This patch, put together by Manuel Novoa III, is a merge of work
[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 #undef APPLET
14 #undef APPLET_ODDNAME
15 #undef APPLET_NOUSAGE
16
17 #if defined(PROTOTYPES)
18 #define APPLET(a,b,c) \
19         extern int b(int argc, char **argv);
20 #define APPLET_ODDNAME(a,b,c,d,e) APPLET(a,b,c)
21 #define APPLET_NOUSAGE(a,b,c) \
22         extern int b(int argc, char **argv);
23 #elif defined(MAKE_LINKS)
24 #define APPLET(a,b,c) LINK c #a
25 #define APPLET_ODDNAME(a,b,c,d,e) LINK c a
26 #define APPLET_NOUSAGE(a,b,c) LINK c #a
27 #elif defined(APPLET_ENUM)
28 #define APPLET(a,b,c) a##_applet_number,
29 #define APPLET_ODDNAME(a,b,c,d,e) e##_applet_number,
30 #define APPLET_NOUSAGE(a,b,c) a##applet_number,
31 #else
32 #define USAGE_ENUM
33 #include "usage.h"
34 const struct BB_applet applets[] = {
35 #define APPLET(a,b,c) {#a,b,c,a##_usage_index},
36 #define APPLET_ODDNAME(a,b,c,d,e) {a,b,c,d},
37 #define APPLET_NOUSAGE(a,b,c) {#a,b,c,-1},
38 #define zcat_usage_index gunzip_usage_index
39 #define sh_usage_index shell_usage_index
40 #endif
41
42 #ifdef BB_TEST
43         APPLET_ODDNAME("[", test_main, _BB_DIR_USR_BIN, test_usage_index, open_bracket)
44 #endif
45 #ifdef BB_AR
46         APPLET(ar, ar_main, _BB_DIR_USR_BIN)
47 #endif
48 #ifdef BB_BASENAME
49         APPLET(basename, basename_main, _BB_DIR_USR_BIN)
50 #endif
51         APPLET_NOUSAGE(busybox, busybox_main, _BB_DIR_BIN)
52 #ifdef BB_CAT
53         APPLET(cat, cat_main, _BB_DIR_BIN)
54 #endif
55 #ifdef BB_CHMOD_CHOWN_CHGRP
56         APPLET(chgrp, chmod_chown_chgrp_main, _BB_DIR_BIN)
57 #endif
58 #ifdef BB_CHMOD_CHOWN_CHGRP
59         APPLET(chmod, chmod_chown_chgrp_main, _BB_DIR_BIN)
60 #endif
61 #ifdef BB_CHMOD_CHOWN_CHGRP
62         APPLET(chown, chmod_chown_chgrp_main, _BB_DIR_BIN)
63 #endif
64 #ifdef BB_CHROOT
65         APPLET(chroot, chroot_main, _BB_DIR_USR_SBIN)
66 #endif
67 #ifdef BB_CHVT
68         APPLET(chvt, chvt_main, _BB_DIR_USR_BIN)
69 #endif
70 #ifdef BB_CLEAR
71         APPLET(clear, clear_main, _BB_DIR_USR_BIN)
72 #endif
73 #ifdef BB_CMP
74         APPLET(cmp, cmp_main, _BB_DIR_USR_BIN)
75 #endif
76 #ifdef BB_CP_MV
77         APPLET(cp, cp_mv_main, _BB_DIR_BIN)
78 #endif
79 #ifdef BB_CUT
80         APPLET(cut, cut_main, _BB_DIR_USR_BIN)
81 #endif
82 #ifdef BB_DATE
83         APPLET(date, date_main, _BB_DIR_BIN)
84 #endif
85 #ifdef BB_DC
86         APPLET(dc, dc_main, _BB_DIR_USR_BIN)
87 #endif
88 #ifdef BB_DD
89         APPLET(dd, dd_main, _BB_DIR_BIN)
90 #endif
91 #ifdef BB_DEALLOCVT
92         APPLET(deallocvt, deallocvt_main, _BB_DIR_USR_BIN)
93 #endif
94 #ifdef BB_DF
95         APPLET(df, df_main, _BB_DIR_BIN)
96 #endif
97 #ifdef BB_DIRNAME
98         APPLET(dirname, dirname_main, _BB_DIR_USR_BIN)
99 #endif
100 #ifdef BB_DMESG
101         APPLET(dmesg, dmesg_main, _BB_DIR_BIN)
102 #endif
103 #ifdef BB_DOS2UNIX
104         APPLET(dos2unix, dos2unix_main, _BB_DIR_USR_BIN)
105 #endif
106 #ifdef BB_DPKG
107         APPLET(dpkg, dpkg_main, _BB_DIR_USR_BIN)
108 #endif
109 #ifdef BB_DPKG_DEB
110         APPLET_ODDNAME("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage_index, dpkg_deb)
111 #endif
112 #ifdef BB_DU
113         APPLET(du, du_main, _BB_DIR_USR_BIN)
114 #endif
115 #ifdef BB_DUMPKMAP
116         APPLET(dumpkmap, dumpkmap_main, _BB_DIR_BIN)
117 #endif
118 #ifdef BB_DUTMP
119         APPLET(dutmp, dutmp_main, _BB_DIR_USR_SBIN)
120 #endif
121 #ifdef BB_ECHO
122         APPLET(echo, echo_main, _BB_DIR_BIN)
123 #endif
124 #ifdef BB_EXPR
125         APPLET(expr, expr_main, _BB_DIR_USR_BIN)
126 #endif
127 #ifdef BB_TRUE_FALSE
128         APPLET(false, false_main, _BB_DIR_BIN)
129 #endif
130 #ifdef BB_FBSET
131         APPLET_NOUSAGE(fbset, fbset_main, _BB_DIR_USR_SBIN)
132 #endif
133 #ifdef BB_FDFLUSH
134         APPLET(fdflush, fdflush_main, _BB_DIR_BIN)
135 #endif
136 #ifdef BB_FIND
137         APPLET(find, find_main, _BB_DIR_USR_BIN)
138 #endif
139 #ifdef BB_FREE
140         APPLET(free, free_main, _BB_DIR_USR_BIN)
141 #endif
142 #ifdef BB_FREERAMDISK
143         APPLET(freeramdisk, freeramdisk_main, _BB_DIR_SBIN)
144 #endif
145 #ifdef BB_FSCK_MINIX
146         APPLET_ODDNAME("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage_index, fsck_minix)
147 #endif
148 #ifdef BB_GETOPT
149         APPLET(getopt, getopt_main, _BB_DIR_BIN)
150 #endif
151 #ifdef BB_GREP
152         APPLET(grep, grep_main, _BB_DIR_BIN)
153 #endif
154 #ifdef BB_GUNZIP
155         APPLET(gunzip, gunzip_main, _BB_DIR_BIN)
156 #endif
157 #ifdef BB_GZIP
158         APPLET(gzip, gzip_main, _BB_DIR_BIN)
159 #endif
160 #ifdef BB_HALT
161         APPLET(halt, halt_main, _BB_DIR_SBIN)
162 #endif
163 #ifdef BB_HEAD
164         APPLET(head, head_main, _BB_DIR_USR_BIN)
165 #endif
166 #ifdef BB_HOSTID
167         APPLET(hostid, hostid_main, _BB_DIR_USR_BIN)
168 #endif
169 #ifdef BB_HOSTNAME
170         APPLET(hostname, hostname_main, _BB_DIR_BIN)
171 #endif
172 #ifdef BB_ID
173         APPLET(id, id_main, _BB_DIR_USR_BIN)
174 #endif
175 #ifdef BB_IFCONFIG
176         APPLET(ifconfig, ifconfig_main, _BB_DIR_SBIN)
177 #endif
178 #ifdef BB_INIT
179         APPLET(init, init_main, _BB_DIR_SBIN)
180 #endif
181 #ifdef BB_INSMOD
182         APPLET(insmod, insmod_main, _BB_DIR_SBIN)
183 #endif
184 #ifdef BB_KILL
185         APPLET(kill, kill_main, _BB_DIR_BIN)
186 #endif
187 #ifdef BB_KILLALL
188         APPLET(killall, kill_main, _BB_DIR_USR_BIN)
189 #endif
190 #ifdef BB_LENGTH
191         APPLET(length, length_main, _BB_DIR_USR_BIN)
192 #endif
193 #ifdef BB_LINUXRC
194         APPLET_NOUSAGE(linuxrc, init_main, _BB_DIR_ROOT)
195 #endif
196 #ifdef BB_LN
197         APPLET(ln, ln_main, _BB_DIR_BIN)
198 #endif
199 #ifdef BB_LOADACM
200         APPLET(loadacm, loadacm_main, _BB_DIR_USR_BIN)
201 #endif
202 #ifdef BB_LOADFONT
203         APPLET(loadfont, loadfont_main, _BB_DIR_USR_BIN)
204 #endif
205 #ifdef BB_LOADKMAP
206         APPLET(loadkmap, loadkmap_main, _BB_DIR_SBIN)
207 #endif
208 #ifdef BB_LOGGER
209         APPLET(logger, logger_main, _BB_DIR_USR_BIN)
210 #endif
211 #ifdef BB_LOGNAME
212         APPLET(logname, logname_main, _BB_DIR_USR_BIN)
213 #endif
214 #ifdef BB_LS
215         APPLET(ls, ls_main, _BB_DIR_BIN)
216 #endif
217 #ifdef BB_LSMOD
218         APPLET(lsmod, lsmod_main, _BB_DIR_SBIN)
219 #endif
220 #ifdef BB_MAKEDEVS
221         APPLET(makedevs, makedevs_main, _BB_DIR_SBIN)
222 #endif
223 #ifdef BB_MD5SUM
224         APPLET(md5sum, md5sum_main, _BB_DIR_USR_BIN)
225 #endif
226 #ifdef BB_MKDIR
227         APPLET(mkdir, mkdir_main, _BB_DIR_BIN)
228 #endif
229 #ifdef BB_MKFIFO
230         APPLET(mkfifo, mkfifo_main, _BB_DIR_USR_BIN)
231 #endif
232 #ifdef BB_MKFS_MINIX
233         APPLET_ODDNAME("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage_index, mkfs_minix)
234 #endif
235 #ifdef BB_MKNOD
236         APPLET(mknod, mknod_main, _BB_DIR_BIN)
237 #endif
238 #ifdef BB_MKSWAP
239         APPLET(mkswap, mkswap_main, _BB_DIR_SBIN)
240 #endif
241 #ifdef BB_MKTEMP
242         APPLET(mktemp, mktemp_main, _BB_DIR_BIN)
243 #endif
244 #ifdef BB_MORE
245         APPLET(more, more_main, _BB_DIR_BIN)
246 #endif
247 #ifdef BB_MOUNT
248         APPLET(mount, mount_main, _BB_DIR_BIN)
249 #endif
250 #ifdef BB_MT
251         APPLET(mt, mt_main, _BB_DIR_BIN)
252 #endif
253 #ifdef BB_CP_MV
254         APPLET(mv, cp_mv_main, _BB_DIR_BIN)
255 #endif
256 #ifdef BB_NC
257         APPLET(nc, nc_main, _BB_DIR_USR_BIN)
258 #endif
259 #ifdef BB_NSLOOKUP
260         APPLET(nslookup, nslookup_main, _BB_DIR_USR_BIN)
261 #endif
262 #ifdef BB_PING
263         APPLET(ping, ping_main, _BB_DIR_BIN)
264 #endif
265 #ifdef BB_PIVOT_ROOT
266         APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN)
267 #endif
268 #ifdef BB_POWEROFF
269         APPLET(poweroff, poweroff_main, _BB_DIR_SBIN)
270 #endif
271 #ifdef BB_PRINTF
272         APPLET(printf, printf_main, _BB_DIR_USR_BIN)
273 #endif
274 #ifdef BB_PS
275         APPLET(ps, ps_main, _BB_DIR_BIN)
276 #endif
277 #ifdef BB_PWD
278         APPLET(pwd, pwd_main, _BB_DIR_BIN)
279 #endif
280 #ifdef BB_RDATE
281         APPLET(rdate, rdate_main, _BB_DIR_USR_BIN)
282 #endif
283 #ifdef BB_READLINK
284         APPLET(readlink, readlink_main, _BB_DIR_USR_BIN)
285 #endif
286 #ifdef BB_REBOOT
287         APPLET(reboot, reboot_main, _BB_DIR_SBIN)
288 #endif
289 #ifdef BB_RENICE
290         APPLET(renice, renice_main, _BB_DIR_USR_BIN)
291 #endif
292 #ifdef BB_RESET
293         APPLET(reset, reset_main, _BB_DIR_USR_BIN)
294 #endif
295 #ifdef BB_RM
296         APPLET(rm, rm_main, _BB_DIR_BIN)
297 #endif
298 #ifdef BB_RMDIR
299         APPLET(rmdir, rmdir_main, _BB_DIR_BIN)
300 #endif
301 #ifdef BB_RMMOD
302         APPLET(rmmod, rmmod_main, _BB_DIR_SBIN)
303 #endif
304 #ifdef BB_ROUTE
305         APPLET(route, route_main, _BB_DIR_USR_BIN)
306 #endif
307 #ifdef BB_RPMUNPACK
308         APPLET(rpmunpack, rpmunpack_main, _BB_DIR_USR_BIN)
309 #endif
310 #ifdef BB_SED
311         APPLET(sed, sed_main, _BB_DIR_BIN)
312 #endif
313 #ifdef BB_SETKEYCODES
314         APPLET(setkeycodes, setkeycodes_main, _BB_DIR_USR_BIN)
315 #endif
316 #ifdef BB_SH
317         APPLET(sh, shell_main, _BB_DIR_BIN)
318 #endif
319 #ifdef BB_SLEEP
320         APPLET(sleep, sleep_main, _BB_DIR_BIN)
321 #endif
322 #ifdef BB_SORT
323         APPLET(sort, sort_main, _BB_DIR_USR_BIN)
324 #endif
325 #ifdef BB_STTY
326         APPLET(stty, stty_main, _BB_DIR_BIN)
327 #endif
328 #ifdef BB_SWAPONOFF
329         APPLET(swapoff, swap_on_off_main, _BB_DIR_SBIN)
330 #endif
331 #ifdef BB_SWAPONOFF
332         APPLET(swapon, swap_on_off_main, _BB_DIR_SBIN)
333 #endif
334 #ifdef BB_SYNC
335         APPLET(sync, sync_main, _BB_DIR_BIN)
336 #endif
337 #ifdef BB_SYSLOGD
338         APPLET(syslogd, syslogd_main, _BB_DIR_SBIN)
339 #endif
340 #ifdef BB_TAIL
341         APPLET(tail, tail_main, _BB_DIR_USR_BIN)
342 #endif
343 #ifdef BB_TAR
344         APPLET(tar, tar_main, _BB_DIR_BIN)
345 #endif
346 #ifdef BB_TEE
347         APPLET(tee, tee_main, _BB_DIR_USR_BIN)
348 #endif
349 #ifdef BB_TELNET
350         APPLET(telnet, telnet_main, _BB_DIR_USR_BIN)
351 #endif
352 #ifdef BB_TEST
353         APPLET(test, test_main, _BB_DIR_USR_BIN)
354 #endif
355 #ifdef BB_TOUCH
356         APPLET(touch, touch_main, _BB_DIR_BIN)
357 #endif
358 #ifdef BB_TR
359         APPLET(tr, tr_main, _BB_DIR_USR_BIN)
360 #endif
361 #ifdef BB_TRUE_FALSE
362         APPLET(true, true_main, _BB_DIR_BIN)
363 #endif
364 #ifdef BB_TTY
365         APPLET(tty, tty_main, _BB_DIR_USR_BIN)
366 #endif
367 #ifdef BB_UMOUNT
368         APPLET(umount, umount_main, _BB_DIR_BIN)
369 #endif
370 #ifdef BB_UNAME
371         APPLET(uname, uname_main, _BB_DIR_BIN)
372 #endif
373 #ifdef BB_UNIQ
374         APPLET(uniq, uniq_main, _BB_DIR_USR_BIN)
375 #endif
376 #ifdef BB_UNIX2DOS
377         APPLET(unix2dos, unix2dos_main, _BB_DIR_USR_BIN)
378 #endif
379 #ifdef BB_UPDATE
380         APPLET(update, update_main, _BB_DIR_SBIN)
381 #endif
382 #ifdef BB_UPTIME
383         APPLET(uptime, uptime_main, _BB_DIR_USR_BIN)
384 #endif
385 #ifdef BB_USLEEP
386         APPLET(usleep, usleep_main, _BB_DIR_BIN)
387 #endif
388 #ifdef BB_UUDECODE
389         APPLET(uudecode, uudecode_main, _BB_DIR_USR_BIN)
390 #endif
391 #ifdef BB_UUENCODE
392         APPLET(uuencode, uuencode_main, _BB_DIR_USR_BIN)
393 #endif
394 #ifdef BB_WATCHDOG
395         APPLET(watchdog, watchdog_main, _BB_DIR_SBIN)
396 #endif
397 #ifdef BB_WC
398         APPLET(wc, wc_main, _BB_DIR_USR_BIN)
399 #endif
400 #ifdef BB_WGET
401         APPLET(wget, wget_main, _BB_DIR_USR_BIN)
402 #endif
403 #ifdef BB_WHICH
404         APPLET(which, which_main, _BB_DIR_USR_BIN)
405 #endif
406 #ifdef BB_WHOAMI
407         APPLET(whoami, whoami_main, _BB_DIR_USR_BIN)
408 #endif
409 #ifdef BB_XARGS
410         APPLET(xargs, xargs_main, _BB_DIR_USR_BIN)
411 #endif
412 #ifdef BB_YES
413         APPLET(yes, yes_main, _BB_DIR_USR_BIN)
414 #endif
415 #ifdef BB_GUNZIP
416         APPLET(zcat, gunzip_main, _BB_DIR_BIN)
417 #endif
418
419 #if !defined(PROTOTYPES) && !defined(MAKE_LINKS) && !defined(APPLET_ENUM)
420         { 0,NULL,0,-1}
421 };
422
423 /* The -1 arises because of the {0,NULL,0,-1} entry above. */
424 size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
425
426 #endif