diff options
| author | muffin <none@none> | 2005-08-19 12:05:17 -0700 |
|---|---|---|
| committer | muffin <none@none> | 2005-08-19 12:05:17 -0700 |
| commit | b55148877d473978f0b46d593fd6213fa526fcc5 (patch) | |
| tree | 94b497479fe49ff4fd4eedb7fa56275edb5551c1 /usr/src | |
| parent | b72c1761d7573be4804f5a97918dcb6d97eedfa5 (diff) | |
| download | illumos-joyent-b55148877d473978f0b46d593fd6213fa526fcc5.tar.gz | |
6269019 cmd/tbl and gcc don't get along
6269073 cmd/captoinfo and gcc don't get along
6269772 gcc and cmd/deroff don't get along
6272081 gcc and cmd/patch don't get along
6272746 gcc and cmd/regcmp don't get along
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/captoinfo/captoinfo.c | 95 | ||||
| -rw-r--r-- | usr/src/cmd/captoinfo/otermcap.c | 23 | ||||
| -rw-r--r-- | usr/src/cmd/deroff/deroff.c | 25 | ||||
| -rw-r--r-- | usr/src/cmd/regcmp/regcmp.c | 51 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t..c | 21 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t0.c | 13 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t1.c | 42 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t2.c | 17 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t3.c | 27 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t4.c | 12 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t5.c | 31 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t6.c | 28 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t7.c | 35 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t8.c | 50 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/t9.c | 14 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tb.c | 37 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tc.c | 25 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/te.c | 37 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tf.c | 41 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tg.c | 22 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/ti.c | 27 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tm.c | 24 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/ts.c | 56 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tt.c | 45 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tu.c | 47 | ||||
| -rw-r--r-- | usr/src/cmd/tbl/tv.c | 29 |
26 files changed, 510 insertions, 364 deletions
diff --git a/usr/src/cmd/captoinfo/captoinfo.c b/usr/src/cmd/captoinfo/captoinfo.c index 831c0d4724..fc26e626d6 100644 --- a/usr/src/cmd/captoinfo/captoinfo.c +++ b/usr/src/cmd/captoinfo/captoinfo.c @@ -19,15 +19,14 @@ * * CDDL HEADER END */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + #pragma ident "%Z%%M% %I% %E% SMI" /* @@ -44,6 +43,8 @@ #include "curses.h" #include <ctype.h> #include <stdlib.h> +#include <unistd.h> +#include <string.h> #include "otermcap.h" #include "print.h" @@ -99,20 +100,6 @@ extern char *boolnames[], *boolcodes[]; extern char *numnames[], *numcodes[]; extern char *strnames[], *strcodes[]; -/* externs from libc.a */ -extern char *getenv(); -extern void exit(); -#if defined(SYSV) || defined(USG) /* handle both Sys Vr2 and Vr3 curses */ -extern char *getcwd(); -#else -extern char *getwd(); -#endif /* SYSV || USG */ -extern int getopt(); -extern int optind; -extern char *optarg; -extern int strncmp(), strcmp(); -extern char *strcpy(); - /* globals for this file */ char *progname; /* argv [0], the name of the program */ static char *term_name; /* the name of the terminal being worked on */ @@ -150,19 +137,19 @@ static int copycomments = 0; /* copy comments from tercap source */ #define ispadchar(c) (isdigit(c) || (c) == '.' || (c) == '*') -static void getlongname(); -static void handleko(); -static void handlema(); -static void print_no_use_entry(); +static void getlongname(void); +static void handleko(void); +static void handlema(void); +static void print_no_use_entry(void); static void print_use_entry(char *); -static void captoinfo(); -static void use_etc_termcap(); -static void initdirname(); +static void captoinfo(void); +static void use_etc_termcap(void); +static void initdirname(void); static void setfilename(char *); -static void setterm_name(); +static void setterm_name(void); static void use_file(char *); static void sorttable(char *[], char *[]); -static void inittables(); +static void inittables(void); /* * Verify that the names given in the termcap entry are all valid. @@ -279,7 +266,7 @@ checktermcap() * Fill up the termcap tables. */ int -filltables() +filltables(void) { int i, tret; @@ -404,7 +391,7 @@ filltables() * names. */ static void -getlongname() +getlongname(void) { char *b = &bp[0], *l = buflongname; @@ -427,8 +414,8 @@ getlongname() /* * Return the value of the termcap string 'capname' as stored in our list. */ -char -*getcapstr(char *capname) +char * +getcapstr(char *capname) { int i; @@ -484,7 +471,6 @@ search(char *names[], int max, char *infoname) return (i); return (-1); #else /* this doesn't work for some reason */ - extern char *bsearch(); char **bret; bret = (char **)bsearch(infoname, (char *)names, max, @@ -504,8 +490,8 @@ search(char *names[], int max, char *infoname) /* * return the value of the terminfo string 'infoname' */ -char -*getinfostr(char *infoname) +char * +getinfostr(char *infoname) { int i; @@ -582,7 +568,7 @@ putnum(char *infoname, int newvalue) (void) fprintf(stderr, "%s: TERM=%s: the numeric name '%s' was not " "found!\n", - progname, term_name, infoname); + progname, term_name, infoname); } /* @@ -616,7 +602,7 @@ putstr(char *infoname, char *newvalue) (void) fprintf(stderr, "%s: TERM=%s: the string name '%s' was not " "found!\n", - progname, term_name, infoname); + progname, term_name, infoname); } /* @@ -692,7 +678,7 @@ struct * capabilities. */ static void -handleko() +handleko(void) { char capname[3]; char *capstr; @@ -807,7 +793,7 @@ prchar(FILE *stream, int c) } static void -handlema() +handlema(void) { char vichar; char cap[2]; @@ -888,7 +874,7 @@ handlema() * given. We'll assume that the defaults are in effect for this terminal. */ void -adddefaults() +adddefaults(void) { char *cap; int sg; @@ -984,8 +970,8 @@ adddefaults() /* * add the string to the string table */ -char -*caddstr(char *to, char *str) +char * +caddstr(char *to, char *str) { while (*str) *to++ = *str++; @@ -1241,7 +1227,7 @@ changecalculations() } static void -print_no_use_entry() +print_no_use_entry(void) { int i; @@ -1316,7 +1302,7 @@ print_use_entry(char *usename) } static void -captoinfo() +captoinfo(void) { char usename[512]; char *sterm_name; @@ -1359,7 +1345,7 @@ captoinfo() #include <signal.h> /* use this file to determine if this is SVR4.0 system */ static void -use_etc_termcap() +use_etc_termcap(void) { if (verbose) #ifdef SIGSTOP @@ -1372,7 +1358,7 @@ use_etc_termcap() } static void -initdirname() +initdirname(void) { #if defined(SYSV) || defined(USG) /* handle both Sys Vr2 and Vr3 curses */ (void) getcwd(dirname, BUFSIZ-2); @@ -1399,7 +1385,7 @@ setfilename(char *capfile) } static void -setterm_name() +setterm_name(void) { if (verbose) (void) fprintf(trace, "setting the environment " @@ -1412,8 +1398,8 @@ setterm_name() /* As a side-effect, comment lines and blank lines */ /* are copied to standard output. */ -char -*getterm_name(char *line) +char * +getterm_name(char *line) { char *lineptr = line; @@ -1503,7 +1489,7 @@ sorttable(char *nametable[], char *codetable[]) * value tables. */ static void -inittables() +inittables(void) { unsigned int i; @@ -1529,6 +1515,7 @@ inittables() sorttable(strnames, strcodes); } +int main(int argc, char **argv) { int c; @@ -1569,7 +1556,7 @@ main(int argc, char **argv) (void) fprintf(stderr, "\t-V\tprint program version\n"); exit(-1); - } + } /* initialize */ pr_init(pr_terminfo); @@ -1580,7 +1567,7 @@ main(int argc, char **argv) else { initdirname(); for (; optind < argc; optind++) - use_file(argv [optind]); + use_file(argv [optind]); } return (0); @@ -1589,4 +1576,8 @@ main(int argc, char **argv) /* fake out the modules in print.c so we don't have to load in */ /* cexpand.c and infotocap.c */ /* ARGSUSED */ -int cpr(stream, string) FILE *stream; char *string; { return 0; } +int +cpr(FILE *stream, char *string) +{ + return (0); +} diff --git a/usr/src/cmd/captoinfo/otermcap.c b/usr/src/cmd/captoinfo/otermcap.c index 1f8baddb97..f7f3cfb2e8 100644 --- a/usr/src/cmd/captoinfo/otermcap.c +++ b/usr/src/cmd/captoinfo/otermcap.c @@ -19,15 +19,14 @@ * * CDDL HEADER END */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + #pragma ident "%Z%%M% %I% %E% SMI" /* Copyright (c) 1979 Regents of the University of California */ @@ -78,8 +77,8 @@ static char *tbuf; static int hopcount; /* detect infinite loops in termcap, init 0 */ -char *tskip(); -char *otgetstr(); +char *tskip(char *); +char *otgetstr(char *, char **); /* Tony Hansen */ int TLHtcfound = 0; @@ -87,7 +86,7 @@ char TLHtcname[16]; static char *termname; static int _tgetent(char *, char *); -static int otnchktc(); +static int otnchktc(void); static char *tdecode(char *, char **); static int otnamatch(char *); /* @@ -95,6 +94,7 @@ static int otnamatch(char *); * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. */ +int otgetent(char *bp, char *name) { /* Tony Hansen */ @@ -202,7 +202,7 @@ _tgetent(char *bp, char *name) * Note that this works because of the left to right scan. */ static int -otnchktc() +otnchktc(void) { char *p, *q; #define TERMNAMESIZE 16 @@ -283,7 +283,7 @@ otnamatch(char *np) * knowing about \: escapes or any such. If necessary, :'s can be put * into the termcap file in octal. */ -/* static - TLH removed */ char * +char * tskip(char *bp) { @@ -302,6 +302,7 @@ tskip(char *bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ +int otgetnum(char *id) { int i, base; @@ -334,6 +335,7 @@ otgetnum(char *id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ +int otgetflag(char *id) { char *bp = tbuf; @@ -414,7 +416,8 @@ nextc: c -= '0', i = 2; do c <<= 3, c |= *str++ - '0'; - while (--i && isdigit(*str)); + while (--i && isdigit(*str)) + ; } break; } diff --git a/usr/src/cmd/deroff/deroff.c b/usr/src/cmd/deroff/deroff.c index 73abe933fa..26656d682a 100644 --- a/usr/src/cmd/deroff/deroff.c +++ b/usr/src/cmd/deroff/deroff.c @@ -19,15 +19,14 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - - /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + #pragma ident "%Z%%M% %I% %E% SMI" #include <assert.h> @@ -122,14 +121,14 @@ static void putmac(char *, int); static void putwords(int); static void regline(int, int); static void sce(void); -static int skeqn(); +static int skeqn(void); static void sdis(char, char); static void stbl(void); static void tbl(void); static void usage(void); -static void work(void); +static void work(void) __NORETURN; -void +int main(int ac, char **av) { int i; @@ -166,8 +165,10 @@ main(int ac, char **av) errflg++; } } - if (errflg) + if (errflg) { usage(); + return (1); + } if (optind == argc) infile = stdin; else @@ -184,15 +185,12 @@ main(int ac, char **av) chars['\''] = APOS; chars['&'] = APOS; work(); + /* NOTREACHED */ } - - - - static int -skeqn() +skeqn(void) { while ((c = getc(infile)) != rdelim) { if (c == EOF) { @@ -317,7 +315,6 @@ usage(void) (void) fputs(gettext( "usage: deroff [ -w ] [ -m (m s l) ] [ -i ] " "[ file ] ... \n"), stderr); - exit(1); } static void diff --git a/usr/src/cmd/regcmp/regcmp.c b/usr/src/cmd/regcmp/regcmp.c index ed2776d2d1..edba830e73 100644 --- a/usr/src/cmd/regcmp/regcmp.c +++ b/usr/src/cmd/regcmp/regcmp.c @@ -19,21 +19,25 @@ * * CDDL HEADER END */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - /* - * Copyright (c) 1997, by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 1997 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6.1.1 */ +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + +#pragma ident "%Z%%M% %I% %E% SMI" #include <stdio.h> #include <locale.h> #include <libgen.h> -FILE *fopen(); +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/stat.h> +#include <fcntl.h> + FILE *iobuf; int gotflg; char ofile[64]; @@ -41,12 +45,16 @@ char a1[1024]; char a2[64]; int c; -main(argc, argv) char **argv; +int getnm(char); +int size(char *); + +int +main(int argc, char **argv) { - register char *name, *str, *v; + char *name, *str, *v; char *bp, *cp, *sv; char *message; - int j, k, cflg = 0; + int k, cflg = 0; int status = 0; (void) setlocale(LC_ALL, ""); @@ -145,7 +153,7 @@ main(argc, argv) char **argv; continue; default: if (c <= '7' && c >= '0') - *str++ = getnm(c); + *str++ = getnm((char)c); else *str++ = c; continue; } @@ -185,23 +193,26 @@ main(argc, argv) char **argv; } fclose(iobuf); } - exit(status); + return (status); } -size(p) -char *p; + +int +size(char *p) { - register i; - register char *q; + int i; + char *q; i = 0; q = p; while (*q++) i++; return (i); } -getnm(j) char j; + +int +getnm(char j) { - register int i; - register int k; + int i; + int k; i = j - '0'; k = 1; while (++k < 4 && (c = getc(iobuf)) >= '0' && c <= '7') diff --git a/usr/src/cmd/tbl/t..c b/usr/src/cmd/tbl/t..c index e52183b506..c7b10360c2 100644 --- a/usr/src/cmd/tbl/t..c +++ b/usr/src/cmd/tbl/t..c @@ -1,19 +1,18 @@ +/* + * Copyright 1998 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* t..c : external declarations */ @@ -29,7 +28,7 @@ # define CLLEN 10 # define SHORTLINE 4 # define BIGBUF 8192 -extern char *gets1(); +extern char *gets1(char *, int); extern int nlin, ncol, iline, nclin, nslin; extern int style[MAXHEAD][MAXCOL]; extern int ctop[MAXHEAD][MAXCOL]; @@ -58,10 +57,10 @@ extern int left1flg; extern int rightl; struct colstr {char *col, *rcol;}; extern struct colstr *table[]; -extern int *alocv(); +extern int *alocv(int); extern char *cspace, *cstore; -extern char *chspace(); -extern char *maknew(); +extern char *chspace(void); +extern char *maknew(char *); extern char *exstore, *exlim; extern int sep[]; extern int used[], lused[], rused[]; diff --git a/usr/src/cmd/tbl/t0.c b/usr/src/cmd/tbl/t0.c index 7bbf44b2ba..c95a45bc2e 100644 --- a/usr/src/cmd/tbl/t0.c +++ b/usr/src/cmd/tbl/t0.c @@ -1,19 +1,18 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* t0.c: storage allocation */ # diff --git a/usr/src/cmd/tbl/t1.c b/usr/src/cmd/tbl/t1.c index 9983649579..b2f2b585cb 100644 --- a/usr/src/cmd/tbl/t1.c +++ b/usr/src/cmd/tbl/t1.c @@ -1,6 +1,10 @@ -/* Co/pyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* + * Copyright 1998 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ /* * Copyright (c) 1980 Regents of the University of California. @@ -8,18 +12,15 @@ * specifies the terms and conditions for redistribution. */ -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* t1.c: main control and input switching */ # #include <locale.h> # include "t..c" #include <signal.h> +#include <stdlib.h> + # ifdef gcos /* required by GCOS because file is passed to "tbl" by troff preprocessor */ # define _f1 _f @@ -41,8 +42,10 @@ extern FILE *_f[]; # define ever (;;) -main(argc,argv) - char *argv[]; +void setinp(int, char **); + +int +main(int argc, char **argv) { # ifdef unix void badsig(); @@ -61,9 +64,8 @@ if(!intss()) tabout = fopen("qq", "w"); /* default media code is type 5 */ exit(tbl(argc,argv)); } - -tbl(argc,argv) - char *argv[]; +int +tbl(int argc, char **argv) { char line[BIGBUF]; /* required by GCOS because "stdout" is set by troff preprocessor */ @@ -78,10 +80,12 @@ while (gets1(line, sizeof line)) fclose(tabin); return(0); } + int sargc; char **sargv; -setinp(argc,argv) - char **argv; + +void +setinp(int argc, char **argv) { sargc = argc; sargv = argv; @@ -89,7 +93,9 @@ setinp(argc,argv) if (sargc>0) swapin(); } -swapin() + +int +swapin(void) { while (sargc>0 && **sargv=='-') /* Mem fault if no test on sargc */ { @@ -137,8 +143,10 @@ swapin() sargv++; return(1); } + # ifdef unix -void badsig() +void +badsig(void) { signal(SIGPIPE, SIG_IGN); exit(0); diff --git a/usr/src/cmd/tbl/t2.c b/usr/src/cmd/tbl/t2.c index a4bbe844f6..4f3a280bbd 100644 --- a/usr/src/cmd/tbl/t2.c +++ b/usr/src/cmd/tbl/t2.c @@ -1,23 +1,24 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* t2.c: subroutine sequencing for one table */ # include "t..c" -tableput() + +void +tableput(void) { saveline(); savefill(); diff --git a/usr/src/cmd/tbl/t3.c b/usr/src/cmd/tbl/t3.c index 48880f7e92..7b9cdb2e85 100644 --- a/usr/src/cmd/tbl/t3.c +++ b/usr/src/cmd/tbl/t3.c @@ -1,22 +1,23 @@ +/* + * Copyright 1991 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* t3.c: interpret commands affecting whole table */ # include "t..c" +#include <string.h> + struct optstr {char *optnam; int *optadd;} options [] = { "expand", &expflg, "EXPAND", &expflg, @@ -39,8 +40,11 @@ struct optstr {char *optnam; int *optadd;} options [] = { "delim", &delim1, "DELIM", &delim1, 0,0}; -extern char *strchr(); -getcomm() + +void backrest(char *); + +void +getcomm(void) { char line[200], *cp, nb[25], *t; struct optstr *lp; @@ -99,8 +103,9 @@ cp++; backrest(cp); return; } -backrest(cp) - char *cp; + +void +backrest(char *cp) { char *s; for(s=cp; *s; s++); diff --git a/usr/src/cmd/tbl/t4.c b/usr/src/cmd/tbl/t4.c index 610c0042f4..262ff12ca2 100644 --- a/usr/src/cmd/tbl/t4.c +++ b/usr/src/cmd/tbl/t4.c @@ -1,5 +1,5 @@ /* - * Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -18,7 +18,11 @@ /* t4.c: read table specification */ # include "t..c" int oncol; -getspec() + +void readspec(void); + +void +getspec(void) { int icol, i; for(icol=0; icol<MAXCOL; icol++) @@ -44,7 +48,9 @@ for(i=0; i<ncol; i++) fprintf(tabout, " %02d", 80+i); fprintf(tabout, "\n"); } -readspec() + +void +readspec(void) { int icol, c, sawchar, stopc, i; char sn[10], *snp, *temp; diff --git a/usr/src/cmd/tbl/t5.c b/usr/src/cmd/tbl/t5.c index 08a1700d66..babc31f573 100644 --- a/usr/src/cmd/tbl/t5.c +++ b/usr/src/cmd/tbl/t5.c @@ -1,12 +1,11 @@ /* - * Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,7 +16,11 @@ /* t5.c: read data for table */ # include "t..c" -gettbl() + +void permute(void); + +void +gettbl(void) { int icol, ch; cstore=cspace= chspace(); @@ -113,7 +116,9 @@ permute(); if (textflg) untext(); return; } -nodata(il) + +int +nodata(int il) { int c; for (c=0; c<ncol;c++) @@ -126,7 +131,9 @@ for (c=0; c<ncol;c++) } return(1); } -oneh(lin) + +int +oneh(int lin) { int k, icol; k = ctype(lin,0); @@ -137,8 +144,11 @@ for(icol=1; icol<ncol; icol++) } return(k); } + # define SPAN "\\^" -permute() + +void +permute(void) { int irow, jcol, is; char *start, *strig; @@ -167,7 +177,9 @@ for(jcol=0; jcol<ncol; jcol++) } } } -vspand(ir,ij,ifform) + +int +vspand(int ir, int ij, int ifform) { if (ir<0) return(0); if (ir>=nlin)return(0); @@ -178,8 +190,9 @@ if (table[ir][ij].rcol!=0) return(0); if (fullbot[ir]) return(0); return(vspen(table[ir][ij].col)); } -vspen(s) - char *s; + +int +vspen(char *s) { if (s==0) return(0); if (!point(s)) return(0); diff --git a/usr/src/cmd/tbl/t6.c b/usr/src/cmd/tbl/t6.c index 92ea2537a6..e862b71de1 100644 --- a/usr/src/cmd/tbl/t6.c +++ b/usr/src/cmd/tbl/t6.c @@ -1,3 +1,8 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -8,17 +13,16 @@ * specifies the terms and conditions for redistribution. */ -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* t6.c: compute tab stops */ # define tx(a) (a>(char *)0 && a<(char *)128) # include "t..c" -maktab() + +void wide(char *, char *, char *); + +void +maktab(void) { # define FN(i,c) font[stynum[i]][c] # define SZ(i,c) csize[stynum[i]][c] @@ -196,8 +200,9 @@ fprintf(tabout, ".if t .if \\n(TW>\\n(.li .tm Table at line %d file %s is too wide - \\n(TW units\n", iline-1, ifile); return; } -wide(s, fn, size) - char *s, *size, *fn; + +void +wide(char *s, char *fn, char *size) { if (point(s)) { @@ -212,8 +217,9 @@ if (point(s)) else fprintf(tabout, "\\n(%c-", s); } -filler(s) - char *s; + +int +filler(char *s) { return (point(s) && s[0]=='\\' && s[1] == 'R'); } diff --git a/usr/src/cmd/tbl/t7.c b/usr/src/cmd/tbl/t7.c index 15f5e1f893..337e1f7098 100644 --- a/usr/src/cmd/tbl/t7.c +++ b/usr/src/cmd/tbl/t7.c @@ -1,24 +1,28 @@ /* - * Copyright (c) 1983-1998 by Sun Microsystems, Inc. - * All Rights Reserved. + * Copyright 1998 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ -#ident "%Z%%M% %I% %E% SMI" - /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - - /* t7.c: control to write table entries */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* t7.c: control to write table entries */ # include "t..c" # define realsplit ((ct=='a'||ct=='n') && table[ldata][c].rcol) -runout() + +void need(void); +void deftail(void); + +void +runout(void) { int i; if (boxflg || allflg || dboxflg) need(); @@ -40,7 +44,9 @@ fprintf(tabout, ".T# 1\n"); if (ctrflg) fprintf(tabout, ".in \\n(#Iu\n"); } -runtabs(lform, ldata) + +void +runtabs(int lform, int ldata) { int c, ct, vforml, lf; fprintf(tabout, ".ta "); @@ -72,8 +78,9 @@ for(c=0; c<ncol; c++) } fprintf(tabout, "\n"); } -ifline(s) - char *s; + +int +ifline(char *s) { if (!point(s)) return(0); if (s[0] == '\\') s++; @@ -83,7 +90,8 @@ if (s[0] == '=') return('='); return(0); } -need() +void +need(void) { int texlin, horlin, i; @@ -104,7 +112,8 @@ need() (void) fprintf(tabout, ".if n .ne %dv\n", 2 * texlin + 2 * horlin + 2); } -deftail() +void +deftail(void) { int i, c, lf, lwid; for(i=0; i<MAXHEAD; i++) diff --git a/usr/src/cmd/tbl/t8.c b/usr/src/cmd/tbl/t8.c index 55cd482def..0b05b43b4f 100644 --- a/usr/src/cmd/tbl/t8.c +++ b/usr/src/cmd/tbl/t8.c @@ -1,30 +1,41 @@ +/* + * Copyright 1996 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* t8.c: write out one line of output table */ # include "t..c" # include <locale.h> # define realsplit ((ct=='a'||ct=='n') && table[nl][c].rcol) + int watchout; int once; int topat[MAXCOL]; -putline(i, nl) - /* i is line number for deciding format */ - /* nl is line number for finding data usually identical */ + +void puttext(char *, char *, char *); +void funnies(int, int); +void putfont(char *); +void putsize(char *); + +/* + * parameters + * + * i: line number for deciding format + * nl: line number for finding data usually identical + */ +void +putline(int i, int nl) { int c, lf, ct, form, lwid, vspf, ip = -1, cmidx, exvspen, vforml; int vct, chfont; @@ -253,8 +264,9 @@ if (vspf) } } } -puttext(s,fn, size) - char *s, *size, *fn; + +void +puttext(char *s, char *fn, char *size) { if (point(s)) { @@ -265,7 +277,9 @@ if (point(s)) if (size!=0) putsize("0"); } } -funnies( stl, lin) + +void +funnies(int stl, int lin) { /* write out funny diverted things */ int c, s, pl, lwid, dv, lf, ct; @@ -331,14 +345,16 @@ for(c=dv=0; c<ncol; c++) if (dv) fprintf(tabout,"\n"); } -putfont(fn) - char *fn; + +void +putfont(char *fn) { if (fn && *fn) fprintf(tabout, fn[1] ? "\\f(%.2s" : "\\f%.2s", fn); } -putsize(s) - char *s; + +void +putsize(char *s) { if (s && *s) fprintf(tabout, "\\s%s",s); diff --git a/usr/src/cmd/tbl/t9.c b/usr/src/cmd/tbl/t9.c index d18d0a33e9..ff26084673 100644 --- a/usr/src/cmd/tbl/t9.c +++ b/usr/src/cmd/tbl/t9.c @@ -1,5 +1,5 @@ /* - * Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -17,8 +17,11 @@ /* t9.c: write lines for tables over 200 lines */ # include "t..c" -static useln; -yetmore() + +static int useln; + +void +yetmore(void) { for(useln=0; useln<MAXLIN && table[useln]==0; useln++); if (useln>=MAXLIN) @@ -33,8 +36,9 @@ while (gets1(cstore=cspace, MAXSTR) && domore(cstore)) last =cstore; return; } -domore(dataln) - char *dataln; + +int +domore(char *dataln) { int icol, ch; if (prefix(".TE", dataln)) diff --git a/usr/src/cmd/tbl/tb.c b/usr/src/cmd/tbl/tb.c index c6d06963e1..b82d7532d0 100644 --- a/usr/src/cmd/tbl/tb.c +++ b/usr/src/cmd/tbl/tb.c @@ -1,23 +1,25 @@ +/* + * Copyright 1991 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tb.c: check which entries exist, also storage allocation */ # include "t..c" -checkuse() +#include <stdlib.h> + +void +checkuse(void) { int i,c, k; for(c=0; c<ncol; c++) @@ -41,21 +43,24 @@ for(c=0; c<ncol; c++) } } } -real(s) - char *s; + +int +real(char *s) { if (s==0) return(0); if (!point(s)) return(1); if (*s==0) return(0); return(1); } + int spcount = 0; -extern char * calloc(); + # define MAXVEC 20 + char *spvecs[MAXVEC]; char * -chspace() +chspace(void) { char *pp; if (spvecs[spcount]) @@ -67,13 +72,15 @@ if (pp == 0) error(gettext("no space for characters")); return(pp); } + # define MAXPC 50 + char *thisvec; int tpcount = -1; char *tpvecs[MAXPC]; int * -alocv(n) +alocv(int n) { int *tp, *q; if (tpcount<0 || thisvec+n > tpvecs[tpcount]+MAXCHS) @@ -93,7 +100,9 @@ for(q=tp; q<(int *)thisvec; q++) *q=0; return(tp); } -release() + +void +release(void) { extern char *exstore; /* give back unwanted space in some vectors */ diff --git a/usr/src/cmd/tbl/tc.c b/usr/src/cmd/tbl/tc.c index 113c271943..85a583c636 100644 --- a/usr/src/cmd/tbl/tc.c +++ b/usr/src/cmd/tbl/tc.c @@ -1,23 +1,24 @@ +/* + * Copyright 1991 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tc.c: find character not in table to delimit fields */ # include "t..c" -choochar() + +void +choochar(void) { /* choose funny characters to delimit fields */ int had[128], ilin,icol, k; @@ -38,7 +39,7 @@ for(ilin=0;ilin<nlin;ilin++) if (point(s)) while (*s) { - if (*s > 0 && *s <= 127) + if (*s > 0 && (unsigned char)*s <= 127) had[*s++]=1; else s++; @@ -47,7 +48,7 @@ for(ilin=0;ilin<nlin;ilin++) if (point(s)) while (*s) { - if (*s > 0 && *s <= 127) + if (*s > 0 && (unsigned char)*s <= 127) had[*s++]=1; else s++; @@ -81,7 +82,9 @@ if (F1==0 || F2==0) error(gettext("couldn't find characters to use for delimiters")); return; } -point(s) + +int +point(int s) { return(s>= 128 || s<0); } diff --git a/usr/src/cmd/tbl/te.c b/usr/src/cmd/tbl/te.c index 8f85f731fc..b5bcb47b8e 100644 --- a/usr/src/cmd/tbl/te.c +++ b/usr/src/cmd/tbl/te.c @@ -1,17 +1,16 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright 1983-1988,2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -19,8 +18,9 @@ # include "t..c" # include <locale.h> # include <errno.h> -error(s) - char *s; + +void +error(char *s) { fprintf(stderr, gettext("\n%s: line %d: %s\n"), ifile, iline, s); # ifdef unix @@ -32,9 +32,9 @@ fprintf(stderr, "run terminated due to error condition detected by tbl preproces exit(0); # endif } + char * -errmsg(errnum) - int errnum; +errmsg(int errnum) { extern int sys_nerr; extern char *sys_errlist[]; @@ -47,10 +47,9 @@ if (errnum > sys_nerr) else return (sys_errlist[errnum]); } + char * -gets1(s, len) - char *s; - int len; +gets1(char *s, int len) { char *p; int nbl; @@ -60,7 +59,7 @@ while(len > 0) while ((p = fgets(s,len,tabin))==0) { if (swapin()==0) - return(0); + return((char *)0); } while (*s) s++; @@ -89,10 +88,14 @@ while(len > 0) return(p); } + # define BACKMAX 500 + char backup[BACKMAX]; char *backp = backup; -un1getc(c) + +void +un1getc(int c) { if (c=='\n') iline--; @@ -100,7 +103,9 @@ if (c=='\n') if (backp >= backup+BACKMAX) error(gettext("too much backup")); } -get1char() + +int +get1char(void) { int c; if (backp>backup) diff --git a/usr/src/cmd/tbl/tf.c b/usr/src/cmd/tbl/tf.c index 9ad09a9073..f39f655639 100644 --- a/usr/src/cmd/tbl/tf.c +++ b/usr/src/cmd/tbl/tf.c @@ -1,23 +1,24 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tf.c: save and restore fill mode around table */ # include "t..c" -savefill() + +void +savefill(void) { /* remembers various things: fill mode, vs, ps in mac 35 (SF) */ fprintf(tabout, ".de %d\n",SF); @@ -33,11 +34,15 @@ fprintf(tabout, ".nf\n"); fprintf(tabout, ".nr #~ 0\n"); fprintf(tabout, ".if n .nr #~ 0.6n\n"); } -rstofill() + +void +rstofill(void) { fprintf(tabout, ".%d\n",SF); } -endoff() + +void +endoff(void) { int i; for(i=0; i<MAXHEAD; i++) @@ -47,22 +52,30 @@ int i; fprintf(tabout, ".rm %c+\n",texstr[i]); fprintf(tabout, "%s\n", last); } -ifdivert() + +void +ifdivert(void) { fprintf(tabout, ".ds #d .d\n"); fprintf(tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n"); } -saveline() + +void +saveline(void) { fprintf(tabout, ".if \\n+(b.=1 .nr d. \\n(.c-\\n(c.-1\n"); linstart=iline; } -restline() + +void +restline(void) { fprintf(tabout,".if \\n-(b.=0 .nr c. \\n(.c-\\n(d.-%d\n", iline-linstart); linstart = 0; } -cleanfc() + +void +cleanfc(void) { fprintf(tabout, ".fc\n"); } diff --git a/usr/src/cmd/tbl/tg.c b/usr/src/cmd/tbl/tg.c index ccd1f87334..eb70505790 100644 --- a/usr/src/cmd/tbl/tg.c +++ b/usr/src/cmd/tbl/tg.c @@ -1,25 +1,25 @@ +/* + * Copyright 1998 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tg.c: process included text blocks */ # include "t..c" /* get_text was originally gettext and was renamed */ -get_text(sp, ilin,icol, fn, sz) - char *sp, *fn, *sz; + +int +get_text(char *sp, int ilin, int icol, char *fn, char *sz) { /* get a section of text */ char line[BIGBUF]; @@ -79,7 +79,9 @@ oname=texname; texname = texstr[++texct]; return(oname); } -untext() + +void +untext(void) { rstofill(); fprintf(tabout, ".nf\n"); diff --git a/usr/src/cmd/tbl/ti.c b/usr/src/cmd/tbl/ti.c index 2d980827d0..5f852162eb 100644 --- a/usr/src/cmd/tbl/ti.c +++ b/usr/src/cmd/tbl/ti.c @@ -1,24 +1,25 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ + +#pragma ident "%Z%%M% %I% %E% SMI" /* ti.c: classify line intersections */ # include "t..c" /* determine local environment for intersections */ -interv(i,c) + +int +interv(int i, int c) { int ku, kl; if (c>=ncol || c == 0) @@ -42,7 +43,9 @@ if (ku ==2) return(TOP); if (kl==BOT) return(2); return(0); } -interh(i,c) + +int +interh(int i, int c) { int kl, kr; if (fullbot[i]== '=' || (dboxflg && (i==0 || i>= nlin-1))) @@ -65,7 +68,9 @@ if (kl== '=') return(LEFT); if (kr== '=') return(RIGHT); return(0); } -up1(i) + +int +up1(int i) { i--; while (instead[i] && i>0) i--; diff --git a/usr/src/cmd/tbl/tm.c b/usr/src/cmd/tbl/tm.c index b3cf5249d0..b9042a6bfa 100644 --- a/usr/src/cmd/tbl/tm.c +++ b/usr/src/cmd/tbl/tm.c @@ -1,25 +1,24 @@ +/* + * Copyright 1991 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tm.c: split numerical fields */ # include "t..c" + char * -maknew(str) - char *str; +maknew(char *str) { /* make two numerical fields */ int c; @@ -64,9 +63,10 @@ maknew(str) } while (*exstore++ = *str++); *p = 0; return(q); - } -ineqn (s, p) - char *s, *p; +} + +int +ineqn (char *s, char *p) { /* true if s is in a eqn within p */ int ineq = 0, c; diff --git a/usr/src/cmd/tbl/ts.c b/usr/src/cmd/tbl/ts.c index 393b88ce7d..42937aaa5c 100644 --- a/usr/src/cmd/tbl/ts.c +++ b/usr/src/cmd/tbl/ts.c @@ -1,23 +1,22 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* ts.c: minor string processing subroutines */ -match (s1, s2) - char *s1, *s2; +int +match(char *s1, char *s2) { while (*s1 == *s2) if (*s1++ == '\0') @@ -26,41 +25,50 @@ match (s1, s2) s2++; return(0); } -prefix(small, big) - char *small, *big; + +int +prefix(char *small, char *big) { int c; while ((c= *small++) == *big++) if (c==0) return(1); return(c==0); } -letter (ch) - { + +int +letter(int ch) +{ if (ch >= 'a' && ch <= 'z') return(1); if (ch >= 'A' && ch <= 'Z') return(1); return(0); - } -numb(str) - char *str; - { +} + +int +numb(char *str) +{ /* convert to integer */ int k; for (k=0; *str >= '0' && *str <= '9'; str++) k = k*10 + *str - '0'; return(k); - } -digit(x) - { +} + +int +digit(int x) +{ return(x>= '0' && x<= '9'); - } -max(a,b) +} + +int +max(int a, int b) { return( a>b ? a : b); } -tcopy (s,t) - char *s, *t; + +void +tcopy(char *s, char *t) { while (*s++ = *t++); } diff --git a/usr/src/cmd/tbl/tt.c b/usr/src/cmd/tbl/tt.c index 817f7f6a30..806d3a1328 100644 --- a/usr/src/cmd/tbl/tt.c +++ b/usr/src/cmd/tbl/tt.c @@ -1,23 +1,24 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tt.c: subroutines for drawing horizontal lines */ # include "t..c" -ctype(il, ic) + +int +ctype(int il, int ic) { if (instead[il]) return(0); @@ -26,16 +27,22 @@ if (fullbot[il]) il = stynum[il]; return(style[il][ic]); } -min(a,b) + +int +min(int a, int b) { return(a<b ? a : b); } -fspan(i,c) + +int +fspan(int i, int c) { c++; return(c<ncol && ctype(i,c)=='s'); } -lspan(i,c) + +int +lspan(int i, int c) { int k; if (ctype(i,c) != 's') return(0); @@ -45,7 +52,9 @@ if (c < ncol && ctype(i,c)== 's') for(k=0; ctype(i,--c) == 's'; k++); return(k); } -ctspan(i,c) + +int +ctspan(int i, int c) { int k; c++; @@ -53,14 +62,18 @@ for(k=1; c<ncol && ctype(i,c)=='s'; k++) c++; return(k); } -tohcol(ic) + +void +tohcol(int ic) { if (ic==0) fprintf(tabout, "\\h'|0'"); else fprintf(tabout, "\\h'(|\\n(%du+|\\n(%du)/2u'", ic+CLEFT, ic+CRIGHT-1); } -allh(i) + +int +allh(int i) { /* return true if every element in line i is horizontal */ /* also at least one must be horizontl */ @@ -75,7 +88,9 @@ for(one=c=0; c<ncol; c++) } return(one); } -thish(i,c) + +int +thish(int i, int c) { int t; char *s; diff --git a/usr/src/cmd/tbl/tu.c b/usr/src/cmd/tbl/tu.c index 8771729f40..254ed3a2e4 100644 --- a/usr/src/cmd/tbl/tu.c +++ b/usr/src/cmd/tbl/tu.c @@ -1,23 +1,26 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tu.c: draws horizontal lines */ # include "t..c" -makeline(i,c,lintype) + +void drawline(int, int, int, int, int, int); + +void +makeline(int i, int c, int lintype) { int cr, type, shortl; type = thish(i,c); @@ -31,7 +34,9 @@ else for(cr=c+1; cr<ncol && ctype(i,cr)=='s'; cr++); drawline(i, c, cr-1, lintype, 0, shortl); } -fullwide(i, lintype) + +void +fullwide(int i, int lintype) { int cr, cl; if (!pr1403) @@ -53,7 +58,8 @@ if (!pr1403) fprintf(tabout, ".vs \\n(%du\n", SVS); } -drawline(i, cl, cr, lintype, noheight, shortl) +void +drawline(int i, int cl, int cr, int lintype, int noheight, int shortl) { char *exhr, *exhl, *lnch; int lcount, ln, linpos, oldpos, nodata; @@ -144,7 +150,9 @@ if (oldpos!=0) if (!nodata) fprintf(tabout, "\\v'+.5m'"); } -getstop() + +void +getstop(void) { int i,c,k,junk, stopp; stopp=1; @@ -160,8 +168,9 @@ for(i=0; i<nlin; i++) if (boxflg || allflg || dboxflg) linestop[0]=1; } -left(i,c, lwidp) - int *lwidp; + +int +left(int i, int c, int *lwidp) { int kind, li, lj; /* returns -1 if no line to left */ @@ -184,7 +193,9 @@ for(i= i+1; i<li; i++) li=i; return(li); } -lefdata(i,c) + +int +lefdata(int i, int c) { int ck; if (i>=nlin) i=nlin-1; @@ -202,7 +213,9 @@ if (allflg)return(1); if (boxflg && c==0) return(1); return(0); } -next(i) + +int +next(int i) { while (i+1 <nlin) { @@ -211,7 +224,9 @@ while (i+1 <nlin) } return(i); } -prev(i) + +int +prev(int i) { while (--i >=0 && (fullbot[i] || instead[i])) ; diff --git a/usr/src/cmd/tbl/tv.c b/usr/src/cmd/tbl/tv.c index 37afe3f2de..77fa9c5881 100644 --- a/usr/src/cmd/tbl/tv.c +++ b/usr/src/cmd/tbl/tv.c @@ -1,23 +1,24 @@ +/* + * Copyright 1990 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ - -/* - * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc. - * All Rights Reserved. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* tv.c: draw vertical lines */ # include "t..c" -drawvert(start,end, c, lwid) + +void +drawvert(int start, int end, int c, int lwid) { char *exb=0, *ext=0; int tp=0, sl, ln, pos, epb, ept, vm; @@ -125,8 +126,8 @@ for(ln=0; ln<lwid; ln++) } } - -midbar(i,c) +int +midbar(int i, int c) { int k; k = midbcol(i,c); @@ -134,7 +135,9 @@ if (k==0 && c>0) k = midbcol(i, c-1); return(k); } -midbcol(i,c) + +int +midbcol(int i, int c) { int ct; while ( (ct=ctype(i,c)) == 's') @@ -146,8 +149,8 @@ if (ct=barent(table[i][c].col)) return(0); } -barent(s) - char *s; +int +barent(char *s) { if (s==0) return (1); if (!point(s)) return(1); |
