Patch from Rob Sullivan to consolidate crc32 table generation.
[oweals/busybox.git] / include / busybox.h
1 /* vi: set sw=4 ts=4: */
2 /*
3  * Busybox main internal header file
4  *
5  * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6  */
7 #ifndef _BB_INTERNAL_H_
8 #define _BB_INTERNAL_H_    1
9
10 #include "bb_config.h"
11
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <stdarg.h>
15 #include <sys/types.h>
16 #include <sys/stat.h>
17
18 #if __GNU_LIBRARY__ < 5 && \
19     !defined(__dietlibc__) && \
20     !defined(_NEWLIB_VERSION)
21 #error "Sorry, this libc version is not supported :("
22 #endif
23
24 extern const char BB_BANNER[];
25
26 #include <features.h>
27
28 /* Pull in the utility routines from libbb */
29 #include "libbb.h"
30
31 enum Location {
32         _BB_DIR_ROOT = 0,
33         _BB_DIR_BIN,
34         _BB_DIR_SBIN,
35         _BB_DIR_USR_BIN,
36         _BB_DIR_USR_SBIN
37 };
38
39 enum SUIDRoot {
40         _BB_SUID_NEVER = 0,
41         _BB_SUID_MAYBE,
42         _BB_SUID_ALWAYS
43 };
44
45 struct BB_applet {
46         const char *name;
47         int (*main) (int argc, char **argv);
48         __extension__ enum Location location:4;
49         __extension__ enum SUIDRoot need_suid:4;
50 };
51
52 /* From busybox.c */
53 extern const struct BB_applet applets[];
54
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.
60  */
61 #define PROTOTYPES
62 #include "applets.h"
63 #undef PROTOTYPES
64
65 #ifndef RB_POWER_OFF
66 /* Stop system and switch power off if possible.  */
67 #define RB_POWER_OFF   0x4321fedc
68 #endif
69
70 /* Try to pull in PATH_MAX */
71 #include <limits.h>
72
73 /* for PATH_MAX on systems that don't have it in limits.h */
74 #include <sys/param.h>
75 #ifndef PATH_MAX
76 #define  PATH_MAX         256
77 #endif
78
79 #ifdef DMALLOC
80 #include <dmalloc.h>
81 #endif
82
83 #endif                                                  /* _BB_INTERNAL_H_ */