aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 1c54a32d5..f9f28f983 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -556,7 +556,10 @@ extern char *reads(int fd, char *buf, size_t count);
556extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p); 556extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p);
557extern ssize_t read_close(int fd, void *buf, size_t maxsz); 557extern ssize_t read_close(int fd, void *buf, size_t maxsz);
558extern ssize_t open_read_close(const char *filename, void *buf, size_t maxsz); 558extern ssize_t open_read_close(const char *filename, void *buf, size_t maxsz);
559/* Returns NULL if file can't be opened */
559extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p); 560extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p);
561/* Never returns NULL */
562extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p);
560 563
561extern ssize_t safe_write(int fd, const void *buf, size_t count); 564extern ssize_t safe_write(int fd, const void *buf, size_t count);
562// NB: will return short write on error, not -1, 565// NB: will return short write on error, not -1,
@@ -568,9 +571,9 @@ extern void xwrite(int fd, const void *buf, size_t count);
568extern void xprint_and_close_file(FILE *file); 571extern void xprint_and_close_file(FILE *file);
569/* Reads up to (and including) TERMINATING_STRING: */ 572/* Reads up to (and including) TERMINATING_STRING: */
570extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string); 573extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string);
571/* Chops off TERMINATING_STRING: from the end: */ 574/* Chops off TERMINATING_STRING from the end: */
572extern char *xmalloc_fgetline_str(FILE *file, const char *terminating_string); 575extern char *xmalloc_fgetline_str(FILE *file, const char *terminating_string);
573/* Reads up to (and including) "\n" or NUL byte */ 576/* Reads up to (and including) "\n" or NUL byte: */
574extern char *xmalloc_fgets(FILE *file); 577extern char *xmalloc_fgets(FILE *file);
575/* Chops off '\n' from the end, unlike fgets: */ 578/* Chops off '\n' from the end, unlike fgets: */
576extern char *xmalloc_fgetline(FILE *file); 579extern char *xmalloc_fgetline(FILE *file);