blob: fbda6efcb553c2850ad8d5cfc055a566ea5eb655 [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
Rob Landley193c8c72005-07-27 06:55:36 +000010#include "bb_config.h"
Eric Andersenf6b71392000-09-26 01:09:18 +000011
Robert Grieblc9aca452002-06-04 20:06:25 +000012#include "libbb.h"
Eric Andersenc3196012001-03-14 01:15:06 +000013
Paul Fox6ba8bbe2006-06-09 12:25:10 +000014/* order matters: used as index into "install_dir[]" in busybox.c */
Eric Andersenf6b71392000-09-26 01:09:18 +000015enum 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 Grieblc9aca452002-06-04 20:06:25 +000023enum SUIDRoot {
24 _BB_SUID_NEVER = 0,
25 _BB_SUID_MAYBE,
26 _BB_SUID_ALWAYS
27};
28
Eric Andersenf6b71392000-09-26 01:09:18 +000029struct BB_applet {
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000030 const char *name;
31 int (*main) (int argc, char **argv);
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000032 __extension__ enum Location location:4;
33 __extension__ enum SUIDRoot need_suid:4;
Eric Andersenf6b71392000-09-26 01:09:18 +000034};
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000035
Eric Andersenf6b71392000-09-26 01:09:18 +000036/* From busybox.c */
37extern const struct BB_applet applets[];
38
Eric Andersen8c725e62000-11-30 00:27:06 +000039/* Automagically pull in all the applet function prototypes and
Eric Andersen87559822000-12-01 19:02:24 +000040 * applet usage strings. These are all of the form:
Eric Andersen8c725e62000-11-30 00:27:06 +000041 * extern int foo_main(int argc, char **argv);
42 * extern const char foo_usage[];
Eric Andersenc7bda1c2004-03-15 08:29:22 +000043 * These are all autogenerated from the set of currently defined applets.
Eric Andersen8c725e62000-11-30 00:27:06 +000044 */
45#define PROTOTYPES
46#include "applets.h"
47#undef PROTOTYPES
Eric Andersenf6b71392000-09-26 01:09:18 +000048
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000049#endif /* _BB_INTERNAL_H_ */