X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Flibbb.h;h=4e1fafcaa4cbe24edd34f99161f49d3cd358f1f3;hb=5a23a432b0a45ff4774a9968895ee87d60e70f03;hp=17f3c25cf905ab581b72e2752bff1d5872dd2908;hpb=8fdd042394b7395c13bee66afb45dd3875c60c63;p=oweals%2Fopkg-lede.git diff --git a/libbb/libbb.h b/libbb/libbb.h index 17f3c25..4e1fafc 100644 --- a/libbb/libbb.h +++ b/libbb/libbb.h @@ -24,24 +24,34 @@ #include #include #include - +#include #include -#include +#include "../libopkg/opkg_message.h" +#ifndef FALSE #define FALSE ((int) 0) +#endif + +#ifndef TRUE #define TRUE ((int) 1) +#endif + +#define error_msg(fmt, args...) opkg_msg(ERROR, fmt"\n", ##args) +#define perror_msg(fmt, args...) opkg_perror(ERROR, fmt, ##args) +#define error_msg_and_die(fmt, args...) \ + do { \ + error_msg(fmt, ##args); \ + exit(EXIT_FAILURE); \ + } while (0) +#define perror_msg_and_die(fmt, args...) \ + do { \ + perror_msg(fmt, ##args); \ + exit(EXIT_FAILURE); \ + } while (0) -extern void error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); -extern void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); -extern void perror_msg(const char *s, ...); -extern void perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn)); extern void archive_xread_all(int fd, char *buf, size_t count); -/* These two are used internally -- you shouldn't need to use them */ -extern void verror_msg(const char *s, va_list p); -extern void vperror_msg(const char *s, va_list p); - const char *mode_string(int mode); const char *time_string(time_t timeVal); @@ -110,7 +120,4 @@ enum { FILEUTILS_FORCE = 8, }; -extern const char *applet_name; -extern const char * const memory_exhausted; - #endif /* __LIBBB_H__ */