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 extern const char BB_BANNER[];
28 /* Pull in the utility routines from libbb */
47 int (*main) (int argc, char **argv);
48 __extension__ enum Location location:4;
49 __extension__ enum SUIDRoot need_suid:4;
53 extern const struct BB_applet applets[];
55 /* Automagically pull in all the applet function prototypes and
56 * applet usage strings. These are all of the form:
57 * extern int foo_main(int argc, char **argv);
58 * extern const char foo_usage[];
59 * These are all autogenerated from the set of currently defined applets.
65 #ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
66 #define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
67 #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
68 #define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
70 #ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
71 #define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
72 #define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
73 #define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
75 #define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
76 #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
77 #define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
83 /* Stop system and switch power off if possible. */
84 #define RB_POWER_OFF 0x4321fedc
87 /* Try to pull in PATH_MAX */
90 /* for PATH_MAX on systems that don't have it in limits.h */
91 #include <sys/param.h>
100 #endif /* _BB_INTERNAL_H_ */