Fixed tiny typo.
[oweals/busybox.git] / 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_DEB
93         APPLET("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage)
94 #endif
95 #ifdef BB_DU
96         APPLET("du", du_main, _BB_DIR_USR_BIN, du_usage)
97 #endif
98 #ifdef BB_DUMPKMAP
99         APPLET("dumpkmap", dumpkmap_main, _BB_DIR_BIN, dumpkmap_usage)
100 #endif
101 #ifdef BB_DUTMP
102         APPLET("dutmp", dutmp_main, _BB_DIR_USR_SBIN, dutmp_usage)
103 #endif
104 #ifdef BB_ECHO
105         APPLET("echo", echo_main, _BB_DIR_BIN, echo_usage)
106 #endif
107 #ifdef BB_EXPR
108         APPLET("expr", expr_main, _BB_DIR_USR_BIN, expr_usage)
109 #endif
110 #ifdef BB_TRUE_FALSE
111         APPLET("false", false_main, _BB_DIR_BIN, false_usage)
112 #endif
113 #ifdef BB_FBSET
114         APPLET_NOUSAGE("fbset", fbset_main, _BB_DIR_USR_SBIN)
115 #endif
116 #ifdef BB_FDFLUSH
117         APPLET("fdflush", fdflush_main, _BB_DIR_BIN, fdflush_usage)
118 #endif
119 #ifdef BB_FIND
120         APPLET("find", find_main, _BB_DIR_USR_BIN, find_usage)
121 #endif
122 #ifdef BB_FREE
123         APPLET("free", free_main, _BB_DIR_USR_BIN, free_usage)
124 #endif
125 #ifdef BB_FREERAMDISK
126         APPLET("freeramdisk", freeramdisk_main, _BB_DIR_SBIN, freeramdisk_usage)
127 #endif
128 #ifdef BB_FSCK_MINIX
129         APPLET("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage)
130 #endif
131 #ifdef BB_GETOPT
132         APPLET("getopt", getopt_main, _BB_DIR_BIN, getopt_usage)
133 #endif
134 #ifdef BB_GREP
135         APPLET("grep", grep_main, _BB_DIR_BIN, grep_usage)
136 #endif
137 #ifdef BB_GUNZIP
138         APPLET("gunzip", gunzip_main, _BB_DIR_BIN, gunzip_usage)
139 #endif
140 #ifdef BB_GZIP
141         APPLET("gzip", gzip_main, _BB_DIR_BIN, gzip_usage)
142 #endif
143 #ifdef BB_HALT
144         APPLET("halt", halt_main, _BB_DIR_SBIN, halt_usage)
145 #endif
146 #ifdef BB_HEAD
147         APPLET("head", head_main, _BB_DIR_USR_BIN, head_usage)
148 #endif
149 #ifdef BB_HOSTID
150         APPLET("hostid", hostid_main, _BB_DIR_USR_BIN, hostid_usage)
151 #endif
152 #ifdef BB_HOSTNAME
153         APPLET("hostname", hostname_main, _BB_DIR_BIN, hostname_usage)
154 #endif
155 #ifdef BB_ID
156         APPLET("id", id_main, _BB_DIR_USR_BIN, id_usage)
157 #endif
158 #ifdef BB_INIT
159         APPLET_NOUSAGE("init", init_main, _BB_DIR_SBIN)
160 #endif
161 #ifdef BB_INSMOD
162         APPLET("insmod", insmod_main, _BB_DIR_SBIN, insmod_usage)
163 #endif
164 #ifdef BB_KILL
165         APPLET("kill", kill_main, _BB_DIR_BIN, kill_usage)
166 #endif
167 #ifdef BB_KILLALL
168         APPLET("killall", kill_main, _BB_DIR_USR_BIN, killall_usage)
169 #endif
170 #ifdef BB_LENGTH
171         APPLET("length", length_main, _BB_DIR_USR_BIN, length_usage)
172 #endif
173 #ifdef BB_LINUXRC
174         APPLET_NOUSAGE("linuxrc", init_main, _BB_DIR_ROOT)
175 #endif
176 #ifdef BB_LN
177         APPLET("ln", ln_main, _BB_DIR_BIN, ln_usage)
178 #endif
179 #ifdef BB_LOADACM
180         APPLET("loadacm", loadacm_main, _BB_DIR_USR_BIN, loadacm_usage)
181 #endif
182 #ifdef BB_LOADFONT
183         APPLET("loadfont", loadfont_main, _BB_DIR_USR_BIN, loadfont_usage)
184 #endif
185 #ifdef BB_LOADKMAP
186         APPLET("loadkmap", loadkmap_main, _BB_DIR_SBIN, loadkmap_usage)
187 #endif
188 #ifdef BB_LOGGER
189         APPLET("logger", logger_main, _BB_DIR_USR_BIN, logger_usage)
190 #endif
191 #ifdef BB_LOGNAME
192         APPLET("logname", logname_main, _BB_DIR_USR_BIN, logname_usage)
193 #endif
194 #ifdef BB_LS
195         APPLET("ls", ls_main, _BB_DIR_BIN, ls_usage)
196 #endif
197 #ifdef BB_LSMOD
198         APPLET("lsmod", lsmod_main, _BB_DIR_SBIN, lsmod_usage)
199 #endif
200 #ifdef BB_MAKEDEVS
201         APPLET("makedevs", makedevs_main, _BB_DIR_SBIN, makedevs_usage)
202 #endif
203 #ifdef BB_MD5SUM
204         APPLET("md5sum", md5sum_main, _BB_DIR_USR_BIN, md5sum_usage)
205 #endif
206 #ifdef BB_MKDIR
207         APPLET("mkdir", mkdir_main, _BB_DIR_BIN, mkdir_usage)
208 #endif
209 #ifdef BB_MKFIFO
210         APPLET("mkfifo", mkfifo_main, _BB_DIR_USR_BIN, mkfifo_usage)
211 #endif
212 #ifdef BB_MKFS_MINIX
213         APPLET("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage)
214 #endif
215 #ifdef BB_MKNOD
216         APPLET("mknod", mknod_main, _BB_DIR_BIN, mknod_usage)
217 #endif
218 #ifdef BB_MKSWAP
219         APPLET("mkswap", mkswap_main, _BB_DIR_SBIN, mkswap_usage)
220 #endif
221 #ifdef BB_MKTEMP
222         APPLET("mktemp", mktemp_main, _BB_DIR_BIN, mktemp_usage)
223 #endif
224 #ifdef BB_MORE
225         APPLET("more", more_main, _BB_DIR_BIN, more_usage)
226 #endif
227 #ifdef BB_MOUNT
228         APPLET("mount", mount_main, _BB_DIR_BIN, mount_usage)
229 #endif
230 #ifdef BB_MT
231         APPLET("mt", mt_main, _BB_DIR_BIN, mt_usage)
232 #endif
233 #ifdef BB_CP_MV
234         APPLET("mv", cp_mv_main, _BB_DIR_BIN, mv_usage)
235 #endif
236 #ifdef BB_NC
237         APPLET("nc", nc_main, _BB_DIR_USR_BIN, nc_usage)
238 #endif
239 #ifdef BB_NSLOOKUP
240         APPLET("nslookup", nslookup_main, _BB_DIR_USR_BIN, nslookup_usage)
241 #endif
242 #ifdef BB_PING
243         APPLET("ping", ping_main, _BB_DIR_BIN, ping_usage)
244 #endif
245 #ifdef BB_POWEROFF
246         APPLET("poweroff", poweroff_main, _BB_DIR_SBIN, poweroff_usage)
247 #endif
248 #ifdef BB_PRINTF
249         APPLET("printf", printf_main, _BB_DIR_USR_BIN, printf_usage)
250 #endif
251 #ifdef BB_PS
252         APPLET("ps", ps_main, _BB_DIR_BIN, ps_usage)
253 #endif
254 #ifdef BB_PWD
255         APPLET("pwd", pwd_main, _BB_DIR_BIN, pwd_usage)
256 #endif
257 #ifdef BB_RDATE
258         APPLET("rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage)
259 #endif
260 #ifdef BB_READLINK
261         APPLET("readlink", readlink_main, _BB_DIR_USR_BIN, readlink_usage)
262 #endif
263 #ifdef BB_REBOOT
264         APPLET("reboot", reboot_main, _BB_DIR_SBIN, reboot_usage)
265 #endif
266 #ifdef BB_RENICE
267         APPLET("renice", renice_main, _BB_DIR_USR_BIN, renice_usage)
268 #endif
269 #ifdef BB_RESET
270         APPLET("reset", reset_main, _BB_DIR_USR_BIN, reset_usage)
271 #endif
272 #ifdef BB_RM
273         APPLET("rm", rm_main, _BB_DIR_BIN, rm_usage)
274 #endif
275 #ifdef BB_RMDIR
276         APPLET("rmdir", rmdir_main, _BB_DIR_BIN, rmdir_usage)
277 #endif
278 #ifdef BB_RMMOD
279         APPLET("rmmod", rmmod_main, _BB_DIR_SBIN, rmmod_usage)
280 #endif
281 #ifdef BB_RPMUNPACK
282         APPLET("rpmunpack", rpmunpack_main, _BB_DIR_USR_BIN, rpmunpack_usage)
283 #endif
284 #ifdef BB_SED
285         APPLET("sed", sed_main, _BB_DIR_BIN, sed_usage)
286 #endif
287 #ifdef BB_SETKEYCODES
288         APPLET("setkeycodes", setkeycodes_main, _BB_DIR_USR_BIN, setkeycodes_usage)
289 #endif
290 #ifdef BB_SH
291         APPLET("sh", shell_main, _BB_DIR_BIN, shell_usage)
292 #endif
293 #ifdef BB_SLEEP
294         APPLET("sleep", sleep_main, _BB_DIR_BIN, sleep_usage)
295 #endif
296 #ifdef BB_SORT
297         APPLET("sort", sort_main, _BB_DIR_USR_BIN, sort_usage)
298 #endif
299 #ifdef BB_SWAPONOFF
300         APPLET("swapoff", swap_on_off_main, _BB_DIR_SBIN, swapoff_usage)
301 #endif
302 #ifdef BB_SWAPONOFF
303         APPLET("swapon", swap_on_off_main, _BB_DIR_SBIN, swapon_usage)
304 #endif
305 #ifdef BB_SYNC
306         APPLET("sync", sync_main, _BB_DIR_BIN, sync_usage)
307 #endif
308 #ifdef BB_SYSLOGD
309         APPLET("syslogd", syslogd_main, _BB_DIR_SBIN, syslogd_usage)
310 #endif
311 #ifdef BB_TAIL
312         APPLET("tail", tail_main, _BB_DIR_USR_BIN, tail_usage)
313 #endif
314 #ifdef BB_TAR
315         APPLET("tar", tar_main, _BB_DIR_BIN, tar_usage)
316 #endif
317 #ifdef BB_TEE
318         APPLET("tee", tee_main, _BB_DIR_USR_BIN, tee_usage)
319 #endif
320 #ifdef BB_TELNET
321         APPLET("telnet", telnet_main, _BB_DIR_USR_BIN, telnet_usage)
322 #endif
323 #ifdef BB_TEST
324         APPLET("test", test_main, _BB_DIR_USR_BIN, test_usage)
325 #endif
326 #ifdef BB_TOUCH
327         APPLET("touch", touch_main, _BB_DIR_BIN, touch_usage)
328 #endif
329 #ifdef BB_TR
330         APPLET("tr", tr_main, _BB_DIR_USR_BIN, tr_usage)
331 #endif
332 #ifdef BB_TRUE_FALSE
333         APPLET("true", true_main, _BB_DIR_BIN, true_usage)
334 #endif
335 #ifdef BB_TTY
336         APPLET("tty", tty_main, _BB_DIR_USR_BIN, tty_usage)
337 #endif
338 #ifdef BB_UMOUNT
339         APPLET("umount", umount_main, _BB_DIR_BIN, umount_usage)
340 #endif
341 #ifdef BB_UNAME
342         APPLET("uname", uname_main, _BB_DIR_BIN, uname_usage)
343 #endif
344 #ifdef BB_UNIQ
345         APPLET("uniq", uniq_main, _BB_DIR_USR_BIN, uniq_usage)
346 #endif
347 #ifdef BB_UNIX2DOS
348         APPLET("unix2dos", unix2dos_main, _BB_DIR_USR_BIN, unix2dos_usage)
349 #endif
350 #ifdef BB_UPDATE
351         APPLET("update", update_main, _BB_DIR_SBIN, update_usage)
352 #endif
353 #ifdef BB_UPTIME
354         APPLET("uptime", uptime_main, _BB_DIR_USR_BIN, uptime_usage)
355 #endif
356 #ifdef BB_USLEEP
357         APPLET("usleep", usleep_main, _BB_DIR_BIN, usleep_usage)
358 #endif
359 #ifdef BB_UUDECODE
360         APPLET("uudecode", uudecode_main, _BB_DIR_USR_BIN, uudecode_usage)
361 #endif
362 #ifdef BB_UUENCODE
363         APPLET("uuencode", uuencode_main, _BB_DIR_USR_BIN, uuencode_usage)
364 #endif
365 #ifdef BB_WC
366         APPLET("wc", wc_main, _BB_DIR_USR_BIN, wc_usage)
367 #endif
368 #ifdef BB_WGET
369         APPLET("wget", wget_main, _BB_DIR_USR_BIN, wget_usage)
370 #endif
371 #ifdef BB_WHICH
372         APPLET("which", which_main, _BB_DIR_USR_BIN, which_usage)
373 #endif
374 #ifdef BB_WHOAMI
375         APPLET("whoami", whoami_main, _BB_DIR_USR_BIN, whoami_usage)
376 #endif
377 #ifdef BB_XARGS
378         APPLET("xargs", xargs_main, _BB_DIR_USR_BIN, xargs_usage)
379 #endif
380 #ifdef BB_YES
381         APPLET("yes", yes_main, _BB_DIR_USR_BIN, yes_usage)
382 #endif
383 #ifdef BB_GUNZIP
384         APPLET("zcat", gunzip_main, _BB_DIR_BIN, gunzip_usage)
385 #endif
386
387 #if !defined(PROTOTYPES) && !defined(MAKE_LINKS)
388         { 0,NULL,0,NULL}
389 };
390
391 /* The -1 arises because of the {0,NULL,0,NULL} entry above. */
392 size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
393
394 #endif