1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#if defined(PROTOTYPES)
26# define APPLET(name,l,s) int name##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
27# define APPLET_ODDNAME(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
28# define APPLET_NOEXEC(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
29# define APPLET_NOFORK(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
30# define APPLET_SCRIPTED(name,main,l,s,help)
31
32#elif defined(NAME_MAIN)
33# define APPLET(name,l,s) name name##_main
34# define APPLET_ODDNAME(name,main,l,s,help) name main##_main
35# define APPLET_NOEXEC(name,main,l,s,help) name main##_main
36# define APPLET_NOFORK(name,main,l,s,help) name main##_main
37# define APPLET_SCRIPTED(name,main,l,s,help) name scripted_main
38
39#elif defined(MAKE_USAGE) && ENABLE_FEATURE_VERBOSE_USAGE
40# define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage name##_full_usage)
41# define APPLET_ODDNAME(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
42# define APPLET_NOEXEC(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
43# define APPLET_NOFORK(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
44# define APPLET_SCRIPTED(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
45
46#elif defined(MAKE_USAGE) && !ENABLE_FEATURE_VERBOSE_USAGE
47# define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage)
48# define APPLET_ODDNAME(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
49# define APPLET_NOEXEC(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
50# define APPLET_NOFORK(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
51# define APPLET_SCRIPTED(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
52
53#elif defined(MAKE_LINKS)
54# define APPLET(name,l,c) LINK l name
55# define APPLET_ODDNAME(name,main,l,s,help) LINK l name
56# define APPLET_NOEXEC(name,main,l,s,help) LINK l name
57# define APPLET_NOFORK(name,main,l,s,help) LINK l name
58# define APPLET_SCRIPTED(name,main,l,s,help) LINK l name
59
60#elif defined(MAKE_SUID)
61# define APPLET(name,l,s) SUID s l name
62# define APPLET_ODDNAME(name,main,l,s,help) SUID s l name
63# define APPLET_NOEXEC(name,main,l,s,help) SUID s l name
64# define APPLET_NOFORK(name,main,l,s,help) SUID s l name
65# define APPLET_SCRIPTED(name,main,l,s,help) SUID s l name
66
67#elif defined(MAKE_SCRIPTS)
68# define APPLET(name,l,s)
69# define APPLET_ODDNAME(name,main,l,s,help)
70# define APPLET_NOEXEC(name,main,l,s,help)
71# define APPLET_NOFORK(name,main,l,s,help)
72# define APPLET_SCRIPTED(name,main,l,s,help) SCRIPT name
73
74#else
75 static struct bb_applet applets[] = {
76# define APPLET(name,l,s) { #name, #name, l, s },
77# define APPLET_ODDNAME(name,main,l,s,help) { #name, #main, l, s },
78# define APPLET_NOEXEC(name,main,l,s,help) { #name, #main, l, s, 1 },
79# define APPLET_NOFORK(name,main,l,s,help) { #name, #main, l, s, 1, 1 },
80# define APPLET_SCRIPTED(name,main,l,s,help) { #name, #main, l, s },
81#endif
82
83#if ENABLE_INSTALL_NO_USR
84# define BB_DIR_USR_BIN BB_DIR_BIN
85# define BB_DIR_USR_SBIN BB_DIR_SBIN
86#endif
87
88
89INSERT
90
91
92#if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \
93 && !defined(MAKE_LINKS) && !defined(MAKE_SUID)
94};
95#endif
96
97#undef APPLET
98#undef APPLET_ODDNAME
99#undef APPLET_NOEXEC
100#undef APPLET_NOFORK
101#undef APPLET_SCRIPTED
102