Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Busybox main internal header file |
| 4 | * |
Bernhard Reutner-Fischer | 86f5c99 | 2006-01-22 22:55:11 +0000 | [diff] [blame] | 5 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 6 | */ |
| 7 | #ifndef _BB_INTERNAL_H_ |
| 8 | #define _BB_INTERNAL_H_ 1 |
| 9 | |
Robert Griebl | c9aca45 | 2002-06-04 20:06:25 +0000 | [diff] [blame] | 10 | #include "libbb.h" |
Eric Andersen | c319601 | 2001-03-14 01:15:06 +0000 | [diff] [blame] | 11 | |
Denis Vlasenko | 0ee3999 | 2006-12-24 15:23:28 +0000 | [diff] [blame] | 12 | /* order matters: used as index into "install_dir[]" in busybox.c */ |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 13 | enum 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 Griebl | c9aca45 | 2002-06-04 20:06:25 +0000 | [diff] [blame] | 21 | enum SUIDRoot { |
| 22 | _BB_SUID_NEVER = 0, |
| 23 | _BB_SUID_MAYBE, |
| 24 | _BB_SUID_ALWAYS |
| 25 | }; |
| 26 | |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 27 | struct BB_applet { |
Glenn L McGrath | 60a22ad | 2002-08-22 15:54:22 +0000 | [diff] [blame] | 28 | const char *name; |
| 29 | int (*main) (int argc, char **argv); |
Bernhard Reutner-Fischer | 86f5c99 | 2006-01-22 22:55:11 +0000 | [diff] [blame] | 30 | __extension__ enum Location location:4; |
| 31 | __extension__ enum SUIDRoot need_suid:4; |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 32 | }; |
Glenn L McGrath | 60a22ad | 2002-08-22 15:54:22 +0000 | [diff] [blame] | 33 | |
Denis Vlasenko | c7ba8b9 | 2007-02-03 17:27:14 +0000 | [diff] [blame] | 34 | /* Defined in busybox.c and applet.c */ |
Denis Vlasenko | 765996a | 2006-12-24 16:59:27 +0000 | [diff] [blame] | 35 | extern int busybox_main(int argc, char **argv); |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 36 | extern const struct BB_applet applets[]; |
Denis Vlasenko | 0ee3999 | 2006-12-24 15:23:28 +0000 | [diff] [blame] | 37 | extern const unsigned short NUM_APPLETS; |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 38 | |
Denis Vlasenko | c7ba8b9 | 2007-02-03 17:27:14 +0000 | [diff] [blame] | 39 | #endif /* _BB_INTERNAL_H_ */ |