summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-09 21:24:12 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-09 21:24:12 +0000
commit3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332 (patch)
treec9e6d3d695cbb2449132428a32fb6c309aad870f /coreutils
parentdd91724aa089e344d0f05e40a338dcce481c1845 (diff)
downloadbusybox-w32-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.tar.gz
busybox-w32-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.tar.bz2
busybox-w32-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.zip
A cleanup patch from Jeff Garzik to static-ify a number of
namespace polluting things that really should be static.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/date.c4
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/ls.c32
-rw-r--r--coreutils/sort.c4
-rw-r--r--coreutils/tail.c4
-rw-r--r--coreutils/uuencode.c6
-rw-r--r--coreutils/wc.c4
7 files changed, 28 insertions, 28 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 878331f71..4b2f66add 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -46,7 +46,7 @@
46 46
47/* Default input handling to save suprising some people */ 47/* Default input handling to save suprising some people */
48 48
49struct tm *date_conv_time(struct tm *tm_time, const char *t_string) 49static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
50{ 50{
51 int nr; 51 int nr;
52 52
@@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
73 73
74/* The new stuff for LRP */ 74/* The new stuff for LRP */
75 75
76struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) 76static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
77{ 77{
78 struct tm t; 78 struct tm t;
79 79
diff --git a/coreutils/head.c b/coreutils/head.c
index fac9ec659..0c8ef3d59 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -29,7 +29,7 @@
29#include <string.h> 29#include <string.h>
30#include "busybox.h" 30#include "busybox.h"
31 31
32int head(int len, FILE *fp) 32static int head(int len, FILE *fp)
33{ 33{
34 int i; 34 int i;
35 char *input; 35 char *input;
diff --git a/coreutils/ls.c b/coreutils/ls.c
index a8d7b182f..77de93a0c 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -156,9 +156,9 @@ struct dnode { /* the basic node */
156}; 156};
157typedef struct dnode dnode_t; 157typedef struct dnode dnode_t;
158 158
159struct dnode **list_dir(char *); 159static struct dnode **list_dir(char *);
160struct dnode **dnalloc(int); 160static struct dnode **dnalloc(int);
161int list_single(struct dnode *); 161static int list_single(struct dnode *);
162 162
163static unsigned int disp_opts; 163static unsigned int disp_opts;
164static unsigned int style_fmt; 164static unsigned int style_fmt;
@@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH;
186static int status = EXIT_SUCCESS; 186static int status = EXIT_SUCCESS;
187 187
188#ifdef BB_FEATURE_HUMAN_READABLE 188#ifdef BB_FEATURE_HUMAN_READABLE
189unsigned long ls_disp_hr = 0; 189static unsigned long ls_disp_hr = 0;
190#endif 190#endif
191 191
192static int my_stat(struct dnode *cur) 192static int my_stat(struct dnode *cur)
@@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn)
256 strcmp(dn->name, "..") != 0); 256 strcmp(dn->name, "..") != 0);
257} 257}
258 258
259int countdirs(struct dnode **dn, int nfiles) 259static int countdirs(struct dnode **dn, int nfiles)
260{ 260{
261 int i, dirs; 261 int i, dirs;
262 262
@@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles)
268 return(dirs); 268 return(dirs);
269} 269}
270 270
271int countsubdirs(struct dnode **dn, int nfiles) 271static int countsubdirs(struct dnode **dn, int nfiles)
272{ 272{
273 int i, subdirs; 273 int i, subdirs;
274 274
@@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles)
280 return subdirs; 280 return subdirs;
281} 281}
282 282
283int countfiles(struct dnode **dnp) 283static int countfiles(struct dnode **dnp)
284{ 284{
285 int nfiles; 285 int nfiles;
286 struct dnode *cur; 286 struct dnode *cur;
@@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp)
293} 293}
294 294
295/* get memory to hold an array of pointers */ 295/* get memory to hold an array of pointers */
296struct dnode **dnalloc(int num) 296static struct dnode **dnalloc(int num)
297{ 297{
298 struct dnode **p; 298 struct dnode **p;
299 299
@@ -303,7 +303,7 @@ struct dnode **dnalloc(int num)
303 return(p); 303 return(p);
304} 304}
305 305
306void dfree(struct dnode **dnp) 306static void dfree(struct dnode **dnp)
307{ 307{
308 struct dnode *cur, *next; 308 struct dnode *cur, *next;
309 309
@@ -319,7 +319,7 @@ void dfree(struct dnode **dnp)
319 free(dnp); /* free the array holding the dnode pointers */ 319 free(dnp); /* free the array holding the dnode pointers */
320} 320}
321 321
322struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) 322static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
323{ 323{
324 int dncnt, i, d; 324 int dncnt, i, d;
325 struct dnode **dnp; 325 struct dnode **dnp;
@@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
359 359
360/*----------------------------------------------------------------------*/ 360/*----------------------------------------------------------------------*/
361#ifdef BB_FEATURE_LS_SORTFILES 361#ifdef BB_FEATURE_LS_SORTFILES
362int sortcmp(struct dnode *d1, struct dnode *d2) 362static int sortcmp(struct dnode *d1, struct dnode *d2)
363{ 363{
364 int cmp, dif; 364 int cmp, dif;
365 365
@@ -396,7 +396,7 @@ int sortcmp(struct dnode *d1, struct dnode *d2)
396} 396}
397 397
398/*----------------------------------------------------------------------*/ 398/*----------------------------------------------------------------------*/
399void shellsort(struct dnode **dn, int size) 399static void shellsort(struct dnode **dn, int size)
400{ 400{
401 struct dnode *temp; 401 struct dnode *temp;
402 int gap, i, j; 402 int gap, i, j;
@@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size)
420#endif 420#endif
421 421
422/*----------------------------------------------------------------------*/ 422/*----------------------------------------------------------------------*/
423void showfiles(struct dnode **dn, int nfiles) 423static void showfiles(struct dnode **dn, int nfiles)
424{ 424{
425 int i, ncols, nrows, row, nc; 425 int i, ncols, nrows, row, nc;
426#ifdef BB_FEATURE_AUTOWIDTH 426#ifdef BB_FEATURE_AUTOWIDTH
@@ -481,7 +481,7 @@ void showfiles(struct dnode **dn, int nfiles)
481} 481}
482 482
483/*----------------------------------------------------------------------*/ 483/*----------------------------------------------------------------------*/
484void showdirs(struct dnode **dn, int ndirs) 484static void showdirs(struct dnode **dn, int ndirs)
485{ 485{
486 int i, nfiles; 486 int i, nfiles;
487 struct dnode **subdnp; 487 struct dnode **subdnp;
@@ -524,7 +524,7 @@ void showdirs(struct dnode **dn, int ndirs)
524} 524}
525 525
526/*----------------------------------------------------------------------*/ 526/*----------------------------------------------------------------------*/
527struct dnode **list_dir(char *path) 527static struct dnode **list_dir(char *path)
528{ 528{
529 struct dnode *dn, *cur, **dnp; 529 struct dnode *dn, *cur, **dnp;
530 struct dirent *entry; 530 struct dirent *entry;
@@ -575,7 +575,7 @@ struct dnode **list_dir(char *path)
575} 575}
576 576
577/*----------------------------------------------------------------------*/ 577/*----------------------------------------------------------------------*/
578int list_single(struct dnode *dn) 578static int list_single(struct dnode *dn)
579{ 579{
580 int i, len; 580 int i, len;
581 char scratch[BUFSIZ + 1]; 581 char scratch[BUFSIZ + 1];
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 79e629c75..9707efa51 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -26,12 +26,12 @@
26#include <stdlib.h> 26#include <stdlib.h>
27#include "busybox.h" 27#include "busybox.h"
28 28
29int compare_ascii(const void *x, const void *y) 29static int compare_ascii(const void *x, const void *y)
30{ 30{
31 return strcmp(*(char **)x, *(char **)y); 31 return strcmp(*(char **)x, *(char **)y);
32} 32}
33 33
34int compare_numeric(const void *x, const void *y) 34static int compare_numeric(const void *x, const void *y)
35{ 35{
36 return atoi(*(char **)x) - atoi(*(char **)y); 36 return atoi(*(char **)x) - atoi(*(char **)y);
37} 37}
diff --git a/coreutils/tail.c b/coreutils/tail.c
index a85256c80..ff77bde77 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -44,14 +44,14 @@ static char *tailbuf;
44static int taillen; 44static int taillen;
45static int newline; 45static int newline;
46 46
47void tailbuf_append(char *buf, int len) 47static void tailbuf_append(char *buf, int len)
48{ 48{
49 tailbuf = xrealloc(tailbuf, taillen + len); 49 tailbuf = xrealloc(tailbuf, taillen + len);
50 memcpy(tailbuf + taillen, buf, len); 50 memcpy(tailbuf + taillen, buf, len);
51 taillen += len; 51 taillen += len;
52} 52}
53 53
54void tailbuf_trunc() 54static void tailbuf_trunc()
55{ 55{
56 char *s; 56 char *s;
57 s = memchr(tailbuf, '\n', taillen); 57 s = memchr(tailbuf, '\n', taillen);
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 41541defb..35a533309 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -34,11 +34,11 @@
34static void encode __P ((void)); 34static void encode __P ((void));
35 35
36/* Pointer to the translation table we currently use. */ 36/* Pointer to the translation table we currently use. */
37const char *trans_ptr; 37static const char *trans_ptr;
38 38
39/* The two currently defined translation tables. The first is the 39/* The two currently defined translation tables. The first is the
40 standard uuencoding, the second is base64 encoding. */ 40 standard uuencoding, the second is base64 encoding. */
41const char uu_std[64] = { 41static const char uu_std[64] = {
42 '`', '!', '"', '#', '$', '%', '&', '\'', 42 '`', '!', '"', '#', '$', '%', '&', '\'',
43 '(', ')', '*', '+', ',', '-', '.', '/', 43 '(', ')', '*', '+', ',', '-', '.', '/',
44 '0', '1', '2', '3', '4', '5', '6', '7', 44 '0', '1', '2', '3', '4', '5', '6', '7',
@@ -49,7 +49,7 @@ const char uu_std[64] = {
49 'X', 'Y', 'Z', '[', '\\', ']', '^', '_' 49 'X', 'Y', 'Z', '[', '\\', ']', '^', '_'
50}; 50};
51 51
52const char uu_base64[64] = { 52static const char uu_base64[64] = {
53 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 53 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
54 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 54 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
55 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 55 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 5472c3070..695e7e7d4 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -29,8 +29,8 @@
29static int total_lines, total_words, total_chars, max_length; 29static int total_lines, total_words, total_chars, max_length;
30static int print_lines, print_words, print_chars, print_length; 30static int print_lines, print_words, print_chars, print_length;
31 31
32void print_counts(int lines, int words, int chars, int length, 32static void print_counts(int lines, int words, int chars, int length,
33 const char *name) 33 const char *name)
34{ 34{
35 char const *space = ""; 35 char const *space = "";
36 36