diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-08 17:30:10 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-08 17:30:10 +0000 |
commit | 786834bcee178ea6c05aa57869337f03678d02dc (patch) | |
tree | 7c9384702688dad91c4ac220517b41c1ecced26c | |
parent | 240a1cfbbe6cf42e8013ce06cb567b3f28c8727f (diff) | |
download | busybox-w32-786834bcee178ea6c05aa57869337f03678d02dc.tar.gz busybox-w32-786834bcee178ea6c05aa57869337f03678d02dc.tar.bz2 busybox-w32-786834bcee178ea6c05aa57869337f03678d02dc.zip |
applets.h: de-obfuscate
-rw-r--r-- | include/applets.h | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/include/applets.h b/include/applets.h index 00d3aee1e..0ead89db8 100644 --- a/include/applets.h +++ b/include/applets.h | |||
@@ -15,41 +15,50 @@ | |||
15 | #undef APPLET_ODDNAME | 15 | #undef APPLET_ODDNAME |
16 | #undef APPLET_NOUSAGE | 16 | #undef APPLET_NOUSAGE |
17 | 17 | ||
18 | /* | ||
19 | name - applet name as it is typed on command line | ||
20 | name2 - applet name, converted to C (ether-wake: name2 = ether_wake) | ||
21 | main - <applet>_main part (e.g. for bzcat: main = bunzip2) | ||
22 | l - location ([/usr]/[s]bin) | ||
23 | s - suid type: | ||
24 | _BB_SUID_ALWAYS: will complain if busybox isn't suid | ||
25 | and is run by non-root (applet_main() will not be called at all) | ||
26 | _BB_SUID_NEVER: will drop suid prior to applet_main() | ||
27 | _BB_SUID_MAYBE: neither of the above | ||
28 | */ | ||
29 | |||
18 | #if defined(PROTOTYPES) | 30 | #if defined(PROTOTYPES) |
19 | # define APPLET(a,b,c) extern int a##_main(int argc, char **argv); | 31 | # define APPLET(name,l,s) int name##_main(int argc, char **argv); |
20 | # define APPLET_NOUSAGE(a,b,c,d) extern int b##_main(int argc, char **argv); | 32 | # define APPLET_NOUSAGE(name,main,l,s) int main##_main(int argc, char **argv); |
21 | # define APPLET_ODDNAME(a,b,c,d,e) extern int b##_main(int argc, char **argv); | 33 | # define APPLET_ODDNAME(name,main,l,s,name2) int main##_main(int argc, char **argv); |
22 | #elif defined(MAKE_USAGE) | 34 | |
23 | # ifdef CONFIG_FEATURE_VERBOSE_USAGE | 35 | #elif defined(MAKE_USAGE) && ENABLE_FEATURE_VERBOSE_USAGE |
24 | # define APPLET(a,b,c) a##_trivial_usage "\n\n" a##_full_usage "\0" | 36 | # define APPLET(name,l,s) name##_trivial_usage "\n\n" name##_full_usage "\0" |
25 | # define APPLET_NOUSAGE(a,b,c,d) "\b\0" | 37 | # define APPLET_NOUSAGE(name,main,l,s) "\b\0" |
26 | # define APPLET_ODDNAME(a,b,c,d,e) e##_trivial_usage "\n\n" e##_full_usage "\0" | 38 | # define APPLET_ODDNAME(name,main,l,s,name2) name2##_trivial_usage "\n\n" name2##_full_usage "\0" |
27 | # else | 39 | |
28 | # define APPLET(a,b,c) a##_trivial_usage "\0" | 40 | #elif defined(MAKE_USAGE) && !ENABLE_FEATURE_VERBOSE_USAGE |
29 | # define APPLET_NOUSAGE(a,b,c,d) "\b\0" | 41 | # define APPLET(name,l,s) name##_trivial_usage "\0" |
30 | # define APPLET_ODDNAME(a,b,c,d,e) e##_trivial_usage "\0" | 42 | # define APPLET_NOUSAGE(name,main,l,s) "\b\0" |
31 | # endif | 43 | # define APPLET_ODDNAME(name,main,l,s,name2) name2##_trivial_usage "\0" |
44 | |||
32 | #elif defined(MAKE_LINKS) | 45 | #elif defined(MAKE_LINKS) |
33 | # define APPLET(a,b,c) LINK b a | 46 | # define APPLET(name,l,c) LINK l name |
34 | # define APPLET_NOUSAGE(a,b,c,d) LINK c a | 47 | # define APPLET_NOUSAGE(name,main,l,s) LINK l name |
35 | # define APPLET_ODDNAME(a,b,c,d,e) LINK c a | 48 | # define APPLET_ODDNAME(name,main,l,s,name2) LINK l name |
49 | |||
36 | #else | 50 | #else |
37 | const struct BB_applet applets[] = { | 51 | const struct BB_applet applets[] = { /* name,main,location,need_suid */ |
38 | # define APPLET(a,b,c) {#a,a##_main,b,c}, | 52 | # define APPLET(name,l,s) {#name,name##_main,l,s}, |
39 | # define APPLET_NOUSAGE(a,b,c,d) {#a,b##_main,c,d}, | 53 | # define APPLET_NOUSAGE(name,main,l,s) {#name,main##_main,l,s}, |
40 | # define APPLET_ODDNAME(a,b,c,d,e) {#a,b##_main,c,d}, | 54 | # define APPLET_ODDNAME(name,main,l,s,name2) {#name,main##_main,l,s}, |
41 | #endif | 55 | #endif |
42 | 56 | ||
43 | #ifdef CONFIG_INSTALL_NO_USR | 57 | #if ENABLE_INSTALL_NO_USR |
44 | # define _BB_DIR_USR_BIN _BB_DIR_BIN | 58 | # define _BB_DIR_USR_BIN _BB_DIR_BIN |
45 | # define _BB_DIR_USR_SBIN _BB_DIR_SBIN | 59 | # define _BB_DIR_USR_SBIN _BB_DIR_SBIN |
46 | #endif | 60 | #endif |
47 | 61 | ||
48 | // _BB_SUID_ALWAYS: will complain if busybox isn't suid | ||
49 | // and is run by non-root (applet_main() will not be called at all) | ||
50 | // _BB_SUID_NEVER: will drop suid prior to applet_main() | ||
51 | // _BB_SUID_MAYBE: neither of the above | ||
52 | |||
53 | USE_TEST(APPLET_NOUSAGE([, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 62 | USE_TEST(APPLET_NOUSAGE([, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
54 | USE_TEST(APPLET_NOUSAGE([[, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 63 | USE_TEST(APPLET_NOUSAGE([[, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
55 | USE_ADDGROUP(APPLET(addgroup, _BB_DIR_BIN, _BB_SUID_NEVER)) | 64 | USE_ADDGROUP(APPLET(addgroup, _BB_DIR_BIN, _BB_SUID_NEVER)) |