diff -ubB tailor.h-orig tailor.h --- tailor.h-orig Tue May 16 15:12:41 2000 +++ tailor.h Tue May 16 15:12:42 2000 @@ -150,7 +150,19 @@ # define fcfree(ptr) free(ptr) #endif -#if defined(VAXC) || defined(VMS) +#ifdef VAXC +#ifndef VMS +#define VMS +#endif +#endif + +#ifdef __VMS +#ifndef VMS +#define VMS +#endif +#endif + +#ifdef VMS # define PATH_SEP ']' # define PATH_SEP2 ':' # define SUFFIX_SEP ';' @@ -168,7 +180,19 @@ # ifdef VAXC # define NO_FCNTL_H # include +# endif /* VAXC */ +# ifdef __DECC +# if (__VMS_VER >= 70000000) +# define DIRENT # endif +# define HAVE_UNISTD_H +# define RETSIGTYPE void + void vms_expand_args(int *, char **[]); +# define VMS_NEEDS_PROTO +/* # define NO_FCNTL_H */ +# define NO_SYMLINK +# include +# endif /* __DECC */ #endif #ifdef AMIGA diff -ubB vms/descrip.mms-orig vms/descrip.mms --- vms/descrip.mms-orig Tue May 16 15:12:43 2000 +++ vms/descrip.mms Tue May 16 15:16:09 2000 @@ -0,0 +1,218 @@ +# Makefile for gzip (GNU zip) -*- Indented-Text -*- +# Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation +# VMS version made by Klaus Reimann , +# revised by Roland B Roberts +# and Karl-Jose Filler +# +# modified by Chuck Lane +# for DECC + + +# After constructing gzip.exe with this Makefile, you should set up +# symbols for gzip.exe. Edit the example below, changing +# "disk:[directory]" as appropriate. +# +# $ gzip == "$disk:[directory]gzip.exe" +# $ gunzip == "$disk:[directory]gunzip.exe" +# $ zcat == "$disk:[directory]zcat.exe" + + +# 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +#### Start of system configuration section. #### + +CC = cc/decc +LINK = link + +.ifdef DEBUG +DCF = /DEBUG/NOOPT +DLF = /DEBUG +.endif + +.ifdef VERBOSE +.ifdef VERBOSE_SHOW +VCF = /LIST/SHOW=($(VERBOSE_SHOW)) +.else +VCF = /LIST +.endif +VLF = /MAP +.else +VCF = /NOLIST +VLF = /NOMAP +.endif + +.ifdef __AXP__ +ARCH = _AXP +.ifdef SHARED_BUILD +O = .ABJ +E = .AXE +.endif +.endif + +.ifdef __VAX__ +ARCH = _VAX +.endif + +.ifdef O +.else +O = .obj +E = .exe +.endif + +.suffixes +.suffixes $(E) $(O) .c + + +CFLAGS = $(DCF)$(VCF)/prefix=(all,except=(getopt,optarg,optopt,optind,opterr,basename)) +LFLAGS = $(DLF)$(VLF) + +# Things you might add to DEFS +# -DDIRENT Use for recursion (-r) vms >= 7.0 +# -DSYSDIR Use for recursion (-r) no +# -DSYSNDIR Use for recursion (-r) no +# -DNDIR Use for recursion (-r) no +# -DSTDC_HEADERS Use yes +# -DHAVE_UNISTD_H Use yes +# -DNO_UTIME_H Don't use no utime +# -DHAVE_SYSUTIME_H Use no utime +# -DNO_MEMORY_H Don't use . Not needed if STDC_HEADERS. +# -DNO_STRING_H Use strings.h, not string.h. Not needed if STDC_HEADERS +# -DRETSIGTYPE=int Define this if signal handlers must return an int. +# -DNO_SYMLINK OS defines S_IFLNK but does not support symbolic links +# -DNO_MULTIPLE_DOTS System does not allow file names with multiple dots +# -DNO_UTIME System does not support setting file modification time +# -DNO_CHOWN System does not support setting file owner +# -DNO_DIR System does not support readdir() +# -DPROTO Force function prototypes even if __STDC__ not defined +# -DASMV Use asm version match.S +# -DMSDOS MSDOS specific +# -DOS2 OS/2 specific +# -DVAXC Vax/VMS with Vax C compiler +# -DVMS Vax/VMS with gcc +# -DDEBUG Debug code +# -DDYN_ALLOC Use dynamic allocation of large data structures +# -DMAXSEG_64K Maximum array size is 64K (for 16 bit system) +# -DRECORD_IO read() and write() are rounded to record sizes. +# -DNO_STDIN_FSTAT fstat() is not available on stdin +# -DNO_SIZE_CHECK stat() does not give a reliable file size + +# DEFS = /define=(VAXC) +# define RCSID /* needed for crypt.c */ +DEFS = VMS,RCSID +LIBS = + +# additional assembly sources for particular systems be required. +OBJA = + +LIB = GZIPLIB$(ARCH) +LIBFILE = $(LIB).OLB +LIBFILE_E = $(LIB).EXISTS + +all : $(LIB) gzip$(E) + @ continue + +#### End of system configuration section. #### + + +OBJS = gzip$(O) zip$(O) deflate$(O) trees$(O) bits$(O) unzip$(O) inflate$(O) \ + util$(O) crypt$(O) lzw$(O) unlzw$(O) unpack$(O) unlzh$(O) getopt$(O) \ + vms$(O) $(OBJA) + +# --- rules --- + +.c$(o) : + $(CC)/DEFINE=($(DEFS))$(CFLAGS)/OBJ=$(MMS$TARGET) $(MMS$SOURCE) + + +$(O).olb : + library $(MMS$TARGET) $(MMS$SOURCE) + +gzip$(E) : GZIP$(O) $(LIB) + link$(LFLAGS)/exe=$(MMS$TARGET) $(MMS$SOURCE),$(LIB)/lib + +clean : + if f$search("gzip$(E)") .nes. "" then delete gzip$(E);* + if f$search("*$(O)") .nes. "" then delete *$(O);* + if f$search("*.lis") .nes. "" then delete *.lis;* + if f$search("*.map") .nes. "" then delete *.map;* + + +$(LIBFILE_E) : + + +$(LIBFILE) : + if f$search("$(MMS$TARGET)") .eqs. "" then lib/create $(MMS$TARGET) + + +$(LIB) : $(LIBFILE) + +$(LIB)(zip) : zip$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(deflate) : deflate$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(trees) : trees$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(bits) : bits$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(unzip) : unzip$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(inflate) : inflate$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(util) : util$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(lzw) : lzw$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(unlzw) : unlzw$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(unpack) : unpack$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(unlzh) : unlzh$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(crypt) : crypt$(O) + library $(MMS$TARGET) $(MMS$SOURCE) + +$(LIB)(getopt) : getopt$(O) + library $(MMS$TARGET) $(MMS$SOURCE) +$(LIB)(vms) : vms$(O) + library $(MMS$TARGET) $(MMS$SOURCE) + + + +$(LIB) : $(LIBFILE) $(LIB)(zip) $(LIB)(deflate) $(LIB)(trees) \ + $(LIB)(bits) $(LIB)(unzip) $(LIB)(inflate) $(LIB)(util) \ + $(LIB)(lzw) $(LIB)(unlzw) $(LIB)(unpack) $(LIB)(unlzh) \ + $(LIB)(crypt) $(LIB)(getopt) $(LIB)(vms) + @ continue + + + + + +# Actual build-related targets + +gzip.obj zip.obj deflate.obj trees.obj bits.obj unzip.obj inflate.obj : gzip.h tailor.h +util.obj lzw.obj unlzw.obj unpack.obj unlzh.obj crypt.obj : gzip.h tailor.h + +gzip.obj unlzw.obj : revision.h lzw.h + +bits.obj unzip.obj util.obj zip.obj : crypt.h + +gzip.obj getopt.obj : getopt.h + +getopt.obj vms.obj : tailor.h + +vms.obj : vms.c +vms.c : [.vms]vms.c + copy [.vms]vms.c vms.c diff -ubB vms/vms.c-orig vms/vms.c --- vms/vms.c-orig Tue May 16 15:12:42 2000 +++ vms/vms.c Tue May 16 15:12:42 2000 @@ -7,6 +7,11 @@ */ #include +#include +#include +#include +#include +#include "tailor.h" static char **vms_argv = NULL; @@ -17,6 +22,11 @@ char *addr; }; +#ifdef VMS_NEEDS_PROTO +void *xmalloc (unsigned size); +int find_file_c(char *, char *, int, int *); +void +#endif vms_expand_args(old_argc, argv) int *old_argc; char **argv[]; @@ -35,6 +45,30 @@ if (new_argc < max_files) { vms_argv[new_argc++] = argv[0][i]; } + } else if (*argv[0][i] == '>') { /* output redirection */ + if (argv[0][i][1]) { + if (!freopen(argv[0][i]+1,"w",stdout)) { + perror("stdout redirection"); + exit(SS$_ABORT); + } + } else if (i+1 < *old_argc && argv[0][i+1] && *argv[0][i+1]) { + if (!freopen(argv[0][++i],"w",stdout)) { + perror("stdout redirection"); + exit(SS$_ABORT); + } + } + } else if (*argv[0][i] == '<') { /* input redirection */ + if (argv[0][i][1]) { + if (!freopen(argv[0][i]+1,"r",stdin)) { + perror("stdin redirection"); + exit(SS$_ABORT); + } + } else if (i+1 < *old_argc && argv[0][i+1] && *argv[0][i+1]) { + if (!freopen(argv[0][++i],"r",stdin)) { + perror("stdin redirection"); + exit(SS$_ABORT); + } + } } else { /* Files */ context = 0; if (find_file_c(argv[0][i], buf, sizeof(buf), &context) & 1 != 1) {