blob: 76ff7b76aaf505270c7144e1857ea9970951d7cc [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
Robert Grieblc9aca452002-06-04 20:06:25 +000010#include "libbb.h"
Eric Andersenc3196012001-03-14 01:15:06 +000011
Denis Vlasenko0ee39992006-12-24 15:23:28 +000012/* order matters: used as index into "install_dir[]" in busybox.c */
Eric Andersenf6b71392000-09-26 01:09:18 +000013enum 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 Grieblc9aca452002-06-04 20:06:25 +000021enum SUIDRoot {
22 _BB_SUID_NEVER = 0,
23 _BB_SUID_MAYBE,
24 _BB_SUID_ALWAYS
25};
26
Eric Andersenf6b71392000-09-26 01:09:18 +000027struct BB_applet {
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000028 const char *name;
29 int (*main) (int argc, char **argv);
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000030 __extension__ enum Location location:4;
31 __extension__ enum SUIDRoot need_suid:4;
Eric Andersenf6b71392000-09-26 01:09:18 +000032};
Glenn L McGrath60a22ad2002-08-22 15:54:22 +000033
Denis Vlasenkoc7ba8b92007-02-03 17:27:14 +000034/* Defined in busybox.c and applet.c */
Denis Vlasenko765996a2006-12-24 16:59:27 +000035extern int busybox_main(int argc, char **argv);
Eric Andersenf6b71392000-09-26 01:09:18 +000036extern const struct BB_applet applets[];
Denis Vlasenko0ee39992006-12-24 15:23:28 +000037extern const unsigned short NUM_APPLETS;
Eric Andersenf6b71392000-09-26 01:09:18 +000038
Denis Vlasenkoc7ba8b92007-02-03 17:27:14 +000039#endif /* _BB_INTERNAL_H_ */