A cleanup patch from Jeff Garzik to static-ify a number of

namespace polluting things that really should be static.
This commit is contained in:
Eric Andersen 2001-03-09 21:24:12 +00:00
parent dd91724aa0
commit 3e6ff9017f
48 changed files with 156 additions and 158 deletions

View file

@ -79,9 +79,9 @@ static const char *statuswords[][10] = {
"post-inst-failed", "removal-failed", 0 } "post-inst-failed", "removal-failed", 0 }
}; };
const int color_white = 0; static const int color_white = 0;
const int color_grey = 1; static const int color_grey = 1;
const int color_black = 2; static const int color_black = 2;
/* data structures */ /* data structures */
typedef struct package_s { typedef struct package_s {

View file

@ -150,7 +150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
#ifdef BB_FEATURE_TAR_GZIP #ifdef BB_FEATURE_TAR_GZIP
/* Signal handler for when child gzip process dies... */ /* Signal handler for when child gzip process dies... */
void child_died() static void child_died()
{ {
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
@ -186,7 +186,7 @@ extern int tar_unzip_init(int tarFd)
#endif #endif
#if defined BB_FEATURE_TAR_EXCLUDE #if defined BB_FEATURE_TAR_EXCLUDE
struct option longopts[] = { static struct option longopts[] = {
{ "exclude", 1, NULL, 'e' }, { "exclude", 1, NULL, 'e' },
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
}; };
@ -574,7 +574,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
return( FALSE); return( FALSE);
} }
int exclude_file(char **excluded_files, const char *file) static int exclude_file(char **excluded_files, const char *file)
{ {
int i; int i;
@ -601,7 +601,7 @@ int exclude_file(char **excluded_files, const char *file)
return 0; return 0;
} }
int extract_file(char **extract_files, const char *file) static int extract_file(char **extract_files, const char *file)
{ {
int i; int i;

View file

@ -46,7 +46,7 @@
/* Default input handling to save suprising some people */ /* Default input handling to save suprising some people */
struct tm *date_conv_time(struct tm *tm_time, const char *t_string) static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
{ {
int nr; int nr;
@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
/* The new stuff for LRP */ /* The new stuff for LRP */
struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
{ {
struct tm t; struct tm t;

View file

@ -29,7 +29,7 @@
#include <string.h> #include <string.h>
#include "busybox.h" #include "busybox.h"
int head(int len, FILE *fp) static int head(int len, FILE *fp)
{ {
int i; int i;
char *input; char *input;

View file

@ -156,9 +156,9 @@ struct dnode { /* the basic node */
}; };
typedef struct dnode dnode_t; typedef struct dnode dnode_t;
struct dnode **list_dir(char *); static struct dnode **list_dir(char *);
struct dnode **dnalloc(int); static struct dnode **dnalloc(int);
int list_single(struct dnode *); static int list_single(struct dnode *);
static unsigned int disp_opts; static unsigned int disp_opts;
static unsigned int style_fmt; static unsigned int style_fmt;
@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH;
static int status = EXIT_SUCCESS; static int status = EXIT_SUCCESS;
#ifdef BB_FEATURE_HUMAN_READABLE #ifdef BB_FEATURE_HUMAN_READABLE
unsigned long ls_disp_hr = 0; static unsigned long ls_disp_hr = 0;
#endif #endif
static int my_stat(struct dnode *cur) static int my_stat(struct dnode *cur)
@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn)
strcmp(dn->name, "..") != 0); strcmp(dn->name, "..") != 0);
} }
int countdirs(struct dnode **dn, int nfiles) static int countdirs(struct dnode **dn, int nfiles)
{ {
int i, dirs; int i, dirs;
@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles)
return(dirs); return(dirs);
} }
int countsubdirs(struct dnode **dn, int nfiles) static int countsubdirs(struct dnode **dn, int nfiles)
{ {
int i, subdirs; int i, subdirs;
@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles)
return subdirs; return subdirs;
} }
int countfiles(struct dnode **dnp) static int countfiles(struct dnode **dnp)
{ {
int nfiles; int nfiles;
struct dnode *cur; struct dnode *cur;
@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp)
} }
/* get memory to hold an array of pointers */ /* get memory to hold an array of pointers */
struct dnode **dnalloc(int num) static struct dnode **dnalloc(int num)
{ {
struct dnode **p; struct dnode **p;
@ -303,7 +303,7 @@ struct dnode **dnalloc(int num)
return(p); return(p);
} }
void dfree(struct dnode **dnp) static void dfree(struct dnode **dnp)
{ {
struct dnode *cur, *next; struct dnode *cur, *next;
@ -319,7 +319,7 @@ void dfree(struct dnode **dnp)
free(dnp); /* free the array holding the dnode pointers */ free(dnp); /* free the array holding the dnode pointers */
} }
struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
{ {
int dncnt, i, d; int dncnt, i, d;
struct dnode **dnp; struct dnode **dnp;
@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#ifdef BB_FEATURE_LS_SORTFILES #ifdef BB_FEATURE_LS_SORTFILES
int sortcmp(struct dnode *d1, struct dnode *d2) static int sortcmp(struct dnode *d1, struct dnode *d2)
{ {
int cmp, dif; int cmp, dif;
@ -396,7 +396,7 @@ int sortcmp(struct dnode *d1, struct dnode *d2)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void shellsort(struct dnode **dn, int size) static void shellsort(struct dnode **dn, int size)
{ {
struct dnode *temp; struct dnode *temp;
int gap, i, j; int gap, i, j;
@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size)
#endif #endif
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void showfiles(struct dnode **dn, int nfiles) static void showfiles(struct dnode **dn, int nfiles)
{ {
int i, ncols, nrows, row, nc; int i, ncols, nrows, row, nc;
#ifdef BB_FEATURE_AUTOWIDTH #ifdef BB_FEATURE_AUTOWIDTH
@ -481,7 +481,7 @@ void showfiles(struct dnode **dn, int nfiles)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void showdirs(struct dnode **dn, int ndirs) static void showdirs(struct dnode **dn, int ndirs)
{ {
int i, nfiles; int i, nfiles;
struct dnode **subdnp; struct dnode **subdnp;
@ -524,7 +524,7 @@ void showdirs(struct dnode **dn, int ndirs)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
struct dnode **list_dir(char *path) static struct dnode **list_dir(char *path)
{ {
struct dnode *dn, *cur, **dnp; struct dnode *dn, *cur, **dnp;
struct dirent *entry; struct dirent *entry;
@ -575,7 +575,7 @@ struct dnode **list_dir(char *path)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
int list_single(struct dnode *dn) static int list_single(struct dnode *dn)
{ {
int i, len; int i, len;
char scratch[BUFSIZ + 1]; char scratch[BUFSIZ + 1];

View file

@ -26,12 +26,12 @@
#include <stdlib.h> #include <stdlib.h>
#include "busybox.h" #include "busybox.h"
int compare_ascii(const void *x, const void *y) static int compare_ascii(const void *x, const void *y)
{ {
return strcmp(*(char **)x, *(char **)y); return strcmp(*(char **)x, *(char **)y);
} }
int compare_numeric(const void *x, const void *y) static int compare_numeric(const void *x, const void *y)
{ {
return atoi(*(char **)x) - atoi(*(char **)y); return atoi(*(char **)x) - atoi(*(char **)y);
} }

View file

@ -44,14 +44,14 @@ static char *tailbuf;
static int taillen; static int taillen;
static int newline; static int newline;
void tailbuf_append(char *buf, int len) static void tailbuf_append(char *buf, int len)
{ {
tailbuf = xrealloc(tailbuf, taillen + len); tailbuf = xrealloc(tailbuf, taillen + len);
memcpy(tailbuf + taillen, buf, len); memcpy(tailbuf + taillen, buf, len);
taillen += len; taillen += len;
} }
void tailbuf_trunc() static void tailbuf_trunc()
{ {
char *s; char *s;
s = memchr(tailbuf, '\n', taillen); s = memchr(tailbuf, '\n', taillen);

View file

@ -34,11 +34,11 @@
static void encode __P ((void)); static void encode __P ((void));
/* Pointer to the translation table we currently use. */ /* Pointer to the translation table we currently use. */
const char *trans_ptr; static const char *trans_ptr;
/* The two currently defined translation tables. The first is the /* The two currently defined translation tables. The first is the
standard uuencoding, the second is base64 encoding. */ standard uuencoding, the second is base64 encoding. */
const char uu_std[64] = { static const char uu_std[64] = {
'`', '!', '"', '#', '$', '%', '&', '\'', '`', '!', '"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '0', '1', '2', '3', '4', '5', '6', '7',
@ -49,7 +49,7 @@ const char uu_std[64] = {
'X', 'Y', 'Z', '[', '\\', ']', '^', '_' 'X', 'Y', 'Z', '[', '\\', ']', '^', '_'
}; };
const char uu_base64[64] = { static const char uu_base64[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',

View file

@ -29,8 +29,8 @@
static int total_lines, total_words, total_chars, max_length; static int total_lines, total_words, total_chars, max_length;
static int print_lines, print_words, print_chars, print_length; static int print_lines, print_words, print_chars, print_length;
void print_counts(int lines, int words, int chars, int length, static void print_counts(int lines, int words, int chars, int length,
const char *name) const char *name)
{ {
char const *space = ""; char const *space = "";

4
date.c
View file

@ -46,7 +46,7 @@
/* Default input handling to save suprising some people */ /* Default input handling to save suprising some people */
struct tm *date_conv_time(struct tm *tm_time, const char *t_string) static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
{ {
int nr; int nr;
@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
/* The new stuff for LRP */ /* The new stuff for LRP */
struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
{ {
struct tm t; struct tm t;

6
dpkg.c
View file

@ -79,9 +79,9 @@ static const char *statuswords[][10] = {
"post-inst-failed", "removal-failed", 0 } "post-inst-failed", "removal-failed", 0 }
}; };
const int color_white = 0; static const int color_white = 0;
const int color_grey = 1; static const int color_grey = 1;
const int color_black = 2; static const int color_black = 2;
/* data structures */ /* data structures */
typedef struct package_s { typedef struct package_s {

View file

@ -132,7 +132,7 @@ struct fb_var_screeninfo {
}; };
struct cmdoptions_t { static struct cmdoptions_t {
char *name; char *name;
unsigned char param_count; unsigned char param_count;
unsigned char code; unsigned char code;

View file

@ -701,7 +701,7 @@ static void read_tables(void)
} }
} }
struct minix_inode *get_inode(unsigned int nr) static struct minix_inode *get_inode(unsigned int nr)
{ {
struct minix_inode *inode; struct minix_inode *inode;
@ -749,7 +749,7 @@ struct minix_inode *get_inode(unsigned int nr)
} }
#ifdef BB_FEATURE_MINIX2 #ifdef BB_FEATURE_MINIX2
struct minix2_inode *get_inode2(unsigned int nr) static struct minix2_inode *get_inode2(unsigned int nr)
{ {
struct minix2_inode *inode; struct minix2_inode *inode;

View file

@ -62,20 +62,19 @@ typedef enum {BASH,TCSH} shell_t;
/* Some global variables that tells us how to parse. */ /* Some global variables that tells us how to parse. */
shell_t shell=BASH; /* The shell we generate output for. */ static shell_t shell=BASH; /* The shell we generate output for. */
int quiet_errors=0; /* 0 is not quiet. */ static int quiet_errors=0; /* 0 is not quiet. */
int quiet_output=0; /* 0 is not quiet. */ static int quiet_output=0; /* 0 is not quiet. */
int quote=1; /* 1 is do quote. */ static int quote=1; /* 1 is do quote. */
int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */ static int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */
/* Function prototypes */ /* Function prototypes */
const char *normalize(const char *arg); static const char *normalize(const char *arg);
int generate_output(char * argv[],int argc,const char *optstr, static int generate_output(char * argv[],int argc,const char *optstr,
const struct option *longopts); const struct option *longopts);
void add_long_options(char *options); static void add_long_options(char *options);
void add_longopt(const char *name,int has_arg); static void add_longopt(const char *name,int has_arg);
void set_shell(const char *new_shell); static void set_shell(const char *new_shell);
void set_initial_shell(void);
/* /*

2
head.c
View file

@ -29,7 +29,7 @@
#include <string.h> #include <string.h>
#include "busybox.h" #include "busybox.h"
int head(int len, FILE *fp) static int head(int len, FILE *fp)
{ {
int i; int i;
char *input; char *input;

View file

@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */ /* vi: set sw=4 ts=4: */
/* /*
* $Id: hostname.c,v 1.25 2001/03/09 14:36:42 andersen Exp $ * $Id: hostname.c,v 1.26 2001/03/09 21:24:12 andersen Exp $
* Mini hostname implementation for busybox * Mini hostname implementation for busybox
* *
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org> * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@ -32,7 +32,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
void do_sethostname(char *s, int isfile) static void do_sethostname(char *s, int isfile)
{ {
FILE *f; FILE *f;
char buf[255]; char buf[255];

8
init.c
View file

@ -174,7 +174,7 @@ struct initActionTag {
initAction *nextPtr; initAction *nextPtr;
initActionEnum action; initActionEnum action;
}; };
initAction *initActionList = NULL; static initAction *initActionList = NULL;
static char *secondConsole = VT_SECONDARY; static char *secondConsole = VT_SECONDARY;
@ -255,7 +255,7 @@ static void message(int device, char *fmt, ...)
} }
/* Set terminal settings to reasonable defaults */ /* Set terminal settings to reasonable defaults */
void set_term(int fd) static void set_term(int fd)
{ {
struct termios tty; struct termios tty;
@ -670,7 +670,7 @@ static void reboot_signal(int sig)
#endif /* ! DEBUG_INIT */ #endif /* ! DEBUG_INIT */
void new_initAction(initActionEnum action, char *process, char *cons) static void new_initAction(initActionEnum action, char *process, char *cons)
{ {
initAction *newAction; initAction *newAction;
@ -725,7 +725,7 @@ static void delete_initAction(initAction * action)
* _is_ defined, but /etc/inittab is missing, this * _is_ defined, but /etc/inittab is missing, this
* results in the same set of default behaviors. * results in the same set of default behaviors.
* */ * */
void parse_inittab(void) static void parse_inittab(void)
{ {
#ifdef BB_FEATURE_USE_INITTAB #ifdef BB_FEATURE_USE_INITTAB
FILE *file; FILE *file;

View file

@ -174,7 +174,7 @@ struct initActionTag {
initAction *nextPtr; initAction *nextPtr;
initActionEnum action; initActionEnum action;
}; };
initAction *initActionList = NULL; static initAction *initActionList = NULL;
static char *secondConsole = VT_SECONDARY; static char *secondConsole = VT_SECONDARY;
@ -255,7 +255,7 @@ static void message(int device, char *fmt, ...)
} }
/* Set terminal settings to reasonable defaults */ /* Set terminal settings to reasonable defaults */
void set_term(int fd) static void set_term(int fd)
{ {
struct termios tty; struct termios tty;
@ -670,7 +670,7 @@ static void reboot_signal(int sig)
#endif /* ! DEBUG_INIT */ #endif /* ! DEBUG_INIT */
void new_initAction(initActionEnum action, char *process, char *cons) static void new_initAction(initActionEnum action, char *process, char *cons)
{ {
initAction *newAction; initAction *newAction;
@ -725,7 +725,7 @@ static void delete_initAction(initAction * action)
* _is_ defined, but /etc/inittab is missing, this * _is_ defined, but /etc/inittab is missing, this
* results in the same set of default behaviors. * results in the same set of default behaviors.
* */ * */
void parse_inittab(void) static void parse_inittab(void)
{ {
#ifdef BB_FEATURE_USE_INITTAB #ifdef BB_FEATURE_USE_INITTAB
FILE *file; FILE *file;

2
kill.c
View file

@ -39,7 +39,7 @@ struct signal_name {
int number; int number;
}; };
const struct signal_name signames[] = { static const struct signal_name signames[] = {
/* POSIX signals */ /* POSIX signals */
{ "HUP", SIGHUP }, /* 1 */ { "HUP", SIGHUP }, /* 1 */
{ "INT", SIGINT }, /* 2 */ { "INT", SIGINT }, /* 2 */

32
ls.c
View file

@ -156,9 +156,9 @@ struct dnode { /* the basic node */
}; };
typedef struct dnode dnode_t; typedef struct dnode dnode_t;
struct dnode **list_dir(char *); static struct dnode **list_dir(char *);
struct dnode **dnalloc(int); static struct dnode **dnalloc(int);
int list_single(struct dnode *); static int list_single(struct dnode *);
static unsigned int disp_opts; static unsigned int disp_opts;
static unsigned int style_fmt; static unsigned int style_fmt;
@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH;
static int status = EXIT_SUCCESS; static int status = EXIT_SUCCESS;
#ifdef BB_FEATURE_HUMAN_READABLE #ifdef BB_FEATURE_HUMAN_READABLE
unsigned long ls_disp_hr = 0; static unsigned long ls_disp_hr = 0;
#endif #endif
static int my_stat(struct dnode *cur) static int my_stat(struct dnode *cur)
@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn)
strcmp(dn->name, "..") != 0); strcmp(dn->name, "..") != 0);
} }
int countdirs(struct dnode **dn, int nfiles) static int countdirs(struct dnode **dn, int nfiles)
{ {
int i, dirs; int i, dirs;
@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles)
return(dirs); return(dirs);
} }
int countsubdirs(struct dnode **dn, int nfiles) static int countsubdirs(struct dnode **dn, int nfiles)
{ {
int i, subdirs; int i, subdirs;
@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles)
return subdirs; return subdirs;
} }
int countfiles(struct dnode **dnp) static int countfiles(struct dnode **dnp)
{ {
int nfiles; int nfiles;
struct dnode *cur; struct dnode *cur;
@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp)
} }
/* get memory to hold an array of pointers */ /* get memory to hold an array of pointers */
struct dnode **dnalloc(int num) static struct dnode **dnalloc(int num)
{ {
struct dnode **p; struct dnode **p;
@ -303,7 +303,7 @@ struct dnode **dnalloc(int num)
return(p); return(p);
} }
void dfree(struct dnode **dnp) static void dfree(struct dnode **dnp)
{ {
struct dnode *cur, *next; struct dnode *cur, *next;
@ -319,7 +319,7 @@ void dfree(struct dnode **dnp)
free(dnp); /* free the array holding the dnode pointers */ free(dnp); /* free the array holding the dnode pointers */
} }
struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
{ {
int dncnt, i, d; int dncnt, i, d;
struct dnode **dnp; struct dnode **dnp;
@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#ifdef BB_FEATURE_LS_SORTFILES #ifdef BB_FEATURE_LS_SORTFILES
int sortcmp(struct dnode *d1, struct dnode *d2) static int sortcmp(struct dnode *d1, struct dnode *d2)
{ {
int cmp, dif; int cmp, dif;
@ -396,7 +396,7 @@ int sortcmp(struct dnode *d1, struct dnode *d2)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void shellsort(struct dnode **dn, int size) static void shellsort(struct dnode **dn, int size)
{ {
struct dnode *temp; struct dnode *temp;
int gap, i, j; int gap, i, j;
@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size)
#endif #endif
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void showfiles(struct dnode **dn, int nfiles) static void showfiles(struct dnode **dn, int nfiles)
{ {
int i, ncols, nrows, row, nc; int i, ncols, nrows, row, nc;
#ifdef BB_FEATURE_AUTOWIDTH #ifdef BB_FEATURE_AUTOWIDTH
@ -481,7 +481,7 @@ void showfiles(struct dnode **dn, int nfiles)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void showdirs(struct dnode **dn, int ndirs) static void showdirs(struct dnode **dn, int ndirs)
{ {
int i, nfiles; int i, nfiles;
struct dnode **subdnp; struct dnode **subdnp;
@ -524,7 +524,7 @@ void showdirs(struct dnode **dn, int ndirs)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
struct dnode **list_dir(char *path) static struct dnode **list_dir(char *path)
{ {
struct dnode *dn, *cur, **dnp; struct dnode *dn, *cur, **dnp;
struct dirent *entry; struct dirent *entry;
@ -575,7 +575,7 @@ struct dnode **list_dir(char *path)
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
int list_single(struct dnode *dn) static int list_single(struct dnode *dn)
{ {
int i, len; int i, len;
char scratch[BUFSIZ + 1]; char scratch[BUFSIZ + 1];

View file

@ -609,7 +609,7 @@ static void setup_tables(void)
* Perform a test of a block; return the number of * Perform a test of a block; return the number of
* blocks readable/writeable. * blocks readable/writeable.
*/ */
long do_check(char *buffer, int try, unsigned int current_block) static long do_check(char *buffer, int try, unsigned int current_block)
{ {
long got; long got;

View file

@ -72,7 +72,7 @@ static int version = -1;
static int pagesize; static int pagesize;
static int *signature_page; static int *signature_page;
struct swap_header_v1 { static struct swap_header_v1 {
char bootbits[1024]; /* Space for disklabel etc. */ char bootbits[1024]; /* Space for disklabel etc. */
unsigned int version; unsigned int version;
unsigned int last_page; unsigned int last_page;

View file

@ -231,7 +231,7 @@ parse_mount_options(char *options, int *flags, char *strflags)
} }
} }
int static int
mount_one(char *blockDevice, char *directory, char *filesystemType, mount_one(char *blockDevice, char *directory, char *filesystemType,
unsigned long flags, char *string_flags, int useMtab, int fakeIt, unsigned long flags, char *string_flags, int useMtab, int fakeIt,
char *mtab_opts, int whineOnErrors) char *mtab_opts, int whineOnErrors)

View file

@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */ /* vi: set sw=4 ts=4: */
/* /*
* $Id: hostname.c,v 1.25 2001/03/09 14:36:42 andersen Exp $ * $Id: hostname.c,v 1.26 2001/03/09 21:24:12 andersen Exp $
* Mini hostname implementation for busybox * Mini hostname implementation for busybox
* *
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org> * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@ -32,7 +32,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
void do_sethostname(char *s, int isfile) static void do_sethostname(char *s, int isfile)
{ {
FILE *f; FILE *f;
char buf[255]; char buf[255];

View file

@ -15,7 +15,7 @@
* Foundation; either version 2 of the License, or (at * Foundation; either version 2 of the License, or (at
* your option) any later version. * your option) any later version.
* *
* $Id: route.c,v 1.8 2001/03/07 06:33:01 andersen Exp $ * $Id: route.c,v 1.9 2001/03/09 21:24:12 andersen Exp $
* *
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov> * adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
@ -346,7 +346,7 @@ INET_setroute(int action, int options, char **args)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
void displayroutes(void) static void displayroutes(void)
{ {
char buff[256]; char buff[256];
int nl = 0 ; int nl = 0 ;

View file

@ -325,7 +325,7 @@ static void putiac1(byte c)
/* ******************************* */ /* ******************************* */
char const escapecharis[] = "\r\nEscape character is "; static char const escapecharis[] = "\r\nEscape character is ";
static void setConMode() static void setConMode()
{ {

View file

@ -47,22 +47,22 @@
} while (0) } while (0)
#endif #endif
void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); static void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
FILE *open_socket(char *host, int port); static FILE *open_socket(char *host, int port);
char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc); static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc);
void progressmeter(int flag); static void progressmeter(int flag);
/* Globals (can be accessed from signal handlers */ /* Globals (can be accessed from signal handlers */
static off_t filesize = 0; /* content-length of the file */ static off_t filesize = 0; /* content-length of the file */
#ifdef BB_FEATURE_WGET_STATUSBAR #ifdef BB_FEATURE_WGET_STATUSBAR
static char *curfile; /* Name of current file being transferred. */ static char *curfile; /* Name of current file being transferred. */
static struct timeval start; /* Time a transfer started. */ static struct timeval start; /* Time a transfer started. */
volatile unsigned long statbytes; /* Number of bytes transferred so far. */ static volatile unsigned long statbytes; /* Number of bytes transferred so far. */
/* For progressmeter() -- number of seconds before xfer considered "stalled" */ /* For progressmeter() -- number of seconds before xfer considered "stalled" */
static const int STALLTIME = 5; static const int STALLTIME = 5;
#endif #endif
void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue)
{ {
if (output != stdout && do_continue==0) { if (output != stdout && do_continue==0) {
fclose(output); fclose(output);
@ -371,7 +371,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
*/ */
int static int
getttywidth(void) getttywidth(void)
{ {
struct winsize winsize; struct winsize winsize;
@ -382,7 +382,7 @@ getttywidth(void)
return (80); return (80);
} }
void static void
updateprogressmeter(int ignore) updateprogressmeter(int ignore)
{ {
int save_errno = errno; int save_errno = errno;
@ -391,7 +391,7 @@ updateprogressmeter(int ignore)
errno = save_errno; errno = save_errno;
} }
void static void
alarmtimer(int wait) alarmtimer(int wait)
{ {
struct itimerval itv; struct itimerval itv;
@ -403,7 +403,7 @@ alarmtimer(int wait)
} }
void static void
progressmeter(int flag) progressmeter(int flag)
{ {
static const char prefixes[] = " KMGTP"; static const char prefixes[] = " KMGTP";
@ -534,7 +534,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: wget.c,v 1.28 2001/02/20 06:14:08 andersen Exp $ * $Id: wget.c,v 1.29 2001/03/09 21:24:12 andersen Exp $
*/ */

View file

@ -886,7 +886,7 @@ static char *nfs_strerror(int stat)
return buf; return buf;
} }
bool_t static bool_t
xdr_fhandle (XDR *xdrs, fhandle objp) xdr_fhandle (XDR *xdrs, fhandle objp)
{ {
//register int32_t *buf; //register int32_t *buf;

View file

@ -39,7 +39,7 @@ struct signal_name {
int number; int number;
}; };
const struct signal_name signames[] = { static const struct signal_name signames[] = {
/* POSIX signals */ /* POSIX signals */
{ "HUP", SIGHUP }, /* 1 */ { "HUP", SIGHUP }, /* 1 */
{ "INT", SIGINT }, /* 2 */ { "INT", SIGINT }, /* 2 */

View file

@ -39,10 +39,10 @@
static const int RFC_868_BIAS = 2208988800UL; static const int RFC_868_BIAS = 2208988800UL;
int setdate= 0; static int setdate= 0;
int printdate= 0; static int printdate= 0;
time_t askremotedate(char *host) static time_t askremotedate(char *host)
{ {
struct hostent *h; struct hostent *h;
struct sockaddr_in sin; struct sockaddr_in sin;

View file

@ -15,7 +15,7 @@
* Foundation; either version 2 of the License, or (at * Foundation; either version 2 of the License, or (at
* your option) any later version. * your option) any later version.
* *
* $Id: route.c,v 1.8 2001/03/07 06:33:01 andersen Exp $ * $Id: route.c,v 1.9 2001/03/09 21:24:12 andersen Exp $
* *
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov> * adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
@ -346,7 +346,7 @@ INET_setroute(int action, int options, char **args)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
void displayroutes(void) static void displayroutes(void)
{ {
char buff[256]; char buff[256];
int nl = 0 ; int nl = 0 ;

4
sort.c
View file

@ -26,12 +26,12 @@
#include <stdlib.h> #include <stdlib.h>
#include "busybox.h" #include "busybox.h"
int compare_ascii(const void *x, const void *y) static int compare_ascii(const void *x, const void *y)
{ {
return strcmp(*(char **)x, *(char **)y); return strcmp(*(char **)x, *(char **)y);
} }
int compare_numeric(const void *x, const void *y) static int compare_numeric(const void *x, const void *y)
{ {
return atoi(*(char **)x) - atoi(*(char **)y); return atoi(*(char **)x) - atoi(*(char **)y);
} }

View file

@ -33,8 +33,8 @@
#include <linux/unistd.h> #include <linux/unistd.h>
#include "busybox.h" #include "busybox.h"
_syscall2(int, swapon, const char *, path, int, flags); static _syscall2(int, swapon, const char *, path, int, flags);
_syscall1(int, swapoff, const char *, path); static _syscall1(int, swapoff, const char *, path);
static int whichApp; static int whichApp;

4
tail.c
View file

@ -44,14 +44,14 @@ static char *tailbuf;
static int taillen; static int taillen;
static int newline; static int newline;
void tailbuf_append(char *buf, int len) static void tailbuf_append(char *buf, int len)
{ {
tailbuf = xrealloc(tailbuf, taillen + len); tailbuf = xrealloc(tailbuf, taillen + len);
memcpy(tailbuf + taillen, buf, len); memcpy(tailbuf + taillen, buf, len);
taillen += len; taillen += len;
} }
void tailbuf_trunc() static void tailbuf_trunc()
{ {
char *s; char *s;
s = memchr(tailbuf, '\n', taillen); s = memchr(tailbuf, '\n', taillen);

8
tar.c
View file

@ -150,7 +150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
#ifdef BB_FEATURE_TAR_GZIP #ifdef BB_FEATURE_TAR_GZIP
/* Signal handler for when child gzip process dies... */ /* Signal handler for when child gzip process dies... */
void child_died() static void child_died()
{ {
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
@ -186,7 +186,7 @@ extern int tar_unzip_init(int tarFd)
#endif #endif
#if defined BB_FEATURE_TAR_EXCLUDE #if defined BB_FEATURE_TAR_EXCLUDE
struct option longopts[] = { static struct option longopts[] = {
{ "exclude", 1, NULL, 'e' }, { "exclude", 1, NULL, 'e' },
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
}; };
@ -574,7 +574,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
return( FALSE); return( FALSE);
} }
int exclude_file(char **excluded_files, const char *file) static int exclude_file(char **excluded_files, const char *file)
{ {
int i; int i;
@ -601,7 +601,7 @@ int exclude_file(char **excluded_files, const char *file)
return 0; return 0;
} }
int extract_file(char **extract_files, const char *file) static int extract_file(char **extract_files, const char *file)
{ {
int i; int i;

View file

@ -325,7 +325,7 @@ static void putiac1(byte c)
/* ******************************* */ /* ******************************* */
char const escapecharis[] = "\r\nEscape character is "; static char const escapecharis[] = "\r\nEscape character is ";
static void setConMode() static void setConMode()
{ {

View file

@ -132,7 +132,7 @@ struct fb_var_screeninfo {
}; };
struct cmdoptions_t { static struct cmdoptions_t {
char *name; char *name;
unsigned char param_count; unsigned char param_count;
unsigned char code; unsigned char code;

View file

@ -701,7 +701,7 @@ static void read_tables(void)
} }
} }
struct minix_inode *get_inode(unsigned int nr) static struct minix_inode *get_inode(unsigned int nr)
{ {
struct minix_inode *inode; struct minix_inode *inode;
@ -749,7 +749,7 @@ struct minix_inode *get_inode(unsigned int nr)
} }
#ifdef BB_FEATURE_MINIX2 #ifdef BB_FEATURE_MINIX2
struct minix2_inode *get_inode2(unsigned int nr) static struct minix2_inode *get_inode2(unsigned int nr)
{ {
struct minix2_inode *inode; struct minix2_inode *inode;

View file

@ -62,20 +62,19 @@ typedef enum {BASH,TCSH} shell_t;
/* Some global variables that tells us how to parse. */ /* Some global variables that tells us how to parse. */
shell_t shell=BASH; /* The shell we generate output for. */ static shell_t shell=BASH; /* The shell we generate output for. */
int quiet_errors=0; /* 0 is not quiet. */ static int quiet_errors=0; /* 0 is not quiet. */
int quiet_output=0; /* 0 is not quiet. */ static int quiet_output=0; /* 0 is not quiet. */
int quote=1; /* 1 is do quote. */ static int quote=1; /* 1 is do quote. */
int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */ static int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */
/* Function prototypes */ /* Function prototypes */
const char *normalize(const char *arg); static const char *normalize(const char *arg);
int generate_output(char * argv[],int argc,const char *optstr, static int generate_output(char * argv[],int argc,const char *optstr,
const struct option *longopts); const struct option *longopts);
void add_long_options(char *options); static void add_long_options(char *options);
void add_longopt(const char *name,int has_arg); static void add_longopt(const char *name,int has_arg);
void set_shell(const char *new_shell); static void set_shell(const char *new_shell);
void set_initial_shell(void);
/* /*

View file

@ -609,7 +609,7 @@ static void setup_tables(void)
* Perform a test of a block; return the number of * Perform a test of a block; return the number of
* blocks readable/writeable. * blocks readable/writeable.
*/ */
long do_check(char *buffer, int try, unsigned int current_block) static long do_check(char *buffer, int try, unsigned int current_block)
{ {
long got; long got;

View file

@ -72,7 +72,7 @@ static int version = -1;
static int pagesize; static int pagesize;
static int *signature_page; static int *signature_page;
struct swap_header_v1 { static struct swap_header_v1 {
char bootbits[1024]; /* Space for disklabel etc. */ char bootbits[1024]; /* Space for disklabel etc. */
unsigned int version; unsigned int version;
unsigned int last_page; unsigned int last_page;

View file

@ -231,7 +231,7 @@ parse_mount_options(char *options, int *flags, char *strflags)
} }
} }
int static int
mount_one(char *blockDevice, char *directory, char *filesystemType, mount_one(char *blockDevice, char *directory, char *filesystemType,
unsigned long flags, char *string_flags, int useMtab, int fakeIt, unsigned long flags, char *string_flags, int useMtab, int fakeIt,
char *mtab_opts, int whineOnErrors) char *mtab_opts, int whineOnErrors)

View file

@ -886,7 +886,7 @@ static char *nfs_strerror(int stat)
return buf; return buf;
} }
bool_t static bool_t
xdr_fhandle (XDR *xdrs, fhandle objp) xdr_fhandle (XDR *xdrs, fhandle objp)
{ {
//register int32_t *buf; //register int32_t *buf;

View file

@ -39,10 +39,10 @@
static const int RFC_868_BIAS = 2208988800UL; static const int RFC_868_BIAS = 2208988800UL;
int setdate= 0; static int setdate= 0;
int printdate= 0; static int printdate= 0;
time_t askremotedate(char *host) static time_t askremotedate(char *host)
{ {
struct hostent *h; struct hostent *h;
struct sockaddr_in sin; struct sockaddr_in sin;

View file

@ -33,8 +33,8 @@
#include <linux/unistd.h> #include <linux/unistd.h>
#include "busybox.h" #include "busybox.h"
_syscall2(int, swapon, const char *, path, int, flags); static _syscall2(int, swapon, const char *, path, int, flags);
_syscall1(int, swapoff, const char *, path); static _syscall1(int, swapoff, const char *, path);
static int whichApp; static int whichApp;

View file

@ -34,11 +34,11 @@
static void encode __P ((void)); static void encode __P ((void));
/* Pointer to the translation table we currently use. */ /* Pointer to the translation table we currently use. */
const char *trans_ptr; static const char *trans_ptr;
/* The two currently defined translation tables. The first is the /* The two currently defined translation tables. The first is the
standard uuencoding, the second is base64 encoding. */ standard uuencoding, the second is base64 encoding. */
const char uu_std[64] = { static const char uu_std[64] = {
'`', '!', '"', '#', '$', '%', '&', '\'', '`', '!', '"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '0', '1', '2', '3', '4', '5', '6', '7',
@ -49,7 +49,7 @@ const char uu_std[64] = {
'X', 'Y', 'Z', '[', '\\', ']', '^', '_' 'X', 'Y', 'Z', '[', '\\', ']', '^', '_'
}; };
const char uu_base64[64] = { static const char uu_base64[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',

4
wc.c
View file

@ -29,8 +29,8 @@
static int total_lines, total_words, total_chars, max_length; static int total_lines, total_words, total_chars, max_length;
static int print_lines, print_words, print_chars, print_length; static int print_lines, print_words, print_chars, print_length;
void print_counts(int lines, int words, int chars, int length, static void print_counts(int lines, int words, int chars, int length,
const char *name) const char *name)
{ {
char const *space = ""; char const *space = "";

22
wget.c
View file

@ -47,22 +47,22 @@
} while (0) } while (0)
#endif #endif
void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); static void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
FILE *open_socket(char *host, int port); static FILE *open_socket(char *host, int port);
char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc); static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc);
void progressmeter(int flag); static void progressmeter(int flag);
/* Globals (can be accessed from signal handlers */ /* Globals (can be accessed from signal handlers */
static off_t filesize = 0; /* content-length of the file */ static off_t filesize = 0; /* content-length of the file */
#ifdef BB_FEATURE_WGET_STATUSBAR #ifdef BB_FEATURE_WGET_STATUSBAR
static char *curfile; /* Name of current file being transferred. */ static char *curfile; /* Name of current file being transferred. */
static struct timeval start; /* Time a transfer started. */ static struct timeval start; /* Time a transfer started. */
volatile unsigned long statbytes; /* Number of bytes transferred so far. */ static volatile unsigned long statbytes; /* Number of bytes transferred so far. */
/* For progressmeter() -- number of seconds before xfer considered "stalled" */ /* For progressmeter() -- number of seconds before xfer considered "stalled" */
static const int STALLTIME = 5; static const int STALLTIME = 5;
#endif #endif
void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue)
{ {
if (output != stdout && do_continue==0) { if (output != stdout && do_continue==0) {
fclose(output); fclose(output);
@ -371,7 +371,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
*/ */
int static int
getttywidth(void) getttywidth(void)
{ {
struct winsize winsize; struct winsize winsize;
@ -382,7 +382,7 @@ getttywidth(void)
return (80); return (80);
} }
void static void
updateprogressmeter(int ignore) updateprogressmeter(int ignore)
{ {
int save_errno = errno; int save_errno = errno;
@ -391,7 +391,7 @@ updateprogressmeter(int ignore)
errno = save_errno; errno = save_errno;
} }
void static void
alarmtimer(int wait) alarmtimer(int wait)
{ {
struct itimerval itv; struct itimerval itv;
@ -403,7 +403,7 @@ alarmtimer(int wait)
} }
void static void
progressmeter(int flag) progressmeter(int flag)
{ {
static const char prefixes[] = " KMGTP"; static const char prefixes[] = " KMGTP";
@ -534,7 +534,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: wget.c,v 1.28 2001/02/20 06:14:08 andersen Exp $ * $Id: wget.c,v 1.29 2001/03/09 21:24:12 andersen Exp $
*/ */