From 2ccfef2004675cc6cb18b9cdad1ebdaf892a10c2 Mon Sep 17 00:00:00 2001
From: Eric Andersen <andersen@codepoet.org>
Date: Mon, 19 Mar 2001 19:30:24 +0000
Subject: Patch from Vladimir to move struct applet from busybox.c to
 applets.c, which looks like the right place for such things to live.

---
 applets.c         | 8 ++++++++
 applets.h         | 3 ---
 applets/applets.c | 8 ++++++++
 applets/busybox.c | 5 -----
 busybox.c         | 5 -----
 include/applets.h | 3 ---
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/applets.c b/applets.c
index 1e31e8925..515110372 100644
--- a/applets.c
+++ b/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.h b/applets.h
index f7f68cd8d..8c59507ce 100644
--- a/applets.h
+++ b/applets.h
@@ -436,7 +436,4 @@
 	{ 0,NULL,0 }
 };
 
-/* The -1 arises because of the {0,NULL,0,-1} entry above. */
-size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
-
 #endif
diff --git a/applets/applets.c b/applets/applets.c
index 1e31e8925..515110372 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 0250e4c10..2872f1e38 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"
diff --git a/busybox.c b/busybox.c
index 0250e4c10..2872f1e38 100644
--- a/busybox.c
+++ b/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"
diff --git a/include/applets.h b/include/applets.h
index f7f68cd8d..8c59507ce 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -436,7 +436,4 @@
 	{ 0,NULL,0 }
 };
 
-/* The -1 arises because of the {0,NULL,0,-1} entry above. */
-size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
-
 #endif
-- 
cgit v1.2.3-55-g6feb