aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-10-19 22:26:25 +0000
committerEric Andersen <andersen@codepoet.org>1999-10-19 22:26:25 +0000
commitf5a3838e2ffb1e75b878f9ac48a6951d4d209f5a (patch)
treeb131d6e42bbbcce9eee2417f9ae52de6e5a4374e
parente674eb78e4cbd52d4b044d8e67d1620b32244e8f (diff)
downloadbusybox-w32-f5a3838e2ffb1e75b878f9ac48a6951d4d209f5a.tar.gz
busybox-w32-f5a3838e2ffb1e75b878f9ac48a6951d4d209f5a.tar.bz2
busybox-w32-f5a3838e2ffb1e75b878f9ac48a6951d4d209f5a.zip
More stuff
-rw-r--r--coreutils/ls.c137
-rw-r--r--ls.c137
-rw-r--r--more.c62
-rw-r--r--util-linux/more.c62
-rw-r--r--zcat.c16
5 files changed, 88 insertions, 326 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index a8e7e048a..0cde1960f 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -1,138 +1,4 @@
1/* 1/*
2 * Mini ls 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// I started writing a newer small one, but it isn't done yet....
23// -Erik
24#if fooBar
25
26#include <stdio.h>
27#include <unistd.h>
28#include <dirent.h>
29#include "internal.h"
30
31
32static const char ls_usage[] = "ls [OPTION]... [FILE]...\n"
33"List information about the FILEs (the current directory by default).\n";
34
35int oneFlag=FALSE;
36int allFlag=FALSE;
37int directoryFlag=FALSE;
38int longFlag=FALSE;
39int typeFlag=FALSE;
40int dereferenceFlag=FALSE;
41int recursiveFlag=FALSE;
42
43static int fileAction(const char *fileName)
44{
45 if ( allFlag==FALSE && ((strcmp(fileName, "..") == 0)
46 || (strcmp(fileName, ".") == 0)) ) {
47 return( TRUE);
48 }
49 //struct stat statBuf;
50 //if (stat(fileName, &statBuf) > 0) {
51 fprintf(stdout, "%s\n", fileName);
52 return( TRUE);
53 //}
54 //else {
55// perror(fileName);
56// return( FALSE);
57// }
58}
59
60static int dirAction(const char *fileName)
61{
62 DIR *dir;
63 struct dirent *entry;
64
65 fprintf(stdout, "%s\n", fileName);
66
67 dir = opendir( fileName);
68 if (!dir) {
69 perror("Can't open directory");
70 exit(FALSE);
71 }
72 while ((entry = readdir(dir)) != NULL) {
73 recursiveAction( entry->d_name, recursiveFlag, dereferenceFlag, FALSE, fileAction, dirAction);
74 }
75 return( TRUE);
76}
77
78int ls_main(int argc, char **argv)
79{
80 if (argc <= 1) {
81 char buf[NAME_MAX];
82 getcwd( buf, NAME_MAX);
83 dirAction( buf);
84 }
85
86 /* peel of the "ls" */
87 argc--;
88 argv++;
89
90 /* Parse any options */
91 while (**argv == '-') {
92 while (*++(*argv)) switch (**argv) {
93 case '1':
94 oneFlag = TRUE;
95 break;
96 case 'a':
97 allFlag = TRUE;
98 break;
99 case 'd':
100 directoryFlag = TRUE;
101 break;
102 case 'l':
103 longFlag = TRUE;
104 break;
105 case 'F':
106 typeFlag = TRUE;
107 break;
108 case 'L':
109 dereferenceFlag = TRUE;
110 break;
111 case 'R':
112 recursiveFlag = TRUE;
113 break;
114 default:
115 usage (ls_usage);
116 }
117 argc--;
118 argv++;
119 }
120
121 /* Ok, ready to do the deed now */
122 fprintf(stderr, "B\n");
123 while (argc-- > 1) {
124 fprintf(stderr, "C\n");
125 recursiveAction( *argv, recursiveFlag, dereferenceFlag, fileAction, dirAction);
126 }
127 exit(TRUE);
128}
129
130
131
132#else
133
134
135/*
136 * tiny-ls.c version 0.1.0: A minimalist 'ls' 2 * tiny-ls.c version 0.1.0: A minimalist 'ls'
137 * Copyright (C) 1996 Brian Candler <B.Candler@pobox.com> 3 * Copyright (C) 1996 Brian Candler <B.Candler@pobox.com>
138 * 4 *
@@ -571,7 +437,7 @@ listerr:
571 return 1; 437 return 1;
572} 438}
573 439
574const char ls_usage[] = "ls [-1a" 440static const char ls_usage[] = "ls [-1a"
575#ifdef FEATURE_TIMESTAMPS 441#ifdef FEATURE_TIMESTAMPS
576 "c" 442 "c"
577#endif 443#endif
@@ -672,4 +538,3 @@ print_usage_message:
672 exit( FALSE); 538 exit( FALSE);
673} 539}
674 540
675#endif
diff --git a/ls.c b/ls.c
index a8e7e048a..0cde1960f 100644
--- a/ls.c
+++ b/ls.c
@@ -1,138 +1,4 @@
1/* 1/*
2 * Mini ls 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// I started writing a newer small one, but it isn't done yet....
23// -Erik
24#if fooBar
25
26#include <stdio.h>
27#include <unistd.h>
28#include <dirent.h>
29#include "internal.h"
30
31
32static const char ls_usage[] = "ls [OPTION]... [FILE]...\n"
33"List information about the FILEs (the current directory by default).\n";
34
35int oneFlag=FALSE;
36int allFlag=FALSE;
37int directoryFlag=FALSE;
38int longFlag=FALSE;
39int typeFlag=FALSE;
40int dereferenceFlag=FALSE;
41int recursiveFlag=FALSE;
42
43static int fileAction(const char *fileName)
44{
45 if ( allFlag==FALSE && ((strcmp(fileName, "..") == 0)
46 || (strcmp(fileName, ".") == 0)) ) {
47 return( TRUE);
48 }
49 //struct stat statBuf;
50 //if (stat(fileName, &statBuf) > 0) {
51 fprintf(stdout, "%s\n", fileName);
52 return( TRUE);
53 //}
54 //else {
55// perror(fileName);
56// return( FALSE);
57// }
58}
59
60static int dirAction(const char *fileName)
61{
62 DIR *dir;
63 struct dirent *entry;
64
65 fprintf(stdout, "%s\n", fileName);
66
67 dir = opendir( fileName);
68 if (!dir) {
69 perror("Can't open directory");
70 exit(FALSE);
71 }
72 while ((entry = readdir(dir)) != NULL) {
73 recursiveAction( entry->d_name, recursiveFlag, dereferenceFlag, FALSE, fileAction, dirAction);
74 }
75 return( TRUE);
76}
77
78int ls_main(int argc, char **argv)
79{
80 if (argc <= 1) {
81 char buf[NAME_MAX];
82 getcwd( buf, NAME_MAX);
83 dirAction( buf);
84 }
85
86 /* peel of the "ls" */
87 argc--;
88 argv++;
89
90 /* Parse any options */
91 while (**argv == '-') {
92 while (*++(*argv)) switch (**argv) {
93 case '1':
94 oneFlag = TRUE;
95 break;
96 case 'a':
97 allFlag = TRUE;
98 break;
99 case 'd':
100 directoryFlag = TRUE;
101 break;
102 case 'l':
103 longFlag = TRUE;
104 break;
105 case 'F':
106 typeFlag = TRUE;
107 break;
108 case 'L':
109 dereferenceFlag = TRUE;
110 break;
111 case 'R':
112 recursiveFlag = TRUE;
113 break;
114 default:
115 usage (ls_usage);
116 }
117 argc--;
118 argv++;
119 }
120
121 /* Ok, ready to do the deed now */
122 fprintf(stderr, "B\n");
123 while (argc-- > 1) {
124 fprintf(stderr, "C\n");
125 recursiveAction( *argv, recursiveFlag, dereferenceFlag, fileAction, dirAction);
126 }
127 exit(TRUE);
128}
129
130
131
132#else
133
134
135/*
136 * tiny-ls.c version 0.1.0: A minimalist 'ls' 2 * tiny-ls.c version 0.1.0: A minimalist 'ls'
137 * Copyright (C) 1996 Brian Candler <B.Candler@pobox.com> 3 * Copyright (C) 1996 Brian Candler <B.Candler@pobox.com>
138 * 4 *
@@ -571,7 +437,7 @@ listerr:
571 return 1; 437 return 1;
572} 438}
573 439
574const char ls_usage[] = "ls [-1a" 440static const char ls_usage[] = "ls [-1a"
575#ifdef FEATURE_TIMESTAMPS 441#ifdef FEATURE_TIMESTAMPS
576 "c" 442 "c"
577#endif 443#endif
@@ -672,4 +538,3 @@ print_usage_message:
672 exit( FALSE); 538 exit( FALSE);
673} 539}
674 540
675#endif
diff --git a/more.c b/more.c
index 772d51b18..745ae2bc4 100644
--- a/more.c
+++ b/more.c
@@ -27,22 +27,33 @@
27 27
28#include "internal.h" 28#include "internal.h"
29#include <stdio.h> 29#include <stdio.h>
30#include <fcntl.h>
30#include <signal.h> 31#include <signal.h>
31 32
32 33
33static const char more_usage[] = "[file ...]"; 34static const char more_usage[] = "[file ...]";
34 35
35 36
37/* ED: sparc termios is broken: revert back to old termio handling. */
36#ifdef BB_MORE_TERM 38#ifdef BB_MORE_TERM
37 #include <termios.h> 39
38 #include <signal.h> 40
39 #include <sys/ioctl.h> 41#if defined (__sparc__)
42# define USE_OLD_TERMIO
43# include <termio.h>
44# include <sys/ioctl.h>
45# define termios termio
46# define stty(fd,argp) ioctl(fd,TCSETAF,argp)
47#else
48# include <termios.h>
49# define stty(fd,argp) tcsetattr(fd,TCSANOW,argp)
50#endif
40 51
41 FILE *cin; 52 FILE *cin;
42 struct termios initial_settings, new_settings; 53 struct termios initial_settings, new_settings;
43 54
44 void gotsig(int sig) { 55 void gotsig(int sig) {
45 tcsetattr(fileno(cin), TCSANOW, &initial_settings); 56 stty(fileno(cin), &initial_settings);
46 exit( TRUE); 57 exit( TRUE);
47 } 58 }
48#endif 59#endif
@@ -50,13 +61,9 @@ static const char more_usage[] = "[file ...]";
50extern int more_main(int argc, char **argv) 61extern int more_main(int argc, char **argv)
51{ 62{
52 int c, lines=0, input=0; 63 int c, lines=0, input=0;
53 int next_page=0, rows = 24; 64 int next_page=0;
54#ifdef BB_MORE_TERM
55 int cols=79;
56 struct winsize win;
57#endif
58 struct stat st; 65 struct stat st;
59 FILE *file = stdin; 66 FILE *file;
60 67
61 if ( strcmp(*argv,"--help")==0 || strcmp(*argv,"-h")==0 ) { 68 if ( strcmp(*argv,"--help")==0 || strcmp(*argv,"-h")==0 ) {
62 usage (more_usage); 69 usage (more_usage);
@@ -64,39 +71,48 @@ extern int more_main(int argc, char **argv)
64 argc--; 71 argc--;
65 argv++; 72 argv++;
66 73
67 while (argc-- > 0) { 74 while (argc >= 0) {
75 if (argc==0) {
76 file = stdin;
77 }
78 else
68 file = fopen(*argv, "r"); 79 file = fopen(*argv, "r");
80
69 if (file == NULL) { 81 if (file == NULL) {
70 perror("Can't open file"); 82 perror("Can't open file");
71 exit(FALSE); 83 exit(FALSE);
72 } 84 }
73 fstat(fileno(file), &st); 85 fstat(fileno(file), &st);
74 fprintf(stderr, "hi\n");
75 86
76#ifdef BB_MORE_TERM 87#ifdef BB_MORE_TERM
77 cin = fopen("/dev/tty", "r"); 88 cin = fopen("/dev/tty", "r");
89 if (!cin)
90 cin = fopen("/dev/console", "r");
91#ifdef USE_OLD_TERMIO
92 ioctl(fileno(cin),TCGETA,&initial_settings);
93#else
78 tcgetattr(fileno(cin),&initial_settings); 94 tcgetattr(fileno(cin),&initial_settings);
95#endif
79 new_settings = initial_settings; 96 new_settings = initial_settings;
80 new_settings.c_lflag &= ~ICANON; 97 new_settings.c_lflag &= ~ICANON;
81 new_settings.c_lflag &= ~ECHO; 98 new_settings.c_lflag &= ~ECHO;
82 tcsetattr(fileno(cin), TCSANOW, &new_settings); 99 stty(fileno(cin), &new_settings);
83 100
84 (void) signal(SIGINT, gotsig); 101 (void) signal(SIGINT, gotsig);
85 102
86 ioctl(STDOUT_FILENO, TIOCGWINSZ, &win);
87 if (win.ws_row > 4) rows = win.ws_row - 2;
88 if (win.ws_col > 0) cols = win.ws_col - 1;
89
90
91#endif 103#endif
92 while ((c = getc(file)) != EOF) { 104 while ((c = getc(file)) != EOF) {
93 if ( next_page ) { 105 if ( next_page ) {
94 int len=0; 106 int len=0;
95 next_page = 0; 107 next_page = 0;
96 lines=0; 108 lines=0;
97 len = fprintf(stdout, "--More-- (%d%% of %ld bytes)%s", 109 len = fprintf(stdout, "--More-- ");
110 if (file != stdin) {
111 len += fprintf(stdout, "(%d%% of %ld bytes)",
98 (int) (100*( (double) ftell(file) / (double) st.st_size )), 112 (int) (100*( (double) ftell(file) / (double) st.st_size )),
99 st.st_size, 113 st.st_size);
114 }
115 len += fprintf(stdout, "%s",
100#ifdef BB_MORE_TERM 116#ifdef BB_MORE_TERM
101 "" 117 ""
102#else 118#else
@@ -105,13 +121,13 @@ extern int more_main(int argc, char **argv)
105 ); 121 );
106 122
107 fflush(stdout); 123 fflush(stdout);
108 input = getc( stdin); 124 input = getc( cin);
109 125
110#ifdef BB_MORE_TERM 126#ifdef BB_MORE_TERM
111 /* Erase the "More" message */ 127 /* Erase the "More" message */
112 while(len-- > 0) 128 while(len-- > 0)
113 putc('\b', stdout); 129 putc('\b', stdout);
114 while(len++ < cols) 130 while(len++ < 79)
115 putc(' ', stdout); 131 putc(' ', stdout);
116 while(len-- > 0) 132 while(len-- > 0)
117 putc('\b', stdout); 133 putc('\b', stdout);
@@ -123,7 +139,7 @@ extern int more_main(int argc, char **argv)
123 goto end; 139 goto end;
124 if (input==' ' && c == '\n' ) 140 if (input==' ' && c == '\n' )
125 next_page = 1; 141 next_page = 1;
126 if ( c == '\n' && ++lines == (rows + 1) ) 142 if ( c == '\n' && ++lines == 24 )
127 next_page = 1; 143 next_page = 1;
128 putc(c, stdout); 144 putc(c, stdout);
129 } 145 }
diff --git a/util-linux/more.c b/util-linux/more.c
index 772d51b18..745ae2bc4 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -27,22 +27,33 @@
27 27
28#include "internal.h" 28#include "internal.h"
29#include <stdio.h> 29#include <stdio.h>
30#include <fcntl.h>
30#include <signal.h> 31#include <signal.h>
31 32
32 33
33static const char more_usage[] = "[file ...]"; 34static const char more_usage[] = "[file ...]";
34 35
35 36
37/* ED: sparc termios is broken: revert back to old termio handling. */
36#ifdef BB_MORE_TERM 38#ifdef BB_MORE_TERM
37 #include <termios.h> 39
38 #include <signal.h> 40
39 #include <sys/ioctl.h> 41#if defined (__sparc__)
42# define USE_OLD_TERMIO
43# include <termio.h>
44# include <sys/ioctl.h>
45# define termios termio
46# define stty(fd,argp) ioctl(fd,TCSETAF,argp)
47#else
48# include <termios.h>
49# define stty(fd,argp) tcsetattr(fd,TCSANOW,argp)
50#endif
40 51
41 FILE *cin; 52 FILE *cin;
42 struct termios initial_settings, new_settings; 53 struct termios initial_settings, new_settings;
43 54
44 void gotsig(int sig) { 55 void gotsig(int sig) {
45 tcsetattr(fileno(cin), TCSANOW, &initial_settings); 56 stty(fileno(cin), &initial_settings);
46 exit( TRUE); 57 exit( TRUE);
47 } 58 }
48#endif 59#endif
@@ -50,13 +61,9 @@ static const char more_usage[] = "[file ...]";
50extern int more_main(int argc, char **argv) 61extern int more_main(int argc, char **argv)
51{ 62{
52 int c, lines=0, input=0; 63 int c, lines=0, input=0;
53 int next_page=0, rows = 24; 64 int next_page=0;
54#ifdef BB_MORE_TERM
55 int cols=79;
56 struct winsize win;
57#endif
58 struct stat st; 65 struct stat st;
59 FILE *file = stdin; 66 FILE *file;
60 67
61 if ( strcmp(*argv,"--help")==0 || strcmp(*argv,"-h")==0 ) { 68 if ( strcmp(*argv,"--help")==0 || strcmp(*argv,"-h")==0 ) {
62 usage (more_usage); 69 usage (more_usage);
@@ -64,39 +71,48 @@ extern int more_main(int argc, char **argv)
64 argc--; 71 argc--;
65 argv++; 72 argv++;
66 73
67 while (argc-- > 0) { 74 while (argc >= 0) {
75 if (argc==0) {
76 file = stdin;
77 }
78 else
68 file = fopen(*argv, "r"); 79 file = fopen(*argv, "r");
80
69 if (file == NULL) { 81 if (file == NULL) {
70 perror("Can't open file"); 82 perror("Can't open file");
71 exit(FALSE); 83 exit(FALSE);
72 } 84 }
73 fstat(fileno(file), &st); 85 fstat(fileno(file), &st);
74 fprintf(stderr, "hi\n");
75 86
76#ifdef BB_MORE_TERM 87#ifdef BB_MORE_TERM
77 cin = fopen("/dev/tty", "r"); 88 cin = fopen("/dev/tty", "r");
89 if (!cin)
90 cin = fopen("/dev/console", "r");
91#ifdef USE_OLD_TERMIO
92 ioctl(fileno(cin),TCGETA,&initial_settings);
93#else
78 tcgetattr(fileno(cin),&initial_settings); 94 tcgetattr(fileno(cin),&initial_settings);
95#endif
79 new_settings = initial_settings; 96 new_settings = initial_settings;
80 new_settings.c_lflag &= ~ICANON; 97 new_settings.c_lflag &= ~ICANON;
81 new_settings.c_lflag &= ~ECHO; 98 new_settings.c_lflag &= ~ECHO;
82 tcsetattr(fileno(cin), TCSANOW, &new_settings); 99 stty(fileno(cin), &new_settings);
83 100
84 (void) signal(SIGINT, gotsig); 101 (void) signal(SIGINT, gotsig);
85 102
86 ioctl(STDOUT_FILENO, TIOCGWINSZ, &win);
87 if (win.ws_row > 4) rows = win.ws_row - 2;
88 if (win.ws_col > 0) cols = win.ws_col - 1;
89
90
91#endif 103#endif
92 while ((c = getc(file)) != EOF) { 104 while ((c = getc(file)) != EOF) {
93 if ( next_page ) { 105 if ( next_page ) {
94 int len=0; 106 int len=0;
95 next_page = 0; 107 next_page = 0;
96 lines=0; 108 lines=0;
97 len = fprintf(stdout, "--More-- (%d%% of %ld bytes)%s", 109 len = fprintf(stdout, "--More-- ");
110 if (file != stdin) {
111 len += fprintf(stdout, "(%d%% of %ld bytes)",
98 (int) (100*( (double) ftell(file) / (double) st.st_size )), 112 (int) (100*( (double) ftell(file) / (double) st.st_size )),
99 st.st_size, 113 st.st_size);
114 }
115 len += fprintf(stdout, "%s",
100#ifdef BB_MORE_TERM 116#ifdef BB_MORE_TERM
101 "" 117 ""
102#else 118#else
@@ -105,13 +121,13 @@ extern int more_main(int argc, char **argv)
105 ); 121 );
106 122
107 fflush(stdout); 123 fflush(stdout);
108 input = getc( stdin); 124 input = getc( cin);
109 125
110#ifdef BB_MORE_TERM 126#ifdef BB_MORE_TERM
111 /* Erase the "More" message */ 127 /* Erase the "More" message */
112 while(len-- > 0) 128 while(len-- > 0)
113 putc('\b', stdout); 129 putc('\b', stdout);
114 while(len++ < cols) 130 while(len++ < 79)
115 putc(' ', stdout); 131 putc(' ', stdout);
116 while(len-- > 0) 132 while(len-- > 0)
117 putc('\b', stdout); 133 putc('\b', stdout);
@@ -123,7 +139,7 @@ extern int more_main(int argc, char **argv)
123 goto end; 139 goto end;
124 if (input==' ' && c == '\n' ) 140 if (input==' ' && c == '\n' )
125 next_page = 1; 141 next_page = 1;
126 if ( c == '\n' && ++lines == (rows + 1) ) 142 if ( c == '\n' && ++lines == 24 )
127 next_page = 1; 143 next_page = 1;
128 putc(c, stdout); 144 putc(c, stdout);
129 } 145 }
diff --git a/zcat.c b/zcat.c
index d5ea40c5d..55aaa8738 100644
--- a/zcat.c
+++ b/zcat.c
@@ -59,7 +59,7 @@ static char *license_msg[] = {
59 */ 59 */
60 60
61#ifdef RCSID 61#ifdef RCSID
62static char rcsid[] = "$Id: zcat.c,v 1.3 1999/10/19 20:03:34 andersen Exp $"; 62static char rcsid[] = "$Id: zcat.c,v 1.4 1999/10/19 22:26:25 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.3 1999/10/19 20:03:34 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.3 1999/10/19 20:03:34 andersen Exp $ */ 83/* $Id: zcat.c,v 1.4 1999/10/19 22:26:25 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.3 1999/10/19 20:03:34 andersen Exp $ */ 439/* $Id: zcat.c,v 1.4 1999/10/19 22:26:25 andersen Exp $ */
440 440
441/* #include "getopt.h" */ 441/* #include "getopt.h" */
442 442
@@ -895,7 +895,7 @@ RETSIGTYPE abort_gzip()
895 */ 895 */
896 896
897#ifdef RCSID 897#ifdef RCSID
898static char rcsid[] = "$Id: zcat.c,v 1.3 1999/10/19 20:03:34 andersen Exp $"; 898static char rcsid[] = "$Id: zcat.c,v 1.4 1999/10/19 22:26:25 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
1024static char rcsid[] = "$Id: zcat.c,v 1.3 1999/10/19 20:03:34 andersen Exp $"; 1024static char rcsid[] = "$Id: zcat.c,v 1.4 1999/10/19 22:26:25 andersen Exp $";
1025#endif 1025#endif
1026 1026
1027#include <ctype.h> 1027#include <ctype.h>
@@ -1041,7 +1041,7 @@ static char rcsid[] = "$Id: zcat.c,v 1.3 1999/10/19 20:03:34 andersen Exp $";
1041 extern int errno; 1041 extern int errno;
1042#endif 1042#endif
1043 1043
1044extern ulg crc_32_tab[]; /* crc table, defined below */ 1044const ulg crc_32_tab[]; /* crc table, defined below */
1045 1045
1046/* =========================================================================== 1046/* ===========================================================================
1047 * Run a set of bytes through the crc shift register. If s is a NULL 1047 * Run a set of bytes through the crc shift register. If s is a NULL
@@ -1255,7 +1255,7 @@ voidp xmalloc (size)
1255/* ======================================================================== 1255/* ========================================================================
1256 * Table of CRC-32's of all single-byte values (made by makecrc.c) 1256 * Table of CRC-32's of all single-byte values (made by makecrc.c)
1257 */ 1257 */
1258ulg crc_32_tab[] = { 1258const ulg crc_32_tab[] = {
1259 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 1259 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
1260 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 1260 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
1261 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 1261 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
@@ -1408,7 +1408,7 @@ ulg crc_32_tab[] = {
1408 */ 1408 */
1409 1409
1410#ifdef RCSID 1410#ifdef RCSID
1411static char rcsid[] = "$Id: zcat.c,v 1.3 1999/10/19 20:03:34 andersen Exp $"; 1411static char rcsid[] = "$Id: zcat.c,v 1.4 1999/10/19 22:26:25 andersen Exp $";
1412#endif 1412#endif
1413 1413
1414#include <sys/types.h> 1414#include <sys/types.h>