diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 15 | ||||
-rw-r--r-- | include/usage.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/include/libbb.h b/include/libbb.h index 07f74e476..3638b7e15 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -524,15 +524,16 @@ extern ssize_t nonblock_safe_read(int fd, void *buf, size_t count); | |||
524 | extern ssize_t full_read(int fd, void *buf, size_t count); | 524 | extern ssize_t full_read(int fd, void *buf, size_t count); |
525 | extern void xread(int fd, void *buf, size_t count); | 525 | extern void xread(int fd, void *buf, size_t count); |
526 | extern unsigned char xread_char(int fd); | 526 | extern unsigned char xread_char(int fd); |
527 | // Read one line a-la fgets. Uses one read(), works only on seekable streams | 527 | // Reads one line a-la fgets (but doesn't save terminating '\n'). |
528 | // Uses single full_read() call, works only on seekable streams. | ||
528 | extern char *reads(int fd, char *buf, size_t count); | 529 | extern char *reads(int fd, char *buf, size_t count); |
529 | // Read one line a-la fgets. Reads byte-by-byte. | 530 | // Reads one line a-la fgets (but doesn't save terminating '\n'). |
530 | // Useful when it is important to not read ahead. | 531 | // Reads byte-by-byte. Useful when it is important to not read ahead. |
531 | // Bytes are appended to pfx (which must be malloced, or NULL). | 532 | // Bytes are appended to pfx (which must be malloced, or NULL). |
532 | extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p); | 533 | extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p); |
533 | extern ssize_t read_close(int fd, void *buf, size_t count); | 534 | extern ssize_t read_close(int fd, void *buf, size_t maxsz); |
534 | extern ssize_t open_read_close(const char *filename, void *buf, size_t count); | 535 | extern ssize_t open_read_close(const char *filename, void *buf, size_t maxsz); |
535 | extern void *xmalloc_open_read_close(const char *filename, size_t *sizep); | 536 | extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p); |
536 | 537 | ||
537 | extern ssize_t safe_write(int fd, const void *buf, size_t count); | 538 | extern ssize_t safe_write(int fd, const void *buf, size_t count); |
538 | // NB: will return short write on error, not -1, | 539 | // NB: will return short write on error, not -1, |
@@ -549,7 +550,7 @@ extern char *xmalloc_fgetline_str(FILE *file, const char *terminating_string); | |||
549 | /* Reads up to (and including) "\n" or NUL byte */ | 550 | /* Reads up to (and including) "\n" or NUL byte */ |
550 | extern char *xmalloc_fgets(FILE *file); | 551 | extern char *xmalloc_fgets(FILE *file); |
551 | /* Chops off '\n' from the end, unlike fgets: */ | 552 | /* Chops off '\n' from the end, unlike fgets: */ |
552 | extern char *xmalloc_getline(FILE *file); | 553 | extern char *xmalloc_fgetline(FILE *file); |
553 | extern char *bb_get_chunk_from_file(FILE *file, int *end); | 554 | extern char *bb_get_chunk_from_file(FILE *file, int *end); |
554 | extern void die_if_ferror(FILE *file, const char *msg); | 555 | extern void die_if_ferror(FILE *file, const char *msg); |
555 | extern void die_if_ferror_stdout(void); | 556 | extern void die_if_ferror_stdout(void); |
diff --git a/include/usage.h b/include/usage.h index f950a0a49..f830fb35c 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -133,6 +133,8 @@ | |||
133 | "\n -f Control pipe (else exit after drawing image)" \ | 133 | "\n -f Control pipe (else exit after drawing image)" \ |
134 | "\n commands: 'NN' (% for progress bar) or 'exit'" \ | 134 | "\n commands: 'NN' (% for progress bar) or 'exit'" \ |
135 | 135 | ||
136 | |||
137 | |||
136 | #define brctl_trivial_usage \ | 138 | #define brctl_trivial_usage \ |
137 | "COMMAND [BRIDGE [INTERFACE]]" | 139 | "COMMAND [BRIDGE [INTERFACE]]" |
138 | #define brctl_full_usage \ | 140 | #define brctl_full_usage \ |