aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-05-31 22:09:03 +0000
committerRob Landley <rob@landley.net>2006-05-31 22:09:03 +0000
commitb623a542dff149151c892344e2343a9e245275de (patch)
tree5170f214530005b5cb3ef2a89f0342bd8b9d1bda
parent8abbee474c4eff45bdc2cacb59047f466e1d6ae1 (diff)
downloadbusybox-w32-b623a542dff149151c892344e2343a9e245275de.tar.gz
busybox-w32-b623a542dff149151c892344e2343a9e245275de.tar.bz2
busybox-w32-b623a542dff149151c892344e2343a9e245275de.zip
Header file cleanup. platform.h apparently needs to be included early on so it
can figure out what header files to include, and override stuff that comes later. But applets shouldn't include platform.h directly, they should include busybox.h or libbb.h. Since busybox.h already includes libbb.h, move libbb.h to the top of busybox.h and platform.h near the top of libbb.h (right after bbconfig.h, which is something platform.h also needs access to). While we're at it, move some stuff from busybox.h to libbb.h so we have one big file to audit/clean up/try to make sense of instead of many.
-rw-r--r--include/busybox.h27
-rw-r--r--include/libbb.h30
2 files changed, 21 insertions, 36 deletions
diff --git a/include/busybox.h b/include/busybox.h
index 1f9f9775f..befbea544 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -9,15 +9,6 @@
9 9
10#include "bb_config.h" 10#include "bb_config.h"
11 11
12#include <stdio.h>
13#include <stdlib.h>
14#include <stdarg.h>
15#include <sys/types.h>
16#include <sys/stat.h>
17
18extern const char BB_BANNER[];
19
20/* Pull in the utility routines from libbb */
21#include "libbb.h" 12#include "libbb.h"
22 13
23enum Location { 14enum Location {
@@ -54,22 +45,4 @@ extern const struct BB_applet applets[];
54#include "applets.h" 45#include "applets.h"
55#undef PROTOTYPES 46#undef PROTOTYPES
56 47
57#ifndef RB_POWER_OFF
58/* Stop system and switch power off if possible. */
59#define RB_POWER_OFF 0x4321fedc
60#endif
61
62/* Try to pull in PATH_MAX */
63#include <limits.h>
64
65/* for PATH_MAX on systems that don't have it in limits.h */
66#include <sys/param.h>
67#ifndef PATH_MAX
68#define PATH_MAX 256
69#endif
70
71#ifdef DMALLOC
72#include <dmalloc.h>
73#endif
74
75#endif /* _BB_INTERNAL_H_ */ 48#endif /* _BB_INTERNAL_H_ */
diff --git a/include/libbb.h b/include/libbb.h
index e4be35d48..4293d394b 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -11,23 +11,22 @@
11#ifndef __LIBBUSYBOX_H__ 11#ifndef __LIBBUSYBOX_H__
12#define __LIBBUSYBOX_H__ 1 12#define __LIBBUSYBOX_H__ 1
13 13
14#include "bb_config.h"
14#include "platform.h" 15#include "platform.h"
15 16
17#include <dirent.h>
18#include <inttypes.h>
19#include <netdb.h>
16#include <stdio.h> 20#include <stdio.h>
17#include <stdlib.h> 21#include <stdlib.h>
18#include <stdarg.h> 22#include <stdarg.h>
19#include <sys/types.h>
20#include <sys/stat.h> 23#include <sys/stat.h>
24#include <sys/time.h>
25#include <sys/types.h>
21#include <termios.h> 26#include <termios.h>
22#include <dirent.h>
23 27
24#include <netinet/in.h>
25#include <netdb.h>
26 28
27#include <inttypes.h>
28#include <sys/time.h>
29 29
30#include "bb_config.h"
31#ifdef CONFIG_SELINUX 30#ifdef CONFIG_SELINUX
32#include <selinux/selinux.h> 31#include <selinux/selinux.h>
33#endif 32#endif
@@ -526,9 +525,22 @@ void *md5_end(void *resbuf, md5_ctx_t *ctx);
526 525
527extern uint32_t *bb_crc32_filltable (int endian); 526extern uint32_t *bb_crc32_filltable (int endian);
528 527
529/* busybox.h will include dmalloc later for us, else include it here. */ 528#ifndef RB_POWER_OFF
530#if !defined _BB_INTERNAL_H_ && defined DMALLOC 529/* Stop system and switch power off if possible. */
530#define RB_POWER_OFF 0x4321fedc
531#endif
532
533/* Try to pull in PATH_MAX */
534#include <limits.h>
535#include <sys/param.h>
536#ifndef PATH_MAX
537#define PATH_MAX 256
538#endif
539
540#ifdef DMALLOC
531#include <dmalloc.h> 541#include <dmalloc.h>
532#endif 542#endif
533 543
544extern const char BB_BANNER[];
545
534#endif /* __LIBBUSYBOX_H__ */ 546#endif /* __LIBBUSYBOX_H__ */