Improve STANDALONE_SHELL. "safe" applets are renamed NOEXEC applets
[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 "libbb.h"
11
12 /* order matters: used as index into "install_dir[]" in busybox.c */
13 enum Location {
14         _BB_DIR_ROOT = 0,
15         _BB_DIR_BIN,
16         _BB_DIR_SBIN,
17         _BB_DIR_USR_BIN,
18         _BB_DIR_USR_SBIN
19 };
20
21 enum SUIDRoot {
22         _BB_SUID_NEVER = 0,
23         _BB_SUID_MAYBE,
24         _BB_SUID_ALWAYS
25 };
26
27 struct BB_applet {
28         const char *name;
29         int (*main) (int argc, char **argv);
30         __extension__ enum Location location:8;
31         __extension__ enum SUIDRoot need_suid:8;
32         /* true if instead if fork(); exec("applet"); waitpid();
33          * one can do fork(); exit(applet_main(argc,argv)); waitpid(); */
34         unsigned char noexec;
35         /* Even nicer */
36         /* true if instead if fork(); exec("applet"); waitpid();
37          * one can simply call applet_main(argc,argv); */
38         unsigned char nofork;
39 };
40
41 /* Defined in applet.c */
42 extern const struct BB_applet applets[];
43 extern const unsigned short NUM_APPLETS;
44
45 #endif  /* _BB_INTERNAL_H_ */