aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-03 16:39:31 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-03 16:39:31 +0000
commit421d9e59416850968707dfec7a665cb0211b8d1c (patch)
treecee92b2a5cd0ea7298aab569ed944fdeb59dbdf2 /include
parent101a470068a62a70489797a3fdfa5084af80106e (diff)
downloadbusybox-421d9e59416850968707dfec7a665cb0211b8d1c.tar.gz
- move buffer allocation schemes to libbb.h
- include the correct headers: applets need busybox.h while lib* need libbb.h
Diffstat (limited to 'include')
-rw-r--r--include/busybox.h17
-rw-r--r--include/libbb.h18
2 files changed, 18 insertions, 17 deletions
diff --git a/include/busybox.h b/include/busybox.h
index 18f9dd56e..59d800e8b 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -62,23 +62,6 @@ extern const struct BB_applet applets[];
#include "applets.h"
#undef PROTOTYPES
-#ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
-#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
-#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
-#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
-#else
-#ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
-#define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
-#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
-#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
-#else
-#define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
-#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
-#define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
-#endif
-#endif
-
-
#ifndef RB_POWER_OFF
/* Stop system and switch power off if possible. */
#define RB_POWER_OFF 0x4321fedc
diff --git a/include/libbb.h b/include/libbb.h
index f444084b3..64a235a9f 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -59,6 +59,24 @@
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
+/* buffer allocation schemes */
+#ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
+#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
+#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
+#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
+#else
+#ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
+#define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
+#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
+#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
+#else
+#define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
+#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
+#define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
+#endif
+#endif
+
+
extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE;
extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));