home *** CD-ROM | disk | FTP | other *** search
- From: clewis@ferret.ocunix.on.ca (Chris Lewis)
- Newsgroups: comp.sources.bugs,comp.lang.postscript,alt.sources
- Subject: Psroff 3.0 Patch 2
- Message-ID: <2280@ecicrl.ocunix.on.ca>
- Date: 10 Jul 91 14:21:11 GMT
-
-
- Archive-name: psroff3.0/Patch.02
- Submitted-by: clewis@ferret.ocunix.on.ca (Chris Lewis)
-
- This is official patch 02 for Psroff 3.0.
- Please apply it by:
- cd <psroff source directory>
- patch -N -p < <this file>
-
- Fixes this patch:
- 1) if you undefined DIT in defs.h, compilation failed in
- two places. Fixed.
- 2) Made asc2ps possible to distribute without anything else.
- (not applicable in psroff release)
- 3) some things should have been unsigned char.
- 4) catconv supports \!, fixed up a passthru repositioning
- botch (sR "P..."). Necessitated for supporting pspic
- (a postscript includer mechanism that passes thru the
- entire postscript file as \!! rather than relying on an
- include mechanism in the back end.)
- 5) -N coredump
-
-
- ./utils/catconv.S Supports \!
- ./utils/dumpft.c unsigned char
- ./utils/asc2ps.c STANDALONE
- ./dit.c unsigned char
- ./troff2.c #undef DIT fix/passthru botch
- ./defs.h Patch level
- ./utils.c #undef DIT fix
- ./dt.c passthru of \! & \X fix
- ./cattab.c unsigned char.
- Index: ./utils/catconv.S
- *** /tmp/PATCHold/./utils/catconv.S Mon Jun 3 12:57:18 1991
- --- ./utils/catconv.S Mon Jun 3 12:57:19 1991
- ***************
- *** 13,19 ****
- #
- # This does a very simpleminded conversion of ditroff-only-isms
- # (such as graphics) into something handleable by CAT troff.
- ! # 1.6 91/03/25
- $cc{'em'}=1; $cc{'ru'}=1; $cc{'14'}=1; $cc{'12'}=1; $cc{'hy'}=1;
- $cc{'34'}=1; $cc{'fi'}=1; $cc{'fl'}=1; $cc{'ff'}=1; $cc{'ct'}=1;
- $cc{'Fl'}=1; $cc{'Fi'}=1; $cc{'de'}=1; $cc{'dg'}=1; $cc{'rg'}=1;
- --- 13,19 ----
- #
- # This does a very simpleminded conversion of ditroff-only-isms
- # (such as graphics) into something handleable by CAT troff.
- ! # 1.7 91/05/30
- $cc{'em'}=1; $cc{'ru'}=1; $cc{'14'}=1; $cc{'12'}=1; $cc{'hy'}=1;
- $cc{'34'}=1; $cc{'fi'}=1; $cc{'fl'}=1; $cc{'ff'}=1; $cc{'ct'}=1;
- $cc{'Fl'}=1; $cc{'Fi'}=1; $cc{'de'}=1; $cc{'dg'}=1; $cc{'rg'}=1;
- ***************
- *** 70,75 ****
- --- 70,78 ----
- $line = do Xprocess($line);
- }
- $line = do findspecials($line);
- + if ($line =~ /^\\!(.*)/) {
- + $line = ".sR \"$1\"";
- + }
- print "$line\n";
- while($index) {
- print ".rr" . $regpref . $regnames[--$index] . "\n";
- ***************
- *** 94,99 ****
- --- 97,103 ----
- return("$predefs$newline");
- }
-
- + # Convert drawing commands
- sub process {
- local($line, $newline, $pre, $opcode, $arglist) = ($_[0]);
- # printf("in process: $line\n");
- ***************
- *** 147,152 ****
- --- 151,157 ----
- return("$predefs$newline");
- }
-
- + # Convert \X directives
- sub Xprocess {
- local($line, $newline, $pre, $opcode, $arglist) = ($_[0]);
- # printf("in process: $line\n");
- Index: ./utils/dumpft.c
- *** /tmp/PATCHold/./utils/dumpft.c Mon Jun 3 12:57:28 1991
- --- ./utils/dumpft.c Mon Jun 3 12:57:29 1991
- ***************
- *** 10,16 ****
-
- #ifndef lint
- static char SCCSID[] =
- ! "@(#)dumpft.c 2.7 Copyright 91/02/20 09:11:14 Chris Lewis";
- #endif
-
- #include "../defs.h"
- --- 10,16 ----
-
- #ifndef lint
- static char SCCSID[] =
- ! "@(#)dumpft.c 2.8 Copyright 91/05/28 12:07:47 Chris Lewis";
- #endif
-
- #include "../defs.h"
- ***************
- *** 282,288 ****
- for(g = 0; g <= filesize - 224; g++) {
- errcnt = 0;
- for (i = 0; tabN[i].ch_name; i++) {
- ! if (tabN[i].ch_wididx == -1)
- continue;
- if (tabN[i].ch_name[0] && !buffer[g+tabN[i].ch_wididx]) {
- if (verbose) {
- --- 282,288 ----
- for(g = 0; g <= filesize - 224; g++) {
- errcnt = 0;
- for (i = 0; tabN[i].ch_name; i++) {
- ! if (tabN[i].ch_wididx == N)
- continue;
- if (tabN[i].ch_name[0] && !buffer[g+tabN[i].ch_wididx]) {
- if (verbose) {
- Index: ./utils/asc2ps.c
- *** /tmp/PATCHold/./utils/asc2ps.c Mon Jun 3 12:57:38 1991
- --- ./utils/asc2ps.c Mon Jun 3 12:57:39 1991
- ***************
- *** 14,23 ****
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)asc2ps.c: 2.4 Copyright 91/04/10 19:48:00 Chris Lewis";
- #endif
-
- #include "defs.h"
-
- double height = 11.0;
- double width = 8.5;
- --- 14,45 ----
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)asc2ps.c: 2.5 Copyright 91/05/25 21:27:18 Chris Lewis";
- #endif
-
- + #ifndef STANDALONE
- #include "defs.h"
- + #else
- +
- + /* Configuration section for STANDALONE version of asc2ps (when compiled
- + without the rest of psroff 3.0).
- + */
- +
- + #define NODECMD "uuname -l" /* returns your uucp node name, use
- + "echo your-machine-name" if you don't
- + have uuname */
- +
- + #undef strchr index /* define if you don't have strchr() */
- +
- + #include <stdio.h>
- + #include <ctype.h>
- + #include <string.h> /* change to strings.h if necessary */
- +
- + /* Dinna touch from here on */
- + #define ALONE
- + #define max(a,b) ((a) > (b) ? (a) : (b))
- +
- + #endif
-
- double height = 11.0;
- double width = 8.5;
- Index: ./dit.c
- *** /tmp/PATCHold/./dit.c Mon Jun 3 12:57:47 1991
- --- ./dit.c Mon Jun 3 12:57:49 1991
- ***************
- *** 12,18 ****
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)dit.c: 91/04/24 Copyright 91/04/24 21:48:46 Chris Lewis";
- #endif
-
- extern struct cattab tabN[], tabS[], *extidx;
- --- 12,18 ----
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)dit.c: 91/05/30 Copyright 91/05/30 01:45:57 Chris Lewis";
- #endif
-
- extern struct cattab tabN[], tabS[], *extidx;
- ***************
- *** 134,140 ****
- #ifdef DIT
-
- int sizescale = 1;
- ! int indtres;
-
- int points, font, ch, i;
- int xpos, ypos;
- --- 134,140 ----
- #ifdef DIT
-
- int sizescale = 1;
- ! int indtres = 300;
-
- int points, font, ch, i;
- int xpos, ypos;
- ***************
- *** 415,422 ****
- #endif
- i = 1;
- special[0] = cmd;
- - while((ch = getchar()) != EOF && isspace(ch));
- - special[i++] = ch;
- while((ch = getchar()) != EOF && ch != '\n')
- special[i++] = ch;
- special[i] = '\0';
- --- 415,420 ----
- ***************
- *** 427,434 ****
- break;
- case '!':
- special[0] = 'P';
- ! dospecial(xpos * TROFFRESOLUTION / indtres,
- ! ypos * TROFFRESOLUTION / indtres,
- special);
- break;
- case 'D': {
- --- 425,432 ----
- break;
- case '!':
- special[0] = 'P';
- ! dospecial(/*xpos * TROFFRESOLUTION / indtres,
- ! ypos * TROFFRESOLUTION / indtres,*/
- special);
- break;
- case 'D': {
- Index: ./troff2.c
- *** /tmp/PATCHold/./troff2.c Mon Jun 3 12:58:00 1991
- --- ./troff2.c Mon Jun 3 12:58:02 1991
- ***************
- *** 12,18 ****
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)troff2.c: 2.17 Copyright 91/05/03 10:41:03 Chris Lewis";
- #endif
-
- #define ESC 0x80
- --- 12,18 ----
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)troff2.c: 2.18 Copyright 91/05/30 01:46:09 Chris Lewis";
- #endif
-
- #define ESC 0x80
- ***************
- *** 222,229 ****
- sizescale = atoi(optarg);
- break;
- #else
- ! case 'S':
- ! fprintf(stderr, "%s: ditroff frontend not configured\n");
- exit(1);
- #endif
- case 'M':
- --- 222,230 ----
- sizescale = atoi(optarg);
- break;
- #else
- ! case 'G':
- ! fprintf(stderr, "%s: ditroff frontend not configured\n",
- ! progname);
- exit(1);
- #endif
- case 'M':
- ***************
- *** 738,747 ****
- *string = '\0';
- return;
-
- case 'p':
- case 'P':
- ! if (be->bedraw)
- ! (*be->bedraw)(specXPos, specYPos, NULL);
- if (be->bepassthru)
- (*be->bepassthru)(string+1);
- else
- --- 739,754 ----
- *string = '\0';
- return;
-
- + case '!':
- case 'p':
- case 'P':
- ! {
- ! static int lastsX, lastsY;
- ! if ((lastsX != specXPos || lastsY != specYPos) && be->bedraw)
- ! (*be->bedraw)(specXPos, specYPos, NULL);
- ! lastsX = specXPos;
- ! lastsY = specYPos;
- ! }
- if (be->bepassthru)
- (*be->bepassthru)(string+1);
- else
- Index: ./defs.h
- *** /tmp/PATCHold/./defs.h Mon Jun 3 12:58:16 1991
- --- ./defs.h Mon Jun 3 12:58:17 1991
- ***************
- *** 9,15 ****
- */
-
- /* Official Release and Patch level: */
- ! #define T2VERSION "@(#)PSROFF Copyright 91/04/26 Chris Lewis - R3 PL1"
-
- /* Configuration parameters:
- */
- --- 9,15 ----
- */
-
- /* Official Release and Patch level: */
- ! #define T2VERSION "@(#)PSROFF Copyright 91/05/28 Chris Lewis - R3 PL2"
-
- /* Configuration parameters:
- */
- ***************
- *** 259,265 ****
-
- struct cattab {
- char *ch_name;
- ! char ch_set;
- unsigned char ch_catidx;
- unsigned char ch_wididx;
- unsigned char ch_info; /* used by some auxiliary programs */
- --- 259,265 ----
-
- struct cattab {
- char *ch_name;
- ! unsigned char ch_set;
- unsigned char ch_catidx;
- unsigned char ch_wididx;
- unsigned char ch_info; /* used by some auxiliary programs */
- Index: ./utils.c
- *** /tmp/PATCHold/./utils.c Mon Jun 3 12:58:27 1991
- --- ./utils.c Mon Jun 3 12:58:29 1991
- ***************
- *** 12,18 ****
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)utils.c: 2.14 Copyright 91/04/05 01:21:20 Chris Lewis";
- #endif
-
- #ifndef HEADERSIZE
- --- 12,18 ----
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)utils.c: 2.15 Copyright 91/05/30 01:46:27 Chris Lewis";
- #endif
-
- #ifndef HEADERSIZE
- ***************
- *** 412,418 ****
- --- 412,422 ----
- register struct fonttable *p;
- int intfont;
- DBP((D_SPEC, "FontSel: %c -> %s\n", from, to));
- + #ifdef DIT
- if (from < (ditroff? '0' : '1') || from > '9') {
- + #else
- + if (from < '1' || from > '9') {
- + #endif
- fprintf(stderr, "Bad arguments to FontSel: %c %s\n", from, to);
- return;
- }
- Index: ./dt.c
- *** /tmp/PATCHold/./dt.c Mon Jun 3 12:58:39 1991
- --- ./dt.c Mon Jun 3 12:58:41 1991
- ***************
- *** 12,18 ****
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)dt.c: 2.6 Copyright 91/03/10 03:12:46 Chris Lewis";
- #endif
-
- /* These two tables are always included so that we have the
- --- 12,18 ----
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)dt.c: 2.7 Copyright 91/05/30 01:46:37 Chris Lewis";
- #endif
-
- /* These two tables are always included so that we have the
- ***************
- *** 459,465 ****
-
- dtPassthru(s)
- register char *s; {
- ! printf("x X %s\n", s);
- }
-
- dtEpilog() {
- --- 459,465 ----
-
- dtPassthru(s)
- register char *s; {
- ! printf("!%s\n", s);
- }
-
- dtEpilog() {
- ***************
- *** 473,480 ****
- --- 473,485 ----
- register char *s; {
- register int temp, t2;
- DBP((D_CAT, "dtDraw: (%d,%d): %s\n", origX, origY, s));
- +
- printf("H%d\n", TROFF2DTX(origX));
- printf("V%d\n", TROFF2DTY(origY));
- +
- + if (!s)
- + return;
- +
- putchar('D');
- putchar(*s);
- s++;
- Index: ./cattab.c
- *** /tmp/PATCHold/./cattab.c Mon Jun 3 12:58:51 1991
- --- ./cattab.c Mon Jun 3 12:58:52 1991
- ***************
- *** 36,42 ****
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)cattab.c: 2.2 Copyright 91/02/20 09:07:04 Chris Lewis";
- #endif
-
- #include "defs.h"
- --- 36,42 ----
-
- #ifndef lint
- static char SCCSid[] =
- ! "@(#)cattab.c: 2.3 Copyright 91/05/28 12:06:08 Chris Lewis";
- #endif
-
- #include "defs.h"
- ***************
- *** 75,85 ****
- {"j", N, 12, 74, 0, "j"},
- {"u", N, 13, 85, 0, "u"},
- {"k", N, 14, 75, 0, "k"},
- ! {"", N, 15, -1, 0, NOC},
- {"p", N, 16, 80, 0, "p"},
- {"em", N, 17, 99, 0, "3/4 em"},
- {";", N, 18, 27, 0, ";"},
- ! {"", N, 19, -1, 0, NOC},
- {"a", N, 20, 65, 0, "a"},
- {"ru", N, 21, 100, 0, "horizontal rule"},
- {"c", N, 22, 67, 0, "c"},
- --- 75,85 ----
- {"j", N, 12, 74, 0, "j"},
- {"u", N, 13, 85, 0, "u"},
- {"k", N, 14, 75, 0, "k"},
- ! {"", N, 15, N, 0, NOC},
- {"p", N, 16, 80, 0, "p"},
- {"em", N, 17, 99, 0, "3/4 em"},
- {";", N, 18, 27, 0, ";"},
- ! {"", N, 19, N, 0, NOC},
- {"a", N, 20, 65, 0, "a"},
- {"ru", N, 21, 100, 0, "horizontal rule"},
- {"c", N, 22, 67, 0, "c"},
- ***************
- *** 101,109 ****
- {",", N, 38, 12, 0, ","},
- {"&", N, 39, 6, 0, "&"},
- {"y", N, 40, 89, 0, "y"},
- ! {"", N, 41, -1, 0, NOC},
- {"%", N, 42, 5, 0, "%"},
- ! {"", N, 43, -1, 0, NOC},
- {"Q", N, 44, 49, 0, "Q"},
- {"T", N, 45, 52, 0, "T"},
- {"O", N, 46, 47, 0, "O"},
- --- 101,109 ----
- {",", N, 38, 12, 0, ","},
- {"&", N, 39, 6, 0, "&"},
- {"y", N, 40, 89, 0, "y"},
- ! {"", N, 41, N, 0, NOC},
- {"%", N, 42, 5, 0, "%"},
- ! {"", N, 43, N, 0, NOC},
- {"Q", N, 44, 49, 0, "Q"},
- {"T", N, 45, 52, 0, "T"},
- {"O", N, 46, 47, 0, "O"},
- ***************
- *** 158,170 ****
- {"rg", N, 95, 189, 0, "registered"},
- {":", N, 96, 26, 0, ":"},
- {"+", N, 97, 11, 0, "+"},
- ! {"", N, 98, -1, 0, NOC},
- {"!", N, 99, 1, 0, "!"},
- {"bu", N, 100, 97, 0, "bullet"},
- {"?", N, 101, 31, 0, "?"},
- {"fm", N, 102, 113, 0, "foot mark (minute)"},
- {"|", N, 103, 92, 0, "|"},
- ! {"", N, 104, -1, 0, NOC},
- {"co", N, 105, 190, 0, "copyright"},
- {"sq", N, 106, 98, 0, "square"},
- {"$", N, 107, 4, 0, "$"},
- --- 158,170 ----
- {"rg", N, 95, 189, 0, "registered"},
- {":", N, 96, 26, 0, ":"},
- {"+", N, 97, 11, 0, "+"},
- ! {"", N, 98, N, 0, NOC},
- {"!", N, 99, 1, 0, "!"},
- {"bu", N, 100, 97, 0, "bullet"},
- {"?", N, 101, 31, 0, "?"},
- {"fm", N, 102, 113, 0, "foot mark (minute)"},
- {"|", N, 103, 92, 0, "|"},
- ! {"", N, 104, N, 0, NOC},
- {"co", N, 105, 190, 0, "copyright"},
- {"sq", N, 106, 98, 0, "square"},
- {"$", N, 107, 4, 0, "$"},
- ***************
- *** 191,201 ****
- {"*f", S, 12, 140, 0, "phi"},
- {"*u", S, 13, 139, 0, "upsilon"},
- {"*k", S, 14, 129, 0, "kappa"},
- ! {"", S, 15, -1, 0, NOC},
- {"*p", S, 16, 135, 0, "pi"},
- {"@", S, 17, 32, 0, "@"},
- {"da", S, 18, 169, 0, "down arrow"},
- ! {"", S, 19, -1, 0, NOC},
- {"*a", S, 20, 120, 0, "alpha"},
- {"or", S, 21, 198, 0, "or (was star)"},
- {"*x", S, 22, 141, 0, "chi"},
- --- 191,201 ----
- {"*f", S, 12, 140, 0, "phi"},
- {"*u", S, 13, 139, 0, "upsilon"},
- {"*k", S, 14, 129, 0, "kappa"},
- ! {"", S, 15, N, 0, NOC},
- {"*p", S, 16, 135, 0, "pi"},
- {"@", S, 17, 32, 0, "@"},
- {"da", S, 18, 169, 0, "down arrow"},
- ! {"", S, 19, N, 0, NOC},
- {"*a", S, 20, 120, 0, "alpha"},
- {"or", S, 21, 198, 0, "or (was star)"},
- {"*x", S, 22, 141, 0, "chi"},
- ***************
- *** 217,225 ****
- {"pt", S, 38, 185, 0, "proportional to"},
- {"rh", S, 39, 194, 0, "right hand"},
- {"*w", S, 40, 143, 0, "omega"},
- ! {"", S, 41, -1, 0, NOC},
- {"gr", S, 42, 182, 0, "gradient"},
- ! {"", S, 43, -1, 0, NOC},
- {"*F", S, 44, 153, 0, "Phi"},
- {"*H", S, 45, 146, 0, "Theta"},
- {"*W", S, 46, 155, 0, "Omega"},
- --- 217,225 ----
- {"pt", S, 38, 185, 0, "proportional to"},
- {"rh", S, 39, 194, 0, "right hand"},
- {"*w", S, 40, 143, 0, "omega"},
- ! {"", S, 41, N, 0, NOC},
- {"gr", S, 42, 182, 0, "gradient"},
- ! {"", S, 43, N, 0, NOC},
- {"*F", S, 44, 153, 0, "Phi"},
- {"*H", S, 45, 146, 0, "Theta"},
- {"*W", S, 46, 155, 0, "Omega"},
- ***************
- *** 274,286 ****
- {"mo", S, 95, 187, 0, "member of"},
- {"~", S, 96, 94, 0, "~"},
- {"es", S, 97, 186, 0, "empty set"},
- ! {"", S, 98, -1, 0, NOC},
- {"dd", S, 99, 193, 0, "dbl dagger"},
- {"br", S, 100, 191, 0, "box rule (was parallel sign)"},
- {"**", S, 101, 196, 0, "math *"},
- {"ib", S, 102, 178, 0, "improper subset"},
- {"ci", S, 103, 199, 0, "circle"},
- ! {"", S, 104, -1, 0, NOC},
- {"pl", S, 105, 188, 0, "equation plus"},
- {"->", S, 106, 166, 0, "right arrow"},
- {"sc", S, 107, 112, 0, "section"},
- --- 274,286 ----
- {"mo", S, 95, 187, 0, "member of"},
- {"~", S, 96, 94, 0, "~"},
- {"es", S, 97, 186, 0, "empty set"},
- ! {"", S, 98, N, 0, NOC},
- {"dd", S, 99, 193, 0, "dbl dagger"},
- {"br", S, 100, 191, 0, "box rule (was parallel sign)"},
- {"**", S, 101, 196, 0, "math *"},
- {"ib", S, 102, 178, 0, "improper subset"},
- {"ci", S, 103, 199, 0, "circle"},
- ! {"", S, 104, N, 0, NOC},
- {"pl", S, 105, 188, 0, "equation plus"},
- {"->", S, 106, 166, 0, "right arrow"},
- {"sc", S, 107, 112, 0, "section"},
-