aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
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[];
62#include "applets.h" 62#include "applets.h"
63#undef PROTOTYPES 63#undef PROTOTYPES
64 64
65#ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
66#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
67#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
68#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
69#else
70#ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
71#define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
72#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
73#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
74#else
75#define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
76#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
77#define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
78#endif
79#endif
80
81
82#ifndef RB_POWER_OFF 65#ifndef RB_POWER_OFF
83/* Stop system and switch power off if possible. */ 66/* Stop system and switch power off if possible. */
84#define RB_POWER_OFF 0x4321fedc 67#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 @@
59#define MAX(a,b) (((a)>(b))?(a):(b)) 59#define MAX(a,b) (((a)>(b))?(a):(b))
60#endif 60#endif
61 61
62/* buffer allocation schemes */
63#ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
64#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
65#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
66#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
67#else
68#ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
69#define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
70#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
71#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
72#else
73#define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
74#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
75#define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
76#endif
77#endif
78
79
62extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE; 80extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE;
63extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 81extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
64extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); 82extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));