Removed files, reorganized code i.e. renamed write_or_die.c to xutils.c
[transsip.git] / src / xutils.h
blob21584a8de2c74d82686aeed76f4921dd2cf916a0
1 /*
2 * transsip - the telephony network
3 * By Daniel Borkmann <daniel@transsip.org>
4 * Copyright 2011 Daniel Borkmann.
5 * Subject to the GPL, version 2.
6 */
8 #ifndef XUTILS_H
9 #define XUTILS_H
11 #include <sys/types.h>
13 extern void fsync_or_die(int fd, const char *msg);
14 extern int open_or_die(const char *file, int flags);
15 extern int open_or_die_m(const char *file, int flags, mode_t mode);
16 extern ssize_t read_or_die(int fd, void *buf, size_t count);
17 extern ssize_t read_exact(int fd, void *buf, size_t len, int mayexit);
18 extern ssize_t write_exact(int fd, void *buf, size_t len, int mayexit);
19 extern ssize_t write_or_die(int fd, const void *buf, size_t count);
20 extern ssize_t write_or_whine_pipe(int fd, const void *buf, size_t len,
21 const char *msg);
22 extern ssize_t write_or_whine(int fd, const void *buf, size_t len,
23 const char *msg);
24 extern size_t strlcpy(char *dest, const char *src, size_t size);
25 extern int slprintf(char *dst, size_t size, const char *fmt, ...);
26 extern char **strntoargv(char *str, size_t len, int *argc);
28 #endif /* XUTILS_H */