#include "dmalloc.h"
#endif
+#include <features.h>
+/* Stupid libc doesn't have a reliable way for use to know
+ * that libc5 is being used. Assume this is good enough */
+#if ! defined __GLIBC__ && ! defined __UCLIBC__
+/* libc5 doesn't define socklen_t */
+typedef unsigned int socklen_t;
+#endif
+
+
/* Some useful definitions */
#define FALSE ((int) 0)
#define TRUE ((int) 1)
extern FILE *wfopen(const char *path, const char *mode);
extern FILE *xfopen(const char *path, const char *mode);
extern void chomp(char *s);
+extern void trim(char *s);
extern struct BB_applet *find_applet_by_name(const char *name);
void run_applet_by_name(const char *name, int argc, char **argv);
#define RB_POWER_OFF 0x4321fedc
#endif
+#if defined(BB_KLOGD) || defined(BB_LOGGER)
+void syslog_msg_with_name(const char *name, int facility, int pri, const char *msg);
+void syslog_msg(int facility, int pri, const char *msg);
+#endif
+
/* Include our own copy of struct sysinfo to avoid binary compatability
* problems with Linux 2.4, which changed things. Grumble, grumble. */
struct sysinfo {
#endif
#ifdef BB_FEATURE_HUMAN_READABLE
-const char *format(unsigned long val, unsigned long hr);
+const char *make_human_readable_str(unsigned long val, unsigned long hr);
#endif
-#define KILOBYTE 1024
-#define MEGABYTE (KILOBYTE*1024)
-#define GIGABYTE (MEGABYTE*1024)
+enum {
+ KILOBYTE = 1024,
+ MEGABYTE = (KILOBYTE*1024),
+ GIGABYTE = (MEGABYTE*1024)
+};
#ifdef BB_FEATURE_BUFFERS_GO_ON_STACK
#define RESERVE_BB_BUFFER(buffer,len) char buffer[len]
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
#endif
+#if defined(BB_FEATURE_RM_INTERACTIVE) && defined(BB_RM)
+int ask_confirmation(void);
+#endif
+
#endif /* _BB_INTERNAL_H_ */