blob: d20337ff15e07313007f63c3c742ee43ffadbd5d [file] [log] [blame]
Eric Andersenf6b71392000-09-26 01:09:18 +00001/* vi: set sw=4 ts=4: */
2/*
3 * Busybox main internal header file
4 *
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +00005 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
Eric Andersenf6b71392000-09-26 01:09:18 +00006 */
7#ifndef _BB_INTERNAL_H_
8#define _BB_INTERNAL_H_ 1
9
Robert Grieblc9aca452002-06-04 20:06:25 +000010#include "libbb.h"
Eric Andersenc3196012001-03-14 01:15:06 +000011
Paul Fox6ba8bbe2006-06-09 12:25:10 +000012/* order matters: used as index into "install_dir[]" in busybox.c */
Eric Andersenf6b71392000-09-26 01:09:18 +000013enum Location {
14 _BB_DIR_ROOT = 0,
15 _BB_DIR_BIN,
16 _BB_DIR_SBIN,
17 _BB_DIR_USR_BIN,
18 _BB_DIR_USR_SBIN
19};
20
Robert Grieblc9aca452002-06-04 20:06:25 +000021enum SUIDRoot {
22 _BB_SUID_NEVER = 0,
23 _BB_SUID_MAYBE,
24 _BB_SUID_ALWAYS
25};
26
Eric Andersenf6b71392000-09-26 01:09:18 +000027struct BB_applet {
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000028 const char *name;
29 int (*main) (int argc, char **argv);
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000030 __extension__ enum Location location:4;
31 __extension__ enum SUIDRoot need_suid:4;
Eric Andersenf6b71392000-09-26 01:09:18 +000032};
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000033
Eric Andersenf6b71392000-09-26 01:09:18 +000034/* From busybox.c */
35extern const struct BB_applet applets[];
36
Eric Andersen8c725e62000-11-30 00:27:06 +000037/* Automagically pull in all the applet function prototypes and
Eric Andersen87559822000-12-01 19:02:24 +000038 * applet usage strings. These are all of the form:
Eric Andersen8c725e62000-11-30 00:27:06 +000039 * extern int foo_main(int argc, char **argv);
40 * extern const char foo_usage[];
Eric Andersenc7bda1c2004-03-15 08:29:22 +000041 * These are all autogenerated from the set of currently defined applets.
Eric Andersen8c725e62000-11-30 00:27:06 +000042 */
43#define PROTOTYPES
44#include "applets.h"
45#undef PROTOTYPES
Eric Andersenf6b71392000-09-26 01:09:18 +000046
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000047#endif /* _BB_INTERNAL_H_ */