diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-10-06 20:25:32 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-10-06 20:25:32 +0000 |
commit | 17d49efd8ce6507152d78a70574193bb1b313af6 (patch) | |
tree | 64e24302dc2575867d8a78897500e5a5b2a48398 | |
parent | 9d3aba7b37b275350a9fe0887871da9ba73dcbd7 (diff) | |
download | busybox-w32-17d49efd8ce6507152d78a70574193bb1b313af6.tar.gz busybox-w32-17d49efd8ce6507152d78a70574193bb1b313af6.tar.bz2 busybox-w32-17d49efd8ce6507152d78a70574193bb1b313af6.zip |
More stuff.
-rw-r--r-- | Makefile | 32 | ||||
-rw-r--r-- | applets/busybox.c | 12 | ||||
-rwxr-xr-x | applets/busybox.mkll | 16 | ||||
-rw-r--r-- | archival/gzip.c | 18 | ||||
-rw-r--r-- | archival/tar.c | 167 | ||||
-rw-r--r-- | busybox.c | 12 | ||||
-rw-r--r-- | busybox.def.h | 13 | ||||
-rwxr-xr-x | busybox.mkll | 16 | ||||
-rw-r--r-- | coreutils/df.c | 61 | ||||
-rw-r--r-- | df.c | 61 | ||||
-rw-r--r-- | dmesg.c | 6 | ||||
-rw-r--r-- | find.c | 133 | ||||
-rw-r--r-- | findutils/find.c | 133 | ||||
-rw-r--r-- | findutils/grep.c | 2 | ||||
-rw-r--r-- | grep.c | 2 | ||||
-rw-r--r-- | gzip.c | 18 | ||||
-rw-r--r-- | internal.h | 2 | ||||
-rw-r--r-- | tar.c | 167 | ||||
-rw-r--r-- | util-linux/dmesg.c | 6 | ||||
-rw-r--r-- | utility.c | 136 | ||||
-rw-r--r-- | zcat.c | 14 |
21 files changed, 597 insertions, 430 deletions
@@ -1,30 +1,38 @@ | |||
1 | 1 | ||
2 | VERSION=0.29alpha1 | 2 | VERSION=0.29alpha1 |
3 | BUILDTIME=$(shell date "+%Y%m%d-%H%M") | 3 | BUILDTIME=$(shell date "+%Y%m%d-%H%M") |
4 | DODEBUG=true | ||
4 | 5 | ||
5 | #This will choke on a non-debian system | 6 | #This will choke on a non-debian system |
6 | ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` | 7 | ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` |
7 | 8 | ||
8 | 9 | ||
9 | STRIP= strip --remove-section=.note --remove-section=.comment busybox | ||
10 | LDFLAGS= -s | ||
11 | |||
12 | # -D_GNU_SOURCE is needed because environ is used in init.c | 10 | # -D_GNU_SOURCE is needed because environ is used in init.c |
13 | CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE | 11 | ifeq ($(DODEBUG),true) |
14 | # For debugging only | 12 | CFLAGS=-Wall -g -D_GNU_SOURCE |
15 | #CFLAGS=-Wall -g -D_GNU_SOURCE | 13 | STRIP= |
14 | else | ||
15 | CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE | ||
16 | STRIP= strip --remove-section=.note --remove-section=.comment busybox | ||
17 | endif | ||
18 | |||
19 | ifndef $(prefix) | ||
20 | prefix=`pwd` | ||
21 | endif | ||
22 | BINDIR=$(prefix) | ||
23 | |||
24 | LDFLAGS= -s | ||
16 | LIBRARIES=-lc | 25 | LIBRARIES=-lc |
17 | OBJECTS=$(shell ./busybox.sh) utility.o | 26 | OBJECTS=$(shell ./busybox.sh) utility.o |
18 | |||
19 | CFLAGS+= -DBB_VER='"$(VERSION)"' | 27 | CFLAGS+= -DBB_VER='"$(VERSION)"' |
20 | CFLAGS+= -DBB_BT='"$(BUILDTIME)"' | 28 | CFLAGS+= -DBB_BT='"$(BUILDTIME)"' |
21 | 29 | ||
22 | #all: busybox links | 30 | all: busybox links |
23 | all: busybox | 31 | #all: busybox |
24 | 32 | ||
25 | busybox: $(OBJECTS) | 33 | busybox: $(OBJECTS) |
26 | $(CC) $(CFLAGS) $(LDFLAGS) -o busybox $(OBJECTS) $(LIBRARIES) | 34 | $(CC) $(CFLAGS) $(LDFLAGS) -o busybox $(OBJECTS) $(LIBRARIES) |
27 | #$(STRIP) | 35 | $(STRIP) |
28 | 36 | ||
29 | links: | 37 | links: |
30 | - ./busybox.mkll | sort >busybox.links | 38 | - ./busybox.mkll | sort >busybox.links |
@@ -38,3 +46,7 @@ distclean: clean | |||
38 | force: | 46 | force: |
39 | 47 | ||
40 | $(OBJECTS): busybox.def.h internal.h Makefile | 48 | $(OBJECTS): busybox.def.h internal.h Makefile |
49 | |||
50 | install: busybox | ||
51 | install.sh $(BINDIR) | ||
52 | |||
diff --git a/applets/busybox.c b/applets/busybox.c index 9986af389..c36bc2626 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -195,6 +195,7 @@ int main(int argc, char **argv) | |||
195 | 195 | ||
196 | int busybox_main(int argc, char **argv) | 196 | int busybox_main(int argc, char **argv) |
197 | { | 197 | { |
198 | int col=0; | ||
198 | argc--; | 199 | argc--; |
199 | argv++; | 200 | argv++; |
200 | 201 | ||
@@ -208,18 +209,19 @@ int busybox_main(int argc, char **argv) | |||
208 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n", | 209 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n", |
209 | BB_VER, BB_BT); | 210 | BB_VER, BB_BT); |
210 | fprintf(stderr, "Usage: busybox [function] [arguments]...\n"); | 211 | fprintf(stderr, "Usage: busybox [function] [arguments]...\n"); |
212 | fprintf(stderr, "or\nUsage: [function] [arguments]...\n"); | ||
211 | fprintf(stderr, | 213 | fprintf(stderr, |
212 | "\n\tMost people will create a symlink to busybox for each\n" | 214 | "\n\tMost people will create a symlink to busybox for each\n" |
213 | "\tfunction name, and busybox will act like whatever you invoke it as.\n"); | 215 | "\tfunction name, and busybox will act like whatever you invoke it as.\n"); |
214 | fprintf(stderr, "\nCurrently defined functions:\n"); | 216 | fprintf(stderr, "\nCurrently defined functions:\n"); |
215 | 217 | ||
216 | if (a->name != 0) { | ||
217 | fprintf(stderr, "%s", a->name); | ||
218 | a++; | ||
219 | } | ||
220 | while (a->name != 0) { | 218 | while (a->name != 0) { |
221 | fprintf(stderr, ", %s", a->name); | 219 | col+=fprintf(stderr, "%s%s", ((col==0)? "\t":", "), a->name); |
222 | a++; | 220 | a++; |
221 | if (col>60) { | ||
222 | fprintf(stderr, ",\n"); | ||
223 | col=0; | ||
224 | } | ||
223 | } | 225 | } |
224 | fprintf(stderr, "\n\n"); | 226 | fprintf(stderr, "\n\n"); |
225 | exit(-1); | 227 | exit(-1); |
diff --git a/applets/busybox.mkll b/applets/busybox.mkll index e43a1ccb0..f79462b7f 100755 --- a/applets/busybox.mkll +++ b/applets/busybox.mkll | |||
@@ -2,16 +2,14 @@ | |||
2 | #Make busybox links list file | 2 | #Make busybox links list file |
3 | 3 | ||
4 | DF="busybox.def.h" | 4 | DF="busybox.def.h" |
5 | MF="main.c" | 5 | MF="busybox.c" |
6 | 6 | ||
7 | LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)" | 7 | LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)" |
8 | 8 | ||
9 | for def in ${LIST}; do | 9 | for def in ${LIST}; do |
10 | 10 | i=`sed -n 's/^#ifdef '$def'.*\/\/\(.*$\)/\/\1\//gp' $MF` | |
11 | set -- $(sed -n '/^#ifdef '$def'[ +| +].*/,/^#endif/{s/.*\/\///p; /^{ /{ s/^{ "//; s/",.*$//p;}; }' $MF) | 11 | j=`sed -n '/^#ifdef '$def'.*/,/^#endif/{ s/.*\"\(.*\)\".*/\1/gp; }' $MF` |
12 | path=$1; shift | 12 | for k in $j; do |
13 | 13 | echo $i$k | |
14 | for n in $@; do | ||
15 | echo "$path/$n" | ||
16 | done | ||
17 | done | 14 | done |
15 | done | ||
diff --git a/archival/gzip.c b/archival/gzip.c index 6fd2e3971..4b1d32ddd 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -380,7 +380,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
380 | # undef LZW | 380 | # undef LZW |
381 | #endif | 381 | #endif |
382 | 382 | ||
383 | /* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */ | 383 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ |
384 | /* tailor.h -- target dependent definitions | 384 | /* tailor.h -- target dependent definitions |
385 | * Copyright (C) 1992-1993 Jean-loup Gailly. | 385 | * Copyright (C) 1992-1993 Jean-loup Gailly. |
386 | * This is free software; you can redistribute it and/or modify it under the | 386 | * This is free software; you can redistribute it and/or modify it under the |
@@ -391,7 +391,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
391 | * The target dependent functions should be defined in tailor.c. | 391 | * The target dependent functions should be defined in tailor.c. |
392 | */ | 392 | */ |
393 | 393 | ||
394 | /* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */ | 394 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ |
395 | 395 | ||
396 | #if defined(__MSDOS__) && !defined(MSDOS) | 396 | #if defined(__MSDOS__) && !defined(MSDOS) |
397 | # define MSDOS | 397 | # define MSDOS |
@@ -767,7 +767,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
767 | #endif | 767 | #endif |
768 | 768 | ||
769 | #ifdef RCSID | 769 | #ifdef RCSID |
770 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 770 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
771 | #endif | 771 | #endif |
772 | 772 | ||
773 | /* =========================================================================== | 773 | /* =========================================================================== |
@@ -976,7 +976,7 @@ void copy_block(buf, len, header) | |||
976 | #include <stdio.h> | 976 | #include <stdio.h> |
977 | 977 | ||
978 | #ifdef RCSID | 978 | #ifdef RCSID |
979 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 979 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
980 | #endif | 980 | #endif |
981 | 981 | ||
982 | /* =========================================================================== | 982 | /* =========================================================================== |
@@ -1592,7 +1592,7 @@ ulg deflate() | |||
1592 | */ | 1592 | */ |
1593 | 1593 | ||
1594 | #ifdef RCSID | 1594 | #ifdef RCSID |
1595 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 1595 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
1596 | #endif | 1596 | #endif |
1597 | 1597 | ||
1598 | #include <ctype.h> | 1598 | #include <ctype.h> |
@@ -1781,7 +1781,7 @@ static int (*work) OF((int infile, int outfile)) = zip; /* function to call */ | |||
1781 | // int main (argc, argv) | 1781 | // int main (argc, argv) |
1782 | // int argc; | 1782 | // int argc; |
1783 | // char **argv; | 1783 | // char **argv; |
1784 | int gzip_main(struct FileInfo * i, int argc, char * * argv) | 1784 | int gzip_main(int argc, char * * argv) |
1785 | { | 1785 | { |
1786 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; | 1786 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; |
1787 | if (foreground) { | 1787 | if (foreground) { |
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode) | |||
1925 | #include <ctype.h> | 1925 | #include <ctype.h> |
1926 | 1926 | ||
1927 | #ifdef RCSID | 1927 | #ifdef RCSID |
1928 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 1928 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
1929 | #endif | 1929 | #endif |
1930 | 1930 | ||
1931 | /* =========================================================================== | 1931 | /* =========================================================================== |
@@ -2943,7 +2943,7 @@ local void set_file_type() | |||
2943 | */ | 2943 | */ |
2944 | 2944 | ||
2945 | #ifdef RCSID | 2945 | #ifdef RCSID |
2946 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 2946 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
2947 | #endif | 2947 | #endif |
2948 | 2948 | ||
2949 | #include <ctype.h> | 2949 | #include <ctype.h> |
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file) | |||
3142 | */ | 3142 | */ |
3143 | 3143 | ||
3144 | #ifdef RCSID | 3144 | #ifdef RCSID |
3145 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 3145 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
3146 | #endif | 3146 | #endif |
3147 | 3147 | ||
3148 | #include <ctype.h> | 3148 | #include <ctype.h> |
diff --git a/archival/tar.c b/archival/tar.c index 03da96735..498d4a300 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -131,14 +131,10 @@ static void writeHeader(const char * fileName, | |||
131 | static void writeTarFile(int fileCount, char ** fileTable); | 131 | static void writeTarFile(int fileCount, char ** fileTable); |
132 | static void writeTarBlock(const char * buf, int len); | 132 | static void writeTarBlock(const char * buf, int len); |
133 | static BOOL putOctal(char * cp, int len, long value); | 133 | static BOOL putOctal(char * cp, int len, long value); |
134 | extern const char * modeString(int mode); | ||
135 | extern const char * timeString(time_t timeVal); | ||
136 | extern int fullWrite(int fd, const char * buf, int len); | ||
137 | extern int fullRead(int fd, char * buf, int len); | ||
138 | 134 | ||
139 | 135 | ||
140 | extern int | 136 | extern int |
141 | tar_main(struct FileInfo *unused, int argc, char ** argv) | 137 | tar_main(int argc, char ** argv) |
142 | { | 138 | { |
143 | const char * options; | 139 | const char * options; |
144 | 140 | ||
@@ -1258,167 +1254,6 @@ wantFileName(const char * fileName, int fileCount, char ** fileTable) | |||
1258 | 1254 | ||
1259 | 1255 | ||
1260 | 1256 | ||
1261 | /* | ||
1262 | * Return the standard ls-like mode string from a file mode. | ||
1263 | * This is static and so is overwritten on each call. | ||
1264 | */ | ||
1265 | const char * | ||
1266 | modeString(int mode) | ||
1267 | { | ||
1268 | static char buf[12]; | ||
1269 | |||
1270 | strcpy(buf, "----------"); | ||
1271 | |||
1272 | /* | ||
1273 | * Fill in the file type. | ||
1274 | */ | ||
1275 | if (S_ISDIR(mode)) | ||
1276 | buf[0] = 'd'; | ||
1277 | if (S_ISCHR(mode)) | ||
1278 | buf[0] = 'c'; | ||
1279 | if (S_ISBLK(mode)) | ||
1280 | buf[0] = 'b'; | ||
1281 | if (S_ISFIFO(mode)) | ||
1282 | buf[0] = 'p'; | ||
1283 | #ifdef S_ISLNK | ||
1284 | if (S_ISLNK(mode)) | ||
1285 | buf[0] = 'l'; | ||
1286 | #endif | ||
1287 | #ifdef S_ISSOCK | ||
1288 | if (S_ISSOCK(mode)) | ||
1289 | buf[0] = 's'; | ||
1290 | #endif | ||
1291 | |||
1292 | /* | ||
1293 | * Now fill in the normal file permissions. | ||
1294 | */ | ||
1295 | if (mode & S_IRUSR) | ||
1296 | buf[1] = 'r'; | ||
1297 | if (mode & S_IWUSR) | ||
1298 | buf[2] = 'w'; | ||
1299 | if (mode & S_IXUSR) | ||
1300 | buf[3] = 'x'; | ||
1301 | if (mode & S_IRGRP) | ||
1302 | buf[4] = 'r'; | ||
1303 | if (mode & S_IWGRP) | ||
1304 | buf[5] = 'w'; | ||
1305 | if (mode & S_IXGRP) | ||
1306 | buf[6] = 'x'; | ||
1307 | if (mode & S_IROTH) | ||
1308 | buf[7] = 'r'; | ||
1309 | if (mode & S_IWOTH) | ||
1310 | buf[8] = 'w'; | ||
1311 | if (mode & S_IXOTH) | ||
1312 | buf[9] = 'x'; | ||
1313 | |||
1314 | /* | ||
1315 | * Finally fill in magic stuff like suid and sticky text. | ||
1316 | */ | ||
1317 | if (mode & S_ISUID) | ||
1318 | buf[3] = ((mode & S_IXUSR) ? 's' : 'S'); | ||
1319 | if (mode & S_ISGID) | ||
1320 | buf[6] = ((mode & S_IXGRP) ? 's' : 'S'); | ||
1321 | if (mode & S_ISVTX) | ||
1322 | buf[9] = ((mode & S_IXOTH) ? 't' : 'T'); | ||
1323 | |||
1324 | return buf; | ||
1325 | } | ||
1326 | |||
1327 | |||
1328 | /* | ||
1329 | * Get the time string to be used for a file. | ||
1330 | * This is down to the minute for new files, but only the date for old files. | ||
1331 | * The string is returned from a static buffer, and so is overwritten for | ||
1332 | * each call. | ||
1333 | */ | ||
1334 | const char * | ||
1335 | timeString(time_t timeVal) | ||
1336 | { | ||
1337 | time_t now; | ||
1338 | char * str; | ||
1339 | static char buf[26]; | ||
1340 | |||
1341 | time(&now); | ||
1342 | |||
1343 | str = ctime(&timeVal); | ||
1344 | |||
1345 | strcpy(buf, &str[4]); | ||
1346 | buf[12] = '\0'; | ||
1347 | |||
1348 | if ((timeVal > now) || (timeVal < now - 365*24*60*60L)) | ||
1349 | { | ||
1350 | strcpy(&buf[7], &str[20]); | ||
1351 | buf[11] = '\0'; | ||
1352 | } | ||
1353 | |||
1354 | return buf; | ||
1355 | } | ||
1356 | |||
1357 | |||
1358 | |||
1359 | /* | ||
1360 | * Write all of the supplied buffer out to a file. | ||
1361 | * This does multiple writes as necessary. | ||
1362 | * Returns the amount written, or -1 on an error. | ||
1363 | */ | ||
1364 | int | ||
1365 | fullWrite(int fd, const char * buf, int len) | ||
1366 | { | ||
1367 | int cc; | ||
1368 | int total; | ||
1369 | |||
1370 | total = 0; | ||
1371 | |||
1372 | while (len > 0) | ||
1373 | { | ||
1374 | cc = write(fd, buf, len); | ||
1375 | |||
1376 | if (cc < 0) | ||
1377 | return -1; | ||
1378 | |||
1379 | buf += cc; | ||
1380 | total+= cc; | ||
1381 | len -= cc; | ||
1382 | } | ||
1383 | |||
1384 | return total; | ||
1385 | } | ||
1386 | |||
1387 | |||
1388 | /* | ||
1389 | * Read all of the supplied buffer from a file. | ||
1390 | * This does multiple reads as necessary. | ||
1391 | * Returns the amount read, or -1 on an error. | ||
1392 | * A short read is returned on an end of file. | ||
1393 | */ | ||
1394 | int | ||
1395 | fullRead(int fd, char * buf, int len) | ||
1396 | { | ||
1397 | int cc; | ||
1398 | int total; | ||
1399 | |||
1400 | total = 0; | ||
1401 | |||
1402 | while (len > 0) | ||
1403 | { | ||
1404 | cc = read(fd, buf, len); | ||
1405 | |||
1406 | if (cc < 0) | ||
1407 | return -1; | ||
1408 | |||
1409 | if (cc == 0) | ||
1410 | break; | ||
1411 | |||
1412 | buf += cc; | ||
1413 | total+= cc; | ||
1414 | len -= cc; | ||
1415 | } | ||
1416 | |||
1417 | return total; | ||
1418 | } | ||
1419 | |||
1420 | |||
1421 | |||
1422 | #endif | 1257 | #endif |
1423 | /* END CODE */ | 1258 | /* END CODE */ |
1424 | 1259 | ||
@@ -195,6 +195,7 @@ int main(int argc, char **argv) | |||
195 | 195 | ||
196 | int busybox_main(int argc, char **argv) | 196 | int busybox_main(int argc, char **argv) |
197 | { | 197 | { |
198 | int col=0; | ||
198 | argc--; | 199 | argc--; |
199 | argv++; | 200 | argv++; |
200 | 201 | ||
@@ -208,18 +209,19 @@ int busybox_main(int argc, char **argv) | |||
208 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n", | 209 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n", |
209 | BB_VER, BB_BT); | 210 | BB_VER, BB_BT); |
210 | fprintf(stderr, "Usage: busybox [function] [arguments]...\n"); | 211 | fprintf(stderr, "Usage: busybox [function] [arguments]...\n"); |
212 | fprintf(stderr, "or\nUsage: [function] [arguments]...\n"); | ||
211 | fprintf(stderr, | 213 | fprintf(stderr, |
212 | "\n\tMost people will create a symlink to busybox for each\n" | 214 | "\n\tMost people will create a symlink to busybox for each\n" |
213 | "\tfunction name, and busybox will act like whatever you invoke it as.\n"); | 215 | "\tfunction name, and busybox will act like whatever you invoke it as.\n"); |
214 | fprintf(stderr, "\nCurrently defined functions:\n"); | 216 | fprintf(stderr, "\nCurrently defined functions:\n"); |
215 | 217 | ||
216 | if (a->name != 0) { | ||
217 | fprintf(stderr, "%s", a->name); | ||
218 | a++; | ||
219 | } | ||
220 | while (a->name != 0) { | 218 | while (a->name != 0) { |
221 | fprintf(stderr, ", %s", a->name); | 219 | col+=fprintf(stderr, "%s%s", ((col==0)? "\t":", "), a->name); |
222 | a++; | 220 | a++; |
221 | if (col>60) { | ||
222 | fprintf(stderr, ",\n"); | ||
223 | col=0; | ||
224 | } | ||
223 | } | 225 | } |
224 | fprintf(stderr, "\n\n"); | 226 | fprintf(stderr, "\n\n"); |
225 | exit(-1); | 227 | exit(-1); |
diff --git a/busybox.def.h b/busybox.def.h index 0149cc3bb..111aca63d 100644 --- a/busybox.def.h +++ b/busybox.def.h | |||
@@ -14,15 +14,14 @@ | |||
14 | #define BB_DATE | 14 | #define BB_DATE |
15 | #define BB_DD | 15 | #define BB_DD |
16 | //#define BB_DESCEND | 16 | //#define BB_DESCEND |
17 | //#define BB_DF | 17 | #define BB_DF |
18 | #define BB_DMESG | 18 | #define BB_DMESG |
19 | //#define BB_DUTMP | 19 | //#define BB_DUTMP |
20 | //#define BB_DYADIC | 20 | //#define BB_DYADIC |
21 | #define BB_FALSE | 21 | #define BB_FALSE |
22 | //#define BB_FDFLUSH | 22 | //#define BB_FDFLUSH |
23 | //#define BB_FIND | 23 | #define BB_FIND |
24 | //#define BB_FINDMOUNT | 24 | #define BB_GREP |
25 | //#define BB_GREP | ||
26 | ////#define BB_HALT | 25 | ////#define BB_HALT |
27 | //#define BB_INIT | 26 | //#define BB_INIT |
28 | //#define BB_KILL | 27 | //#define BB_KILL |
@@ -53,11 +52,11 @@ | |||
53 | ////#define BB_SWAPOFF | 52 | ////#define BB_SWAPOFF |
54 | //#define BB_SWAPON | 53 | //#define BB_SWAPON |
55 | //#define BB_SYNC | 54 | //#define BB_SYNC |
56 | //#define BB_TAR | 55 | #define BB_TAR |
57 | //#define BB_TOUCH | 56 | //#define BB_TOUCH |
58 | #define BB_TRUE | 57 | #define BB_TRUE |
59 | //#define BB_UMOUNT | 58 | //#define BB_UMOUNT |
60 | //#define BB_UPDATE | 59 | //#define BB_UPDATE |
61 | //#define BB_UTILITY | 60 | //#define BB_UTILITY |
62 | //#define BB_ZCAT | 61 | #define BB_ZCAT |
63 | //#define BB_GZIP | 62 | #define BB_GZIP |
diff --git a/busybox.mkll b/busybox.mkll index e43a1ccb0..f79462b7f 100755 --- a/busybox.mkll +++ b/busybox.mkll | |||
@@ -2,16 +2,14 @@ | |||
2 | #Make busybox links list file | 2 | #Make busybox links list file |
3 | 3 | ||
4 | DF="busybox.def.h" | 4 | DF="busybox.def.h" |
5 | MF="main.c" | 5 | MF="busybox.c" |
6 | 6 | ||
7 | LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)" | 7 | LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)" |
8 | 8 | ||
9 | for def in ${LIST}; do | 9 | for def in ${LIST}; do |
10 | 10 | i=`sed -n 's/^#ifdef '$def'.*\/\/\(.*$\)/\/\1\//gp' $MF` | |
11 | set -- $(sed -n '/^#ifdef '$def'[ +| +].*/,/^#endif/{s/.*\/\///p; /^{ /{ s/^{ "//; s/",.*$//p;}; }' $MF) | 11 | j=`sed -n '/^#ifdef '$def'.*/,/^#endif/{ s/.*\"\(.*\)\".*/\1/gp; }' $MF` |
12 | path=$1; shift | 12 | for k in $j; do |
13 | 13 | echo $i$k | |
14 | for n in $@; do | ||
15 | echo "$path/$n" | ||
16 | done | ||
17 | done | 14 | done |
15 | done | ||
diff --git a/coreutils/df.c b/coreutils/df.c index a0692afc5..bbda69456 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -17,7 +17,7 @@ df(const char * device, const char * mountPoint) | |||
17 | long blocks_percent_used; | 17 | long blocks_percent_used; |
18 | 18 | ||
19 | if ( statfs(mountPoint, &s) != 0 ) { | 19 | if ( statfs(mountPoint, &s) != 0 ) { |
20 | name_and_error(mountPoint); | 20 | perror(mountPoint); |
21 | return 1; | 21 | return 1; |
22 | } | 22 | } |
23 | 23 | ||
@@ -52,7 +52,7 @@ df(const char * device, const char * mountPoint) | |||
52 | } | 52 | } |
53 | 53 | ||
54 | extern int | 54 | extern int |
55 | df_main(struct FileInfo * i, int argc, char * * argv) | 55 | df_main(int argc, char * * argv) |
56 | { | 56 | { |
57 | static const char header[] = | 57 | static const char header[] = |
58 | "Filesystem 1024-blocks Used Available Capacity Mounted on\n"; | 58 | "Filesystem 1024-blocks Used Available Capacity Mounted on\n"; |
@@ -63,11 +63,9 @@ df_main(struct FileInfo * i, int argc, char * * argv) | |||
63 | int status; | 63 | int status; |
64 | 64 | ||
65 | while ( argc > 1 ) { | 65 | while ( argc > 1 ) { |
66 | if ( (mountEntry = findMountPoint(argv[1], "/etc/mtab")) == 0 | 66 | if ( (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 ) |
67 | && (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 ) | ||
68 | { | 67 | { |
69 | fprintf(stderr, "%s: can't find mount point.\n" | 68 | fprintf(stderr, "%s: can't find mount point.\n" ,argv[1]); |
70 | ,argv[1]); | ||
71 | return 1; | 69 | return 1; |
72 | } | 70 | } |
73 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); | 71 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); |
@@ -82,10 +80,8 @@ df_main(struct FileInfo * i, int argc, char * * argv) | |||
82 | FILE * mountTable; | 80 | FILE * mountTable; |
83 | struct mntent * mountEntry; | 81 | struct mntent * mountEntry; |
84 | 82 | ||
85 | if ( (mountTable = setmntent("/etc/mtab", "r")) == 0 | 83 | if ( (mountTable = setmntent("/proc/mounts", "r")) == 0) { |
86 | && (mountTable = setmntent("/proc/mounts", "r")) == 0 | 84 | perror("/proc/mounts"); |
87 | ) { | ||
88 | name_and_error("/etc/mtab"); | ||
89 | return 1; | 85 | return 1; |
90 | } | 86 | } |
91 | 87 | ||
@@ -101,3 +97,48 @@ df_main(struct FileInfo * i, int argc, char * * argv) | |||
101 | 97 | ||
102 | return 0; | 98 | return 0; |
103 | } | 99 | } |
100 | |||
101 | |||
102 | |||
103 | |||
104 | /* | ||
105 | * Given a block device, find the mount table entry if that block device | ||
106 | * is mounted. | ||
107 | * | ||
108 | * Given any other file (or directory), find the mount table entry for its | ||
109 | * filesystem. | ||
110 | */ | ||
111 | extern struct mntent * | ||
112 | findMountPoint(const char * name, const char * table) | ||
113 | { | ||
114 | struct stat s; | ||
115 | dev_t mountDevice; | ||
116 | FILE * mountTable; | ||
117 | struct mntent * mountEntry; | ||
118 | |||
119 | if ( stat(name, &s) != 0 ) | ||
120 | return 0; | ||
121 | |||
122 | if ( (s.st_mode & S_IFMT) == S_IFBLK ) | ||
123 | mountDevice = s.st_rdev; | ||
124 | else | ||
125 | mountDevice = s.st_dev; | ||
126 | |||
127 | |||
128 | if ( (mountTable = setmntent(table, "r")) == 0 ) | ||
129 | return 0; | ||
130 | |||
131 | while ( (mountEntry = getmntent(mountTable)) != 0 ) { | ||
132 | if ( strcmp(name, mountEntry->mnt_dir) == 0 | ||
133 | || strcmp(name, mountEntry->mnt_fsname) == 0 ) /* String match. */ | ||
134 | break; | ||
135 | if ( stat(mountEntry->mnt_fsname, &s) == 0 | ||
136 | && s.st_rdev == mountDevice ) /* Match the device. */ | ||
137 | break; | ||
138 | if ( stat(mountEntry->mnt_dir, &s) == 0 | ||
139 | && s.st_dev == mountDevice ) /* Match the directory's mount point. */ | ||
140 | break; | ||
141 | } | ||
142 | endmntent(mountTable); | ||
143 | return mountEntry; | ||
144 | } | ||
@@ -17,7 +17,7 @@ df(const char * device, const char * mountPoint) | |||
17 | long blocks_percent_used; | 17 | long blocks_percent_used; |
18 | 18 | ||
19 | if ( statfs(mountPoint, &s) != 0 ) { | 19 | if ( statfs(mountPoint, &s) != 0 ) { |
20 | name_and_error(mountPoint); | 20 | perror(mountPoint); |
21 | return 1; | 21 | return 1; |
22 | } | 22 | } |
23 | 23 | ||
@@ -52,7 +52,7 @@ df(const char * device, const char * mountPoint) | |||
52 | } | 52 | } |
53 | 53 | ||
54 | extern int | 54 | extern int |
55 | df_main(struct FileInfo * i, int argc, char * * argv) | 55 | df_main(int argc, char * * argv) |
56 | { | 56 | { |
57 | static const char header[] = | 57 | static const char header[] = |
58 | "Filesystem 1024-blocks Used Available Capacity Mounted on\n"; | 58 | "Filesystem 1024-blocks Used Available Capacity Mounted on\n"; |
@@ -63,11 +63,9 @@ df_main(struct FileInfo * i, int argc, char * * argv) | |||
63 | int status; | 63 | int status; |
64 | 64 | ||
65 | while ( argc > 1 ) { | 65 | while ( argc > 1 ) { |
66 | if ( (mountEntry = findMountPoint(argv[1], "/etc/mtab")) == 0 | 66 | if ( (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 ) |
67 | && (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 ) | ||
68 | { | 67 | { |
69 | fprintf(stderr, "%s: can't find mount point.\n" | 68 | fprintf(stderr, "%s: can't find mount point.\n" ,argv[1]); |
70 | ,argv[1]); | ||
71 | return 1; | 69 | return 1; |
72 | } | 70 | } |
73 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); | 71 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); |
@@ -82,10 +80,8 @@ df_main(struct FileInfo * i, int argc, char * * argv) | |||
82 | FILE * mountTable; | 80 | FILE * mountTable; |
83 | struct mntent * mountEntry; | 81 | struct mntent * mountEntry; |
84 | 82 | ||
85 | if ( (mountTable = setmntent("/etc/mtab", "r")) == 0 | 83 | if ( (mountTable = setmntent("/proc/mounts", "r")) == 0) { |
86 | && (mountTable = setmntent("/proc/mounts", "r")) == 0 | 84 | perror("/proc/mounts"); |
87 | ) { | ||
88 | name_and_error("/etc/mtab"); | ||
89 | return 1; | 85 | return 1; |
90 | } | 86 | } |
91 | 87 | ||
@@ -101,3 +97,48 @@ df_main(struct FileInfo * i, int argc, char * * argv) | |||
101 | 97 | ||
102 | return 0; | 98 | return 0; |
103 | } | 99 | } |
100 | |||
101 | |||
102 | |||
103 | |||
104 | /* | ||
105 | * Given a block device, find the mount table entry if that block device | ||
106 | * is mounted. | ||
107 | * | ||
108 | * Given any other file (or directory), find the mount table entry for its | ||
109 | * filesystem. | ||
110 | */ | ||
111 | extern struct mntent * | ||
112 | findMountPoint(const char * name, const char * table) | ||
113 | { | ||
114 | struct stat s; | ||
115 | dev_t mountDevice; | ||
116 | FILE * mountTable; | ||
117 | struct mntent * mountEntry; | ||
118 | |||
119 | if ( stat(name, &s) != 0 ) | ||
120 | return 0; | ||
121 | |||
122 | if ( (s.st_mode & S_IFMT) == S_IFBLK ) | ||
123 | mountDevice = s.st_rdev; | ||
124 | else | ||
125 | mountDevice = s.st_dev; | ||
126 | |||
127 | |||
128 | if ( (mountTable = setmntent(table, "r")) == 0 ) | ||
129 | return 0; | ||
130 | |||
131 | while ( (mountEntry = getmntent(mountTable)) != 0 ) { | ||
132 | if ( strcmp(name, mountEntry->mnt_dir) == 0 | ||
133 | || strcmp(name, mountEntry->mnt_fsname) == 0 ) /* String match. */ | ||
134 | break; | ||
135 | if ( stat(mountEntry->mnt_fsname, &s) == 0 | ||
136 | && s.st_rdev == mountDevice ) /* Match the device. */ | ||
137 | break; | ||
138 | if ( stat(mountEntry->mnt_dir, &s) == 0 | ||
139 | && s.st_dev == mountDevice ) /* Match the directory's mount point. */ | ||
140 | break; | ||
141 | } | ||
142 | endmntent(mountTable); | ||
143 | return mountEntry; | ||
144 | } | ||
@@ -28,7 +28,7 @@ static inline _syscall3(int,klog,int,type,char *,b,int,len) | |||
28 | const char dmesg_usage[] = "dmesg"; | 28 | const char dmesg_usage[] = "dmesg"; |
29 | 29 | ||
30 | int | 30 | int |
31 | dmesg_main(struct FileInfo * info, int argc, char * * argv) | 31 | dmesg_main(int argc, char * * argv) |
32 | { | 32 | { |
33 | 33 | ||
34 | char buf[4096]; | 34 | char buf[4096]; |
@@ -50,7 +50,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv) | |||
50 | break; | 50 | break; |
51 | case '?': | 51 | case '?': |
52 | default: | 52 | default: |
53 | usage(dmesg_usage); | 53 | fprintf(stderr, "%s\n", dmesg_usage); |
54 | exit(1); | 54 | exit(1); |
55 | } | 55 | } |
56 | } | 56 | } |
@@ -58,7 +58,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv) | |||
58 | argv += optind; | 58 | argv += optind; |
59 | 59 | ||
60 | if (argc > 1) { | 60 | if (argc > 1) { |
61 | usage(dmesg_usage); | 61 | fprintf(stderr, "%s\n", dmesg_usage); |
62 | exit(1); | 62 | exit(1); |
63 | } | 63 | } |
64 | 64 | ||
@@ -1,3 +1,133 @@ | |||
1 | /* | ||
2 | * Mini find implementation for busybox | ||
3 | * | ||
4 | * Copyright (C) 1998 by Erik Andersen <andersee@debian.org> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #include <stdio.h> | ||
23 | #include <unistd.h> | ||
24 | #include <dirent.h> | ||
25 | #include "internal.h" | ||
26 | |||
27 | |||
28 | static char* pattern=NULL; | ||
29 | static char* directory=NULL; | ||
30 | int dereferenceFlag=FALSE; | ||
31 | |||
32 | static const char find_usage[] = "find [path...] [expression]\n" | ||
33 | "default path is the current directory; default expression is -print\n" | ||
34 | "expression may consist of:\n"; | ||
35 | |||
36 | |||
37 | |||
38 | static int fileAction(const char *fileName) | ||
39 | { | ||
40 | if (pattern==NULL) | ||
41 | fprintf(stdout, "%s\n", fileName); | ||
42 | else if (match(fileName, pattern) == TRUE) | ||
43 | fprintf(stdout, "%s\n", fileName); | ||
44 | return( TRUE); | ||
45 | } | ||
46 | |||
47 | static int dirAction(const char *fileName) | ||
48 | { | ||
49 | DIR *dir; | ||
50 | struct dirent *entry; | ||
51 | |||
52 | if (pattern==NULL) | ||
53 | fprintf(stdout, "%s\n", fileName); | ||
54 | else if (match(fileName, pattern) == TRUE) | ||
55 | fprintf(stdout, "%s\n", fileName); | ||
56 | |||
57 | dir = opendir( fileName); | ||
58 | if (!dir) { | ||
59 | perror("Can't open directory"); | ||
60 | exit(FALSE); | ||
61 | } | ||
62 | while ((entry = readdir(dir)) != NULL) { | ||
63 | char dirName[NAME_MAX]; | ||
64 | sprintf(dirName, "%s/%s", fileName, entry->d_name); | ||
65 | recursiveAction( dirName, TRUE, dereferenceFlag, fileAction, dirAction); | ||
66 | } | ||
67 | return( TRUE); | ||
68 | } | ||
69 | |||
70 | int find_main(int argc, char **argv) | ||
71 | { | ||
72 | if (argc <= 1) { | ||
73 | dirAction( "."); | ||
74 | } | ||
75 | |||
76 | /* peel off the "find" */ | ||
77 | argc--; | ||
78 | argv++; | ||
79 | |||
80 | if (**argv != '-') { | ||
81 | directory=*argv; | ||
82 | argc--; | ||
83 | argv++; | ||
84 | } | ||
85 | |||
86 | /* Parse any options */ | ||
87 | while (**argv == '-') { | ||
88 | int stopit=FALSE; | ||
89 | while (*++(*argv) && stopit==FALSE) switch (**argv) { | ||
90 | case 'f': | ||
91 | if (strcmp(*argv, "follow")==0) { | ||
92 | argc--; | ||
93 | argv++; | ||
94 | dereferenceFlag=TRUE; | ||
95 | } | ||
96 | break; | ||
97 | case 'n': | ||
98 | if (strcmp(*argv, "name")==0) { | ||
99 | if (argc-- > 1) { | ||
100 | pattern=*(++argv); | ||
101 | stopit=-TRUE; | ||
102 | } else { | ||
103 | fprintf(stderr, "Usage: %s\n", find_usage); | ||
104 | exit( FALSE); | ||
105 | } | ||
106 | } | ||
107 | break; | ||
108 | case '-': | ||
109 | /* Ignore all long options */ | ||
110 | break; | ||
111 | default: | ||
112 | fprintf(stderr, "Usage: %s\n", find_usage); | ||
113 | exit( FALSE); | ||
114 | } | ||
115 | if (argc-- > 1) | ||
116 | argv++; | ||
117 | if (**argv != '-') | ||
118 | break; | ||
119 | else | ||
120 | break; | ||
121 | } | ||
122 | |||
123 | dirAction( directory); | ||
124 | exit(TRUE); | ||
125 | } | ||
126 | |||
127 | |||
128 | |||
129 | #ifdef foobar | ||
130 | |||
1 | #include "internal.h" | 131 | #include "internal.h" |
2 | #include <errno.h> | 132 | #include <errno.h> |
3 | #include <stdio.h> | 133 | #include <stdio.h> |
@@ -21,3 +151,6 @@ find_fn(const struct FileInfo * i) | |||
21 | 151 | ||
22 | return(0); | 152 | return(0); |
23 | } | 153 | } |
154 | |||
155 | |||
156 | #endif | ||
diff --git a/findutils/find.c b/findutils/find.c index b3ac1ff5a..a42f9e979 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -1,3 +1,133 @@ | |||
1 | /* | ||
2 | * Mini find implementation for busybox | ||
3 | * | ||
4 | * Copyright (C) 1998 by Erik Andersen <andersee@debian.org> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #include <stdio.h> | ||
23 | #include <unistd.h> | ||
24 | #include <dirent.h> | ||
25 | #include "internal.h" | ||
26 | |||
27 | |||
28 | static char* pattern=NULL; | ||
29 | static char* directory=NULL; | ||
30 | int dereferenceFlag=FALSE; | ||
31 | |||
32 | static const char find_usage[] = "find [path...] [expression]\n" | ||
33 | "default path is the current directory; default expression is -print\n" | ||
34 | "expression may consist of:\n"; | ||
35 | |||
36 | |||
37 | |||
38 | static int fileAction(const char *fileName) | ||
39 | { | ||
40 | if (pattern==NULL) | ||
41 | fprintf(stdout, "%s\n", fileName); | ||
42 | else if (match(fileName, pattern) == TRUE) | ||
43 | fprintf(stdout, "%s\n", fileName); | ||
44 | return( TRUE); | ||
45 | } | ||
46 | |||
47 | static int dirAction(const char *fileName) | ||
48 | { | ||
49 | DIR *dir; | ||
50 | struct dirent *entry; | ||
51 | |||
52 | if (pattern==NULL) | ||
53 | fprintf(stdout, "%s\n", fileName); | ||
54 | else if (match(fileName, pattern) == TRUE) | ||
55 | fprintf(stdout, "%s\n", fileName); | ||
56 | |||
57 | dir = opendir( fileName); | ||
58 | if (!dir) { | ||
59 | perror("Can't open directory"); | ||
60 | exit(FALSE); | ||
61 | } | ||
62 | while ((entry = readdir(dir)) != NULL) { | ||
63 | char dirName[NAME_MAX]; | ||
64 | sprintf(dirName, "%s/%s", fileName, entry->d_name); | ||
65 | recursiveAction( dirName, TRUE, dereferenceFlag, fileAction, dirAction); | ||
66 | } | ||
67 | return( TRUE); | ||
68 | } | ||
69 | |||
70 | int find_main(int argc, char **argv) | ||
71 | { | ||
72 | if (argc <= 1) { | ||
73 | dirAction( "."); | ||
74 | } | ||
75 | |||
76 | /* peel off the "find" */ | ||
77 | argc--; | ||
78 | argv++; | ||
79 | |||
80 | if (**argv != '-') { | ||
81 | directory=*argv; | ||
82 | argc--; | ||
83 | argv++; | ||
84 | } | ||
85 | |||
86 | /* Parse any options */ | ||
87 | while (**argv == '-') { | ||
88 | int stopit=FALSE; | ||
89 | while (*++(*argv) && stopit==FALSE) switch (**argv) { | ||
90 | case 'f': | ||
91 | if (strcmp(*argv, "follow")==0) { | ||
92 | argc--; | ||
93 | argv++; | ||
94 | dereferenceFlag=TRUE; | ||
95 | } | ||
96 | break; | ||
97 | case 'n': | ||
98 | if (strcmp(*argv, "name")==0) { | ||
99 | if (argc-- > 1) { | ||
100 | pattern=*(++argv); | ||
101 | stopit=-TRUE; | ||
102 | } else { | ||
103 | fprintf(stderr, "Usage: %s\n", find_usage); | ||
104 | exit( FALSE); | ||
105 | } | ||
106 | } | ||
107 | break; | ||
108 | case '-': | ||
109 | /* Ignore all long options */ | ||
110 | break; | ||
111 | default: | ||
112 | fprintf(stderr, "Usage: %s\n", find_usage); | ||
113 | exit( FALSE); | ||
114 | } | ||
115 | if (argc-- > 1) | ||
116 | argv++; | ||
117 | if (**argv != '-') | ||
118 | break; | ||
119 | else | ||
120 | break; | ||
121 | } | ||
122 | |||
123 | dirAction( directory); | ||
124 | exit(TRUE); | ||
125 | } | ||
126 | |||
127 | |||
128 | |||
129 | #ifdef foobar | ||
130 | |||
1 | #include "internal.h" | 131 | #include "internal.h" |
2 | #include <errno.h> | 132 | #include <errno.h> |
3 | #include <stdio.h> | 133 | #include <stdio.h> |
@@ -21,3 +151,6 @@ find_fn(const struct FileInfo * i) | |||
21 | 151 | ||
22 | return(0); | 152 | return(0); |
23 | } | 153 | } |
154 | |||
155 | |||
156 | #endif | ||
diff --git a/findutils/grep.c b/findutils/grep.c index 3779e5510..a07feda03 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -36,7 +36,7 @@ static BOOL search | |||
36 | 36 | ||
37 | 37 | ||
38 | extern int | 38 | extern int |
39 | grep_main(struct FileInfo * unused, int argc, char ** argv) | 39 | grep_main(int argc, char ** argv) |
40 | { | 40 | { |
41 | FILE * fp; | 41 | FILE * fp; |
42 | const char * word; | 42 | const char * word; |
@@ -36,7 +36,7 @@ static BOOL search | |||
36 | 36 | ||
37 | 37 | ||
38 | extern int | 38 | extern int |
39 | grep_main(struct FileInfo * unused, int argc, char ** argv) | 39 | grep_main(int argc, char ** argv) |
40 | { | 40 | { |
41 | FILE * fp; | 41 | FILE * fp; |
42 | const char * word; | 42 | const char * word; |
@@ -380,7 +380,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
380 | # undef LZW | 380 | # undef LZW |
381 | #endif | 381 | #endif |
382 | 382 | ||
383 | /* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */ | 383 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ |
384 | /* tailor.h -- target dependent definitions | 384 | /* tailor.h -- target dependent definitions |
385 | * Copyright (C) 1992-1993 Jean-loup Gailly. | 385 | * Copyright (C) 1992-1993 Jean-loup Gailly. |
386 | * This is free software; you can redistribute it and/or modify it under the | 386 | * This is free software; you can redistribute it and/or modify it under the |
@@ -391,7 +391,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
391 | * The target dependent functions should be defined in tailor.c. | 391 | * The target dependent functions should be defined in tailor.c. |
392 | */ | 392 | */ |
393 | 393 | ||
394 | /* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */ | 394 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ |
395 | 395 | ||
396 | #if defined(__MSDOS__) && !defined(MSDOS) | 396 | #if defined(__MSDOS__) && !defined(MSDOS) |
397 | # define MSDOS | 397 | # define MSDOS |
@@ -767,7 +767,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
767 | #endif | 767 | #endif |
768 | 768 | ||
769 | #ifdef RCSID | 769 | #ifdef RCSID |
770 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 770 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
771 | #endif | 771 | #endif |
772 | 772 | ||
773 | /* =========================================================================== | 773 | /* =========================================================================== |
@@ -976,7 +976,7 @@ void copy_block(buf, len, header) | |||
976 | #include <stdio.h> | 976 | #include <stdio.h> |
977 | 977 | ||
978 | #ifdef RCSID | 978 | #ifdef RCSID |
979 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 979 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
980 | #endif | 980 | #endif |
981 | 981 | ||
982 | /* =========================================================================== | 982 | /* =========================================================================== |
@@ -1592,7 +1592,7 @@ ulg deflate() | |||
1592 | */ | 1592 | */ |
1593 | 1593 | ||
1594 | #ifdef RCSID | 1594 | #ifdef RCSID |
1595 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 1595 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
1596 | #endif | 1596 | #endif |
1597 | 1597 | ||
1598 | #include <ctype.h> | 1598 | #include <ctype.h> |
@@ -1781,7 +1781,7 @@ static int (*work) OF((int infile, int outfile)) = zip; /* function to call */ | |||
1781 | // int main (argc, argv) | 1781 | // int main (argc, argv) |
1782 | // int argc; | 1782 | // int argc; |
1783 | // char **argv; | 1783 | // char **argv; |
1784 | int gzip_main(struct FileInfo * i, int argc, char * * argv) | 1784 | int gzip_main(int argc, char * * argv) |
1785 | { | 1785 | { |
1786 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; | 1786 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; |
1787 | if (foreground) { | 1787 | if (foreground) { |
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode) | |||
1925 | #include <ctype.h> | 1925 | #include <ctype.h> |
1926 | 1926 | ||
1927 | #ifdef RCSID | 1927 | #ifdef RCSID |
1928 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 1928 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
1929 | #endif | 1929 | #endif |
1930 | 1930 | ||
1931 | /* =========================================================================== | 1931 | /* =========================================================================== |
@@ -2943,7 +2943,7 @@ local void set_file_type() | |||
2943 | */ | 2943 | */ |
2944 | 2944 | ||
2945 | #ifdef RCSID | 2945 | #ifdef RCSID |
2946 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 2946 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
2947 | #endif | 2947 | #endif |
2948 | 2948 | ||
2949 | #include <ctype.h> | 2949 | #include <ctype.h> |
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file) | |||
3142 | */ | 3142 | */ |
3143 | 3143 | ||
3144 | #ifdef RCSID | 3144 | #ifdef RCSID |
3145 | static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 3145 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
3146 | #endif | 3146 | #endif |
3147 | 3147 | ||
3148 | #include <ctype.h> | 3148 | #include <ctype.h> |
diff --git a/internal.h b/internal.h index 5a8b0c57e..9c7dda4d4 100644 --- a/internal.h +++ b/internal.h | |||
@@ -183,6 +183,8 @@ int fullRead(int fd, char *buf, int len); | |||
183 | int recursiveAction(const char *fileName, BOOL recurse, BOOL followLinks, | 183 | int recursiveAction(const char *fileName, BOOL recurse, BOOL followLinks, |
184 | int (*fileAction) (const char *fileName), | 184 | int (*fileAction) (const char *fileName), |
185 | int (*dirAction) (const char *fileName)); | 185 | int (*dirAction) (const char *fileName)); |
186 | BOOL match(const char* text, const char * pattern); | ||
187 | const char* timeString(time_t timeVal); | ||
186 | 188 | ||
187 | 189 | ||
188 | #endif | 190 | #endif |
@@ -131,14 +131,10 @@ static void writeHeader(const char * fileName, | |||
131 | static void writeTarFile(int fileCount, char ** fileTable); | 131 | static void writeTarFile(int fileCount, char ** fileTable); |
132 | static void writeTarBlock(const char * buf, int len); | 132 | static void writeTarBlock(const char * buf, int len); |
133 | static BOOL putOctal(char * cp, int len, long value); | 133 | static BOOL putOctal(char * cp, int len, long value); |
134 | extern const char * modeString(int mode); | ||
135 | extern const char * timeString(time_t timeVal); | ||
136 | extern int fullWrite(int fd, const char * buf, int len); | ||
137 | extern int fullRead(int fd, char * buf, int len); | ||
138 | 134 | ||
139 | 135 | ||
140 | extern int | 136 | extern int |
141 | tar_main(struct FileInfo *unused, int argc, char ** argv) | 137 | tar_main(int argc, char ** argv) |
142 | { | 138 | { |
143 | const char * options; | 139 | const char * options; |
144 | 140 | ||
@@ -1258,167 +1254,6 @@ wantFileName(const char * fileName, int fileCount, char ** fileTable) | |||
1258 | 1254 | ||
1259 | 1255 | ||
1260 | 1256 | ||
1261 | /* | ||
1262 | * Return the standard ls-like mode string from a file mode. | ||
1263 | * This is static and so is overwritten on each call. | ||
1264 | */ | ||
1265 | const char * | ||
1266 | modeString(int mode) | ||
1267 | { | ||
1268 | static char buf[12]; | ||
1269 | |||
1270 | strcpy(buf, "----------"); | ||
1271 | |||
1272 | /* | ||
1273 | * Fill in the file type. | ||
1274 | */ | ||
1275 | if (S_ISDIR(mode)) | ||
1276 | buf[0] = 'd'; | ||
1277 | if (S_ISCHR(mode)) | ||
1278 | buf[0] = 'c'; | ||
1279 | if (S_ISBLK(mode)) | ||
1280 | buf[0] = 'b'; | ||
1281 | if (S_ISFIFO(mode)) | ||
1282 | buf[0] = 'p'; | ||
1283 | #ifdef S_ISLNK | ||
1284 | if (S_ISLNK(mode)) | ||
1285 | buf[0] = 'l'; | ||
1286 | #endif | ||
1287 | #ifdef S_ISSOCK | ||
1288 | if (S_ISSOCK(mode)) | ||
1289 | buf[0] = 's'; | ||
1290 | #endif | ||
1291 | |||
1292 | /* | ||
1293 | * Now fill in the normal file permissions. | ||
1294 | */ | ||
1295 | if (mode & S_IRUSR) | ||
1296 | buf[1] = 'r'; | ||
1297 | if (mode & S_IWUSR) | ||
1298 | buf[2] = 'w'; | ||
1299 | if (mode & S_IXUSR) | ||
1300 | buf[3] = 'x'; | ||
1301 | if (mode & S_IRGRP) | ||
1302 | buf[4] = 'r'; | ||
1303 | if (mode & S_IWGRP) | ||
1304 | buf[5] = 'w'; | ||
1305 | if (mode & S_IXGRP) | ||
1306 | buf[6] = 'x'; | ||
1307 | if (mode & S_IROTH) | ||
1308 | buf[7] = 'r'; | ||
1309 | if (mode & S_IWOTH) | ||
1310 | buf[8] = 'w'; | ||
1311 | if (mode & S_IXOTH) | ||
1312 | buf[9] = 'x'; | ||
1313 | |||
1314 | /* | ||
1315 | * Finally fill in magic stuff like suid and sticky text. | ||
1316 | */ | ||
1317 | if (mode & S_ISUID) | ||
1318 | buf[3] = ((mode & S_IXUSR) ? 's' : 'S'); | ||
1319 | if (mode & S_ISGID) | ||
1320 | buf[6] = ((mode & S_IXGRP) ? 's' : 'S'); | ||
1321 | if (mode & S_ISVTX) | ||
1322 | buf[9] = ((mode & S_IXOTH) ? 't' : 'T'); | ||
1323 | |||
1324 | return buf; | ||
1325 | } | ||
1326 | |||
1327 | |||
1328 | /* | ||
1329 | * Get the time string to be used for a file. | ||
1330 | * This is down to the minute for new files, but only the date for old files. | ||
1331 | * The string is returned from a static buffer, and so is overwritten for | ||
1332 | * each call. | ||
1333 | */ | ||
1334 | const char * | ||
1335 | timeString(time_t timeVal) | ||
1336 | { | ||
1337 | time_t now; | ||
1338 | char * str; | ||
1339 | static char buf[26]; | ||
1340 | |||
1341 | time(&now); | ||
1342 | |||
1343 | str = ctime(&timeVal); | ||
1344 | |||
1345 | strcpy(buf, &str[4]); | ||
1346 | buf[12] = '\0'; | ||
1347 | |||
1348 | if ((timeVal > now) || (timeVal < now - 365*24*60*60L)) | ||
1349 | { | ||
1350 | strcpy(&buf[7], &str[20]); | ||
1351 | buf[11] = '\0'; | ||
1352 | } | ||
1353 | |||
1354 | return buf; | ||
1355 | } | ||
1356 | |||
1357 | |||
1358 | |||
1359 | /* | ||
1360 | * Write all of the supplied buffer out to a file. | ||
1361 | * This does multiple writes as necessary. | ||
1362 | * Returns the amount written, or -1 on an error. | ||
1363 | */ | ||
1364 | int | ||
1365 | fullWrite(int fd, const char * buf, int len) | ||
1366 | { | ||
1367 | int cc; | ||
1368 | int total; | ||
1369 | |||
1370 | total = 0; | ||
1371 | |||
1372 | while (len > 0) | ||
1373 | { | ||
1374 | cc = write(fd, buf, len); | ||
1375 | |||
1376 | if (cc < 0) | ||
1377 | return -1; | ||
1378 | |||
1379 | buf += cc; | ||
1380 | total+= cc; | ||
1381 | len -= cc; | ||
1382 | } | ||
1383 | |||
1384 | return total; | ||
1385 | } | ||
1386 | |||
1387 | |||
1388 | /* | ||
1389 | * Read all of the supplied buffer from a file. | ||
1390 | * This does multiple reads as necessary. | ||
1391 | * Returns the amount read, or -1 on an error. | ||
1392 | * A short read is returned on an end of file. | ||
1393 | */ | ||
1394 | int | ||
1395 | fullRead(int fd, char * buf, int len) | ||
1396 | { | ||
1397 | int cc; | ||
1398 | int total; | ||
1399 | |||
1400 | total = 0; | ||
1401 | |||
1402 | while (len > 0) | ||
1403 | { | ||
1404 | cc = read(fd, buf, len); | ||
1405 | |||
1406 | if (cc < 0) | ||
1407 | return -1; | ||
1408 | |||
1409 | if (cc == 0) | ||
1410 | break; | ||
1411 | |||
1412 | buf += cc; | ||
1413 | total+= cc; | ||
1414 | len -= cc; | ||
1415 | } | ||
1416 | |||
1417 | return total; | ||
1418 | } | ||
1419 | |||
1420 | |||
1421 | |||
1422 | #endif | 1257 | #endif |
1423 | /* END CODE */ | 1258 | /* END CODE */ |
1424 | 1259 | ||
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index a63fa3d39..9096621b0 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c | |||
@@ -28,7 +28,7 @@ static inline _syscall3(int,klog,int,type,char *,b,int,len) | |||
28 | const char dmesg_usage[] = "dmesg"; | 28 | const char dmesg_usage[] = "dmesg"; |
29 | 29 | ||
30 | int | 30 | int |
31 | dmesg_main(struct FileInfo * info, int argc, char * * argv) | 31 | dmesg_main(int argc, char * * argv) |
32 | { | 32 | { |
33 | 33 | ||
34 | char buf[4096]; | 34 | char buf[4096]; |
@@ -50,7 +50,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv) | |||
50 | break; | 50 | break; |
51 | case '?': | 51 | case '?': |
52 | default: | 52 | default: |
53 | usage(dmesg_usage); | 53 | fprintf(stderr, "%s\n", dmesg_usage); |
54 | exit(1); | 54 | exit(1); |
55 | } | 55 | } |
56 | } | 56 | } |
@@ -58,7 +58,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv) | |||
58 | argv += optind; | 58 | argv += optind; |
59 | 59 | ||
60 | if (argc > 1) { | 60 | if (argc > 1) { |
61 | usage(dmesg_usage); | 61 | fprintf(stderr, "%s\n", dmesg_usage); |
62 | exit(1); | 62 | exit(1); |
63 | } | 63 | } |
64 | 64 | ||
@@ -406,6 +406,131 @@ freeChunks(void) | |||
406 | 406 | ||
407 | 407 | ||
408 | /* | 408 | /* |
409 | * Get the time string to be used for a file. | ||
410 | * This is down to the minute for new files, but only the date for old files. | ||
411 | * The string is returned from a static buffer, and so is overwritten for | ||
412 | * each call. | ||
413 | */ | ||
414 | const char * | ||
415 | timeString(time_t timeVal) | ||
416 | { | ||
417 | time_t now; | ||
418 | char * str; | ||
419 | static char buf[26]; | ||
420 | |||
421 | time(&now); | ||
422 | |||
423 | str = ctime(&timeVal); | ||
424 | |||
425 | strcpy(buf, &str[4]); | ||
426 | buf[12] = '\0'; | ||
427 | |||
428 | if ((timeVal > now) || (timeVal < now - 365*24*60*60L)) | ||
429 | { | ||
430 | strcpy(&buf[7], &str[20]); | ||
431 | buf[11] = '\0'; | ||
432 | } | ||
433 | |||
434 | return buf; | ||
435 | } | ||
436 | |||
437 | |||
438 | /* | ||
439 | * Routine to see if a text string is matched by a wildcard pattern. | ||
440 | * Returns TRUE if the text is matched, or FALSE if it is not matched | ||
441 | * or if the pattern is invalid. | ||
442 | * * matches zero or more characters | ||
443 | * ? matches a single character | ||
444 | * [abc] matches 'a', 'b' or 'c' | ||
445 | * \c quotes character c | ||
446 | * Adapted from code written by Ingo Wilken. | ||
447 | */ | ||
448 | BOOL | ||
449 | match(const char * text, const char * pattern) | ||
450 | { | ||
451 | const char * retryPat; | ||
452 | const char * retryText; | ||
453 | int ch; | ||
454 | BOOL found; | ||
455 | |||
456 | retryPat = NULL; | ||
457 | retryText = NULL; | ||
458 | |||
459 | while (*text || *pattern) | ||
460 | { | ||
461 | ch = *pattern++; | ||
462 | |||
463 | switch (ch) | ||
464 | { | ||
465 | case '*': | ||
466 | retryPat = pattern; | ||
467 | retryText = text; | ||
468 | break; | ||
469 | |||
470 | case '[': | ||
471 | found = FALSE; | ||
472 | |||
473 | while ((ch = *pattern++) != ']') | ||
474 | { | ||
475 | if (ch == '\\') | ||
476 | ch = *pattern++; | ||
477 | |||
478 | if (ch == '\0') | ||
479 | return FALSE; | ||
480 | |||
481 | if (*text == ch) | ||
482 | found = TRUE; | ||
483 | } | ||
484 | |||
485 | if (!found) | ||
486 | { | ||
487 | pattern = retryPat; | ||
488 | text = ++retryText; | ||
489 | } | ||
490 | |||
491 | /* fall into next case */ | ||
492 | |||
493 | case '?': | ||
494 | if (*text++ == '\0') | ||
495 | return FALSE; | ||
496 | |||
497 | break; | ||
498 | |||
499 | case '\\': | ||
500 | ch = *pattern++; | ||
501 | |||
502 | if (ch == '\0') | ||
503 | return FALSE; | ||
504 | |||
505 | /* fall into next case */ | ||
506 | |||
507 | default: | ||
508 | if (*text == ch) | ||
509 | { | ||
510 | if (*text) | ||
511 | text++; | ||
512 | break; | ||
513 | } | ||
514 | |||
515 | if (*text) | ||
516 | { | ||
517 | pattern = retryPat; | ||
518 | text = ++retryText; | ||
519 | break; | ||
520 | } | ||
521 | |||
522 | return FALSE; | ||
523 | } | ||
524 | |||
525 | if (pattern == NULL) | ||
526 | return FALSE; | ||
527 | } | ||
528 | |||
529 | return TRUE; | ||
530 | } | ||
531 | |||
532 | |||
533 | /* | ||
409 | * Write all of the supplied buffer out to a file. | 534 | * Write all of the supplied buffer out to a file. |
410 | * This does multiple writes as necessary. | 535 | * This does multiple writes as necessary. |
411 | * Returns the amount written, or -1 on an error. | 536 | * Returns the amount written, or -1 on an error. |
@@ -543,3 +668,14 @@ recursiveAction( const char *fileName, BOOL recurse, BOOL followLinks, | |||
543 | 668 | ||
544 | 669 | ||
545 | /* END CODE */ | 670 | /* END CODE */ |
671 | |||
672 | |||
673 | |||
674 | |||
675 | |||
676 | |||
677 | |||
678 | |||
679 | |||
680 | |||
681 | |||
@@ -59,7 +59,7 @@ static char *license_msg[] = { | |||
59 | */ | 59 | */ |
60 | 60 | ||
61 | #ifdef RCSID | 61 | #ifdef RCSID |
62 | static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 62 | static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | #include <ctype.h> | 65 | #include <ctype.h> |
@@ -80,7 +80,7 @@ static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | |||
80 | * The target dependent functions should be defined in tailor.c. | 80 | * The target dependent functions should be defined in tailor.c. |
81 | */ | 81 | */ |
82 | 82 | ||
83 | /* $Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */ | 83 | /* $Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ |
84 | 84 | ||
85 | #define RECORD_IO 0 | 85 | #define RECORD_IO 0 |
86 | 86 | ||
@@ -436,7 +436,7 @@ extern int unlzw OF((int in, int out)); | |||
436 | # undef LZW | 436 | # undef LZW |
437 | #endif | 437 | #endif |
438 | 438 | ||
439 | /* $Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */ | 439 | /* $Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ |
440 | 440 | ||
441 | /* #include "getopt.h" */ | 441 | /* #include "getopt.h" */ |
442 | 442 | ||
@@ -698,7 +698,7 @@ int (*work) OF((int infile, int outfile)) = unzip; /* function to call */ | |||
698 | #define strequ(s1, s2) (strcmp((s1),(s2)) == 0) | 698 | #define strequ(s1, s2) (strcmp((s1),(s2)) == 0) |
699 | 699 | ||
700 | /* ======================================================================== */ | 700 | /* ======================================================================== */ |
701 | int zcat_main (struct FileInfo * i, int argc, char * * argv) | 701 | int zcat_main (int argc, char * * argv) |
702 | { | 702 | { |
703 | int file_count; /* number of files to precess */ | 703 | int file_count; /* number of files to precess */ |
704 | 704 | ||
@@ -895,7 +895,7 @@ RETSIGTYPE abort_gzip() | |||
895 | */ | 895 | */ |
896 | 896 | ||
897 | #ifdef RCSID | 897 | #ifdef RCSID |
898 | static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 898 | static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
899 | #endif | 899 | #endif |
900 | 900 | ||
901 | /* #include "crypt.h" */ | 901 | /* #include "crypt.h" */ |
@@ -1021,7 +1021,7 @@ int unzip(in, out) | |||
1021 | */ | 1021 | */ |
1022 | 1022 | ||
1023 | #ifdef RCSID | 1023 | #ifdef RCSID |
1024 | static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 1024 | static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
1025 | #endif | 1025 | #endif |
1026 | 1026 | ||
1027 | #include <ctype.h> | 1027 | #include <ctype.h> |
@@ -1408,7 +1408,7 @@ ulg crc_32_tab[] = { | |||
1408 | */ | 1408 | */ |
1409 | 1409 | ||
1410 | #ifdef RCSID | 1410 | #ifdef RCSID |
1411 | static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $"; | 1411 | static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; |
1412 | #endif | 1412 | #endif |
1413 | 1413 | ||
1414 | #include <sys/types.h> | 1414 | #include <sys/types.h> |