home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 9 Archive
/
09-Archive.zip
/
FREEZE-2.ZIP
/
patches.os2
< prev
next >
Wrap
Text File
|
1992-07-18
|
13KB
|
493 lines
diff -c orig/encode.c new/encode.c
*** orig/encode.c Tue Jun 02 11:35:58 1992
--- new/encode.c Tue Jun 02 13:35:44 1992
***************
*** 175,181 ****
fprintf( stderr, "\tSymbols: %ld; references: %ld.\n",
symbols_out, refers_out);
#else /* !DEBUG */
! fprintf( stderr, "Freezing: " );
prratio( stderr, in_count-bytes_out, in_count );
prbits( stderr, in_count, bytes_out);
#endif /* DEBUG */
--- 175,181 ----
fprintf( stderr, "\tSymbols: %ld; references: %ld.\n",
symbols_out, refers_out);
#else /* !DEBUG */
! fprintf( stderr, " Freezing: " );
prratio( stderr, in_count-bytes_out, in_count );
prbits( stderr, in_count, bytes_out);
#endif /* DEBUG */
diff -c orig/freeze.c new/freeze.c
*** orig/freeze.c Tue Jun 02 11:36:14 1992
--- new/freeze.c Tue Jun 02 13:44:08 1992
***************
*** 45,63 ****
#ifdef DEBUG
# ifdef DOS
! fprintf(stderr,"Usage: freeze [-cdDfitvVg] [file | +type ...]\n");
# else
! fprintf(stderr,"Usage: freeze [-cdDfvVg] [file | +type ...]\n");
# endif /* DOS */
#else
# ifdef DOS
! fprintf(stderr,"Usage: freeze [-cdfitvVg] [file | +type ...]\n");
# else
! fprintf(stderr,"Usage: freeze [-cdfvVg] [file | +type ...]\n");
# endif /* DOS */
#endif /* DEBUG */
}
--- 45,76 ----
#ifdef DEBUG
# ifdef DOS
! fprintf(stderr,"\nUsage: freeze [-cdDfitvVg] [file | +type ...]\n");
# else
! fprintf(stderr,"\nUsage: freeze [-cdDfvVg] [file | +type ...]\n");
# endif /* DOS */
#else
# ifdef DOS
! fprintf(stderr,"\nUsage: freeze [-cdfitvVg] [file | +type ...]\n");
# else
! fprintf(stderr,"\nUsage: freeze [-cdfvVg] [file | +type ...]\n");
# endif /* DOS */
+ fprintf(stderr, "\n\
+ -c Write output on stdout, don't remove original.\n\
+ -d If given, melting is done instead.\n\
+ -g Use \"greedy\" parsing (1.5% worse, 40% faster).\n\
+ -f Forces output file to be generated, even if one already\n\
+ exists, and even if no space is saved by freezeing.\n\
+ -i Image mode.\n\
+ -t Text mode.\n\
+ -v Write freezing statistics. -vv means \"draw progress\n\
+ indicator\".\n\
+ -V Write version and compilation options.\n\
+ ");
+
#endif /* DEBUG */
}
***************
*** 99,104 ****
--- 112,120 ----
long indc_count, indc_threshold;
long file_length = 0; /* initial length of file */
+ char IOoutbuf[32768];
+ char IOinbuf[32768];
+
SIGTYPE (*bgnd_flag)();
void writeerr(), copystat(), version(), tune_table();
***************
*** 158,164 ****
/* From compress.c. Replace .Z --> .F etc */
void main( argc, argv )
! register int argc; char **argv;
{
short overwrite = 0; /* Do not overwrite unless given -f flag */
char tempname[100];
--- 174,180 ----
/* From compress.c. Replace .Z --> .F etc */
void main( argc, argv )
! int argc; char **argv;
{
short overwrite = 0; /* Do not overwrite unless given -f flag */
char tempname[100];
***************
*** 183,188 ****
--- 199,208 ----
extern SIGTYPE oops();
#endif
+ #ifdef __EMX__
+ _wildcard(&argc, &argv);
+ #endif
+
#ifndef DOS
if ( (bgnd_flag = signal ( SIGINT, SIG_IGN )) != SIG_IGN )
#endif
***************
*** 217,222 ****
--- 237,247 ----
#endif
}
+ if (argc == 1 && isatty(0)) {
+ Usage();
+ exit(0);
+ }
+
#ifdef DOS
/* use case-insensitive match: parent may not be command.com */
#ifdef MSDOS
***************
*** 249,263 ****
#ifndef DOS
(void) defopen(deffile);
#else
cp = strrchr(cp, '.');
*++cp = 'C';
*++cp = 'N';
*++cp = 'F';
*++cp = '\0';
-
- #ifdef TOS
(void) defopen(argv0);
#else
(void) defopen(argv[0]);
#endif /* TOS */
#endif /* DOS */
--- 274,291 ----
#ifndef DOS
(void) defopen(deffile);
#else
+ #ifdef TOS
cp = strrchr(cp, '.');
*++cp = 'C';
*++cp = 'N';
*++cp = 'F';
*++cp = '\0';
(void) defopen(argv0);
#else
+ char config[MAXNAMLEN];
+ _searchenv("freeze.cnf", "INIT", config);
+ if (config[0] == 0)
+ _searchenv("freeze.cnf", "PATH", config);
(void) defopen(argv[0]);
#endif /* TOS */
#endif /* DOS */
***************
*** 367,377 ****
--- 395,415 ----
/* pseudo-extension: FOOBAR. */
(void) strcat(tempname, "F");
else {
+ #ifdef OS2
+ (void) strcat(tempname, ".F");
+ if (!IsFileNameValid(tempname)) {
+ tail[0] = cp[1];
+ tail[1] = cp[2];
+ *(++cp) = '\0';
+ (void) strcat(tempname, "XF");
+ }
+ #else
/* cp now points to file extension */
tail[0] = cp[1]; /* save two chars */
tail[1] = cp[2];
*(++cp) = '\0';
(void) strcat(tempname, "XF");
+ #endif
}
*fileptr = tempname;
}
***************
*** 399,404 ****
--- 437,444 ----
perror(*fileptr); continue;
}
+ setvbuf(stdin, IOinbuf, _IOFBF, sizeof(IOinbuf));
+
/* Check the magic number */
if (getchar() != MAGIC1)
goto reject;
***************
*** 456,464 ****
--- 496,507 ----
perror(*fileptr); continue;
}
+ setvbuf(stdin, IOinbuf, _IOFBF, sizeof(IOinbuf));
+
/* Generate output filename */
(void) strcpy(ofname, *fileptr);
#ifndef BSD /* Short filenames */
+ #ifndef OS2
if ((cp = last_sep(ofname)) != NULL) cp++;
else cp = ofname;
# ifdef DOS
***************
*** 472,478 ****
continue;
}
# endif /* DOS */
! #endif /* BSD Long filenames allowed */
#ifdef DOS
/* There is no difference between FOOBAR and FOOBAR. names */
--- 515,522 ----
continue;
}
# endif /* DOS */
! #endif /* OS2 */
! #endif /* BSD Long filenames allowed */
#ifdef DOS
/* There is no difference between FOOBAR and FOOBAR. names */
***************
*** 482,489 ****
--- 526,541 ----
/* FOOBAR. case */
(void) strcat(ofname, "F");
else {
+ #ifdef OS2
+ (void) strcat(ofname, ".F");
+ if (!IsFileNameValid(ofname)) {
+ cp[2] = '\0';
+ (void) strcat(ofname, "XF");
+ }
+ #else
cp[2] = '\0';
(void) strcat(ofname, "XF");
+ #endif
}
#else
(void) strcat(ofname, ".F");
***************
*** 549,554 ****
--- 601,608 ----
setmode(fileno(stdout), O_BINARY);
#endif
}
+ setvbuf(stdout, IOoutbuf, _IOFBF, sizeof(IOoutbuf));
+
/* Actually do the freezing/melting */
if (do_melt == 0)
freeze();
***************
*** 709,714 ****
--- 763,769 ----
if (_osmajor < 3) freopen("CON","at",stdout); else /* MS-DOS 2.xx bug */
#endif
+ (void) fclose(stdin);
(void) fclose(stdout);
if (exit_stat == 2 && (!force)) { /* No freezing: remove file.F */
Only in new: freeze.exe
diff -c orig/freeze.h new/freeze.h
*** orig/freeze.h Tue Jun 02 11:36:14 1992
--- new/freeze.h Tue Jun 02 13:14:14 1992
***************
*** 3,13 ****
#ifdef SUN4
#include <sys/stdtypes.h>
#else /* SUN4 */
! # ifndef getc
# define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int) *(p)->_ptr++)
! # endif
! # ifndef putc
# define putc(x, p) (--(p)->_cnt < 0 ? _flsbuf((unsigned char) (x), (p)) : (int) (*(p)->_ptr++ = (unsigned char) (x)))
# endif
#endif /* SUN4 */
--- 3,15 ----
#ifdef SUN4
#include <sys/stdtypes.h>
#else /* SUN4 */
! # ifndef __EMX__
! # ifndef getc
# define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int) *(p)->_ptr++)
! # endif
! # ifndef putc
# define putc(x, p) (--(p)->_cnt < 0 ? _flsbuf((unsigned char) (x), (p)) : (int) (*(p)->_ptr++ = (unsigned char) (x)))
+ # endif
# endif
#endif /* SUN4 */
***************
*** 41,47 ****
#ifdef UTIMES
#include <sys/time.h>
#else
! #include <utime.h> /* Some systems have sys/utime.h instead of this */
#endif /* UTIMES */
#else
#ifdef M_XENIX
--- 43,49 ----
#ifdef UTIMES
#include <sys/time.h>
#else
! #include <sys/utime.h> /* Some systems have sys/utime.h instead of utime.h */
#endif /* UTIMES */
#else
#ifdef M_XENIX
Only in new: isvalid.c
diff -c orig/makefile new/makefile
*** orig/makefile Tue Jun 02 11:36:14 1992
--- new/makefile Tue Jun 02 13:30:08 1992
***************
*** 1,4 ****
! SHELL = /bin/sh
default:
@echo ''
--- 1,5 ----
! # SHELL = /bin/sh
! # MAKEFILE = makefile
default:
@echo ''
***************
*** 18,24 ****
lz.h\
patchlevel.h
! CC = gcc -fstrength-reduce
# or proprietary compiler, if it's better than that
OPTIONS = -DCOMPAT
--- 19,25 ----
lz.h\
patchlevel.h
! CC = gcc
# or proprietary compiler, if it's better than that
OPTIONS = -DCOMPAT
***************
*** 26,33 ****
LINTFLAGS = -DBITS=15 -DSIGTYPE=void -DCOMPAT -DDEBUG\
-DGATHER_STAT -x -DFAST
- MAKEFILE = makefile
-
OBJS = bitio.o\
debug.o\
decode.o\
--- 27,32 ----
***************
*** 60,66 ****
.c.o:
$(CC) -c $(CFLAGS) $(OPTIONS) $<
! prog: $(PROGRAM) statist
man: $(CATMAN)
--- 59,65 ----
.c.o:
$(CC) -c $(CFLAGS) $(OPTIONS) $<
! prog: $(PROGRAM)$(EXE) statist$(EXE)
man: $(CATMAN)
***************
*** 67,77 ****
lint: $(SRCS)
lint $(LINTFLAGS) $(SRCS) > lint.out
! $(PROGRAM): $(OBJS)
! $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
! statist: statist.o lz.o
! $(CC) $(CFLAGS) $(LDFLAGS) -o statist statist.o lz.o $(LIBS)
clobber: clean
rm -f $(PROGRAM) statist *.man
--- 66,76 ----
lint: $(SRCS)
lint $(LINTFLAGS) $(SRCS) > lint.out
! $(PROGRAM)$(EXE): $(OBJS)
! $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)$(EXE)
! statist$(EXE): statist.o lz.o
! $(CC) $(CFLAGS) $(LDFLAGS) -o statist$(EXE) statist.o lz.o $(LIBS)
clobber: clean
rm -f $(PROGRAM) statist *.man
***************
*** 110,136 ****
chmod +r $@
bsd:
! make prog CFLAGS="-O -DBSD -DUTIMES -DBITS=16\
-DFAST -DSIGTYPE=void"
sysv:
! make prog CFLAGS="-O -DBITS=16 -DFAST -DSIGTYPE=void"\
LIBS="-lc_s"
x286:
! make prog CC=cc CFLAGS="-Ox -Mc2 -DBITS=16 -DFAST\
-DSIGTYPE=int"
x286install:
! make install MANDEST=/usr/man/man.C SEC=C
generic:
! make prog CFLAGS="-O -DBITS=16 -DFAST -DSIGTYPE=int"
sun4:
! make prog CC=cc CFLAGS="-O4 -DBSD -DSUN4 -DSIGTYPE=void\
-DUTIMES -DBITS=16 -DFAST"
###
bitio.o: freeze.h compat.h bitio.h
debug.o: freeze.h compat.h huf.h bitio.h
--- 109,140 ----
chmod +r $@
bsd:
! $(MAKE) prog CFLAGS="-O -DBSD -DUTIMES -DBITS=16\
-DFAST -DSIGTYPE=void"
sysv:
! $(MAKE) prog CFLAGS="-O -DBITS=16 -DFAST -DSIGTYPE=void"\
LIBS="-lc_s"
x286:
! $(MAKE) prog CC=cc CFLAGS="-Ox -Mc2 -DBITS=16 -DFAST\
-DSIGTYPE=int"
x286install:
! $(MAKE) install MANDEST=/usr/man/man.C SEC=C
generic:
! $(MAKE) prog CFLAGS="-O -DBITS=16 -DFAST -DSIGTYPE=int"
sun4:
! $(MAKE) prog CC=cc CFLAGS="-O4 -DBSD -DSUN4 -DSIGTYPE=void\
-DUTIMES -DBITS=16 -DFAST"
+ os2:
+ $(MAKE) prog CFLAGS="-O2 -s -DOS2 -DMSDOS -DBITS=16\
+ -DFAST -DSIGTYPE=void" EXE=".exe" OBJS="$(OBJS) isvalid.o"\
+ LIBS="-los2"
+
###
bitio.o: freeze.h compat.h bitio.h
debug.o: freeze.h compat.h huf.h bitio.h
***************
*** 137,143 ****
decode.o: freeze.h compat.h huf.h bitio.h
default.o: freeze.h compat.h
encode.o: freeze.h compat.h lz.h huf.h bitio.h
! freeze.o: freeze.h compat.h lz.h huf.h patchlevel.h
huf.o: freeze.h compat.h huf.h bitio.h
lz.o: freeze.h compat.h lz.h
statist.o: freeze.h compat.h lz.h
--- 141,147 ----
decode.o: freeze.h compat.h huf.h bitio.h
default.o: freeze.h compat.h
encode.o: freeze.h compat.h lz.h huf.h bitio.h
! freeze.o: freeze.h compat.h lz.h huf.h
huf.o: freeze.h compat.h huf.h bitio.h
lz.o: freeze.h compat.h lz.h
statist.o: freeze.h compat.h lz.h
Only in new: patches.os2
Only in new: statist.exe