1 /* $MirOS: src/usr.bin/oldroff/tbl/t..c,v 1.4 2008/11/08 23:04:52 tg Exp $ */ 2 3 /*- 4 * Copyright (c) 1979, 1980, 1981, 1986, 1988, 1990, 1991, 1992 5 * The Regents of the University of California. 6 * Copyright (C) Caldera International Inc. 2001-2002. 7 * Copyright (c) 2003, 2004 8 * Thorsten "mirabilos" Glaser <tg@mirbsd.org> 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, 12 * with or without modification, are permitted provided 13 * that the following conditions are met: 14 * 15 * Redistributions of source code and documentation must retain 16 * the above copyright notice, this list of conditions and the 17 * following disclaimer. Redistributions in binary form must 18 * reproduce the above copyright notice, this list of conditions 19 * and the following disclaimer in the documentation and/or other 20 * materials provided with the distribution. 21 * 22 * All advertising materials mentioning features or use of this 23 * software must display the following acknowledgement: 24 * This product includes software developed or owned by 25 * Caldera International, Inc. 26 * 27 * Neither the name of Caldera International, Inc. nor the names 28 * of other contributors may be used to endorse or promote products 29 * derived from this software without specific prior written permission. 30 * 31 * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 32 * INTERNATIONAL, INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 33 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 34 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 35 * ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE 36 * LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR 37 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 38 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 39 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 40 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 41 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 42 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 */ 44 45 #define T__C_SCCSID "@(#)t..c 4.5 (Berkeley) 4/18/91" 46 #define T__C_RCSID "$MirOS: src/usr.bin/oldroff/tbl/t..c,v 1.4 2008/11/08 23:04:52 tg Exp $" 47 48 /* t..c : external declarations */ 49 50 # include "stdio.h" 51 # include "ctype.h" 52 53 # define MAXLIN 200 54 # define MAXHEAD 100 55 # define MAXCOL 20 56 # define MAXCHS 2000 57 # define MAXRPT 100 58 # define CLLEN 10 59 # define SHORTLINE 4 60 extern int nlin, ncol, iline, nclin, nslin; 61 extern int style[MAXHEAD][MAXCOL]; 62 extern int ctop[MAXHEAD][MAXCOL]; 63 extern char font[MAXHEAD][MAXCOL][2]; 64 extern char csize[MAXHEAD][MAXCOL][4]; 65 extern char vsize[MAXHEAD][MAXCOL][4]; 66 extern char cll[MAXCOL][CLLEN]; 67 extern int stynum[]; 68 extern int F1, F2; 69 extern int lefline[MAXHEAD][MAXCOL]; 70 extern int fullbot[]; 71 extern char *instead[]; 72 extern int expflg; 73 extern int ctrflg; 74 extern int evenflg; 75 extern int evenup[]; 76 extern int boxflg; 77 extern int dboxflg; 78 extern int linsize; 79 extern int tab; 80 extern int pr1403; 81 extern int linsize, delim1, delim2; 82 extern int allflg; 83 extern int textflg; 84 extern int left1flg; 85 extern int dummyflg; 86 extern int rightl; 87 struct colstr {char *col, *rcol;}; 88 /* FIXME: kludge for seeing if somebody stuffed a char into col or rcol. */ 89 # define tx(a) ((int)(a)>0 && (int)(a)<128) 90 extern struct colstr *table[]; 91 extern char *cspace, *cstore; 92 extern char *chspace(); 93 extern char *exstore, *exlim; 94 extern int sep[]; 95 extern int used[], lused[], rused[]; 96 extern int linestop[]; 97 extern int leftover; 98 extern char *last, *ifile; 99 extern int texname; 100 extern int texct, texmax; 101 extern char texstr[]; 102 extern int linstart; 103 104 105 extern FILE *tabin, *tabout; 106 # define CRIGHT 80 107 # define CLEFT 40 108 # define CMID 60 109 # define S1 31 110 # define S2 32 111 # define TMP 38 112 # define SF 35 113 # define SL 34 114 # define LSIZE 33 115 # define SIND 37 116 # define SVS 36 117 /* this refers to the relative position of lines */ 118 # define LEFT 1 119 # define RIGHT 2 120 # define THRU 3 121 # define TOP 1 122 # define BOT 2 123