summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorEric Andersen2001-03-19 19:30:24 +0000
committerEric Andersen2001-03-19 19:30:24 +0000
commit2ccfef2004675cc6cb18b9cdad1ebdaf892a10c2 (patch)
tree16b0e70cfb8994ee2249c77ba57cef3f56713d2d /applets
parent23c1a18126aba2b2c3b5a818b826ae7f958cf4bd (diff)
downloadbusybox-2ccfef2004675cc6cb18b9cdad1ebdaf892a10c2.zip
busybox-2ccfef2004675cc6cb18b9cdad1ebdaf892a10c2.tar.gz
Patch from Vladimir to move struct applet from busybox.c to applets.c,
which looks like the right place for such things to live.
Diffstat (limited to 'applets')
-rw-r--r--applets/applets.c8
-rw-r--r--applets/busybox.c5
2 files changed, 8 insertions, 5 deletions
diff --git a/applets/applets.c b/applets/applets.c
index 1e31e89..5151103 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -29,12 +29,20 @@
#include <stdlib.h>
#include "busybox.h"
+#undef APPLET
+#undef APPLET_NOUSAGE
+#undef PROTOTYPES
+#include "applets.h"
+
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
struct BB_applet *applet_using;
+/* The -1 arises because of the {0,NULL,0,-1} entry above. */
+const size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
+
extern void show_usage(void)
{
const char *format_string;
diff --git a/applets/busybox.c b/applets/busybox.c
index 0250e4c..2872f1e 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -6,11 +6,6 @@
#include <stdlib.h>
#include "busybox.h"
-#undef APPLET
-#undef APPLET_NOUSAGE
-#undef PROTOTYPES
-#include "applets.h"
-
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"