More stuff.
authorEric Andersen <andersen@codepoet.org>
Wed, 6 Oct 1999 20:25:32 +0000 (20:25 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 6 Oct 1999 20:25:32 +0000 (20:25 -0000)
21 files changed:
Makefile
applets/busybox.c
applets/busybox.mkll
archival/gzip.c
archival/tar.c
busybox.c
busybox.def.h
busybox.mkll
coreutils/df.c
df.c
dmesg.c
find.c
findutils/find.c
findutils/grep.c
grep.c
gzip.c
internal.h
tar.c
util-linux/dmesg.c
utility.c
zcat.c

index 535c4d7f80f067e78d4720c49a9a9129f3eb4e8b..2b999f088d39c5f1d68d8e415ebbe847f9302566 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,38 @@
 
 VERSION=0.29alpha1
 BUILDTIME=$(shell date "+%Y%m%d-%H%M")
+DODEBUG=true
 
 #This will choke on a non-debian system
 ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
 
 
-STRIP= strip --remove-section=.note --remove-section=.comment busybox
-LDFLAGS= -s
-
 # -D_GNU_SOURCE is needed because environ is used in init.c
-CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
-# For debugging only
-#CFLAGS=-Wall -g -D_GNU_SOURCE
+ifeq ($(DODEBUG),true)
+    CFLAGS=-Wall -g -D_GNU_SOURCE
+    STRIP=
+else
+    CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
+    STRIP= strip --remove-section=.note --remove-section=.comment busybox
+endif
+
+ifndef $(prefix)
+    prefix=`pwd`
+endif
+BINDIR=$(prefix)
+
+LDFLAGS= -s
 LIBRARIES=-lc
 OBJECTS=$(shell ./busybox.sh) utility.o
-
 CFLAGS+= -DBB_VER='"$(VERSION)"'
 CFLAGS+= -DBB_BT='"$(BUILDTIME)"'
 
-#all: busybox links
-all: busybox
+all: busybox links
+#all: busybox
 
 busybox: $(OBJECTS)
        $(CC) $(CFLAGS) $(LDFLAGS) -o busybox $(OBJECTS) $(LIBRARIES)
-       #$(STRIP)
+       $(STRIP)
 
 links:
        - ./busybox.mkll | sort >busybox.links
@@ -38,3 +46,7 @@ distclean: clean
 force:
 
 $(OBJECTS):  busybox.def.h internal.h Makefile
+
+install:    busybox
+       install.sh $(BINDIR)
+
index 9986af3890eda31dc47775f5685b5c15f42f4679..c36bc2626e9802e51e2f015d19b0b98276a6f4aa 100644 (file)
@@ -195,6 +195,7 @@ int main(int argc, char **argv)
 
 int busybox_main(int argc, char **argv)
 {
+    int col=0;
     argc--;
     argv++;
 
@@ -208,18 +209,19 @@ int busybox_main(int argc, char **argv)
        fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n",
                BB_VER, BB_BT);
        fprintf(stderr, "Usage: busybox [function] [arguments]...\n");
+       fprintf(stderr, "or\nUsage: [function] [arguments]...\n");
        fprintf(stderr,
                "\n\tMost people will create a symlink to busybox for each\n"
                "\tfunction name, and busybox will act like whatever you invoke it as.\n");
        fprintf(stderr, "\nCurrently defined functions:\n");
 
-       if (a->name != 0) {
-           fprintf(stderr, "%s", a->name);
-           a++;
-       }
        while (a->name != 0) {
-           fprintf(stderr, ", %s", a->name);
+           col+=fprintf(stderr, "%s%s", ((col==0)? "\t":", "), a->name);
            a++;
+           if (col>60) {
+               fprintf(stderr, ",\n");
+               col=0;
+           }
        }
        fprintf(stderr, "\n\n");
        exit(-1);
index e43a1ccb072e939876b583c8360ea4ba1821fcdb..f79462b7f1aae1bd74fb7542e99c91c844f4de91 100755 (executable)
@@ -2,16 +2,14 @@
 #Make busybox links list file
 
 DF="busybox.def.h"
-MF="main.c"
+MF="busybox.c"
 
 LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)"
 
-       for def in ${LIST}; do
-                       
-               set -- $(sed -n '/^#ifdef '$def'[ +|    +].*/,/^#endif/{s/.*\/\///p; /^{ /{ s/^{ "//; s/",.*$//p;}; }' $MF)
-               path=$1; shift
-               
-                       for n in $@; do
-                               echo "$path/$n"
-                       done
+for def in ${LIST}; do
+       i=`sed -n 's/^#ifdef '$def'.*\/\/\(.*$\)/\/\1\//gp' $MF`
+       j=`sed -n '/^#ifdef '$def'.*/,/^#endif/{ s/.*\"\(.*\)\".*/\1/gp; }' $MF`
+       for k in $j; do
+           echo $i$k
        done
+done
index 6fd2e3971c6a594a4f9b603ac2ec70bfa2324241..4b1d32ddd85456ad6edd50f4c56d4c8ccccd1a43 100644 (file)
@@ -380,7 +380,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #  undef LZW
 #endif
 
-/* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */
+/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
 /* tailor.h -- target dependent definitions
  * Copyright (C) 1992-1993 Jean-loup Gailly.
  * 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 */
  * The target dependent functions should be defined in tailor.c.
  */
 
-/* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */
+/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
 
 #if defined(__MSDOS__) && !defined(MSDOS)
 #  define MSDOS
@@ -767,7 +767,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #endif
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -976,7 +976,7 @@ void copy_block(buf, len, header)
 #include <stdio.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -1592,7 +1592,7 @@ ulg deflate()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -1781,7 +1781,7 @@ static int (*work) OF((int infile, int outfile)) = zip; /* function to call */
 // int main (argc, argv)
 //    int argc;
 //    char **argv;
-int gzip_main(struct FileInfo * i, int argc, char * * argv)
+int gzip_main(int argc, char * * argv)
 {
     foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
     if (foreground) {
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode)
 #include <ctype.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -2943,7 +2943,7 @@ local void set_file_type()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file)
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
index 03da96735e6913bacdd9491c43504d0278667e4b..498d4a3004512645573dc91ce50e9d32a9a3ac55 100644 (file)
@@ -131,14 +131,10 @@ static    void    writeHeader(const char * fileName,
 static void    writeTarFile(int fileCount, char ** fileTable);
 static void    writeTarBlock(const char * buf, int len);
 static BOOL    putOctal(char * cp, int len, long value);
-extern  const char *    modeString(int mode);
-extern  const char *    timeString(time_t timeVal);
-extern  int             fullWrite(int fd, const char * buf, int len);
-extern  int             fullRead(int fd, char * buf, int len);
 
 
 extern int 
-tar_main(struct FileInfo *unused, int argc, char ** argv)
+tar_main(int argc, char ** argv)
 {
        const char *    options;
 
@@ -1258,167 +1254,6 @@ wantFileName(const char * fileName, int fileCount, char ** fileTable)
 
 
 
-/*
- * Return the standard ls-like mode string from a file mode.
- * This is static and so is overwritten on each call.
- */
-const char *
-modeString(int mode)
-{
-       static  char    buf[12];
-
-       strcpy(buf, "----------");
-
-       /*
-        * Fill in the file type.
-        */
-       if (S_ISDIR(mode))
-               buf[0] = 'd';
-       if (S_ISCHR(mode))
-               buf[0] = 'c';
-       if (S_ISBLK(mode))
-               buf[0] = 'b';
-       if (S_ISFIFO(mode))
-               buf[0] = 'p';
-#ifdef S_ISLNK
-       if (S_ISLNK(mode))
-               buf[0] = 'l';
-#endif
-#ifdef S_ISSOCK
-       if (S_ISSOCK(mode))
-               buf[0] = 's';
-#endif
-
-       /*
-        * Now fill in the normal file permissions.
-        */
-       if (mode & S_IRUSR)
-               buf[1] = 'r';
-       if (mode & S_IWUSR)
-               buf[2] = 'w';
-       if (mode & S_IXUSR)
-               buf[3] = 'x';
-       if (mode & S_IRGRP)
-               buf[4] = 'r';
-       if (mode & S_IWGRP)
-               buf[5] = 'w';
-       if (mode & S_IXGRP)
-               buf[6] = 'x';
-       if (mode & S_IROTH)
-               buf[7] = 'r';
-       if (mode & S_IWOTH)
-               buf[8] = 'w';
-       if (mode & S_IXOTH)
-               buf[9] = 'x';
-
-       /*
-        * Finally fill in magic stuff like suid and sticky text.
-        */
-       if (mode & S_ISUID)
-               buf[3] = ((mode & S_IXUSR) ? 's' : 'S');
-       if (mode & S_ISGID)
-               buf[6] = ((mode & S_IXGRP) ? 's' : 'S');
-       if (mode & S_ISVTX)
-               buf[9] = ((mode & S_IXOTH) ? 't' : 'T');
-
-       return buf;
-}
-
-
-/*
- * Get the time string to be used for a file.
- * This is down to the minute for new files, but only the date for old files.
- * The string is returned from a static buffer, and so is overwritten for
- * each call.
- */
-const char *
-timeString(time_t timeVal)
-{
-       time_t          now;
-       char *          str;
-       static  char    buf[26];
-
-       time(&now);
-
-       str = ctime(&timeVal);
-
-       strcpy(buf, &str[4]);
-       buf[12] = '\0';
-
-       if ((timeVal > now) || (timeVal < now - 365*24*60*60L))
-       {
-               strcpy(&buf[7], &str[20]);
-               buf[11] = '\0';
-       }
-
-       return buf;
-}
-
-
-
-/*
- * Write all of the supplied buffer out to a file.
- * This does multiple writes as necessary.
- * Returns the amount written, or -1 on an error.
- */
-int
-fullWrite(int fd, const char * buf, int len)
-{
-       int     cc;
-       int     total;
-
-       total = 0;
-
-       while (len > 0)
-       {
-               cc = write(fd, buf, len);
-
-               if (cc < 0)
-                       return -1;
-
-               buf += cc;
-               total+= cc;
-               len -= cc;
-       }
-
-       return total;
-}
-
-
-/*
- * Read all of the supplied buffer from a file.
- * This does multiple reads as necessary.
- * Returns the amount read, or -1 on an error.
- * A short read is returned on an end of file.
- */
-int
-fullRead(int fd, char * buf, int len)
-{
-       int     cc;
-       int     total;
-
-       total = 0;
-
-       while (len > 0)
-       {
-               cc = read(fd, buf, len);
-
-               if (cc < 0)
-                       return -1;
-
-               if (cc == 0)
-                       break;
-
-               buf += cc;
-               total+= cc;
-               len -= cc;
-       }
-
-       return total;
-}
-
-
-
 #endif
 /* END CODE */
 
index 9986af3890eda31dc47775f5685b5c15f42f4679..c36bc2626e9802e51e2f015d19b0b98276a6f4aa 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -195,6 +195,7 @@ int main(int argc, char **argv)
 
 int busybox_main(int argc, char **argv)
 {
+    int col=0;
     argc--;
     argv++;
 
@@ -208,18 +209,19 @@ int busybox_main(int argc, char **argv)
        fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n",
                BB_VER, BB_BT);
        fprintf(stderr, "Usage: busybox [function] [arguments]...\n");
+       fprintf(stderr, "or\nUsage: [function] [arguments]...\n");
        fprintf(stderr,
                "\n\tMost people will create a symlink to busybox for each\n"
                "\tfunction name, and busybox will act like whatever you invoke it as.\n");
        fprintf(stderr, "\nCurrently defined functions:\n");
 
-       if (a->name != 0) {
-           fprintf(stderr, "%s", a->name);
-           a++;
-       }
        while (a->name != 0) {
-           fprintf(stderr, ", %s", a->name);
+           col+=fprintf(stderr, "%s%s", ((col==0)? "\t":", "), a->name);
            a++;
+           if (col>60) {
+               fprintf(stderr, ",\n");
+               col=0;
+           }
        }
        fprintf(stderr, "\n\n");
        exit(-1);
index 0149cc3bbdab0a769b8997296db1006e837be2d7..111aca63d37b409af50e57214218e8e91b546971 100644 (file)
 #define BB_DATE
 #define BB_DD
 //#define BB_DESCEND
-//#define BB_DF
+#define BB_DF
 #define BB_DMESG
 //#define BB_DUTMP
 //#define BB_DYADIC
 #define BB_FALSE
 //#define BB_FDFLUSH
-//#define BB_FIND
-//#define BB_FINDMOUNT
-//#define BB_GREP
+#define BB_FIND
+#define BB_GREP
 ////#define BB_HALT
 //#define BB_INIT
 //#define BB_KILL
 ////#define BB_SWAPOFF
 //#define BB_SWAPON
 //#define BB_SYNC
-//#define BB_TAR
+#define BB_TAR
 //#define BB_TOUCH
 #define BB_TRUE
 //#define BB_UMOUNT
 //#define BB_UPDATE
 //#define BB_UTILITY
-//#define BB_ZCAT
-//#define BB_GZIP
+#define BB_ZCAT
+#define BB_GZIP
index e43a1ccb072e939876b583c8360ea4ba1821fcdb..f79462b7f1aae1bd74fb7542e99c91c844f4de91 100755 (executable)
@@ -2,16 +2,14 @@
 #Make busybox links list file
 
 DF="busybox.def.h"
-MF="main.c"
+MF="busybox.c"
 
 LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)"
 
-       for def in ${LIST}; do
-                       
-               set -- $(sed -n '/^#ifdef '$def'[ +|    +].*/,/^#endif/{s/.*\/\///p; /^{ /{ s/^{ "//; s/",.*$//p;}; }' $MF)
-               path=$1; shift
-               
-                       for n in $@; do
-                               echo "$path/$n"
-                       done
+for def in ${LIST}; do
+       i=`sed -n 's/^#ifdef '$def'.*\/\/\(.*$\)/\/\1\//gp' $MF`
+       j=`sed -n '/^#ifdef '$def'.*/,/^#endif/{ s/.*\"\(.*\)\".*/\1/gp; }' $MF`
+       for k in $j; do
+           echo $i$k
        done
+done
index a0692afc5fb820de89b2ecad59e9908036963c8d..bbda694567bbd18f41734b1827c8aa905703f81a 100644 (file)
@@ -17,7 +17,7 @@ df(const char * device, const char * mountPoint)
        long            blocks_percent_used;
 
        if ( statfs(mountPoint, &s) != 0 ) {
-               name_and_error(mountPoint);
+               perror(mountPoint);
                return 1;
        }
        
@@ -52,7 +52,7 @@ df(const char * device, const char * mountPoint)
 }
 
 extern int
-df_main(struct FileInfo * i, int argc, char * * argv)
+df_main(int argc, char * * argv)
 {
        static const char header[] =
         "Filesystem         1024-blocks  Used Available Capacity Mounted on\n";
@@ -63,11 +63,9 @@ df_main(struct FileInfo * i, int argc, char * * argv)
                int                             status;
 
                while ( argc > 1 ) {
-                       if ( (mountEntry = findMountPoint(argv[1], "/etc/mtab")) == 0
-                        && (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 )
+                       if ( (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 )
                        {
-                               fprintf(stderr, "%s: can't find mount point.\n"
-                               ,argv[1]);
+                               fprintf(stderr, "%s: can't find mount point.\n" ,argv[1]);
                                return 1;
                        }
                        status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
@@ -82,10 +80,8 @@ df_main(struct FileInfo * i, int argc, char * * argv)
                FILE *          mountTable;
                struct mntent * mountEntry;
 
-               if ( (mountTable = setmntent("/etc/mtab", "r")) == 0
-                && (mountTable = setmntent("/proc/mounts", "r")) == 0
-               ) {
-                       name_and_error("/etc/mtab");
+               if ( (mountTable = setmntent("/proc/mounts", "r")) == 0) {
+                       perror("/proc/mounts");
                        return 1;
                }
 
@@ -101,3 +97,48 @@ df_main(struct FileInfo * i, int argc, char * * argv)
        
        return 0;
 }
+
+
+
+
+/*
+ * Given a block device, find the mount table entry if that block device
+ * is mounted.
+ *
+ * Given any other file (or directory), find the mount table entry for its
+ * filesystem.
+ */
+extern struct mntent *
+findMountPoint(const char * name, const char * table)
+{
+       struct stat     s;
+       dev_t                   mountDevice;
+       FILE *                  mountTable;
+       struct mntent * mountEntry;
+
+       if ( stat(name, &s) != 0 )
+               return 0;
+
+       if ( (s.st_mode & S_IFMT) == S_IFBLK )
+               mountDevice = s.st_rdev;
+       else
+               mountDevice = s.st_dev;
+
+       
+       if ( (mountTable = setmntent(table, "r")) == 0 )
+               return 0;
+
+       while ( (mountEntry = getmntent(mountTable)) != 0 ) {
+               if ( strcmp(name, mountEntry->mnt_dir) == 0
+                || strcmp(name, mountEntry->mnt_fsname) == 0 ) /* String match. */
+                       break;
+               if ( stat(mountEntry->mnt_fsname, &s) == 0
+                && s.st_rdev == mountDevice )  /* Match the device. */
+                               break;
+               if ( stat(mountEntry->mnt_dir, &s) == 0
+                && s.st_dev == mountDevice )   /* Match the directory's mount point. */
+                       break;
+       }
+       endmntent(mountTable);
+       return mountEntry;
+}
diff --git a/df.c b/df.c
index a0692afc5fb820de89b2ecad59e9908036963c8d..bbda694567bbd18f41734b1827c8aa905703f81a 100644 (file)
--- a/df.c
+++ b/df.c
@@ -17,7 +17,7 @@ df(const char * device, const char * mountPoint)
        long            blocks_percent_used;
 
        if ( statfs(mountPoint, &s) != 0 ) {
-               name_and_error(mountPoint);
+               perror(mountPoint);
                return 1;
        }
        
@@ -52,7 +52,7 @@ df(const char * device, const char * mountPoint)
 }
 
 extern int
-df_main(struct FileInfo * i, int argc, char * * argv)
+df_main(int argc, char * * argv)
 {
        static const char header[] =
         "Filesystem         1024-blocks  Used Available Capacity Mounted on\n";
@@ -63,11 +63,9 @@ df_main(struct FileInfo * i, int argc, char * * argv)
                int                             status;
 
                while ( argc > 1 ) {
-                       if ( (mountEntry = findMountPoint(argv[1], "/etc/mtab")) == 0
-                        && (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 )
+                       if ( (mountEntry = findMountPoint(argv[1], "/proc/mounts")) == 0 )
                        {
-                               fprintf(stderr, "%s: can't find mount point.\n"
-                               ,argv[1]);
+                               fprintf(stderr, "%s: can't find mount point.\n" ,argv[1]);
                                return 1;
                        }
                        status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
@@ -82,10 +80,8 @@ df_main(struct FileInfo * i, int argc, char * * argv)
                FILE *          mountTable;
                struct mntent * mountEntry;
 
-               if ( (mountTable = setmntent("/etc/mtab", "r")) == 0
-                && (mountTable = setmntent("/proc/mounts", "r")) == 0
-               ) {
-                       name_and_error("/etc/mtab");
+               if ( (mountTable = setmntent("/proc/mounts", "r")) == 0) {
+                       perror("/proc/mounts");
                        return 1;
                }
 
@@ -101,3 +97,48 @@ df_main(struct FileInfo * i, int argc, char * * argv)
        
        return 0;
 }
+
+
+
+
+/*
+ * Given a block device, find the mount table entry if that block device
+ * is mounted.
+ *
+ * Given any other file (or directory), find the mount table entry for its
+ * filesystem.
+ */
+extern struct mntent *
+findMountPoint(const char * name, const char * table)
+{
+       struct stat     s;
+       dev_t                   mountDevice;
+       FILE *                  mountTable;
+       struct mntent * mountEntry;
+
+       if ( stat(name, &s) != 0 )
+               return 0;
+
+       if ( (s.st_mode & S_IFMT) == S_IFBLK )
+               mountDevice = s.st_rdev;
+       else
+               mountDevice = s.st_dev;
+
+       
+       if ( (mountTable = setmntent(table, "r")) == 0 )
+               return 0;
+
+       while ( (mountEntry = getmntent(mountTable)) != 0 ) {
+               if ( strcmp(name, mountEntry->mnt_dir) == 0
+                || strcmp(name, mountEntry->mnt_fsname) == 0 ) /* String match. */
+                       break;
+               if ( stat(mountEntry->mnt_fsname, &s) == 0
+                && s.st_rdev == mountDevice )  /* Match the device. */
+                               break;
+               if ( stat(mountEntry->mnt_dir, &s) == 0
+                && s.st_dev == mountDevice )   /* Match the directory's mount point. */
+                       break;
+       }
+       endmntent(mountTable);
+       return mountEntry;
+}
diff --git a/dmesg.c b/dmesg.c
index a63fa3d39607525eccce4f8b745c729b6d2eb17f..9096621b03a1908aedb9ef74ea863070420032ad 100644 (file)
--- a/dmesg.c
+++ b/dmesg.c
@@ -28,7 +28,7 @@ static inline _syscall3(int,klog,int,type,char *,b,int,len)
 const char                     dmesg_usage[] = "dmesg";
 
 int
-dmesg_main(struct FileInfo * info, int argc, char * * argv)
+dmesg_main(int argc, char * * argv)
 {
 
    char buf[4096];
@@ -50,7 +50,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv)
         break;
       case '?':
       default:
-        usage(dmesg_usage);
+        fprintf(stderr, "%s\n", dmesg_usage);
         exit(1);
       }
    }
@@ -58,7 +58,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv)
    argv += optind;
    
    if (argc > 1) {
-      usage(dmesg_usage);
+     fprintf(stderr, "%s\n", dmesg_usage);
       exit(1);
    }
 
diff --git a/find.c b/find.c
index b3ac1ff5a99a7fd3559f38d55a05d754e9de404f..a42f9e979bfed6c2a844162ab05791e3428463c6 100644 (file)
--- a/find.c
+++ b/find.c
@@ -1,3 +1,133 @@
+/*
+ * Mini find implementation for busybox
+ *
+ * Copyright (C) 1998 by Erik Andersen <andersee@debian.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <dirent.h>
+#include "internal.h"
+
+
+static char* pattern=NULL;
+static char* directory=NULL;
+int dereferenceFlag=FALSE;
+
+static const char find_usage[] = "find [path...] [expression]\n"
+"default path is the current directory; default expression is -print\n"
+"expression may consist of:\n";
+
+
+
+static int fileAction(const char *fileName)
+{
+    if (pattern==NULL)
+       fprintf(stdout, "%s\n", fileName);
+    else if (match(fileName, pattern) == TRUE)
+       fprintf(stdout, "%s\n", fileName);
+    return( TRUE);
+}
+
+static int dirAction(const char *fileName)
+{
+    DIR *dir;
+    struct dirent *entry;
+    
+    if (pattern==NULL)
+       fprintf(stdout, "%s\n", fileName);
+    else if (match(fileName, pattern) == TRUE)
+       fprintf(stdout, "%s\n", fileName);
+
+    dir = opendir( fileName);
+    if (!dir) {
+       perror("Can't open directory");
+       exit(FALSE);
+    }
+    while ((entry = readdir(dir)) != NULL) {
+       char dirName[NAME_MAX];
+       sprintf(dirName, "%s/%s", fileName, entry->d_name);
+       recursiveAction( dirName, TRUE, dereferenceFlag, fileAction, dirAction);
+    }
+    return( TRUE);
+}
+
+int find_main(int argc, char **argv)
+{
+    if (argc <= 1) {
+       dirAction( "."); 
+    }
+
+    /* peel off the "find" */
+    argc--;
+    argv++;
+
+    if (**argv != '-') {
+       directory=*argv;
+       argc--;
+       argv++;
+    }
+
+    /* Parse any options */
+    while (**argv == '-') {
+       int stopit=FALSE;
+       while (*++(*argv) && stopit==FALSE) switch (**argv) {
+           case 'f':
+               if (strcmp(*argv, "follow")==0) {
+                   argc--;
+                   argv++;
+                   dereferenceFlag=TRUE;
+               }
+               break;
+           case 'n':
+               if (strcmp(*argv, "name")==0) {
+                   if (argc-- > 1) {
+                       pattern=*(++argv);
+                       stopit=-TRUE;
+                   } else {
+                       fprintf(stderr, "Usage: %s\n", find_usage);
+                       exit( FALSE);
+                   }
+               }
+               break;
+           case '-':
+               /* Ignore all long options */
+               break;
+           default:
+               fprintf(stderr, "Usage: %s\n", find_usage);
+               exit( FALSE);
+       }
+       if (argc-- > 1)
+           argv++;
+           if (**argv != '-')
+               break;
+       else
+           break;
+    }
+
+    dirAction( directory); 
+    exit(TRUE);
+}
+
+
+
+#ifdef foobar
+
 #include "internal.h"
 #include <errno.h>
 #include <stdio.h>
@@ -21,3 +151,6 @@ find_fn(const struct FileInfo * i)
 
        return(0);      
 }
+
+
+#endif
index b3ac1ff5a99a7fd3559f38d55a05d754e9de404f..a42f9e979bfed6c2a844162ab05791e3428463c6 100644 (file)
@@ -1,3 +1,133 @@
+/*
+ * Mini find implementation for busybox
+ *
+ * Copyright (C) 1998 by Erik Andersen <andersee@debian.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <dirent.h>
+#include "internal.h"
+
+
+static char* pattern=NULL;
+static char* directory=NULL;
+int dereferenceFlag=FALSE;
+
+static const char find_usage[] = "find [path...] [expression]\n"
+"default path is the current directory; default expression is -print\n"
+"expression may consist of:\n";
+
+
+
+static int fileAction(const char *fileName)
+{
+    if (pattern==NULL)
+       fprintf(stdout, "%s\n", fileName);
+    else if (match(fileName, pattern) == TRUE)
+       fprintf(stdout, "%s\n", fileName);
+    return( TRUE);
+}
+
+static int dirAction(const char *fileName)
+{
+    DIR *dir;
+    struct dirent *entry;
+    
+    if (pattern==NULL)
+       fprintf(stdout, "%s\n", fileName);
+    else if (match(fileName, pattern) == TRUE)
+       fprintf(stdout, "%s\n", fileName);
+
+    dir = opendir( fileName);
+    if (!dir) {
+       perror("Can't open directory");
+       exit(FALSE);
+    }
+    while ((entry = readdir(dir)) != NULL) {
+       char dirName[NAME_MAX];
+       sprintf(dirName, "%s/%s", fileName, entry->d_name);
+       recursiveAction( dirName, TRUE, dereferenceFlag, fileAction, dirAction);
+    }
+    return( TRUE);
+}
+
+int find_main(int argc, char **argv)
+{
+    if (argc <= 1) {
+       dirAction( "."); 
+    }
+
+    /* peel off the "find" */
+    argc--;
+    argv++;
+
+    if (**argv != '-') {
+       directory=*argv;
+       argc--;
+       argv++;
+    }
+
+    /* Parse any options */
+    while (**argv == '-') {
+       int stopit=FALSE;
+       while (*++(*argv) && stopit==FALSE) switch (**argv) {
+           case 'f':
+               if (strcmp(*argv, "follow")==0) {
+                   argc--;
+                   argv++;
+                   dereferenceFlag=TRUE;
+               }
+               break;
+           case 'n':
+               if (strcmp(*argv, "name")==0) {
+                   if (argc-- > 1) {
+                       pattern=*(++argv);
+                       stopit=-TRUE;
+                   } else {
+                       fprintf(stderr, "Usage: %s\n", find_usage);
+                       exit( FALSE);
+                   }
+               }
+               break;
+           case '-':
+               /* Ignore all long options */
+               break;
+           default:
+               fprintf(stderr, "Usage: %s\n", find_usage);
+               exit( FALSE);
+       }
+       if (argc-- > 1)
+           argv++;
+           if (**argv != '-')
+               break;
+       else
+           break;
+    }
+
+    dirAction( directory); 
+    exit(TRUE);
+}
+
+
+
+#ifdef foobar
+
 #include "internal.h"
 #include <errno.h>
 #include <stdio.h>
@@ -21,3 +151,6 @@ find_fn(const struct FileInfo * i)
 
        return(0);      
 }
+
+
+#endif
index 3779e5510a9eda7ea7ae988f140bfc40b003e63c..a07feda03649c84e064320089b088a2b1cb9652c 100644 (file)
@@ -36,7 +36,7 @@ static        BOOL    search
 
 
 extern int 
-grep_main(struct FileInfo * unused, int argc, char ** argv)
+grep_main(int argc, char ** argv)
 {
        FILE *          fp;
        const char *    word;
diff --git a/grep.c b/grep.c
index 3779e5510a9eda7ea7ae988f140bfc40b003e63c..a07feda03649c84e064320089b088a2b1cb9652c 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -36,7 +36,7 @@ static        BOOL    search
 
 
 extern int 
-grep_main(struct FileInfo * unused, int argc, char ** argv)
+grep_main(int argc, char ** argv)
 {
        FILE *          fp;
        const char *    word;
diff --git a/gzip.c b/gzip.c
index 6fd2e3971c6a594a4f9b603ac2ec70bfa2324241..4b1d32ddd85456ad6edd50f4c56d4c8ccccd1a43 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -380,7 +380,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #  undef LZW
 #endif
 
-/* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */
+/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
 /* tailor.h -- target dependent definitions
  * Copyright (C) 1992-1993 Jean-loup Gailly.
  * 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 */
  * The target dependent functions should be defined in tailor.c.
  */
 
-/* $Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */
+/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
 
 #if defined(__MSDOS__) && !defined(MSDOS)
 #  define MSDOS
@@ -767,7 +767,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #endif
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -976,7 +976,7 @@ void copy_block(buf, len, header)
 #include <stdio.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -1592,7 +1592,7 @@ ulg deflate()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -1781,7 +1781,7 @@ static int (*work) OF((int infile, int outfile)) = zip; /* function to call */
 // int main (argc, argv)
 //    int argc;
 //    char **argv;
-int gzip_main(struct FileInfo * i, int argc, char * * argv)
+int gzip_main(int argc, char * * argv)
 {
     foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
     if (foreground) {
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode)
 #include <ctype.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -2943,7 +2943,7 @@ local void set_file_type()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file)
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
index 5a8b0c57e07785d2bd771b2757a7934ba6a45c7d..9c7dda4d4052bab9479d645c0431803d2a0d6f4a 100644 (file)
@@ -183,6 +183,8 @@ int fullRead(int fd, char *buf, int len);
 int recursiveAction(const char *fileName, BOOL recurse, BOOL followLinks,
          int (*fileAction) (const char *fileName),
          int (*dirAction) (const char *fileName));
+BOOL match(const char* text, const char * pattern);
+const char* timeString(time_t timeVal);
 
 
 #endif
diff --git a/tar.c b/tar.c
index 03da96735e6913bacdd9491c43504d0278667e4b..498d4a3004512645573dc91ce50e9d32a9a3ac55 100644 (file)
--- a/tar.c
+++ b/tar.c
@@ -131,14 +131,10 @@ static    void    writeHeader(const char * fileName,
 static void    writeTarFile(int fileCount, char ** fileTable);
 static void    writeTarBlock(const char * buf, int len);
 static BOOL    putOctal(char * cp, int len, long value);
-extern  const char *    modeString(int mode);
-extern  const char *    timeString(time_t timeVal);
-extern  int             fullWrite(int fd, const char * buf, int len);
-extern  int             fullRead(int fd, char * buf, int len);
 
 
 extern int 
-tar_main(struct FileInfo *unused, int argc, char ** argv)
+tar_main(int argc, char ** argv)
 {
        const char *    options;
 
@@ -1258,167 +1254,6 @@ wantFileName(const char * fileName, int fileCount, char ** fileTable)
 
 
 
-/*
- * Return the standard ls-like mode string from a file mode.
- * This is static and so is overwritten on each call.
- */
-const char *
-modeString(int mode)
-{
-       static  char    buf[12];
-
-       strcpy(buf, "----------");
-
-       /*
-        * Fill in the file type.
-        */
-       if (S_ISDIR(mode))
-               buf[0] = 'd';
-       if (S_ISCHR(mode))
-               buf[0] = 'c';
-       if (S_ISBLK(mode))
-               buf[0] = 'b';
-       if (S_ISFIFO(mode))
-               buf[0] = 'p';
-#ifdef S_ISLNK
-       if (S_ISLNK(mode))
-               buf[0] = 'l';
-#endif
-#ifdef S_ISSOCK
-       if (S_ISSOCK(mode))
-               buf[0] = 's';
-#endif
-
-       /*
-        * Now fill in the normal file permissions.
-        */
-       if (mode & S_IRUSR)
-               buf[1] = 'r';
-       if (mode & S_IWUSR)
-               buf[2] = 'w';
-       if (mode & S_IXUSR)
-               buf[3] = 'x';
-       if (mode & S_IRGRP)
-               buf[4] = 'r';
-       if (mode & S_IWGRP)
-               buf[5] = 'w';
-       if (mode & S_IXGRP)
-               buf[6] = 'x';
-       if (mode & S_IROTH)
-               buf[7] = 'r';
-       if (mode & S_IWOTH)
-               buf[8] = 'w';
-       if (mode & S_IXOTH)
-               buf[9] = 'x';
-
-       /*
-        * Finally fill in magic stuff like suid and sticky text.
-        */
-       if (mode & S_ISUID)
-               buf[3] = ((mode & S_IXUSR) ? 's' : 'S');
-       if (mode & S_ISGID)
-               buf[6] = ((mode & S_IXGRP) ? 's' : 'S');
-       if (mode & S_ISVTX)
-               buf[9] = ((mode & S_IXOTH) ? 't' : 'T');
-
-       return buf;
-}
-
-
-/*
- * Get the time string to be used for a file.
- * This is down to the minute for new files, but only the date for old files.
- * The string is returned from a static buffer, and so is overwritten for
- * each call.
- */
-const char *
-timeString(time_t timeVal)
-{
-       time_t          now;
-       char *          str;
-       static  char    buf[26];
-
-       time(&now);
-
-       str = ctime(&timeVal);
-
-       strcpy(buf, &str[4]);
-       buf[12] = '\0';
-
-       if ((timeVal > now) || (timeVal < now - 365*24*60*60L))
-       {
-               strcpy(&buf[7], &str[20]);
-               buf[11] = '\0';
-       }
-
-       return buf;
-}
-
-
-
-/*
- * Write all of the supplied buffer out to a file.
- * This does multiple writes as necessary.
- * Returns the amount written, or -1 on an error.
- */
-int
-fullWrite(int fd, const char * buf, int len)
-{
-       int     cc;
-       int     total;
-
-       total = 0;
-
-       while (len > 0)
-       {
-               cc = write(fd, buf, len);
-
-               if (cc < 0)
-                       return -1;
-
-               buf += cc;
-               total+= cc;
-               len -= cc;
-       }
-
-       return total;
-}
-
-
-/*
- * Read all of the supplied buffer from a file.
- * This does multiple reads as necessary.
- * Returns the amount read, or -1 on an error.
- * A short read is returned on an end of file.
- */
-int
-fullRead(int fd, char * buf, int len)
-{
-       int     cc;
-       int     total;
-
-       total = 0;
-
-       while (len > 0)
-       {
-               cc = read(fd, buf, len);
-
-               if (cc < 0)
-                       return -1;
-
-               if (cc == 0)
-                       break;
-
-               buf += cc;
-               total+= cc;
-               len -= cc;
-       }
-
-       return total;
-}
-
-
-
 #endif
 /* END CODE */
 
index a63fa3d39607525eccce4f8b745c729b6d2eb17f..9096621b03a1908aedb9ef74ea863070420032ad 100644 (file)
@@ -28,7 +28,7 @@ static inline _syscall3(int,klog,int,type,char *,b,int,len)
 const char                     dmesg_usage[] = "dmesg";
 
 int
-dmesg_main(struct FileInfo * info, int argc, char * * argv)
+dmesg_main(int argc, char * * argv)
 {
 
    char buf[4096];
@@ -50,7 +50,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv)
         break;
       case '?':
       default:
-        usage(dmesg_usage);
+        fprintf(stderr, "%s\n", dmesg_usage);
         exit(1);
       }
    }
@@ -58,7 +58,7 @@ dmesg_main(struct FileInfo * info, int argc, char * * argv)
    argv += optind;
    
    if (argc > 1) {
-      usage(dmesg_usage);
+     fprintf(stderr, "%s\n", dmesg_usage);
       exit(1);
    }
 
index c8f58e8f2ce6087083defd2494a460cdb481dbae..369aa21f21f8f1003cdbbc03bdc21b6b6ffa86ac 100644 (file)
--- a/utility.c
+++ b/utility.c
@@ -405,6 +405,131 @@ freeChunks(void)
 }
 
 
+/*
+ * Get the time string to be used for a file.
+ * This is down to the minute for new files, but only the date for old files.
+ * The string is returned from a static buffer, and so is overwritten for
+ * each call.
+ */
+const char *
+timeString(time_t timeVal)
+{
+       time_t          now;
+       char *          str;
+       static  char    buf[26];
+
+       time(&now);
+
+       str = ctime(&timeVal);
+
+       strcpy(buf, &str[4]);
+       buf[12] = '\0';
+
+       if ((timeVal > now) || (timeVal < now - 365*24*60*60L))
+       {
+               strcpy(&buf[7], &str[20]);
+               buf[11] = '\0';
+       }
+
+       return buf;
+}
+
+
+/*
+ * Routine to see if a text string is matched by a wildcard pattern.
+ * Returns TRUE if the text is matched, or FALSE if it is not matched
+ * or if the pattern is invalid.
+ *  *          matches zero or more characters
+ *  ?          matches a single character
+ *  [abc]      matches 'a', 'b' or 'c'
+ *  \c         quotes character c
+ *  Adapted from code written by Ingo Wilken.
+ */
+BOOL
+match(const char * text, const char * pattern)
+{
+       const char *    retryPat;
+       const char *    retryText;
+       int             ch;
+       BOOL            found;
+
+       retryPat = NULL;
+       retryText = NULL;
+
+       while (*text || *pattern)
+       {
+               ch = *pattern++;
+
+               switch (ch)
+               {
+                       case '*':  
+                               retryPat = pattern;
+                               retryText = text;
+                               break;
+
+                       case '[':  
+                               found = FALSE;
+
+                               while ((ch = *pattern++) != ']')
+                               {
+                                       if (ch == '\\')
+                                               ch = *pattern++;
+
+                                       if (ch == '\0')
+                                               return FALSE;
+
+                                       if (*text == ch)
+                                               found = TRUE;
+                               }
+
+                               if (!found)
+                               {
+                                       pattern = retryPat;
+                                       text = ++retryText;
+                               }
+
+                               /* fall into next case */
+
+                       case '?':  
+                               if (*text++ == '\0')
+                                       return FALSE;
+
+                               break;
+
+                       case '\\':  
+                               ch = *pattern++;
+
+                               if (ch == '\0')
+                                       return FALSE;
+
+                               /* fall into next case */
+
+                       default:        
+                               if (*text == ch)
+                               {
+                                       if (*text)
+                                               text++;
+                                       break;
+                               }
+
+                               if (*text)
+                               {
+                                       pattern = retryPat;
+                                       text = ++retryText;
+                                       break;
+                               }
+
+                               return FALSE;
+               }
+
+               if (pattern == NULL)
+                       return FALSE;
+       }
+
+       return TRUE;
+}
+
+
 /*
  * Write all of the supplied buffer out to a file.
  * This does multiple writes as necessary.
@@ -543,3 +668,14 @@ recursiveAction( const char *fileName, BOOL recurse, BOOL followLinks,
 
 
 /* END CODE */
+
+
+
+
+
+
+
+
+
+
+
diff --git a/zcat.c b/zcat.c
index 50fcdfc47b3362b699530cfcbc9702827346ac5b..dfc4d21da11b0d21ec495c5e3e44df2615632b50 100644 (file)
--- a/zcat.c
+++ b/zcat.c
@@ -59,7 +59,7 @@ static char  *license_msg[] = {
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -80,7 +80,7 @@ static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
  * The target dependent functions should be defined in tailor.c.
  */
 
-/* $Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */
+/* $Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
 
 #define RECORD_IO 0
 
@@ -436,7 +436,7 @@ extern int unlzw  OF((int in, int out));
 #  undef LZW
 #endif
 
-/* $Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $ */
+/* $Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
 
 /* #include "getopt.h" */
 
@@ -698,7 +698,7 @@ int (*work) OF((int infile, int outfile)) = unzip; /* function to call */
 #define strequ(s1, s2) (strcmp((s1),(s2)) == 0)
 
 /* ======================================================================== */
-int zcat_main (struct FileInfo * i, int argc, char * * argv)
+int zcat_main (int argc, char * * argv)
 {
     int file_count;     /* number of files to precess */
 
@@ -895,7 +895,7 @@ RETSIGTYPE abort_gzip()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 /* #include "crypt.h" */
@@ -1021,7 +1021,7 @@ int unzip(in, out)
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -1408,7 +1408,7 @@ ulg crc_32_tab[] = {
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: zcat.c,v 1.1 1999/10/05 16:24:56 andersen Exp $";
+static char rcsid[] = "$Id: zcat.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
 #endif
 
 #include <sys/types.h>