diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-12-08 20:20:03 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-12-08 20:20:03 (EST) |
commit | 2fdb3fc0b67757afd6fe7a244b6e14d2a546af0e (patch) | |
tree | a5e28a26a07e429a753f29945cc8ba9c4f6c9884 /libbb/libbb.h | |
parent | e4a49209222ea7385f64e9336425df115a3ea1a3 (diff) |
Merge commit 'grg' into HEAD
git-svn-id: http://opkg.googlecode.com/svn/trunk@471 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libbb/libbb.h')
-rw-r--r-- | libbb/libbb.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libbb/libbb.h b/libbb/libbb.h index 619b400..4e1fafc 100644 --- a/libbb/libbb.h +++ b/libbb/libbb.h @@ -24,10 +24,10 @@ #include <stdarg.h> #include <sys/stat.h> #include <sys/types.h> - +#include <stdlib.h> #include <netdb.h> -#include <features.h> +#include "../libopkg/opkg_message.h" #ifndef FALSE #define FALSE ((int) 0) @@ -37,15 +37,20 @@ #define TRUE ((int) 1) #endif -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); +#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) -/* 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); +extern void archive_xread_all(int fd, char *buf, size_t count); const char *mode_string(int mode); const char *time_string(time_t timeVal); @@ -115,7 +120,4 @@ enum { FILEUTILS_FORCE = 8, }; -extern const char *applet_name; -extern const char * const memory_exhausted; - #endif /* __LIBBB_H__ */ |