diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-01-27 08:24:39 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-01-27 08:24:39 +0000 |
commit | ed3ef50c233ffb1b50ea0e7382a8e60b86491009 (patch) | |
tree | ecb05ce51890c2cf84ad036543a972ac812320c3 /include | |
parent | ab050f5522e843bf08994685134adaaac7ffd392 (diff) | |
download | busybox-w32-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.tar.gz busybox-w32-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.tar.bz2 busybox-w32-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.zip |
Fix header file usage -- there were many unnecessary header files included in
busybox.h which slowed compiles. I left only what was needed and then fixed up
all the apps to include their own header files. I also fixed naming for pwd.h
and grp.h functions. Tested to compile and run with libc5, glibc, and uClibc.
-Erik
Diffstat (limited to 'include')
-rw-r--r-- | include/busybox.h | 32 | ||||
-rw-r--r-- | include/grp.h | 28 | ||||
-rw-r--r-- | include/pwd.h | 29 |
3 files changed, 19 insertions, 70 deletions
diff --git a/include/busybox.h b/include/busybox.h index be6c6f305..5f9425a5b 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -26,19 +26,10 @@ | |||
26 | 26 | ||
27 | #include "Config.h" | 27 | #include "Config.h" |
28 | 28 | ||
29 | #include <stdlib.h> | 29 | #include <stdio.h> |
30 | #include <stdarg.h> | 30 | #include <stdarg.h> |
31 | #include <string.h> | ||
32 | #include <unistd.h> | ||
33 | #include <errno.h> | ||
34 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
35 | #include <sys/param.h> | ||
36 | #include <sys/types.h> | 32 | #include <sys/types.h> |
37 | #include <mntent.h> | ||
38 | #include <regex.h> | ||
39 | /* for the _syscall() macros */ | ||
40 | #include <sys/syscall.h> | ||
41 | #include <linux/unistd.h> | ||
42 | 33 | ||
43 | #ifdef DMALLOC | 34 | #ifdef DMALLOC |
44 | #include "dmalloc.h" | 35 | #include "dmalloc.h" |
@@ -69,26 +60,6 @@ static inline int is_octal(ch) { return ((ch >= '0') && (ch <= '7')); } | |||
69 | #endif | 60 | #endif |
70 | 61 | ||
71 | 62 | ||
72 | /* I don't like nested includes, but the string and io functions are used | ||
73 | * too often | ||
74 | */ | ||
75 | #include <stdio.h> | ||
76 | #if !defined(NO_STRING_H) || defined(STDC_HEADERS) | ||
77 | # include <string.h> | ||
78 | # if !defined(STDC_HEADERS) && !defined(NO_MEMORY_H) && !defined(__GNUC__) | ||
79 | # include <memory.h> | ||
80 | # endif | ||
81 | # define memzero(s, n) memset ((void *)(s), 0, (n)) | ||
82 | #else | ||
83 | # include <strings.h> | ||
84 | # define strchr index | ||
85 | # define strrchr rindex | ||
86 | # define memcpy(d, s, n) bcopy((s), (d), (n)) | ||
87 | # define memcmp(s1, s2, n) bcmp((s1), (s2), (n)) | ||
88 | # define memzero(s, n) bzero((s), (n)) | ||
89 | #endif | ||
90 | |||
91 | |||
92 | enum Location { | 63 | enum Location { |
93 | _BB_DIR_ROOT = 0, | 64 | _BB_DIR_ROOT = 0, |
94 | _BB_DIR_BIN, | 65 | _BB_DIR_BIN, |
@@ -179,7 +150,6 @@ extern void print_file(FILE *file); | |||
179 | extern int print_file_by_name(char *filename); | 150 | extern int print_file_by_name(char *filename); |
180 | extern char process_escape_sequence(char **ptr); | 151 | extern char process_escape_sequence(char **ptr); |
181 | extern char *get_last_path_component(char *path); | 152 | extern char *get_last_path_component(char *path); |
182 | extern void xregcomp(regex_t *preg, const char *regex, int cflags); | ||
183 | extern FILE *wfopen(const char *path, const char *mode); | 153 | extern FILE *wfopen(const char *path, const char *mode); |
184 | extern FILE *xfopen(const char *path, const char *mode); | 154 | extern FILE *xfopen(const char *path, const char *mode); |
185 | 155 | ||
diff --git a/include/grp.h b/include/grp.h index f27c466fd..87d4115ce 100644 --- a/include/grp.h +++ b/include/grp.h | |||
@@ -5,16 +5,6 @@ | |||
5 | #include <grp.h> | 5 | #include <grp.h> |
6 | #else | 6 | #else |
7 | 7 | ||
8 | #define bb_setgrent setgrent | ||
9 | #define bb_endgrent endgrent | ||
10 | #define bb_getgrent getgrent | ||
11 | #define bb_getgrgid getgrgid | ||
12 | #define bb_getgrnam getgrnam | ||
13 | #define bb_fgetgrent fgetgrent | ||
14 | #define bb_setgroups setgroups | ||
15 | #define bb_initgroups initgroups | ||
16 | #define __bb_getgrent __getgrent | ||
17 | |||
18 | #include <sys/types.h> | 8 | #include <sys/types.h> |
19 | #include <features.h> | 9 | #include <features.h> |
20 | #include <stdio.h> | 10 | #include <stdio.h> |
@@ -28,19 +18,19 @@ struct group | |||
28 | char **gr_mem; /* Member list. */ | 18 | char **gr_mem; /* Member list. */ |
29 | }; | 19 | }; |
30 | 20 | ||
31 | extern void bb_setgrent __P ((void)); | 21 | extern void setgrent __P ((void)); |
32 | extern void bb_endgrent __P ((void)); | 22 | extern void endgrent __P ((void)); |
33 | extern struct group * bb_getgrent __P ((void)); | 23 | extern struct group * getgrent __P ((void)); |
34 | 24 | ||
35 | extern struct group * bb_getgrgid __P ((__const gid_t gid)); | 25 | extern struct group * getgrgid __P ((__const gid_t gid)); |
36 | extern struct group * bb_getgrnam __P ((__const char * name)); | 26 | extern struct group * getgrnam __P ((__const char * name)); |
37 | 27 | ||
38 | extern struct group * bb_fgetgrent __P ((FILE * file)); | 28 | extern struct group * fgetgrent __P ((FILE * file)); |
39 | 29 | ||
40 | extern int bb_setgroups __P ((size_t n, __const gid_t * groups)); | 30 | extern int setgroups __P ((size_t n, __const gid_t * groups)); |
41 | extern int bb_initgroups __P ((__const char * user, gid_t gid)); | 31 | extern int initgroups __P ((__const char * user, gid_t gid)); |
42 | 32 | ||
43 | extern struct group * __bb_getgrent __P ((int grp_fd)); | 33 | extern struct group * __getgrent __P ((int grp_fd)); |
44 | 34 | ||
45 | #endif /* USE_SYSTEM_PWD_GRP */ | 35 | #endif /* USE_SYSTEM_PWD_GRP */ |
46 | #endif /* __BB_GRP_H */ | 36 | #endif /* __BB_GRP_H */ |
diff --git a/include/pwd.h b/include/pwd.h index 82743f5ad..e603a96e3 100644 --- a/include/pwd.h +++ b/include/pwd.h | |||
@@ -5,17 +5,6 @@ | |||
5 | #include <pwd.h> | 5 | #include <pwd.h> |
6 | #else | 6 | #else |
7 | 7 | ||
8 | #define bb_setpwent setpwent | ||
9 | #define bb_endpwent endpwent | ||
10 | #define bb_getpwent getpwent | ||
11 | #define bb_putpwent putpwent | ||
12 | #define bb_getpw getpw | ||
13 | #define bb_fgetpwent fgetpwent | ||
14 | #define bb_getpwuid getpwuid | ||
15 | #define bb_getpwnam getpwnam | ||
16 | #define __bb_getpwent __bb_getpwent | ||
17 | |||
18 | |||
19 | #include <sys/types.h> | 8 | #include <sys/types.h> |
20 | #include <features.h> | 9 | #include <features.h> |
21 | #include <stdio.h> | 10 | #include <stdio.h> |
@@ -32,19 +21,19 @@ struct passwd | |||
32 | char *pw_shell; /* Shell program. */ | 21 | char *pw_shell; /* Shell program. */ |
33 | }; | 22 | }; |
34 | 23 | ||
35 | extern void bb_setpwent __P ((void)); | 24 | extern void setpwent __P ((void)); |
36 | extern void bb_endpwent __P ((void)); | 25 | extern void endpwent __P ((void)); |
37 | extern struct passwd * bb_getpwent __P ((void)); | 26 | extern struct passwd * getpwent __P ((void)); |
38 | 27 | ||
39 | extern int bb_putpwent __P ((__const struct passwd * __p, FILE * __f)); | 28 | extern int putpwent __P ((__const struct passwd * __p, FILE * __f)); |
40 | extern int bb_getpw __P ((uid_t uid, char *buf)); | 29 | extern int getpw __P ((uid_t uid, char *buf)); |
41 | 30 | ||
42 | extern struct passwd * bb_fgetpwent __P ((FILE * file)); | 31 | extern struct passwd * fgetpwent __P ((FILE * file)); |
43 | 32 | ||
44 | extern struct passwd * bb_getpwuid __P ((__const uid_t)); | 33 | extern struct passwd * getpwuid __P ((__const uid_t)); |
45 | extern struct passwd * bb_getpwnam __P ((__const char *)); | 34 | extern struct passwd * getpwnam __P ((__const char *)); |
46 | 35 | ||
47 | extern struct passwd * __bb_getpwent __P ((__const int passwd_fd)); | 36 | extern struct passwd * __getpwent __P ((__const int passwd_fd)); |
48 | 37 | ||
49 | #endif /* USE_SYSTEM_PWD_GRP */ | 38 | #endif /* USE_SYSTEM_PWD_GRP */ |
50 | #endif /* __BB_PWD_H */ | 39 | #endif /* __BB_PWD_H */ |