tls: in AES-GCM decoding, avoid memmove
[oweals/busybox.git] / include / applets.src.h
1 /* vi: set sw=4 ts=4: */
2 /*
3  * applets.h - a listing of all busybox applets.
4  *
5  * If you write a new applet, you need to add an entry to this list to make
6  * busybox aware of it.
7  */
8
9 /*
10 name  - applet name as it is typed on command line
11 help  - applet name, converted to C (ether-wake: help = ether_wake)
12 main  - corresponding <applet>_main to call (bzcat: main = bunzip2)
13 l     - location to install link to: [/usr]/[s]bin
14 s     - suid type:
15         BB_SUID_REQUIRE: will complain if busybox isn't suid
16         and is run by non-root (applet_main() will not be called at all)
17         BB_SUID_DROP: will drop suid prior to applet_main()
18         BB_SUID_MAYBE: neither of the above
19         (every instance of BB_SUID_REQUIRE and BB_SUID_MAYBE
20         needs to be justified in comment)
21         NB: please update FEATURE_SUID help text whenever you add/remove
22         BB_SUID_REQUIRE or BB_SUID_MAYBE applet.
23 */
24
25 #define NOUSAGE_STR "\b"
26
27 #define dummy_trivial_usage NOUSAGE_STR \
28
29 #define dummy_full_usage "" \
30
31 #if defined(PROTOTYPES)
32 # define APPLET(name,l,s)                    int name##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
33 # define APPLET_ODDNAME(name,main,l,s,help)  int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
34 # define APPLET_NOEXEC(name,main,l,s,help)   int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
35 # define APPLET_NOFORK(name,main,l,s,help)   int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
36 # define APPLET_SCRIPTED(name,main,l,s,help)
37
38 #elif defined(NAME_MAIN)
39 # define APPLET(name,l,s)                    name name##_main
40 # define APPLET_ODDNAME(name,main,l,s,help)  name main##_main
41 # define APPLET_NOEXEC(name,main,l,s,help)   name main##_main
42 # define APPLET_NOFORK(name,main,l,s,help)   name main##_main
43 # define APPLET_SCRIPTED(name,main,l,s,help) name scripted_main
44
45 #elif defined(MAKE_USAGE) && ENABLE_FEATURE_VERBOSE_USAGE
46 # define APPLET(name,l,s)                    MAKE_USAGE(#name, name##_trivial_usage name##_full_usage)
47 # define APPLET_ODDNAME(name,main,l,s,help)  MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
48 # define APPLET_NOEXEC(name,main,l,s,help)   MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
49 # define APPLET_NOFORK(name,main,l,s,help)   MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
50 # define APPLET_SCRIPTED(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
51
52 #elif defined(MAKE_USAGE) && !ENABLE_FEATURE_VERBOSE_USAGE
53 # define APPLET(name,l,s)                    MAKE_USAGE(#name, name##_trivial_usage)
54 # define APPLET_ODDNAME(name,main,l,s,help)  MAKE_USAGE(#name, help##_trivial_usage)
55 # define APPLET_NOEXEC(name,main,l,s,help)   MAKE_USAGE(#name, help##_trivial_usage)
56 # define APPLET_NOFORK(name,main,l,s,help)   MAKE_USAGE(#name, help##_trivial_usage)
57 # define APPLET_SCRIPTED(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
58
59 #elif defined(MAKE_LINKS)
60 # define APPLET(name,l,c)                    LINK l name
61 # define APPLET_ODDNAME(name,main,l,s,help)  LINK l name
62 # define APPLET_NOEXEC(name,main,l,s,help)   LINK l name
63 # define APPLET_NOFORK(name,main,l,s,help)   LINK l name
64 # define APPLET_SCRIPTED(name,main,l,s,help) LINK l name
65
66 #elif defined(MAKE_SUID)
67 # define APPLET(name,l,s)                    SUID s l name
68 # define APPLET_ODDNAME(name,main,l,s,help)  SUID s l name
69 # define APPLET_NOEXEC(name,main,l,s,help)   SUID s l name
70 # define APPLET_NOFORK(name,main,l,s,help)   SUID s l name
71 # define APPLET_SCRIPTED(name,main,l,s,help) SUID s l name
72
73 #elif defined(MAKE_SCRIPTS)
74 # define APPLET(name,l,s)
75 # define APPLET_ODDNAME(name,main,l,s,help)
76 # define APPLET_NOEXEC(name,main,l,s,help)
77 # define APPLET_NOFORK(name,main,l,s,help)
78 # define APPLET_SCRIPTED(name,main,l,s,help) SCRIPT name
79
80 #else
81   static struct bb_applet applets[] = { /*    name, main, location, need_suid */
82 # define APPLET(name,l,s)                    { #name, #name, l, s },
83 # define APPLET_ODDNAME(name,main,l,s,help)  { #name, #main, l, s },
84 # define APPLET_NOEXEC(name,main,l,s,help)   { #name, #main, l, s, 1 },
85 # define APPLET_NOFORK(name,main,l,s,help)   { #name, #main, l, s, 1, 1 },
86 # define APPLET_SCRIPTED(name,main,l,s,help) { #name, #main, l, s },
87 #endif
88
89 #if ENABLE_INSTALL_NO_USR
90 # define BB_DIR_USR_BIN BB_DIR_BIN
91 # define BB_DIR_USR_SBIN BB_DIR_SBIN
92 #endif
93
94
95 INSERT
96
97
98 #if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \
99         && !defined(MAKE_LINKS) && !defined(MAKE_SUID)
100 };
101 #endif
102
103 #undef APPLET
104 #undef APPLET_ODDNAME
105 #undef APPLET_NOEXEC
106 #undef APPLET_NOFORK
107 #undef APPLET_SCRIPTED