-#include "bb_config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if __GNU_LIBRARY__ < 5 && \
- !defined(__dietlibc__) && \
- !defined(_NEWLIB_VERSION)
-#error "Sorry, this libc version is not supported :("
-#endif
-
-#ifndef BB_EXTRA_VERSION
-#define BB_BANNER "BusyBox v" BB_VER " (" BB_BT ")"
+#include "libbb.h"
+/* BB_DIR_foo and BB_SUID_bar constants: */
+#include "applet_metadata.h"
+
+PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
+
+/* Defined in appletlib.c (by including generated applet_tables.h) */
+/* Keep in sync with applets/applet_tables.c! */
+extern const char applet_names[] ALIGN1;
+extern int (*const applet_main[])(int argc, char **argv);
+extern const uint8_t applet_flags[] ALIGN1;
+extern const uint8_t applet_suid[] ALIGN1;
+extern const uint8_t applet_install_loc[] ALIGN1;
+
+#if ENABLE_FEATURE_PREFER_APPLETS \
+ || ENABLE_FEATURE_SH_STANDALONE \
+ || ENABLE_FEATURE_SH_NOFORK
+# define APPLET_IS_NOFORK(i) (applet_flags[(i)/4] & (1 << (2 * ((i)%4))))
+# define APPLET_IS_NOEXEC(i) (applet_flags[(i)/4] & (1 << ((2 * ((i)%4))+1)))