[net.sources] titroff/ditroff

req@warwick.UUCP (Russell Quin) (11/21/86)

The files and context-diffs that follow can be applied to ditroff (dwb 1) to:
o	add lots of error checking

o	make the existing error messages more helpful

o	allow user-defined fonts

o	add some new facilities

o	add ``enhancements'' for compatibility with UCB-Gremlin

o	fix a lot of bugs

All of the changes are conditionally compiled with "ifdef" -- each set of
changes has its own name.

The resulting version of troff is *much* easier to use.

Caveat: the existing -ms and -mm macro packages are full of syntax errors and
bugs. These will start to produce warning messages.  If you fix them, the
output will be better.  Perhaps you'd like to post your fixes!

I shall be leaving Warwick to move to a new job at the end of this week, so
although mail will be forwarded (& I'd be glad of any changes that you needed
to make), I may take a while to respond!

Russell

This part contains the extra fles, local.c and local.h

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	local.c
#	local.h
# This archive created: Thu Nov 20 21:32:30 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'local.c'" '(20607 characters)'
if test -f 'local.c'
then
	echo shar: will not over-write existing file "'local.c'"
else
sed 's/^X//' << \SHAR_EOF > 'local.c'
X/* local.c --- local features that didn't fit in elsewhere:
X *	error reporting:  warnings about local features
X *			  warnings about syntax errors &c
X *			  fatal error reporting
X */
X#include <ctype.h>
X/* give users warnings if they use non-standard features... */
X#ifndef MAXPTR
X#include "tdef.h"
X#endif MAXPTR
X#include "ext.h"
X#ifndef WARN_ONCE
X#include "local.h"
X#endif WARN_ONCE
X#if defined(WARNLEVELREG) || defined(REPORTERRS)
X/* v.h defines a single structure, to which the extern applies.
X * It contains the names of the general-purpose number-registers.
X * We use it for giving the line-number in error messages, and for
X * a "warning level" register to enable turning off warnings about local
X * features from within troff.
X * - req
X */
Xextern
X#include "v.h"
X#endif 
X#ifdef LOCALWARN
X
X/*ARGSUSED1*/
Xlwarn(s, a1, a2, a3, a4, a5)
X	char *s;
X{
X#ifdef WARNLEVELREG
X	if (v.wl) {
X		if (v.wl & WARN_ONCE) {
X			errmsg(EWARN, "Input uses local features; use troff -W for explicit information\n");
X			v.wl &= (~WARN_ONCE);
X		} else {
X			errmsg(0, 0, s, a1, a2, a3, a4, a5);
X		}
X	}
X#else !WARNLEVELREG
X	if (warninglevel) {
X		/* stderr comes from tdef.h; different to stdio.h's stderr! */
X		if (warninglevel & WARN_ONCE) {
X			errmsg(EWARN, "Input uses local features; use troff -W for explicit information\n");
X			warninglevel &= (~WARN_ONCE);
X		} else {
X			errmsg(0, 0, s, a1, a2, a3, a4, a5);
X		}
X	}
X#endif WARNLEVELREG
X}
X#endif LOCALWARN
X#ifdef REPORTERRS
X
Xchar *progname;   /* set in n1.c:main() */
Xchar *ifilename;  /* set by n1.c:nextfile() */
Xint reporterrs = LERR_EVERYTHING;
X
X/*ARGSUSED2*/
Xvoid
Xerrmsg(func, arg, mesg, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
X	int (*func)();	/* called after printing the message, if != 0 */
X	int arg;	/* passed to func */
X	char *mesg;	/* passed to printf */
X{
X
X	/* don't give warnings if they're turned off
X	 * note that this turns off warnings about local features too, but
X	 * you can set warninglevel to achieve that more cleanly!
X	 *
X	 */
X	if (func == 0 && !(reporterrs & LERR_WARNINGS)) {
X		return;
X	}
X	/* NOTE:  troff has its own version of printf and stdio! */
X	if (!progname || !*progname) {
X		progname = "ditroff";
X	}
X	/* progname might contain %.  Remember that we're not using stdio */
X	fprintf(stderr, "%s:", progname);
X	if (ifilename && *ifilename) {
X		fprintf(stderr, "%s:", ifilename);
X		/* ifilename set by n1.c:nextfile();  it might not always
X		 * change when .so happens, though!
X		 */
X	}
X	fprintf(stderr, "%d:%s", v.cd, (func == 0) ? "warning: " : " ");
X
X	if (mesg && *mesg) {
X		fprintf(stderr, mesg, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
X		if (mesg[strlen(mesg)-1] != '\n') { /* no trailing newline */
X			/* terminal modes may be odd, so add \r as well */
X			fprintf(stderr, "\r\n");
X		}
X	} else {
X		fprintf(stderr, "Internal error: mesg NULL (__FILE__:__LINE__)\n");
X	}
X
X	if (func != 0) {
X		(* func)(arg);
X	} /* else simply return */
X}
X
Xchar *
Xrealname(a)
X	tchar a;
X{
X	/* return string representation of the name.  Trivial now, but might
X	 * become complex if long names are allowed
X	 * -- req
X	 */
X
X
X#ifdef TCHARTOS
X	char one, two;
X	char *rp;
X#endif TCHARTOS
X	static char buffer[30];		/* max is 2 char name + 1 for \0 */
X					/* but also use "[none]" etc */
X	buffer[0] = buffer[1] = buffer[2] = '\0';
X	buffer[0] = (char) a;
X	buffer[1] = a >> BYTE;
X
X	if (!buffer[0] && !buffer[1]) {
X		return(strcpy(buffer, "[null name]"));
X	} 
X	if (!buffer[0]) {
X		/* don't know if this can happen */
X		buffer[0] = ' ';
X	}
X#ifdef TCHARTOS
X	one = buffer[0];
X	two = buffer[1];
X	if (buffer[0]) strcpy(buffer, tchartos((tchar) one));
X	if (buffer[1]) strcat(buffer, tchartos((tchar) two));
X#endif TCHARTOS
X	return buffer;
X}
X
X#endif REPORTERRS
X#ifdef ROTATEPAGE
X
Xint pageangle = 0;
X
Xvoid
Xcaserp()	/* .rp n --- rotate page by n degrees */
X		/* .rp n x y -- put topleft at x, y */
X{
X	static int oldangle = 0;
X	int newx = 0, newy = 0;
X
X#ifdef LOCALWARN
X	lwarn(".rp (rotate page) is non-standard");
X#endif LOCALWARN
X	if (skip()) {
X		pageangle = oldangle;
X	} else {
X		oldangle = pageangle;
X		/* does inumb() allow +n to be an increment? */
X		pageangle = inumb(&pageangle);
X	}
X	/* don't give % a non-portable -ve argument, in case it
X	 * ever matters... */
X	while (pageangle < 0) {
X		pageangle += 360;
X	}
X	if (pageangle >= 360) {
X		pageangle %= 360;
X	}
X	/* swap over width & length of page to apply to the nearest
X	 * diagonal
X	 */
X	if ((pageangle < 45 && pageangle > 0) ||
X	    (pageangle >= 315) || (pageangle >= 135 && pageangle < 225)) {
X		extern int paperwidth, paperlength;	/* in t10.c */
X
X		int tmpwid = paperwidth;
X
X		paperwidth = paperlength;
X		paperlength = tmpwid;
X	}
X	/* now look for newx, newy */
X	if (!skip()) {
X		newx = inumb(&newx);
X		if (skip()) {
X#ifdef REPORTERRS
X			errmsg(EWARN, ".rp: new y pos missing (assuming 0)");
X#endif REPORTERRS
X			newy = 0;
X		} else {
X			newy= inumb(&newy);
X			if (!skip()) {
X#ifdef REPORTERRS
X				errmsg(EWARN,
X				".rp: extra characters ignored from \"%s\"",
X							tchartos(ch));
X#endif REPORTERRS
X			}
X		}
X	}
X	ptpangle(newx, newy);
X}
X
X
X/* ptpangle() is called from newpage() in t10.c.  Probably won't be able to
X * affect the 1st page, as newpage() gets called at the end of each page.
X * But it should also be called on the 1st-page transition, to start page 1.
X * I haven't checked to see if it is.
X * - req
X */
Xptpangle(newx, newy)
X	int newx, newy;
X{
X	static int angle = 0;
X	/* only print out command if the angle
X	 * 	is non-zero (on every page, to help pre-processors)
X	 *	has changed (obvious!)  Note that it might change to 0.
X	 */
X	if (pageangle || pageangle != angle) {
X		fprintf(ptid, "x A %d %d %d\n", pageangle, newx, newy);
X		angle = pageangle;
X	}
X}
X#endif ROTATEPAGE
X#ifdef USEFONTPATH
Xchar *
Xfollowpath(path, file, mode)
X	char *path, *file;
X	int mode;
X{
X	/* "path" is interpreted as a colon-separated list of names.
X	 * We look in each of them for "file".
X	 */
X	int fd;	/* try to open the file at each stage */
X
X	register char *p = path;
X	static char result[NS];
X
X	while (*p) {
X		register char *q = result;
X
X		*q = '\0';
X		while (*p && *p != ':') {
X			if (q - result >= NS - (strlen(file) + 2)) {
X				/* 2 is for '/' and trailing '\0' */
X#ifdef REPORTERRS
X				errmsg(EWARN, "Name in path too long (%s)",
X							result);
X#else !REPORTERRS
X				fprintf(stderr, "troff: \"%s\" too long in \"%s\"",
X					result, path);
X#endif REPORTERRS
X				return 0;
X			}
X			*q++ = *p++;
X			*q = '\0';
X		}
X		if (*p && *p == ':')
X			p++;	/* step over the colon */
X		if (q == result)
X			*q++ = '.';
X		*q++ = '/';
X		*q = '\0';
X
X		if ((fd = open(strcat(result, file), mode)) >= 0) {
X			/* opened it OK... */
X			close(fd);
X			return(result);
X		}
X		q = result;
X	}
X	/* failed... */
X	return (char *) 0;	/* not using stdio -- NULL not defined */
X}
X#endif USEFONTPATH
X#ifdef FONTFAMILIES
X
X/* caseff -- fontfamily */
Xcaseff()
X{
X	char familyname[NS];
X	int j, k;
X	tchar i;
X
X	if (skip()) {
X#ifdef REPORTERRS
X		errmsg(EWARN, "call to .ff with no arguments ignored");
X		return;
X#endif REPORTERRS
X	}
X#ifdef LOCALWARN
X	lwarn("Font Family (.ff) is non-portable");
X#endif LOCALWARN
X	lgf++; /* don't want ligatures in our nice FamilyName */
X	for (k = 0; k < (NS - 1); k++) {
X		if (((j = cbits(i = getch())) <= ' ') || (j > 0176))
X			break;
X		familyname[k] = j;
X	}
X	familyname[k] = 0;
X	ch = i;
X	lgf--;
X	if (familyname[0]) {
X		setfamily(familyname);
X	}
X#ifdef REPORTERRS
X	else {
X		errmsg(EWARN, ".ff: illegal font family name");
X	}
X#endif REPORTERRS
X}
X
X/* setfamily(name) -- use font family ``name'' */
X/* We do this by reading a ``FamilyFile'' looking for a line that starts
X * with name followed by a colon.  After the colon there is a comma-
X * separated list of font names to load in successive positions.
X * Later I'd like to add more (that's why the commas are there):
X * S=n would set the slant to n on that font position, H the height,
X * b the bd factor, s the size, ....
X * But that's for later.  Maybe *after* breakfast.
X * - req 20/10/1986
X */
X
X#ifndef FAMILYFILENAME
X#define FAMILYFILENAME "FamilyFile"
X#endif !FAMILYFILENAME
Xint
Xsetfamily(name)
X	char *name;
X{
X	char tmp[NS]; /* to store filename if !fontpath */
X	char *FamilyFileName = tmp;
X	int famfile;
X	char linebuf[NS];
X	int linenumber = 0; /* for error reporting. */
X	int pos = 0;
X	int c;  /* current input char from family file */
X	int inextf; /* index into nextf[] */
X
X	extern char *fontpath;
X
X#ifdef USEFONTPATH
X	if (fontpath && *fontpath) {
X	       if (!(FamilyFileName = followpath(fontpath, FAMILYFILENAME, 0))){
X#ifdef REPORTERRS
X			errmsg(EWARN, "Can't find \"%s\" in path \"%s\" to load font family %s from",
X					FAMILYFILENAME, fontpath, name);
X#else !REPORTERRS
X			fprintf(stderr
X				"troff: can't find \"%s\" for font family %s\n",
X					FAMILYFILENAME, name);
X#endif REPORTERRS
X			return 0;
X		}
X	} else
X#endif USEFONTPATH
X		sprintf(tmp, "/usr/lib/troff/descs/dev%s/%s",
X						devname, FAMILYFILENAME);
X	if (FamilyFileName != tmp) {
X		(void) strcpy(tmp, FamilyFileName);
X		FamilyFileName = tmp;
X	}
X	if ((famfile = open(FamilyFileName, 0)) < 0) {
X#ifdef REPORTERRS
X		errmsg(EWARN,
X		"Can't open font family file \"%s\" looking for family \"%s\"",
X							FamilyFileName, name);
X#else !REPORTERRS
X		fprintf(stderr, "troff: can't open %s to load family %s\n"",
X							FamilyFileName, name);
X#endif REPORTERRS
X		return 0;
X	}
X	/* now have an open file `famfile' */
X
X	/* look for a line starting with name: */
X	
X	while ((c = getfamchar(famfile)) >= 0) {
X		linenumber++;
X		/* at start of line... */
X
X		/* skip initial whitespace */
X		while (c > 0 && (c == ' ' || c == '\t') )
X			c = getfamchar(famfile);
X
X		if (c == *name) {
X			char *p = name + 1;
X
X			while ((c = getfamchar(famfile)) > 0) {
X				if (!*p || *p++ != c) { 
X					break;
X				}
X			}
X			if (!*p && c == ':') { /* found */
X				break;
X			} else {
X				/* mismatch... */
X				c = '#';
X			}
X		} else {
X			c = '#'; /* ignore rest of line! */
X		}
X		if (c != '#' ) {
X#ifdef REPORTERRS
X			errmsg(EWARN,
X"Error reading font family file \"%s\" line %d: \'%c\' unexpected",
X						FamilyFileName, linenumber, c);
X#else !REPORTERRS
X			fprintf(stderr, "troff: %s: %d: format error\n",
X						FamilyFileName, linenumber);
X#endif REPORTERRS
X			close (famfile);
X			return 0;
X
X		} else { /* comment or a mismatch */
X			while ((c = getfamchar(famfile)) > 0 && c != '\n')
X				;
X			if (c < 0) { /* EOF */
X				break;
X			}
X		}
X	}
X	/* now either c < 0 (EOF or error) or c is 1 char past a match */
X	if (c < 0) {
X#ifdef REPORTERRS
X		errmsg(EWARN, "Font Family %s not found in \"%s\"",
X						name, FamilyFileName);
X#else !REPORTERRS
X		fprintf(stderr, "troff: Font Family %s not found in \"%s\"",
X						name, FamilyFileName);
X#endif REPORTERRS
X		return 0;
X	}
X	/* now we have a match.  Want to look for font names */
X	while ((c = getfamchar(famfile)) > 0 && c != '\n') {
X		char shortname[3];
X		char *p = shortname;
X
X		/* skip whitespace */
X		while (c > 0 && (c == ' ' || c == '\t') )
X			c = getfamchar(famfile);
X
X		if (c == '\n' || c < 0)
X			break;
X
X		/* now the font name */
X		/* c already contains the 1st char of this. */
X		shortname[0] = c;
X		if ((c = getfamchar(famfile)) > 0 && c != '\n') {
X			shortname[1] = c;
X		} else break;
X		if (c == ' ' || c == '\t')
X			shortname[1] = '\0';
X		else
X			shortname[2] = '\0';
X		
X		/* got a font name */
X		/* try to mount it on the next position */
X		if (setfp(++pos, PAIR(shortname[0], shortname[1]), 0) < 0) {
X			break; /* setfp does an error message */
X		}
X
X		/* skip whitespace */
X		while ((c = getfamchar(famfile)) > 0 && (c == ' '||c == '\t'))
X			;
X
X		if (c == ':') {
X			/* do a .so on the filename */
X			/* I'd like to push back ".so file" here!
X			* - req
X			*/
X			inextf = nextf[0] = 0;
X
X			/* skip whitespace */
X			while (((c = getfamchar(famfile)) > 0) &&
X						(c == ' ' || c == '\t')) {
X					continue;
X			}
X			while (c > 0 && c != ' ' && c != '\n' && c != '\t') {
X				nextf[inextf++] = c;
X				nextf[inextf] = 0;
X				c = getfamchar(famfile);
X			}
X
X			if (!inextf || !nextf[0]) {
X#ifdef REPORTERRS
X				errmsg(EWARN, "%s: %d: colon (:) unexpected",
X						FamilyFileName, linenumber);
X#else !REPORTERRS
X				fprintf(stderr,
X					"troff: %s: %d: colon (:) unexpected",
X						FamilyFileName, linenumber);
X#endif REPORTERRS
X				break;
X			}
X			/* skip trailing whitespace */
X
X			while (c > 0 && (c == ' '||c == '\t')) {
X				(c = getfamchar(famfile));
X			}
X#ifdef REPORTERRS
X			if (c != '\n' && c != '#') {
X				if (c < 0) {
X					errmsg(EWARN, "Unexpected EOF at line %d of font family file \"%s\"", linenumber, FamilyFileName);
X				} else {
X					errmsg(EWARN, "%s: %d: \"%c\" unexpected after filename \"%s\"", FamilyFileName, linenumber, c, nextf);
X					c = '#';
X				}
X			}
X#endif REPORTERRS
X			/* do this after checking the rest of the line so that
X			 * we can use nextf in the error message!
X			 */
X			dosofile("Loading Font Family");
X		}
X		if (c == '\n' || c == '#' || c < 0) {
X			break;
X		} else if (c == ',') {
X			continue;
X		} else {
X#ifdef REPORTERRS
X			errmsg(EWARN, "%s: %d: Expected a comma, found \"%c\"",
X					FamilyFileName, linenumber, c);
X#else !REPORTERRS
X			fprintf(stderr,
X				"troff: %s: %d: Expected a comma, found \"%c\"",
X					FamilyFileName, linenumber, c);
X#endif REPORTERRS
X			break;
X		}
X	}
X	close (famfile);
X#ifdef REPORTERRS
X	/* pos == 0 implies no fonts loaded
X	 * inextf == 0 implies no file loaded (via dosofile())
X	 */
X	if (pos == 0 && inextf == 0) {
X		errmsg(EWARN, ".ff: no action in \"%s\" for family \"%s\"",
X					FamilyFileName, name);
X	}
X#endif REPORTERRS
X	return pos;
X}
X
X/* this is the bulk of caseso().  I've factored it out to use the same code
X * in both places */
Xint
Xdosofile(wherefrom)
X	char *wherefrom;
X{
X	register i;
X	register char	*p, *q;
X	/* offl, ioff and ipl are from n1.c */
X	extern long offl[];
X	extern long ioff;
X	extern filep ipl[];
X
X	if ((i = open(nextf, 0)) < 0 || (ifi >= NSO)) {
X#ifdef REPORTERRS
X		errmsg(done, 02, "%s: can't open file %s", wherefrom, nextf);
X#else !REPORTERRS
X		fprintf(stderr, "troff: can't open file %s\n", nextf);
X		done(02);
X#endif REPORTERRS
X	}
X	flushi();
X	ifl[ifi] = ifile;
X	ifile = i;
X	offl[ifi] = ioff;
X	ioff = 0;
X	ipl[ifi] = ip;
X	ip = 0;
X	nx++;
X	nflush++;
X	if (!ifl[ifi++]) {
X		p = ibuf;
X		q = xbuf;
X		xbufp = ibufp;
X		xeibuf = eibuf;
X		while (p < eibuf)
X			*q++ = *p++;
X	}
X}
X
X
Xint
Xgetfamchar(f)
X	int f;
X{
X	/* return the next char from file 'fam' */
X	/* wouldn't it have been nice to have used stdio ? */
X	/* should probably do this like .cf I suppose.  */
X
X	static char smallbuf[NS];
X	static char *p = 0;
X
X	if (!p || !*p) {
X		if ((read(f, smallbuf, NS - 1)) <= 0) {
X			/* EINTR problem here? */
X			return -1;
X		}
X		p = smallbuf;
X	}
X	return (*p++) & 0377; /* discourage sign extension */
X}
X
X#endif FONTFAMILIES
X#ifdef ANYBASESTR
X/* would like to define setbasestr() here.
X * the idea is to allow text to be set on an arbitrary baseline.
X * \R'l 1i 1i'hello there'
X * should draw "hello there" at a 45 degree angle.
X * Perhaps it'd be easier to stick to straight lines for now, as then at
X * least we can work out the width of the things!  Perhaps it should be
X * \R'n'str'.
X * But I don't know how to do that, either!
X * - req
X */
X#endif ANYBASESTR
X#ifdef BLANKSMACRO
X
Xstatic int bmmacro = PAIR('s', 'p');
X
Xcasebm()
X{
X	lgf++;
X	skip();
X	if (!(bmmacro = getrq())) {
X		bmmacro = PAIR('s', 'p');
X	}
X}
X
Xint nrspaces, nrlines;
X/* this is really for the .B and .N registers in n4.c: the idea is that one
X * could write a paragraph macro that was invoked by magic on blank lines:
X * .de P
X * .sp \\n(.NV \" .N is the number of blank lines
X * .if \\n(.B>0  .ti +\\n(PDu \" .B is indent...
X * ..
X * with other processing as well.  This is a big improvement, as it means
X * that blank lines in the output can be handled consistently.  It also
X * allows for things like poetry, and for style parameters (e.g. the para
X * indent in "P" above is fixed irrespective of the number of spaces on
X * the input line.
X * 
X * bug: callblank is called for each blank line instead of once at the end
X *
X * req
X */
Xcallblank(spaces, lines)
X	int spaces;	/* number of leading spaces */
X	int lines;	/* after this many blank lines */
X{
X	/* 2nd arg to control() is a 1 if we have to collect args for a
X	 * user-defined macro. */
X	nrspaces = spaces;
X	nrlines = lines;
X	if (bmmacro == PAIR('s', 'p')) {
X		callsp();
X	} else {
X		control(bmmacro, 0);
X	}
X}
X#endif BLANKSMACRO
X#ifdef TCHARTOS
X
X/* routine to provide a string representation of a tchar
X * BUG:
X * uses a static buffer to hold the result.
X * req 1986
X */
X
Xchar *
Xtchar0(i)
X	tchar i;
X{
X	static char resultbuf0[5]; /* plenty! */
X	static char resultbuf1[5]; /* plenty! */
X	static char which = '0';
X
X	int ch = cbits(i);
X	register char *resultbuf = (which == '0') ? resultbuf0 : resultbuf1;
X
X	which ^= '0';
X	*resultbuf = '\0';	/* paranoia */
X
X	switch (ch) {
X	case 002: case 003: case 005: case 006: case 007: /* unfair? */
X	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g':
X	case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
X	case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u':
X	case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B':
X	case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I':
X	case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P':
X	case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W':
X	case 'X': case 'Y': case 'Z': case '0': case '1': case '2': case '3':
X	case '4': case '5': case '6': case '7': case '8': case '9': case '!':
X	case '@': case '#': case '$': case '%': case '^': case '&': case '*':
X	case '(': case ')': case '_': case '-': case '=': case '+': case '`':
X	case '~': case ']': case '[': case '{': case '}': case '\'': case '"':
X	case ';': case ':': case '<': case '>': case ',': case '.': case '/':
X	case '?': case '|': case '\\': case ' ':
X	case '\n': case '\r': case '\f':
X		resultbuf[0] = ch;
X		resultbuf[1] = '\0';
X		return resultbuf;
X
X	default:
X		ch &= 0177;	/* bottom 7 bits (must be ASCII) */
X		if (iscntrl(ch)) {
X			resultbuf[0] = '^';
X			resultbuf[1] = (ch + '@') & 0177;  /* ASCII ONLY */
X			resultbuf[2] = '\0';
X			return resultbuf;
X		}
X		/* ``shouldn't happen'' */
X		errmsg(EWARN, "Unknown char 0%o in tchar0()", ch);
X		return "[UNKNOWN]";
X	}
X}
X
Xchar *
Xtchartos(c)
X	tchar c;
X{
X	/* use 2 buffers and alternate, so 2 calls to tchartos() OK.  Ugh. */
X	static char resultbuf0[20]; /* biggest case currently \h'32767' */
X	static char resultbuf1[20];
X	static char which = '0';
X
X	register char *p = (which == '0') ? resultbuf0 : resultbuf1;
X	char *resultbuf = p;
X
X	which ^= '0';
X	*p = '\0';
X
X	if (ismot(c)) {
X		if (isvmot(c)) {
X			(void) strcpy(p, tchar0(eschar));
X			while (*p) {
X				p++;
X			}
X			sprintf(p, "v'%d'", sbits(c));
X			return resultbuf;
X		} else {
X			return "[\\h or TAB]";
X		}
X	}
X
X	if (iszbit(c)) {
X		(void) strcat(p, tchar0(eschar));
X		*p++ = 'z';
X		*p = '\0';
X	}
X
X	if (cbits(c) > 128) { /* special char */
X		(void) strcpy(p, tchar0(eschar));
X		strcat(p, "(");
X		while (*p) {
X			p++;
X		}
X		(void) strcpy(p, &chname[chtab[cbits(c) - 128]]);
X		return resultbuf;
X	}
X
X	switch(cbits(c)) {
X
X	case 0:		return "[NUL]";
X	case IMP:	return "[IMP]";
X	case TAB:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "t");
X	case RPT:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "l");
X	case CHARHT:	(void) strcat(p, tchar0(eschar));
X			while (*p)
X				p++;
X			sprintf(p, "H'%d'", sbits(c));
X			return resultbuf;
X	case SLANT:	(void) strcat(p, tchar0(eschar));
X			while (*p)
X				p++;
X			sprintf(p, "S'%d'", sbits(c) - 180);
X			return resultbuf;
X	case 027:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, " ");	/* em-space */
X	case FONTPOS:	(void) strcat(p, tchar0(eschar));
X			while (*p)
X				p++;
X			*p++ = 'f';
X			if (((c>>16) >> BYTE) && ((c>>16) >> BYTE))
X				*p++ = '(';
X			*p++ =  (c>>16) & BMASK;
X			*p++ =  ((c>>16) >> BYTE);
X			*p++ =  '\0';
X			return resultbuf;
X	case DRAWFCN:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "D");
X	case LEFT:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "{");
X	case RIGHT:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "}");
X	case FILLER:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "&");
X	case OHC:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "%"); /*WRONG*/
X	case CONT:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "c");
X	case PRESC:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "e");
X	case XPAR:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, "!");
X	case FLSS:	return "[FLSS]";
X	case WORDSP:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, " ");
X	case ESC:	(void) strcat(p, tchar0(eschar));
X			return strcat(p, tchar0(eschar));
X
X	default:	return strcpy(p, tchar0(c));
X	}
X
X	/*NOTREACHED*/
X}
X#endif TCHARTOS
SHAR_EOF
if test 20607 -ne "`wc -c < 'local.c'`"
then
	echo shar: error transmitting "'local.c'" '(should have been 20607 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'local.h'" '(1174 characters)'
if test -f 'local.h'
then
	echo shar: will not over-write existing file "'local.h'"
else
sed 's/^X//' << \SHAR_EOF > 'local.h'
X#ifdef LOCALWARN
X/* lwarn.c::lwarn() printfs it's arguments as a warning message if
X * warninglevel & WARN_ALL; if warninglevel & WARN_ONCE, it just prints a
X * message the 1st time.
X *
X * REQ Sept. 86
X */
X#define WARN_ONCE	1
X#define WARN_ALL	2
X#endif LOCALWARN
X#ifdef REPORTERRS
X/* note that EWARN provides 2 arguments to a call to error.  One day the way
X * troff exits should be rationalised, and then EWARN would be a single value!
X */
X#define EWARN 0,0
Xextern int errno;
Xchar *realname();
Xvoid errmsg();
X
X/* flags for diffent kingds of error */
X/* these are OR'd together -- mostly used in atoi() */
X#define LERR_BADEXPSTART 01	/* no expression found */
X#define LERR_PSNUMWARN   02	/* "\s94 is a 9 point 4" msg enabled */
X#define LERR_WARNINGS	 04	/* no warnings at all if false */
X
X/* LERR_EVERYTHING is the result of ORing all of the LERR values together;
X * it's used to initialise the repoerterrs variable in local.h
X */
X#define LERR_EVERYTHING (LERR_BADEXPSTART|LERR_WARNINGS)
X/* let's not use LERR_PSNUMWARN for now! */
X#endif REPORTERRS
X#if defined(REPORTERRS) || defined(TCHARTOS)
Xextern char *strcpy();
Xextern char *strcat();
X#endif /* REPORTERRS||TCHARTOS */
SHAR_EOF
if test 1174 -ne "`wc -c < 'local.h'`"
then
	echo shar: error transmitting "'local.h'" '(should have been 1174 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
ARPA		req%uu.warwick.ac.uk@ucl-cs.arpa
EARN/BITNET	req%UK.AC.WARWICK.UU@AC.UK
JANET		req@uk.ac.warwick.uu
UUCP		seismo!mcvax!ukc!warwick!req  (req@warwick.UUCP)
PHONE		+44 203 523485
For mail.frplist, use "frplist" instead of "req" in the above lines.
The BITNET path only works from sites that have AC.UK in their tables.  Sorry.

req@warwick.UUCP (Russell Quin) (11/21/86)

See the article ``titroff/ditroff (1.0) enhancements and fixes: first part''
for details.  That is part one, this is part two, there are others, the last is
called ``last part''.

diffa, diffb, diffc and diffd should be concatenated (cat diff[abcd] > diffs)
and fed to patch.

Russell

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	diffa
# This archive created: Thu Nov 20 21:49:53 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'diffa'" '(48695 characters)'
if test -f 'diffa'
then
	echo shar: will not over-write existing file "'diffa'"
else
sed 's/^X//' << \SHAR_EOF > 'diffa'
Xdiff -rbc titroff/README /distribution/dwb/text/troff.d/README
X*** titroff/README	Fri Jul 16 22:27:13 1982
X--- /distribution/dwb/text/troff.d/README	Fri Sep  9 18:44:29 1983
X***************
X*** 1,5
X  
X! The troff in this directory (known as a.out)
X  is a troff that produces machine-independent output.
X  It requires a file of descriptive information about
X  the particular typesetter you have in mind, and produces
X
X--- 1,5 -----
X  
X! The troff in this directory
X  is a troff that produces machine-independent output.
X  It requires a file of descriptive information about
X  the particular typesetter you have in mind, and produces
X***************
X*** 6,13
X  output parameterized for that device.
X  
X  Thus:
X! 	a.out -T202 ...
X! produces output for the mergenthaler linotron 202.
X  (This is the default.)
X  
X  To make this work, one needs to create a set of
X
X--- 6,13 -----
X  output parameterized for that device.
X  
X  Thus:
X! 	troff -Taps ...
X! produces output for the Autologic APS-5.
X  (This is the default.)
X  
X  To make this work, one needs to create a set of
X***************
X*** 15,23
X  	/usr/lib/font/devxxx
X  where "xxx" is your device name.
X  Currently supported devices are
X! 	202	mergenthaler 202 using our software
X! 	aps	autologic aps5
X! 	cat	gsi cat (not really working at present)
X  
X  The file "DESC" contains information about the
X  device itself and the character set.  The file dev202/DESC
X
X--- 15,21 -----
X  	/usr/lib/font/devxxx
X  where "xxx" is your device name.
X  Currently supported devices are
X! 	aps	Autologic APS-5
X  
X  The file "DESC" contains information about the
X  device itself and the character set.  The file devaps/DESC
X***************
X*** 20,26
X  	cat	gsi cat (not really working at present)
X  
X  The file "DESC" contains information about the
X! device itself and the character set.  The file dev202/DESC
X  is a good example; follow the format closely.
X  
X  In addition, each font needs a description of its
X
X--- 18,24 -----
X  	aps	Autologic APS-5
X  
X  The file "DESC" contains information about the
X! device itself and the character set.  The file devaps/DESC
X  is a good example; follow the format closely.
X  
X  In addition, each font needs a description of its
X***************
X*** 25,31
X  
X  In addition, each font needs a description of its
X  characters, width and device-driving codes;
X! see dev202/R and S for typical examples.
X  
X  The program "makedev" will convert these text
X  descriptions into a binary form that the a.out can
X
X--- 23,29 -----
X  
X  In addition, each font needs a description of its
X  characters, width and device-driving codes;
X! see devaps/R and S for typical examples.
X  
X  The program "makedev" will convert these text
X  descriptions into a binary form that the troff can
X***************
X*** 28,34
X  see dev202/R and S for typical examples.
X  
X  The program "makedev" will convert these text
X! descriptions into a binary form that the a.out can
X  slurp up in a single gulp during initialization;
X  these wind up in dev202/DESC.out (which includes
X  default font info) and XX.out for info about font XX.
X
X--- 26,32 -----
X  see devaps/R and S for typical examples.
X  
X  The program "makedev" will convert these text
X! descriptions into a binary form that the troff can
X  slurp up in a single gulp during initialization;
X  these wind up in devaps/DESC.out (which includes
X  default font info) and XX.out for info about font XX.
X***************
X*** 30,36
X  The program "makedev" will convert these text
X  descriptions into a binary form that the a.out can
X  slurp up in a single gulp during initialization;
X! these wind up in dev202/DESC.out (which includes
X  default font info) and XX.out for info about font XX.
X  
X  The second half of the job is to write a post-processor
X
X--- 28,34 -----
X  The program "makedev" will convert these text
X  descriptions into a binary form that the troff can
X  slurp up in a single gulp during initialization;
X! these wind up in devaps/DESC.out (which includes
X  default font info) and XX.out for info about font XX.
X  
X  The second half of the job is to write a post-processor
X***************
X*** 34,40
X  default font info) and XX.out for info about font XX.
X  
X  The second half of the job is to write a post-processor
X! that converts the more or less machine-independent a.out
X  output into specific codes for your favorite typesetter.
X  d202.c is the driver for the 202;
X  it will serve as a useful prototype.  In particular,
X
X--- 32,38 -----
X  default font info) and XX.out for info about font XX.
X  
X  The second half of the job is to write a post-processor
X! that converts the more or less machine-independent troff
X  output into specific codes for your favorite typesetter.
X  daps.c is the driver for the APS-5;
X  it will serve as a useful prototype.  In particular,
X***************
X*** 36,42
X  The second half of the job is to write a post-processor
X  that converts the more or less machine-independent a.out
X  output into specific codes for your favorite typesetter.
X! d202.c is the driver for the 202;
X  it will serve as a useful prototype.  In particular,
X  it contains a precise description of the output language.
X  Other postprocessors are
X
X--- 34,40 -----
X  The second half of the job is to write a post-processor
X  that converts the more or less machine-independent troff
X  output into specific codes for your favorite typesetter.
X! daps.c is the driver for the APS-5;
X  it will serve as a useful prototype.  In particular,
X  it contains a precise description of the output language.
X  Other postprocessors are
X***************
X*** 40,47
X  it will serve as a useful prototype.  In particular,
X  it contains a precise description of the output language.
X  Other postprocessors are
X- 	daps	aps5
X- 	dcat	graphic systems CAT (not really up to date)
X  	tc	tektronix 4014
X  	hc	hp2621 (mainly for crude graphics)
X  	ta	prints ascii on ordinary terminals (crudely)
X
X--- 38,43 -----
X  it will serve as a useful prototype.  In particular,
X  it contains a precise description of the output language.
X  Other postprocessors are
X  	tc	tektronix 4014
X  	hc	hp2621 (mainly for crude graphics)
X  	ta	prints ascii on ordinary terminals (crudely)
X***************
X*** 45,52
X  	tc	tektronix 4014
X  	hc	hp2621 (mainly for crude graphics)
X  	ta	prints ascii on ordinary terminals (crudely)
X- 	dcan	driver for Imagen/Canon laser printer
X- 	d8400	untested driver for compugraphics 8400
X  
X  The 202 driver writes onto /dev/202 in the same way that
X  old troff writes on /dev/cat; to get its output on the std output,
X
X--- 41,46 -----
X  	tc	tektronix 4014
X  	hc	hp2621 (mainly for crude graphics)
X  	ta	prints ascii on ordinary terminals (crudely)
X  
X  The aps driver writes onto /dev/aps in the same way that
X  old troff writes on /dev/cat; to get its output on the std output,
X***************
X*** 48,54
X  	dcan	driver for Imagen/Canon laser printer
X  	d8400	untested driver for compugraphics 8400
X  
X! The 202 driver writes onto /dev/202 in the same way that
X  old troff writes on /dev/cat; to get its output on the std output,
X  use, e.g., d202 -t ... >file.
X  
X
X--- 42,48 -----
X  	hc	hp2621 (mainly for crude graphics)
X  	ta	prints ascii on ordinary terminals (crudely)
X  
X! The aps driver writes onto /dev/aps in the same way that
X  old troff writes on /dev/cat; to get its output on the std output,
X  use, e.g., daps -t ... >file.
X  
X***************
X*** 50,56
X  
X  The 202 driver writes onto /dev/202 in the same way that
X  old troff writes on /dev/cat; to get its output on the std output,
X! use, e.g., d202 -t ... >file.
X  
X  One can always simply run
X  	a.out
X
X--- 44,50 -----
X  
X  The aps driver writes onto /dev/aps in the same way that
X  old troff writes on /dev/cat; to get its output on the std output,
X! use, e.g., daps -t ... >file.
X  
X  One can always simply run
X  	troff
X***************
X*** 53,59
X  use, e.g., d202 -t ... >file.
X  
X  One can always simply run
X! 	a.out
X  and look at the output; it is guaranteed to be ascii text
X  and thus safe to edit, grep, etc.
X  (Since it is ascii, it is also guaranteed to be quite voluminous.)
X
X--- 47,53 -----
X  use, e.g., daps -t ... >file.
X  
X  One can always simply run
X! 	troff
X  and look at the output; it is guaranteed to be ascii text
X  and thus safe to edit, grep, etc.
X  (Since it is ascii, it is also guaranteed to be quite voluminous.)
X***************
X*** 57,86
X  and look at the output; it is guaranteed to be ascii text
X  and thus safe to edit, grep, etc.
X  (Since it is ascii, it is also guaranteed to be quite voluminous.)
X! On our system, /usr/bin/troff is actually a shell program
X! that detects -Txxx arguments;  the current default is 202.
X! 
X! Putting output codes into the font description files
X! seems like the right thing to do but I'm not happy yet.
X! Accordingly, the formats of any or all of the files
X! described here are subject to drastic change; hang loose.
X! 
X! To clear up one potential misapprehension, the code in this
X! directory has not been retrofitted to make an nroff. 
X! That would require major surgery, primarily on n6.c and n10.c.
X! 
X! As it says in the Unix warranty:
X! 	"There is no warranty of merchantability nor any warranty
X! 	of fitness for a particular purpose nor any other warranty,
X! 	either express or implied, as to the accuracy of the
X! 	enclosed materials or as to their suitability for any
X! 	particular purpose.  Accordingly, Bell Telephone
X! 	Laboratories assumes no responsibility for their use by the
X! 	recipient.   Further, Bell Laboratories assumes no obligation
X! 	to furnish any assistance of any kind whatsoever, or to
X! 	furnish any additional information or documentation."
X! 
X! Nevertheless, I will try to answer questions in cases of
X! dire necessity.  Suggestions and other comments would be appreciated.
X! 
X! Brian W. Kernighan
X
X--- 51,54 -----
X  and look at the output; it is guaranteed to be ascii text
X  and thus safe to edit, grep, etc.
X  (Since it is ascii, it is also guaranteed to be quite voluminous.)
X! SCCS @(#)README	1.3
Xdiff -rbc titroff/d.h /distribution/dwb/text/troff.d/d.h
X*** titroff/d.h	Sun Feb 21 15:07:44 1982
X--- /distribution/dwb/text/troff.d/d.h	Fri Sep  9 18:44:31 1983
X***************
X*** 1,2
X  struct d {filep op; int dnl,dimac,ditrap,ditf,alss,blss,nls,mkline,
X  		maxl,hnl,curd;} d[NDI], *dip;
X
X--- 1,3 -----
X+ /*      @(#)d.h	1.1     */
X  struct d {filep op; int dnl,dimac,ditrap,ditf,alss,blss,nls,mkline,
X  		maxl,hnl,curd;} d[NDI], *dip;
Xdiff -rbc titroff/dev.h /distribution/dwb/text/troff.d/dev.h
X*** titroff/dev.h	Mon Sep 15 22:29:14 1986
X--- /distribution/dwb/text/troff.d/dev.h	Fri Sep  9 18:44:35 1983
X***************
X*** 1,3
X  /*
X  	dev.h: characteristics of a typesetter
X  */
X
X--- 1,4 -----
X+ /*      @(#)dev.h	1.1     */
X  /*
X  	dev.h: characteristics of a typesetter
X  */
X***************
X*** 18,26
X  	short	lchname;	/* length of chname table */
X  	short	spare1;		/* in case of expansion */
X  	short	spare2;
X- #ifdef DESCHASNAME
X- 	char dname[10];		/* name of troff device (eg. APS, cat) */
X- #endif DESCHASNAME
X  };
X  
X  struct font {		/* characteristics of a font */
X
X--- 19,24 -----
X  	short	lchname;	/* length of chname table */
X  	short	spare1;		/* in case of expansion */
X  	short	spare2;
X  };
X  
X  struct font {		/* characteristics of a font */
Xdiff -rbc titroff/draw.c /distribution/dwb/text/troff.d/draw.c
X*** titroff/draw.c	Thu Mar 15 14:35:46 1984
X--- /distribution/dwb/text/troff.d/draw.c	Fri Sep  9 18:44:42 1983
X***************
X*** 1,3
X  #include	<stdio.h>
X  #include	<math.h>
X  #define	PI	3.141592654
X
X--- 1,4 -----
X+ /*      @(#)draw.c	1.1     */
X  #include	<stdio.h>
X  #include	<math.h>
X  #define	PI	3.141592654
Xdiff -rbc titroff/ext.h /distribution/dwb/text/troff.d/ext.h
X*** titroff/ext.h	Tue Nov 11 15:17:15 1986
X--- /distribution/dwb/text/troff.d/ext.h	Fri Sep  9 18:44:47 1983
X***************
X*** 1,3
X  extern	char	**argp;
X  extern	char	*chname;
X  extern	char	*eibuf;
X
X--- 1,4 -----
X+ /*      @(#)ext.h	1.1     */
X  extern	char	**argp;
X  extern	char	*chname;
X  extern	char	*eibuf;
X***************
X*** 10,15
X  extern	char	*unlkp;
X  extern	char	*xbufp;
X  extern	char	*xeibuf;
X  extern	char	codetab[];
X  extern	char	devname[];
X  extern	char	fontfile[];
X
X--- 11,17 -----
X  extern	char	*unlkp;
X  extern	char	*xbufp;
X  extern	char	*xeibuf;
X+ extern	char	cfname[NSO][NS];
X  extern	char	codetab[];
X  extern	char	devname[];
X  extern	char	fontfile[];
X***************
X*** 230,245
X  extern	tchar	oline[];
X  extern	tchar	rchar;
X  extern	tchar	word[];
X- #ifdef LOCALWARN
X- #ifdef WARNLEVELREG
X- /* warning level is taken from v.h instead -- v.wl --- req */
X- #else !WARNLEVELREG
X- extern	int	warninglevel;
X- #endif WARNLEVELREG
X- #endif LOCALWARN
X- #ifdef REPORTERRS
X- extern int	reporterrs;	/* < 0 means no warnings given */
X- #endif REPORTERRS
X- #ifdef TCHARTOS
X- extern char *tchartos();	/* gives a string representation of a tchar */
X- #endif TCHARTOS
X
X--- 232,234 -----
X  extern	tchar	oline[];
X  extern	tchar	rchar;
X  extern	tchar	word[];
XOnly in titroff: local.c
XOnly in titroff: local.h
Xdiff -rbc titroff/makedev.c /distribution/dwb/text/troff.d/makedev.c
X*** titroff/makedev.c	Mon Nov 10 21:09:29 1986
X--- /distribution/dwb/text/troff.d/makedev.c	Fri Sep  9 18:45:10 1983
X***************
X*** 1,3
X  /*
X    makedev:
X  	read text info about a particular device
X
X--- 1,4 -----
X+ /*      @(#)makedev.c	1.2     */
X  /*
X    makedev:
X  	read text info about a particular device
X***************
X*** 17,25
X  		creates files F.out.
X  
X  	DESC.out contains:
X- #ifdef DESCHASNAME
X- 	dev structure with fundamental sizes & typesetter name
X- #else !DESCHASNAME
X  	dev structure with fundamental sizes
X  #endif DESCHASNAME
X  	list of sizes (nsizes+1) terminated by 0, as short's
X
X--- 18,23 -----
X  		creates files F.out.
X  
X  	DESC.out contains:
X  	dev structure with fundamental sizes
X  	list of sizes (nsizes+1) terminated by 0, as short's
X  	indices of char names (nchtab * sizeof(short))
X***************
X*** 21,27
X  	dev structure with fundamental sizes & typesetter name
X  #else !DESCHASNAME
X  	dev structure with fundamental sizes
X- #endif DESCHASNAME
X  	list of sizes (nsizes+1) terminated by 0, as short's
X  	indices of char names (nchtab * sizeof(short))
X  	char names as hy\0em\0... (lchname)
X
X--- 19,24 -----
X  
X  	DESC.out contains:
X  	dev structure with fundamental sizes
X  	list of sizes (nsizes+1) terminated by 0, as short's
X  	indices of char names (nchtab * sizeof(short))
X  	char names as hy\0em\0... (lchname)
X***************
X*** 66,79
X  char	kern[FSIZE];	/* ascender+descender info */
X  char	code[FSIZE];	/* actual device codes for a physical font */
X  
X! #ifndef NFONT
X! #ifdef MOREPREFONTS
X! #define	NFONT	40	/* max number of default fonts */
X! /* would like to get this from tdef.h, but then have problems with stdio.. */
X! #else !MOREPREFONTS
X! #define	NFONT	10	/* max number of default fonts */
X! #endif MOREPREFONTS
X! #endif !NFONT
X  char	fname[NFONT][10];	/* temp space to hold default font names */
X  
X  int	fflag	= 0;	/* on if font table to be written */
X
X--- 63,69 -----
X  char	kern[FSIZE];	/* ascender+descender info */
X  char	code[FSIZE];	/* actual device codes for a physical font */
X  
X! #define	NFONT	60	/* max number of default fonts */
X  char	fname[NFONT][10];	/* temp space to hold default font names */
X  
X  int	fflag	= 0;	/* on if font table to be written */
X***************
X*** 86,93
X  	FILE *fin;
X  	char cmd[100], *p;
X  	int i, totfont, v;
X- #ifdef DESCHASNAME
X- 	char devname[10];
X  
X  	dev.dname[0] = dev.dname[1] = '\0';	/* paranoia */
X  #endif DESCHASNAME
X
X--- 76,81 -----
X  	FILE *fin;
X  	char cmd[100], *p;
X  	int i, totfont, v;
X  
X  	if ((fin = fopen("DESC", "r")) == NULL) {
X  		fprintf(stderr, "makedev: can't open %s\n", argv[1]);
X***************
X*** 89,97
X  #ifdef DESCHASNAME
X  	char devname[10];
X  
X- 	dev.dname[0] = dev.dname[1] = '\0';	/* paranoia */
X- #endif DESCHASNAME
X- 
X  	if ((fin = fopen("DESC", "r")) == NULL) {
X  		fprintf(stderr, "makedev: can't open %s\n", argv[1]);
X  		exit(1);
X
X--- 77,82 -----
X  	char cmd[100], *p;
X  	int i, totfont, v;
X  
X  	if ((fin = fopen("DESC", "r")) == NULL) {
X  		fprintf(stderr, "makedev: can't open %s\n", argv[1]);
X  		exit(1);
X***************
X*** 98,111
X  	}
X  	while (fscanf(fin, "%s", cmd) != EOF) {
X  		if (cmd[0] == '#')	/* comment */
X- #ifdef DESCHASNAME
X- 		{
X- 			if (strcmp(cmd, "##name") == 0) {
X- 				fscanf(fin, "%10s", dev.dname);
X- 				dev.dname[9] = '\0';
X- 				fprintf(stderr, "Makedev: DESC for %s\n",
X- 								dev.dname);
X- 			} else {
X  				skipline(fin);
X  			}
X  		}
X
X--- 83,88 -----
X  	}
X  	while (fscanf(fin, "%s", cmd) != EOF) {
X  		if (cmd[0] == '#')	/* comment */
X  			skipline(fin);
X  		else if (strcmp(cmd, "res") == 0) {
X  			fscanf(fin, "%hd", &dev.res);
X***************
X*** 107,117
X  								dev.dname);
X  			} else {
X  				skipline(fin);
X- 			}
X- 		}
X- #else !DESCHASNAME
X- 			skipline(fin);
X- #endif DESCHASNAME
X  		else if (strcmp(cmd, "res") == 0) {
X  			fscanf(fin, "%hd", &dev.res);
X  		} else if (strcmp(cmd, "hor") == 0) {
X
X--- 84,89 -----
X  	while (fscanf(fin, "%s", cmd) != EOF) {
X  		if (cmd[0] == '#')	/* comment */
X  			skipline(fin);
X  		else if (strcmp(cmd, "res") == 0) {
X  			fscanf(fin, "%hd", &dev.res);
X  		} else if (strcmp(cmd, "hor") == 0) {
X***************
X*** 153,164
X  			fprintf(stderr, "makedev: unknown command %s\n", cmd);
X  	}
X  	if (argc > 0 && strcmp(argv[1], "DESC") == 0) {
X- #ifdef DESCHASNAME
X- 		if (dev.dname[0] == '\0') {
X- 			fprintf(stderr, "makedev: no \"##name xxx\" entry in DESC\n");
X- 			exit(1);
X- 		}
X- #endif DESCHASNAME
X  		fdout = creat(fout, 0666);
X  		if (fdout < 0) {
X  			fprintf(stderr, "makedev: can't open %s\n", fout);
X
X--- 125,130 -----
X  			fprintf(stderr, "makedev: unknown command %s\n", cmd);
X  	}
X  	if (argc > 0 && strcmp(argv[1], "DESC") == 0) {
X  		fdout = creat(fout, 0666);
X  		if (fdout < 0) {
X  			fprintf(stderr, "makedev: can't open %s\n", fout);
X***************
X*** 249,260
X  				/* so leave previous values intact
X  				*/
X  				if (strlen(ch) == 1)	/* it's ascii */
X- 				{
X- #ifdef CHECKDESCFILES
X- 					if (fitab[i]) {
X- 						fprintf(stderr, "makedev: warning: duplicate entries for \"%s\"\n", ch);
X- 					}
X- #endif CHECKDESCFILES
X  					fitab[ch[0] - 32] = nw;	/* fitab origin omits non-graphics */
X  				}
X  				else {		/* it has a funny name */
X
X--- 215,220 -----
X  				/* so leave previous values intact
X  				*/
X  				if (strlen(ch) == 1)	/* it's ascii */
X  					fitab[ch[0] - 32] = nw;	/* fitab origin omits non-graphics */
X  				else {		/* it has a funny name */
X  					for (i = 0; i < dev.nchtab; i++)
X***************
X*** 256,262
X  					}
X  #endif CHECKDESCFILES
X  					fitab[ch[0] - 32] = nw;	/* fitab origin omits non-graphics */
X- 				}
X  				else {		/* it has a funny name */
X  					for (i = 0; i < dev.nchtab; i++)
X  						if (strcmp(&chname[chtab[i]], ch) == 0) {
X
X--- 216,221 -----
X  				*/
X  				if (strlen(ch) == 1)	/* it's ascii */
X  					fitab[ch[0] - 32] = nw;	/* fitab origin omits non-graphics */
X  				else {		/* it has a funny name */
X  					for (i = 0; i < dev.nchtab; i++)
X  						if (strcmp(&chname[chtab[i]], ch) == 0) {
X***************
X*** 260,270
X  				else {		/* it has a funny name */
X  					for (i = 0; i < dev.nchtab; i++)
X  						if (strcmp(&chname[chtab[i]], ch) == 0) {
X- #ifdef CHECKDESCFILES
X- 							if (fitab[i]) {
X- 								fprintf(stderr, "makedev: warning: duplicate entries for \"%s\"\n", ch);
X- 							}
X- #endif CHECKDESCFILES
X  							fitab[i + 128-32] = nw;	/* starts after the ascii */
X  							break;
X  						}
X
X--- 219,224 -----
X  				else {		/* it has a funny name */
X  					for (i = 0; i < dev.nchtab; i++)
X  						if (strcmp(&chname[chtab[i]], ch) == 0) {
X  							fitab[i + 128-32] = nw;	/* starts after the ascii */
X  							break;
X  						}
XOnly in titroff: makefile
Xdiff -rbc titroff/n1.c /distribution/dwb/text/troff.d/n1.c
X*** titroff/n1.c	Sat Nov 15 19:08:13 1986
X--- /distribution/dwb/text/troff.d/n1.c	Tue Oct 25 17:24:09 1983
X***************
X*** 1,3
X  #include <ctype.h>
X  #include <sys/types.h>
X  #include <sys/stat.h>
X
X--- 1,5 -----
X+ char xxxn1v[] = "@(#)n1.c	1.5";
X+ 
X  #include <ctype.h>
X  #include <sys/types.h>
X  #include <sys/stat.h>
X***************
X*** 2,10
X  #include <sys/types.h>
X  #include <sys/stat.h>
X  #include "tdef.h"
X- #ifdef BSD42
X- #include <sys/time.h>
X- #endif BSD42
X  extern
X  #include "d.h"
X  extern
X
X--- 4,9 -----
X  #include <sys/types.h>
X  #include <sys/stat.h>
X  #include "tdef.h"
X  extern
X  #include "d.h"
X  extern
X***************
X*** 28,39
X  
X  char	*sprintf();
X  tchar	inchar[LNSIZE], *pinchar = inchar;	/* XXX */
X- #ifdef COMMENT
X- /* ioff, ipl[] and offl[] are also used in local.c, where they're decalred
X-  * as extern.
X-  * - req
X-  */
X- #endif COMMENT
X  filep ipl[NSO];
X  long	offl[NSO];
X  long	ioff;
X
X--- 27,32 -----
X  
X  char	*sprintf();
X  tchar	inchar[LNSIZE], *pinchar = inchar;	/* XXX */
X  filep ipl[NSO];
X  long	offl[NSO];
X  long	ioff;
X***************
X*** 38,50
X  long	offl[NSO];
X  long	ioff;
X  char	*ttyp;
X! #ifdef USEFONTPATH
X! extern char *fontpath;	/* from t6.c */
X! #endif USEFONTPATH
X! 
X! #ifdef COMMENT
X! /* control table... rq is request name */
X! #endif COMMENT
X  extern struct contab {
X  	int	rq;
X  	union {
X
X--- 31,38 -----
X  long	offl[NSO];
X  long	ioff;
X  char	*ttyp;
X! char	cfname[NSO][NS] = "<standard input>";	/*file name stack*/
X! int	cfline[NSO];		/*input line count stack*/
X  extern struct contab {
X  	int	rq;
X  	union {
X***************
X*** 52,59
X  		unsigned	mx;
X  	} x;
X  } contab[NM];
X- #ifdef REPORTERRS
X- extern char *progname;
X  
X  #endif REPORTERRS
X  
X
X--- 40,45 -----
X  		unsigned	mx;
X  	} x;
X  } contab[NM];
X  
X  main(argc, argv)
X  int	argc;
X***************
X*** 55,62
X  #ifdef REPORTERRS
X  extern char *progname;
X  
X- #endif REPORTERRS
X- 
X  main(argc, argv)
X  int	argc;
X  char	**argv;
X
X--- 41,46 -----
X  	} x;
X  } contab[NM];
X  
X  main(argc, argv)
X  int	argc;
X  char	**argv;
X***************
X*** 78,91
X  	signal(SIGTERM, kcatch);
X  	oargc = argc;
X  	oargv = argv;
X- #ifdef REPORTERRS
X- 	/* save progname for local.c:errmsg() error reporting */
X- 	for (p = argv[0]; *p; p++)
X- 		;
X- 	while (p > *argv && *p != '/')
X- 		p--;
X- 	progname = (p && *p == '/') ? ++p : argv[0];
X- #endif REPORTERRS
X  	init0();
X  options:
X  #ifdef ENVIRONMENT
X
X--- 62,67 -----
X  	signal(SIGTERM, kcatch);
X  	oargc = argc;
X  	oargv = argv;
X  	init0();
X  options:
X  	while (--argc > 0 && (++argv)[0][0] == '-')
X***************
X*** 88,107
X  #endif REPORTERRS
X  	init0();
X  options:
X- #ifdef ENVIRONMENT
X- 	/* no point making nroff look at the ditroff DESC files... */
X- #ifndef NROFF
X-       {	extern char *getenv();
X- 	char *p = getenv("TYPESETTER");
X- 
X- 	if (p != (char *) 0) {
X- 		strcpy(devname, p);
X- 		dotT++;
X- 	}
X-       }
X- #endif NROFF
X- #endif ENVIRONMENT
X- 
X  	while (--argc > 0 && (++argv)[0][0] == '-')
X  		switch (argv[0][1]) {
X  
X
X--- 64,69 -----
X  	oargv = argv;
X  	init0();
X  options:
X  	while (--argc > 0 && (++argv)[0][0] == '-')
X  		switch (argv[0][1]) {
X  
X***************
X*** 105,125
X  	while (--argc > 0 && (++argv)[0][0] == '-')
X  		switch (argv[0][1]) {
X  
X- #ifdef LOCALWARN
X- #ifndef WARN_ALL
X- #include "local.h"
X- #endif WARN_ALL
X- 		case 'W':
X- 			/* print out warnings -- see local.h, local.c
X- 			 * --- REQ 16/9/86
X- 			 */
X- #ifdef WARNLEVELREG
X- 			v.wl = WARN_ALL;
X- #else !WARNLEVELREG
X- 			warninglevel = WARN_ALL;
X- #endif WARNLEVELREG
X- 			continue;
X- #endif LOCALWARN
X  		case 'F':	/* switch font tables from default */
X  			if (argv[0][2] != '\0') {
X  				strcpy(termtab, &argv[0][2]);
X
X--- 67,72 -----
X  	while (--argc > 0 && (++argv)[0][0] == '-')
X  		switch (argv[0][1]) {
X  
X  		case 'F':	/* switch font tables from default */
X  			if (argv[0][2] != '\0') {
X  				strcpy(termtab, &argv[0][2]);
X***************
X*** 124,132
X  			if (argv[0][2] != '\0') {
X  				strcpy(termtab, &argv[0][2]);
X  				strcpy(fontfile, &argv[0][2]);
X- #ifdef USEFONTPATH
X- 				fontpath = &argv[0][2];
X- #endif USEFONTPATH
X  			} else {
X  				argv++; argc--;
X  #ifdef NOOPTARGFIX
X
X--- 71,76 -----
X  			if (argv[0][2] != '\0') {
X  				strcpy(termtab, &argv[0][2]);
X  				strcpy(fontfile, &argv[0][2]);
X  			} else {
X  				argv++; argc--;
X  				strcpy(termtab, argv[0]);
X***************
X*** 129,151
X  #endif USEFONTPATH
X  			} else {
X  				argv++; argc--;
X- #ifdef NOOPTARGFIX
X- #ifdef REPORTERRS
X- 				if (argc <= 0) {
X- 					errmsg(done, 02,
X- 					"-F option must be followed by a %s",
X- #ifdef FONTFAMILIES
X- 							"font path"
X- #else !FONTFAMILIES
X- 							"directory name"
X- #endif FONTFAMILIES
X- 									);
X- #else !REPORTERRS
X- 					fprintf(stderr, "troff: -F needs an argument");
X- 					edone(02);
X- #endif REPORTERRS
X- #endif NOOPTARGFIX
X- 				}
X  				strcpy(termtab, argv[0]);
X  				strcpy(fontfile, argv[0]);
X  #ifdef USEFONTPATH
X
X--- 73,78 -----
X  				strcpy(fontfile, &argv[0][2]);
X  			} else {
X  				argv++; argc--;
X  				strcpy(termtab, argv[0]);
X  				strcpy(fontfile, argv[0]);
X  			}
X***************
X*** 148,156
X  				}
X  				strcpy(termtab, argv[0]);
X  				strcpy(fontfile, argv[0]);
X- #ifdef USEFONTPATH
X- 				fontpath = argv[0];
X- #endif USEFONTPATH
X  			}
X  			continue;
X  #ifdef COMMENT
X
X--- 75,80 -----
X  				argv++; argc--;
X  				strcpy(termtab, argv[0]);
X  				strcpy(fontfile, argv[0]);
X  			}
X  			continue;
X  		case 0:
X***************
X*** 153,161
X  #endif USEFONTPATH
X  			}
X  			continue;
X- #ifdef COMMENT
X- 		/* - : read stdin */
X- #endif COMMENT
X  		case 0:
X  			goto start;
X  #ifdef COMMENT
X
X--- 77,82 -----
X  				strcpy(fontfile, argv[0]);
X  			}
X  			continue;
X  		case 0:
X  			goto start;
X  		case 'i':
X***************
X*** 158,166
X  #endif COMMENT
X  		case 0:
X  			goto start;
X- #ifdef COMMENT
X- 		/* -i : read stdin after all i/p files have been exhausted */
X- #endif COMMENT
X  		case 'i':
X  			stdi++;
X  			continue;
X
X--- 79,84 -----
X  			continue;
X  		case 0:
X  			goto start;
X  		case 'i':
X  			stdi++;
X  			continue;
X***************
X*** 164,172
X  		case 'i':
X  			stdi++;
X  			continue;
X- #ifdef COMMENT
X- 		/* -q : simultaneous i/o mode of .rd */
X- #endif COMMENT
X  		case 'q':
X  			quiet++;
X  			if (gtty(0, &ttys) >= 0)
X
X--- 82,87 -----
X  		case 'i':
X  			stdi++;
X  			continue;
X  		case 'q':
X  			quiet++;
X  			if (gtty(0, &ttys) >= 0)
X***************
X*** 172,180
X  			if (gtty(0, &ttys) >= 0)
X  				ttysave = ttys.sg_flags;
X  			continue;
X- #ifdef COMMENT
X- 		/* -nM : 1st page to be numbered M */
X- #endif COMMENT
X  		case 'n':
X  			npn = ctoi(&argv[0][2]);
X  			continue;
X
X--- 87,92 -----
X  			if (gtty(0, &ttys) >= 0)
X  				ttysave = ttys.sg_flags;
X  			continue;
X  		case 'n':
X  			npn = ctoi(&argv[0][2]);
X  			continue;
X***************
X*** 182,192
X  			bdtab[3] = ctoi(&argv[0][2]);
X  			if (bdtab[3] < 0 || bdtab[3] > 50)
X  				bdtab[3] = 0;
X- #ifdef REPORTERRS
X- 			if (bdtab[3] == 0) {
X- 				errmsg(EWARN, "-u option must be followed by a number in the range 0 - 50; using 0");
X- 			}
X- #endif REPORTERRS
X  			continue;
X  #ifdef COMMENT
X  		/* -s -- stop every n pages */
X
X--- 94,99 -----
X  			bdtab[3] = ctoi(&argv[0][2]);
X  			if (bdtab[3] < 0 || bdtab[3] > 50)
X  				bdtab[3] = 0;
X  			continue;
X  		case 's':
X  			if (!(stop = ctoi(&argv[0][2])))
X***************
X*** 188,196
X  			}
X  #endif REPORTERRS
X  			continue;
X- #ifdef COMMENT
X- 		/* -s -- stop every n pages */
X- #endif COMMENT
X  		case 's':
X  			if (!(stop = ctoi(&argv[0][2])))
X  				stop++;
X
X--- 95,100 -----
X  			if (bdtab[3] < 0 || bdtab[3] > 50)
X  				bdtab[3] = 0;
X  			continue;
X  		case 's':
X  			if (!(stop = ctoi(&argv[0][2])))
X  				stop++;
X***************
X*** 195,203
X  			if (!(stop = ctoi(&argv[0][2])))
X  				stop++;
X  			continue;
X- #ifdef COMMENT
X- 		/* -rA=n --- set register A to n */
X- #endif COMMENT
X  		case 'r':
X  			eibuf = sprintf(ibuf+strlen(ibuf), ".nr %c %s\n",
X  				argv[0][2], &argv[0][3]);
X
X--- 99,104 -----
X  			if (!(stop = ctoi(&argv[0][2])))
X  				stop++;
X  			continue;
X  		case 'r':
X  			eibuf = sprintf(ibuf+strlen(ibuf), ".nr %c %s\n",
X  				argv[0][2], &argv[0][3]);
X***************
X*** 202,210
X  			eibuf = sprintf(ibuf+strlen(ibuf), ".nr %c %s\n",
X  				argv[0][2], &argv[0][3]);
X  			continue;
X! #ifdef COMMENT
X! 		/* -mxxx -- read macro package /usr/lib/tmac/tmac.xxx */ 
X! #endif COMMENT
X  		case 'm':
X  			p = &nextf[nfi];
X  			q = &argv[0][2];
X
X--- 103,109 -----
X  			eibuf = sprintf(ibuf+strlen(ibuf), ".nr %c %s\n",
X  				argv[0][2], &argv[0][3]);
X  			continue;
X! 		case 'c':
X  		case 'm':
X  			p = &nextf[nfi];
X  			q = &argv[0][2];
X***************
X*** 212,220
X  				;
X  			mflg++;
X  			continue;
X- #ifdef COMMENT
X- 		/* -opagelist */
X- #endif COMMENT
X  		case 'o':
X  			getpn(&argv[0][2]);
X  			continue;
X
X--- 111,116 -----
X  				;
X  			mflg++;
X  			continue;
X  		case 'o':
X  			getpn(&argv[0][2]);
X  			continue;
X***************
X*** 234,244
X  			continue;
X  #endif
X  #ifndef NROFF
X- #ifdef COMMENT
X- 		/* -Txxx -- read the DESC.out for typesetter xxx from
X- 		 * /usr/lib/troff/descs/devxxx
X- 		 */
X- #endif COMMENT
X  		case 'T':
X  			strcpy(devname, &argv[0][2]);
X  			dotT++;
X
X--- 130,135 -----
X  			continue;
X  #endif
X  #ifndef NROFF
X  		case 'T':
X  			strncpy(devname, &argv[0][2], 11);
X  			devname[11] = 0;	/*directory name is char[14]*/
X***************
X*** 240,246
X  		 */
X  #endif COMMENT
X  		case 'T':
X! 			strcpy(devname, &argv[0][2]);
X  			dotT++;
X  			continue;
X  #ifdef COMMENT
X
X--- 131,138 -----
X  #endif
X  #ifndef NROFF
X  		case 'T':
X! 			strncpy(devname, &argv[0][2], 11);
X! 			devname[11] = 0;	/*directory name is char[14]*/
X  			dotT++;
X  			continue;
X  		case 'z':
X***************
X*** 243,251
X  			strcpy(devname, &argv[0][2]);
X  			dotT++;
X  			continue;
X- #ifdef COMMENT
X- 		/* -z --- efficiently suppress output */
X- #endif COMMENT
X  		case 'z':
X  			no_out++;
X  #ifdef COMMENT
X
X--- 135,140 -----
X  			devname[11] = 0;	/*directory name is char[14]*/
X  			dotT++;
X  			continue;
X  		case 'z':
X  			no_out++;
X  		case 'a':
X***************
X*** 248,258
X  #endif COMMENT
X  		case 'z':
X  			no_out++;
X- #ifdef COMMENT
X- 		/* -a -- provide ascii approximation to o/p.  Doesn't seem
X- 		 * to work too well
X- 		 */
X- #endif COMMENT
X  		case 'a':
X  			ascii = 1;
X  			nofeed++;
X
X--- 137,142 -----
X  			continue;
X  		case 'z':
X  			no_out++;
X  		case 'a':
X  			ascii = 1;
X  			nofeed++;
X***************
X*** 258,266
X  			nofeed++;
X  		case 't':
X  			ptid = 1;
X- #ifdef COMMENT
X- 		/* -f --- suppress final page-throw? */
X- #endif COMMENT
X  			continue;
X  		case 'f':
X  			nofeed++;
X
X--- 142,147 -----
X  			nofeed++;
X  		case 't':
X  			ptid = 1;
X  			continue;
X  		case 'f':
X  			nofeed++;
X***************
X*** 270,284
X  			fprintf(stderr, "troff: unknown option %s\n", argv[0]);
X  			done(02);
X  		}
X- #ifndef NROFF
X- #ifdef USEFONTPATH
X- 	/*
X- 	if (fontpath && devname && *devname) {
X- 		sprintf(fontpath, FONTPATH, devname);
X- 	}
X- 	*/
X- #endif USEFONTPATH
X- #endif NROFF
X  
X  start:
X  	init1(oargv[0][0]);
X
X--- 151,156 -----
X  			fprintf(stderr, "troff: unknown option %s\n", argv[0]);
X  			done(02);
X  		}
X  
X  start:
X  	init1(oargv[0][0]);
X***************
X*** 298,306
X  	if (pendt)
X  		goto lt;
X  	if ((j = cbits(i)) == XPAR) {
X- #ifdef COMMENT
X- 		/* transparent mode line... */
X- #endif COMMENT
X  		copyf++;
X  		tflg++;
X  		while (cbits(i) != '\n')
X
X--- 170,175 -----
X  	if (pendt)
X  		goto lt;
X  	if ((j = cbits(i)) == XPAR) {
X  		copyf++;
X  		tflg++;
X  		while (cbits(i) != '\n')
X***************
X*** 310,318
X  		goto loop;
X  	}
X  	if (j == cc || j == c2) {
X- #ifdef COMMENT
X- 		/* macro request... */
X- #endif COMMENT
X  		if (j == c2)
X  			nb++;
X  #ifdef COMMENT
X
X--- 179,184 -----
X  		goto loop;
X  	}
X  	if (j == cc || j == c2) {
X  		if (j == c2)
X  			nb++;
X  		copyf++;
X***************
X*** 315,323
X  #endif COMMENT
X  		if (j == c2)
X  			nb++;
X- #ifdef COMMENT
X- 			/* suppress line-break */
X- #endif COMMENT
X  		copyf++;
X  #ifdef COMMENT
X  		/* read macro args in copy mode */
X
X--- 181,186 -----
X  	if (j == cc || j == c2) {
X  		if (j == c2)
X  			nb++;
X  		copyf++;
X  		while ((j = cbits(i = getch())) == ' ' || j == '\t')
X  			;
X***************
X*** 319,329
X  			/* suppress line-break */
X  #endif COMMENT
X  		copyf++;
X- #ifdef COMMENT
X- 		/* read macro args in copy mode */
X- 
X- 		/* skip blanks between . and macro-name */
X- #endif COMMENT
X  		while ((j = cbits(i = getch())) == ' ' || j == '\t')
X  			;
X  		ch = i;
X
X--- 182,187 -----
X  		if (j == c2)
X  			nb++;
X  		copyf++;
X  		while ((j = cbits(i = getch())) == ' ' || j == '\t')
X  			;
X  		ch = i;
X***************
X*** 352,363
X  }
X  
X  
X- #ifdef COMMENT
X- /* init0 is called once, before any args are parsed (except that progname is
X-  * defined)
X-  * - req
X-  */
X- #endif COMMENT
X  init0()
X  {
X  	eibuf = ibufp = ibuf;
X
X--- 210,215 -----
X  }
X  
X  
X  init0()
X  {
X  	eibuf = ibufp = ibuf;
X***************
X*** 363,371
X  	eibuf = ibufp = ibuf;
X  	ibuf[0] = 0;
X  	v.nl = -1;
X- #ifdef WARNLEVELREG
X- 	v.wl = WARN_ONCE;
X- #endif WARNLEVELREG
X  }
X  
X  
X
X--- 215,220 -----
X  	eibuf = ibufp = ibuf;
X  	ibuf[0] = 0;
X  	v.nl = -1;
X  }
X  
X  
X***************
X*** 369,379
X  }
X  
X  
X- #ifdef COMMENT
X- /* init1 is called once after the arguments have been parsed and before
X-  * main processing - req
X-  */
X- #endif COMMENT
X  init1(a)
X  char	a;
X  {
X
X--- 218,223 -----
X  }
X  
X  
X  init1(a)
X  char	a;
X  {
X***************
X*** 382,388
X  	register i;
X  
X  	p = mktemp("/usr/tmp/trtmpXXXXX");
X- #ifdef USEDOTFORTMPIFA
X  	if (a == 'a')
X  		p = &p[9];
X  #endif USEDOTFORTMPIFA
X
X--- 226,231 -----
X  	register i;
X  
X  	p = mktemp("/usr/tmp/trtmpXXXXX");
X  	if (a == 'a')
X  		p = &p[9];
X  	if ((close(creat(p, 0600))) < 0) {
X***************
X*** 385,399
X  #ifdef USEDOTFORTMPIFA
X  	if (a == 'a')
X  		p = &p[9];
X- #endif USEDOTFORTMPIFA
X- #ifdef COMMENT
X- 	/* i.e., if troff's name begins with "a", use the current directory
X- 	 * for tmp files.  The 9 refers to the string passed to mktemp.
X- 	 * Presumable this is for testing, when titroff is complied as
X- 	 * a.out
X- 	 * REQ
X- 	 */
X- #endif COMMENT
X  	if ((close(creat(p, 0600))) < 0) {
X  #ifdef REPORTERRS
X  		extern void exit();	/* ! */
X
X--- 228,233 -----
X  	p = mktemp("/usr/tmp/trtmpXXXXX");
X  	if (a == 'a')
X  		p = &p[9];
X  	if ((close(creat(p, 0600))) < 0) {
X  		fprintf(stderr, "troff: cannot create temp file.\n");
X  		exit(-1);
X***************
X*** 395,405
X  	 */
X  #endif COMMENT
X  	if ((close(creat(p, 0600))) < 0) {
X- #ifdef REPORTERRS
X- 		extern void exit();	/* ! */
X- 
X- 		errmsg(exit, -1, "cannot create temp file \"%s\"", p);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: cannot create temp file.\n");
X  		exit(-1);
X  #endif REPORTERRS
X
X--- 229,234 -----
X  	if (a == 'a')
X  		p = &p[9];
X  	if ((close(creat(p, 0600))) < 0) {
X  		fprintf(stderr, "troff: cannot create temp file.\n");
X  		exit(-1);
X  	}
X***************
X*** 402,408
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: cannot create temp file.\n");
X  		exit(-1);
X- #endif REPORTERRS
X  	}
X  	ibf = open(p, 2);
X  	unlkp = p;
X
X--- 231,236 -----
X  	if ((close(creat(p, 0600))) < 0) {
X  		fprintf(stderr, "troff: cannot create temp file.\n");
X  		exit(-1);
X  	}
X  	ibf = open(p, 2);
X  	unlkp = p;
X***************
X*** 412,422
X  }
X  
X  
X- #ifdef COMMENT
X- /* init2 is called once, after init1, and after saving arg[cv] in oarg[cv]
X-  * - req
X-  */
X- #endif COMMENT
X  init2()
X  {
X  	register i, j;
X
X--- 240,245 -----
X  }
X  
X  
X  init2()
X  {
X  	register i, j;
X***************
X*** 468,477
X  	long	tt;
X  	register i;
X  	static int ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
X- #ifdef BSD42
X- 	struct timeval t;
X- 	struct timezone tz;
X- #endif BSD42
X  
X  #ifdef BSD42
X  	gettimeofday(&t, &tz);
X
X--- 291,296 -----
X  	long	tt;
X  	register i;
X  	static int ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
X  
X  	time(&tt);
X  	tt -= 3600 * ZONE;	/* 5hrs for EST */
X***************
X*** 473,483
X  	struct timezone tz;
X  #endif BSD42
X  
X- #ifdef BSD42
X- 	gettimeofday(&t, &tz);
X- 	t.tv_sec -+ 60 * tz.tz_minuteswest;	/* 0 for GMT, 5h for EST */
X- 	v.dy = (t.tv_sec/86400L) + 1;		/* day of the year */
X- #else !BSD42
X  	time(&tt);
X  	tt -= 3600 * ZONE;	/* 5hrs for EST */
X  	v.dy = (tt / 86400L) + 1;
X
X--- 292,297 -----
X  	register i;
X  	static int ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
X  
X  	time(&tt);
X  	tt -= 3600 * ZONE;	/* 5hrs for EST */
X  	v.dy = (tt / 86400L) + 1;
X***************
X*** 481,487
X  	time(&tt);
X  	tt -= 3600 * ZONE;	/* 5hrs for EST */
X  	v.dy = (tt / 86400L) + 1;
X- #endif BSD42
X  	v.dw = (v.dy + 3) % 7 + 1;
X  	for (v.yr = 70; ; v.yr++) {
X  		if ((v.yr) % 4)
X
X--- 295,300 -----
X  	time(&tt);
X  	tt -= 3600 * ZONE;	/* 5hrs for EST */
X  	v.dy = (tt / 86400L) + 1;
X  	v.dw = (v.dy + 3) % 7 + 1;
X  	for (v.yr = 70; ; v.yr++) {
X  		if ((v.yr) % 4)
X***************
X*** 694,702
X  register int	a, b;
X  {
X  	register int	j;
X- #ifdef BUILTINCONTROLFIX
X- 	int i = 0;
X- #endif BUILTINCONTROLFIX
X  
X  	if (a == 0 || (j = findmn(a)) == -1)
X  #ifdef REPORTERRS
X
X--- 507,512 -----
X  register int	a, b;
X  {
X  	register int	j;
X  
X  	if (a == 0 || (j = findmn(a)) == -1)
X  		return(0);
X***************
X*** 699,712
X  #endif BUILTINCONTROLFIX
X  
X  	if (a == 0 || (j = findmn(a)) == -1)
X- #ifdef REPORTERRS
X- 	{
X- 		extern char *realname();  /* defined in local.c */
X- 
X- 		if (a && a != PAIR(RIGHT, 0)) {
X- 			errmsg(EWARN, "Call to unknown macro (%s) ignored",
X- 								realname(a));
X- 		}
X  		return(0);
X  	}
X  #else !REPORTERRS
X
X--- 509,514 -----
X  	register int	j;
X  
X  	if (a == 0 || (j = findmn(a)) == -1)
X  		return(0);
X  	if (contab[j].rq & MMASK) {
X  		nxf->nargs = 0;
X***************
X*** 708,717
X  								realname(a));
X  		}
X  		return(0);
X- 	}
X- #else !REPORTERRS
X- 		return(0);
X- #endif REPORTERRS
X  	if (contab[j].rq & MMASK) {
X  		nxf->nargs = 0;
X  #ifdef BUILTINCONTROLFIX
X
X--- 510,515 -----
X  
X  	if (a == 0 || (j = findmn(a)) == -1)
X  		return(0);
X  	if (contab[j].rq & MMASK) {
X  		nxf->nargs = 0;
X  		if (b)
X***************
X*** 714,722
X  #endif REPORTERRS
X  	if (contab[j].rq & MMASK) {
X  		nxf->nargs = 0;
X- #ifdef BUILTINCONTROLFIX
X- 		if (b > 0)
X- #else !BUILTINCONTROLFIX
X  		if (b)
X  #endif BUILTINCONTROLFIX
X  			collect();
X
X--- 512,517 -----
X  		return(0);
X  	if (contab[j].rq & MMASK) {
X  		nxf->nargs = 0;
X  		if (b)
X  			collect();
X  		flushi();
X***************
X*** 718,724
X  		if (b > 0)
X  #else !BUILTINCONTROLFIX
X  		if (b)
X- #endif BUILTINCONTROLFIX
X  			collect();
X  		flushi();
X  		return(pushi((filep)contab[j].x.mx));
X
X--- 513,518 -----
X  	if (contab[j].rq & MMASK) {
X  		nxf->nargs = 0;
X  		if (b)
X  			collect();
X  		flushi();
X  		return(pushi((filep)contab[j].x.mx));
X***************
X*** 723,740
X  		flushi();
X  		return(pushi((filep)contab[j].x.mx));
X  	} else if (b)
X- #ifdef BUILTINCONTROLFIX
X- 	{
X- 		if (b < 0) {
X- 			/* don't want built-in macro to read input */
X- 			/* this is from callsp() in n7.c */
X- 			if (flss)
X- 				i = flss; 
X- 			else 
X- 				i = lss;
X- 			flss = 0;
X- 			return((*contab[j].x.f)(i));
X- 		} else {
X  			return((*contab[j].x.f)(0));
X  		}
X  	}
X
X--- 517,522 -----
X  		flushi();
X  		return(pushi((filep)contab[j].x.mx));
X  	} else if (b)
X  		return((*contab[j].x.f)(0));
X  	else
X  		return(0);
X***************
X*** 736,746
X  			return((*contab[j].x.f)(i));
X  		} else {
X  			return((*contab[j].x.f)(0));
X- 		}
X- 	}
X- #else !BUILTINCONTROLFIX
X- 		return((*contab[j].x.f)(0));
X- #endif BUILTINCONTROLFIX
X  	else
X  		return(0);
X  }
X
X--- 518,523 -----
X  		return(pushi((filep)contab[j].x.mx));
X  	} else if (b)
X  		return((*contab[j].x.f)(0));
X  	else
X  		return(0);
X  }
X***************
X*** 763,771
X  	register int	k;
X  	tchar i, j;
X  	tchar setht(), setslant();
X- #ifdef REPORTERRS
X- 	static int leftcount = 0;	/* how many more \{ than \} in input */
X- #endif REPORTERRS
X  
X  	level++;
X  g0:
X
X--- 540,545 -----
X  	register int	k;
X  	tchar i, j;
X  	tchar setht(), setslant();
X  
X  	level++;
X  g0:
X***************
X*** 825,837
X  	switch (k) {
X  
X  	case '\n':	/* concealed newline */
X- #ifdef LINENUMFIX
X- 		/* current input line in this file */
X- 		if (ip == 0) {
X- 			/* reading from file rather than macro */
X- 			v.cd++;
X- 		}
X- #endif LINENUMFIX
X  		goto g0;
X  	case 'n':	/* number register */
X  		setn();
X
X--- 599,604 -----
X  	switch (k) {
X  
X  	case '\n':	/* concealed newline */
X  		goto g0;
X  	case 'n':	/* number register */
X  		setn();
X***************
X*** 844,852
X  		goto g0;
X  	case '{':	/* LEFT */
X  		i = LEFT;
X- #ifdef REPORTERRS
X- 		leftcount++;
X- #endif REPORTERRS
X  		goto gx;
X  	case '}':	/* RIGHT */
X  		i = RIGHT;
X
X--- 611,616 -----
X  		goto g0;
X  	case '{':	/* LEFT */
X  		i = LEFT;
X  		goto gx;
X  	case '}':	/* RIGHT */
X  		i = RIGHT;
X***************
X*** 850,861
X  		goto gx;
X  	case '}':	/* RIGHT */
X  		i = RIGHT;
X- #ifdef REPORTERRS
X- 		if (--leftcount < 0) {
X- 			errmsg(EWARN, "\\} without a matching \\{");
X- 			leftcount = 0;
X- 		}
X- #endif REPORTERRS
X  		goto gx;
X  	case '"':	/* comment */
X  		while (cbits(i = getch0()) != '\n')
X
X--- 614,619 -----
X  		goto gx;
X  	case '}':	/* RIGHT */
X  		i = RIGHT;
X  		goto gx;
X  	case '"':	/* comment */
X  		while (cbits(i = getch0()) != '\n')
X***************
X*** 934,947
X  		case 'S':	/* slant */
X  			i = setslant();
X  			break;
X- #ifdef ANYBASESTR
X- 		case 'R':	/* \R'drawing function'string' --
X- 				 * use 'drawing function' as baseline for text
X- 				 * - req
X- 				 */
X- 			i = setbasestr();
X- 			break;
X- #endif ANYBASESTR
X  		case 'f':	/* font indicator */
X  			setfont(0);
X  			goto g0;
X
X--- 692,697 -----
X  		case 'S':	/* slant */
X  			i = setslant();
X  			break;
X  		case 'f':	/* font indicator */
X  			setfont(0);
X  			goto g0;
X***************
X*** 978,988
X  			if ((k = findr(getsn())) != -1) {
X  				vlist[k] = v.hp = sumhp();
X  			}
X- #ifdef REPORTERRS
X- 			else {
X- 				errmsg(EWARN, "\\k must be follwed by a valid number register name");
X- 			}
X- #endif REPORTERRS
X  			goto g0;
X  		case '0':	/* number space */
X  			i = makem(width('0' | chbits));
X
X--- 728,733 -----
X  			if ((k = findr(getsn())) != -1) {
X  				vlist[k] = v.hp = sumhp();
X  			}
X  			goto g0;
X  		case '0':	/* number space */
X  			i = makem(width('0' | chbits));
X***************
X*** 998,1006
X  			break;
X  		default:
X  			i = j;
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "Unknown inline escape \"\\%s\"", tchartos(j));
X- #endif REPORTERRS
X  		}
X  	else {
X  		ch0 = j;
X
X--- 743,748 -----
X  			break;
X  		default:
X  			i = j;
X  		}
X  	else {
X  		ch0 = j;
X***************
X*** 1056,1078
X  		return(rchar);
X  	}
X  
X- #ifdef COMMENT
X- 	/* this is where input push-back is done for number registers,
X- 	 * strings, macros & diversions.
X- 	 * For a number register, \n(xx is expanded into cbuf[], and cp is
X- 	 * set equal to cbuf.
X- 	 *
X- 	 * for macro arguments and strings, ap is used (Arg Pointer ?);
X- 	 *
X- 	 * for macros and diversions, ip is set.
X- 	 *
X- 	 * For single-char push-back, ch is set (all over the place!) --
X- 	 * this is used at the start of getch()
X- 	 *
X- 	 * -- req
X- 	 *
X- 	 */
X- #endif COMMENT
X  again:
X  	if (cp) {
X  		if ((i = *cp++) == 0) {
X
X--- 798,803 -----
X  		return(rchar);
X  	}
X  
X  again:
X  	if (cp) {
X  		if ((i = *cp++) == 0) {
X***************
X*** 1158,1163
X  n1:
X  	if ((p[0] == '-') && (p[1] == 0)) {
X  		ifile = 0;
X  	} else if ((ifile = open(p, 0)) < 0) {
X  		fprintf(stderr, "troff: cannot open %s\n", p);
X  		nfo -= mflg;
X
X--- 883,889 -----
X  n1:
X  	if ((p[0] == '-') && (p[1] == 0)) {
X  		ifile = 0;
X+ 		strcpy(cfname[ifi],"<standard input>");
X  	} else if ((ifile = open(p, 0)) < 0) {
X  		fprintf(stderr, "troff: cannot open %s\n", p);
X  		nfo -= mflg;
X***************
X*** 1162,1168
X  		fprintf(stderr, "troff: cannot open %s\n", p);
X  		nfo -= mflg;
X  		done(02);
X! 	}
X  	nfo++;
X  	v.cd = 0;
X  	ioff = 0;
X
X--- 888,895 -----
X  		fprintf(stderr, "troff: cannot open %s\n", p);
X  		nfo -= mflg;
X  		done(02);
X! 	} else
X! 		strcpy(cfname[ifi],p);
X  	nfo++;
X  	v.cd = 0;
X  	ioff = 0;
X***************
X*** 1166,1191
X  	nfo++;
X  	v.cd = 0;
X  	ioff = 0;
X- #ifdef REPORTERRS
X- 	{
X- 		extern char *ifilename;
X- 
X- 		/* set the filename so that local.c:errmsg() can use it */
X- 
X- 		ifilename = p;
X- 		if (! strcmp(p, "-")) {
X- 			ifilename = "stdin";
X- 		}
X- 		/* potential bug if the storage for nextf that p points to
X- 		 * doesn't persist.  But as far as I can see it does.  Don't
X- 		 * really want to invent a fixed-sized buffer.  If I get time,
X- 		 * though, there will be a troff string that will contain
X- 		 * the filename, and then storage won't be a problem.
X- 		 * --- req, 6/10/86
X- 		 */
X- 		 /* BUG2: no easy way to change progname on a .so */
X- 	}
X- #endif REPORTERRS
X  	return(0);
X  n2:
X  	if ((nfo -= mflg) && !stdi)
X
X--- 893,898 -----
X  	nfo++;
X  	v.cd = 0;
X  	ioff = 0;
X  	return(0);
X  n2:
X  	if ((nfo -= mflg) && !stdi)
X***************
X*** 1192,1197
X  		done(0);
X  	nfo++;
X  	v.cd = ifile = stdi = mflg = 0;
X  	ioff = 0;
X  	return(0);
X  }
X
X--- 899,905 -----
X  		done(0);
X  	nfo++;
X  	v.cd = ifile = stdi = mflg = 0;
X+ 	strcpy(cfname[ifi],"<standard input>");
X  	ioff = 0;
X  	return(0);
X  }
X***************
X*** 1204,1209
X  	extern char	*ttyname();
X  
X  	ioff = offl[--ifi];
X  	ip = ipl[ifi];
X  	if ((ifile = ifl[ifi]) == 0) {
X  		p = xbuf;
X
X--- 912,918 -----
X  	extern char	*ttyname();
X  
X  	ioff = offl[--ifi];
X+ 	v.cd = cfline[ifi];		/*restore line counter*/
X  	ip = ipl[ifi];
X  	if ((ifile = ifl[ifi]) == 0) {
X  		p = xbuf;
X***************
X*** 1302,1318
X  
X  	lgf++;
X  	nextf[0] = 0;
X- #ifdef FONTFAMILIES
X- 	if (skip() || !getname()) {
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, "Call to .so with no arguments ignored");
X- #else !REPORTERRS
X- 		fprintf(stderr, "troff: Call to .so with no args ignored");
X- #endif REPORTERRS
X- 		return 0;
X- 	}
X- 	dosofile(".so");
X- #else !FONTFAMILIES
X  	if (skip() || !getname() || ((i = open(nextf, 0)) < 0) || (ifi >= NSO)) {
X  #ifdef REPORTERRS
X  		errmsg(done, 02, ".so: can't open file %s", nextf);
X
X--- 1011,1016 -----
X  
X  	lgf++;
X  	nextf[0] = 0;
X  	if (skip() || !getname() || ((i = open(nextf, 0)) < 0) || (ifi >= NSO)) {
X  		fprintf(stderr, "troff: can't open file %s\n", nextf);
X  		done(02);
X***************
X*** 1314,1322
X  	dosofile(".so");
X  #else !FONTFAMILIES
X  	if (skip() || !getname() || ((i = open(nextf, 0)) < 0) || (ifi >= NSO)) {
X- #ifdef REPORTERRS
X- 		errmsg(done, 02, ".so: can't open file %s", nextf);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: can't open file %s\n", nextf);
X  		done(02);
X  #endif REPORTERRS
X
X--- 1012,1017 -----
X  	lgf++;
X  	nextf[0] = 0;
X  	if (skip() || !getname() || ((i = open(nextf, 0)) < 0) || (ifi >= NSO)) {
X  		fprintf(stderr, "troff: can't open file %s\n", nextf);
X  		done(02);
X  	}
X***************
X*** 1319,1325
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: can't open file %s\n", nextf);
X  		done(02);
X- #endif REPORTERRS
X  	}
X  	flushi();
X  	ifl[ifi] = ifile;
X
X--- 1014,1019 -----
X  	if (skip() || !getname() || ((i = open(nextf, 0)) < 0) || (ifi >= NSO)) {
X  		fprintf(stderr, "troff: can't open file %s\n", nextf);
X  		done(02);
X  	}
X  	strcpy(cfname[ifi+1], nextf);
X  	cfline[ifi] = v.cd;		/*hold line counter*/
X***************
X*** 1321,1326
X  		done(02);
X  #endif REPORTERRS
X  	}
X  	flushi();
X  	ifl[ifi] = ifile;
X  	ifile = i;
X
X--- 1015,1023 -----
X  		fprintf(stderr, "troff: can't open file %s\n", nextf);
X  		done(02);
X  	}
X+ 	strcpy(cfname[ifi+1], nextf);
X+ 	cfline[ifi] = v.cd;		/*hold line counter*/
X+ 	v.cd = 0;
X  	flushi();
X  	ifl[ifi] = ifile;
X  	ifile = i;
X***************
X*** 1338,1344
X  		while (p < eibuf)
X  			*q++ = *p++;
X  	}
X- #endif FONTFAMILIES
X  }
X  
X  
X
X--- 1035,1040 -----
X  		while (p < eibuf)
X  			*q++ = *p++;
X  	}
X  }
X  
X  
X***************
X*** 1393,1401
X  	register int n, neg;
X  
X  	if (*a == 0)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "-o: usage is -oLIST; no LIST of pagenumbers found");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 1089,1094 -----
X  	register int n, neg;
X  
X  	if (*a == 0)
X  		return;
X  	neg = 0;
X  	for ( ; *a; a++)
X***************
X*** 1397,1406
X  	{
X  		errmsg(EWARN, "-o: usage is -oLIST; no LIST of pagenumbers found");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	neg = 0;
X  	for ( ; *a; a++)
X  		switch (*a) {
X
X--- 1090,1095 -----
X  
X  	if (*a == 0)
X  		return;
X  	neg = 0;
X  	for ( ; *a; a++)
X  		switch (*a) {
X***************
X*** 1422,1430
X  			*pnp++ = neg ? -n : n;
X  			neg = 0;
X  			if (pnp >= &pnlist[NPN-2]) {
X- #ifdef REPORTERRS
X- 				errmsg(done2, -3, "too many pagenumbers (maximum is %d)", NPN);
X- #else !REPORTERRS
X  				fprintf(stderr, "troff: too many page numbers\n");
X  				done3(-3);
X  #endif REPORTERRS
X
X--- 1111,1116 -----
X  			*pnp++ = neg ? -n : n;
X  			neg = 0;
X  			if (pnp >= &pnlist[NPN-2]) {
X  				fprintf(stderr, "troff: too many page numbers\n");
X  				done3(-3);
X  			}
X***************
X*** 1427,1433
X  #else !REPORTERRS
X  				fprintf(stderr, "troff: too many page numbers\n");
X  				done3(-3);
X- #endif REPORTERRS
X  			}
X  		}
X  	if (neg)
X
X--- 1113,1118 -----
X  			if (pnp >= &pnlist[NPN-2]) {
X  				fprintf(stderr, "troff: too many page numbers\n");
X  				done3(-3);
X  			}
X  		}
X  	if (neg)
XOnly in titroff: n10.c
SHAR_EOF
if test 48695 -ne "`wc -c < 'diffa'`"
then
	echo shar: error transmitting "'diffa'" '(should have been 48695 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
ARPA		req%uu.warwick.ac.uk@ucl-cs.arpa
EARN/BITNET	req%UK.AC.WARWICK.UU@AC.UK
JANET		req@uk.ac.warwick.uu
UUCP		seismo!mcvax!ukc!warwick!req  (req@warwick.UUCP)
PHONE		+44 203 523485
For mail.frplist, use "frplist" instead of "req" in the above lines.
The BITNET path only works from sites that have AC.UK in their tables.  Sorry.

req@warwick.UUCP (Russell Quin) (11/21/86)

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	diffb
# This archive created: Thu Nov 20 21:49:58 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'diffb'" '(42764 characters)'
if test -f 'diffb'
then
	echo shar: will not over-write existing file "'diffb'"
else
sed 's/^X//' << \SHAR_EOF > 'diffb'
Xdiff -rbc titroff/n2.c /distribution/dwb/text/troff.d/n2.c
X*** titroff/n2.c	Mon Nov 10 23:05:39 1986
X--- /distribution/dwb/text/troff.d/n2.c	Fri Sep  9 18:45:21 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  #include <sgtty.h>
X  extern
X
X--- 1,4 -----
X+ /*	@(#)n2.c	1.2	*/
X  #include "tdef.h"
X  #include <sgtty.h>
X  extern
X***************
X*** 92,98
X  			oput(' ');
X  			return;
X  		}
X! 		if (j < 0177) {
X  			oput(j);
X  			return;
X  		}
X
X--- 93,99 -----
X  			oput(' ');
X  			return;
X  		}
X! 		if (j < 0177 && j != WORDSP) {
X  			oput(j);
X  			return;
X  		}
X***************
X*** 164,186
X  			}
X  #endif
X  		}
X- #ifdef TOOLATEFIX
X- 		/* integer overflow seems unlikely, but could be 
X- 		 * a little unfortunate in the *very* rare case that a
X- 		 * .po happened at exactly the wrong time...
X- 		 * Doing the stty twice would be bad, too, though
X- 		 * While we're about it, let's check the write, too.
X- 		 * though I don't know what to do if it fails!
X- 		 */
X- 		toolate = write(ptid, obuf, obufp - obuf);
X- 		if (toolate != obufp - obuf) {
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "Write failed, errno = %d", errno);
X- #endif REPORTERRS
X- 			/* do something, I suppose.  Like ignore it */
X- 		}
X- 		toolate = 1;
X- #else !TOOLATEFIX
X  		toolate += write(ptid, obuf, obufp - obuf);
X  #endif TOOLATEFIX
X  	}
X
X--- 165,170 -----
X  			}
X  #endif
X  		}
X  		toolate += write(ptid, obuf, obufp - obuf);
X  	}
X  	obufp = obuf;
X***************
X*** 182,188
X  		toolate = 1;
X  #else !TOOLATEFIX
X  		toolate += write(ptid, obuf, obufp - obuf);
X- #endif TOOLATEFIX
X  	}
X  	obufp = obuf;
X  }
X
X--- 166,171 -----
X  #endif
X  		}
X  		toolate += write(ptid, obuf, obufp - obuf);
X  	}
X  	obufp = obuf;
X  }
X***************
X*** 188,196
X  }
X  
X  
X- #ifdef LINTSTUFF
X- void
X- #endif LINTSTUFF
X  done(x) 
X  int	x;
X  {
X
X--- 171,176 -----
X  }
X  
X  
X  done(x) 
X  int	x;
X  {
X***************
X*** 205,216
X  		if (control(i, 0))
X  			longjmp(sjbuf, 1);
X  	}
X- #ifdef REPORTERRS
X- 	if (dilev) {
X- 		errmsg(EWARN, "End of File unexpected whilst diverting to %s",
X- 				realname(dip->curd));
X- 	}
X- #endif REPORTERRS
X  	if (!nfo)
X  		done3(0);
X  	mflg = 0;
X
X--- 185,190 -----
X  		if (control(i, 0))
X  			longjmp(sjbuf, 1);
X  	}
X  	if (!nfo)
X  		done3(0);
X  	mflg = 0;
X***************
X*** 234,242
X  }
X  
X  
X- #ifdef LINTSTUFF
X- void
X- #endif LINTSTUFF
X  done1(x) 
X  int	x; 
X  {
X
X--- 208,213 -----
X  }
X  
X  
X  done1(x) 
X  int	x; 
X  {
X***************
X*** 258,266
X  }
X  
X  
X- #ifdef LINTSTUFF
X- void
X- #endif LINTSTUFF
X  done2(x) 
X  int	x; 
X  {
X
X--- 229,234 -----
X  }
X  
X  
X  done2(x) 
X  int	x; 
X  {
X***************
X*** 273,287
X  	done3(x);
X  }
X  
X- #ifdef COMMENT
X- /* done3() seems to be the thing to call on a fatal error, as it does the
X-  * least afterwords.
X-  * -- req
X-  */
X- #endif COMMENT
X- #ifdef LINTSTUFF
X- void
X- #endif LINTSTUFF
X  done3(x) 
X  int	x;
X  {
X
X--- 241,246 -----
X  	done3(x);
X  }
X  
X  done3(x) 
X  int	x;
X  {
X***************
X*** 302,310
X  }
X  
X  
X- #ifdef LINTSTUFF
X- void
X- #endif LINTSTUFF
X  edone(x) 
X  int	x;
X  {
X
X--- 261,266 -----
X  }
X  
X  
X  edone(x) 
X  int	x;
X  {
X***************
X*** 322,330
X  	int	id[2];
X  
X  	if (toolate || skip() || !getname() || pipe(id) == -1 || (i = fork()) == -1) {
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, ".pi: too late for pipe; not created");
X- #else !REPORTERRS
X  		fprintf(stderr, "Pipe not created.\n");
X  #endif REPORTERRS
X  		return;
X
X--- 278,283 -----
X  	int	id[2];
X  
X  	if (toolate || skip() || !getname() || pipe(id) == -1 || (i = fork()) == -1) {
X  		fprintf(stderr, "Pipe not created.\n");
X  		return;
X  	}
X***************
X*** 326,332
X  		errmsg(EWARN, ".pi: too late for pipe; not created");
X  #else !REPORTERRS
X  		fprintf(stderr, "Pipe not created.\n");
X- #endif REPORTERRS
X  		return;
X  	}
X  	ptid = id[1];
X
X--- 279,284 -----
X  
X  	if (toolate || skip() || !getname() || pipe(id) == -1 || (i = fork()) == -1) {
X  		fprintf(stderr, "Pipe not created.\n");
X  		return;
X  	}
X  	ptid = id[1];
X***************
X*** 340,348
X  	dup(id[0]);
X  	close(id[1]);
X  	execl(nextf, nextf, 0);
X- #ifdef REPORTERRS
X- 	errmsg(exit, -4, ".pi: cannot exec %s (errno = %d)", nextf, errno);
X- #else !REPORTERRS
X  	fprintf(stderr, "Cannot exec %s\n", nextf);
X  	exit(-4);
X  #endif REPORTERRS
X
X--- 292,297 -----
X  	dup(id[0]);
X  	close(id[1]);
X  	execl(nextf, nextf, 0);
X  	fprintf(stderr, "Cannot exec %s\n", nextf);
X  	exit(-4);
X  }
X***************
X*** 345,349
X  #else !REPORTERRS
X  	fprintf(stderr, "Cannot exec %s\n", nextf);
X  	exit(-4);
X- #endif REPORTERRS
X  }
X
X--- 294,297 -----
X  	execl(nextf, nextf, 0);
X  	fprintf(stderr, "Cannot exec %s\n", nextf);
X  	exit(-4);
X  }
Xdiff -rbc titroff/n3.c /distribution/dwb/text/troff.d/n3.c
X*** titroff/n3.c	Tue Nov 11 18:51:29 1986
X--- /distribution/dwb/text/troff.d/n3.c	Fri Sep  9 18:45:30 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  extern
X  #include "d.h"
X
X--- 1,4 -----
X+ /*      @(#)n3.c	1.1     */
X  #include "tdef.h"
X  extern
X  #include "d.h"
X***************
X*** 49,61
X  }
X  
X  
X- #ifdef COMMENT
X- /* .rn aa bb
X-  * call aa bb
X-  * Question: is it an error if aa doesn't exist?  I guess so, so we print
X-  * a warning if -DREPORTERRS is set
X-  */
X- #endif COMMENT
X  casern()
X  {
X  	register i, j;
X
X--- 50,55 -----
X  }
X  
X  
X  casern()
X  {
X  	register i, j;
X***************
X*** 63,72
X  	lgf++;
X  	skip();
X  	if ((i = getrq()) == 0 || (oldmn = findmn(i)) < 0)
X- #ifdef REPORTERRS
X- 	{
X- 		if (i == 0) {
X- 			errmsg(EWARN, ".rn called without arguments");
X  			return;
X  		} else {
X  			errmsg(EWARN, ".rn: no macro called %s to rename",
X
X--- 57,62 -----
X  	lgf++;
X  	skip();
X  	if ((i = getrq()) == 0 || (oldmn = findmn(i)) < 0)
X  		return;
X  	skip();
X  	clrmn(findmn(j = getrq()));
X***************
X*** 68,81
X  		if (i == 0) {
X  			errmsg(EWARN, ".rn called without arguments");
X  			return;
X- 		} else {
X- 			errmsg(EWARN, ".rn: no macro called %s to rename",
X- 					realname(i));
X- 		}
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	skip();
X  	clrmn(findmn(j = getrq()));
X  	if (j)
X
X--- 58,63 -----
X  	skip();
X  	if ((i = getrq()) == 0 || (oldmn = findmn(i)) < 0)
X  		return;
X  	skip();
X  	clrmn(findmn(j = getrq()));
X  	if (j)
X***************
X*** 80,90
X  	clrmn(findmn(j = getrq()));
X  	if (j)
X  		contab[oldmn].rq = (contab[oldmn].rq & MMASK) | j;
X- #ifdef REPORTERRS
X- 	else {
X- 		errmsg(EWARN, ".rn %s: two arguments are needed", realname(i));
X- 	}
X- #endif REPORTERRS
X  }
X  
X  
X
X--- 62,67 -----
X  	clrmn(findmn(j = getrq()));
X  	if (j)
X  		contab[oldmn].rq = (contab[oldmn].rq & MMASK) | j;
X  }
X  
X  
X***************
X*** 88,100
X  }
X  
X  
X- #ifdef COMMENT
X- /* should probably be an error to .rm a non-existant macro, but this happens
X-  * too often for it to be helpful.
X-  * Think of .rm as rm -rf
X-  * -- req
X-  */
X- #endif COMMENT
X  caserm()
X  {
X  	lgf++;
X
X--- 65,70 -----
X  }
X  
X  
X  caserm()
X  {
X  	lgf++;
X***************
X*** 137,147
X  	lgf++;
X  	skip();
X  	if ((i = getrq()) == 0)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "%s called with no argument",
X- 			ds ? (app ? ".as" : ".ds") :
X- 			     (app ? ".am" : ".de")  );
X  		goto de1;
X  	}
X  #else !REPORTERRS
X
X--- 107,112 -----
X  	lgf++;
X  	skip();
X  	if ((i = getrq()) == 0)
X  		goto de1;
X  	if ((offset = finds(i)) == 0)
X  		goto de1;
X***************
X*** 143,152
X  			ds ? (app ? ".as" : ".ds") :
X  			     (app ? ".am" : ".de")  );
X  		goto de1;
X- 	}
X- #else !REPORTERRS
X- 		goto de1;
X- #endif REPORTERRS
X  	if ((offset = finds(i)) == 0)
X  		goto de1;
X  #ifdef COMMENT
X
X--- 108,113 -----
X  	skip();
X  	if ((i = getrq()) == 0)
X  		goto de1;
X  	if ((offset = finds(i)) == 0)
X  		goto de1;
X  	if (ds)
X***************
X*** 149,159
X  #endif REPORTERRS
X  	if ((offset = finds(i)) == 0)
X  		goto de1;
X- #ifdef COMMENT
X- 		/* finds() returns 0 on an error, so no need to report it here
X- 		 * -- req
X- 		 */
X- #endif COMMENT
X  	if (ds)
X  		copys();
X  	else 
X
X--- 110,115 -----
X  		goto de1;
X  	if ((offset = finds(i)) == 0)
X  		goto de1;
X  	if (ds)
X  		copys();
X  	else 
X***************
X*** 200,210
X  	if (i >= 0) {
X  		if (contab[i].rq & MMASK)
X  			ffree((filep)contab[i].x.mx);
X- #ifdef PROTECTBUILTINS
X- 		else
X- 			errmsg(EWARN, "Builtin request %s removed",
X- 					realname(contab[i].rq & ~MMASK));
X- #endif PROTECTBUILTINS
X  		contab[i].rq = 0;
X  		contab[i].x.mx = 0;
X  	}
X
X--- 156,161 -----
X  	if (i >= 0) {
X  		if (contab[i].rq & MMASK)
X  			ffree((filep)contab[i].x.mx);
X  		contab[i].rq = 0;
X  		contab[i].x.mx = 0;
X  	}
X***************
X*** 233,242
X  			ip = incoff(ip);
X  		nextb = ip;
X  		ip = savip;
X- #ifdef PROTECTBUILTINS
X- 	} else if (app && oldmn >= 0) {
X- 		errmsg(EWARN, "Built-in request %s redefined", realname(mn));
X- #endif PROTECTBUILTINS
X  	} else {
X  		for (i = 0; i < NM; i++) {
X  			if (contab[i].rq == 0)
X
X--- 184,189 -----
X  			ip = incoff(ip);
X  		nextb = ip;
X  		ip = savip;
X  	} else {
X  		for (i = 0; i < NM; i++) {
X  			if (contab[i].rq == 0)
X***************
X*** 246,257
X  			app = 0;
X  			if (macerr++ > 1)
X  				done2(02);
X- #ifdef REPORTERRS
X- 			errmsg(edone,04, "too many (%d) string/macro names", NM);
X- 			/* edone() may return, so the return is needed.
X- 			 * -- req
X- 			 */
X- #else !REPORTERRS
X  			fprintf(stderr, "troff: Too many (%d) string/macro names.\n", NM);
X  			edone(04);
X  #endif REPORTERRS
X
X--- 193,198 -----
X  			app = 0;
X  			if (macerr++ > 1)
X  				done2(02);
X  			fprintf(stderr, "troff: Too many (%d) string/macro names.\n", NM);
X  			edone(04);
X  			return(offset = 0);
X***************
X*** 254,260
X  #else !REPORTERRS
X  			fprintf(stderr, "troff: Too many (%d) string/macro names.\n", NM);
X  			edone(04);
X- #endif REPORTERRS
X  			return(offset = 0);
X  		}
X  		contab[i].x.mx = (unsigned) nextb;
X
X--- 195,200 -----
X  				done2(02);
X  			fprintf(stderr, "troff: Too many (%d) string/macro names.\n", NM);
X  			edone(04);
X  			return(offset = 0);
X  		}
X  		contab[i].x.mx = (unsigned) nextb;
X***************
X*** 282,314
X  }
X  
X  
X- #ifdef COMMENT
X- /* copyb() simulates a finite state machine that recognises
X-  *	<start-of-line> .jk
X-  * where j and k are the 1 or 2 letters of the macro name that getrq() finds.
X-  *
X-  * start---><state==1>--"."--><state==2>--"j"--<state==3>--"k"-->ACCEPT
X-  * "\n" puts us back to <state==1>
X-  * anything else puts us back to start (which is equivalent)
X-  *
X-  * The idea is to copy stuff into a macro (i.e. into the tmp file) until
X-  * ACCEPT, when we return.  This is used by .de, .am and .ig.  .ig should
X-  * really not use this, as auto-incremented number registers will be
X-  * affected.  Or there could be another flag to getch().  Ugh.
X-  *
X-  * It would be nice if we could provide a warning if EOF was found, as a
X-  * very common cause of no output is to have unmatched .de xx and .., but
X-  * this is difficult.  We can warn about "open" diversions in done(), I
X-  * suppose.  The problem is that getach() calls nextfile() on EOF, which
X-  * in turn calls done() if there aren't any more; but done() doesn't know
X-  * that we're still in coyb, and deducing it from the state of the global
X-  * variables is too much effort.  The reason I'm content to leave it at that
X-  * point is that even if done() *did* know about copyb, it wouldn't be able
X-  * to relate that to the user-level .de or .am or whatever very easily.
X-  *
X-  * -- req
X-  */
X- #endif COMMENT
X  copyb()
X  {
X  	register i, j, k;
X
X--- 222,227 -----
X  }
X  
X  
X  copyb()
X  {
X  	register i, j, k;
X***************
X*** 375,384
X  
X  	copyf++;
X  	if (skip())
X- #ifdef REPORTERRS
X- 	{
X- 		/* would be nice if we knew the string name! */
X- 		errmsg(EWARN, ".ds: usage is .ds xx \"string; no string here!");
X  		goto c0;
X  	}
X  #else !REPORTERRS
X
X--- 288,293 -----
X  
X  	copyf++;
X  	if (skip())
X  		goto c0;
X  	if (cbits(i = getch()) != '"')
X  		wbf(i);
X***************
X*** 380,389
X  		/* would be nice if we knew the string name! */
X  		errmsg(EWARN, ".ds: usage is .ds xx \"string; no string here!");
X  		goto c0;
X- 	}
X- #else !REPORTERRS
X- 		goto c0;
X- #endif REPORTERRS
X  	if (cbits(i = getch()) != '"')
X  		wbf(i);
X  	while (cbits(i = getch()) != '\n')
X
X--- 289,294 -----
X  	copyf++;
X  	if (skip())
X  		goto c0;
X  	if (cbits(i = getch()) != '"')
X  		wbf(i);
X  	while (cbits(i = getch()) != '\n')
X***************
X*** 435,443
X  }
X  
X  
X- #ifdef COMMENT
X- /* wbf() --- Write Buffer File (or Block File)		-- req  */
X- #endif COMMENT
X  wbf(i)
X  tchar i;
X  {
X
X--- 340,345 -----
X  }
X  
X  
X  wbf(i)
X  tchar i;
X  {
X***************
X*** 469,477
X  }
X  
X  
X- #ifdef COMMENT
X- /* wbfl() --- Write BLock to File -- req  */
X- #endif COMMENT
X  wbfl()
X  {
X  	if (woff == 0)
X
X--- 371,376 -----
X  }
X  
X  
X  wbfl()
X  {
X  	if (woff == 0)
X***************
X*** 486,494
X  }
X  
X  
X- #ifdef COMMENT
X- /* rbf() -- read block from file -- req */
X- #endif COMMENT
X  tchar rbf()
X  {
X  	tchar i;
X
X--- 385,390 -----
X  }
X  
X  
X  tchar rbf()
X  {
X  	tchar i;
X***************
X*** 520,528
X  		p = ip;
X  		if (!((j = ++p) & (BLK - 1))) {
X  			if ((i = blist[blisti(--p)]) == -1) {
X- #ifdef REPORTERRS
X- 				errmsg(done2,-5, "Internal error in rbf()");
X- #else !REPORTERRS
X  				fprintf(stderr, "troff: Bad storage allocation.\n");
X  				done2(-5);
X  #endif REPORTERRS
X
X--- 416,421 -----
X  		p = ip;
X  		if (!((j = ++p) & (BLK - 1))) {
X  			if ((i = blist[blisti(--p)]) == -1) {
X  				fprintf(stderr, "troff: Bad storage allocation.\n");
X  				done2(-5);
X  			}
X***************
X*** 525,531
X  #else !REPORTERRS
X  				fprintf(stderr, "troff: Bad storage allocation.\n");
X  				done2(-5);
X- #endif REPORTERRS
X  			}
X  			j = ((filep)i);
X  		}
X
X--- 418,423 -----
X  			if ((i = blist[blisti(--p)]) == -1) {
X  				fprintf(stderr, "troff: Bad storage allocation.\n");
X  				done2(-5);
X  			}
X  			j = ((filep)i);
X  		}
X***************
X*** 540,550
X  {
X  	register filep i;
X  
X- #ifdef COMMENT
X- 	/* BLK is a power of 2, so p & ~(BLK - 1) is (on a 2's compl. m/c)
X- 	 * the bits higher than BLK
X- 	 * -- req */
X- #endif COMMENT
X  	if ((i = p & ~(BLK - 1)) != roff) {
X  		roff = i;
X  #ifndef INCORE
X
X--- 432,437 -----
X  {
X  	register filep i;
X  
X  	if ((i = p & ~(BLK - 1)) != roff) {
X  		roff = i;
X  #ifndef INCORE
X***************
X*** 567,575
X  
X  	if (!((j = ++p) & (BLK - 1))) {
X  		if ((i = blist[blisti(--p)]) == -1) {
X- #ifdef REPORTERRS
X- 			errmsg(done2, -5, "Internal storage error in incoff()");
X- #else !REPORTERRS
X  			fprintf(stderr, "troff: Bad storage allocation.\n");
X  			done2(-5);
X  #endif REPORTERRS
X
X--- 454,459 -----
X  
X  	if (!((j = ++p) & (BLK - 1))) {
X  		if ((i = blist[blisti(--p)]) == -1) {
X  			fprintf(stderr, "troff: Bad storage allocation.\n");
X  			done2(-5);
X  		}
X***************
X*** 572,578
X  #else !REPORTERRS
X  			fprintf(stderr, "troff: Bad storage allocation.\n");
X  			done2(-5);
X- #endif REPORTERRS
X  		}
X  		j = (filep) i;
X  	}
X
X--- 456,461 -----
X  		if ((i = blist[blisti(--p)]) == -1) {
X  			fprintf(stderr, "troff: Bad storage allocation.\n");
X  			done2(-5);
X  		}
X  		j = (filep) i;
X  	}
X***************
X*** 639,644
X  int	x;
X  {
X  	register char	*i;
X  	char	*sbrk();
X  
X  #ifdef ALIGNFIXES
X
X--- 522,528 -----
X  int	x;
X  {
X  	register char	*i;
X+ 	register j;
X  	char	*sbrk();
X  
X  	if (j = x % sizeof(int))	/*allocate only whole words for 3B*/
X***************
X*** 641,671
X  	register char	*i;
X  	char	*sbrk();
X  
X! #ifdef ALIGNFIXES
X! 	/* have to align x to a suitable boundary for storing an int.
X! 	 * Or a tchar?  Or a struct?  We'll use the larger of int and tchar
X! 	 * to be on the safe side...  Really ought to go through and check
X! 	 * every use, but...
X! 	 * - req
X! 	 */
X! 	unsigned int xsize = sizeof(int);
X! 
X! 	if (xsize < sizeof(tchar))
X! 		xsize = sizeof(tchar);
X! 	if (x % (int) xsize)
X! 		x += (int) (xsize - 1);
X! #else !ALIGNFIXES
X! 	if (x % 2 == 1) 
X! 		x++;
X! #endif ALIGNFIXES
X! #ifdef COMMENT
X! 	/* } for brace-match tool */
X! 
X! 	/* note that MAXPTR is (char *) -1, so it's really an error
X! 	 * rather than a cvalue to check against.
X! 	 * - req
X! 	 */
X! #endif COMMENT
X  	if ((i = sbrk(x)) == MAXPTR) {
X  #ifdef REPORTERRS
X  		errmsg(edone, 0100, "Out of memory at %d (recursive macro problem?)", i);
X
X--- 525,532 -----
X  	register j;
X  	char	*sbrk();
X  
X! 	if (j = x % sizeof(int))	/*allocate only whole words for 3B*/
X! 		x += sizeof(int) - j;
X  	if ((i = sbrk(x)) == MAXPTR) {
X  		fprintf(stderr, "troff: Core limit reached.\n");
X  		edone(0100);
X***************
X*** 667,676
X  	 */
X  #endif COMMENT
X  	if ((i = sbrk(x)) == MAXPTR) {
X- #ifdef REPORTERRS
X- 		errmsg(edone, 0100, "Out of memory at %d (recursive macro problem?)", i);
X- 		edone(0100);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: Core limit reached.\n");
X  		edone(0100);
X  #endif REPORTERRS
X
X--- 528,533 -----
X  	if (j = x % sizeof(int))	/*allocate only whole words for 3B*/
X  		x += sizeof(int) - j;
X  	if ((i = sbrk(x)) == MAXPTR) {
X  		fprintf(stderr, "troff: Core limit reached.\n");
X  		edone(0100);
X  	} else {
X***************
X*** 673,679
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: Core limit reached.\n");
X  		edone(0100);
X- #endif REPORTERRS
X  	} else {
X  		enda = i + x;
X  	}
X
X--- 530,535 -----
X  	if ((i = sbrk(x)) == MAXPTR) {
X  		fprintf(stderr, "troff: Core limit reached.\n");
X  		edone(0100);
X  	} else {
X  		if ((unsigned)i % sizeof(int)){	/*check alignment for 3B*/
X  			fprintf(stderr, "troff: alignment problem.\n");
X***************
X*** 675,680
X  		edone(0100);
X  #endif REPORTERRS
X  	} else {
X  		enda = i + x;
X  	}
X  	return(i);
X
X--- 531,540 -----
X  		fprintf(stderr, "troff: Core limit reached.\n");
X  		edone(0100);
X  	} else {
X+ 		if ((unsigned)i % sizeof(int)){	/*check alignment for 3B*/
X+ 			fprintf(stderr, "troff: alignment problem.\n");
X+ 			edone(0100);
X+ 		}
X  		enda = i + x;
X  	}
X  	return(i);
X***************
X*** 681,689
X  }
X  
X  
X- #ifdef COMMENT
X- /* Long name stuff would go here, of course */
X- #endif COMMENT
X  getsn()
X  {
X  	register i;
X
X--- 541,546 -----
X  }
X  
X  
X  getsn()
X  {
X  	register i;
X***************
X*** 701,718
X  {
X  	register i;
X  
X- #ifdef COMMENT
X- 	/* lgf++ --- don't expand ligatures in strings.  Bug: if input that
X- 	 * would normally be turned into a ligature overlapps a string
X- 	 * (eg:
X- 	 * .ds a "i
X- 	 * f\*a  ), the ligature isn't expanded.  I don't know why.
X- 	 *
X- 	 * Is it an error to say \*x if x doesn't exist?  I guess so,
X- 	 * but this would make lots of errors with -ms.  I'll think about it.
X- 	 * -- req
X- 	 */
X- #endif COMMENT
X  	lgf++;
X  	if (((i = getsn()) == 0) ||  ((i = findmn(i)) == -1) ||  !(contab[i].rq & MMASK)) {
X  		lgf--;
X
X--- 558,563 -----
X  {
X  	register i;
X  
X  	lgf++;
X  	if (((i = getsn()) == 0) ||  ((i = findmn(i)) == -1) ||  !(contab[i].rq & MMASK)) {
X  		lgf--;
X***************
X*** 716,724
X  	lgf++;
X  	if (((i = getsn()) == 0) ||  ((i = findmn(i)) == -1) ||  !(contab[i].rq & MMASK)) {
X  		lgf--;
X- #ifdef COMMENT
X- 		/* an error message should prbably go here --- req */
X- #endif COMMENT
X  		return(0);
X  	} else {
X  		SPACETEST(nxf, sizeof(struct s));
X
X--- 561,566 -----
X  	lgf++;
X  	if (((i = getsn()) == 0) ||  ((i = findmn(i)) == -1) ||  !(contab[i].rq & MMASK)) {
X  		lgf--;
X  		return(0);
X  	} else {
X  		SPACETEST(nxf, sizeof(struct s));
X***************
X*** 731,739
X  
X  
X  
X- #ifdef COMMENT
X- /* collect macro arguments */
X- #endif COMMENT
X  collect()
X  {
X  	register j;
X
X--- 573,578 -----
X  
X  
X  
X  collect()
X  {
X  	register j;
X***************
X*** 809,819
X  				fprintf(stderr, "strp=0x%x, lim = 0x%x\n",
X  					strp, lim);
X  #endif 0
X- #ifdef REPORTERRS
X- 				copyf--;
X- 				errmsg(edone, 04,
X- 			"Macro arguments use more than %d characters", CPERMAC);
X- #else !REPORTERRS
X  				fprintf(stderr,
X  					"troff: Macro argument too long.\n");
X  				copyf--;
X
X--- 648,653 -----
X  				fprintf(stderr, "strp=0x%x, lim = 0x%x\n",
X  					strp, lim);
X  #endif 0
X  				fprintf(stderr,
X  					"troff: Macro argument too long.\n");
X  				copyf--;
X***************
X*** 818,824
X  					"troff: Macro argument too long.\n");
X  				copyf--;
X  				edone(004);
X- #endif REPORTERRS
X  			}
X  			SPACETEST(strp, 3 * sizeof(tchar));
X  		}
X
X--- 652,657 -----
X  					"troff: Macro argument too long.\n");
X  				copyf--;
X  				edone(004);
X  			}
X  			SPACETEST(strp, 3 * sizeof(tchar));
X  		}
X***************
X*** 824,836
X  		}
X  		*strp++ = 0;
X  	}
X- #ifdef COMMENT
X- 	/* should report if > APERMAC args... */
X- 	/* Also, the cast to (tchar **) may be wrong;  4.2bsd troff has int **
X- 	 * instead, but uses nxf rather than savnxf.  Who cares?
X- 	 * - req
X- 	 */
X- #endif COMMENT
X  	nxf = savnxf;
X  	nxf->nargs = argpp - (tchar **)(savnxf + 1);
X  	argtop = strp;
X
X--- 657,662 -----
X  		}
X  		*strp++ = 0;
X  	}
X  	nxf = savnxf;
X  	nxf->nargs = argpp - (tchar **)(savnxf + 1);
X  	argtop = strp;
X***************
X*** 866,874
X  
X  	lgf++;
X  	if (skip() || ((i = getrq()) == 0)) {
X- #ifdef COMMENT
X- 		/* .di */
X- #endif COMMENT
X  		if (dip != d)
X  			wbt((tchar)0);
X  		if (dilev > 0) {
X
X--- 692,697 -----
X  
X  	lgf++;
X  	if (skip() || ((i = getrq()) == 0)) {
X  		if (dip != d)
X  			wbt((tchar)0);
X  		if (dilev > 0) {
X***************
X*** 877,887
X  			dip = &d[--dilev];
X  			offset = dip->op;
X  		}
X- #ifdef REPORTERRS
X- 		else {
X- 			errmsg(EWARN, ".di without arguments outside a diversion");
X- 		}
X- #endif REPORTERRS
X  		goto rtn;
X  	}
X  	if (++dilev == NDI) {
X
X--- 700,705 -----
X  			dip = &d[--dilev];
X  			offset = dip->op;
X  		}
X  		goto rtn;
X  	}
X  	if (++dilev == NDI) {
X***************
X*** 886,895
X  	}
X  	if (++dilev == NDI) {
X  		--dilev;
X- #ifdef REPORTERRS
X- 		errmsg(edone,02,"Diversions nested deeper than %d levels", NDI);
X- 		edone(02);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: Diversions nested too deep.\n");
X  		edone(02);
X  #endif REPORTERRS
X
X--- 704,709 -----
X  	}
X  	if (++dilev == NDI) {
X  		--dilev;
X  		fprintf(stderr, "troff: Diversions nested too deep.\n");
X  		edone(02);
X  	}
X***************
X*** 892,898
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: Diversions nested too deep.\n");
X  		edone(02);
X- #endif REPORTERRS
X  	}
X  	if (dip != d)
X  		wbt((tchar)0);
X
X--- 706,711 -----
X  		--dilev;
X  		fprintf(stderr, "troff: Diversions nested too deep.\n");
X  		edone(02);
X  	}
X  	if (dip != d)
X  		wbt((tchar)0);
X***************
X*** 917,925
X  	skip();
X  	dip->ditrap = vnumb((int *)0);
X  	if (nonumb)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, ".dt must have a numeric first argument");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 730,735 -----
X  	skip();
X  	dip->ditrap = vnumb((int *)0);
X  	if (nonumb)
X  		return;
X  	skip();
X  	dip->dimac = getrq();
X***************
X*** 921,930
X  	{
X  		errmsg(EWARN, ".dt must have a numeric first argument");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	skip();
X  #ifdef REPORTERRS
X  	if ((dip->dimac = getrq()) == 0) {
X
X--- 731,736 -----
X  	dip->ditrap = vnumb((int *)0);
X  	if (nonumb)
X  		return;
X  	skip();
X  	dip->dimac = getrq();
X  }
X***************
X*** 926,936
X  		return;
X  #endif REPORTERRS
X  	skip();
X- #ifdef REPORTERRS
X- 	if ((dip->dimac = getrq()) == 0) {
X- 		errmsg(EWARN, ".dt needs to have a macro-name as a third argument");
X- 	}
X- #else !REPORTERRS
X  	dip->dimac = getrq();
X  #endif REPORTERRS
X  }
X
X--- 732,737 -----
X  	if (nonumb)
X  		return;
X  	skip();
X  	dip->dimac = getrq();
X  }
X  
X***************
X*** 932,938
X  	}
X  #else !REPORTERRS
X  	dip->dimac = getrq();
X- #endif REPORTERRS
X  }
X  
X  
X
X--- 733,738 -----
X  		return;
X  	skip();
X  	dip->dimac = getrq();
X  }
X  
X  
X***************
X*** 951,959
X  	if ((offset = begin = alloc()) == 0)
X  		return;
X  	if (ismot(delim = getch())) {
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, ".tl: first delimiter unsuitable; using \"'\"");
X- #endif REPORTERRS
X  		ch = delim;
X  		delim = '\'';
X  	} else 
X
X--- 751,756 -----
X  	if ((offset = begin = alloc()) == 0)
X  		return;
X  	if (ismot(delim = getch())) {
X  		ch = delim;
X  		delim = '\'';
X  	} else 
X***************
X*** 959,974
X  	} else 
X  		delim = cbits(delim);
X  	if (!nlflg)
X- #ifdef REPORTERRS
X- 	{
X- #endif REPORTERRS
X- #ifdef COMMENT
X- 		/* would like to detect .tl with no trailing delim here.
X- 		 * Maybe .tl 'left'
X- 		 * should be an error, too (no 'center'right')
X- 		 * - req
X- 		 */
X- #endif COMMENT
X  		while (cbits(i = getch()) != '\n') {
X  			if (cbits(i) == cbits(delim))
X  				i = IMP;
X
X--- 756,761 -----
X  	} else 
X  		delim = cbits(delim);
X  	if (!nlflg)
X  		while (cbits(i = getch()) != '\n') {
X  			if (cbits(i) == cbits(delim))
X  				i = IMP;
X***************
X*** 974,984
X  				i = IMP;
X  			wbf(i);
X  		}
X- #ifdef REPORTERRS
X- 	} else {
X- 		errmsg(EWARN, ".tl with no arguments ignored");
X- 	}
X- #endif REPORTERRS
X  	wbf((tchar)IMP);
X  	wbf((tchar)IMP);
X  	wbt((tchar)0);
X
X--- 761,766 -----
X  				i = IMP;
X  			wbf(i);
X  		}
X  	wbf((tchar)IMP);
X  	wbf((tchar)IMP);
X  	wbt((tchar)0);
X***************
X*** 1011,1020
X  }
X  
X  
X- #ifdef COMMENT
X- /* if no argument to .pc, set to IMP (i.e. turn the mechanism off
X-  * -- req */
X- #endif COMMENT
X  casepc()
X  {
X  	pagech = chget(IMP);
X
X--- 793,798 -----
X  }
X  
X  
X  casepc()
X  {
X  	pagech = chget(IMP);
Xdiff -rbc titroff/n4.c /distribution/dwb/text/troff.d/n4.c
X*** titroff/n4.c	Wed Nov 19 21:24:19 1986
X--- /distribution/dwb/text/troff.d/n4.c	Fri Sep  9 18:45:36 1983
X***************
X*** 1,3
X  #include	<ctype.h>
X  #include "tdef.h"
X  extern
X
X--- 1,4 -----
X+ /*      @(#)n4.c	1.1     */
X  #include	<ctype.h>
X  #include "tdef.h"
X  extern
X***************
X*** 18,28
X  #include <sgtty.h>
X  #include "ext.h"
X  
X- #ifndef NROFF
X- #ifdef PAPERSIZEREG
X- extern int paperwidth, paperlength;
X- #endif PAPERSIZEREG
X- #endif !NROFF
X  int	regcnt = NNAMES;
X  int	falsef	= 0;	/* on if inside false branch of if */
X  
X
X--- 19,24 -----
X  #include <sgtty.h>
X  #include "ext.h"
X  
X  int	regcnt = NNAMES;
X  int	falsef	= 0;	/* on if inside false branch of if */
X  
X***************
X*** 139,164
X  		case 'b':
X  			i = bdtab[font];
X  			break;
X! #ifndef NROFF
X! #ifdef PAPERSIZEREG
X! 		case 'W':	/* .W -- paperwidth */
X! 			i = paperwidth;
X! #ifdef LOCALWARN
X! 			lwarn(".W number register non-standard\n");
X! #endif LOCALWARN
X! 			break;
X! 		case 'M':	/* .M -- paperlength */
X! 			i = paperlength;
X! #ifdef LOCALWARN
X! 			lwarn(".M number register non-standard\n");
X! #endif LOCALWARN
X! 			break;
X! #endif PAPERSIZEREG
X! #endif !NROFF
X! #ifdef BLANKSMACRO
X! 		case 'B':	/* .B number of leading blanks on this line */
X! 			{
X! 				extern int nrspaces; /* from local.c */
X  
X  				i = nrspaces;
X  #ifdef LOCALWARN
X
X--- 135,144 -----
X  		case 'b': 
X  			i = bdtab[font];
X  			break;
X! 		case 'F':
X! 			for (i=0; cbuf[i] = cfname[ifi][i]; i++) ;
X! 			cp = cbuf;
X! 			return;
X  
X  		default:
X  			goto s0;
X***************
X*** 160,192
X  			{
X  				extern int nrspaces; /* from local.c */
X  
X- 				i = nrspaces;
X- #ifdef LOCALWARN
X- 				lwarn(".B number register non-standard\n");
X- #endif LOCALWARN
X- 				break;
X- 			}
X- 
X- 		case 'N':	/* nlflag */
X- 			{
X- 				extern int nrlines;
X- 
X- 				i = nrlines;
X- #ifdef LOCALWARN
X- 				lwarn(".B number register non-standard\n");
X- #endif LOCALWARN
X- 				break;
X- 			}
X- #endif BLANKSMACRO
X- 
X- #ifdef EVREG
X- 		case 'e':	/* .e -- environment number */
X- 			i = ev;
X- #ifdef LOCALWARN
X- 			lwarn(".e number register non-standard\n");
X- #endif LOCALWARN
X- 			break;
X- #endif EVREG
X  		default:
X  #ifdef REPORTERRS
X  			errmsg(EWARN, "\\n: No such read-only number register as .%c",
X
X--- 140,145 -----
X  			cp = cbuf;
X  			return;
X  
X  		default:
X  			goto s0;
X  		}
X***************
X*** 188,197
X  			break;
X  #endif EVREG
X  		default:
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "\\n: No such read-only number register as .%c",
X- 								i >> BYTE);
X- #endif REPORTERRS
X  			goto s0;
X  		}
X  	else {
X
X--- 141,146 -----
X  			return;
X  
X  		default:
X  			goto s0;
X  		}
X  	else {
X***************
X*** 196,207
X  		}
X  	else {
X  s0:
X- #ifdef COMMENT
X- 		/* no such number register could be an error, but it
X- 		 * happens too often to be worth moaning at.
X- 		 * -- req
X- 		 */
X- #endif COMMENT
X  		if ((j = findr(i)) == -1)
X  			i = 0;
X  		else {
X
X--- 145,150 -----
X  		}
X  	else {
X  s0:
X  		if ((j = findr(i)) == -1)
X  			i = 0;
X  		else {
X***************
X*** 249,257
X  		}
X  	}
X  	if (p == &r[NN]) {
X- #ifdef REPORTERRS
X- 		errmsg(done2, 04, "more than %d number registers", NN);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: too many number registers (%d).\n", NN);
X  		done2(04);
X  #endif REPORTERRS
X
X--- 192,197 -----
X  		}
X  	}
X  	if (p == &r[NN]) {
X  		fprintf(stderr, "troff: too many number registers (%d).\n", NN);
X  		done2(04); 
X  	}
X***************
X*** 254,260
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: too many number registers (%d).\n", NN);
X  		done2(04);
X- #endif REPORTERRS
X  	}
X  	return(p - r);
X  }
X
X--- 194,199 -----
X  	if (p == &r[NN]) {
X  		fprintf(stderr, "troff: too many number registers (%d).\n", NN);
X  		done2(04); 
X  	}
X  	return(p - r);
X  }
X***************
X*** 389,397
X  }
X  
X  
X- #ifdef REPORTERRS
X- static int bracklevel = 0;	/* depth of ( ... ) in expressions */
X- #endif REPORTERRS
X  long	atoi0()
X  {
X  	register c, k, cnt;
X
X--- 328,333 -----
X  }
X  
X  
X  long	atoi0()
X  {
X  	register c, k, cnt;
X***************
X*** 412,425
X  		ch = ii;
X  		if (cnt)
X  			break;
X- #ifdef COMMENT
X- 		/* else fall through... */
X- 
X- 		/* Could warn here about trailing garbage, but things like
X- 		 * .ta 3iR or \l'3iX' would go horribly wrong then!
X- 		 * - req
X- 		 */
X- #endif COMMENT
X  	case '+':
X  		i = ckph();
X  #ifdef REPORTERRS
X
X--- 348,353 -----
X  		ch = ii;
X  		if (cnt)
X  			break;
X  	case '+':
X  		i = ckph();
X  		if (nonumb)
X***************
X*** 422,448
X  #endif COMMENT
X  	case '+':
X  		i = ckph();
X- #ifdef REPORTERRS
X- 		if (nonumb) {
X- 			if (cnt) {
X- 				if (cbits(ch) == '\n') {
X- 					errmsg(EWARN, "newline unexpected after +");
X- 				} else {
X- 					errmsg(EWARN, "Unexpected \"%s\" found after +", tchartos(ch));
X- 				}
X- 			} else if (cbits(ch) != '\n') {
X- 				/* caseif() turns off this message! */
X- 				if (reporterrs & LERR_BADEXPSTART) {
X- 					if (!(ismot(ch) && !isvmot(ch)) &&
X- 						cbits(ch) != RIGHT &&
X- 						cbits(ch) != ' ') {
X- 							errmsg(EWARN, "\"%s\" can't start an expression", tchartos(ch));
X- 					}
X- 				}
X- 			}
X- 			break;
X- 		} 
X- #else !REPORTERRS
X  		if (nonumb)
X  			break;
X  #endif REPORTERRS
X
X--- 350,355 -----
X  			break;
X  	case '+':
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc += i;
X***************
X*** 445,451
X  #else !REPORTERRS
X  		if (nonumb)
X  			break;
X- #endif REPORTERRS
X  		acc += i;
X  		goto a0;
X  	case '-':
X
X--- 352,357 -----
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc += i;
X  		goto a0;
X  	case '-':
X***************
X*** 451,459
X  	case '-':
X  		i = ckph();
X  		if (nonumb)
X- #ifdef REPORTERRS
X- 		{
X- 			errmsg(EWARN, "found \"%s\" after \"-\" in expression!", tchartos(ch));
X  			break;
X  		}
X  #else !REPORTERRS
X
X--- 357,362 -----
X  	case '-':
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc -= i;
X  		goto a0;
X***************
X*** 455,464
X  		{
X  			errmsg(EWARN, "found \"%s\" after \"-\" in expression!", tchartos(ch));
X  			break;
X- 		}
X- #else !REPORTERRS
X- 			break;
X- #endif REPORTERRS
X  		acc -= i;
X  		goto a0;
X  	case '*':
X
X--- 358,363 -----
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc -= i;
X  		goto a0;
X  	case '*':
X***************
X*** 464,472
X  	case '*':
X  		i = ckph();
X  		if (nonumb)
X- #ifdef REPORTERRS
X- 		{
X- 			errmsg(EWARN, "found \"%s\" after * in expression!", tchartos(ch));
X  			break;
X  		}
X  #else !REPORTERRS
X
X--- 363,368 -----
X  	case '*':
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc *= i;
X  		goto a0;
X***************
X*** 468,477
X  		{
X  			errmsg(EWARN, "found \"%s\" after * in expression!", tchartos(ch));
X  			break;
X- 		}
X- #else !REPORTERRS
X- 			break;
X- #endif REPORTERRS
X  		acc *= i;
X  		goto a0;
X  	case '/':
X
X--- 364,369 -----
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc *= i;
X  		goto a0;
X  	case '/':
X***************
X*** 477,485
X  	case '/':
X  		i = ckph();
X  		if (nonumb)
X- #ifdef REPORTERRS
X- 		{
X- 			errmsg(EWARN, "found \"%s\" after / in expression!", tchartos(ch));
X  			break;
X  		}
X  #else !REPORTERRS
X
X--- 369,374 -----
X  	case '/':
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		if (i == 0) {
X  			flusho();
X***************
X*** 481,490
X  		{
X  			errmsg(EWARN, "found \"%s\" after / in expression!", tchartos(ch));
X  			break;
X- 		}
X- #else !REPORTERRS
X- 			break;
X- #endif REPORTERRS
X  		if (i == 0) {
X  			flusho();
X  #ifdef REPORTERRS
X
X--- 370,375 -----
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		if (i == 0) {
X  			flusho();
X  			fprintf(stderr, "troff: divide by zero.\n");
X***************
X*** 487,495
X  #endif REPORTERRS
X  		if (i == 0) {
X  			flusho();
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "divide by zero in expression (result is 0)");
X- #else !REPORTERRS
X  			fprintf(stderr, "troff: divide by zero.\n");
X  #endif REPORTERRS
X  			acc = 0;
X
X--- 372,377 -----
X  			break;
X  		if (i == 0) {
X  			flusho();
X  			fprintf(stderr, "troff: divide by zero.\n");
X  			acc = 0;
X  		} else 
X***************
X*** 491,497
X  			errmsg(EWARN, "divide by zero in expression (result is 0)");
X  #else !REPORTERRS
X  			fprintf(stderr, "troff: divide by zero.\n");
X- #endif REPORTERRS
X  			acc = 0;
X  		} else
X  			acc /= i;
X
X--- 373,378 -----
X  		if (i == 0) {
X  			flusho();
X  			fprintf(stderr, "troff: divide by zero.\n");
X  			acc = 0;
X  		} else 
X  			acc /= i;
X***************
X*** 499,507
X  	case '%':
X  		i = ckph();
X  		if (nonumb)
X- #ifdef REPORTERRS
X- 		{
X- 			errmsg(EWARN, "found \"%s\" after % (mod) in expression!", tchartos(ch));
X  			break;
X  		}
X  #else !REPORTERRS
X
X--- 380,385 -----
X  	case '%':
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc %= i;
X  		goto a0;
X***************
X*** 503,512
X  		{
X  			errmsg(EWARN, "found \"%s\" after % (mod) in expression!", tchartos(ch));
X  			break;
X- 		}
X- #else !REPORTERRS
X- 			break;
X- #endif REPORTERRS
X  		acc %= i;
X  		goto a0;
X  	case '&':	/*and*/
X
X--- 381,386 -----
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		acc %= i;
X  		goto a0;
X  	case '&':	/*and*/
X***************
X*** 512,520
X  	case '&':	/*and*/
X  		i = ckph();
X  		if (nonumb)
X- #ifdef REPORTERRS
X- 		{
X- 			errmsg(EWARN, "found \"%s\" after & in expression!", tchartos(ch));
X  			break;
X  		}
X  #else !REPORTERRS
X
X--- 386,391 -----
X  	case '&':	/*and*/
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		if ((acc > 0) && (i > 0))
X  			acc = 1; 
X***************
X*** 516,525
X  		{
X  			errmsg(EWARN, "found \"%s\" after & in expression!", tchartos(ch));
X  			break;
X- 		}
X- #else !REPORTERRS
X- 			break;
X- #endif REPORTERRS
X  		if ((acc > 0) && (i > 0))
X  			acc = 1;
X  		else
X
X--- 387,392 -----
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		if ((acc > 0) && (i > 0))
X  			acc = 1; 
X  		else 
X***************
X*** 528,536
X  	case ':':	/*or*/
X  		i = ckph();
X  		if (nonumb)
X- #ifdef REPORTERRS
X- 		{
X- 			errmsg(EWARN, "found \"%s\" after : (logical or) in expression!", tchartos(ch));
X  			break;
X  		}
X  #else !REPORTERRS
X
X--- 395,400 -----
X  	case ':':	/*or*/
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		if ((acc > 0) || (i > 0))
X  			acc = 1; 
X***************
X*** 532,541
X  		{
X  			errmsg(EWARN, "found \"%s\" after : (logical or) in expression!", tchartos(ch));
X  			break;
X- 		}
X- #else !REPORTERRS
X- 			break;
X- #endif REPORTERRS
X  		if ((acc > 0) || (i > 0))
X  			acc = 1;
X  		else
X
X--- 396,401 -----
X  		i = ckph();
X  		if (nonumb)
X  			break;
X  		if ((acc > 0) || (i > 0))
X  			acc = 1; 
X  		else 
X***************
X*** 547,555
X  		i = ckph();
X  		if (nonumb) {
X  			acc = 0;
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "found \"%s\" after = in expression!", tchartos(ch));
X- #endif REPORTERRS
X  			break;
X  		}
X  		if (i == acc)
X
X--- 407,412 -----
X  		i = ckph();
X  		if (nonumb) {
X  			acc = 0; 
X  			break;
X  		}
X  		if (i == acc)
X***************
X*** 566,574
X  		i = ckph();
X  		if (nonumb) {
X  			acc = 0;
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "found \"%s\" after > in expression!", tchartos(ch));
X- #endif REPORTERRS
X  			break;
X  		}
X  		if (acc > (i - k))
X
X--- 423,428 -----
X  		i = ckph();
X  		if (nonumb) {
X  			acc = 0; 
X  			break;
X  		}
X  		if (acc > (i - k))
X***************
X*** 585,593
X  		i = ckph();
X  		if (nonumb) {
X  			acc = 0;
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "found \"%s\" after < in expression!", tchartos(ch));
X- #endif REPORTERRS
X  			break;
X  		}
X  		if (acc < (i + k))
X
X--- 439,444 -----
X  		i = ckph();
X  		if (nonumb) {
X  			acc = 0; 
X  			break;
X  		}
X  		if (acc < (i + k))
X***************
X*** 596,608
X  			acc = 0;
X  		goto a0;
X  	case ')':
X- #ifdef REPORTERRS
X- 		if (bracklevel) {
X- 			bracklevel--;
X- 		} else {
X- 			errmsg(EWARN, "too many ) in expression!");
X- 		}
X- #endif REPORTERRS
X  		break;
X  	case '(':
X  #ifdef REPORTERRS
X
X--- 447,452 -----
X  			acc = 0;
X  		goto a0;
X  	case ')': 
X  		break;
X  	case '(':
X  		acc = atoi0();
X***************
X*** 605,613
X  #endif REPORTERRS
X  		break;
X  	case '(':
X- #ifdef REPORTERRS
X- 		bracklevel++;
X- #endif REPORTERRS
X  		acc = atoi0();
X  		goto a0;
X  	}
X
X--- 449,454 -----
X  	case ')': 
X  		break;
X  	case '(':
X  		acc = atoi0();
X  		goto a0;
X  	}
X***************
X*** 623,631
X  	extern long	atoi1();
X  
X  	if (cbits(i = getch()) == '(')
X- #ifdef REPORTERRS
X- 	{
X- 		bracklevel++;
X  		j = atoi0();
X  	}
X  #else !REPORTERRS
X
X--- 464,469 -----
X  	extern long	atoi1();
X  
X  	if (cbits(i = getch()) == '(')
X  		j = atoi0();
X  	else {
X  		ch = i;
X***************
X*** 627,636
X  	{
X  		bracklevel++;
X  		j = atoi0();
X- 	}
X- #else !REPORTERRS
X- 		j = atoi0();
X- #endif REPORTERRS
X  	else {
X  		ch = i;
X  		j = atoi1();
X
X--- 465,470 -----
X  
X  	if (cbits(i = getch()) == '(')
X  		j = atoi0();
X  	else {
X  		ch = i;
X  		j = atoi1();
X***************
X*** 770,778
X  casenr()
X  {
X  	register i, j;
X- #ifdef REPORTERRS
X- 	tchar name;
X- #endif REPORTERRS
X  
X  	lgf++;
X  #ifdef REPORTERRS
X
X--- 604,609 -----
X  casenr()
X  {
X  	register i, j;
X  
X  	lgf++;
X  	skip();
X***************
X*** 775,799
X  #endif REPORTERRS
X  
X  	lgf++;
X- #ifdef REPORTERRS
X- 	if (skip()) {
X- 		errmsg(EWARN, ".nr request with no arguments ignored");
X- 		goto rtn;
X- 	}
X- 	if ((i = findr(name = getrq())) == -1)
X- 		goto rtn;
X- 		/* findr() allocates a new register & warns if there are none,
X- 		 * so no need to give an error here too.
X- 		 *
X- 		 * We save the name of the register for error messages
X- 		 *
X- 		 * -- req
X- 		 */
X- 	if (skip()) {
X- 		errmsg(EWARN, ".nr %s: missing expression!", realname(name));
X- 		goto rtn;
X- 	}
X- #else !REPORTERRS
X  	skip();
X  	if ((i = findr(getrq())) == -1)
X  		goto rtn;
X
X--- 606,611 -----
X  	register i, j;
X  
X  	lgf++;
X  	skip();
X  	if ((i = findr(getrq())) == -1)
X  		goto rtn;
X***************
X*** 798,807
X  	if ((i = findr(getrq())) == -1)
X  		goto rtn;
X  	skip();
X- #endif REPORTERRS
X- #ifdef COMMENT
X- 		/* should warn about read-only number registers here? */
X- #endif COMMENT
X  	j = inumb(&vlist[i]);
X  #ifdef REPORTERRS
X  	if (nonumb) {
X
X--- 610,615 -----
X  	if ((i = findr(getrq())) == -1)
X  		goto rtn;
X  	skip();
X  	j = inumb(&vlist[i]);
X  	if (nonumb)
X  		goto rtn;
X***************
X*** 803,824
X  		/* should warn about read-only number registers here? */
X  #endif COMMENT
X  	j = inumb(&vlist[i]);
X- #ifdef REPORTERRS
X- 	if (nonumb) {
X- 		/* ch can be set to 0 & then have font & size info ORed in,
X- 		 * so you can have NULLs in different fonts!!  This is why we
X- 		 * test cbits(ch) rather than ch itself.  -- req
X- 		 */
X- 		if (cbits(ch) && cbits(ch) != '\n') {
X- 			errmsg(EWARN,
X- ".nr %s: extra characters ignored from \"%s\"", realname(name), tchartos(ch));
X- 		} else {
X- 			errmsg(EWARN, ".nr %s %d ignored (error in expression?)",
X- 								realname(name), j);
X- 		}
X- 		goto rtn;
X- 	}
X- #else !REPORTERRS
X  	if (nonumb)
X  		goto rtn;
X  #endif REPORTERRS
X
X--- 611,616 -----
X  		goto rtn;
X  	skip();
X  	j = inumb(&vlist[i]);
X  	if (nonumb)
X  		goto rtn;
X  	vlist[i] = j;
X***************
X*** 821,827
X  #else !REPORTERRS
X  	if (nonumb)
X  		goto rtn;
X- #endif REPORTERRS
X  	vlist[i] = j;
X  #ifdef REPORTERRS
X  	if (!skip()) {
X
X--- 613,618 -----
X  	j = inumb(&vlist[i]);
X  	if (nonumb)
X  		goto rtn;
X  	vlist[i] = j;
X  	skip();
X  	j = atoi();
X***************
X*** 823,853
X  		goto rtn;
X  #endif REPORTERRS
X  	vlist[i] = j;
X- #ifdef REPORTERRS
X- 	if (!skip()) {
X- 		/* 3rd argument to .nr is auto-increment value (which may
X- 		 * be -ve, of course)
X- 		 */
X- 		int savrpterrs = reporterrs;
X- 		int n = j;
X- 
X- 		/* as arg is optional...  Otherwise a trailing TAB */
X- 		/* produces error messages! */
X- 		/* this might confuse people who use the reporterrs number
X- 		 * register as an increment, I suppose!
X- 		 */
X- 		reporterrs &= (~LERR_BADEXPSTART);
X- 
X- 		j = atoi();
X- 
X- 		reporterrs = savrpterrs;
X- 
X- 		if (nonumb && cbits(ch) == '\n') {
X- 				errmsg(EWARN,
X- 					".nr %s %d: non-numeric increment ignored", realname(name), n);
X- 		}
X- 	}
X- #else !REPORTERRS
X  	skip();
X  	j = atoi();
X  #endif REPORTERRS
X
X--- 614,619 -----
X  	if (nonumb)
X  		goto rtn;
X  	vlist[i] = j;
X  	skip();
X  	j = atoi();
X  	if (nonumb)
X***************
X*** 850,856
X  #else !REPORTERRS
X  	skip();
X  	j = atoi();
X! #endif REPORTERRS
X  	inc[i] = j;
X  rtn:
X  	return;
X
X--- 616,623 -----
X  	vlist[i] = j;
X  	skip();
X  	j = atoi();
X! 	if (nonumb)
X! 		goto rtn;
X  	inc[i] = j;
X  rtn:
X  	return;
X***************
X*** 863,880
X  	tchar j;
X  
X  	lgf++;
X- #ifdef REPORTERRS
X- 	if (skip()) {
X- 		errmsg(EWARN, ".af: called without arguments");
X- 		return;
X- 	} else if (!(i = getrq())) {
X- 		errmsg(EWARN, ".af: need a register name as 2nd argument");
X- 		return;
X- 	} else if (skip()) {
X- 		errmsg(EWARN, ".af: need 2 arguments (reg, format), found 1");
X- 		return;
X- 	}
X- #else !REPORTERRS
X  	if (skip() || !(i = getrq()) || skip())
X  		return;
X  #endif REPORTERRS
X
X--- 630,635 -----
X  	tchar j;
X  
X  	lgf++;
X  	if (skip() || !(i = getrq()) || skip())
X  		return;
X  	k = 0;
X***************
X*** 877,883
X  #else !REPORTERRS
X  	if (skip() || !(i = getrq()) || skip())
X  		return;
X- #endif REPORTERRS
X  	k = 0;
X  	j = getch();
X  	if (!isalpha(cbits(j))) {
X
X--- 632,637 -----
X  	lgf++;
X  	if (skip() || !(i = getrq()) || skip())
X  		return;
X  	k = 0;
X  	j = getch();
X  	if (!isalpha(cbits(j))) {
X***************
X*** 888,899
X  	if (!k)
X  		k = j;
X  	fmt[findr(i)] = k & BMASK;
X- #ifdef COMMENT
X- 	/* note that (1) findr could return -1 if i == 0, so we check it
X- 	 * 	     (2) we allocate a new number register if necessary
X- 	 * - req
X- 	 */
X- #endif COMMENT
X  }
X  
X  setaf()	/* return format of number register */
X
X--- 642,647 -----
X  	if (!k)
X  		k = j;
X  	fmt[findr(i)] = k & BMASK;
X  }
X  
X  setaf()	/* return format of number register */
X***************
X*** 970,981
X  		neg++;
X  		n = -n;
X  	}
X- #ifdef REPORTERRS
X- 	if (m == 0) {
X- 		errmsg(EWARN, "Internal Error: m == 0 in quant()");
X- 		m = 1;	/* guess... */
X- 	}
X- #endif REPORTERRS
X  	/* better as i = ((n + (m/2))/m)*m */
X  	i = n / m;
X  	if ((n - m * i) > (m / 2))
X
X--- 718,723 -----
X  		neg++;
X  		n = -n;
X  	}
X  	/* better as i = ((n + (m/2))/m)*m */
X  	i = n / m;
X  	if ((n - m * i) > (m / 2))
X***************
X*** 985,987
X  		i = -i;
X  	return(i);
X  }
X
X--- 727,731 -----
X  		i = -i;
X  	return(i);
X  }
X+ 
X+ 
SHAR_EOF
if test 42764 -ne "`wc -c < 'diffb'`"
then
	echo shar: error transmitting "'diffb'" '(should have been 42764 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
ARPA		req%uu.warwick.ac.uk@ucl-cs.arpa
EARN/BITNET	req%UK.AC.WARWICK.UU@AC.UK
JANET		req@uk.ac.warwick.uu
UUCP		seismo!mcvax!ukc!warwick!req  (req@warwick.UUCP)
PHONE		+44 203 523485
For mail.frplist, use "frplist" instead of "req" in the above lines.
The BITNET path only works from sites that have AC.UK in their tables.  Sorry.

req@warwick.UUCP (11/21/86)

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	diffc
# This archive created: Thu Nov 20 21:50:05 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'diffc'" '(49231 characters)'
if test -f 'diffc'
then
	echo shar: will not over-write existing file "'diffc'"
else
sed 's/^X//' << \SHAR_EOF > 'diffc'
Xdiff -rbc titroff/n5.c /distribution/dwb/text/troff.d/n5.c
X*** titroff/n5.c	Wed Nov 19 21:30:06 1986
X--- /distribution/dwb/text/troff.d/n5.c	Fri Sep  9 18:45:51 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  #include <sgtty.h>
X  extern
X
X--- 1,4 -----
X+ /*      @(#)n5.c	1.1     */
X  #include "tdef.h"
X  #include <sgtty.h>
X  extern
X***************
X*** 46,56
X  	case '3': 
X  	case '5':
X  		admod = (i - '0') / 2;
X- #ifdef REPORTERRS
X- 		break;
X- 	default:
X- 		errmsg(EWARN, ".ad: Unknown adjust mode \"%s\"", tchartos(i));
X- #endif REPORTERRS
X  	}
X  }
X  
X
X--- 47,52 -----
X  	case '3': 
X  	case '5':
X  		admod = (i - '0') / 2;
X  	}
X  }
X  
X***************
X*** 146,154
X  	i = atoi();
X  	noscale = 0;
X  	if (nonumb)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, ".hy: numeric argument expected assuming 1");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 142,147 -----
X  	i = atoi();
X  	noscale = 0;
X  	if (nonumb)
X  		return;
X  	hyf = max(i, 0);
X  }
X***************
X*** 150,159
X  	{
X  		errmsg(EWARN, ".hy: numeric argument expected assuming 1");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	hyf = max(i, 0);
X  }
X  
X
X--- 143,148 -----
X  	noscale = 0;
X  	if (nonumb)
X  		return;
X  	hyf = max(i, 0);
X  }
X  
X***************
X*** 285,298
X  
X  	skip();
X  	if ((i = vnumb(&pl)) == 0)
X- #ifdef PAPERSIZEREG
X- 	{
X- 		extern int paperlength, paperwidth;
X- 
X- 		pl = paperlength; /* from DESC */
X- 		/* this is swapped with paperwidth if the page gets rotated */
X- 	}
X- #else !PAPERSIZEREG
X  		pl = 11 * INCH; /*11in*/
X  #endif PAPERSIZEREG
X  	else 
X
X--- 274,279 -----
X  
X  	skip();
X  	if ((i = vnumb(&pl)) == 0)
X  		pl = 11 * INCH; /*11in*/
X  	else 
X  		pl = i;
X***************
X*** 294,300
X  	}
X  #else !PAPERSIZEREG
X  		pl = 11 * INCH; /*11in*/
X- #endif PAPERSIZEREG
X  	else 
X  		pl = i;
X  	if (v.nl > pl)
X
X--- 275,280 -----
X  	skip();
X  	if ((i = vnumb(&pl)) == 0)
X  		pl = 11 * INCH; /*11in*/
X  	else 
X  		pl = i;
X  	if (v.nl > pl)
X***************
X*** 310,318
X  	skip();
X  	i = vnumb((int *)0);
X  	if (nonumb)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, ".wh: usage .wh nnn xx (can't find number nnn)");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 290,295 -----
X  	skip();
X  	i = vnumb((int *)0);
X  	if (nonumb)
X  		return;
X  	skip();
X  	j = getrq();
X***************
X*** 314,323
X  	{
X  		errmsg(EWARN, ".wh: usage .wh nnn xx (can't find number nnn)");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	skip();
X  	j = getrq();
X  	if ((k = findn(i)) != NTRAP) {
X
X--- 291,296 -----
X  	i = vnumb((int *)0);
X  	if (nonumb)
X  		return;
X  	skip();
X  	j = getrq();
X  	if ((k = findn(i)) != NTRAP) {
X***************
X*** 329,337
X  			break;
X  	if (k == NTRAP) {
X  		flusho();
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, "more than %d traps -- too many", NTRAP - 1);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: cannot plant trap.\n");
X  #endif REPORTERRS
X  		return;
X
X--- 302,307 -----
X  			break;
X  	if (k == NTRAP) {
X  		flusho();
X  		fprintf(stderr, "troff: cannot plant trap.\n");
X  		return;
X  	}
X***************
X*** 333,339
X  		errmsg(EWARN, "more than %d traps -- too many", NTRAP - 1);
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: cannot plant trap.\n");
X- #endif REPORTERRS
X  		return;
X  	}
X  	mlist[k] = j;
X
X--- 303,308 -----
X  	if (k == NTRAP) {
X  		flusho();
X  		fprintf(stderr, "troff: cannot plant trap.\n");
X  		return;
X  	}
X  	mlist[k] = j;
X***************
X*** 348,356
X  	lgf++;
X  	skip();
X  	if (!(j = getrq()))
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, ".ch: need a macro name and a place -- no name given");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 317,322 -----
X  	lgf++;
X  	skip();
X  	if (!(j = getrq()))
X  		return;
X  	else 
X  		for (k = 0; k < NTRAP; k++)
X***************
X*** 352,361
X  	{
X  		errmsg(EWARN, ".ch: need a macro name and a place -- no name given");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	else 
X  		for (k = 0; k < NTRAP; k++)
X  			if (mlist[k] == j)
X
X--- 318,323 -----
X  	skip();
X  	if (!(j = getrq()))
X  		return;
X  	else 
X  		for (k = 0; k < NTRAP; k++)
X  			if (mlist[k] == j)
X***************
X*** 361,369
X  			if (mlist[k] == j)
X  				break;
X  	if (k == NTRAP)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, ".ch: Can't change unplanted macro \"%s\"", realname(j));
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 323,328 -----
X  			if (mlist[k] == j)
X  				break;
X  	if (k == NTRAP)
X  		return;
X  	skip();
X  	i = vnumb((int *)0);
X***************
X*** 365,374
X  	{
X  		errmsg(EWARN, ".ch: Can't change unplanted macro \"%s\"", realname(j));
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	skip();
X  	i = vnumb((int *)0);
X  	if (nonumb)
X
X--- 324,329 -----
X  				break;
X  	if (k == NTRAP)
X  		return;
X  	skip();
X  	i = vnumb((int *)0);
X  	if (nonumb)
X***************
X*** 401,411
X  		npn = i;
X  		npnflg++;
X  	}
X- #ifdef REPORTERRS
X- 	else {
X- 		errmsg(EWARN, "Call to .pn with non-numeric argument ignored");
X- 	}
X- #endif REPORTERRS
X  }
X  
X  
X
X--- 356,361 -----
X  		npn = i;
X  		npnflg++;
X  	}
X  }
X  
X  
X***************
X*** 434,443
X  int	x;
X  {
X  	register i;
X- #ifdef TCHARTOS
X- 	tchar	tmbuf[NTM];
X- 	extern char *tchartos();
X- #else !TCHARTOS
X  	char	tmbuf[NTM];
X  #endif TCHARTOS
X  
X
X--- 384,389 -----
X  int	x;
X  {
X  	register i;
X  	char	tmbuf[NTM];
X  
X  	lgf++;
X***************
X*** 439,445
X  	extern char *tchartos();
X  #else !TCHARTOS
X  	char	tmbuf[NTM];
X- #endif TCHARTOS
X  
X  	lgf++;
X  	copyf++;
X
X--- 385,390 -----
X  {
X  	register i;
X  	char	tmbuf[NTM];
X  
X  	lgf++;
X  	copyf++;
X***************
X*** 452,463
X  		tmbuf[i++] = '\n';
X  	tmbuf[i] = 0;
X  	flusho();
X- #ifdef TCHARTOS
X- 	for (i = 0; i < NTM -2 && tmbuf[i] && tmbuf[i] != '\n'; i++) {
X- 		fprintf(stderr, tchartos(tmbuf[i]));
X- 	}
X- 	fprintf(stderr, "\n");
X- #else !TCHARTOS
X  	fprintf(stderr, "%s", tmbuf);
X  #endif TCHARTOS
X  	copyf--;
X
X--- 397,402 -----
X  		tmbuf[i++] = '\n';
X  	tmbuf[i] = 0;
X  	flusho();
X  	fprintf(stderr, "%s", tmbuf);
X  	copyf--;
X  }
X***************
X*** 459,465
X  	fprintf(stderr, "\n");
X  #else !TCHARTOS
X  	fprintf(stderr, "%s", tmbuf);
X- #endif TCHARTOS
X  	copyf--;
X  }
X  
X
X--- 398,403 -----
X  	tmbuf[i] = 0;
X  	flusho();
X  	fprintf(stderr, "%s", tmbuf);
X  	copyf--;
X  }
X  
X***************
X*** 539,547
X  	if (skip()) {
X  e0:
X  		if (evi == 0)
X- #ifdef REPORTERRS
X- 		{
X- 			errmsg(EWARN, ".ev at outermost level ignored");
X  			return;
X  		}
X  #else !REPORTERRS
X
X--- 477,482 -----
X  	if (skip()) {
X  e0:
X  		if (evi == 0)
X  			return;
X  		nxev =  evlist[--evi];
X  		goto e1;
X***************
X*** 543,552
X  		{
X  			errmsg(EWARN, ".ev at outermost level ignored");
X  			return;
X- 		}
X- #else !REPORTERRS
X- 			return;
X- #endif REPORTERRS
X  		nxev =  evlist[--evi];
X  		goto e1;
X  	}
X
X--- 478,483 -----
X  e0:
X  		if (evi == 0)
X  			return;
X  		nxev =  evlist[--evi];
X  		goto e1;
X  	}
X***************
X*** 556,582
X  	if (nonumb)
X  		goto e0;
X  	flushi();
X- #ifdef REPORTERRS
X- 	if (nxev >= NEV) {
X- 		flusho();
X- 		errmsg(error? done2 : edone, 040,
X- 				".ev %d: largest number allowed is %d",
X- 						nxev, NEV - 1);
X- 		return;
X- 	} else if (nxev < 0) {
X- 		flusho();
X- 		errmsg(error? done2 : edone, 040,
X- 				".ev %d: number must be in range 0-%d",
X- 						nxev, NEV - 1);
X- 		return;
X- 	} else if (evi >= EVLSZ) {
X- 		flusho();
X- 		errmsg(error? done2 : edone, 040,
X- 				".ev %d: Environments nested deeper than %d levels",
X- 						nxev, EVLSZ - 1);
X- 		return;
X- 	}
X- #else !REPORTERRS
X  	if ((nxev >= NEV) || (nxev < 0) || (evi >= EVLSZ)) {
X  		flusho();
X  		fprintf(stderr, "troff: cannot do ev.\n");
X
X--- 487,492 -----
X  	if (nonumb)
X  		goto e0;
X  	flushi();
X  	if ((nxev >= NEV) || (nxev < 0) || (evi >= EVLSZ)) {
X  		flusho();
X  		fprintf(stderr, "troff: cannot do ev.\n");
X***************
X*** 586,592
X  			edone(040);
X  		return;
X  	}
X- #endif REPORTERRS
X  	evlist[evi++] = ev;
X  e1:
X  	if (ev == nxev)
X
X--- 496,501 -----
X  			edone(040);
X  		return;
X  	}
X  	evlist[evi++] = ev;
X  e1:
X  	if (ev == nxev)
X***************
X*** 604,612
X  	if (--ifx < 0) {
X  		ifx = 0;
X  		iflist[0] = 0;
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, ".el without matching .if ignored");
X- #endif REPORTERRS
X  	}
X  	caseif(2);
X  }
X
X--- 513,518 -----
X  	if (--ifx < 0) {
X  		ifx = 0;
X  		iflist[0] = 0;
X  	}
X  	caseif(2);
X  }
X***************
X*** 615,625
X  caseie()
X  {
X  	if (ifx >= NIF) {
X- #ifdef REPORTERRS
X- 		ifx = 0;
X- 		errmsg(edone, 040, ".ie: if-else nested deeper than %d pairs",
X- 								    NIF - 1);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: if-else overflow.\n");
X  #endif REPORTERRS
X  	}
X
X--- 521,526 -----
X  caseie()
X  {
X  	if (ifx >= NIF) {
X  		fprintf(stderr, "troff: if-else overflow.\n");
X  		ifx = 0;
X  		edone(040);
X***************
X*** 621,627
X  								    NIF - 1);
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: if-else overflow.\n");
X! #endif REPORTERRS
X  	}
X  	caseif(1);
X  	ifx++;
X
X--- 522,529 -----
X  {
X  	if (ifx >= NIF) {
X  		fprintf(stderr, "troff: if-else overflow.\n");
X! 		ifx = 0;
X! 		edone(040);
X  	}
X  	caseif(1);
X  	ifx++;
X***************
X*** 641,652
X  		goto i1;
X  	}
X  	true = 0;
X- #ifdef REPORTERRS
X- 	if (skip()) {
X- 		errmsg(EWARN, ".i%c without test ignored",
X- 				(x == 0) ? 'f' : ((x < 2) ? 'e' : 'l') );
X- 	}
X- #else !REPORTERRS
X  	skip();
X  #endif REPORTERRS
X  	if ((cbits(i = getch())) == '!') {
X
X--- 543,548 -----
X  		goto i1;
X  	}
X  	true = 0;
X  	skip();
X  	if ((cbits(i = getch())) == '!') {
X  		notflag = 1;
X***************
X*** 648,654
X  	}
X  #else !REPORTERRS
X  	skip();
X- #endif REPORTERRS
X  	if ((cbits(i = getch())) == '!') {
X  		notflag = 1;
X  	} else {
X
X--- 544,549 -----
X  	}
X  	true = 0;
X  	skip();
X  	if ((cbits(i = getch())) == '!') {
X  		notflag = 1;
X  	} else {
X***************
X*** 655,674
X  		notflag = 0;
X  		ch = i;
X  	}
X- #ifdef REPORTERRS
X- 	/* atoi will moan if we give it something that's not an expression.
X- 	 * I'm not so sure it was a good idea giving atoi error checking!
X- 	 * Let's do a real kludge and have a gloval variable to turn off
X- 	 * error checking!
X- 	 * - req
X- 	 */
X- 	{
X- 		int save_errs = reporterrs;
X- 
X- 		reporterrs &= (~LERR_BADEXPSTART);
X- 		/* don't moan about leading garbage --
X- 		 * just assume there isn't an expression there
X- 		 */
X  		i = atoi();
X  		reporterrs = save_errs;
X  	}
X
X--- 550,555 -----
X  		notflag = 0;
X  		ch = i;
X  	}
X  	i = atoi();
X  	if (!nonumb) {
X  		if (i > 0)
X***************
X*** 670,680
X  		 * just assume there isn't an expression there
X  		 */
X  		i = atoi();
X- 		reporterrs = save_errs;
X- 	}
X- #else !REPORTERRS
X- 	i = atoi();
X- #endif REPORTERRS
X  	if (!nonumb) {
X  		if (i > 0)
X  			true++;
X
X--- 551,556 -----
X  		ch = i;
X  	}
X  	i = atoi();
X  	if (!nonumb) {
X  		if (i > 0)
X  			true++;
X***************
X*** 702,743
X  #endif
X  	case ' ':
X  		break;
X- #ifdef TESTFILES
X- 	case 'r':	/* true if file is readable */
X- 	{
X- 		int c;
X- 		char filename[NS];
X- 
X- 		if (skip()) {
X- errmsg(EWARN, ".i%c r: newline unexpected", x == 0 ? 'f' : 'e');
X- 			break;
X- 		}
X- 		for (i = 0; i < NS - 1; i++) {
X- 			int oldlgf = lgf;
X- 
X- 			/* I'm not sure what the 0176 is, but the others use
X- 			 * it too...
X- 			 * probably EOF.
X- 			 * - req
X- 			 */
X- 			lgf++;
X- 			if ((c = cbits(getch())) <= ' ' || c > 0176 ||
X- 						c == '\n' || nlflg) {
X- 				break;
X- 			} else {
X- 				filename[i] = c;
X- 			}
X- 		}
X- 		filename[i] = '\0';
X- 		if (c == '\n') {
X- 			errmsg(EWARN, ".i%c r \"%s\": newline unexpected", x == 0 ? 'f' : 'e', filename);
X- 		} else {
X- 			ch = c;
X- 		}
X- 		true = (access(filename, 4) >= 0);
X- 	}
X- 	break;
X- #endif TESTFILES
X  	default:
X  		true = cmpstr(i);
X  	}
X
X--- 578,583 -----
X  #endif
X  	case ' ':
X  		break;
X  	default:
X  		true = cmpstr(i);
X  	}
X***************
X*** 810,820
X  	if (ismot(c))
X  		return(0);
X  	delim = cbits(c);
X- #ifdef REPORTERRS
X- 	if (isvmot(delim)) {
X- 		errmsg(EWARN, "String delimiter is a vertical motion!");
X- 	}
X- #endif REPORTERRS
X  	if (dip != d)
X  		wbfl();
X  	if ((offset = begin = alloc()) == (filep)0)
X
X--- 650,655 -----
X  	if (ismot(c))
X  		return(0);
X  	delim = cbits(c);
X  	if (dip != d)
X  		wbfl();
X  	if ((offset = begin = alloc()) == (filep)0)
X***************
X*** 832,842
X  		wbf(i);
X  		cnt++;
X  	}
X- #ifdef REPORTERRS
X- 	if (j != delim) {
X- 		errmsg(EWARN, "Unexpected newline in conditional test");
X- 	}
X- #endif REPORTERRS
X  	wbt((tchar)0);
X  	k = !cnt;
X  	if (nlflg)
X
X--- 667,672 -----
X  		wbf(i);
X  		cnt++;
X  	}
X  	wbt((tchar)0);
X  	k = !cnt;
X  	if (nlflg)
X***************
X*** 853,863
X  	pinchar = inchar;	/* XXX */
X  	while ((j = cbits(i = getch())) != delim && j != '\n') {
X  		if (rbf0(p) != i) {
X- #ifdef REPORTERRS
X- 			if (eat(delim) != delim) {
X- 				errmsg(EWARN, "No closing delim \"%s\" for string test", tchartos(delim));
X- 			}
X- #else !REPORTERRS
X  			eat(delim);
X  #endif REPORTERRS
X  			k = 0;
X
X--- 683,688 -----
X  	pinchar = inchar;	/* XXX */
X  	while ((j = cbits(i = getch())) != delim && j != '\n') {
X  		if (rbf0(p) != i) {
X  			eat(delim);
X  			k = 0;
X  			break;
X***************
X*** 859,865
X  			}
X  #else !REPORTERRS
X  			eat(delim);
X- #endif REPORTERRS
X  			k = 0;
X  			break;
X  		}
X
X--- 684,689 -----
X  	while ((j = cbits(i = getch())) != delim && j != '\n') {
X  		if (rbf0(p) != i) {
X  			eat(delim);
X  			k = 0;
X  			break;
X  		}
X***************
X*** 866,876
X  		p = incoff(p);
X  		k = !(--cnt);
X  	}
X- #ifdef REPORTERRS
X- 	if (j == '\n') {
X- 		errmsg(EWARN, "Newline unexpected after string test");
X- 	}
X- #endif REPORTERRS
X  rtn:
X  	apts = savapts;
X  	apts1 = savapts1;
X
X--- 690,695 -----
X  		p = incoff(p);
X  		k = !(--cnt);
X  	}
X  rtn:
X  	apts = savapts;
X  	apts1 = savapts1;
X***************
X*** 954,963
X  	for (i = 0; ((i < (NTAB - 1)) && !nonumb); i++) {
X  		if (skip())
X  			break;
X- #ifdef ALIGNFIXES
X- 		tabtab[i] = tabtab[max(i-1, 0)] & TMASK;
X- 		tabtab[i] = max(hnumb(&tabtab[i]), 0) & TMASK;
X- #else !ALIGNFIXES
X  		tabtab[i] = max(hnumb(&tabtab[max(i-1,0)]), 0) & TMASK;
X  #endif ALIGNFIXES
X  		if (!nonumb) 
X
X--- 773,778 -----
X  	for (i = 0; ((i < (NTAB - 1)) && !nonumb); i++) {
X  		if (skip())
X  			break;
X  		tabtab[i] = max(hnumb(&tabtab[max(i-1,0)]), 0) & TMASK;
X  		if (!nonumb) 
X  			switch (cbits(ch)) {
X***************
X*** 959,965
X  		tabtab[i] = max(hnumb(&tabtab[i]), 0) & TMASK;
X  #else !ALIGNFIXES
X  		tabtab[i] = max(hnumb(&tabtab[max(i-1,0)]), 0) & TMASK;
X- #endif ALIGNFIXES
X  		if (!nonumb) 
X  			switch (cbits(ch)) {
X  			case 'C':
X
X--- 774,779 -----
X  		if (skip())
X  			break;
X  		tabtab[i] = max(hnumb(&tabtab[max(i-1,0)]), 0) & TMASK;
X  		if (!nonumb) 
X  			switch (cbits(ch)) {
X  			case 'C':
X***************
X*** 968,976
X  			case 'R':
X  				tabtab[i] |= RTAB;
X  				break;
X- #ifdef COMMENT
X- 			/* no error checking here.  Probably not a problem */
X- #endif COMMENT
X  			default: /*includes L*/
X  #ifdef REPORTERRS
X  				if (cbits(ch) != 'L' && cbits(ch) != ' ' &&
X
X--- 782,787 -----
X  			case 'R':
X  				tabtab[i] |= RTAB;
X  				break;
X  			default: /*includes L*/
X  				break;
X  			}
X***************
X*** 972,983
X  			/* no error checking here.  Probably not a problem */
X  #endif COMMENT
X  			default: /*includes L*/
X- #ifdef REPORTERRS
X- 				if (cbits(ch) != 'L' && cbits(ch) != ' ' &&
X- 				    cbits(ch) != '\t' && cbits(ch) != '\n') {
X- 					errmsg(EWARN, ".ta: tab suffix \"%s\" not L, R or C; using L", tchartos(ch));
X- 				}
X- #endif REPORTERRS
X  				break;
X  			}
X  		nonumb = ch = 0;
X
X--- 783,788 -----
X  				tabtab[i] |= RTAB;
X  				break;
X  			default: /*includes L*/
X  				break;
X  			}
X  		nonumb = ch = 0;
X***************
X*** 986,997
X  }
X  
X  
X- #ifdef COMMENT
X- /* note that for .ne to work in an intuitive way, there must be a .br before
X-  * it!!!
X-  * - req
X-  */
X- #endif COMMENT
X  casene()
X  {
X  	register i, j;
X
X--- 791,796 -----
X  }
X  
X  
X  casene()
X  {
X  	register i, j;
X***************
X*** 1010,1035
X  }
X  
X  
X- #ifdef COMMENT
X- /* lines like
X-  * 'trouble in the outer hebrides' was....
X-  * cause so many problems that it'd be nice to be able to spot them.
X-  *
X-  * A better approach to .tr would be to have a read-only string that
X-  * contained the current trtab[].  Then .tr \*(xx would be useful.
X-  * There is no way to turn off all translations, except one-at-a-time.
X-  * The s & f bits (see tdef.h or BWK's titroff paper) are not stored, so
X-  * you can't do useful things like
X-  * .tr *\s+2*
X-  * to make all stars come out bigger, or
X-  * .tr *\f(ma*
X-  * to use the * from font "ma" instead.  Really this would be introducing
X-  * single-character macros, though.  User defined fonts sound a better way
X-  * of doing this to me.
X-  *
X-  * - req
X-  */
X- #endif COMMENT
X  casetr()
X  {
X  	register i, j;
X
X--- 809,814 -----
X  }
X  
X  
X  casetr()
X  {
X  	register i, j;
X***************
X*** 1036,1046
X  	tchar k;
X  
X  	lgf++;
X- #ifdef REPORTERRS
X- 	if (skip()) {
X- 		errmsg(EWARN, ".tr with no arguments ignored");
X- 	}
X- #else !REPORTERRS
X  	skip();
X  #endif REPORTERRS
X  	while ((i = cbits(k=getch())) != '\n') {
X
X--- 815,820 -----
X  	tchar k;
X  
X  	lgf++;
X  	skip();
X  	while ((i = cbits(k=getch())) != '\n') {
X  		if (ismot(k))
X***************
X*** 1042,1048
X  	}
X  #else !REPORTERRS
X  	skip();
X- #endif REPORTERRS
X  	while ((i = cbits(k=getch())) != '\n') {
X  		if (ismot(k))
X  			return;
X
X--- 816,821 -----
X  
X  	lgf++;
X  	skip();
X  	while ((i = cbits(k=getch())) != '\n') {
X  		if (ismot(k))
X  			return;
X***************
X*** 1103,1111
X  }
X  
X  
X- #ifdef COMMENT
X- /* note -- there can only be one active input trap -- req */
X- #endif COMMENT
X  caseit()
X  {
X  	register i;
X
X--- 876,881 -----
X  }
X  
X  
X  caseit()
X  {
X  	register i;
X***************
X*** 1122,1133
X  }
X  
X  
X- #ifdef COMMENT
X- /* BUG: interaction between .nm (line number mode) and .mc (margin character)
X-  * whereby the margin character is indented wrongly on numbered lines!
X-  * - req
X-  */
X- #endif COMMENT
X  casemc()
X  {
X  	register i;
X
X--- 892,897 -----
X  }
X  
X  
X  casemc()
X  {
X  	register i;
X***************
X*** 1139,1165
X  		return;
X  	ic = getch();
X  	icf = 1;
X- #ifdef COMMENT
X- 	/* what should we do with ".mc xxx 4"?
X- 	 * it's an error, or we could allow a margin-string...
X- 	 * Let's be lazy.
X- 	 * -- req
X- 	 */
X- #endif COMMENT
X- #ifdef REPORTERRS
X- 	i = 0;
X- 	if (skip()) {	/* use old ics if nonumb */
X- 		return;
X- 	}
X- 	i = hnumb((int *) 0);
X- 	if (nonumb) {
X- 		errmsg(EWARN, ".mc: 2nd argument should be numeric");
X- 	} else if (i < 0) {
X- 		errmsg(EWARN, ".mc: offset N should be positive");
X- 	} else {
X- 		ics = i;
X- 	}
X- #else !REPORTERRS
X  	skip();
X  	i = max(hnumb((int *)0), 0);
X  	if (!nonumb)
X
X--- 903,908 -----
X  		return;
X  	ic = getch();
X  	icf = 1;
X  	skip();
X  	i = max(hnumb((int *)0), 0);
X  	if (!nonumb)
X***************
X*** 1164,1170
X  	i = max(hnumb((int *)0), 0);
X  	if (!nonumb)
X  		ics = i;
X- #endif REPORTERRS
X  }
X  
X  
X
X--- 907,912 -----
X  	i = max(hnumb((int *)0), 0);
X  	if (!nonumb)
X  		ics = i;
X  }
X  
X  
X***************
X*** 1181,1189
X  		return;
X  	}
X  	if ((i = getrq()) == 0)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, ".mk: 2nd argument must be a macro-name");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 923,928 -----
X  		return;
X  	}
X  	if ((i = getrq()) == 0)
X  		return;
X  	vlist[findr(i)] = j;
X  }
X***************
X*** 1185,1194
X  	{
X  		errmsg(EWARN, ".mk: 2nd argument must be a macro-name");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	vlist[findr(i)] = j;
X  }
X  
X
X--- 924,929 -----
X  	}
X  	if ((i = getrq()) == 0)
X  		return;
X  	vlist[findr(i)] = j;
X  }
X  
X***************
X*** 1199,1207
X  
X  	skip();
X  	if ((i = vnumb((int *)0)) < 0)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, ".sv request for negative (%d) space ignored", i);
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 934,939 -----
X  
X  	skip();
X  	if ((i = vnumb((int *)0)) < 0)
X  		return;
X  	if (nonumb)
X  		i = 1;
X***************
X*** 1203,1212
X  	{
X  		errmsg(EWARN, ".sv request for negative (%d) space ignored", i);
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	if (nonumb)
X  		i = 1;
X  	sv += i;
X
X--- 935,940 -----
X  	skip();
X  	if ((i = vnumb((int *)0)) < 0)
X  		return;
X  	if (nonumb)
X  		i = 1;
X  	sv += i;
X***************
X*** 1228,1246
X  }
X  
X  
X- #ifdef COMMENT
X- /* .nm +-N M S I -- line number mode: next line numbered N (+0 to continue)
X-  * Defaults: M = 1, number-text sepapation S = 1, line-number Indent I = 0
X-  * M > 1 prints only linenumbers that are multiples of M.
X-  *
X-  * Creaping featurism really -- it could probably be done with traps.
X-  *
X-  * Doing .af nl i
X-  * really ought to allow non-arabic line-numbers, I suppose.
X-  *
X-  * -req
X-  */
X- #endif COMMENT
X  casenm()
X  {
X  	register i;
X
X--- 956,961 -----
X  }
X  
X  
X  casenm()
X  {
X  	register i;
XOnly in titroff: n6.c
Xdiff -rbc titroff/n7.c /distribution/dwb/text/troff.d/n7.c
X*** titroff/n7.c	Mon Nov  3 14:27:47 1986
X--- /distribution/dwb/text/troff.d/n7.c	Fri Sep  9 18:46:01 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  extern
X  #include "d.h"
X
X--- 1,4 -----
X+ /*	@(#)n7.c	1.3	*/
X  #include "tdef.h"
X  extern
X  #include "d.h"
X***************
X*** 54,62
X  	if (dip == d)
X  		horiz(po);
X  #endif
X- #ifdef COMMENT
X- 	/* put out line numbers */
X- #endif COMMENT
X  	if (lnmod)
X  		donum();
X  	lastl = ne;
X
X--- 55,60 -----
X  	if (dip == d)
X  		horiz(po);
X  #endif
X  	if (lnmod)
X  		donum();
X  	lastl = ne;
X***************
X*** 126,140
X  			nc--;
X  		}
X  	}
X- #ifdef COMMENT
X- 	/* Margin Character is ic [sic].
X- 	 * BUG: if we have numbered this line, there's a horizontal
X- 	 * offset error!
X- 	 * Look at donum().
X- 	 *
X- 	 * req
X- 	 */
X- #endif COMMENT
X  	if (ic) {
X  		if ((k = ll - un - lastl + ics) > 0)
X  			horiz(k);
X
X--- 124,129 -----
X  			nc--;
X  		}
X  	}
X  	if (ic) {
X  		if ((k = ll - un - lastl + ics) > 0)
X  			horiz(k);
X***************
X*** 166,176
X  	extern pchar();
X  
X  	nrbits = nmbits;
X- #ifdef COMMENT
X- 	/* this all fails horribly if digits don't all have the same width!
X- 	 * - req
X- 	 */
X- #endif COMMENT
X  	nw = width('1' | nrbits);
X  	if (nn) {
X  		nn--;
X
X--- 155,160 -----
X  	extern pchar();
X  
X  	nrbits = nmbits;
X  	nw = width('1' | nrbits);
X  	if (nn) {
X  		nn--;
X***************
X*** 190,200
X  	horiz(nw * (ni + i));
X  	nform = 0;
X  	fnumb(v.ln, pchar);
X- #ifdef COMMENT
X- 	/* the next line screws up margin characters.
X- 	 * -req
X- 	 */
X- #endif COMMENT
X  	un += nw * nms;
X  	v.ln++;
X  }
X
X--- 174,179 -----
X  	horiz(nw * (ni + i));
X  	nform = 0;
X  	fnumb(v.ln, pchar);
X  	un += nw * nms;
X  	v.ln++;
X  }
X***************
X*** 204,221
X  {
X  	tchar i;
X  	static int	spcnt;
X- #ifdef BLANKSMACRO
X- 	static int	nlcnt;	/* no. of blank lines seen... */
X- 	/*  The idea is to call a macro set by .bm (default is sp) when
X- 	 * there's a line that starts with whitespace.
X- 	 * eg: 5 blank lines followed by
X- 	 * "   hello"
X- 	 * causes callblank(3, 5) because the 1st line with text on it
X- 	 * has 3 leading spaces & happens after 5 blank lines.
X- 	 *
X- 	 * - req
X- 	 */
X- #endif BLANKSMACRO
X  
X  	nflush++;
X  	if ((dip == d) && (v.nl == -1)) {
X
X--- 183,188 -----
X  {
X  	tchar i;
X  	static int	spcnt;
X  
X  	nflush++;
X  	if ((dip == d) && (v.nl == -1)) {
X***************
X*** 220,228
X  	nflush++;
X  	if ((dip == d) && (v.nl == -1)) {
X  		newline(1); 
X- #ifdef COMMENT
X- 		/* the first line of a new file */
X- #endif COMMENT
X  		return;
X  	}
X  	setnel();
X
X--- 187,192 -----
X  	nflush++;
X  	if ((dip == d) && (v.nl == -1)) {
X  		newline(1); 
X  		return;
X  	}
X  	setnel();
X***************
X*** 244,261
X  		spcnt++;
X  	if (nlflg) {
X  t1:
X- #ifdef BLANKSMACRO
X- 		/* call the .bl macro if lines start with  whitespace */
X- 		nlcnt++;
X- 		nflush = pendt = ch = 0;
X- 		if (spcnt) {
X- 			int x = spcnt, y = nlcnt;
X- 			spcnt = nlcnt = 0;	/* in case bm macro introduces
X- 						* a blank line */
X- 			callblank(x, y);
X- 		}
X- 		spcnt = 0;
X- #else !BLANKSMACRO
X  		nflush = pendt = ch = spcnt = 0;
X  		callsp();
X  #endif BLANKSMACRO
X
X--- 208,213 -----
X  		spcnt++;
X  	if (nlflg) {
X  t1:
X  		nflush = pendt = ch = spcnt = 0;
X  		callsp();
X  		return;
X***************
X*** 258,264
X  #else !BLANKSMACRO
X  		nflush = pendt = ch = spcnt = 0;
X  		callsp();
X- #endif BLANKSMACRO
X  		return;
X  	}
X  #ifdef BLANKSMACRO
X
X--- 210,215 -----
X  t1:
X  		nflush = pendt = ch = spcnt = 0;
X  		callsp();
X  		return;
X  	}
X  	ch = i;
X***************
X*** 261,278
X  #endif BLANKSMACRO
X  		return;
X  	}
X- #ifdef BLANKSMACRO
X- 	else {
X- 		if (nlcnt) {
X- 			int x = spcnt, y = nlcnt;
X- 
X- 			nflush = pendt = ch = 0;
X- 			nlcnt = spcnt = 0; /* in case bm macro introduces
X- 					    * a blank line */
X- 			callblank(x, y);
X- 		}
X- 	}
X- #endif BLANKSMACRO
X  	ch = i;
X  	if (spcnt) {
X  t2:
X
X--- 212,217 -----
X  		callsp();
X  		return;
X  	}
X  	ch = i;
X  	if (spcnt) {
X  t2:
X***************
X*** 403,411
X  	if (linep >= line + lnsize - 1) {
X  		if (!over) {
X  			flusho();
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "Internal error: Line overflow");
X- #else !REPORTERRS
X  			fprintf(stderr, "troff: Line overflow.\n");
X  #endif REPORTERRS
X  			over++;
X
X--- 342,347 -----
X  	if (linep >= line + lnsize - 1) {
X  		if (!over) {
X  			flusho();
X  			fprintf(stderr, "troff: Line overflow.\n");
X  			over++;
X  			c = LEFTHAND;
X***************
X*** 407,413
X  			errmsg(EWARN, "Internal error: Line overflow");
X  #else !REPORTERRS
X  			fprintf(stderr, "troff: Line overflow.\n");
X- #endif REPORTERRS
X  			over++;
X  			c = LEFTHAND;
X  			w = -1;
X
X--- 343,348 -----
X  		if (!over) {
X  			flusho();
X  			fprintf(stderr, "troff: Line overflow.\n");
X  			over++;
X  			c = LEFTHAND;
X  			w = -1;
X***************
X*** 517,525
X  	} else if ((i = findt(v.nl - nlss)) <= nlss) {
X  		if ((j = findn1(v.nl - nlss + i)) == NTRAP) {
X  			flusho();
X- #ifdef REPORTERRS
X- 			errmsg(done2, -5, "Internal error: Trap botch in __FILE__ at line __LINE__");
X- #else !REPORTERRS
X  			fprintf(stderr, "troff: Trap botch.\n");
X  			done2(-5);
X  #endif REPORTERRS
X
X--- 452,457 -----
X  	} else if ((i = findt(v.nl - nlss)) <= nlss) {
X  		if ((j = findn1(v.nl - nlss + i)) == NTRAP) {
X  			flusho();
X  			fprintf(stderr, "troff: Trap botch.\n");
X  			done2(-5);
X  		}
X***************
X*** 522,528
X  #else !REPORTERRS
X  			fprintf(stderr, "troff: Trap botch.\n");
X  			done2(-5);
X- #endif REPORTERRS
X  		}
X  		trap = control(mlist[j], 0);
X  	}
X
X--- 454,459 -----
X  			flusho();
X  			fprintf(stderr, "troff: Trap botch.\n");
X  			done2(-5);
X  		}
X  		trap = control(mlist[j], 0);
X  	}
X***************
X*** 805,812
X  	if (j != ' ') {
X  		if (j != '\n')
X  			goto g0;
X! 		j = cbits(*(wordp - 1));
X! 		if ((j == '.') ||  (j == '!') ||  (j == '?'))
X  			spflg++;
X  	}
X  	*wordp = 0;
X
X--- 736,747 -----
X  	if (j != ' ') {
X  		if (j != '\n')
X  			goto g0;
X! 		{ tchar *wp = wordp-1;
X! 		while (wp >= word) {
X! 			j = cbits(*wp--);
X! 			if (j=='"' || j=='\'' || j==')' ||j==']')
X! 				continue;
X! 			if (j == '.' || j == '!' || j == ':' || j == '?')
X  				spflg++;
X  			break;
X  		  }
X***************
X*** 808,813
X  		j = cbits(*(wordp - 1));
X  		if ((j == '.') ||  (j == '!') ||  (j == '?'))
X  			spflg++;
X  	}
X  	*wordp = 0;
X  rtn:
X
X--- 743,749 -----
X  				continue;
X  			if (j == '.' || j == '!' || j == ':' || j == '?')
X  				spflg++;
X+ 			break;
X  		  }
X  		}
X  	}
X***************
X*** 809,814
X  		if ((j == '.') ||  (j == '!') ||  (j == '?'))
X  			spflg++;
X  	}
X  	*wordp = 0;
X  rtn:
X  	wdstart = 0;
X
X--- 745,752 -----
X  				spflg++;
X  			break;
X  		  }
X+ 		}
X+ 	}
X  	*wordp = 0;
X  rtn:
X  	wdstart = 0;
X***************
X*** 828,836
X  	if (wordp >= &word[WDSIZE - 1]) {
X  		if (!over) {
X  			flusho();
X- #ifdef REPORTERRS
X- 			errmsg(EWARN, "Word overflow (word longer than %d chars)", WDSIZE - 1);
X- #else !REPORTERRS
X  			fprintf(stderr, "troff: Word overflow.\n");
X  #endif REPORTERRS
X  			over++;
X
X--- 766,771 -----
X  	if (wordp >= &word[WDSIZE - 1]) {
X  		if (!over) {
X  			flusho();
X  			fprintf(stderr, "troff: Word overflow.\n");
X  			over++;
X  			c = LEFTHAND;
X***************
X*** 832,838
X  			errmsg(EWARN, "Word overflow (word longer than %d chars)", WDSIZE - 1);
X  #else !REPORTERRS
X  			fprintf(stderr, "troff: Word overflow.\n");
X- #endif REPORTERRS
X  			over++;
X  			c = LEFTHAND;
X  			w = -1;
X
X--- 767,772 -----
X  		if (!over) {
X  			flusho();
X  			fprintf(stderr, "troff: Word overflow.\n");
X  			over++;
X  			c = LEFTHAND;
X  			w = -1;
Xdiff -rbc titroff/n8.c /distribution/dwb/text/troff.d/n8.c
X*** titroff/n8.c	Tue Nov 11 14:56:59 1986
X--- /distribution/dwb/text/troff.d/n8.c	Fri Sep  9 18:46:03 1983
X***************
X*** 1,3
X  #include	<ctype.h>
X  #include	"tdef.h"
X  #define	HY_BIT	0200	/* stuff in here only works for ascii */
X
X--- 1,4 -----
X+ /*      @(#)n8.c	1.1     */
X  #include	<ctype.h>
X  #include	"tdef.h"
X  #define	HY_BIT	0200	/* stuff in here only works for ascii */
X***************
X*** 122,130
X  	}
X  	return;
X  full:
X- #ifdef REPORTERRS
X- 	errmsg(EWARN, ".hw: exception word list full (%d bytes)", NHEX - 2);
X- #else !REPORTERRS
X  	fprintf(stderr, "troff: exception word list full.\n");
X  #endif REPORTERRS
X  	*nexth = 0;
X
X--- 123,128 -----
X  	}
X  	return;
X  full:
X  	fprintf(stderr, "troff: exception word list full.\n");
X  	*nexth = 0;
X  }
X***************
X*** 126,132
X  	errmsg(EWARN, ".hw: exception word list full (%d bytes)", NHEX - 2);
X  #else !REPORTERRS
X  	fprintf(stderr, "troff: exception word list full.\n");
X- #endif REPORTERRS
X  	*nexth = 0;
X  }
X  
X
X--- 124,129 -----
X  	return;
X  full:
X  	fprintf(stderr, "troff: exception word list full.\n");
X  	*nexth = 0;
X  }
X  
Xdiff -rbc titroff/n9.c /distribution/dwb/text/troff.d/n9.c
X*** titroff/n9.c	Tue Nov 11 15:01:18 1986
X--- /distribution/dwb/text/troff.d/n9.c	Fri Sep  9 18:46:08 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  extern
X  #include "d.h"
X
X--- 1,4 -----
X+ /*      @(#)n9.c	1.1     */
X  #include "tdef.h"
X  extern
X  #include "d.h"
X***************
X*** 34,42
X  	int	w, cnt, delim, rem, temp;
X  
X  	if (ismot(c = getch()))
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "\\l with unsuitable delimiter (vertical motion) ignored");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 35,40 -----
X  	int	w, cnt, delim, rem, temp;
X  
X  	if (ismot(c = getch()))
X  		return;
X  	delim = cbits(c);
X  	vflag = 0;
X***************
X*** 38,47
X  	{
X  		errmsg(EWARN, "\\l with unsuitable delimiter (vertical motion) ignored");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	delim = cbits(c);
X  	vflag = 0;
X  	dfact = EM;
X
X--- 36,41 -----
X  
X  	if (ismot(c = getch()))
X  		return;
X  	delim = cbits(c);
X  	vflag = 0;
X  	dfact = EM;
X***************
X*** 48,59
X  	length = quant(atoi(), HOR);
X  	dfact = 1;
X  	if (!length) {
X- #ifdef REPORTERRS
X- 		if (eat(delim) != delim) {
X- 			errmsg(EWARN, "\\l%s: zero length & no trailing delim",
X- 						tchartos(delim));
X- 		}
X- #else !REPORTERRS
X  		eat(delim);
X  #endif REPORTERRS
X  		return;
X
X--- 42,47 -----
X  	length = quant(atoi(), HOR);
X  	dfact = 1;
X  	if (!length) {
X  		eat(delim);
X  		return;
X  	}
X***************
X*** 55,61
X  		}
X  #else !REPORTERRS
X  		eat(delim);
X- #endif REPORTERRS
X  		return;
X  	}
X  s0:
X
X--- 43,48 -----
X  	dfact = 1;
X  	if (!length) {
X  		eat(delim);
X  		return;
X  	}
X  s0:
X***************
X*** 66,82
X  		goto s0;
X  	w = width(c);
X  	i = cbuf;
X- #ifdef ZEROLINES
X- 	if (w == 0) {
X- 		/* prevent zero-width char from causing a core dump! */
X- 		w = quant(EM, HOR);
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, "\\l: zero-width character used to draw a line\n");
X- #else !REPORTERRS
X- 		fprintf(stderr,"troff: Warning: zero-width character used to draw a line\n");
X- #endif REPORTERRS
X- 	}
X- #endif ZEROLINES
X  	if (length < 0) {
X  		*i++ = makem(length);
X  		length = -length;
X
X--- 53,58 -----
X  		goto s0;
X  	w = width(c);
X  	i = cbuf;
X  	if (length < 0) {
X  		*i++ = makem(length);
X  		length = -length;
X***************
X*** 99,114
X  	}
X  s1:
X  	*i++ = 0;
X- #ifdef REPORTERRS
X- 	c = getch();
X- 	if (cbits(c) != delim) {
X- 		if (cbits(c) == '\n') {
X- 			errmsg(EWARN, "\\l: newline unexpected");
X- 		} else {
X- 			errmsg(EWARN, "\\l: delimiters different (\"%s\" and \"%s\")", tchartos(delim), tchartos(c));
X- 		}
X- 	}
X- #else !REPORTERRS
X  	eat(delim);
X  #endif REPORTERRS
X  	cp = cbuf;
X
X--- 75,80 -----
X  	}
X  s1:
X  	*i++ = 0;
X  	eat(delim);
X  	cp = cbuf;
X  }
X***************
X*** 110,116
X  	}
X  #else !REPORTERRS
X  	eat(delim);
X- #endif REPORTERRS
X  	cp = cbuf;
X  }
X  
X
X--- 76,81 -----
X  s1:
X  	*i++ = 0;
X  	eat(delim);
X  	cp = cbuf;
X  }
X  
X***************
X*** 133,141
X  	int	delim, w[NOV];
X  
X  	if (ismot(i = getch()))
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "\\o: vertical motion unsuitable as delimiter");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 98,103 -----
X  	int	delim, w[NOV];
X  
X  	if (ismot(i = getch()))
X  		return;
X  	delim = cbits(i);
X  	for (k = 0; (k < NOV) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X***************
X*** 137,146
X  	{
X  		errmsg(EWARN, "\\o: vertical motion unsuitable as delimiter");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	delim = cbits(i);
X  #ifdef LONGOVFIX
X  	for (k = 0; (k < NOV - 1) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X
X--- 99,104 -----
X  
X  	if (ismot(i = getch()))
X  		return;
X  	delim = cbits(i);
X  	for (k = 0; (k < NOV) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X  		o[k] = i;
X***************
X*** 142,150
X  		return;
X  #endif REPORTERRS
X  	delim = cbits(i);
X- #ifdef LONGOVFIX
X- 	for (k = 0; (k < NOV - 1) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X- #else !LONGOVFIX
X  	for (k = 0; (k < NOV) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X  #endif LONGOVFIX
X  		o[k] = i;
X
X--- 100,105 -----
X  	if (ismot(i = getch()))
X  		return;
X  	delim = cbits(i);
X  	for (k = 0; (k < NOV) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X  		o[k] = i;
X  		w[k] = width(i);
X***************
X*** 146,152
X  	for (k = 0; (k < NOV - 1) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X  #else !LONGOVFIX
X  	for (k = 0; (k < NOV) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X- #endif LONGOVFIX
X  		o[k] = i;
X  		w[k] = width(i);
X  	}
X
X--- 101,106 -----
X  		return;
X  	delim = cbits(i);
X  	for (k = 0; (k < NOV) && ((j = cbits(i = getch())) != delim) &&  (j != '\n'); k++) {
X  		o[k] = i;
X  		w[k] = width(i);
X  	}
X***************
X*** 150,163
X  		o[k] = i;
X  		w[k] = width(i);
X  	}
X- #ifdef REPORTERRS
X- 	if (k >= NOV - 1) {
X- 		errmsg(EWARN, "\\o: overstrike longer than %d characters", NOV);
X- 	} else if (j == '\n') {
X- 		errmsg(EWARN,
X- 			"\\o: no trailing delimiter found to match \"%s\"", tchartos(delim));
X- 	}
X- #endif REPORTERRS
X  	o[k] = w[k] = 0;
X  	if (o[0])
X  		for (j = 1; j; ) {
X
X--- 104,109 -----
X  		o[k] = i;
X  		w[k] = width(i);
X  	}
X  	o[k] = w[k] = 0;
X  	if (o[0])
X  		for (j = 1; j; ) {
X***************
X*** 175,184
X  			}
X  		}
X  	else 
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "Empty overstrike \"\\o%s%s\" ignored",
X- 					tchartos(delim), tchartos(delim));
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 121,126 -----
X  			}
X  		}
X  	else 
X  		return;
X  	p = cbuf;
X  	for (k = 0; o[k]; k++) {
X***************
X*** 180,189
X  		errmsg(EWARN, "Empty overstrike \"\\o%s%s\" ignored",
X  					tchartos(delim), tchartos(delim));
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	p = cbuf;
X  	for (k = 0; o[k]; k++) {
X  		*p++ = o[k];
X
X--- 122,127 -----
X  		}
X  	else 
X  		return;
X  	p = cbuf;
X  	for (k = 0; o[k]; k++) {
X  		*p++ = o[k];
X***************
X*** 202,210
X  	int	cnt, delim;
X  
X  	if (ismot(i = getch()))
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "\\b: vertical motion unsuitable as delimiter");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 140,145 -----
X  	int	cnt, delim;
X  
X  	if (ismot(i = getch()))
X  		return;
X  	delim = cbits(i);
X  	j = cbuf + 1;
X***************
X*** 206,215
X  	{
X  		errmsg(EWARN, "\\b: vertical motion unsuitable as delimiter");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	delim = cbits(i);
X  	j = cbuf + 1;
X  	cnt = 0;
X
X--- 141,146 -----
X  
X  	if (ismot(i = getch()))
X  		return;
X  	delim = cbits(i);
X  	j = cbuf + 1;
X  	cnt = 0;
X***************
X*** 224,248
X  		*j++ = dwn;
X  		cnt++;
X  	}
X- #ifdef REPORTERRS
X- 	if (j > (cbuf + NC - 4)) {
X- 		errmsg(EWARN,
X- 			"Bracket (\\b) too long (truncated to %d characte",
X- 			cbuf + NC - 4);
X- 		while (((k = cbits(i = getch())) != delim) && (k != '\n')) {
X- 			/* throw away the rest... */
X- 			;
X- 		}
X- 	} 
X- 	if (k == '\n') {
X- 		errmsg(EWARN, "\\b: No delimiter found to match \"%s\"",
X- 						tchartos(delim));
X- 	} else if (--cnt < 0) {
X- 		errmsg(EWARN, "Empty bracket \"\\b%s%s\" ignored",
X- 				tchartos(delim), tchartos(delim));
X- 		return;
X- 	}
X- #else !REPORTERRS
X  	if (--cnt < 0)
X  		return;
X  #endif REPORTERRS
X
X--- 155,160 -----
X  		*j++ = dwn;
X  		cnt++;
X  	}
X  	if (--cnt < 0)
X  		return;
X  	else if (!cnt) {
X***************
X*** 245,251
X  #else !REPORTERRS
X  	if (--cnt < 0)
X  		return;
X- #endif REPORTERRS
X  	else if (!cnt) {
X  #ifdef ZBRACKFIX
X  		ch = *(j - 2) & ~ZBIT;
X
X--- 157,162 -----
X  	}
X  	if (--cnt < 0)
X  		return;
X  	else if (!cnt) {
X  		ch = *(j - 2);
X  		return;
X***************
X*** 247,269
X  		return;
X  #endif REPORTERRS
X  	else if (!cnt) {
X- #ifdef ZBRACKFIX
X- 		ch = *(j - 2) & ~ZBIT;
X- 		/* turn off the ZBIT (zero width) on single chars, or
X- 		 * there'd be a problem with \b'\zx', whereby the entire
X- 		 * bracket would have no space left for it.  Or maybe that's
X- 		 * how it *should* behave?  A \b with only 1 char seems an
X- 		 * odd thing to want anyway!
X- 		 *
X- 		 * Should we warn the user?  Probably not.  The only time
X- 		 * this is likely to happen involves machine-generated
X- 		 * troff input.
X- 		 *
X- 		 * What about \b'' --- should that be an error?!??
X- 		 *
X- 		 * -- req, after John Buck (trixie!polyof!john), 7/10/86
X- 		 */
X- #else !ZBRACKFIX
X  		ch = *(j - 2);
X  #endif ZBRACKFIX
X  		return;
X
X--- 158,163 -----
X  	if (--cnt < 0)
X  		return;
X  	else if (!cnt) {
X  		ch = *(j - 2);
X  		return;
X  	}
X***************
X*** 265,271
X  		 */
X  #else !ZBRACKFIX
X  		ch = *(j - 2);
X- #endif ZBRACKFIX
X  		return;
X  	}
X  	*j = 0;
X
X--- 159,164 -----
X  		return;
X  	else if (!cnt) {
X  		ch = *(j - 2);
X  		return;
X  	}
X  	*j = 0;
X***************
X*** 287,295
X  	int	cnt, delim, v;
X  
X  	if (ismot(c = getch()))
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "\\L: unsuitable start delimiter");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 180,185 -----
X  	int	cnt, delim, v;
X  
X  	if (ismot(c = getch()))
X  		return;
X  	delim = cbits(c);
X  	dfact = lss;
X***************
X*** 291,300
X  	{
X  		errmsg(EWARN, "\\L: unsuitable start delimiter");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	delim = cbits(c);
X  	dfact = lss;
X  	vflag++;
X
X--- 181,186 -----
X  
X  	if (ismot(c = getch()))
X  		return;
X  	delim = cbits(c);
X  	dfact = lss;
X  	vflag++;
X***************
X*** 301,311
X  	i = quant(atoi(), VERT);
X  	dfact = 1;
X  	if (!i) {
X- #ifdef REPORTERRS
X- 		if (eat(delim) != delim) {
X- 			errmsg(EWARN, "Vertical line (\\L): no closing delimiter");
X- 		} /* not an error to have a zero-length line */
X- #else !REPORTERRS
X  		eat(delim);
X  #endif REPORTERRS
X  		vflag = 0;
X
X--- 187,192 -----
X  	i = quant(atoi(), VERT);
X  	dfact = 1;
X  	if (!i) {
X  		eat(delim);
X  		vflag = 0;
X  		return;
X***************
X*** 307,313
X  		} /* not an error to have a zero-length line */
X  #else !REPORTERRS
X  		eat(delim);
X- #endif REPORTERRS
X  		vflag = 0;
X  		return;
X  	}
X
X--- 188,193 -----
X  	dfact = 1;
X  	if (!i) {
X  		eat(delim);
X  		vflag = 0;
X  		return;
X  	}
X***************
X*** 314,334
X  	if ((cbits(c = getch())) == delim) {
X  		c = BOXRULE | chbits;	/*default box rule*/
X  	} else 
X- #ifdef REPORTERRS
X- 	{
X- 		int delim2 = cbits(getch());
X- 
X- 		if (delim2 != delim) {
X- 			if (delim2 == '\n') {
X- 				errmsg(EWARN, "\\v: unexpected newline");
X- 			} else {
X- 				errmsg(EWARN,
X- 	"\\v: expected closing delim \"%s\", found \"%s\"",
X- 			tchartos(delim), tchartos(delim2));
X- 			}
X- 		}
X- 	}
X- #else !REPORTERRS
X  		getch();
X  #endif REPORTERRS
X  	c |= ZBIT;
X
X--- 194,199 -----
X  	if ((cbits(c = getch())) == delim) {
X  		c = BOXRULE | chbits;	/*default box rule*/
X  	} else 
X  		getch();
X  	c |= ZBIT;
X  	neg = 0;
X***************
X*** 330,336
X  	}
X  #else !REPORTERRS
X  		getch();
X- #endif REPORTERRS
X  	c |= ZBIT;
X  	neg = 0;
X  	if (i < 0) {
X
X--- 195,200 -----
X  		c = BOXRULE | chbits;	/*default box rule*/
X  	} else 
X  		getch();
X  	c |= ZBIT;
X  	neg = 0;
X  	if (i < 0) {
X***************
X*** 343,354
X  #ifndef NROFF
X  	v = EM;
X  #endif
X- #ifdef REPORTERRS
X- 	if (!v) {
X- 		errmsg(EWARN, "Internal error: !v (__FILE__:__LINE__)");
X- 		v = EM;
X- 	}
X- #endif REPORTERRS
X  	cnt = i / v;
X  	rem = makem(i % v) | neg;
X  	ver = makem(v) | neg;
X
X--- 207,212 -----
X  #ifndef NROFF
X  	v = EM;
X  #endif
X  	cnt = i / v;
X  	rem = makem(i % v) | neg;
X  	ver = makem(v) | neg;
X***************
X*** 374,382
X  
X  setdraw()	/* generate internal cookies for a drawing function */
X  {
X- #ifdef DXLIM
X- 	int i, j, k, dx[DXLIM], dy[DXLIM], delim, type, temp;
X- #else !DXLIM
X  	int i, j, k, dx[100], dy[100], delim, type, temp;
X  #endif DXLIM
X  	tchar c;
X
X--- 232,237 -----
X  
X  setdraw()	/* generate internal cookies for a drawing function */
X  {
X  	int i, j, k, dx[100], dy[100], delim, type, temp;
X  	tchar c;
X  	/* input is \D'f x y x y ... c' (or at least it had better be) */
X***************
X*** 378,384
X  	int i, j, k, dx[DXLIM], dy[DXLIM], delim, type, temp;
X  #else !DXLIM
X  	int i, j, k, dx[100], dy[100], delim, type, temp;
X- #endif DXLIM
X  	tchar c;
X  	/* input is \D'f x y x y ... c' (or at least it had better be) */
X  	/* this does drawing function f with character c and the */
X
X--- 233,238 -----
X  setdraw()	/* generate internal cookies for a drawing function */
X  {
X  	int i, j, k, dx[100], dy[100], delim, type, temp;
X  	tchar c;
X  	/* input is \D'f x y x y ... c' (or at least it had better be) */
X  	/* this does drawing function f with character c and the */
X***************
X*** 389,402
X  	/* e x y:	ellipse of diameters x,y, left side here */
X  	/* a x y r:	arc to x,y with radius r (ccw) */
X  	/* ~ x y ...:	wiggly line */
X- #ifdef GREMLIN
X- 	/* t n:		line thickness n */
X- 	/* s n:		line style mask set to n */
X- 	/* g x y ...:	gremlin [!??!?] don't ask me!  - req */
X- #endif GREMLIN
X- #ifdef ANYBASESTR
X- 	/* b drawingstuff ' text ': use DRAWFCN as baseline for text -- req */
X- #endif ANYBASESTR
X  
X  	if (ismot(c = getch()))
X  #ifdef REPORTERRS
X
X--- 243,248 -----
X  	/* e x y:	ellipse of diameters x,y, left side here */
X  	/* a x y r:	arc to x,y with radius r (ccw) */
X  	/* ~ x y ...:	wiggly line */
X  
X  	if (ismot(c = getch()))
X  		return;
X***************
X*** 399,407
X  #endif ANYBASESTR
X  
X  	if (ismot(c = getch()))
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "\\D: Unsuitable delimiter for drawing function");
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 245,250 -----
X  	/* ~ x y ...:	wiggly line */
X  
X  	if (ismot(c = getch()))
X  		return;
X  	delim = cbits(c);
X  	type = cbits(getch());
X***************
X*** 403,412
X  	{
X  		errmsg(EWARN, "\\D: Unsuitable delimiter for drawing function");
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	delim = cbits(c);
X  	type = cbits(getch());
X  #ifdef REPORTERRS
X
X--- 246,251 -----
X  
X  	if (ismot(c = getch()))
X  		return;
X  	delim = cbits(c);
X  	type = cbits(getch());
X  	for (i = 0; i < 50 ; i++) {
X***************
X*** 409,447
X  #endif REPORTERRS
X  	delim = cbits(c);
X  	type = cbits(getch());
X- #ifdef REPORTERRS
X- 	switch(type) {
X- 
X- 	default:
X- 		errmsg(EWARN, "\\D%c: unknown drawing function \"%c\"",
X- 								type, type);
X- 		break;
X- 
X- 	case DRAWLINE:
X- 	case DRAWCIRCLE:
X- 	case DRAWELLIPSE:
X- 	case DRAWARC:
X- 	case DRAWWIG:
X- #ifdef GREMLIN
X- 	case DRAWGREM:
X- 	case DRAWTHICK:
X- 	case DRAWLSTYLE:
X- #endif GREMLIN
X- #ifdef ANYBASESTR
X- 	case DRAWBASESTR:
X- #endif ANYBASESTR
X- 
X- 	/* do nothing -- only the default action is interesting!
X- 	 * - req
X- 	 */
X- 	break;
X- 
X- 	}
X- #endif REPORTERRS
X- 
X- #ifdef DXLIM
X- 	for (i = 0; i < DXLIM/2 ; i++) {
X- #else !DXLIM
X  	for (i = 0; i < 50 ; i++) {
X  #endif DXLIM
X  #ifdef COMMENT
X
X--- 248,253 -----
X  		return;
X  	delim = cbits(c);
X  	type = cbits(getch());
X  	for (i = 0; i < 50 ; i++) {
X  		c = getch();
X  		if (cbits(c) == delim)
X***************
X*** 443,452
X  	for (i = 0; i < DXLIM/2 ; i++) {
X  #else !DXLIM
X  	for (i = 0; i < 50 ; i++) {
X- #endif DXLIM
X- #ifdef COMMENT
X- 	/* } */  /* (brace is for bracket matching tool!) */
X- #endif COMMENT
X  		c = getch();
X  		if (cbits(c) == delim)
X  			break;
X
X--- 249,254 -----
X  	delim = cbits(c);
X  	type = cbits(getch());
X  	for (i = 0; i < 50 ; i++) {
X  		c = getch();
X  		if (cbits(c) == delim)
X  			break;
X***************
X*** 472,482
X  		else if (dy[i] < -MAXMOT)
X  			dy[i] = -MAXMOT;
X  	}
X- #ifdef REPORTERRS
X- 	if (cbits(c) != delim) {
X- 		errmsg(EWARN, "\\D: more than %d parameters", i - 1);
X- 	}
X- #endif REPORTERRS
X  	dfact = 1;
X  	vflag = 0;
X  #ifndef NROFF
X
X--- 274,279 -----
X  		else if (dy[i] < -MAXMOT)
X  			dy[i] = -MAXMOT;
X  	}
X  	dfact = 1;
X  	vflag = 0;
X  #ifndef NROFF
X***************
X*** 536,544
X  	for (j = 0; ; j++) {
X  		if ((tabtab[j] & TMASK) == 0) {
X  			if (x == savfc)
X- #ifdef REPORTERRS
X- 				errmsg(EWARN, "zero field width");
X- #else !REPORTERRS
X  				fprintf(stderr, "troff: zero field width.\n");
X  #endif REPORTERRS
X  			jj = 0;
X
X--- 333,338 -----
X  	for (j = 0; ; j++) {
X  		if ((tabtab[j] & TMASK) == 0) {
X  			if (x == savfc)
X  				fprintf(stderr, "troff: zero field width.\n");
X  			jj = 0;
X  			goto rtn;
X***************
X*** 540,546
X  				errmsg(EWARN, "zero field width");
X  #else !REPORTERRS
X  				fprintf(stderr, "troff: zero field width.\n");
X- #endif REPORTERRS
X  			jj = 0;
X  			goto rtn;
X  		}
X
X--- 334,339 -----
X  		if ((tabtab[j] & TMASK) == 0) {
X  			if (x == savfc)
X  				fprintf(stderr, "troff: zero field width.\n");
X  			jj = 0;
X  			goto rtn;
X  		}
Xdiff -rbc titroff/ni.c /distribution/dwb/text/troff.d/ni.c
X*** titroff/ni.c	Fri Oct 31 19:13:42 1986
X--- /distribution/dwb/text/troff.d/ni.c	Tue Oct 25 17:24:10 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  
X  /* You may want to change these names */
X
X--- 1,4 -----
X+ /*      @(#)ni.c	1.2     */
X  #include "tdef.h"
X  
X  /* You may want to change these names */
X***************
X*** 3,15
X  /* You may want to change these names */
X  
X  #ifndef NROFF
X! char	termtab[NS] = FONTFILE;	/* rest added in ptinit() */
X! char	fontfile[NS] = FONTFILE;	/* rest added in casefp() */
X! #ifdef DESCHASNAME
X! char	devname[10]	 = "default";	/* default typesetter */
X! #else !DESCHASNAME
X! char	devname[10]	 = "va";	/* default typesetter */
X! #endif DESCHASNAME
X  #endif
X  char	obuf[OBUFSZ];	/* characters collected here for actual typesetter output */
X  char	*obufp = obuf;
X
X--- 4,12 -----
X  /* You may want to change these names */
X  
X  #ifndef NROFF
X! char	termtab[NS] = "/usr/lib/font";	/* rest added in ptinit() */
X! char	fontfile[NS] = "/usr/lib/font";	/* rest added in casefp() */
X! char	devname[12]	 = "aps";	/* default typesetter */
X  #endif
X  char	obuf[OBUFSZ];	/* characters collected here for actual typesetter output */
X  char	*obufp = obuf;
X***************
X*** 29,37
X  	PAIR('s', 'b'),
X  	PAIR('c', '.'),
X  	PAIR('$', '$'),
X- #ifdef WARNLEVELREG
X- 	PAIR('w', 'l'),		/* warning level */
X- #endif WARNLEVELREG
X  };
X  
X  
X
X--- 26,31 -----
X  	PAIR('s', 'b'),
X  	PAIR('c', '.'),
X  	PAIR('$', '$'),
X  };
X  
X  
X***************
X*** 91,105
X  casecc(), casec2(), caseem(), caseaf(), casehw(), casemc(), casepm(),
X  casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(),
X  caseht(), casecf(), casesy();
X- #ifdef ROTATEPAGE
X- extern caserp();	/* rotate page -- req */
X- #endif ROTATEPAGE
X- #ifdef FONTFAMILIES
X- extern caseff();	/* font family -- req */
X- #endif FONTFAMILIES
X- #ifdef BLANKSMACRO
X- extern casebm();	/* blanks macro -- req */
X- #endif BLANKSMACRO
X  
X  #ifdef COMMENT
X  /* the comments are because we can't initialise a union in C
X
X--- 85,90 -----
X  casecc(), casec2(), caseem(), caseaf(), casehw(), casemc(), casepm(),
X  casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(),
X  caseht(), casecf(), casesy();
X  
X  struct contab {
X  	int	rq;
X***************
X*** 101,111
X  extern casebm();	/* blanks macro -- req */
X  #endif BLANKSMACRO
X  
X- #ifdef COMMENT
X- /* the comments are because we can't initialise a union in C
X-  * - req
X-  */
X- #endif COMMENT
X  struct contab {
X  	int	rq;
X  	/*
X
X--- 86,91 -----
X  casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(),
X  caseht(), casecf(), casesy();
X  
X  struct contab {
X  	int	rq;
X  	/*
X***************
X*** 202,217
X  	PAIR('h', 't'), caseht,
X  	PAIR('c', 'f'), casecf,
X  	PAIR('s', 'y'), casesy,
X! 	PAIR('!', 0), casesy,	/* synonym for .sy */
X! #ifdef ROTATEPAGE
X! 	PAIR('r', 'p'), caserp,	/* .rp -- rotate page */
X! #endif ROTATEPAGE
X! #ifdef FONTFAMILIES
X! 	PAIR('f', 'f'), caseff, /*.ff -- font family */
X! #endif FONTFAMILIES
X! #ifdef BLANKSMACRO
X! 	PAIR('b', 'm'), casebm, /* .bl xx -- blanks macro */
X! #endif BLANKSMACRO
X  };
X  
X  
X
X--- 182,188 -----
X  	PAIR('h', 't'), caseht,
X  	PAIR('c', 'f'), casecf,
X  	PAIR('s', 'y'), casesy,
X! /*	PAIR('!', 0), casesy,	/* synonym for .sy */
X  };
X  
X  
X***************
X*** 268,274
X  int	c2	 = '\'';
X  int	ohc	 = OHC;
X  int	tdelim	 = IMP;
X! int	hyf	 = 1;
X  int	hyoff	 = 0;
X  int	un1	 = -1;
X  int	tabc	 = 0;
X
X--- 239,245 -----
X  int	c2	 = '\'';
X  int	ohc	 = OHC;
X  int	tdelim	 = IMP;
X! int	hyf	 = 0;
X  int	hyoff	 = 0;
X  int	un1	 = -1;
X  int	tabc	 = 0;
X***************
X*** 323,325
X  
X  char	blockxxx[EVSPARE]	 = {
X  	0};
X
X--- 294,298 -----
X  
X  char	blockxxx[EVSPARE]	 = {
X  	0};
X+ 
X+ 
SHAR_EOF
if test 49231 -ne "`wc -c < 'diffc'`"
then
	echo shar: error transmitting "'diffc'" '(should have been 49231 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
ARPA		req%uu.warwick.ac.uk@ucl-cs.arpa
EARN/BITNET	req%UK.AC.WARWICK.UU@AC.UK
JANET		req@uk.ac.warwick.uu
UUCP		seismo!mcvax!ukc!warwick!req  (req@warwick.UUCP)
PHONE		+44 203 523485
For mail.frplist, use "frplist" instead of "req" in the above lines.
The BITNET path only works from sites that have AC.UK in their tables.  Sorry.

req@warwick.UUCP (11/21/86)

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	diffd
# This archive created: Thu Nov 20 21:50:10 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'diffd'" '(59948 characters)'
if test -f 'diffd'
then
	echo shar: will not over-write existing file "'diffd'"
else
sed 's/^X//' << \SHAR_EOF > 'diffd'
Xdiff -rbc titroff/nii.c /distribution/dwb/text/troff.d/nii.c
X*** titroff/nii.c	Mon Oct 13 15:30:32 1986
X--- /distribution/dwb/text/troff.d/nii.c	Fri Sep  9 18:46:14 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  #ifdef NROFF
X  #include "tw.h"
X
X--- 1,4 -----
X+ /*      @(#)nii.c	1.1     */
X  #include "tdef.h"
X  #ifdef NROFF
X  #include "tw.h"
X***************
X*** 129,147
X  int	dotT;
X  char	*unlkp;
X  int	no_out;
X- #ifdef LOCALWARN
X- #include "local.h"
X- #ifdef WARNLEVELREG
X- int	warninglevel = WARN_ONCE;
X- #else !WARNLEVELREG
X- /* use v.nl instead, with the same values */
X- #endif WARNLEVELREG
X-        /* warninglevel is:
X- 	* 0 -- no warnings
X- 	* 1 -- 1 warning the 1st time a non-standard feature is used
X- 	* 2 -- warn about every non-standard feature
X- 	*
X- 	* these are defined in local.h
X- 	* REQ
X- 	*/
X- #endif LOCALWARN
X
X--- 130,132 -----
X  int	dotT;
X  char	*unlkp;
X  int	no_out;
Xdiff -rbc titroff/s.h /distribution/dwb/text/troff.d/s.h
X*** titroff/s.h	Sun Feb 21 15:07:45 1982
X--- /distribution/dwb/text/troff.d/s.h	Fri Sep  9 18:46:16 1983
X***************
X*** 1,3
X  struct s {
X  	int nargs;
X  	struct s *pframe;
X
X--- 1,4 -----
X+ /*      @(#)s.h	1.1     */
X  struct s {
X  	int nargs;
X  	struct s *pframe;
Xdiff -rbc titroff/suftab.c /distribution/dwb/text/troff.d/suftab.c
X*** titroff/suftab.c	Wed Jan 11 10:26:33 1984
X--- /distribution/dwb/text/troff.d/suftab.c	Fri Sep  9 18:46:26 1983
X***************
X*** 1,3
X  /*
X   * Suffix table
X   */
X
X--- 1,4 -----
X+ /*      @(#)suftab.c	1.1     */
X  /*
X   * Suffix table
X   */
Xdiff -rbc titroff/t10.c /distribution/dwb/text/troff.d/t10.c
X*** titroff/t10.c	Thu Oct 23 18:29:01 1986
X--- /distribution/dwb/text/troff.d/t10.c	Fri Sep  9 18:46:35 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  extern
X  #include "d.h"
X
X--- 1,4 -----
X+ /*      @(#)t10.c	1.1     */
X  #include "tdef.h"
X  extern
X  #include "d.h"
X***************
X*** 13,22
X  #include "ext.h"
X  int	vpos	 = 0;	/* absolute vertical position on page */
X  int	hpos	 = 0;	/* ditto horizontal */
X- #ifdef PAPERSIZEREG
X- int	paperlength = 0;	/* from DESC */
X- int	paperwidth = 0;		/* ditto */
X- #endif PAPERSIZEREG
X  
X  #define	T_IESC	16
X  
X
X--- 14,19 -----
X  #include "ext.h"
X  int	vpos	 = 0;	/* absolute vertical position on page */
X  int	hpos	 = 0;	/* ditto horizontal */
X  
X  #define	T_IESC	16
X  
X***************
X*** 71,101
X  	/* read in resolution, size info, font info, etc.
X  	/* and set params
X  	*/
X- #ifdef USEFONTPATH
X- 	extern char *fontpath;	/* from t6.c */
X- 	extern char *followpath();	/* in local.c */
X- 	extern char *strcpy();
X- 
X- 	if (fontpath && *fontpath) {
X- 		p = followpath(fontpath, "DESC.out", 0);
X- 		if (!p || !*p) {
X- #ifdef REPORTERRS
X- 			errmsg(done3, 1,
X- 				"Can't find DESC.out in path %s", fontpath);
X- #else !REPORTERRS
X- 			fprintf(stderr,
X- 				"troff: can't find DESC.out in path %s",
X- 								fontpath);
X- 			done3(1);
X- #endif REPORTERRS
X- 		} else {
X- 			(void) strcpy(termtab, p);
X- 			/* fits because both termtab and
X- 			 * local.c:followpath().result are NS chars long,
X- 			 * and followpath checks
X- 			 */
X- 		}
X- 	} else {
X  		strcat(termtab, "/dev");
X  		strcat(termtab, devname);
X  		strcat(termtab, "/DESC.out");
X
X--- 68,73 -----
X  	/* read in resolution, size info, font info, etc.
X  	/* and set params
X  	*/
X  	strcat(termtab, "/dev");
X  	strcat(termtab, devname);
X  	strcat(termtab, "/DESC.out");	/* makes "..../devXXX/DESC.out" */
X***************
X*** 98,108
X  	} else {
X  		strcat(termtab, "/dev");
X  		strcat(termtab, devname);
X- 		strcat(termtab, "/DESC.out");
X- 	}
X- #else !USEFONTPATH
X- 	strcat(termtab, "/dev");
X- 	strcat(termtab, devname);
X  	strcat(termtab, "/DESC.out");	/* makes "..../devXXX/DESC.out" */
X  #endif USEFONTPATH
X  	if ((fin = open(termtab, 0)) < 0) {
X
X--- 70,75 -----
X  	*/
X  	strcat(termtab, "/dev");
X  	strcat(termtab, devname);
X  	strcat(termtab, "/DESC.out");	/* makes "..../devXXX/DESC.out" */
X  	if ((fin = open(termtab, 0)) < 0) {
X  		fprintf(stderr, "troff: can't open tables for %s\n", termtab);
X***************
X*** 104,110
X  	strcat(termtab, "/dev");
X  	strcat(termtab, devname);
X  	strcat(termtab, "/DESC.out");	/* makes "..../devXXX/DESC.out" */
X- #endif USEFONTPATH
X  	if ((fin = open(termtab, 0)) < 0) {
X  #ifdef REPORTERRS
X  		errmsg(done3, 1, "can't open %s (table for device %s)", termtab, devname);
X
X--- 71,76 -----
X  	strcat(termtab, "/dev");
X  	strcat(termtab, devname);
X  	strcat(termtab, "/DESC.out");	/* makes "..../devXXX/DESC.out" */
X  	if ((fin = open(termtab, 0)) < 0) {
X  		fprintf(stderr, "troff: can't open tables for %s\n", termtab);
X  		done3(1);
X***************
X*** 106,114
X  	strcat(termtab, "/DESC.out");	/* makes "..../devXXX/DESC.out" */
X  #endif USEFONTPATH
X  	if ((fin = open(termtab, 0)) < 0) {
X- #ifdef REPORTERRS
X- 		errmsg(done3, 1, "can't open %s (table for device %s)", termtab, devname);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: can't open tables for %s\n", termtab);
X  		done3(1);
X  #endif REPORTERRS
X
X--- 72,77 -----
X  	strcat(termtab, devname);
X  	strcat(termtab, "/DESC.out");	/* makes "..../devXXX/DESC.out" */
X  	if ((fin = open(termtab, 0)) < 0) {
X  		fprintf(stderr, "troff: can't open tables for %s\n", termtab);
X  		done3(1);
X  	}
X***************
X*** 111,117
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: can't open tables for %s\n", termtab);
X  		done3(1);
X- #endif REPORTERRS
X  	}
X  #ifndef DMBTEST
X  	if (read(fin, &dev, sizeof(struct dev )) != sizeof (struct dev)) {
X
X--- 74,79 -----
X  	if ((fin = open(termtab, 0)) < 0) {
X  		fprintf(stderr, "troff: can't open tables for %s\n", termtab);
X  		done3(1);
X  	}
X  	read(fin, &dev, sizeof(struct dev ));
X  	Inch = dev.res;
X***************
X*** 113,128
X  		done3(1);
X  #endif REPORTERRS
X  	}
X- #ifndef DMBTEST
X- 	if (read(fin, &dev, sizeof(struct dev )) != sizeof (struct dev)) {
X- #ifdef REPORTERRS
X- 		errmsg(done3, 1, "can't read in device structure (%d bytes)", sizeof (struct dev));
X- #else !REPORTERRS
X- 		fprintf(stderr, "troff: can't read in device structure\n");
X- 		done3(1);
X- #endif REPORTERRS
X- 	}
X- #else DMBTEST
X  	read(fin, &dev, sizeof(struct dev ));
X  #endif DMBTEST
X  	Inch = dev.res;
X
X--- 75,80 -----
X  		fprintf(stderr, "troff: can't open tables for %s\n", termtab);
X  		done3(1);
X  	}
X  	read(fin, &dev, sizeof(struct dev ));
X  	Inch = dev.res;
X  	Hor = dev.hor;
X***************
X*** 124,130
X  	}
X  #else DMBTEST
X  	read(fin, &dev, sizeof(struct dev ));
X- #endif DMBTEST
X  	Inch = dev.res;
X  	Hor = dev.hor;
X  	Vert = dev.vert;
X
X--- 76,81 -----
X  		done3(1);
X  	}
X  	read(fin, &dev, sizeof(struct dev ));
X  	Inch = dev.res;
X  	Hor = dev.hor;
X  	Vert = dev.vert;
X***************
X*** 130,150
X  	Vert = dev.vert;
X  	Unitwidth = dev.unitwidth;
X  	nfonts = dev.nfonts;
X- #ifdef CHECKNFONTS
X- 	if (nfonts > NFONT) {
X- #ifdef REPORTERRS
X- 		errmsg(done3, 2, "too many pre-loaded fonts (%d, max %d); check DESC & makedev.c", nfonts, NFONT);
X- 		/* should be done3 rather than edone, as we don't want to
X- 		 * continue.  I was wrong when I put the CHECKNFONTS in, by
X- 		 * virtue of cribbing from bwk...
X- 		 * - req
X- 		 */
X- #else !REPORTERRS
X- 		fprintf(stderr, "troff: too many pre-loaded fonts (%d, max %d); check DESC & makedev.c\n", nfonts, NFONT);
X- 		edone(04);  /* is this right ?? */
X- #endif REPORTERRS
X- 	}
X- #endif CHECKNFONTS
X  	nsizes = dev.nsizes;
X  	nchtab = dev.nchtab;
X  #ifdef PAPERSIZEREG
X
X--- 81,86 -----
X  	Vert = dev.vert;
X  	Unitwidth = dev.unitwidth;
X  	nfonts = dev.nfonts;
X  	nsizes = dev.nsizes;
X  	nchtab = dev.nchtab;
X  	filebase = setbrk(dev.filesize + 2*EXTRAFONT);	/* enough room for whole file */
X***************
X*** 147,159
X  #endif CHECKNFONTS
X  	nsizes = dev.nsizes;
X  	nchtab = dev.nchtab;
X- #ifdef PAPERSIZEREG
X- 	paperlength = dev.paperlength;
X- 	paperwidth = dev.paperwidth;
X- #endif PAPERSIZEREG
X- #ifdef DESCHASNAME
X- 	(void) strncpy(devname, dev.dname, sizeof(dev.dname) - 1);
X- #endif DESCHASNAME
X  	filebase = setbrk(dev.filesize + 2*EXTRAFONT);	/* enough room for whole file */
X  #ifdef REPORTERRS
X  	/* Read in pre-loaded fonts and gunk all at once */
X
X--- 83,88 -----
X  	nfonts = dev.nfonts;
X  	nsizes = dev.nsizes;
X  	nchtab = dev.nchtab;
X  	filebase = setbrk(dev.filesize + 2*EXTRAFONT);	/* enough room for whole file */
X  	read(fin, filebase, dev.filesize);	/* all at once */
X  	pstab = (short *) filebase;
X***************
X*** 155,166
X  	(void) strncpy(devname, dev.dname, sizeof(dev.dname) - 1);
X  #endif DESCHASNAME
X  	filebase = setbrk(dev.filesize + 2*EXTRAFONT);	/* enough room for whole file */
X- #ifdef REPORTERRS
X- 	/* Read in pre-loaded fonts and gunk all at once */
X- 	if (read(fin, filebase, dev.filesize) != dev.filesize) {
X- 		errmsg(done3, 3, "Internal error: Failed to read %d bytes from %s at __FILE__:__LINE__", termtab, dev.filesize);
X- 	}
X- #else !REPORTERRS
X  	read(fin, filebase, dev.filesize);	/* all at once */
X  #endif REPORTERRS
X  	pstab = (short *) filebase;
X
X--- 84,89 -----
X  	nsizes = dev.nsizes;
X  	nchtab = dev.nchtab;
X  	filebase = setbrk(dev.filesize + 2*EXTRAFONT);	/* enough room for whole file */
X  	read(fin, filebase, dev.filesize);	/* all at once */
X  	pstab = (short *) filebase;
X  	chtab = pstab + nsizes + 1;
X***************
X*** 162,168
X  	}
X  #else !REPORTERRS
X  	read(fin, filebase, dev.filesize);	/* all at once */
X- #endif REPORTERRS
X  	pstab = (short *) filebase;
X  	chtab = pstab + nsizes + 1;
X  	chname = (char *) (chtab + dev.nchtab);
X
X--- 85,90 -----
X  	nchtab = dev.nchtab;
X  	filebase = setbrk(dev.filesize + 2*EXTRAFONT);	/* enough room for whole file */
X  	read(fin, filebase, dev.filesize);	/* all at once */
X  	pstab = (short *) filebase;
X  	chtab = pstab + nsizes + 1;
X  	chname = (char *) (chtab + dev.nchtab);
X***************
X*** 218,230
X    */
X  }
X  
X- #ifdef COMMENT
X- /* Really, all of this DESC.out stuff isn't done properly at all. 
X-  * The link between special names in troff & the post-processors is an
X-  * almighty hack.  But at least it works.
X-  * -req
X-  */
X- #endif COMMENT
X  specnames()
X  {
X  	static struct {
X
X--- 140,145 -----
X    */
X  }
X  
X  specnames()
X  {
X  	static struct {
X***************
X*** 252,263
X  	};
X  	int	i;
X  
X- #ifdef COMMENT
X- 	/* could moan about not having important characters here, perhaps.
X- 	 * but that's better left to makedev (which doesn't do it either)
X- 	 *- req
X- 	 */
X- #endif COMMENT
X  	for (i = 0; spnames[i].n; i++)
X  		*spnames[i].n = findch(spnames[i].v);
X  }
X
X--- 167,172 -----
X  	};
X  	int	i;
X  
X  	for (i = 0; spnames[i].n; i++)
X  		*spnames[i].n = findch(spnames[i].v);
X  }
X***************
X*** 445,454
X  			vpos += dy + dy2;
X  			break;
X  		case DRAWWIG:	/* wiggly line */
X- #ifdef GREMLIN
X- 		case DRAWGREM:	/* gremlin - do both in one switch... */
X- 			fprintf(ptid, "D%c %d %d", cbits(pi[1]), dx, dy);
X- #else !GREMLIN
X  			fprintf(ptid, "D%c %d %d", DRAWWIG, dx, dy);
X  #endif GREMLIN
X  			w = 0;
X
X--- 354,359 -----
X  			vpos += dy + dy2;
X  			break;
X  		case DRAWWIG:	/* wiggly line */
X  			fprintf(ptid, "D%c %d %d", DRAWWIG, dx, dy);
X  			w = 0;
X  			hpos += dx;
X***************
X*** 450,456
X  			fprintf(ptid, "D%c %d %d", cbits(pi[1]), dx, dy);
X  #else !GREMLIN
X  			fprintf(ptid, "D%c %d %d", DRAWWIG, dx, dy);
X- #endif GREMLIN
X  			w = 0;
X  			hpos += dx;
X  			vpos += dy;
X
X--- 355,360 -----
X  			break;
X  		case DRAWWIG:	/* wiggly line */
X  			fprintf(ptid, "D%c %d %d", DRAWWIG, dx, dy);
X  			w = 0;
X  			hpos += dx;
X  			vpos += dy;
X***************
X*** 454,465
X  			w = 0;
X  			hpos += dx;
X  			vpos += dy;
X- #ifdef COMMENT
X- 			/* no check for overflow here, but probably
X- 			 * OK because setdraw() checks.
X- 			 * - req
X- 			 */
X- #endif COMMENT
X  			for (n = 5; cbits(pi[n]) != '.'; n += 2) {
X  				dx = absmot(pi[n]);
X  				if (isnmot(pi[n]))
X
X--- 358,363 -----
X  			w = 0;
X  			hpos += dx;
X  			vpos += dy;
X  			for (n = 5; cbits(pi[n]) != '.'; n += 2) {
X  				dx = absmot(pi[n]);
X  				if (isnmot(pi[n]))
X***************
X*** 473,490
X  			}
X  			fprintf(ptid, "\n");
X  			break;
X- #ifdef GREMLIN
X- 		case DRAWTHICK:		/* line thickness */
X- 		case DRAWLSTYLE:	/* line style mask */
X- 			fprintf(ptid, "D%c %d\n", dx);
X- 			break;
X- #endif GREMLIN
X- #ifdef REPORTERRS
X- 		/* a warning is printed by setdraw, so we don't need one
X- 		 * here.
X- 		 * - req
X- 		 */
X- #endif REPORTERRS
X  		}
X  #ifdef MOVEAFTERDRAW
X  		/* tell the post-processor where we are... */
X
X--- 371,376 -----
X  			}
X  			fprintf(ptid, "\n");
X  			break;
X  		}
X  		for (n = 3; cbits(pi[n]) != '.'; n++)
X  			;
X***************
X*** 486,495
X  		 */
X  #endif REPORTERRS
X  		}
X- #ifdef MOVEAFTERDRAW
X- 		/* tell the post-processor where we are... */
X- 		fprintf(ptid, "H%d\nV%d\n", hpos, vpos);
X- #endif MOVEAFTERDRAW
X  		for (n = 3; cbits(pi[n]) != '.'; n++)
X  			;
X  		outsize = n + 1;
X
X--- 372,377 -----
X  			fprintf(ptid, "\n");
X  			break;
X  		}
X  		for (n = 3; cbits(pi[n]) != '.'; n++)
X  			;
X  		outsize = n + 1;
X***************
X*** 584,592
X  		return;
X  	flusho();
X  	fprintf(ptid, "p%d\n", n);	/* new page */
X- #ifdef ROTATEPAGE
X- 	ptpangle();	/* rotated page angle, local .c --- req */
X- #endif ROTATEPAGE
X  	ptps();
X  	ptfont();
X  }
X
X--- 466,471 -----
X  		return;
X  	flusho();
X  	fprintf(ptid, "p%d\n", n);	/* new page */
X  	ptps();
X  	ptfont();
X  }
Xdiff -rbc titroff/t6.c /distribution/dwb/text/troff.d/t6.c
X*** titroff/t6.c	Wed Nov 19 21:31:41 1986
X--- /distribution/dwb/text/troff.d/t6.c	Fri Sep  9 18:46:43 1983
X***************
X*** 1,3
X  #include "tdef.h"
X  extern
X  #include "d.h"
X
X--- 1,4 -----
X+ /*      @(#)t6.c	1.2     */
X  #include "tdef.h"
X  extern
X  #include "d.h"
X***************
X*** 23,33
X  int	bdtab[NFONT+1];
X  int	sbold = 0;
X  
X- #ifdef COMMENT
X- /* width() gets the width of drawing functions wrong.
X-  * - req
X-  */
X- #endif COMMENT
X  width(j)
X  tchar j;
X  {
X
X--- 24,29 -----
X  int	bdtab[NFONT+1];
X  int	sbold = 0;
X  
X  width(j)
X  tchar j;
X  {
X***************
X*** 47,62
X  		k = -widthp;
X  		goto rtn;
X  	}
X- #ifdef WIDTHOFDRAWFIX
X- 	if (i == DRAW) {
X- 		/* work out the width of the drawing function...
X- 		 * - req
X- 		 */
X- 		 /* unfortunately, we can't do this, as we don't have
X- 		  * enough information...
X- 		  */
X- 	}
X- #endif WIDTHOFDRAWFIX
X  	if (i == PRESC)
X  		i = eschar;
X  	else if (i == ohc || iscontrol(i))
X
X--- 43,48 -----
X  		k = -widthp;
X  		goto rtn;
X  	}
X  	if (i == PRESC)
X  		i = eschar;
X  	else if (i == ohc || iscontrol(i))
X***************
X*** 190,198
X  	extern int	nchtab;
X  
X  	s = temp;
X- #ifdef COMMENT
X- 	/* should use getrq() here, but that returns a tchar */
X- #endif COMMENT
X  	if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0)
X  #ifdef REPORTERRS
X  	{
X
X--- 176,181 -----
X  	extern int	nchtab;
X  
X  	s = temp;
X  	if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0)
X  		return(0);
X  	*s = '\0';
X***************
X*** 194,203
X  	/* should use getrq() here, but that returns a tchar */
X  #endif COMMENT
X  	if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0)
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "\\(xx -- need 2 characters after (, only got %d",
X- 					s - temp);
X  		return(0);
X  	}
X  #else !REPORTERRS
X
X--- 177,182 -----
X  
X  	s = temp;
X  	if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0)
X  		return(0);
X  	*s = '\0';
X  	for (j = 0; j < nchtab; j++)
X***************
X*** 199,208
X  		errmsg(EWARN, "\\(xx -- need 2 characters after (, only got %d",
X  					s - temp);
X  		return(0);
X- 	}
X- #else !REPORTERRS
X- 		return(0);
X- #endif REPORTERRS
X  	*s = '\0';
X  	for (j = 0; j < nchtab; j++)
X  		if (strcmp(&chname[chtab[j]], temp) == 0)
X
X--- 178,183 -----
X  	s = temp;
X  	if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0)
X  		return(0);
X  	*s = '\0';
X  	for (j = 0; j < nchtab; j++)
X  		if (strcmp(&chname[chtab[j]], temp) == 0)
X***************
X*** 207,215
X  	for (j = 0; j < nchtab; j++)
X  		if (strcmp(&chname[chtab[j]], temp) == 0)
X  			return(j + 128 | chbits);
X- #ifdef REPORTERRS
X- 	errmsg(EWARN, "Special character \\(%s doesn't exist", s);
X- #endif REPORTERRS
X  	return(0);
X  }
X  
X
X--- 182,187 -----
X  	for (j = 0; j < nchtab; j++)
X  		if (strcmp(&chname[chtab[j]], temp) == 0)
X  			return(j + 128 | chbits);
X  	return(0);
X  }
X  
X***************
X*** 226,235
X  {
X  	register k;
X  
X- #ifdef RIBSFIX
X- 	/* if S has been unmounted (overwritten), smnt set to zero... */
X- 	if ((k = i - '0') >= 0 && k <= nfonts && (smnt && k != smnt))
X- #else !RIBSFIX
X  	if ((k = i - '0') >= 0 && k <= nfonts && k < smnt)
X  #endif RIBSFIX
X  		return(k);
X
X--- 198,203 -----
X  {
X  	register k;
X  
X  	if ((k = i - '0') >= 0 && k <= nfonts && k < smnt)
X  		return(k);
X  	for (k = 0; fontlab[k] != i; k++)
X***************
X*** 231,237
X  	if ((k = i - '0') >= 0 && k <= nfonts && (smnt && k != smnt))
X  #else !RIBSFIX
X  	if ((k = i - '0') >= 0 && k <= nfonts && k < smnt)
X- #endif RIBSFIX
X  		return(k);
X  	for (k = 0; fontlab[k] != i; k++)
X  		if (k > nfonts)
X
X--- 199,204 -----
X  	register k;
X  
X  	if ((k = i - '0') >= 0 && k <= nfonts && k < smnt)
X  		return(k);
X  	for (k = 0; fontlab[k] != i; k++)
X  		if (k > nfonts)
X***************
X*** 251,265
X  		i = inumb(&apts);	/* this is a disaster for fractional point sizes */
X  		noscale = 0;
X  		if (nonumb)
X- #ifdef REPORTERRS
X- 		{
X- 			tchar nextc = getch();
X- 
X- 			if (cbits(nextc) == '\n') {
X- 				errmsg(".ps: newline unexpected");
X- 			} else {
X- 				errmsg(EWARN, ".ps: bad expression from \"%s\" ignored", tchartos(nextc));
X- 			}
X  			return;
X  		}
X  #else !REPORTERRS
X
X--- 218,223 -----
X  		i = inumb(&apts);	/* this is a disaster for fractional point sizes */
X  		noscale = 0;
X  		if (nonumb)
X  			return;
X  	}
X  	casps1(i);
X***************
X*** 262,271
X  			}
X  			return;
X  		}
X- #else !REPORTERRS
X- 			return;
X- #endif REPORTERRS
X- 	}
X  	casps1(i);
X  }
X  
X
X--- 220,225 -----
X  		if (nonumb)
X  			return;
X  	}
X  	casps1(i);
X  }
X  
X***************
X*** 283,294
X  }
X  
X  
X- #ifdef COMMENT
X- /* Should we moan about unfound sizes?  Plethora of moans from eqn, I expect!
X-  * As the effect is already documented, let's not.
X-  * - req
X-  */
X- #endif COMMENT
X  findps(i)
X  register int	i;
X  {
X
X--- 237,242 -----
X  }
X  
X  
X  findps(i)
X  register int	i;
X  {
X***************
X*** 294,305
X  {
X  	register j, k;
X  
X! 	for (j = 0; i > (k = pstab[j]); j++)
X! 		if (!k) {
X! 			k = pstab[--j];
X! 			break;
X! 		}
X! 	return(k);
X  }
X  
X  
X
X--- 242,254 -----
X  {
X  	register j, k;
X  
X! 	for (j=k=0 ; pstab[j]!=0 ; j++)
X! 		if ( abs(pstab[j]-i) < abs(pstab[k]-i) )
X! 			k = j ;
X! 
X! 	if ( pstab[k] != i )
X! 		fprintf(stderr,"troff: asked for size %d, got %d\n",i,pstab[k]) ;
X! 	return(pstab[k]);
X  }
X  
X  
X***************
X*** 320,332
X  }
X  
X  
X- #ifdef COMMENT
X- /* should really check here more carefully.  It would be nice to warn the
X-  * user that \s106 is a ten-point "6", or that \s47 is a four-point 7.
X-  * I will if I get a few more minutes tonight.
X-  * - req
X-  */
X- #endif COMMENT
X  setps()
X  {
X  	register i, j;
X
X--- 269,274 -----
X  }
X  
X  
X  setps()
X  {
X  	register i, j;
X***************
X*** 349,366
X  			i = 10 * i + j;
X  			ch = 0;
X  		}
X- #ifdef REPORTERRS
X- 		/* warn if the next input char is a digit... */
X- 		if (i >= 3 || (j >= 0 && j <= 9)) { /* where's isdigit() !? */
X- 			j = cbits(ch = getch()) - '0';
X- 		}
X- 		if ((reporterrs & LERR_PSNUMWARN) && j >= 0 && j <= 9) {
X- 			/* next char is a digit.  Probably an error! */
X- 			/* we know it's a digit, so no tchartos() needed */
X- 			errmsg(EWARN, "\\s%d%c is a %d-point %c",
X- 			i, j + '0', i, j + '0');
X- 		}
X- #endif REPORTERRS
X  		casps1(i);
X  	}
X  #ifdef REPORTERRS
X
X--- 291,296 -----
X  			i = 10 * i + j;
X  			ch = 0;
X  		}
X  		casps1(i);
X  	}
X  }
X***************
X*** 363,376
X  #endif REPORTERRS
X  		casps1(i);
X  	}
X- #ifdef REPORTERRS
X- 	else
X- 	{
X- 		/* error -- ignored */
X- 		i += '0';
X- 		errmsg(EWARN, "\\s%s ignored%s", tchartos(i), (cbits(i) == 'P') ? " (use \\s0 for previous size)" : " ");
X- 	}
X- #endif REPORTERRS
X  }
X  
X  
X
X--- 293,298 -----
X  		}
X  		casps1(i);
X  	}
X  }
X  
X  
X***************
X*** 379,396
X  	int n;
X  	tchar c;
X  
X- #ifdef REPORTERRS
X- 	tchar delim1, delim2;
X- 
X- 	if (cbits((delim1 = getch())) == '\n') {
X- 		errmsg(EWARN, "\\H: newline unexpected");
X- 		return;
X- 	} else if (ismot(delim1)) {
X- 		errmsg(EWARN, "\\H: Unsuitable delimiter \"%s\"",
X- 							tchartos(delim1));
X- 		return;
X- 	}
X- #else !REPORTERRS
X  	getch();
X  #endif REPORTERRS
X  	n = inumb(&apts);
X
X--- 301,306 -----
X  	int n;
X  	tchar c;
X  
X  	getch();
X  	n = inumb(&apts);
X  	getch();
X***************
X*** 392,398
X  	}
X  #else !REPORTERRS
X  	getch();
X- #endif REPORTERRS
X  	n = inumb(&apts);
X  #ifdef REPORTERRS
X  	if (cbits(delim2 = getch()) != cbits(delim1)) {
X
X--- 302,307 -----
X  	tchar c;
X  
X  	getch();
X  	n = inumb(&apts);
X  	getch();
X  	if (n == 0 || nonumb)
X***************
X*** 394,408
X  	getch();
X  #endif REPORTERRS
X  	n = inumb(&apts);
X- #ifdef REPORTERRS
X- 	if (cbits(delim2 = getch()) != cbits(delim1)) {
X- 		if (cbits(delim2) == '\n') {
X- 			errmsg(EWARN, "\\H: expected trailing delim \"%s\", found newline", tchartos(delim1));
X- 		} else {
X- 			errmsg(EWARN, "\\H: expected close delim \"%s\", found \"%s\"", tchartos(delim1), tchartos(delim2));
X- 		}
X- 	}
X- #else !REPORTERRS
X  	getch();
X  #endif REPORTERRS
X  	if (n == 0 || nonumb)
X
X--- 303,308 -----
X  
X  	getch();
X  	n = inumb(&apts);
X  	getch();
X  	if (n == 0 || nonumb)
X  		n = apts;	/* does this work? */
X***************
X*** 404,410
X  	}
X  #else !REPORTERRS
X  	getch();
X- #endif REPORTERRS
X  	if (n == 0 || nonumb)
X  		n = apts;	/* does this work? */
X  	c = CHARHT;
X
X--- 304,309 -----
X  	getch();
X  	n = inumb(&apts);
X  	getch();
X  	if (n == 0 || nonumb)
X  		n = apts;	/* does this work? */
X  	c = CHARHT;
X***************
X*** 418,431
X  	int n;
X  	tchar c;
X  
X- #ifdef REPORTERRS
X- 	tchar delim1, delim2;
X- 
X- 	if (cbits(delim1 = getch()) == '\n') {
X- 		errmsg(EWARN, "\\S: newline unexpected");
X- 		return;
X- 	}
X- #else !REPORTERRS
X  	getch();
X  #endif REPORTERRS
X  	n = 0;
X
X--- 317,322 -----
X  	int n;
X  	tchar c;
X  
X  	getch();
X  	n = 0;
X  	n = inumb(&n);
X***************
X*** 427,433
X  	}
X  #else !REPORTERRS
X  	getch();
X- #endif REPORTERRS
X  	n = 0;
X  	n = inumb(&n);
X  #ifdef REPORTERRS
X
X--- 318,323 -----
X  	tchar c;
X  
X  	getch();
X  	n = 0;
X  	n = inumb(&n);
X  	getch();
X***************
X*** 430,444
X  #endif REPORTERRS
X  	n = 0;
X  	n = inumb(&n);
X- #ifdef REPORTERRS
X- 	if (cbits(delim2 = getch()) != cbits(delim1)) {
X- 		if (cbits(delim2) == '\n') {
X- 			errmsg(EWARN, "\\S: expected trailing delim \"%s\", found newline", tchartos(delim1));
X- 		} else {
X- 			errmsg(EWARN, "\\S: expected close delim \"%s\", found \"%s\"", tchartos(delim1), tchartos(delim2));
X- 		}
X- 	}
X- #else !REPORTERRS
X  	getch();
X  #endif REPORTERRS
X  	if (nonumb)
X
X--- 320,325 -----
X  	getch();
X  	n = 0;
X  	n = inumb(&n);
X  	getch();
X  	if (nonumb)
X  		n = 0;
X***************
X*** 440,446
X  	}
X  #else !REPORTERRS
X  	getch();
X- #endif REPORTERRS
X  	if (nonumb)
X  		n = 0;
X  	c = SLANT;
X
X--- 321,326 -----
X  	n = 0;
X  	n = inumb(&n);
X  	getch();
X  	if (nonumb)
X  		n = 0;
X  	c = SLANT;
X***************
X*** 470,501
X  		j = font1;
X  		goto s0;
X  	}
X- #ifdef RIBSFIX
X- 	/* R I B & S are no longer names of specific fonts;
X- 	 * they're synonyms for given font positions.  This was always how most
X- 	 * people thought of them in any case, so it's easier to change it than
X- 	 * to tell them the (old) truth...
X- 	 * REQ
X- 	 */
X- 	switch (i) {
X- 		case 'R':	/* Relative Roman */
X- 			i = '1';
X- 			break;
X- 		case 'I':	/* Relative Italic */
X- 			i = '2';
X- 			break;
X- 		case 'B':	/* Relative Bold */
X- 			i = '3';
X- 			break;
X- 		case 'X':	/* Bold Italic (ugh, 2-char names...) */
X- 			i = '4';
X- 			break;
X- 		case 'S':	/* Special (meaningless) */
X- 			if (smnt)
X- 				return;	/* can't change to Special font */
X- 		/* default: fall through... */
X- 	}
X- #else !RIBSFIX
X  	if (i == 'S' || i == '0')
X  		return;
X  #endif RIBSFIX
X
X--- 350,355 -----
X  		j = font1;
X  		goto s0;
X  	}
X  	if (i == 'S' || i == '0')
X  		return;
X  	if ((j = findft(i)) == -1)
X***************
X*** 498,504
X  #else !RIBSFIX
X  	if (i == 'S' || i == '0')
X  		return;
X- #endif RIBSFIX
X  	if ((j = findft(i)) == -1)
X  		if ((j = setfp(0, i, 0)) == -1)	/* try to put it in position 0 */
X  			return;
X
X--- 352,357 -----
X  	}
X  	if (i == 'S' || i == '0')
X  		return;
X  	if ((j = findft(i)) == -1)
X  		if ((j = setfp(0, i, 0)) == -1)	/* try to put it in position 0 */
X  			return;
X***************
X*** 519,527
X  
X  	base = v.st = v.sb = wid = v.ct = 0;
X  	if (ismot(i = getch()))
X- #ifdef REPORTERRS
X- 	{
X- 		errmsg(EWARN, "\\w: unsuitable delimiter \"%s\"", tchartos(i));
X  		return;
X  	}
X  #else !REPORTERRS
X
X--- 372,377 -----
X  
X  	base = v.st = v.sb = wid = v.ct = 0;
X  	if (ismot(i = getch()))
X  		return;
X  	delim = cbits(i);
X  	savhp = v.hp;
X***************
X*** 523,532
X  	{
X  		errmsg(EWARN, "\\w: unsuitable delimiter \"%s\"", tchartos(i));
X  		return;
X- 	}
X- #else !REPORTERRS
X- 		return;
X- #endif REPORTERRS
X  	delim = cbits(i);
X  	savhp = v.hp;
X  	savpinchar = pinchar;	/* XXX */
X
X--- 373,378 -----
X  	base = v.st = v.sb = wid = v.ct = 0;
X  	if (ismot(i = getch()))
X  		return;
X  	delim = cbits(i);
X  	savhp = v.hp;
X  	savpinchar = pinchar;	/* XXX */
X***************
X*** 559,569
X  		if ((k = base + em) > v.st)
X  			v.st = k;
X  	}
X- #ifdef REPORTERRS
X- 	if (cbits(i) != delim) {
X- 		errmsg(EWARN, "\\w: no trailing delimiter found to match \"%s\"", tchartos(i));
X- 	}
X- #endif REPORTERRS
X  	nform = 0;
X  	setn1(wid);
X  	v.hp = savhp;
X
X--- 405,410 -----
X  		if ((k = base + em) > v.st)
X  			v.st = k;
X  	}
X  	nform = 0;
X  	setn1(wid);
X  	v.hp = savhp;
X***************
X*** 602,616
X  	register short j, n;
X  	tchar i;
X  
X- #ifdef REPORTERRS
X- 	tchar delim1, delim2;
X- 
X- 	if ((delim1 = cbits(getch())) == '\n') {
X- 		errmsg(EWARN, "\\h: newline unexpected");
X- 		return;
X- 	} else if (ismot(delim1)) {
X- 		errmsg(EWARN, "\\h: \"%s\" unsuitable delim", tchartos(delim1));
X- 	}
X  	j = HOR;
X  #else !REPORTERRS
X  	j = HOR;
X
X--- 443,448 -----
X  	register short j, n;
X  	tchar i;
X  
X  	j = HOR;
X  	getch(); /*eat delim*/
X  	if (n = atoi()) {
X***************
X*** 612,619
X  		errmsg(EWARN, "\\h: \"%s\" unsuitable delim", tchartos(delim1));
X  	}
X  	j = HOR;
X- #else !REPORTERRS
X- 	j = HOR;
X  	getch(); /*eat delim*/
X  #endif REPORTERRS
X  	if (n = atoi()) {
X
X--- 444,449 -----
X  	tchar i;
X  
X  	j = HOR;
X  	getch(); /*eat delim*/
X  	if (n = atoi()) {
X  		if (vflag)
X***************
X*** 615,621
X  #else !REPORTERRS
X  	j = HOR;
X  	getch(); /*eat delim*/
X- #endif REPORTERRS
X  	if (n = atoi()) {
X  		if (vflag)
X  			j = VERT;
X
X--- 445,450 -----
X  
X  	j = HOR;
X  	getch(); /*eat delim*/
X  	if (n = atoi()) {
X  		if (vflag)
X  			j = VERT;
X***************
X*** 622,636
X  		i = makem(quant(n, j));
X  	} else
X  		i = 0;
X- #ifdef REPORTERRS
X- 	if ((delim2 = cbits(getch())) != delim1) {
X- 		if (delim2 == '\n') {
X- 			errmsg(EWARN, "\\h: expected trailing delim \"%s\", found newline", tchartos(delim1));
X- 		} else {
X- 			errmsg(EWARN, "\\h: expected close delim \"%s\", found \"%s\"", tchartos(delim1), tchartos(delim2));
X- 		}
X- 	}
X- #else !REPORTERRS
X  	getch();
X  #endif REPORTERRS
X  	vflag = 0;
X
X--- 451,456 -----
X  		i = makem(quant(n, j));
X  	} else
X  		i = 0;
X  	getch();
X  	vflag = 0;
X  	dfact = 1;
X***************
X*** 632,638
X  	}
X  #else !REPORTERRS
X  	getch();
X- #endif REPORTERRS
X  	vflag = 0;
X  	dfact = 1;
X  	return(i);
X
X--- 452,457 -----
X  	} else
X  		i = 0;
X  	getch();
X  	vflag = 0;
X  	dfact = 1;
X  	return(i);
X***************
X*** 725,733
X  
X  	skip();
X  	if ((i = cbits(getch()) - '0') <= 0 || i > nfonts)
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, "fp %d: font position must be in range 1..%d", i, nfonts);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: fp: bad font position %d\n", i);
X  #endif REPORTERRS
X  	else if (skip() || !(j = getrq()))
X
X--- 544,549 -----
X  
X  	skip();
X  	if ((i = cbits(getch()) - '0') <= 0 || i > nfonts)
X  		fprintf(stderr, "troff: fp: bad font position %d\n", i);
X  	else if (skip() || !(j = getrq()))
X  		fprintf(stderr, "troff: fp: no font name\n"); 
X***************
X*** 729,735
X  		errmsg(EWARN, "fp %d: font position must be in range 1..%d", i, nfonts);
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: fp: bad font position %d\n", i);
X- #endif REPORTERRS
X  	else if (skip() || !(j = getrq()))
X  #ifdef REPORTERRS
X  		errmsg(EWARN, ".fp %d without font name ignored", i); 
X
X--- 545,550 -----
X  	skip();
X  	if ((i = cbits(getch()) - '0') <= 0 || i > nfonts)
X  		fprintf(stderr, "troff: fp: bad font position %d\n", i);
X  	else if (skip() || !(j = getrq()))
X  		fprintf(stderr, "troff: fp: no font name\n"); 
X  	else {
X***************
X*** 731,739
X  		fprintf(stderr, "troff: fp: bad font position %d\n", i);
X  #endif REPORTERRS
X  	else if (skip() || !(j = getrq()))
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, ".fp %d without font name ignored", i); 
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: fp: no font name\n"); 
X  #endif REPORTERRS
X  	else {
X
X--- 546,551 -----
X  	if ((i = cbits(getch()) - '0') <= 0 || i > nfonts)
X  		fprintf(stderr, "troff: fp: bad font position %d\n", i);
X  	else if (skip() || !(j = getrq()))
X  		fprintf(stderr, "troff: fp: no font name\n"); 
X  	else {
X  		skip();
X***************
X*** 735,741
X  		errmsg(EWARN, ".fp %d without font name ignored", i); 
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: fp: no font name\n"); 
X- #endif REPORTERRS
X  	else {
X  		skip();
X  		setfp(i, j, 0);
X
X--- 547,552 -----
X  		fprintf(stderr, "troff: fp: bad font position %d\n", i);
X  	else if (skip() || !(j = getrq()))
X  		fprintf(stderr, "troff: fp: no font name\n"); 
X  	else {
X  		skip();
X  		setfp(i, j, 0);
X***************
X*** 741,750
X  		setfp(i, j, 0);
X  	}
X  }
X- #ifdef USEFONTPATH
X- char *fontpath = 0;
X- extern char *followpath();
X- #endif USEFONTPATH
X  
X  setfp(pos, f, d)	/* mount font f at position pos[0...nfonts] */
X  int pos, f;
X
X--- 552,557 -----
X  		setfp(i, j, 0);
X  	}
X  }
X  
X  setfp(pos, f, d)	/* mount font f at position pos[0...nfonts] */
X  int pos, f;
X***************
X*** 752,764
X  {
X  	register i, j, k;
X  	int n;
X- #ifdef COMMENT
X- 	/* the 10 in shortname[10] is to match up with the 10 in dev.h.
X- 	 * but it doesn't really matter, as the field is effectively
X- 	 * unused.
X- 	 * - req
X- 	 */
X- #endif COMMENT
X  	char	longname[NS], shortname[10], *p;
X  	extern int	nchtab;
X  
X
X--- 559,564 -----
X  {
X  	register i, j, k;
X  	int n;
X  	char	longname[NS], shortname[10], *p;
X  	extern int	nchtab;
X  
X***************
X*** 765,772
X  	shortname[0] = f & BMASK;
X  	shortname[1] = f >> BYTE;
X  	shortname[2] = '\0';
X- #ifdef USEFONTPATH
X- 	if (!fontpath || !*fontpath) {
X  		if (d == 0)	/* normal case */
X  			sprintf(longname, "%s/dev%s/%s.out", fontfile, devname, shortname);
X  		else		/* 3rd argument is a directory for the font */
X
X--- 565,570 -----
X  	shortname[0] = f & BMASK;
X  	shortname[1] = f >> BYTE;
X  	shortname[2] = '\0';
X  	if (d == 0)	/* normal case */
X  		sprintf(longname, "%s/dev%s/%s.out", fontfile, devname, shortname);
X  	else		/* 3rd argument is a directory for the font */
X***************
X*** 772,821
X  		else		/* 3rd argument is a directory for the font */
X  			sprintf(longname, "%s/%s.out", fontfile, shortname);
X  		if ((k = open(longname, 0)) < 0) {
X- 			if ((k = open(longname, 0)) < 0) {
X- #ifdef REPORTERRS
X- 				errmsg(EWARN, "No file \"%s\" for font %s",
X- 							longname,shortname);
X- #else !REPORTERRS
X- 				fprintf(stderr, "troff: Can't open %s\n",
X- 								longname);
X- #endif REPORTERRS
X- 				return(-1);
X- 			}
X- 		}
X- 	} else {
X- 		/* march along fontpath looking for ':', which delimits
X- 		 * entries; each entry is in turn prepended to %s.out.
X- 		 * The default fontfile is made in n1.c:main()
X- 		 * and is /usr/lib/troff/descs/devXXX, where XXX is from -T
X- 		 * - req
X- 		 */
X- 		char *p;
X- 
X- 		sprintf(longname, "%s.out", shortname);
X- 		/* the trailing zero means we need a readable file */
X- 		if ((p = followpath(fontpath, longname, 0)) == (char *) 0 ||
X- 							(k = open(p, 0)) < 0) {
X- #ifdef REPORTERRS
X- 			errmsg(EWARN,
X- 				"Can't find \"%s\" for font %s in path \"%s\"",
X- 					       longname, shortname, fontfile);
X- #else !REPORTERRS
X- 			fprintf(stderr, "troff: can't find font file %s.out in path \"%s\"", shortname, fontfile);
X- #endif REPORTERRS
X- 			return(-1);
X- 		}
X- 	}
X- 	/* now have k as an open file */
X- #else !USEFONTPATH
X- 	if (d == 0)	/* normal case */
X- 		sprintf(longname, "%s/dev%s/%s.out", fontfile, devname, shortname);
X- 	else		/* 3rd argument is a directory for the font */
X- 		sprintf(longname, "%s/%s.out", fontfile, shortname);
X- 	if ((k = open(longname, 0)) < 0) {
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, "No file \"%s\" for font %s", longname,shortname);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: Can't open %s\n", longname);
X  #endif REPORTERRS
X  		return(-1);
X
X--- 570,575 -----
X  	else		/* 3rd argument is a directory for the font */
X  		sprintf(longname, "%s/%s.out", fontfile, shortname);
X  	if ((k = open(longname, 0)) < 0) {
X  		fprintf(stderr, "troff: Can't open %s\n", longname);
X  		return(-1);
X  	}
X***************
X*** 817,823
X  		errmsg(EWARN, "No file \"%s\" for font %s", longname,shortname);
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: Can't open %s\n", longname);
X- #endif REPORTERRS
X  		return(-1);
X  	}
X  #endif USEFONTPATH
X
X--- 571,576 -----
X  		sprintf(longname, "%s/%s.out", fontfile, shortname);
X  	if ((k = open(longname, 0)) < 0) {
X  		fprintf(stderr, "troff: Can't open %s\n", longname);
X  		return(-1);
X  	}
X  	n = fontbase[pos]->nwfont & BMASK;
X***************
X*** 820,826
X  #endif REPORTERRS
X  		return(-1);
X  	}
X- #endif USEFONTPATH
X  	n = fontbase[pos]->nwfont & BMASK;
X  	read(k, fontbase[pos], 3*n + nchtab + 128 - 32 + sizeof(struct font));
X  	kerntab[pos] = (char *) fontab[pos] + (fontbase[pos]->nwfont & BMASK);
X
X--- 573,578 -----
X  		fprintf(stderr, "troff: Can't open %s\n", longname);
X  		return(-1);
X  	}
X  	n = fontbase[pos]->nwfont & BMASK;
X  	read(k, fontbase[pos], 3*n + nchtab + 128 - 32 + sizeof(struct font));
X  	kerntab[pos] = (char *) fontab[pos] + (fontbase[pos]->nwfont & BMASK);
X***************
X*** 827,835
X  	/* have to reset the fitab pointer because the width may be different */
X  	fitab[pos] = (char *) fontab[pos] + 3 * (fontbase[pos]->nwfont & BMASK);
X  	if ((fontbase[pos]->nwfont & BMASK) > n) {
X- #ifdef REPORTERRS
X- 		errmsg(EWARN, "Font %s is %d bytes too big for position %d\n", shortname, fontbase[pos]->nwfont - n, pos);
X- #else !REPORTERRS
X  		fprintf(stderr, "troff: Font %s too big for position %d\n", shortname, pos);
X  #endif REPORTERRS
X  		return(-1);
X
X--- 579,584 -----
X  	/* have to reset the fitab pointer because the width may be different */
X  	fitab[pos] = (char *) fontab[pos] + 3 * (fontbase[pos]->nwfont & BMASK);
X  	if ((fontbase[pos]->nwfont & BMASK) > n) {
X  		fprintf(stderr, "troff: Font %s too big for position %d\n", shortname, pos);
X  		return(-1);
X  	}
X***************
X*** 831,837
X  		errmsg(EWARN, "Font %s is %d bytes too big for position %d\n", shortname, fontbase[pos]->nwfont - n, pos);
X  #else !REPORTERRS
X  		fprintf(stderr, "troff: Font %s too big for position %d\n", shortname, pos);
X- #endif REPORTERRS
X  		return(-1);
X  	}
X  	fontbase[pos]->nwfont = n;	/* so can load a larger one again later */
X
X--- 580,585 -----
X  	fitab[pos] = (char *) fontab[pos] + 3 * (fontbase[pos]->nwfont & BMASK);
X  	if ((fontbase[pos]->nwfont & BMASK) > n) {
X  		fprintf(stderr, "troff: Font %s too big for position %d\n", shortname, pos);
X  		return(-1);
X  	}
X  	fontbase[pos]->nwfont = n;	/* so can load a larger one again later */
X***************
X*** 864,888
X  	register i, j;
X  
X  	noscale++;
X- 	i = j;
X- #ifdef REPORTERRS
X- 	{
X- 		int name;
X- 
X- 		if (skip()) {
X- 			errmsg(EWARN, "call to .cs with no arguments ignored");
X- 			goto rtn;
X- 		}
X- 		if (!(i = getrq())) {
X- 			errmsg(EWARN, "call to .cs with no arguments ignored");
X- 			goto rtn;
X- 		}
X- 		if ((i = findft(name = i)) < 0) {
X- 			errmsg(EWARN, ".cs: font %s is not mounted -- ignored",
X- 						realname(name));
X- 			goto rtn;
X- 		}
X- 	}
X  	skip();
X  #else !REPORTERRS
X  	skip();
X
X--- 612,617 -----
X  	register i, j;
X  
X  	noscale++;
X  	skip();
X  	if (!(i = getrq()) || (i = findft(i)) < 0)
X  		goto rtn;
X***************
X*** 884,891
X  		}
X  	}
X  	skip();
X- #else !REPORTERRS
X- 	skip();
X  	if (!(i = getrq()) || (i = findft(i)) < 0)
X  		goto rtn;
X  	skip();
X
X--- 613,618 -----
X  
X  	noscale++;
X  	skip();
X  	if (!(i = getrq()) || (i = findft(i)) < 0)
X  		goto rtn;
X  	skip();
X***************
X*** 889,895
X  	if (!(i = getrq()) || (i = findft(i)) < 0)
X  		goto rtn;
X  	skip();
X- #endif REPORTERRS
X  	cstab[i] = atoi();
X  #ifdef REPORTERRS
X  	if (!skip())
X
X--- 616,621 -----
X  	if (!(i = getrq()) || (i = findft(i)) < 0)
X  		goto rtn;
X  	skip();
X  	cstab[i] = atoi();
X  	skip();
X  	j = atoi();
X***************
X*** 891,898
X  	skip();
X  #endif REPORTERRS
X  	cstab[i] = atoi();
X! #ifdef REPORTERRS
X! 	if (!skip())
X  		j = atoi();
X  #endif REPORTERRS
X  	if (nonumb)
X
X--- 617,623 -----
X  		goto rtn;
X  	skip();
X  	cstab[i] = atoi();
X! 	skip();
X  	j = atoi();
X  	if (nonumb)
X  		ccstab[i] = 0;
X***************
X*** 894,900
X  #ifdef REPORTERRS
X  	if (!skip())
X  		j = atoi();
X- #endif REPORTERRS
X  	if (nonumb)
X  		ccstab[i] = 0;
X  	else
X
X--- 619,624 -----
X  	cstab[i] = atoi();
X  	skip();
X  	j = atoi();
X  	if (nonumb)
X  		ccstab[i] = 0;
X  	else
X***************
X*** 910,937
X  
X  	k = 0;
X  bd0:
X- #ifdef REPORTERRS
X- 	if (skip()) {
X- 		errmsg(EWARN, "Call to .bd with no arguments ignored");
X- 		if (k)
X- 			goto bd1;
X- 		else 
X- 			return;
X- 	} else if (!(i = getrq())) {
X- 		errmsg(EWARN, ".cs: without any arguments ignored");
X- 		if (k)
X- 			goto bd1;
X- 		else 
X- 			return;
X- 	} else if ((j = findft(i)) < 0) {
X- 		errmsg(EWARN, "Call to .cs for unknown font %s ignored",
X- 						realname(j));
X- 		if (k)
X- 			goto bd1;
X- 		else 
X- 			return;
X- 	}
X- #else !REPORTERRS
X  	if (skip() || !(i = getrq()) || (j = findft(i)) == -1) {
X  		if (k)
X  			goto bd1;
X
X--- 634,639 -----
X  
X  	k = 0;
X  bd0:
X  	if (skip() || !(i = getrq()) || (j = findft(i)) == -1) {
X  		if (k)
X  			goto bd1;
X***************
X*** 938,944
X  		else 
X  			return;
X  	}
X- #endif REPORTERRS
X  	if (j == smnt) {
X  		k = smnt;
X  		goto bd0;
X
X--- 640,645 -----
X  		else 
X  			return;
X  	}
X  	if (j == smnt) {
X  		k = smnt;
X  		goto bd0;
X***************
X*** 980,995
X  	register i;
X  
X  	noscale++;
X- #ifdef REPORTERRS
X- 	/* ignored if no args. */
X- 	/* That way we can distinguish between a syntax error in an expression
X- 	 * and a call to .ss without args, and only moan at the former (although
X- 	 * atoi() may moan too, of course!
X- 	 * - req
X- 	 */
X- 	if (skip())
X- 		return;
X- #endif REPORTERRS
X  	skip();
X  	if (i = atoi()) {
X  		spacesz = i & 0177;
X
X--- 681,686 -----
X  	register i;
X  
X  	noscale++;
X  	skip();
X  	if (i = atoi()) {
X  		spacesz = i & 0177;
X***************
X*** 995,1005
X  		spacesz = i & 0177;
X  		sps = width(' ' | chbits);
X  	}
X- #ifdef REPORTERRS
X- 	else if (nonumb) {
X- 		errmsg(EWARN, ".ss with non-numeric argument ignored");
X- 	}
X- #endif REPORTERRS
X  	noscale = 0;
X  }
X  
X
X--- 686,691 -----
X  		spacesz = i & 0177;
X  		sps = width(' ' | chbits);
X  	}
X  	noscale = 0;
X  }
X  
Xdiff -rbc titroff/ta.c /distribution/dwb/text/troff.d/ta.c
X*** titroff/ta.c	Wed Jan 11 10:26:33 1984
X--- /distribution/dwb/text/troff.d/ta.c	Fri Sep  9 18:46:54 1983
X***************
X*** 1,3
X  /*
X   *	drive hp2621 terminal 
X   *	just to see stuff quickly. like troff -a
X
X--- 1,4 -----
X+ /*      @(#)ta.c	1.1     */
X  /*
X   *	drive hp2621 terminal 
X   *	just to see stuff quickly. like troff -a
XOnly in titroff: tags
Xdiff -rbc titroff/tc.c /distribution/dwb/text/troff.d/tc.c
X*** titroff/tc.c	Wed Jan 11 10:26:33 1984
X--- /distribution/dwb/text/troff.d/tc.c	Fri Sep  9 18:47:11 1983
X***************
X*** 1,3
X  /*
X   *	drive 4014 scope
X   */
X
X--- 1,4 -----
X+ /*	@(#)tc.c	1.2	*/
X  /*
X   *	drive 4014 scope
X   */
X***************
X*** 99,106
X  		case 'T':
X  			if (strcmp(&argv[1][2], "cat") == 0) {	/* use the old one */
X  				if (fork() == 0) {
X! 					execv("/usr/bin/oldtc", argv);
X! 					fprintf(stderr, "tc: can't find oldtc\n");
X  				}
X  				wait();
X  				exit(1);
X
X--- 100,107 -----
X  		case 'T':
X  			if (strcmp(&argv[1][2], "cat") == 0) {	/* use the old one */
X  				if (fork() == 0) {
X! 					execv("/usr/bin/otc", argv);
X! 					fprintf(stderr, "tc: can't find otc\n");
X  				}
X  				wait((int *)0);
X  				exit(1);
X***************
X*** 102,108
X  					execv("/usr/bin/oldtc", argv);
X  					fprintf(stderr, "tc: can't find oldtc\n");
X  				}
X! 				wait();
X  				exit(1);
X  			}
X  			break;
X
X--- 103,109 -----
X  					execv("/usr/bin/otc", argv);
X  					fprintf(stderr, "tc: can't find otc\n");
X  				}
X! 				wait((int *)0);
X  				exit(1);
X  			}
X  			break;
X***************
X*** 120,125
X  			if (dbg == 0) dbg = 1;
X  			break;
X  		case 'c':
X  			keepon = 1;
X  			break;
X  		}
X
X--- 121,127 -----
X  			if (dbg == 0) dbg = 1;
X  			break;
X  		case 'c':
X+ 		case 't':
X  			keepon = 1;
X  			break;
X  		}
X***************
X*** 580,586
X  		fputs("-n	go back n pages\n", stderr);
X  		fputs("n	print page n (previously printed)\n", stderr);
X  		fputs("o...	set the -o output list to ...\n", stderr);
X! 		fputs("en	n=0 -> don't erase; n=1 -> erase\n", stderr);
X  		fputs("an	sets aspect ratio to n\n", stderr);
X  		break;
X  	default:
X
X--- 582,588 -----
X  		fputs("-n	go back n pages\n", stderr);
X  		fputs("n	print page n (previously printed)\n", stderr);
X  		fputs("o...	set the -o output list to ...\n", stderr);
X! 		fputs("e	invert state of erasing\n", stderr);
X  		fputs("an	sets aspect ratio to n\n", stderr);
X  		break;
X  	default:
Xdiff -rbc titroff/tdef.h /distribution/dwb/text/troff.d/tdef.h
X*** titroff/tdef.h	Tue Nov 11 15:16:31 1986
X--- /distribution/dwb/text/troff.d/tdef.h	Tue Oct 25 17:24:11 1983
X***************
X*** 1,7
X! #ifdef BSD42
X! #include <pagsiz.h>
X! #define 	BUFSIZ	BSIZE
X! #endif BSD42
X  #include <signal.h>
X  
X  #define	MAXPTR	(char *)-1	/* max value of any pointer variable */
X
X--- 1,4 -----
X! /*      @(#)tdef.h	1.2     */
X  #include <signal.h>
X  
X  #define	MAXPTR	(char *)-1	/* max value of any pointer variable */
X***************
X*** 77,93
X  #define	DRAWELLIPSE	'e'
X  #define	DRAWARC		'a'	/* arbitrary arc */
X  #define	DRAWWIG		'~'	/* wiggly line with spline */
X- #ifdef GREMLIN
X- /* Gremlin enhancements go here.  But I don't know what they are yet.
X-  * Line thickness
X-  * Stipple
X-  * ``Gremlin''
X-  * - req
X-  */
X- #define DRAWGREM	'g'	/* gremlin [sic] */
X- #define DRAWTHICK	't'	/* line thickness */
X- #define DRAWLSTYLE	's'	/* line style */
X- #endif GREMLIN
X  
X  #define	LEFT	020	/* \{ */
X  #define	RIGHT	021	/* \} */
X
X--- 74,79 -----
X  #define	DRAWELLIPSE	'e'
X  #define	DRAWARC		'a'	/* arbitrary arc */
X  #define	DRAWWIG		'~'	/* wiggly line with spline */
X  
X  #define	LEFT	020	/* \{ */
X  #define	RIGHT	021	/* \} */
X***************
X*** 92,100
X  #define	LEFT	020	/* \{ */
X  #define	RIGHT	021	/* \} */
X  #define	FILLER	022	/* \& and similar purposes */
X- #ifdef ANYBASELINE
X- #define BASESTR 023	/* \B -- text on arbitrary baseline  - req */
X- #endif ANYBASELINE
X  #define	OHC	024	/* optional hyphenation character \% */
X  #define	CONT	025	/* \c character */
X  #define	PRESC	026	/* printable escape */
X
X--- 78,83 -----
X  #define	LEFT	020	/* \{ */
X  #define	RIGHT	021	/* \} */
X  #define	FILLER	022	/* \& and similar purposes */
X  #define	OHC	024	/* optional hyphenation character \% */
X  #define	CONT	025	/* \c character */
X  #define	PRESC	026	/* printable escape */
X***************
X*** 132,140
X  
X  /* array sizes, and similar limits: */
X  
X- #ifdef MOREPREFONTS
X- #define	NFONT	40	/* maximum number of fonts (including specials) */
X- #else !MOREPREFONTS
X  #define	NFONT	10	/* maximum number of fonts (including specials) */
X  #endif MOREPREFONTS
X  #define	EXTRAFONT	500	/* extra space for swapping a font */
X
X--- 115,120 -----
X  
X  /* array sizes, and similar limits: */
X  
X  #define	NFONT	10	/* maximum number of fonts (including specials) */
X  #define	EXTRAFONT	500	/* extra space for swapping a font */
X  #define	NN	300	/* number registers */
X***************
X*** 136,142
X  #define	NFONT	40	/* maximum number of fonts (including specials) */
X  #else !MOREPREFONTS
X  #define	NFONT	10	/* maximum number of fonts (including specials) */
X- #endif MOREPREFONTS
X  #define	EXTRAFONT	500	/* extra space for swapping a font */
X  #ifdef BSD42
X  #ifdef VMUNIX
X
X--- 116,121 -----
X  /* array sizes, and similar limits: */
X  
X  #define	NFONT	10	/* maximum number of fonts (including specials) */
X  #define	EXTRAFONT	500	/* extra space for swapping a font */
X  #define	NN	300	/* number registers */
X  #define	NNAMES	15	 /* predefined reg names */
X***************
X*** 138,147
X  #define	NFONT	10	/* maximum number of fonts (including specials) */
X  #endif MOREPREFONTS
X  #define	EXTRAFONT	500	/* extra space for swapping a font */
X- #ifdef BSD42
X- #ifdef VMUNIX
X- #define	NN	528	/* number registers */
X- #else !VMUNIX
X  #define	NN	300	/* number registers */
X  #endif VMUNIX
X  #else !BSD42
X
X--- 117,122 -----
X  
X  #define	NFONT	10	/* maximum number of fonts (including specials) */
X  #define	EXTRAFONT	500	/* extra space for swapping a font */
X  #define	NN	300	/* number registers */
X  #define	NNAMES	15	 /* predefined reg names */
X  #define	NIF	15	/* if-else nesting */
X***************
X*** 143,152
X  #define	NN	528	/* number registers */
X  #else !VMUNIX
X  #define	NN	300	/* number registers */
X- #endif VMUNIX
X- #else !BSD42
X- #define	NN	300	/* number registers */
X- #endif BSD42
X  #define	NNAMES	15	 /* predefined reg names */
X  #define	NIF	15	/* if-else nesting */
X  #define	NS	64	/* name buffer */
X
X--- 118,123 -----
X  #define	NFONT	10	/* maximum number of fonts (including specials) */
X  #define	EXTRAFONT	500	/* extra space for swapping a font */
X  #define	NN	300	/* number registers */
X  #define	NNAMES	15	 /* predefined reg names */
X  #define	NIF	15	/* if-else nesting */
X  #define	NS	128	/* name buffer */
X***************
X*** 149,155
X  #endif BSD42
X  #define	NNAMES	15	 /* predefined reg names */
X  #define	NIF	15	/* if-else nesting */
X! #define	NS	64	/* name buffer */
X  #define	NTM	256	/* tm buffer */
X  #ifdef LOTSOFENVS
X  #define	NEV	7	/* environments */
X
X--- 120,126 -----
X  #define	NN	300	/* number registers */
X  #define	NNAMES	15	 /* predefined reg names */
X  #define	NIF	15	/* if-else nesting */
X! #define	NS	128	/* name buffer */
X  #define	NTM	256	/* tm buffer */
X  #define	NEV	3	/* environments */
X  #define	EVLSZ	10	/* size of ev stack */
X***************
X*** 151,164
X  #define	NIF	15	/* if-else nesting */
X  #define	NS	64	/* name buffer */
X  #define	NTM	256	/* tm buffer */
X- #ifdef LOTSOFENVS
X- #define	NEV	7	/* environments */
X- /* the macro packges use .ev 0, 1, 2
X-  * so this leaves 3, 4, 5, 6
X-  * for the user.  I'm going to make -ms use .ev 3, though, for keeps.
X-  * - req
X-  */
X- #else !LOTSOFENVS
X  #define	NEV	3	/* environments */
X  #endif LOTSOFENVS
X  #define	EVLSZ	10	/* size of ev stack */
X
X--- 122,127 -----
X  #define	NIF	15	/* if-else nesting */
X  #define	NS	128	/* name buffer */
X  #define	NTM	256	/* tm buffer */
X  #define	NEV	3	/* environments */
X  #define	EVLSZ	10	/* size of ev stack */
X  #define	DSIZE	512	/* disk sector size in chars */
X***************
X*** 160,166
X   */
X  #else !LOTSOFENVS
X  #define	NEV	3	/* environments */
X- #endif LOTSOFENVS
X  #define	EVLSZ	10	/* size of ev stack */
X  #define	DSIZE	512	/* disk sector size in chars */
X  
X
X--- 123,128 -----
X  #define	NS	128	/* name buffer */
X  #define	NTM	256	/* tm buffer */
X  #define	NEV	3	/* environments */
X  #define	EVLSZ	10	/* size of ev stack */
X  #define	DSIZE	512	/* disk sector size in chars */
X  
X***************
X*** 172,179
X     no harm is done as long as it's big enough.
X  */
X  
X- #ifdef WARWICK
X- /* if it's wrong, let's fix it ! */
X  #define	EVUSED	\
X  		(59 * sizeof(int)	/* integers in env block */	\
X  		+ 9 * sizeof(*tchar)	/* tchars in env block */	\
X
X--- 134,139 -----
X     no harm is done as long as it's big enough.
X  */
X  
X  #define	EVUSED	\
X  		(59 * sizeof(int)	/* integers in env block */	\
X  		+ 9 * sizeof(tchar)	/* tchars in env block */	\
X***************
X*** 176,188
X  /* if it's wrong, let's fix it ! */
X  #define	EVUSED	\
X  		(59 * sizeof(int)	/* integers in env block */	\
X- 		+ 9 * sizeof(*tchar)	/* tchars in env block */	\
X- 		+ NHYP * sizeof(*tchar)	/* hytab */	\
X- 		+ NTAB * sizeof(int)	/* tabtab */	\
X- 		+ (LNSIZE+WDSIZE) * sizeof(*tchar))	/* line+word */
X- #else WARWICK
X- #define	EVUSED	\
X- 		(59 * sizeof(int)	/* integers in env block */	\
X  		+ 9 * sizeof(tchar)	/* tchars in env block */	\
X  		+ NHYP * sizeof(tchar)	/* hytab */	\
X  		+ NTAB * sizeof(int)	/* tabtab */	\
X
X--- 136,141 -----
X  
X  #define	EVUSED	\
X  		(59 * sizeof(int)	/* integers in env block */	\
X  		+ 9 * sizeof(tchar)	/* tchars in env block */	\
X  		+ NHYP * sizeof(tchar)	/* hytab */	\
X  		+ NTAB * sizeof(int)	/* tabtab */	\
X***************
X*** 187,193
X  		+ NHYP * sizeof(tchar)	/* hytab */	\
X  		+ NTAB * sizeof(int)	/* tabtab */	\
X  		+ (LNSIZE+WDSIZE) * sizeof(tchar))	/* line+word */
X- #endif WARWICK
X  
X  #define	EVSPARE	DSIZE - EVUSED % DSIZE	/* number of leftover chars */
X  #define	EVS	(EVUSED + EVSPARE)	/* should be a multiple of DSIZE */
X
X--- 140,145 -----
X  		+ NHYP * sizeof(tchar)	/* hytab */	\
X  		+ NTAB * sizeof(int)	/* tabtab */	\
X  		+ (LNSIZE+WDSIZE) * sizeof(tchar))	/* line+word */
X  
X  #define	EVSPARE	DSIZE - EVUSED % DSIZE	/* number of leftover chars */
X  #define	EVS	(EVUSED + EVSPARE)	/* should be a multiple of DSIZE */
X***************
X*** 191,199
X  
X  #define	EVSPARE	DSIZE - EVUSED % DSIZE	/* number of leftover chars */
X  #define	EVS	(EVUSED + EVSPARE)	/* should be a multiple of DSIZE */
X- #ifdef WARWICK
X- #define NM	800
X- #else WARWICK
X  #define	NM	350	/* requests + macros */
X  #endif WARWICK
X  #define	DELTA	1024	/* delta core bytes */
X
X--- 143,148 -----
X  
X  #define	EVSPARE	DSIZE - EVUSED % DSIZE	/* number of leftover chars */
X  #define	EVS	(EVUSED + EVSPARE)	/* should be a multiple of DSIZE */
X  #define	NM	350	/* requests + macros */
X  #define	DELTA	1024	/* delta core bytes */
X  #define	NHYP	10	/* max hyphens per word */
X***************
X*** 195,201
X  #define NM	800
X  #else WARWICK
X  #define	NM	350	/* requests + macros */
X- #endif WARWICK
X  #define	DELTA	1024	/* delta core bytes */
X  #define	NHYP	10	/* max hyphens per word */
X  #ifndef NHEX /* to allow setting this from the Makefile -- req */
X
X--- 144,149 -----
X  #define	EVSPARE	DSIZE - EVUSED % DSIZE	/* number of leftover chars */
X  #define	EVS	(EVUSED + EVSPARE)	/* should be a multiple of DSIZE */
X  #define	NM	350	/* requests + macros */
X  #define	DELTA	1024	/* delta core bytes */
X  #define	NHYP	10	/* max hyphens per word */
X  #define	NHEX	128	/* byte size of exception word list */
X***************
X*** 198,204
X  #endif WARWICK
X  #define	DELTA	1024	/* delta core bytes */
X  #define	NHYP	10	/* max hyphens per word */
X- #ifndef NHEX /* to allow setting this from the Makefile -- req */
X  #define	NHEX	128	/* byte size of exception word list */
X  #endif !NHEX
X  #define	NTAB	35	/* tab stops */
X
X--- 146,151 -----
X  #define	NM	350	/* requests + macros */
X  #define	DELTA	1024	/* delta core bytes */
X  #define	NHYP	10	/* max hyphens per word */
X  #define	NHEX	128	/* byte size of exception word list */
X  #define	NTAB	35	/* tab stops */
X  #define	NSO	5	/* "so" depth */
X***************
X*** 200,206
X  #define	NHYP	10	/* max hyphens per word */
X  #ifndef NHEX /* to allow setting this from the Makefile -- req */
X  #define	NHEX	128	/* byte size of exception word list */
X- #endif !NHEX
X  #define	NTAB	35	/* tab stops */
X  #define	NSO	5	/* "so" depth */
X  #ifdef WARWICK
X
X--- 147,152 -----
X  #define	DELTA	1024	/* delta core bytes */
X  #define	NHYP	10	/* max hyphens per word */
X  #define	NHEX	128	/* byte size of exception word list */
X  #define	NTAB	35	/* tab stops */
X  #define	NSO	5	/* "so" depth */
X  #define	WDSIZE	270	/* word buffer size */
X***************
X*** 203,212
X  #endif !NHEX
X  #define	NTAB	35	/* tab stops */
X  #define	NSO	5	/* "so" depth */
X- #ifdef WARWICK
X- #define	WDSIZE	960	/* word buffer size */
X- #define	LNSIZE	2960	/* line buffer size */
X- #else WARWICK
X  #define	WDSIZE	270	/* word buffer size */
X  #define	LNSIZE	680	/* line buffer size */
X  #endif WARWICK
X
X--- 149,154 -----
X  #define	NHEX	128	/* byte size of exception word list */
X  #define	NTAB	35	/* tab stops */
X  #define	NSO	5	/* "so" depth */
X  #define	WDSIZE	270	/* word buffer size */
X  #define	LNSIZE	680	/* line buffer size */
X  #define	NDI	5	/* number of diversions */
X***************
X*** 209,215
X  #else WARWICK
X  #define	WDSIZE	270	/* word buffer size */
X  #define	LNSIZE	680	/* line buffer size */
X- #endif WARWICK
X  #define	NDI	5	/* number of diversions */
X  #define	NTRTAB	350	/* number of items in trtab[] */
X  #define	NTRAP	20	/* number of traps */
X
X--- 151,156 -----
X  #define	NSO	5	/* "so" depth */
X  #define	WDSIZE	270	/* word buffer size */
X  #define	LNSIZE	680	/* line buffer size */
X  #define	NDI	5	/* number of diversions */
X  #define	NTRTAB	350	/* number of items in trtab[] */
X  #define	NTRAP	20	/* number of traps */
X***************
X*** 214,222
X  #define	NTRTAB	350	/* number of items in trtab[] */
X  #define	NTRAP	20	/* number of traps */
X  #define	NPN	20	/* numbers in "-o" */
X- #ifdef WARWICK
X- #define	FBUFSZ	1024	/* field buf size words */
X- #else WARWICK
X  #define	FBUFSZ	256	/* field buf size words */
X  #endif WARWICK
X  #ifdef BUFSIZ
X
X--- 155,160 -----
X  #define	NTRTAB	350	/* number of items in trtab[] */
X  #define	NTRAP	20	/* number of traps */
X  #define	NPN	20	/* numbers in "-o" */
X  #define	FBUFSZ	256	/* field buf size words */
X  #define	OBUFSZ	512	/* bytes */
X  #define	IBUFSZ	512	/* bytes */
X***************
X*** 218,228
X  #define	FBUFSZ	1024	/* field buf size words */
X  #else WARWICK
X  #define	FBUFSZ	256	/* field buf size words */
X- #endif WARWICK
X- #ifdef BUFSIZ
X- #define	OBUFSZ	BUFSIZ	/* bytes */
X- #define	IBUFSZ	BUFSIZ	/* bytes */
X- #else !BUFSIZ
X  #define	OBUFSZ	512	/* bytes */
X  #define	IBUFSZ	512	/* bytes */
X  #endif BUFSIZ
X
X--- 156,161 -----
X  #define	NTRAP	20	/* number of traps */
X  #define	NPN	20	/* numbers in "-o" */
X  #define	FBUFSZ	256	/* field buf size words */
X  #define	OBUFSZ	512	/* bytes */
X  #define	IBUFSZ	512	/* bytes */
X  #define	NC	256	/* cbuf size words */
X***************
X*** 225,231
X  #else !BUFSIZ
X  #define	OBUFSZ	512	/* bytes */
X  #define	IBUFSZ	512	/* bytes */
X- #endif BUFSIZ
X  #define	NC	256	/* cbuf size words */
X  #define	NOV	10	/* number of overstrike chars */
X  #define	NPP	10	/* pads per field */
X
X--- 158,163 -----
X  #define	FBUFSZ	256	/* field buf size words */
X  #define	OBUFSZ	512	/* bytes */
X  #define	IBUFSZ	512	/* bytes */
X  #define	NC	256	/* cbuf size words */
X  #define	NOV	10	/* number of overstrike chars */
X  #define	NPP	10	/* pads per field */
X***************
X*** 251,257
X  #define	VMOT	(01L<<16)	/* vert motion bit */
X  #define	NMOT	(01L<<17)	/* negative motion indicator*/
X  #define	MAXMOT	32767	/* bad way to write this!!! */
X! #define	ismot(n)	((unsigned short)(n) & MOT)	/* (short) is a cheap mask */
X  #define	isvmot(n)	((n) & VMOT)	/* must have tested MOT previously */
X  #define	isnmot(n)	((n) & NMOT)	/* ditto */
X  #define	absmot(n)	((unsigned short)(n) & ~MOT)	/* (short) is cheap mask */
X
X--- 183,189 -----
X  #define	VMOT	(01L<<16)	/* vert motion bit */
X  #define	NMOT	(01L<<17)	/* negative motion indicator*/
X  #define	MAXMOT	32767	/* bad way to write this!!! */
X! #define	ismot(n)	(unsigned)((n) & MOT)	/* (short) is a cheap mask */
X  #define	isvmot(n)	((n) & VMOT)	/* must have tested MOT previously */
X  #define	isnmot(n)	((n) & NMOT)	/* ditto */
X  #define	absmot(n)	(unsigned)(0177777 & (n) & ~MOT)	/* (short) is cheap mask */
X***************
X*** 254,260
X  #define	ismot(n)	((unsigned short)(n) & MOT)	/* (short) is a cheap mask */
X  #define	isvmot(n)	((n) & VMOT)	/* must have tested MOT previously */
X  #define	isnmot(n)	((n) & NMOT)	/* ditto */
X! #define	absmot(n)	((unsigned short)(n) & ~MOT)	/* (short) is cheap mask */
X  
X  #define	ZBIT	(01L << 31)	/* zero width char */
X  #define	iszbit(n)	((n) & ZBIT)
X
X--- 186,192 -----
X  #define	ismot(n)	(unsigned)((n) & MOT)	/* (short) is a cheap mask */
X  #define	isvmot(n)	((n) & VMOT)	/* must have tested MOT previously */
X  #define	isnmot(n)	((n) & NMOT)	/* ditto */
X! #define	absmot(n)	(unsigned)(0177777 & (n) & ~MOT)	/* (short) is cheap mask */
X  
X  #define	ZBIT	(01L << 31)	/* zero width char */
X  #define	iszbit(n)	((n) & ZBIT)
X***************
X*** 264,273
X  #define	SFMASK		(SMASK|FMASK)	/* size and font in a tchar */
X  #define	CMASK		~MOT		/* clears MOT */
X  #define	CMASKL		077777L
X! #define	sbits(n)	((unsigned short)((n) >> 24) & 0177)
X! #define	fbits(n)	((unsigned short)((n) >> 16) & 0377)
X! #define	sfbits(n)	((unsigned short)(((n) & SFMASK) >> 16))
X! #define	cbits(n)	(unsigned short)(n)	/* isolate bottom 16 bits  */
X  #define	setsbits(n,s)	n = (n & ~SMASK) | (tchar)(s) << 24
X  #define	setfbits(n,f)	n = (n & ~FMASK) | (tchar)(f) << 16
X  #define	setsfbits(n,sf)	n = (n & ~SFMASK) | (tchar)(sf) << 16
X
X--- 196,205 -----
X  #define	SFMASK		(SMASK|FMASK)	/* size and font in a tchar */
X  #define	CMASK		~MOT		/* clears MOT */
X  #define	CMASKL		077777L
X! #define	sbits(n)	(((n) >> 24) & 0177)
X! #define	fbits(n)	(((n) >> 16) & 0377)
X! #define	sfbits(n)	(unsigned)(0177777 & (((n) & SFMASK) >> 16))
X! #define	cbits(n)	(unsigned)(0177777 & (n))	/* isolate bottom 16 bits  */
X  #define	setsbits(n,s)	n = (n & ~SMASK) | (tchar)(s) << 24
X  #define	setfbits(n,f)	n = (n & ~FMASK) | (tchar)(f) << 16
X  #define	setsfbits(n,sf)	n = (n & ~SFMASK) | (tchar)(sf) << 16
X***************
X*** 284,292
X  
X  #define	PAIR(A,B)	(A|(B<<BYTE))
X  
X- #ifdef ALIGNFIXES
X- typedef long filep;
X- #else !ALIGNFIXES
X  typedef unsigned filep;
X  #endif ALIGNFIXES
X  #define	BLK	128	/* alloc block tchars */
X
X--- 216,221 -----
X  
X  #define	PAIR(A,B)	(A|(B<<BYTE))
X  
X  typedef unsigned filep;
X  #define	BLK	128	/* alloc block tchars */
X  #define	NBLIST	1024	/* allocation list */
X***************
X*** 288,294
X  typedef long filep;
X  #else !ALIGNFIXES
X  typedef unsigned filep;
X- #endif ALIGNFIXES
X  #define	BLK	128	/* alloc block tchars */
X  #define	NBLIST	1024	/* allocation list */
X  /* previous values were BLK 256 NBLIST 512 */
X
X--- 217,222 -----
X  #define	PAIR(A,B)	(A|(B<<BYTE))
X  
X  typedef unsigned filep;
X  #define	BLK	128	/* alloc block tchars */
X  #define	NBLIST	1024	/* allocation list */
X  /* previous values were BLK 256 NBLIST 512 */
X***************
X*** 308,323
X  extern	tchar	setz();
X  extern	tchar	setch(), absch();
X  extern	tchar	setht(), setslant();
X- #ifdef REPORTERRS
X- extern
X- #ifdef LINTSTUFF
X- void
X- #endif LINTSTUFF
X- done(), done1(), done2(), done3(), edone();
X- /* cleanup functions now passed as a parameter to errmsg() */
X- /* I don't quite understand why there are so many! */
X- /* - req	*/
X- #endif REPORTERRS
X  
X  #define	atoi(i)		((int) atoi0(i))
X  extern	long	atoi0();
X
X--- 236,241 -----
X  extern	tchar	setz();
X  extern	tchar	setch(), absch();
X  extern	tchar	setht(), setslant();
X  
X  #define	atoi(i)		((int) atoi0(i))
X  extern	long	atoi0();
X***************
X*** 348,351
X  extern int	c_lefthand;
X  
X  extern int	stderr;	/* this is NOT the stdio value! */
X- #include "local.h"
X
X--- 266,268 -----
X  extern int	c_lefthand;
X  
X  extern int	stderr;	/* this is NOT the stdio value! */
XOnly in titroff: troff.doc
XOnly in /distribution/dwb/text/troff.d: troff.mk
XOnly in /distribution/dwb/text/troff.d: troff.sh
XOnly in titroff: tw.h
Xdiff -rbc titroff/v.h /distribution/dwb/text/troff.d/v.h
X*** titroff/v.h	Mon Oct 13 22:37:52 1986
X--- /distribution/dwb/text/troff.d/v.h	Fri Sep  9 18:47:33 1983
X***************
X*** 1,3
X  struct v {int pn,nl,yr,hp,ct,dn,mo,dy,dw,ln,dl,st,sb,cd,pid;
X  #ifdef WARNLEVELREG
X  	int wl;	/* warning level -- req */
X
X--- 1,3 -----
X+ /*      @(#)v.h	1.1     */
X  struct v {int pn,nl,yr,hp,ct,dn,mo,dy,dw,ln,dl,st,sb,cd,pid;
X  	int vxx[NN-NNAMES];} v ;
X***************
X*** 1,8
X  struct v {int pn,nl,yr,hp,ct,dn,mo,dy,dw,ln,dl,st,sb,cd,pid;
X- #ifdef WARNLEVELREG
X- 	int wl;	/* warning level -- req */
X- #endif WARNLEVELREG
X- #ifdef EVREG
X- 	int ev;	/* number of current env --- starts as 0 */
X- #endif EVREG
X  	int vxx[NN-NNAMES];} v ;
X
X--- 1,3 -----
X  /*      @(#)v.h	1.1     */
X  struct v {int pn,nl,yr,hp,ct,dn,mo,dy,dw,ln,dl,st,sb,cd,pid;
X  	int vxx[NN-NNAMES];} v ;
XOnly in titroff: x.c
SHAR_EOF
if test 59948 -ne "`wc -c < 'diffd'`"
then
	echo shar: error transmitting "'diffd'" '(should have been 59948 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
ARPA		req%uu.warwick.ac.uk@ucl-cs.arpa
EARN/BITNET	req%UK.AC.WARWICK.UU@AC.UK
JANET		req@uk.ac.warwick.uu
UUCP		seismo!mcvax!ukc!warwick!req  (req@warwick.UUCP)
PHONE		+44 203 523485
For mail.frplist, use "frplist" instead of "req" in the above lines.
The BITNET path only works from sites that have AC.UK in their tables.  Sorry.

req@warwick.UUCP (11/21/86)

This is just the makefile.  But none the less important for all that.

I would have liked to have enclosed some helpful documentation, but it wasn't
possible.  Sorry.  There is no point asking for some, as I won't be able to
give you any.

The stuff was tested on VAX/4.1bsd with local mods.  There are superficial
fixes for BSD 4.2;  there should be no moredifficulty porting this version to
Sys V than any other version...

Russell

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	makefile
# This archive created: Thu Nov 20 21:50:15 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'makefile'" '(6588 characters)'
if test -f 'makefile'
then
	echo shar: will not over-write existing file "'makefile'"
else
sed 's/^X//' << \SHAR_EOF > 'makefile'
XDESTDIR=$R/usr/bin
XSEPID=
XOPT=-O
XHACKS=-DENVIRONMENT -DDESCHASNAME -DPAPERSIZEREG -DLOCALWARN -DRIBSFIX\
X-DCHECKNFONTS -DMOREPREFONTS -DMOVEAFTERDRAW -DMAKEDEVITDEF \
X-UUSEDOTFORTMPIFA -DZEROLINES -DTOOLATEFIX -DREPORTERRS -DWARNLEVELREG\
X-DLINENUMFIX -DPROTECTBUILTINS -DEVREG -DLOTSOFENVS -DROTATEPAGE -DUSEFONTPATH\
X-DFONTFAMILIES -DNOOPTARGFIX -UANYBASESTR -DDXLIM=200 -DGREMLIN -DBLANKSMACRO \
X-DBUILTINCONTROLFIX -DLONGOVFIX -DALIGNFIXES -UBSD42 -DTCHARTOS -DNHEX=256\
X-DSKIPFIX -DTESTFILES
X# additional flags for Makedev
XMAKEDEVHACKS=-DCHECKDESCFILES
X# -DCOMMENT ------- various comments added by req.  No code difference.
X# -DENVIRONMENT --- look at "TYPESETTER" for -Txxx	- req
X# -DDESCHASNAME --- DESC.out contains the name of the typesetter - req
X# -DPAPERSIZEREG -- read-only registers .W and .M for paper width/length - req
X# -DLOCALWARN ----- warn if local features are used	- req
X# -DRIBSFIX ------- R, I, B, S, X are the same as 1, 2, 3, smnt, 4 resp. --
X#  ('X' is Bold Italic)	- req
X# -DCHECKNFONTS --- check the number of pre-loaded fonts before loading them,
X#  instead of simply core-dumping if there were too many...
X# -DMOREPREFONTS -- allow more than 10 preloaded fonts.  It's a good idea to
X#  set CHECKNFONTS with this too, as NFONTS is defined in lots of places...
X# -DMOVEAFTERDRAW - put out a move function after a DRAW (from \D) command.
X#  This is because the various filters seem to disagree about where we should
X#  end up after drawing a spline or line or...		- req
X# -DMAKEDEVITDEF -- Makedev includes tdef.h to ensure synchronisation of magic
X#  numbers...	- req
X# -UUSEDOTFORTMPIFA --- as distributed, if troff's name begins with "a", it
X#  uses the current directory for tmp files (presumably for testing). - req
X# -DZEROLINES ----- cope with \l'3i x' where x is a zero-width character - req
X# -DREPORTERRS ---- give more helpful (and complete) error messages	- req
X# -DTOOLATEFIX ---- don't let integer overflow in total # chars o/p cause
X#  the tty flags to be corrupted (!)	- req
X# -DWARNLEVELREG -- use a troff number register (wl) to store the warning level
X#  for warnings about local features.  Then it can be turned on/off from within
X#  troff (without producing a warning!)		- req
X# -DPROTECTBUILTINS --- give a warning message if a built-in request is
X#  changed (eg. ".de rm" or ".rm rm").  There doesn't seem any advantage in
X#  actually forbidding this.
X# -DEVREG --------- The .e read-only number register = current environment #
X# -DLOTSOFENVS ---- allow more (currently 7) environments
X# -DROTATEPAGE ---- add .rp n  to rotate the page through 90 degrees
X# -DUSEFONTPATH --- fontfile is a colon-delimited path (eg. with -F option)
X# -DFONTFAMILIES -- allow ".ff font-family"
X# -DNOOPTARGFIX --- fix "troff -F" etc. (need an argument, but wasn't checked)
X# -DDXLIM=200 ----- limit for number of pairs of points in \D'~ x y ...' (was
X#  wired in as 50)     - req
X# -DGREMLIN ------- allow ucb gremlin features
X# -DANYBASESTR ---- allow arbitrary baseline strings (not finished yet)
X# -DCOLOUR -------- allow colour to be specified (not done yet)
X# -DBLANKSMACRO --- allow user-defined request called on leading whitespace
X# -DBUILTINCONTROLFIX - control() calls built-ins as well as others for
X# .em or .bm -- req
X# -DLONGOVFIX ----- produce a warning if \o'xxxxxx' overflows the buffer
X#  (instead of dumping core)
X# -DALIGNFIXES ---- fixes to make troff slightly more careful about pointer
X#  alignment & sizeof()...  - req
X# -UBSD42 --------- op sys is Berkeley 4.2BSD.  Most fixes taken from 4.2bsd
X#  troff and compared by hand.  This might well not be good enough.  - req
X# -DTCHARTOS ------ use tchartos() to provide a printable representation of
X#  a tchar.  One day this should clearly be combined with the output routines
X#  of t10.c -- req.
X# -DSKIPFIX ------- make skip() passe over tabs as well as spaces -- req
X# -DTESTFILES ----- allow ".if r file" (true if can read file)
X#
XFBASE=$R/usr/lib/troff/descs
XCFLAGS=$(OPT) -g -DFONTFILE=\"$(FBASE)\" -DFONTPATH=\"$(FBASE)/dev%s\" $(HACKS)
XCC=cc
XMAKE=make
XCLEAN=clean
X
XCFILES=n1.c n2.c n3.c n4.c n5.c t6.c n7.c n8.c n9.c t10.c ni.c nii.c hytab.c suftab.c local.c
XHFILES=tdef.h v.h d.h s.h tw.h dev.h
XTFILES=n1.o n2.o n3.o n4.o n5.o t6.o n7.o n8.o n9.o t10.o ni.o nii.o hytab.o suftab.o local.o
XDRIVERS=daps dva dcat d202 dcan d8400 dxerox
X
Xall:	titroff makedev $(DRIVERS)
X
Xtitroff: $(TFILES)
X	$(CC) -o titroff $(TFILES)
X
Xinstall:  all
X	-strip titroff
X	cp titroff makedev $R/usr/bin
X	cp $R/usr/bin/titroff $R/usr/bin/ditroff
X	-tar fc - dev* | (cd $R/usr/lib/troff/descs; tar fxv -)
X	cp $(DRIVERS) $R/usr/lib/troff/drivers
X	$(MAKE) $(CLEAN)
X
Xlocal.o:	ext.h local.h tdef.h
Xn1.o:	tdef.h d.h v.h tw.h s.h local.h
Xn2.o:	tdef.h d.h v.h tw.h s.h
Xn3.o:	tdef.h d.h v.h tw.h s.h
Xn4.o:	tdef.h d.h v.h tw.h s.h dev.h
Xn5.o:	tdef.h d.h v.h tw.h s.h
Xn6.o:	tdef.h d.h v.h tw.h s.h
Xt6.o:	tdef.h d.h v.h tw.h s.h dev.h
Xn7.o:	tdef.h d.h v.h tw.h s.h
Xn8.o:	tdef.h d.h v.h tw.h s.h
Xn9.o:	tdef.h d.h v.h tw.h s.h
Xn10.o:	tdef.h d.h v.h tw.h s.h
Xt10.o:	tdef.h d.h v.h tw.h s.h dev.h
Xni.o:	tdef.h d.h v.h tw.h s.h
Xnii.o:	tdef.h d.h v.h tw.h s.h local.h
X
Xhytab.o:	hytab.c
X
Xsuftab.o:	suftab.c
X
X
Xlist:
X	@pr TODO n[1-6].c t6.c n[7-9].c [nt]10.c ni.c nii.c *.h
X
Xlint:
X	lint -phc $(CFILES)
X
Xlib:	titroff
X	cp titroff $R/usr/bin/titroff
X
Xdxerox:	dxerox.c
X	$(CC) $(CFLAGS) -o dxerox dxerox.c -lm
X
Xdva.o:	dva.c
X	$(CC) $(CFLAGS) -c -DDEBUG dva.c -lm
X
Xdva:	dva.o draw.o dev.h
X	$(CC) $(CFLAGS) -o dva dva.o draw.o -lm
X
Xdcat:	dcat.o draw.o dev.h
X	$(CC) $(CFLAGS) -o dcat dcat.o draw.o -lm
X
Xd202:	d202.o draw.o dev.h
X	$(CC) $(CFLAGS) -O -o d202 d202.o draw.o -lm
X
Xd8400:	d8400.o draw.o dev.h
X	$(CC) $(CFLAGS) -O -o d8400 d8400.o draw.o -lm
X
Xjc:	jc.o draw.o dev.h
X	$(CC) $(CFLAGS) -O -o jc jc.o draw.o -lm
X
Xdcan:	dcan.o draw.o dev.h
X	$(CC) $(CFLAGS) -O -o dcan dcan.o draw.o -lm
X
Xdsort:	dsort.o dev.h
X	$(CC) $(CFLAGS) -i -O -o dsort dsort.o
X
Xdaps:	daps.o draw.o aps.h dev.h
X	$(CC) $(CFLAGS) -o daps daps.o draw.o -lm
X
Xtc:	tc.o draw.o dev.h
X	$(CC) $(CFLAGS) -O -o tc tc.o draw.o -lm
X
Xhc:	hc.o draw.o dev.h
X	$(CC) $(CFLAGS) -O -o hc hc.o draw.o -lm
X
Xta:	ta.o draw.o dev.h
X	$(CC) $(CFLAGS) -O -o ta ta.o draw.o -lm
X
Xmakedev:	makedev.c dev.h
X	$(CC) $(MAKEDEVHACKS) $(CFLAGS) -o makedev makedev.c
X
Xdumpaps:	dumpaps.c
X	$(CC) $(CFLAGS) dumpaps.c -o dumpaps
X
Xsrc:
X	cp makefile $(CFILES) $(HFILES) $R/usr1/src/cmd/troff
X
Xdriverlist:
X	pr d202.c dev.h dva.c dcat.c daps.c makedev.c $R/usr/src/cmd/troff/tc.c
X
Xbackup:
X	cp $R/usr/lib/troff.new $R/usr/lib/otroff.new
X
Xclean:
X	rm -f titroff *.o a.out make.out core $(DRIVERS) makedev
SHAR_EOF
if test 6588 -ne "`wc -c < 'makefile'`"
then
	echo shar: error transmitting "'makefile'" '(should have been 6588 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
ARPA		req%uu.warwick.ac.uk@ucl-cs.arpa
EARN/BITNET	req%UK.AC.WARWICK.UU@AC.UK
JANET		req@uk.ac.warwick.uu
UUCP		seismo!mcvax!ukc!warwick!req  (req@warwick.UUCP)
PHONE		+44 203 523485
For mail.frplist, use "frplist" instead of "req" in the above lines.
The BITNET path only works from sites that have AC.UK in their tables.  Sorry.