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 | |
Rob Landley | 193c8c7 | 2005-07-27 06:55:36 +0000 | [diff] [blame] | 10 | #include "bb_config.h" |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 11 | |
Robert Griebl | c9aca45 | 2002-06-04 20:06:25 +0000 | [diff] [blame] | 12 | #include "libbb.h" |
Eric Andersen | c319601 | 2001-03-14 01:15:06 +0000 | [diff] [blame] | 13 | |
Paul Fox | 6ba8bbe | 2006-06-09 12:25:10 +0000 | [diff] [blame] | 14 | /* order matters: used as index into "install_dir[]" in busybox.c */ |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 15 | enum Location { |
| 16 | _BB_DIR_ROOT = 0, |
| 17 | _BB_DIR_BIN, |
| 18 | _BB_DIR_SBIN, |
| 19 | _BB_DIR_USR_BIN, |
| 20 | _BB_DIR_USR_SBIN |
| 21 | }; |
| 22 | |
Robert Griebl | c9aca45 | 2002-06-04 20:06:25 +0000 | [diff] [blame] | 23 | enum SUIDRoot { |
| 24 | _BB_SUID_NEVER = 0, |
| 25 | _BB_SUID_MAYBE, |
| 26 | _BB_SUID_ALWAYS |
| 27 | }; |
| 28 | |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 29 | struct BB_applet { |
Glenn L McGrath | 60a22ad | 2002-08-22 15:54:22 +0000 | [diff] [blame] | 30 | const char *name; |
| 31 | int (*main) (int argc, char **argv); |
Bernhard Reutner-Fischer | 86f5c99 | 2006-01-22 22:55:11 +0000 | [diff] [blame] | 32 | __extension__ enum Location location:4; |
| 33 | __extension__ enum SUIDRoot need_suid:4; |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 34 | }; |
Glenn L McGrath | 60a22ad | 2002-08-22 15:54:22 +0000 | [diff] [blame] | 35 | |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 36 | /* From busybox.c */ |
| 37 | extern const struct BB_applet applets[]; |
| 38 | |
Eric Andersen | 8c725e6 | 2000-11-30 00:27:06 +0000 | [diff] [blame] | 39 | /* Automagically pull in all the applet function prototypes and |
Eric Andersen | 8755982 | 2000-12-01 19:02:24 +0000 | [diff] [blame] | 40 | * applet usage strings. These are all of the form: |
Eric Andersen | 8c725e6 | 2000-11-30 00:27:06 +0000 | [diff] [blame] | 41 | * extern int foo_main(int argc, char **argv); |
| 42 | * extern const char foo_usage[]; |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 43 | * These are all autogenerated from the set of currently defined applets. |
Eric Andersen | 8c725e6 | 2000-11-30 00:27:06 +0000 | [diff] [blame] | 44 | */ |
| 45 | #define PROTOTYPES |
| 46 | #include "applets.h" |
| 47 | #undef PROTOTYPES |
Eric Andersen | f6b7139 | 2000-09-26 01:09:18 +0000 | [diff] [blame] | 48 | |
Glenn L McGrath | 60a22ad | 2002-08-22 15:54:22 +0000 | [diff] [blame] | 49 | #endif /* _BB_INTERNAL_H_ */ |