4bd8b79e4f3d86b435c2267918acd13a5a88f47d
[oweals/busybox.git] / include / applets.h
1 /*
2  * applets.h - a listing of all busybox applets.
3  *
4  * If you write a new applet, you need to add an entry to this list to make
5  * busybox aware of it.
6  *
7  * It is CRUCIAL that this listing be kept in ascii order, otherwise the binary
8  * search lookup contributed by Gaute B Strokkenes stops working. If you value
9  * your kneecaps, you'll be sure to *make sure* that any changes made to this
10  * file result in the listing remaining in ascii order. You have been warned.
11  */
12
13 #if defined(PROTOTYPES)
14 #define APPLET(a,b,c,d) \
15         extern int b(int argc, char **argv); \
16         extern const char d[];
17 #define APPLET_NOUSAGE(a,b,c) \
18         extern int b(int argc, char **argv);
19 #elif defined(MAKE_LINKS)
20 #define APPLET(a,b,c,d) LINK c a
21 #define APPLET_NOUSAGE(a,b,c) LINK c a
22 #else
23 const struct BB_applet applets[] = {
24 #define APPLET(a,b,c,d) {a,b,c,d},
25 #define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL},
26 #endif
27
28 #ifdef BB_TEST
29         APPLET("[", test_main, _BB_DIR_USR_BIN, test_usage)
30 #endif
31 #ifdef BB_AR
32         APPLET("ar", ar_main, _BB_DIR_USR_BIN, ar_usage)
33 #endif
34 #ifdef BB_BASENAME
35         APPLET("basename", basename_main, _BB_DIR_USR_BIN, basename_usage)
36 #endif
37         APPLET_NOUSAGE("busybox", busybox_main, _BB_DIR_BIN)
38 #ifdef BB_CAT
39         APPLET("cat", cat_main, _BB_DIR_BIN, cat_usage)
40 #endif
41 #ifdef BB_CHMOD_CHOWN_CHGRP
42         APPLET("chgrp", chmod_chown_chgrp_main, _BB_DIR_BIN, chgrp_usage)
43 #endif
44 #ifdef BB_CHMOD_CHOWN_CHGRP
45         APPLET("chmod", chmod_chown_chgrp_main, _BB_DIR_BIN, chmod_usage)
46 #endif
47 #ifdef BB_CHMOD_CHOWN_CHGRP
48         APPLET("chown", chmod_chown_chgrp_main, _BB_DIR_BIN, chown_usage)
49 #endif
50 #ifdef BB_CHROOT
51         APPLET("chroot", chroot_main, _BB_DIR_USR_SBIN, chroot_usage)
52 #endif
53 #ifdef BB_CHVT
54         APPLET("chvt", chvt_main, _BB_DIR_USR_BIN, chvt_usage)
55 #endif
56 #ifdef BB_CLEAR
57         APPLET("clear", clear_main, _BB_DIR_USR_BIN, clear_usage)
58 #endif
59 #ifdef BB_CMP
60         APPLET("cmp", cmp_main, _BB_DIR_USR_BIN, cmp_usage)
61 #endif
62 #ifdef BB_CP_MV
63         APPLET("cp", cp_mv_main, _BB_DIR_BIN, cp_usage)
64 #endif
65 #ifdef BB_CUT
66         APPLET("cut", cut_main, _BB_DIR_USR_BIN, cut_usage)
67 #endif
68 #ifdef BB_DATE
69         APPLET("date", date_main, _BB_DIR_BIN, date_usage)
70 #endif
71 #ifdef BB_DC
72         APPLET("dc", dc_main, _BB_DIR_USR_BIN, dc_usage)
73 #endif
74 #ifdef BB_DD
75         APPLET("dd", dd_main, _BB_DIR_BIN, dd_usage)
76 #endif
77 #ifdef BB_DEALLOCVT
78         APPLET("deallocvt", deallocvt_main, _BB_DIR_USR_BIN, deallocvt_usage)
79 #endif
80 #ifdef BB_DF
81         APPLET("df", df_main, _BB_DIR_BIN, df_usage)
82 #endif
83 #ifdef BB_DIRNAME
84         APPLET("dirname", dirname_main, _BB_DIR_USR_BIN, dirname_usage)
85 #endif
86 #ifdef BB_DMESG
87         APPLET("dmesg", dmesg_main, _BB_DIR_BIN, dmesg_usage)
88 #endif
89 #ifdef BB_DOS2UNIX
90         APPLET("dos2unix", dos2unix_main, _BB_DIR_USR_BIN, dos2unix_usage)
91 #endif
92 #ifdef BB_DPKG
93         APPLET("dpkg", dpkg_main, _BB_DIR_USR_BIN, dpkg_usage)
94 #endif
95 #ifdef BB_DPKG_DEB
96         APPLET("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage)
97 #endif
98 #ifdef BB_DU
99         APPLET("du", du_main, _BB_DIR_USR_BIN, du_usage)
100 #endif
101 #ifdef BB_DUMPKMAP
102         APPLET("dumpkmap", dumpkmap_main, _BB_DIR_BIN, dumpkmap_usage)
103 #endif
104 #ifdef BB_DUTMP
105         APPLET("dutmp", dutmp_main, _BB_DIR_USR_SBIN, dutmp_usage)
106 #endif
107 #ifdef BB_ECHO
108         APPLET("echo", echo_main, _BB_DIR_BIN, echo_usage)
109 #endif
110 #ifdef BB_EXPR
111         APPLET("expr", expr_main, _BB_DIR_USR_BIN, expr_usage)
112 #endif
113 #ifdef BB_TRUE_FALSE
114         APPLET("false", false_main, _BB_DIR_BIN, false_usage)
115 #endif
116 #ifdef BB_FBSET
117         APPLET_NOUSAGE("fbset", fbset_main, _BB_DIR_USR_SBIN)
118 #endif
119 #ifdef BB_FDFLUSH
120         APPLET("fdflush", fdflush_main, _BB_DIR_BIN, fdflush_usage)
121 #endif
122 #ifdef BB_FIND
123         APPLET("find", find_main, _BB_DIR_USR_BIN, find_usage)
124 #endif
125 #ifdef BB_FREE
126         APPLET("free", free_main, _BB_DIR_USR_BIN, free_usage)
127 #endif
128 #ifdef BB_FREERAMDISK
129         APPLET("freeramdisk", freeramdisk_main, _BB_DIR_SBIN, freeramdisk_usage)
130 #endif
131 #ifdef BB_FSCK_MINIX
132         APPLET("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage)
133 #endif
134 #ifdef BB_GETOPT
135         APPLET("getopt", getopt_main, _BB_DIR_BIN, getopt_usage)
136 #endif
137 #ifdef BB_GREP
138         APPLET("grep", grep_main, _BB_DIR_BIN, grep_usage)
139 #endif
140 #ifdef BB_GUNZIP
141         APPLET("gunzip", gunzip_main, _BB_DIR_BIN, gunzip_usage)
142 #endif
143 #ifdef BB_GZIP
144         APPLET("gzip", gzip_main, _BB_DIR_BIN, gzip_usage)
145 #endif
146 #ifdef BB_HALT
147         APPLET("halt", halt_main, _BB_DIR_SBIN, halt_usage)
148 #endif
149 #ifdef BB_HEAD
150         APPLET("head", head_main, _BB_DIR_USR_BIN, head_usage)
151 #endif
152 #ifdef BB_HOSTID
153         APPLET("hostid", hostid_main, _BB_DIR_USR_BIN, hostid_usage)
154 #endif
155 #ifdef BB_HOSTNAME
156         APPLET("hostname", hostname_main, _BB_DIR_BIN, hostname_usage)
157 #endif
158 #ifdef BB_ID
159         APPLET("id", id_main, _BB_DIR_USR_BIN, id_usage)
160 #endif
161 #ifdef BB_INIT
162         APPLET_NOUSAGE("init", init_main, _BB_DIR_SBIN)
163 #endif
164 #ifdef BB_INSMOD
165         APPLET("insmod", insmod_main, _BB_DIR_SBIN, insmod_usage)
166 #endif
167 #ifdef BB_KILL
168         APPLET("kill", kill_main, _BB_DIR_BIN, kill_usage)
169 #endif
170 #ifdef BB_KILLALL
171         APPLET("killall", kill_main, _BB_DIR_USR_BIN, killall_usage)
172 #endif
173 #ifdef BB_LENGTH
174         APPLET("length", length_main, _BB_DIR_USR_BIN, length_usage)
175 #endif
176 #ifdef BB_LINUXRC
177         APPLET_NOUSAGE("linuxrc", init_main, _BB_DIR_ROOT)
178 #endif
179 #ifdef BB_LN
180         APPLET("ln", ln_main, _BB_DIR_BIN, ln_usage)
181 #endif
182 #ifdef BB_LOADACM
183         APPLET("loadacm", loadacm_main, _BB_DIR_USR_BIN, loadacm_usage)
184 #endif
185 #ifdef BB_LOADFONT
186         APPLET("loadfont", loadfont_main, _BB_DIR_USR_BIN, loadfont_usage)
187 #endif
188 #ifdef BB_LOADKMAP
189         APPLET("loadkmap", loadkmap_main, _BB_DIR_SBIN, loadkmap_usage)
190 #endif
191 #ifdef BB_LOGGER
192         APPLET("logger", logger_main, _BB_DIR_USR_BIN, logger_usage)
193 #endif
194 #ifdef BB_LOGNAME
195         APPLET("logname", logname_main, _BB_DIR_USR_BIN, logname_usage)
196 #endif
197 #ifdef BB_LS
198         APPLET("ls", ls_main, _BB_DIR_BIN, ls_usage)
199 #endif
200 #ifdef BB_LSMOD
201         APPLET("lsmod", lsmod_main, _BB_DIR_SBIN, lsmod_usage)
202 #endif
203 #ifdef BB_MAKEDEVS
204         APPLET("makedevs", makedevs_main, _BB_DIR_SBIN, makedevs_usage)
205 #endif
206 #ifdef BB_MD5SUM
207         APPLET("md5sum", md5sum_main, _BB_DIR_USR_BIN, md5sum_usage)
208 #endif
209 #ifdef BB_MKDIR
210         APPLET("mkdir", mkdir_main, _BB_DIR_BIN, mkdir_usage)
211 #endif
212 #ifdef BB_MKFIFO
213         APPLET("mkfifo", mkfifo_main, _BB_DIR_USR_BIN, mkfifo_usage)
214 #endif
215 #ifdef BB_MKFS_MINIX
216         APPLET("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage)
217 #endif
218 #ifdef BB_MKNOD
219         APPLET("mknod", mknod_main, _BB_DIR_BIN, mknod_usage)
220 #endif
221 #ifdef BB_MKSWAP
222         APPLET("mkswap", mkswap_main, _BB_DIR_SBIN, mkswap_usage)
223 #endif
224 #ifdef BB_MKTEMP
225         APPLET("mktemp", mktemp_main, _BB_DIR_BIN, mktemp_usage)
226 #endif
227 #ifdef BB_MORE
228         APPLET("more", more_main, _BB_DIR_BIN, more_usage)
229 #endif
230 #ifdef BB_MOUNT
231         APPLET("mount", mount_main, _BB_DIR_BIN, mount_usage)
232 #endif
233 #ifdef BB_MT
234         APPLET("mt", mt_main, _BB_DIR_BIN, mt_usage)
235 #endif
236 #ifdef BB_CP_MV
237         APPLET("mv", cp_mv_main, _BB_DIR_BIN, mv_usage)
238 #endif
239 #ifdef BB_NC
240         APPLET("nc", nc_main, _BB_DIR_USR_BIN, nc_usage)
241 #endif
242 #ifdef BB_NSLOOKUP
243         APPLET("nslookup", nslookup_main, _BB_DIR_USR_BIN, nslookup_usage)
244 #endif
245 #ifdef BB_PING
246         APPLET("ping", ping_main, _BB_DIR_BIN, ping_usage)
247 #endif
248 #ifdef BB_PIVOT_ROOT
249         APPLET("pivot_root", pivot_root_main, _BB_DIR_SBIN, pivot_root_usage)
250 #endif
251 #ifdef BB_POWEROFF
252         APPLET("poweroff", poweroff_main, _BB_DIR_SBIN, poweroff_usage)
253 #endif
254 #ifdef BB_PRINTF
255         APPLET("printf", printf_main, _BB_DIR_USR_BIN, printf_usage)
256 #endif
257 #ifdef BB_PS
258         APPLET("ps", ps_main, _BB_DIR_BIN, ps_usage)
259 #endif
260 #ifdef BB_PWD
261         APPLET("pwd", pwd_main, _BB_DIR_BIN, pwd_usage)
262 #endif
263 #ifdef BB_RDATE
264         APPLET("rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage)
265 #endif
266 #ifdef BB_READLINK
267         APPLET("readlink", readlink_main, _BB_DIR_USR_BIN, readlink_usage)
268 #endif
269 #ifdef BB_REBOOT
270         APPLET("reboot", reboot_main, _BB_DIR_SBIN, reboot_usage)
271 #endif
272 #ifdef BB_RENICE
273         APPLET("renice", renice_main, _BB_DIR_USR_BIN, renice_usage)
274 #endif
275 #ifdef BB_RESET
276         APPLET("reset", reset_main, _BB_DIR_USR_BIN, reset_usage)
277 #endif
278 #ifdef BB_RM
279         APPLET("rm", rm_main, _BB_DIR_BIN, rm_usage)
280 #endif
281 #ifdef BB_RMDIR
282         APPLET("rmdir", rmdir_main, _BB_DIR_BIN, rmdir_usage)
283 #endif
284 #ifdef BB_RMMOD
285         APPLET("rmmod", rmmod_main, _BB_DIR_SBIN, rmmod_usage)
286 #endif
287 #ifdef BB_RPMUNPACK
288         APPLET("rpmunpack", rpmunpack_main, _BB_DIR_USR_BIN, rpmunpack_usage)
289 #endif
290 #ifdef BB_SED
291         APPLET("sed", sed_main, _BB_DIR_BIN, sed_usage)
292 #endif
293 #ifdef BB_SETKEYCODES
294         APPLET("setkeycodes", setkeycodes_main, _BB_DIR_USR_BIN, setkeycodes_usage)
295 #endif
296 #ifdef BB_SH
297         APPLET("sh", shell_main, _BB_DIR_BIN, shell_usage)
298 #endif
299 #ifdef BB_SLEEP
300         APPLET("sleep", sleep_main, _BB_DIR_BIN, sleep_usage)
301 #endif
302 #ifdef BB_SORT
303         APPLET("sort", sort_main, _BB_DIR_USR_BIN, sort_usage)
304 #endif
305 #ifdef BB_SWAPONOFF
306         APPLET("swapoff", swap_on_off_main, _BB_DIR_SBIN, swapoff_usage)
307 #endif
308 #ifdef BB_SWAPONOFF
309         APPLET("swapon", swap_on_off_main, _BB_DIR_SBIN, swapon_usage)
310 #endif
311 #ifdef BB_SYNC
312         APPLET("sync", sync_main, _BB_DIR_BIN, sync_usage)
313 #endif
314 #ifdef BB_SYSLOGD
315         APPLET("syslogd", syslogd_main, _BB_DIR_SBIN, syslogd_usage)
316 #endif
317 #ifdef BB_TAIL
318         APPLET("tail", tail_main, _BB_DIR_USR_BIN, tail_usage)
319 #endif
320 #ifdef BB_TAR
321         APPLET("tar", tar_main, _BB_DIR_BIN, tar_usage)
322 #endif
323 #ifdef BB_TEE
324         APPLET("tee", tee_main, _BB_DIR_USR_BIN, tee_usage)
325 #endif
326 #ifdef BB_TELNET
327         APPLET("telnet", telnet_main, _BB_DIR_USR_BIN, telnet_usage)
328 #endif
329 #ifdef BB_TEST
330         APPLET("test", test_main, _BB_DIR_USR_BIN, test_usage)
331 #endif
332 #ifdef BB_TOUCH
333         APPLET("touch", touch_main, _BB_DIR_BIN, touch_usage)
334 #endif
335 #ifdef BB_TR
336         APPLET("tr", tr_main, _BB_DIR_USR_BIN, tr_usage)
337 #endif
338 #ifdef BB_TRUE_FALSE
339         APPLET("true", true_main, _BB_DIR_BIN, true_usage)
340 #endif
341 #ifdef BB_TTY
342         APPLET("tty", tty_main, _BB_DIR_USR_BIN, tty_usage)
343 #endif
344 #ifdef BB_UMOUNT
345         APPLET("umount", umount_main, _BB_DIR_BIN, umount_usage)
346 #endif
347 #ifdef BB_UNAME
348         APPLET("uname", uname_main, _BB_DIR_BIN, uname_usage)
349 #endif
350 #ifdef BB_UNIQ
351         APPLET("uniq", uniq_main, _BB_DIR_USR_BIN, uniq_usage)
352 #endif
353 #ifdef BB_UNIX2DOS
354         APPLET("unix2dos", unix2dos_main, _BB_DIR_USR_BIN, unix2dos_usage)
355 #endif
356 #ifdef BB_UPDATE
357         APPLET("update", update_main, _BB_DIR_SBIN, update_usage)
358 #endif
359 #ifdef BB_UPTIME
360         APPLET("uptime", uptime_main, _BB_DIR_USR_BIN, uptime_usage)
361 #endif
362 #ifdef BB_USLEEP
363         APPLET("usleep", usleep_main, _BB_DIR_BIN, usleep_usage)
364 #endif
365 #ifdef BB_UUDECODE
366         APPLET("uudecode", uudecode_main, _BB_DIR_USR_BIN, uudecode_usage)
367 #endif
368 #ifdef BB_UUENCODE
369         APPLET("uuencode", uuencode_main, _BB_DIR_USR_BIN, uuencode_usage)
370 #endif
371 #ifdef BB_WATCHDOG
372         APPLET("watchdog", watchdog_main, _BB_DIR_SBIN, watchdog_usage)
373 #endif
374 #ifdef BB_WC
375         APPLET("wc", wc_main, _BB_DIR_USR_BIN, wc_usage)
376 #endif
377 #ifdef BB_WGET
378         APPLET("wget", wget_main, _BB_DIR_USR_BIN, wget_usage)
379 #endif
380 #ifdef BB_WHICH
381         APPLET("which", which_main, _BB_DIR_USR_BIN, which_usage)
382 #endif
383 #ifdef BB_WHOAMI
384         APPLET("whoami", whoami_main, _BB_DIR_USR_BIN, whoami_usage)
385 #endif
386 #ifdef BB_XARGS
387         APPLET("xargs", xargs_main, _BB_DIR_USR_BIN, xargs_usage)
388 #endif
389 #ifdef BB_YES
390         APPLET("yes", yes_main, _BB_DIR_USR_BIN, yes_usage)
391 #endif
392 #ifdef BB_GUNZIP
393         APPLET("zcat", gunzip_main, _BB_DIR_BIN, gunzip_usage)
394 #endif
395
396 #if !defined(PROTOTYPES) && !defined(MAKE_LINKS)
397         { 0,NULL,0,NULL}
398 };
399
400 /* The -1 arises because of the {0,NULL,0,NULL} entry above. */
401 size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
402
403 #endif