busybox.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* 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. #ifndef _BB_INTERNAL_H_
  8. #define _BB_INTERNAL_H_ 1
  9. #include "libbb.h"
  10. /* order matters: used as index into "install_dir[]" in busybox.c */
  11. enum Location {
  12. _BB_DIR_ROOT = 0,
  13. _BB_DIR_BIN,
  14. _BB_DIR_SBIN,
  15. _BB_DIR_USR_BIN,
  16. _BB_DIR_USR_SBIN
  17. };
  18. enum SUIDRoot {
  19. _BB_SUID_NEVER = 0,
  20. _BB_SUID_MAYBE,
  21. _BB_SUID_ALWAYS
  22. };
  23. struct BB_applet {
  24. const char *name;
  25. int (*main) (int argc, char **argv);
  26. __extension__ enum Location location:4;
  27. __extension__ enum SUIDRoot need_suid:4;
  28. };
  29. /* From busybox.c */
  30. extern const struct BB_applet applets[];
  31. /* Automagically pull in all the applet function prototypes and
  32. * applet usage strings. These are all of the form:
  33. * extern int foo_main(int argc, char **argv);
  34. * extern const char foo_usage[];
  35. * These are all autogenerated from the set of currently defined applets.
  36. */
  37. #define PROTOTYPES
  38. #include "applets.h"
  39. #undef PROTOTYPES
  40. #endif /* _BB_INTERNAL_H_ */