#include "Config.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/param.h>
+#include <sys/types.h>
#include <mntent.h>
#include <regex.h>
/* for the _syscall() macros */
#include <sys/syscall.h>
#include <linux/unistd.h>
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
/* Some useful definitions */
#define FALSE ((int) 0)
#define TRUE ((int) 1)
+#define SKIP ((int) 2)
/* for mtab.c */
#define MTAB_GETMOUNTPT '1'
extern FILE *wfopen(const char *path, const char *mode);
extern FILE *xfopen(const char *path, const char *mode);
-#ifndef DMALLOC
+#ifndef DMALLOC
extern void *xmalloc (size_t size);
extern void *xrealloc(void *old, size_t size);
extern void *xcalloc(size_t nmemb, size_t size);
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
#endif
+#ifdef BB_FEATURE_HUMAN_READABLE
+char *format(unsigned long val, unsigned long hr);
+#define KILOBYTE 1024
+#define MEGABYTE (KILOBYTE*1024)
+#define GIGABYTE (MEGABYTE*1024)
+#endif
+
+#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[len]
+#else
+#define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len)
+#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
+#endif
+
#endif /* _BB_INTERNAL_H_ */