Annotation of /trunk/mkinitrd-magellan/busybox/include/busybox.h
Parent Directory | Revision Log
Revision 984 -
(hide annotations)
(download)
Sun May 30 11:32:42 2010 UTC (14 years ago) by niro
File MIME type: text/plain
File size: 1794 byte(s)
Sun May 30 11:32:42 2010 UTC (14 years ago) by niro
File MIME type: text/plain
File size: 1794 byte(s)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 | niro | 532 | /* vi: set sw=4 ts=4: */ |
2 | /* | ||
3 | * Busybox main internal header file | ||
4 | * | ||
5 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. | ||
6 | */ | ||
7 | niro | 984 | #ifndef BUSYBOX_H |
8 | #define BUSYBOX_H 1 | ||
9 | niro | 532 | |
10 | #include "libbb.h" | ||
11 | |||
12 | niro | 984 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
13 | niro | 816 | |
14 | /* order matters: used as index into "install_dir[]" in appletlib.c */ | ||
15 | typedef enum bb_install_loc_t { | ||
16 | niro | 532 | _BB_DIR_ROOT = 0, |
17 | _BB_DIR_BIN, | ||
18 | _BB_DIR_SBIN, | ||
19 | _BB_DIR_USR_BIN, | ||
20 | _BB_DIR_USR_SBIN | ||
21 | niro | 816 | } bb_install_loc_t; |
22 | niro | 532 | |
23 | niro | 816 | typedef enum bb_suid_t { |
24 | niro | 984 | _BB_SUID_DROP = 0, |
25 | niro | 532 | _BB_SUID_MAYBE, |
26 | niro | 984 | _BB_SUID_REQUIRE |
27 | niro | 816 | } bb_suid_t; |
28 | niro | 532 | |
29 | |||
30 | niro | 816 | /* Defined in appletlib.c (by including generated applet_tables.h) */ |
31 | /* Keep in sync with applets/applet_tables.c! */ | ||
32 | extern const char applet_names[]; | ||
33 | extern int (*const applet_main[])(int argc, char **argv); | ||
34 | extern const uint16_t applet_nameofs[]; | ||
35 | extern const uint8_t applet_install_loc[]; | ||
36 | niro | 532 | |
37 | niro | 816 | #if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS |
38 | #define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff)) | ||
39 | #else | ||
40 | #define APPLET_NAME(i) (applet_names + applet_nameofs[i]) | ||
41 | #endif | ||
42 | |||
43 | #if ENABLE_FEATURE_PREFER_APPLETS | ||
44 | #define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 12)) | ||
45 | #define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 13)) | ||
46 | #endif | ||
47 | |||
48 | #if ENABLE_FEATURE_SUID | ||
49 | #define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3) | ||
50 | #endif | ||
51 | |||
52 | #if ENABLE_FEATURE_INSTALLER | ||
53 | #define APPLET_INSTALL_LOC(i) ({ \ | ||
54 | unsigned v = (i); \ | ||
55 | if (v & 1) v = applet_install_loc[v/2] >> 4; \ | ||
56 | else v = applet_install_loc[v/2] & 0xf; \ | ||
57 | v; }) | ||
58 | #endif | ||
59 | |||
60 | |||
61 | /* Length of these names has effect on size of libbusybox | ||
62 | * and "individual" binaries. Keep them short. | ||
63 | niro | 532 | */ |
64 | niro | 816 | #if ENABLE_BUILD_LIBBUSYBOX |
65 | #if ENABLE_FEATURE_SHARED_BUSYBOX | ||
66 | int lbb_main(char **argv) EXTERNALLY_VISIBLE; | ||
67 | #else | ||
68 | int lbb_main(char **argv); | ||
69 | #endif | ||
70 | #endif | ||
71 | niro | 532 | |
72 | niro | 984 | POP_SAVED_FUNCTION_VISIBILITY |
73 | |||
74 | niro | 816 | #endif |