X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fx.h;h=b3384af43d93b37aad0a96523cef97d2f616ab66;hp=45bf6a9c4fa618696a0a7c59d174e9cf5197991b;hb=15672ac8305a1c5ba0d9bf6edabb0a194c30628e;hpb=80c3009d01077a141a0803267a1f0aff217ed61c diff --git a/src/x.h b/src/x.h index 45bf6a9..b3384af 100644 --- a/src/x.h +++ b/src/x.h @@ -22,6 +22,8 @@ #ifndef _X_H_ #define _X_H_ +#include "ttt.h" + void xasprintf (char **strp, const char *fmt, ...) TTT_PRINTF_FORMAT(2, 3); @@ -46,10 +48,38 @@ xrealloc (void *ptr, size_t size); FILE * xfdopen (int filedes, const char *mode); +void +xfreopen (const char *path, const char *mode, FILE *stream); + char * xstrdup (const char *s); void xfwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream); +int +xsocket (int domain, int type, int protocol); + +void +xbind (int sockfd, const struct sockaddr *my_addr, socklen_t addrlen); + +void +xlisten (int s, int backlog); + +int +xfcntl (int fd, int cmd, long arg); + +int +xselect (int n, + fd_set *readfds, + fd_set *writefds, + fd_set *exceptfds, + struct timeval *timeout); + +ssize_t +xread (int fd, void *buf, size_t count); + +ssize_t +xwrite (int fd, const void *buf, size_t count); + #endif /* _X_H_ */