+-+-+-+ Beginning of part 2 +-+-+-+ Xere */ X EXT char TMPREJNAME[] INIT("/tmp/patchrXXXXXX"); X--- 116,127 ----- X EXT char *origext INIT(Nullch); X EXT char *origprae INIT(Nullch); X X+ #ifdef VMS X+ EXT char TMPOUTNAME[] INIT("sys$scratch:patchoXXXXXX"); V+ EXT char TMPINNAME[] INIT("sys$scratch:patchiXXXXXX"); /* might want /usr/t Xmp here */ X+ EXT char TMPREJNAME[] INIT("sys$scratch:patchrXXXXXX"); X+ EXT char TMPPATNAME[] INIT("sys$scratch:patchpXXXXXX"); X+ #else X EXT char TMPOUTNAME[] INIT("/tmp/patchoXXXXXX"); V EXT char TMPINNAME[] INIT("/tmp/patchiXXXXXX"); /* might want /usr/tmp here X */ X EXT char TMPREJNAME[] INIT("/tmp/patchrXXXXXX"); X************** X*** 115,120 V EXT char TMPINNAME[] INIT("/tmp/patchiXXXXXX");`009/* might want /usr/tmp h Xere */ X EXT char TMPREJNAME[] INIT("/tmp/patchrXXXXXX"); X EXT char TMPPATNAME[] INIT("/tmp/patchpXXXXXX"); X EXT bool toutkeep INIT(FALSE); X EXT bool trejkeep INIT(FALSE); X X--- 126,132 ----- V EXT char TMPINNAME[] INIT("/tmp/patchiXXXXXX"); /* might want /usr/tmp here X */ X EXT char TMPREJNAME[] INIT("/tmp/patchrXXXXXX"); X EXT char TMPPATNAME[] INIT("/tmp/patchpXXXXXX"); X+ #endif X EXT bool toutkeep INIT(FALSE); X EXT bool trejkeep INIT(FALSE); X $ GOSUB UNPACK_FILE $ FILE_IS = "CONFIG.H" $ CHECKSUM_IS = 1326345539 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* config.h (HAND TUNED FOR VMS -- without EUNICE) X * This file was produced by running the config.h.SH script, which X * gets its values from config.sh, which is generally produced by X * running Configure. X * X * Feel free to modify any of this as the need arises. Note, however, X * that running config.h.SH again will wipe out any changes you've made. X * For a more permanent change edit config.sh and rerun config.h.SH. X */ X X X/* EUNICE: X * This symbol, if defined, indicates that the program is being compiled X * under the EUNICE package under VMS. The program will need to handle X * things like files that don't go away the first time you unlink them, X * due to version numbering. It will also need to compensate for lack X * of a respectable link() command. X */ X/* VMS: X * This symbol, if defined, indicates that the program is running under X * VMS. It is currently only set in conjunction with the EUNICE symbol. X */ X#/*undef EUNICE /**/ X#/*undef VMS /**/ X X/* CPPSTDIN: X * This symbol contains the first part of the string which will invoke X * the C preprocessor on the standard input and produce to standard X * output. Typical value of "cc -E" or "/lib/cpp". X */ X/* CPPMINUS: X * This symbol contains the second part of the string which will invoke X * the C preprocessor on the standard input and produce to standard V * output. This symbol will have the value "-" if CPPSTDIN needs a minu Xs X * to specify standard input, otherwise the value is "". X */ V#define CPPSTDIN "" /* There is a VMS preprocessor, but we normally don't X */ X#define CPPMINUS "" /* call it directly. */ X X/* CHARSPRINTF: X * This symbol is defined if this system declares "char *sprintf()" in X * stdio.h. The trend seems to be to declare it as "int sprintf()". It X * is up to the package author to declare sprintf correctly based on the X * symbol. X */ X/*#define CHARSPRINTF*/ /*VMS is int sprintf (at this time)*/ X X/* FLEXFILENAMES: X * This symbol, if defined, indicates that the system supports filenames X * longer than 14 characters. X */ X#define FLEXFILENAMES /**/ X X/* index: X * This preprocessor symbol is defined, along with rindex, if the system X * uses the strchr and strrchr routines instead. X */ X/* rindex: X * This preprocessor symbol is defined, along with index, if the system X * uses the strchr and strrchr routines instead. X */ X#define index strchr /* VMS uses strchr and strrchr */ X#define rindex strrchr /* (where did index come from anyway?) */ X X/* VOIDSIG: V * This symbol is defined if this system declares "void (*signal())()" i Xn X * signal.h. The old way was to declare it as "int (*signal())()". It X * is up to the package author to declare things correctly based on the X * symbol. X */ X#/*undef VOIDSIG */ /*VMS uses int (*signal())()*/ X X/* Reg1: V * This symbol, along with Reg2, Reg3, etc. is either the word "register X" X * or null, depending on whether the C compiler pays attention to this X * many register declarations. The intent is that you don't have to X * order your register declarations in the order of importance, so you X * can freely declare register variables in sub-blocks of code and as X * function parameters. Do not use Reg more than once per routine. X */ X X#define Reg1 register /**/ X#define Reg2 register /**/ X#define Reg3 register /**/ X#define Reg4 register /**/ X#define Reg5 register /**/ X#define Reg6 register /**/ X#define Reg7 /**/ X#define Reg8 /**/ X#define Reg9 /**/ X#define Reg10 /**/ X#define Reg11 /**/ X#define Reg12 /**/ X#define Reg13 /**/ X#define Reg14 /**/ X#define Reg15 /**/ X#define Reg16 /**/ X X/* VOIDFLAGS: V * This symbol indicates how much support of the void type is given by t Xhis X * compiler. What various bits mean: X * X * 1 = supports declaration of void X * 2 = supports arrays of pointers to functions returning void X * 4 = supports comparisons between pointers to void functions and X * addresses of void functions X * V * The package designer should define VOIDUSED to indicate the requireme Xnts X * of the package. This can be done either by #defining VOIDUSED before X * including config.h, or by defining defvoidused in Myinit.U. If the X * level of void support necessary is not present, defines void to int. X */ X#ifndef VOIDUSED X#define VOIDUSED 7 X#endif X#define VOIDFLAGS 7 X#if (VOIDFLAGS & VOIDUSED) != VOIDUSED X#define void int /* is void to be avoided? */ X#define M_VOID /* Xenix strikes again */ X#endif X#ifndef unlink X#define unlink delete /* VMS doesn't have link/unlink. closest is delete*/ X#endif $ GOSUB UNPACK_FILE $ FILE_IS = "CONFIG.H_UNIX" $ CHECKSUM_IS = 402730149 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* config.h X * This file was produced by running the Configure script. X * Feel free to modify any of this as the need arises. X */ X X X#/*undef`009EUNICE`009`009/* no file linking? */ X#/*undef`009VMS X X#/*undef`009index strchr`009/* cultural */ X#/*undef`009rindex strrchr`009/* differences? */ X X#/*undef`009void int`009/* is void to be avoided? */ X X/* How many register declarations are paid attention to? */ X X#define Reg1 register X#define Reg2 register X#define Reg3 register X#define Reg4 register X#define Reg5 register X#define Reg6 register X#define Reg7 X#define Reg8 X#define Reg9 X#define Reg10 X#define Reg11 X#define Reg12 X#define Reg13 X#define Reg14 X#define Reg15 X#define Reg16 X $ GOSUB UNPACK_FILE $ FILE_IS = "CONFIG.VMS_H" $ CHECKSUM_IS = 1326345539 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* config.h (HAND TUNED FOR VMS -- without EUNICE) X * This file was produced by running the config.h.SH script, which X * gets its values from config.sh, which is generally produced by X * running Configure. X * X * Feel free to modify any of this as the need arises. Note, however, X * that running config.h.SH again will wipe out any changes you've made. X * For a more permanent change edit config.sh and rerun config.h.SH. X */ X X X/* EUNICE: X * This symbol, if defined, indicates that the program is being compiled X * under the EUNICE package under VMS. The program will need to handle X * things like files that don't go away the first time you unlink them, X * due to version numbering. It will also need to compensate for lack X * of a respectable link() command. X */ X/* VMS: X * This symbol, if defined, indicates that the program is running under X * VMS. It is currently only set in conjunction with the EUNICE symbol. X */ X#/*undef EUNICE /**/ X#/*undef VMS /**/ X X/* CPPSTDIN: X * This symbol contains the first part of the string which will invoke X * the C preprocessor on the standard input and produce to standard X * output. Typical value of "cc -E" or "/lib/cpp". X */ X/* CPPMINUS: X * This symbol contains the second part of the string which will invoke X * the C preprocessor on the standard input and produce to standard V * output. This symbol will have the value "-" if CPPSTDIN needs a minu Xs X * to specify standard input, otherwise the value is "". X */ V#define CPPSTDIN "" /* There is a VMS preprocessor, but we normally don't X */ X#define CPPMINUS "" /* call it directly. */ X X/* CHARSPRINTF: X * This symbol is defined if this system declares "char *sprintf()" in X * stdio.h. The trend seems to be to declare it as "int sprintf()". It X * is up to the package author to declare sprintf correctly based on the X * symbol. X */ X/*#define CHARSPRINTF*/ /*VMS is int sprintf (at this time)*/ X X/* FLEXFILENAMES: X * This symbol, if defined, indicates that the system supports filenames X * longer than 14 characters. X */ X#define FLEXFILENAMES /**/ X X/* index: X * This preprocessor symbol is defined, along with rindex, if the system X * uses the strchr and strrchr routines instead. X */ X/* rindex: X * This preprocessor symbol is defined, along with index, if the system X * uses the strchr and strrchr routines instead. X */ X#define index strchr /* VMS uses strchr and strrchr */ X#define rindex strrchr /* (where did index come from anyway?) */ X X/* VOIDSIG: V * This symbol is defined if this system declares "void (*signal())()" i Xn X * signal.h. The old way was to declare it as "int (*signal())()". It X * is up to the package author to declare things correctly based on the X * symbol. X */ X#/*undef VOIDSIG */ /*VMS uses int (*signal())()*/ X X/* Reg1: V * This symbol, along with Reg2, Reg3, etc. is either the word "register X" X * or null, depending on whether the C compiler pays attention to this X * many register declarations. The intent is that you don't have to X * order your register declarations in the order of importance, so you X * can freely declare register variables in sub-blocks of code and as X * function parameters. Do not use Reg more than once per routine. X */ X X#define Reg1 register /**/ X#define Reg2 register /**/ X#define Reg3 register /**/ X#define Reg4 register /**/ X#define Reg5 register /**/ X#define Reg6 register /**/ X#define Reg7 /**/ X#define Reg8 /**/ X#define Reg9 /**/ X#define Reg10 /**/ X#define Reg11 /**/ X#define Reg12 /**/ X#define Reg13 /**/ X#define Reg14 /**/ X#define Reg15 /**/ X#define Reg16 /**/ X X/* VOIDFLAGS: V * This symbol indicates how much support of the void type is given by t Xhis X * compiler. What various bits mean: X * X * 1 = supports declaration of void X * 2 = supports arrays of pointers to functions returning void X * 4 = supports comparisons between pointers to void functions and X * addresses of void functions X * V * The package designer should define VOIDUSED to indicate the requireme Xnts X * of the package. This can be done either by #defining VOIDUSED before X * including config.h, or by defining defvoidused in Myinit.U. If the X * level of void support necessary is not present, defines void to int. X */ X#ifndef VOIDUSED X#define VOIDUSED 7 X#endif X#define VOIDFLAGS 7 X#if (VOIDFLAGS & VOIDUSED) != VOIDUSED X#define void int /* is void to be avoided? */ X#define M_VOID /* Xenix strikes again */ X#endif X#ifndef unlink X#define unlink delete /* VMS doesn't have link/unlink. closest is delete*/ X#endif $ GOSUB UNPACK_FILE $ FILE_IS = "EXTERN.H" $ CHECKSUM_IS = 591885565 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* $Header: EXTERN.h,v 2.0 86/09/17 15:35:37 lwall Exp $ X * X * $Log:`009EXTERN.h,v $ X * Revision 2.0 86/09/17 15:35:37 lwall X * Baseline for netwide release. X * X */ X X#ifdef EXT X#undef EXT X#endif X#define EXT extern X X#ifdef INIT X#undef INIT X#endif X#define INIT(x) X X#ifdef DOINIT X#undef DOINIT X#endif $ GOSUB UNPACK_FILE $ FILE_IS = "INP.C" $ CHECKSUM_IS = 1242443730 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* $Header: inp.c,v 2.0.1.1 88/06/03 15:06:13 lwall Locked $ X * X * $Log:`009inp.c,v $ X * Revision 2.0.1.1 88/06/03 15:06:13 lwall X * patch10: made a little smarter about sccs files X * X * Revision 2.0 86/09/17 15:37:02 lwall X * Baseline for netwide release. X * X */ X X#include "EXTERN.h" X#include "common.h" X#include "util.h" X#include "pch.h" X#include "INTERN.h" X#include "inp.h" X X/* Input-file-with-indexable-lines abstract type */ X Xstatic long i_size;`009`009`009/* size of the input file */ Xstatic char *i_womp;`009`009`009/* plan a buffer for entire file */ Xstatic char **i_ptr;`009`009`009/* pointers to lines in i_womp */ X Xstatic int tifd = -1;`009`009`009/* plan b virtual string array */ Xstatic char *tibuf[2];`009`009`009/* plan b buffers */ Xstatic LINENUM tiline[2] = `123-1, -1`125;`009/* 1st line in each buffer */ Xstatic LINENUM lines_per_buf;`009`009/* how many lines per buffer */ Xstatic int tireclen;`009`009`009/* length of records in tmp file */ X X/* New patch--prepare to edit another file. */ X Xvoid Xre_input() X`123 X if (using_plan_a) `123 X`009i_size = 0; X#ifndef lint X`009if (i_ptr != Null(char**)) X`009 free((char *)i_ptr); X#endif X`009if (i_womp != Nullch) X`009 free(i_womp); X`009i_womp = Nullch; X`009i_ptr = Null(char **); X `125 X else `123 X`009using_plan_a = TRUE;`009`009/* maybe the next one is smaller */ X`009Close(tifd); X`009tifd = -1; X`009free(tibuf[0]); X`009free(tibuf[1]); X`009tibuf[0] = tibuf[1] = Nullch; X`009tiline[0] = tiline[1] = -1; X`009tireclen = 0; X `125 X`125 X X/* Constuct the line index, somehow or other. */ X Xvoid Xscan_input(filename) Xchar *filename; X`123 X if (!plan_a(filename)) X`009plan_b(filename); X if (verbose) `123 X`009say3("Patching file %s using Plan %s...\n", filename, X`009 (using_plan_a ? "A" : "B") ); X `125 X`125 X X/* Try keeping everything in memory. */ X Xbool Xplan_a(filename) Xchar *filename; X`123 X int ifd; X Reg1 char *s; X Reg2 LINENUM iline; X -+-+-+-+-+ End of part 2 +-+-+-+-+-