diff options
author | Rob Landley <rob@landley.net> | 2006-03-06 23:47:33 +0300 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-03-06 23:47:33 +0300 |
commit | dfba741457cc81eb2ed3a9d4c074fbad74aa3249 (patch) | |
tree | 588d140a71e857cb32c80d1faad6f3073b119aa7 /libbb | |
parent | 1f5e25bf3eca768b8cee1c689ac154d8f51662f9 (diff) |
Robert P. Day removed 8 gazillion occurrences of "extern" on function
definitions. (That should only be on prototypes.)
Diffstat (limited to 'libbb')
37 files changed, 54 insertions, 54 deletions
diff --git a/libbb/bb_echo.c b/libbb/bb_echo.c index 41e6e4915..9ad73df85 100644 --- a/libbb/bb_echo.c +++ b/libbb/bb_echo.c @@ -28,7 +28,7 @@ #include <string.h> #include "busybox.h" -extern int bb_echo(int ATTRIBUTE_UNUSED argc, char **argv) +int bb_echo(int ATTRIBUTE_UNUSED argc, char **argv) { #ifndef CONFIG_FEATURE_FANCY_ECHO #define eflag '\\' diff --git a/libbb/concat_path_file.c b/libbb/concat_path_file.c index 029c23272..3c5460d47 100644 --- a/libbb/concat_path_file.c +++ b/libbb/concat_path_file.c @@ -28,7 +28,7 @@ #include <string.h> #include "libbb.h" -extern char *concat_path_file(const char *path, const char *filename) +char *concat_path_file(const char *path, const char *filename) { char *lc; diff --git a/libbb/concat_subpath_file.c b/libbb/concat_subpath_file.c index 6d86f5e8c..e72441999 100644 --- a/libbb/concat_subpath_file.c +++ b/libbb/concat_subpath_file.c @@ -28,7 +28,7 @@ #include "libbb.h" -extern char *concat_subpath_file(const char *path, const char *f) +char *concat_subpath_file(const char *path, const char *f) { if(f && *f == '.' && (!f[1] || (f[1] == '.' && !f[2]))) return NULL; diff --git a/libbb/copyfd.c b/libbb/copyfd.c index 515253148..d138f3e59 100644 --- a/libbb/copyfd.c +++ b/libbb/copyfd.c @@ -62,7 +62,7 @@ out: } -extern int bb_copyfd_size(int fd1, int fd2, const off_t size) +int bb_copyfd_size(int fd1, int fd2, const off_t size) { if (size) { return(bb_full_fd_action(fd1, fd2, size)); @@ -70,7 +70,7 @@ extern int bb_copyfd_size(int fd1, int fd2, const off_t size) return(0); } -extern int bb_copyfd_eof(int fd1, int fd2) +int bb_copyfd_eof(int fd1, int fd2) { return(bb_full_fd_action(fd1, fd2, 0)); } diff --git a/libbb/device_open.c b/libbb/device_open.c index 61f954f46..df5eae9e4 100644 --- a/libbb/device_open.c +++ b/libbb/device_open.c @@ -25,7 +25,7 @@ /* try to open up the specified device */ -extern int device_open(const char *device, int mode) +int device_open(const char *device, int mode) { int m, f, fd = -1; diff --git a/libbb/error_msg.c b/libbb/error_msg.c index 18811b8d1..2a90ba438 100644 --- a/libbb/error_msg.c +++ b/libbb/error_msg.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include "libbb.h" -extern void bb_error_msg(const char *s, ...) +void bb_error_msg(const char *s, ...) { va_list p; diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c index 0937658a3..92043a535 100644 --- a/libbb/error_msg_and_die.c +++ b/libbb/error_msg_and_die.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include "libbb.h" -extern void bb_error_msg_and_die(const char *s, ...) +void bb_error_msg_and_die(const char *s, ...) { va_list p; diff --git a/libbb/find_mount_point.c b/libbb/find_mount_point.c index 4d27b4809..83527a8c8 100644 --- a/libbb/find_mount_point.c +++ b/libbb/find_mount_point.c @@ -32,7 +32,7 @@ * Given any other file (or directory), find the mount table entry for its * filesystem. */ -extern struct mntent *find_mount_point(const char *name, const char *table) +struct mntent *find_mount_point(const char *name, const char *table) { struct stat s; dev_t mountDevice; diff --git a/libbb/find_pid_by_name.c b/libbb/find_pid_by_name.c index 24084a34f..833c96f51 100644 --- a/libbb/find_pid_by_name.c +++ b/libbb/find_pid_by_name.c @@ -23,7 +23,7 @@ * Returns a list of all matching PIDs * It is the caller's duty to free the returned pidlist. */ -extern long* find_pid_by_name( const char* pidName) +long* find_pid_by_name( const char* pidName) { long* pidList; int i=0; @@ -42,7 +42,7 @@ extern long* find_pid_by_name( const char* pidName) return pidList; } -extern long *pidlist_reverse(long *pidList) +long *pidlist_reverse(long *pidList) { int i=0; while (pidList[i] > 0 && ++i); diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c index dfe0cfa7b..d1ffc87f5 100644 --- a/libbb/find_root_device.c +++ b/libbb/find_root_device.c @@ -26,7 +26,7 @@ #include <stdlib.h> #include "libbb.h" -extern char *find_block_device(char *path) +char *find_block_device(char *path) { DIR *dir; struct dirent *entry; diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c index 5ad497ffa..44cf44869 100644 --- a/libbb/get_line_from_file.c +++ b/libbb/get_line_from_file.c @@ -45,14 +45,14 @@ char *bb_get_chunk_from_file(FILE *file, int *end) } /* Get line, including trailing /n if any */ -extern char *bb_get_line_from_file(FILE *file) +char *bb_get_line_from_file(FILE *file) { int i; return bb_get_chunk_from_file(file, &i); } /* Get line. Remove trailing /n */ -extern char *bb_get_chomped_line_from_file(FILE *file) +char *bb_get_chomped_line_from_file(FILE *file) { int i; char *c=bb_get_chunk_from_file(file, &i); diff --git a/libbb/herror_msg.c b/libbb/herror_msg.c index 87ec15acc..d0d0a15d2 100644 --- a/libbb/herror_msg.c +++ b/libbb/herror_msg.c @@ -24,7 +24,7 @@ #include "libbb.h" -extern void bb_herror_msg(const char *s, ...) +void bb_herror_msg(const char *s, ...) { va_list p; diff --git a/libbb/herror_msg_and_die.c b/libbb/herror_msg_and_die.c index 5c765f1be..9a76ef7e1 100644 --- a/libbb/herror_msg_and_die.c +++ b/libbb/herror_msg_and_die.c @@ -24,7 +24,7 @@ #include "libbb.h" -extern void bb_herror_msg_and_die(const char *s, ...) +void bb_herror_msg_and_die(const char *s, ...) { va_list p; diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c index e01aafa25..5f5d36df2 100644 --- a/libbb/kernel_version.c +++ b/libbb/kernel_version.c @@ -30,7 +30,7 @@ * so, for example, to check if the kernel is greater than 2.2.11: * if (get_kernel_revision() <= 2*65536+2*256+11) { <stuff> } */ -extern int get_kernel_revision(void) +int get_kernel_revision(void) { struct utsname name; char *s; diff --git a/libbb/llist.c b/libbb/llist.c index ce7daddee..af0a9948c 100644 --- a/libbb/llist.c +++ b/libbb/llist.c @@ -13,7 +13,7 @@ #ifdef L_llist_add_to /* Add data to the start of the linked list. */ -extern llist_t *llist_add_to(llist_t *old_head, char *new_item) +llist_t *llist_add_to(llist_t *old_head, char *new_item) { llist_t *new_head; @@ -27,7 +27,7 @@ extern llist_t *llist_add_to(llist_t *old_head, char *new_item) #ifdef L_llist_add_to_end /* Add data to the end of the linked list. */ -extern llist_t *llist_add_to_end(llist_t *list_head, char *data) +llist_t *llist_add_to_end(llist_t *list_head, char *data) { llist_t *new_item; @@ -50,7 +50,7 @@ extern llist_t *llist_add_to_end(llist_t *list_head, char *data) #ifdef L_llist_free_one /* Free the current list element and advance to the next entry in the list. * Returns a pointer to the next element. */ -extern llist_t *llist_free_one(llist_t *elm) +llist_t *llist_free_one(llist_t *elm) { llist_t *next = elm ? elm->link : NULL; #if ENABLE_DMALLOC /* avoid warnings from dmalloc's error-free-null option */ @@ -64,7 +64,7 @@ extern llist_t *llist_free_one(llist_t *elm) #ifdef L_llist_free /* Recursively free all elements in the linked list. */ -extern void llist_free(llist_t *elm) +void llist_free(llist_t *elm) { while ((elm = llist_free_one(elm))); } diff --git a/libbb/obscure.c b/libbb/obscure.c index 4d159a771..6244970de 100644 --- a/libbb/obscure.c +++ b/libbb/obscure.c @@ -244,7 +244,7 @@ obscure_msg(const char *old, const char *newval, const struct passwd *pwdp) * check passwords. */ -extern int obscure(const char *old, const char *newval, const struct passwd *pwdp) +int obscure(const char *old, const char *newval, const struct passwd *pwdp) { const char *msg = obscure_msg(old, newval, pwdp); diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c index 185957bc3..ffbf4e1d4 100644 --- a/libbb/parse_mode.c +++ b/libbb/parse_mode.c @@ -29,7 +29,7 @@ #define FILEMODEBITS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) -extern int bb_parse_mode(const char *s, mode_t *current_mode) +int bb_parse_mode(const char *s, mode_t *current_mode) { static const mode_t who_mask[] = { S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO, /* a */ diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c index 8ba053188..a0fdabc1d 100644 --- a/libbb/perror_msg.c +++ b/libbb/perror_msg.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include "libbb.h" -extern void bb_perror_msg(const char *s, ...) +void bb_perror_msg(const char *s, ...) { va_list p; diff --git a/libbb/perror_msg_and_die.c b/libbb/perror_msg_and_die.c index 15bf0421e..4a26dcce8 100644 --- a/libbb/perror_msg_and_die.c +++ b/libbb/perror_msg_and_die.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include "libbb.h" -extern void bb_perror_msg_and_die(const char *s, ...) +void bb_perror_msg_and_die(const char *s, ...) { va_list p; diff --git a/libbb/perror_nomsg.c b/libbb/perror_nomsg.c index 464cb86c4..479b2ba93 100644 --- a/libbb/perror_nomsg.c +++ b/libbb/perror_nomsg.c @@ -23,7 +23,7 @@ #include <stddef.h> #include <libbb.h> -extern void bb_perror_nomsg(void) +void bb_perror_nomsg(void) { /* Ignore the gcc warning about a null format string. */ bb_perror_msg(NULL); diff --git a/libbb/perror_nomsg_and_die.c b/libbb/perror_nomsg_and_die.c index bab228455..7cbe35e3a 100644 --- a/libbb/perror_nomsg_and_die.c +++ b/libbb/perror_nomsg_and_die.c @@ -23,7 +23,7 @@ #include <stddef.h> #include "libbb.h" -extern void bb_perror_nomsg_and_die(void) +void bb_perror_nomsg_and_die(void) { /* Ignore the gcc warning about a null format string. */ bb_perror_msg_and_die(NULL); diff --git a/libbb/print_file.c b/libbb/print_file.c index 963db1416..26bd0d458 100644 --- a/libbb/print_file.c +++ b/libbb/print_file.c @@ -24,7 +24,7 @@ #include <unistd.h> #include "libbb.h" -extern void bb_xprint_and_close_file(FILE *file) +void bb_xprint_and_close_file(FILE *file) { bb_xfflush_stdout(); /* Note: Do not use STDOUT_FILENO here, as this is a lib routine @@ -45,7 +45,7 @@ extern void bb_xprint_and_close_file(FILE *file) * exits with default error code if an error occurs */ -extern int bb_xprint_file_by_name(const char *filename) +int bb_xprint_file_by_name(const char *filename) { FILE *f; diff --git a/libbb/printf.c b/libbb/printf.c index 2cba31792..e61723242 100644 --- a/libbb/printf.c +++ b/libbb/printf.c @@ -145,7 +145,7 @@ extern int bb_vfprintf(FILE * __restrict stream, #endif #ifdef L_bb_vprintf -extern int bb_vprintf(const char * __restrict format, va_list arg) +int bb_vprintf(const char * __restrict format, va_list arg) { return bb_vfprintf(stdout, format, arg); } @@ -167,7 +167,7 @@ extern int bb_fprintf(FILE * __restrict stream, #endif #ifdef L_bb_printf -extern int bb_printf(const char * __restrict format, ...) +int bb_printf(const char * __restrict format, ...) { va_list arg; int rv; diff --git a/libbb/procps.c b/libbb/procps.c index 2ebe66e9d..e73c0dc64 100644 --- a/libbb/procps.c +++ b/libbb/procps.c @@ -34,7 +34,7 @@ static int read_to_buf(const char *filename, void *buf) } -extern procps_status_t * procps_scan(int save_user_arg0) +procps_status_t * procps_scan(int save_user_arg0) { static DIR *dir; struct dirent *entry; diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c index 727149d0c..a15339974 100644 --- a/libbb/pw_encrypt.c +++ b/libbb/pw_encrypt.c @@ -25,7 +25,7 @@ #include "libbb.h" -extern char *pw_encrypt(const char *clear, const char *salt) +char *pw_encrypt(const char *clear, const char *salt) { static char cipher[128]; char *cp; diff --git a/libbb/remove_file.c b/libbb/remove_file.c index 8b45c58b8..ee1aaa5cd 100644 --- a/libbb/remove_file.c +++ b/libbb/remove_file.c @@ -30,7 +30,7 @@ #include <getopt.h> #include "libbb.h" -extern int remove_file(const char *path, int flags) +int remove_file(const char *path, int flags) { struct stat path_stat; int path_exists = 1; diff --git a/libbb/run_parts.c b/libbb/run_parts.c index 4c8841fe5..7f5fe459b 100644 --- a/libbb/run_parts.c +++ b/libbb/run_parts.c @@ -47,7 +47,7 @@ static int valid_name(const struct dirent *d) * test_mode = 2 means to fail silently on missing directories */ -extern int run_parts(char **args, const unsigned char test_mode, char **env) +int run_parts(char **args, const unsigned char test_mode, char **env) { struct dirent **namelist = 0; struct stat st; diff --git a/libbb/safe_strncpy.c b/libbb/safe_strncpy.c index 2016e6b52..d4275698c 100644 --- a/libbb/safe_strncpy.c +++ b/libbb/safe_strncpy.c @@ -25,7 +25,7 @@ /* Like strncpy but make sure the resulting string is always 0 terminated. */ -extern char * safe_strncpy(char *dst, const char *src, size_t size) +char * safe_strncpy(char *dst, const char *src, size_t size) { dst[size-1] = '\0'; return strncpy(dst, src, size-1); diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c index bf049a2d2..fd5d72540 100644 --- a/libbb/skip_whitespace.c +++ b/libbb/skip_whitespace.c @@ -23,7 +23,7 @@ #include <ctype.h> #include "libbb.h" -extern const char *bb_skip_whitespace(const char *s) +const char *bb_skip_whitespace(const char *s) { while (isspace(*s)) { ++s; diff --git a/libbb/vdprintf.c b/libbb/vdprintf.c index 53fdbd37a..96c71ea63 100644 --- a/libbb/vdprintf.c +++ b/libbb/vdprintf.c @@ -26,7 +26,7 @@ #if (__GLIBC__ < 2) -extern int vdprintf(int d, const char *format, va_list ap) +int vdprintf(int d, const char *format, va_list ap) { char buf[BUF_SIZE]; int len; diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c index 07b37e4ad..d0fbb05c6 100644 --- a/libbb/verror_msg.c +++ b/libbb/verror_msg.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include "libbb.h" -extern void bb_verror_msg(const char *s, va_list p) +void bb_verror_msg(const char *s, va_list p) { fflush(stdout); fprintf(stderr, "%s: ", bb_applet_name); diff --git a/libbb/vherror_msg.c b/libbb/vherror_msg.c index 1560eb595..a5b1a7030 100644 --- a/libbb/vherror_msg.c +++ b/libbb/vherror_msg.c @@ -26,7 +26,7 @@ #include "libbb.h" -extern void bb_vherror_msg(const char *s, va_list p) +void bb_vherror_msg(const char *s, va_list p) { if(s == 0) s = ""; diff --git a/libbb/vperror_msg.c b/libbb/vperror_msg.c index 5c446967a..ed4ac83cd 100644 --- a/libbb/vperror_msg.c +++ b/libbb/vperror_msg.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include "libbb.h" -extern void bb_vperror_msg(const char *s, va_list p) +void bb_vperror_msg(const char *s, va_list p) { int err=errno; if(s == 0) s = ""; diff --git a/libbb/warn_ignoring_args.c b/libbb/warn_ignoring_args.c index a1fa528f4..cc35fe26a 100644 --- a/libbb/warn_ignoring_args.c +++ b/libbb/warn_ignoring_args.c @@ -22,7 +22,7 @@ #include <libbb.h> -extern void bb_warn_ignoring_args(int n) +void bb_warn_ignoring_args(int n) { if (n) { bb_perror_msg("ignoring all arguments"); diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index 6d54c1a79..4114090de 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c @@ -26,7 +26,7 @@ #ifndef DMALLOC #ifdef L_xmalloc -extern void *xmalloc(size_t size) +void *xmalloc(size_t size) { void *ptr = malloc(size); if (ptr == NULL && size != 0) @@ -36,7 +36,7 @@ extern void *xmalloc(size_t size) #endif #ifdef L_xrealloc -extern void *xrealloc(void *ptr, size_t size) +void *xrealloc(void *ptr, size_t size) { ptr = realloc(ptr, size); if (ptr == NULL && size != 0) @@ -46,7 +46,7 @@ extern void *xrealloc(void *ptr, size_t size) #endif #ifdef L_xcalloc -extern void *xcalloc(size_t nmemb, size_t size) +void *xcalloc(size_t nmemb, size_t size) { void *ptr = calloc(nmemb, size); if (ptr == NULL && nmemb != 0 && size != 0) @@ -96,7 +96,7 @@ FILE *bb_xfopen(const char *path, const char *mode) #endif #ifdef L_xopen -extern int bb_xopen(const char *pathname, int flags) +int bb_xopen(const char *pathname, int flags) { int ret; @@ -109,7 +109,7 @@ extern int bb_xopen(const char *pathname, int flags) #endif #ifdef L_xread -extern ssize_t bb_xread(int fd, void *buf, size_t count) +ssize_t bb_xread(int fd, void *buf, size_t count) { ssize_t size; @@ -122,7 +122,7 @@ extern ssize_t bb_xread(int fd, void *buf, size_t count) #endif #ifdef L_xread_all -extern void bb_xread_all(int fd, void *buf, size_t count) +void bb_xread_all(int fd, void *buf, size_t count) { ssize_t size; @@ -138,7 +138,7 @@ extern void bb_xread_all(int fd, void *buf, size_t count) #endif #ifdef L_xread_char -extern unsigned char bb_xread_char(int fd) +unsigned char bb_xread_char(int fd) { char tmp; @@ -149,7 +149,7 @@ extern unsigned char bb_xread_char(int fd) #endif #ifdef L_xferror -extern void bb_xferror(FILE *fp, const char *fn) +void bb_xferror(FILE *fp, const char *fn) { if (ferror(fp)) { bb_error_msg_and_die("%s", fn); @@ -158,14 +158,14 @@ extern void bb_xferror(FILE *fp, const char *fn) #endif #ifdef L_xferror_stdout -extern void bb_xferror_stdout(void) +void bb_xferror_stdout(void) { bb_xferror(stdout, bb_msg_standard_output); } #endif #ifdef L_xfflush_stdout -extern void bb_xfflush_stdout(void) +void bb_xfflush_stdout(void) { if (fflush(stdout)) { bb_perror_msg_and_die(bb_msg_standard_output); diff --git a/libbb/xgetlarg.c b/libbb/xgetlarg.c index f332bb37e..6d3c4d1db 100644 --- a/libbb/xgetlarg.c +++ b/libbb/xgetlarg.c @@ -13,7 +13,7 @@ #include "busybox.h" -extern long bb_xgetlarg(const char *arg, int base, long lower, long upper) +long bb_xgetlarg(const char *arg, int base, long lower, long upper) { long result; char *endptr; diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c index b3e3eda2b..1bc166bbc 100644 --- a/libbb/xreadlink.c +++ b/libbb/xreadlink.c @@ -13,7 +13,7 @@ #include <unistd.h> #include "libbb.h" -extern char *xreadlink(const char *path) +char *xreadlink(const char *path) { static const int GROWBY = 80; /* how large we will grow strings by */ |