source: MondoRescue/branches/2.2.9/mindi-busybox/include/busybox.h@ 2725

Last change on this file since 2725 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File size: 1.9 KB
RevLine 
[821]1/* vi: set sw=4 ts=4: */
2/*
3 * Busybox main internal header file
4 *
[2725]5 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
[821]6 */
[2725]7#ifndef BUSYBOX_H
8#define BUSYBOX_H 1
[821]9
10#include "libbb.h"
11
[2725]12PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
13
14/* order matters: used as index into "install_dir[]" in appletlib.c */
[1765]15typedef enum bb_install_loc_t {
[821]16 _BB_DIR_ROOT = 0,
17 _BB_DIR_BIN,
18 _BB_DIR_SBIN,
[2725]19#if ENABLE_INSTALL_NO_USR
20 _BB_DIR_USR_BIN = _BB_DIR_BIN,
21 _BB_DIR_USR_SBIN = _BB_DIR_SBIN,
22#else
[821]23 _BB_DIR_USR_BIN,
[2725]24 _BB_DIR_USR_SBIN,
25#endif
[1765]26} bb_install_loc_t;
[821]27
[1765]28typedef enum bb_suid_t {
[2725]29 _BB_SUID_DROP = 0,
[821]30 _BB_SUID_MAYBE,
[2725]31 _BB_SUID_REQUIRE
[1765]32} bb_suid_t;
[2725]33
34
35/* Defined in appletlib.c (by including generated applet_tables.h) */
36/* Keep in sync with applets/applet_tables.c! */
37extern const char applet_names[];
38extern int (*const applet_main[])(int argc, char **argv);
39extern const uint16_t applet_nameofs[];
40extern const uint8_t applet_install_loc[];
41
42#if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS
43# define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff))
44#else
45# define APPLET_NAME(i) (applet_names + applet_nameofs[i])
[1765]46#endif
[821]47
[2725]48#if ENABLE_FEATURE_PREFER_APPLETS
49# define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 12))
50# define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 13))
51#else
52# define APPLET_IS_NOFORK(i) 0
53# define APPLET_IS_NOEXEC(i) 0
[1765]54#endif
[2725]55
[1765]56#if ENABLE_FEATURE_SUID
[2725]57# define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3)
[1765]58#endif
[2725]59
60#if ENABLE_FEATURE_INSTALLER
61#define APPLET_INSTALL_LOC(i) ({ \
62 unsigned v = (i); \
63 if (v & 1) v = applet_install_loc[v/2] >> 4; \
64 else v = applet_install_loc[v/2] & 0xf; \
65 v; })
[1765]66#endif
[821]67
68
[2725]69/* Length of these names has effect on size of libbusybox
70 * and "individual" binaries. Keep them short.
71 */
72#if ENABLE_BUILD_LIBBUSYBOX
73#if ENABLE_FEATURE_SHARED_BUSYBOX
74int lbb_main(char **argv) EXTERNALLY_VISIBLE;
75#else
76int lbb_main(char **argv);
77#endif
78#endif
79
80POP_SAVED_FUNCTION_VISIBILITY
81
82#endif
Note: See TracBrowser for help on using the repository browser.