housel@en.ecn.purdue.edu (Peter S. Housel) (12/13/88)
Several people asked me to post my changes to NR to allow it to run under Minix. Allen Holub has kindly granted me permission to do so. Also included are my version of the "-man" macros for NR, and my version of the "man" command. For information purposes only: NR is available on disk from M&T Books, 501 Galveston Drive, Redwood City, CA, 94063. -Peter S. Housel- housel@en.ecn.purdue.edu ...!pur-ee!housel ------------------------ #!/bin/sh echo 'x - CRC-LIST' sed 's/^X//' <<'**-CRC-LIST-EOF-**' >CRC-LIST X27111 2375 Makefile X33174 1714 Makefile.tools X25485 392 bitmap.c.cdif X04419 475 bitmap.h.cdif X36609 1155 date.c.cdif X63497 12 debug.h X53318 732 ferr.c.cdif X24543 680 getargs.c.cdif X34407 746 getargs.h.cdif X59767 150 getch.c X39315 1411 hash.c.cdif X15108 749 hash.h.cdif X00922 312 inserts.c.cdif X05666 590 itoascii.c.cdi X63497 12 malloc.h X05137 690 man.sh X38595 326 misc.c X09136 1515 nr.c.cdif X23040 2065 nr.h.cdif X10278 779 nrcmd.c.cdif X14970 1694 nrglbls.c.cdif X50548 4346 nrinp.c.cdif X63216 5797 nrmac.c.cdif X51889 913 nrmap.c.cdif X49659 524 nrmap.h.cdif X10503 824 nrmsc.c.cdif X15454 2442 nrout.c.cdif X43596 1221 nrp.h X03824 1413 nrprocs.c.cdif X49636 1255 nrtext.c.cdif X27216 1828 parse.c.cdif X05126 638 queue.c.cdif X37079 309 skipspac.c.cdi X01093 255 stdarg.h X08152 432 stoi.c.cdif X03631 321 strsave.c.cdif X19711 466 switchar.c.cdi X63919 2325 tmac.an **-CRC-LIST-EOF-** echo 'x - Makefile' sed 's/^X//' <<'**-Makefile-EOF-**' >Makefile X# X# Makefile for NR X# X XCFLAGS= -F -I. X XSRCS = nr.c nrcmd.c nreg.c nrglbls.c nrinp.c nrmac.c \ X nrmap.c nrmsc.c nrout.c nrprocs_1.c nrprocs_2.c \ X nrtab.c nrtext.c XOBJS = nr.s nrcmd.s nreg.s nrglbls.s nrinp.s nrmac.s \ X nrmap.s nrmsc.s nrout.s nrprocs_1.s nrprocs_2.s \ X nrtab.s nrtext.s X XLIBS = tools/libtools.a X Xall: nr X Xnr: $(OBJS) X ./asld -T/usr/tmp -o nr -i /usr/lib/crtso.s $(OBJS) $(LIBS) /usr/lib/libc.a /usr/lib/end.s X Xdepend: X mkdep $(CFLAGS) $(SRCS) X Xclean: X rm -f nr $(OBJS) ERRS core X X# DO NOT DELETE THIS LINE -- mkdep uses it. X# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. X Xnr.s: /usr/include/fcntl.h Xnr.s: /usr/include/signal.h Xnr.s: /usr/include/stdio.h Xnr.s: ascii.h Xnr.s: date.h Xnr.s: nr.c Xnr.s: nr.h Xnr.s: tools/bitmap.h Xnr.s: tools/getargs.h Xnrcmd.s: /usr/include/ctype.h Xnrcmd.s: /usr/include/stdio.h Xnrcmd.s: ascii.h Xnrcmd.s: nr.h Xnrcmd.s: nrcmd.c Xnreg.s: /usr/include/stdio.h Xnreg.s: ascii.h Xnreg.s: nr.h Xnreg.s: nreg.c Xnreg.s: tools/hash.h Xnrglbls.s: /usr/include/stdio.h Xnrglbls.s: ascii.h Xnrglbls.s: nr.h Xnrglbls.s: nrglbls.c Xnrinp.s: /usr/include/ctype.h Xnrinp.s: /usr/include/stdio.h Xnrinp.s: ascii.h Xnrinp.s: nr.h Xnrinp.s: nrinp.c Xnrmac.s: /usr/include/stdio.h Xnrmac.s: ascii.h Xnrmac.s: nr.h Xnrmac.s: nrmac.c Xnrmac.s: tools/hash.h Xnrmap.s: /usr/include/ctype.h Xnrmap.s: /usr/include/stdio.h Xnrmap.s: ascii.h Xnrmap.s: nr.h Xnrmap.s: nrmap.c Xnrmap.s: nrmap.h Xnrmsc.s: /usr/include/ctype.h Xnrmsc.s: /usr/include/stdio.h Xnrmsc.s: ascii.h Xnrmsc.s: nr.h Xnrmsc.s: nrmsc.c Xnrout.s: /usr/include/ctype.h Xnrout.s: /usr/include/stdarg.h Xnrout.s: /usr/include/stdio.h Xnrout.s: ascii.h Xnrout.s: nr.h Xnrout.s: nrmap.h Xnrout.s: nrout.c Xnrout.s: nrtlen.h Xnrprocs_1.s: /usr/include/ctype.h Xnrprocs_1.s: /usr/include/stdio.h Xnrprocs_1.s: /usr/include/sys/types.h Xnrprocs_1.s: /usr/include/time.h Xnrprocs_1.s: ascii.h Xnrprocs_1.s: nr.h Xnrprocs_1.s: nrprocs_1.c Xnrprocs_2.s: /usr/include/ctype.h Xnrprocs_2.s: /usr/include/stdio.h Xnrprocs_2.s: /usr/include/sys/types.h Xnrprocs_2.s: /usr/include/time.h Xnrprocs_2.s: ascii.h Xnrprocs_2.s: nr.h Xnrprocs_2.s: nrp.h Xnrprocs_2.s: nrprocs_2.c Xnrtab.s: /usr/include/stdio.h Xnrtab.s: ascii.h Xnrtab.s: nr.h Xnrtab.s: nrtab.c Xnrtext.s: /usr/include/ctype.h Xnrtext.s: /usr/include/stdio.h Xnrtext.s: ascii.h Xnrtext.s: nr.h Xnrtext.s: nrmap.h Xnrtext.s: nrtext.c Xnrtext.s: nrtlen.h X X# IF YOU PUT ANYTHING HERE IT WILL GO AWAY **-Makefile-EOF-** echo 'x - Makefile.tools' sed 's/^X//' <<'**-Makefile.tools-EOF-**' >Makefile.tools X# X# Makefile for tools library X# X XCFLAGS= -F -LIB -I. -I.. X XSRCS = hash.c getargs.c bitmap.c queue.c date.c stoi.c uatoi.c strsave.c \ X queue.c itoascii.c ferr.c cpy.c inserts.c onferr.c parse.c \ X skipspac.c skipto.c switchar.c getch.c misc.c XOBJS = hash.s getargs.s bitmap.s queue.s date.s stoi.s uatoi.s strsave.s \ X queue.s itoascii.s ferr.s cpy.s inserts.s onferr.s parse.s \ X skipspac.s skipto.s switchar.s getch.s misc.s X Xall: libtools.a X Xlibtools.a: $(OBJS) X ar r libtools.a $(OBJS) X Xdepend: X mkdep $(CFLAGS) $(SRCS) X Xclean: X rm -f $(OBJS) ERRS libtools.a X X# DO NOT DELETE THIS LINE -- mkdep uses it. X# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. X Xhash.s: ../tools/debug.h Xhash.s: ../tools/hash.h Xhash.s: /usr/include/ctype.h Xhash.s: /usr/include/limits.h Xhash.s: /usr/include/stdio.h Xhash.s: hash.c Xhash.s: malloc.h Xgetargs.s: ../tools/getargs.h Xgetargs.s: /usr/include/stdio.h Xgetargs.s: getargs.c Xbitmap.s: ../tools/bitmap.h Xbitmap.s: /usr/include/stdio.h Xbitmap.s: bitmap.c Xqueue.s: queue.c Xdate.s: /usr/include/sys/types.h Xdate.s: /usr/include/time.h Xdate.s: date.c Xstoi.s: /usr/include/ctype.h Xstoi.s: stoi.c Xuatoi.s: uatoi.c Xstrsave.s: strsave.c Xqueue.s: queue.c Xitoascii.s: /usr/include/ctype.h Xitoascii.s: itoascii.c Xferr.s: /usr/include/stdarg.h Xferr.s: /usr/include/stdio.h Xferr.s: ferr.c Xcpy.s: cpy.c Xinserts.s: inserts.c Xonferr.s: onferr.c Xparse.s: /usr/include/ctype.h Xparse.s: /usr/include/stdarg.h Xparse.s: /usr/include/stdio.h Xparse.s: parse.c Xskipspac.s: /usr/include/ctype.h Xskipspac.s: skipspac.c Xskipto.s: skipto.c Xswitchar.s: switchar.c Xgetch.s: getch.c Xmisc.s: /usr/include/stdio.h Xmisc.s: /usr/include/sys/stat.h Xmisc.s: misc.c X X# IF YOU PUT ANYTHING HERE IT WILL GO AWAY **-Makefile.tools-EOF-** echo 'x - README' sed 's/^X//' <<'**-README-EOF-**' >README XThis is the patch kit to adapt NR to Minix. X XNR is an implementation of the NROFF text formatter, written by Allen XHolub and published by M&T Publishing. The program is Copyright 1987, X1988 by Alan Holub. [Disclaimer: I have no relationship to M&T Xpublishing other than as a reader of Dr. Dobb's Journal of Software XTools, and as a purchaser of the NR disk.] X XMr. Holub has graciously granted permission for me to post these patches. X XINSTRUCTIONS X X1) Extract the sources from the NR.ARC file on the distribution disk, and Xcopy them to Minix using dosread. X X2) Apply all of the patches (*.cdif and *.cdi) using patch. I kept Xrunning out of /tmp space ("no space on RAM disk") when patching Xnrprocs.c, and had to mount a floppy disk on /tmp before it would work. X X3) Create a "tools" subdirectory, and move the following files into it: Xbitmap.c getargs.c malloc.h stoi.c Xbitmap.h getargs.h misc.c strsave.c Xcpy.c getch.c onferr.c switchar.c Xdate.c hash.c parse.c uatoi.c Xdate.h hash.h queue.c Xdebug.h inserts.c skipspac.c Xferr.c itoascii.c skipto.c X XThe files "malloc.h", "debug.h", "misc.c", and "getch.c" are from this Xkit, and the rest are part of NR. Also, move "Makefile.tools" from Xthis kit into the "tools" directory and rename it "Makefile". X X4) Replace the "Makefile" in the main directory with the one from this kit. XAlso, make sure "nrp.h" from this kit is in the main directory. X X5) Split "nrprocs.c" into two parts (right between ss() and ta()), using: X split -1600 nrprocs.c X mv xaa nrprocs_1.c X head -22 nrprocs_1.c | cat - xab > nrprocs_2.c X rm xab X XNow, edit nrprocs_2.c and change the line which says: X static Nestlev = 0; /* .{/.} Nesting level */ Xto: X #include "nrp.h" X X6) Copy /bin/asld to the main directory, and run "chmem =49000 asld". XOtherwise asld will run out of space. (This is a tight squeeze.) Also, Xtry "chmem +700 /lib/cem" - this is necessary to compile nrprocs_2.c Xon a PC. Increasing the space much beyond this causes cem to crash. X X7) Install "stdarg.h" in "/usr/include". This is the ANSI C equivalent Xof "varargs.h". X X8) Do a "make" in the "tools" directory. You should have a "libtools.a". X X9) Do a "make" in the main directory. Install "nr" as "/usr/bin/nroff". X X10) Insert a line containing ".cm" at the beginning of, and ".cm on" at Xthe end of "s.mac". This puts NR in "NR copy mode" while it is reading Xthe "-ms" macros, but leaves it in NROFF mode when it is done. This is Xnecessary because I have changed the NR default (see the patch for Xnrglbls.c). X X11) Create the directory "/usr/lib/tmac". Copy "s.mac" to X"/usr/lib/tmac/tmac.s". Copy "tmac.an" (the "-man" macros, from this kit) Xto "/usr/lib/tmac/tmac.an". X X12) If desired, Copy "man.sh" to "/usr/bin/man". Make directories X"/usr/man", "/usr/man/man[1-8]", and "/usr/man/cat[1-8]". X XNOTES X XThe patches were designed strictly with the intent of getting a version Xworking on Minix, with no consideration for keeping things #ifdef'ed. X XThere's probably not any way I can make this easier to do. X XAs noted above, the default copy mode is now nroff-compatible instead Xof NR-compatible. Use a ".cm" command for your strictly-NR files. X XSeveral of the changes (mostly in nrout.c) were bug fixes necessary to get Xfont changes to work, especially for the -man macros. I unfortunately Xdon't remember what I fixed, and some things may still be broken. X XBe forewarned that NR only understands units in terms of n's (horizontal) Xand v's (vertical), and doesn't allow any units to be specified. X XThe "-man" macros are pretty much a minimal set that serve to get Xacceptable-looking manual pages for most things. There are usually a Xlot of error messages when a manual page author has used an Xunimplemented construct or macro. Ignore these and see how it turns Xout. X XHalf of the work implementing tmac.an was spent trying to get hanging Xindentation to work right. It still isn't quite right. X XMany of the remaining bugs are probably Not My Fault. **-README-EOF-** echo 'x - bitmap.c.cdif' sed 's/^X//' <<'**-bitmap.c.cdif-EOF-**' >bitmap.c.cdif X*** ../../nr.orig/tools/bitmap.c Mon Nov 28 18:10:23 1988 X--- bitmap.c Mon Dec 12 16:10:52 1988 X*************** X*** 9,13 **** X */ X X! extern char *calloc ( unsigned, unsigned ); X X /*----------------------------------------------------------------------*/ X--- 9,13 ---- X */ X X! extern char *calloc (); X X /*----------------------------------------------------------------------*/ **-bitmap.c.cdif-EOF-** echo 'x - bitmap.h.cdif' sed 's/^X//' <<'**-bitmap.h.cdif-EOF-**' >bitmap.h.cdif X*** ../../nr.orig/tools/bitmap.h Mon Nov 28 18:10:27 1988 X--- bitmap.h Mon Dec 12 16:10:55 1988 X*************** X*** 4,9 **** X typedef char *BITMAP; X X! extern BITMAP makebitmap ( unsigned ); X! extern int setbit ( unsigned, BITMAP, int ); X! extern void setall ( BITMAP, int ); X! extern int testbit ( unsigned, BITMAP ); X--- 4,9 ---- X typedef char *BITMAP; X X! extern BITMAP makebitmap(); X! extern int setbit(); X! extern void setall(); X! extern int testbit(); **-bitmap.h.cdif-EOF-** echo 'x - date.c.cdif' sed 's/^X//' <<'**-date.c.cdif-EOF-**' >date.c.cdif X*** ../../nr.orig/tools/date.c Mon Nov 28 18:10:33 1988 X--- date.c Mon Dec 12 16:10:58 1988 X*************** X*** 2,10 **** X */ X X! #include <dos.h> X! X! extern int intdos( union REGS*, union REGS* ); X! X! /*----------------------------------------------------------------------*/ X X date( month, day, year, day_of_the_week ) X--- 2,6 ---- X */ X X! #include <time.h> X X date( month, day, year, day_of_the_week ) X*************** X*** 12,29 **** X { X /* Return the month, day, year, and day of the week (0 = sunday, X! * 6 = saturday). This function is totally non-portable, X! * and must be compiled with the lattice C compiler. X! */ X! X! union REGS regs; X! X! regs.h.ah = 0x2a ; X! X! intdos( ®s, ®s ); X! X! *month = regs.h.dh ; X! *day = regs.h.dl ; X! *year = regs.x.cx ; X! *day_of_the_week = regs.h.al ; X } X X--- 8,24 ---- X { X /* Return the month, day, year, and day of the week (0 = sunday, X! * 6 = saturday). X! */ X! X! struct tm *t; X! time_t now; X! X! time(&now); X! t = localtime(&now); X! X! *month = t->tm_mon + 1; X! *day = t->tm_mday; X! *year = t->tm_year + 1900; X! *day_of_the_week = t->tm_wday; X } X **-date.c.cdif-EOF-** echo 'x - debug.h' sed 's/^X//' <<'**-debug.h-EOF-**' >debug.h X/* empty */ **-debug.h-EOF-** echo 'x - ferr.c.cdif' sed 's/^X//' <<'**-ferr.c.cdif-EOF-**' >ferr.c.cdif X*** ../../nr.orig/tools/ferr.c Mon Nov 28 18:10:48 1988 X--- ferr.c Mon Dec 12 16:11:01 1988 X*************** X*** 1,6 **** X #include <stdio.h> X X- #ifdef MSDOS /*-------------- Use the ANSI functions -----------------*/ X- X #include <stdarg.h> X X--- 1,4 ---- X*************** X*** 21,45 **** X } X X- #else /*------------------------- Unix System V ------------------------*/ X- X- #include <varargs.h> X- X- void ferr( va_alist ) X- va_dcl /* No semicolon! */ X- { X- extern int errno; X- va_list args; X- char *fmt; X- X- va_start( args ); X- fmt = va_arg( args, char* ); X- X- if( fmt ) X- _doprnt( fmt, args, stderr ); X- else X- perror( va_arg(args, char* ) ); X- X- exit( on_ferr() ); X- } X- X- #endif X--- 19,20 ---- **-ferr.c.cdif-EOF-** echo 'x - getargs.c.cdif' sed 's/^X//' <<'**-getargs.c.cdif-EOF-**' >getargs.c.cdif X*** ../../nr.orig/tools/getargs.c Mon Nov 28 18:10:52 1988 X--- getargs.c Mon Dec 12 16:31:20 1988 X*************** X*** 25,29 **** X X extern int switchar (); X! extern int stoi ( char** ); X X typedef int (*PFI)(); X--- 25,29 ---- X X extern int switchar (); X! extern int stoi (); X X typedef int (*PFI)(); X*************** X*** 62,71 **** X X case PROC: X! /* this kludge is required by MSC, ver. 5, which X! * won't allow a cast from int pointer to function X! * pointer (the jerks). X! */ X! X! (* (PFI) ((unsigned long)(argp->variable)) )( linep ); X X linep = ""; X--- 62,66 ---- X X case PROC: X! (* (PFI) ((argp->variable)) )( linep ); X X linep = ""; **-getargs.c.cdif-EOF-** echo 'x - getargs.h.cdif' sed 's/^X//' <<'**-getargs.h.cdif-EOF-**' >getargs.h.cdif X*** ../../nr.orig/tools/getargs.h Mon Nov 28 18:10:55 1988 X--- getargs.h Mon Dec 12 16:11:08 1988 X*************** X*** 11,16 **** X typedef struct X { X! unsigned arg : 7 ; /* Command line switch */ X! unsigned type : 4 ; /* variable type */ X int *variable ; /* pointer to variable */ X char *errmsg ; /* pointer to error message */ X--- 11,16 ---- X typedef struct X { X! unsigned char arg ; /* Command line switch */ X! unsigned char type ; /* variable type */ X int *variable ; /* pointer to variable */ X char *errmsg ; /* pointer to error message */ X*************** X*** 18,20 **** X ARG; X X! extern int getargs( int, char**, ARG*, int, int (*)() ); X--- 18,20 ---- X ARG; X X! extern int getargs(); **-getargs.h.cdif-EOF-** echo 'x - getch.c' sed 's/^X//' <<'**-getch.c-EOF-**' >getch.c Xint getch() X{ X char c; X int fd; X X if((fd = open("/dev/tty", 0)) < 0 || 1 != read(fd, &c, 1) || close(fd)) X return -1; X else X return c & 0xFF; X} **-getch.c-EOF-** echo 'x - hash.c.cdif' sed 's/^X//' <<'**-hash.c.cdif-EOF-**' >hash.c.cdif X*** ../../nr.orig/tools/hash.c Mon Nov 28 18:11:02 1988 X--- hash.c Mon Dec 12 16:11:13 1988 X*************** X*** 7,10 **** X--- 7,13 ---- X #include <tools/debug.h> X X+ #define PUBLIC X+ #define PRIVATE static X+ #define CHAR_BIT 8 X X /* HASHTAB.C General-purpose hash table functions. X*************** X*** 61,66 **** X */ X X! PRIVATE unsigned hash ( char*, HASH_TAB*); X! PRIVATE int symcmp ( BUCKET**, BUCKET** ); X X /*----------------------------------------------------------------------*/ X--- 64,69 ---- X */ X X! PRIVATE unsigned hash(); X! PRIVATE int symcmp(); X X /*----------------------------------------------------------------------*/ X*************** X*** 143,147 **** X PUBLIC void use_pjw() { Pjw = 1; } X X! #define HASH(n,t) ( Pjw ? (*hash_pjw) : (*hash_add) )(n,t) X X /*----------------------------------------------------------------------*/ X--- 146,150 ---- X PUBLIC void use_pjw() { Pjw = 1; } X X! #define HASH(n,t) (hash_add(n,t)) X X /*----------------------------------------------------------------------*/ X*************** X*** 245,249 **** X for(; last->next ; last = last->next ) X if( strcmp(last->sname,last->next->sname) == 0 ) X! return (char *)( last->next + 1 ); X return NULL; X } X--- 248,252 ---- X for(; last->next ; last = last->next ) X if( strcmp(last->sname,last->next->sname) == 0 ) X! return (void *)(char *)( last->next + 1 ); X return NULL; X } **-hash.c.cdif-EOF-** echo 'x - hash.h.cdif' sed 's/^X//' <<'**-hash.h.cdif-EOF-**' >hash.h.cdif X*** ../../nr.orig/tools/hash.h Mon Nov 28 18:11:06 1988 X--- hash.h Mon Dec 12 16:11:16 1988 X*************** X*** 26,34 **** X #define symname(p) ( ((BUCKET*)(p) - 1)->sname ) X X! extern void *addsym (HASH_TAB *, char *, int ); X! extern void delsym (HASH_TAB *, BUCKET * ); X! extern void *findsym (HASH_TAB *, char * ); X! extern void *nextsym (BUCKET * ); X! extern HASH_TAB *maketab (unsigned int ); X! extern void ptab (HASH_TAB *, void (*)(), int ); X! extern void use_pjw (void ); X--- 26,34 ---- X #define symname(p) ( ((BUCKET*)(p) - 1)->sname ) X X! extern void *addsym(); X! extern void delsym(); X! extern void *findsym(); X! extern void *nextsym(); X! extern HASH_TAB *maketab(); X! extern void ptab(); X! extern void use_pjw(); **-hash.h.cdif-EOF-** echo 'x - inserts.c.cdif' sed 's/^X//' <<'**-inserts.c.cdif-EOF-**' >inserts.c.cdif X*** ../../nr.orig/tools/inserts.c Mon Nov 28 18:11:09 1988 X--- inserts.c Mon Dec 12 16:11:19 1988 X*************** X*** 1,6 **** X- #ifndef MSC_VER4 /* Microsoft C, version 5 */ X- # define memcpy(d,s,c) memmove(d,s,c) X- #endif X- X int inserts( str, target, maxch ) X register char *str, *target; X--- 1,2 ---- **-inserts.c.cdif-EOF-** echo 'x - itoascii.c.cdi' sed 's/^X//' <<'**-itoascii.c.cdi-EOF-**' >itoascii.c.cdi X*** ../../nr.orig/tools/itoascii.c Mon Nov 28 18:11:15 1988 X--- itoascii.c Mon Dec 12 16:11:23 1988 X*************** X*** 26,33 **** X */ X X! #define SSIZE 16 /* Maximum size of expanded number */ X! X! extern char *cpy (char*, char* ); X! extern void strcpy (char*, char* ); X X /*----------------------------------------------------------------------*/ X--- 26,35 ---- X */ X X! #include <ctype.h> X! X! #define SSIZE 16 /* Maximum size of expanded number */ X! X! extern char *cpy (); X! extern void strcpy (); X X /*----------------------------------------------------------------------*/ **-itoascii.c.cdi-EOF-** echo 'x - malloc.h' sed 's/^X//' <<'**-malloc.h-EOF-**' >malloc.h X/* empty */ **-malloc.h-EOF-** echo 'x - man.sh' sed 's/^X//' <<'**-man.sh-EOF-**' >man.sh X#!/bin/sh X# Author: Peter S. Housel May 1988 Xcd /usr/man Xif test -t 1 ; then X PAGER=${PAGER-/usr/bin/more} Xelse X PAGER=cat Xfi Xs=1 Xfor i ; do X case $i in X[1-9]*) X s=$i;; X-*) X echo "Unknown flag $i";; X*)if /usr/bin/test -f cat$s/$i.$s ; then X $PAGER cat$s/$i.$s X else X if /usr/bin/test -f man$s/$i.$s ; then X echo -n "Reformatting page..." X /usr/bin/nroff -man man$s/$i.$s > cat$s/$i.$s X echo "done." X $PAGER cat$s/$i.$s X else X found=no X for j in 1 2 3 4 5 6 7 8 ; do X if /usr/bin/test -f man$j/$i.$j; then X man $j $i X found=yes X fi X done X case $found in Xno) echo "$i: manual page not found" X exit 1 X esac X fi X fi;; X esac Xdone **-man.sh-EOF-** echo 'x - misc.c' sed 's/^X//' <<'**-misc.c-EOF-**' >misc.c X#include <stdio.h> X#include <sys/stat.h> X Xint rename(from, to) /* incredibly lazy on my part */ Xchar *from, *to; X{ X char cmdbuf[128]; X sprintf(cmdbuf, "mv %s %s", from, to); X return system(cmdbuf); X} X Xlong filelength(fd) Xint fd; X{ X struct stat stb; X X if(fstat(fd, &stb) < 0) X return -1L; X else X return stb.st_size; X} X **-misc.c-EOF-** echo 'x - nr.c.cdif' sed 's/^X//' <<'**-nr.c.cdif-EOF-**' >nr.c.cdif X*** ../nr.orig/nr.c Mon Nov 28 18:11:34 1988 X--- nr.c Mon Dec 12 15:25:42 1988 X*************** X*** 49,53 **** X /* of proportionally spaced characters. */ X X! #define X(x) (int (*))((long)(x)) X X static ARG Argtab[] = X--- 49,53 ---- X /* of proportionally spaced characters. */ X X! #define X(x) (int (*))(x) X X static ARG Argtab[] = X*************** X*** 85,89 **** X */ X X! #define MACFILE "\\lib\\tmac\\%1.8s.mac" X X /*--------------------------------------------------------*/ X--- 85,89 ---- X */ X X! #define MACFILE "/usr/lib/tmac/tmac.%s" X X /*--------------------------------------------------------*/ X*************** X*** 205,209 **** X X static sgetc(s) X! UCHAR **s; X { X return **s ? *((*s)++) : EOF ; X--- 205,209 ---- X X static sgetc(s) X! char **s; X { X return **s ? *((*s)++) : EOF ; X*************** X*** 304,309 **** X char **argv; X { X! fprintf(stderr, "NR ver. 1.2a [%s]. ", _DAY_ ); X! fprintf(stderr, "(C) 1987 Allen I. Holub. All rights reserved.\n" ); X X /* Initialize: */ X--- 304,312 ---- X char **argv; X { X! (void) "NR ver. 1.2a. "; X! (void) "(C) 1987 Allen I. Holub. All rights reserved.\n"; X! X! Ifile = stdin; /* can't initialize in nrglbls.c */ X! Ofile = stdout; X X /* Initialize: */ X*************** X*** 357,361 **** X X if( Unbuf ) X! setvbuf( Ifile, NULL, _IONBF, 0 ); X X screate( ".f" , Ifilename ); X--- 360,364 ---- X X if( Unbuf ) X! setbuf(Ifile, NULL); X X screate( ".f" , Ifilename ); **-nr.c.cdif-EOF-** echo 'x - nr.h.cdif' sed 's/^X//' <<'**-nr.h.cdif-EOF-**' >nr.h.cdif X*** ../nr.orig/nr.h Mon Nov 28 18:11:41 1988 X--- nr.h Mon Dec 12 15:28:34 1988 X*************** X*** 1,3 **** X! #include <ascii.h> X X #define min(a,b) ((a) < (b) ? (a) : (b)) X--- 1,3 ---- X! #include "ascii.h" X X #define min(a,b) ((a) < (b) ? (a) : (b)) X*************** X*** 6,10 **** X typedef unsigned char UCHAR; X X! #define MSC_VER5 /* For Microsoft C, version 5, if this define */ X /* doesn't exit, version 4 is assumed. */ X X--- 6,10 ---- X typedef unsigned char UCHAR; X X! /* #define MSC_VER5 /* For Microsoft C, version 5, if this define */ X /* doesn't exit, version 4 is assumed. */ X X*************** X*** 194,199 **** X char *cmd; /* Command name */ X int (*action)(); /* Subroutine to call when cmd found */ X! unsigned type : 3 ; /* Command type */ X! unsigned inhib : 1 ; /* 1 ==> Inhibit works */ X char *def; /* Default value of numeric argument */ X } X--- 194,199 ---- X char *cmd; /* Command name */ X int (*action)(); /* Subroutine to call when cmd found */ X! unsigned char type ; /* Command type */ X! unsigned char inhib ; /* 1 ==> Inhibit works */ X char *def; /* Default value of numeric argument */ X } X*************** X*** 217,227 **** X typedef struct X { X! UCHAR name; /* Font name */ X! UCHAR smac[3]; /* Macro to enter new font */ X! UCHAR emac[3]; /* Macro to exit font */ X! int resolution; /* Min horizontal resolution from .hd */ X! UCHAR *left; /* String to go left from .hd */ X! UCHAR *right; /* String to go right from .hd */ X! UCHAR *widths; /* Array of character widths. */ X } X FONT; X--- 217,227 ---- X typedef struct X { X! char name; /* Font name */ X! char smac[3]; /* Macro to enter new font */ X! char emac[3]; /* Macro to exit font */ X! int resolution; /* Min horizontal resolution from .hd */ X! char *left; /* String to go left from .hd */ X! char *right; /* String to go right from .hd */ X! char *widths; /* Array of character widths. */ X } X FONT; **-nr.h.cdif-EOF-** echo 'x - nrcmd.c.cdif' sed 's/^X//' <<'**-nrcmd.c.cdif-EOF-**' >nrcmd.c.cdif X*** ../nr.orig/nrcmd.c Mon Nov 28 18:11:51 1988 X--- nrcmd.c Mon Dec 12 15:20:29 1988 X*************** X*** 71,76 **** X int error; X extern int getvar(), null(); X! extern double parse(); X! double val = 0.0 ; X X if( **s ) X--- 71,76 ---- X int error; X extern int getvar(), null(); X! extern long parse(); X! long val = 0 ; X X if( **s ) X*************** X*** 162,166 **** X * Type 1: (* action)( val, str, offset, dobreak ); X * Type 2: (* action)( val, str, offset, dobreak, tail); X! * double val; X * char *str; X * char *tail; X--- 162,166 ---- X * Type 1: (* action)( val, str, offset, dobreak ); X * Type 2: (* action)( val, str, offset, dobreak, tail); X! * long val; X * char *str; X * char *tail; **-nrcmd.c.cdif-EOF-** echo 'x - nrglbls.c.cdif' sed 's/^X//' <<'**-nrglbls.c.cdif-EOF-**' >nrglbls.c.cdif X*** ../nr.orig/nrglbls.c Mon Nov 28 18:12:06 1988 X--- nrglbls.c Mon Dec 12 15:24:29 1988 X*************** X*** 106,110 **** X int Nobreak = '\''; /* Nobreak character */ X int Nospace = 0 ; /* Inhibit spacing as per .ns command */ X! int Nr_cpmode = 0 ; /* Nroff copy mode, expand \ in macro definitions*/ X int Num_bold = 0 ; /* Remaining number of input lines to print bold */ X int Num_center = 0 ; /* Remaining number of input lines to center */ X--- 106,110 ---- X int Nobreak = '\''; /* Nobreak character */ X int Nospace = 0 ; /* Inhibit spacing as per .ns command */ X! int Nr_cpmode = 1 ; /* Nroff copy mode, expand \ in macro definitions*/ X int Num_bold = 0 ; /* Remaining number of input lines to print bold */ X int Num_center = 0 ; /* Remaining number of input lines to center */ X*************** X*** 146,155 **** X char Itrap_name[3] = {0,0,0}; /* Macro executed when Intrap == 0 */ X X! FILE *Ifile = stdin; /* Current input descriptor */ X! char *Ifilename = "stdin"; /* Name of input file or macro */ X! FILE *Ofile = stdout; /* Output descriptor */ X! char *Ofilename = "stdout"; /* Name of output file or macro */ X! X! int Nestlev = 0 ; /* Nesting level determined by .{ & .} */ X X int Nm_on = 0 ; /* Line numbering enabled by .nm cmd */ X--- 146,153 ---- X char Itrap_name[3] = {0,0,0}; /* Macro executed when Intrap == 0 */ X X! FILE *Ifile = NULL; /* Current input descriptor */ X! char *Ifilename = "stdin"; /* Name of input file or macro */ X! FILE *Ofile = NULL; /* Output descriptor */ X! char *Ofilename = "stdout"; /* Name of output file or macro */ X X int Nm_on = 0 ; /* Line numbering enabled by .nm cmd */ **-nrglbls.c.cdif-EOF-** exit 0
housel@en.ecn.purdue.edu (Peter S. Housel) (12/13/88)
#!/bin/sh echo 'x - nrinp.c.cdif' sed 's/^X//' <<'**-nrinp.c.cdif-EOF-**' >nrinp.c.cdif X*** ../nr.orig/nrinp.c Mon Nov 28 18:12:23 1988 X--- nrinp.c Mon Dec 12 15:27:27 1988 X*************** X*** 24,29 **** X static int New_font = 0; /* Used by chfont() */ X X! extern char *expandstr(char*, char*, int); /* nrmac.c */ X! extern char *cpy( char*, char* ); /* tools.lib */ X X /*--------------------------------------------------------*/ X--- 24,29 ---- X static int New_font = 0; /* Used by chfont() */ X X! extern char *expandstr(); /* nrmac.c */ X! extern char *cpy(); /* tools.lib */ X X /*--------------------------------------------------------*/ X*************** X*** 135,139 **** X X int escape( tstart, target, copymode, inp, ifile, maxch) X! UCHAR *tstart, **target; X int (*inp)(); X FILE *ifile; X--- 135,139 ---- X X int escape( tstart, target, copymode, inp, ifile, maxch) X! char *tstart, **target; X int (*inp)(); X FILE *ifile; X*************** X*** 177,184 **** X int j; /* temporary */ X int linechar; /* line-drawing character */ X! UCHAR *bp; /* general-purpouse pointer */ X! UCHAR *dest; /* Pointer to target array */ X! UCHAR name[8]; /* string or number reg name */ X! UCHAR temp[80]; /* buffer used by itoascii() */ X /* to translate number */ X X--- 177,184 ---- X int j; /* temporary */ X int linechar; /* line-drawing character */ X! char *bp; /* general-purpouse pointer */ X! char *dest; /* Pointer to target array */ X! char name[8]; /* string or number reg name */ X! char temp[80]; /* buffer used by itoascii() */ X /* to translate number */ X X*************** X*** 385,390 **** X c = (* inp)(ifile); /* c = MS digit */ X i = (* inp)(ifile); /* i = LS digit */ X! c = toupper(c); X! i = toupper(i); X X if( !ishex(c) || !ishex(i) ) X--- 385,390 ---- X c = (* inp)(ifile); /* c = MS digit */ X i = (* inp)(ifile); /* i = LS digit */ X! if(islower(c)) c = toupper(c); X! if(islower(i)) i = toupper(i); X X if( !ishex(c) || !ishex(i) ) X*************** X*** 729,733 **** X int getline( target, copymode, inp) X int ( *inp )(); X! UCHAR *target; X { X /* Get an input line & put it into target. Get at most X--- 729,733 ---- X int getline( target, copymode, inp) X int ( *inp )(); X! char *target; X { X /* Get an input line & put it into target. Get at most X*************** X*** 751,757 **** X */ X X! register UCHAR *rp ; X! register int c ; X! UCHAR *p ; X X if( Quit ) /* Quit is set by the .ex command */ X--- 751,757 ---- X */ X X! register char *rp ; X! register int c ; X! char *p ; X X if( Quit ) /* Quit is set by the .ex command */ X*************** X*** 785,788 **** X--- 785,798 ---- X if( New_font && !ISCMD(*target) ) X { X+ do_newfont(target, p-target); X+ } X+ X+ return( !(c == EOF && p == target) ); X+ } X+ X+ int do_newfont(target, len) X+ char *target; X+ int len; X+ { X /* This is a kludge but it's the most convenient X * way to get a font change into the input stream X*************** X*** 792,796 **** X */ X X! memcpy( target+2, target, (p-target) + 1 ); X switch(New_font) X { X--- 802,806 ---- X */ X X! memcpy( target+2, target, len + 1 ); X switch(New_font) X { X*************** X*** 807,814 **** X target[1] = New_font ; X New_font = 0; X! } X! X! return( !(c == EOF && p == target) ); X! } X X /*--------------------------------------------------------*/ X--- 817,822 ---- X target[1] = New_font ; X New_font = 0; X! } X! X X /*--------------------------------------------------------*/ X*************** X*** 843,848 **** X */ X X! UCHAR line [MAXSTR] ; X! UCHAR *oiname, **omacv ; X int oinlines, oismacro ; X FILE *oifile ; X--- 851,856 ---- X */ X X! char line [MAXSTR] ; X! char *oiname, **omacv ; X int oinlines, oismacro ; X FILE *oifile ; X*************** X*** 889,893 **** X command( (char*)nifile ); X else X! text( (char*)nifile ); X } X else X--- 897,905 ---- X command( (char*)nifile ); X else X! { X! if(New_font) X! do_newfont( (char *)nifile, strlen( (char *)nifile )); X! text( (char*)nifile ); X! } X } X else **-nrinp.c.cdif-EOF-** echo 'x - nrmac.c.cdif' sed 's/^X//' <<'**-nrmac.c.cdif-EOF-**' >nrmac.c.cdif X*** ../nr.orig/nrmac.c Mon Nov 28 18:12:32 1988 X--- nrmac.c Mon Dec 12 15:09:50 1988 X*************** X*** 1,5 **** X #include <stdio.h> X X! #include <tools/hash.h> X #include "nr.h" X X--- 1,5 ---- X #include <stdio.h> X X! #include "tools/hash.h" X #include "nr.h" X X*************** X*** 53,57 **** X MACRO; X X! typedef UCHAR LTRAP[4]; X X static LTRAP Linetrap[ MAXLTRAP+1 ]; /* Traps, indexed by line number */ X--- 53,57 ---- X MACRO; X X! typedef char LTRAP[4]; X X static LTRAP Linetrap[ MAXLTRAP+1 ]; /* Traps, indexed by line number */ X*************** X*** 85,96 **** X */ X X! extern void err ( char*, ... ); /* nrout.c */ X! extern void process ( FILE*, char*, int, char** ); /* nrinp.c */ X! extern char *skipspace( char*, int ); X! extern char *skipto ( int, char*, int ); X! extern char *getenv ( char* ); X! extern char *strsave ( char* ); X! X! extern int getline ( unsigned char*, int, int (*)() ); /* nrinp.c */ X X /*--------------------------------------------------------*/ X--- 85,96 ---- X */ X X! extern void err (); /* nrout.c */ X! extern void process (); /* nrinp.c */ X! extern char *skipspace(); X! extern char *skipto (); X! extern char *getenv (); X! extern char *strsave (); X! X! extern int getline (); /* nrinp.c */ X X /*--------------------------------------------------------*/ X*************** X*** 99,145 **** X /* MACRO-RELATED (primitives): */ X X! /*global*/ int mgetc (MACRO * ); X! /*global*/ void mwrite (MACRO *, char *); X! /*global*/ void mputc (int, MACRO *); X! /*global*/ int munlink (char * ); X! /*global*/ void mrename (char *, char * ); X! /*global*/ MACRO *mopen (char *, char * ); X! /*global*/ void mclose (MACRO* ); X X /* MACRO-RELATED (high level): */ X X! /*global*/ char *expandstr (char *,char *,int); X! /*global*/ int expand_macro (char *); X! /*global*/ int mcreate (char *,char *); X! /*global*/ int mappend (char *,char *); X! /*global*/ void mac_clean (void); X! /*global*/ int screate (char *,char *); X! /*global*/ int sappend (char *,char *); X! /*global*/ int printm (void); X X /* DIVERSION-RELATED */ X X! /*global*/ int dcreate (char *); X! /*global*/ int dappend (char *); X! /*global*/ int endiv (void); X X /* TRAP-RELATED */ X X! /*global*/ int set_linetrap (char *,int ); X! /*global*/ int movetrap (char *,int ,int ); X! /*global*/ int pr_traps (void); X! /*global*/ int do_divtrap (void); X! /*global*/ int do_linetrap (int ); X! /*global*/ int distance (void); X X /* USED LOCALLY */ X X! /*local */ void delm (char*, MACRO* ); X! /*local */ char *fname (char*, char* ); X! /*local */ void swrite (MACRO*, char* ); X! /*local */ void prnt (char*, MACRO* ); X! /*local */ int pushdiv (MACRO*, char* ); X! /*local */ MACRO *popdiv (void ); X! /*local */ int findtrap (char* ); X X /*--------------------------------------------------------*/ X--- 99,145 ---- X /* MACRO-RELATED (primitives): */ X X! /*global*/ int mgetc (); X! /*global*/ void mwrite (); X! /*global*/ void mputc (); X! /*global*/ int munlink (); X! /*global*/ void mrename (); X! /*global*/ MACRO *mopen (); X! /*global*/ void mclose (); X X /* MACRO-RELATED (high level): */ X X! /*global*/ char *expandstr (); X! /*global*/ int expand_macro (); X! /*global*/ int mcreate (); X! /*global*/ int mappend (); X! /*global*/ void mac_clean (); X! /*global*/ int screate (); X! /*global*/ int sappend (); X! /*global*/ int printm (); X X /* DIVERSION-RELATED */ X X! /*global*/ int dcreate (); X! /*global*/ int dappend (); X! /*global*/ int endiv (); X X /* TRAP-RELATED */ X X! /*global*/ int set_linetrap (); X! /*global*/ int movetrap (); X! /*global*/ int pr_traps (); X! /*global*/ int do_divtrap (); X! /*global*/ int do_linetrap (); X! /*global*/ int distance (); X X /* USED LOCALLY */ X X! /*local */ void delm (); X! /*local */ char *fname (); X! /*local */ void swrite (); X! /*local */ void prnt2 (); X! /*local */ int pushdiv (); X! /*local */ MACRO *popdiv (); X! /*local */ int findtrap (); X X /*--------------------------------------------------------*/ X*************** X*** 765,769 **** X /*--------------------------------------------------------*/ X X! static void prnt( m_name, p ) X char *m_name; X MACRO *p; X--- 765,769 ---- X /*--------------------------------------------------------*/ X X! static void prnt2( m_name, p ) X char *m_name; X MACRO *p; X*************** X*** 772,775 **** X--- 772,776 ---- X int len; X char str[80]; X+ extern long filelength(); X X if( p->buf ) X*************** X*** 820,824 **** X else X { X! ptab( Macros, prnt, 1 ); X printf( "\nThe end macro is <%s>\n", X *Endm ? Endm : "NONEXISTANT" ); X--- 821,825 ---- X else X { X! ptab( Macros, prnt2, 1 ); X printf( "\nThe end macro is <%s>\n", X *Endm ? Endm : "NONEXISTANT" ); X*************** X*** 1037,1046 **** X */ X X! register UCHAR *lp; X X if( lnum < 0 ) X lnum += PGLEN ; X X! lp = (UCHAR *)( Linetrap + lnum ); X X if( lnum < 0 || lnum > MAXLTRAP ) X--- 1038,1047 ---- X */ X X! register char *lp; X X if( lnum < 0 ) X lnum += PGLEN ; X X! lp = (char *)( Linetrap + lnum ); X X if( lnum < 0 || lnum > MAXLTRAP ) X*************** X*** 1138,1146 **** X /* Spring a line trap on line "lnum", if one exists */ X X! register UCHAR *trap ; X X if( 0 <= lnum && lnum <= MAXLTRAP ) X { X! trap = (UCHAR *)( Linetrap + lnum ); X X if( *trap ) X--- 1139,1147 ---- X /* Spring a line trap on line "lnum", if one exists */ X X! register char *trap ; X X if( 0 <= lnum && lnum <= MAXLTRAP ) X { X! trap = (char *)( Linetrap + lnum ); X X if( *trap ) **-nrmac.c.cdif-EOF-** echo 'x - nrmap.c.cdif' sed 's/^X//' <<'**-nrmap.c.cdif-EOF-**' >nrmap.c.cdif X*** ../nr.orig/nrmap.c Mon Nov 28 18:12:37 1988 X--- nrmap.c Mon Dec 12 16:41:19 1988 X*************** X*** 78,85 **** X switch(i) X { X! case LITCHAR: c=i=*src++ ; SET_LIT(i); break; X! case SOFT_HYPHEN: c=i=*src++ ; HYPHENATE(i); break; X! case ZWIDTH: i=*src++ ; c = -1; break; X! case UP_SPACE: c=i=' ' ; SETNOPAD(i); break; X } X X--- 78,85 ---- X switch(i) X { X! case LITCHAR: c = i = *src++ ; SET_LIT(i); break; X! case SOFT_HYPHEN: c = i = *src++ ; HYPHENATE(i); break; X! case ZWIDTH: i = *src++ ; c = -1; break; X! case UP_SPACE: c = i = ' ' ; SETNOPAD(i); break; X } X X*************** X*** 96,100 **** X } X X! if( c <= MAX_CHARS_IN_FONT && c != '@' ) X SETWIDTH( i ); X else X--- 96,100 ---- X } X X! if( c <= MAX_CHARS_IN_FONT /* && c != '@' */) X SETWIDTH( i ); X else **-nrmap.c.cdif-EOF-** echo 'x - nrmap.h.cdif' sed 's/^X//' <<'**-nrmap.h.cdif-EOF-**' >nrmap.h.cdif X*** ../nr.orig/nrmap.h Mon Nov 28 18:12:41 1988 X--- nrmap.h Mon Dec 12 15:09:57 1988 X*************** X*** 82,86 **** X #define WHITE(c) ( CHAR(c)==' ' && !((c) & MODE_BIT) && PADDABLE(c) ) X X! #define FVAL(c) ( (int)((UCHAR)(c)) ) X #define MVAL(c) ( (int)((((int)(c)) << 4) >> 4)) /* do sign extension */ X X--- 82,86 ---- X #define WHITE(c) ( CHAR(c)==' ' && !((c) & MODE_BIT) && PADDABLE(c) ) X X! #define FVAL(c) ( CHAR(c) ) X #define MVAL(c) ( (int)((((int)(c)) << 4) >> 4)) /* do sign extension */ X **-nrmap.h.cdif-EOF-** echo 'x - nrmsc.c.cdif' sed 's/^X//' <<'**-nrmsc.c.cdif-EOF-**' >nrmsc.c.cdif X*** ../nr.orig/nrmsc.c Mon Nov 28 18:12:46 1988 X--- nrmsc.c Mon Dec 12 15:10:00 1988 X*************** X*** 12,20 **** X typedef struct X { X! unsigned adjusting :1; /* adjustment enabled */ X! unsigned bold :1; /* boldface active */ X! unsigned fill :1; /* filling enabled */ X! unsigned italics :1; /* italics active */ X! unsigned over :1; /* overstrike active */ X X int adjmode; /* adjustment mode (.ad M) */ X--- 12,20 ---- X typedef struct X { X! unsigned char adjusting; /* adjustment enabled */ X! unsigned char bold ; /* boldface active */ X! unsigned char fill ; /* filling enabled */ X! unsigned char italics ; /* italics active */ X! unsigned char over ; /* overstrike active */ X X int adjmode; /* adjustment mode (.ad M) */ **-nrmsc.c.cdif-EOF-** echo 'x - nrout.c.cdif' sed 's/^X//' <<'**-nrout.c.cdif-EOF-**' >nrout.c.cdif X*** ../nr.orig/nrout.c Mon Nov 28 18:12:55 1988 X--- nrout.c Mon Dec 12 15:10:08 1988 X*************** X*** 12,16 **** X #include <stdio.h> X #include <ctype.h> X! #include <stdarg.h> /* used by va_list, etc.: Microsoft-supplied */ X X #include "nr.h" X--- 12,16 ---- X #include <stdio.h> X #include <ctype.h> X! #include "stdarg.h" /* used by va_list, etc.: Microsoft-supplied */ X X #include "nr.h" X*************** X*** 20,24 **** X static int Do_zero_trap = 1; X X! extern char *cpy( char*, char* ); X X /*---------------------------------------------------------- X--- 20,24 ---- X static int Do_zero_trap = 1; X X! extern char *cpy(); X X /*---------------------------------------------------------- X*************** X*** 45,49 **** X va_start( args, fmt ); X X! putc( '\007', stderr ); X X fprintf( Verbose ? stdout : stderr, "ERROR(%s%s, line %d): ", X--- 45,49 ---- X va_start( args, fmt ); X X! /* putc( '\007', stderr ); */ X X fprintf( Verbose ? stdout : stderr, "ERROR(%s%s, line %d): ", X*************** X*** 201,205 **** X X title( s ) X! UCHAR *s ; X { X /* Do a three part title: /str1/str2/str3/ X--- 201,205 ---- X X title( s ) X! char *s ; X { X /* Do a three part title: /str1/str2/str3/ X*************** X*** 216,221 **** X X int delim, ndelim ; X! UCHAR srcbuf[ MAXSTR ], *src; X! UCHAR pagenum[60]; X int i, fmt; X CTYPE destbuf[ MAXSTR ], *dest ; X--- 216,221 ---- X X int delim, ndelim ; X! char srcbuf[ MAXSTR ], *src; X! char pagenum[60]; X int i, fmt; X CTYPE destbuf[ MAXSTR ], *dest ; X*************** X*** 662,666 **** X c &= 0xff; X X! bdos( (c == '\t') ? 6 : 2 , c, 0 ); X } X } X--- 662,667 ---- X c &= 0xff; X X! putchar(c); X! /* bdos( (c == '\t') ? 6 : 2 , c, 0 ); */ X } X } X*************** X*** 737,742 **** X c = (Esc == -1) ? '\\' : Esc ; X X! else if( IS_LIT(big_c) && c == '@' ) X! c = 0 ; X X outc( c ); /* Print char and advance */ X--- 738,743 ---- X c = (Esc == -1) ? '\\' : Esc ; X X! /* else if( IS_LIT(big_c) && c == '@' ) */ X! /* c = 0 ; */ X X outc( c ); /* Print char and advance */ X*************** X*** 820,824 **** X if( !Wordstar ) /* Not in wordstar mode */ X { X! outc( '\r' ); X outc( '\n' ); X } X--- 821,825 ---- X if( !Wordstar ) /* Not in wordstar mode */ X { X! /* outc( '\r' ); */ X outc( '\n' ); X } **-nrout.c.cdif-EOF-** echo 'x - nrp.h' sed 's/^X//' <<'**-nrp.h-EOF-**' >nrp.h Xextern int comment(); Xextern int ad(); Xextern int af(); Xextern int am(); Xextern int as(); Xextern int bd(); Xextern int bo(); Xextern int bp(); Xextern int br(); Xextern int c2(); Xextern int cc(); Xextern int ce(); Xextern int cf(); Xextern int ch(); Xextern int cm(); Xextern int cu(); Xextern int da(); Xextern int db(); Xextern int de(); Xextern int df(); Xextern int di(); Xextern int ds(); Xextern int dt(); Xextern int ec(); Xextern int el(); Xextern int em(); Xextern int eo(); Xextern int ev(); Xextern int ex(); Xextern int fi(); Xextern int ft(); Xextern int hd(); Xextern int hy(); Xextern int id(); Xextern int ie(); Xextern int iff(); Xextern int ig(); Xextern int in(); Xextern int it(); Xextern int lc(); Xextern int ll(); Xextern int ls(); Xextern int lt(); Xextern int mc(); Xextern int mf(); Xextern int ml(); Xextern int na(); Xextern int nb(); Xextern int ne(); Xextern int nf(); Xextern int nh(); Xextern int nm(); Xextern int nr(); Xextern int ns(); Xextern int od(); Xextern int os(); Xextern int ou(); Xextern int pc(); Xextern int pl(); Xextern int po(); Xextern int pt(); Xextern int rd(); Xextern int rm(); Xextern int rn(); Xextern int rr(); Xextern int rs(); Xextern int so(); Xextern int sp(); Xextern int ss(); Xextern int sblock(); Xextern int eblock(); **-nrp.h-EOF-** echo 'x - nrprocs.c.cdif' sed 's/^X//' <<'**-nrprocs.c.cdif-EOF-**' >nrprocs.c.cdif X*** ../nr.orig/nrprocs.c Mon Nov 28 18:13:08 1988 X--- nrprocs.c Mon Dec 12 17:20:25 1988 X*************** X*** 16,23 **** X X extern int mgetc(), fgetc(); X extern char *skipspace(), *skipto(), *cpy(); X! extern char *strsave ( char* ); X! extern double parse ( char** ); X X static Nestlev = 0; /* .{/.} Nesting level */ X X--- 16,23 ---- X X extern int mgetc(), fgetc(); X extern char *skipspace(), *skipto(), *cpy(); X! extern char *strsave (); X! extern long parse (); X X static Nestlev = 0; /* .{/.} Nesting level */ X X*************** X*** 506,512 **** X static FONT *lastfont = &Fonts[0]; X int i, existing ; X FILE *stream; X! UCHAR *malloc(); X X if( !*lstr ) X { X--- 506,512 ---- X static FONT *lastfont = &Fonts[0]; X int i, existing ; X FILE *stream; X! char *malloc(); X X if( !*lstr ) X { X*************** X*** 1138,1145 **** X * implied by N). If N is missing or 0, 2 is used. X */ X X! static UCHAR buf[21]; X! UCHAR *p; X X if( !*str ) X { X--- 1138,1145 ---- X * implied by N). If N is missing or 0, 2 is used. X */ X X! static char buf[21]; X! char *p; X X if( !*str ) X { X*************** X*** 1287,1293 **** X */ X X char *p; X! extern double parse(); X X if( Nm_on = *str ) X { X--- 1287,1293 ---- X */ X X char *p; X! extern long parse(); X X if( Nm_on = *str ) X { **-nrprocs.c.cdif-EOF-** echo 'x - nrtext.c.cdif' sed 's/^X//' <<'**-nrtext.c.cdif-EOF-**' >nrtext.c.cdif X*** ../nr.orig/nrtext.c Mon Nov 28 18:13:19 1988 X--- nrtext.c Mon Dec 12 15:18:42 1988 X*************** X*** 14,23 **** X typedef CTYPE QUEUE; /* Dummy typedef for queue routines */ X X- X /*--------------------------------------------------------*/ X X extern QUEUE *makequeue() ; X extern CTYPE *show_next() ; X! extern void map(CTYPE*, char*); X X /*-------------------------------------------------------- X--- 14,22 ---- X typedef CTYPE QUEUE; /* Dummy typedef for queue routines */ X X /*--------------------------------------------------------*/ X X extern QUEUE *makequeue() ; X extern CTYPE *show_next() ; X! extern void map(); X X /*-------------------------------------------------------- X*************** X*** 140,144 **** X */ X X! Last_queued = *cp & 0xff ; X X Owidth += HORIZONTAL( *cp ) ? MVAL( *cp ) : CWIDTH( *cp ) ; X--- 139,144 ---- X */ X X! if(0 == (*cp & MODE_BIT)) X! Last_queued = *cp & CHR ; X X Owidth += HORIZONTAL( *cp ) ? MVAL( *cp ) : CWIDTH( *cp ) ; X*************** X*** 393,397 **** X */ X X! hyphen( word, line-1 ); X X prevwidth += CWIDTH( TO_CTYPE('-') ); /* (1) */ X--- 393,397 ---- X */ X X! /* hyphen( word, line-1 ); */ X X prevwidth += CWIDTH( TO_CTYPE('-') ); /* (1) */ **-nrtext.c.cdif-EOF-** echo 'x - parse.c.cdif' sed 's/^X//' <<'**-parse.c.cdif-EOF-**' >parse.c.cdif X*** ../../nr.orig/tools/parse.c Mon Nov 28 18:13:33 1988 X--- parse.c Mon Dec 12 16:11:28 1988 X*************** X*** 2,6 **** X #include <ctype.h> X #include <stdarg.h> X! #include <math.h> X X /* PARSE.C Expression parser for infix desk calculator X--- 2,6 ---- X #include <ctype.h> X #include <stdarg.h> X! /* #include <math.h> */ X X /* PARSE.C Expression parser for infix desk calculator X*************** X*** 83,97 **** X */ X X! extern long atol( char * ); X! X! typedef double VTYPE; X! #define VTYPE_IS_DOUBLE 1 X X static char *Str; /* Static global varialbes */ X static char *Start_str; X X! int find (int ); /* local static subroutines */ X! int match (char * ); X! void error (char *, ... ); X VTYPE expr (); X VTYPE term (); X--- 83,97 ---- X */ X X! extern long atol(); X! X! typedef long VTYPE; X! #define VTYPE_IS_DOUBLE 0 X X static char *Str; /* Static global varialbes */ X static char *Start_str; X X! int find (); /* local static subroutines */ X! int match (); X! void error (); X VTYPE expr (); X VTYPE term (); X*************** X*** 154,158 **** X /*----------------------------------------------------------------------*/ X X! static void error( fmt, ... ) /* has a variable number of args */ X char *fmt; X { X--- 154,158 ---- X /*----------------------------------------------------------------------*/ X X! static void error( fmt ) /* has a variable number of args */ X char *fmt; X { X*************** X*** 238,241 **** X--- 238,242 ---- X VTYPE left; X static VTYPE tmp; X+ int i; X X left = constant(); X*************** X*** 336,341 **** X else X { X! rval = atof( Str ); X! X while( isdigit(*Str) || *Str == '.' ) X Str++; X--- 337,343 ---- X else X { X! #if VTYPE_IS_DOUBLE X! rval = atof( Str ); X! #endif X while( isdigit(*Str) || *Str == '.' ) X Str++; **-parse.c.cdif-EOF-** echo 'x - queue.c.cdif' sed 's/^X//' <<'**-queue.c.cdif-EOF-**' >queue.c.cdif X*** ../../nr.orig/tools/queue.c Mon Nov 28 18:13:38 1988 X--- queue.c Mon Dec 12 16:23:52 1988 X*************** X*** 16,23 **** X */ X X- #ifndef MSC_VER4 /* Microsoft C, ver. 5 */ X- # define memcpy(d,s,c) memmove(d,s,c) X- #endif X- X /*----------------------------------------------------------------------*/ X X--- 16,19 ---- X*************** X*** 200,204 **** X printf( "<-tail\n\n" ); X X! #ifdef DEBUG X printf("start =0x%x\n", qp->start ); X printf("head =%d\n", qp->head ); X--- 196,200 ---- X printf( "<-tail\n\n" ); X X! #ifdef DEBUG X printf("start =0x%x\n", qp->start ); X printf("head =%d\n", qp->head ); **-queue.c.cdif-EOF-** echo 'x - skipspac.c.cdi' sed 's/^X//' <<'**-skipspac.c.cdi-EOF-**' >skipspac.c.cdi X*** ../../nr.orig/tools/skipspac.c Mon Nov 28 18:13:47 1988 X--- skipspac.c Mon Dec 12 16:11:35 1988 X*************** X*** 4,8 **** X X char *skipspace( p, esc ) X! register unsigned char *p ; X register int esc ; X { X--- 4,8 ---- X X char *skipspace( p, esc ) X! register char *p ; X register int esc ; X { **-skipspac.c.cdi-EOF-** echo 'x - stdarg.h' sed 's/^X//' <<'**-stdarg.h-EOF-**' >stdarg.h X/* stdarg.h */ X#define va_list char * X#define va_start(argp, format) argp = (char *)&format + sizeof(format) X#define va_arg(argp, type) ((type *)(argp += sizeof(type)))[-1] X#define vfprintf _doprintf X#define vprintf(fmt,args) vfprintf(stdout,fmt,args) **-stdarg.h-EOF-** echo 'x - stoi.c.cdif' sed 's/^X//' <<'**-stoi.c.cdif-EOF-**' >stoi.c.cdif X*** ../../nr.orig/tools/stoi.c Mon Nov 28 18:13:55 1988 X--- stoi.c Mon Dec 12 16:11:38 1988 X*************** X*** 47,51 **** X num += ('0'<= *str && *str <= '9') ? X *str - '0' : X! toupper(*str) - 'A' + 10 ; X str++; X } X--- 47,52 ---- X num += ('0'<= *str && *str <= '9') ? X *str - '0' : X! (islower(*str) ? *str - 'a' + 10 X! : *str - 'A' + 10); X str++; X } **-stoi.c.cdif-EOF-** echo 'x - strsave.c.cdif' sed 's/^X//' <<'**-strsave.c.cdif-EOF-**' >strsave.c.cdif X*** ../../nr.orig/tools/strsave.c Mon Nov 28 18:13:59 1988 X--- strsave.c Mon Dec 12 16:11:41 1988 X*************** X*** 1,4 **** X! extern char *strcpy ( char*, char* ); X! extern void *malloc ( unsigned ); X X char *strsave( str ) X--- 1,4 ---- X! extern char *strcpy (); X! extern void *malloc (); X X char *strsave( str ) **-strsave.c.cdif-EOF-** echo 'x - switchar.c.cdi' sed 's/^X//' <<'**-switchar.c.cdi-EOF-**' >switchar.c.cdi X*** ../../nr.orig/tools/switchar.c Mon Nov 28 18:14:03 1988 X--- switchar.c Mon Dec 12 16:11:44 1988 X*************** X*** 1,16 **** X! int switchar() X! { X! /* Returns the first character in the SWITCHAR environment X! * if one is defined, else returns '-'. X! */ X! X! register char *env; X! extern char *getenv(); X! X! if( !(env = getenv("SWITCHAR")) || !*env ) X! return '-'; X! else X! return (int)*env ; X! X! } X! X--- 1 ---- X! int switchar() {return '-';} **-switchar.c.cdi-EOF-** echo 'x - tmac.an' sed 's/^X//' <<'**-tmac.an-EOF-**' >tmac.an X.\" '-man' macros for NR X.\" author: Peter S. Housel May 1988 X.ds S "" X.de _R \" reset font and size, do tab if necessary X.if \\n(_I \{\ X.\" X\T X.DT X.rr _I \} X.ft R X.. X.de B \" boldface X.ft B X.ie \\n(.$==0 .it 1 _R X.el \\$1\\$2\\$3\\$4\\$5\\$6\\fR\\*S X.. X.de BI \" alternate bold and italic X.ft B X.ie \\n(.$==0 .it 1 _R X.el \\$1\\fI\\$2\\fB\\$3\\fI\\$4\\fB\\$5\\fI\\$6\\fR\\*S X.. X.de BR \" alternate bold and Roman X.ft B X.ie \\n(.$==0 .it 1 _R X.el \\$1\\fR\\$2\\fB\\$3\\fR\\$4\\fB\\$5\\fR\\$6\\fR\\*S X.. X.de DT \" restore default tabs X.ta 8 +8 +8 +8 +8 +8 +8 +8 +8 +8 +8 +8 X.. X.de _P \" set prevailing indent X.if !'\\$1'' .nr _P \\$1 X.in \\n(_P X.. X.de HP \" hanging indent paragraph X._P \\$1 X.ti 0 X.. X.de I \" italicize X.ft I X.ie \\n(.$==0 .it 1 _R X.el \\$1\\$2\\$3\\$4\\$5\\$6\\fR\\*S X.. X.de IB \" alternate italic and bold X.ft I X.ie \\n(.$==0 .it 1 _R X.el \\$1\\fB\\$2\\fI\\$3\\fB\\$4\\fI\\$5\\fB\\$6\\fR\\*S X.. X.de IP \" indented paragraph with hanging tag argument X.TP \\$2 X\\$1 X.. X.de IR \" alternate italic and Roman X.ft I X.ie \\n(.$==0 .it 1 _R X.el \\$1\\fR\\$2\\fI\\$3\\fR\\$4\\fI\\$5\\fR\\$6\\fR\\*S X.. X.de LP \" paragraph X.PP X.. X.de PD \" set interparagraph distance X.ie \\n(.$==0 .nr PD 1 X.el .nr PD \\$1 X.. X.de PP \" new paragraph X\fR\*S X.sp \\n(PD X._P 5 X.. X.de RE \" end of relative indent X.in -\\n(RS X.. X.de RB \" alternate Roman and bold X.ft R X.ie \\n(.$==0 .it 1 _R X.el \\$1\\fB\\$2\\fR\\$3\\fB\\$4\\fR\\$5\\fB\\$6\\fR\\*S X.. X.de RI \" alternate Roman and italic X.ft R X.ie \\n(.$==0 .it 1 _R X.el \\$1\\fI\\$2\\fR\\$3\\fI\\$4\\fR\\$5\\fI\\$6\\fR\\*S X.. X.de RS \" start relative indent X.ie \\n(.$==0 .nr RS \\n(_P X.el .nr RS \\$1 X.in +\\n(RS X.. X.de _S \" subhead trap X\fR\*S X.br X.. X.de SH \" subhead X.sp 1 X._P X.ti 0 X.ft B X.ie \\n(.$==0 .it 1 _S X.el \\$1 \\$2 \\$3 \\$4 \\$5 \\$6\\fR\\*S X.br X.. X.de SM \" small X.\".ps -2 X.ie \\n(.$==0 .it 1 _R X.el \\$1\\$2\\$3\\$4\\$5\\$6\\fR\\*S X.. X.de TH \" title X.ds _N \\$1 X.ds _C \\$2 X._P 5 X.DT X.. X.de TP \" indented paragraph with hanging tag X.ie !'\\$1'' .nr _I \\$1 X.el .nr _I 5 X.sp \\n(PD X.in \\n(_I+\\n(_P X.ti -\\n(_I X.ta \\n(_I X.it 1 _R X.. X.de _H \" header macro X.ev 1 X.sp 2 X.tl |\\*(_N(\\*(_C)|MINIX Programmer's Manual|\\*(_N(\\*(_C)| X.sp 2 X.ev X.. X.de _F \" footer macro X.ev 1 X.sp 2 X.tl |Glerptic edition||%| X.bp X.ev X.. X.wh 0 _H X.wh -6 _F X.TH XX 0 X.ds R "(Reg)" X.PD **-tmac.an-EOF-** exit 0