1 /* vi: set sw=4 ts=4: */
3 * Busybox main internal header file
5 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
7 #ifndef _BB_INTERNAL_H_
8 #define _BB_INTERNAL_H_ 1
10 #include "bb_config.h"
15 #include <sys/types.h>
18 #if __GNU_LIBRARY__ < 5 && \
19 !defined(__dietlibc__) && \
20 !defined(_NEWLIB_VERSION)
21 #error "Sorry, this libc version is not supported :("
24 #ifndef BB_EXTRA_VERSION
25 #define BB_BANNER "BusyBox v" BB_VER " (" BB_BT ")"
27 #define BB_BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")"
32 /* Pull in the utility routines from libbb */
51 int (*main) (int argc, char **argv);
52 __extension__ enum Location location:4;
53 __extension__ enum SUIDRoot need_suid:4;
57 extern const struct BB_applet applets[];
59 /* Automagically pull in all the applet function prototypes and
60 * applet usage strings. These are all of the form:
61 * extern int foo_main(int argc, char **argv);
62 * extern const char foo_usage[];
63 * These are all autogenerated from the set of currently defined applets.
69 #ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
70 #define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
71 #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
72 #define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
74 #ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
75 #define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
76 #define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
77 #define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
79 #define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
80 #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
81 #define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
87 /* Stop system and switch power off if possible. */
88 #define RB_POWER_OFF 0x4321fedc
91 /* Try to pull in PATH_MAX */
94 /* for PATH_MAX on systems that don't have it in limits.h */
95 #include <sys/param.h>
104 #endif /* _BB_INTERNAL_H_ */