diff options
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -26,6 +26,7 @@ #include <regex.h> #include <stdbool.h> #include <stddef.h> +#include <stdio.h> #include <sys/types.h> // Some portability concerns @@ -274,4 +275,17 @@ size_t xwrite(int fd, const void *buf, size_t nbytes); */ char *xconfstr(int name); +/** + * Convenience wrapper for getdelim(). + * + * @param file + * The file to read. + * @param delim + * The delimiter character to split on. + * @return + * The read chunk (without the delimiter), allocated with malloc(). + * NULL is returned on error (errno != 0) or end of file (errno == 0). + */ +char *xgetdelim(FILE *file, char delim); + #endif // BFS_UTIL_H |