Fix up some silly macros and use xmalloc and friends exclusively.
[oweals/busybox.git] / busybox.h
index 692a9084e5ab8a58c74e1b5f9761a30c104b3e8a..99932095bd609735616711e78d2c744bac57e0f1 100644 (file)
--- a/busybox.h
+++ b/busybox.h
@@ -89,10 +89,10 @@ extern const struct BB_applet applets[];
 extern const char *applet_name;
 
 extern void show_usage(void) __attribute__ ((noreturn));
-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, ...) __attribute__ ((format (printf, 1, 2)));
-extern void perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
+extern void error_msg(const char *s, ...);
+extern void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn));
+extern void perror_msg(const char *s, ...);
+extern void perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn));
 
 const char *mode_string(int mode);
 const char *time_string(time_t timeVal);
@@ -175,11 +175,11 @@ extern unsigned long parse_number(const char *numstr,
 /* These parse entries in /etc/passwd and /etc/group.  This is desirable
  * for BusyBox since we want to avoid using the glibc NSS stuff, which
  * increases target size and is often not needed embedded systems.  */
-extern long my_getpwnam(char *name);
-extern long my_getgrnam(char *name);
+extern long my_getpwnam(const char *name);
+extern long my_getgrnam(const char *name);
 extern void my_getpwuid(char *name, long uid);
 extern void my_getgrgid(char *group, long gid);
-extern long my_getpwnamegid(char *name);
+extern long my_getpwnamegid(const char *name);
 
 extern int device_open(char *device, int mode);
 
@@ -234,10 +234,10 @@ extern int sysinfo (struct sysinfo* info);
 
 #ifdef BB_FEATURE_HUMAN_READABLE
 const char *format(unsigned long val, unsigned long hr);
+#endif
 #define KILOBYTE 1024
 #define MEGABYTE (KILOBYTE*1024)
 #define GIGABYTE (MEGABYTE*1024)
-#endif
 
 #ifdef BB_FEATURE_BUFFERS_GO_ON_STACK
 #define RESERVE_BB_BUFFER(buffer,len)           char buffer[len]