X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Flibbb.h;h=d94dd598eaa45719c65b23ee5a99f776a11f8fca;hb=a5b3e76c38371c2c5781c11cfe5980aeb041e034;hp=fcd0dfa31a9e48463c4d53932f96d34be1b7a928;hpb=9f739445cd3deddd0343c3a8d5a981ede26bef30;p=oweals%2Fbusybox.git diff --git a/include/libbb.h b/include/libbb.h index fcd0dfa31..d94dd598e 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -159,7 +159,7 @@ #endif -#if (__GLIBC__ < 2) +#if defined(__GLIBC__) && __GLIBC__ < 2 int vdprintf(int d, const char *format, va_list ap); #endif // This is declared here rather than #including in order to avoid @@ -203,11 +203,17 @@ extern int recursive_action(const char *fileName, int recurse, extern int device_open(const char *device, int mode); extern int get_console_fd(void); extern char *find_block_device(char *path); -extern off_t bb_copyfd_size(int fd1, int fd2, off_t size); +/* bb_copyfd_XX print read/write errors and return -1 if they occur */ extern off_t bb_copyfd_eof(int fd1, int fd2); +extern off_t bb_copyfd_size(int fd1, int fd2, off_t size); +extern void bb_copyfd_exact_size(int fd1, int fd2, off_t size); +/* "short" copy can be detected by return value < size */ +/* this helper yells "short read!" if param is not -1 */ +extern void complain_copyfd_and_die(off_t sz) ATTRIBUTE_NORETURN; extern char bb_process_escape_sequence(const char **ptr); extern char *bb_get_last_path_component(char *path); extern int ndelay_on(int fd); +extern int ndelay_off(int fd); extern DIR *xopendir(const char *path); @@ -263,6 +269,8 @@ extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, //int NOT_LONE_DASH(const char *s) { return s[0] != '-' || s[1]; } #define LONE_DASH(s) ((s)[0] == '-' && !(s)[1]) #define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) +#define LONE_CHAR(s,c) ((s)[0] == (c) && !(s)[1]) +#define NOT_LONE_CHAR(s,c) ((s)[0] != (c) || (s)[1]) /* dmalloc will redefine these to it's own implementation. It is safe * to have the prototypes here unconditionally. */ @@ -386,7 +394,9 @@ extern void bb_vperror_msg(const char *s, va_list p); extern void bb_vinfo_msg(const char *s, va_list p); -extern int bb_echo(int argc, char** argv); +/* applets which are useful from another applets */ +extern int bb_cat(char** argv); +extern int bb_echo(char** argv); extern int bb_test(int argc, char** argv); #ifndef BUILD_INDIVIDUAL