diff options
Diffstat (limited to 'usr.bin/sgmls')
32 files changed, 164 insertions, 164 deletions
diff --git a/usr.bin/sgmls/libsgmls/sgmls.c b/usr.bin/sgmls/libsgmls/sgmls.c index 5af7e5b..cbb03f1 100644 --- a/usr.bin/sgmls/libsgmls/sgmls.c +++ b/usr.bin/sgmls/libsgmls/sgmls.c @@ -303,7 +303,7 @@ int sgmls_next(sp, e) char *name; attribute_s *a; external_entity_s *ext; - + name = scan_token(&p); a = parse_attribute(sp, p); ext = lookup_external_entity(sp, name); @@ -449,7 +449,7 @@ int parse_data(p, linenop) else *q++ = *p++; } - + if (q > start || is_sdata) { if (n >= datav_size) grow_datav(); @@ -656,7 +656,7 @@ data_s *copy_data(v, n) unsigned total; char *p; data_s *result; - + result = (data_s *)xmalloc(n*sizeof(data_s)); total = 0; for (i = 0; i < n; i++) @@ -810,7 +810,7 @@ int read_line(sp) error(E_SYSTEM); return 0; } - + sp->input_lineno++; input_lineno = sp->input_lineno; for (;;) { @@ -979,7 +979,7 @@ void add_attribute(pp, a) *pp = a; } - + static char *strsave(s) char *s; diff --git a/usr.bin/sgmls/libsgmls/sgmls.h b/usr.bin/sgmls/libsgmls/sgmls.h index 79b2658..c327f15 100644 --- a/usr.bin/sgmls/libsgmls/sgmls.h +++ b/usr.bin/sgmls/libsgmls/sgmls.h @@ -35,7 +35,7 @@ struct sgmls_external_entity { struct sgmls_attribute *attributes; struct sgmls_notation *notation; }; - + struct sgmls_entity { union { struct sgmls_internal_entity internal; diff --git a/usr.bin/sgmls/rast/Makefile b/usr.bin/sgmls/rast/Makefile index 3be6c87..4c8a7c2 100644 --- a/usr.bin/sgmls/rast/Makefile +++ b/usr.bin/sgmls/rast/Makefile @@ -8,7 +8,7 @@ PROG= rast SRCS+= rast.c -CFLAGS+= -I${.CURDIR}/../libsgmls -I${.CURDIR}/../sgmls +CFLAGS+= -I${.CURDIR}/../libsgmls -I${.CURDIR}/../sgmls LDADD= ${LIBSGMLS} DPADD= ${LIBSGMLS} diff --git a/usr.bin/sgmls/rast/rast.c b/usr.bin/sgmls/rast/rast.c index 31b48de..2634679 100644 --- a/usr.bin/sgmls/rast/rast.c +++ b/usr.bin/sgmls/rast/rast.c @@ -518,7 +518,7 @@ void error(char *message,...) char *message; #endif va_list ap; - + fprintf(stderr, "%s: ", program_name); #ifdef VARARGS va_start(ap); diff --git a/usr.bin/sgmls/sgmls/ambig.c b/usr.bin/sgmls/sgmls/ambig.c index 9da02eb..942aa5d 100644 --- a/usr.bin/sgmls/sgmls/ambig.c +++ b/usr.bin/sgmls/sgmls/ambig.c @@ -102,7 +102,7 @@ VOID ambig() { struct contoken *s; int i; - + if (!follow) { /* We can't allocate everything in one chunk, because that would overflow a 16-bit unsigned if GRPGTCNT was 253. */ diff --git a/usr.bin/sgmls/sgmls/entgen.c b/usr.bin/sgmls/sgmls/entgen.c index 0829495..e08e9f0 100644 --- a/usr.bin/sgmls/sgmls/entgen.c +++ b/usr.bin/sgmls/sgmls/entgen.c @@ -1,7 +1,7 @@ /* entgen.c - Implement entgen() which generates a list of filenames from a struct fpi. - + Written by James Clark (jjc@jclark.com). */ @@ -207,7 +207,7 @@ char *buf; /* return -1 if the formal public identifier was invalid or missing. */ if (f->fpiversw < 0 || !f->fpipubis) return -1; - + switch (c) { case 'A': /* Is it available? */ return f->fpitt == '+' ? 0 : -1; @@ -307,7 +307,7 @@ struct fpi *f; return sysidgen((char *)f->fpisysis); file = path; - + for (;;) { char *p; int len = 0; @@ -334,7 +334,7 @@ struct fpi *f; } else len++; - + if (len > 0) { /* We've got a valid non-empty filename. */ char *s; @@ -368,7 +368,7 @@ UNIV sysidgen(s) char *s; { char *buf, *p; - + buf = (char *)rmalloc(strlen(s) + 2); for (p = buf; *s; s++) { diff --git a/usr.bin/sgmls/sgmls/etype.h b/usr.bin/sgmls/sgmls/etype.h index e4ee1f9..707f602 100644 --- a/usr.bin/sgmls/sgmls/etype.h +++ b/usr.bin/sgmls/sgmls/etype.h @@ -25,7 +25,7 @@ struct thdr { /* Token header or model header. */ UNCH ttype; /* Token type attributes or model content. */ union { - int tnum; /* Group token: tokens in group. + int tnum; /* Group token: tokens in group. Model header: content tokens at any level. */ struct etd *thetd; /* GI token: ptr to etd. */ } tu; diff --git a/usr.bin/sgmls/sgmls/exclude.c b/usr.bin/sgmls/sgmls/exclude.c index c3968b4..7d72cc0 100644 --- a/usr.bin/sgmls/sgmls/exclude.c +++ b/usr.bin/sgmls/sgmls/exclude.c @@ -18,7 +18,7 @@ VOID exclude() if ((mod->ttype & MKEYWORD) == 0 && exmark(1)) { int excl; - + excktok(mod + 1, 0, &excl); exmark(0); } @@ -58,7 +58,7 @@ int *excl; /* Set to 1 if token is excluded. */ int tnum; int optional = 0; int hadopt, hadreq; - + *excl = 0; switch (t->ttype & TTMASK) { @@ -100,7 +100,7 @@ int *excl; /* Set to 1 if token is excluded. */ default: abort(); } - + /* Was required, but exclusions have made it optional. eg <!element foo - - (a | b) -(a, b)> */ diff --git a/usr.bin/sgmls/sgmls/genlex.c b/usr.bin/sgmls/sgmls/genlex.c index 1e84ecf..2a0d3a6 100644 --- a/usr.bin/sgmls/sgmls/genlex.c +++ b/usr.bin/sgmls/sgmls/genlex.c @@ -34,7 +34,7 @@ int main(argc, argv) UNCH tab[256]; char special[256]; /* Shunned character numbers in the reference concrete syntax. */ - static UNCH refshun[] = { + static UNCH refshun[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 127, 255 }; @@ -89,7 +89,7 @@ int main(argc, argv) for (j = 0; j < 256; j++) if (!special[j]) { - if (shunned[j]) + if (shunned[j]) tab[j] = lextabs[i][CANON_ASCII_NONSGML]; else tab[j] = lextabs[i][CANON_ASCII_DATACHAR]; diff --git a/usr.bin/sgmls/sgmls/getopt.c b/usr.bin/sgmls/sgmls/getopt.c index 9a218b3..bc8edeb 100644 --- a/usr.bin/sgmls/sgmls/getopt.c +++ b/usr.bin/sgmls/sgmls/getopt.c @@ -132,7 +132,7 @@ char *opts; else optarg = argv[optind++]; sp = 1; - } + } else { if (argv[optind][++sp] == '\0') { sp = 1; diff --git a/usr.bin/sgmls/sgmls/lextaba.c b/usr.bin/sgmls/sgmls/lextaba.c index 54f9395..38a2fd1 100644 --- a/usr.bin/sgmls/sgmls/lextaba.c +++ b/usr.bin/sgmls/sgmls/lextaba.c @@ -457,15 +457,15 @@ DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, DAT, NON }; -#undef SIG -#undef DAT -#undef NON -#undef NU -#undef NMS -#undef SPC -#undef EE -#undef EOB -#undef RS +#undef SIG +#undef DAT +#undef NON +#undef NU +#undef NMS +#undef SPC +#undef EE +#undef EOB +#undef RS #undef COM1 #undef LIT3 #undef LITA diff --git a/usr.bin/sgmls/sgmls/lineout.c b/usr.bin/sgmls/sgmls/lineout.c index fd856ce..553c835 100644 --- a/usr.bin/sgmls/sgmls/lineout.c +++ b/usr.bin/sgmls/sgmls/lineout.c @@ -150,7 +150,7 @@ UNCH *ename; int rc; PNE np; UNCH *tp; - + if (sgmlment(ename)) /* already defined it */ return; rc = sgmlgent(ename, &np, &tp); @@ -294,7 +294,7 @@ UNIV id; ret = run_process(argv); if (ret != 0) suberr++; - + current_filename = 0; free(argv); if (ret == 0) @@ -410,7 +410,7 @@ UNCH *s; print_string(n, s, 0); putchar('\n'); } - + static VOID output_implied_attribute(ent, aname) UNCH *ent, *aname; @@ -451,7 +451,7 @@ int type; fatal("invalid attribute type %d", type); #endif return "INVALID"; -} +} static VOID output_begin_attribute(ent, aname, type) UNCH *ent, *aname; @@ -576,7 +576,7 @@ int is_sdata; if (is_sdata) fputs("\\|", stdout); } - + static VOID print_id(id, pubid, sysid) UNIV id; diff --git a/usr.bin/sgmls/sgmls/main.c b/usr.bin/sgmls/sgmls/main.c index 3435dce..4c8bbb3 100644 --- a/usr.bin/sgmls/sgmls/main.c +++ b/usr.bin/sgmls/sgmls/main.c @@ -178,7 +178,7 @@ char **argv; abort(); } } - + #ifdef CANT_REDIRECT_STDERR if (errfile) { FILE *fp; @@ -285,7 +285,7 @@ char **argv; for (i = 0; i < argc; i++) len += strlen(argv[i]) + 1; - + res = xmalloc(len); ptr = (char *)res; for (i = 0; i < argc; i++) { @@ -455,10 +455,10 @@ UNIV id; for (p = (char *)id, nfiles = 0; *p; p = strchr(p, '\0') + 1) nfiles++; - + argv = (char **)xmalloc((subargc + 2 + 1 + nfiles + 1)*sizeof(char *)); memcpy((UNIV)argv, (UNIV)subargv, subargc*sizeof(char *)); - + i = subargc; argv[i++] = "-c"; @@ -541,7 +541,7 @@ VOID fatal(int errnum,...) int errnum; #endif va_list ap; - + #ifdef VARARGS va_start(ap); errnum = va_arg(ap, int); @@ -563,7 +563,7 @@ VOID appl_error(int errnum,...) int errnum; #endif va_list ap; - + #ifdef VARARGS va_start(ap); errnum = va_arg(ap, int); diff --git a/usr.bin/sgmls/sgmls/md1.c b/usr.bin/sgmls/sgmls/md1.c index a2db320..9a294e3 100644 --- a/usr.bin/sgmls/sgmls/md1.c +++ b/usr.bin/sgmls/sgmls/md1.c @@ -721,7 +721,7 @@ UNCH *tbuf; /* Work area for tokenization (tbuf). */ mderr(129, tbuf+1, (UNCH *)0); return; } - /* Must omit omitted end-tag minimization, if omitted + /* Must omit omitted end-tag minimization, if omitted start-tag minimization was omitted (because OMITTAG == NO). */ if (!minomitted) { /* PARAMETER 2B: End-tag minimization. diff --git a/usr.bin/sgmls/sgmls/md2.c b/usr.bin/sgmls/sgmls/md2.c index 846c555..94dc4d3 100644 --- a/usr.bin/sgmls/sgmls/md2.c +++ b/usr.bin/sgmls/sgmls/md2.c @@ -98,7 +98,7 @@ UNCH *tbuf; /* Work area for tokenization[LITLEN+2]. */ etx.c = savestr(tbuf); break; case ESMD: /* MD: parameter literal required. */ - etx.c = sandwich(tbuf, lex.m.mdo, lex.m.mdc); + etx.c = sandwich(tbuf, lex.m.mdo, lex.m.mdc); goto bcheck; case ESMS: /* MS: parameter literal required. */ etx.c = sandwich(tbuf, lex.m.mss, lex.m.mse); @@ -355,7 +355,7 @@ VOID storedatt(pne) PNE pne; { int i; - + NEAL(pne) = (struct ad *)rmalloc((1+ADN(al))*ADSZ); memcpy((UNIV)NEAL(pne), (UNIV)al, (1+ADN(al))*ADSZ); for (i = 1; i <= (int)ADN(al); i++) { @@ -424,7 +424,7 @@ PFPI f; /* Ptr to formal public identifier structure. */ /* The standard only says that it *should* be two letters, so don't enforce that. */ for (i = 0; i < len; i++) { - /* Don't assume ASCII. */ + /* Don't assume ASCII. */ if (!strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", q[i])) return 7; } diff --git a/usr.bin/sgmls/sgmls/msgcat.c b/usr.bin/sgmls/sgmls/msgcat.c index 6b0d9cb..ec6a8b5 100644 --- a/usr.bin/sgmls/sgmls/msgcat.c +++ b/usr.bin/sgmls/sgmls/msgcat.c @@ -48,7 +48,7 @@ struct message { unsigned setnum; char *text; }; - + struct cat { char *name; int loaded; @@ -117,7 +117,7 @@ int oflag; if (!name) return 0; - + catp = (struct cat *)malloc(sizeof *catp); if (!catp) return 0; @@ -476,7 +476,7 @@ int quote; p[i] = '\0'; return p; } - + /* 0 success, -1 error */ static @@ -559,7 +559,7 @@ struct message **table; unsigned setnum, msgnum; { struct message **pp; - + for (pp = &table[hash(setnum, msgnum)]; *pp; pp = &(*pp)->next) if ((*pp)->setnum == setnum && (*pp)->msgnum == msgnum) { struct message *p = *pp; @@ -638,9 +638,9 @@ char **argv; struct message **list; unsigned setnum; struct message *table[HASH_TAB_SIZE]; - + program_name = argv[0]; - + if (argc < 3) usage(); @@ -666,7 +666,7 @@ char **argv; fclose(fp); } } - + errno = 0; fp = fopen(argv[1], "w"); if (!fp) @@ -687,7 +687,7 @@ char **argv; list[j++] = p; } assert(j == nmessages); - + qsort((UNIV)list, nmessages, sizeof(struct message *), message_compare); setnum = NL_SETD; @@ -728,8 +728,8 @@ VOID fatal(char *message,...) message = va_arg(ap, char *); #else /* not VARARGS */ va_start(ap, message); -#endif /* not VARARGS */ - +#endif /* not VARARGS */ + fprintf(stderr, "%s: ", program_name); vfprintf(stderr, message, ap); putc('\n', stderr); @@ -803,7 +803,7 @@ char **argv; { nl_catd catd; int msgnum, setnum; - + if (argc != 2) { fprintf(stderr, "usage: %s catalogue\n", argv[0]); exit(1); diff --git a/usr.bin/sgmls/sgmls/pars1.c b/usr.bin/sgmls/sgmls/pars1.c index 7960dc7..8616107 100644 --- a/usr.bin/sgmls/sgmls/pars1.c +++ b/usr.bin/sgmls/sgmls/pars1.c @@ -604,7 +604,7 @@ struct mpos *newmpos() VOID endprolog() { int i; - + ambigfree(); if (dtdsw) { frem((UNIV)nmgrp); diff --git a/usr.bin/sgmls/sgmls/pars2.c b/usr.bin/sgmls/sgmls/pars2.c index 8c97ec6..cc4c4ec 100644 --- a/usr.bin/sgmls/sgmls/pars2.c +++ b/usr.bin/sgmls/sgmls/pars2.c @@ -172,10 +172,10 @@ int ch; change the entity, since the entity might be referenced again. So in this case we copy the entity. This is inefficient, but it will only happen in a case like this: - + <!entity % amp "&"> <!entity e "x%amp;#SPACE;"> - + Usually character references will have been processed while the entity was being defined. */ if (*FPOS != ch) { @@ -852,7 +852,7 @@ int parmlen; { int skip = (pcblitt.newstate == 0); int i; - + for (i = 0; parmlen >= 0 && i < datalen; i++) { switch (data[i]) { case RSCHAR: diff --git a/usr.bin/sgmls/sgmls/pcbrf.c b/usr.bin/sgmls/sgmls/pcbrf.c index 16786e5..a18617e 100644 --- a/usr.bin/sgmls/sgmls/pcbrf.c +++ b/usr.bin/sgmls/sgmls/pcbrf.c @@ -1312,22 +1312,22 @@ struct parse pcbeal = {"EAL", lexgrp, ealtab, 0, 0, 0, 0}; static UNCH /* sig dat num nms spc non ee eob rs com lit lita tagc */ - + sp31 []={SP1 ,SP1 ,SP1 ,SP1 ,TK1 ,SP1 ,SP1 ,SP1 ,TK1 ,CM0 ,TK1 ,TK1 ,SP1 }, sp31a[]={INV_,ISIG,LEN_,LEN_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,LIT1,LIT2,ESGD}, - + tk31 []={TK1 ,TK1 ,SP1 ,SP1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,CM1 ,TK1 ,TK1 ,SP1 }, tk31a[]={INV_,ISIG,NUM1,NAS1,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,LIT1,LIT2,ESGD}, - + cm30 []={SP1 ,CM0 ,SP1 ,SP1 ,SP1 ,CM0 ,SP1 ,CM0 ,SP1 ,CM2 ,SP1 ,SP1 ,SP1 }, cm30a[]={PCI_,ISIG,PCI_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,NOP_,PCI_,PCI_,PCI_}, - + cm31 []={TK1 ,CM1 ,TK1 ,TK1 ,TK1 ,CM1 ,TK1 ,CM1 ,TK1 ,CM2 ,TK1 ,TK1 ,TK1 }, cm31a[]={PCI_,ISIG,PCI_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,NOP_,PCI_,PCI_,PCI_}, - + cm32 []={CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,TK1 ,CM2 ,CM2 ,CM3 ,CM2 ,CM2 ,CM2 }, cm32a[]={NOP_,ISIG,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_}, - + cm33 []={CM2 ,CM3 ,CM2 ,CM2 ,CM2 ,CM3 ,TK1 ,CM3 ,CM2 ,TK1 ,CM2 ,CM2 ,CM2 }, cm33a[]={NOP_,ISIG,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_}, diff --git a/usr.bin/sgmls/sgmls/serv.c b/usr.bin/sgmls/sgmls/serv.c index b9699d2..68b5fe1 100644 --- a/usr.bin/sgmls/sgmls/serv.c +++ b/usr.bin/sgmls/sgmls/serv.c @@ -72,7 +72,7 @@ UNCH *s; /* String to be hashed. */ int hashsize; /* Size of hash table array. */ { unsigned long h = 0, g; - + while (*s != 0) { h <<= 4; h += *s++; diff --git a/usr.bin/sgmls/sgmls/sgml1.c b/usr.bin/sgmls/sgmls/sgml1.c index 94a6119..a2808f4 100644 --- a/usr.bin/sgmls/sgmls/sgml1.c +++ b/usr.bin/sgmls/sgmls/sgml1.c @@ -370,7 +370,7 @@ PNE *np; UNCH **tp; { PECB ep; /* Pointer to an entity control block. */ - + ep = entfind(iname); if (!ep) return -1; diff --git a/usr.bin/sgmls/sgmls/sgml2.c b/usr.bin/sgmls/sgmls/sgml2.c index e202f84..83bccbd 100644 --- a/usr.bin/sgmls/sgmls/sgml2.c +++ b/usr.bin/sgmls/sgmls/sgml2.c @@ -386,7 +386,7 @@ UNCH *parm2; /* Additional parameters (or NULL). */ { struct error err; errorinit(&err, subdcl ? MDERR : MDERR2, number); - err.parmno = parmno; + err.parmno = parmno; err.subdcl = subdcl; err.eparm[0] = (UNIV)parm1; err.eparm[1] = (UNIV)parm2; diff --git a/usr.bin/sgmls/sgmls/sgmldecl.c b/usr.bin/sgmls/sgmls/sgmldecl.c index aab66e9..1ba7fe7 100644 --- a/usr.bin/sgmls/sgmls/sgmldecl.c +++ b/usr.bin/sgmls/sgmls/sgmldecl.c @@ -163,21 +163,21 @@ in a buffer intended for a literal.) */ /* Table of quantity names. Must match Q* in sgmldecl.h. */ static char *quantity_names[] = { - "ATTCNT", - "ATTSPLEN", - "BSEQLEN", - "DTAGLEN", - "DTEMPLEN", - "ENTLVL", - "GRPCNT", - "GRPGTCNT", - "GRPLVL", - "LITLEN", - "NAMELEN", - "NORMSEP", - "PILEN", - "TAGLEN", - "TAGLVL", + "ATTCNT", + "ATTSPLEN", + "BSEQLEN", + "DTAGLEN", + "DTEMPLEN", + "ENTLVL", + "GRPCNT", + "GRPGTCNT", + "GRPLVL", + "LITLEN", + "NAMELEN", + "NORMSEP", + "PILEN", + "TAGLEN", + "TAGLVL", }; static int max_quantity[] = { @@ -944,7 +944,7 @@ UNCH *tbuf; return FAIL; } start[i] = bufi; - + for (s = tbuf; *s; s++) { int c = *s; if (c == DELNONCH) { @@ -995,7 +995,7 @@ UNCH *tbuf; nlextoke[uc] = NMS; nlextran[lc] = uc; } - + for (i = 0; i < count[2]; i++) { UNCH lc = buf[start[2] + i]; UNCH uc = buf[start[3] + i]; @@ -1148,7 +1148,7 @@ UNCH *tbuf; for (i = 0; i < NKEYS; i++) if (newkey[i][0] != '\0') { UNCH temp[REFNAMELEN + 1]; - + ustrcpy(temp, key[i]); ustrcpy(key[i], newkey[i]); ustrcpy(newkey[i], temp); @@ -1388,7 +1388,7 @@ VOID sdinit() { int i; /* Shunned character numbers in the reference concrete syntax. */ - static UNCH refshun[] = { + static UNCH refshun[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 127, 255 }; @@ -1434,7 +1434,7 @@ static VOID bufsrealloc() { UNS size; - + if (ENTLVL != REFENTLVL) scbs = (struct source *)rrealloc((UNIV)scbs, (ENTLVL+1)*sizeof(struct source)); @@ -1462,7 +1462,7 @@ static VOID setlexical() { int i; UNCH **p; - + if (nlextoke) { /* Handle characters that were made significant by the NAMING section. */ @@ -1492,7 +1492,7 @@ static VOID setlexical() } } - + /* Now munge the lexical tables. */ for (p = lextabs; *p; p++) { UNCH nonclass = (*p)[CANON_NONSGML]; @@ -1543,7 +1543,7 @@ static VOID setlexical() frem((UNIV)nlextoke); nlextoke = 0; } - + } /* Munge parse tables so that empty start and end tags are not recognized. */ @@ -1552,7 +1552,7 @@ static VOID noemptytag() { static struct parse *pcbs[] = { &pcbconm, &pcbcone, &pcbconr, &pcbconc }; int i; - + for (i = 0; i < SIZEOF(pcbs); i++) { int maxclass, maxstate; int j, k, act; @@ -1620,7 +1620,7 @@ FILE *fp; SYSTEM_CHARSET_OWNER, SYSTEM_CHARSET_DESCRIPTION, SYSTEM_CHARSET_DESIGNATING_SEQUENCE); - + if (!done_nonsgml) { done_nonsgml = 1; for (i = 0; i < 256; i++) @@ -1654,7 +1654,7 @@ FILE *fp; if (!changed) fprintf(fp, "PUBLIC \"%s\"\n", capset_map[0].name); fprintf(fp, "SCOPE DOCUMENT\n"); - + fprintf(fp, "SYNTAX\nSHUNCHAR"); for (i = 0; i < 256; i++) if (char_flags[i] & CHAR_SHUNNED) diff --git a/usr.bin/sgmls/sgmls/sgmldecl.h b/usr.bin/sgmls/sgmls/sgmldecl.h index d5d0466..296bdb8 100644 --- a/usr.bin/sgmls/sgmls/sgmldecl.h +++ b/usr.bin/sgmls/sgmls/sgmldecl.h @@ -1,15 +1,15 @@ /* sgmldecl.h: SGML declaration parsing. */ -#define QATTCNT 0 -#define QATTSPLEN 1 -#define QBSEQLEN 2 -#define QDTAGLEN 3 -#define QDTEMPLEN 4 -#define QENTLVL 5 -#define QGRPCNT 6 -#define QGRPGTCNT 7 -#define QGRPLVL 8 -#define QLITLEN 9 +#define QATTCNT 0 +#define QATTSPLEN 1 +#define QBSEQLEN 2 +#define QDTAGLEN 3 +#define QDTEMPLEN 4 +#define QENTLVL 5 +#define QGRPCNT 6 +#define QGRPGTCNT 7 +#define QGRPLVL 8 +#define QLITLEN 9 #define QNAMELEN 10 #define QNORMSEP 11 #define QPILEN 12 @@ -18,16 +18,16 @@ #define NQUANTITY (QTAGLVL+1) -#define TOTALCAP 0 -#define ENTCAP 1 -#define ENTCHCAP 2 -#define ELEMCAP 3 -#define GRPCAP 4 -#define EXGRPCAP 5 -#define EXNMCAP 6 -#define ATTCAP 7 -#define ATTCHCAP 8 -#define AVGRPCAP 9 +#define TOTALCAP 0 +#define ENTCAP 1 +#define ENTCHCAP 2 +#define ELEMCAP 3 +#define GRPCAP 4 +#define EXGRPCAP 5 +#define EXNMCAP 6 +#define ATTCAP 7 +#define ATTCHCAP 8 +#define AVGRPCAP 9 #define NOTCAP 10 #define NOTCHCAP 11 #define IDCAP 12 diff --git a/usr.bin/sgmls/sgmls/sgmlio.c b/usr.bin/sgmls/sgmls/sgmlio.c index c78bb7a..3db1d0d 100644 --- a/usr.bin/sgmls/sgmls/sgmlio.c +++ b/usr.bin/sgmls/sgmls/sgmlio.c @@ -191,7 +191,7 @@ int *newfilep; struct iofcb *f = (struct iofcb *)p; FILE *fp; int c; - + *newfilep = 0; if (f->first) { buf[i] = EOBCHAR; diff --git a/usr.bin/sgmls/sgmls/sgmlmsg.c b/usr.bin/sgmls/sgmls/sgmlmsg.c index a35cb1b..454bc3e 100644 --- a/usr.bin/sgmls/sgmls/sgmlmsg.c +++ b/usr.bin/sgmls/sgmls/sgmlmsg.c @@ -64,16 +64,16 @@ static char *headers[] = { /* Indexes into headers[] */ -#define HDRPFX 0 -#define HDRALL 1 -#define HDRUNSUP 2 -#define HDRSYS 3 -#define HDRWARN 4 -#define HDRLOC 5 -#define HDRELOC 6 -#define HDRMD 7 -#define HDRMD2 8 -#define HDRMODE 9 +#define HDRPFX 0 +#define HDRALL 1 +#define HDRUNSUP 2 +#define HDRSYS 3 +#define HDRWARN 4 +#define HDRLOC 5 +#define HDRELOC 6 +#define HDRMD 7 +#define HDRMD2 8 +#define HDRMODE 9 #define HDREOF 10 #define HDREE 11 #define HDRRS 12 @@ -229,7 +229,7 @@ struct error *e; } else indent = 4; - + for (toplevel = 0; getlocation(toplevel, &loc); toplevel++) if (loc.filesw) { prevfilelevel = filelevel; @@ -285,7 +285,7 @@ struct error *e; hdrcode = HDRUNSUP; else hdrcode = HDRALL; - + xfprintf(efp, getheader(hdrcode), type, severity, e->errnum); if (filelevel >= 0) { @@ -301,9 +301,9 @@ struct error *e; } } } - + /* It is necessary to copy the result of getparm() because - the specification of catgets() says in can return a + the specification of catgets() says in can return a pointer to a static buffer which may get overwritten by the next call to catgets(). */ @@ -388,7 +388,7 @@ int indent; { int i = 1; UNCH *gi; - + gi = getgi(i); if (!gi) return; diff --git a/usr.bin/sgmls/sgmls/traceset.c b/usr.bin/sgmls/sgmls/traceset.c index df18cbe..64ebd48 100644 --- a/usr.bin/sgmls/sgmls/traceset.c +++ b/usr.bin/sgmls/sgmls/traceset.c @@ -55,7 +55,7 @@ char *s; VOID traceset() { dotrace(sw.trace); - + if (trace||atrace||ctrace||dtrace||etrace||gtrace||itrace||mtrace||ntrace) fprintf(stderr, "TRACESET: state=%d;att=%d;con=%d;dcl=%d;ent=%d;grp=%d;id=%d;ms=%d;dcn=%d.\n", @@ -67,7 +67,7 @@ VOID traceset() VOID tracepro() { dotrace(sw.ptrace); - + if (trace||atrace||dtrace||etrace||gtrace||mtrace||ntrace) fprintf(stderr, "TRACEPRO: state=%d; att=%d; dcl=%d; ent=%d; grp=%d; ms=%d; dcn=%d.\n", @@ -217,7 +217,7 @@ struct entity *p; VOID tracedcn(p) struct dcncb *p; { - fprintf(stderr, + fprintf(stderr, "DCN dcn=%p; adl=%p; notation is %s\n", (UNIV)p, (UNIV)p->adl, p->ename+1); if (p->adl) @@ -245,7 +245,7 @@ TECB pg; UNCH *gi; { int i = 0; /* Loop counter. */ - + if (pg==SRMNULL) fprintf(stderr, "%-8s SHORTREF table empty for %s.\n", action, gi); else { @@ -264,12 +264,12 @@ VOID traceadl(al) struct ad al[]; { int i=0; - + fprintf(stderr, "ADLIST %p %d membe%s; %d attribut%s\n", (UNIV)al, ADN(al), ADN(al)==1 ? "r" : "rs", AN(al), AN(al)==1 ? "e" : "es"); while (++i<=ADN(al)) { - fprintf(stderr, + fprintf(stderr, (BITOFF(ADFLAGS(al,i), AGROUP) && ADTYPE(al,i)<=ANOTEGRP) ? " %p %-8s %02x %02x %2d %2d %p %p\n" : " %p %-8s %02x %02x %2d %2d %p %p\n", @@ -325,7 +325,7 @@ VOID tracegrp(pg) struct etd *pg[]; { int i = -1; /* Loop counter. */ - + fprintf(stderr, "ETDGRP %p\n", (UNIV)pg); while (pg[++i]!=0) fprintf(stderr, " %p %s\n", (UNIV)pg[i], pg[i]->etdgi+1); @@ -336,7 +336,7 @@ VOID tracengr(pg) struct dcncb *pg[]; { int i = -1; /* Loop counter. */ - + fprintf(stderr, "DCNGRP %p\n", (UNIV)pg); while (pg[++i]!=0) fprintf(stderr, " %p %s\n", (UNIV)pg[i], pg[i]->ename+1); @@ -346,7 +346,7 @@ struct dcncb *pg[]; VOID traceetd(p) struct etd *p; /* Pointer to an etd. */ { - fprintf(stderr, + fprintf(stderr, "ETD etd=%p %s min=%02x cmod=%p ttype=%02x mex=%p, pex=%p, ", (UNIV)p, p->etdgi+1, p->etdmin, (UNIV)p->etdmod, p->etdmod->ttype, (UNIV)p->etdmex, (UNIV)p->etdpex); @@ -408,7 +408,7 @@ struct mpos pos[]; /* Position in open element's model. */ int Tstart; /* Initial T for this group. */ { int i = 0; /* Loop counter. */ - + fprintf(stderr, "%-10s %d:", stagenm, P); while (++i<=P) fprintf(stderr, " %d-%d", pos[i].g, pos[i].t); @@ -436,7 +436,7 @@ int opt; /* ALLHIT parm: 1=test optionals; 0=ignore. */ int Tstart; /* Initial T for this group. */ { int i = 0; /* Loop counter. */ - + fprintf(stderr, "%-10s %d:", stagenm, P); while (++i<=P) fprintf(stderr, " %d-%d", pos[i].g, pos[i].t); diff --git a/usr.bin/sgmls/sgmls/xfprintf.c b/usr.bin/sgmls/sgmls/xfprintf.c index 1780795..f544faa 100644 --- a/usr.bin/sgmls/sgmls/xfprintf.c +++ b/usr.bin/sgmls/sgmls/xfprintf.c @@ -113,10 +113,10 @@ struct spec *sp; sp->pos = **pp - '0'; *pp += 2; } - + while (**pp != '\0' && strchr(FLAG_CHARS, **pp)) *pp += 1; - + /* handle the field width */ sp->field_width = MISSING; @@ -162,7 +162,7 @@ struct spec *sp; modifier = **pp; *pp += 1; } - + switch (**pp) { case 'd': case 'i': @@ -219,7 +219,7 @@ static int find_arg_types(format, arg_type) int i, pos; const char *p; struct spec spec; - + for (i = 0; i < 9; i++) arg_type[i] = NONE; @@ -384,7 +384,7 @@ static int printit(handle, func, p, ap, nargs, arg) start = ++p; if (!parse_spec(&p, &spec)) abort(); /* should have caught it in find_arg_types */ - + buf[0] = '%'; q = buf + 1; @@ -470,7 +470,7 @@ static int maybe_positional(format) } return 1; } - + static int xdoprt(handle, func, format, ap) UNIV handle; printer func; @@ -483,7 +483,7 @@ static int xdoprt(handle, func, format, ap) if (!find_arg_types(format, arg_type)) return -1; - + for (nargs = 0; nargs < 9; nargs++) if (arg_type[nargs] == NONE) break; @@ -491,7 +491,7 @@ static int xdoprt(handle, func, format, ap) for (i = nargs; i < 9; i++) if (arg_type[i] != NONE) return -1; - + for (i = 0; i < nargs; i++) get_arg(arg_type[i], &ap, arg + i); diff --git a/usr.bin/sgmls/sgmlsasp/Makefile b/usr.bin/sgmls/sgmlsasp/Makefile index 1d60f29..69bfdab 100644 --- a/usr.bin/sgmls/sgmlsasp/Makefile +++ b/usr.bin/sgmls/sgmlsasp/Makefile @@ -8,7 +8,7 @@ PROG= sgmlsasp SRCS+= sgmlsasp.c replace.c -CFLAGS+= -I${.CURDIR}/../libsgmls -I${.CURDIR}/../sgmls +CFLAGS+= -I${.CURDIR}/../libsgmls -I${.CURDIR}/../sgmls LDADD= ${LIBSGMLS} DPADD= ${LIBSGMLS} diff --git a/usr.bin/sgmls/sgmlsasp/replace.c b/usr.bin/sgmls/sgmlsasp/replace.c index 9a855a9..a37086b 100644 --- a/usr.bin/sgmls/sgmlsasp/replace.c +++ b/usr.bin/sgmls/sgmlsasp/replace.c @@ -90,7 +90,7 @@ void load_replacement_file(tablep, file) else error("can't open `%s'", file); } - + current_lineno = 1; current_file = file; tok = get_token(); @@ -131,7 +131,7 @@ struct replacement_item **parse_string(tail, recog_attr) { struct buffer buf; unsigned len; - + buffer_init(&buf); for (;;) { int c = get(); @@ -274,7 +274,7 @@ int get_token() default: parse_error("bad input character `%c'", c); } - return EOF; + return EOF; } static @@ -325,7 +325,7 @@ struct replacement *lookup_replacement(tablep, type, name) { int h = hash(type, name); struct table_entry *p; - + for (p = tablep->table[h]; p; p = p->next) if (strcmp(name, p->gi) == 0 && type == p->type) return &p->replacement; @@ -342,7 +342,7 @@ struct replacement *define_replacement(tablep, type, name) { int h = hash(type, name); struct table_entry *p; - + for (p = tablep->table[h]; p; p = p->next) if (strcmp(name, p->gi) == 0 && type == p->type) return 0; @@ -409,7 +409,7 @@ int hash(type, s) char *s; { unsigned long h = 0, g; - + while (*s != 0) { h <<= 4; h += *s++; @@ -442,7 +442,7 @@ UNIV xrealloc(p, size) parse_error("out of memory"); return p; } - + static NO_RETURN #ifdef VARARGS void parse_error(va_alist) va_dcl @@ -455,7 +455,7 @@ void parse_error(char *message,...) char *message; #endif va_list ap; - + #ifdef VARARGS va_start(ap); message = va_arg(ap, char *); diff --git a/usr.bin/sgmls/sgmlsasp/replace.h b/usr.bin/sgmls/sgmlsasp/replace.h index 18c9f82..be2bbcd 100644 --- a/usr.bin/sgmls/sgmlsasp/replace.h +++ b/usr.bin/sgmls/sgmlsasp/replace.h @@ -5,7 +5,7 @@ enum replacement_type { DATA_REPL, ATTR_REPL }; - + struct replacement_item { union { char *attr; @@ -30,6 +30,6 @@ enum event_type { START_ELEMENT, END_ELEMENT }; struct replacement_table *make_replacement_table P((void)); void load_replacement_file P((struct replacement_table *, char *)); - + struct replacement * lookup_replacement P((struct replacement_table *, enum event_type, char *)); diff --git a/usr.bin/sgmls/sgmlsasp/sgmlsasp.c b/usr.bin/sgmls/sgmlsasp/sgmlsasp.c index fdaf113..eacf1c1 100644 --- a/usr.bin/sgmls/sgmlsasp/sgmlsasp.c +++ b/usr.bin/sgmls/sgmlsasp/sgmlsasp.c @@ -154,7 +154,7 @@ struct sgmls_attribute *attributes; return; if (repl->flags & NEWLINE_BEGIN) output_begin_line(); - + for (p = repl->items; p; p = p->next) switch (p->type) { case DATA_REPL: @@ -190,7 +190,7 @@ struct sgmls_attribute *p; { char **token = p->value.token.v; int n = p->value.token.n; - + if (n > 0) { int i; output_token(token[0]); @@ -262,7 +262,7 @@ void error(char *message,...) char *message; #endif va_list ap; - + fprintf(stderr, "%s: ", program_name); #ifdef VARARGS va_start(ap); |