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:
parent
dd91724aa0
commit
3e6ff9017f
@ -79,9 +79,9 @@ static const char *statuswords[][10] = {
|
||||
"post-inst-failed", "removal-failed", 0 }
|
||||
};
|
||||
|
||||
const int color_white = 0;
|
||||
const int color_grey = 1;
|
||||
const int color_black = 2;
|
||||
static const int color_white = 0;
|
||||
static const int color_grey = 1;
|
||||
static const int color_black = 2;
|
||||
|
||||
/* data structures */
|
||||
typedef struct package_s {
|
||||
|
@ -150,7 +150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
|
||||
|
||||
#ifdef BB_FEATURE_TAR_GZIP
|
||||
/* Signal handler for when child gzip process dies... */
|
||||
void child_died()
|
||||
static void child_died()
|
||||
{
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
@ -186,7 +186,7 @@ extern int tar_unzip_init(int tarFd)
|
||||
#endif
|
||||
|
||||
#if defined BB_FEATURE_TAR_EXCLUDE
|
||||
struct option longopts[] = {
|
||||
static struct option longopts[] = {
|
||||
{ "exclude", 1, NULL, 'e' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
@ -574,7 +574,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
|
||||
return( FALSE);
|
||||
}
|
||||
|
||||
int exclude_file(char **excluded_files, const char *file)
|
||||
static int exclude_file(char **excluded_files, const char *file)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -601,7 +601,7 @@ int exclude_file(char **excluded_files, const char *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int extract_file(char **extract_files, const char *file)
|
||||
static int extract_file(char **extract_files, const char *file)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
/* 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;
|
||||
|
||||
@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
|
||||
|
||||
/* 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;
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <string.h>
|
||||
#include "busybox.h"
|
||||
|
||||
int head(int len, FILE *fp)
|
||||
static int head(int len, FILE *fp)
|
||||
{
|
||||
int i;
|
||||
char *input;
|
||||
|
@ -156,9 +156,9 @@ struct dnode { /* the basic node */
|
||||
};
|
||||
typedef struct dnode dnode_t;
|
||||
|
||||
struct dnode **list_dir(char *);
|
||||
struct dnode **dnalloc(int);
|
||||
int list_single(struct dnode *);
|
||||
static struct dnode **list_dir(char *);
|
||||
static struct dnode **dnalloc(int);
|
||||
static int list_single(struct dnode *);
|
||||
|
||||
static unsigned int disp_opts;
|
||||
static unsigned int style_fmt;
|
||||
@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH;
|
||||
static int status = EXIT_SUCCESS;
|
||||
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
unsigned long ls_disp_hr = 0;
|
||||
static unsigned long ls_disp_hr = 0;
|
||||
#endif
|
||||
|
||||
static int my_stat(struct dnode *cur)
|
||||
@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn)
|
||||
strcmp(dn->name, "..") != 0);
|
||||
}
|
||||
|
||||
int countdirs(struct dnode **dn, int nfiles)
|
||||
static int countdirs(struct dnode **dn, int nfiles)
|
||||
{
|
||||
int i, dirs;
|
||||
|
||||
@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles)
|
||||
return(dirs);
|
||||
}
|
||||
|
||||
int countsubdirs(struct dnode **dn, int nfiles)
|
||||
static int countsubdirs(struct dnode **dn, int nfiles)
|
||||
{
|
||||
int i, subdirs;
|
||||
|
||||
@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles)
|
||||
return subdirs;
|
||||
}
|
||||
|
||||
int countfiles(struct dnode **dnp)
|
||||
static int countfiles(struct dnode **dnp)
|
||||
{
|
||||
int nfiles;
|
||||
struct dnode *cur;
|
||||
@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp)
|
||||
}
|
||||
|
||||
/* get memory to hold an array of pointers */
|
||||
struct dnode **dnalloc(int num)
|
||||
static struct dnode **dnalloc(int num)
|
||||
{
|
||||
struct dnode **p;
|
||||
|
||||
@ -303,7 +303,7 @@ struct dnode **dnalloc(int num)
|
||||
return(p);
|
||||
}
|
||||
|
||||
void dfree(struct dnode **dnp)
|
||||
static void dfree(struct dnode **dnp)
|
||||
{
|
||||
struct dnode *cur, *next;
|
||||
|
||||
@ -319,7 +319,7 @@ void dfree(struct dnode **dnp)
|
||||
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;
|
||||
struct dnode **dnp;
|
||||
@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
#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;
|
||||
|
||||
@ -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;
|
||||
int gap, i, j;
|
||||
@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size)
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
void showfiles(struct dnode **dn, int nfiles)
|
||||
static void showfiles(struct dnode **dn, int nfiles)
|
||||
{
|
||||
int i, ncols, nrows, row, nc;
|
||||
#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;
|
||||
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 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;
|
||||
char scratch[BUFSIZ + 1];
|
||||
|
@ -26,12 +26,12 @@
|
||||
#include <stdlib.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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -44,14 +44,14 @@ static char *tailbuf;
|
||||
static int taillen;
|
||||
static int newline;
|
||||
|
||||
void tailbuf_append(char *buf, int len)
|
||||
static void tailbuf_append(char *buf, int len)
|
||||
{
|
||||
tailbuf = xrealloc(tailbuf, taillen + len);
|
||||
memcpy(tailbuf + taillen, buf, len);
|
||||
taillen += len;
|
||||
}
|
||||
|
||||
void tailbuf_trunc()
|
||||
static void tailbuf_trunc()
|
||||
{
|
||||
char *s;
|
||||
s = memchr(tailbuf, '\n', taillen);
|
||||
|
@ -34,11 +34,11 @@
|
||||
static void encode __P ((void));
|
||||
|
||||
/* 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
|
||||
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',
|
||||
@ -49,7 +49,7 @@ const char uu_std[64] = {
|
||||
'X', 'Y', 'Z', '[', '\\', ']', '^', '_'
|
||||
};
|
||||
|
||||
const char uu_base64[64] = {
|
||||
static const char uu_base64[64] = {
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
|
||||
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
|
||||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
|
||||
|
@ -29,7 +29,7 @@
|
||||
static int total_lines, total_words, total_chars, max_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)
|
||||
{
|
||||
char const *space = "";
|
||||
|
4
date.c
4
date.c
@ -46,7 +46,7 @@
|
||||
|
||||
/* 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;
|
||||
|
||||
@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
|
||||
|
||||
/* 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;
|
||||
|
||||
|
6
dpkg.c
6
dpkg.c
@ -79,9 +79,9 @@ static const char *statuswords[][10] = {
|
||||
"post-inst-failed", "removal-failed", 0 }
|
||||
};
|
||||
|
||||
const int color_white = 0;
|
||||
const int color_grey = 1;
|
||||
const int color_black = 2;
|
||||
static const int color_white = 0;
|
||||
static const int color_grey = 1;
|
||||
static const int color_black = 2;
|
||||
|
||||
/* data structures */
|
||||
typedef struct package_s {
|
||||
|
2
fbset.c
2
fbset.c
@ -132,7 +132,7 @@ struct fb_var_screeninfo {
|
||||
};
|
||||
|
||||
|
||||
struct cmdoptions_t {
|
||||
static struct cmdoptions_t {
|
||||
char *name;
|
||||
unsigned char param_count;
|
||||
unsigned char code;
|
||||
|
@ -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;
|
||||
|
||||
@ -749,7 +749,7 @@ struct minix_inode *get_inode(unsigned int nr)
|
||||
}
|
||||
|
||||
#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;
|
||||
|
||||
|
21
getopt.c
21
getopt.c
@ -62,20 +62,19 @@ typedef enum {BASH,TCSH} shell_t;
|
||||
|
||||
|
||||
/* Some global variables that tells us how to parse. */
|
||||
shell_t shell=BASH; /* The shell we generate output for. */
|
||||
int quiet_errors=0; /* 0 is not quiet. */
|
||||
int quiet_output=0; /* 0 is not quiet. */
|
||||
int quote=1; /* 1 is do quote. */
|
||||
int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */
|
||||
static shell_t shell=BASH; /* The shell we generate output for. */
|
||||
static int quiet_errors=0; /* 0 is not quiet. */
|
||||
static int quiet_output=0; /* 0 is not quiet. */
|
||||
static int quote=1; /* 1 is do quote. */
|
||||
static int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */
|
||||
|
||||
/* Function prototypes */
|
||||
const char *normalize(const char *arg);
|
||||
int generate_output(char * argv[],int argc,const char *optstr,
|
||||
static const char *normalize(const char *arg);
|
||||
static int generate_output(char * argv[],int argc,const char *optstr,
|
||||
const struct option *longopts);
|
||||
void add_long_options(char *options);
|
||||
void add_longopt(const char *name,int has_arg);
|
||||
void set_shell(const char *new_shell);
|
||||
void set_initial_shell(void);
|
||||
static void add_long_options(char *options);
|
||||
static void add_longopt(const char *name,int has_arg);
|
||||
static void set_shell(const char *new_shell);
|
||||
|
||||
|
||||
/*
|
||||
|
2
head.c
2
head.c
@ -29,7 +29,7 @@
|
||||
#include <string.h>
|
||||
#include "busybox.h"
|
||||
|
||||
int head(int len, FILE *fp)
|
||||
static int head(int len, FILE *fp)
|
||||
{
|
||||
int i;
|
||||
char *input;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* 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
|
||||
*
|
||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||
@ -32,7 +32,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void do_sethostname(char *s, int isfile)
|
||||
static void do_sethostname(char *s, int isfile)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[255];
|
||||
|
8
init.c
8
init.c
@ -174,7 +174,7 @@ struct initActionTag {
|
||||
initAction *nextPtr;
|
||||
initActionEnum action;
|
||||
};
|
||||
initAction *initActionList = NULL;
|
||||
static initAction *initActionList = NULL;
|
||||
|
||||
|
||||
static char *secondConsole = VT_SECONDARY;
|
||||
@ -255,7 +255,7 @@ static void message(int device, char *fmt, ...)
|
||||
}
|
||||
|
||||
/* Set terminal settings to reasonable defaults */
|
||||
void set_term(int fd)
|
||||
static void set_term(int fd)
|
||||
{
|
||||
struct termios tty;
|
||||
|
||||
@ -670,7 +670,7 @@ static void reboot_signal(int sig)
|
||||
|
||||
#endif /* ! DEBUG_INIT */
|
||||
|
||||
void new_initAction(initActionEnum action, char *process, char *cons)
|
||||
static void new_initAction(initActionEnum action, char *process, char *cons)
|
||||
{
|
||||
initAction *newAction;
|
||||
|
||||
@ -725,7 +725,7 @@ static void delete_initAction(initAction * action)
|
||||
* _is_ defined, but /etc/inittab is missing, this
|
||||
* results in the same set of default behaviors.
|
||||
* */
|
||||
void parse_inittab(void)
|
||||
static void parse_inittab(void)
|
||||
{
|
||||
#ifdef BB_FEATURE_USE_INITTAB
|
||||
FILE *file;
|
||||
|
@ -174,7 +174,7 @@ struct initActionTag {
|
||||
initAction *nextPtr;
|
||||
initActionEnum action;
|
||||
};
|
||||
initAction *initActionList = NULL;
|
||||
static initAction *initActionList = NULL;
|
||||
|
||||
|
||||
static char *secondConsole = VT_SECONDARY;
|
||||
@ -255,7 +255,7 @@ static void message(int device, char *fmt, ...)
|
||||
}
|
||||
|
||||
/* Set terminal settings to reasonable defaults */
|
||||
void set_term(int fd)
|
||||
static void set_term(int fd)
|
||||
{
|
||||
struct termios tty;
|
||||
|
||||
@ -670,7 +670,7 @@ static void reboot_signal(int sig)
|
||||
|
||||
#endif /* ! DEBUG_INIT */
|
||||
|
||||
void new_initAction(initActionEnum action, char *process, char *cons)
|
||||
static void new_initAction(initActionEnum action, char *process, char *cons)
|
||||
{
|
||||
initAction *newAction;
|
||||
|
||||
@ -725,7 +725,7 @@ static void delete_initAction(initAction * action)
|
||||
* _is_ defined, but /etc/inittab is missing, this
|
||||
* results in the same set of default behaviors.
|
||||
* */
|
||||
void parse_inittab(void)
|
||||
static void parse_inittab(void)
|
||||
{
|
||||
#ifdef BB_FEATURE_USE_INITTAB
|
||||
FILE *file;
|
||||
|
2
kill.c
2
kill.c
@ -39,7 +39,7 @@ struct signal_name {
|
||||
int number;
|
||||
};
|
||||
|
||||
const struct signal_name signames[] = {
|
||||
static const struct signal_name signames[] = {
|
||||
/* POSIX signals */
|
||||
{ "HUP", SIGHUP }, /* 1 */
|
||||
{ "INT", SIGINT }, /* 2 */
|
||||
|
32
ls.c
32
ls.c
@ -156,9 +156,9 @@ struct dnode { /* the basic node */
|
||||
};
|
||||
typedef struct dnode dnode_t;
|
||||
|
||||
struct dnode **list_dir(char *);
|
||||
struct dnode **dnalloc(int);
|
||||
int list_single(struct dnode *);
|
||||
static struct dnode **list_dir(char *);
|
||||
static struct dnode **dnalloc(int);
|
||||
static int list_single(struct dnode *);
|
||||
|
||||
static unsigned int disp_opts;
|
||||
static unsigned int style_fmt;
|
||||
@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH;
|
||||
static int status = EXIT_SUCCESS;
|
||||
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
unsigned long ls_disp_hr = 0;
|
||||
static unsigned long ls_disp_hr = 0;
|
||||
#endif
|
||||
|
||||
static int my_stat(struct dnode *cur)
|
||||
@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn)
|
||||
strcmp(dn->name, "..") != 0);
|
||||
}
|
||||
|
||||
int countdirs(struct dnode **dn, int nfiles)
|
||||
static int countdirs(struct dnode **dn, int nfiles)
|
||||
{
|
||||
int i, dirs;
|
||||
|
||||
@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles)
|
||||
return(dirs);
|
||||
}
|
||||
|
||||
int countsubdirs(struct dnode **dn, int nfiles)
|
||||
static int countsubdirs(struct dnode **dn, int nfiles)
|
||||
{
|
||||
int i, subdirs;
|
||||
|
||||
@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles)
|
||||
return subdirs;
|
||||
}
|
||||
|
||||
int countfiles(struct dnode **dnp)
|
||||
static int countfiles(struct dnode **dnp)
|
||||
{
|
||||
int nfiles;
|
||||
struct dnode *cur;
|
||||
@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp)
|
||||
}
|
||||
|
||||
/* get memory to hold an array of pointers */
|
||||
struct dnode **dnalloc(int num)
|
||||
static struct dnode **dnalloc(int num)
|
||||
{
|
||||
struct dnode **p;
|
||||
|
||||
@ -303,7 +303,7 @@ struct dnode **dnalloc(int num)
|
||||
return(p);
|
||||
}
|
||||
|
||||
void dfree(struct dnode **dnp)
|
||||
static void dfree(struct dnode **dnp)
|
||||
{
|
||||
struct dnode *cur, *next;
|
||||
|
||||
@ -319,7 +319,7 @@ void dfree(struct dnode **dnp)
|
||||
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;
|
||||
struct dnode **dnp;
|
||||
@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
#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;
|
||||
|
||||
@ -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;
|
||||
int gap, i, j;
|
||||
@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size)
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
void showfiles(struct dnode **dn, int nfiles)
|
||||
static void showfiles(struct dnode **dn, int nfiles)
|
||||
{
|
||||
int i, ncols, nrows, row, nc;
|
||||
#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;
|
||||
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 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;
|
||||
char scratch[BUFSIZ + 1];
|
||||
|
@ -609,7 +609,7 @@ static void setup_tables(void)
|
||||
* Perform a test of a block; return the number of
|
||||
* 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;
|
||||
|
||||
|
2
mkswap.c
2
mkswap.c
@ -72,7 +72,7 @@ static int version = -1;
|
||||
static int pagesize;
|
||||
static int *signature_page;
|
||||
|
||||
struct swap_header_v1 {
|
||||
static struct swap_header_v1 {
|
||||
char bootbits[1024]; /* Space for disklabel etc. */
|
||||
unsigned int version;
|
||||
unsigned int last_page;
|
||||
|
2
mount.c
2
mount.c
@ -231,7 +231,7 @@ parse_mount_options(char *options, int *flags, char *strflags)
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
mount_one(char *blockDevice, char *directory, char *filesystemType,
|
||||
unsigned long flags, char *string_flags, int useMtab, int fakeIt,
|
||||
char *mtab_opts, int whineOnErrors)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* 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
|
||||
*
|
||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||
@ -32,7 +32,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void do_sethostname(char *s, int isfile)
|
||||
static void do_sethostname(char *s, int isfile)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[255];
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Foundation; either version 2 of the License, or (at
|
||||
* 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>
|
||||
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
||||
@ -346,7 +346,7 @@ INET_setroute(int action, int options, char **args)
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
void displayroutes(void)
|
||||
static void displayroutes(void)
|
||||
{
|
||||
char buff[256];
|
||||
int nl = 0 ;
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -47,22 +47,22 @@
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
|
||||
FILE *open_socket(char *host, int port);
|
||||
char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc);
|
||||
void progressmeter(int flag);
|
||||
static void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
|
||||
static FILE *open_socket(char *host, int port);
|
||||
static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc);
|
||||
static void progressmeter(int flag);
|
||||
|
||||
/* Globals (can be accessed from signal handlers */
|
||||
static off_t filesize = 0; /* content-length of the file */
|
||||
#ifdef BB_FEATURE_WGET_STATUSBAR
|
||||
static char *curfile; /* Name of current file being transferred. */
|
||||
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" */
|
||||
static const int STALLTIME = 5;
|
||||
#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) {
|
||||
fclose(output);
|
||||
@ -371,7 +371,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
static int
|
||||
getttywidth(void)
|
||||
{
|
||||
struct winsize winsize;
|
||||
@ -382,7 +382,7 @@ getttywidth(void)
|
||||
return (80);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
updateprogressmeter(int ignore)
|
||||
{
|
||||
int save_errno = errno;
|
||||
@ -391,7 +391,7 @@ updateprogressmeter(int ignore)
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
alarmtimer(int wait)
|
||||
{
|
||||
struct itimerval itv;
|
||||
@ -403,7 +403,7 @@ alarmtimer(int wait)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
static void
|
||||
progressmeter(int flag)
|
||||
{
|
||||
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
|
||||
* 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 $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -886,7 +886,7 @@ static char *nfs_strerror(int stat)
|
||||
return buf;
|
||||
}
|
||||
|
||||
bool_t
|
||||
static bool_t
|
||||
xdr_fhandle (XDR *xdrs, fhandle objp)
|
||||
{
|
||||
//register int32_t *buf;
|
||||
|
@ -39,7 +39,7 @@ struct signal_name {
|
||||
int number;
|
||||
};
|
||||
|
||||
const struct signal_name signames[] = {
|
||||
static const struct signal_name signames[] = {
|
||||
/* POSIX signals */
|
||||
{ "HUP", SIGHUP }, /* 1 */
|
||||
{ "INT", SIGINT }, /* 2 */
|
||||
|
6
rdate.c
6
rdate.c
@ -39,10 +39,10 @@
|
||||
|
||||
static const int RFC_868_BIAS = 2208988800UL;
|
||||
|
||||
int setdate= 0;
|
||||
int printdate= 0;
|
||||
static int setdate= 0;
|
||||
static int printdate= 0;
|
||||
|
||||
time_t askremotedate(char *host)
|
||||
static time_t askremotedate(char *host)
|
||||
{
|
||||
struct hostent *h;
|
||||
struct sockaddr_in sin;
|
||||
|
4
route.c
4
route.c
@ -15,7 +15,7 @@
|
||||
* Foundation; either version 2 of the License, or (at
|
||||
* 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>
|
||||
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
||||
@ -346,7 +346,7 @@ INET_setroute(int action, int options, char **args)
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
void displayroutes(void)
|
||||
static void displayroutes(void)
|
||||
{
|
||||
char buff[256];
|
||||
int nl = 0 ;
|
||||
|
4
sort.c
4
sort.c
@ -26,12 +26,12 @@
|
||||
#include <stdlib.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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include <linux/unistd.h>
|
||||
#include "busybox.h"
|
||||
|
||||
_syscall2(int, swapon, const char *, path, int, flags);
|
||||
_syscall1(int, swapoff, const char *, path);
|
||||
static _syscall2(int, swapon, const char *, path, int, flags);
|
||||
static _syscall1(int, swapoff, const char *, path);
|
||||
|
||||
|
||||
static int whichApp;
|
||||
|
4
tail.c
4
tail.c
@ -44,14 +44,14 @@ static char *tailbuf;
|
||||
static int taillen;
|
||||
static int newline;
|
||||
|
||||
void tailbuf_append(char *buf, int len)
|
||||
static void tailbuf_append(char *buf, int len)
|
||||
{
|
||||
tailbuf = xrealloc(tailbuf, taillen + len);
|
||||
memcpy(tailbuf + taillen, buf, len);
|
||||
taillen += len;
|
||||
}
|
||||
|
||||
void tailbuf_trunc()
|
||||
static void tailbuf_trunc()
|
||||
{
|
||||
char *s;
|
||||
s = memchr(tailbuf, '\n', taillen);
|
||||
|
8
tar.c
8
tar.c
@ -150,7 +150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
|
||||
|
||||
#ifdef BB_FEATURE_TAR_GZIP
|
||||
/* Signal handler for when child gzip process dies... */
|
||||
void child_died()
|
||||
static void child_died()
|
||||
{
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
@ -186,7 +186,7 @@ extern int tar_unzip_init(int tarFd)
|
||||
#endif
|
||||
|
||||
#if defined BB_FEATURE_TAR_EXCLUDE
|
||||
struct option longopts[] = {
|
||||
static struct option longopts[] = {
|
||||
{ "exclude", 1, NULL, 'e' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
@ -574,7 +574,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
|
||||
return( FALSE);
|
||||
}
|
||||
|
||||
int exclude_file(char **excluded_files, const char *file)
|
||||
static int exclude_file(char **excluded_files, const char *file)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -601,7 +601,7 @@ int exclude_file(char **excluded_files, const char *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int extract_file(char **extract_files, const char *file)
|
||||
static int extract_file(char **extract_files, const char *file)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
2
telnet.c
2
telnet.c
@ -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()
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ struct fb_var_screeninfo {
|
||||
};
|
||||
|
||||
|
||||
struct cmdoptions_t {
|
||||
static struct cmdoptions_t {
|
||||
char *name;
|
||||
unsigned char param_count;
|
||||
unsigned char code;
|
||||
|
@ -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;
|
||||
|
||||
@ -749,7 +749,7 @@ struct minix_inode *get_inode(unsigned int nr)
|
||||
}
|
||||
|
||||
#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;
|
||||
|
||||
|
@ -62,20 +62,19 @@ typedef enum {BASH,TCSH} shell_t;
|
||||
|
||||
|
||||
/* Some global variables that tells us how to parse. */
|
||||
shell_t shell=BASH; /* The shell we generate output for. */
|
||||
int quiet_errors=0; /* 0 is not quiet. */
|
||||
int quiet_output=0; /* 0 is not quiet. */
|
||||
int quote=1; /* 1 is do quote. */
|
||||
int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */
|
||||
static shell_t shell=BASH; /* The shell we generate output for. */
|
||||
static int quiet_errors=0; /* 0 is not quiet. */
|
||||
static int quiet_output=0; /* 0 is not quiet. */
|
||||
static int quote=1; /* 1 is do quote. */
|
||||
static int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */
|
||||
|
||||
/* Function prototypes */
|
||||
const char *normalize(const char *arg);
|
||||
int generate_output(char * argv[],int argc,const char *optstr,
|
||||
static const char *normalize(const char *arg);
|
||||
static int generate_output(char * argv[],int argc,const char *optstr,
|
||||
const struct option *longopts);
|
||||
void add_long_options(char *options);
|
||||
void add_longopt(const char *name,int has_arg);
|
||||
void set_shell(const char *new_shell);
|
||||
void set_initial_shell(void);
|
||||
static void add_long_options(char *options);
|
||||
static void add_longopt(const char *name,int has_arg);
|
||||
static void set_shell(const char *new_shell);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -609,7 +609,7 @@ static void setup_tables(void)
|
||||
* Perform a test of a block; return the number of
|
||||
* 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;
|
||||
|
||||
|
@ -72,7 +72,7 @@ static int version = -1;
|
||||
static int pagesize;
|
||||
static int *signature_page;
|
||||
|
||||
struct swap_header_v1 {
|
||||
static struct swap_header_v1 {
|
||||
char bootbits[1024]; /* Space for disklabel etc. */
|
||||
unsigned int version;
|
||||
unsigned int last_page;
|
||||
|
@ -231,7 +231,7 @@ parse_mount_options(char *options, int *flags, char *strflags)
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
mount_one(char *blockDevice, char *directory, char *filesystemType,
|
||||
unsigned long flags, char *string_flags, int useMtab, int fakeIt,
|
||||
char *mtab_opts, int whineOnErrors)
|
||||
|
@ -886,7 +886,7 @@ static char *nfs_strerror(int stat)
|
||||
return buf;
|
||||
}
|
||||
|
||||
bool_t
|
||||
static bool_t
|
||||
xdr_fhandle (XDR *xdrs, fhandle objp)
|
||||
{
|
||||
//register int32_t *buf;
|
||||
|
@ -39,10 +39,10 @@
|
||||
|
||||
static const int RFC_868_BIAS = 2208988800UL;
|
||||
|
||||
int setdate= 0;
|
||||
int printdate= 0;
|
||||
static int setdate= 0;
|
||||
static int printdate= 0;
|
||||
|
||||
time_t askremotedate(char *host)
|
||||
static time_t askremotedate(char *host)
|
||||
{
|
||||
struct hostent *h;
|
||||
struct sockaddr_in sin;
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include <linux/unistd.h>
|
||||
#include "busybox.h"
|
||||
|
||||
_syscall2(int, swapon, const char *, path, int, flags);
|
||||
_syscall1(int, swapoff, const char *, path);
|
||||
static _syscall2(int, swapon, const char *, path, int, flags);
|
||||
static _syscall1(int, swapoff, const char *, path);
|
||||
|
||||
|
||||
static int whichApp;
|
||||
|
@ -34,11 +34,11 @@
|
||||
static void encode __P ((void));
|
||||
|
||||
/* 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
|
||||
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',
|
||||
@ -49,7 +49,7 @@ const char uu_std[64] = {
|
||||
'X', 'Y', 'Z', '[', '\\', ']', '^', '_'
|
||||
};
|
||||
|
||||
const char uu_base64[64] = {
|
||||
static const char uu_base64[64] = {
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
|
||||
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
|
||||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
|
||||
|
2
wc.c
2
wc.c
@ -29,7 +29,7 @@
|
||||
static int total_lines, total_words, total_chars, max_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)
|
||||
{
|
||||
char const *space = "";
|
||||
|
22
wget.c
22
wget.c
@ -47,22 +47,22 @@
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
|
||||
FILE *open_socket(char *host, int port);
|
||||
char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc);
|
||||
void progressmeter(int flag);
|
||||
static void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
|
||||
static FILE *open_socket(char *host, int port);
|
||||
static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc);
|
||||
static void progressmeter(int flag);
|
||||
|
||||
/* Globals (can be accessed from signal handlers */
|
||||
static off_t filesize = 0; /* content-length of the file */
|
||||
#ifdef BB_FEATURE_WGET_STATUSBAR
|
||||
static char *curfile; /* Name of current file being transferred. */
|
||||
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" */
|
||||
static const int STALLTIME = 5;
|
||||
#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) {
|
||||
fclose(output);
|
||||
@ -371,7 +371,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
static int
|
||||
getttywidth(void)
|
||||
{
|
||||
struct winsize winsize;
|
||||
@ -382,7 +382,7 @@ getttywidth(void)
|
||||
return (80);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
updateprogressmeter(int ignore)
|
||||
{
|
||||
int save_errno = errno;
|
||||
@ -391,7 +391,7 @@ updateprogressmeter(int ignore)
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
alarmtimer(int wait)
|
||||
{
|
||||
struct itimerval itv;
|
||||
@ -403,7 +403,7 @@ alarmtimer(int wait)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
static void
|
||||
progressmeter(int flag)
|
||||
{
|
||||
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
|
||||
* 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 $
|
||||
*/
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user