/* Get line, remove trailing \n */ char* FAST_FUNC xmalloc_fgetline_fast(FILE *file) { int sz; char *r = xmalloc_fgets_internal(file, &sz); if (r && r[sz - 1] == '\n') r[--sz] = '\0'; return r; /* not xrealloc(r, sz + 1)! */ }
/* Get line, remove trailing \n */ char* FAST_FUNC xmalloc_fgetline(FILE *file) { int sz; char *r = xmalloc_fgets_internal(file, &sz); if (!r) return r; if (r[sz - 1] == '\n') r[--sz] = '\0'; return xrealloc(r, sz + 1); }
char* FAST_FUNC xmalloc_fgets(FILE *file) { int sz; return xmalloc_fgets_internal(file, &sz); }
char* FAST_FUNC xmalloc_fgetline_str(FILE *file, const char *terminating_string) { return xmalloc_fgets_internal(file, terminating_string, 1); }