summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfieber <jfieber@FreeBSD.org>1997-07-19 15:19:08 +0000
committerjfieber <jfieber@FreeBSD.org>1997-07-19 15:19:08 +0000
commitdd12b6c2e5843ad06dd22cba8334290e59dcd5dd (patch)
treeae2ab920ce5faed5fe029b6d747109a092a0dc19
parent84c0a5dcfe5457e17760d668151e508b658ed6e6 (diff)
downloadFreeBSD-src-dd12b6c2e5843ad06dd22cba8334290e59dcd5dd.zip
FreeBSD-src-dd12b6c2e5843ad06dd22cba8334290e59dcd5dd.tar.gz
Remove SGML tools from -current.
-rw-r--r--share/Makefile2
-rw-r--r--share/sgml/CATALOG90
-rw-r--r--share/sgml/FreeBSD/Makefile12
-rw-r--r--share/sgml/FreeBSD/linuxdoc.dcl105
-rw-r--r--share/sgml/FreeBSD/linuxdoc.dtd450
-rw-r--r--share/sgml/FreeBSD/linuxdoc.sty129
-rw-r--r--share/sgml/ISO/ISOamsa66
-rw-r--r--share/sgml/ISO/ISOamsb52
-rw-r--r--share/sgml/ISO/ISOamsc20
-rw-r--r--share/sgml/ISO/ISOamsn70
-rw-r--r--share/sgml/ISO/ISOamso29
-rw-r--r--share/sgml/ISO/ISOamsr94
-rw-r--r--share/sgml/ISO/ISObox62
-rw-r--r--share/sgml/ISO/ISOcyr177
-rw-r--r--share/sgml/ISO/ISOcyr236
-rw-r--r--share/sgml/ISO/ISOdia24
-rw-r--r--share/sgml/ISO/ISOgrk159
-rw-r--r--share/sgml/ISO/ISOgrk230
-rw-r--r--share/sgml/ISO/ISOgrk353
-rw-r--r--share/sgml/ISO/ISOgrk453
-rw-r--r--share/sgml/ISO/ISOlat172
-rw-r--r--share/sgml/ISO/ISOlat2131
-rw-r--r--share/sgml/ISO/ISOnum91
-rw-r--r--share/sgml/ISO/ISOpub100
-rw-r--r--share/sgml/ISO/ISOtech73
-rw-r--r--share/sgml/ISO/Makefile15
-rw-r--r--share/sgml/Makefile18
-rw-r--r--share/sgml/Makefile.inc3
-rw-r--r--share/sgml/docbook/Makefile15
-rw-r--r--share/sgml/docbook/cals-tbl.dtd331
-rw-r--r--share/sgml/docbook/dbgenent.mod25
-rw-r--r--share/sgml/docbook/dbhier.mod1149
-rw-r--r--share/sgml/docbook/dbpool.mod4649
-rw-r--r--share/sgml/docbook/docbook.dcl106
-rw-r--r--share/sgml/docbook/docbook.dtd277
-rw-r--r--share/sgml/transpec/Makefile15
-rw-r--r--share/sgml/transpec/docbook-html.ts2845
-rw-r--r--share/sgml/transpec/html.cmap35
-rw-r--r--share/sgml/transpec/html.sdata566
-rw-r--r--share/sgml/transpec/linuxdoc-html.ts1005
-rw-r--r--share/sgml/transpec/linuxdoc-roff.ts1180
-rw-r--r--share/sgml/transpec/roff.cmap37
-rw-r--r--share/sgml/transpec/roff.sdata623
-rw-r--r--share/sgml/transpec/transpec.dtd97
-rw-r--r--usr.bin/Makefile4
-rw-r--r--usr.bin/sgmlfmt/Makefile9
-rw-r--r--usr.bin/sgmlfmt/sgmlfmt.1172
-rwxr-xr-xusr.bin/sgmlfmt/sgmlfmt.pl749
-rw-r--r--usr.bin/sgmls/LICENSE43
-rw-r--r--usr.bin/sgmls/Makefile9
-rw-r--r--usr.bin/sgmls/Makefile.inc16
-rw-r--r--usr.bin/sgmls/README138
-rwxr-xr-xusr.bin/sgmls/configure617
-rw-r--r--usr.bin/sgmls/instant/Makefile15
-rw-r--r--usr.bin/sgmls/instant/README150
-rw-r--r--usr.bin/sgmls/instant/browse.c462
-rw-r--r--usr.bin/sgmls/instant/general.h329
-rw-r--r--usr.bin/sgmls/instant/hyper.c100
-rw-r--r--usr.bin/sgmls/instant/info.c300
-rw-r--r--usr.bin/sgmls/instant/instant.1183
-rw-r--r--usr.bin/sgmls/instant/main.c710
-rw-r--r--usr.bin/sgmls/instant/tables.c2013
-rw-r--r--usr.bin/sgmls/instant/traninit.c577
-rw-r--r--usr.bin/sgmls/instant/translate.c881
-rw-r--r--usr.bin/sgmls/instant/translate.h153
-rw-r--r--usr.bin/sgmls/instant/transpec.5528
-rw-r--r--usr.bin/sgmls/instant/tranvar.c763
-rw-r--r--usr.bin/sgmls/instant/util.c1109
-rw-r--r--usr.bin/sgmls/libsgmls/Makefile17
-rw-r--r--usr.bin/sgmls/libsgmls/sgmls.c1032
-rw-r--r--usr.bin/sgmls/libsgmls/sgmls.h127
-rwxr-xr-xusr.bin/sgmls/sgmls.pl247
-rw-r--r--usr.bin/sgmls/sgmls/Makefile19
-rw-r--r--usr.bin/sgmls/sgmls/action.h180
-rw-r--r--usr.bin/sgmls/sgmls/adl.h118
-rw-r--r--usr.bin/sgmls/sgmls/alloc.h8
-rw-r--r--usr.bin/sgmls/sgmls/ambig.c438
-rw-r--r--usr.bin/sgmls/sgmls/appl.h31
-rw-r--r--usr.bin/sgmls/sgmls/catalog.c925
-rw-r--r--usr.bin/sgmls/sgmls/catalog.h45
-rw-r--r--usr.bin/sgmls/sgmls/config.h158
-rw-r--r--usr.bin/sgmls/sgmls/context.c451
-rw-r--r--usr.bin/sgmls/sgmls/context.h19
-rw-r--r--usr.bin/sgmls/sgmls/dosproc.c40
-rw-r--r--usr.bin/sgmls/sgmls/ebcdic.c42
-rw-r--r--usr.bin/sgmls/sgmls/ebcdic.h25
-rw-r--r--usr.bin/sgmls/sgmls/entgen.c517
-rw-r--r--usr.bin/sgmls/sgmls/entity.h192
-rw-r--r--usr.bin/sgmls/sgmls/error.h61
-rw-r--r--usr.bin/sgmls/sgmls/etype.h93
-rw-r--r--usr.bin/sgmls/sgmls/exclude.c121
-rw-r--r--usr.bin/sgmls/sgmls/genlex.c140
-rw-r--r--usr.bin/sgmls/sgmls/getopt.c166
-rw-r--r--usr.bin/sgmls/sgmls/getopt.h11
-rw-r--r--usr.bin/sgmls/sgmls/keyword.h22
-rw-r--r--usr.bin/sgmls/sgmls/latin1.h37
-rw-r--r--usr.bin/sgmls/sgmls/lexcode.h12
-rw-r--r--usr.bin/sgmls/sgmls/lexrf.c125
-rw-r--r--usr.bin/sgmls/sgmls/lextaba.c750
-rw-r--r--usr.bin/sgmls/sgmls/lextabe.c357
-rw-r--r--usr.bin/sgmls/sgmls/lextoke.h10
-rw-r--r--usr.bin/sgmls/sgmls/lineout.c656
-rw-r--r--usr.bin/sgmls/sgmls/lineout.h23
-rw-r--r--usr.bin/sgmls/sgmls/main.c650
-rw-r--r--usr.bin/sgmls/sgmls/md1.c866
-rw-r--r--usr.bin/sgmls/sgmls/md2.c792
-rw-r--r--usr.bin/sgmls/sgmls/msg.h258
-rw-r--r--usr.bin/sgmls/sgmls/msgcat.c840
-rw-r--r--usr.bin/sgmls/sgmls/msgcat.h13
-rw-r--r--usr.bin/sgmls/sgmls/pars1.c984
-rw-r--r--usr.bin/sgmls/sgmls/pars2.c1333
-rw-r--r--usr.bin/sgmls/sgmls/pcbrf.c1351
-rw-r--r--usr.bin/sgmls/sgmls/portproc.c105
-rw-r--r--usr.bin/sgmls/sgmls/serv.c299
-rw-r--r--usr.bin/sgmls/sgmls/sgml1.c485
-rw-r--r--usr.bin/sgmls/sgmls/sgml2.c522
-rw-r--r--usr.bin/sgmls/sgmls/sgmlaux.h72
-rw-r--r--usr.bin/sgmls/sgmls/sgmldecl.c1804
-rw-r--r--usr.bin/sgmls/sgmls/sgmldecl.h90
-rw-r--r--usr.bin/sgmls/sgmls/sgmlfnsm.h130
-rw-r--r--usr.bin/sgmls/sgmls/sgmlincl.h20
-rw-r--r--usr.bin/sgmls/sgmls/sgmlio.c384
-rw-r--r--usr.bin/sgmls/sgmls/sgmlmain.h101
-rw-r--r--usr.bin/sgmls/sgmls/sgmlmsg.c514
-rw-r--r--usr.bin/sgmls/sgmls/sgmls.1970
-rw-r--r--usr.bin/sgmls/sgmls/sgmlxtrn.c225
-rw-r--r--usr.bin/sgmls/sgmls/sgmlxtrn.h123
-rw-r--r--usr.bin/sgmls/sgmls/source.h114
-rw-r--r--usr.bin/sgmls/sgmls/std.h110
-rw-r--r--usr.bin/sgmls/sgmls/stklen.c2
-rw-r--r--usr.bin/sgmls/sgmls/strerror.c36
-rw-r--r--usr.bin/sgmls/sgmls/synrf.c72
-rw-r--r--usr.bin/sgmls/sgmls/synxtrn.h154
-rw-r--r--usr.bin/sgmls/sgmls/tools.h76
-rw-r--r--usr.bin/sgmls/sgmls/trace.h113
-rw-r--r--usr.bin/sgmls/sgmls/traceset.c462
-rw-r--r--usr.bin/sgmls/sgmls/unix.cfg147
-rw-r--r--usr.bin/sgmls/sgmls/unixproc.c98
-rw-r--r--usr.bin/sgmls/sgmls/version.c1
-rw-r--r--usr.bin/sgmls/sgmls/xfprintf.c564
-rw-r--r--usr.bin/sgmls/unix.cfg165
141 files changed, 3 insertions, 47258 deletions
diff --git a/share/Makefile b/share/Makefile
index 2dc7103..de8644f 100644
--- a/share/Makefile
+++ b/share/Makefile
@@ -1,6 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
-SUBDIR= dict doc examples info man me misc mk sgml skel syscons \
+SUBDIR= dict doc examples info man me misc mk skel syscons \
tabset termcap timedef zoneinfo
.include <bsd.subdir.mk>
diff --git a/share/sgml/CATALOG b/share/sgml/CATALOG
deleted file mode 100644
index 4b59cc4..0000000
--- a/share/sgml/CATALOG
+++ /dev/null
@@ -1,90 +0,0 @@
--- $Id$ --
-
--- ISO general entities --
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN"
-"ISO/ISOamsa"
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN"
-"ISO/ISOamsb"
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN"
-"ISO/ISOamsc"
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN"
-"ISO/ISOamsn"
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN"
-"ISO/ISOamso"
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN"
-"ISO/ISOamsr"
-
-PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN"
-"ISO/ISObox"
-
-PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN"
-"ISO/ISOcyr1"
-
-PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN"
-"ISO/ISOcyr2"
-
-PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN"
-"ISO/ISOdia"
-
-PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN"
-"ISO/ISOgrk1"
-
-PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN"
-"ISO/ISOgrk2"
-
-PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN"
-"ISO/ISOgrk3"
-
-PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN"
-"ISO/ISOgrk4"
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN"
-"ISO/ISOlat1"
-
-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN"
-"ISO/ISOlat2"
-
-PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN"
-"ISO/ISOnum"
-
-PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN"
-"ISO/ISOpub"
-
-PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN"
-"ISO/ISOtech"
-
--- Linuxdoc, as customized for FreeBSD --
-
-DOCTYPE "linuxdoc"
-"FreeBSD/linuxdoc.dcl"
-
-PUBLIC "-//FreeBSD//DTD linuxdoc//EN"
-"FreeBSD/linuxdoc.dtd"
-
--- Transpec for instant(1) --
-
-PUBLIC "-//FreeBSD//DTD transpec//EN"
-"transpec/transpec.dtd"
-
--- Docbook --
-
-PUBLIC "-//Davenport//DTD DocBook V3.0//EN"
-"docbook/docbook.dtd"
-
-PUBLIC "-//Davenport//ELEMENTS DocBook Information Pool V3.0//EN"
-"docbook/dbpool.mod"
-
-PUBLIC "-//Davenport//ELEMENTS DocBook Document Hierarchy V3.0//EN"
-"docbook/dbhier.mod"
-
-PUBLIC "-//Davenport//ENTITIES DocBook Additional General Entities V3.0//EN"
-"docbook/dbgenent.mod"
-
-PUBLIC "-//USA-DOD//DTD Table Model 951010//EN"
-"docbook/cals-tbl.dtd"
diff --git a/share/sgml/FreeBSD/Makefile b/share/sgml/FreeBSD/Makefile
deleted file mode 100644
index a2ca4e0..0000000
--- a/share/sgml/FreeBSD/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# $Id$
-
-FILES= linuxdoc.dtd linuxdoc.dcl linuxdoc.sty
-NOOBJ= noobj
-
-all clean cleandir depend lint tags:
-
-afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
- ${DESTDIR}${BINDIR}/${.CURDIR:T}
-
-.include <bsd.prog.mk>
diff --git a/share/sgml/FreeBSD/linuxdoc.dcl b/share/sgml/FreeBSD/linuxdoc.dcl
deleted file mode 100644
index c063aba..0000000
--- a/share/sgml/FreeBSD/linuxdoc.dcl
+++ /dev/null
@@ -1,105 +0,0 @@
- <!SGML "ISO 8879:1986"
-
- CHARSET
-
- BASESET "ISO 646:1983//CHARSET
- International Reference Version (IRV)//ESC 2/5 4/0"
- DESCSET
- 0 9 UNUSED
- 9 2 9
- 11 2 UNUSED
- 13 1 13
- 14 18 UNUSED
- 32 95 32
- 127 1 UNUSED
-
- BASESET "ISO Registration Number 100//CHARSET
- ECMA-94 Right Part of Latin Alphabet Nr. 1//ESC 2/13 4/1"
- DESCSET
- 128 32 UNUSED
- 160 96 32
-
-
- CAPACITY SGMLREF
-
- TOTALCAP 99000000
- ATTCAP 1000000
- ATTCHCAP 1000000
- AVGRPCAP 1000000
- ELEMCAP 1000000
- ENTCAP 1000000
- ENTCHCAP 1000000
- GRPCAP 1000000
- IDCAP 32000000
- IDREFCAP 32000000
-
- SCOPE DOCUMENT
-
- SYNTAX
-
- SHUNCHAR CONTROLS 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 128 129
- 130 131 132 133 134 135 136 137 138 139
- 140 141 142 143 144 145 146 147 148 149
- 150 151 152 153 154 155 156 157 158 159
-
- BASESET "ISO 646:1983//CHARSET
- International Reference Version (IRV)//ESC 2/5 4/0"
- DESCSET
- 0 128 0
-
-
- FUNCTION
- RE 13
- RS 10
- SPACE 32
- TAB SEPCHAR 9
-
- NAMING
- LCNMSTRT ""
- UCNMSTRT ""
- LCNMCHAR ".-"
- UCNMCHAR ".-"
- NAMECASE GENERAL YES
- ENTITY NO
-
- DELIM GENERAL SGMLREF
- SHORTREF SGMLREF
-
- NAMES SGMLREF
-
- QUANTITY SGMLREF
- ATTCNT 256
- GRPCNT 253
- GRPGTCNT 253
- LITLEN 8092
- NAMELEN 44
- TAGLVL 100
-
- FEATURES
- MINIMIZE
- DATATAG NO
- OMITTAG YES
- RANK NO
- SHORTTAG YES
-
- LINK
- SIMPLE NO
- IMPLICIT NO
- EXPLICIT NO
-
- OTHER
- CONCUR NO
- SUBDOC NO
- FORMAL YES
-
- APPINFO
- NONE
->
-
-<!--
- Reference Concrete Syntax modifications for the DocBook DTD,
- Revision: 2.2.1
- -->
diff --git a/share/sgml/FreeBSD/linuxdoc.dtd b/share/sgml/FreeBSD/linuxdoc.dtd
deleted file mode 100644
index e3f3ee1..0000000
--- a/share/sgml/FreeBSD/linuxdoc.dtd
+++ /dev/null
@@ -1,450 +0,0 @@
-<!-- This is LINUXDOC.DTD, a hacked version of QWERTZ.DTD v1.3
- by Matt Welsh; modified from QWERTZ.DTD by Tom Gordon -->
-
-<!-- =========================================================== -->
-<!-- Parameter Entities -->
-<!-- =========================================================== -->
-
-<!entity % emph
- " em|it|bf|sf|sl|tt|cparam " >
-
-<!entity % index "idx|cdx" >
-
-<!-- url added by HG; htmlurl added by esr -->
-<!entity % xref
- " label|ref|pageref|cite|url|htmlurl|ncite|email " >
-
-<!entity % inline
- " (#pcdata | f| x| %emph; |sq| %xref | %index )* " >
-
-<!entity % list
- " list | itemize | enum | descrip " >
-
-<!entity % par
- " %list; | comment | lq | quote | tscreen " >
-
-<!entity % mathpar " dm | eq " >
-
-<!entity % thrm
- " def | prop | lemma | coroll | proof | theorem " >
-
-<!entity % litprog " code | verb " >
-
-<!entity % sectpar
- " %par; | figure | tabular | table | %mathpar; |
- %thrm; | %litprog; ">
-<!element linuxdoc o o
- (part | chapt | sect | article | report |
- book | letter | telefax | slides | notes | manpage ) >
-
-<!ENTITY % ISOlat1 PUBLIC
- "ISO 8879:1986//ENTITIES Added Latin 1//EN">
-%ISOlat1;
-<!ENTITY % ISOnum PUBLIC
- "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN">
-%ISOnum;
-<!ENTITY % ISOdia PUBLIC
- "ISO 8879:1986//ENTITIES Diacritical Marks//EN">
-%ISOdia;
-<!ENTITY % ISOpub PUBLIC
- "ISO 8879:1986//ENTITIES Publishing//EN">
-%ISOpub;
-<!ENTITY % ISOamsa PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN">
-%ISOamsa;
-<!ENTITY % ISOamsb PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN">
-%ISOamsb;
-<!ENTITY % ISOamsc PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN">
-%ISOamsc;
-<!ENTITY % ISOamsn PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN">
-%ISOamsn;
-<!ENTITY % ISOamso PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN">
-%ISOamso;
-<!ENTITY % ISOamsr PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN">
-%ISOamsr;
-
-<!--
-<!entity Ae '&Auml;' >
-<!entity ae '&auml;' >
-<!entity Oe '&Ouml;' >
-<!entity oe '&ouml;' >
-<!entity Ue '&Uuml;' >
-<!entity ue '&uuml;' >
-<!entity sz '&szlig;' >
--->
-
-<!-- =========================================================== -->
-<!-- Elements -->
-<!-- =========================================================== -->
-
-<!element p o o (( %inline | %sectpar )+) +(newline) >
-<!entity ptag '<p>' >
-<!entity psplit '</p><p>' >
-
-<!shortref pmap
- "&#RS;B" null
- "&#RS;B&#RE;" psplit
- "&#RS;&#RE;" psplit>
-
-<!usemap pmap p>
-<!element em - - (%inline)>
-<!element bf - - (%inline)>
-<!element it - - (%inline)>
-<!element sf - - (%inline)>
-<!element sl - - (%inline)>
-<!element tt - - (%inline)>
-<!element sq - - (%inline)>
-<!element cparam - - (%inline)>
-
-<!entity ftag '<f>' -- formula begin -- >
-<!entity qendtag '</sq>'>
-
-<!element lq - - (p*)>
-<!element quote - - ((%inline; | %sectpar;)*, p*)+ >
-<!element tscreen - - ((%inline; | %sectpar;)*, p*)+ >
-<!element itemize - - (item+)>
-<!element enum - - (item+)>
-<!element list - - (item+)>
-
-<!-- What a mess. The following is here to clean up problems with
- paragraph breaks in a descrip. I can think of cases where this might
- break, but it seems to work. mdw -->
-
-<!shortref desmap
- "&#RS;B" null
- "&#RS;B&#RE;" ptag
- "&#RS;&#RE;" ptag>
-
-<!element descrip - - (tag?, p+)+ >
-<!usemap desmap descrip>
-
-<!element item o o ((%inline; | %sectpar;)*, p*) >
-
-<!element tag - o (%inline)>
-<!usemap global (list,itemize,enum)>
-<!entity space " ">
-<!entity null "">
-
-<!element figure - - ((eps | ph ), caption?)>
-<!attlist figure
- loc cdata "tbp">
-
-<!element eps - o empty >
-<!attlist eps
- file cdata #required>
-<!element ph - o empty >
-<!attlist ph
- vspace cdata #required>
-
-<!element caption - o (%inline)>
-
-<!shortref oneline
- "B&#RE;" space
- "&#RS;&#RE;" null
- "&#RS;B&#RE;" null>
-
-<!usemap oneline tag>
-<!usemap oneline caption>
-
-<!entity % tabrow "(%inline, (colsep, %inline)*)" >
-<!element tabular - -
- (%tabrow, (rowsep, hline?, %tabrow)*, caption?) >
-
-<!attlist tabular
- ca cdata #required>
-
-<!element rowsep - o empty>
-<!element colsep - o empty>
-<!element hline - o empty>
-
-<!entity rowsep "<rowsep>">
-<!entity colsep "<colsep>">
-
-<!shortref tabmap
- "&#RE;" null
- "&#RS;&#RE;" null
- "&#RS;B&#RE;" null
- "&#RS;B" null
- "B&#RE;" null
- "BB" space>
-
-<!usemap tabmap tabular>
-<!element table - - (tabular, caption?) >
-<!attlist table
- loc cdata "tbp">
-
-<!element code - - rcdata>
-<!element verb - - rcdata>
-
-<!shortref ttmap -- also on one-line --
- "B&#RE;" space
- "&#RS;&#RE;" null
- "&#RS;B&#RE;" null
- "&#RS;B" null>
-
-<!usemap ttmap tt>
-<!element mc - - cdata >
-<!entity % sppos "tu" >
-<!entity % fcs "%sppos;|phr" >
-<!entity % fcstxt "#pcdata|mc|%fcs;" >
-<!entity % fscs "rf|v|fi" >
-<!entity % limits "pr|in|sum" >
-<!entity % fbu "fr|lim|ar|root" >
-<!entity % fph "unl|ovl|sup|inf" >
-<!entity % fbutxt "(%fbu;) | (%limits;) |
- (%fcstxt;)|(%fscs;)|(%fph;)" >
-<!entity % fphtxt "p|#pcdata" >
-<!element f - - ((%fbutxt;)*) >
-
-<!entity fendtag '</f>' -- formula end -- >
-
-<!shortref fmap
- "&#RS;B" null
- "&#RS;B&#RE;" null
- "&#RS;&#RE;" null>
-
-<!usemap fmap f >
-
-<!element dm - - ((%fbutxt;)*)>
-<!element eq - - ((%fbutxt;)*)>
-
-<!shortref dmmap
- "&#RE;" space>
-
-<!usemap dmmap (dm,eq)>
-<!element fr - - (nu,de) >
-<!element nu o o ((%fbutxt;)*) >
-<!element de o o ((%fbutxt;)*) >
-<!element ll o o ((%fbutxt;)*) >
-<!element ul o o ((%fbutxt;)*) >
-<!element opd - o ((%fbutxt;)*) >
-<!element pr - - (ll,ul,opd?) >
-<!element in - - (ll,ul,opd?) >
-<!element sum - - (ll,ul,opd?) >
-<!element lim - - (op,ll,ul,opd?) >
-<!element op o o (%fcstxt;|rf|%fph;) -(tu) >
-<!element root - - ((%fbutxt;)*) >
-<!attlist root
- n cdata "">
-<!element col o o ((%fbutxt;)*) >
-<!element row o o (col, (arc, col)*) >
-
-<!element ar - - (row, (arr, row)*) >
-<!attlist ar
- ca cdata #required >
-<!element arr - o empty >
-<!element arc - o empty >
-<!entity arr "<arr>" >
-<!entity arc "<arc>" >
-
-<!shortref arrmap
- "&#RE;" space>
-
-<!usemap arrmap ar >
-<!element sup - - ((%fbutxt;)*) -(tu) >
-<!element inf - - ((%fbutxt;)*) -(tu) >
-<!element unl - - ((%fbutxt;)*) >
-<!element ovl - - ((%fbutxt;)*) >
-<!element rf - o (#pcdata) >
-<!element phr - o ((%fphtxt;)*) >
-<!element v - o ((%fcstxt;)*)
- -(tu|%limits;|%fbu;|%fph;) >
-<!element fi - o (#pcdata) >
-<!element tu - o empty >
-
-<!usemap global (rf,phr)>
-<!element def - - (thtag?, p+) >
-<!element prop - - (thtag?, p+) >
-<!element lemma - - (thtag?, p+) >
-<!element coroll - - (thtag?, p+) >
-<!element proof - - (p+) >
-<!element theorem - - (thtag?, p+) >
-<!element thtag - - (%inline)>
-
-<!usemap global (def,prop,lemma,coroll,proof,theorem)>
-<!usemap oneline thtag>
-<!entity qtag '<sq>' >
-
-<!shortref global
- "&#RS;B" null -- delete leading blanks -- >
-
-<!usemap global linuxdoc>
-<!element label - o empty>
-<!attlist label id cdata #required>
-
-<!-- ref modified to have an optional name field HG -->
-<!element ref - o empty>
-<!attlist ref
- id cdata #required
- name cdata #implied>
-
-<!-- url entity added to have direct url references HG -->
-<!element url - o empty>
-<!attlist url
- url cdata #required
- name cdata #implied>
-
-<!-- htmlurl entity added to have quieter url references esr -->
-<!element htmlurl - o empty>
-<!attlist htmlurl
- url cdata #required
- name cdata #implied>
-
-<!element pageref - o empty>
-<!attlist pageref
- id cdata #required>
-<!element comment - - (%inline)>
-<!element x - - ((#pcdata | mc)*) >
-<!usemap #empty x >
-
-<!-- Hacked by mdw to exclude abstract; abstract now part of titlepag -->
-<!element article - -
- (titlepag, header?,
- toc?, lof?, lot?, p*, (part | sect)*,
- (appendix, sect+)?, biblio?) +(footnote)>
-
-<!attlist article
- opts cdata #IMPLIED>
-
-<!-- Hacked by mdw to exclude abstract; abstract now part of titlepag -->
-<!element report - -
- (titlepag, header?, toc?, lof?, lot?, p*,
- (part | chapt)*, (appendix, chapt+)?, biblio?) +(footnote)>
-
-<!attlist report
- opts cdata #IMPLIED>
-<!element book - -
- (titlepag, header?, toc?, lof?, lot?, p*, (part | chapt)*,
- (appendix, chapt+)?, biblio?) +(footnote) >
-
-<!attlist book
- opts cdata #IMPLIED>
-
-<!-- Hacked by mdw, abstract now part of titlepag -->
-<!element titlepag o o (title, author, date?, abstract?)>
-<!element title - o (%inline, subtitle?) +(newline)>
-<!element subtitle - o (%inline)>
-<!usemap oneline titlepag>
-<!element author - o (name, thanks?, inst?,
- (and, name, thanks?, inst?)*)>
-<!element name o o (%inline) +(newline)>
-<!element and - o empty>
-<!element thanks - o (%inline)>
-<!element inst - o (%inline) +(newline)>
-<!element date - o (#pcdata) >
-
-<!usemap global thanks>
-
-<!element newline - o empty >
-<!entity nl "<newline>">
-
-<!-- Hacked by mdw -->
-<!element abstract - o (%inline)>
-<!usemap oneline abstract>
-
-
-<!element toc - o empty>
-<!element lof - o empty>
-<!element lot - o empty>
-<!element header - - (lhead, rhead) >
-<!element lhead - o (%inline)>
-<!element rhead - o (%inline)>
-<!entity % sect "heading, header?, p* " >
-<!element heading o o (%inline)>
-<!element part - o (%sect, (chapt* | sect*))>
-<!element chapt - o (%sect, sect*) +(footnote)>
-<!element sect - o (%sect, sect1*) +(footnote)>
-<!element sect1 - o (%sect, sect2*)>
-<!element sect2 - o (%sect, sect3*)>
-<!element sect3 - o (%sect, sect4*)>
-<!element sect4 - o (%sect)>
-<!usemap oneline (part,chapt,sect,sect1,sect2,sect3,sect4)>
-<!element appendix - o empty >
-<!element footnote - - (%inline)>
-<!usemap global footnote>
-<!element cite - o empty>
-<!attlist cite
- id cdata #required>
-
-<!element ncite - o empty>
-<!attlist ncite
- id cdata #required
- note cdata #required>
-
-
-<!element idx - - (#pcdata)>
-<!element cdx - - (#pcdata)>
-
-<!element biblio - o empty>
-<!attlist biblio
- style cdata "linuxdoc"
- files cdata "">
-<!element slides - - (slide*) >
-
-<!attlist slides
- opts cdata "null">
-<!element slide - o (title?, p+) >
-<!entity % addr "(address?, email?, phone?, fax?)" >
-
-<!element letter - -
- (from, %addr, to, %addr, cc?, subject?, sref?, rref?,
- rdate?, opening, p+, closing, encl?, ps?)>
-
-<!attlist letter
- opts cdata "null">
-
-<!element from - o (#pcdata) >
-<!element to - o (#pcdata) >
-
-<!usemap oneline (from,to)>
-
-<!element address - o (#pcdata) +(newline) >
-<!element email - o (#pcdata) >
-<!element phone - o (#pcdata) >
-<!element fax - o (#pcdata) >
-
-<!element subject - o (%inline;) >
-<!element sref - o (#pcdata) >
-<!element rref - o (#pcdata) >
-<!element rdate - o (#pcdata) >
-
-<!element opening - o (%inline;) >
-<!usemap oneline opening>
-
-<!element closing - o (%inline;) >
-<!element cc - o (%inline;) +(newline) >
-<!element encl - o (%inline;) +(newline) >
-
-<!element ps - o (p+) >
-
-<!element telefax - -
- (from, %addr, to, address, email?,
- phone?, fax, cc?, subject?,
- opening, p+, closing, ps?)>
-
-<!attlist telefax
- opts cdata "null"
- length cdata "2">
-
-<!element notes - - (title?, p+) >
-<!attlist notes
- opts cdata "null" >
-<!element manpage - - (sect1*)
- -(sect2 | f | %mathpar | figure | tabular |
- table | %xref | %thrm )>
-
-
-<!attlist manpage
- opts cdata "null"
- title cdata ""
- sectnum cdata "1" >
-<!shortref manpage
- "&#RS;B" null>
-
-<!usemap manpage manpage >
-<!-- end of linuxdoc dtd -->
diff --git a/share/sgml/FreeBSD/linuxdoc.sty b/share/sgml/FreeBSD/linuxdoc.sty
deleted file mode 100644
index 0a86c43..0000000
--- a/share/sgml/FreeBSD/linuxdoc.sty
+++ /dev/null
@@ -1,129 +0,0 @@
-%% This is linuxdoc-qwertz.sty, for use with SGML-generated LaTeX
-%% by Matt Welsh (mdw@sunsite.unc.edu)
-%%
-%% Based on linuxdoc.sty by Michael K. Johnson, and latex.tex by
-%% Leslie Lamport.
-%%
-%% Modified by John Fieber <jfieber@freebsd.org> for the FreeBSD
-%% Documentation Project.
-
-\typeout{Linux Documentation Style `linuxdoc, version 0.02 <6 May 1995>}
-
-% qwertz TeX macros
-
-\catcode`\"=12
-\sloppy
-\newtheorem{definition}{Definition}
-\newtheorem{proposition}{Proposition}
-\newtheorem{lemma}{Lemma}
-\newtheorem{corollary}{Corollary}
-\newtheorem{theorem}{Theorem}
-\newcommand{\mch}[1]{{\ifmmode#1 \else\(#1\)\fi}}
-\newcommand{\lt}{{\ifmmode{<}\else{\verb+<+}\fi}}
-\newcommand{\gt}{{\ifmmode{>}\else{\verb+>+}\fi}}
-\newcommand{\verbar}{{\ifmmode{|}\else{\tt|}\fi}}
-\newcommand{\idx}[1]{#1\index{#1}}
-\newcommand{\cdx}[1]{#1\index{#1@{\tt #1}}}
-
-%%% GLOBAL LAYOUT THINGS
-
-\marginparwidth 0.0 in
-\parindent 0.0 in
-\topmargin -0.5 in
-\textheight 8.5 in
-\advance\headsep 2 ex
-\advance\textheight -2 ex
-\renewcommand{\baselinestretch}{1.14}
-\addtolength{\parskip}{1.2 ex}
-
-%%% ONE-SIDED/TWO-SIDED DEPENDENCIES
-
-\if@twoside % ``book'' style was chosen
- \oddsidemargin 0.0 in
- \evensidemargin 0 in
- \textwidth 6 in
- \def\ps@headings{\let\@mkboth\markboth
- \def\@oddfoot{}\def\@evenfoot{}% No feet.
- \def\@evenhead{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth
- \rm \thepage\hfil \bf \leftmark} % Left heading.
- \def\@oddhead{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth
- {\bf \rightmark}\hfil \rm\thepage} % Right heading.
- \def\chaptermark##1{\markboth {{\ifnum \c@secnumdepth >\m@ne
- \@chapapp\ \thechapter. \ \fi ##1}}{}}%
- \def\sectionmark##1{\markright {{\ifnum \c@secnumdepth >\z@
- \thesection. \ \fi ##1}}}}
-
-\else % if not book style, then
- \oddsidemargin 0.0 in
- \evensidemargin\oddsidemargin
- \textwidth 6.5 in
- \def\ps@headings{\let\@mkboth\markboth
- \def\@oddfoot{}\def\@evenfoot{}% No feet.
- \def\@oddhead{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth
- {\bf \rightmark}\hfil \rm\thepage} % Right heading.
- \def\@evenhead\@oddhead
- \def\chaptermark##1{\markboth {{\ifnum \c@secnumdepth >\m@ne
- \@chapapp\ \thechapter. \ \fi ##1}}{}}%
- \def\sectionmark##1{\markright {{\ifnum \c@secnumdepth >\z@
- \thesection. \ \fi ##1}}}}
-
-\fi
-
-%% Titlepage stuff
-
-\gdef\@title{}
-\gdef\title#1{\gdef\@title{#1}}
-\gdef\@date{}
-\gdef\date#1{\gdef\@date{#1}}
-\gdef\@author{}
-\gdef\author#1{\gdef\@author{#1}}
-\gdef\@abstract{}
-\gdef\abstract#1{\gdef\@abstract{#1}}
-
-\def\maketitle{\thispagestyle{empty}\let\footnotesize\small%
-\let\footnoterule\relax
-%\setcounter{page}{0}%
-%\null
-%\vskip 3 in
-\noindent
-{\huge\sf \@title}\\
-\rule{\textwidth}{1mm}\\
-\mbox{} \@author\ \hfill \@date\ \\
-\vskip 1 ex
-\noindent{\sf \@abstract}
-\setcounter{footnote}{0}%
-\gdef\@author{}\gdef\@title{}\gdef\@years{}\gdef\@abstract{}
-\let\maketitle\relax}
-
-%% Needs to be here for the previous ps@headings defs to work.
-\pagestyle{headings}
-
-%%% USEFUL MACROS
-
-\newcommand{\linux}{Linux} % Always use this when
- % refering to the \linux\
- % operating system, like that.
-\newcommand{\key}[1]{{\fbox{\small\tt #1}}} % Use this to mark keys, like
- % \key{del} for the delete key.
-\newcommand{\ret}{\fbox{\sf return}} % Special case for the return key.
-\newcommand{\st}{\small\tt} % Small typewriter -- comes in handy.
-%\newcommand{\lb}{{\tt\char '173}} % Left Brace '{'
-%\newcommand{\rb}{{\tt\char '175}} % Right Brace '}'
-\newcommand{\lbr}{$\langle$} % Left Bracket '<'
-\newcommand{\rbr}{$\rangle$} % Right Bracket '>'
-\newcommand{\bs}{{\tt\char '134}} % BackSlash '\'
-\newcommand{\tm}{${}^{\mbox{\tiny\sf TM}}$}
-\newcommand{\TM}{\tm} % TM trademark symbol in
- % either case
-\newcommand{\cparam}[1]{{\rm \lbr{\sl #1}\rbr}}
- % Metavariables.
-
-%% define URL macro to handle the optional name argument
-\def\url#1#2{{\em #2} {\tt (#1)}}
-
-%% the tscreen environment automatically goes into typewriter type,
-%% but is otherwise like the screen environment
-
-\newenvironment{tscreen}%
- {\begin{quote}\bgroup\small\tt}%
- {\egroup\end{quote}}
diff --git a/share/sgml/ISO/ISOamsa b/share/sgml/ISO/ISOamsa
deleted file mode 100644
index b77154c..0000000
--- a/share/sgml/ISO/ISOamsa
+++ /dev/null
@@ -1,66 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOamsa PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN">
- %ISOamsa;
--->
-<!ENTITY cularr SDATA "[cularr]"--/curvearrowleft A: left curved arrow -->
-<!ENTITY curarr SDATA "[curarr]"--/curvearrowright A: rt curved arrow -->
-<!ENTITY dArr SDATA "[dArr ]"--/Downarrow A: down dbl arrow -->
-<!ENTITY darr2 SDATA "[darr2 ]"--/downdownarrows A: two down arrows -->
-<!ENTITY dharl SDATA "[dharl ]"--/downleftharpoon A: dn harpoon-left -->
-<!ENTITY dharr SDATA "[dharr ]"--/downrightharpoon A: down harpoon-rt -->
-<!ENTITY lAarr SDATA "[lAarr ]"--/Lleftarrow A: left triple arrow -->
-<!ENTITY Larr SDATA "[Larr ]"--/twoheadleftarrow A:-->
-<!ENTITY larr2 SDATA "[larr2 ]"--/leftleftarrows A: two left arrows -->
-<!ENTITY larrhk SDATA "[larrhk]"--/hookleftarrow A: left arrow-hooked -->
-<!ENTITY larrlp SDATA "[larrlp]"--/looparrowleft A: left arrow-looped -->
-<!ENTITY larrtl SDATA "[larrtl]"--/leftarrowtail A: left arrow-tailed -->
-<!ENTITY lhard SDATA "[lhard ]"--/leftharpoondown A: l harpoon-down -->
-<!ENTITY lharu SDATA "[lharu ]"--/leftharpoonup A: left harpoon-up -->
-<!ENTITY hArr SDATA "[hArr ]"--/Leftrightarrow A: l&r dbl arrow -->
-<!ENTITY harr SDATA "[harr ]"--/leftrightarrow A: l&r arrow -->
-<!ENTITY lrarr2 SDATA "[lrarr2]"--/leftrightarrows A: l arr over r arr -->
-<!ENTITY rlarr2 SDATA "[rlarr2]"--/rightleftarrows A: r arr over l arr -->
-<!ENTITY harrw SDATA "[harrw ]"--/leftrightsquigarrow A: l&r arr-wavy -->
-<!ENTITY rlhar2 SDATA "[rlhar2]"--/rightleftharpoons A: r harp over l -->
-<!ENTITY lrhar2 SDATA "[lrhar2]"--/leftrightharpoons A: l harp over r -->
-<!ENTITY lsh SDATA "[lsh ]"--/Lsh A:-->
-<!ENTITY map SDATA "[map ]"--/mapsto A:-->
-<!ENTITY mumap SDATA "[mumap ]"--/multimap A:-->
-<!ENTITY nearr SDATA "[nearr ]"--/nearrow A: NE pointing arrow -->
-<!ENTITY nlArr SDATA "[nlArr ]"--/nLeftarrow A: not implied by -->
-<!ENTITY nlarr SDATA "[nlarr ]"--/nleftarrow A: not left arrow -->
-<!ENTITY nhArr SDATA "[nhArr ]"--/nLeftrightarrow A: not l&r dbl arr -->
-<!ENTITY nharr SDATA "[nharr ]"--/nleftrightarrow A: not l&r arrow -->
-<!ENTITY nrarr SDATA "[nrarr ]"--/nrightarrow A: not right arrow -->
-<!ENTITY nrArr SDATA "[nrArr ]"--/nRightarrow A: not implies -->
-<!ENTITY nwarr SDATA "[nwarr ]"--/nwarrow A: NW pointing arrow -->
-<!ENTITY olarr SDATA "[olarr ]"--/circlearrowleft A: l arr in circle -->
-<!ENTITY orarr SDATA "[orarr ]"--/circlearrowright A: r arr in circle -->
-<!ENTITY rAarr SDATA "[rAarr ]"--/Rrightarrow A: right triple arrow -->
-<!ENTITY Rarr SDATA "[Rarr ]"--/twoheadrightarrow A:-->
-<!ENTITY rarr2 SDATA "[rarr2 ]"--/rightrightarrows A: two rt arrows -->
-<!ENTITY rarrhk SDATA "[rarrhk]"--/hookrightarrow A: rt arrow-hooked -->
-<!ENTITY rarrlp SDATA "[rarrlp]"--/looparrowright A: rt arrow-looped -->
-<!ENTITY rarrtl SDATA "[rarrtl]"--/rightarrowtail A: rt arrow-tailed -->
-<!ENTITY rarrw SDATA "[rarrw ]"--/squigarrowright A: rt arrow-wavy -->
-<!ENTITY rhard SDATA "[rhard ]"--/rightharpoondown A: rt harpoon-down -->
-<!ENTITY rharu SDATA "[rharu ]"--/rightharpoonup A: rt harpoon-up -->
-<!ENTITY rsh SDATA "[rsh ]"--/Rsh A:-->
-<!ENTITY drarr SDATA "[drarr ]"--/searrow A: downward rt arrow -->
-<!ENTITY dlarr SDATA "[dlarr ]"--/swarrow A: downward l arrow -->
-<!ENTITY uArr SDATA "[uArr ]"--/Uparrow A: up dbl arrow -->
-<!ENTITY uarr2 SDATA "[uarr2 ]"--/upuparrows A: two up arrows -->
-<!ENTITY vArr SDATA "[vArr ]"--/Updownarrow A: up&down dbl arrow -->
-<!ENTITY varr SDATA "[varr ]"--/updownarrow A: up&down arrow -->
-<!ENTITY uharl SDATA "[uharl ]"--/upleftharpoon A: up harpoon-left -->
-<!ENTITY uharr SDATA "[uharr ]"--/uprightharpoon A: up harp-r-->
-<!ENTITY xlArr SDATA "[xlArr ]"--/Longleftarrow A: long l dbl arrow -->
-<!ENTITY xhArr SDATA "[xhArr ]"--/Longleftrightarrow A: long l&r dbl arr-->
-<!ENTITY xharr SDATA "[xharr ]"--/longleftrightarrow A: long l&r arr -->
-<!ENTITY xrArr SDATA "[xrArr ]"--/Longrightarrow A: long rt dbl arr -->
diff --git a/share/sgml/ISO/ISOamsb b/share/sgml/ISO/ISOamsb
deleted file mode 100644
index 43944a7..0000000
--- a/share/sgml/ISO/ISOamsb
+++ /dev/null
@@ -1,52 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOamsb PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN">
- %ISOamsb;
--->
-<!ENTITY amalg SDATA "[amalg ]"--/amalg B: amalgamation or coproduct-->
-<!ENTITY Barwed SDATA "[Barwed]"--/doublebarwedge B: log and, dbl bar-->
-<!ENTITY barwed SDATA "[barwed]"--/barwedge B: logical and, bar above-->
-<!ENTITY Cap SDATA "[Cap ]"--/Cap /doublecap B: dbl intersection-->
-<!ENTITY Cup SDATA "[Cup ]"--/Cup /doublecup B: dbl union-->
-<!ENTITY cuvee SDATA "[cuvee ]"--/curlyvee B: curly logical or-->
-<!ENTITY cuwed SDATA "[cuwed ]"--/curlywedge B: curly logical and-->
-<!ENTITY diam SDATA "[diam ]"--/diamond B: open diamond-->
-<!ENTITY divonx SDATA "[divonx]"--/divideontimes B: division on times-->
-<!ENTITY intcal SDATA "[intcal]"--/intercal B: intercal-->
-<!ENTITY lthree SDATA "[lthree]"--/leftthreetimes B:-->
-<!ENTITY ltimes SDATA "[ltimes]"--/ltimes B: times sign, left closed-->
-<!ENTITY minusb SDATA "[minusb]"--/boxminus B: minus sign in box-->
-<!ENTITY oast SDATA "[oast ]"--/circledast B: asterisk in circle-->
-<!ENTITY ocir SDATA "[ocir ]"--/circledcirc B: open dot in circle-->
-<!ENTITY odash SDATA "[odash ]"--/circleddash B: hyphen in circle-->
-<!ENTITY odot SDATA "[odot ]"--/odot B: middle dot in circle-->
-<!ENTITY ominus SDATA "[ominus]"--/ominus B: minus sign in circle-->
-<!ENTITY oplus SDATA "[oplus ]"--/oplus B: plus sign in circle-->
-<!ENTITY osol SDATA "[osol ]"--/oslash B: solidus in circle-->
-<!ENTITY otimes SDATA "[otimes]"--/otimes B: multiply sign in circle-->
-<!ENTITY plusb SDATA "[plusb ]"--/boxplus B: plus sign in box-->
-<!ENTITY plusdo SDATA "[plusdo]"--/dotplus B: plus sign, dot above-->
-<!ENTITY rthree SDATA "[rthree]"--/rightthreetimes B:-->
-<!ENTITY rtimes SDATA "[rtimes]"--/rtimes B: times sign, right closed-->
-<!ENTITY sdot SDATA "[sdot ]"--/cdot B: small middle dot-->
-<!ENTITY sdotb SDATA "[sdotb ]"--/dotsquare /boxdot B: small dot in box-->
-<!ENTITY setmn SDATA "[setmn ]"--/setminus B: reverse solidus-->
-<!ENTITY sqcap SDATA "[sqcap ]"--/sqcap B: square intersection-->
-<!ENTITY sqcup SDATA "[sqcup ]"--/sqcup B: square union-->
-<!ENTITY ssetmn SDATA "[ssetmn]"--/smallsetminus B: sm reverse solidus-->
-<!ENTITY sstarf SDATA "[sstarf]"--/star B: small star, filled-->
-<!ENTITY timesb SDATA "[timesb]"--/boxtimes B: multiply sign in box-->
-<!ENTITY top SDATA "[top ]"--/top B: inverted perpendicular-->
-<!ENTITY uplus SDATA "[uplus ]"--/uplus B: plus sign in union-->
-<!ENTITY wreath SDATA "[wreath]"--/wr B: wreath product-->
-<!ENTITY xcirc SDATA "[xcirc ]"--/bigcirc B: large circle-->
-<!ENTITY xdtri SDATA "[xdtri ]"--/bigtriangledown B: big dn tri, open-->
-<!ENTITY xutri SDATA "[xutri ]"--/bigtriangleup B: big up tri, open-->
-<!ENTITY coprod SDATA "[coprod]"--/coprod L: coproduct operator-->
-<!ENTITY prod SDATA "[prod ]"--/prod L: product operator-->
-<!ENTITY sum SDATA "[sum ]"--/sum L: summation operator-->
diff --git a/share/sgml/ISO/ISOamsc b/share/sgml/ISO/ISOamsc
deleted file mode 100644
index 06222d5..0000000
--- a/share/sgml/ISO/ISOamsc
+++ /dev/null
@@ -1,20 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOamsc PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN">
- %ISOamsc;
--->
-<!ENTITY rceil SDATA "[rceil ]"--/rceil C: right ceiling-->
-<!ENTITY rfloor SDATA "[rfloor]"--/rfloor C: right floor-->
-<!ENTITY rpargt SDATA "[rpargt]"--/rightparengtr C: right paren, gt-->
-<!ENTITY urcorn SDATA "[urcorn]"--/urcorner C: upper right corner-->
-<!ENTITY drcorn SDATA "[drcorn]"--/lrcorner C: downward right corner-->
-<!ENTITY lceil SDATA "[lceil ]"--/lceil O: left ceiling-->
-<!ENTITY lfloor SDATA "[lfloor]"--/lfloor O: left floor-->
-<!ENTITY lpargt SDATA "[lpargt]"--/leftparengtr O: left parenthesis, gt-->
-<!ENTITY ulcorn SDATA "[ulcorn]"--/ulcorner O: upper left corner-->
-<!ENTITY dlcorn SDATA "[dlcorn]"--/llcorner O: downward left corner-->
diff --git a/share/sgml/ISO/ISOamsn b/share/sgml/ISO/ISOamsn
deleted file mode 100644
index 0c8327a..0000000
--- a/share/sgml/ISO/ISOamsn
+++ /dev/null
@@ -1,70 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOamsn PUBLIC
- "ISO 8879:1986//ENTITIES
- Added Math Symbols: Negated Relations//EN">
- %ISOamsn;
--->
-<!ENTITY gnap SDATA "[gnap ]"--/gnapprox N: greater, not approximate-->
-<!ENTITY gne SDATA "[gne ]"--/gneq N: greater, not equals-->
-<!ENTITY gnE SDATA "[gnE ]"--/gneqq N: greater, not dbl equals-->
-<!ENTITY gnsim SDATA "[gnsim ]"--/gnsim N: greater, not similar-->
-<!ENTITY gvnE SDATA "[gvnE ]"--/gvertneqq N: gt, vert, not dbl eq-->
-<!ENTITY lnap SDATA "[lnap ]"--/lnapprox N: less, not approximate-->
-<!ENTITY lnE SDATA "[lnE ]"--/lneqq N: less, not double equals-->
-<!ENTITY lne SDATA "[lne ]"--/lneq N: less, not equals-->
-<!ENTITY lnsim SDATA "[lnsim ]"--/lnsim N: less, not similar-->
-<!ENTITY lvnE SDATA "[lvnE ]"--/lvertneqq N: less, vert, not dbl eq-->
-<!ENTITY nap SDATA "[nap ]"--/napprox N: not approximate-->
-<!ENTITY ncong SDATA "[ncong ]"--/ncong N: not congruent with-->
-<!ENTITY nequiv SDATA "[nequiv]"--/nequiv N: not identical with-->
-<!ENTITY ngE SDATA "[ngE ]"--/ngeqq N: not greater, dbl equals-->
-<!ENTITY nge SDATA "[nge ]"--/ngeq N: not greater-than-or-equal-->
-<!ENTITY nges SDATA "[nges ]"--/ngeqslant N: not gt-or-eq, slanted-->
-<!ENTITY ngt SDATA "[ngt ]"--/ngtr N: not greater-than-->
-<!ENTITY nle SDATA "[nle ]"--/nleq N: not less-than-or-equal-->
-<!ENTITY nlE SDATA "[nlE ]"--/nleqq N: not less, dbl equals-->
-<!ENTITY nles SDATA "[nles ]"--/nleqslant N: not less-or-eq, slant-->
-<!ENTITY nlt SDATA "[nlt ]"--/nless N: not less-than-->
-<!ENTITY nltri SDATA "[nltri ]"--/ntriangleleft N: not left triangle-->
-<!ENTITY nltrie SDATA "[nltrie]"--/ntrianglelefteq N: not l tri, eq-->
-<!ENTITY nmid SDATA "[nmid ]"--/nmid-->
-<!ENTITY npar SDATA "[npar ]"--/nparallel N: not parallel-->
-<!ENTITY npr SDATA "[npr ]"--/nprec N: not precedes-->
-<!ENTITY npre SDATA "[npre ]"--/npreceq N: not precedes, equals-->
-<!ENTITY nrtri SDATA "[nrtri ]"--/ntriangleright N: not rt triangle-->
-<!ENTITY nrtrie SDATA "[nrtrie]"--/ntrianglerighteq N: not r tri, eq-->
-<!ENTITY nsc SDATA "[nsc ]"--/nsucc N: not succeeds-->
-<!ENTITY nsce SDATA "[nsce ]"--/nsucceq N: not succeeds, equals-->
-<!ENTITY nsim SDATA "[nsim ]"--/nsim N: not similar-->
-<!ENTITY nsime SDATA "[nsime ]"--/nsimeq N: not similar, equals-->
-<!ENTITY nsmid SDATA "[nsmid ]"--/nshortmid-->
-<!ENTITY nspar SDATA "[nspar ]"--/nshortparallel N: not short par-->
-<!ENTITY nsub SDATA "[nsub ]"--/nsubset N: not subset-->
-<!ENTITY nsube SDATA "[nsube ]"--/nsubseteq N: not subset, equals-->
-<!ENTITY nsubE SDATA "[nsubE ]"--/nsubseteqq N: not subset, dbl eq-->
-<!ENTITY nsup SDATA "[nsup ]"--/nsupset N: not superset-->
-<!ENTITY nsupE SDATA "[nsupE ]"--/nsupseteqq N: not superset, dbl eq-->
-<!ENTITY nsupe SDATA "[nsupe ]"--/nsupseteq N: not superset, equals-->
-<!ENTITY nvdash SDATA "[nvdash]"--/nvdash N: not vertical, dash-->
-<!ENTITY nvDash SDATA "[nvDash]"--/nvDash N: not vertical, dbl dash-->
-<!ENTITY nVDash SDATA "[nVDash]"--/nVDash N: not dbl vert, dbl dash-->
-<!ENTITY nVdash SDATA "[nVdash]"--/nVdash N: not dbl vertical, dash-->
-<!ENTITY prnap SDATA "[prnap ]"--/precnapprox N: precedes, not approx-->
-<!ENTITY prnE SDATA "[prnE ]"--/precneqq N: precedes, not dbl eq-->
-<!ENTITY prnsim SDATA "[prnsim]"--/precnsim N: precedes, not similar-->
-<!ENTITY scnap SDATA "[scnap ]"--/succnapprox N: succeeds, not approx-->
-<!ENTITY scnE SDATA "[scnE ]"--/succneqq N: succeeds, not dbl eq-->
-<!ENTITY scnsim SDATA "[scnsim]"--/succnsim N: succeeds, not similar-->
-<!ENTITY subne SDATA "[subne ]"--/subsetneq N: subset, not equals-->
-<!ENTITY subnE SDATA "[subnE ]"--/subsetneqq N: subset, not dbl eq-->
-<!ENTITY supne SDATA "[supne ]"--/supsetneq N: superset, not equals-->
-<!ENTITY supnE SDATA "[supnE ]"--/supsetneqq N: superset, not dbl eq-->
-<!ENTITY vsubnE SDATA "[vsubnE]"--/subsetneqq N: subset not dbl eq, var-->
-<!ENTITY vsubne SDATA "[vsubne]"--/subsetneq N: subset, not eq, var-->
-<!ENTITY vsupne SDATA "[vsupne]"--/supsetneq N: superset, not eq, var-->
-<!ENTITY vsupnE SDATA "[vsupnE]"--/supsetneqq N: super not dbl eq, var-->
diff --git a/share/sgml/ISO/ISOamso b/share/sgml/ISO/ISOamso
deleted file mode 100644
index ad9b329..0000000
--- a/share/sgml/ISO/ISOamso
+++ /dev/null
@@ -1,29 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOamso PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN">
- %ISOamso;
--->
-<!ENTITY ang SDATA "[ang ]"--/angle - angle-->
-<!ENTITY angmsd SDATA "[angmsd]"--/measuredangle - angle-measured-->
-<!ENTITY beth SDATA "[beth ]"--/beth - beth, Hebrew-->
-<!ENTITY bprime SDATA "[bprime]"--/backprime - reverse prime-->
-<!ENTITY comp SDATA "[comp ]"--/complement - complement sign-->
-<!ENTITY daleth SDATA "[daleth]"--/daleth - daleth, Hebrew-->
-<!ENTITY ell SDATA "[ell ]"--/ell - cursive small l-->
-<!ENTITY empty SDATA "[empty ]"--/emptyset /varnothing =small o, slash-->
-<!ENTITY gimel SDATA "[gimel ]"--/gimel - gimel, Hebrew-->
-<!ENTITY image SDATA "[image ]"--/Im - imaginary-->
-<!ENTITY inodot SDATA "[inodot]"--/imath =small i, no dot-->
-<!ENTITY jnodot SDATA "[jnodot]"--/jmath - small j, no dot-->
-<!ENTITY nexist SDATA "[nexist]"--/nexists - negated exists-->
-<!ENTITY oS SDATA "[oS ]"--/circledS - capital S in circle-->
-<!ENTITY planck SDATA "[planck]"--/hbar /hslash - Planck's over 2pi-->
-<!ENTITY real SDATA "[real ]"--/Re - real-->
-<!ENTITY sbsol SDATA "[sbsol ]"--/sbs - short reverse solidus-->
-<!ENTITY vprime SDATA "[vprime]"--/varprime - prime, variant-->
-<!ENTITY weierp SDATA "[weierp]"--/wp - Weierstrass p-->
diff --git a/share/sgml/ISO/ISOamsr b/share/sgml/ISO/ISOamsr
deleted file mode 100644
index 3f26c34..0000000
--- a/share/sgml/ISO/ISOamsr
+++ /dev/null
@@ -1,94 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOamsr PUBLIC
- "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN">
- %ISOamsr;
--->
-<!ENTITY ape SDATA "[ape ]"--/approxeq R: approximate, equals-->
-<!ENTITY asymp SDATA "[asymp ]"--/asymp R: asymptotically equal to-->
-<!ENTITY bcong SDATA "[bcong ]"--/backcong R: reverse congruent-->
-<!ENTITY bepsi SDATA "[bepsi ]"--/backepsilon R: such that-->
-<!ENTITY bowtie SDATA "[bowtie]"--/bowtie R:-->
-<!ENTITY bsim SDATA "[bsim ]"--/backsim R: reverse similar-->
-<!ENTITY bsime SDATA "[bsime ]"--/backsimeq R: reverse similar, eq-->
-<!ENTITY bump SDATA "[bump ]"--/Bumpeq R: bumpy equals-->
-<!ENTITY bumpe SDATA "[bumpe ]"--/bumpeq R: bumpy equals, equals-->
-<!ENTITY cire SDATA "[cire ]"--/circeq R: circle, equals-->
-<!ENTITY colone SDATA "[colone]"--/coloneq R: colon, equals-->
-<!ENTITY cuepr SDATA "[cuepr ]"--/curlyeqprec R: curly eq, precedes-->
-<!ENTITY cuesc SDATA "[cuesc ]"--/curlyeqsucc R: curly eq, succeeds-->
-<!ENTITY cupre SDATA "[cupre ]"--/curlypreceq R: curly precedes, eq-->
-<!ENTITY dashv SDATA "[dashv ]"--/dashv R: dash, vertical-->
-<!ENTITY ecir SDATA "[ecir ]"--/eqcirc R: circle on equals sign-->
-<!ENTITY ecolon SDATA "[ecolon]"--/eqcolon R: equals, colon-->
-<!ENTITY eDot SDATA "[eDot ]"--/doteqdot /Doteq R: eq, even dots-->
-<!ENTITY esdot SDATA "[esdot ]"--/doteq R: equals, single dot above-->
-<!ENTITY efDot SDATA "[efDot ]"--/fallingdotseq R: eq, falling dots-->
-<!ENTITY egs SDATA "[egs ]"--/eqslantgtr R: equal-or-gtr, slanted-->
-<!ENTITY els SDATA "[els ]"--/eqslantless R: eq-or-less, slanted-->
-<!ENTITY erDot SDATA "[erDot ]"--/risingdotseq R: eq, rising dots-->
-<!ENTITY fork SDATA "[fork ]"--/pitchfork R: pitchfork-->
-<!ENTITY frown SDATA "[frown ]"--/frown R: down curve-->
-<!ENTITY gap SDATA "[gap ]"--/gtrapprox R: greater, approximate-->
-<!ENTITY gsdot SDATA "[gsdot ]"--/gtrdot R: greater than, single dot-->
-<!ENTITY gE SDATA "[gE ]"--/geqq R: greater, double equals-->
-<!ENTITY gel SDATA "[gel ]"--/gtreqless R: greater, equals, less-->
-<!ENTITY gEl SDATA "[gEl ]"--/gtreqqless R: gt, dbl equals, less-->
-<!ENTITY ges SDATA "[ges ]"--/geqslant R: gt-or-equal, slanted-->
-<!ENTITY Gg SDATA "[Gg ]"--/ggg /Gg /gggtr R: triple gtr-than-->
-<!ENTITY gl SDATA "[gl ]"--/gtrless R: greater, less-->
-<!ENTITY gsim SDATA "[gsim ]"--/gtrsim R: greater, similar-->
-<!ENTITY Gt SDATA "[Gt ]"--/gg R: dbl greater-than sign-->
-<!ENTITY lap SDATA "[lap ]"--/lessapprox R: less, approximate-->
-<!ENTITY ldot SDATA "[ldot ]"--/lessdot R: less than, with dot-->
-<!ENTITY lE SDATA "[lE ]"--/leqq R: less, double equals-->
-<!ENTITY lEg SDATA "[lEg ]"--/lesseqqgtr R: less, dbl eq, greater-->
-<!ENTITY leg SDATA "[leg ]"--/lesseqgtr R: less, eq, greater-->
-<!ENTITY les SDATA "[les ]"--/leqslant R: less-than-or-eq, slant-->
-<!ENTITY lg SDATA "[lg ]"--/lessgtr R: less, greater-->
-<!ENTITY Ll SDATA "[Ll ]"--/Ll /lll /llless R: triple less-than-->
-<!ENTITY lsim SDATA "[lsim ]"--/lesssim R: less, similar-->
-<!ENTITY Lt SDATA "[Lt ]"--/ll R: double less-than sign-->
-<!ENTITY ltrie SDATA "[ltrie ]"--/trianglelefteq R: left triangle, eq-->
-<!ENTITY mid SDATA "[mid ]"--/mid R:-->
-<!ENTITY models SDATA "[models]"--/models R:-->
-<!ENTITY pr SDATA "[pr ]"--/prec R: precedes-->
-<!ENTITY prap SDATA "[prap ]"--/precapprox R: precedes, approximate-->
-<!ENTITY pre SDATA "[pre ]"--/preceq R: precedes, equals-->
-<!ENTITY prsim SDATA "[prsim ]"--/precsim R: precedes, similar-->
-<!ENTITY rtrie SDATA "[rtrie ]"--/trianglerighteq R: right tri, eq-->
-<!ENTITY samalg SDATA "[samalg]"--/smallamalg R: small amalg-->
-<!ENTITY sc SDATA "[sc ]"--/succ R: succeeds-->
-<!ENTITY scap SDATA "[scap ]"--/succapprox R: succeeds, approximate-->
-<!ENTITY sccue SDATA "[sccue ]"--/succcurlyeq R: succeeds, curly eq-->
-<!ENTITY sce SDATA "[sce ]"--/succeq R: succeeds, equals-->
-<!ENTITY scsim SDATA "[scsim ]"--/succsim R: succeeds, similar-->
-<!ENTITY sfrown SDATA "[sfrown]"--/smallfrown R: small down curve-->
-<!ENTITY smid SDATA "[smid ]"--/shortmid R:-->
-<!ENTITY smile SDATA "[smile ]"--/smile R: up curve-->
-<!ENTITY spar SDATA "[spar ]"--/shortparallel R: short parallel-->
-<!ENTITY sqsub SDATA "[sqsub ]"--/sqsubset R: square subset-->
-<!ENTITY sqsube SDATA "[sqsube]"--/sqsubseteq R: square subset, equals-->
-<!ENTITY sqsup SDATA "[sqsup ]"--/sqsupset R: square superset-->
-<!ENTITY sqsupe SDATA "[sqsupe]"--/sqsupseteq R: square superset, eq-->
-<!ENTITY ssmile SDATA "[ssmile]"--/smallsmile R: small up curve-->
-<!ENTITY Sub SDATA "[Sub ]"--/Subset R: double subset-->
-<!ENTITY subE SDATA "[subE ]"--/subseteqq R: subset, dbl equals-->
-<!ENTITY Sup SDATA "[Sup ]"--/Supset R: dbl superset-->
-<!ENTITY supE SDATA "[supE ]"--/supseteqq R: superset, dbl equals-->
-<!ENTITY thkap SDATA "[thkap ]"--/thickapprox R: thick approximate-->
-<!ENTITY thksim SDATA "[thksim]"--/thicksim R: thick similar-->
-<!ENTITY trie SDATA "[trie ]"--/triangleq R: triangle, equals-->
-<!ENTITY twixt SDATA "[twixt ]"--/between R: between-->
-<!ENTITY vdash SDATA "[vdash ]"--/vdash R: vertical, dash-->
-<!ENTITY Vdash SDATA "[Vdash ]"--/Vdash R: dbl vertical, dash-->
-<!ENTITY vDash SDATA "[vDash ]"--/vDash R: vertical, dbl dash-->
-<!ENTITY veebar SDATA "[veebar]"--/veebar R: logical or, bar below-->
-<!ENTITY vltri SDATA "[vltri ]"--/vartriangleleft R: l tri, open, var-->
-<!ENTITY vprop SDATA "[vprop ]"--/varpropto R: proportional, variant-->
-<!ENTITY vrtri SDATA "[vrtri ]"--/vartriangleright R: r tri, open, var-->
-<!ENTITY Vvdash SDATA "[Vvdash]"--/Vvdash R: triple vertical, dash-->
diff --git a/share/sgml/ISO/ISObox b/share/sgml/ISO/ISObox
deleted file mode 100644
index 643e926..0000000
--- a/share/sgml/ISO/ISObox
+++ /dev/null
@@ -1,62 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISObox PUBLIC
- "ISO 8879:1986//ENTITIES Box and Line Drawing//EN">
- %ISObox;
--->
-<!-- All names are in the form: box1234, where:
- box = constants that identify a box drawing entity.
- 1&2 = v, V, u, U, d, D, Ud, or uD, as follows:
- v = vertical line for full height.
- u = upper half of vertical line.
- d = downward (lower) half of vertical line.
- 3&4 = h, H, l, L, r, R, Lr, or lR, as follows:
- h = horizontal line for full width.
- l = left half of horizontal line.
- r = right half of horizontal line.
- In all cases, an upper-case letter means a double or heavy line.
--->
-<!ENTITY boxh SDATA "[boxh ]"--horizontal line -->
-<!ENTITY boxv SDATA "[boxv ]"--vertical line-->
-<!ENTITY boxur SDATA "[boxur ]"--upper right quadrant-->
-<!ENTITY boxul SDATA "[boxul ]"--upper left quadrant-->
-<!ENTITY boxdl SDATA "[boxdl ]"--lower left quadrant-->
-<!ENTITY boxdr SDATA "[boxdr ]"--lower right quadrant-->
-<!ENTITY boxvr SDATA "[boxvr ]"--upper and lower right quadrants-->
-<!ENTITY boxhu SDATA "[boxhu ]"--upper left and right quadrants-->
-<!ENTITY boxvl SDATA "[boxvl ]"--upper and lower left quadrants-->
-<!ENTITY boxhd SDATA "[boxhd ]"--lower left and right quadrants-->
-<!ENTITY boxvh SDATA "[boxvh ]"--all four quadrants-->
-<!ENTITY boxvR SDATA "[boxvR ]"--upper and lower right quadrants-->
-<!ENTITY boxhU SDATA "[boxhU ]"--upper left and right quadrants-->
-<!ENTITY boxvL SDATA "[boxvL ]"--upper and lower left quadrants-->
-<!ENTITY boxhD SDATA "[boxhD ]"--lower left and right quadrants-->
-<!ENTITY boxvH SDATA "[boxvH ]"--all four quadrants-->
-<!ENTITY boxH SDATA "[boxH ]"--horizontal line-->
-<!ENTITY boxV SDATA "[boxV ]"--vertical line-->
-<!ENTITY boxUR SDATA "[boxUR ]"--upper right quadrant-->
-<!ENTITY boxUL SDATA "[boxUL ]"--upper left quadrant-->
-<!ENTITY boxDL SDATA "[boxDL ]"--lower left quadrant-->
-<!ENTITY boxDR SDATA "[boxDR ]"--lower right quadrant-->
-<!ENTITY boxVR SDATA "[boxVR ]"--upper and lower right quadrants-->
-<!ENTITY boxHU SDATA "[boxHU ]"--upper left and right quadrants-->
-<!ENTITY boxVL SDATA "[boxVL ]"--upper and lower left quadrants-->
-<!ENTITY boxHD SDATA "[boxHD ]"--lower left and right quadrants-->
-<!ENTITY boxVH SDATA "[boxVH ]"--all four quadrants-->
-<!ENTITY boxVr SDATA "[boxVr ]"--upper and lower right quadrants-->
-<!ENTITY boxHu SDATA "[boxHu ]"--upper left and right quadrants-->
-<!ENTITY boxVl SDATA "[boxVl ]"--upper and lower left quadrants-->
-<!ENTITY boxHd SDATA "[boxHd ]"--lower left and right quadrants-->
-<!ENTITY boxVh SDATA "[boxVh ]"--all four quadrants-->
-<!ENTITY boxuR SDATA "[boxuR ]"--upper right quadrant-->
-<!ENTITY boxUl SDATA "[boxUl ]"--upper left quadrant-->
-<!ENTITY boxdL SDATA "[boxdL ]"--lower left quadrant-->
-<!ENTITY boxDr SDATA "[boxDr ]"--lower right quadrant-->
-<!ENTITY boxUr SDATA "[boxUr ]"--upper right quadrant-->
-<!ENTITY boxuL SDATA "[boxuL ]"--upper left quadrant-->
-<!ENTITY boxDl SDATA "[boxDl ]"--lower left quadrant-->
-<!ENTITY boxdR SDATA "[boxdR ]"--lower right quadrant-->
diff --git a/share/sgml/ISO/ISOcyr1 b/share/sgml/ISO/ISOcyr1
deleted file mode 100644
index 97b961b..0000000
--- a/share/sgml/ISO/ISOcyr1
+++ /dev/null
@@ -1,77 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOcyr1 PUBLIC
- "ISO 8879:1986//ENTITIES Russian Cyrillic//EN">
- %ISOcyr1;
--->
-<!ENTITY acy SDATA "[acy ]"--=small a, Cyrillic-->
-<!ENTITY Acy SDATA "[Acy ]"--=capital A, Cyrillic-->
-<!ENTITY bcy SDATA "[bcy ]"--=small be, Cyrillic-->
-<!ENTITY Bcy SDATA "[Bcy ]"--=capital BE, Cyrillic-->
-<!ENTITY vcy SDATA "[vcy ]"--=small ve, Cyrillic-->
-<!ENTITY Vcy SDATA "[Vcy ]"--=capital VE, Cyrillic-->
-<!ENTITY gcy SDATA "[gcy ]"--=small ghe, Cyrillic-->
-<!ENTITY Gcy SDATA "[Gcy ]"--=capital GHE, Cyrillic-->
-<!ENTITY dcy SDATA "[dcy ]"--=small de, Cyrillic-->
-<!ENTITY Dcy SDATA "[Dcy ]"--=capital DE, Cyrillic-->
-<!ENTITY iecy SDATA "[iecy ]"--=small ie, Cyrillic-->
-<!ENTITY IEcy SDATA "[IEcy ]"--=capital IE, Cyrillic-->
-<!ENTITY iocy SDATA "[iocy ]"--=small io, Russian-->
-<!ENTITY IOcy SDATA "[IOcy ]"--=capital IO, Russian-->
-<!ENTITY zhcy SDATA "[zhcy ]"--=small zhe, Cyrillic-->
-<!ENTITY ZHcy SDATA "[ZHcy ]"--=capital ZHE, Cyrillic-->
-<!ENTITY zcy SDATA "[zcy ]"--=small ze, Cyrillic-->
-<!ENTITY Zcy SDATA "[Zcy ]"--=capital ZE, Cyrillic-->
-<!ENTITY icy SDATA "[icy ]"--=small i, Cyrillic-->
-<!ENTITY Icy SDATA "[Icy ]"--=capital I, Cyrillic-->
-<!ENTITY jcy SDATA "[jcy ]"--=small short i, Cyrillic-->
-<!ENTITY Jcy SDATA "[Jcy ]"--=capital short I, Cyrillic-->
-<!ENTITY kcy SDATA "[kcy ]"--=small ka, Cyrillic-->
-<!ENTITY Kcy SDATA "[Kcy ]"--=capital KA, Cyrillic-->
-<!ENTITY lcy SDATA "[lcy ]"--=small el, Cyrillic-->
-<!ENTITY Lcy SDATA "[Lcy ]"--=capital EL, Cyrillic-->
-<!ENTITY mcy SDATA "[mcy ]"--=small em, Cyrillic-->
-<!ENTITY Mcy SDATA "[Mcy ]"--=capital EM, Cyrillic-->
-<!ENTITY ncy SDATA "[ncy ]"--=small en, Cyrillic-->
-<!ENTITY Ncy SDATA "[Ncy ]"--=capital EN, Cyrillic-->
-<!ENTITY ocy SDATA "[ocy ]"--=small o, Cyrillic-->
-<!ENTITY Ocy SDATA "[Ocy ]"--=capital O, Cyrillic-->
-<!ENTITY pcy SDATA "[pcy ]"--=small pe, Cyrillic-->
-<!ENTITY Pcy SDATA "[Pcy ]"--=capital PE, Cyrillic-->
-<!ENTITY rcy SDATA "[rcy ]"--=small er, Cyrillic-->
-<!ENTITY Rcy SDATA "[Rcy ]"--=capital ER, Cyrillic-->
-<!ENTITY scy SDATA "[scy ]"--=small es, Cyrillic-->
-<!ENTITY Scy SDATA "[Scy ]"--=capital ES, Cyrillic-->
-<!ENTITY tcy SDATA "[tcy ]"--=small te, Cyrillic-->
-<!ENTITY Tcy SDATA "[Tcy ]"--=capital TE, Cyrillic-->
-<!ENTITY ucy SDATA "[ucy ]"--=small u, Cyrillic-->
-<!ENTITY Ucy SDATA "[Ucy ]"--=capital U, Cyrillic-->
-<!ENTITY fcy SDATA "[fcy ]"--=small ef, Cyrillic-->
-<!ENTITY Fcy SDATA "[Fcy ]"--=capital EF, Cyrillic-->
-<!ENTITY khcy SDATA "[khcy ]"--=small ha, Cyrillic-->
-<!ENTITY KHcy SDATA "[KHcy ]"--=capital HA, Cyrillic-->
-<!ENTITY tscy SDATA "[tscy ]"--=small tse, Cyrillic-->
-<!ENTITY TScy SDATA "[TScy ]"--=capital TSE, Cyrillic-->
-<!ENTITY chcy SDATA "[chcy ]"--=small che, Cyrillic-->
-<!ENTITY CHcy SDATA "[CHcy ]"--=capital CHE, Cyrillic-->
-<!ENTITY shcy SDATA "[shcy ]"--=small sha, Cyrillic-->
-<!ENTITY SHcy SDATA "[SHcy ]"--=capital SHA, Cyrillic-->
-<!ENTITY shchcy SDATA "[shchcy]"--=small shcha, Cyrillic-->
-<!ENTITY SHCHcy SDATA "[SHCHcy]"--=capital SHCHA, Cyrillic-->
-<!ENTITY hardcy SDATA "[hardcy]"--=small hard sign, Cyrillic-->
-<!ENTITY HARDcy SDATA "[HARDcy]"--=capital HARD sign, Cyrillic-->
-<!ENTITY ycy SDATA "[ycy ]"--=small yeru, Cyrillic-->
-<!ENTITY Ycy SDATA "[Ycy ]"--=capital YERU, Cyrillic-->
-<!ENTITY softcy SDATA "[softcy]"--=small soft sign, Cyrillic-->
-<!ENTITY SOFTcy SDATA "[SOFTcy]"--=capital SOFT sign, Cyrillic-->
-<!ENTITY ecy SDATA "[ecy ]"--=small e, Cyrillic-->
-<!ENTITY Ecy SDATA "[Ecy ]"--=capital E, Cyrillic-->
-<!ENTITY yucy SDATA "[yucy ]"--=small yu, Cyrillic-->
-<!ENTITY YUcy SDATA "[YUcy ]"--=capital YU, Cyrillic-->
-<!ENTITY yacy SDATA "[yacy ]"--=small ya, Cyrillic-->
-<!ENTITY YAcy SDATA "[YAcy ]"--=capital YA, Cyrillic-->
-<!ENTITY numero SDATA "[numero]"--=numero sign-->
diff --git a/share/sgml/ISO/ISOcyr2 b/share/sgml/ISO/ISOcyr2
deleted file mode 100644
index 480b01c..0000000
--- a/share/sgml/ISO/ISOcyr2
+++ /dev/null
@@ -1,36 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOcyr2 PUBLIC
- "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN">
- %ISOcyr2;
--->
-<!ENTITY djcy SDATA "[djcy ]"--=small dje, Serbian-->
-<!ENTITY DJcy SDATA "[DJcy ]"--=capital DJE, Serbian-->
-<!ENTITY gjcy SDATA "[gjcy ]"--=small gje, Macedonian-->
-<!ENTITY GJcy SDATA "[GJcy ]"--=capital GJE Macedonian-->
-<!ENTITY jukcy SDATA "[jukcy ]"--=small je, Ukrainian-->
-<!ENTITY Jukcy SDATA "[Jukcy ]"--=capital JE, Ukrainian-->
-<!ENTITY dscy SDATA "[dscy ]"--=small dse, Macedonian-->
-<!ENTITY DScy SDATA "[DScy ]"--=capital DSE, Macedonian-->
-<!ENTITY iukcy SDATA "[iukcy ]"--=small i, Ukrainian-->
-<!ENTITY Iukcy SDATA "[Iukcy ]"--=capital I, Ukrainian-->
-<!ENTITY yicy SDATA "[yicy ]"--=small yi, Ukrainian-->
-<!ENTITY YIcy SDATA "[YIcy ]"--=capital YI, Ukrainian-->
-<!ENTITY jsercy SDATA "[jsercy]"--=small je, Serbian-->
-<!ENTITY Jsercy SDATA "[Jsercy]"--=capital JE, Serbian-->
-<!ENTITY ljcy SDATA "[ljcy ]"--=small lje, Serbian-->
-<!ENTITY LJcy SDATA "[LJcy ]"--=capital LJE, Serbian-->
-<!ENTITY njcy SDATA "[njcy ]"--=small nje, Serbian-->
-<!ENTITY NJcy SDATA "[NJcy ]"--=capital NJE, Serbian-->
-<!ENTITY tshcy SDATA "[tshcy ]"--=small tshe, Serbian-->
-<!ENTITY TSHcy SDATA "[TSHcy ]"--=capital TSHE, Serbian-->
-<!ENTITY kjcy SDATA "[kjcy ]"--=small kje Macedonian-->
-<!ENTITY KJcy SDATA "[KJcy ]"--=capital KJE, Macedonian-->
-<!ENTITY ubrcy SDATA "[ubrcy ]"--=small u, Byelorussian-->
-<!ENTITY Ubrcy SDATA "[Ubrcy ]"--=capital U, Byelorussian-->
-<!ENTITY dzcy SDATA "[dzcy ]"--=small dze, Serbian-->
-<!ENTITY DZcy SDATA "[DZcy ]"--=capital dze, Serbian-->
diff --git a/share/sgml/ISO/ISOdia b/share/sgml/ISO/ISOdia
deleted file mode 100644
index 3b6f98d..0000000
--- a/share/sgml/ISO/ISOdia
+++ /dev/null
@@ -1,24 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOdia PUBLIC
- "ISO 8879:1986//ENTITIES Diacritical Marks//EN">
- %ISOdia;
--->
-<!ENTITY acute SDATA "[acute ]"--=acute accent-->
-<!ENTITY breve SDATA "[breve ]"--=breve-->
-<!ENTITY caron SDATA "[caron ]"--=caron-->
-<!ENTITY cedil SDATA "[cedil ]"--=cedilla-->
-<!ENTITY circ SDATA "[circ ]"--=circumflex accent-->
-<!ENTITY dblac SDATA "[dblac ]"--=double acute accent-->
-<!ENTITY die SDATA "[die ]"--=dieresis-->
-<!ENTITY dot SDATA "[dot ]"--=dot above-->
-<!ENTITY grave SDATA "[grave ]"--=grave accent-->
-<!ENTITY macr SDATA "[macr ]"--=macron-->
-<!ENTITY ogon SDATA "[ogon ]"--=ogonek-->
-<!ENTITY ring SDATA "[ring ]"--=ring-->
-<!ENTITY tilde SDATA "[tilde ]"--=tilde-->
-<!ENTITY uml SDATA "[uml ]"--=umlaut mark-->
diff --git a/share/sgml/ISO/ISOgrk1 b/share/sgml/ISO/ISOgrk1
deleted file mode 100644
index dea16bf..0000000
--- a/share/sgml/ISO/ISOgrk1
+++ /dev/null
@@ -1,59 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOgrk1 PUBLIC
- "ISO 8879:1986//ENTITIES Greek Letters//EN">
- %ISOgrk1;
--->
-<!ENTITY agr SDATA "[agr ]"--=small alpha, Greek-->
-<!ENTITY Agr SDATA "[Agr ]"--=capital Alpha, Greek-->
-<!ENTITY bgr SDATA "[bgr ]"--=small beta, Greek-->
-<!ENTITY Bgr SDATA "[Bgr ]"--=capital Beta, Greek-->
-<!ENTITY ggr SDATA "[ggr ]"--=small gamma, Greek-->
-<!ENTITY Ggr SDATA "[Ggr ]"--=capital Gamma, Greek-->
-<!ENTITY dgr SDATA "[dgr ]"--=small delta, Greek-->
-<!ENTITY Dgr SDATA "[Dgr ]"--=capital Delta, Greek-->
-<!ENTITY egr SDATA "[egr ]"--=small epsilon, Greek-->
-<!ENTITY Egr SDATA "[Egr ]"--=capital Epsilon, Greek-->
-<!ENTITY zgr SDATA "[zgr ]"--=small zeta, Greek-->
-<!ENTITY Zgr SDATA "[Zgr ]"--=capital Zeta, Greek-->
-<!ENTITY eegr SDATA "[eegr ]"--=small eta, Greek-->
-<!ENTITY EEgr SDATA "[EEgr ]"--=capital Eta, Greek-->
-<!ENTITY thgr SDATA "[thgr ]"--=small theta, Greek-->
-<!ENTITY THgr SDATA "[THgr ]"--=capital Theta, Greek-->
-<!ENTITY igr SDATA "[igr ]"--=small iota, Greek-->
-<!ENTITY Igr SDATA "[Igr ]"--=capital Iota, Greek-->
-<!ENTITY kgr SDATA "[kgr ]"--=small kappa, Greek-->
-<!ENTITY Kgr SDATA "[Kgr ]"--=capital Kappa, Greek-->
-<!ENTITY lgr SDATA "[lgr ]"--=small lambda, Greek-->
-<!ENTITY Lgr SDATA "[Lgr ]"--=capital Lambda, Greek-->
-<!ENTITY mgr SDATA "[mgr ]"--=small mu, Greek-->
-<!ENTITY Mgr SDATA "[Mgr ]"--=capital Mu, Greek-->
-<!ENTITY ngr SDATA "[ngr ]"--=small nu, Greek-->
-<!ENTITY Ngr SDATA "[Ngr ]"--=capital Nu, Greek-->
-<!ENTITY xgr SDATA "[xgr ]"--=small xi, Greek-->
-<!ENTITY Xgr SDATA "[Xgr ]"--=capital Xi, Greek-->
-<!ENTITY ogr SDATA "[ogr ]"--=small omicron, Greek-->
-<!ENTITY Ogr SDATA "[Ogr ]"--=capital Omicron, Greek-->
-<!ENTITY pgr SDATA "[pgr ]"--=small pi, Greek-->
-<!ENTITY Pgr SDATA "[Pgr ]"--=capital Pi, Greek-->
-<!ENTITY rgr SDATA "[rgr ]"--=small rho, Greek-->
-<!ENTITY Rgr SDATA "[Rgr ]"--=capital Rho, Greek-->
-<!ENTITY sgr SDATA "[sgr ]"--=small sigma, Greek-->
-<!ENTITY Sgr SDATA "[Sgr ]"--=capital Sigma, Greek-->
-<!ENTITY sfgr SDATA "[sfgr ]"--=final small sigma, Greek-->
-<!ENTITY tgr SDATA "[tgr ]"--=small tau, Greek-->
-<!ENTITY Tgr SDATA "[Tgr ]"--=capital Tau, Greek-->
-<!ENTITY ugr SDATA "[ugr ]"--=small upsilon, Greek-->
-<!ENTITY Ugr SDATA "[Ugr ]"--=capital Upsilon, Greek-->
-<!ENTITY phgr SDATA "[phgr ]"--=small phi, Greek-->
-<!ENTITY PHgr SDATA "[PHgr ]"--=capital Phi, Greek-->
-<!ENTITY khgr SDATA "[khgr ]"--=small chi, Greek-->
-<!ENTITY KHgr SDATA "[KHgr ]"--=capital Chi, Greek-->
-<!ENTITY psgr SDATA "[psgr ]"--=small psi, Greek-->
-<!ENTITY PSgr SDATA "[PSgr ]"--=capital Psi, Greek-->
-<!ENTITY ohgr SDATA "[ohgr ]"--=small omega, Greek-->
-<!ENTITY OHgr SDATA "[OHgr ]"--=capital Omega, Greek-->
diff --git a/share/sgml/ISO/ISOgrk2 b/share/sgml/ISO/ISOgrk2
deleted file mode 100644
index 657bb99..0000000
--- a/share/sgml/ISO/ISOgrk2
+++ /dev/null
@@ -1,30 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOgrk2 PUBLIC
- "ISO 8879:1986//ENTITIES Monotoniko Greek//EN">
- %ISOgrk2;
--->
-<!ENTITY aacgr SDATA "[aacgr ]"--=small alpha, accent, Greek-->
-<!ENTITY Aacgr SDATA "[Aacgr ]"--=capital Alpha, accent, Greek-->
-<!ENTITY eacgr SDATA "[eacgr ]"--=small epsilon, accent, Greek-->
-<!ENTITY Eacgr SDATA "[Eacgr ]"--=capital Epsilon, accent, Greek-->
-<!ENTITY eeacgr SDATA "[eeacgr]"--=small eta, accent, Greek-->
-<!ENTITY EEacgr SDATA "[EEacgr]"--=capital Eta, accent, Greek-->
-<!ENTITY idigr SDATA "[idigr ]"--=small iota, dieresis, Greek-->
-<!ENTITY Idigr SDATA "[Idigr ]"--=capital Iota, dieresis, Greek-->
-<!ENTITY iacgr SDATA "[iacgr ]"--=small iota, accent, Greek-->
-<!ENTITY Iacgr SDATA "[Iacgr ]"--=capital Iota, accent, Greek-->
-<!ENTITY idiagr SDATA "[idiagr]"--=small iota, dieresis, accent, Greek-->
-<!ENTITY oacgr SDATA "[oacgr ]"--=small omicron, accent, Greek-->
-<!ENTITY Oacgr SDATA "[Oacgr ]"--=capital Omicron, accent, Greek-->
-<!ENTITY udigr SDATA "[udigr ]"--=small upsilon, dieresis, Greek-->
-<!ENTITY Udigr SDATA "[Udigr ]"--=capital Upsilon, dieresis, Greek-->
-<!ENTITY uacgr SDATA "[uacgr ]"--=small upsilon, accent, Greek-->
-<!ENTITY Uacgr SDATA "[Uacgr ]"--=capital Upsilon, accent, Greek-->
-<!ENTITY udiagr SDATA "[udiagr]"--=small upsilon, dieresis, accent, Greek-->
-<!ENTITY ohacgr SDATA "[ohacgr]"--=small omega, accent, Greek-->
-<!ENTITY OHacgr SDATA "[OHacgr]"--=capital Omega, accent, Greek-->
diff --git a/share/sgml/ISO/ISOgrk3 b/share/sgml/ISO/ISOgrk3
deleted file mode 100644
index f76c3a0..0000000
--- a/share/sgml/ISO/ISOgrk3
+++ /dev/null
@@ -1,53 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOgrk3 PUBLIC
- "ISO 8879:1986//ENTITIES Greek Symbols//EN">
- %ISOgrk3;
--->
-<!ENTITY alpha SDATA "[alpha ]"--=small alpha, Greek-->
-<!ENTITY beta SDATA "[beta ]"--=small beta, Greek-->
-<!ENTITY gamma SDATA "[gamma ]"--=small gamma, Greek-->
-<!ENTITY Gamma SDATA "[Gamma ]"--=capital Gamma, Greek-->
-<!ENTITY gammad SDATA "[gammad]"--/digamma-->
-<!ENTITY delta SDATA "[delta ]"--=small delta, Greek-->
-<!ENTITY Delta SDATA "[Delta ]"--=capital Delta, Greek-->
-<!ENTITY epsi SDATA "[epsi ]"--=small epsilon, Greek-->
-<!ENTITY epsiv SDATA "[epsiv ]"--/varepsilon-->
-<!ENTITY epsis SDATA "[epsis ]"--/straightepsilon-->
-<!ENTITY zeta SDATA "[zeta ]"--=small zeta, Greek-->
-<!ENTITY eta SDATA "[eta ]"--=small eta, Greek-->
-<!ENTITY thetas SDATA "[thetas]"--straight theta-->
-<!ENTITY Theta SDATA "[Theta ]"--=capital Theta, Greek-->
-<!ENTITY thetav SDATA "[thetav]"--/vartheta - curly or open theta-->
-<!ENTITY iota SDATA "[iota ]"--=small iota, Greek-->
-<!ENTITY kappa SDATA "[kappa ]"--=small kappa, Greek-->
-<!ENTITY kappav SDATA "[kappav]"--/varkappa-->
-<!ENTITY lambda SDATA "[lambda]"--=small lambda, Greek-->
-<!ENTITY Lambda SDATA "[Lambda]"--=capital Lambda, Greek-->
-<!ENTITY mu SDATA "[mu ]"--=small mu, Greek-->
-<!ENTITY nu SDATA "[nu ]"--=small nu, Greek-->
-<!ENTITY xi SDATA "[xi ]"--=small xi, Greek-->
-<!ENTITY Xi SDATA "[Xi ]"--=capital Xi, Greek-->
-<!ENTITY pi SDATA "[pi ]"--=small pi, Greek-->
-<!ENTITY piv SDATA "[piv ]"--/varpi-->
-<!ENTITY Pi SDATA "[Pi ]"--=capital Pi, Greek-->
-<!ENTITY rho SDATA "[rho ]"--=small rho, Greek-->
-<!ENTITY rhov SDATA "[rhov ]"--/varrho-->
-<!ENTITY sigma SDATA "[sigma ]"--=small sigma, Greek-->
-<!ENTITY Sigma SDATA "[Sigma ]"--=capital Sigma, Greek-->
-<!ENTITY sigmav SDATA "[sigmav]"--/varsigma-->
-<!ENTITY tau SDATA "[tau ]"--=small tau, Greek-->
-<!ENTITY upsi SDATA "[upsi ]"--=small upsilon, Greek-->
-<!ENTITY Upsi SDATA "[Upsi ]"--=capital Upsilon, Greek-->
-<!ENTITY phis SDATA "[phis ]"--/straightphi - straight phi-->
-<!ENTITY Phi SDATA "[Phi ]"--=capital Phi, Greek-->
-<!ENTITY phiv SDATA "[phiv ]"--/varphi - curly or open phi-->
-<!ENTITY chi SDATA "[chi ]"--=small chi, Greek-->
-<!ENTITY psi SDATA "[psi ]"--=small psi, Greek-->
-<!ENTITY Psi SDATA "[Psi ]"--=capital Psi, Greek-->
-<!ENTITY omega SDATA "[omega ]"--=small omega, Greek-->
-<!ENTITY Omega SDATA "[Omega ]"--=capital Omega, Greek-->
diff --git a/share/sgml/ISO/ISOgrk4 b/share/sgml/ISO/ISOgrk4
deleted file mode 100644
index e4427a0..0000000
--- a/share/sgml/ISO/ISOgrk4
+++ /dev/null
@@ -1,53 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOgrk4 PUBLIC
- "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN">
- %ISOgrk4;
--->
-<!ENTITY b.alpha SDATA "[b.alpha ]"--=small alpha, Greek-->
-<!ENTITY b.beta SDATA "[b.beta ]"--=small beta, Greek-->
-<!ENTITY b.gamma SDATA "[b.gamma ]"--=small gamma, Greek-->
-<!ENTITY b.Gamma SDATA "[b.Gamma ]"--=capital Gamma, Greek-->
-<!ENTITY b.gammad SDATA "[b.gammad]"--/digamma-->
-<!ENTITY b.delta SDATA "[b.delta ]"--=small delta, Greek-->
-<!ENTITY b.Delta SDATA "[b.Delta ]"--=capital Delta, Greek-->
-<!ENTITY b.epsi SDATA "[b.epsi ]"--=small epsilon, Greek-->
-<!ENTITY b.epsiv SDATA "[b.epsiv ]"--/varepsilon-->
-<!ENTITY b.epsis SDATA "[b.epsis ]"--/straightepsilon-->
-<!ENTITY b.zeta SDATA "[b.zeta ]"--=small zeta, Greek-->
-<!ENTITY b.eta SDATA "[b.eta ]"--=small eta, Greek-->
-<!ENTITY b.thetas SDATA "[b.thetas]"--straight theta-->
-<!ENTITY b.Theta SDATA "[b.Theta ]"--=capital Theta, Greek-->
-<!ENTITY b.thetav SDATA "[b.thetav]"--/vartheta - curly or open theta-->
-<!ENTITY b.iota SDATA "[b.iota ]"--=small iota, Greek-->
-<!ENTITY b.kappa SDATA "[b.kappa ]"--=small kappa, Greek-->
-<!ENTITY b.kappav SDATA "[b.kappav]"--/varkappa-->
-<!ENTITY b.lambda SDATA "[b.lambda]"--=small lambda, Greek-->
-<!ENTITY b.Lambda SDATA "[b.Lambda]"--=capital Lambda, Greek-->
-<!ENTITY b.mu SDATA "[b.mu ]"--=small mu, Greek-->
-<!ENTITY b.nu SDATA "[b.nu ]"--=small nu, Greek-->
-<!ENTITY b.xi SDATA "[b.xi ]"--=small xi, Greek-->
-<!ENTITY b.Xi SDATA "[b.Xi ]"--=capital Xi, Greek-->
-<!ENTITY b.pi SDATA "[b.pi ]"--=small pi, Greek-->
-<!ENTITY b.Pi SDATA "[b.Pi ]"--=capital Pi, Greek-->
-<!ENTITY b.piv SDATA "[b.piv ]"--/varpi-->
-<!ENTITY b.rho SDATA "[b.rho ]"--=small rho, Greek-->
-<!ENTITY b.rhov SDATA "[b.rhov ]"--/varrho-->
-<!ENTITY b.sigma SDATA "[b.sigma ]"--=small sigma, Greek-->
-<!ENTITY b.Sigma SDATA "[b.Sigma ]"--=capital Sigma, Greek-->
-<!ENTITY b.sigmav SDATA "[b.sigmav]"--/varsigma-->
-<!ENTITY b.tau SDATA "[b.tau ]"--=small tau, Greek-->
-<!ENTITY b.upsi SDATA "[b.upsi ]"--=small upsilon, Greek-->
-<!ENTITY b.Upsi SDATA "[b.Upsi ]"--=capital Upsilon, Greek-->
-<!ENTITY b.phis SDATA "[b.phis ]"--/straightphi - straight phi-->
-<!ENTITY b.Phi SDATA "[b.Phi ]"--=capital Phi, Greek-->
-<!ENTITY b.phiv SDATA "[b.phiv ]"--/varphi - curly or open phi-->
-<!ENTITY b.chi SDATA "[b.chi ]"--=small chi, Greek-->
-<!ENTITY b.psi SDATA "[b.psi ]"--=small psi, Greek-->
-<!ENTITY b.Psi SDATA "[b.Psi ]"--=capital Psi, Greek-->
-<!ENTITY b.omega SDATA "[b.omega ]"--=small omega, Greek-->
-<!ENTITY b.Omega SDATA "[b.Omega ]"--=capital Omega, Greek-->
diff --git a/share/sgml/ISO/ISOlat1 b/share/sgml/ISO/ISOlat1
deleted file mode 100644
index 0d7d0a7..0000000
--- a/share/sgml/ISO/ISOlat1
+++ /dev/null
@@ -1,72 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOlat1 PUBLIC
- "ISO 8879:1986//ENTITIES Added Latin 1//EN">
- %ISOlat1;
--->
-<!ENTITY aacute SDATA "[aacute]"--=small a, acute accent-->
-<!ENTITY Aacute SDATA "[Aacute]"--=capital A, acute accent-->
-<!ENTITY acirc SDATA "[acirc ]"--=small a, circumflex accent-->
-<!ENTITY Acirc SDATA "[Acirc ]"--=capital A, circumflex accent-->
-<!ENTITY agrave SDATA "[agrave]"--=small a, grave accent-->
-<!ENTITY Agrave SDATA "[Agrave]"--=capital A, grave accent-->
-<!ENTITY aring SDATA "[aring ]"--=small a, ring-->
-<!ENTITY Aring SDATA "[Aring ]"--=capital A, ring-->
-<!ENTITY atilde SDATA "[atilde]"--=small a, tilde-->
-<!ENTITY Atilde SDATA "[Atilde]"--=capital A, tilde-->
-<!ENTITY auml SDATA "[auml ]"--=small a, dieresis or umlaut mark-->
-<!ENTITY Auml SDATA "[Auml ]"--=capital A, dieresis or umlaut mark-->
-<!ENTITY aelig SDATA "[aelig ]"--=small ae diphthong (ligature)-->
-<!ENTITY AElig SDATA "[AElig ]"--=capital AE diphthong (ligature)-->
-<!ENTITY ccedil SDATA "[ccedil]"--=small c, cedilla-->
-<!ENTITY Ccedil SDATA "[Ccedil]"--=capital C, cedilla-->
-<!ENTITY eth SDATA "[eth ]"--=small eth, Icelandic-->
-<!ENTITY ETH SDATA "[ETH ]"--=capital Eth, Icelandic-->
-<!ENTITY eacute SDATA "[eacute]"--=small e, acute accent-->
-<!ENTITY Eacute SDATA "[Eacute]"--=capital E, acute accent-->
-<!ENTITY ecirc SDATA "[ecirc ]"--=small e, circumflex accent-->
-<!ENTITY Ecirc SDATA "[Ecirc ]"--=capital E, circumflex accent-->
-<!ENTITY egrave SDATA "[egrave]"--=small e, grave accent-->
-<!ENTITY Egrave SDATA "[Egrave]"--=capital E, grave accent-->
-<!ENTITY euml SDATA "[euml ]"--=small e, dieresis or umlaut mark-->
-<!ENTITY Euml SDATA "[Euml ]"--=capital E, dieresis or umlaut mark-->
-<!ENTITY iacute SDATA "[iacute]"--=small i, acute accent-->
-<!ENTITY Iacute SDATA "[Iacute]"--=capital I, acute accent-->
-<!ENTITY icirc SDATA "[icirc ]"--=small i, circumflex accent-->
-<!ENTITY Icirc SDATA "[Icirc ]"--=capital I, circumflex accent-->
-<!ENTITY igrave SDATA "[igrave]"--=small i, grave accent-->
-<!ENTITY Igrave SDATA "[Igrave]"--=capital I, grave accent-->
-<!ENTITY iuml SDATA "[iuml ]"--=small i, dieresis or umlaut mark-->
-<!ENTITY Iuml SDATA "[Iuml ]"--=capital I, dieresis or umlaut mark-->
-<!ENTITY ntilde SDATA "[ntilde]"--=small n, tilde-->
-<!ENTITY Ntilde SDATA "[Ntilde]"--=capital N, tilde-->
-<!ENTITY oacute SDATA "[oacute]"--=small o, acute accent-->
-<!ENTITY Oacute SDATA "[Oacute]"--=capital O, acute accent-->
-<!ENTITY ocirc SDATA "[ocirc ]"--=small o, circumflex accent-->
-<!ENTITY Ocirc SDATA "[Ocirc ]"--=capital O, circumflex accent-->
-<!ENTITY ograve SDATA "[ograve]"--=small o, grave accent-->
-<!ENTITY Ograve SDATA "[Ograve]"--=capital O, grave accent-->
-<!ENTITY oslash SDATA "[oslash]"--=small o, slash-->
-<!ENTITY Oslash SDATA "[Oslash]"--=capital O, slash-->
-<!ENTITY otilde SDATA "[otilde]"--=small o, tilde-->
-<!ENTITY Otilde SDATA "[Otilde]"--=capital O, tilde-->
-<!ENTITY ouml SDATA "[ouml ]"--=small o, dieresis or umlaut mark-->
-<!ENTITY Ouml SDATA "[Ouml ]"--=capital O, dieresis or umlaut mark-->
-<!ENTITY szlig SDATA "[szlig ]"--=small sharp s, German (sz ligature)-->
-<!ENTITY thorn SDATA "[thorn ]"--=small thorn, Icelandic-->
-<!ENTITY THORN SDATA "[THORN ]"--=capital THORN, Icelandic-->
-<!ENTITY uacute SDATA "[uacute]"--=small u, acute accent-->
-<!ENTITY Uacute SDATA "[Uacute]"--=capital U, acute accent-->
-<!ENTITY ucirc SDATA "[ucirc ]"--=small u, circumflex accent-->
-<!ENTITY Ucirc SDATA "[Ucirc ]"--=capital U, circumflex accent-->
-<!ENTITY ugrave SDATA "[ugrave]"--=small u, grave accent-->
-<!ENTITY Ugrave SDATA "[Ugrave]"--=capital U, grave accent-->
-<!ENTITY uuml SDATA "[uuml ]"--=small u, dieresis or umlaut mark-->
-<!ENTITY Uuml SDATA "[Uuml ]"--=capital U, dieresis or umlaut mark-->
-<!ENTITY yacute SDATA "[yacute]"--=small y, acute accent-->
-<!ENTITY Yacute SDATA "[Yacute]"--=capital Y, acute accent-->
-<!ENTITY yuml SDATA "[yuml ]"--=small y, dieresis or umlaut mark-->
diff --git a/share/sgml/ISO/ISOlat2 b/share/sgml/ISO/ISOlat2
deleted file mode 100644
index 4bcb337..0000000
--- a/share/sgml/ISO/ISOlat2
+++ /dev/null
@@ -1,131 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOlat2 PUBLIC
- "ISO 8879:1986//ENTITIES Added Latin 2//EN">
- %ISOlat2;
--->
-<!ENTITY abreve SDATA "[abreve]"--=small a, breve-->
-<!ENTITY Abreve SDATA "[Abreve]"--=capital A, breve-->
-<!ENTITY amacr SDATA "[amacr ]"--=small a, macron-->
-<!ENTITY Amacr SDATA "[Amacr ]"--=capital A, macron-->
-<!ENTITY aogon SDATA "[aogon ]"--=small a, ogonek-->
-<!ENTITY Aogon SDATA "[Aogon ]"--=capital A, ogonek-->
-<!ENTITY cacute SDATA "[cacute]"--=small c, acute accent-->
-<!ENTITY Cacute SDATA "[Cacute]"--=capital C, acute accent-->
-<!ENTITY ccaron SDATA "[ccaron]"--=small c, caron-->
-<!ENTITY Ccaron SDATA "[Ccaron]"--=capital C, caron-->
-<!ENTITY ccirc SDATA "[ccirc ]"--=small c, circumflex accent-->
-<!ENTITY Ccirc SDATA "[Ccirc ]"--=capital C, circumflex accent-->
-<!ENTITY cdot SDATA "[cdot ]"--=small c, dot above-->
-<!ENTITY Cdot SDATA "[Cdot ]"--=capital C, dot above-->
-<!ENTITY dcaron SDATA "[dcaron]"--=small d, caron-->
-<!ENTITY Dcaron SDATA "[Dcaron]"--=capital D, caron-->
-<!ENTITY dstrok SDATA "[dstrok]"--=small d, stroke-->
-<!ENTITY Dstrok SDATA "[Dstrok]"--=capital D, stroke-->
-<!ENTITY ecaron SDATA "[ecaron]"--=small e, caron-->
-<!ENTITY Ecaron SDATA "[Ecaron]"--=capital E, caron-->
-<!ENTITY edot SDATA "[edot ]"--=small e, dot above-->
-<!ENTITY Edot SDATA "[Edot ]"--=capital E, dot above-->
-<!ENTITY emacr SDATA "[emacr ]"--=small e, macron-->
-<!ENTITY Emacr SDATA "[Emacr ]"--=capital E, macron-->
-<!ENTITY eogon SDATA "[eogon ]"--=small e, ogonek-->
-<!ENTITY Eogon SDATA "[Eogon ]"--=capital E, ogonek-->
-<!ENTITY gacute SDATA "[gacute]"--=small g, acute accent-->
-<!ENTITY gbreve SDATA "[gbreve]"--=small g, breve-->
-<!ENTITY Gbreve SDATA "[Gbreve]"--=capital G, breve-->
-<!ENTITY Gcedil SDATA "[Gcedil]"--=capital G, cedilla-->
-<!ENTITY gcirc SDATA "[gcirc ]"--=small g, circumflex accent-->
-<!ENTITY Gcirc SDATA "[Gcirc ]"--=capital G, circumflex accent-->
-<!ENTITY gdot SDATA "[gdot ]"--=small g, dot above-->
-<!ENTITY Gdot SDATA "[Gdot ]"--=capital G, dot above-->
-<!ENTITY hcirc SDATA "[hcirc ]"--=small h, circumflex accent-->
-<!ENTITY Hcirc SDATA "[Hcirc ]"--=capital H, circumflex accent-->
-<!ENTITY hstrok SDATA "[hstrok]"--=small h, stroke-->
-<!ENTITY Hstrok SDATA "[Hstrok]"--=capital H, stroke-->
-<!ENTITY Idot SDATA "[Idot ]"--=capital I, dot above-->
-<!ENTITY Imacr SDATA "[Imacr ]"--=capital I, macron-->
-<!ENTITY imacr SDATA "[imacr ]"--=small i, macron-->
-<!ENTITY ijlig SDATA "[ijlig ]"--=small ij ligature-->
-<!ENTITY IJlig SDATA "[IJlig ]"--=capital IJ ligature-->
-<!ENTITY inodot SDATA "[inodot]"--=small i without dot-->
-<!ENTITY iogon SDATA "[iogon ]"--=small i, ogonek-->
-<!ENTITY Iogon SDATA "[Iogon ]"--=capital I, ogonek-->
-<!ENTITY itilde SDATA "[itilde]"--=small i, tilde-->
-<!ENTITY Itilde SDATA "[Itilde]"--=capital I, tilde-->
-<!ENTITY jcirc SDATA "[jcirc ]"--=small j, circumflex accent-->
-<!ENTITY Jcirc SDATA "[Jcirc ]"--=capital J, circumflex accent-->
-<!ENTITY kcedil SDATA "[kcedil]"--=small k, cedilla-->
-<!ENTITY Kcedil SDATA "[Kcedil]"--=capital K, cedilla-->
-<!ENTITY kgreen SDATA "[kgreen]"--=small k, Greenlandic-->
-<!ENTITY lacute SDATA "[lacute]"--=small l, acute accent-->
-<!ENTITY Lacute SDATA "[Lacute]"--=capital L, acute accent-->
-<!ENTITY lcaron SDATA "[lcaron]"--=small l, caron-->
-<!ENTITY Lcaron SDATA "[Lcaron]"--=capital L, caron-->
-<!ENTITY lcedil SDATA "[lcedil]"--=small l, cedilla-->
-<!ENTITY Lcedil SDATA "[Lcedil]"--=capital L, cedilla-->
-<!ENTITY lmidot SDATA "[lmidot]"--=small l, middle dot-->
-<!ENTITY Lmidot SDATA "[Lmidot]"--=capital L, middle dot-->
-<!ENTITY lstrok SDATA "[lstrok]"--=small l, stroke-->
-<!ENTITY Lstrok SDATA "[Lstrok]"--=capital L, stroke-->
-<!ENTITY nacute SDATA "[nacute]"--=small n, acute accent-->
-<!ENTITY Nacute SDATA "[Nacute]"--=capital N, acute accent-->
-<!ENTITY eng SDATA "[eng ]"--=small eng, Lapp-->
-<!ENTITY ENG SDATA "[ENG ]"--=capital ENG, Lapp-->
-<!ENTITY napos SDATA "[napos ]"--=small n, apostrophe-->
-<!ENTITY ncaron SDATA "[ncaron]"--=small n, caron-->
-<!ENTITY Ncaron SDATA "[Ncaron]"--=capital N, caron-->
-<!ENTITY ncedil SDATA "[ncedil]"--=small n, cedilla-->
-<!ENTITY Ncedil SDATA "[Ncedil]"--=capital N, cedilla-->
-<!ENTITY odblac SDATA "[odblac]"--=small o, double acute accent-->
-<!ENTITY Odblac SDATA "[Odblac]"--=capital O, double acute accent-->
-<!ENTITY Omacr SDATA "[Omacr ]"--=capital O, macron-->
-<!ENTITY omacr SDATA "[omacr ]"--=small o, macron-->
-<!ENTITY oelig SDATA "[oelig ]"--=small oe ligature-->
-<!ENTITY OElig SDATA "[OElig ]"--=capital OE ligature-->
-<!ENTITY racute SDATA "[racute]"--=small r, acute accent-->
-<!ENTITY Racute SDATA "[Racute]"--=capital R, acute accent-->
-<!ENTITY rcaron SDATA "[rcaron]"--=small r, caron-->
-<!ENTITY Rcaron SDATA "[Rcaron]"--=capital R, caron-->
-<!ENTITY rcedil SDATA "[rcedil]"--=small r, cedilla-->
-<!ENTITY Rcedil SDATA "[Rcedil]"--=capital R, cedilla-->
-<!ENTITY sacute SDATA "[sacute]"--=small s, acute accent-->
-<!ENTITY Sacute SDATA "[Sacute]"--=capital S, acute accent-->
-<!ENTITY scaron SDATA "[scaron]"--=small s, caron-->
-<!ENTITY Scaron SDATA "[Scaron]"--=capital S, caron-->
-<!ENTITY scedil SDATA "[scedil]"--=small s, cedilla-->
-<!ENTITY Scedil SDATA "[Scedil]"--=capital S, cedilla-->
-<!ENTITY scirc SDATA "[scirc ]"--=small s, circumflex accent-->
-<!ENTITY Scirc SDATA "[Scirc ]"--=capital S, circumflex accent-->
-<!ENTITY tcaron SDATA "[tcaron]"--=small t, caron-->
-<!ENTITY Tcaron SDATA "[Tcaron]"--=capital T, caron-->
-<!ENTITY tcedil SDATA "[tcedil]"--=small t, cedilla-->
-<!ENTITY Tcedil SDATA "[Tcedil]"--=capital T, cedilla-->
-<!ENTITY tstrok SDATA "[tstrok]"--=small t, stroke-->
-<!ENTITY Tstrok SDATA "[Tstrok]"--=capital T, stroke-->
-<!ENTITY ubreve SDATA "[ubreve]"--=small u, breve-->
-<!ENTITY Ubreve SDATA "[Ubreve]"--=capital U, breve-->
-<!ENTITY udblac SDATA "[udblac]"--=small u, double acute accent-->
-<!ENTITY Udblac SDATA "[Udblac]"--=capital U, double acute accent-->
-<!ENTITY umacr SDATA "[umacr ]"--=small u, macron-->
-<!ENTITY Umacr SDATA "[Umacr ]"--=capital U, macron-->
-<!ENTITY uogon SDATA "[uogon ]"--=small u, ogonek-->
-<!ENTITY Uogon SDATA "[Uogon ]"--=capital U, ogonek-->
-<!ENTITY uring SDATA "[uring ]"--=small u, ring-->
-<!ENTITY Uring SDATA "[Uring ]"--=capital U, ring-->
-<!ENTITY utilde SDATA "[utilde]"--=small u, tilde-->
-<!ENTITY Utilde SDATA "[Utilde]"--=capital U, tilde-->
-<!ENTITY wcirc SDATA "[wcirc ]"--=small w, circumflex accent-->
-<!ENTITY Wcirc SDATA "[Wcirc ]"--=capital W, circumflex accent-->
-<!ENTITY ycirc SDATA "[ycirc ]"--=small y, circumflex accent-->
-<!ENTITY Ycirc SDATA "[Ycirc ]"--=capital Y, circumflex accent-->
-<!ENTITY Yuml SDATA "[Yuml ]"--=capital Y, dieresis or umlaut mark-->
-<!ENTITY zacute SDATA "[zacute]"--=small z, acute accent-->
-<!ENTITY Zacute SDATA "[Zacute]"--=capital Z, acute accent-->
-<!ENTITY zcaron SDATA "[zcaron]"--=small z, caron-->
-<!ENTITY Zcaron SDATA "[Zcaron]"--=capital Z, caron-->
-<!ENTITY zdot SDATA "[zdot ]"--=small z, dot above-->
-<!ENTITY Zdot SDATA "[Zdot ]"--=capital Z, dot above-->
diff --git a/share/sgml/ISO/ISOnum b/share/sgml/ISO/ISOnum
deleted file mode 100644
index d7b41c3..0000000
--- a/share/sgml/ISO/ISOnum
+++ /dev/null
@@ -1,91 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOnum PUBLIC
- "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN">
- %ISOnum;
--->
-<!ENTITY half SDATA "[half ]"--=fraction one-half-->
-<!ENTITY frac12 SDATA "[frac12]"--=fraction one-half-->
-<!ENTITY frac14 SDATA "[frac14]"--=fraction one-quarter-->
-<!ENTITY frac34 SDATA "[frac34]"--=fraction three-quarters-->
-<!ENTITY frac18 SDATA "[frac18]"--=fraction one-eighth-->
-<!ENTITY frac38 SDATA "[frac38]"--=fraction three-eighths-->
-<!ENTITY frac58 SDATA "[frac58]"--=fraction five-eighths-->
-<!ENTITY frac78 SDATA "[frac78]"--=fraction seven-eighths-->
-
-<!ENTITY sup1 SDATA "[sup1 ]"--=superscript one-->
-<!ENTITY sup2 SDATA "[sup2 ]"--=superscript two-->
-<!ENTITY sup3 SDATA "[sup3 ]"--=superscript three-->
-
-<!ENTITY plus SDATA "[plus ]"--=plus sign B:-- >
-<!ENTITY plusmn SDATA "[plusmn]"--/pm B: =plus-or-minus sign-->
-<!ENTITY lt SDATA "[lt ]"--=less-than sign R:-->
-<!ENTITY equals SDATA "[equals]"--=equals sign R:-->
-<!ENTITY gt SDATA "[gt ]"--=greater-than sign R:-->
-<!ENTITY divide SDATA "[divide]"--/div B: =divide sign-->
-<!ENTITY times SDATA "[times ]"--/times B: =multiply sign-->
-
-<!ENTITY curren SDATA "[curren]"--=general currency sign-->
-<!ENTITY pound SDATA "[pound ]"--=pound sign-->
-<!ENTITY dollar SDATA "[dollar]"--=dollar sign-->
-<!ENTITY cent SDATA "[cent ]"--=cent sign-->
-<!ENTITY yen SDATA "[yen ]"--/yen =yen sign-->
-
-<!ENTITY num SDATA "[num ]"--=number sign-->
-<!ENTITY percnt SDATA "[percnt]"--=percent sign-->
-<!ENTITY amp SDATA "[amp ]"--=ampersand-->
-<!ENTITY ast SDATA "[ast ]"--/ast B: =asterisk-->
-<!ENTITY commat SDATA "[commat]"--=commercial at-->
-<!ENTITY lsqb SDATA "[lsqb ]"--/lbrack O: =left square bracket-->
-<!ENTITY bsol SDATA "[bsol ]"--/backslash =reverse solidus-->
-<!ENTITY rsqb SDATA "[rsqb ]"--/rbrack C: =right square bracket-->
-<!ENTITY lcub SDATA "[lcub ]"--/lbrace O: =left curly bracket-->
-<!ENTITY horbar SDATA "[horbar]"--=horizontal bar-->
-<!ENTITY verbar SDATA "[verbar]"--/vert =vertical bar-->
-<!ENTITY rcub SDATA "[rcub ]"--/rbrace C: =right curly bracket-->
-<!ENTITY micro SDATA "[micro ]"--=micro sign-->
-<!ENTITY ohm SDATA "[ohm ]"--=ohm sign-->
-<!ENTITY deg SDATA "[deg ]"--=degree sign-->
-<!ENTITY ordm SDATA "[ordm ]"--=ordinal indicator, masculine-->
-<!ENTITY ordf SDATA "[ordf ]"--=ordinal indicator, feminine-->
-<!ENTITY sect SDATA "[sect ]"--=section sign-->
-<!ENTITY para SDATA "[para ]"--=pilcrow (paragraph sign)-->
-<!ENTITY middot SDATA "[middot]"--/centerdot B: =middle dot-->
-<!ENTITY larr SDATA "[larr ]"--/leftarrow /gets A: =leftward arrow-->
-<!ENTITY rarr SDATA "[rarr ]"--/rightarrow /to A: =rightward arrow-->
-<!ENTITY uarr SDATA "[uarr ]"--/uparrow A: =upward arrow-->
-<!ENTITY darr SDATA "[darr ]"--/downarrow A: =downward arrow-->
-<!ENTITY copy SDATA "[copy ]"--=copyright sign-->
-<!ENTITY reg SDATA "[reg ]"--/circledR =registered sign-->
-<!ENTITY trade SDATA "[trade ]"--=trade mark sign-->
-<!ENTITY brvbar SDATA "[brvbar]"--=broken (vertical) bar-->
-<!ENTITY not SDATA "[not ]"--/neg /lnot =not sign-->
-<!ENTITY sung SDATA "[sung ]"--=music note (sung text sign)-->
-
-<!ENTITY excl SDATA "[excl ]"--=exclamation mark-->
-<!ENTITY iexcl SDATA "[iexcl ]"--=inverted exclamation mark-->
-<!ENTITY quot SDATA "[quot ]"--=quotation mark-->
-<!ENTITY apos SDATA "[apos ]"--=apostrophe-->
-<!ENTITY lpar SDATA "[lpar ]"--O: =left parenthesis-->
-<!ENTITY rpar SDATA "[rpar ]"--C: =right parenthesis-->
-<!ENTITY comma SDATA "[comma ]"--P: =comma-->
-<!ENTITY lowbar SDATA "[lowbar]"--=low line-->
-<!ENTITY hyphen SDATA "[hyphen]"--=hyphen-->
-<!ENTITY period SDATA "[period]"--=full stop, period-->
-<!ENTITY sol SDATA "[sol ]"--=solidus-->
-<!ENTITY colon SDATA "[colon ]"--/colon P:-->
-<!ENTITY semi SDATA "[semi ]"--=semicolon P:-->
-<!ENTITY quest SDATA "[quest ]"--=question mark-->
-<!ENTITY iquest SDATA "[iquest]"--=inverted question mark-->
-<!ENTITY laquo SDATA "[laquo ]"--=angle quotation mark, left-->
-<!ENTITY raquo SDATA "[raquo ]"--=angle quotation mark, right-->
-<!ENTITY lsquo SDATA "[lsquo ]"--=single quotation mark, left-->
-<!ENTITY rsquo SDATA "[rsquo ]"--=single quotation mark, right-->
-<!ENTITY ldquo SDATA "[ldquo ]"--=double quotation mark, left-->
-<!ENTITY rdquo SDATA "[rdquo ]"--=double quotation mark, right-->
-<!ENTITY nbsp SDATA "[nbsp ]"--=no break (required) space-->
-<!ENTITY shy SDATA "[shy ]"--=soft hyphen-->
diff --git a/share/sgml/ISO/ISOpub b/share/sgml/ISO/ISOpub
deleted file mode 100644
index c184973..0000000
--- a/share/sgml/ISO/ISOpub
+++ /dev/null
@@ -1,100 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOpub PUBLIC
- "ISO 8879:1986//ENTITIES Publishing//EN">
- %ISOpub;
--->
-<!ENTITY emsp SDATA "[emsp ]"--=em space-->
-<!ENTITY ensp SDATA "[ensp ]"--=en space (1/2-em)-->
-<!ENTITY emsp13 SDATA "[emsp3 ]"--=1/3-em space-->
-<!ENTITY emsp14 SDATA "[emsp4 ]"--=1/4-em space-->
-<!ENTITY numsp SDATA "[numsp ]"--=digit space (width of a number)-->
-<!ENTITY puncsp SDATA "[puncsp]"--=punctuation space (width of comma)-->
-<!ENTITY thinsp SDATA "[thinsp]"--=thin space (1/6-em)-->
-<!ENTITY hairsp SDATA "[hairsp]"--=hair space-->
-<!ENTITY mdash SDATA "[mdash ]"--=em dash-->
-<!ENTITY ndash SDATA "[ndash ]"--=en dash-->
-<!ENTITY dash SDATA "[dash ]"--=hyphen (true graphic)-->
-<!ENTITY blank SDATA "[blank ]"--=significant blank symbol-->
-<!ENTITY hellip SDATA "[hellip]"--=ellipsis (horizontal)-->
-<!ENTITY nldr SDATA "[nldr ]"--=double baseline dot (en leader)-->
-<!ENTITY frac13 SDATA "[frac13]"--=fraction one-third-->
-<!ENTITY frac23 SDATA "[frac23]"--=fraction two-thirds-->
-<!ENTITY frac15 SDATA "[frac15]"--=fraction one-fifth-->
-<!ENTITY frac25 SDATA "[frac25]"--=fraction two-fifths-->
-<!ENTITY frac35 SDATA "[frac35]"--=fraction three-fifths-->
-<!ENTITY frac45 SDATA "[frac45]"--=fraction four-fifths-->
-<!ENTITY frac16 SDATA "[frac16]"--=fraction one-sixth-->
-<!ENTITY frac56 SDATA "[frac56]"--=fraction five-sixths-->
-<!ENTITY incare SDATA "[incare]"--=in-care-of symbol-->
-<!ENTITY block SDATA "[block ]"--=full block-->
-<!ENTITY uhblk SDATA "[uhblk ]"--=upper half block-->
-<!ENTITY lhblk SDATA "[lhblk ]"--=lower half block-->
-<!ENTITY blk14 SDATA "[blk14 ]"--=25% shaded block-->
-<!ENTITY blk12 SDATA "[blk12 ]"--=50% shaded block-->
-<!ENTITY blk34 SDATA "[blk34 ]"--=75% shaded block-->
-<!ENTITY marker SDATA "[marker]"--=histogram marker-->
-<!ENTITY cir SDATA "[cir ]"--/circ B: =circle, open-->
-<!ENTITY squ SDATA "[squ ]"--=square, open-->
-<!ENTITY rect SDATA "[rect ]"--=rectangle, open-->
-<!ENTITY utri SDATA "[utri ]"--/triangle =up triangle, open-->
-<!ENTITY dtri SDATA "[dtri ]"--/triangledown =down triangle, open-->
-<!ENTITY star SDATA "[star ]"--=star, open-->
-<!ENTITY bull SDATA "[bull ]"--/bullet B: =round bullet, filled-->
-<!ENTITY squf SDATA "[squf ]"--/blacksquare =sq bullet, filled-->
-<!ENTITY utrif SDATA "[utrif ]"--/blacktriangle =up tri, filled-->
-<!ENTITY dtrif SDATA "[dtrif ]"--/blacktriangledown =dn tri, filled-->
-<!ENTITY ltrif SDATA "[ltrif ]"--/blacktriangleleft R: =l tri, filled-->
-<!ENTITY rtrif SDATA "[rtrif ]"--/blacktriangleright R: =r tri, filled-->
-<!ENTITY clubs SDATA "[clubs ]"--/clubsuit =club suit symbol-->
-<!ENTITY diams SDATA "[diams ]"--/diamondsuit =diamond suit symbol-->
-<!ENTITY hearts SDATA "[hearts]"--/heartsuit =heart suit symbol-->
-<!ENTITY spades SDATA "[spades]"--/spadesuit =spades suit symbol-->
-<!ENTITY malt SDATA "[malt ]"--/maltese =maltese cross-->
-<!ENTITY dagger SDATA "[dagger]"--/dagger B: =dagger-->
-<!ENTITY Dagger SDATA "[Dagger]"--/ddagger B: =double dagger-->
-<!ENTITY check SDATA "[check ]"--/checkmark =tick, check mark-->
-<!ENTITY cross SDATA "[ballot]"--=ballot cross-->
-<!ENTITY sharp SDATA "[sharp ]"--/sharp =musical sharp-->
-<!ENTITY flat SDATA "[flat ]"--/flat =musical flat-->
-<!ENTITY male SDATA "[male ]"--=male symbol-->
-<!ENTITY female SDATA "[female]"--=female symbol-->
-<!ENTITY phone SDATA "[phone ]"--=telephone symbol-->
-<!ENTITY telrec SDATA "[telrec]"--=telephone recorder symbol-->
-<!ENTITY copysr SDATA "[copysr]"--=sound recording copyright sign-->
-<!ENTITY caret SDATA "[caret ]"--=caret (insertion mark)-->
-<!ENTITY lsquor SDATA "[lsquor]"--=rising single quote, left (low)-->
-<!ENTITY ldquor SDATA "[ldquor]"--=rising dbl quote, left (low)-->
-
-<!ENTITY fflig SDATA "[fflig ]"--small ff ligature-->
-<!ENTITY filig SDATA "[filig ]"--small fi ligature-->
-<!ENTITY fjlig SDATA "[fjlig ]"--small fj ligature-->
-<!ENTITY ffilig SDATA "[ffilig]"--small ffi ligature-->
-<!ENTITY ffllig SDATA "[ffllig]"--small ffl ligature-->
-<!ENTITY fllig SDATA "[fllig ]"--small fl ligature-->
-
-<!ENTITY mldr SDATA "[mldr ]"--em leader-->
-<!ENTITY rdquor SDATA "[rdquor]"--rising dbl quote, right (high)-->
-<!ENTITY rsquor SDATA "[rsquor]"--rising single quote, right (high)-->
-<!ENTITY vellip SDATA "[vellip]"--vertical ellipsis-->
-
-<!ENTITY hybull SDATA "[hybull]"--rectangle, filled (hyphen bullet)-->
-<!ENTITY loz SDATA "[loz ]"--/lozenge - lozenge or total mark-->
-<!ENTITY lozf SDATA "[lozf ]"--/blacklozenge - lozenge, filled-->
-<!ENTITY ltri SDATA "[ltri ]"--/triangleleft B: l triangle, open-->
-<!ENTITY rtri SDATA "[rtri ]"--/triangleright B: r triangle, open-->
-<!ENTITY starf SDATA "[starf ]"--/bigstar - star, filled-->
-
-<!ENTITY natur SDATA "[natur ]"--/natural - music natural-->
-<!ENTITY rx SDATA "[rx ]"--pharmaceutical prescription (Rx)-->
-<!ENTITY sext SDATA "[sext ]"--sextile (6-pointed star)-->
-
-<!ENTITY target SDATA "[target]"--register mark or target-->
-<!ENTITY dlcrop SDATA "[dlcrop]"--downward left crop mark -->
-<!ENTITY drcrop SDATA "[drcrop]"--downward right crop mark -->
-<!ENTITY ulcrop SDATA "[ulcrop]"--upward left crop mark -->
-<!ENTITY urcrop SDATA "[urcrop]"--upward right crop mark -->
diff --git a/share/sgml/ISO/ISOtech b/share/sgml/ISO/ISOtech
deleted file mode 100644
index cbda344..0000000
--- a/share/sgml/ISO/ISOtech
+++ /dev/null
@@ -1,73 +0,0 @@
-<!-- (C) International Organization for Standardization 1986
- Permission to copy in any form is granted for use with
- conforming SGML systems and applications as defined in
- ISO 8879, provided this notice is included in all copies.
--->
-<!-- Character entity set. Typical invocation:
- <!ENTITY % ISOtech PUBLIC
- "ISO 8879:1986//ENTITIES General Technical//EN">
- %ISOtech;
--->
-<!ENTITY aleph SDATA "[aleph ]"--/aleph =aleph, Hebrew-->
-<!ENTITY and SDATA "[and ]"--/wedge /land B: =logical and-->
-<!ENTITY ang90 SDATA "[ang90 ]"--=right (90 degree) angle-->
-<!ENTITY angsph SDATA "[angsph]"--/sphericalangle =angle-spherical-->
-<!ENTITY ap SDATA "[ap ]"--/approx R: =approximate-->
-<!ENTITY becaus SDATA "[becaus]"--/because R: =because-->
-<!ENTITY bottom SDATA "[bottom]"--/bot B: =perpendicular-->
-<!ENTITY cap SDATA "[cap ]"--/cap B: =intersection-->
-<!ENTITY cong SDATA "[cong ]"--/cong R: =congruent with-->
-<!ENTITY conint SDATA "[conint]"--/oint L: =contour integral operator-->
-<!ENTITY cup SDATA "[cup ]"--/cup B: =union or logical sum-->
-<!ENTITY equiv SDATA "[equiv ]"--/equiv R: =identical with-->
-<!ENTITY exist SDATA "[exist ]"--/exists =at least one exists-->
-<!ENTITY forall SDATA "[forall]"--/forall =for all-->
-<!ENTITY fnof SDATA "[fnof ]"--=function of (italic small f)-->
-<!ENTITY ge SDATA "[ge ]"--/geq /ge R: =greater-than-or-equal-->
-<!ENTITY iff SDATA "[iff ]"--/iff =if and only if-->
-<!ENTITY infin SDATA "[infin ]"--/infty =infinity-->
-<!ENTITY int SDATA "[int ]"--/int L: =integral operator-->
-<!ENTITY isin SDATA "[isin ]"--/in R: =set membership-->
-<!ENTITY lang SDATA "[lang ]"--/langle O: =left angle bracket-->
-<!ENTITY lArr SDATA "[lArr ]"--/Leftarrow A: =is implied by-->
-<!ENTITY le SDATA "[le ]"--/leq /le R: =less-than-or-equal-->
-<!ENTITY minus SDATA "[minus ]"--B: =minus sign-->
-<!ENTITY mnplus SDATA "[mnplus]"--/mp B: =minus-or-plus sign-->
-<!ENTITY nabla SDATA "[nabla ]"--/nabla =del, Hamilton operator-->
-<!ENTITY ne SDATA "[ne ]"--/ne /neq R: =not equal-->
-<!ENTITY ni SDATA "[ni ]"--/ni /owns R: =contains-->
-<!ENTITY or SDATA "[or ]"--/vee /lor B: =logical or-->
-<!ENTITY par SDATA "[par ]"--/parallel R: =parallel-->
-<!ENTITY part SDATA "[part ]"--/partial =partial differential-->
-<!ENTITY permil SDATA "[permil]"--=per thousand-->
-<!ENTITY perp SDATA "[perp ]"--/perp R: =perpendicular-->
-<!ENTITY prime SDATA "[prime ]"--/prime =prime or minute-->
-<!ENTITY Prime SDATA "[Prime ]"--=double prime or second-->
-<!ENTITY prop SDATA "[prop ]"--/propto R: =is proportional to-->
-<!ENTITY radic SDATA "[radic ]"--/surd =radical-->
-<!ENTITY rang SDATA "[rang ]"--/rangle C: =right angle bracket-->
-<!ENTITY rArr SDATA "[rArr ]"--/Rightarrow A: =implies-->
-<!ENTITY sim SDATA "[sim ]"--/sim R: =similar-->
-<!ENTITY sime SDATA "[sime ]"--/simeq R: =similar, equals-->
-<!ENTITY square SDATA "[square]"--/square B: =square-->
-<!ENTITY sub SDATA "[sub ]"--/subset R: =subset or is implied by-->
-<!ENTITY sube SDATA "[sube ]"--/subseteq R: =subset, equals-->
-<!ENTITY sup SDATA "[sup ]"--/supset R: =superset or implies-->
-<!ENTITY supe SDATA "[supe ]"--/supseteq R: =superset, equals-->
-<!ENTITY there4 SDATA "[there4]"--/therefore R: =therefore-->
-<!ENTITY Verbar SDATA "[Verbar]"--/Vert =dbl vertical bar-->
-
-<!ENTITY angst SDATA "[angst ]"--Angstrom =capital A, ring-->
-<!ENTITY bernou SDATA "[bernou]"--Bernoulli function (script capital B)-->
-<!ENTITY compfn SDATA "[compfn]"--B: composite function (small circle)-->
-<!ENTITY Dot SDATA "[Dot ]"--=dieresis or umlaut mark-->
-<!ENTITY DotDot SDATA "[DotDot]"--four dots above-->
-<!ENTITY hamilt SDATA "[hamilt]"--Hamiltonian (script capital H)-->
-<!ENTITY lagran SDATA "[lagran]"--Lagrangian (script capital L)-->
-<!ENTITY lowast SDATA "[lowast]"--low asterisk-->
-<!ENTITY notin SDATA "[notin ]"--N: negated set membership-->
-<!ENTITY order SDATA "[order ]"--order of (script small o)-->
-<!ENTITY phmmat SDATA "[phmmat]"--physics M-matrix (script capital M)-->
-<!ENTITY tdot SDATA "[tdot ]"--three dots above-->
-<!ENTITY tprime SDATA "[tprime]"--triple prime-->
-<!ENTITY wedgeq SDATA "[wedgeq]"--R: corresponds to (wedge, equals)-->
diff --git a/share/sgml/ISO/Makefile b/share/sgml/ISO/Makefile
deleted file mode 100644
index b3b294a..0000000
--- a/share/sgml/ISO/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $Id$
-
-FILES= ISOamsa ISOamsb ISOamsc ISOamsn ISOamso ISOamsr
-FILES+= ISObox ISOcyr1 ISOcyr2 ISOdia ISOgrk1 ISOgrk2 ISOgrk3
-FILES+= ISOgrk4 ISOlat1 ISOlat2 ISOnum ISOpub ISOtech
-NOOBJ= noobj
-
-all clean cleandir depend lint tags:
-
-afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
- ${DESTDIR}${BINDIR}/${.CURDIR:T}
-
-.include <bsd.prog.mk>
-
diff --git a/share/sgml/Makefile b/share/sgml/Makefile
deleted file mode 100644
index c3d0d17..0000000
--- a/share/sgml/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# $Id$
-
-SUBDIR= FreeBSD ISO docbook transpec
-FILES= CATALOG
-MAINTAINER=jfieber@freebsd.org
-
-BINDIR?=/usr/share
-DISTRIBUTION?= bin
-
-afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
- ${DESTDIR}${BINDIR}/${.CURDIR:T}
-
-afterdistribute:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
- ${DISTDIR}/${DISTRIBUTION}${BINDIR}/${.CURDIR:T}
-
-.include <bsd.subdir.mk>
diff --git a/share/sgml/Makefile.inc b/share/sgml/Makefile.inc
deleted file mode 100644
index 5362afa..0000000
--- a/share/sgml/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id$
-
-BINDIR?= /usr/share/sgml
diff --git a/share/sgml/docbook/Makefile b/share/sgml/docbook/Makefile
deleted file mode 100644
index 7eb4d9d..0000000
--- a/share/sgml/docbook/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $Id$
-
-FILES= cals-tbl.dtd dbgenent.mod dbhier.mod dbpool.mod
-FILES+= docbook.dcl docbook.dtd
-NOOBJ= noobj
-
-all clean cleandir depend lint tags:
-
-afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
- ${DESTDIR}${BINDIR}/${.CURDIR:T}
-
-.include <bsd.prog.mk>
-
-
diff --git a/share/sgml/docbook/cals-tbl.dtd b/share/sgml/docbook/cals-tbl.dtd
deleted file mode 100644
index 4ff4e68..0000000
--- a/share/sgml/docbook/cals-tbl.dtd
+++ /dev/null
@@ -1,331 +0,0 @@
-<!-- CALS TABLE MODEL DECLARATION MODULE -->
-
-<!-- This set of declarations defines the CALS Table Model as of the
- date shown in the Formal Public Identifier (FPI) for this entity.
-
- This set of declarations may be referred to using a public external
- entity declaration and reference as shown in the following two lines:
-
-<!ENTITY % calstbls PUBLIC "-//USA-DOD//DTD Table Model 951010//EN">
-%calstbls;
-
- If various parameter entities used within this set of declarations
- are to be given non-default values, the appropriate declarations
- should be given before calling in this package (i.e., before the
- "%calstbls;" reference).
-
- NOTE: This set of declarations assumes a NAMELEN of 32 as is used in
- the standard CALS defined SGML declaration.
--->
-
-<!-- This entity includes a set of element and attribute declarations
- that partially defines the CALS table model. However, the model
- is not well-defined without the accompanying natural language
- description of the semantics (meanings) of these various elements,
- attributes, and attribute values. The semantic writeup, available
- as a separate entity, should be used in conjunction with this entity.
--->
-
-<!-- In order to use the CALS table model, various parameter entity
- declarations are required. A brief description is as follows:
-
- ENTITY NAME WHERE USED WHAT IT IS
-
- %bodyatt In ATTLIST of: Additional (non-table related)
- table element(s) attributes on the overall
- (wrapper) table element(s)
-
- %secur In ATTLIST of: Additional (non-table related)
- table element(s) attributes on all the listed
- <tgroup> elements
- <tbody>
- table head and foot element(s)
- <row>
- <entrytbl>
- <entry>
-
- %yesorno In ATTLIST of: An attribute declared value
- almost all elements for a "boolean" attribute
-
- %titles In content model of: The "title" part of the model
- table element(s) group for the table element(s)
-
- %paracon In content model of: The "text" (data content) part
- <entry> of the model group for <entry>
-
- %tbl.table.name In declaration of: The name(s) of the "table"
- table element(s) element(s)
-
- %tbl.table-titles.mdl In content model of: The model group for the title
- table elements(s) part of the content model for
- table element(s)
-
- %tbl.table-main.mdl In content model of: The model group for the main part
- table elements(s) (not including titles) of the
- content model for table element(s)
-
- %tbl.table.mdl In content model of: The model group for the content
- table elements(s) model for table element(s),
- often (and by default) defined
- in terms of %tbl.table-titles.mdl
- and %tbl.table-main.mdl
-
- %tbl.table.excep In content model of: The exceptions for the content
- table element(s) model for table element(s)
-
- %tbl.table.att In ATTLIST of: Additional attributes on the
- table element(s) table element(s)
-
- %tbl.tgroup.mdl In content model of: The model group for the content
- <tgroup> model for <tgroup>
-
- %tbl.tgroup.att In ATTLIST of: Additional attributes on the
- <tgroup> <tgroup> and <entrytbl> elements
- <entrytbl>
-
- %tbl.hdft.name In declaration of: The name(s) of the table
- head/foot element(s) head and foot element(s)
-
- %tbl.hdft.mdl In content model of: The model group for the content
- head/foot element(s) model for head/foot element(s)
-
- %tbl.hdft.excep In content model of: The exceptions for the content
- head/foot element(s) model for head/foot element(s)
-
- %tbl.row.mdl In content model of: The model group for the content
- <row> model for <row>
-
- %tbl.row.excep In content model of: The exceptions for the content
- <row> model for <row>
-
- %tbl.entrytbl.mdl In content model of: The model group for the content
- <entrytbl> model for <entrytbl>
-
- %tbl.entrytbl.excep In content model of: The exceptions for the content
- <entrytbl> model for <entrytbl>
-
- %tbl.entry.mdl In content model of: The model group for the content
- <entry> model for <entry>
-
- %tbl.entry.excep In content model of: The exceptions for the content
- <entry> model for <entry>
-
- If any of these parameter entities are not declared before this set of
- declarations is referenced, this set of declarations will make the
- following default definitions for all of these have parameter entities.
--->
-
-<!-- These definitions are not directly related to the table model, but are
- used in the default CALS table model and are usually defined elsewhere
- (and prior to the inclusion of this table module) in a CALS DTD. -->
-
-<!ENTITY % bodyatt "">
-<!ENTITY % secur "">
-<!ENTITY % yesorno 'NUMBER' -- no if zero(s),
- yes if any other digits value -->
-<!ENTITY % titles 'title?'>
-<!ENTITY % paracon '#PCDATA' -- default for use in entry content -->
-
-<!--
-The parameter entities as defined below provide the CALS table model
-as published (as part of the Example DTD) in MIL-HDBK-28001.
-
-These following declarations provide the CALS-compliant default definitions
-for these entities. However, these entities can and should be redefined
-(by giving the appropriate parameter entity declaration(s) prior to the
-reference to this Table Model declaration set entity) to fit the needs
-of the current application.
--->
-
-<!ENTITY % tbl.table.name "(table|chart)">
-<!ENTITY % tbl.table-titles.mdl "%titles,">
-<!ENTITY % tbl.table-main.mdl "(tgroup+|graphic+)">
-<!ENTITY % tbl.table.mdl "%tbl.table-titles.mdl; %tbl.table-main.mdl;">
-<!ENTITY % tbl.table.excep "-(table|chart|figure)">
-<!ENTITY % tbl.table.att '
- tabstyle NMTOKEN #IMPLIED
- tocentry %yesorno; #IMPLIED
- shortentry %yesorno; #IMPLIED
- orient (port|land) #IMPLIED
- pgwide %yesorno; #IMPLIED '>
-<!ENTITY % tbl.tgroup.mdl "colspec*,spanspec*,thead?,tfoot?,tbody">
-<!ENTITY % tbl.tgroup.att '
- tgroupstyle NMTOKEN #IMPLIED '>
-<!ENTITY % tbl.hdft.name "(thead|tfoot)">
-<!ENTITY % tbl.hdft.mdl "colspec*,row+">
-<!ENTITY % tbl.hdft.excep "-(entrytbl)">
-<!ENTITY % tbl.row.mdl "(entry|entrytbl)+">
-<!ENTITY % tbl.row.excep "-(pgbrk)">
-<!ENTITY % tbl.entrytbl.mdl "colspec*,spanspec*,thead?,tbody">
-<!ENTITY % tbl.entrytbl.excep "-(entrytbl|pgbrk)">
-<!ENTITY % tbl.entry.mdl "(para|warning|caution|note|legend|%paracon;)*">
-<!ENTITY % tbl.entry.excep "-(pgbrk)">
-
-<!-- ===== Element and attribute declarations follow. ===== -->
-
-<!--
- Default declarations previously defined in this entity and
- referenced below include:
- ENTITY % tbl.table.name "(table|chart)"
- ENTITY % tbl.table-titles.mdl "%titles,"
- ENTITY % tbl.table-main.mdl "(tgroup+|graphic+)"
- ENTITY % tbl.table.mdl "%tbl.table-titles; %tbl.table-main.mdl;"
- ENTITY % tbl.table.excep "-(table|chart|figure)"
- ENTITY % tbl.table.att '
- tabstyle NMTOKEN #IMPLIED
- tocentry %yesorno; #IMPLIED
- shortentry %yesorno; #IMPLIED
- orient (port|land) #IMPLIED
- pgwide %yesorno; #IMPLIED '
--->
-
-<!ELEMENT %tbl.table.name; - - (%tbl.table.mdl;) %tbl.table.excep; >
-
-<!ATTLIST table
- frame (top|bottom|topbot|all|sides|none) #IMPLIED
- colsep %yesorno; #IMPLIED
- rowsep %yesorno; #IMPLIED
- %tbl.table.att;
- %bodyatt;
- %secur;
->
-
-<!--
- Default declarations previously defined in this entity and
- referenced below include:
- ENTITY % tbl.tgroup.mdl "colspec*,spanspec*,thead?,tfoot?,tbody"
- ENTITY % tbl.tgroup.att '
- tgroupstyle NMTOKEN #IMPLIED '
--->
-
-<!ELEMENT tgroup - O (%tbl.tgroup.mdl;) >
-
-<!ATTLIST tgroup
- cols NUMBER #REQUIRED
- %tbl.tgroup.att;
- colsep %yesorno; #IMPLIED
- rowsep %yesorno; #IMPLIED
- align (left|right|center|justify|char) #IMPLIED
- char CDATA #IMPLIED
- charoff NUTOKEN #IMPLIED
- %secur;
->
-
-<!ELEMENT colspec - O EMPTY >
-
-<!ATTLIST colspec
- colnum NUMBER #IMPLIED
- colname NMTOKEN #IMPLIED
- colwidth CDATA #IMPLIED
- colsep %yesorno; #IMPLIED
- rowsep %yesorno; #IMPLIED
- align (left|right|center|justify|char) #IMPLIED
- char CDATA #IMPLIED
- charoff NUTOKEN #IMPLIED
->
-
-<!ELEMENT spanspec - O EMPTY >
-
-<!ATTLIST spanspec
- namest NMTOKEN #REQUIRED
- nameend NMTOKEN #REQUIRED
- spanname NMTOKEN #REQUIRED
- colsep %yesorno; #IMPLIED
- rowsep %yesorno; #IMPLIED
- align (left|right|center|justify|char) #IMPLIED
- char CDATA #IMPLIED
- charoff NUTOKEN #IMPLIED
->
-
-
-<!--
- Default declarations previously defined in this entity and
- referenced below include:
- ENTITY % tbl.hdft.name "(thead|tfoot)"
- ENTITY % tbl.hdft.mdl "colspec*,row+"
- ENTITY % tbl.hdft.excep "-(entrytbl)"
--->
-
-<!ELEMENT %tbl.hdft.name; - O (%tbl.hdft.mdl;) %tbl.hdft.excep;>
-
-<!ATTLIST %tbl.hdft.name;
- valign (top|middle|bottom) #IMPLIED
- %secur;
->
-
-
-<!ELEMENT tbody - O (row+)>
-
-<!ATTLIST tbody
- valign (top|middle|bottom) #IMPLIED
- %secur;
->
-
-<!--
- Default declarations previously defined in this entity and
- referenced below include:
- ENTITY % tbl.row.mdl "(entry|entrytbl)+"
- ENTITY % tbl.row.excep "-(pgbrk)"
--->
-
-<!ELEMENT row - O (%tbl.row.mdl;) %tbl.row.excep;>
-
-<!ATTLIST row
- rowsep %yesorno; #IMPLIED
- valign (top|middle|bottom) #IMPLIED
- %secur;
->
-
-<!--
- Default declarations previously defined in this entity and
- referenced below include:
- ENTITY % tbl.entrytbl.mdl "colspec*,spanspec*,thead?,tbody"
- ENTITY % tbl.entrytbl.excep "-(entrytbl|pgbrk)"
- ENTITY % tbl.tgroup.att '
- tgroupstyle NMTOKEN #IMPLIED '
--->
-
-<!ELEMENT entrytbl - - (%tbl.entrytbl.mdl) %tbl.entrytbl.excep; >
-
-<!ATTLIST entrytbl
- cols NUMBER #REQUIRED
- %tbl.tgroup.att;
- colname NMTOKEN #IMPLIED
- spanname NMTOKEN #IMPLIED
- namest NMTOKEN #IMPLIED
- nameend NMTOKEN #IMPLIED
- colsep %yesorno; #IMPLIED
- rowsep %yesorno; #IMPLIED
- align (left|right|center|justify|char) #IMPLIED
- char CDATA #IMPLIED
- charoff NUTOKEN #IMPLIED
- %secur;
->
-
-
-<!--
- Default declarations previously defined in this entity and
- referenced below include:
- ENTITY % paracon "#PCDATA"
- ENTITY % tbl.entry.mdl "(para|warning|caution|note|legend|%paracon;)*"
- ENTITY % tbl.entry.excep "-(pgbrk)"
--->
-
-<!ELEMENT entry - O (%tbl.entry.mdl;) %tbl.entry.excep; >
-
-<!ATTLIST entry
- colname NMTOKEN #IMPLIED
- namest NMTOKEN #IMPLIED
- nameend NMTOKEN #IMPLIED
- spanname NMTOKEN #IMPLIED
- morerows NUMBER #IMPLIED
- colsep %yesorno; #IMPLIED
- rowsep %yesorno; #IMPLIED
- align (left|right|center|justify|char) #IMPLIED
- char CDATA #IMPLIED
- charoff NUTOKEN #IMPLIED
- rotate %yesorno; #IMPLIED
- valign (top|middle|bottom) #IMPLIED
- %secur;
->
-
diff --git a/share/sgml/docbook/dbgenent.mod b/share/sgml/docbook/dbgenent.mod
deleted file mode 100644
index 174ddd6..0000000
--- a/share/sgml/docbook/dbgenent.mod
+++ /dev/null
@@ -1,25 +0,0 @@
-<!-- ...................................................................... -->
-<!-- DocBook additional general entities V3.0 ............................. -->
-<!-- File dbgenent.mod .................................................... -->
-
-<!-- You can edit this file to add the following:
-
- o General entity declarations of any kind. For example:
-
- <!ENTITY happyface SDATA "insert-face"> (system-specific data)
- <!ENTITY productname "WinWidget"> (small boilerplate)
- <!ENTITY legal-notice SYSTEM "notice.sgm"> (large boilerplate)
-
- o Notation declarations. For example:
-
- <!NOTATION chicken-scratch SYSTEM>
-
- o Declarations for and references to external parameter entities
- containing collections of any of the above. For example:
-
- <!ENTITY % all-titles PUBLIC "-//DocTools//ELEMENTS Book Titles//EN">
- %all-titles;
--->
-
-<!-- End of DocBook additional general entities V3.0 ...................... -->
-<!-- ...................................................................... -->
diff --git a/share/sgml/docbook/dbhier.mod b/share/sgml/docbook/dbhier.mod
deleted file mode 100644
index 81bee69..0000000
--- a/share/sgml/docbook/dbhier.mod
+++ /dev/null
@@ -1,1149 +0,0 @@
-<!-- ...................................................................... -->
-<!-- DocBook document hierarchy module V3.0 ............................... -->
-<!-- File dbhier.mod ...................................................... -->
-
-<!-- Copyright 1992, 1993, 1994, 1995, 1996 HaL Computer Systems, Inc.,
- O'Reilly & Associates, Inc., ArborText, Inc., and Fujitsu Software
- Corporation.
-
- Permission to use, copy, modify and distribute the DocBook DTD and
- its accompanying documentation for any purpose and without fee is
- hereby granted in perpetuity, provided that the above copyright
- notice and this paragraph appear in all copies. The copyright
- holders make no representation about the suitability of the DTD for
- any purpose. It is provided "as is" without expressed or implied
- warranty.
-
- If you modify the DocBook DTD in any way, except for declaring and
- referencing additional sets of general entities and declaring
- additional notations, label your DTD as a variant of DocBook. See
- the maintenance documentation for more information.
-
- Please direct all questions, bug reports, or suggestions for
- changes to the davenport@online.ora.com mailing list or to one of
- the maintainers:
-
- o Terry Allen, Fujitsu Software Corporation
- 3055 Orchard Drive, San Jose, CA 95134
- <tallen@fsc.fujitsu.com>
-
- o Eve Maler, ArborText Inc.
- 105 Lexington St., Burlington, MA 01803
- <elm@arbortext.com>
--->
-
-<!-- ...................................................................... -->
-
-<!-- This module contains the definitions for the overall document
- hierarchies of DocBook documents. It covers computer documentation
- manuals and manual fragments, as well as reference entries (such as
- man pages) and technical journals or anthologies containing
- articles.
-
- This module depends on the DocBook information pool module. All
- elements and entities referenced but not defined here are assumed
- to be defined in the information pool module.
-
- In DTD driver files referring to this module, please use an entity
- declaration that uses the public identifier shown below:
-
- <!ENTITY % dbhier PUBLIC
- "-//Davenport//ELEMENTS DocBook Document Hierarchy V3.0//EN">
- %dbhier;
-
- See the documentation for detailed information on the parameter
- entity and module scheme used in DocBook, customizing DocBook and
- planning for interchange, and changes made since the last release
- of DocBook.
--->
-
-<!-- ...................................................................... -->
-<!-- Entities for module inclusions ....................................... -->
-
-<!ENTITY % dbhier.redecl.module "IGNORE">
-<!ENTITY % dbhier.redecl2.module "IGNORE">
-
-<!-- ...................................................................... -->
-<!-- Entities for element classes ......................................... -->
-
-<!ENTITY % local.appendix.class "">
-<!ENTITY % appendix.class "Appendix %local.appendix.class;">
-
-<!ENTITY % local.article.class "">
-<!ENTITY % article.class "Article %local.article.class">
-
-<!ENTITY % local.book.class "">
-<!ENTITY % book.class "Book %local.book.class;">
-
-<!ENTITY % local.chapter.class "">
-<!ENTITY % chapter.class "Chapter %local.chapter.class;">
-
-<!ENTITY % local.index.class "">
-<!ENTITY % index.class "Index|SetIndex %local.index.class;">
-
-<!-- SetInfo and BookInfo are not included in otherinfo.class because
-they have different attribute lists. -->
-<!ENTITY % local.otherinfo.class "">
-<!--FUTURE USE (V4.0):
-......................
-The DocInfo element will be split out into ChapterInfo, AppendixInfo,
-etc.
-......................
--->
-<!ENTITY % otherinfo.class "DocInfo|Sect1Info|Sect2Info|Sect3Info
- |Sect4Info|Sect5Info|RefSect1Info
- |RefSect2Info|RefSect3Info|RefSynopsisDivInfo
- %local.otherinfo.class;">
-
-<!ENTITY % local.refentry.class "">
-<!ENTITY % refentry.class "RefEntry %local.refentry.class;">
-
-<!ENTITY % local.nav.class "">
-<!ENTITY % nav.class "ToC|LoT|Index|Glossary|Bibliography
- %local.nav.class;">
-
-<!-- Redeclaration placeholder ............................................ -->
-
-<!-- For redeclaring entities that are declared after this point while
- retaining their references to the entities that are declared before
- this point -->
-
-<![ %dbhier.redecl.module; [
-%rdbhier;
-<!--end of dbhier.redecl.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Entities for element mixtures ........................................ -->
-
-<!ENTITY % local.divcomponent.mix "">
-<!ENTITY % divcomponent.mix
- "%list.class; |%admon.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- |%formal.class; |%compound.class;
- |%genobj.class; |%descobj.class;
- %local.divcomponent.mix;">
-
-<!ENTITY % local.refcomponent.mix "">
-<!ENTITY % refcomponent.mix
- "%list.class; |%admon.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- |%formal.class; |%compound.class;
- |%genobj.class; |%descobj.class;
- %local.refcomponent.mix;">
-
-<!ENTITY % local.indexdivcomponent.mix "">
-<!ENTITY % indexdivcomponent.mix
- "ItemizedList|OrderedList|VariableList|SimpleList
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- |Anchor|Comment
- |%link.char.class;
- %local.indexdivcomponent.mix;">
-
-<!ENTITY % local.refname.char.mix "">
-<!ENTITY % refname.char.mix
- "#PCDATA
- |%tech.char.class;
- %local.refname.char.mix;">
-
-<!ENTITY % local.partcontent.mix "">
-<!ENTITY % partcontent.mix
- "%appendix.class;|%chapter.class;|%nav.class;|%article.class;
- |Preface|%refentry.class;|Reference %local.partcontent.mix;">
-
-<!ENTITY % local.refinline.char.mix "">
-<!ENTITY % refinline.char.mix
- "#PCDATA
- |%xref.char.class; |%gen.char.class;
- |%link.char.class; |%tech.char.class;
- |%base.char.class; |%docinfo.char.class;
- |%other.char.class;
- %local.refinline.char.mix;">
-
-<!ENTITY % local.refclass.char.mix "">
-<!ENTITY % refclass.char.mix
- "#PCDATA
- |Application
- %local.refclass.char.mix;">
-
-<!ENTITY % local.setinfo.char.mix "">
-<!ENTITY % setinfo.char.mix
- "#PCDATA
- |%docinfo.char.class;|Title|Copyright|CorpName
- |Date|Editor|Edition|InvPartNumber|ISBN
- |LegalNotice|OrgName|PrintHistory|Publisher
- |PubsNumber|ReleaseInfo|Subtitle|VolumeNum
- %local.setinfo.char.mix;">
-
-<!-- Redeclaration placeholder 2 .......................................... -->
-
-<!-- For redeclaring entities that are declared after this point while
- retaining their references to the entities that are declared before
- this point -->
-
-<![ %dbhier.redecl2.module; [
-%rdbhier2;
-<!--end of dbhier.redecl2.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Entities for content models .......................................... -->
-
-<!ENTITY % div.title.content
- "Title, TitleAbbrev?">
-
-<!--FUTURE USE (V4.0):
-......................
-The DocInfo element will be split out into ChapterInfo, AppendixInfo,
-etc.
-......................
--->
-<!ENTITY % bookcomponent.title.content
- "DocInfo?, Title, TitleAbbrev?">
-
-<!ENTITY % sect.title.content
- "Title, TitleAbbrev?">
-
-<!ENTITY % refsect.title.content
- "Title, TitleAbbrev?">
-
-<!ENTITY % bookcomponent.content
- "((%divcomponent.mix;)+,
- (Sect1*|(%refentry.class;)*|SimpleSect*))
- | (Sect1+|(%refentry.class;)+|SimpleSect+)">
-
-<!-- ...................................................................... -->
-<!-- Set and SetInfo ...................................................... -->
-
-<!ENTITY % set.content.module "INCLUDE">
-<![ %set.content.module; [
-<!ENTITY % set.module "INCLUDE">
-<![ %set.module; [
-<!ENTITY % local.set.attrib "">
-<!ENTITY % set.role.attrib "%role.attrib;">
-<!ELEMENT Set - O ((%div.title.content;)?, SetInfo?, ToC?, (%book.class;),
- (%book.class;)+, SetIndex?) +(%ubiq.mix;)>
-<!ATTLIST Set
- --
- FPI: SGML formal public identifier
- --
- FPI CDATA #IMPLIED
- %status.attrib;
- %common.attrib;
- %set.role.attrib;
- %local.set.attrib;
->
-<!--end of set.module-->]]>
-
-<!ENTITY % setinfo.module "INCLUDE">
-<![ %setinfo.module; [
-<!ENTITY % local.setinfo.attrib "">
-<!ENTITY % setinfo.role.attrib "%role.attrib;">
-<!ELEMENT SetInfo - - ((Graphic | LegalNotice | ModeSpec | SubjectSet
- | KeywordSet | ITermSet | %bibliocomponent.mix;)+) -(BeginPage)>
-<!ATTLIST SetInfo
- --
- Contents: IDs of the ToC, Books, and SetIndex that comprise
- the set, in the order of their appearance
- --
- Contents IDREFS #IMPLIED
- %common.attrib;
- %setinfo.role.attrib;
- %local.setinfo.attrib;
->
-<!--end of setinfo.module-->]]>
-<!--end of set.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Book and BookInfo .................................................... -->
-
-<!ENTITY % book.content.module "INCLUDE">
-<![ %book.content.module; [
-<!ENTITY % book.module "INCLUDE">
-<![ %book.module; [
-<!--FUTURE USE (V4.0):
-......................
-The %article.class; entity *may* be removed from the Book content model.
-(Article may be made part of a new top-level document hierarchy.)
-......................
--->
-
-<!ENTITY % local.book.attrib "">
-<!ENTITY % book.role.attrib "%role.attrib;">
-<!ELEMENT Book - O ((%div.title.content;)?, BookInfo?, Dedication?, ToC?, LoT*,
- (Glossary|Bibliography|Preface)*,
- (((%chapter.class;)+, Reference*) | Part+
- | Reference+ | (%article.class;)+),
- (%appendix.class;)*, (Glossary|Bibliography)*,
- (%index.class;)*, LoT*, ToC?)
- +(%ubiq.mix;)>
-<!ATTLIST Book
- --
- FPI: SGML formal public identifier
- --
- FPI CDATA #IMPLIED
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %book.role.attrib;
- %local.book.attrib;
->
-<!--end of book.module-->]]>
-
-<!ENTITY % bookinfo.module "INCLUDE">
-<![ %bookinfo.module; [
-<!--FUTURE USE (V4.0):
-......................
-BookBiblio will be discarded.
-......................
--->
-<!ENTITY % local.bookinfo.attrib "">
-<!ENTITY % bookinfo.role.attrib "%role.attrib;">
-<!ELEMENT BookInfo - - ((Graphic | LegalNotice | ModeSpec | SubjectSet
- | KeywordSet | ITermSet | %bibliocomponent.mix; | BookBiblio)+)
- -(BeginPage)>
-<!ATTLIST BookInfo
- --
- Contents: IDs of the ToC, LoTs, Prefaces, Parts, Chapters,
- Appendixes, References, GLossary, Bibliography, and indexes
- comprising the Book, in the order of their appearance
- --
- Contents IDREFS #IMPLIED
- %common.attrib;
- %bookinfo.role.attrib;
- %local.bookinfo.attrib;
->
-<!--end of bookinfo.module-->]]>
-<!--end of book.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Dedication, ToC, and LoT ............................................. -->
-
-<!ENTITY % dedication.module "INCLUDE">
-<![ %dedication.module; [
-<!ENTITY % local.dedication.attrib "">
-<!ENTITY % dedication.role.attrib "%role.attrib;">
-<!ELEMENT Dedication - O ((%sect.title.content;)?, (%legalnotice.mix;)+)>
-<!ATTLIST Dedication
- %status.attrib;
- %common.attrib;
- %dedication.role.attrib;
- %local.dedication.attrib;
->
-<!--end of dedication.module-->]]>
-
-<!ENTITY % toc.content.module "INCLUDE">
-<![ %toc.content.module; [
-<!ENTITY % toc.module "INCLUDE">
-<![ %toc.module; [
-<!ENTITY % local.toc.attrib "">
-<!ENTITY % toc.role.attrib "%role.attrib;">
-<!ELEMENT ToC - O ((%bookcomponent.title.content;)?, ToCfront*,
- (ToCpart | ToCchap)*, ToCback*)>
-<!ATTLIST ToC
- %pagenum.attrib;
- %common.attrib;
- %toc.role.attrib;
- %local.toc.attrib;
->
-<!--end of toc.module-->]]>
-
-<!ENTITY % tocfront.module "INCLUDE">
-<![ %tocfront.module; [
-<!ENTITY % local.tocfront.attrib "">
-<!ENTITY % tocfront.role.attrib "%role.attrib;">
-<!ELEMENT ToCfront - O ((%para.char.mix;)+)>
-<!ATTLIST ToCfront
- %label.attrib;
- %linkend.attrib; --to element that this entry represents--
- %pagenum.attrib;
- %common.attrib;
- %tocfront.role.attrib;
- %local.tocfront.attrib;
->
-<!--end of tocfront.module-->]]>
-
-<!ENTITY % tocentry.module "INCLUDE">
-<![ %tocentry.module; [
-<!ENTITY % local.tocentry.attrib "">
-<!ENTITY % tocentry.role.attrib "%role.attrib;">
-<!ELEMENT ToCentry - - ((%para.char.mix;)+)>
-<!ATTLIST ToCentry
- %linkend.attrib; --to element that this entry represents--
- %pagenum.attrib;
- %common.attrib;
- %tocentry.role.attrib;
- %local.tocentry.attrib;
->
-<!--end of tocentry.module-->]]>
-
-<!ENTITY % tocpart.module "INCLUDE">
-<![ %tocpart.module; [
-<!ENTITY % local.tocpart.attrib "">
-<!ENTITY % tocpart.role.attrib "%role.attrib;">
-<!ELEMENT ToCpart - O (ToCentry+, ToCchap*)>
-<!ATTLIST ToCpart
- %common.attrib;
- %tocpart.role.attrib;
- %local.tocpart.attrib;
->
-<!--end of tocpart.module-->]]>
-
-<!ENTITY % tocchap.module "INCLUDE">
-<![ %tocchap.module; [
-<!ENTITY % local.tocchap.attrib "">
-<!ENTITY % tocchap.role.attrib "%role.attrib;">
-<!ELEMENT ToCchap - O (ToCentry+, ToClevel1*)>
-<!ATTLIST ToCchap
- %label.attrib;
- %common.attrib;
- %tocchap.role.attrib;
- %local.tocchap.attrib;
->
-<!--end of tocchap.module-->]]>
-
-<!ENTITY % toclevel1.module "INCLUDE">
-<![ %toclevel1.module; [
-<!ENTITY % local.toclevel1.attrib "">
-<!ENTITY % toclevel1.role.attrib "%role.attrib;">
-<!ELEMENT ToClevel1 - O (ToCentry+, ToClevel2*)>
-<!ATTLIST ToClevel1
- %common.attrib;
- %toclevel1.role.attrib;
- %local.toclevel1.attrib;
->
-<!--end of toclevel1.module-->]]>
-
-<!ENTITY % toclevel2.module "INCLUDE">
-<![ %toclevel2.module; [
-<!ENTITY % local.toclevel2.attrib "">
-<!ENTITY % toclevel2.role.attrib "%role.attrib;">
-<!ELEMENT ToClevel2 - O (ToCentry+, ToClevel3*)>
-<!ATTLIST ToClevel2
- %common.attrib;
- %toclevel2.role.attrib;
- %local.toclevel2.attrib;
->
-<!--end of toclevel2.module-->]]>
-
-<!ENTITY % toclevel3.module "INCLUDE">
-<![ %toclevel3.module; [
-<!ENTITY % local.toclevel3.attrib "">
-<!ENTITY % toclevel3.role.attrib "%role.attrib;">
-<!ELEMENT ToClevel3 - O (ToCentry+, ToClevel4*)>
-<!ATTLIST ToClevel3
- %common.attrib;
- %toclevel3.role.attrib;
- %local.toclevel3.attrib;
->
-<!--end of toclevel3.module-->]]>
-
-<!ENTITY % toclevel4.module "INCLUDE">
-<![ %toclevel4.module; [
-<!ENTITY % local.toclevel4.attrib "">
-<!ENTITY % toclevel4.role.attrib "%role.attrib;">
-<!ELEMENT ToClevel4 - O (ToCentry+, ToClevel5*)>
-<!ATTLIST ToClevel4
- %common.attrib;
- %toclevel4.role.attrib;
- %local.toclevel4.attrib;
->
-<!--end of toclevel4.module-->]]>
-
-<!ENTITY % toclevel5.module "INCLUDE">
-<![ %toclevel5.module; [
-<!ENTITY % local.toclevel5.attrib "">
-<!ENTITY % toclevel5.role.attrib "%role.attrib;">
-<!ELEMENT ToClevel5 - O (ToCentry+)>
-<!ATTLIST ToClevel5
- %common.attrib;
- %toclevel5.role.attrib;
- %local.toclevel5.attrib;
->
-<!--end of toclevel5.module-->]]>
-
-<!ENTITY % tocback.module "INCLUDE">
-<![ %tocback.module; [
-<!ENTITY % local.tocback.attrib "">
-<!ENTITY % tocback.role.attrib "%role.attrib;">
-<!ELEMENT ToCback - O ((%para.char.mix;)+)>
-<!ATTLIST ToCback
- %label.attrib;
- %linkend.attrib; --to element that this entry represents--
- %pagenum.attrib;
- %common.attrib;
- %tocback.role.attrib;
- %local.tocback.attrib;
->
-<!--end of tocback.module-->]]>
-<!--end of toc.content.module-->]]>
-
-<!ENTITY % lot.content.module "INCLUDE">
-<![ %lot.content.module; [
-<!ENTITY % lot.module "INCLUDE">
-<![ %lot.module; [
-<!ENTITY % local.lot.attrib "">
-<!ENTITY % lot.role.attrib "%role.attrib;">
-<!ELEMENT LoT - O ((%bookcomponent.title.content;)?, LoTentry*)>
-<!ATTLIST LoT
- %label.attrib;
- %common.attrib;
- %lot.role.attrib;
- %local.lot.attrib;
->
-<!--end of lot.module-->]]>
-
-<!ENTITY % lotentry.module "INCLUDE">
-<![ %lotentry.module; [
-<!ENTITY % local.lotentry.attrib "">
-<!ENTITY % lotentry.role.attrib "%role.attrib;">
-<!ELEMENT LoTentry - - ((%para.char.mix;)+ )>
-<!ATTLIST LoTentry
- --
- SrcCredit: Information about the source of the entry,
- as for a list of illustrations
- --
- SrcCredit CDATA #IMPLIED
- %pagenum.attrib;
- %common.attrib;
- %lotentry.role.attrib;
- %local.lotentry.attrib;
->
-<!--end of lotentry.module-->]]>
-<!--end of lot.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Appendix, Chapter, Part, Preface, Reference, PartIntro ............... -->
-
-<!ENTITY % appendix.module "INCLUDE">
-<![ %appendix.module; [
-<!ENTITY % local.appendix.attrib "">
-<!ENTITY % appendix.role.attrib "%role.attrib;">
-<!ELEMENT Appendix - O ((%bookcomponent.title.content;), ToCchap?,
- (%bookcomponent.content;)) +(%ubiq.mix;)>
-<!ATTLIST Appendix
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %appendix.role.attrib;
- %local.appendix.attrib;
->
-<!--end of appendix.module-->]]>
-
-<!ENTITY % chapter.module "INCLUDE">
-<![ %chapter.module; [
-<!ENTITY % local.chapter.attrib "">
-<!ENTITY % chapter.role.attrib "%role.attrib;">
-<!ELEMENT Chapter - O ((%bookcomponent.title.content;), ToCchap?,
- (%bookcomponent.content;), (Index | Glossary | Bibliography)*)
- +(%ubiq.mix;)>
-<!ATTLIST Chapter
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %chapter.role.attrib;
- %local.chapter.attrib;
->
-<!--end of chapter.module-->]]>
-
-<!ENTITY % part.module "INCLUDE">
-<![ %part.module; [
-
-<!-- Note that Part was to have its content model reduced in V4.0. This
-change will not be made after all. -->
-
-<!ENTITY % local.part.attrib "">
-<!ENTITY % part.role.attrib "%role.attrib;">
-<!ELEMENT Part - - ((%bookcomponent.title.content;), PartIntro?,
- (%partcontent.mix;)+) +(%ubiq.mix;)>
-<!ATTLIST Part
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %part.role.attrib;
- %local.part.attrib;
->
-<!--ELEMENT PartIntro (defined below)-->
-<!--end of part.module-->]]>
-
-<!ENTITY % preface.module "INCLUDE">
-<![ %preface.module; [
-<!ENTITY % local.preface.attrib "">
-<!ENTITY % preface.role.attrib "%role.attrib;">
-<!ELEMENT Preface - O ((%bookcomponent.title.content;),
- (%bookcomponent.content;)) +(%ubiq.mix;)>
-<!ATTLIST Preface
- %status.attrib;
- %common.attrib;
- %preface.role.attrib;
- %local.preface.attrib;
->
-<!--end of preface.module-->]]>
-
-<!ENTITY % reference.module "INCLUDE">
-<![ %reference.module; [
-<!ENTITY % local.reference.attrib "">
-<!ENTITY % reference.role.attrib "%role.attrib;">
-<!ELEMENT Reference - O ((%bookcomponent.title.content;), PartIntro?,
- (%refentry.class;)+) +(%ubiq.mix;)>
-<!ATTLIST Reference
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %reference.role.attrib;
- %local.reference.attrib;
->
-<!--ELEMENT PartIntro (defined below)-->
-<!--end of reference.module-->]]>
-
-<!ENTITY % partintro.module "INCLUDE">
-<![ %partintro.module; [
-<!ENTITY % local.partintro.attrib "">
-<!ENTITY % partintro.role.attrib "%role.attrib;">
-<!ELEMENT PartIntro - O ((%div.title.content;)?, (%bookcomponent.content;))
- +(%ubiq.mix;)>
-<!ATTLIST PartIntro
- %label.attrib;
- %common.attrib;
- %local.partintro.attrib;
- %partintro.role.attrib;
->
-<!--end of partintro.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Other Info elements .................................................. -->
-
-<!ENTITY % otherinfo.module "INCLUDE">
-<![ %otherinfo.module; [
-<!ENTITY % local.otherinfo.attrib "">
-<!ENTITY % otherinfo.role.attrib "%role.attrib;">
-<!ELEMENT (%otherinfo.class;) - - ((Graphic | LegalNotice | ModeSpec
- | SubjectSet | KeywordSet | ITermSet | %bibliocomponent.mix;)+)
- -(BeginPage)>
-<!ATTLIST (%otherinfo.class;)
- %common.attrib;
- %otherinfo.role.attrib;
- %local.otherinfo.attrib;
->
-<!--end of otherinfo.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Sect1, Sect2, Sect3, Sect4, Sect5 .................................... -->
-
-<!ENTITY % sect1.module "INCLUDE">
-<![ %sect1.module; [
-<!ENTITY % local.sect1.attrib "">
-<!ENTITY % sect1.role.attrib "%role.attrib;">
-<!ELEMENT Sect1 - O (Sect1Info?, (%sect.title.content;), (%nav.class;)*,
- (((%divcomponent.mix;)+,
- ((%refentry.class;)* | Sect2* | SimpleSect*))
- | (%refentry.class;)+ | Sect2+ | SimpleSect+), (%nav.class;)*)
- +(%ubiq.mix;)>
-<!ATTLIST Sect1
- --
- Renderas: Indicates the format in which the heading should
- appear
- --
- Renderas (Sect2
- |Sect3
- |Sect4
- |Sect5) #IMPLIED
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %sect1.role.attrib;
- %local.sect1.attrib;
->
-<!--end of sect1.module-->]]>
-
-<!ENTITY % sect2.module "INCLUDE">
-<![ %sect2.module; [
-<!ENTITY % local.sect2.attrib "">
-<!ENTITY % sect2.role.attrib "%role.attrib;">
-<!ELEMENT Sect2 - O (Sect2Info?, (%sect.title.content;), (%nav.class;)*,
- (((%divcomponent.mix;)+,
- ((%refentry.class;)* | Sect3* | SimpleSect*))
- | (%refentry.class;)+ | Sect3+ | SimpleSect+), (%nav.class;)*)>
-<!ATTLIST Sect2
- --
- Renderas: Indicates the format in which the heading should
- appear
- --
- Renderas (Sect1
- |Sect3
- |Sect4
- |Sect5) #IMPLIED
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %sect2.role.attrib;
- %local.sect2.attrib;
->
-<!--end of sect2.module-->]]>
-
-<!ENTITY % sect3.module "INCLUDE">
-<![ %sect3.module; [
-<!ENTITY % local.sect3.attrib "">
-<!ENTITY % sect3.role.attrib "%role.attrib;">
-<!ELEMENT Sect3 - O (Sect3Info?, (%sect.title.content;), (%nav.class;)*,
- (((%divcomponent.mix;)+,
- ((%refentry.class;)* | Sect4* | SimpleSect*))
- | (%refentry.class;)+ | Sect4+ | SimpleSect+), (%nav.class;)*)>
-<!ATTLIST Sect3
- --
- Renderas: Indicates the format in which the heading should
- appear
- --
- Renderas (Sect1
- |Sect2
- |Sect4
- |Sect5) #IMPLIED
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %sect3.role.attrib;
- %local.sect3.attrib;
->
-<!--end of sect3.module-->]]>
-
-<!ENTITY % sect4.module "INCLUDE">
-<![ %sect4.module; [
-<!ENTITY % local.sect4.attrib "">
-<!ENTITY % sect4.role.attrib "%role.attrib;">
-<!ELEMENT Sect4 - O (Sect4Info?, (%sect.title.content;), (%nav.class;)*,
- (((%divcomponent.mix;)+,
- ((%refentry.class;)* | Sect5* | SimpleSect*))
- | (%refentry.class;)+ | Sect5+ | SimpleSect+), (%nav.class;)*)>
-<!ATTLIST Sect4
- --
- Renderas: Indicates the format in which the heading should
- appear
- --
- Renderas (Sect1
- |Sect2
- |Sect3
- |Sect5) #IMPLIED
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %sect4.role.attrib;
- %local.sect4.attrib;
->
-<!--end of sect4.module-->]]>
-
-<!ENTITY % sect5.module "INCLUDE">
-<![ %sect5.module; [
-<!ENTITY % local.sect5.attrib "">
-<!ENTITY % sect5.role.attrib "%role.attrib;">
-<!ELEMENT Sect5 - O (Sect5Info?, (%sect.title.content;), (%nav.class;)*,
- (((%divcomponent.mix;)+, ((%refentry.class;)* | SimpleSect*))
- | (%refentry.class;)+ | SimpleSect+), (%nav.class;)*)>
-<!ATTLIST Sect5
- --
- Renderas: Indicates the format in which the heading should
- appear
- --
- Renderas (Sect1
- |Sect2
- |Sect3
- |Sect4) #IMPLIED
- %label.attrib;
- %status.attrib;
- %common.attrib;
- %sect5.role.attrib;
- %local.sect5.attrib;
->
-<!--end of sect5.module-->]]>
-
-<!ENTITY % simplesect.module "INCLUDE">
-<![ %simplesect.module; [
-<!ENTITY % local.simplesect.attrib "">
-<!ENTITY % simplesect.role.attrib "%role.attrib;">
-<!ELEMENT SimpleSect - O ((%sect.title.content;), (%divcomponent.mix;)+)
- +(%ubiq.mix;)>
-<!ATTLIST SimpleSect
- %common.attrib;
- %simplesect.role.attrib;
- %local.simplesect.attrib;
->
-<!--end of simplesect.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Bibliography ......................................................... -->
-
-<!ENTITY % bibliography.content.module "INCLUDE">
-<![ %bibliography.content.module; [
-<!ENTITY % bibliography.module "INCLUDE">
-<![ %bibliography.module; [
-<!ENTITY % local.bibliography.attrib "">
-<!ENTITY % bibliography.role.attrib "%role.attrib;">
-<!ELEMENT Bibliography - O ((%bookcomponent.title.content;)?,
- (%component.mix;)*,
- (BiblioDiv+ | (BiblioEntry|BiblioMixed)+))>
-<!ATTLIST Bibliography
- %status.attrib;
- %common.attrib;
- %bibliography.role.attrib;
- %local.bibliography.attrib;
->
-<!--end of bibliography.module-->]]>
-
-<!ENTITY % bibliodiv.module "INCLUDE">
-<![ %bibliodiv.module; [
-<!ENTITY % local.bibliodiv.attrib "">
-<!ENTITY % bibliodiv.role.attrib "%role.attrib;">
-<!ELEMENT BiblioDiv - O ((%sect.title.content;)?, (%component.mix;)*,
- (BiblioEntry|BiblioMixed)+)>
-<!ATTLIST BiblioDiv
- %status.attrib;
- %common.attrib;
- %bibliodiv.role.attrib;
- %local.bibliodiv.attrib;
->
-<!--end of bibliodiv.module-->]]>
-<!--end of bibliography.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Glossary ............................................................. -->
-
-<!ENTITY % glossary.content.module "INCLUDE">
-<![ %glossary.content.module; [
-<!ENTITY % glossary.module "INCLUDE">
-<![ %glossary.module; [
-<!ENTITY % local.glossary.attrib "">
-<!ENTITY % glossary.role.attrib "%role.attrib;">
-<!ELEMENT Glossary - O ((%bookcomponent.title.content;)?, (%component.mix;)*,
- (GlossDiv+ | GlossEntry+), Bibliography?)>
-<!ATTLIST Glossary
- %status.attrib;
- %common.attrib;
- %glossary.role.attrib;
- %local.glossary.attrib;
->
-<!--end of glossary.module-->]]>
-
-<!ENTITY % glossdiv.module "INCLUDE">
-<![ %glossdiv.module; [
-<!ENTITY % local.glossdiv.attrib "">
-<!ENTITY % glossdiv.role.attrib "%role.attrib;">
-<!ELEMENT GlossDiv - O ((%sect.title.content;), (%component.mix;)*,
- GlossEntry+)>
-<!ATTLIST GlossDiv
- %status.attrib;
- %common.attrib;
- %glossdiv.role.attrib;
- %local.glossdiv.attrib;
->
-<!--end of glossdiv.module-->]]>
-<!--end of glossary.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Index and SetIndex ................................................... -->
-
-<!ENTITY % index.content.module "INCLUDE">
-<![ %index.content.module; [
-<!ENTITY % indexes.module "INCLUDE">
-<![ %indexes.module; [
-<!ENTITY % local.indexes.attrib "">
-<!ENTITY % indexes.role.attrib "%role.attrib;">
-<!ELEMENT (%index.class;) - O ((%bookcomponent.title.content;)?,
- (%component.mix;)*, (IndexDiv* | IndexEntry*))
- -(%ndxterm.class;)>
-<!ATTLIST (%index.class;)
- %common.attrib;
- %indexes.role.attrib;
- %local.indexes.attrib;
->
-<!--end of indexes.module-->]]>
-
-<!ENTITY % indexdiv.module "INCLUDE">
-<![ %indexdiv.module; [
-
-<!-- SegmentedList in this content is useful for marking up permuted
- indices. -->
-
-<!ENTITY % local.indexdiv.attrib "">
-<!ENTITY % indexdiv.role.attrib "%role.attrib;">
-<!ELEMENT IndexDiv - O ((%sect.title.content;)?, ((%indexdivcomponent.mix;)*,
- (IndexEntry+ | SegmentedList)))>
-<!ATTLIST IndexDiv
- %common.attrib;
- %indexdiv.role.attrib;
- %local.indexdiv.attrib;
->
-<!--end of indexdiv.module-->]]>
-
-<!ENTITY % indexentry.module "INCLUDE">
-<![ %indexentry.module; [
-<!-- Index entries appear in the index, not the text. -->
-
-<!ENTITY % local.indexentry.attrib "">
-<!ENTITY % indexentry.role.attrib "%role.attrib;">
-<!ELEMENT IndexEntry - O (PrimaryIE, (SeeIE|SeeAlsoIE)*,
- (SecondaryIE, (SeeIE|SeeAlsoIE|TertiaryIE)*)*)>
-<!ATTLIST IndexEntry
- %common.attrib;
- %indexentry.role.attrib;
- %local.indexentry.attrib;
->
-<!--end of indexentry.module-->]]>
-
-<!ENTITY % primsecterie.module "INCLUDE">
-<![ %primsecterie.module; [
-<!ENTITY % local.primsecterie.attrib "">
-<!ENTITY % primsecterie.role.attrib "%role.attrib;">
-<!ELEMENT (PrimaryIE | SecondaryIE | TertiaryIE) - O ((%ndxterm.char.mix;)+)>
-<!ATTLIST (PrimaryIE | SecondaryIE | TertiaryIE)
- %linkends.attrib; --to IndexTerms that these entries represent--
- %common.attrib;
- %primsecterie.role.attrib;
- %local.primsecterie.attrib;
->
-<!--end of primsecterie.module-->]]>
-
-<!ENTITY % seeie.module "INCLUDE">
-<![ %seeie.module; [
-<!ENTITY % local.seeie.attrib "">
-<!ENTITY % seeie.role.attrib "%role.attrib;">
-<!ELEMENT SeeIE - O ((%ndxterm.char.mix;)+)>
-<!ATTLIST SeeIE
- %linkend.attrib; --to IndexEntry to look up--
- %common.attrib;
- %seeie.role.attrib;
- %local.seeie.attrib;
->
-<!--end of seeie.module-->]]>
-
-<!ENTITY % seealsoie.module "INCLUDE">
-<![ %seealsoie.module; [
-<!ENTITY % local.seealsoie.attrib "">
-<!ENTITY % seealsoie.role.attrib "%role.attrib;">
-<!ELEMENT SeeAlsoIE - O ((%ndxterm.char.mix;)+)>
-<!ATTLIST SeeAlsoIE
- %linkends.attrib; --to related IndexEntries--
- %common.attrib;
- %seealsoie.role.attrib;
- %local.seealsoie.attrib;
->
-<!--end of seealsoie.module-->]]>
-<!--end of index.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- RefEntry ............................................................. -->
-
-<!ENTITY % refentry.content.module "INCLUDE">
-<![ %refentry.content.module; [
-<!ENTITY % refentry.module "INCLUDE">
-<![ %refentry.module; [
-<!ENTITY % local.refentry.attrib "">
-<!ENTITY % refentry.role.attrib "%role.attrib;">
-<!--FUTURE USE (V4.0):
-......................
-The DocInfo element will be split out into ChapterInfo, AppendixInfo,
-etc.
-......................
--->
-<!ELEMENT RefEntry - O (DocInfo?, RefMeta?, (Comment|%link.char.class;)*,
- RefNameDiv, RefSynopsisDiv?, RefSect1+) +(%ubiq.mix;)>
-<!ATTLIST RefEntry
- %status.attrib;
- %common.attrib;
- %refentry.role.attrib;
- %local.refentry.attrib;
->
-<!--end of refentry.module-->]]>
-
-<!ENTITY % refmeta.module "INCLUDE">
-<![ %refmeta.module; [
-<!ENTITY % local.refmeta.attrib "">
-<!ENTITY % refmeta.role.attrib "%role.attrib;">
-<!ELEMENT RefMeta - - (RefEntryTitle, ManVolNum?, RefMiscInfo*)
- -(BeginPage)>
-<!ATTLIST RefMeta
- %common.attrib;
- %refmeta.role.attrib;
- %local.refmeta.attrib;
->
-<!--end of refmeta.module-->]]>
-
-<!ENTITY % refmiscinfo.module "INCLUDE">
-<![ %refmiscinfo.module; [
-<!ENTITY % local.refmiscinfo.attrib "">
-<!ENTITY % refmiscinfo.role.attrib "%role.attrib;">
-<!ELEMENT RefMiscInfo - - ((%docinfo.char.mix;)+)>
-<!ATTLIST RefMiscInfo
- --
- Class: Freely assignable parameter; no default
- --
- Class CDATA #IMPLIED
- %common.attrib;
- %refmiscinfo.role.attrib;
- %local.refmiscinfo.attrib;
->
-<!--end of refmiscinfo.module-->]]>
-
-<!ENTITY % refnamediv.module "INCLUDE">
-<![ %refnamediv.module; [
-<!ENTITY % local.refnamediv.attrib "">
-<!ENTITY % refnamediv.role.attrib "%role.attrib;">
-<!ELEMENT RefNameDiv - O (RefDescriptor?, RefName+, RefPurpose, RefClass*,
- (Comment|%link.char.class;)*)>
-<!ATTLIST RefNameDiv
- %common.attrib;
- %refnamediv.role.attrib;
- %local.refnamediv.attrib;
->
-<!--end of refnamediv.module-->]]>
-
-<!ENTITY % refdescriptor.module "INCLUDE">
-<![ %refdescriptor.module; [
-<!ENTITY % local.refdescriptor.attrib "">
-<!ENTITY % refdescriptor.role.attrib "%role.attrib;">
-<!ELEMENT RefDescriptor - O ((%refname.char.mix;)+)>
-<!ATTLIST RefDescriptor
- %common.attrib;
- %refdescriptor.role.attrib;
- %local.refdescriptor.attrib;
->
-<!--end of refdescriptor.module-->]]>
-
-<!ENTITY % refname.module "INCLUDE">
-<![ %refname.module; [
-<!ENTITY % local.refname.attrib "">
-<!ENTITY % refname.role.attrib "%role.attrib;">
-<!ELEMENT RefName - O ((%refname.char.mix;)+)>
-<!ATTLIST RefName
- %common.attrib;
- %refname.role.attrib;
- %local.refname.attrib;
->
-<!--end of refname.module-->]]>
-
-<!ENTITY % refpurpose.module "INCLUDE">
-<![ %refpurpose.module; [
-<!ENTITY % local.refpurpose.attrib "">
-<!ENTITY % refpurpose.role.attrib "%role.attrib;">
-<!ELEMENT RefPurpose - O ((%refinline.char.mix;)+)>
-<!ATTLIST RefPurpose
- %common.attrib;
- %refpurpose.role.attrib;
- %local.refpurpose.attrib;
->
-<!--end of refpurpose.module-->]]>
-
-<!ENTITY % refclass.module "INCLUDE">
-<![ %refclass.module; [
-<!ENTITY % local.refclass.attrib "">
-<!ENTITY % refclass.role.attrib "%role.attrib;">
-<!ELEMENT RefClass - O ((%refclass.char.mix;)+)>
-<!ATTLIST RefClass
- %common.attrib;
- %refclass.role.attrib;
- %local.refclass.attrib;
->
-<!--end of refclass.module-->]]>
-
-<!ENTITY % refsynopsisdiv.module "INCLUDE">
-<![ %refsynopsisdiv.module; [
-<!ENTITY % local.refsynopsisdiv.attrib "">
-<!ENTITY % refsynopsisdiv.role.attrib "%role.attrib;">
-<!ELEMENT RefSynopsisDiv - O (RefSynopsisDivInfo?, (%refsect.title.content;)?,
- (((%refcomponent.mix;)+, RefSect2*) | (RefSect2+)))>
-<!ATTLIST RefSynopsisDiv
- %common.attrib;
- %refsynopsisdiv.role.attrib;
- %local.refsynopsisdiv.attrib;
->
-<!--end of refsynopsisdiv.module-->]]>
-
-<!ENTITY % refsect1.module "INCLUDE">
-<![ %refsect1.module; [
-<!ENTITY % local.refsect1.attrib "">
-<!ENTITY % refsect1.role.attrib "%role.attrib;">
-<!ELEMENT RefSect1 - O (RefSect1Info?, (%refsect.title.content;),
- (((%refcomponent.mix;)+, RefSect2*) | RefSect2+))>
-<!ATTLIST RefSect1
- %status.attrib;
- %common.attrib;
- %refsect1.role.attrib;
- %local.refsect1.attrib;
->
-<!--end of refsect1.module-->]]>
-
-<!ENTITY % refsect2.module "INCLUDE">
-<![ %refsect2.module; [
-<!ENTITY % local.refsect2.attrib "">
-<!ENTITY % refsect2.role.attrib "%role.attrib;">
-<!ELEMENT RefSect2 - O (RefSect2Info?, (%refsect.title.content;),
- (((%refcomponent.mix;)+, RefSect3*) | RefSect3+))>
-<!ATTLIST RefSect2
- %status.attrib;
- %common.attrib;
- %refsect2.role.attrib;
- %local.refsect2.attrib;
->
-<!--end of refsect2.module-->]]>
-
-<!ENTITY % refsect3.module "INCLUDE">
-<![ %refsect3.module; [
-<!ENTITY % local.refsect3.attrib "">
-<!ENTITY % refsect3.role.attrib "%role.attrib;">
-<!ELEMENT RefSect3 - O (RefSect3Info?, (%refsect.title.content;),
- (%refcomponent.mix;)+)>
-<!ATTLIST RefSect3
- %status.attrib;
- %common.attrib;
- %refsect3.role.attrib;
- %local.refsect3.attrib;
->
-<!--end of refsect3.module-->]]>
-<!--end of refentry.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Article .............................................................. -->
-
-<!ENTITY % article.module "INCLUDE">
-<![ %article.module; [
-<!-- An Article is a chapter-level, stand-alone document that is often,
- but need not be, collected into a Book. -->
-<!--FUTURE USE (V4.0):
-......................
-The %nav.class; entity now allows ToC; ToCchap will be allowed instead.
-RefEntry will be removed from the main content of Article.
-......................
--->
-
-<!--FUTURE USE (V4.0):
-......................
-The ArtHeader element will be renamed to ArticleInfo.
-......................
--->
-
-<!ENTITY % local.article.attrib "">
-<!ENTITY % article.role.attrib "%role.attrib;">
-<!ELEMENT Article - O (ArtHeader, ToCchap?, LoT*, (%bookcomponent.content;),
- ((%nav.class;) | (%appendix.class;) | Ackno)*) +(%ubiq.mix;)>
-<!ATTLIST Article
- --
- Class: Indicates the type of a particular article;
- all articles have the same structure and general purpose.
- No default.
- --
- Class (JournalArticle
- |ProductSheet
- |WhitePaper
- |TechReport) #IMPLIED
- --
- ParentBook: ID of the enclosing Book
- --
- ParentBook IDREF #IMPLIED
- %status.attrib;
- %common.attrib;
- %article.role.attrib;
- %local.article.attrib;
->
-<!--end of article.module-->]]>
-
-<!-- End of DocBook document hierarchy module V3.0 ........................ -->
-<!-- ...................................................................... -->
diff --git a/share/sgml/docbook/dbpool.mod b/share/sgml/docbook/dbpool.mod
deleted file mode 100644
index 9e74173..0000000
--- a/share/sgml/docbook/dbpool.mod
+++ /dev/null
@@ -1,4649 +0,0 @@
-<!-- ...................................................................... -->
-<!-- DocBook information pool module V3.0 ................................. -->
-<!-- File dbpool.mod ...................................................... -->
-
-<!-- Copyright 1992, 1993, 1994, 1995, 1996 HaL Computer Systems, Inc.,
- O'Reilly & Associates, Inc., ArborText, Inc., and Fujitsu Software
- Corporation.
-
- Permission to use, copy, modify and distribute the DocBook DTD and
- its accompanying documentation for any purpose and without fee is
- hereby granted in perpetuity, provided that the above copyright
- notice and this paragraph appear in all copies. The copyright
- holders make no representation about the suitability of the DTD for
- any purpose. It is provided "as is" without expressed or implied
- warranty.
-
- If you modify the DocBook DTD in any way, except for declaring and
- referencing additional sets of general entities and declaring
- additional notations, label your DTD as a variant of DocBook. See
- the maintenance documentation for more information.
-
- Please direct all questions, bug reports, or suggestions for
- changes to the davenport@online.ora.com mailing list or to one of
- the maintainers:
-
- o Terry Allen, Fujitsu Software Corporation
- 3055 Orchard Drive, San Jose, CA 95134
- <tallen@fsc.fujitsu.com>
-
- o Eve Maler, ArborText Inc.
- 105 Lexington St., Burlington, MA 01803
- <elm@arbortext.com>
--->
-
-<!-- ...................................................................... -->
-
-<!-- This module contains the definitions for the objects, inline
- elements, and so on that are available to be used as the main
- content of DocBook documents. Some elements are useful for general
- publishing, and others are useful specifically for computer
- documentation.
-
- This module has the following dependencies on other modules:
-
- o It assumes that a %notation.class; entity is defined by the
- driver file or other high-level module. This entity is
- referenced in the NOTATION attributes for the graphic-related and
- ModeSpec elements.
-
- o It assumes that an appropriately parameterized table module is
- available for use with the table-related elements.
-
- In DTD driver files referring to this module, please use an entity
- declaration that uses the public identifier shown below:
-
- <!ENTITY % dbpool PUBLIC
- "-//Davenport//ELEMENTS DocBook Information Pool V3.0//EN">
- %dbpool;
-
- See the documentation for detailed information on the parameter
- entity and module scheme used in DocBook, customizing DocBook and
- planning for interchange, and changes made since the last release
- of DocBook.
--->
-
-<!-- ...................................................................... -->
-<!-- General-purpose semantics entities ................................... -->
-
-<!ENTITY % yesorno.attvals "NUMBER">
-<!ENTITY % yes.attval "1">
-<!ENTITY % no.attval "0">
-
-<!-- ...................................................................... -->
-<!-- Entities for module inclusions ....................................... -->
-
-<!ENTITY % dbpool.redecl.module "IGNORE">
-
-<!-- ...................................................................... -->
-<!-- Entities for element classes and mixtures ............................ -->
-
-<!-- Object-level classes ................................................. -->
-
-<!ENTITY % local.list.class "">
-<!ENTITY % list.class
- "CalloutList|GlossList|ItemizedList|OrderedList|SegmentedList
- |SimpleList|VariableList %local.list.class;">
-
-<!ENTITY % local.admon.class "">
-<!ENTITY % admon.class
- "Caution|Important|Note|Tip|Warning %local.admon.class;">
-
-<!ENTITY % local.linespecific.class "">
-<!ENTITY % linespecific.class
- "LiteralLayout|ProgramListing|ProgramListingCO|Screen
- |ScreenCO|ScreenShot %local.linespecific.class;">
-
-<!ENTITY % local.synop.class "">
-<!ENTITY % synop.class
- "Synopsis|CmdSynopsis|FuncSynopsis %local.synop.class;">
-
-<!ENTITY % local.para.class "">
-<!ENTITY % para.class
- "FormalPara|Para|SimPara %local.para.class;">
-
-<!ENTITY % local.informal.class "">
-<!ENTITY % informal.class
- "Address|BlockQuote|Graphic|GraphicCO|InformalEquation
- |InformalExample|InformalTable %local.informal.class;">
-
-<!ENTITY % local.formal.class "">
-<!ENTITY % formal.class
- "Equation|Example|Figure|Table %local.formal.class;">
-
-<!ENTITY % local.compound.class "">
-<!ENTITY % compound.class
- "MsgSet|Procedure|Sidebar %local.compound.class;">
-
-<!ENTITY % local.genobj.class "">
-<!ENTITY % genobj.class
- "Anchor|BridgeHead|Comment|Highlights
- %local.genobj.class;">
-
-<!ENTITY % local.descobj.class "">
-<!ENTITY % descobj.class
- "Abstract|AuthorBlurb|Epigraph
- %local.descobj.class;">
-
-<!-- Character-level classes .............................................. -->
-
-<!ENTITY % local.ndxterm.class "">
-<!ENTITY % ndxterm.class
- "IndexTerm %local.ndxterm.class;">
-
-<!ENTITY % local.xref.char.class "">
-<!ENTITY % xref.char.class
- "FootnoteRef|XRef %local.xref.char.class;">
-
-<!ENTITY % local.gen.char.class "">
-<!ENTITY % gen.char.class
- "Abbrev|Acronym|Citation|CiteRefEntry|CiteTitle|Emphasis
- |FirstTerm|ForeignPhrase|GlossTerm|Footnote|Phrase
- |Quote|Trademark|WordAsWord %local.gen.char.class;">
-
-<!ENTITY % local.link.char.class "">
-<!ENTITY % link.char.class
- "Link|OLink|ULink %local.link.char.class;">
-
-<!ENTITY % local.tech.char.class "">
-<!--FUTURE USE (V4.0):
-......................
-MsgText will be removed from tech.char.class to a more appropriate
-parameter entity.
-......................
--->
-<!ENTITY % tech.char.class
- "Action|Application|ClassName|Command|ComputerOutput
- |Database|Email|EnVar|ErrorCode|ErrorName|ErrorType|Filename
- |Function|GUIButton|GUIIcon|GUILabel|GUIMenu|GUIMenuItem
- |GUISubmenu|Hardware|Interface|InterfaceDefinition|KeyCap
- |KeyCode|KeyCombo|KeySym|Literal|Markup|MediaLabel|MenuChoice
- |MouseButton|MsgText|Option|Optional|Parameter|Prompt|Property
- |Replaceable|ReturnValue|SGMLTag|StructField|StructName
- |Symbol|SystemItem|Token|Type|UserInput
- %local.tech.char.class;">
-
-<!ENTITY % local.base.char.class "">
-<!ENTITY % base.char.class
- "Anchor %local.base.char.class;">
-
-<!ENTITY % local.docinfo.char.class "">
-<!ENTITY % docinfo.char.class
- "Author|AuthorInitials|CorpAuthor|ModeSpec|OtherCredit
- |ProductName|ProductNumber|RevHistory
- %local.docinfo.char.class;">
-
-<!ENTITY % local.other.char.class "">
-<!ENTITY % other.char.class
- "Comment|Subscript|Superscript %local.other.char.class;">
-
-<!ENTITY % local.inlineobj.char.class "">
-<!ENTITY % inlineobj.char.class
- "InlineGraphic|InlineEquation %local.inlineobj.char.class;">
-
-<!-- Redeclaration placeholder ............................................ -->
-
-<!-- For redeclaring entities that are declared after this point while
- retaining their references to the entities that are declared before
- this point -->
-
-<![ %dbpool.redecl.module; [
-%rdbpool;
-<!--end of dbpool.redecl.module-->]]>
-
-<!-- Object-level mixtures ................................................ -->
-
-<!--
- list admn line synp para infm form cmpd gen desc
-Component mixture X X X X X X X X X X
-Sidebar mixture X X X X X X X a X
-Footnote mixture X X X X X
-Example mixture X X X X X
-Highlights mixture X X X
-Paragraph mixture X X X X
-Admonition mixture X X X X X X b c
-Figure mixture X X X
-Table entry mixture X X X X d
-Glossary def mixture X X X X X e
-Legal notice mixture X X X X f
-
-a. Just Procedure; not Sidebar itself or MsgSet.
-b. No MsgSet.
-c. No Highlights.
-d. Just Graphic; no other informal objects.
-e. No Anchor, BridgeHead, or Highlights.
-f. Just BlockQuote; no other informal objects.
--->
-
-<!ENTITY % local.component.mix "">
-<!ENTITY % component.mix
- "%list.class; |%admon.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- |%formal.class; |%compound.class;
- |%genobj.class; |%descobj.class;
- %local.component.mix;">
-
-<!ENTITY % local.sidebar.mix "">
-<!ENTITY % sidebar.mix
- "%list.class; |%admon.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- |%formal.class; |Procedure
- |%genobj.class;
- %local.sidebar.mix;">
-
-<!ENTITY % local.footnote.mix "">
-<!ENTITY % footnote.mix
- "%list.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- %local.footnote.mix;">
-
-<!ENTITY % local.example.mix "">
-<!ENTITY % example.mix
- "%list.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- %local.example.mix;">
-
-<!ENTITY % local.highlights.mix "">
-<!ENTITY % highlights.mix
- "%list.class; |%admon.class;
- |%para.class;
- %local.highlights.mix;">
-
-<!-- %synop.class; is already included in para.char.mix because synopses
- used inside paragraph-like contexts are "inline" synopses -->
-<!-- %formal.class; is explicitly excluded from many contexts in which
- paragraphs are used -->
-<!ENTITY % local.para.mix "">
-<!ENTITY % para.mix
- "%list.class; |%admon.class;
- |%linespecific.class;
- |%informal.class;
- |%formal.class;
- %local.para.mix;">
-
-<!ENTITY % local.admon.mix "">
-<!ENTITY % admon.mix
- "%list.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- |%formal.class; |Procedure|Sidebar
- |Anchor|BridgeHead|Comment
- %local.admon.mix;">
-
-<!ENTITY % local.figure.mix "">
-<!ENTITY % figure.mix
- "%linespecific.class; |%synop.class;
- |%informal.class;
- %local.figure.mix;">
-
-<!ENTITY % local.tabentry.mix "">
-<!ENTITY % tabentry.mix
- "%list.class; |%admon.class;
- |%linespecific.class;
- |%para.class; |Graphic
- %local.tabentry.mix;">
-
-<!ENTITY % local.glossdef.mix "">
-<!ENTITY % glossdef.mix
- "%list.class;
- |%linespecific.class; |%synop.class;
- |%para.class; |%informal.class;
- |%formal.class;
- |Comment
- %local.glossdef.mix;">
-
-<!ENTITY % local.legalnotice.mix "">
-<!ENTITY % legalnotice.mix
- "%list.class; |%admon.class;
- |%linespecific.class;
- |%para.class; |BlockQuote
- %local.legalnotice.mix;">
-
-<!-- Character-level mixtures ............................................. -->
-
-<!ENTITY % local.ubiq.mix "">
-<!ENTITY % ubiq.mix
- "%ndxterm.class;|BeginPage %local.ubiq.mix;">
-
-<!--
- #PCD xref word link cptr base dnfo othr inob (synop)
-para.char.mix X X X X X X X X X X
-title.char.mix X X X X X X X X X
-ndxterm.char.mix X X X X X X X X a
-cptr.char.mix X X X X X a
-smallcptr.char.mix X b a
-word.char.mix X c X X X a
-docinfo.char.mix X d b X a
-
-a. Just InlineGraphic; no InlineEquation.
-b. Just Replaceable; no other computer terms.
-c. Just Emphasis and Trademark; no other word elements.
-d. Just Acronym, Emphasis, and Trademark; no other word elements.
--->
-
-<!-- Note that synop.class is not usually used for *.char.mixes,
- but is used here because synopses used inside paragraph
- contexts are "inline" synopses -->
-<!ENTITY % local.para.char.mix "">
-<!ENTITY % para.char.mix
- "#PCDATA
- |%xref.char.class; |%gen.char.class;
- |%link.char.class; |%tech.char.class;
- |%base.char.class; |%docinfo.char.class;
- |%other.char.class; |%inlineobj.char.class;
- |%synop.class;
- %local.para.char.mix;">
-
-<!ENTITY % local.title.char.mix "">
-<!ENTITY % title.char.mix
- "#PCDATA
- |%xref.char.class; |%gen.char.class;
- |%link.char.class; |%tech.char.class;
- |%base.char.class; |%docinfo.char.class;
- |%other.char.class; |%inlineobj.char.class;
- %local.title.char.mix;">
-
-<!ENTITY % local.ndxterm.char.mix "">
-<!ENTITY % ndxterm.char.mix
- "#PCDATA
- |%xref.char.class; |%gen.char.class;
- |%link.char.class; |%tech.char.class;
- |%base.char.class; |%docinfo.char.class;
- |%other.char.class; |InlineGraphic
- %local.ndxterm.char.mix;">
-
-<!ENTITY % local.cptr.char.mix "">
-<!ENTITY % cptr.char.mix
- "#PCDATA
- |%link.char.class; |%tech.char.class;
- |%base.char.class;
- |%other.char.class; |InlineGraphic
- %local.cptr.char.mix;">
-
-<!ENTITY % local.smallcptr.char.mix "">
-<!ENTITY % smallcptr.char.mix
- "#PCDATA
- |Replaceable
- |InlineGraphic
- %local.smallcptr.char.mix;">
-
-<!ENTITY % local.word.char.mix "">
-<!ENTITY % word.char.mix
- "#PCDATA
- |Acronym|Emphasis|Trademark
- |%link.char.class;
- |%base.char.class;
- |%other.char.class; |InlineGraphic
- %local.word.char.mix;">
-
-<!ENTITY % local.docinfo.char.mix "">
-<!ENTITY % docinfo.char.mix
- "#PCDATA
- |Emphasis|Trademark
- |Replaceable
- |%other.char.class; |InlineGraphic
- %local.docinfo.char.mix;">
-<!--ENTITY % bibliocomponent.mix (see Bibliographic section, below)-->
-<!--ENTITY % person.ident.mix (see Bibliographic section, below)-->
-
-<!-- ...................................................................... -->
-<!-- Entities for content models .......................................... -->
-
-<!ENTITY % formalobject.title.content "Title, TitleAbbrev?">
-
-<!ENTITY % equation.content "(Graphic+)">
-
-<!ENTITY % inlineequation.content "(Graphic+)">
-
-<!ENTITY % programlisting.content "CO | LineAnnotation | %para.char.mix;">
-
-<!ENTITY % screen.content "CO | LineAnnotation | %para.char.mix;">
-
-<!-- ...................................................................... -->
-<!-- Entities for attributes and attribute components ..................... -->
-
-<!-- Effectivity attributes ............................................... -->
-
-<!ENTITY % arch.attrib
- --Arch: Computer or chip architecture to which element applies; no
- default--
- "Arch CDATA #IMPLIED">
-
-<!ENTITY % conformance.attrib
- --Conformance: Standards conformance characteristics--
- "Conformance NMTOKENS #IMPLIED">
-
-<!ENTITY % os.attrib
- --OS: Operating system to which element applies; no default--
- "OS CDATA #IMPLIED">
-
-<!ENTITY % revision.attrib
- --Revision: Editorial revision to which element belongs; no default--
- "Revision CDATA #IMPLIED">
-
-<!ENTITY % userlevel.attrib
- --UserLevel: Level of user experience to which element applies; no
- default--
- "UserLevel CDATA #IMPLIED">
-
-<!ENTITY % vendor.attrib
- --Vendor: Computer vendor to which element applies; no default--
- "Vendor CDATA #IMPLIED">
-
-<!ENTITY % local.effectivity.attrib "">
-<!ENTITY % effectivity.attrib
- "%arch.attrib;
- %conformance.attrib;
- %os.attrib;
- %revision.attrib;
- %userlevel.attrib;
- %vendor.attrib;
- %local.effectivity.attrib;"
->
-
-<!-- Common attributes .................................................... -->
-
-<!ENTITY % id.attrib
- --Id: Unique identifier of element; no default--
- "Id ID #IMPLIED">
-
-<!ENTITY % idreq.attrib
- --Id: Unique identifier of element; a value must be supplied; no
- default--
- "Id ID #REQUIRED">
-
-<!ENTITY % lang.attrib
- --Lang: Indicator of language in which element is written, for
- translation, character set management, etc.; no default--
- "Lang CDATA #IMPLIED">
-
-<!ENTITY % remap.attrib
- --Remap: Previous role of element before conversion; no default--
- "Remap CDATA #IMPLIED">
-
-<!ENTITY % role.attrib
- --Role: New role of element in local environment; no default--
- "Role CDATA #IMPLIED">
-
-<!ENTITY % xreflabel.attrib
- --XRefLabel: Alternate labeling string for XRef text generation;
- default is usually title or other appropriate label text already
- contained in element--
- "XRefLabel CDATA #IMPLIED">
-
-<!ENTITY % revisionflag.attrib
- --RevisionFlag: Revision status of element; default is that element
- wasn't revised--
- "RevisionFlag (Changed
- |Added
- |Deleted
- |Off) #IMPLIED">
-
-<!ENTITY % local.common.attrib "">
-<!ENTITY % common.attrib
- "%id.attrib;
- %lang.attrib;
- %remap.attrib;
- --Role is included explicitly on each element--
- %xreflabel.attrib;
- %revisionflag.attrib;
- %effectivity.attrib;
- %local.common.attrib;"
->
-
-<!ENTITY % idreq.common.attrib
- "%idreq.attrib;
- %lang.attrib;
- %remap.attrib;
- --Role is included explicitly on each element--
- %xreflabel.attrib;
- %revisionflag.attrib;
- %effectivity.attrib;
- %local.common.attrib;"
->
-
-<!-- Semi-common attributes and other attribute entities .................. -->
-
-<!ENTITY % local.graphics.attrib "">
-<!ENTITY % graphics.attrib
- "
- --EntityRef: Name of an external entity containing the content
- of the graphic--
- EntityRef ENTITY #IMPLIED
-
- --FileRef: Filename, qualified by a pathname if desired,
- designating the file containing the content of the graphic--
- FileRef CDATA #IMPLIED
-
- --Format: Notation of the element content, if any--
- Format NOTATION
- (%notation.class;)
- #IMPLIED
-
- --SrcCredit: Information about the source of the Graphic--
- SrcCredit CDATA #IMPLIED
-
- --Width: Same as CALS reprowid (desired width)--
- Width NUTOKEN #IMPLIED
-
- --Depth: Same as CALS reprodep (desired depth)--
- Depth NUTOKEN #IMPLIED
-
- --Align: Same as CALS hplace with 'none' removed; #IMPLIED means
- application-specific--
- Align (Left
- |Right
- |Center) #IMPLIED
-
- --Scale: Conflation of CALS hscale and vscale--
- Scale NUMBER #IMPLIED
-
- --Scalefit: Same as CALS scalefit--
- Scalefit %yesorno.attvals;
- #IMPLIED
- %local.graphics.attrib;"
->
-
-<!ENTITY % local.keyaction.attrib "">
-<!ENTITY % keyaction.attrib
- "
- --Action: Key combination type; default is unspecified if one
- child element, Simul if there is more than one; if value is
- Other, the OtherAction attribute must have a nonempty value--
- Action (Click
- |Double-Click
- |Press
- |Seq
- |Simul
- |Other) #IMPLIED
-
- --OtherAction: User-defined key combination type--
- OtherAction CDATA #IMPLIED"
->
-
-<!ENTITY % label.attrib
- --Label: Identifying number or string; default is usually the
- appropriate number or string autogenerated by a formatter--
- "Label CDATA #IMPLIED">
-
-<!ENTITY % linespecific.attrib
- --Format: whether element is assumed to contain significant white
- space--
- "Format NOTATION
- (linespecific) linespecific">
-
-<!ENTITY % linkend.attrib
- --Linkend: link to related information; no default--
- "Linkend IDREF #IMPLIED">
-
-<!ENTITY % linkendreq.attrib
- --Linkend: required link to related information--
- "Linkend IDREF #REQUIRED">
-
-<!ENTITY % linkends.attrib
- --Linkends: link to one or more sets of related information; no
- default--
- "Linkends IDREFS #IMPLIED">
-
-<!ENTITY % linkendsreq.attrib
- --Linkends: required link to one or more sets of related information--
- "Linkends IDREFS #REQUIRED">
-
-<!ENTITY % local.mark.attrib "">
-<!ENTITY % mark.attrib
- "Mark CDATA #IMPLIED
- %local.mark.attrib;"
->
-
-<!ENTITY % moreinfo.attrib
- --MoreInfo: whether element's content has an associated RefEntry--
- "MoreInfo (RefEntry|None) None">
-
-<!ENTITY % pagenum.attrib
- --Pagenum: number of page on which element appears; no default--
- "Pagenum CDATA #IMPLIED">
-
-<!ENTITY % local.status.attrib "">
-<!ENTITY % status.attrib
- --Status: Editorial or publication status of the element
- it applies to, such as "in review" or "approved for distribution"--
- "Status CDATA #IMPLIED
- %local.status.attrib;"
->
-
-<!ENTITY % width.attrib
- --Width: width of the longest line in the element to which it
- pertains, in number of characters--
- "Width NUMBER #IMPLIED">
-
-<!-- ...................................................................... -->
-<!-- Title elements ....................................................... -->
-
-<!ENTITY % title.module "INCLUDE">
-<![ %title.module; [
-<!ENTITY % local.title.attrib "">
-<!ENTITY % title.role.attrib "%role.attrib;">
-<!ELEMENT Title - O ((%title.char.mix;)+)>
-<!ATTLIST Title
- %pagenum.attrib;
- %common.attrib;
- %title.role.attrib;
- %local.title.attrib;
->
-<!--end of title.module-->]]>
-
-<!ENTITY % titleabbrev.module "INCLUDE">
-<![ %titleabbrev.module; [
-<!ENTITY % local.titleabbrev.attrib "">
-<!ENTITY % titleabbrev.role.attrib "%role.attrib;">
-<!ELEMENT TitleAbbrev - O ((%title.char.mix;)+)>
-<!ATTLIST TitleAbbrev
- %common.attrib;
- %titleabbrev.role.attrib;
- %local.titleabbrev.attrib;
->
-<!--end of titleabbrev.module-->]]>
-
-<!ENTITY % subtitle.module "INCLUDE">
-<![ %subtitle.module; [
-<!ENTITY % local.subtitle.attrib "">
-<!ENTITY % subtitle.role.attrib "%role.attrib;">
-<!ELEMENT Subtitle - O ((%title.char.mix;)+)>
-<!ATTLIST Subtitle
- %common.attrib;
- %subtitle.role.attrib;
- %local.subtitle.attrib;
->
-<!--end of subtitle.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Bibliographic entities and elements .................................. -->
-
-<!-- The bibliographic elements are typically used in the document
- hierarchy. They do not appear in content models of information
- pool elements. See also the document information elements,
- below. -->
-
-<!ENTITY % local.person.ident.mix "">
-<!--FUTURE USE (V4.0):
-......................
-AuthorBlurb and Affiliation will be removed from %person.ident.mix; and a new
-wrapper element created to allow association of those two elements with
-Author name information.
-......................
--->
-<!ENTITY % person.ident.mix
- "Honorific|FirstName|Surname|Lineage|OtherName|Affiliation
- |AuthorBlurb|Contrib %local.person.ident.mix;">
-
-<!ENTITY % local.bibliocomponent.mix "">
-<!ENTITY % bibliocomponent.mix
- "Abbrev|Abstract|Address|ArtPageNums|Author
- |AuthorGroup|AuthorInitials|BiblioMisc|BiblioSet
- |Collab|ConfGroup|ContractNum|ContractSponsor
- |Copyright|CorpAuthor|CorpName|Date|Edition
- |Editor|InvPartNumber|ISBN|ISSN|IssueNum|OrgName
- |OtherCredit|PageNums|PrintHistory|ProductName
- |ProductNumber|PubDate|Publisher|PublisherName
- |PubsNumber|ReleaseInfo|RevHistory|SeriesVolNums
- |Subtitle|Title|TitleAbbrev|VolumeNum
- |%person.ident.mix;
- %local.bibliocomponent.mix;">
-
-<!ENTITY % biblioentry.module "INCLUDE">
-<![ %biblioentry.module; [
-<!ENTITY % local.biblioentry.attrib "">
-<!--FUTURE USE (V4.0):
-......................
-The ArtHeader element will be renamed to ArticleInfo.
-......................
--->
-<!ENTITY % biblioentry.role.attrib "%role.attrib;">
-<!ELEMENT BiblioEntry - O ((ArtHeader | BookBiblio | SeriesInfo
- | (%bibliocomponent.mix;))+) -(%ubiq.mix;)>
-<!ATTLIST BiblioEntry
- %common.attrib;
- %biblioentry.role.attrib;
- %local.biblioentry.attrib;
->
-<!--end of biblioentry.module-->]]>
-
-<!ENTITY % bibliomixed.module "INCLUDE">
-<![ %bibliomixed.module; [
-<!ENTITY % local.bibliomixed.attrib "">
-<!ENTITY % bibliomixed.role.attrib "%role.attrib;">
-<!ELEMENT BiblioMixed - O ((%bibliocomponent.mix; | BiblioMSet | #PCDATA)+)
- -(%ubiq.mix;)>
-<!ATTLIST BiblioMixed
- %common.attrib;
- %bibliomixed.role.attrib;
- %local.biblioentry.attrib;
->
-<!--end of bibliomixed.module-->]]>
-
-<!ENTITY % bookbiblio.module "INCLUDE">
-<![ %bookbiblio.module; [
-<!--FUTURE USE (V4.0):
-......................
-BookBiblio will be discarded.
-......................
--->
-<!ENTITY % local.bookbiblio.attrib "">
-<!ENTITY % bookbiblio.role.attrib "%role.attrib;">
-<!ELEMENT BookBiblio - - ((%bibliocomponent.mix; | SeriesInfo)+) -(%ubiq.mix;)>
-<!ATTLIST BookBiblio
- %common.attrib;
- %bookbiblio.role.attrib;
- %local.bookbiblio.attrib;
->
-<!--end of bookbiblio.module-->]]>
-
-<!ENTITY % seriesinfo.module "INCLUDE">
-<![ %seriesinfo.module; [
-<!--FUTURE USE (V4.0):
-......................
-SeriesInfo *may* be discarded; it has become a special case of BiblioSet.
-......................
--->
-<!ENTITY % local.seriesinfo.attrib "">
-<!ENTITY % seriesinfo.role.attrib "%role.attrib;">
-<!ELEMENT SeriesInfo - - ((%bibliocomponent.mix;)+) -(%ubiq.mix;)>
-<!ATTLIST SeriesInfo
- %common.attrib;
- %seriesinfo.role.attrib;
- %local.seriesinfo.attrib;
->
-<!--end of seriesinfo.module-->]]>
-
-<!ENTITY % artheader.module "INCLUDE">
-<![ %artheader.module; [
-<!--FUTURE USE (V4.0):
-......................
-BookBiblio will be discarded and will be removed from ArtHeader, which
-will be renamed to ArticleInfo.
-......................
--->
-<!ENTITY % local.artheader.attrib "">
-<!ENTITY % artheader.role.attrib "%role.attrib;">
-<!ELEMENT ArtHeader - - ((%bibliocomponent.mix; | BookBiblio)+) -(%ubiq.mix;)>
-<!ATTLIST ArtHeader
- %common.attrib;
- %artheader.role.attrib;
- %local.artheader.attrib;
->
-<!--end of artheader.module-->]]>
-
-<!ENTITY % biblioset.module "INCLUDE">
-<![ %biblioset.module; [
-<!ENTITY % local.biblioset.attrib "">
-<!ENTITY % biblioset.role.attrib "%role.attrib;">
-<!ELEMENT BiblioSet - - ((%bibliocomponent.mix;)+) -(%ubiq.mix;)>
-<!ATTLIST BiblioSet
- --
- Relation: Relationship of elements contained within BiblioSet
- --
- Relation CDATA #IMPLIED
- %common.attrib;
- %biblioset.role.attrib;
- %local.biblioset.attrib;
->
-<!--end of biblioset.module-->]]>
-
-<!ENTITY % bibliomset.module "INCLUDE">
-<![ %bibliomset.module; [
-<!ENTITY % bibliomset.role.attrib "%role.attrib;">
-<!ENTITY % local.bibliomset.attrib "">
-<!ELEMENT BiblioMSet - - ((%bibliocomponent.mix; | BiblioMSet | #PCDATA)+)
- -(%ubiq.mix;)>
-<!ATTLIST BiblioMSet
- --
- Relation: Relationship of elements contained within BiblioMSet
- --
- Relation CDATA #IMPLIED
- %bibliomset.role.attrib;
- %common.attrib;
- %local.bibliomset.attrib;
->
-<!--end of bibliomset.module-->]]>
-
-<!ENTITY % bibliomisc.module "INCLUDE">
-<![ %bibliomisc.module; [
-<!ENTITY % local.bibliomisc.attrib "">
-<!ENTITY % bibliomisc.role.attrib "%role.attrib;">
-<!ELEMENT BiblioMisc - - ((%para.char.mix;)+)>
-<!ATTLIST BiblioMisc
- %common.attrib;
- %bibliomisc.role.attrib;
- %local.bibliomisc.attrib;
->
-<!--end of bibliomisc.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Subject, Keyword, and ITermSet elements .............................. -->
-
-<!ENTITY % subjectset.content.module "INCLUDE">
-<![ %subjectset.content.module; [
-<!ENTITY % subjectset.module "INCLUDE">
-<![ %subjectset.module; [
-<!ENTITY % local.subjectset.attrib "">
-<!ENTITY % subjectset.role.attrib "%role.attrib;">
-<!ELEMENT SubjectSet - - (Subject+)>
-<!ATTLIST SubjectSet
- --
- Scheme: Controlled vocabulary employed in SubjectTerms
- --
- Scheme NAME #IMPLIED
- %common.attrib;
- %subjectset.role.attrib;
- %local.subjectset.attrib;
->
-<!--end of subjectset.module-->]]>
-
-<!ENTITY % subject.module "INCLUDE">
-<![ %subject.module; [
-<!ENTITY % local.subject.attrib "">
-<!ENTITY % subject.role.attrib "%role.attrib;">
-<!ELEMENT Subject - - (SubjectTerm+)>
-<!ATTLIST Subject
- --
- Weight: Ranking of this group of SubjectTerms relative
- to others, 0 is low, no highest value specified
- --
- Weight NUMBER #IMPLIED
- %common.attrib;
- %subject.role.attrib;
- %local.subject.attrib;
->
-<!--end of subject.module-->]]>
-
-<!ENTITY % subjectterm.module "INCLUDE">
-<![ %subjectterm.module; [
-<!ENTITY % local.subjectterm.attrib "">
-<!ENTITY % subjectterm.role.attrib "%role.attrib;">
-<!ELEMENT SubjectTerm - - (#PCDATA)>
-<!ATTLIST SubjectTerm
- %common.attrib;
- %subjectterm.role.attrib;
- %local.subjectterm.attrib;
->
-<!--end of subjectterm.module-->]]>
-<!--end of subjectset.content.module-->]]>
-
-<!ENTITY % keywordset.content.module "INCLUDE">
-<![ %keywordset.content.module; [
-<!ENTITY % local.keywordset.attrib "">
-<!ENTITY % keywordset.module "INCLUDE">
-<![ %keywordset.module; [
-<!ENTITY % local.keywordset.attrib "">
-<!ENTITY % keywordset.role.attrib "%role.attrib;">
-<!ELEMENT KeywordSet - - (Keyword+)>
-<!ATTLIST KeywordSet
- %common.attrib;
- %keywordset.role.attrib;
- %local.keywordset.attrib;
->
-<!--end of keywordset.module-->]]>
-
-<!ENTITY % keyword.module "INCLUDE">
-<![ %keyword.module; [
-<!ENTITY % local.keyword.attrib "">
-<!ENTITY % keyword.role.attrib "%role.attrib;">
-<!ELEMENT Keyword - - (#PCDATA)>
-<!ATTLIST Keyword
- %common.attrib;
- %keyword.role.attrib;
- %local.keyword.attrib;
->
-<!--end of keyword.module-->]]>
-<!--end of keywordset.content.module-->]]>
-
-<!ENTITY % itermset.module "INCLUDE">
-<![ %itermset.module; [
-<!ENTITY % local.itermset.attrib "">
-<!ENTITY % itermset.role.attrib "%role.attrib;">
-<!ELEMENT ITermSet - - (IndexTerm+)>
-<!ATTLIST ITermSet
- %common.attrib;
- %itermset.role.attrib;
- %local.itermset.attrib;
->
-<!--end of itermset.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Compound (section-ish) elements ...................................... -->
-
-<!-- Message set ...................... -->
-
-<!ENTITY % msgset.content.module "INCLUDE">
-<![ %msgset.content.module; [
-<!ENTITY % msgset.module "INCLUDE">
-<![ %msgset.module; [
-<!ENTITY % local.msgset.attrib "">
-<!ENTITY % msgset.role.attrib "%role.attrib;">
-<!ELEMENT MsgSet - - (MsgEntry+)>
-<!ATTLIST MsgSet
- %common.attrib;
- %msgset.role.attrib;
- %local.msgset.attrib;
->
-<!--end of msgset.module-->]]>
-
-<!ENTITY % msgentry.module "INCLUDE">
-<![ %msgentry.module; [
-<!ENTITY % local.msgentry.attrib "">
-<!ENTITY % msgentry.role.attrib "%role.attrib;">
-<!ELEMENT MsgEntry - O (Msg+, MsgInfo?, MsgExplan*)>
-<!ATTLIST MsgEntry
- %common.attrib;
- %msgentry.role.attrib;
- %local.msgentry.attrib;
->
-<!--end of msgentry.module-->]]>
-
-<!ENTITY % msg.module "INCLUDE">
-<![ %msg.module; [
-<!ENTITY % local.msg.attrib "">
-<!ENTITY % msg.role.attrib "%role.attrib;">
-<!ELEMENT Msg - O (Title?, MsgMain, (MsgSub | MsgRel)*)>
-<!ATTLIST Msg
- %common.attrib;
- %msg.role.attrib;
- %local.msg.attrib;
->
-<!--end of msg.module-->]]>
-
-<!ENTITY % msgmain.module "INCLUDE">
-<![ %msgmain.module; [
-<!ENTITY % local.msgmain.attrib "">
-<!ENTITY % msgmain.role.attrib "%role.attrib;">
-<!ELEMENT MsgMain - - (Title?, MsgText)>
-<!ATTLIST MsgMain
- %common.attrib;
- %msgmain.role.attrib;
- %local.msgmain.attrib;
->
-<!--end of msgmain.module-->]]>
-
-<!ENTITY % msgsub.module "INCLUDE">
-<![ %msgsub.module; [
-<!ENTITY % local.msgsub.attrib "">
-<!ENTITY % msgsub.role.attrib "%role.attrib;">
-<!ELEMENT MsgSub - - (Title?, MsgText)>
-<!ATTLIST MsgSub
- %common.attrib;
- %msgsub.role.attrib;
- %local.msgsub.attrib;
->
-<!--end of msgsub.module-->]]>
-
-<!ENTITY % msgrel.module "INCLUDE">
-<![ %msgrel.module; [
-<!ENTITY % local.msgrel.attrib "">
-<!ENTITY % msgrel.role.attrib "%role.attrib;">
-<!ELEMENT MsgRel - - (Title?, MsgText)>
-<!ATTLIST MsgRel
- %common.attrib;
- %msgrel.role.attrib;
- %local.msgrel.attrib;
->
-<!--end of msgrel.module-->]]>
-
-<!--ELEMENT MsgText (defined in the Inlines section, below)-->
-
-<!ENTITY % msginfo.module "INCLUDE">
-<![ %msginfo.module; [
-<!ENTITY % local.msginfo.attrib "">
-<!ENTITY % msginfo.role.attrib "%role.attrib;">
-<!ELEMENT MsgInfo - - ((MsgLevel | MsgOrig | MsgAud)*)>
-<!ATTLIST MsgInfo
- %common.attrib;
- %msginfo.role.attrib;
- %local.msginfo.attrib;
->
-<!--end of msginfo.module-->]]>
-
-<!ENTITY % msglevel.module "INCLUDE">
-<![ %msglevel.module; [
-<!ENTITY % local.msglevel.attrib "">
-<!ENTITY % msglevel.role.attrib "%role.attrib;">
-<!ELEMENT MsgLevel - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST MsgLevel
- %common.attrib;
- %msglevel.role.attrib;
- %local.msglevel.attrib;
->
-<!--end of msglevel.module-->]]>
-
-<!ENTITY % msgorig.module "INCLUDE">
-<![ %msgorig.module; [
-<!ENTITY % local.msgorig.attrib "">
-<!ENTITY % msgorig.role.attrib "%role.attrib;">
-<!ELEMENT MsgOrig - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST MsgOrig
- %common.attrib;
- %msgorig.role.attrib;
- %local.msgorig.attrib;
->
-<!--end of msgorig.module-->]]>
-
-<!ENTITY % msgaud.module "INCLUDE">
-<![ %msgaud.module; [
-<!ENTITY % local.msgaud.attrib "">
-<!ENTITY % msgaud.role.attrib "%role.attrib;">
-<!ELEMENT MsgAud - - ((%para.char.mix;)+)>
-<!ATTLIST MsgAud
- %common.attrib;
- %msgaud.role.attrib;
- %local.msgaud.attrib;
->
-<!--end of msgaud.module-->]]>
-
-<!ENTITY % msgexplan.module "INCLUDE">
-<![ %msgexplan.module; [
-<!ENTITY % local.msgexplan.attrib "">
-<!ENTITY % msgexplan.role.attrib "%role.attrib;">
-<!ELEMENT MsgExplan - - (Title?, (%component.mix;)+)>
-<!ATTLIST MsgExplan
- %common.attrib;
- %msgexplan.role.attrib;
- %local.msgexplan.attrib;
->
-<!--end of msgexplan.module-->]]>
-<!--end of msgset.content.module-->]]>
-
-<!-- Procedure ........................ -->
-
-<!ENTITY % procedure.content.module "INCLUDE">
-<![ %procedure.content.module; [
-<!ENTITY % procedure.module "INCLUDE">
-<![ %procedure.module; [
-<!ENTITY % local.procedure.attrib "">
-<!ENTITY % procedure.role.attrib "%role.attrib;">
-<!ELEMENT Procedure - - ((%formalobject.title.content;)?,
- (%component.mix;)*, Step+)>
-<!ATTLIST Procedure
- %common.attrib;
- %procedure.role.attrib;
- %local.procedure.attrib;
->
-<!--end of procedure.module-->]]>
-
-<!ENTITY % step.module "INCLUDE">
-<![ %step.module; [
-<!ENTITY % local.step.attrib "">
-<!ENTITY % step.role.attrib "%role.attrib;">
-<!ELEMENT Step - O (Title?, (((%component.mix;)+, (SubSteps,
- (%component.mix;)*)?) | (SubSteps, (%component.mix;)*)))>
-<!ATTLIST Step
- --
- Performance: Whether the Step must be performed
- --
- Performance (Optional
- |Required) Required -- not #REQUIRED! --
- %common.attrib;
- %step.role.attrib;
- %local.step.attrib;
->
-<!--end of step.module-->]]>
-
-<!ENTITY % substeps.module "INCLUDE">
-<![ %substeps.module; [
-<!ENTITY % local.substeps.attrib "">
-<!ENTITY % substeps.role.attrib "%role.attrib;">
-<!ELEMENT SubSteps - - (Step+)>
-<!ATTLIST SubSteps
- --
- Performance: whether entire set of substeps must be performed
- --
- Performance (Optional
- |Required) Required -- not #REQUIRED! --
- %common.attrib;
- %substeps.role.attrib;
- %local.substeps.attrib;
->
-<!--end of substeps.module-->]]>
-<!--end of procedure.content.module-->]]>
-
-<!-- Sidebar .......................... -->
-
-<!ENTITY % sidebar.module "INCLUDE">
-<![ %sidebar.module; [
-<!ENTITY % local.sidebar.attrib "">
-<!ENTITY % sidebar.role.attrib "%role.attrib;">
-<!ELEMENT Sidebar - - ((%formalobject.title.content;)?, (%sidebar.mix;)+)>
-<!ATTLIST Sidebar
- %common.attrib;
- %sidebar.role.attrib;
- %local.sidebar.attrib;
->
-<!--end of sidebar.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Paragraph-related elements ........................................... -->
-
-<!ENTITY % abstract.module "INCLUDE">
-<![ %abstract.module; [
-<!ENTITY % local.abstract.attrib "">
-<!ENTITY % abstract.role.attrib "%role.attrib;">
-<!ELEMENT Abstract - - (Title?, (%para.class;)+)>
-<!ATTLIST Abstract
- %common.attrib;
- %abstract.role.attrib;
- %local.abstract.attrib;
->
-<!--end of abstract.module-->]]>
-
-<!ENTITY % authorblurb.module "INCLUDE">
-<![ %authorblurb.module; [
-<!ENTITY % local.authorblurb.attrib "">
-<!ENTITY % authorblurb.role.attrib "%role.attrib;">
-<!ELEMENT AuthorBlurb - - (Title?, (%para.class;)+)>
-<!ATTLIST AuthorBlurb
- %common.attrib;
- %authorblurb.role.attrib;
- %local.authorblurb.attrib;
->
-<!--end of authorblurb.module-->]]>
-
-<!ENTITY % blockquote.module "INCLUDE">
-<![ %blockquote.module; [
-<!--FUTURE USE (V4.0):
-......................
-Epigraph will be disallowed from appearing in BlockQuote.
-......................
--->
-
-<!ENTITY % local.blockquote.attrib "">
-<!ENTITY % blockquote.role.attrib "%role.attrib;">
-<!ELEMENT BlockQuote - - (Title?, Attribution?, (%component.mix;)+)>
-<!ATTLIST BlockQuote
- %common.attrib;
- %blockquote.role.attrib;
- %local.blockquote.attrib;
->
-<!--end of blockquote.module-->]]>
-
-<!ENTITY % attribution.module "INCLUDE">
-<![ %attribution.module; [
-<!ENTITY % local.attribution.attrib "">
-<!ENTITY % attribution.role.attrib "%role.attrib;">
-<!ELEMENT Attribution - O ((%para.char.mix;)+)>
-<!ATTLIST Attribution
- %common.attrib;
- %attribution.role.attrib;
- %local.attribution.attrib;
->
-<!--end of attribution.module-->]]>
-
-<!ENTITY % bridgehead.module "INCLUDE">
-<![ %bridgehead.module; [
-<!ENTITY % local.bridgehead.attrib "">
-<!ENTITY % bridgehead.role.attrib "%role.attrib;">
-<!ELEMENT BridgeHead - - ((%title.char.mix;)+)>
-<!ATTLIST BridgeHead
- --
- Renderas: Indicates the format in which the BridgeHead
- should appear
- --
- Renderas (Other
- |Sect1
- |Sect2
- |Sect3
- |Sect4
- |Sect5) #IMPLIED
- %common.attrib;
- %bridgehead.role.attrib;
- %local.bridgehead.attrib;
->
-<!--end of bridgehead.module-->]]>
-
-<!ENTITY % comment.module "INCLUDE">
-<![ %comment.module; [
-<!--FUTURE USE (V4.0):
-......................
-Comment will be renamed to Remark and will be excluded from itself.
-......................
--->
-<!ENTITY % local.comment.attrib "">
-<!ENTITY % comment.role.attrib "%role.attrib;">
-<!ELEMENT Comment - - ((%para.char.mix;)+) -(%ubiq.mix;)>
-<!ATTLIST Comment
- %common.attrib;
- %comment.role.attrib;
- %local.comment.attrib;
->
-<!--end of comment.module-->]]>
-
-<!ENTITY % epigraph.module "INCLUDE">
-<![ %epigraph.module; [
-<!ENTITY % local.epigraph.attrib "">
-<!ENTITY % epigraph.role.attrib "%role.attrib;">
-<!ELEMENT Epigraph - - (Attribution?, (%para.class;)+)>
-<!ATTLIST Epigraph
- %common.attrib;
- %epigraph.role.attrib;
- %local.epigraph.attrib;
->
-<!--ELEMENT Attribution (defined above)-->
-<!--end of epigraph.module-->]]>
-
-<!ENTITY % footnote.module "INCLUDE">
-<![ %footnote.module; [
-<!ENTITY % local.footnote.attrib "">
-<!ENTITY % footnote.role.attrib "%role.attrib;">
-<!ELEMENT Footnote - - ((%footnote.mix;)+) -(Footnote|%formal.class;)>
-<!ATTLIST Footnote
- %label.attrib;
- %common.attrib;
- %footnote.role.attrib;
- %local.footnote.attrib;
->
-<!--end of footnote.module-->]]>
-
-<!ENTITY % highlights.module "INCLUDE">
-<![ %highlights.module; [
-<!ENTITY % local.highlights.attrib "">
-<!ENTITY % highlights.role.attrib "%role.attrib;">
-<!ELEMENT Highlights - - ((%highlights.mix;)+) -(%ubiq.mix;|%formal.class;)>
-<!ATTLIST Highlights
- %common.attrib;
- %highlights.role.attrib;
- %local.highlights.attrib;
->
-<!--end of highlights.module-->]]>
-
-<!ENTITY % formalpara.module "INCLUDE">
-<![ %formalpara.module; [
-<!ENTITY % local.formalpara.attrib "">
-<!ENTITY % formalpara.role.attrib "%role.attrib;">
-<!ELEMENT FormalPara - O (Title, Para)>
-<!ATTLIST FormalPara
- %common.attrib;
- %formalpara.role.attrib;
- %local.formalpara.attrib;
->
-<!--end of formalpara.module-->]]>
-
-<!ENTITY % para.module "INCLUDE">
-<![ %para.module; [
-<!ENTITY % local.para.attrib "">
-<!ENTITY % para.role.attrib "%role.attrib;">
-<!ELEMENT Para - O ((%para.char.mix; | %para.mix;)+)>
-<!ATTLIST Para
- %common.attrib;
- %para.role.attrib;
- %local.para.attrib;
->
-<!--end of para.module-->]]>
-
-<!ENTITY % simpara.module "INCLUDE">
-<![ %simpara.module; [
-<!ENTITY % local.simpara.attrib "">
-<!ENTITY % simpara.role.attrib "%role.attrib;">
-<!ELEMENT SimPara - O ((%para.char.mix;)+)>
-<!ATTLIST SimPara
- %common.attrib;
- %simpara.role.attrib;
- %local.simpara.attrib;
->
-<!--end of simpara.module-->]]>
-
-<!ENTITY % admon.module "INCLUDE">
-<![ %admon.module; [
-<!ENTITY % local.admon.attrib "">
-<!ENTITY % admon.role.attrib "%role.attrib;">
-<!ELEMENT (%admon.class;) - - (Title?, (%admon.mix;)+) -(%admon.class;)>
-<!ATTLIST (%admon.class;)
- %common.attrib;
- %admon.role.attrib;
- %local.admon.attrib;
->
-<!--end of admon.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Lists ................................................................ -->
-
-<!-- GlossList ........................ -->
-
-<!ENTITY % glosslist.module "INCLUDE">
-<![ %glosslist.module; [
-<!ENTITY % local.glosslist.attrib "">
-<!ENTITY % glosslist.role.attrib "%role.attrib;">
-<!ELEMENT GlossList - - (GlossEntry+)>
-<!ATTLIST GlossList
- %common.attrib;
- %glosslist.role.attrib;
- %local.glosslist.attrib;
->
-<!--end of glosslist.module-->]]>
-
-<!ENTITY % glossentry.content.module "INCLUDE">
-<![ %glossentry.content.module; [
-<!ENTITY % glossentry.module "INCLUDE">
-<![ %glossentry.module; [
-<!ENTITY % local.glossentry.attrib "">
-<!ENTITY % glossentry.role.attrib "%role.attrib;">
-<!ELEMENT GlossEntry - O (GlossTerm, Acronym?, Abbrev?, (GlossSee|GlossDef+))>
-<!ATTLIST GlossEntry
- --
- SortAs: String by which the GlossEntry is to be sorted
- (alphabetized) in lieu of its proper content
- --
- SortAs CDATA #IMPLIED
- %common.attrib;
- %glossentry.role.attrib;
- %local.glossentry.attrib;
->
-<!--end of glossentry.module-->]]>
-
-<!--FUTURE USE (V4.0):
-......................
-GlossTerm will be excluded from itself. Also, GlossTerm *may* be split
-into an element that appears in a Glossary and an element that can
-appear in the main text.
-......................
--->
-<!--ELEMENT GlossTerm (defined in the Inlines section, below)-->
-<!ENTITY % glossdef.module "INCLUDE">
-<![ %glossdef.module; [
-<!ENTITY % local.glossdef.attrib "">
-<!ENTITY % glossdef.role.attrib "%role.attrib;">
-<!ELEMENT GlossDef - O ((%glossdef.mix;)+, GlossSeeAlso*)>
-<!--FUTURE USE (V4.0):
-......................
-The Subject attribute will be renamed Keyword.
-......................
--->
-<!ATTLIST GlossDef
- --
- Subject: List of subjects; keywords for the definition
- --
- Subject CDATA #IMPLIED
- %common.attrib;
- %glossdef.role.attrib;
- %local.glossdef.attrib;
->
-<!--end of glossdef.module-->]]>
-
-<!ENTITY % glosssee.module "INCLUDE">
-<![ %glosssee.module; [
-<!ENTITY % local.glosssee.attrib "">
-<!ENTITY % glosssee.role.attrib "%role.attrib;">
-<!ELEMENT GlossSee - O ((%para.char.mix;)+)>
-<!ATTLIST GlossSee
- --
- OtherTerm: Reference to the GlossEntry whose GlossTerm
- should be displayed at the point of the GlossSee
- --
- OtherTerm IDREF #CONREF
- %common.attrib;
- %glosssee.role.attrib;
- %local.glosssee.attrib;
->
-<!--end of glosssee.module-->]]>
-
-<!ENTITY % glossseealso.module "INCLUDE">
-<![ %glossseealso.module; [
-<!ENTITY % local.glossseealso.attrib "">
-<!ENTITY % glossseealso.role.attrib "%role.attrib;">
-<!ELEMENT GlossSeeAlso - O ((%para.char.mix;)+)>
-<!ATTLIST GlossSeeAlso
- --
- OtherTerm: Reference to the GlossEntry whose GlossTerm
- should be displayed at the point of the GlossSeeAlso
- --
- OtherTerm IDREF #CONREF
- %common.attrib;
- %glossseealso.role.attrib;
- %local.glossseealso.attrib;
->
-<!--end of glossseealso.module-->]]>
-<!--end of glossentry.content.module-->]]>
-
-<!-- ItemizedList and OrderedList ..... -->
-
-<!ENTITY % itemizedlist.module "INCLUDE">
-<![ %itemizedlist.module; [
-<!ENTITY % local.itemizedlist.attrib "">
-<!ENTITY % itemizedlist.role.attrib "%role.attrib;">
-<!ELEMENT ItemizedList - - (ListItem+)>
-<!ATTLIST ItemizedList
- --
- Spacing: Whether the vertical space in the list should be
- compressed
- --
- Spacing (Normal
- |Compact) #IMPLIED
- --
- Mark: Keyword, e.g., bullet, dash, checkbox, none;
- list of keywords and defaults are implementation specific
- --
- %mark.attrib;
- %common.attrib;
- %itemizedlist.role.attrib;
- %local.itemizedlist.attrib;
->
-<!--end of itemizedlist.module-->]]>
-
-<!ENTITY % orderedlist.module "INCLUDE">
-<![ %orderedlist.module; [
-<!ENTITY % local.orderedlist.attrib "">
-<!ENTITY % orderedlist.role.attrib "%role.attrib;">
-<!ELEMENT OrderedList - - (ListItem+)>
-<!ATTLIST OrderedList
- --
- Numeration: Style of ListItem numbered; default is expected
- to be Arabic
- --
- Numeration (Arabic
- |Upperalpha
- |Loweralpha
- |Upperroman
- |Lowerroman) #IMPLIED
- --
- InheritNum: Specifies for a nested list that the numbering
- of ListItems should include the number of the item
- within which they are nested (e.g., 1a and 1b within 1,
- rather than a and b)--
- InheritNum (Inherit
- |Ignore) Ignore
- --
- Continuation: Where list numbering begins afresh (Restarts,
- the default) or continues that of the immediately preceding
- list (Continues)
- --
- Continuation (Continues
- |Restarts) Restarts
- --
- Spacing: Whether the vertical space in the list should be
- compressed
- --
- Spacing (Normal
- |Compact) #IMPLIED
- %common.attrib;
- %orderedlist.role.attrib;
- %local.orderedlist.attrib;
->
-<!--end of orderedlist.module-->]]>
-
-<!ENTITY % listitem.module "INCLUDE">
-<![ %listitem.module; [
-<!ENTITY % local.listitem.attrib "">
-<!ENTITY % listitem.role.attrib "%role.attrib;">
-<!ELEMENT ListItem - O ((%component.mix;)+)>
-<!ATTLIST ListItem
- --
- Override: Indicates the mark to be used for this ListItem
- instead of the default mark or the mark specified by
- the Mark attribute on the enclosing ItemizedList
- --
- Override CDATA #IMPLIED
- %common.attrib;
- %listitem.role.attrib;
- %local.listitem.attrib;
->
-<!--end of listitem.module-->]]>
-
-<!-- SegmentedList .................... -->
-<!ENTITY % segmentedlist.content.module "INCLUDE">
-<![ %segmentedlist.content.module; [
-<!--FUTURE USE (V4.0):
-......................
-Two SegTitles will be required.
-......................
--->
-<!ENTITY % segmentedlist.module "INCLUDE">
-<![ %segmentedlist.module; [
-<!ENTITY % local.segmentedlist.attrib "">
-<!ENTITY % segmentedlist.role.attrib "%role.attrib;">
-<!ELEMENT SegmentedList - - ((%formalobject.title.content;)?, SegTitle*,
- SegListItem+)>
-<!ATTLIST SegmentedList
- %common.attrib;
- %segmentedlist.role.attrib;
- %local.segmentedlist.attrib;
->
-<!--end of segmentedlist.module-->]]>
-
-<!ENTITY % segtitle.module "INCLUDE">
-<![ %segtitle.module; [
-<!ENTITY % local.segtitle.attrib "">
-<!ENTITY % segtitle.role.attrib "%role.attrib;">
-<!ELEMENT SegTitle - O ((%title.char.mix;)+)>
-<!ATTLIST SegTitle
- %common.attrib;
- %segtitle.role.attrib;
- %local.segtitle.attrib;
->
-<!--end of segtitle.module-->]]>
-
-<!ENTITY % seglistitem.module "INCLUDE">
-<![ %seglistitem.module; [
-<!ENTITY % local.seglistitem.attrib "">
-<!ENTITY % seglistitem.role.attrib "%role.attrib;">
-<!ELEMENT SegListItem - O (Seg, Seg+)>
-<!ATTLIST SegListItem
- %common.attrib;
- %seglistitem.role.attrib;
- %local.seglistitem.attrib;
->
-<!--end of seglistitem.module-->]]>
-
-<!ENTITY % seg.module "INCLUDE">
-<![ %seg.module; [
-<!ENTITY % local.seg.attrib "">
-<!ENTITY % seg.role.attrib "%role.attrib;">
-<!ELEMENT Seg - O ((%para.char.mix;)+)>
-<!ATTLIST Seg
- %common.attrib;
- %seg.role.attrib;
- %local.seg.attrib;
->
-<!--end of seg.module-->]]>
-<!--end of segmentedlist.content.module-->]]>
-
-<!-- SimpleList ....................... -->
-
-<!ENTITY % simplelist.content.module "INCLUDE">
-<![ %simplelist.content.module; [
-<!ENTITY % simplelist.module "INCLUDE">
-<![ %simplelist.module; [
-<!ENTITY % local.simplelist.attrib "">
-<!ENTITY % simplelist.role.attrib "%role.attrib;">
-<!ELEMENT SimpleList - - (Member+)>
-<!ATTLIST SimpleList
- --
- Columns: The number of columns the array should contain
- --
- Columns NUMBER #IMPLIED
- --
- Type: How the Members of the SimpleList should be
- formatted: Inline (members separated with commas etc.
- inline), Vert (top to bottom in n Columns), or Horiz (in
- the direction of text flow) in n Columns. If Column
- is 1 or implied, Type=Vert and Type=Horiz give the same
- results.
- --
- Type (Inline
- |Vert
- |Horiz) Vert
- %common.attrib;
- %simplelist.role.attrib;
- %local.simplelist.attrib;
->
-<!--end of simplelist.module-->]]>
-
-<!ENTITY % member.module "INCLUDE">
-<![ %member.module; [
-<!ENTITY % local.member.attrib "">
-<!ENTITY % member.role.attrib "%role.attrib;">
-<!ELEMENT Member - O ((%para.char.mix;)+)>
-<!ATTLIST Member
- %common.attrib;
- %member.role.attrib;
- %local.member.attrib;
->
-<!--end of member.module-->]]>
-<!--end of simplelist.content.module-->]]>
-
-<!-- VariableList ..................... -->
-
-<!ENTITY % variablelist.content.module "INCLUDE">
-<![ %variablelist.content.module; [
-<!ENTITY % variablelist.module "INCLUDE">
-<![ %variablelist.module; [
-<!ENTITY % local.variablelist.attrib "">
-<!ENTITY % variablelist.role.attrib "%role.attrib;">
-<!ELEMENT VariableList - - ((%formalobject.title.content;)?, VarListEntry+)>
-<!ATTLIST VariableList
- --
- TermLength: Length beyond which the presentation engine
- may consider the Term too long and select an alternate
- presentation of the Term and, or, its associated ListItem.
- --
- TermLength CDATA #IMPLIED
- %common.attrib;
- %variablelist.role.attrib;
- %local.variablelist.attrib;
->
-<!--end of variablelist.module-->]]>
-
-<!ENTITY % varlistentry.module "INCLUDE">
-<![ %varlistentry.module; [
-<!ENTITY % local.varlistentry.attrib "">
-<!ENTITY % varlistentry.role.attrib "%role.attrib;">
-<!ELEMENT VarListEntry - O (Term+, ListItem)>
-<!ATTLIST VarListEntry
- %common.attrib;
- %varlistentry.role.attrib;
- %local.varlistentry.attrib;
->
-<!--end of varlistentry.module-->]]>
-
-<!ENTITY % term.module "INCLUDE">
-<![ %term.module; [
-<!ENTITY % local.term.attrib "">
-<!ENTITY % term.role.attrib "%role.attrib;">
-<!ELEMENT Term - O ((%para.char.mix;)+)>
-<!ATTLIST Term
- %common.attrib;
- %term.role.attrib;
- %local.term.attrib;
->
-<!--end of term.module-->]]>
-
-<!--ELEMENT ListItem (defined above)-->
-<!--end of variablelist.content.module-->]]>
-
-<!-- CalloutList ...................... -->
-
-<!ENTITY % calloutlist.content.module "INCLUDE">
-<![ %calloutlist.content.module; [
-<!ENTITY % calloutlist.module "INCLUDE">
-<![ %calloutlist.module; [
-<!ENTITY % local.calloutlist.attrib "">
-<!ENTITY % calloutlist.role.attrib "%role.attrib;">
-<!ELEMENT CalloutList - - ((%formalobject.title.content;)?, Callout+)>
-<!ATTLIST CalloutList
- %common.attrib;
- %calloutlist.role.attrib;
- %local.calloutlist.attrib;
->
-<!--end of calloutlist.module-->]]>
-
-<!ENTITY % callout.module "INCLUDE">
-<![ %callout.module; [
-<!ENTITY % local.callout.attrib "">
-<!ENTITY % callout.role.attrib "%role.attrib;">
-<!ELEMENT Callout - O ((%component.mix;)+)>
-<!ATTLIST Callout
- --
- AreaRefs: IDs of one or more Areas or AreaSets described
- by this Callout
- --
- AreaRefs IDREFS #REQUIRED
- %common.attrib;
- %callout.role.attrib;
- %local.callout.attrib;
->
-<!--end of callout.module-->]]>
-<!--end of calloutlist.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Objects .............................................................. -->
-
-<!-- Examples etc. .................... -->
-
-<!ENTITY % example.module "INCLUDE">
-<![ %example.module; [
-<!ENTITY % local.example.attrib "">
-<!ENTITY % example.role.attrib "%role.attrib;">
-<!ELEMENT Example - - ((%formalobject.title.content;), (%example.mix;)+)
- -(%formal.class;)>
-<!ATTLIST Example
- %label.attrib;
- %width.attrib;
- %common.attrib;
- %example.role.attrib;
- %local.example.attrib;
->
-<!--end of example.module-->]]>
-
-<!ENTITY % informalexample.module "INCLUDE">
-<![ %informalexample.module; [
-<!ENTITY % local.informalexample.attrib "">
-<!ENTITY % informalexample.role.attrib "%role.attrib;">
-<!ELEMENT InformalExample - - ((%example.mix;)+)>
-<!ATTLIST InformalExample
- %width.attrib;
- %common.attrib;
- %informalexample.role.attrib;
- %local.informalexample.attrib;
->
-<!--end of informalexample.module-->]]>
-
-<!ENTITY % programlistingco.module "INCLUDE">
-<![ %programlistingco.module; [
-<!ENTITY % local.programlistingco.attrib "">
-<!ENTITY % programlistingco.role.attrib "%role.attrib;">
-<!ELEMENT ProgramListingCO - - (AreaSpec, ProgramListing, CalloutList*)>
-<!ATTLIST ProgramListingCO
- %common.attrib;
- %programlistingco.role.attrib;
- %local.programlistingco.attrib;
->
-<!--ELEMENT CalloutList (defined above in Lists)-->
-<!--end of informalexample.module-->]]>
-
-<!ENTITY % areaspec.content.module "INCLUDE">
-<![ %areaspec.content.module; [
-<!ENTITY % areaspec.module "INCLUDE">
-<![ %areaspec.module; [
-<!ENTITY % local.areaspec.attrib "">
-<!ENTITY % areaspec.role.attrib "%role.attrib;">
-<!ELEMENT AreaSpec - - ((Area|AreaSet)+)>
-<!ATTLIST AreaSpec
- --
- Units: global unit of measure in which coordinates in
- this spec are expressed:
-
- - CALSPair "x1,y1 x2,y2": lower-left and upper-right
- coordinates in a rectangle describing repro area in which
- graphic is placed, where X and Y dimensions are each some
- number 0..10000 (taken from CALS graphic attributes)
-
- - LineColumn "line column": line number and column number
- at which to start callout text in "linespecific" content
-
- - LineRange "startline endline": whole lines from startline
- to endline in "linespecific" content
-
- - LineColumnPair "line1 col1 line2 col2": starting and ending
- points of area in "linespecific" content that starts at
- first position and ends at second position (including the
- beginnings of any intervening lines)
-
- - Other: directive to look at value of OtherUnits attribute
- to get implementation-specific keyword
-
- The default is implementation-specific; usually dependent on
- the parent element (GraphicCO gets CALSPair, ProgramListingCO
- and ScreenCO get LineColumn)
- --
- Units (CALSPair
- |LineColumn
- |LineRange
- |LineColumnPair
- |Other) #IMPLIED
- --
- OtherUnits: User-defined units
- --
- OtherUnits NAME #IMPLIED
- %common.attrib;
- %areaspec.role.attrib;
- %local.areaspec.attrib;
->
-<!--end of areaspec.module-->]]>
-
-<!ENTITY % area.module "INCLUDE">
-<![ %area.module; [
-<!ENTITY % local.area.attrib "">
-<!ENTITY % area.role.attrib "%role.attrib;">
-<!ELEMENT Area - O EMPTY>
-<!ATTLIST Area
- %label.attrib; --bug number/symbol override or initialization--
- %linkends.attrib; --to any related information--
- --
- Units: unit of measure in which coordinates in this
- area are expressed; inherits from AreaSet and AreaSpec
- --
- Units (CALSPair
- |LineColumn
- |LineRange
- |LineColumnPair
- |Other) #IMPLIED
- --
- OtherUnits: User-defined units
- --
- OtherUnits NAME #IMPLIED
- Coords CDATA #REQUIRED
- %idreq.common.attrib;
- %area.role.attrib;
- %local.area.attrib;
->
-<!--end of area.module-->]]>
-
-<!ENTITY % areaset.module "INCLUDE">
-<![ %areaset.module; [
-<!ENTITY % local.areaset.attrib "">
-<!ENTITY % areaset.role.attrib "%role.attrib;">
-<!ELEMENT AreaSet - - (Area+)>
-<!ATTLIST AreaSet
- %label.attrib; --bug number/symbol override or initialization--
-
- --
- Units: unit of measure in which coordinates in this
- area are expressed; inherits from AreaSpec
- --
- Units (CALSPair
- |LineColumn
- |LineRange
- |LineColumnPair
- |Other) #IMPLIED
- OtherUnits NAME #IMPLIED
- Coords CDATA #REQUIRED
- %idreq.common.attrib;
- %areaset.role.attrib;
- %local.area.attrib;
->
-<!--end of areaset.module-->]]>
-<!--end of areaspec.content.module-->]]>
-
-<!ENTITY % programlisting.module "INCLUDE">
-<![ %programlisting.module; [
-<!ENTITY % local.programlisting.attrib "">
-<!ENTITY % programlisting.role.attrib "%role.attrib;">
-<!ELEMENT ProgramListing - - ((%programlisting.content;)+)>
-<!ATTLIST ProgramListing
- %width.attrib;
- %linespecific.attrib;
- %common.attrib;
- %programlisting.role.attrib;
- %local.programlisting.attrib;
->
-<!--end of programlisting.module-->]]>
-
-<!ENTITY % literallayout.module "INCLUDE">
-<![ %literallayout.module; [
-<!ENTITY % local.literallayout.attrib "">
-<!ENTITY % literallayout.role.attrib "%role.attrib;">
-<!ELEMENT LiteralLayout - - ((LineAnnotation | %para.char.mix;)+)>
-<!ATTLIST LiteralLayout
- %width.attrib;
- %linespecific.attrib;
- %common.attrib;
- %literallayout.role.attrib;
- %local.literallayout.attrib;
->
-<!--ELEMENT LineAnnotation (defined in the Inlines section, below)-->
-<!--end of literallayout.module-->]]>
-
-<!ENTITY % screenco.module "INCLUDE">
-<![ %screenco.module; [
-<!ENTITY % local.screenco.attrib "">
-<!ENTITY % screenco.role.attrib "%role.attrib;">
-<!ELEMENT ScreenCO - - (AreaSpec, Screen, CalloutList*)>
-<!ATTLIST ScreenCO
- %common.attrib;
- %screenco.role.attrib;
- %local.screenco.attrib;
->
-<!--ELEMENT AreaSpec (defined above)-->
-<!--ELEMENT CalloutList (defined above in Lists)-->
-<!--end of screenco.module-->]]>
-
-<!ENTITY % screen.module "INCLUDE">
-<![ %screen.module; [
-<!ENTITY % local.screen.attrib "">
-<!ENTITY % screen.role.attrib "%role.attrib;">
-<!ELEMENT Screen - - ((%screen.content;)+)>
-<!ATTLIST Screen
- %width.attrib;
- %linespecific.attrib;
- %common.attrib;
- %screen.role.attrib;
- %local.screen.attrib;
->
-<!--end of screen.module-->]]>
-
-<!ENTITY % screenshot.content.module "INCLUDE">
-<![ %screenshot.content.module; [
-<!ENTITY % screenshot.module "INCLUDE">
-<![ %screenshot.module; [
-<!ENTITY % local.screenshot.attrib "">
-<!ENTITY % screenshot.role.attrib "%role.attrib;">
-<!ELEMENT ScreenShot - - (ScreenInfo?, (Graphic|GraphicCO))>
-<!ATTLIST ScreenShot
- %common.attrib;
- %screenshot.role.attrib;
- %local.screenshot.attrib;
->
-<!--end of screenshot.module-->]]>
-
-<!ENTITY % screeninfo.module "INCLUDE">
-<![ %screeninfo.module; [
-<!ENTITY % local.screeninfo.attrib "">
-<!ENTITY % screeninfo.role.attrib "%role.attrib;">
-<!ELEMENT ScreenInfo - O ((%para.char.mix;)+) -(%ubiq.mix;)>
-<!ATTLIST ScreenInfo
- %common.attrib;
- %screeninfo.role.attrib;
- %local.screeninfo.attrib;
->
-<!--end of screeninfo.module-->]]>
-<!--end of screenshot.content.module-->]]>
-
-<!-- Figures etc. ..................... -->
-
-<!ENTITY % figure.module "INCLUDE">
-<![ %figure.module; [
-<!ENTITY % local.figure.attrib "">
-<!ENTITY % figure.role.attrib "%role.attrib;">
-<!ELEMENT Figure - - ((%formalobject.title.content;), (%figure.mix; |
- %link.char.class;)+)>
-<!ATTLIST Figure
- --
- Float: Whether the Figure is supposed to be rendered
- where convenient (yes (1) value) or at the place it occurs
- in the text (no (0) value, the default)
- --
- Float %yesorno.attvals; %no.attval;
- %label.attrib;
- %common.attrib;
- %figure.role.attrib;
- %local.figure.attrib;
->
-<!--end of figure.module-->]]>
-
-<!ENTITY % graphicco.module "INCLUDE">
-<![ %graphicco.module; [
-<!ENTITY % local.graphicco.attrib "">
-<!ENTITY % graphicco.role.attrib "%role.attrib;">
-<!ELEMENT GraphicCO - - (AreaSpec, Graphic, CalloutList*)>
-<!ATTLIST GraphicCO
- %common.attrib;
- %graphicco.role.attrib;
- %local.graphicco.attrib;
->
-<!--ELEMENT AreaSpec (defined above in Examples)-->
-<!--ELEMENT CalloutList (defined above in Lists)-->
-<!--end of graphicco.module-->]]>
-
-<!-- Graphical data can be the content of Graphic, or you can reference
- an external file either as an entity (Entitref) or a filename
- (Fileref). -->
-
-<!ENTITY % graphic.module "INCLUDE">
-<![ %graphic.module; [
-<!--FUTURE USE (V4.0):
-......................
-Graphic will be declared EMPTY. This change will require that end-tags
-be removed and that any embedded graphic content be stored outside the
-SGML source and pointed to from an Entityref or Fileref attribute.
-......................
--->
-<!ENTITY % local.graphic.attrib "">
-<!ENTITY % graphic.role.attrib "%role.attrib;">
-<!ELEMENT Graphic - - CDATA>
-<!ATTLIST Graphic
- %graphics.attrib;
- %common.attrib;
- %graphic.role.attrib;
- %local.graphic.attrib;
->
-<!--end of graphic.module-->]]>
-
-<!ENTITY % inlinegraphic.module "INCLUDE">
-<![ %inlinegraphic.module; [
-<!--FUTURE USE (V4.0):
-......................
-InlineGraphic will be declared EMPTY. This change will require that
-end-tags be removed and that any embedded graphic content be stored
-outside the SGML source and pointed to from an Entityref or Fileref
-attribute.
-......................
--->
-<!ENTITY % local.inlinegraphic.attrib "">
-<!ENTITY % inlinegraphic.role.attrib "%role.attrib;">
-<!ELEMENT InlineGraphic - - CDATA>
-<!ATTLIST InlineGraphic
- %graphics.attrib;
- %common.attrib;
- %inlinegraphic.role.attrib;
- %local.inlinegraphic.attrib;
->
-<!--end of inlinegraphic.module-->]]>
-
-<!-- Equations ........................ -->
-
-<!ENTITY % equation.module "INCLUDE">
-<![ %equation.module; [
-<!ENTITY % local.equation.attrib "">
-<!ENTITY % equation.role.attrib "%role.attrib;">
-<!ELEMENT Equation - - ((%formalobject.title.content;)?, (InformalEquation |
- (Alt?, %equation.content;)))>
-<!ATTLIST Equation
- %label.attrib;
- %common.attrib;
- %equation.role.attrib;
- %local.equation.attrib;
->
-<!--end of equation.module-->]]>
-
-<!ENTITY % informalequation.module "INCLUDE">
-<![ %informalequation.module; [
-<!ENTITY % local.informalequation.attrib "">
-<!ENTITY % informalequation.role.attrib "%role.attrib;">
-<!ELEMENT InformalEquation - - (Alt?, %equation.content;)>
-<!ATTLIST InformalEquation
- %common.attrib;
- %informalequation.role.attrib;
- %local.informalequation.attrib;
->
-<!--end of informalequation.module-->]]>
-
-<!ENTITY % inlineequation.module "INCLUDE">
-<![ %inlineequation.module; [
-<!ENTITY % local.inlineequation.attrib "">
-<!ENTITY % inlineequation.role.attrib "%role.attrib;">
-<!ELEMENT InlineEquation - - (Alt?, %inlineequation.content;)>
-<!ATTLIST InlineEquation
- %common.attrib;
- %inlineequation.role.attrib;
- %local.inlineequation.attrib;
->
-<!--end of inlineequation.module-->]]>
-
-<!ENTITY % alt.module "INCLUDE">
-<![ %alt.module; [
-<!ENTITY % local.alt.attrib "">
-<!ENTITY % alt.role.attrib "%role.attrib;">
-<!ELEMENT Alt - - (#PCDATA)>
-<!ATTLIST Alt
- %common.attrib;
- %alt.role.attrib;
- %local.alt.attrib;
->
-<!--end of alt.module-->]]>
-
-<!-- Tables ........................... -->
-
-<!ENTITY % table.module "INCLUDE">
-<![ %table.module; [
-
-<!ENTITY % tables.role.attrib "%role.attrib;">
-
-<!-- Add Label attribute to Table element (and InformalTable element). -->
-<!ENTITY % bodyatt "%label.attrib;">
-
-<!-- Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
- EntryTbl, and Entry (and InformalTable element). -->
-<!ENTITY % secur
- "%common.attrib;
- %tables.role.attrib;">
-
-<!-- Remove Chart. -->
-<!ENTITY % tbl.table.name "Table">
-
-<!-- Content model for Table. -->
-<!ENTITY % tbl.table.mdl
- "((%formalobject.title.content;), (Graphic+|TGroup+))">
-
-<!-- Exclude all DocBook tables and formal objects. -->
-<!ENTITY % tbl.table.excep "-(InformalTable|%formal.class;)">
-
-<!-- Remove pgbrk exception on Row. -->
-<!ENTITY % tbl.row.excep "">
-
-<!-- Allow either objects or inlines; beware of REs between elements. -->
-<!ENTITY % tbl.entry.mdl "((%tabentry.mix;)+ | (%para.char.mix;)+)">
-
-<!-- Remove pgbrk exception on Entry. -->
-<!ENTITY % tbl.entry.excep "">
-
-<!-- Remove pgbrk exception on EntryTbl, but leave exclusion of itself. -->
-<!ENTITY % tbl.entrytbl.excep "-(EntryTbl)">
-
-<!-- Reference CALS table module. -->
-<!ENTITY % calstbls PUBLIC "-//USA-DOD//DTD Table Model 951010//EN">
-%calstbls;
-<!--end of table.module-->]]>
-
-<!ENTITY % informaltable.module "INCLUDE">
-<![ %informaltable.module; [
-
-<!-- Note that InformalTable is dependent on some of the entity
- declarations that customize Table. -->
-
-<!ENTITY % local.informaltable.attrib "">
-<!ELEMENT InformalTable - - (Graphic+|TGroup+) %tbl.table.excep;>
-<!ATTLIST InformalTable
- --
- Frame, Colsep, and Rowsep must be repeated because
- they are not in entities in the table module.
- --
- Frame (Top
- |Bottom
- |Topbot
- |All
- |Sides
- |None) #IMPLIED
- Colsep %yesorno.attvals; #IMPLIED
- Rowsep %yesorno.attvals; #IMPLIED
- %tbl.table.att; -- includes TabStyle, ToCentry, ShortEntry,
- Orient, PgWide --
- %bodyatt; -- includes Label --
- %secur; -- includes common attributes --
- %local.informaltable.attrib;
->
-<!--end of informaltable.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Synopses ............................................................. -->
-
-<!-- Synopsis ......................... -->
-
-<!ENTITY % synopsis.module "INCLUDE">
-<![ %synopsis.module; [
-<!ENTITY % local.synopsis.attrib "">
-<!ENTITY % synopsis.role.attrib "%role.attrib;">
-<!ELEMENT Synopsis - - ((LineAnnotation | %para.char.mix; | Graphic)+)>
-<!ATTLIST Synopsis
- %label.attrib;
- %linespecific.attrib;
- %common.attrib;
- %synopsis.role.attrib;
- %local.synopsis.attrib;
->
-
-<!--ELEMENT LineAnnotation (defined in the Inlines section, below)-->
-<!--end of synopsis.module-->]]>
-
-<!-- CmdSynopsis ...................... -->
-
-<!ENTITY % cmdsynopsis.content.module "INCLUDE">
-<![ %cmdsynopsis.content.module; [
-<!ENTITY % cmdsynopsis.module "INCLUDE">
-<![ %cmdsynopsis.module; [
-<!ENTITY % local.cmdsynopsis.attrib "">
-<!ENTITY % cmdsynopsis.role.attrib "%role.attrib;">
-<!ELEMENT CmdSynopsis - - ((Command | Arg | Group | SBR)+, SynopFragment*)>
-<!ATTLIST CmdSynopsis
- %label.attrib;
- --
- Sepchar: Character that should separate command and all
- top-level arguments; alternate value might be e.g., &Delta;
- --
- Sepchar CDATA " "
- %common.attrib;
- %cmdsynopsis.role.attrib;
- %local.cmdsynopsis.attrib;
->
-<!--end of cmdsynopsis.module-->]]>
-
-<!ENTITY % arg.module "INCLUDE">
-<![ %arg.module; [
-<!ENTITY % local.arg.attrib "">
-<!ENTITY % arg.role.attrib "%role.attrib;">
-<!ELEMENT Arg - - ((#PCDATA
- | Arg
- | Group
- | Option
- | SynopFragmentRef
- | Replaceable
- | SBR)+)>
-<!ATTLIST Arg
- --
- Choice: Whether Arg must be supplied: Opt (optional to
- supply, e.g. [arg]; the default), Req (required to supply,
- e.g. {arg}), or Plain (required to supply, e.g. arg)
- --
- Choice (Opt
- |Req
- |Plain) Opt
- --
- Rep: whether Arg is repeatable: Norepeat (e.g. arg without
- ellipsis; the default), or Repeat (e.g. arg...)
- --
- Rep (Norepeat
- |Repeat) Norepeat
- %common.attrib;
- %arg.role.attrib;
- %local.arg.attrib;
->
-<!--end of arg.module-->]]>
-
-<!ENTITY % group.module "INCLUDE">
-<![ %group.module; [
-<!--FUTURE USE (V4.0):
-......................
-The OptMult and ReqMult values for the Choice attribute on Group will be
-removed. Use the Rep attribute instead to indicate that the choice is
-repeatable.
-......................
--->
-
-<!ENTITY % local.group.attrib "">
-<!ENTITY % group.role.attrib "%role.attrib;">
-<!ELEMENT Group - - ((Arg | Group | Option | SynopFragmentRef
- | Replaceable | SBR)+)>
-<!ATTLIST Group
- --
- Choice: Whether Group must be supplied: Opt (optional to
- supply, e.g. [g1|g2|g3]; the default), Req (required to
- supply, e.g. {g1|g2|g3}), Plain (required to supply,
- e.g. g1|g2|g3), OptMult (can supply zero or more, e.g.
- [[g1|g2|g3]]), or ReqMult (must supply one or more, e.g.
- {{g1|g2|g3}})
- --
- Choice (Opt
- |Req
- |Plain
- |Optmult
- |Reqmult) Opt
- --
- Rep: whether Group is repeatable: Norepeat (e.g. group
- without ellipsis; the default), or Repeat (e.g. group...)
- --
- Rep (Norepeat
- |Repeat) Norepeat
- %common.attrib;
- %group.role.attrib;
- %local.group.attrib;
->
-<!--end of group.module-->]]>
-
-<!ENTITY % sbr.module "INCLUDE">
-<![ %sbr.module; [
-<!ENTITY % local.sbr.attrib "">
-<!-- Synopsis break -->
-<!ENTITY % sbr.role.attrib "%role.attrib;">
-<!ELEMENT SBR - O EMPTY>
-<!ATTLIST SBR
- %common.attrib;
- %sbr.role.attrib;
- %local.sbr.attrib;
->
-<!--end of sbr.module-->]]>
-
-<!ENTITY % synopfragmentref.module "INCLUDE">
-<![ %synopfragmentref.module; [
-<!ENTITY % local.synopfragmentref.attrib "">
-<!ENTITY % synopfragmentref.role.attrib "%role.attrib;">
-<!ELEMENT SynopFragmentRef - - RCDATA >
-<!ATTLIST SynopFragmentRef
- %linkendreq.attrib; --to SynopFragment of complex synopsis
- material for separate referencing--
- %common.attrib;
- %synopfragmentref.role.attrib;
- %local.synopfragmentref.attrib;
->
-<!--end of synopfragmentref.module-->]]>
-
-<!ENTITY % synopfragment.module "INCLUDE">
-<![ %synopfragment.module; [
-<!ENTITY % local.synopfragment.attrib "">
-<!ENTITY % synopfragment.role.attrib "%role.attrib;">
-<!ELEMENT SynopFragment - - ((Arg | Group)+)>
-<!ATTLIST SynopFragment
- %idreq.common.attrib;
- %synopfragment.role.attrib;
- %local.synopfragment.attrib;
->
-<!--end of synopfragment.module-->]]>
-
-<!--ELEMENT Command (defined in the Inlines section, below)-->
-<!--ELEMENT Option (defined in the Inlines section, below)-->
-<!--ELEMENT Replaceable (defined in the Inlines section, below)-->
-<!--end of cmdsynopsis.content.module-->]]>
-
-<!-- FuncSynopsis ..................... -->
-
-<!ENTITY % funcsynopsis.content.module "INCLUDE">
-<![ %funcsynopsis.content.module; [
-<!ENTITY % funcsynopsis.module "INCLUDE">
-<![ %funcsynopsis.module; [
-<!--FUTURE USE (V4.0):
-......................
-The content model group starting with FuncDef will not be available; you
-will have to use FuncPrototype. Also, you will be able to have a
-mixture of FuncPrototypes and FuncSynopsisInfos (this is not
-backwards-incompatible all by itself).
-
-<!ELEMENT FuncSynopsis - - ((FuncSynopsisInfo|FuncPrototype)+)>
-......................
--->
-
-<!ENTITY % local.funcsynopsis.attrib "">
-<!ENTITY % funcsynopsis.role.attrib "%role.attrib;">
-<!ELEMENT FuncSynopsis - - (FuncSynopsisInfo?, (FuncPrototype+ |
- (FuncDef, (Void | VarArgs | ParamDef+))+), FuncSynopsisInfo?)>
-<!ATTLIST FuncSynopsis
- %label.attrib;
- %common.attrib;
- %funcsynopsis.role.attrib;
- %local.funcsynopsis.attrib;
->
-<!--end of funcsynopsis.module-->]]>
-
-<!ENTITY % funcsynopsisinfo.module "INCLUDE">
-<![ %funcsynopsisinfo.module; [
-<!ENTITY % local.funcsynopsisinfo.attrib "">
-<!ENTITY % funcsynopsisinfo.role.attrib "%role.attrib;">
-<!ELEMENT FuncSynopsisInfo - O ((LineAnnotation | %cptr.char.mix;)* )>
-<!ATTLIST FuncSynopsisInfo
- %linespecific.attrib;
- %common.attrib;
- %funcsynopsisinfo.role.attrib;
- %local.funcsynopsisinfo.attrib;
->
-<!--end of funcsynopsisinfo.module-->]]>
-
-<!ENTITY % funcprototype.module "INCLUDE">
-<![ %funcprototype.module; [
-<!ENTITY % local.funcprototype.attrib "">
-<!ENTITY % funcprototype.role.attrib "%role.attrib;">
-<!ELEMENT FuncPrototype - O (FuncDef, (Void | VarArgs | ParamDef+))>
-<!ATTLIST FuncPrototype
- %common.attrib;
- %funcprototype.role.attrib;
- %local.funcprototype.attrib;
->
-<!--end of funcprototype.module-->]]>
-
-<!ENTITY % funcdef.module "INCLUDE">
-<![ %funcdef.module; [
-<!ENTITY % local.funcdef.attrib "">
-<!ENTITY % funcdef.role.attrib "%role.attrib;">
-<!ELEMENT FuncDef - - ((#PCDATA
- | Replaceable
- | Function)*)>
-<!ATTLIST FuncDef
- %common.attrib;
- %funcdef.role.attrib;
- %local.funcdef.attrib;
->
-<!--end of funcdef.module-->]]>
-
-<!ENTITY % void.module "INCLUDE">
-<![ %void.module; [
-<!ENTITY % local.void.attrib "">
-<!ENTITY % void.role.attrib "%role.attrib;">
-<!ELEMENT Void - O EMPTY>
-<!ATTLIST Void
- %common.attrib;
- %void.role.attrib;
- %local.void.attrib;
->
-<!--end of void.module-->]]>
-
-<!ENTITY % varargs.module "INCLUDE">
-<![ %varargs.module; [
-<!ENTITY % local.varargs.attrib "">
-<!ENTITY % varargs.role.attrib "%role.attrib;">
-<!ELEMENT VarArgs - O EMPTY>
-<!ATTLIST VarArgs
- %common.attrib;
- %varargs.role.attrib;
- %local.varargs.attrib;
->
-<!--end of varargs.module-->]]>
-
-<!-- Processing assumes that only one Parameter will appear in a
- ParamDef, and that FuncParams will be used at most once, for
- providing information on the "inner parameters" for parameters that
- are pointers to functions. -->
-
-<!ENTITY % paramdef.module "INCLUDE">
-<![ %paramdef.module; [
-<!ENTITY % local.paramdef.attrib "">
-<!ENTITY % paramdef.role.attrib "%role.attrib;">
-<!ELEMENT ParamDef - - ((#PCDATA
- | Replaceable
- | Parameter
- | FuncParams)*)>
-<!ATTLIST ParamDef
- %common.attrib;
- %paramdef.role.attrib;
- %local.paramdef.attrib;
->
-<!--end of paramdef.module-->]]>
-
-<!ENTITY % funcparams.module "INCLUDE">
-<![ %funcparams.module; [
-<!ENTITY % local.funcparams.attrib "">
-<!ENTITY % funcparams.role.attrib "%role.attrib;">
-<!ELEMENT FuncParams - - ((%cptr.char.mix;)*)>
-<!ATTLIST FuncParams
- %common.attrib;
- %funcparams.role.attrib;
- %local.funcparams.attrib;
->
-<!--end of funcparams.module-->]]>
-
-<!--ELEMENT LineAnnotation (defined in the Inlines section, below)-->
-<!--ELEMENT Replaceable (defined in the Inlines section, below)-->
-<!--ELEMENT Function (defined in the Inlines section, below)-->
-<!--ELEMENT Parameter (defined in the Inlines section, below)-->
-<!--end of funcsynopsis.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Document information entities and elements ........................... -->
-
-<!-- The document information elements include some elements that are
- currently used only in the document hierarchy module. They are
- defined here so that they will be available for use in customized
- document hierarchies. -->
-
-<!-- .................................. -->
-
-<!ENTITY % docinfo.content.module "INCLUDE">
-<![ %docinfo.content.module; [
-
-<!-- Ackno ............................ -->
-
-<!ENTITY % ackno.module "INCLUDE">
-<![ %ackno.module; [
-<!ENTITY % local.ackno.attrib "">
-<!ENTITY % ackno.role.attrib "%role.attrib;">
-<!ELEMENT Ackno - - ((%docinfo.char.mix;)+)>
-<!ATTLIST Ackno
- %common.attrib;
- %ackno.role.attrib;
- %local.ackno.attrib;
->
-<!--end of ackno.module-->]]>
-
-<!-- Address .......................... -->
-
-<!ENTITY % address.content.module "INCLUDE">
-<![ %address.content.module; [
-<!ENTITY % address.module "INCLUDE">
-<![ %address.module; [
-<!ENTITY % local.address.attrib "">
-<!ENTITY % address.role.attrib "%role.attrib;">
-<!ELEMENT Address - - (#PCDATA|Street|POB|Postcode|City|State|Country|Phone
- |Fax|Email|OtherAddr)*>
-<!ATTLIST Address
- %linespecific.attrib;
- %common.attrib;
- %address.role.attrib;
- %local.address.attrib;
->
-<!--end of address.module-->]]>
-
- <!ENTITY % street.module "INCLUDE">
- <![ %street.module; [
- <!ENTITY % local.street.attrib "">
- <!ENTITY % street.role.attrib "%role.attrib;">
- <!ELEMENT Street - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Street
- %common.attrib;
- %street.role.attrib;
- %local.street.attrib;
->
- <!--end of street.module-->]]>
-
- <!ENTITY % pob.module "INCLUDE">
- <![ %pob.module; [
- <!ENTITY % local.pob.attrib "">
- <!ENTITY % pob.role.attrib "%role.attrib;">
- <!ELEMENT POB - - ((%docinfo.char.mix;)+)>
- <!ATTLIST POB
- %common.attrib;
- %pob.role.attrib;
- %local.pob.attrib;
->
- <!--end of pob.module-->]]>
-
- <!ENTITY % postcode.module "INCLUDE">
- <![ %postcode.module; [
- <!ENTITY % local.postcode.attrib "">
- <!ENTITY % postcode.role.attrib "%role.attrib;">
- <!ELEMENT Postcode - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Postcode
- %common.attrib;
- %postcode.role.attrib;
- %local.postcode.attrib;
->
- <!--end of postcode.module-->]]>
-
- <!ENTITY % city.module "INCLUDE">
- <![ %city.module; [
- <!ENTITY % local.city.attrib "">
- <!ENTITY % city.role.attrib "%role.attrib;">
- <!ELEMENT City - - ((%docinfo.char.mix;)+)>
- <!ATTLIST City
- %common.attrib;
- %city.role.attrib;
- %local.city.attrib;
->
- <!--end of city.module-->]]>
-
- <!ENTITY % state.module "INCLUDE">
- <![ %state.module; [
- <!ENTITY % local.state.attrib "">
- <!ENTITY % state.role.attrib "%role.attrib;">
- <!ELEMENT State - - ((%docinfo.char.mix;)+)>
- <!ATTLIST State
- %common.attrib;
- %state.role.attrib;
- %local.state.attrib;
->
- <!--end of state.module-->]]>
-
- <!ENTITY % country.module "INCLUDE">
- <![ %country.module; [
- <!ENTITY % local.country.attrib "">
- <!ENTITY % country.role.attrib "%role.attrib;">
- <!ELEMENT Country - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Country
- %common.attrib;
- %role.attrib;
- %local.country.attrib;
->
- <!--end of country.module-->]]>
-
- <!ENTITY % phone.module "INCLUDE">
- <![ %phone.module; [
- <!ENTITY % local.phone.attrib "">
- <!ENTITY % phone.role.attrib "%role.attrib;">
- <!ELEMENT Phone - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Phone
- %common.attrib;
- %phone.role.attrib;
- %local.phone.attrib;
->
- <!--end of phone.module-->]]>
-
- <!ENTITY % fax.module "INCLUDE">
- <![ %fax.module; [
- <!ENTITY % local.fax.attrib "">
- <!ENTITY % fax.role.attrib "%role.attrib;">
- <!ELEMENT Fax - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Fax
- %common.attrib;
- %fax.role.attrib;
- %local.fax.attrib;
->
- <!--end of fax.module-->]]>
-
- <!--ELEMENT Email (defined in the Inlines section, below)-->
-
- <!ENTITY % otheraddr.module "INCLUDE">
- <![ %otheraddr.module; [
- <!ENTITY % local.otheraddr.attrib "">
- <!ENTITY % otheraddr.role.attrib "%role.attrib;">
- <!ELEMENT OtherAddr - - ((%docinfo.char.mix;)+)>
- <!ATTLIST OtherAddr
- %common.attrib;
- %otheraddr.role.attrib;
- %local.otheraddr.attrib;
->
- <!--end of otheraddr.module-->]]>
-<!--end of address.content.module-->]]>
-
-<!-- Affiliation ...................... -->
-
-<!ENTITY % affiliation.content.module "INCLUDE">
-<![ %affiliation.content.module; [
-<!ENTITY % affiliation.module "INCLUDE">
-<![ %affiliation.module; [
-<!ENTITY % local.affiliation.attrib "">
-<!ENTITY % affiliation.role.attrib "%role.attrib;">
-<!ELEMENT Affiliation - - (ShortAffil?, JobTitle*, OrgName?, OrgDiv*,
- Address*)>
-<!ATTLIST Affiliation
- %common.attrib;
- %affiliation.role.attrib;
- %local.affiliation.attrib;
->
-<!--end of affiliation.module-->]]>
-
- <!ENTITY % shortaffil.module "INCLUDE">
- <![ %shortaffil.module; [
- <!ENTITY % local.shortaffil.attrib "">
- <!ENTITY % shortaffil.role.attrib "%role.attrib;">
- <!ELEMENT ShortAffil - - ((%docinfo.char.mix;)+)>
- <!ATTLIST ShortAffil
- %common.attrib;
- %shortaffil.role.attrib;
- %local.shortaffil.attrib;
->
- <!--end of shortaffil.module-->]]>
-
- <!ENTITY % jobtitle.module "INCLUDE">
- <![ %jobtitle.module; [
- <!ENTITY % local.jobtitle.attrib "">
- <!ENTITY % jobtitle.role.attrib "%role.attrib;">
- <!ELEMENT JobTitle - - ((%docinfo.char.mix;)+)>
- <!ATTLIST JobTitle
- %common.attrib;
- %jobtitle.role.attrib;
- %local.jobtitle.attrib;
->
- <!--end of jobtitle.module-->]]>
-
- <!--ELEMENT OrgName (defined elsewhere in this section)-->
-
- <!ENTITY % orgdiv.module "INCLUDE">
- <![ %orgdiv.module; [
- <!ENTITY % local.orgdiv.attrib "">
- <!ENTITY % orgdiv.role.attrib "%role.attrib;">
- <!ELEMENT OrgDiv - - ((%docinfo.char.mix;)+)>
- <!ATTLIST OrgDiv
- %common.attrib;
- %orgdiv.role.attrib;
- %local.orgdiv.attrib;
->
- <!--end of orgdiv.module-->]]>
-
- <!--ELEMENT Address (defined elsewhere in this section)-->
-<!--end of affiliation.content.module-->]]>
-
-<!-- ArtPageNums ...................... -->
-
-<!ENTITY % artpagenums.module "INCLUDE">
-<![ %artpagenums.module; [
-<!ENTITY % local.artpagenums.attrib "">
-<!ENTITY % argpagenums.role.attrib "%role.attrib;">
-<!ELEMENT ArtPageNums - - ((%docinfo.char.mix;)+)>
-<!ATTLIST ArtPageNums
- %common.attrib;
- %argpagenums.role.attrib;
- %local.artpagenums.attrib;
->
-<!--end of artpagenums.module-->]]>
-
-<!-- Author ........................... -->
-
-<!ENTITY % author.module "INCLUDE">
-<![ %author.module; [
-<!--FUTURE USE (V4.0):
-......................
-AuthorBlurb and Affiliation will be removed from %person.ident.mix; and a new
-wrapper element created to allow association of those two elements with
-Author name information.
-......................
--->
-<!ENTITY % local.author.attrib "">
-<!ENTITY % author.role.attrib "%role.attrib;">
-<!ELEMENT Author - - ((%person.ident.mix;)+)>
-<!ATTLIST Author
- %common.attrib;
- %author.role.attrib;
- %local.author.attrib;
->
-<!--(see "Personal identity elements" for %person.ident.mix;)-->
-<!--end of author.module-->]]>
-
-<!-- AuthorGroup ...................... -->
-
-<!ENTITY % authorgroup.content.module "INCLUDE">
-<![ %authorgroup.content.module; [
-<!ENTITY % authorgroup.module "INCLUDE">
-<![ %authorgroup.module; [
-<!ENTITY % local.authorgroup.attrib "">
-<!ENTITY % authorgroup.role.attrib "%role.attrib;">
-<!ELEMENT AuthorGroup - - ((Author|Editor|Collab|CorpAuthor|OtherCredit)+)>
-<!ATTLIST AuthorGroup
- %common.attrib;
- %authorgroup.role.attrib;
- %local.authorgroup.attrib;
->
-<!--end of authorgroup.module-->]]>
-
- <!--ELEMENT Author (defined elsewhere in this section)-->
- <!--ELEMENT Editor (defined elsewhere in this section)-->
-
- <!ENTITY % collab.content.module "INCLUDE">
- <![ %collab.content.module; [
- <!ENTITY % collab.module "INCLUDE">
- <![ %collab.module; [
- <!ENTITY % local.collab.attrib "">
- <!ENTITY % collab.role.attrib "%role.attrib;">
- <!ELEMENT Collab - - (CollabName, Affiliation*)>
- <!ATTLIST Collab
- %common.attrib;
- %collab.role.attrib;
- %local.collab.attrib;
->
- <!--end of collab.module-->]]>
-
- <!ENTITY % collabname.module "INCLUDE">
- <![ %collabname.module; [
- <!ENTITY % local.collabname.attrib "">
- <!ENTITY % collabname.role.attrib "%role.attrib;">
- <!ELEMENT CollabName - - ((%docinfo.char.mix;)+)>
- <!ATTLIST CollabName
- %common.attrib;
- %collabname.role.attrib;
- %local.collabname.attrib;
->
- <!--end of collabname.module-->]]>
-
- <!--ELEMENT Affiliation (defined elsewhere in this section)-->
- <!--end of collab.content.module-->]]>
-
- <!--ELEMENT CorpAuthor (defined elsewhere in this section)-->
- <!--ELEMENT OtherCredit (defined elsewhere in this section)-->
-
-<!--end of authorgroup.content.module-->]]>
-
-<!-- AuthorInitials ................... -->
-
-<!ENTITY % authorinitials.module "INCLUDE">
-<![ %authorinitials.module; [
-<!ENTITY % local.authorinitials.attrib "">
-<!ENTITY % authorinitials.role.attrib "%role.attrib;">
-<!ELEMENT AuthorInitials - - ((%docinfo.char.mix;)+)>
-<!ATTLIST AuthorInitials
- %common.attrib;
- %authorinitials.role.attrib;
- %local.authorinitials.attrib;
->
-<!--end of authorinitials.module-->]]>
-
-<!-- ConfGroup ........................ -->
-
-<!ENTITY % confgroup.content.module "INCLUDE">
-<![ %confgroup.content.module; [
-<!ENTITY % confgroup.module "INCLUDE">
-<![ %confgroup.module; [
-<!ENTITY % local.confgroup.attrib "">
-<!ENTITY % confgroup.role.attrib "%role.attrib;">
-<!ELEMENT ConfGroup - - ((ConfDates|ConfTitle|ConfNum|Address|ConfSponsor)*)>
-<!ATTLIST ConfGroup
- %common.attrib;
- %confgroup.role.attrib;
- %local.confgroup.attrib;
->
-<!--end of confgroup.module-->]]>
-
- <!ENTITY % confdates.module "INCLUDE">
- <![ %confdates.module; [
- <!ENTITY % local.confdates.attrib "">
- <!ENTITY % confdates.role.attrib "%role.attrib;">
- <!ELEMENT ConfDates - - ((%docinfo.char.mix;)+)>
- <!ATTLIST ConfDates
- %common.attrib;
- %confdates.role.attrib;
- %local.confdates.attrib;
->
- <!--end of confdates.module-->]]>
-
- <!ENTITY % conftitle.module "INCLUDE">
- <![ %conftitle.module; [
- <!ENTITY % local.conftitle.attrib "">
- <!ENTITY % conftitle.role.attrib "%role.attrib;">
- <!ELEMENT ConfTitle - - ((%docinfo.char.mix;)+)>
- <!ATTLIST ConfTitle
- %common.attrib;
- %conftitle.role.attrib;
- %local.conftitle.attrib;
->
- <!--end of conftitle.module-->]]>
-
- <!ENTITY % confnum.module "INCLUDE">
- <![ %confnum.module; [
- <!ENTITY % local.confnum.attrib "">
- <!ENTITY % confnum.role.attrib "%role.attrib;">
- <!ELEMENT ConfNum - - ((%docinfo.char.mix;)+)>
- <!ATTLIST ConfNum
- %common.attrib;
- %confnum.role.attrib;
- %local.confnum.attrib;
->
- <!--end of confnum.module-->]]>
-
- <!--ELEMENT Address (defined elsewhere in this section)-->
-
- <!ENTITY % confsponsor.module "INCLUDE">
- <![ %confsponsor.module; [
- <!ENTITY % local.confsponsor.attrib "">
- <!ENTITY % confsponsor.role.attrib "%role.attrib;">
- <!ELEMENT ConfSponsor - - ((%docinfo.char.mix;)+)>
- <!ATTLIST ConfSponsor
- %common.attrib;
- %confsponsor.role.attrib;
- %local.confsponsor.attrib;
->
- <!--end of confsponsor.module-->]]>
-<!--end of confgroup.content.module-->]]>
-
-<!-- ContractNum ...................... -->
-
-<!ENTITY % contractnum.module "INCLUDE">
-<![ %contractnum.module; [
-<!ENTITY % local.contractnum.attrib "">
-<!ENTITY % contractnum.role.attrib "%role.attrib;">
-<!ELEMENT ContractNum - - ((%docinfo.char.mix;)+)>
-<!ATTLIST ContractNum
- %common.attrib;
- %contractnum.role.attrib;
- %local.contractnum.attrib;
->
-<!--end of contractnum.module-->]]>
-
-<!-- ContractSponsor .................. -->
-
-<!ENTITY % contractsponsor.module "INCLUDE">
-<![ %contractsponsor.module; [
-<!ENTITY % local.contractsponsor.attrib "">
-<!ENTITY % contractsponsor.role.attrib "%role.attrib;">
-<!ELEMENT ContractSponsor - - ((%docinfo.char.mix;)+)>
-<!ATTLIST ContractSponsor
- %common.attrib;
- %contractsponsor.role.attrib;
- %local.contractsponsor.attrib;
->
-<!--end of contractsponsor.module-->]]>
-
-<!-- Copyright ........................ -->
-
-<!ENTITY % copyright.content.module "INCLUDE">
-<![ %copyright.content.module; [
-<!ENTITY % copyright.module "INCLUDE">
-<![ %copyright.module; [
-<!ENTITY % local.copyright.attrib "">
-<!ENTITY % copyright.role.attrib "%role.attrib;">
-<!ELEMENT Copyright - - (Year+, Holder*)>
-<!ATTLIST Copyright
- %common.attrib;
- %copyright.role.attrib;
- %local.copyright.attrib;
->
-<!--end of copyright.module-->]]>
-
- <!ENTITY % year.module "INCLUDE">
- <![ %year.module; [
- <!ENTITY % local.year.attrib "">
- <!ENTITY % year.role.attrib "%role.attrib;">
- <!ELEMENT Year - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Year
- %common.attrib;
- %year.role.attrib;
- %local.year.attrib;
->
- <!--end of year.module-->]]>
-
- <!ENTITY % holder.module "INCLUDE">
- <![ %holder.module; [
- <!ENTITY % local.holder.attrib "">
- <!ENTITY % holder.role.attrib "%role.attrib;">
- <!ELEMENT Holder - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Holder
- %common.attrib;
- %holder.role.attrib;
- %local.holder.attrib;
->
- <!--end of holder.module-->]]>
-<!--end of copyright.content.module-->]]>
-
-<!-- CorpAuthor ....................... -->
-
-<!ENTITY % corpauthor.module "INCLUDE">
-<![ %corpauthor.module; [
-<!ENTITY % local.corpauthor.attrib "">
-<!ENTITY % corpauthor.role.attrib "%role.attrib;">
-<!ELEMENT CorpAuthor - - ((%docinfo.char.mix;)+)>
-<!ATTLIST CorpAuthor
- %common.attrib;
- %corpauthor.role.attrib;
- %local.corpauthor.attrib;
->
-<!--end of corpauthor.module-->]]>
-
-<!-- CorpName ......................... -->
-
-<!ENTITY % corpname.module "INCLUDE">
-<![ %corpname.module; [
-<!ENTITY % local.corpname.attrib "">
-<!ELEMENT CorpName - - ((%docinfo.char.mix;)+)>
-<!ENTITY % corpname.role.attrib "%role.attrib;">
-<!ATTLIST CorpName
- %common.attrib;
- %corpname.role.attrib;
- %local.corpname.attrib;
->
-<!--end of corpname.module-->]]>
-
-<!-- Date ............................. -->
-
-<!ENTITY % date.module "INCLUDE">
-<![ %date.module; [
-<!ENTITY % local.date.attrib "">
-<!ENTITY % date.role.attrib "%role.attrib;">
-<!ELEMENT Date - - ((%docinfo.char.mix;)+)>
-<!ATTLIST Date
- %common.attrib;
- %date.role.attrib;
- %local.date.attrib;
->
-<!--end of date.module-->]]>
-
-<!-- Edition .......................... -->
-
-<!ENTITY % edition.module "INCLUDE">
-<![ %edition.module; [
-<!ENTITY % local.edition.attrib "">
-<!ENTITY % edition.role.attrib "%role.attrib;">
-<!ELEMENT Edition - - ((%docinfo.char.mix;)+)>
-<!ATTLIST Edition
- %common.attrib;
- %edition.role.attrib;
- %local.edition.attrib;
->
-<!--end of edition.module-->]]>
-
-<!-- Editor ........................... -->
-
-<!ENTITY % editor.module "INCLUDE">
-<![ %editor.module; [
-<!--FUTURE USE (V4.0):
-......................
-AuthorBlurb and Affiliation will be removed from %person.ident.mix; and a new
-wrapper element created to allow association of those two elements with
-Editor name information.
-......................
--->
-<!ENTITY % local.editor.attrib "">
-<!ENTITY % editor.role.attrib "%role.attrib;">
-<!ELEMENT Editor - - ((%person.ident.mix;)+)>
-<!ATTLIST Editor
- %common.attrib;
- %editor.role.attrib;
- %local.editor.attrib;
->
- <!--(see "Personal identity elements" for %person.ident.mix;)-->
-<!--end of editor.module-->]]>
-
-<!-- ISBN ............................. -->
-
-<!ENTITY % isbn.module "INCLUDE">
-<![ %isbn.module; [
-<!ENTITY % local.isbn.attrib "">
-<!ENTITY % isbn.role.attrib "%role.attrib;">
-<!ELEMENT ISBN - - ((%docinfo.char.mix;)+)>
-<!ATTLIST ISBN
- %common.attrib;
- %isbn.role.attrib;
- %local.isbn.attrib;
->
-<!--end of isbn.module-->]]>
-
-<!-- ISSN ............................. -->
-
-<!ENTITY % issn.module "INCLUDE">
-<![ %issn.module; [
-<!ENTITY % local.issn.attrib "">
-<!ENTITY % issn.role.attrib "%role.attrib;">
-<!ELEMENT ISSN - - ((%docinfo.char.mix;)+)>
-<!ATTLIST ISSN
- %common.attrib;
- %issn.role.attrib;
- %local.issn.attrib;
->
-<!--end of issn.module-->]]>
-
-<!-- InvPartNumber .................... -->
-
-<!ENTITY % invpartnumber.module "INCLUDE">
-<![ %invpartnumber.module; [
-<!ENTITY % local.invpartnumber.attrib "">
-<!ENTITY % invpartnumber.role.attrib "%role.attrib;">
-<!ELEMENT InvPartNumber - - ((%docinfo.char.mix;)+)>
-<!ATTLIST InvPartNumber
- %common.attrib;
- %invpartnumber.role.attrib;
- %local.invpartnumber.attrib;
->
-<!--end of invpartnumber.module-->]]>
-
-<!-- IssueNum ......................... -->
-
-<!ENTITY % issuenum.module "INCLUDE">
-<![ %issuenum.module; [
-<!ENTITY % local.issuenum.attrib "">
-<!ENTITY % issuenum.role.attrib "%role.attrib;">
-<!ELEMENT IssueNum - - ((%docinfo.char.mix;)+)>
-<!ATTLIST IssueNum
- %common.attrib;
- %issuenum.role.attrib;
- %local.issuenum.attrib;
->
-<!--end of issuenum.module-->]]>
-
-<!-- LegalNotice ...................... -->
-
-<!ENTITY % legalnotice.module "INCLUDE">
-<![ %legalnotice.module; [
-<!ENTITY % local.legalnotice.attrib "">
-<!ENTITY % legalnotice.role.attrib "%role.attrib;">
-<!ELEMENT LegalNotice - - (Title?, (%legalnotice.mix;)+) -(%formal.class;)>
-<!ATTLIST LegalNotice
- %common.attrib;
- %legalnotice.role.attrib;
- %local.legalnotice.attrib;
->
-<!--end of legalnotice.module-->]]>
-
-<!-- ModeSpec ......................... -->
-
-<!ENTITY % modespec.module "INCLUDE">
-<![ %modespec.module; [
-<!ENTITY % local.modespec.attrib "">
-<!ENTITY % modespec.role.attrib "%role.attrib;">
-<!ELEMENT ModeSpec - - ((%docinfo.char.mix;)+) -(%ubiq.mix;)>
-<!ATTLIST ModeSpec
- --
- Application: Type of action required for completion
- of the links to which the ModeSpec is relevant (e.g.,
- retrieval query)
- --
- Application NOTATION
- (%notation.class;) #IMPLIED
- %common.attrib;
- %modespec.role.attrib;
- %local.modespec.attrib;
->
-<!--end of modespec.module-->]]>
-
-<!-- OrgName .......................... -->
-
-<!ENTITY % orgname.module "INCLUDE">
-<![ %orgname.module; [
-<!ENTITY % local.orgname.attrib "">
-<!ENTITY % orgname.role.attrib "%role.attrib;">
-<!ELEMENT OrgName - - ((%docinfo.char.mix;)+)>
-<!ATTLIST OrgName
- %common.attrib;
- %orgname.role.attrib;
- %local.orgname.attrib;
->
-<!--end of orgname.module-->]]>
-
-<!-- OtherCredit ...................... -->
-
-<!ENTITY % othercredit.module "INCLUDE">
-<![ %othercredit.module; [
-<!--FUTURE USE (V4.0):
-......................
-AuthorBlurb and Affiliation will be removed from %person.ident.mix; and a new
-wrapper element created to allow association of those two elements with
-OtherCredit name information.
-......................
--->
-<!ENTITY % local.othercredit.attrib "">
-<!ENTITY % othercredit.role.attrib "%role.attrib;">
-<!ELEMENT OtherCredit - - ((%person.ident.mix;)+)>
-<!ATTLIST OtherCredit
- %common.attrib;
- %othercredit.role.attrib;
- %local.othercredit.attrib;
->
- <!--(see "Personal identity elements" for %person.ident.mix;)-->
-<!--end of othercredit.module-->]]>
-
-<!-- PageNums ......................... -->
-
-<!ENTITY % pagenums.module "INCLUDE">
-<![ %pagenums.module; [
-<!ENTITY % local.pagenums.attrib "">
-<!ENTITY % pagenums.role.attrib "%role.attrib;">
-<!ELEMENT PageNums - - ((%docinfo.char.mix;)+)>
-<!ATTLIST PageNums
- %common.attrib;
- %pagenums.role.attrib;
- %local.pagenums.attrib;
->
-<!--end of pagenums.module-->]]>
-
-<!-- Personal identity elements ....... -->
-
-<!-- These elements are used only within Author, Editor, and
-OtherCredit. -->
-
-<!ENTITY % person.ident.module "INCLUDE">
-<![ %person.ident.module; [
-<!--FUTURE USE (V4.0):
-......................
-AuthorBlurb and Affiliation will be removed from %person.ident.mix; and
-a new wrapper element created to allow association of those two elements
-with Contrib name information.
-......................
--->
- <!ENTITY % contrib.module "INCLUDE">
- <![ %contrib.module; [
- <!ENTITY % local.contrib.attrib "">
- <!ENTITY % contrib.role.attrib "%role.attrib;">
- <!ELEMENT Contrib - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Contrib
- %common.attrib;
- %contrib.role.attrib;
- %local.contrib.attrib;
->
- <!--end of contrib.module-->]]>
-
- <!ENTITY % firstname.module "INCLUDE">
- <![ %firstname.module; [
- <!ENTITY % local.firstname.attrib "">
- <!ENTITY % firstname.role.attrib "%role.attrib;">
- <!ELEMENT FirstName - - ((%docinfo.char.mix;)+)>
- <!ATTLIST FirstName
- %common.attrib;
- %firstname.role.attrib;
- %local.firstname.attrib;
->
- <!--end of firstname.module-->]]>
-
- <!ENTITY % honorific.module "INCLUDE">
- <![ %honorific.module; [
- <!ENTITY % local.honorific.attrib "">
- <!ENTITY % honorific.role.attrib "%role.attrib;">
- <!ELEMENT Honorific - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Honorific
- %common.attrib;
- %honorific.role.attrib;
- %local.honorific.attrib;
->
- <!--end of honorific.module-->]]>
-
- <!ENTITY % lineage.module "INCLUDE">
- <![ %lineage.module; [
- <!ENTITY % local.lineage.attrib "">
- <!ENTITY % lineage.role.attrib "%role.attrib;">
- <!ELEMENT Lineage - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Lineage
- %common.attrib;
- %lineage.role.attrib;
- %local.lineage.attrib;
->
- <!--end of lineage.module-->]]>
-
- <!ENTITY % othername.module "INCLUDE">
- <![ %othername.module; [
- <!ENTITY % local.othername.attrib "">
- <!ENTITY % othername.role.attrib "%role.attrib;">
- <!ELEMENT OtherName - - ((%docinfo.char.mix;)+)>
- <!ATTLIST OtherName
- %common.attrib;
- %othername.role.attrib;
- %local.othername.attrib;
->
- <!--end of othername.module-->]]>
-
- <!ENTITY % surname.module "INCLUDE">
- <![ %surname.module; [
- <!ENTITY % local.surname.attrib "">
- <!ENTITY % surname.role.attrib "%role.attrib;">
- <!ELEMENT Surname - - ((%docinfo.char.mix;)+)>
- <!ATTLIST Surname
- %common.attrib;
- %surname.role.attrib;
- %local.surname.attrib;
->
- <!--end of surname.module-->]]>
-<!--end of person.ident.module-->]]>
-
-<!-- PrintHistory ..................... -->
-
-<!ENTITY % printhistory.module "INCLUDE">
-<![ %printhistory.module; [
-<!ENTITY % local.printhistory.attrib "">
-<!ENTITY % printhistory.role.attrib "%role.attrib;">
-<!ELEMENT PrintHistory - - ((%para.class;)+)>
-<!ATTLIST PrintHistory
- %common.attrib;
- %printhistory.role.attrib;
- %local.printhistory.attrib;
->
-<!--end of printhistory.module-->]]>
-
-<!-- ProductName ...................... -->
-
-<!ENTITY % productname.module "INCLUDE">
-<![ %productname.module; [
-<!ENTITY % local.productname.attrib "">
-<!ENTITY % productname.role.attrib "%role.attrib;">
-<!ELEMENT ProductName - - ((%para.char.mix;)+)>
-<!ATTLIST ProductName
- --
- Class: More precisely identifies the item the element names
- --
- Class (Service
- |Trade
- |Registered
- |Copyright) Trade
- %common.attrib;
- %productname.role.attrib;
- %local.productname.attrib;
->
-<!--end of productname.module-->]]>
-
-<!-- ProductNumber .................... -->
-
-<!ENTITY % productnumber.module "INCLUDE">
-<![ %productnumber.module; [
-<!ENTITY % local.productnumber.attrib "">
-<!ENTITY % productnumber.role.attrib "%role.attrib;">
-<!ELEMENT ProductNumber - - ((%docinfo.char.mix;)+)>
-<!ATTLIST ProductNumber
- %common.attrib;
- %productnumber.role.attrib;
- %local.productnumber.attrib;
->
-<!--end of productnumber.module-->]]>
-
-<!-- PubDate .......................... -->
-
-<!ENTITY % pubdate.module "INCLUDE">
-<![ %pubdate.module; [
-<!ENTITY % local.pubdate.attrib "">
-<!ENTITY % pubdate.role.attrib "%role.attrib;">
-<!ELEMENT PubDate - - ((%docinfo.char.mix;)+)>
-<!ATTLIST PubDate
- %common.attrib;
- %pubdate.role.attrib;
- %local.pubdate.attrib;
->
-<!--end of pubdate.module-->]]>
-
-<!-- Publisher ........................ -->
-
-<!ENTITY % publisher.content.module "INCLUDE">
-<![ %publisher.content.module; [
-<!ENTITY % publisher.module "INCLUDE">
-<![ %publisher.module; [
-<!ENTITY % local.publisher.attrib "">
-<!ENTITY % publisher.role.attrib "%role.attrib;">
-<!ELEMENT Publisher - - (PublisherName, Address*)>
-<!ATTLIST Publisher
- %common.attrib;
- %publisher.role.attrib;
- %local.publisher.attrib;
->
-<!--end of publisher.module-->]]>
-
- <!ENTITY % publishername.module "INCLUDE">
- <![ %publishername.module; [
- <!ENTITY % local.publishername.attrib "">
- <!ENTITY % publishername.role.attrib "%role.attrib;">
- <!ELEMENT PublisherName - - ((%docinfo.char.mix;)+)>
- <!ATTLIST PublisherName
- %common.attrib;
- %publishername.role.attrib;
- %local.publishername.attrib;
->
- <!--end of publishername.module-->]]>
-
- <!--ELEMENT Address (defined elsewhere in this section)-->
-<!--end of publisher.content.module-->]]>
-
-<!-- PubsNumber ....................... -->
-
-<!ENTITY % pubsnumber.module "INCLUDE">
-<![ %pubsnumber.module; [
-<!ENTITY % local.pubsnumber.attrib "">
-<!ENTITY % pubsnumber.role.attrib "%role.attrib;">
-<!ELEMENT PubsNumber - - ((%docinfo.char.mix;)+)>
-<!ATTLIST PubsNumber
- %common.attrib;
- %pubsnumber.role.attrib;
- %local.pubsnumber.attrib;
->
-<!--end of pubsnumber.module-->]]>
-
-<!-- ReleaseInfo ...................... -->
-
-<!ENTITY % releaseinfo.module "INCLUDE">
-<![ %releaseinfo.module; [
-<!ENTITY % local.releaseinfo.attrib "">
-<!ENTITY % releaseinfo.role.attrib "%role.attrib;">
-<!ELEMENT ReleaseInfo - - ((%docinfo.char.mix;)+)>
-<!ATTLIST ReleaseInfo
- %common.attrib;
- %releaseinfo.role.attrib;
- %local.releaseinfo.attrib;
->
-<!--end of releaseinfo.module-->]]>
-
-<!-- RevHistory ....................... -->
-
-<!ENTITY % revhistory.content.module "INCLUDE">
-<![ %revhistory.content.module; [
-<!ENTITY % revhistory.module "INCLUDE">
-<![ %revhistory.module; [
-<!ENTITY % local.revhistory.attrib "">
-<!ENTITY % revhistory.role.attrib "%role.attrib;">
-<!ELEMENT RevHistory - - (Revision+)>
-<!ATTLIST RevHistory
- %common.attrib;
- %revhistory.role.attrib;
- %local.revhistory.attrib;
->
-<!--end of revhistory.module-->]]>
-
- <!ENTITY % revision.module "INCLUDE">
- <![ %revision.module; [
- <!ENTITY % local.revision.attrib "">
- <!ENTITY % revision.role.attrib "%role.attrib;">
- <!ELEMENT Revision - - (RevNumber, Date, AuthorInitials*, RevRemark?)>
- <!ATTLIST Revision
- %common.attrib;
- %revision.role.attrib;
- %local.revision.attrib;
->
- <!--end of revision.module-->]]>
-
- <!ENTITY % revnumber.module "INCLUDE">
- <![ %revnumber.module; [
- <!ENTITY % local.revnumber.attrib "">
- <!ENTITY % revnumber.role.attrib "%role.attrib;">
- <!ELEMENT RevNumber - - ((%docinfo.char.mix;)+)>
- <!ATTLIST RevNumber
- %common.attrib;
- %revnumber.role.attrib;
- %local.revnumber.attrib;
->
- <!--end of revnumber.module-->]]>
-
- <!--ELEMENT Date (defined elsewhere in this section)-->
- <!--ELEMENT AuthorInitials (defined elsewhere in this section)-->
-
- <!ENTITY % revremark.module "INCLUDE">
- <![ %revremark.module; [
- <!ENTITY % local.revremark.attrib "">
- <!ENTITY % revremark.role.attrib "%role.attrib;">
- <!ELEMENT RevRemark - - ((%docinfo.char.mix;)+)>
- <!ATTLIST RevRemark
- %common.attrib;
- %revremark.role.attrib;
- %local.revremark.attrib;
->
- <!--end of revremark.module-->]]>
-<!--end of revhistory.content.module-->]]>
-
-<!-- SeriesVolNums .................... -->
-
-<!ENTITY % seriesvolnums.module "INCLUDE">
-<![ %seriesvolnums.module; [
-<!ENTITY % local.seriesvolnums.attrib "">
-<!ENTITY % seriesvolnums.role.attrib "%role.attrib;">
-<!ELEMENT SeriesVolNums - - ((%docinfo.char.mix;)+)>
-<!ATTLIST SeriesVolNums
- %common.attrib;
- %seriesvolnums.role.attrib;
- %local.seriesvolnums.attrib;
->
-<!--end of seriesvolnums.module-->]]>
-
-<!-- VolumeNum ........................ -->
-
-<!ENTITY % volumenum.module "INCLUDE">
-<![ %volumenum.module; [
-<!ENTITY % local.volumenum.attrib "">
-<!ENTITY % volumenum.role.attrib "%role.attrib;">
-<!ELEMENT VolumeNum - - ((%docinfo.char.mix;)+)>
-<!ATTLIST VolumeNum
- %common.attrib;
- %volumenum.role.attrib;
- %local.volumenum.attrib;
->
-<!--end of volumenum.module-->]]>
-
-<!-- .................................. -->
-
-<!--end of docinfo.content.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- Inline, link, and ubiquitous elements ................................ -->
-
-<!-- Technical and computer terms ......................................... -->
-
-<!ENTITY % accel.module "INCLUDE">
-<![ %accel.module; [
-<!ENTITY % local.accel.attrib "">
-<!ENTITY % accel.role.attrib "%role.attrib;">
-<!ELEMENT Accel - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST Accel
- %common.attrib;
- %accel.role.attrib;
- %local.accel.attrib;
->
-<!--end of accel.module-->]]>
-
-<!ENTITY % action.module "INCLUDE">
-<![ %action.module; [
-<!--FUTURE USE (V4.0):
-......................
-Action will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.action.attrib "">
-<!ENTITY % action.role.attrib "%role.attrib;">
-<!ELEMENT Action - - ((%cptr.char.mix;)+)>
-<!ATTLIST Action
- %moreinfo.attrib;
- %common.attrib;
- %action.role.attrib;
- %local.action.attrib;
->
-<!--end of action.module-->]]>
-
-<!ENTITY % application.module "INCLUDE">
-<![ %application.module; [
-<!ENTITY % local.application.attrib "">
-<!ENTITY % application.role.attrib "%role.attrib;">
-<!ELEMENT Application - - ((%para.char.mix;)+)>
-<!ATTLIST Application
- Class (Hardware
- |Software) #IMPLIED
- %moreinfo.attrib;
- %common.attrib;
- %application.role.attrib;
- %local.application.attrib;
->
-<!--end of application.module-->]]>
-
-<!ENTITY % classname.module "INCLUDE">
-<![ %classname.module; [
-<!ENTITY % local.classname.attrib "">
-<!ENTITY % classname.role.attrib "%role.attrib;">
-<!ELEMENT ClassName - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST ClassName
- %common.attrib;
- %classname.role.attrib;
- %local.classname.attrib;
->
-<!--end of classname.module-->]]>
-
-<!ENTITY % co.module "INCLUDE">
-<![ %co.module; [
-<!ENTITY % local.co.attrib "">
-<!-- CO is a callout area of the LineColumn unit type (a single character
- position); the position is directly indicated by the location of CO. -->
-<!ENTITY % co.role.attrib "%role.attrib;">
-<!ELEMENT CO - O EMPTY>
-<!ATTLIST CO
- %label.attrib; --bug number/symbol override or initialization--
- %linkends.attrib; --to any related information--
- %idreq.common.attrib;
- %co.role.attrib;
- %local.co.attrib;
->
-<!--end of co.module-->]]>
-
-<!ENTITY % command.module "INCLUDE">
-<![ %command.module; [
-<!--FUTURE USE (V4.0):
-......................
-Command will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.command.attrib "">
-<!ENTITY % command.role.attrib "%role.attrib;">
-<!ELEMENT Command - - ((%cptr.char.mix;)+)>
-<!ATTLIST Command
- %moreinfo.attrib;
- %common.attrib;
- %command.role.attrib;
- %local.command.attrib;
->
-<!--end of command.module-->]]>
-
-<!ENTITY % computeroutput.module "INCLUDE">
-<![ %computeroutput.module; [
-<!ENTITY % local.computeroutput.attrib "">
-<!ENTITY % computeroutput.role.attrib "%role.attrib;">
-<!ELEMENT ComputerOutput - - ((%cptr.char.mix;)+)>
-<!ATTLIST ComputerOutput
- %moreinfo.attrib;
- %common.attrib;
- %computeroutput.role.attrib;
- %local.computeroutput.attrib;
->
-<!--end of computeroutput.module-->]]>
-
-<!ENTITY % database.module "INCLUDE">
-<![ %database.module; [
-<!--FUTURE USE (V4.0):
-......................
-Database will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.database.attrib "">
-<!ENTITY % database.role.attrib "%role.attrib;">
-<!ELEMENT Database - - ((%cptr.char.mix;)+)>
-<!ATTLIST Database
- --
- Class: Type of database the element names; no default
- --
- Class (Name
- |Table
- |Field
- |Key1
- |Key2
- |Record) #IMPLIED
- %moreinfo.attrib;
- %common.attrib;
- %database.role.attrib;
- %local.database.attrib;
->
-<!--end of database.module-->]]>
-
-<!ENTITY % email.module "INCLUDE">
-<![ %email.module; [
-<!ENTITY % local.email.attrib "">
-<!ENTITY % email.role.attrib "%role.attrib;">
-<!ELEMENT Email - - ((%docinfo.char.mix;)+)>
-<!ATTLIST Email
- %common.attrib;
- %email.role.attrib;
- %local.email.attrib;
->
-<!--end of email.module-->]]>
-
-<!ENTITY % envar.module "INCLUDE">
-<![ %envar.module; [
-<!ENTITY % local.envar.attrib "">
-<!ENTITY % envar.role.attrib "%role.attrib;">
-<!ELEMENT EnVar - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST EnVar
- %common.attrib;
- %envar.role.attrib;
- %local.envar.attrib;
->
-<!--end of envar.module-->]]>
-
-
-<!ENTITY % errorcode.module "INCLUDE">
-<![ %errorcode.module; [
-<!ENTITY % local.errorcode.attrib "">
-<!ENTITY % errorcode.role.attrib "%role.attrib;">
-<!ELEMENT ErrorCode - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST ErrorCode
- %moreinfo.attrib;
- %common.attrib;
- %errorcode.role.attrib;
- %local.errorcode.attrib;
->
-<!--end of errorcode.module-->]]>
-
-<!ENTITY % errorname.module "INCLUDE">
-<![ %errorname.module; [
-<!ENTITY % local.errorname.attrib "">
-<!ENTITY % errorname.role.attrib "%role.attrib;">
-<!ELEMENT ErrorName - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST ErrorName
- %common.attrib;
- %errorname.role.attrib;
- %local.errorname.attrib;
->
-<!--end of errorname.module-->]]>
-
-<!ENTITY % errortype.module "INCLUDE">
-<![ %errortype.module; [
-<!ENTITY % local.errortype.attrib "">
-<!ENTITY % errortype.role.attrib "%role.attrib;">
-<!ELEMENT ErrorType - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST ErrorType
- %common.attrib;
- %errortype.role.attrib;
- %local.errortype.attrib;
->
-<!--end of errortype.module-->]]>
-
-<!ENTITY % filename.module "INCLUDE">
-<![ %filename.module; [
-<!--FUTURE USE (V4.0):
-......................
-Filename will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.filename.attrib "">
-<!ENTITY % filename.role.attrib "%role.attrib;">
-<!ELEMENT Filename - - ((%cptr.char.mix;)+)>
-<!ATTLIST Filename
- --
- Class: Type of filename the element names; no default
- --
- Class (HeaderFile
- |SymLink
- |Directory) #IMPLIED
- --
- Path: Search path (possibly system-specific) in which
- file can be found
- --
- Path CDATA #IMPLIED
- %moreinfo.attrib;
- %common.attrib;
- %filename.role.attrib;
- %local.filename.attrib;
->
-<!--end of filename.module-->]]>
-
-<!ENTITY % function.module "INCLUDE">
-<![ %function.module; [
-<!ENTITY % local.function.attrib "">
-<!ENTITY % function.role.attrib "%role.attrib;">
-<!ELEMENT Function - - ((%cptr.char.mix;)+)>
-<!ATTLIST Function
- %moreinfo.attrib;
- %common.attrib;
- %function.role.attrib;
- %local.function.attrib;
->
-<!--end of function.module-->]]>
-
-<!ENTITY % guibutton.module "INCLUDE">
-<![ %guibutton.module; [
-<!ENTITY % local.guibutton.attrib "">
-<!ENTITY % guibutton.role.attrib "%role.attrib;">
-<!ELEMENT GUIButton - - ((%smallcptr.char.mix;|Accel)+)>
-<!ATTLIST GUIButton
- %moreinfo.attrib;
- %common.attrib;
- %guibutton.role.attrib;
- %local.guibutton.attrib;
->
-<!--end of guibutton.module-->]]>
-
-<!ENTITY % guiicon.module "INCLUDE">
-<![ %guiicon.module; [
-<!ENTITY % local.guiicon.attrib "">
-<!ENTITY % guiicon.role.attrib "%role.attrib;">
-<!ELEMENT GUIIcon - - ((%smallcptr.char.mix;|Accel)+)>
-<!ATTLIST GUIIcon
- %moreinfo.attrib;
- %common.attrib;
- %guiicon.role.attrib;
- %local.guiicon.attrib;
->
-<!--end of guiicon.module-->]]>
-
-<!ENTITY % guilabel.module "INCLUDE">
-<![ %guilabel.module; [
-<!ENTITY % local.guilabel.attrib "">
-<!ENTITY % guilabel.role.attrib "%role.attrib;">
-<!ELEMENT GUILabel - - ((%smallcptr.char.mix;|Accel)+)>
-<!ATTLIST GUILabel
- %moreinfo.attrib;
- %common.attrib;
- %guilabel.role.attrib;
- %local.guilabel.attrib;
->
-<!--end of guilabel.module-->]]>
-
-<!ENTITY % guimenu.module "INCLUDE">
-<![ %guimenu.module; [
-<!ENTITY % local.guimenu.attrib "">
-<!ENTITY % guimenu.role.attrib "%role.attrib;">
-<!ELEMENT GUIMenu - - ((%smallcptr.char.mix;|Accel)+)>
-<!ATTLIST GUIMenu
- %moreinfo.attrib;
- %common.attrib;
- %guimenu.role.attrib;
- %local.guimenu.attrib;
->
-<!--end of guimenu.module-->]]>
-
-<!ENTITY % guimenuitem.module "INCLUDE">
-<![ %guimenuitem.module; [
-<!ENTITY % local.guimenuitem.attrib "">
-<!ENTITY % guimenuitem.role.attrib "%role.attrib;">
-<!ELEMENT GUIMenuItem - - ((%smallcptr.char.mix;|Accel)+)>
-<!ATTLIST GUIMenuItem
- %moreinfo.attrib;
- %common.attrib;
- %guimenuitem.role.attrib;
- %local.guimenuitem.attrib;
->
-<!--end of guimenuitem.module-->]]>
-
-<!ENTITY % guisubmenu.module "INCLUDE">
-<![ %guisubmenu.module; [
-<!ENTITY % local.guisubmenu.attrib "">
-<!ENTITY % guisubmenu.role.attrib "%role.attrib;">
-<!ELEMENT GUISubmenu - - ((%smallcptr.char.mix;|Accel)+)>
-<!ATTLIST GUISubmenu
- %moreinfo.attrib;
- %common.attrib;
- %guisubmenu.role.attrib;
- %local.guisubmenu.attrib;
->
-<!--end of guisubmenu.module-->]]>
-
-<!ENTITY % hardware.module "INCLUDE">
-<![ %hardware.module; [
-<!--FUTURE USE (V4.0):
-......................
-Hardware will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.hardware.attrib "">
-<!ENTITY % hardware.role.attrib "%role.attrib;">
-<!ELEMENT Hardware - - ((%cptr.char.mix;)+)>
-<!ATTLIST Hardware
- %moreinfo.attrib;
- %common.attrib;
- %hardware.role.attrib;
- %local.hardware.attrib;
->
-<!--end of hardware.module-->]]>
-
-<!ENTITY % interface.module "INCLUDE">
-<![ %interface.module; [
-<!--FUTURE USE (V4.0):
-......................
-Interface will no longer have a Class attribute; if you want to subclass
-interface information, use GUIButton, GUIIcon, GUILabel, GUIMenu,
-GUIMenuItem, or GUISubmenu, or use a Role value on Interface. Also,
-Interface will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.interface.attrib "">
-<!ENTITY % interface.role.attrib "%role.attrib;">
-<!ELEMENT Interface - - ((%cptr.char.mix;|Accel)+)>
-<!ATTLIST Interface
- --
- Class: Type of the Interface item; no default
- --
- Class (Button
- |Icon
- |Menu
- |MenuItem) #IMPLIED
- %moreinfo.attrib;
- %common.attrib;
- %interface.role.attrib;
- %local.interface.attrib;
->
-<!--end of interface.module-->]]>
-
-<!ENTITY % interfacedefinition.module "INCLUDE">
-<![ %interfacedefinition.module; [
-<!--FUTURE USE (V4.0):
-......................
-InterfaceDefinition will be discarded.
-......................
--->
-<!ENTITY % local.interfacedefinition.attrib "">
-<!ENTITY % interfacedefinition.role.attrib "%role.attrib;">
-<!ELEMENT InterfaceDefinition - - ((%cptr.char.mix;)+)>
-<!ATTLIST InterfaceDefinition
- %moreinfo.attrib;
- %common.attrib;
- %interfacedefinition.role.attrib;
- %local.interfacedefinition.attrib;
->
-<!--end of interfacedefinition.module-->]]>
-
-<!ENTITY % keycap.module "INCLUDE">
-<![ %keycap.module; [
-<!--FUTURE USE (V4.0):
-......................
-KeyCap will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.keycap.attrib "">
-<!ENTITY % keycap.role.attrib "%role.attrib;">
-<!ELEMENT KeyCap - - ((%cptr.char.mix;)+)>
-<!ATTLIST KeyCap
- %moreinfo.attrib;
- %common.attrib;
- %keycap.role.attrib;
- %local.keycap.attrib;
->
-<!--end of keycap.module-->]]>
-
-<!ENTITY % keycode.module "INCLUDE">
-<![ %keycode.module; [
-<!ENTITY % local.keycode.attrib "">
-<!ENTITY % keycode.role.attrib "%role.attrib;">
-<!ELEMENT KeyCode - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST KeyCode
- %common.attrib;
- %keycode.role.attrib;
- %local.keycode.attrib;
->
-<!--end of keycode.module-->]]>
-
-<!ENTITY % keycombo.module "INCLUDE">
-<![ %keycombo.module; [
-<!ENTITY % local.keycombo.attrib "">
-<!ENTITY % keycombo.role.attrib "%role.attrib;">
-<!ELEMENT KeyCombo - - ((KeyCap|KeyCombo|KeySym|MouseButton)+)>
-<!ATTLIST KeyCombo
- %keyaction.attrib;
- %moreinfo.attrib;
- %common.attrib;
- %keycombo.role.attrib;
- %local.keycombo.attrib;
->
-<!--end of keycombo.module-->]]>
-
-<!ENTITY % keysym.module "INCLUDE">
-<![ %keysym.module; [
-<!ENTITY % local.keysym.attrib "">
-<!ENTITY % keysysm.role.attrib "%role.attrib;">
-<!ELEMENT KeySym - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST KeySym
- %common.attrib;
- %keysysm.role.attrib;
- %local.keysym.attrib;
->
-<!--end of keysym.module-->]]>
-
-<!ENTITY % lineannotation.module "INCLUDE">
-<![ %lineannotation.module; [
-<!ENTITY % local.lineannotation.attrib "">
-<!ENTITY % lineannotation.role.attrib "%role.attrib;">
-<!ELEMENT LineAnnotation - - ((%para.char.mix;)+)>
-<!ATTLIST LineAnnotation
- %common.attrib;
- %lineannotation.role.attrib;
- %local.lineannotation.attrib;
->
-<!--end of lineannotation.module-->]]>
-
-<!ENTITY % literal.module "INCLUDE">
-<![ %literal.module; [
-<!--FUTURE USE (V4.0):
-......................
-Literal will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.literal.attrib "">
-<!ENTITY % literal.role.attrib "%role.attrib;">
-<!ELEMENT Literal - - ((%cptr.char.mix;)+)>
-<!ATTLIST Literal
- %moreinfo.attrib;
- %common.attrib;
- %literal.role.attrib;
- %local.literal.attrib;
->
-<!--end of literal.module-->]]>
-
-<!ENTITY % markup.module "INCLUDE">
-<![ %markup.module; [
-<!ENTITY % local.markup.attrib "">
-<!ENTITY % markup.role.attrib "%role.attrib;">
-<!ELEMENT Markup - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST Markup
- %common.attrib;
- %markup.role.attrib;
- %local.markup.attrib;
->
-<!--end of markup.module-->]]>
-
-<!ENTITY % medialabel.module "INCLUDE">
-<![ %medialabel.module; [
-<!ENTITY % local.medialabel.attrib "">
-<!ENTITY % medialabel.role.attrib "%role.attrib;">
-<!ELEMENT MediaLabel - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST MediaLabel
- --
- Class: Type of medium named by the element; no default
- --
- Class (Cartridge
- |CDRom
- |Disk
- |Tape) #IMPLIED
- %common.attrib;
- %medialabel.role.attrib;
- %local.medialabel.attrib;
->
-<!--end of medialabel.module-->]]>
-
-<!ENTITY % menuchoice.content.module "INCLUDE">
-<![ %menuchoice.content.module; [
-<!ENTITY % menuchoice.module "INCLUDE">
-<![ %menuchoice.module; [
-<!ENTITY % local.menuchoice.attrib "">
-<!ENTITY % menuchoice.role.attrib "%role.attrib;">
-<!ELEMENT MenuChoice - - (Shortcut?, (GUIButton|GUIIcon|GUILabel
- |GUIMenu|GUIMenuItem|GUISubmenu|Interface)+)>
-<!ATTLIST MenuChoice
- %moreinfo.attrib;
- %common.attrib;
- %menuchoice.role.attrib;
- %local.menuchoice.attrib;
->
-<!--end of menuchoice.module-->]]>
-
-<!ENTITY % shortcut.module "INCLUDE">
-<![ %shortcut.module; [
-<!-- See also KeyCombo -->
-<!ENTITY % local.shortcut.attrib "">
-<!ENTITY % shortcut.role.attrib "%role.attrib;">
-<!ELEMENT Shortcut - - ((KeyCap|KeyCombo|KeySym|MouseButton)+)>
-<!ATTLIST Shortcut
- %keyaction.attrib;
- %moreinfo.attrib;
- %common.attrib;
- %shortcut.role.attrib;
- %local.shortcut.attrib;
->
-<!--end of shortcut.module-->]]>
-<!--end of menuchoice.content.module-->]]>
-
-<!ENTITY % mousebutton.module "INCLUDE">
-<![ %mousebutton.module; [
-<!ENTITY % local.mousebutton.attrib "">
-<!ENTITY % mousebutton.role.attrib "%role.attrib;">
-<!ELEMENT MouseButton - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST MouseButton
- %moreinfo.attrib;
- %common.attrib;
- %mousebutton.role.attrib;
- %local.mousebutton.attrib;
->
-<!--end of mousebutton.module-->]]>
-
-<!ENTITY % msgtext.module "INCLUDE">
-<![ %msgtext.module; [
-<!ENTITY % local.msgtext.attrib "">
-<!ENTITY % msgtext.role.attrib "%role.attrib;">
-<!ELEMENT MsgText - - ((%component.mix;)+)>
-<!ATTLIST MsgText
- %common.attrib;
- %msgtext.role.attrib;
- %local.msgtext.attrib;
->
-<!--end of msgtext.module-->]]>
-
-<!ENTITY % option.module "INCLUDE">
-<![ %option.module; [
-<!--FUTURE USE (V4.0):
-......................
-Option will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.option.attrib "">
-<!ENTITY % option.role.attrib "%role.attrib;">
-<!ELEMENT Option - - ((%cptr.char.mix;)+)>
-<!ATTLIST Option
- %common.attrib;
- %option.role.attrib;
- %local.option.attrib;
->
-<!--end of option.module-->]]>
-
-<!ENTITY % optional.module "INCLUDE">
-<![ %optional.module; [
-<!ENTITY % local.optional.attrib "">
-<!ENTITY % optional.role.attrib "%role.attrib;">
-<!ELEMENT Optional - - ((%cptr.char.mix;)+)>
-<!ATTLIST Optional
- %common.attrib;
- %optional.role.attrib;
- %local.optional.attrib;
->
-<!--end of optional.module-->]]>
-
-<!ENTITY % parameter.module "INCLUDE">
-<![ %parameter.module; [
-<!--FUTURE USE (V4.0):
-......................
-Parameter will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.parameter.attrib "">
-<!ENTITY % parameter.role.attrib "%role.attrib;">
-<!ELEMENT Parameter - - ((%cptr.char.mix;)+)>
-<!ATTLIST Parameter
- --
- Class: Type of the Parameter; no default
- --
- Class (Command
- |Function
- |Option) #IMPLIED
- %moreinfo.attrib;
- %common.attrib;
- %parameter.role.attrib;
- %local.parameter.attrib;
->
-<!--end of parameter.module-->]]>
-
-<!ENTITY % prompt.module "INCLUDE">
-<![ %prompt.module; [
-<!ENTITY % local.prompt.attrib "">
-<!ENTITY % prompt.role.attrib "%role.attrib;">
-<!ELEMENT Prompt - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST Prompt
- %moreinfo.attrib;
- %common.attrib;
- %prompt.role.attrib;
- %local.prompt.attrib;
->
-<!--end of prompt.module-->]]>
-
-<!ENTITY % property.module "INCLUDE">
-<![ %property.module; [
-<!--FUTURE USE (V4.0):
-......................
-Property will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.property.attrib "">
-<!ENTITY % property.role.attrib "%role.attrib;">
-<!ELEMENT Property - - ((%cptr.char.mix;)+)>
-<!ATTLIST Property
- %moreinfo.attrib;
- %common.attrib;
- %property.role.attrib;
- %local.property.attrib;
->
-<!--end of property.module-->]]>
-
-<!ENTITY % replaceable.module "INCLUDE">
-<![ %replaceable.module; [
-<!ENTITY % local.replaceable.attrib "">
-<!ENTITY % replaceable.role.attrib "%role.attrib;">
-<!ELEMENT Replaceable - - ((#PCDATA
- | %link.char.class;
- | Optional
- | %base.char.class;
- | %other.char.class;
- | InlineGraphic)+)>
-<!ATTLIST Replaceable
- --
- Class: Type of information the element represents; no
- default
- --
- Class (Command
- |Function
- |Option
- |Parameter) #IMPLIED
- %common.attrib;
- %replaceable.role.attrib;
- %local.replaceable.attrib;
->
-<!--end of replaceable.module-->]]>
-
-<!ENTITY % returnvalue.module "INCLUDE">
-<![ %returnvalue.module; [
-<!ENTITY % local.returnvalue.attrib "">
-<!ENTITY % returnvalue.role.attrib "%role.attrib;">
-<!ELEMENT ReturnValue - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST ReturnValue
- %common.attrib;
- %returnvalue.role.attrib;
- %local.returnvalue.attrib;
->
-<!--end of returnvalue.module-->]]>
-
-<!ENTITY % sgmltag.module "INCLUDE">
-<![ %sgmltag.module; [
-<!ENTITY % local.sgmltag.attrib "">
-<!ENTITY % sgmltag.role.attrib "%role.attrib;">
-<!ELEMENT SGMLTag - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST SGMLTag
- --
- Class: Type of SGML construct the element names; no default
- --
- Class (Attribute
- |AttValue
- |Element
- |EndTag
- |GenEntity
- |NumCharRef
- |ParamEntity
- |PI
- |StartTag
- |SGMLComment) #IMPLIED
- %common.attrib;
- %sgmltag.role.attrib;
- %local.sgmltag.attrib;
->
-<!--end of sgmltag.module-->]]>
-
-<!ENTITY % structfield.module "INCLUDE">
-<![ %structfield.module; [
-<!ENTITY % local.structfield.attrib "">
-<!ENTITY % structfield.role.attrib "%role.attrib;">
-<!ELEMENT StructField - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST StructField
- %common.attrib;
- %structfield.role.attrib;
- %local.structfield.attrib;
->
-<!--end of structfield.module-->]]>
-
-<!ENTITY % structname.module "INCLUDE">
-<![ %structname.module; [
-<!ENTITY % local.structname.attrib "">
-<!ENTITY % structname.role.attrib "%role.attrib;">
-<!ELEMENT StructName - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST StructName
- %common.attrib;
- %structname.role.attrib;
- %local.structname.attrib;
->
-<!--end of structname.module-->]]>
-
-<!ENTITY % symbol.module "INCLUDE">
-<![ %symbol.module; [
-<!ENTITY % local.symbol.attrib "">
-<!ENTITY % symbol.role.attrib "%role.attrib;">
-<!ELEMENT Symbol - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST Symbol
- --
- Class: Type of symbol; no default
- --
- Class (Limit) #IMPLIED
- %common.attrib;
- %symbol.role.attrib;
- %local.symbol.attrib;
->
-<!--end of symbol.module-->]]>
-
-<!ENTITY % systemitem.module "INCLUDE">
-<![ %systemitem.module; [
-<!--FUTURE USE (V4.0):
-......................
-SystemItem will have its content constrained to smallcptr.char.mix.
-......................
--->
-<!ENTITY % local.systemitem.attrib "">
-<!ENTITY % systemitem.role.attrib "%role.attrib;">
-<!ELEMENT SystemItem - - ((%cptr.char.mix; | Acronym)+)>
-<!--FUTURE USE (V4.0):
-......................
-The EnvironVar and Prompt values of Class will be eliminated;
-use the EnVar and Prompt elements new in 3.0 instead.
-......................
--->
-<!ATTLIST SystemItem
- --
- Class: Type of system item the element names; no default
- --
- Class (Constant
- |EnvironVar
- |Macro
- |OSname
- |Prompt
- |Resource
- |SystemName) #IMPLIED
- %moreinfo.attrib;
- %common.attrib;
- %systemitem.role.attrib;
- %local.systemitem.attrib;
->
-<!--end of systemitem.module-->]]>
-
-
-<!ENTITY % token.module "INCLUDE">
-<![ %token.module; [
-<!ENTITY % local.token.attrib "">
-<!ENTITY % token.role.attrib "%role.attrib;">
-<!ELEMENT Token - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST Token
- %common.attrib;
- %token.role.attrib;
- %local.token.attrib;
->
-<!--end of token.module-->]]>
-
-<!ENTITY % type.module "INCLUDE">
-<![ %type.module; [
-<!ENTITY % local.type.attrib "">
-<!ENTITY % type.role.attrib "%role.attrib;">
-<!ELEMENT Type - - ((%smallcptr.char.mix;)+)>
-<!ATTLIST Type
- %common.attrib;
- %type.role.attrib;
- %local.type.attrib;
->
-<!--end of type.module-->]]>
-
-<!ENTITY % userinput.module "INCLUDE">
-<![ %userinput.module; [
-<!ENTITY % local.userinput.attrib "">
-<!ENTITY % userinput.role.attrib "%role.attrib;">
-<!ELEMENT UserInput - - ((%cptr.char.mix;)+)>
-<!ATTLIST UserInput
- %moreinfo.attrib;
- %common.attrib;
- %userinput.role.attrib;
- %local.userinput.attrib;
->
-<!--end of userinput.module-->]]>
-
-<!-- General words and phrases ............................................ -->
-
-<!ENTITY % abbrev.module "INCLUDE">
-<![ %abbrev.module; [
-<!ENTITY % local.abbrev.attrib "">
-<!ENTITY % abbrev.role.attrib "%role.attrib;">
-<!ELEMENT Abbrev - - ((%word.char.mix;)+)>
-<!ATTLIST Abbrev
- %common.attrib;
- %abbrev.role.attrib;
- %local.abbrev.attrib;
->
-<!--end of abbrev.module-->]]>
-
-<!ENTITY % acronym.module "INCLUDE">
-<![ %acronym.module; [
-<!ENTITY % local.acronym.attrib "">
-<!ENTITY % acronym.role.attrib "%role.attrib;">
-<!ELEMENT Acronym - - ((%word.char.mix;)+) -(Acronym)>
-<!ATTLIST Acronym
- %common.attrib;
- %acronym.role.attrib;
- %local.acronym.attrib;
->
-<!--end of acronym.module-->]]>
-
-<!ENTITY % citation.module "INCLUDE">
-<![ %citation.module; [
-<!ENTITY % local.citation.attrib "">
-<!ENTITY % citation.role.attrib "%role.attrib;">
-<!ELEMENT Citation - - ((%para.char.mix;)+)>
-<!ATTLIST Citation
- %common.attrib;
- %citation.role.attrib;
- %local.citation.attrib;
->
-<!--end of citation.module-->]]>
-
-<!ENTITY % citerefentry.module "INCLUDE">
-<![ %citerefentry.module; [
-<!ENTITY % local.citerefentry.attrib "">
-<!ENTITY % citerefentry.role.attrib "%role.attrib;">
-<!ELEMENT CiteRefEntry - - (RefEntryTitle, ManVolNum?)>
-<!ATTLIST CiteRefEntry
- %common.attrib;
- %citerefentry.role.attrib;
- %local.citerefentry.attrib;
->
-<!--end of citerefentry.module-->]]>
-
-<!ENTITY % refentrytitle.module "INCLUDE">
-<![ %refentrytitle.module; [
-<!ENTITY % local.refentrytitle.attrib "">
-<!ENTITY % refentrytitle.role.attrib "%role.attrib;">
-<!ELEMENT RefEntryTitle - O ((%para.char.mix;)+)>
-<!ATTLIST RefEntryTitle
- %common.attrib;
- %refentrytitle.role.attrib;
- %local.refentrytitle.attrib;
->
-<!--end of refentrytitle.module-->]]>
-
-<!ENTITY % manvolnum.module "INCLUDE">
-<![ %manvolnum.module; [
-<!ENTITY % local.manvolnum.attrib "">
-<!ENTITY % namvolnum.role.attrib "%role.attrib;">
-<!ELEMENT ManVolNum - O ((%word.char.mix;)+)>
-<!ATTLIST ManVolNum
- %common.attrib;
- %namvolnum.role.attrib;
- %local.manvolnum.attrib;
->
-<!--end of manvolnum.module-->]]>
-
-<!ENTITY % citetitle.module "INCLUDE">
-<![ %citetitle.module; [
-<!ENTITY % local.citetitle.attrib "">
-<!ENTITY % citetitle.role.attrib "%role.attrib;">
-<!ELEMENT CiteTitle - - ((%para.char.mix;)+)>
-<!ATTLIST CiteTitle
- --
- Pubwork: Genre of published work cited; no default
- --
- Pubwork (Article
- |Book
- |Chapter
- |Part
- |RefEntry
- |Section) #IMPLIED
- %common.attrib;
- %citetitle.role.attrib;
- %local.citetitle.attrib;
->
-<!--end of citetitle.module-->]]>
-
-<!ENTITY % emphasis.module "INCLUDE">
-<![ %emphasis.module; [
-<!ENTITY % local.emphasis.attrib "">
-<!ENTITY % emphasis.role.attrib "%role.attrib;">
-<!ELEMENT Emphasis - - ((%para.char.mix;)+)>
-<!ATTLIST Emphasis
- %common.attrib;
- %emphasis.role.attrib;
- %local.emphasis.attrib;
->
-<!--end of emphasis.module-->]]>
-
-<!ENTITY % firstterm.module "INCLUDE">
-<![ %firstterm.module; [
-<!ENTITY % local.firstterm.attrib "">
-<!ENTITY % firstterm.role.attrib "%role.attrib;">
-<!ELEMENT FirstTerm - - ((%word.char.mix;)+)>
-<!ATTLIST FirstTerm
- %linkend.attrib; --to GlossEntry or other explanation--
- %common.attrib;
- %firstterm.role.attrib;
- %local.firstterm.attrib;
->
-<!--end of firstterm.module-->]]>
-
-<!ENTITY % foreignphrase.module "INCLUDE">
-<![ %foreignphrase.module; [
-<!ENTITY % local.foreignphrase.attrib "">
-<!ENTITY % foreignphrase.role.attrib "%role.attrib;">
-<!ELEMENT ForeignPhrase - - ((%para.char.mix;)+)>
-<!ATTLIST ForeignPhrase
- %common.attrib;
- %foreignphrase.role.attrib;
- %local.foreignphrase.attrib;
->
-<!--end of foreignphrase.module-->]]>
-
-<!ENTITY % glossterm.module "INCLUDE">
-<![ %glossterm.module; [
-<!ENTITY % local.glossterm.attrib "">
-<!ENTITY % glossterm.role.attrib "%role.attrib;">
-<!ELEMENT GlossTerm - O ((%para.char.mix;)+)>
-<!ATTLIST GlossTerm
- %linkend.attrib; --to GlossEntry if Glossterm used in text--
- --
- BaseForm: Provides the form of GlossTerm to be used
- for indexing
- --
- BaseForm CDATA #IMPLIED
- %common.attrib;
- %glossterm.role.attrib;
- %local.glossterm.attrib;
->
-<!--end of glossterm.module-->]]>
-
-<!ENTITY % phrase.module "INCLUDE">
-<![ %phrase.module; [
-<!ENTITY % local.phrase.attrib "">
-<!ENTITY % phrase.role.attrib "%role.attrib;">
-<!ELEMENT Phrase - - ((%para.char.mix;)+)>
-<!ATTLIST Phrase
- %common.attrib;
- %phrase.role.attrib;
- %local.phrase.attrib;
->
-<!--end of phrase.module-->]]>
-
-<!ENTITY % quote.module "INCLUDE">
-<![ %quote.module; [
-<!ENTITY % local.quote.attrib "">
-<!ENTITY % quote.role.attrib "%role.attrib;">
-<!ELEMENT Quote - - ((%para.char.mix;)+)>
-<!ATTLIST Quote
- %common.attrib;
- %quote.role.attrib;
- %local.quote.attrib;
->
-<!--end of quote.module-->]]>
-
-<!ENTITY % ssscript.module "INCLUDE">
-<![ %ssscript.module; [
-<!ENTITY % local.ssscript.attrib "">
-<!ENTITY % ssscript.role.attrib "%role.attrib;">
-<!ELEMENT (Subscript | Superscript) - - ((#PCDATA
- | %link.char.class;
- | Emphasis
- | Replaceable
- | Symbol
- | InlineGraphic
- | %base.char.class;
- | %other.char.class;)+)
- -(%ubiq.mix;)>
-<!ATTLIST (Subscript | Superscript)
- %common.attrib;
- %ssscript.role.attrib;
- %local.ssscript.attrib;
->
-<!--end of ssscript.module-->]]>
-
-<!ENTITY % trademark.module "INCLUDE">
-<![ %trademark.module; [
-<!ENTITY % local.trademark.attrib "">
-<!ENTITY % trademark.role.attrib "%role.attrib;">
-<!ELEMENT Trademark - - ((#PCDATA
- | %link.char.class;
- | %tech.char.class;
- | %base.char.class;
- | %other.char.class;
- | InlineGraphic
- | Emphasis)+)>
-<!ATTLIST Trademark
- --
- Class: More precisely identifies the item the element names
- --
- Class (Service
- |Trade
- |Registered
- |Copyright) Trade
- %common.attrib;
- %trademark.role.attrib;
- %local.trademark.attrib;
->
-<!--end of trademark.module-->]]>
-
-<!ENTITY % wordasword.module "INCLUDE">
-<![ %wordasword.module; [
-<!ENTITY % local.wordasword.attrib "">
-<!ENTITY % wordasword.role.attrib "%role.attrib;">
-<!ELEMENT WordAsWord - - ((%word.char.mix;)+)>
-<!ATTLIST WordAsWord
- %common.attrib;
- %wordasword.role.attrib;
- %local.wordasword.attrib;
->
-<!--end of wordasword.module-->]]>
-
-<!-- Links and cross-references ........................................... -->
-
-<!ENTITY % link.module "INCLUDE">
-<![ %link.module; [
-<!--FUTURE USE (V4.0):
-......................
-All link elements will be excluded from themselves and each other.
-......................
--->
-<!ENTITY % local.link.attrib "">
-<!ENTITY % link.role.attrib "%role.attrib;">
-<!ELEMENT Link - - ((%para.char.mix;)+)>
-<!ATTLIST Link
- --
- Endterm: ID of element containing text that is to be
- fetched from elsewhere in the document to appear as
- the content of this element
- --
- Endterm IDREF #IMPLIED
- %linkendreq.attrib; --to linked-to object--
- --
- Type: Freely assignable parameter
- --
- Type CDATA #IMPLIED
- %common.attrib;
- %link.role.attrib;
- %local.link.attrib;
->
-<!--end of link.module-->]]>
-
-<!ENTITY % olink.module "INCLUDE">
-<![ %olink.module; [
-<!ENTITY % local.olink.attrib "">
-<!ENTITY % olink.role.attrib "%role.attrib;">
-<!ELEMENT OLink - - ((%para.char.mix;)+)>
-<!ATTLIST OLink
- --
- TargetDocEnt: Name of an entity to be the target of the link
- --
- TargetDocEnt ENTITY #IMPLIED
- --
- LinkMode: ID of a ModeSpec containing instructions for
- operating on the entity named by TargetDocEnt
- --
- LinkMode IDREF #IMPLIED
- --
- LocalInfo: Information that may be passed to ModeSpec
- --
- LocalInfo CDATA #IMPLIED
- --
- Type: Freely assignable parameter
- --
- Type CDATA #IMPLIED
- %common.attrib;
- %olink.role.attrib;
- %local.olink.attrib;
->
-<!--end of olink.module-->]]>
-
-<!ENTITY % ulink.module "INCLUDE">
-<![ %ulink.module; [
-<!ENTITY % local.ulink.attrib "">
-<!ENTITY % ulink.role.attrib "%role.attrib;">
-<!ELEMENT ULink - - ((%para.char.mix;)+)>
-<!ATTLIST ULink
- --
- URL: uniform resource locator; the target of the ULink
- --
- URL CDATA #REQUIRED
- --
- Type: Freely assignable parameter
- --
- Type CDATA #IMPLIED
- %common.attrib;
- %ulink.role.attrib;
- %local.ulink.attrib;
->
-<!--end of ulink.module-->]]>
-
-<!ENTITY % footnoteref.module "INCLUDE">
-<![ %footnoteref.module; [
-<!ENTITY % local.footnoteref.attrib "">
-<!ENTITY % footnoteref.role.attrib "%role.attrib;">
-<!ELEMENT FootnoteRef - O EMPTY>
-<!ATTLIST FootnoteRef
- %linkendreq.attrib; --to footnote content supplied elsewhere--
- %label.attrib;
- %common.attrib;
- %footnoteref.role.attrib;
- %local.footnoteref.attrib;
->
-<!--end of footnoteref.module-->]]>
-
-<!ENTITY % xref.module "INCLUDE">
-<![ %xref.module; [
-<!ENTITY % local.xref.attrib "">
-<!ENTITY % xref.role.attrib "%role.attrib;">
-<!ELEMENT XRef - O EMPTY>
-<!ATTLIST XRef
- --
- Endterm: ID of element containing text that is to be
- fetched from elsewhere in the document to appear as
- the content of this element
- --
- Endterm IDREF #IMPLIED
- %linkendreq.attrib; --to linked-to object--
- %common.attrib;
- %xref.role.attrib;
- %local.xref.attrib;
->
-<!--end of xref.module-->]]>
-
-<!-- Ubiquitous elements .................................................. -->
-
-<!ENTITY % anchor.module "INCLUDE">
-<![ %anchor.module; [
-<!ENTITY % local.anchor.attrib "">
-<!ENTITY % anchor.role.attrib "%role.attrib;">
-<!ELEMENT Anchor - O EMPTY>
-<!ATTLIST Anchor
- %idreq.attrib; -- required --
- %pagenum.attrib; --replaces Lang --
- %remap.attrib;
- %xreflabel.attrib;
- %revisionflag.attrib;
- %effectivity.attrib;
- %anchor.role.attrib;
- %local.anchor.attrib;
->
-<!--end of anchor.module-->]]>
-
-<!ENTITY % beginpage.module "INCLUDE">
-<![ %beginpage.module; [
-<!ENTITY % local.beginpage.attrib "">
-<!ENTITY % beginpage.role.attrib "%role.attrib;">
-<!ELEMENT BeginPage - O EMPTY>
-<!ATTLIST BeginPage
- --
- PageNum: Number of page that begins at this point
- --
- %pagenum.attrib;
- %common.attrib;
- %beginpage.role.attrib;
- %local.beginpage.attrib;
->
-<!--end of beginpage.module-->]]>
-
-<!-- IndexTerms appear in the text flow for generating or linking an
- index. -->
-
-<!ENTITY % indexterm.content.module "INCLUDE">
-<![ %indexterm.content.module; [
-<!ENTITY % indexterm.module "INCLUDE">
-<![ %indexterm.module; [
-<!ENTITY % local.indexterm.attrib "">
-<!ENTITY % indexterm.role.attrib "%role.attrib;">
-<!ELEMENT IndexTerm - O (Primary, ((Secondary, ((Tertiary, (See|SeeAlso+)?)
- | See | SeeAlso+)?) | See | SeeAlso+)?) -(%ubiq.mix;)>
-<!ATTLIST IndexTerm
- %pagenum.attrib;
- --
- Scope: Indicates which generated indices the IndexTerm
- should appear in: Global (whole document set), Local (this
- document only), or All (both)
- --
- Scope (All
- |Global
- |Local) #IMPLIED
- --
- Significance: Whether this IndexTerm is the most pertinent
- of its series (Preferred) or not (Normal, the default)
- --
- Significance (Preferred
- |Normal) Normal
- --
- Class: Indicates type of IndexTerm; default is Singular,
- or EndOfRange if StartRef is supplied; StartOfRange value
- must be supplied explicitly on starts of ranges
- --
- Class (Singular
- |StartOfRange
- |EndOfRange) #IMPLIED
- --
- StartRef: ID of the IndexTerm that starts the indexing
- range ended by this IndexTerm
- --
- StartRef IDREF #CONREF
- --
- Zone: IDs of the elements to which the IndexTerm applies,
- and indicates that the IndexTerm applies to those entire
- elements rather than the point at which the IndexTerm
- occurs
- --
- Zone IDREFS #IMPLIED
- %common.attrib;
- %indexterm.role.attrib;
- %local.indexterm.attrib;
->
-<!--end of indexterm.module-->]]>
-
-<!ENTITY % primsecter.module "INCLUDE">
-<![ %primsecter.module; [
-<!ENTITY % local.primsecter.attrib "">
-<!ENTITY % primsecter.role.attrib "%role.attrib;">
-<!ELEMENT (Primary | Secondary | Tertiary) - O ((%ndxterm.char.mix;)+)>
-<!ATTLIST (Primary | Secondary | Tertiary)
- --
- SortAs: Alternate sort string for index sorting, e.g.,
- "fourteen" for an element containing "14"
- --
- SortAs CDATA #IMPLIED
- %common.attrib;
- %primsecter.role.attrib;
- %local.primsecter.attrib;
->
-<!--end of primsecter.module-->]]>
-
-<!ENTITY % seeseealso.module "INCLUDE">
-<![ %seeseealso.module; [
-<!ENTITY % local.seeseealso.attrib "">
-<!ENTITY % seeseealso.role.attrib "%role.attrib;">
-<!ELEMENT (See | SeeAlso) - O ((%ndxterm.char.mix;)+)>
-<!ATTLIST (See | SeeAlso)
- %common.attrib;
- %seeseealso.role.attrib;
- %local.seeseealso.attrib;
->
-<!--end of seeseealso.module-->]]>
-<!--end of indexterm.content.module-->]]>
-
-<!-- End of DocBook information pool module V3.0 .......................... -->
-<!-- ...................................................................... -->
diff --git a/share/sgml/docbook/docbook.dcl b/share/sgml/docbook/docbook.dcl
deleted file mode 100644
index bb3a754..0000000
--- a/share/sgml/docbook/docbook.dcl
+++ /dev/null
@@ -1,106 +0,0 @@
-<!SGML "ISO 8879:1986"
- -- ...................................................................... --
- -- DocBook SGML declaration V3.0 ........................................ --
- -- file docbook.dcl ..................................................... --
-
-CHARSET
-
- BASESET
- "ISO 646:1983//CHARSET International Reference Version (IRV)//ESC 2/5 4/0"
- DESCSET
- 0 9 UNUSED
- 9 2 9
- 11 2 UNUSED
- 13 1 13
- 14 18 UNUSED
- 32 95 32
- 127 1 UNUSED
-
- BASESET
- "ISO Registration Number 100//CHARSET ECMA-94 Right Part of Latin Alphabet Nr. 1//ESC 2/13 4/1"
- DESCSET
- 128 32 UNUSED
- 160 96 32
-
-CAPACITY SGMLREF
-
- TOTALCAP 99000000
- ATTCAP 1000000
- ATTCHCAP 1000000
- AVGRPCAP 1000000
- ELEMCAP 1000000
- ENTCAP 1000000
- ENTCHCAP 1000000
- GRPCAP 1000000
- IDCAP 32000000
- IDREFCAP 32000000
-
-SCOPE DOCUMENT
-
-SYNTAX
-
- SHUNCHAR CONTROLS 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 128 129
- 130 131 132 133 134 135 136 137 138 139
- 140 141 142 143 144 145 146 147 148 149
- 150 151 152 153 154 155 156 157 158 159
-
- BASESET
- "ISO 646:1983//CHARSET International Reference Version (IRV)//ESC 2/5 4/0"
- DESCSET
- 0 128 0
-
- FUNCTION
- RE 13
- RS 10
- SPACE 32
- TAB SEPCHAR 9
-
- NAMING
- LCNMSTRT ""
- UCNMSTRT ""
- LCNMCHAR ".-"
- UCNMCHAR ".-"
- NAMECASE
- GENERAL YES
- ENTITY NO
-
- DELIM
- GENERAL SGMLREF
- SHORTREF SGMLREF
-
- NAMES SGMLREF
-
- QUANTITY SGMLREF
- ATTCNT 256
- GRPCNT 253
- GRPGTCNT 253
- LITLEN 8092
- NAMELEN 44
- TAGLVL 100
-
-FEATURES
-
- MINIMIZE
- DATATAG NO
- OMITTAG NO
- RANK NO
- SHORTTAG YES
-
- LINK
- SIMPLE NO
- IMPLICIT NO
- EXPLICIT NO
-
- OTHER
- CONCUR NO
- SUBDOC NO
- FORMAL YES
-
-APPINFO NONE
-
- -- End of DocBook SGML declaration V3.0 ................................. --
- -- ...................................................................... --
->
diff --git a/share/sgml/docbook/docbook.dtd b/share/sgml/docbook/docbook.dtd
deleted file mode 100644
index 6f56a2b..0000000
--- a/share/sgml/docbook/docbook.dtd
+++ /dev/null
@@ -1,277 +0,0 @@
-<!-- ...................................................................... -->
-<!-- DocBook DTD V3.0 ..................................................... -->
-<!-- File docbook.dtd ..................................................... -->
-
-<!-- Copyright 1992, 1993, 1994, 1995, 1996 HaL Computer Systems, Inc.,
- O'Reilly & Associates, Inc., ArborText, Inc., and Fujitsu Software
- Corporation.
-
- Permission to use, copy, modify and distribute the DocBook DTD and
- its accompanying documentation for any purpose and without fee is
- hereby granted in perpetuity, provided that the above copyright
- notice and this paragraph appear in all copies. The copyright
- holders make no representation about the suitability of the DTD for
- any purpose. It is provided "as is" without expressed or implied
- warranty.
-
- If you modify the DocBook DTD in any way, except for declaring and
- referencing additional sets of general entities and declaring
- additional notations, label your DTD as a variant of DocBook. See
- the maintenance documentation for more information.
-
- Please direct all questions, bug reports, or suggestions for
- changes to the davenport@online.ora.com mailing list or to one of
- the maintainers:
-
- o Terry Allen, Fujitsu Software Corporation
- 3055 Orchard Drive, San Jose, CA 95134
- <tallen@fsc.fujitsu.com>
-
- o Eve Maler, ArborText Inc.
- 105 Lexington St., Burlington, MA 01803
- <elm@arbortext.com>
--->
-
-<!-- ...................................................................... -->
-
-<!-- This is the driver file for Version 3.0 of the DocBook DTD.
- Please use the following formal public identifier to identify it:
-
- "-//Davenport//DTD DocBook V3.0//EN"
-
- For example, if your document's top-level element is Book, and
- you are using DocBook directly, use the FPI in the DOCTYPE
- declaration:
-
- <!DOCTYPE Book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [...]>
-
- Or, if you have a higher-level driver file that customizes DocBook,
- use the FPI in the parameter entity declaration:
-
- <!ENTITY % DocBookDTD PUBLIC "-//Davenport//DTD DocBook V3.0//EN">
- %DocBookDTD;
-
- The DocBook DTD is accompanied by an SGML declaration.
-
- See the documentation for detailed information on the parameter
- entity and module scheme used in DocBook, customizing DocBook and
- planning for interchange, and changes made since the last release
- of DocBook.
--->
-
-<!-- ...................................................................... -->
-<!-- Notation declarations ................................................ -->
-
-<!ENTITY % local.notation.class "">
-<!ENTITY % notation.class
- "BMP| CGM-CHAR | CGM-BINARY | CGM-CLEAR | DITROFF | DVI
- | EPS | EQN | FAX | GIF | GIF87a | GIF89a | IGES | PCX
- | PIC | PS | SGML | TBL | TEX | TIFF | WMF | WPG
- | linespecific
- %local.notation.class;">
-
-<!NOTATION BMP PUBLIC
-"+//ISBN 0-7923-9432-1::Graphic Notation//NOTATION Microsoft Windows bitmap//EN">
-<!NOTATION CGM-CHAR PUBLIC "ISO 8632/2//NOTATION Character encoding//EN">
-<!NOTATION CGM-BINARY PUBLIC "ISO 8632/3//NOTATION Binary encoding//EN">
-<!NOTATION CGM-CLEAR PUBLIC "ISO 8632/4//NOTATION Clear text encoding//EN">
-<!NOTATION DITROFF SYSTEM "DITROFF">
-<!NOTATION DVI SYSTEM "DVI">
-<!NOTATION EPS PUBLIC
-"+//ISBN 0-201-18127-4::Adobe//NOTATION PostScript Language Ref. Manual//EN">
-<!-- EQN was SYSTEM "-//AT&T//NOTATION EQN-1//EN" -->
-<!NOTATION EQN SYSTEM>
-<!NOTATION FAX PUBLIC
-"-//USA-DOD//NOTATION CCITT Group 4 Facsimile Type 1 Untiled Raster//EN">
-<!NOTATION GIF SYSTEM "GIF">
-<!NOTATION GIF87a PUBLIC
-"-//CompuServe//NOTATION Graphics Interchange Format 87a//EN">
-
-<!NOTATION GIF89a PUBLIC
-"-//CompuServe//NOTATION Graphics Interchange Format 89a//EN">
-<!NOTATION IGES PUBLIC
-"-//USA-DOD//NOTATION (ASME/ANSI Y14.26M-1987) Initial Graphics Exchange Specification//EN">
-<!NOTATION PCX PUBLIC
-"+//ISBN 0-7923-9432-1::Graphic Notation//NOTATION ZSoft PCX bitmap//EN">
-<!-- PIC was SYSTEM "-//AT&T//NOTATION EQN-1//EN" -->
-<!NOTATION PIC SYSTEM>
-<!NOTATION PS SYSTEM "PS">
-<!NOTATION SGML PUBLIC
-"ISO 8879:1986//NOTATION Standard Generalized Markup Language//EN">
-<!-- TBL was SYSTEM "-//AT&T//NOTATION EQN-1//EN" -->
-<!NOTATION TBL SYSTEM>
-<!NOTATION TEX PUBLIC
-"+//ISBN 0-201-13448-9::Knuth//NOTATION The TeXbook//EN">
-<!NOTATION TIFF SYSTEM "TIFF">
-<!NOTATION WMF PUBLIC
-"+//ISBN 0-7923-9432-1::Graphic Notation//NOTATION Microsoft Windows Metafile//EN">
-<!NOTATION WPG SYSTEM "WPG" --WordPerfect Graphic format-->
-<!NOTATION linespecific SYSTEM
-"line ends and leading white space must be preserved in output">
-
-<!-- ...................................................................... -->
-<!-- ISO character entity sets ............................................ -->
-
-<!ENTITY % ISOamsa.module "INCLUDE">
-<![ %ISOamsa.module; [
-<!ENTITY % ISOamsa PUBLIC
-"ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN">
-%ISOamsa;
-<!--end of ISOamsa.module-->]]>
-
-<!ENTITY % ISOamsb.module "INCLUDE">
-<![ %ISOamsb.module; [
-<!ENTITY % ISOamsb PUBLIC
-"ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN">
-%ISOamsb;
-<!--end of ISOamsb.module-->]]>
-
-<!ENTITY % ISOamsc.module "INCLUDE">
-<![ %ISOamsc.module; [
-<!ENTITY % ISOamsc PUBLIC
-"ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN">
-%ISOamsc;
-<!--end of ISOamsc.module-->]]>
-
-<!ENTITY % ISOamsn.module "INCLUDE">
-<![ %ISOamsn.module; [
-<!ENTITY % ISOamsn PUBLIC
-"ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN">
-%ISOamsn;
-<!--end of ISOamsn.module-->]]>
-
-<!ENTITY % ISOamso.module "INCLUDE">
-<![ %ISOamso.module; [
-<!ENTITY % ISOamso PUBLIC
-"ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN">
-%ISOamso;
-<!--end of ISOamso.module-->]]>
-
-<!ENTITY % ISOamsr.module "INCLUDE">
-<![ %ISOamsr.module; [
-<!ENTITY % ISOamsr PUBLIC
-"ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN">
-%ISOamsr;
-<!--end of ISOamsr.module-->]]>
-
-<!ENTITY % ISObox.module "INCLUDE">
-<![ %ISObox.module; [
-<!ENTITY % ISObox PUBLIC
-"ISO 8879:1986//ENTITIES Box and Line Drawing//EN">
-%ISObox;
-<!--end of ISObox.module-->]]>
-
-<!ENTITY % ISOcyr1.module "INCLUDE">
-<![ %ISOcyr1.module; [
-<!ENTITY % ISOcyr1 PUBLIC
-"ISO 8879:1986//ENTITIES Russian Cyrillic//EN">
-%ISOcyr1;
-<!--end of ISOcyr1.module-->]]>
-
-<!ENTITY % ISOcyr2.module "INCLUDE">
-<![ %ISOcyr2.module; [
-<!ENTITY % ISOcyr2 PUBLIC
-"ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN">
-%ISOcyr2;
-<!--end of ISOcyr2.module-->]]>
-
-<!ENTITY % ISOdia.module "INCLUDE">
-<![ %ISOdia.module; [
-<!ENTITY % ISOdia PUBLIC
-"ISO 8879:1986//ENTITIES Diacritical Marks//EN">
-%ISOdia;
-<!--end of ISOdia.module-->]]>
-
-<!ENTITY % ISOgrk1.module "INCLUDE">
-<![ %ISOgrk1.module; [
-<!ENTITY % ISOgrk1 PUBLIC
-"ISO 8879:1986//ENTITIES Greek Letters//EN">
-%ISOgrk1;
-<!--end of ISOgrk1.module-->]]>
-
-<!ENTITY % ISOgrk2.module "INCLUDE">
-<![ %ISOgrk2.module; [
-<!ENTITY % ISOgrk2 PUBLIC
-"ISO 8879:1986//ENTITIES Monotoniko Greek//EN">
-%ISOgrk2;
-<!--end of ISOgrk2.module-->]]>
-
-<!ENTITY % ISOgrk3.module "INCLUDE">
-<![ %ISOgrk3.module; [
-<!ENTITY % ISOgrk3 PUBLIC
-"ISO 8879:1986//ENTITIES Greek Symbols//EN">
-%ISOgrk3;
-<!--end of ISOgrk3.module-->]]>
-
-<!ENTITY % ISOgrk4.module "INCLUDE">
-<![ %ISOgrk4.module; [
-<!ENTITY % ISOgrk4 PUBLIC
-"ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN">
-%ISOgrk4;
-<!--end of ISOgrk4.module-->]]>
-
-<!ENTITY % ISOlat1.module "INCLUDE">
-<![ %ISOlat1.module; [
-<!ENTITY % ISOlat1 PUBLIC
-"ISO 8879:1986//ENTITIES Added Latin 1//EN">
-%ISOlat1;
-<!--end of ISOlat1.module-->]]>
-
-<!ENTITY % ISOlat2.module "INCLUDE">
-<![ %ISOlat2.module; [
-<!ENTITY % ISOlat2 PUBLIC
-"ISO 8879:1986//ENTITIES Added Latin 2//EN">
-%ISOlat2;
-<!--end of ISOlat2.module-->]]>
-
-<!ENTITY % ISOnum.module "INCLUDE">
-<![ %ISOnum.module; [
-<!ENTITY % ISOnum PUBLIC
-"ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN">
-%ISOnum;
-<!--end of ISOnum.module-->]]>
-
-<!ENTITY % ISOpub.module "INCLUDE">
-<![ %ISOpub.module; [
-<!ENTITY % ISOpub PUBLIC
-"ISO 8879:1986//ENTITIES Publishing//EN">
-%ISOpub;
-<!--end of ISOpub.module-->]]>
-
-<!ENTITY % ISOtech.module "INCLUDE">
-<![ %ISOtech.module; [
-<!ENTITY % ISOtech PUBLIC
-"ISO 8879:1986//ENTITIES General Technical//EN">
-%ISOtech;
-<!--end of ISOtech.module-->]]>
-
-<!-- ...................................................................... -->
-<!-- DTD modules .......................................................... -->
-
-<!-- Information pool .............. -->
-
-<!ENTITY % dbpool PUBLIC
-"-//Davenport//ELEMENTS DocBook Information Pool V3.0//EN">
-%dbpool;
-
-<!-- Redeclaration placeholder ..... -->
-
-<!ENTITY % intermod.redecl.module "IGNORE">
-<![ %intermod.redecl.module; [
-%rdbmods;
-<!--end of intermod.redecl.module-->]]>
-
-<!-- Document hierarchy ............ -->
-
-<!ENTITY % dbhier PUBLIC
-"-//Davenport//ELEMENTS DocBook Document Hierarchy V3.0//EN">
-%dbhier;
-<!-- ...................................................................... -->
-<!-- Other general entities ............................................... -->
-
-<!ENTITY % dbgenent PUBLIC
-"-//Davenport//ENTITIES DocBook Additional General Entities V3.0//EN">
-%dbgenent;
-
-<!-- End of DocBook DTD V3.0 .............................................. -->
-<!-- ...................................................................... -->
diff --git a/share/sgml/transpec/Makefile b/share/sgml/transpec/Makefile
deleted file mode 100644
index e7de82d..0000000
--- a/share/sgml/transpec/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $Id: Makefile,v 1.4 1997/02/22 13:56:25 peter Exp $
-
-FILES= roff.cmap roff.sdata linuxdoc-roff.ts
-FILES+= html.cmap html.sdata linuxdoc-html.ts
-FILES+= docbook-html.ts
-FILES+= transpec.dtd
-NOOBJ= noobj
-
-all clean cleandir depend lint tags:
-
-afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
- ${DESTDIR}${BINDIR}/${.CURDIR:T}
-
-.include <bsd.prog.mk>
diff --git a/share/sgml/transpec/docbook-html.ts b/share/sgml/transpec/docbook-html.ts
deleted file mode 100644
index 8fa6f55..0000000
--- a/share/sgml/transpec/docbook-html.ts
+++ /dev/null
@@ -1,2845 +0,0 @@
-<!--
-
- $Id: docbook-html.ts,v 1.8 1997/01/19 21:21:18 jfieber Exp $
-
- Copyright (C) 1997
- John R. Fieber. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY JOHN R. FIEBER AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL JOHN R. FIEBER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
--->
-
-<!--
-
- This is an instant(1) translation specification to turn an
- SGML document marked up according to the Docbook DTD into
- HTML.
-
- The rules in this file are in alphabetical order according
- to the name of the element to which they apply. Rules
- intended to be invoked from other rules are at the end of
- the file. The order of the rules affects how they are processed
- and an alphabetical order helps prevent unpleasnt surprises.
-
--->
-
-<!DOCTYPE transpec PUBLIC "-//FreeBSD//DTD transpec//EN" [
-
-<!ENTITY lt CDATA "<">
-<!ENTITY gt CDATA ">">
-<!ENTITY amp CDATA "&">
-
-<!-- Entities for frequently used constructs. -->
-
-<!ENTITY wspace CDATA "&nbsp;&nbsp;">
-
-<!ENTITY hlofont CDATA '<FONT COLOR="#660000">'>
-<!ENTITY hlofont CDATA '<FONT FACE="Helvetica">'>
-<!ENTITY hlcfont CDATA '</FONT>'>
-
-<!ENTITY c.admon CDATA ''>
-<!ENTITY c.admon CDATA ' BGCOLOR="FFFFEE"'>
-
-<!ENTITY m.preblk '<start>${_action &r.blkps;t}
-&lt;BLOCKQUOTE>&lt;PRE></start>
-<end>&lt;/PRE>&lt;/BLOCKQUOTE>
-${_action &r.blkpe;t}</end>'>
-
-<!ENTITY m.blk '<start>${_action &r.blkps;t}
-&lt;BLOCKQUOTE></start>
-<end>&lt;/BLOCKQUOTE>
-${_action &r.blkpe;t}</end>'>
-
-<!ENTITY m.tt '<start>&lt;TT></start>
-<end>&lt;/TT></end>'>
-
-<!ENTITY m.i '<start>&lt;I></start>
-<end>&lt;/I></end>'>
-
-<!ENTITY m.b '<start>&lt;B></start>
-<end>&lt;/B></end>'>
-
-<!ENTITY m.u '<start>&lt;U></start>
-<end>&lt;/U></end>'>
-
-<!-- Rule names (instant(1) only allows cryptic numbers). -->
-
-<!ENTITY r.pass "1">
-<!ENTITY r.ignore "6">
-<!ENTITY r.admon "7">
-<!ENTITY r.prgi "9">
-<!ENTITY r.anchor "10">
-
-<!ENTITY r.pttoc "16">
-<!ENTITY r.pttoci "17">
-<!ENTITY r.pftoci "18">
-<!ENTITY r.chtoc "19">
-<!ENTITY r.chtoci "20">
-<!ENTITY r.s1toc "21">
-<!ENTITY r.s1toci "22">
-<!ENTITY r.s2toc "23">
-<!ENTITY r.s2toci "24">
-<!ENTITY r.s3toc "25">
-<!ENTITY r.s3toci "26">
-<!ENTITY r.aptoci "27">
-
-<!ENTITY r.fnote "40">
-<!ENTITY r.fnotei "41">
-
-<!ENTITY r.blkps "50">
-<!ENTITY r.blkpe "51">
-
-<!ENTITY r.hyphen "60">
-<!ENTITY r.nl "61">
-
-<!ENTITY r.inchdr "70">
-<!ENTITY r.incftr "71">
-
-<!ENTITY cmap SYSTEM "/usr/share/sgml/transpec/html.cmap">
-<!ENTITY sdata SYSTEM "/usr/share/sgml/transpec/html.sdata">
-
-]>
-
-<transpec>
-
-<!-- Character and SDATA entity mapping -->
-
-<cmap>&cmap;</cmap>
-<smap>&sdata;</smap>
-
-<!-- Numerous counters -->
-
-<var>partnum 1
-<var>pfnum 1
-<var>chapnum 1
-<var>sect1num 1
-<var>sect2num 1
-<var>sect3num 1
-<var>sect4num 1
-<var>sect5num 1
-<var>subsect 1
-<var>appnum A
-<var>exnum 1
-<var>fignum 1
-<var>tabnum 1
-<var>eqnum 1
-<var>fnotenum 1
-<var>tmpchapnum 1
-
-<!-- This is a bit of a hack. The rule for ANCHOR looks at this
- and does nothing if it is set. Rules that go collecting
- data from other parts of the document should set this to 1
- to prevent a given anchor from appearing more than once.
- Generally, dealing with IDs needs to be completely reworked. -->
-
-<var>anchorinhibit 0</var>
-
-<!-- Transform rules -->
-
-<rule> <!-- Abbreviation, especially one followed by a period -->
-<match>
-<gi>ABBREV
-</rule>
-
-<rule> <!-- Document summary -->
-<match>
-<gi>ABSTRACT
-<action>
-<start>${_action &r.anchor;t}</start>
-</rule>
-
-<rule> <!-- Keycap used with a meta key to activate a graphical user interface -->
-<match>
-<gi>ACCEL
-<action>
-&m.u;
-</rule>
-
-<rule> <!-- Acknowledgements in an Article -->
-<match>
-<gi>ACKNO
-<action>
-<start>^&lt;P></start>
-<end>&lt;/P>^</end>
-</rule>
-
-<rule> <!-- Pronounceable contraction of initials -->
-<match>
-<gi>ACRONYM
-<content>^[^a-z]*$</content>
-<action>
-<replace>&lt;SMALL>${_! echo -n "${+content}" | tr "[:lower:]" "[:upper:]"}&lt;/SMALL></replace>
-</rule>
-
-<rule> <!-- Pronounceable contraction of initials -->
-<match>
-<gi>ACRONYM
-</rule>
-
-<rule> <!-- Function invoked in response to a user event -->
-<match>
-<gi>ACTION
-</rule>
-
-<rule> <!-- Real-world address -->
-<match>
-<gi>ADDRESS
-<action>
-<start>${_action &r.blkps;t}
-&lt;P></start>
-<end>&lt;/P>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Author's institutional affiliation -->
-<match>
-<gi>AFFILIATION
-<action>
-<start>&lt;BR></start>
-</rule>
-
-<rule> <!-- Prose explanation of a nonprose element -->
-<match>
-<gi>ALT
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Spot in text -->
-<match>
-<gi>ANCHOR
-<action>
-<start>${_isset anchorinhibit 0 &r.anchor;t}</start>
-</rule>
-
-<rule> <!-- Appendix for a Book -->
-<match>
-<gi>APPENDIX
-<action>
-<start>^${_set chapnum ${appnum}}&lt;!-- Start APPENDIX ${appnum} (${ID}):
-${_followrel child TITLE &r.pass;} -->^</start>
-<end>^&lt;!-- End APPENDIX -->^</end>
-<incr>appnum
-<set>sect1num 1
-</rule>
-
-<rule> <!-- Name of a software program -->
-<match>
-<gi>APPLICATION
-<action>
-&m.b;
-</rule>
-
-<rule> <!-- Region defined in a graphic or code example -->
-<match>
-<gi>AREA
-</rule>
-
-<rule> <!-- Set of related areas in a graphic or code example -->
-<match>
-<gi>AREASET
-</rule>
-
-<rule> <!-- Collection of regions in a graphic or code example -->
-<match>
-<gi>AREASPEC
-</rule>
-
-<rule> <!-- Argument in a CmdSynopsis -->
-<match>
-<gi>ARG
-<attval>CHOICE OPT
-<attval>REP NOREPEAT
-<action>
-<start>^[</start>
-<end>]^</end>
-</rule>
-
-<rule> <!-- Argument in a CmdSynopsis -->
-<match>
-<gi>ARG
-<attval>CHOICE OPT
-<action>
-<start>^[</start>
-<end>&amp;nbsp;...&amp;nbsp;]^</end>
-</rule>
-
-<rule> <!-- Argument in a CmdSynopsis -->
-<match>
-<gi>ARG
-<attval>CHOICE REQ
-<attval>REP NOREPEAT
-<action>
-<start>^{</start>
-<end>}^</end>
-</rule>
-
-<rule> <!-- Argument in a CmdSynopsis -->
-<match>
-<gi>ARG
-<attval>CHOICE REQ
-<action>
-<start>^{</start>
-<end>&amp;nbsp;...&amp;nbsp;}^</end>
-</rule>
-
-<rule> <!-- Argument in a CmdSynopsis -->
-<match>
-<gi>ARG
-<attval>REP REPEAT
-<action>
-<start>^</start>
-<end>&amp;nbsp;...^</end>
-</rule>
-
-<rule> <!-- Argument in a CmdSynopsis -->
-<match>
-<gi>ARG
-<action>
-<start>^</start>
-<end>^</end>
-</rule>
-
-<rule> <!-- Metainformation for an Article -->
-<match>
-<gi>ARTHEADER
-</rule>
-
-<rule> <!-- Article -->
-<match>
-<gi>ARTICLE
-</rule>
-
-<rule> <!-- Page numbers of an Article as published -->
-<match>
-<gi>ARTPAGENUMS
-</rule>
-
-<rule> <!-- Attribution of content for a BlockQuote or Epigraph -->
-<match>
-<gi>ATTRIBUTION
-<action>
-<ignore>all
-</rule>
-
-<rule> <!-- Author of a document -->
-<match>
-<gi>AUTHOR
-<action>
-<start>^&lt;P></start>
-<!-- <end>&lt;/P>^ -->
-</rule>
-
-<rule> <!-- Short description of author -->
-<match>
-<gi>AUTHORBLURB
-</rule>
-
-<rule> <!-- Wrapper for Author information -->
-<match>
-<gi>AUTHORGROUP
-</rule>
-
-<rule> <!-- Initials or other identifier for the author of a Revision or Comment -->
-<match>
-<gi>AUTHORINITIALS
-</rule>
-
-<rule> <!-- Page break in a print version of a work that may be displayed online -->
-<match>
-<gi>BEGINPAGE
-</rule>
-
-<rule> <!-- Section of a Bibliography -->
-<match>
-<gi>BIBLIODIV
-</rule>
-
-<rule> <!-- Entry in a Bibliography -->
-<match>
-<gi>BIBLIOENTRY
-</rule>
-
-<rule> <!-- Bibliography -->
-<match>
-<gi>BIBLIOGRAPHY
-</rule>
-
-<rule> <!-- Untyped information supplied in a BiblioEntry or BookInfo -->
-<match>
-<gi>BIBLIOMISC
-</rule>
-
-<rule> <!-- Entry in a Bibliography -->
-<match>
-<gi>BIBLIOMIXED
-</rule>
-
-<rule> <!-- Container for related bibliographic information -->
-<match>
-<gi>BIBLIOMSET
-</rule>
-
-<rule> <!-- Container for related bibliographic information -->
-<match>
-<gi>BIBLIOSET
-</rule>
-
-<rule> <!-- Quotation set off from the main text, rather than occurring in-line -->
-<match>
-<gi>BLOCKQUOTE
-<relation>child ATTRIBUTION
-<action>
-<start>${_action &r.blkps;t}
-${_action &r.anchor;t}&lt;BLOCKQUOTE></start>
-<end>&lt;P ALIGN=RIGHT>&lt;I>--
-${_followrel child ATTRIBUTION &r.pass;}&lt;/I>&lt;/P>
-&lt;/BLOCKQUOTE>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Quotation set off from the main text, rather than occurring in-line -->
-<match>
-<gi>BLOCKQUOTE
-<action>
-<start>${_action &r.blkps;t}
-${_action &r.anchor;t}&lt;BLOCKQUOTE></start>
-<end>&lt;/BLOCKQUOTE>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Book -->
-<match>
-<gi>BOOK
-<action>
-<start>^&lt;!-- Generated on ${date} using ${transpec} -->
-&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
-&lt;HTML>&lt;TITLE>${_followrel descendant TITLE &r.pass;}&lt;/TITLE>
-&lt;BODY BGCOLOR="#FFFFFF" TEXT="#000000">
-${_isset inchdr &r.inchdr;}^</start>
-<end>^${_set fnotenum 1}${_action &r.fnote;t}
-${_isset incftr &r.incftr;}
-&lt;/BODY>&lt;/HTML></end>
-</rule>
-
-<rule> <!-- Information about a book used in a bibliographical citation -->
-<match>
-<gi>BOOKBIBLIO
-<action>
-<start>^&lt;H1>&hlofont;${_followrel child TITLE &r.pass;}&hlcfont;&lt;/H1></start>
-</rule>
-
-<rule> <!-- Metainformation for a Book -->
-<match>
-<gi>BOOKINFO
-<relation>sibling PART
-<action>
-<end>^&lt;H1>&hlofont;Contents&hlcfont;&lt/H1>
-${_followrel parent BOOK &r.pttoc;t}^</end>
-</rule>
-
-<rule> <!-- Metainformation for a Book -->
-<match>
-<gi>BOOKINFO
-<action>
-<end>^&lt;H1>&hlofont;Contents&hlcfont;&lt/H1>
-${_followrel parent BOOK &r.chtoc;t}^</end>
-</rule>
-
-<rule> <!-- Free-floating heading not tied to the Sect hierarchy -->
-<match>
-<gi>BRIDGEHEAD
-<action>
-<start>^&lt;H4>&hlofont;&lt;EM></start>
-<end>&lt;/EM>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<rule> <!-- Description linked to Areas in a graphic or code example -->
-<match>
-<gi>CALLOUT
-<action>
-<start>^&lt;LI></start>
-<end>&lt;/LI>^</end>
-</rule>
-
-<rule> <!-- Collection of callout descriptions -->
-<match>
-<gi>CALLOUTLIST
-<action>
-<start>${_action &r.blkps;t}
-&lt;UL>^</start>
-<end>^&lt;/UL>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Admonition set off from the text -->
-<match>
-<gi>CAUTION
-<action>
-<do>&r.admon;
-</rule>
-
-<rule> <!-- Chapter of a Book -->
-<match>
-<gi>CHAPTER
-<action>
-<start>^&lt;!-- Start CHAPTER ${chapnum} (${ID}): ${_followrel child TITLE &r.pass;} -->^</start>
-<end>^&lt;!-- End CHAPTER -->^</end>
-<incr>chapnum
-<set>sect1num 1
-</rule>
-
-<rule> <!-- In-line bibliographic reference to another published
- work that uses a reference string, such as an abbreviation
- in a Bibliography -->
-<match>
-<gi>CITATION
-<action>
-<start>&lt;CITE></start>
-<end>&lt;/CITE></end>
-</rule>
-
-<rule> <!-- Citation of a RefEntry -->
-<match>
-<gi>CITEREFENTRY
-<!-- a link to a man page cgi would be good here... -->
-</rule>
-
-<rule> <!-- Citation of some published work -->
-<match>
-<gi>CITETITLE
-<action>
-<start>&lt;CITE></start>
-<end>&lt;/CITE></end>
-</rule>
-
-<rule> <!-- Name of a city in an Address -->
-<match>
-<gi>CITY
-</rule>
-
-<rule> <!-- Name of the class to which a program component belongs -->
-<match>
-<gi>CLASSNAME
-</rule>
-
-<rule> <!-- Synopsis for a Command -->
-<match>
-<gi>CMDSYNOPSIS
-<action>
-&m.blk;
-</rule>
-
-<rule> <!-- Callout area specification embedded in a code example -->
-<match>
-<gi>CO
-</rule>
-
-<rule> <!-- A collaborative group of authors -->
-<match>
-<gi>COLLAB
-</rule>
-
-<rule> <!-- Name of a collaborative group of authors -->
-<match>
-<gi>COLLABNAME
-</rule>
-
-<rule> <!-- Formatting specification for a column in a Table -->
-<match>
-<gi>COLSPEC
-</rule>
-
-<rule> <!-- Executable program, or the entry a user makes to execute a command -->
-<match>
-<gi>COMMAND
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Remark made within the document file that is intended for use
- during interim stages of production -->
-<match>
-<gi>COMMENT
-<action>
-<ignore>all
-</rule>
-
-<rule> <!-- Data presented to the user by a computer -->
-<match>
-<gi>COMPUTEROUTPUT
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Dates of a conference in connection with which a document was written -->
-<match>
-<gi>CONFDATES
-</rule>
-
-<rule> <!-- Wrapper for information about a conference -->
-<match>
-<gi>CONFGROUP
-</rule>
-
-<rule> <!-- Formal number of a conference in connection with which a document was written -->
-<match>
-<gi>CONFNUM
-</rule>
-
-<rule> <!-- Sponsor of a conference in connection with which a document was written -->
-<match>
-<gi>CONFSPONSOR
-</rule>
-
-<rule> <!-- Title of a conference in connection with which a document was written -->
-<match>
-<gi>CONFTITLE
-</rule>
-
-<rule> <!-- Number of a contract under which a document was written -->
-<match>
-<gi>CONTRACTNUM
-</rule>
-
-<rule> <!-- Sponsor of a contract under which a document was written -->
-<match>
-<gi>CONTRACTSPONSOR
-</rule>
-
-<rule> <!-- Information about the contributions of an Author,
- Editor, or OtherCredit to the work in question -->
-<match>
-<gi>CONTRIB
-</rule>
-
-<rule> <!-- Copyright information about a documen -->
-<match>
-<gi>COPYRIGHT
-<action>
-<start>^&lt;P>Copyright &amp;copy; </start>
-<!-- <end>&lt;/P>^ -->
-</rule>
-
-<rule> <!-- Corporate author of a Book -->
-<match>
-<gi>CORPAUTHOR
-</rule>
-
-<rule> <!-- Name of a corporation -->
-<match>
-<gi>CORPNAME
-</rule>
-
-<rule> <!-- Name of a country in an Address -->
-<match>
-<gi>COUNTRY
-</rule>
-
-<rule> <!-- Name of an organized set of data -->
-<match>
-<gi>DATABASE
-</rule>
-
-<rule> <!-- Date of publication or revision of a document -->
-<match>
-<gi>DATE
-</rule>
-
-<rule> <!-- Metainformation for a book component -->
-<match>
-<gi>DOCINFO
-</rule>
-
-<rule> <!-- Name or number of an edition of a document -->
-<match>
-<gi>EDITION
-</rule>
-
-<rule> <!-- Editor of a document -->
-<match>
-<gi>EDITOR
-</rule>
-
-<rule> <!-- Email address in an Address -->
-<match>
-<gi>EMAIL
-<action>
-<start>&lt;A HREF="mailto:${_action &r.pass;}"></start>
-<end>&lt;/A></end>
-</rule>
-
-<!-- Emphasis: The remap attribute indicates the procedural markup tags
- used in the linuxdoc DTD. -->
-
-<rule> <!-- Emphasized text: Bold -->
-<match>
-<gi>EMPHASIS
-<attval>REMAP bf
-<action>
-&m.b;
-</rule>
-
-<rule> <!-- Emphasized text: Italic -->
-<match>
-<gi>EMPHASIS
-<attval>REMAP it
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Emphasized text: Sans-Serif -->
-<match>
-<gi>EMPHASIS
-<attval>REMAP sf
-<action>
-<start>&hlofont;</start>
-<end>&hlcfont;</end>
-</rule>
-
-<rule> <!-- Emphasized text: Slanted -->
-<match>
-<gi>EMPHASIS
-<attval>REMAP sl
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Emphasized text: Typewriter -->
-<match>
-<gi>EMPHASIS
-<attval>REMAP tt
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Emphasized text -->
-<match>
-<gi>EMPHASIS
-<action>
-<start>&lt;EM></start>
-<end>&lt;/EM></end>
-</rule>
-
-<rule> <!-- Cell in a table -->
-<match>
-<gi>ENTRY
-<context>ROW THEAD
-<action>
-<start>^&lt;TH></start>
-<end>&lt;/TH>^</end>
-</rule>
-
-<rule> <!-- Cell in a table -->
-<match>
-<gi>ENTRY
-<action>
-<start>^&lt;TD></start>
-<end>&lt;/TD>^</end>
-</rule>
-
-<rule> <!-- Subtable appearing as a table cell -->
-<match>
-<gi>ENTRYTBL
-</rule>
-
-<rule> <!-- Environmental variable -->
-<match>
-<gi>ENVVAR
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Brief text set at the beginning of a document as relevant to its content -->
-<match>
-<gi>EPIGRAPH
-</rule>
-
-<rule> <!-- Formal mathematical equation displayed as a block rather than in-line -->
-<match>
-<gi>EQUATION
-<action>
-<start>${_action &r.blkps;t}
-{_action &r.anchor;t}&lt;HR NOSHADE>&lt;P>&lt;STRONG>${_gi M} ${eqnum}:&lt;/STRONG>
-${_followrel child TITLE &r.pass;}&lt;/P>^</start>
-<end>^&lt;HR NOSHADE>
-${_action &r.blkpe;t}</end>
-<incr>eqnum
-</rule>
-
-<rule> <!-- Error message reported by a computer -->
-<match>
-<gi>ERRORNAME
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Classification of an error message reported by a computer -->
-<match>
-<gi>ERRORTYPE
-</rule>
-
-<rule> <!-- Example of a computer program or related information -->
-<match>
-<gi>EXAMPLE
-<action>
-<start>${_action &r.blkps;t}
-${_action &r.anchor;t}&lt;HR NOSHADE>&lt;P>&lt;STRONG>${_gi M} ${exnum}:&lt;/STRONG>
-${_followrel child TITLE &r.pass;}&lt;/P>^</start>
-<end>^&lt;HR NOSHADE>
-${_action &r.blkpe;t}</end>
-<incr>exnum
-</rule>
-
-<rule> <!-- Fax number in an Address -->
-<match>
-<gi>FAX
-</rule>
-
-<rule> <!-- Formal illustration -->
-<match>
-<gi>FIGURE
-<action>
-<start>${_action &r.blkps;t}
-${_action &r.anchor;t}&lt;HR NOSHADE>&lt;P>&lt;STRONG>${_gi M} ${fignum}:&lt;/STRONG>
-${_followrel child TITLE &r.pass;}&lt;/P>^</start>
-<end>^&lt;HR NOSHADE>
-${_action &r.blkpe;t}</end>
-<incr>fignum
-</rule>
-
-<rule> <!-- Name of a file, possibly including pathname -->
-<match>
-<gi>FILENAME
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Given name -->
-<match>
-<gi>FIRSTNAME
-<action>
-<start>^</start>
-<end>^</end>
-</rule>
-
-<rule> <!-- First occurrence of a word in a given context -->
-<match>
-<gi>FIRSTTERM
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Footnotes: Put both a link and an anchor here
- so that footnotes can be followed in both directions. -->
-<match>
-<gi>FOOTNOTE
-<action>
-<start>&lt;A NAME="rfn-${fnotenum}">&lt;/A>&lt;SUP>&lt;SMALL>&lt;A HREF="#fn-${fnotenum}">${fnotenum}&lt/A>&lt/SMALL>&lt;/SUP></start>
-<ignore>all
-<incr>fnotenum
-</rule>
-
-<rule> <!-- Location of a footnote mark -->
-<match>
-<gi>FOOTNOTEREF
-</rule>
-
-<rule> <!-- Word or words in a language other than that of the containing document -->
-<match>
-<gi>FOREIGNPHRASE
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Paragraph with a Title -->
-<match>
-<gi>FORMALPARA
-</rule>
-
-<rule> <!-- Function or routine name and its return type in a FuncSynopsis -->
-<match>
-<gi>FUNCDEF
-</rule>
-
-<rule> <!-- Parameter information for a function or routine that is
- pointed to from within a FuncSynopsis -->
-<match>
-<gi>FUNCPARAMS
-</rule>
-
-<rule> <!-- Set of function or routine prototype information in a FuncSynopsis -->
-<match>
-<gi>FUNCPROTOTYPE
-</rule>
-
-<rule> <!-- Synopsis of a Function -->
-<match>
-<gi>FUNCSYNOPSIS
-<action>
-&m.blk;
-</rule>
-
-<rule> <!-- Information supplementing the FuncDefs of a FuncSynopsis -->
-<match>
-<gi>FUNCSYNOPSISINFO
-</rule>
-
-<rule> <!-- Subroutine in a program or external library -->
-<match>
-<gi>FUNCTION
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Glossary of terms -->
-<match>
-<gi>GLOSSARY
-<action>
-<start>&lt;H1>&hlofont;${_find gi TITLE &r.pass;}&hlcfont;&lt;/H1>
-&lt;DL>^</start>
-<end>&lt;/DL></end>
-</rule>
-
-<rule> <!-- Definition attached to a GlossTerm in a GlossEntry -->
-<match>
-<gi>GLOSSDEF
-<action>
-<start>&lt;DD></start>
-<end>&lt;/DD>^</end>
-</rule>
-
-<rule> <!-- Division of a Glossary -->
-<match>
-<gi>GLOSSDIV
-</rule>
-
-<rule> <!-- Entry in a Glossary or GlossList -->
-<match>
-<gi>GLOSSENTRY
-</rule>
-
-<rule> <!-- Wrapper for a set of GlossEntries -->
-<match>
-<gi>GLOSSLIST
-<action>
-<start>${_action &r.blkps;t}
-&lt;DL></start>
-<end>&lt;/DL>
-${_action &r.blkps;t}</end>
-</rule>
-
-<rule> <!-- Cross-reference from one GlossEntry to another -->
-<match>
-<gi>GLOSSSEE
-</rule>
-
-<rule> <!-- Cross-reference from one GlossDef to another GlossEntry -->
-<match>
-<gi>GLOSSSEEALSO
-</rule>
-
-<rule> <!-- Term outside a Glossary that is defined in some GlossEntry;
- term within a GlossEntry that is defined by that GlossEntry -->
-<match>
-<gi>GLOSSTERM
-<action>
-<start>^&lt;DT>&lt;STRONG></start>
-<end>&lt;/STRONG>&lt;/DT></end>
-</rule>
-
-<rule> <!-- Graphical data, or a pointer to an external entity containing
- such data, to be rendered as an object, not in-line -->
-<match>
-<gi>GRAPHIC
-<action>
-<replace>${_action &r.blkps;t}
-&lt;P>&lt;A HREF="${_filename}">[image]&lt;/A>&lt;/P>
-${_action &r.blkpe;t}</replace>
-</rule>
-
-<rule> <!-- Graphic that contains a specification of areas within it that
- have associated callouts -->
-<match>
-<gi>GRAPHICCO
-</rule>
-
-<rule> <!-- Group of constituent parts of a CmdSynopsis -->
-<match>
-<gi>GROUP
-</rule>
-
-<rule> <!-- Text on a button in a graphical user interface -->
-<match>
-<gi>GUIBUTTON
-</rule>
-
-<rule> <!-- Graphic and, or, text appearing as a icon in a graphical user interface -->
-<match>
-<gi>GUIICON
-</rule>
-
-<rule> <!-- Text in a graphical user interface -->
-<match>
-<gi>GUILABEL
-</rule>
-
-<rule> <!-- Name of a menu in a graphical user interface -->
-<match>
-<gi>GUIMENU
-</rule>
-
-<rule> <!-- Name of a terminal menu item in a graphical user interface -->
-<match>
-<gi>GUIMENUITEM
-</rule>
-
-<rule> <!-- Name of a submenu in a graphical user interface -->
-<match>
-<gi>GUISUBMENU
-</rule>
-
-<rule> <!-- Physical part of a computer system -->
-<match>
-<gi>HARDWARE
-</rule>
-
-<rule> <!-- List of main points discussed in a book component such as a Chapter -->
-<match>
-<gi>HIGHLIGHTS
-</rule>
-
-<rule> <!-- Holder of a copyright in the containing document -->
-<match>
-<gi>HOLDER
-</rule>
-
-<rule> <!-- Title of a person -->
-<match>
-<gi>HONORIFIC
-</rule>
-
-<rule> <!-- Admonition set off from the text -->
-<match>
-<gi>IMPORTANT
-<action>
-<do>&r.admon;
-</rule>
-
-<rule> <!-- Index to content -->
-<match>
-<gi>INDEX
-</rule>
-
-<rule> <!-- Division of an Index -->
-<match>
-<gi>INDEXDIV
-</rule>
-
-<rule> <!-- Entry in an Index -->
-<match>
-<gi>INDEXENTRY
-</rule>
-
-<rule> <!-- Character string to be indexed, occurring in the text flow but not in the text itself -->
-<match>
-<gi>INDEXTERM
-<action>
-<ignore>all
-</rule>
-
-<rule> <!-- Informal mathematical equation displayed as a block, rather than in-line -->
-<match>
-<gi>INFORMALEQUATION
-<action>
-<start>${_action &r.blkps;t}</start>
-<end>${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Untitled Example -->
-<match>
-<gi>INFORMALEXAMPLE
-<action>
-<start>${_action &r.blkps;t}</start>
-<end>${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Untitled table -->
-<match>
-<gi>INFORMALTABLE
-<action>
-<start>${_action &r.blkps;t}</start>
-<end>${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Untitled mathematical equation occurring in-line or as the
- content of an Equation -->
-<match>
-<gi>INLINEEQUATION
-</rule>
-
-<rule> <!-- Graphical data, or a pointer to an external entity containing
- such data, to be rendered in-line -->
-<match>
-<gi>INLINEGRAPHIC
-</rule>
-
-<rule> <!-- Element of a graphical user interface -->
-<match>
-<gi>INTERFACE
-</rule>
-
-<rule> <!-- Specification for a graphical user interface -->
-<match>
-<gi>INTERFACEDEFINITION
-</rule>
-
-<rule> <!-- Inventory part number -->
-<match>
-<gi>INVPARTNUMBER
-</rule>
-
-<rule> <!-- International Standard Book Number of a document -->
-<match>
-<gi>ISBN
-</rule>
-
-<rule> <!-- International Standard Serial Number of a journal -->
-<match>
-<gi>ISSN
-</rule>
-
-<rule> <!-- Number of an issue of a journal -->
-<match>
-<gi>ISSUENUM
-</rule>
-
-<rule> <!-- List in which each entry is marked with a bullet, dash, or other
- dingbat -->
-<match>
-<gi>ITEMIZEDLIST
-<action>
-<start>${_action &r.blkps;t}
-&lt;UL>^</start>
-<end>^&lt;/UL>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Title of a remunerated position in an Affiliation -->
-<match>
-<gi>JOBTITLE
-</rule>
-
-<rule> <!-- Text printed on a physical key on a computer keyboard, not
- necessarily the same thing as a KeyCode -->
-<match>
-<gi>KEYCAP
-<relation>parent KEYCOMBO
-<action>
-<end>${_relation sibling+1 KEYCAP &r.hyphen;}${_relation sibling+1 KEYSYM &r.hyphen;}${_relation sibling+1 MOUSEBUTTON &r.hyphen;}${_relation sibling+1 KEYCOMBO &r.nl;}</end>
-</rule>
-
-<rule> <!-- Text printed on a physical key on a computer keyboard, not
- necessarily the same thing as a KeyCode -->
-<match>
-<gi>KEYCAP
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Computer's numeric designation of a key on a computer
- keyboard -->
-<match>
-<gi>KEYCODE
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Combination of input actions -->
-<match>
-<gi>KEYCOMBO
-<relation>parent KEYCOMBO
-<relation>sibling+1 KEYCOMBO
-<action>
-<end>^</end>
-</rule>
-
-<rule> <!-- Combination of input actions -->
-<match>
-<gi>KEYCOMBO
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Key symbol name, which is not necessarily the same thing as a
- Keycap -->
-<match>
-<gi>KEYSYM
-<relation>parent KEYCOMBO
-<action>
-<end>${_relation sibling+1 KEYCAP &r.hyphen;}${_relation sibling+1 KEYSYM &r.hyphen;}${_relation sibling+1 MOUSEBUTTON &r.hyphen;}${_relation sibling+1 KEYCOMBO &r.nl;}</end>
-</rule>
-
-<rule> <!-- Key symbol name, which is not necessarily the same thing as a
- Keycap -->
-<match>
-<gi>KEYSYM
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Statement of legal obligations or requirements -->
-<match>
-<gi>LEGALNOTICE
-</rule>
-
-<rule> <!-- Portion of a person's name indicating a relationship to ancestors -->
-<match>
-<gi>LINEAGE
-</rule>
-
-<rule> <!-- Writer's or editor's comment on a line of program code
- within an Example, ProgramListing, or Screen -->
-<match>
-<gi>LINEANNOTATION
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Hypertext link -->
-<match>
-<gi>LINK
-</rule>
-
-<rule> <!-- Wrapper for the elements of items in an ItemizedList or
- OrderedList -->
-<match>
-<gi>LISTITEM
-<context>VARLISTENTRY
-<action>
-<start>^&lt;DD></start>
-<end>&lt;/DD>^</end>
-</rule>
-
-<rule> <!-- Wrapper for the elements of items in an ItemizedList or
- OrderedList -->
-<match>
-<gi>LISTITEM
-<action>
-<start>^&lt;LI></start>
-<end>&lt;/LI>^</end>
-</rule>
-
-<rule> <!-- Literal string, used in-line, that is part of data in a computer -->
-<match>
-<gi>LITERAL
-<context>LITERALLAYOUT
-</rule>
-
-<rule> <!-- Literal string, used in-line, that is part of data in a computer -->
-<match>
-<gi>LITERAL
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Wrapper for lines set off from the main text that are not
- tagged as Screens, Examples, or ProgramListing, in which
- line breaks and leading white space are to be regarded as
- significant -->
-<match>
-<gi>LITERALLAYOUT
-<action>
-<start>${_action &r.blkps;t}
-&lt;PRE>^</start>
-<end>^&lt;/PRE>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- List of titles of objects within a document -->
-<match>
-<gi>LOT
-</rule>
-
-<rule> <!-- Entry in a LoT -->
-<match>
-<gi>LOTENTRY
-</rule>
-
-<rule> <!-- Section of a complete set of UNIX reference pages that a
- reference page belongs to -->
-<match>
-<gi>MANVOLNUM
-<action>
-<start>(</start>
-<end>)</end>
-</rule>
-
-<rule> <!-- String of formatting markup in text, which it is desired to represent
- literally -->
-<match>
-<gi>MARKUP
-</rule>
-
-<rule> <!-- Name of the physical medium on or in which some information
- is contained -->
-<match>
-<gi>MEDIALABEL
-</rule>
-
-<rule> <!-- Member of a SimpleList: first -->
-<match>
-<gi>MEMBER
-<nthchild>1
-</rule>
-
-<rule> <!-- Member of a SimpleList: middle -->
-<match>
-<gi>MEMBER
-<relation>sibling+ MEMBER
-<action>
-<start>, </start>
-</rule>
-
-<rule> <!-- Member of a SimpleList: last -->
-<match>
-<gi>MEMBER
-<action>
-<start>, and </start>
-</rule>
-
-<rule> <!-- Menu selection or series of such selections -->
-<match>
-<gi>MENUCHOICE
-</rule>
-
-<rule> <!-- Application-specific information necessary for the completion
- of an OLink -->
-<match>
-<gi>MODESPEC
-</rule>
-
-<rule> <!-- Conventional name of a mouse button -->
-<match>
-<gi>MOUSEBUTTON
-<relation>parent KEYCOMBO
-<action>
-<end>${_relation sibling+1 KEYCAP &r.hyphen;}${_relation sibling+1 KEYSYM &r.hyphen;}${_relation sibling+1 MOUSEBUTTON &r.hyphen;}${_relation sibling+1 KEYCOMBO &r.nl;}</end>
-</rule>
-
-<rule> <!-- Conventional name of a mouse button -->
-<match>
-<gi>MOUSEBUTTON
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Error message and its subparts, along with explanatory text, in a
- MsgEntry -->
-<match>
-<gi>MSG
-</rule>
-
-<rule> <!-- Audience to which a Msg is relevant -->
-<match>
-<gi>MSGAUD
-</rule>
-
-<rule> <!-- Wrapper for an entry in a MsgSet -->
-<match>
-<gi>MSGENTRY
-</rule>
-
-<rule> <!-- Explanatory material relating to a Msg -->
-<match>
-<gi>MSGEXPLAN
-</rule>
-
-<rule> <!-- Information about the Msg that contains it -->
-<match>
-<gi>MSGINFO
-</rule>
-
-<rule> <!-- Level of importance or severity of a Msg -->
-<match>
-<gi>MSGLEVEL
-</rule>
-
-<rule> <!-- Main error message of a Msg -->
-<match>
-<gi>MSGMAIN
-</rule>
-
-<rule> <!-- Origin of a Msg -->
-<match>
-<gi>MSGORIG
-</rule>
-
-<rule> <!-- Subpart of a Msg containing a message that is related to the main
- message -->
-<match>
-<gi>MSGREL
-</rule>
-
-<rule> <!-- List of error messages produced by a system, with various
- additional information -->
-<match>
-<gi>MSGSET
-</rule>
-
-<rule> <!-- Optional subpart of a Msg, which might contain messages that
- appear in various contexts -->
-<match>
-<gi>MSGSUB
-</rule>
-
-<rule> <!-- Contents of the parts of Msg -->
-<match>
-<gi>MSGTEXT
-</rule>
-
-<rule> <!-- Message to the user, set off from the text -->
-<match>
-<gi>NOTE
-<action>
-<do>&r.admon;
-</rule>
-
-<rule> <!-- Link that addresses its target by use of an entity -->
-<match>
-<gi>OLINK
-</rule>
-
-<rule> <!-- Option for a computer program command -->
-<match>
-<gi>OPTION
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Optional information contained in a Synopsis -->
-<match>
-<gi>OPTIONAL
-<action>
-<start>[</start>
-<end>]</end>
-</rule>
-
-<rule> <!-- List in which each entry is marked with a sequentially
- incremented label -->
-<match>
-<gi>ORDEREDLIST
-<action>
-<start>${_action &r.blkps;t}
-&lt;OL>^</start>
-<end>^&lt;/OL>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Division of an organization -->
-<match>
-<gi>ORGDIV
-</rule>
-
-<rule> <!-- Name of an organization other than a corporation -->
-<match>
-<gi>ORGNAME
-</rule>
-
-<rule> <!-- Uncategorized information in Address -->
-<match>
-<gi>OTHERADDR
-</rule>
-
-<rule> <!-- Person or entity to be credited, other than an Author or Editor -->
-<match>
-<gi>OTHERCREDIT
-</rule>
-
-<rule> <!-- Name component that is not a Firstname, Surname, or Lineage -->
-<match>
-<gi>OTHERNAME
-</rule>
-
-<rule> <!-- Numbers of the pages contained in a Book, for use in its
- BookBiblio -->
-<match>
-<gi>PAGENUMS
-</rule>
-
-<rule> <!-- Paragraph -->
-<match>
-<gi>PARA
-<context>LISTITEM|VARLISTENTRY|STEP|GLOSSDEF
-<action>
-<start>^&lt;P></start>
-<end>&lt;/P></end>
-</rule>
-
-<rule> <!-- Paragraph -->
-<match>
-<gi>PARA
-<action>
-<start>^&lt;P></start>
-<end>&lt;/P></end>
-</rule>
-
-<rule> <!-- Data type information and the name of the Parameter this
- information applies to -->
-<match>
-<gi>PARAMDEF
-</rule>
-
-<rule> <!-- Part of an instruction to a computer -->
-<match>
-<gi>PARAMETER
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Section of a Book containing book components -->
-<match>
-<gi>PART
-<action>
-<start>^&lt;!-- Start PART ${partnum} (${ID}):
-${_followrel child TITLE &r.pass;} -->^</start>
-<end>^&lt;!-- End PART -->^</end>
-<incr>partnum
-</rule>
-
-<rule> <!-- Introduction to the contents of a Part -->
-<match>
-<gi>PARTINTRO
-</rule>
-
-<rule> <!-- Telephone number in an Address -->
-<match>
-<gi>PHONE
-</rule>
-
-<rule> <!-- Post office box number in an Address -->
-<match>
-<gi>POB
-</rule>
-
-<rule> <!-- Postal code in an Address -->
-<match>
-<gi>POSTCODE
-</rule>
-
-<rule> <!-- Introductory textual matter in a Book -->
-<match>
-<gi>PREFACE
-<action>
-<start>^&lt;!-- Start PREFACE (${ID}): ${_followrel child TITLE &r.pass;} -->^</start>
-<end>^&lt;!-- End PREFACE -->^</end>
-<incr>pfnum
-<set>sect1num 1
-</rule>
-
-<rule> <!-- Word or phrase occurring in the text that is to appear in the index
- under as a primary entry -->
-<match>
-<gi>PRIMARY
-</rule>
-
-<rule> <!-- Primary entry in an Index, not in the text -->
-<match>
-<gi>PRIMARYIE
-</rule>
-
-<rule> <!-- Printing history of a Book -->
-<match>
-<gi>PRINTHISTORY
-</rule>
-
-<rule> <!-- List of operations to be performed -->
-<match>
-<gi>PROCEDURE
-<action>
-<start>${_action &r.blkps;t}
-&lt;OL>^</start>
-<end>^&lt;/OL>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Formal name for a product -->
-<match>
-<gi>PRODUCTNAME
-</rule>
-
-<rule> <!-- Number assigned to a product -->
-<match>
-<gi>PRODUCTNUMBER
-</rule>
-
-<rule> <!-- Listing of all or part of a program -->
-<match>
-<gi>PROGRAMLISTING
-<relation>parent EXAMPLE
-<action>
-<start>^&lt;PRE></start>
-<end>&lt;/PRE>^</end>
-</rule>
-
-<rule> <!-- Listing of all or part of a program -->
-<match>
-<gi>PROGRAMLISTING
-<action>
-&m.preblk;
-</rule>
-
-<rule> <!-- Listing of a program or related information containing
- areas with associated callouts -->
-<match>
-<gi>PROGRAMLISTINGCO
-</rule>
-
-<rule> <!-- Character indicating the start of an input field in a
- computer display -->
-<match>
-<gi>PROMPT
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Defined set of data associated with a window -->
-<match>
-<gi>PROPERTY
-</rule>
-
-<rule> <!-- Date of publication of a document -->
-<match>
-<gi>PUBDATE
-<action>
-<start>&lt;P></start>
-<end>&lt;/P></end>
-</rule>
-
-<rule> <!-- Publisher of a document -->
-<match>
-<gi>PUBLISHER
-</rule>
-
-<rule> <!-- Name of a publisher of a document in Publisher -->
-<match>
-<gi>PUBLISHERNAME
-</rule>
-
-<rule> <!-- Number assigned to a publication, other than an ISBN or
- ISSN or InvPartNumber -->
-<match>
-<gi>PUBSNUMBER
-</rule>
-
-<rule> <!-- In-line quotation -->
-<match>
-<gi>QUOTE
-<relation>parent QUOTE
-<action>
-<start>`</start>
-<end>'</end>
-</rule>
-
-<rule> <!-- In-line quotation -->
-<match>
-<gi>QUOTE
-<action>
-<start>``</start>
-<end>''</end>
-</rule>
-
-<rule> <!-- Applicability or scope of the topic of a RefEntry -->
-<match>
-<gi>REFCLASS
-</rule>
-
-<rule> <!-- Substitute for RefName to be used when a RefEntry covers
- more than one topic and none of the topic names is to be
- used as the sort name -->
-<match>
-<gi>REFDESCRIPTOR
-</rule>
-
-<rule> <!-- A reference page -->
-<match>
-<gi>REFENTRY
-<action>
-<start>^&lt;!-- Reference Entry --></start>
-</rule>
-
-<rule> <!-- Primary name given to a reference page for sorting and
- indexing -->
-<match>
-<gi>REFENTRYTITLE
-<context>CITEREFENTRY
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Primary name given to a reference page for sorting and
- indexing -->
-<match>
-<gi>REFENTRYTITLE
-<action>
-<start>&lt;HR NOSHADE>&lt;H2>${_followrel ancestor REFENTRY &r.anchor;}</start>
-<end>&lt;/H2></end>
-</rule>
-
-<rule> <!-- Collection of RefEntries, forming a book component -->
-<match>
-<gi>REFERENCE
-</rule>
-
-<rule> <!-- First major division of a reference page, in which metainformation
- about the reference page is supplied -->
-<match>
-<gi>REFMETA
-</rule>
-
-<rule> <!-- Information in RefMeta that may be supplied by vendors, or a
- descriptive phrase for use in a print header -->
-<match>
-<gi>REFMISCINFO
-<action>
-<ignore>all
-</rule>
-
-<rule> <!-- Subject or subjects of a reference page -->
-<match>
-<gi>REFNAME
-<action>
-<start>^&lt;STRONG></start>
-<end>^&lt;/STRONG> -^</end>
-</rule>
-
-<rule> <!-- Major division of a reference page containing naming,
- purpose, and classification information -->
-<match>
-<gi>REFNAMEDIV
-<action>
-<start> ^&lt;H3>Name&lt;/H3>
-&lt;P></start>
-<end>^&lt;/P>^</end>
-</rule>
-
-<rule> <!-- Subject of a reference page -->
-<match>
-<gi>REFPURPOSE
-</rule>
-
-<rule> <!-- Major subsection of a RefEntry -->
-<match>
-<gi>REFSECT1
-</rule>
-
-<rule> <!-- Subsection of a RefSect1 -->
-<match>
-<gi>REFSECT2
-</rule>
-
-<rule> <!-- Subsection of a Refsect2 -->
-<match>
-<gi>REFSECT3
-</rule>
-
-<rule> <!-- Major division of a reference page, in which the syntax of
- the subject of the reference page is indicated -->
-<match>
-<gi>REFSYNOPSISDIV
-</rule>
-
-<rule> <!-- Information about a particular version of a document -->
-<match>
-<gi>RELEASEINFO
-</rule>
-
-<rule> <!-- Content that may be replaced in a synopsis or command line -->
-<match>
-<gi>REPLACEABLE
-<action>
-&m.i;
-</rule>
-
-<rule> <!-- Value returned by a function -->
-<match>
-<gi>RETURNVALUE
-</rule>
-
-<rule> <!-- Revisions to a document -->
-<match>
-<gi>REVHISTORY
-</rule>
-
-<rule> <!-- Entry in RevHistory, describing some revision made to the text -->
-<match>
-<gi>REVISION
-</rule>
-
-<rule> <!-- Number of a Revision -->
-<match>
-<gi>REVNUMBER
-</rule>
-
-<rule> <!-- Description of a Revision -->
-<match>
-<gi>REVREMARK
-</rule>
-
-<rule> <!-- Row in a TBody, THead, or TFoot -->
-<match>
-<gi>ROW
-<action>
-<start>^&lt;TR valign="top">^</start>
-<end>^&lt;/TR>^</end>
-</rule>
-
-<rule> <!-- Line break in a command synopsis -->
-<match>
-<gi>SBR
-<action>
-<start>&lt;BR></start>
-</rule>
-
-<rule> <!-- Text that a user sees or might see on a computer screen -->
-<match>
-<gi>SCREEN
-<relation>parent EXAMPLE
-<action>
-<start>^&lt;PRE></start>
-<end>&lt;/PRE>^</end>
-</rule>
-
-<rule> <!-- Text that a user sees or might see on a computer screen -->
-<match>
-<gi>SCREEN
-<action>
-&m.preblk;
-</rule>
-
-<rule> <!-- Screen containing areas with associated callouts -->
-<match>
-<gi>SCREENCO
-</rule>
-
-<rule> <!-- Information about how a ScreenShot was produced -->
-<match>
-<gi>SCREENINFO
-</rule>
-
-<rule> <!-- Representation of what the user sees or might see on a
- computer screen -->
-<match>
-<gi>SCREENSHOT
-<relation>parent EXAMPLE
-</rule>
-
-<rule> <!-- Representation of what the user sees or might see on a
- computer screen -->
-<match>
-<gi>SCREENSHOT
-<action>
-<start>${_action &r.blkps;t}</start>
-<end>${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Word or phrase in the text that is to appear in the index beneath
- a Primary entry -->
-<match>
-<gi>SECONDARY
-</rule>
-
-<rule> <!-- Part of IndexEntry, like PrimaryIE -->
-<match>
-<gi>SECONDARYIE
-</rule>
-
-<rule> <!-- Top-level section of a book component, including the Title of that
- section -->
-<match>
-<gi>SECT1
-<action>
-<incr>sect1num
-<set>sect2num 1
-</rule>
-
-<rule> <!-- Section beginning with a second-level heading -->
-<match>
-<gi>SECT2
-<action>
-<incr>sect2num
-<set>sect3num 1
-</rule>
-
-<rule> <!-- Section beginning with a third-level heading -->
-<match>
-<gi>SECT3
-<action>
-<incr>sect3num
-<set>sect4num 1
-</rule>
-
-<rule> <!-- Section beginning with a fourth-level heading -->
-<match>
-<gi>SECT4
-<action>
-<incr>sect4num
-<set>sect5num 1
-</rule>
-
-<rule> <!-- Section beginning with a fifth-level heading -->
-<match>
-<gi>SECT5
-<action>
-<incr>sect5num
-</rule>
-
-<rule> <!-- Part of IndexTerm, indicating, for a word or phrase in the text,
- the index entry to which the reader is to be directed when he
- consults the stub index entry for another element within the
- IndexTerm -->
-<match>
-<gi>SEE
-</rule>
-
-<rule> <!-- Like See, but indicates the index entries to which the reader
- is also to be directed when he consults a full index entry -->
-<match>
-<gi>SEEALSO
-</rule>
-
-<rule> <!-- "See also" entry in an Index -->
-<match>
-<gi>SEEALSOIE
-</rule>
-
-<rule> <!-- "See" entry in an Index -->
-<match>
-<gi>SEEIE
-</rule>
-
-<rule> <!-- Component of a SegmentedList -->
-<match>
-<gi>SEG
-</rule>
-
-<rule> <!-- List item in a SegmentedList -->
-<match>
-<gi>SEGLISTITEM
-</rule>
-
-<rule> <!-- List of sets of information -->
-<match>
-<gi>SEGMENTEDLIST
-</rule>
-
-<rule> <!-- Title that pertains to one Seg in each SegListItem -->
-<match>
-<gi>SEGTITLE
-</rule>
-
-<rule> <!-- Information about the publication series of which the containing
- Book is a part -->
-<match>
-<gi>SERIESINFO
-</rule>
-
-<rule> <!-- Numbers of all the volumes in a Series, for use in SeriesInfo -->
-<match>
-<gi>SERIESVOLNUMS
-</rule>
-
-<rule> <!-- Two or more Books -->
-<match>
-<gi>SET
-</rule>
-
-<rule> <!-- Index to a Set -->
-<match>
-<gi>SETINDEX
-</rule>
-
-<rule> <!-- Metainformation for a Set, in which it may appear -->
-<match>
-<gi>SETINFO
-</rule>
-
-<!-- SGMLTag in its variations -->
-
-<rule> <!-- Component of SGML markup -->
-<match>
-<gi>SGMLTAG
-<attval>CLASS PARAMENTITY
-<action>
-<start>&lt;CODE>%</start>
-<end>&lt;/CODE></end>
-</rule>
-
-<rule> <!-- Component of SGML markup -->
-<match>
-<gi>SGMLTAG
-<attval>CLASS GENENTITY
-<action>
-<start>&lt;CODE>&amp;amp;</start>
-<end>;&lt;/CODE></end>
-</rule>
-
-<rule> <!-- Component of SGML markup -->
-<match>
-<gi>SGMLTAG
-<attval>CLASS STARTTAG
-<action>
-<start>&lt;CODE>&amp;lt;</start>
-<end>>&lt;/CODE></end>
-</rule>
-
-<rule> <!-- Component of SGML markup -->
-<match>
-<gi>SGMLTAG
-<attval>CLASS ENDTAG
-<action>
-<start>&lt;CODE>&amp;lt;/</start>
-<end>>&lt;/CODE></end>
-</rule>
-
-<rule> <!-- Component of SGML markup -->
-<match>
-<gi>SGMLTAG
-<attval>CLASS PI
-<action>
-<start>&lt;CODE>&amp;lt;?</start>
-<end>>&lt;/CODE></end>
-</rule>
-
-<rule> <!-- Component of SGML markup -->
-<match>
-<gi>SGMLTAG
-<attval>CLASS SGMLCOMMENT
-<action>
-<start>&lt;CODE>&amp;lt;--</start>
-<end>--&amp;lt;/CODE></end>
-</rule>
-
-<!-- catchall for remaining types of tags -->
-<rule> <!-- Component of SGML markup -->
-<match>
-<gi>SGMLTAG
-<action>
-<start>&lt;CODE></start>
-<end>&lt;/CODE></end>
-</rule>
-
-<rule> <!-- Brief version of of Affiliation, in which it may appear -->
-<match>
-<gi>SHORTAFFIL
-</rule>
-
-<rule> <!-- Segment of a book component that is isolated from the narrative
- flow of the main text, typically boxed and floating -->
-<match>
-<gi>SIDEBAR
-<action>
-<do>&r.admon;
-</rule>
-
-<rule> <!-- Paragraph that is only a text block, without included
- block-oriented elements -->
-<match>
-<gi>SIMPARA
-</rule>
-
-<rule> <!-- List of single words or short phrases -->
-<match>
-<gi>SIMPLELIST
-</rule>
-
-<rule> <!-- Section with no subdivisions -->
-<match>
-<gi>SIMPLESECT
-</rule>
-
-<rule> <!-- Formatting information for a spanned column in a TGroup -->
-<match>
-<gi>SPANSPEC
-</rule>
-
-<rule> <!-- State in an Address -->
-<match>
-<gi>STATE
-</rule>
-
-<rule> <!-- Part of a Procedure -->
-<match>
-<gi>STEP
-<action>
-<start>^&lt;LI></start>
-<end>&lt;/LI>^</end>
-</rule>
-
-<rule> <!-- Street in an Address -->
-<match>
-<gi>STREET
-</rule>
-
-<rule> <!-- Field in a Structure -->
-<match>
-<gi>STRUCTFIELD
-</rule>
-
-<rule> <!-- Name of a Structure -->
-<match>
-<gi>STRUCTNAME
-</rule>
-
-<rule> <!-- Subscript -->
-<match>
-<gi>SUBSCRIPT
-<action>
-<start>&lt;SUB></start>
-<end>&lt;/SUB></end>
-</rule>
-
-<rule> <!-- Wrapper for Steps within Steps -->
-<match>
-<gi>SUBSTEPS
-<action>
-<start>^&lt;OL>^</start>
-<end>^&lt;/OL>^</end>
-</rule>
-
-<rule> <!-- Subtitle of a document -->
-<match>
-<gi>SUBTITLE
-<action>
-<start>^&lt;P>&lt;EM></start>
-<end>&lt;/EM>&lt;/P>^</end>
-</rule>
-
-<rule> <!-- Superscript -->
-<match>
-<gi>SUPERSCRIPT
-<action>
-<start>&lt;SUP></start>
-<end>&lt;/SUP></end>
-</rule>
-
-<rule> <!-- Family name -->
-<match>
-<gi>SURNAME
-<action>
-<start>^</start>
-<end>^</end>
-</rule>
-
-<rule> <!-- Name that is replaced by a value before processing -->
-<match>
-<gi>SYMBOL
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Part of CmdSynopsis -->
-<match>
-<gi>SYNOPFRAGMENT
-</rule>
-
-<rule> <!-- Part of a CmdSynopsis -->
-<match>
-<gi>SYNOPFRAGMENTREF
-</rule>
-
-<rule> <!-- Syntax of a command or function -->
-<match>
-<gi>SYNOPSIS
-<action>
-&m.blk;
-</rule>
-
-<rule> <!-- System-related term or item -->
-<match>
-<gi>SYSTEMITEM
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Table in a document -->
-<match>
-<gi>TABLE
-<attval>FRAME none
-<action>
-<start>${_action &r.blkps;t}&lt;P>${_action &r.anchor;t}&lt;STRONG>${_gi M} ${tabnum}:&lt;/STRONG>
-${_followrel child TITLE &r.pass;}&lt;/P>&lt;TABLE>^</start>
-<end>^&lt;/TABLE>
-${_action &r.blkpe;t}</end>
-<incr>tabnum
-</rule>
-
-<rule> <!-- Table in a document -->
-<match>
-<gi>TABLE
-<action>
-<start>${_action &r.blkps;t}&lt;P>${_action &r.anchor;t}&lt;STRONG>${_gi M} ${tabnum}:&lt;/STRONG>
-${_followrel child TITLE &r.pass;}&lt;/P>&lt;TABLE border="1">^</start>
-<end>^&lt;/TABLE>
-${_action &r.blkpe;t}</end>
-<incr>tabnum
-</rule>
-
-<rule> <!-- Wrapper for the Rows of a Table or InformalTable -->
-<match>
-<gi>TBODY
-</rule>
-
-<rule> <!-- Hanging term attached to a ListItem within a VarListEntry in a
- VariableList -->
-<match>
-<gi>TERM
-<action>
-<start>^&lt;DT></start>
-<end>&lt;/DT>^</end>
-</rule>
-
-<rule> <!-- Word or phrase that is to appear in the index under a Secondary
- entry -->
-<match>
-<gi>TERTIARY
-</rule>
-
-<rule> <!-- Third-level entry in an Index, not in the text -->
-<match>
-<gi>TERTIARYIE
-</rule>
-
-<rule> <!-- Footer row of a table -->
-<match>
-<gi>TFOOT
-</rule>
-
-<rule> <!-- Wrapper for part of a Table that contains an array along
-with its
- formatting information -->
-<match>
-<gi>TGROUP
-<relation>parent INFORMALTABLE
-<action>
-<start>^&lt;TABLE>^</start>
-<end>^&lt;/TABLE>^</end>
-</rule>
-
-<rule> <!-- Wrapper for part of a Table that contains an array along with its
- formatting information -->
-<match>
-<gi>TGROUP
-</rule>
-
-<rule> <!-- Heading row of a table -->
-<match>
-<gi>THEAD
-</rule>
-
-<rule> <!-- Suggestion to the user, set off from the text -->
-<match>
-<gi>TIP
-<action>
-<do>&r.admon;
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<relation>parent BLOCKQUOTE
-<action>
-<start>^&lt;H4>&hlofont;</start>
-<end>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<!-- Titles in the preface -->
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>PREFACE
-<action>
-<start>^&lt;H1>&lt;A NAME="pf-${pfnum}">&lt;/A>&hlofont;</start>
-<end>&hlcfont;&lt;/H1>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT1
-<relation>ancestor PREFACE
-<action>
-<start>^&lt;H2>&hlofont;</start>
-<end>&hlcfont;&lt;/H2>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT2
-<relation>ancestor PREFACE
-<action>
-<start>^&lt;H3>&hlofont;</start>
-<end>&hlcfont;&lt;/H3>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT3
-<relation>ancestor PREFACE
-<action>
-<start>^&lt;H4>&hlofont;</start>
-<end>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT4
-<relation>ancestor PREFACE
-<action>
-<start>^&lt;H4>&hlofont;</start>
-<end>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT5
-<relation>ancestor PREFACE
-<action>
-<start>^&lt;H4>&hlofont;</start>
-<end>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<!-- Title in bookbiblio -->
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>BOOKBIBLIO
-<action>
-<ignore>all
-</rule>
-
-<!-- Titles in other sections -->
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>^REF.*
-<action>
-<start>^&lt;H3></start>
-<end>^&lt;/H3></end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>PART
-<action>
-<start>^&lt;H1>&lt;A NAME="pt-${partnum}">&lt;/A>${_followrel parent PART &r.anchor;t}&hlofont;Part ${partnum}:&lt;BR>^</start>
-<end>&hlcfont;&lt;/H1>
-${_followrel parent PART &r.chtoc;t}^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>CHAPTER
-<action>
-<start>^&lt;H1>&lt;A NAME="ch-${chapnum}">&lt;/A>${_followrel parent CHAPTER &r.anchor;t}&hlofont;${chapnum}.&wspace;^</start>
-<end>&hlcfont;&lt;/H1>
-${_followrel parent CHAPTER &r.s1toc;t}^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>APPENDIX
-<action>
-<start>^&lt;H1>&lt;A NAME="ch-${chapnum}">&lt;/A>${_followrel parent APPENDIX &r.anchor;t}&hlofont;${chapnum}.&wspace;^</start>
-<end>&hlcfont;&lt;/H1>
-${_followrel parent APPENDIX &r.s1toc;t}^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT1
-<action>
-<start>^&lt;H2>&lt;A NAME="s1-${chapnum}-${sect1num}">&lt;/A>${_followrel parent SECT1 &r.anchor;t}&hlofont;${chapnum}.${sect1num}.&wspace;^</start>
-<end>&hlcfont;&lt;/H2>
-${_followrel parent SECT1 &r.s2toc;t}^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT2
-<action>
-<start>^&lt;H3>&lt;A NAME="s2-${chapnum}-${sect1num}-${sect2num}">&lt;/A>${_followrel parent SECT2 &r.anchor;t}&hlofont;${chapnum}.${sect1num}.${sect2num}.&wspace^</start>
-<end>&hlcfont;&lt;/H3>
-${_followrel parent SECT2 &r.s3toc;t}^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT3
-<action>
-<start>^&lt;H4>&lt;A NAME="s3-${chapnum}-${sect1num}-${sect2num}-${sect3num}">&lt;/A>${_followrel parent SECT3 &r.anchor;t}&hlofont;${chapnum}.${sect1num}.${sect2num}.${sect3num}.&wspace;^</start>
-<end>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT4
-<action>
-<start>^&lt;H4>${_followrel parent SECT4 &r.anchor;t}&hlofont;</start>
-<end>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>SECT5
-<action>
-<start>^&lt;H4>${_followrel parent SECT5 &r.anchor;t}&hlofont;</start>
-<end>&hlcfont;&lt;/H4>^</end>
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>FIGURE|EXAMPLE|TABLE|CAUTION|IMPORTANT|NOTE|TIP|WARNING
-<action>
-<ignore>all
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-<context>GLOSSARY
-<action>
-<ignore>all
-</rule>
-
-<rule> <!-- Text of a heading or the title of a block-oriented element -->
-<match>
-<gi>TITLE
-</rule>
-
-<rule> <!-- Abbreviated title -->
-<match>
-<gi>TITLEABBREV
-<action>
-<ignore>all
-</rule>
-
-<rule> <!-- Table of contents -->
-<match>
-<gi>TOC
-</rule>
-
-<rule> <!-- Entry for back matter in a ToC -->
-<match>
-<gi>TOCBACK
-</rule>
-
-<rule> <!-- Entry in a ToC for a part of the body of a Book -->
-<match>
-<gi>TOCCHAP
-</rule>
-
-<rule> <!-- Entry in a ToC or its subelements -->
-<match>
-<gi>TOCENTRY
-</rule>
-
-<rule> <!-- Entry for introductory matter in a ToC -->
-<match>
-<gi>TOCFRONT
-</rule>
-
-<rule> <!-- Top-level entry within a ToCchap -->
-<match>
-<gi>TOCLEVEL1
-</rule>
-
-<rule> <!-- Second-level entry within a ToCchap -->
-<match>
-<gi>TOCLEVEL2
-</rule>
-
-<rule> <!-- Third-level entry within a ToCchap -->
-<match>
-<gi>TOCLEVEL3
-</rule>
-
-<rule> <!-- Fourth-level entry within a ToCchap -->
-<match>
-<gi>TOCLEVEL4
-</rule>
-
-<rule> <!-- Fifth-level entry within a ToCchap -->
-<match>
-<gi>TOCLEVEL5
-</rule>
-
-<rule> <!-- Entry in a ToC for a Part of a Book -->
-<match>
-<gi>TOCPART
-</rule>
-
-<rule> <!-- Unit of information in the context of lexical analysis -->
-<match>
-<gi>TOKEN
-</rule>
-
-<rule> <!-- Trademark -->
-<match>
-<gi>TRADEMARK
-<action>
-<end>&lt;SMALL>&lt;SUP>(TM)&lt;/SUP>&lt;/SMALL></end>
-</rule>
-
-<rule> <!-- Classification of a value -->
-<match>
-<gi>TYPE
-<action>
-&m.tt;
-</rule>
-
-<rule> <!-- Link that addresses its target by means of a Uniform Resource
- Locator -->
-<match>
-<gi>ULINK
-<action>
-<start>&lt;A HREF="${URL}"></start>
-<end>&lt;/A></end>
-</rule>
-
-<rule> <!-- Data entered by the user -->
-<match>
-<gi>USERINPUT
-<action>
-<start>&lt;B>&lt;CODE></start>
-<end>&lt;/CODE>&lt;/B></end>
-</rule>
-
-<rule> <!-- Empty element, part of FuncSynopsis, indicating that the Function in
- question has a variable number of arguments -->
-<match>
-<gi>VARARGS
-</rule>
-
-<rule> <!-- List in which each entry is composed of sets of one or more
- Terms with associated ListItems -->
-<match>
-<gi>VARIABLELIST
-<action>
-<start>${_action &r.blkps;t}
-&lt;DL>^</start>
-<end>^&lt;/DL>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule> <!-- Wrapper for Term and its associated ListItem in a
- VariableList -->
-<match>
-<gi>VARLISTENTRY
-</rule>
-
-<rule> <!-- Empty element, part of FuncSynopsis, that indicates that the Function in
- question takes no arguments -->
-<match>
-<gi>VOID
-</rule>
-
-<rule> <!-- Number of a Book in relation to Set, or of a journal, when Book
- is used to represent a journal by containing Articles -->
-<match>
-<gi>VOLUMENUM
-</rule>
-
-<rule> <!-- Admonition set off from the text -->
-<match>
-<gi>WARNING
-<action>
-<do>&r.admon;
-</rule>
-
-<rule> <!-- Word -->
-<match>
-<gi>WORDASWORD
-<action>
-<start>``</start>
-<end>''</end>
-</rule>
-
-<rule> <!-- Cross reference link to another part of the document -->
-<match>
-<gi>XREF
-<attval>REMAP .
-<action>
-<replace>&lt;EM>&lt;A HREF="#${LINKEND}">${REMAP}&lt;/A>&lt;/EM></replace>
-</rule>
-
-<rule> <!-- Cross reference link to another part of the document -->
-<match>
-<gi>XREF
-<action>
-<replace>&lt;EM>&lt;A HREF="#${LINKEND}">${_chasetogi TITLE &r.pass}&lt;/A>&lt;/EM></replace>
-</rule>
-
-<rule> <!-- Year of publication of a document -->
-<match>
-<gi>YEAR
-<action>
-<start>^</start>
-<end>^</end>
-</rule>
-
-<rule> <!-- Absorb anything that mannages to get this
- far without a match so it does not accidentally
- match the rules below which are meant to be
- explicitly invoked from other rules. -->
-<match>
-<gi>*
-</rule>
-
-<!-- Just pass the content and child elements through. -->
-<rule id="&r.pass;">
-<match>
-<gi>_pass-text
-</rule>
-
-<!-- Output an HTML anchor if the ID is set. -->
-<rule id="&r.anchor;">
-<match>
-<attval>ID .
-<action>
-<replace>&lt;A NAME="${ID id}">&lt;/A></replace>
-</rule>
-
-<rule id="&r.ignore;">
-<match>
-<gi>_no_pass_text
-<action>
-<ignore>all
-</rule>
-
-<rule id="&r.admon;">
-<match>
-<gi>_admonition
-<action>
-<start>${_action &r.blkps;t}
-&lt;CENTER>${_action &r.anchor;t}&lt;TABLE align="center" border="1" cellpadding="5" width="90%">
-&lt;TR>
-&lt;TD&c.admon;>&lt;P>&lt;STRONG>${_followrel child TITLE &r.pass; &r.prgi;}:&lt;/STRONG>&lt;/P></start>
-<end>^&lt;/TD>&lt;/TR>&lt;/TABLE>&lt;/CENTER>
-${_action &r.blkpe;t}</end>
-</rule>
-
-<rule id="&r.prgi;">
-<match>
-<gi>_prgi
-<action>
-<replace>${_gi M}</replace>
-</rule>
-
-<!-- Generate tables of contents. Each r.??toc scans the subtree for
- sectional elements of the specified level, generating a list of links. -->
-
-<rule id="&r.pttoc;">
-<match>
-<relation>descendant PART
-<action>
-<replace>^&lt;DL>${_set anchorinhibit 1}
-${_find gi PART &r.pttoci;}
-${_set anchorinhibit 0}&lt;/DL>${_set partnum 1}^</replace>
-</rule>
-
-<rule id="&r.pttoci;">
-<match>
-<gi>_pttoc
-<action>
-<replace>&lt;DD>Part ${partnum}.&wspace;&lt;EM>&lt;A HREF="#pt-${partnum}">${_followrel descendant TITLE &r.pass;}&lt;/A>&lt;/EM>&lt;/DD>^</replace>
-<incr>partnum
-</rule>
-
-<rule id="&r.chtoc;">
-<match>
-<relation>descendant CHAPTER
-<action>
-<replace>^&lt;DL>${_set anchorinhibit 1}
-${_set tmpchapnum ${pfpnum}}${_find gi PREFACE &r.pftoci;}${_set pfnum ${tmpchapnum}}
-${_set tmpchapnum ${chapnum}}${_find gi CHAPTER &r.chtoci;}${_set chapnum ${appnum}}${_find gi APPENDIX &r.chtoci;}
-${_set anchorinhibit 0}&lt;/DL>^</replace>
-<set>chapnum ${tmpchapnum}
-</rule>
-
-<rule id="&r.chtoci;">
-<match>
-<gi>_chtoc
-<action>
-<replace>&lt;DD>${chapnum}.&wspace;&lt;EM>&lt;A HREF="#ch-${chapnum}">${_followrel descendant TITLE &r.pass;}&lt;/A>&lt;/EM>&lt;/DD>^</replace>
-<incr>chapnum
-</rule>
-
-<rule id="&r.pftoci;">
-<match>
-<gi>_aptoc
-<action>
-<replace>&lt;DD>&lt;EM>&lt;A HREF="#pf-${pfnum}">${_followrel descendant TITLE &r.pass;}&lt;/A>&lt;/EM>&lt;/DD>^</replace>
-<incr>pfnum
-</rule>
-
-<rule id="&r.s1toc;">
-<match>
-<relation>descendant SECT1
-<action>
-<replace>^${_set anchorinhibit 1}&lt;DL>
-${_find gi SECT1 &r.s1toci;}
-${_set anchorinhibit 0}&lt;/DL>${_set sect1num 1}^</replace>
-</rule>
-
-<rule id="&r.s1toci;">
-<match>
-<gi>_s1toc
-<action>
-<replace>&lt;DD>${chapnum}.${sect1num}.&wspace;&lt;EM>&lt;A HREF="#s1-${chapnum}-${sect1num}">${_followrel descendant TITLE &r.pass;}&lt;/A>&lt;/EM>&lt;/DD>^</replace>
-<incr>sect1num
-</rule>
-
-<rule id="&r.s2toc;">
-<match>
-<relation>descendant SECT2
-<action>
-<replace>^${_set anchorinhibit 1}&lt;DL>
-${_find gi SECT2 &r.s2toci;}
-${_set anchorinhibit 0}&lt;/DL>${_set sect2num 1}^</replace>
-</rule>
-
-<rule id="&r.s2toci;">
-<match>
-<gi>_s2toc
-<action>
-<replace>&lt;DD>${chapnum}.${sect1num}.${sect2num}.&wspace;&lt;EM>&lt;A HREF="#s2-${chapnum}-${sect1num}-${sect2num}">${_followrel descendant TITLE &r.pass;}&lt;/A>&lt;/EM>&lt;/DD>^</replace>
-<incr>sect2num
-</rule>
-
-<rule id="&r.s3toc;">
-<match>
-<relation>descendant SECT3
-<action>
-<replace>^${_set anchorinhibit 1}&lt;DL>
-${_find gi SECT3 &r.s3toci;}
-${_set anchorinhibit 0}&lt;/DL>${_set sect3num 1}^</replace>
-</rule>
-
-<rule id="&r.s3toci;">
-<match>
-<gi>_s3toc
-<action>
-<replace>&lt;DD>${chapnum}.${sect1num}.${sect2num}.${sect3num}.&wspace;&lt;EM>&lt;A HREF="#s3-${chapnum}-${sect1num}-${sect2num}-${sect3num}">${_followrel descendant TITLE &r.pass;}&lt;/A>&lt;/EM>&lt;/DD>^</replace>
-<incr>sect3num
-</rule>
-
-<rule id="&r.fnote;">
-<match>
-<relation>descendant FOOTNOTE
-<action>
-<replace>&lt;H1>&hlofont;Notes&hlcfont;&lt;/H1>
-&lt;TABLE width="100%">
-${_find top gi FOOTNOTE &r.fnotei;}
-&lt;/TABLE></replace>
-</rule>
-
-<rule id="&r.fnotei;">
-<match>
-<gi>_fnote
-<action>
-<start>^&lt;TR>&lt;TD VALIGN="TOP">&lt;B>&lt;A NAME="fn-${fnotenum}">&lt/A>&lt;A HREF="#rfn-${fnotenum}">${fnotenum}.&lt/A>&lt;/B>&lt;/TD>
-&lt;TD VALIGN="TOP"></start>
-<end>&lt;/TD>&lt;TR></end>
-<incr>fnotenum
-</rule>
-
-<!-- These two are for handling the case of a block element that
- can occur in a docbook <para>, but not in an html <p>. Call
- the first in the <start> of such an element, and the second
- in the <end> which will close and re-open the html <p>. -->
-
-<rule id="&r.blkps;">
-<match>
-<relation>parent PARA
-<action>
-<replace>&lt;/P>^</replace>
-</rule>
-
-<rule id="&r.blkpe;">
-<match>
-<relation>parent PARA
-<action>
-<replace>^&lt;P></replace>
-</rule>
-
-<!-- Simply output a hyphen -->
-<rule id="&r.hyphen;">
-<match>
-<gi>_hyphen
-<action>
-<replace>-</replace>
-</rule>
-
-<!-- Force a linebreak -->
-<rule id="&r.nl;">
-<match>
-<gi>_hyphen
-<action>
-<replace>^</replace>
-</rule>
-
-<!-- Insert a header file -->
-<rule id="&r.inchdr;">
-<match>
-<varval>inchdr .
-<action>
-<replace>${_include ${inchdr}}</replace>
-</rule>
-
-<!-- Insert a footer file -->
-<rule id="&r.incftr;">
-<match>
-<varval>incftr .
-<action>
-<replace>${_include ${incftr}}</replace>
-</rule>
-
-
-
-</transpec>
diff --git a/share/sgml/transpec/html.cmap b/share/sgml/transpec/html.cmap
deleted file mode 100644
index 79ed03f..0000000
--- a/share/sgml/transpec/html.cmap
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
-
- $Id$
-
- Copyright (C) 1996
- John R. Fieber. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY JOHN R. FIEBER AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL JOHN R. FIEBER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
--->
-
-<!-- Character mappings for HTML -->
-
-<map from="<" to="&#38;lt;">
-<map from=">" to="&#38;gt;">
-<map from="&" to="&#38;amp;">
diff --git a/share/sgml/transpec/html.sdata b/share/sgml/transpec/html.sdata
deleted file mode 100644
index 973e905..0000000
--- a/share/sgml/transpec/html.sdata
+++ /dev/null
@@ -1,566 +0,0 @@
-<!--
-
- $Id$
-
- Copyright (c) 1994
- Open Software Foundation, Inc.
-
- Permission is hereby granted to use, copy, modify and freely distribute
- the software in this file and its documentation for any purpose without
- fee, provided that the above copyright notice appears in all copies and
- that both the copyright notice and this permission notice appear in
- supporting documentation. Further, provided that the name of Open
- Software Foundation, Inc. ("OSF") not be used in advertising or
- publicity pertaining to distribution of the software without prior
- written permission from OSF. OSF makes no representations about the
- suitability of this software for any purpose. It is provided "as is"
- without express or implied warranty.
-
--->
-
-<!--
-
-SDATA entity mappings BACK to entity references.
-I think this is only usefule for creating a normalized instance."
-
-J.Bowe, 1993
-
-Enhancement by John R Fieber, 1996
-
--->
-
-<!-- Numeric and Special Graphic -->
-
-<map from="[half ]" to="&#38;half;">
-<map from="[frac12]" to="&#38;frac12;">
-<map from="[frac14]" to="&#38;frac14;">
-<map from="[frac34]" to="&#38;frac34;">
-<map from="[frac18]" to="&#38;frac18;">
-<map from="[frac38]" to="&#38;frac38;">
-<map from="[frac58]" to="&#38;frac58;">
-<map from="[frac78]" to="&#38;frac78;">
-<map from="[sup1 ]" to="&#38;sup1;">
-<map from="[sup2 ]" to="&#38;sup2;">
-<map from="[sup3 ]" to="&#38;sup3;">
-<map from="[plus ]" to="+">
-<map from="[plusmn]" to="&#38;plusmn;">
-<map from="[lt ]" to="&#38;lt;">
-<map from="[equals]" to="=">
-<map from="[gt ]" to="&#38;gt;">
-<map from="[divide]" to="/">
-<map from="[times ]" to="&#38;times;">
-<map from="[curren]" to="&#38;curren;">
-<map from="[pound ]" to="&#38;pound;">
-<map from="[dollar]" to="&#38;#36;">
-<map from="[cent ]" to="&#38;cent;">
-<map from="[yen ]" to="&#38;yen;">
-<map from="[num ]" to="#">
-<map from="[percnt]" to="%">
-<map from="[amp ]" to="&#38;amp;">
-<map from="[ast ]" to="*">
-<map from="[commat]" to="&#38;commat;">
-<map from="[lsqb ]" to="[">
-<map from="[bsol ]" to="\">
-<map from="[rsqb ]" to="]">
-<map from="[lcub ]" to="{">
-<map from="[horbar]" to="&#38;horbar;">
-<map from="[verbar]" to="|">
-<map from="[rcub ]" to="}">
-<map from="[micro ]" to="&#38;micro;">
-<map from="[ohm ]" to="&#38;ohm;">
-<map from="[deg ]" to="&#38;deg;">
-<map from="[ordm ]" to="&#38;ordm;">
-<map from="[ordf ]" to="&#38;ordf;">
-<map from="[sect ]" to="&#38;sect;">
-<map from="[para ]" to="&#38;para;">
-<map from="[middot]" to="&#38;middot;">
-<map from="[larr ]" to="&#38;larr;">
-<map from="[rarr ]" to="&#38;rarr;">
-<map from="[uarr ]" to="&#38;uarr;">
-<map from="[darr ]" to="&#38;darr;">
-<map from="[copy ]" to="&#38;copy;">
-<map from="[reg ]" to="&#38;reg;">
-<map from="[trade ]" to="&#38;trade;">
-<map from="[brvbar]" to="&#38;brvbar;">
-<map from="[not ]" to="&#38;not;">
-<map from="[sung ]" to="&#38;sung;">
-<map from="[excl ]" to="&#38;excl;">
-<map from="[iexcl ]" to="&#38;iexcl;">
-<map from="[quot ]" to="&#38;quot;">
-<map from="[apos ]" to="'">
-<map from="[lpar ]" to="(">
-<map from="[rpar ]" to=")">
-<map from="[comma ]" to=",">
-<map from="[lowbar]" to="_">
-<map from="[hyphen]" to="-">
-<map from="[period]" to=".">
-<map from="[sol ]" to="/">
-<map from="[colon ]" to=":">
-<map from="[semi ]" to=";">
-<map from="[quest ]" to="?">
-<map from="[iquest]" to="&#38;iquest;">
-<map from="[laquo ]" to="&#38;laquo;">
-<map from="[raquo ]" to="&#38;raquo;">
-<map from="[lsquo ]" to="`">
-<map from="[rsquo ]" to="'">
-<map from="[ldquo ]" to="``">
-<map from="[rdquo ]" to="''">
-<map from="[nbsp ]" to="&#38;nbsp;">
-<map from="[shy ]" to="&#38;shy;">
-
-<!-- Publishing -->
-
-<map from="[emsp ]" to="&#38;nbsp;&#38;nbsp;">
-<map from="[ensp ]" to="&#38;nbsp;">
-<map from="[emsp3 ]" to="&#38;nbsp;">
-<map from="[emsp4 ]" to="&#38;nbsp;">
-<map from="[numsp ]" to="&#38;nbsp;">
-<map from="[puncsp]" to="&#38;puncsp;">
-<map from="[thinsp]" to="&#38;nbsp;">
-<map from="[hairsp]" to="">
-<map from="[mdash ]" to="--">
-<map from="[ndash ]" to="-">
-<map from="[dash ]" to="-">
-<map from="[blank ]" to="&#38;blank;">
-<map from="[hellip]" to="...">
-<map from="[nldr ]" to="&#38;nldr;">
-<map from="[frac13]" to="&#38;frac13;">
-<map from="[frac23]" to="&#38;frac23;">
-<map from="[frac15]" to="&#38;frac15;">
-<map from="[frac25]" to="&#38;frac25;">
-<map from="[frac35]" to="&#38;frac35;">
-<map from="[frac45]" to="&#38;frac45;">
-<map from="[frac16]" to="&#38;frac16;">
-<map from="[frac56]" to="&#38;frac56;">
-<map from="[incare]" to="&#38;incare;">
-<map from="[block ]" to="&#38;block;">
-<map from="[uhblk ]" to="&#38;uhblk;">
-<map from="[lhblk ]" to="&#38;lhblk;">
-<map from="[blk14 ]" to="&#38;blk14;">
-<map from="[blk12 ]" to="&#38;blk12;">
-<map from="[blk34 ]" to="&#38;blk34;">
-<map from="[marker]" to="&#38;marker;">
-<map from="[cir ]" to="&#38;cir;">
-<map from="[squ ]" to="&#38;squ;">
-<map from="[rect ]" to="&#38;rect;">
-<map from="[utri ]" to="&#38;utri;">
-<map from="[dtri ]" to="&#38;dtri;">
-<map from="[star ]" to="&#38;star;">
-<map from="[bull ]" to="*">
-<map from="[squf ]" to="&#38;squf;">
-<map from="[utrif ]" to="&#38;utrif;">
-<map from="[dtrif ]" to="&#38;dtrif;">
-<map from="[ltrif ]" to="&#38;ltrif;">
-<map from="[rtrif ]" to="&#38;rtrif;">
-<map from="[clubs ]" to="&#38;clubs;">
-<map from="[diams ]" to="&#38;diams;">
-<map from="[hearts]" to="&#38;hearts;">
-<map from="[spades]" to="&#38;spades;">
-<map from="[malt ]" to="&#38;malt;">
-<map from="[dagger]" to="&#38;dagger;">
-<map from="[Dagger]" to="&#38;Dagger;">
-<map from="[check ]" to="&#38;check;">
-<map from="[ballot]" to="&#38;ballot;">
-<map from="[sharp ]" to="&#38;sharp;">
-<map from="[flat ]" to="&#38;flat;">
-<map from="[male ]" to="&#38;male;">
-<map from="[female]" to="&#38;female;">
-<map from="[phone ]" to="&#38;phone;">
-<map from="[telrec]" to="&#38;telrec;">
-<map from="[copysr]" to="&#38;copysr;">
-<map from="[caret ]" to="&#38;caret;">
-<map from="[lsquor]" to="&#38;lsquor;">
-<map from="[ldquor]" to="&#38;ldquor;">
-<map from="[fflig ]" to="&#38;fflig;">
-<map from="[filig ]" to="&#38;filig;">
-<map from="[fjlig ]" to="&#38;fjlig;">
-<map from="[ffilig]" to="&#38;ffilig;">
-<map from="[ffllig]" to="&#38;ffllig;">
-<map from="[fllig ]" to="&#38;fllig;">
-<map from="[mldr ]" to="&#38;mldr;">
-<map from="[rdquor]" to="&#38;rdquor;">
-<map from="[rsquor]" to="&#38;rsquor;">
-<map from="[vellip]" to="...">
-<map from="[hybull]" to="&#38;hybull;">
-<map from="[loz ]" to="&#38;loz;">
-<map from="[lozf ]" to="&#38;lozf;">
-<map from="[ltri ]" to="&#38;ltri;">
-<map from="[rtri ]" to="&#38;rtri;">
-<map from="[starf ]" to="&#38;starf;">
-<map from="[natur ]" to="&#38;natur;">
-<map from="[rx ]" to="&#38;rx;">
-<map from="[sext ]" to="&#38;sext;">
-<map from="[target]" to="&#38;target;">
-<map from="[dlcrop]" to="&#38;dlcrop;">
-<map from="[drcrop]" to="&#38;drcrop;">
-<map from="[ulcrop]" to="&#38;ulcrop;">
-<map from="[urcrop]" to="&#38;urcrop;">
-
-<!-- Added Latin 1 -->
-
-<map from="[aacute]" to="&#38;aacute;">
-<map from="[Aacute]" to="&#38;Aacute;">
-<map from="[acirc ]" to="&#38;acirc;">
-<map from="[Acirc ]" to="&#38;Acirc;">
-<map from="[agrave]" to="&#38;agrave;">
-<map from="[Agrave]" to="&#38;Agrave;">
-<map from="[aring ]" to="&#38;aring;">
-<map from="[Aring ]" to="&#38;Aring;">
-<map from="[atilde]" to="&#38;atilde;">
-<map from="[Atilde]" to="&#38;Atilde;">
-<map from="[auml ]" to="&#38;auml;">
-<map from="[Auml ]" to="&#38;Auml;">
-<map from="[aelig ]" to="&#38;aelig;">
-<map from="[AElig ]" to="&#38;AElig;">
-<map from="[ccedil]" to="&#38;ccedil;">
-<map from="[Ccedil]" to="&#38;Ccedil;">
-<map from="[eth ]" to="&#38;eth;">
-<map from="[ETH ]" to="&#38;ETH;">
-<map from="[eacute]" to="&#38;eacute;">
-<map from="[Eacute]" to="&#38;Eacute;">
-<map from="[ecirc ]" to="&#38;ecirc;">
-<map from="[Ecirc ]" to="&#38;Ecirc;">
-<map from="[egrave]" to="&#38;egrave;">
-<map from="[Egrave]" to="&#38;Egrave;">
-<map from="[euml ]" to="&#38;euml;">
-<map from="[Euml ]" to="&#38;Euml;">
-<map from="[iacute]" to="&#38;iacute;">
-<map from="[Iacute]" to="&#38;Iacute;">
-<map from="[icirc ]" to="&#38;icirc;">
-<map from="[Icirc ]" to="&#38;Icirc;">
-<map from="[igrave]" to="&#38;igrave;">
-<map from="[Igrave]" to="&#38;Igrave;">
-<map from="[iuml ]" to="&#38;iuml;">
-<map from="[Iuml ]" to="&#38;Iuml;">
-<map from="[ntilde]" to="&#38;ntilde;">
-<map from="[Ntilde]" to="&#38;Ntilde;">
-<map from="[oacute]" to="&#38;oacute;">
-<map from="[Oacute]" to="&#38;Oacute;">
-<map from="[ocirc ]" to="&#38;ocirc;">
-<map from="[Ocirc ]" to="&#38;Ocirc;">
-<map from="[ograve]" to="&#38;ograve;">
-<map from="[Ograve]" to="&#38;Ograve;">
-<map from="[oslash]" to="&#38;oslash;">
-<map from="[Oslash]" to="&#38;Oslash;">
-<map from="[otilde]" to="&#38;otilde;">
-<map from="[Otilde]" to="&#38;Otilde;">
-<map from="[ouml ]" to="&#38;ouml;">
-<map from="[Ouml ]" to="&#38;Ouml;">
-<map from="[szlig ]" to="&#38;szlig;">
-<map from="[thorn ]" to="&#38;thorn;">
-<map from="[THORN ]" to="&#38;THORN;">
-<map from="[uacute]" to="&#38;uacute;">
-<map from="[Uacute]" to="&#38;Uacute;">
-<map from="[ucirc ]" to="&#38;ucirc;">
-<map from="[Ucirc ]" to="&#38;Ucirc;">
-<map from="[ugrave]" to="&#38;ugrave;">
-<map from="[Ugrave]" to="&#38;Ugrave;">
-<map from="[uuml ]" to="&#38;uuml;">
-<map from="[Uuml ]" to="&#38;Uuml;">
-<map from="[yacute]" to="&#38;yacute;">
-<map from="[Yacute]" to="&#38;Yacute;">
-<map from="[yuml ]" to="&#38;yuml;">
-
-<!-- Added Latin 2 -->
-
-<map from="[abreve]" to="&#38;abreve;">
-<map from="[Abreve]" to="&#38;Abreve;">
-<map from="[amacr ]" to="&#38;amacr;">
-<map from="[Amacr ]" to="&#38;Amacr;">
-<map from="[aogon ]" to="&#38;aogon;">
-<map from="[Aogon ]" to="&#38;Aogon;">
-<map from="[cacute]" to="&#38;cacute;">
-<map from="[Cacute]" to="&#38;Cacute;">
-<map from="[ccaron]" to="&#38;ccaron;">
-<map from="[Ccaron]" to="&#38;Ccaron;">
-<map from="[ccirc ]" to="&#38;ccirc;">
-<map from="[Ccirc ]" to="&#38;Ccirc;">
-<map from="[cdot ]" to="&#38;cdot;">
-<map from="[Cdot ]" to="&#38;Cdot;">
-<map from="[dcaron]" to="&#38;dcaron;">
-<map from="[Dcaron]" to="&#38;Dcaron;">
-<map from="[dstrok]" to="&#38;dstrok;">
-<map from="[Dstrok]" to="&#38;Dstrok;">
-<map from="[ecaron]" to="&#38;ecaron;">
-<map from="[Ecaron]" to="&#38;Ecaron;">
-<map from="[edot ]" to="&#38;edot;">
-<map from="[Edot ]" to="&#38;Edot;">
-<map from="[emacr ]" to="&#38;emacr;">
-<map from="[Emacr ]" to="&#38;Emacr;">
-<map from="[eogon ]" to="&#38;eogon;">
-<map from="[Eogon ]" to="&#38;Eogon;">
-<map from="[gacute]" to="&#38;gacute;">
-<map from="[gbreve]" to="&#38;gbreve;">
-<map from="[Gbreve]" to="&#38;Gbreve;">
-<map from="[Gcedil]" to="&#38;Gcedil;">
-<map from="[gcirc ]" to="&#38;gcirc;">
-<map from="[Gcirc ]" to="&#38;Gcirc;">
-<map from="[gdot ]" to="&#38;gdot;">
-<map from="[Gdot ]" to="&#38;Gdot;">
-<map from="[hcirc ]" to="&#38;hcirc;">
-<map from="[Hcirc ]" to="&#38;Hcirc;">
-<map from="[hstrok]" to="&#38;hstrok;">
-<map from="[Hstrok]" to="&#38;Hstrok;">
-<map from="[Idot ]" to="&#38;Idot;">
-<map from="[Imacr ]" to="&#38;Imacr;">
-<map from="[imacr ]" to="&#38;imacr;">
-<map from="[ijlig ]" to="&#38;ijlig;">
-<map from="[IJlig ]" to="&#38;IJlig;">
-<map from="[inodot]" to="&#38;inodot;">
-<map from="[iogon ]" to="&#38;iogon;">
-<map from="[Iogon ]" to="&#38;Iogon;">
-<map from="[itilde]" to="&#38;itilde;">
-<map from="[Itilde]" to="&#38;Itilde;">
-<map from="[jcirc ]" to="&#38;jcirc;">
-<map from="[Jcirc ]" to="&#38;Jcirc;">
-<map from="[kcedil]" to="&#38;kcedil;">
-<map from="[Kcedil]" to="&#38;Kcedil;">
-<map from="[kgreen]" to="&#38;kgreen;">
-<map from="[lacute]" to="&#38;lacute;">
-<map from="[Lacute]" to="&#38;Lacute;">
-<map from="[lcaron]" to="&#38;lcaron;">
-<map from="[Lcaron]" to="&#38;Lcaron;">
-<map from="[lcedil]" to="&#38;lcedil;">
-<map from="[Lcedil]" to="&#38;Lcedil;">
-<map from="[lmidot]" to="&#38;lmidot;">
-<map from="[Lmidot]" to="&#38;Lmidot;">
-<map from="[lstrok]" to="&#38;lstrok;">
-<map from="[Lstrok]" to="&#38;Lstrok;">
-<map from="[nacute]" to="&#38;nacute;">
-<map from="[Nacute]" to="&#38;Nacute;">
-<map from="[eng ]" to="&#38;eng;">
-<map from="[ENG ]" to="&#38;ENG;">
-<map from="[napos ]" to="&#38;napos;">
-<map from="[ncaron]" to="&#38;ncaron;">
-<map from="[Ncaron]" to="&#38;Ncaron;">
-<map from="[ncedil]" to="&#38;ncedil;">
-<map from="[Ncedil]" to="&#38;Ncedil;">
-<map from="[odblac]" to="&#38;odblac;">
-<map from="[Odblac]" to="&#38;Odblac;">
-<map from="[Omacr ]" to="&#38;Omacr;">
-<map from="[omacr ]" to="&#38;omacr;">
-<map from="[oelig ]" to="&#38;oelig;">
-<map from="[OElig ]" to="&#38;OElig;">
-<map from="[racute]" to="&#38;racute;">
-<map from="[Racute]" to="&#38;Racute;">
-<map from="[rcaron]" to="&#38;rcaron;">
-<map from="[Rcaron]" to="&#38;Rcaron;">
-<map from="[rcedil]" to="&#38;rcedil;">
-<map from="[Rcedil]" to="&#38;Rcedil;">
-<map from="[sacute]" to="&#38;sacute;">
-<map from="[Sacute]" to="&#38;Sacute;">
-<map from="[scaron]" to="&#38;scaron;">
-<map from="[Scaron]" to="&#38;Scaron;">
-<map from="[scedil]" to="&#38;scedil;">
-<map from="[Scedil]" to="&#38;Scedil;">
-<map from="[scirc ]" to="&#38;scirc;">
-<map from="[Scirc ]" to="&#38;Scirc;">
-<map from="[tcaron]" to="&#38;tcaron;">
-<map from="[Tcaron]" to="&#38;Tcaron;">
-<map from="[tcedil]" to="&#38;tcedil;">
-<map from="[Tcedil]" to="&#38;Tcedil;">
-<map from="[tstrok]" to="&#38;tstrok;">
-<map from="[Tstrok]" to="&#38;Tstrok;">
-<map from="[ubreve]" to="&#38;ubreve;">
-<map from="[Ubreve]" to="&#38;Ubreve;">
-<map from="[udblac]" to="&#38;udblac;">
-<map from="[Udblac]" to="&#38;Udblac;">
-<map from="[umacr ]" to="&#38;umacr;">
-<map from="[Umacr ]" to="&#38;Umacr;">
-<map from="[uogon ]" to="&#38;uogon;">
-<map from="[Uogon ]" to="&#38;Uogon;">
-<map from="[uring ]" to="&#38;uring;">
-<map from="[Uring ]" to="&#38;Uring;">
-<map from="[utilde]" to="&#38;utilde;">
-<map from="[Utilde]" to="&#38;Utilde;">
-<map from="[wcirc ]" to="&#38;wcirc;">
-<map from="[Wcirc ]" to="&#38;Wcirc;">
-<map from="[ycirc ]" to="&#38;ycirc;">
-<map from="[Ycirc ]" to="&#38;Ycirc;">
-<map from="[Yuml ]" to="&#38;Yuml;">
-<map from="[zacute]" to="&#38;zacute;">
-<map from="[Zacute]" to="&#38;Zacute;">
-<map from="[zcaron]" to="&#38;zcaron;">
-<map from="[Zcaron]" to="&#38;Zcaron;">
-<map from="[zdot ]" to="&#38;zdot;">
-<map from="[Zdot ]" to="&#38;Zdot;">
-
-<!-- Greek Letters -->
-
-<map from="[agr ]" to="&#38;agr;">
-<map from="[Agr ]" to="&#38;Agr;">
-<map from="[bgr ]" to="&#38;bgr;">
-<map from="[Bgr ]" to="&#38;Bgr;">
-<map from="[ggr ]" to="&#38;ggr;">
-<map from="[Ggr ]" to="&#38;Ggr;">
-<map from="[dgr ]" to="&#38;dgr;">
-<map from="[Dgr ]" to="&#38;Dgr;">
-<map from="[egr ]" to="&#38;egr;">
-<map from="[Egr ]" to="&#38;Egr;">
-<map from="[zgr ]" to="&#38;zgr;">
-<map from="[Zgr ]" to="&#38;Zgr;">
-<map from="[eegr ]" to="&#38;eegr;">
-<map from="[EEgr ]" to="&#38;EEgr;">
-<map from="[thgr ]" to="&#38;thgr;">
-<map from="[THgr ]" to="&#38;THgr;">
-<map from="[igr ]" to="&#38;igr;">
-<map from="[Igr ]" to="&#38;Igr;">
-<map from="[kgr ]" to="&#38;kgr;">
-<map from="[Kgr ]" to="&#38;Kgr;">
-<map from="[lgr ]" to="&#38;lgr;">
-<map from="[Lgr ]" to="&#38;Lgr;">
-<map from="[mgr ]" to="&#38;mgr;">
-<map from="[Mgr ]" to="&#38;Mgr;">
-<map from="[ngr ]" to="&#38;ngr;">
-<map from="[Ngr ]" to="&#38;Ngr;">
-<map from="[xgr ]" to="&#38;xgr;">
-<map from="[Xgr ]" to="&#38;Xgr;">
-<map from="[ogr ]" to="&#38;ogr;">
-<map from="[Ogr ]" to="&#38;Ogr;">
-<map from="[pgr ]" to="&#38;pgr;">
-<map from="[Pgr ]" to="&#38;Pgr;">
-<map from="[rgr ]" to="&#38;rgr;">
-<map from="[Rgr ]" to="&#38;Rgr;">
-<map from="[sgr ]" to="&#38;sgr;">
-<map from="[Sgr ]" to="&#38;Sgr;">
-<map from="[sfgr ]" to="&#38;sfgr;">
-<map from="[tgr ]" to="&#38;tgr;">
-<map from="[Tgr ]" to="&#38;Tgr;">
-<map from="[ugr ]" to="&#38;ugr;">
-<map from="[Ugr ]" to="&#38;Ugr;">
-<map from="[phgr ]" to="&#38;phgr;">
-<map from="[PHgr ]" to="&#38;PHgr;">
-<map from="[khgr ]" to="&#38;khgr;">
-<map from="[KHgr ]" to="&#38;KHgr;">
-<map from="[psgr ]" to="&#38;psgr;">
-<map from="[PSgr ]" to="&#38;PSgr;">
-<map from="[ohgr ]" to="&#38;ohgr;">
-<map from="[OHgr ]" to="&#38;OHgr;">
-
-<!-- Greek Symbols -->
-
-<map from="[alpha ]" to="&#38;alpha;">
-<map from="[beta ]" to="&#38;beta;">
-<map from="[gamma ]" to="&#38;gamma;">
-<map from="[Gamma ]" to="&#38;Gamma;">
-<map from="[gammad]" to="&#38;gammad;">
-<map from="[delta ]" to="&#38;delta;">
-<map from="[Delta ]" to="&#38;Delta;">
-<map from="[epsi ]" to="&#38;epsi;">
-<map from="[epsiv ]" to="&#38;epsiv;">
-<map from="[epsis ]" to="&#38;epsis;">
-<map from="[zeta ]" to="&#38;zeta;">
-<map from="[eta ]" to="&#38;eta;">
-<map from="[thetas]" to="&#38;thetas;">
-<map from="[Theta ]" to="&#38;Theta;">
-<map from="[thetav]" to="&#38;thetav;">
-<map from="[iota ]" to="&#38;iota;">
-<map from="[kappa ]" to="&#38;kappa;">
-<map from="[kappav]" to="&#38;kappav;">
-<map from="[lambda]" to="&#38;lambda;">
-<map from="[Lambda]" to="&#38;Lambda;">
-<map from="[mu ]" to="&#38;mu;">
-<map from="[nu ]" to="&#38;nu;">
-<map from="[xi ]" to="&#38;xi;">
-<map from="[Xi ]" to="&#38;Xi;">
-<map from="[pi ]" to="&#38;pi;">
-<map from="[piv ]" to="&#38;piv;">
-<map from="[Pi ]" to="&#38;Pi;">
-<map from="[rho ]" to="&#38;rho;">
-<map from="[rhov ]" to="&#38;rhov;">
-<map from="[sigma ]" to="&#38;sigma;">
-<map from="[Sigma ]" to="&#38;Sigma;">
-<map from="[sigmav]" to="&#38;sigmav;">
-<map from="[tau ]" to="&#38;tau;">
-<map from="[upsi ]" to="&#38;upsi;">
-<map from="[Upsi ]" to="&#38;Upsi;">
-<map from="[phis ]" to="&#38;phis;">
-<map from="[Phi ]" to="&#38;Phi;">
-<map from="[phiv ]" to="&#38;phiv;">
-<map from="[chi ]" to="&#38;chi;">
-<map from="[psi ]" to="&#38;psi;">
-<map from="[Psi ]" to="&#38;Psi;">
-<map from="[omega ]" to="&#38;omega;">
-<map from="[Omega ]" to="&#38;Omega;">
-
-<!-- General Technical -->
-
-<map from="[aleph ]" to="&#38;aleph;">
-<map from="[and ]" to="&#38;and;">
-<map from="[ang90 ]" to="&#38;ang90;">
-<map from="[angsph]" to="&#38;angsph;">
-<map from="[ap ]" to="&#38;ap;">
-<map from="[becaus]" to="&#38;becaus;">
-<map from="[bottom]" to="&#38;bottom;">
-<map from="[cap ]" to="&#38;cap;">
-<map from="[cong ]" to="&#38;cong;">
-<map from="[conint]" to="&#38;conint;">
-<map from="[cup ]" to="&#38;cup;">
-<map from="[equiv ]" to="&#38;equiv;">
-<map from="[exist ]" to="&#38;exist;">
-<map from="[forall]" to="&#38;forall;">
-<map from="[fnof ]" to="&#38;fnof;">
-<map from="[ge ]" to="&#38;ge;">
-<map from="[iff ]" to="&#38;iff;">
-<map from="[infin ]" to="&#38;infin;">
-<map from="[int ]" to="&#38;int;">
-<map from="[isin ]" to="&#38;isin;">
-<map from="[lang ]" to="&#38;lang;">
-<map from="[lArr ]" to="&#38;lArr;">
-<map from="[le ]" to="&#38;le;">
-<map from="[minus ]" to="-">
-<map from="[mnplus]" to="&#38;mnplus;">
-<map from="[nabla ]" to="&#38;nabla;">
-<map from="[ne ]" to="&#38;ne;">
-<map from="[ni ]" to="&#38;ni;">
-<map from="[or ]" to="&#38;or;">
-<map from="[par ]" to="&#38;par;">
-<map from="[part ]" to="&#38;part;">
-<map from="[permil]" to="&#38;permil;">
-<map from="[perp ]" to="&#38;perp;">
-<map from="[prime ]" to="&#38;prime;">
-<map from="[Prime ]" to="&#38;Prime;">
-<map from="[prop ]" to="&#38;prop;">
-<map from="[radic ]" to="&#38;radic;">
-<map from="[rang ]" to="&#38;rang;">
-<map from="[rArr ]" to="&#38;rArr;">
-<map from="[sim ]" to="&#38;sim;">
-<map from="[sime ]" to="&#38;sime;">
-<map from="[square]" to="&#38;square;">
-<map from="[sub ]" to="&#38;sub;">
-<map from="[sube ]" to="&#38;sube;">
-<map from="[sup ]" to="&#38;sup;">
-<map from="[supe ]" to="&#38;supe;">
-<map from="[there4]" to="&#38;there4;">
-<map from="[Verbar]" to="&#38;Verbar;">
-<map from="[angst ]" to="&#38;angst;">
-<map from="[bernou]" to="&#38;bernou;">
-<map from="[compfn]" to="&#38;compfn;">
-<map from="[Dot ]" to="&#38;Dot;">
-<map from="[DotDot]" to="&#38;DotDot;">
-<map from="[hamilt]" to="&#38;hamilt;">
-<map from="[lagran]" to="&#38;lagran;">
-<map from="[lowast]" to="&#38;lowast;">
-<map from="[notin ]" to="&#38;notin;">
-<map from="[order ]" to="&#38;order;">
-<map from="[phmmat]" to="&#38;phmmat;">
-<map from="[tdot ]" to="&#38;tdot;">
-<map from="[tprime]" to="&#38;tprime;">
-<map from="[wedgeq]" to="&#38;wedgeq;">
-
-<!-- Diacritical Marks -->
-
-<map from="[acute ]" to="&#38;acute;">
-<map from="[breve ]" to="&#38;breve;">
-<map from="[caron ]" to="&#38;caron;">
-<map from="[cedil ]" to="&#38;cedil;">
-<map from="[circ ]" to="&#38;circ;">
-<map from="[dblac ]" to="&#38;dblac;">
-<map from="[die ]" to="&#38;die;">
-<map from="[dot ]" to="&#38;dot;">
-<map from="[grave ]" to="&#38;grave;">
-<map from="[macr ]" to="&#38;macr;">
-<map from="[ogon ]" to="&#38;ogon;">
-<map from="[ring ]" to="&#38;ring;">
-<map from="[tilde ]" to="~">
-<map from="[uml ]" to="&#38;uml;">
diff --git a/share/sgml/transpec/linuxdoc-html.ts b/share/sgml/transpec/linuxdoc-html.ts
deleted file mode 100644
index fae755d..0000000
--- a/share/sgml/transpec/linuxdoc-html.ts
+++ /dev/null
@@ -1,1005 +0,0 @@
-<!--
-
- $Id$
-
- Copyright (C) 1996
- John R. Fieber. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY JOHN R. FIEBER AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL JOHN R. FIEBER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
--->
-
-<!--
-
- This is an instant(1) translation specification to turn an
- SGML document marked up according to the linuxdoc DTD into
- HTML. The output is intended to be post-processed by
- sgmlfmt(1).
-
--->
-
-<!DOCTYPE transpec PUBLIC "-//FreeBSD//DTD transpec//EN" [
-<!ENTITY lt CDATA "<">
-<!ENTITY gt CDATA ">">
-<!--
-<!ENTITY % ISOnum PUBLIC
- "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN">
- %ISOnum;
--->
-
-<!ENTITY cmap SYSTEM "/usr/share/sgml/transpec/html.cmap">
-<!ENTITY sdata SYSTEM "/usr/share/sgml/transpec/html.sdata">
-
-]>
-
-<transpec>
-
-<!-- Character and SDATA entity mapping -->
-<cmap>&cmap;</cmap>
-<smap>&sdata;</smap>
-
-<!-- Transform rules -->
-
-<rule>
-<match>
-<gi>LINUXDOC
-</rule>
-
-<rule>
-<match>
- <gi>ARTICLE
-</rule>
-
-<rule>
-<match>
- <gi>REPORT
-</rule>
-
-<rule>
-<match>
- <gi>BOOK
-</rule>
-
-<rule>
-<match>
- <gi>NOTES
-</rule>
-
-<rule>
-<match>
- <gi>MANPAGE
-</rule>
-
-<rule>
-<match>
- <gi>TITLEPAG
-</rule>
-
-<rule>
-<match>
- <gi>TITLE
-<action>
- <start>^&lt;@@title&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>SUBTITLE
-<action>
- <start>^&lt;h2&gt;</start>
- <end>&lt;/h2&gt;^</end>
-</rule>
-
-<rule>
-<match>
-<gi>DATE
-</rule>
-
-<rule>
-<match>
- <gi>AUTHOR
-</rule>
-
-<rule>
-<match>
- <gi>NAME
-<action>
- <start>^&lt;h2&gt;</start>
- <end>&lt;/h2&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>AND
-<action>
- <start>and </start>
-</rule>
-
-<rule>
-<match>
- <gi>THANKS
-<action>
- <start>^Thanks </start>
-</rule>
-
-<rule>
-<match>
- <gi>INST
-<action>
- <start>^&lt;h3&gt;</start>
- <end>&lt;/h3&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>NEWLINE
-<action>
- <start>&lt;br&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>LABEL
-<action>
- <start>^&lt;@@label&gt;${ID}^</start>
-</rule>
-
-<rule>
-<match>
- <gi>HEADER
-</rule>
-
-<rule>
-<match>
- <gi>LHEAD
-<action>
- <start>^&lt;!-- </start>
- <end>--&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>RHEAD
-<action>
- <start>^&lt;!-- </start>
- <end>--&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>COMMENT
-<action>
- <start>^&lt;h4&gt;Comment&lt;/h4&gt;^</start>
-</rule>
-
-<rule>
-<match>
- <gi>ABSTRACT
-<action>
- <start>^&lt;p&gt;&lt;hr&gt;&lt;em&gt;</start>
- <end>&lt;/em&gt;&lt;hr&gt;&lt;/p&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>APPENDIX
-<action>
- <start>^&lt;h2&gt;Appendix&lt;/h2&gt;^</start>
-</rule>
-
-<rule>
-<match>
- <gi>TOC
-</rule>
-
-<rule>
-<match>
- <gi>LOF
-</rule>
-
-<rule>
-<match>
- <gi>LOT
-</rule>
-
-<rule>
-<match>
- <gi>PART
-<action>
- <start>^&lt;@@part&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>CHAPT
-<action>
- <start>^&lt;@@sect&gt;</start>
- <end>^&lt;@@endsect&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SECT
-<action>
- <start>^&lt;@@sect&gt;</start>
- <end>^&lt;@@endsect&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SECT1
-<action>
- <start>^&lt;@@sect&gt;</start>
- <end>^&lt;@@endsect&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SECT2
-<action>
- <start>^&lt;@@sect&gt;</start>
- <end>^&lt;@@endsect&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SECT3
-<action>
- <start>^&lt;@@sect&gt;</start>
- <end>^&lt;@@endsect&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SECT4
-<action>
- <start>^&lt;@@sect&gt;</start>
- <end>^&lt;@@endsect&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>HEADING
-<action>
- <start>^&lt;@@head&gt;</start>
- <end>^&lt;@@endhead&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>P
-<action>
- <start>&lt;p&gt;</start>
- <end>&lt;/p&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>ITEMIZE
-<action>
- <start>^&lt;ul&gt;^</start>
- <end>^&lt;/ul&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>ENUM
-<action>
- <start>^&lt;ol&gt;^</start>
- <end>^&lt;/ol&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>DESCRIP
-<action>
- <start>^&lt;dl&gt;^</start>
- <end>^&lt;/dl&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>ITEM
-<action>
- <start>^&lt;li&gt;</start>
- <end>&lt;/li&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>TAG
-<action>
- <start>&lt;dt&gt;&lt;b&gt;</start>
- <end>&lt;/b&gt;&lt;dd&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>CITE
-<action>
- <start>[&lt;i&gt;${ID}&lt;/i&gt;]</start>
-</rule>
-
-<rule>
-<match>
- <gi>NCITE
-<action>
- <start>[&lt;i&gt;${NOTE} (${ID})&lt;/i&gt;]</start>
-</rule>
-
-<rule>
-<match>
- <gi>FOOTNOTE
-<action>
- <start>^&lt;sl&gt;</start>
- <end>&lt;/sl&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SQ
-<action>
- <start>"</start>
- <end>"</end>
-</rule>
-
-<rule>
-<match>
- <gi>LQ
-<action>
- <start>^&lt;LQ&gt;^</start>
- <end>^&lt;/LQ&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>EM
-<action>
- <start>&lt;em&gt;</start>
- <end>&lt;/em&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>BF
-<action>
- <start>&lt;b&gt;</start>
- <end>&lt;/b&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>IT
-<action>
- <start>&lt;i&gt;</start>
- <end>&lt;/i&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>SF
-<action>
- <start>&lt;SF&gt;</start>
- <end>&lt;/SF&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>SL
-<action>
- <start>&lt;i&gt;</start>
- <end>&lt;/i&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>TT
-<action>
- <start>&lt;code&gt;</start>
- <end>&lt;/code&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>URL HTMLURL
- <attval>NAME .
-<action>
- <start>&lt;A href="${URL}">${NAME}&lt;/A></start>
-</rule>
-
-<rule>
-<match>
- <gi>URL HTMLURL
-<action>
- <start>&lt;A href="${URL}">${URL}&lt;/A></start>
-</rule>
-
-<rule>
-<match>
- <gi>REF
- <attval>NAME .
-<action>
- <start>^&lt;@@ref&gt;${ID}
-${NAME}&lt;/A&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>REF
-<action>
- <start>^&lt;@@ref&gt;${ID}
-${ID}&lt;/A&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>HREF
-<action>
- <start>^&lt;@@ref&gt;${ID}^</start>
-</rule>
-
-<rule>
-<match>
- <gi>PAGEREF
-<action>
- <start>^&lt;@@ref&gt;${ID}^</start>
-</rule>
-
-<rule>
-<match>
- <gi>X
-</rule>
-
-<rule>
-<match>
- <gi>MC
-<action>
- <start>&lt;MC&gt;</start>
- <end>&lt;/MC&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>BIBLIO
-<action>
- <start>^&lt;BIBLIO STYLE="${STYLE}" FILES="${FILES}"&gt;^</start>
-</rule>
-
-<rule>
-<match>
- <gi>CODE
-<action>
- <start>^&lt;hr&gt;&lt;pre&gt;^</start>
- <end>^&lt;/pre&gt;&lt;hr&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>VERB
-<action>
- <start>^&lt;pre&gt;^</start>
- <end>^&lt;/pre&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>TSCREEN
-<action>
- <start>^&lt;blockquote&gt;&lt;code&gt;^</start>
- <end>^&lt;/code&gt;&lt;/blockquote&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>QUOTE
-<action>
- <start>^&lt;blockquote&gt;^</start>
- <end>^&lt;/blockquote&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>DEF
-<action>
- <start>^&lt;DEF&gt;</start>
- <end>^&lt;/DEF&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>PROP
-<action>
- <start>^&lt;PROP&gt;</start>
- <end>^&lt;/PROP&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>LEMMA
-<action>
- <start>^&lt;LEMMA&gt;</start>
- <end>^&lt;/LEMMA&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>COROLL
-<action>
- <start>^&lt;COROLL&gt;</start>
- <end>^&lt;/COROLL&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>PROOF
-<action>
- <start>^&lt;PROOF&gt;</start>
- <end>^&lt;/PROOF&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>THEOREM
-<action>
- <start>^&lt;THEOREM&gt;</start>
- <end>^&lt;/THEOREM&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>THTAG
-<action>
- <start>&lt;THTAG&gt;</start>
- <end>&lt;/THTAG&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>F
-<action>
- <start>&lt;F&gt;</start>
- <end>&lt;/F&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>DM
-<action>
- <start>^&lt;DM&gt;^</start>
- <end>^&lt;/DM&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>EQ
-<action>
- <start>^&lt;EQ&gt;^</start>
- <end>^&lt;/EQ&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>FR
-<action>
- <start>&lt;FR&gt;</start>
- <end>&lt;/FR&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>NU
-<action>
- <start>&lt;NU&gt;</start>
- <end>&lt;/NU&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>DE
-<action>
- <start>&lt;DE&gt;</start>
- <end>&lt;/DE&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>LIM
-<action>
- <start>&lt;LIM&gt;</start>
- <end>&lt;/LIM&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>OP
-<action>
- <start>&lt;OP&gt;</start>
- <end>&lt;/OP&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>LL
-<action>
- <start>&lt;LL&gt;</start>
- <end>&lt;/LL&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>UL
-<action>
- <start>&lt;UL&gt;</start>
- <end>&lt;/UL&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>OPD
-<action>
- <start>&lt;OPD&gt;</start>
- <end>&lt;/OPD&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>PR
-<action>
- <start>&lt;PR&gt;</start>
- <end>&lt;/PR&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>IN
-<action>
- <start>&lt;INT&gt;</start>
- <end>&lt;/INT&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>SUM
-<action>
- <start>&lt;SUM&gt;</start>
- <end>&lt;/SUM&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>ROOT
-<action>
- <start>&lt;ROOT&gt;</start>
- <end>&lt;/ROOT&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>AR
-<action>
- <start>&lt;AR&gt;</start>
- <end>&lt;/AR&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>ARR
-<action>
- <start>&lt;ARR&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>ARC
-<action>
- <start>&lt;ARC&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>SUP
-<action>
- <start>&lt;SUP&gt;</start>
- <end>&lt;/SUP&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>INF
-<action>
- <start>&lt;INF&gt;</start>
- <end>&lt;/INF&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>UNL
-<action>
- <start>&lt;UNL&gt;</start>
- <end>&lt;/UNL&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>OVL
-<action>
- <start>&lt;OVL&gt;</start>
- <end>&lt;/OVL&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>RF
-<action>
- <start>&lt;RF&gt;</start>
- <end>&lt;/RF&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>V
-<action>
- <start>&lt;V&gt;</start>
- <end>&lt;/V&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>FI
-<action>
- <start>&lt;FI&gt;</start>
- <end>&lt;/FI&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>PHR
-<action>
- <start>&lt;PHR&gt;</start>
- <end>&lt;/PHR&gt;</end>
-</rule>
-
-<rule>
-<match>
- <gi>TU
-<action>
- <start>&lt;TU&gt;</start>
-</rule>
-
-<rule>
-<match>
- <gi>FIGURE
-<action>
- <start>^&lt;FIGURE&gt;^</start>
- <end>^&lt;/FIGURE&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>EPS
-<action>
- <start>^&lt;EPS FILE="${FILE}"&gt;^</start>
-</rule>
-
-<rule>
-<match>
- <gi>PH
-<action>
- <start>^&lt;PH VSPACE="${VSPACE}"&gt;^</start>
-</rule>
-
-<rule>
-<match>
- <gi>CAPTION
-<action>
- <start>^&lt;CAPTION&gt;</start>
- <end>&lt;/CAPTION&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>TABLE
-<action>
- <start>^&lt;TABLE&gt;^</start>
- <end>^&lt;/TABLE&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>TABULAR
-<action>
- <start>^&lt;br&gt;^</start>
- <end>^</end>
-</rule>
-
-<rule>
-<match>
- <gi>ROWSEP
-<action>
- <start>&lt;br&gt;^</start>
-</rule>
-
-<rule>
-<match>
- <gi>COLSEP
-</rule>
-
-<rule>
-<match>
- <gi>HLINE
-<action>
- <start>^&lt;hr&gt;^</start>
-</rule>
-
-<rule>
-<match>
- <gi>SLIDES
-<action>
- <start>^&lt;SLIDES&gt;^</start>
- <end>^&lt;/SLIDES&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SLIDE
-<action>
- <start>^&lt;SLIDE&gt;^</start>
- <end>^&lt;/SLIDE&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>LETTER
-<action>
- <start>^&lt;LETTER OPTS="${OPTS}"&gt;^</start>
- <end>^&lt;/LETTER&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>TELEFAX
-<action>
- <start>^&lt;TELEFAX OPTS="${OPTS}"&gt;^</start>
- <end>^&lt;/TELEFAX&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>OPENING
-<action>
- <start>^&lt;OPENING&gt;</start>
- <end>&lt;/OPENING&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>FROM
-<action>
- <start>^&lt;FROM&gt;</start>
- <end>^&lt;/FROM&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>TO
-<action>
- <start>^&lt;TO&gt;</start>
- <end>^&lt;/TO&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>ADDRESS
-<action>
- <start>^&lt;ADDRESS&gt;^</start>
- <end>^&lt;/ADDRESS&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>EMAIL
-<action>
- <start>^&lt;@@email&gt;</start>
- <end>&lt;@@endemail&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>PHONE
-<action>
- <start>^&lt;PHONE&gt;</start>
- <end>&lt;/PHONE&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>FAX
-<action>
- <start>^&lt;FAX&gt;</start>
- <end>&lt;/FAX&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SUBJECT
-<action>
- <start>^&lt;SUBJECT&gt;</start>
- <end>&lt;/SUBJECT&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>SREF
-<action>
- <start>^&lt;SREF&gt;</start>
- <end>&lt;/SREF&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>RREF
-<action>
- <start>^&lt;RREF&gt;</start>
- <end>&lt;/RREF&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>RDATE
-<action>
- <start>^&lt;RDATE&gt;</start>
- <end>&lt;/RDATE&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>CLOSING
-<action>
- <start>^&lt;CLOSING&gt;</start>
- <end>&lt;/CLOSING&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>CC
-<action>
- <start>^&lt;CC&gt;</start>
- <end>&lt;/CC&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>ENCL
-<action>
- <start>^&lt;ENCL&gt;</start>
- <end>&lt;/ENCL&gt;^</end>
-</rule>
-
-<rule>
-<match>
- <gi>PS
-<action>
- <start>^&lt;PS&gt;^</start>
- <end>^&lt;/PS&gt;^</end>
-
-
-</transpec>
diff --git a/share/sgml/transpec/linuxdoc-roff.ts b/share/sgml/transpec/linuxdoc-roff.ts
deleted file mode 100644
index 566a0de..0000000
--- a/share/sgml/transpec/linuxdoc-roff.ts
+++ /dev/null
@@ -1,1180 +0,0 @@
-<!--
-
- $Id$
-
- Copyright (C) 1996
- John R. Fieber. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY JOHN R. FIEBER AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL JOHN R. FIEBER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
--->
-
-<!--
-
- This is an instant(1) translation specification to turn an
- SGML document marked up according to the linuxdoc DTD into
- a document suitable for processing with groff(1) using mm
- macros.
-
- Special thanks to Chuck Robey <chuckr@freebsd.org> for helping
- to unravel the mysteries of groff.
-
--->
-
-<!DOCTYPE transpec PUBLIC "-//FreeBSD//DTD transpec//EN" [
-
-<!ENTITY r.pass CDATA "1">
-<!ENTITY r.passw CDATA "2">
-<!ENTITY r.phack CDATA "3">
-<!ENTITY r.label CDATA "4">
-<!ENTITY r.initr CDATA "5">
-
-<!ENTITY gt CDATA ">">
-<!ENTITY lt CDATA "<">
-<!ENTITY amp CDATA "&">
-
-<!ENTITY cmap SYSTEM "/usr/share/sgml/transpec/roff.cmap">
-<!ENTITY sdata SYSTEM "/usr/share/sgml/transpec/roff.sdata">
-
-<!ENTITY family CDATA "P">
-
-]>
-
-<transpec>
-
-<!-- Character and SDATA entity mapping -->
-<cmap>&cmap;</cmap>
-<smap>&sdata;</smap>
-
-<!-- Transform rules -->
-
-<!-- Inside a HEADING, all these need to be suppressed or deferred
- to a later time. -->
-<rule>
-<match>
-<gi>EM IT BF SF SL TT CPARAM LABEL REF PAGEREF CITE URL HTMLURL NCITE EMAIL IDX CDX F X
-<relation>ancestor HEADING
-</rule>
-
-<rule>
-<match>
-<gi>LINUXDOC
-<action>
-<start>^.\" Generated ${date} using ${transpec}
-.\" by ${user}@${host}
-.if t \{\
-. nr W 6i
-. nr O 1.25i
-. nr L 11i
-.\}
-.if n .nr W 79n
-.so /usr/share/tmac/tmac.m
-.nr Pt 0
-.ie t \{\
-. fam &family;
-. ds HP 16 14 12 10 10 10 10
-. ds HF HB HB HB HBI HI HI HI
-.\}
-.el \{\
-. SA 0
-. ftr C R
-.\}
-.PH "'${_followrel descendant TITLE &r.pass;}''%'"
-.nr N 1 <!-- header at the bottom of the first page -->
-.nr Pgps 0 <!-- header/footer size immune from .S -->
-.nr Hy 1 <!-- hypenation on -->
-.nr H0 0 1 <!-- Part counter -->
-.af H0 I
-${_followrel descendant LABEL &r.initr;}</start>
-<end>^</end>
-</rule>
-
-<!-- This is used with the above ${_followrel ...} to insert the
- .INITR command which opens a file for writing cross reference
- information. If there are no <label> tags, we don't want to
- bother with this. -->
-<rule id="&r.initr;">
-<match>
-<gi>_initr
-<action>
-<start>^.INITR "${filename}"^</start>
-</rule>
-
-<rule>
-<match>
-<gi>ARTICLE
-<action>
-<start>^.nr Hb 4
-.nr Hs 4^</start>
-<end>^.bp
-.TC^</end>
-</rule>
-
-<rule>
-<match>
-<gi>REPORT BOOK
-<action>
-<start>^.nr Cl 3 <!-- TOC goes to level 3 -->
-.nr Hb 5
-.nr Hs 5^</start>
-<end>
-^.bp
-.TC^</end>
-</rule>
-
-<rule>
-<match>
-<gi>NOTES
-</rule>
-
-<rule>
-<match>
-<gi>MANPAGE
-</rule>
-
-<rule>
-<match>
-<gi>TITLEPAG
-<action>
-<start>^\&
-.if t .SP 1i^</start>
-<end>^.SP 3^</end>
-</rule>
-
-<rule>
-<match>
-<gi>TITLE
-<action>
-<start>^.if t .S 18
-.DS C F
-.if t .fam H
-.B
-.if t .SA 0^</start>
-<end>^.if t .SA 1
-.R
-.if t .fam &family;
-.DE
-.if t .S D^</end>
-</rule>
-
-<rule>
-<match>
-<gi>SUBTITLE
-</rule>
-
-<rule>
-<match>
-<gi>DATE
-<action>
-<start>^.DS C F^</start>
-<end>^.DE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>ABSTRACT
-<action>
-<start>^.SP 3
-.DS C
-.B Abstract
-.DE
-.DS I F^</start>
-<end>^.DE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>AUTHOR
-<action>
-<start>^.DS C F^</start>
-<end>^.DE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>NAME
-</rule>
-
-<rule>
-<match>
-<gi>AND
-<action>
-<start>^.br^</start>
-</rule>
-
-<rule>
-<match>
-<gi>THANKS
-<action>
-<start>\*F
-.FS^</start>
-<end>^.FE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>INST
-<action>
-<start>^.br^</start>
-</rule>
-
-<rule>
-<match>
-<gi>NEWLINE
-<action>
-<start>^.br^</start>
-</rule>
-
-<rule id="&r.label;">
-<match>
-<gi>LABEL
-<action>
-<start>^.SETR "${ID}"^</start>
-</rule>
-
-<rule>
-<match>
-<gi>HEADER
-</rule>
-
-<rule>
-<match>
-<gi>LHEAD
-<action>
-<start>^.EH '</start>
-<end>'''^</end>
-</rule>
-
-<rule>
-<match>
-<gi>RHEAD
-<action>
-<start>^.OH '''</start>
-<end>'^</end>
-</rule>
-
-<rule>
-<match>
-<gi>COMMENT
-<action>
-<start>^(*^</start>
-<end>^*)^</end>
-</rule>
-
-<rule>
-<match>
-<gi>APPENDIX
-<action>
-<start>^.af H1 A^</start>
-</rule>
-
-<rule>
-<match>
-<gi>TOC
-</rule>
-
-<rule>
-<match>
-<gi>LOF
-</rule>
-
-<rule>
-<match>
-<gi>LOT
-</rule>
-
-<rule>
-<match>
-<gi>PART
-</rule>
-
-<rule>
-<match>
-<gi>CHAPT
-<action>
-<start>^.if t .SK
-${_set sl 1}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT
-<relation>ancestor BOOK
-<action>
-<start>${_set sl 2}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT
-<action>
-<start>${_set sl 1}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT1
-<relation>ancestor BOOK
-<action>
-<start>${_set sl 3}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT1
-<action>
-<start>${_set sl 2}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT2
-<relation>ancestor BOOK
-<action>
-<start>${_set sl 4}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT2
-<action>
-<start>${_set sl 3}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT3
-<relation>ancestor BOOK
-<action>
-<start>${_set sl 5}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT3
-<action>
-<start>${_set sl 4}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT4
-<relation>ancestor BOOK
-<action>
-<start>${_set sl 6}</start>
-</rule>
-
-<rule>
-<match>
-<gi>SECT4
-<action>
-<start>${_set sl 5}</start>
-</rule>
-
-<rule>
-<match>
-<gi>HEADING
-<context>PART
-<action>
-<start>^.if t .SK
-\&
-.if t .fam H
-.SP 3i
-.if t .S 24
-Part \n+(H0
-.SP 1i
-.if t .S 36^</start>
-<end>^.if t .S D
-.if t .fam &family;
-.if t .SK^</end>
-</rule>
-
-<rule>
-<match>
-<gi>HEADING
-<action>
-<start>^.H ${sl} "</start>
-<end>"
-${_followrel child LABEL &r.label}</end>
-</rule>
-
-<!--
-<rule>
-<match>
-<gi>HEADING
-<action>
-<start>^.br
-.di fbsd-head^</start>
-<end>^.br
-.di
-.asciify fbsd-head
-.H ${sl} \*[fbsd-head]
-${_followrel child LABEL &r.label}</end>
-</rule>
--->
-
-<!-- A paragraph immediately following a <tag> in a <descrip>. -->
-<rule>
-<match>
-<gi>P
-<relation>sibling-1 TAG
-</rule>
-
-<rule>
-<match>
-<gi>P
-<action>
-<start>${_notempty &r.phack;}</start>
-</rule>
-
-<!-- Completely empty paragraphs. -->
-<rule id="&r.phack;">
-<match>
-<gi>_phack
-<action>
-<replace>^.P^</replace>
-</rule>
-
-
-<rule>
-<match>
-<gi>ITEMIZE
-<action>
-<start>^.BL^</start>
-<end>^.LE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>ENUM
-<action>
-<start>^.AL^</start>
-<end>^.LE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>DESCRIP
-<action>
-<start>^.BVL \n(Li*2/1 \n(Li^</start>
-<end>^.LE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>ITEM
-<action>
-<start>^.LI^</start>
-</rule>
-
-<rule>
-<match>
-<gi>TAG
-<action>
-<start>^.LI "</start>
-<end>"^</end>
-</rule>
-
-<rule>
-<match>
-<gi>CITE
-<action>
-<start>^.\[
-${ID}
-.\]^</start>
-</rule>
-
-<rule>
-<match>
-<gi>NCITE
-<action>
-<start>^.\[
-${ID}
-.\]
-(${NOTE})</start>
-</rule>
-
-<rule>
-<match>
-<gi>FOOTNOTE
-<action>
-<start>\*F
-.FS^</start>
-<end>^.FE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>SQ
-<action>
-<start>\*Q</start>
-<end>\*U</end>
-</rule>
-
-<rule>
-<match>
-<gi>LQ
-<action>
-<start>^.if t .br
-.if t .S -2
-.DS I F^</start>
-<end>^.DE
-.if t .S D^</end>
-</rule>
-
-<rule>
-<match>
-<gi>EM
-<action>
-<start>\fI</start>
-<end>\fR</end>
-</rule>
-
-<rule>
-<match>
-<gi>BF
-<action>
-<start>\fB</start>
-<end>\fR</end>
-</rule>
-
-<rule>
-<match>
-<gi>IT
-<action>
-<start>\fI</start>
-<end>\fR</end>
-</rule>
-
-<rule>
-<match>
-<gi>SF
-<action>
-<start>\fR</start>
-<end>\fR</end>
-</rule>
-
-<rule>
-<match>
-<gi>SL
-<action>
-<start>\fI</start>
-<end>\fR</end>
-</rule>
-
-<rule>
-<match>
-<gi>TT
-<action>
-<start>\fC</start>
-<end>\fR</end>
-</rule>
-
-<rule>
-<match>
-<gi>CPARAM
-<action>
-<start>\fI<</start>
-<end>>\fR</end>
-</rule>
-
-<!-- A URL with a NAME attribute -->
-<rule>
-<match>
-<gi>URL
-<attval>NAME .
-<action>
-<start>${NAME}\*F
-.FS
-\fC&lt;URL:${URL}&gt;\fP
-.FE
-\&</start>
-</rule>
-
-<!-- A URL without a NAME attribute -->
-<rule>
-<match>
-<gi>URL
-<action>
-<start>\fC&lt;URL:${URL}&gt;\fP</start>
-</rule>
-
-<rule>
-<match>
-<gi>HTMLURL
-<action>
-<start>${NAME}</start>
-</rule>
-
-<rule>
-<match>
-<gi>REF
-<attval>NAME .
-<action>
-<start>\fI${NAME}\fP (section\~
-.GETHN "${ID}"
-, page\~
-.GETPN "${ID}"
-)</start>
-</rule>
-
-<rule>
-<match>
-<gi>REF
-<action>
-<start>\fI${ID}\fP (section\~
-.GETHN "${ID}"
-, page\~
-.GETPN "${ID}"
-)</start>
-</rule>
-
-<rule>
-<match>
-<gi>PAGEREF
-<action>
-<start>^.GETPN "${ID}"
-\&</start>
-</rule>
-
-<rule>
-<match>
-<gi>X
-</rule>
-
-<rule>
-<match>
-<gi>MC
-</rule>
-
-<rule>
-<match>
-<gi>BIBLIO
-<action>
-<start>^.\[
-\$LIST\$
-.\]^</start>
-</rule>
-
-<rule>
-<match>
-<gi>VERB CODE
-<action>
-<start>^.if t .br
-.if t .S -2
-.DS I
-.fam C^</start>
-<end>^.DE
-.if t .S D^</end>
-</rule>
-
-<rule>
-<match>
-<gi>TSCREEN
-<relation>child VERB
-</rule>
-
-<rule>
-<match>
-<gi>TSCREEN
-<action>
-<start>^.if t .br
-.if t .S -2
-.DS I
-.fam C^</start>
-<end>^.DE
-.if t .S D^</end>
-</rule>
-
-<rule>
-<match>
-<gi>QUOTE
-<action>
-<start>^.DS I F^</start>
-<end>^.DE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>DEF
-<action>
-<start>^.sp
-.nr def \n\[def\]+1
-.B "Definition \n\[def\] "^</start>
-<end>^.ft P
-.sp^</end>
-</rule>
-
-<rule>
-<match>
-<gi>PROP
-<action>
-<start>^.sp
-.nr prop \n\[prop\]+1
-.B "Proposition \n\[prop\] "^</start>
-<end>^.ft P
-.sp^</end>
-</rule>
-
-<rule>
-<match>
-<gi>LEMMA
-<action>
-<start>^.sp
-.nr lemma \n\[lemma\]+1
-.B "Lemma \n\[lemma\] "^</start>
-<end>^.ft P
-.sp^</end>
-</rule>
-
-<rule>
-<match>
-<gi>COROLL
-<action>
-<start>^.sp
-.nr coroll \n\[coroll\]+1
-.B "Corolloary \n\[coroll\] "^</start>
-<end>^.ft P
-.sp^</end>
-</rule>
-
-<rule>
-<match>
-<gi>PROOF
-<action>
-<start>^.sp
-.nr proof \n\[proof\]+1
-.B "Proof \n\[proof\] "^</start>
-<end>^.ft P
-.sp^</end>
-</rule>
-
-<rule>
-<match>
-<gi>THEOREM
-<action>
-<start>^.sp
-.nr theorem \n\[theorem\]+1
-.B "Theorem \n\[theorem\] "^</start>
-<end>^.ft P
-.sp^</end>
-</rule>
-
-<rule>
-<match>
-<gi>THTAG
-<action>
-<start>^.B
-(</start>
-<end>)
-.I^</end>
-</rule>
-
-<rule>
-<match>
-<gi>F
-</rule>
-
-<rule>
-<match>
-<gi>DM
-<action>
-<start>^.DS L^</start>
-<end>^.DE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>EQ
-<action>
-<start>^.DS L^</start>
-<end>^.DE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>FR
-</rule>
-
-<rule>
-<match>
-<gi>NU
-<action>
-<start>{</start>
-<end>} over </end>
-</rule>
-
-<rule>
-<match>
-<gi>DE
-<action>
-<start>{</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>LIM
-</rule>
-
-<rule>
-<match>
-<gi>OP
-</rule>
-
-<rule>
-<match>
-<gi>LL
-<action>
-<start>from {</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>UL
-<action>
-<start>to {</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>OPD
-</rule>
-
-<rule>
-<match>
-<gi>PR
-<action>
-<start> prod </start>
-</rule>
-
-<rule>
-<match>
-<gi>IN
-<action>
-<start> int </start>
-</rule>
-
-<rule>
-<match>
-<gi>SUM
-<action>
-<start> sum </start>
-</rule>
-
-<rule>
-<match>
-<gi>ROOT
-<action>
-<start> sqrt {</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>AR
-<action>
-<start>^.TS
-center, tab(|) ;
-${CA}.^</start>
-<end>^.TE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>ARR
-</rule>
-
-<rule>
-<match>
-<gi>ARC
-<action>
-<start>|</start>
-</rule>
-
-<rule>
-<match>
-<gi>SUP
-<action>
-<start> sup {</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>INF
-<action>
-<start> sub {</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>UNL
-<action>
-<start>{</start>
-<end>} under </end>
-</rule>
-
-<rule>
-<match>
-<gi>OVL
-<action>
-<start>{</start>
-<end>} bar </end>
-</rule>
-
-<rule>
-<match>
-<gi>RF
-<action>
-<start> bold{</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>V
-<action>
-<start>{</start>
-<end>} vec </end>
-</rule>
-
-<rule>
-<match>
-<gi>FI
-<action>
-<start>\fI</start>
-<end>\fR</end>
-</rule>
-
-<rule>
-<match>
-<gi>PHR
-<action>
-<start> roman }</start>
-<end>}</end>
-</rule>
-
-<rule>
-<match>
-<gi>TU
-<action>
-<start>^.br^</start>
-</rule>
-
-<rule>
-<match>
-<gi>FIGURE
-</rule>
-
-<rule>
-<match>
-<gi>EPS
-<action>
-<start>^.if t .PSPIC ${FILE}
-.if n .sp 4^</start>
-</rule>
-
-<rule>
-<match>
-<gi>PH
-<action>
-<start>^.sp ${VSPACE}^</start>
-</rule>
-
-<rule>
-<match>
-<gi>CAPTION
-<action>
-<start>^.sp
-.ce^</start>
-</rule>
-
-<rule>
-<match>
-<gi>TABLE
-<action>
-<start>^.DF
-.R^</start>
-<end>^.DE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>TABULAR
-<action>
-<start>^.TS
-center, tab(|) ;
-${CA}.^</start>
-<end>^.TE^</end>
-</rule>
-
-<rule>
-<match>
-<gi>ROWSEP
-<action>
-<start>^</start>
-</rule>
-
-<rule>
-<match>
-<gi>COLSEP
-<action>
-<start>|</start>
-</rule>
-
-<rule>
-<match>
-<gi>HLINE
-<action>
-<start>^_^</start>
-</rule>
-
-<rule>
-<match>
-<gi>SLIDES
-<action>
-<start>^.nr PS 18^</start>
-</rule>
-
-<rule>
-<match>
-<gi>SLIDE
-<action>
-<end>^.bp
-\&^</end>
-</rule>
-
-<rule>
-<match>
-<gi>LETTER
-<action>
-<start>^.nf^</start>
-<end>^</end>
-</rule>
-
-<rule>
-<match>
-<gi>FROM
-<action>
-<start>^From: </start>
-</rule>
-
-<rule>
-<match>
-<gi>TO
-<action>
-<start>^To: </start>
-</rule>
-
-<rule>
-<match>
-<gi>ADDRESS
-<action>
-<start>^.de Ad</start>
-<end>^..^</end>
-</rule>
-
-<rule>
-<match>
-<gi>EMAIL
-<action>
-<start><</start>
-<end>></end>
-</rule>
-
-<rule>
-<match>
-<gi>SUBJECT
-<action>
-<start>^Subject: </start>
-</rule>
-
-<rule>
-<match>
-<gi>SREF
-<action>
-<start>^Sref: </start>
-</rule>
-
-<rule>
-<match>
-<gi>RREF
-<action>
-<start>^In-Reply-To: </start>
-</rule>
-
-<rule>
-<match>
-<gi>CC
-<action>
-<start>^cc: </start>
-</rule>
-
-<rule>
-<match>
-<gi>OPENING
-<action>
-<start>^.fi
-.LP^</start>
-</rule>
-
-<rule>
-<match>
-<gi>CLOSING
-<action>
-<start>^.LP^</start>
-</rule>
-
-<rule>
-<match>
-<gi>ENCL
-<action>
-<start>^.XP
-encl: </start>
-</rule>
-
-<rule>
-<match>
-<gi>PS
-<action>
-<start>^.LP
-p.s.</start>
-</rule>
-
-<!-- Pass the content through -->
-<rule id="&r.pass">
-<match>
-<gi>_pass-text
-</rule>
-
-<rule id="&r.passw">
-<match>
-<gi>_pass-word
-<action>
-<replace>${each_C} </replace>
-</rule>
-
-</transpec>
diff --git a/share/sgml/transpec/roff.cmap b/share/sgml/transpec/roff.cmap
deleted file mode 100644
index 92fa91a..0000000
--- a/share/sgml/transpec/roff.cmap
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
-
- $Id$
-
- Copyright (C) 1996
- John R. Fieber. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY JOHN R. FIEBER AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL JOHN R. FIEBER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
--->
-
-<!-- Character mapping for groff. -->
-
-<map from="\" to="\\">
-<map from="^" to="\(ha">
-<map from="." to="\&.">
-<map from="'" to="\N'39'">
-<map from='"' to="\N'34'">
diff --git a/share/sgml/transpec/roff.sdata b/share/sgml/transpec/roff.sdata
deleted file mode 100644
index e6f89cc..0000000
--- a/share/sgml/transpec/roff.sdata
+++ /dev/null
@@ -1,623 +0,0 @@
-<!--
-
- $Id$
-
- Copyright (C) 1996
- Chuck Robey. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY CHUCK ROBEY AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL CHUCK ROBEY OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
--->
-
-<!--
-
-ISO SDATA entity translations for groff.
-
--->
-
-<!-- Numeric and Special Graphic -->
-
-<map from="[half ]" to="\(12">
-<map from="[frac12]" to="\(12">
-<map from="[frac14]" to="\(14">
-<map from="[frac34]" to="\(34">
-<map from="[frac18]" to="1/8">
-<map from="[frac38]" to="3/8">
-<map from="[frac58]" to="5/8">
-<map from="[frac78]" to="7/8">
-<map from="[sup1 ]" to="\(S1">
-<map from="[sup2 ]" to="\(S2">
-<map from="[sup3 ]" to="\(S3">
-<map from="[plus ]" to="\N'43'">
-<map from="[plusmn]" to="\(+-">
-<map from="[lt ]" to="<">
-<map from="[equals]" to="=">
-<map from="[gt ]" to=">">
-<map from="[divide]" to="\(di">
-<map from="[times ]" to="\N'215'">
-<map from="[curren]" to="\(Cs">
-<map from="[pound ]" to="\(Po">
-<map from="[dollar]" to="\N'36'">
-<map from="[cent ]" to="\(ct">
-<map from="[yen ]" to="\(Ye">
-<map from="[num ]" to="#">
-<map from="[percnt]" to="%">
-<map from="[amp ]" to="&">
-<map from="[ast ]" to="*">
-<map from="[commat]" to="@">
-<map from="[lsqb ]" to="\(lB">
-<map from="[bsol ]" to="\(rs">
-<map from="[rsqb ]" to="\(rB">
-<map from="[lcub ]" to="\(rC">
-<map from="[horbar]" to="\(em">
-<map from="[verbar]" to="\(bv">
-<map from="[rcub ]" to="\(rC">
-<map from="[micro ]" to="\N'181'">
-<map from="[ohm ]" to="\(*W">
-<map from="[deg ]" to="\N'176'">
-<map from="[ordm ]" to="\(Om">
-<map from="[ordf ]" to="\(Of">
-<map from="[sect ]" to="\N'167'">
-<map from="[para ]" to="\(ps">
-<map from="[middot]" to="\(md">
-<map from="[larr ]" to="\(<-">
-<map from="[rarr ]" to="\(->">
-<map from="[uarr ]" to="\(ua">
-<map from="[darr ]" to="\(da">
-<map from="[copy ]" to="\(co">
-<map from="[reg ]" to="\(rg">
-<map from="[trade ]" to="\(tm">
-<map from="[brvbar]" to="\N'166'">
-<map from="[not ]" to="\N'172'">
-<!-- <map from="[sung ]" to=""> --> <!-- =music note (sung text sign) -->
-<map from="[excl ]" to="\N'33'">
-<map from="[iexcl ]" to="\(r!">
-<map from="[quot ]" to="\N'39'">
-<map from="[apos ]" to="\N'39'">
-<map from="[lpar ]" to="\N'40'">
-<map from="[rpar ]" to="\N'41'">
-<map from="[comma ]" to="\(bq">
-<map from="[lowbar]" to="\(ru">
-<map from="[hyphen]" to="\(en">
-<map from="[period]" to="\N'46'">
-<map from="[sol ]" to="\(sl">
-<map from="[colon ]" to="\N'58'">
-<map from="[semi ]" to="\N'59'">
-<map from="[quest ]" to="\N'63'">
-<map from="[iquest]" to="\(r?">
-<map from="[laquo ]" to="\(Fo">
-<map from="[raquo ]" to="\(Fc">
-<map from="[lsquo ]" to="\(oq">
-<map from="[rsquo ]" to="\N'39'">
-<map from="[ldquo ]" to="\(lq">
-<map from="[rdquo ]" to="\(rq">
-<map from="[nbsp ]" to="\ ">
-<map from="[shy ]" to="\(hy">
-
-<!-- Publishing -->
-
-<map from="[emsp ]" to="\~">
-<map from="[ensp ]" to="\~">
-<map from="[emsp3 ]" to="\~">
-<map from="[emsp4 ]" to="\~">
-<map from="[numsp ]" to="\0">
-<map from="[puncsp]" to="\|">
-<map from="[thinsp]" to="\!">
-<map from="[hairsp]" to="\\^">
-<map from="[mdash ]" to="\(em">
-<map from="[ndash ]" to="\(en">
-<map from="[dash ]" to="\-">
-<map from="[blank ]" to="\ ">
-<map from="[hellip]" to="\&...">
-<map from="[nldr ]" to="\&..">
-<map from="[frac13]" to="1/3">
-<map from="[frac23]" to="2/3">
-<map from="[frac15]" to="1/5">
-<map from="[frac25]" to="2/5">
-<map from="[frac35]" to="3/5">
-<map from="[frac45]" to="4/5">
-<map from="[frac16]" to="1/6">
-<map from="[frac56]" to="5/6">
-<!--
-<map from="[incare]" to="=in-care-of symbol">
-<map from="[block ]" to="=full block">
-<map from="[uhblk ]" to="=upper half block">
-<map from="[lhblk ]" to="=lower half block">
-<map from="[blk14 ]" to="=25% shaded block">
-<map from="[blk12 ]" to="=50% shaded block">
-<map from="[blk34 ]" to="=75% shaded block">
-<map from="[marker]" to="=histogram marker">
--->
-<map from="[cir ]" to="\(ci">
-<map from="[squ ]" to="\(sq">
-<!--
-<map from="[rect ]" to="=rectangle, open">
-<map from="[utri ]" to="/triangle =up triangle, open">
-<map from="[dtri ]" to="/triangledown =down triangle, open">
--->
-<map from="[star ]" to="\(**">
-<map from="[bull ]" to="\(bu">
-<!--
-<map from="[squf ]" to="/blacksquare =sq bullet, filled">
-<map from="[utrif ]" to="/blacktriangle =up tri, filled">
-<map from="[dtrif ]" to="/blacktriangledown =dn tri, filled">
-<map from="[ltrif ]" to="/blacktriangleleft R: =l tri, filled">
-<map from="[rtrif ]" to="/blacktriangleright R: =r tri, filled">
--->
-<map from="[clubs ]" to="\(CL">
-<map from="[diams ]" to="\(DI">
-<map from="[hearts]" to="\(HE">
-<map from="[spades]" to="\(SP">
-<!--
-<map from="[malt ]" to="/maltese =maltese cross">
--->
-<map from="[dagger]" to="\(dg">
-<map from="[Dagger]" to="\(dd">
-<map from="[check ]" to="\(OK">
-<!--
-<map from="[ballot]" to="=ballot cross">
-<map from="[sharp ]" to="/sharp =musical sharp">
-<map from="[flat ]" to="/flat =musical flat">
-<map from="[male ]" to="=male symbol">
-<map from="[female]" to="=female symbol">
-<map from="[phone ]" to="=telephone symbol">
-<map from="[telrec]" to="=telephone recorder symbol">
-<map from="[copysr]" to="=sound recording copyright sign">
--->
-<map from="[caret ]" to="\^">
-<map from="[lsquor]" to="\N'44'">
-<map from="[ldquor]" to="\(Bq">
-<map from="[fflig ]" to="\(ff">
-<map from="[filig ]" to="\(fi">
-<!--
-<map from="[fjlig ]" to="small fj ligature">
--->
-<map from="[ffilig]" to="\(Fi">
-<map from="[ffllig]" to="\(Fl">
-<map from="[fllig ]" to="\(fl">
-<!--
-<map from="[mldr ]" to="em leader">
--->
-<map from="[rdquor]" to="\(lq">
-<map from="[rsquor]" to="\(oq">
-<!--
-<map from="[vellip]" to="vertical ellipsis">
-<map from="[hybull]" to="rectangle, filled (hyphen bullet)">
--->
-<map from="[loz ]" to="/(lz">
-<!--
-<map from="[lozf ]" to="/blacklozenge - lozenge, filled">
-<map from="[ltri ]" to="/triangleleft B: l triangle, open">
-<map from="[rtri ]" to="/triangleright B: r triangle, open">
-<map from="[starf ]" to="/bigstar - star, filled">
-<map from="[natur ]" to="/natural - music natural">
-<map from="[rx ]" to="pharmaceutical prescription (Rx)">
-<map from="[sext ]" to="sextile (6-pointed star)">
-<map from="[target]" to="register mark or target">
-<map from="[dlcrop]" to="downward left crop mark">
-<map from="[drcrop]" to="downward right crop mark">
-<map from="[ulcrop]" to="upward left crop mark">
-<map from="[urcrop]" to="upward right crop mark">
--->
-
-<!-- Added Latin 1 -->
-
-<map from="[aacute]" to="\('a">
-<map from="[Aacute]" to="\('A">
-<map from="[acirc ]" to="\(^a">
-<map from="[Acirc ]" to="\(^A">
-<map from="[agrave]" to="\(`a">
-<map from="[Agrave]" to="\(`A">
-<map from="[aring ]" to="\(oa">
-<map from="[Aring ]" to="\(oA">
-<map from="[atilde]" to="\(~a">
-<map from="[Atilde]" to="\(~A">
-<map from="[auml ]" to="\(:a">
-<map from="[Auml ]" to="\(:A">
-<map from="[aelig ]" to="\(ae">
-<map from="[AElig ]" to="\(AE">
-<map from="[ccedil]" to="\(,c">
-<map from="[Ccedil]" to="\(,C">
-<map from="[eth ]" to="\(Sd">
-<map from="[ETH ]" to="\(-D">
-<map from="[eacute]" to="\('e">
-<map from="[Eacute]" to="\('E">
-<map from="[ecirc ]" to="\(^e">
-<map from="[Ecirc ]" to="\(^E">
-<map from="[egrave]" to="\(`e">
-<map from="[Egrave]" to="\(`E">
-<map from="[euml ]" to="\(:e">
-<map from="[Euml ]" to="\(:E">
-<map from="[iacute]" to="\('i">
-<map from="[Iacute]" to="\('I">
-<map from="[icirc ]" to="\(^i">
-<map from="[Icirc ]" to="\(^I">
-<map from="[igrave]" to="\(`i">
-<map from="[Igrave]" to="\(`I">
-<map from="[iuml ]" to="\(:i">
-<map from="[Iuml ]" to="\(:I">
-<map from="[ntilde]" to="\(~n">
-<map from="[Ntilde]" to="\(~N">
-<map from="[oacute]" to="\('o">
-<map from="[Oacute]" to="\('O">
-<map from="[ocirc ]" to="\(^o">
-<map from="[Ocirc ]" to="\(^O">
-<map from="[ograve]" to="\(`o">
-<map from="[Ograve]" to="\(`O">
-<map from="[oslash]" to="\(/o">
-<map from="[Oslash]" to="\(/O">
-<map from="[otilde]" to="\(~o">
-<map from="[Otilde]" to="\(~O">
-<map from="[ouml ]" to="\(:o">
-<map from="[Ouml ]" to="\(:O">
-<map from="[szlig ]" to="\(ss">
-<map from="[thorn ]" to="\(Tp">
-<map from="[THORN ]" to="\(TP">
-<map from="[uacute]" to="\('u">
-<map from="[Uacute]" to="\('U">
-<map from="[ucirc ]" to="\(^u">
-<map from="[Ucirc ]" to="\(^U">
-<map from="[ugrave]" to="\(`u">
-<map from="[Ugrave]" to="\(`U">
-<map from="[uuml ]" to="\(:u">
-<map from="[Uuml ]" to="\(:U">
-<map from="[yacute]" to="\('y">
-<map from="[Yacute]" to="\('Y">
-<map from="[yuml ]" to="\(:y">
-<map from="[Yuml ]" to="\(:Y">
-
-<!-- Added Latin 2 -->
-
-<map from="[abreve]" to="\o'a\(ab'">
-<map from="[Abreve]" to="\o'A\s+3\(ab\s-3'">
-<map from="[amacr ]" to="\o'a\(a-'">
-<map from="[Amacr ]" to="\o'A\s+3\(a-\s-3'">
-<map from="[aogon ]" to="\o'a\N'184''">
-<map from="[Aogon ]" to="\o'A\N'184''">
-<map from="[cacute]" to="\o'c\(aa'">
-<map from="[Cacute]" to="\o'C\s+3\(aa\s-3'">
-<map from="[ccaron]" to="\o'c\(ah'">
-<map from="[Ccaron]" to="\o'C\s+3\(ah\s-3'">
-<map from="[ccirc ]" to="\o'c\(a^'">
-<map from="[Ccirc ]" to="\o'C\s+3\(a^\s-3'">
-<map from="[cdot ]" to="\o'c\(a.'">
-<map from="[Cdot ]" to="\o'C\s+3\(a.\s-3'">
-<map from="[dcaron]" to="\o'd\(ah'">
-<map from="[Dcaron]" to="\o'D\s+3\(ah\s-3'">
-<map from="[dstrok]" to="d\h'-3p'\(hy">
-<map from="[Dstrok]" to="\(-D">
-<map from="[ecaron]" to="\o'e\(ah'">
-<map from="[Ecaron]" to="\o'E\s+3\(ah\s-3'">
-<map from="[edot ]" to="\o'e\(a.'">
-<map from="[Edot ]" to="\o'E\s+3\(a.\s-3'">
-<map from="[emacr ]" to="\o'e\(a-'">
-<map from="[Emacr ]" to="\o'E\s+3\(a-\s-3'">
-<map from="[eogon ]" to="\o'e\N'184''">
-<map from="[Eogon ]" to="\o'E\N'184''">
-<map from="[gacute]" to="\o'g\(aa'">
-<map from="[gbreve]" to="\o'g\(ab'">
-<map from="[Gbreve]" to="\o'G\s+3\(ab\s-3'">
-<map from="[Gcedil]" to="\o'G\s+3\(ac\s-3'">
-<map from="[gcirc ]" to="\o'g\(a^'">
-<map from="[Gcirc ]" to="\o'G\s+3\(a^\s-3'">
-<map from="[gdot ]" to="\o'g\(a.'">
-<map from="[Gdot ]" to="\o'G\s+3\(a.\s-3'">
-<map from="[hcirc ]" to="\s-1\zh\s+3\(a^\s-2">
-<map from="[Hcirc ]" to="\o'\s-1H\s+4\(a^\s-3'">
-<map from="[hstrok]" to="\o'h\(a-'">
-<map from="[Hstrok]" to="\o'H\s-2\(a-\s+2'">
-<map from="[Idot ]" to="\o'I\s+3\(a.\s-3'">
-<map from="[Imacr ]" to="\o'I\s+3\(a-\s-3'">
-<map from="[imacr ]" to="\o'i\(a-'">
-<map from="[ijlig ]" to="\(ij">
-<map from="[IJlig ]" to="\(IJ">
-<map from="[inodot]" to="\(.i">
-<map from="[iogon ]" to="\o'i\N'184''">
-<map from="[Iogon ]" to="\o'I\N'184''">
-<map from="[itilde]" to="\o'i\(a~'">
-<map from="[Itilde]" to="\o'I\s+3\(a~\s-3'">
-<map from="[jcirc ]" to="\o'j\(a^'">
-<map from="[Jcirc ]" to="\o'J\s+3\(a^\s-3'">
-<map from="[kcedil]" to="\o'k\(ac'">
-<map from="[Kcedil]" to="\o'K\(ac'">
-<map from="[kgreen]" to="\s-3\(*K\s+3">
-<map from="[lacute]" to="\o'l\s+3\(aa\s-3'">
-<map from="[Lacute]" to="\o'L\s+3\(aa\s-3'">
-<map from="[lcaron]" to="\o'l\s+3\(ah\s-3'">
-<map from="[Lcaron]" to="\o'L\s+3\(ah\s-3'">
-<map from="[lcedil]" to="\o'l\(ac'">
-<map from="[Lcedil]" to="\o'L\(ac'">
-<map from="[lmidot]" to="\zl\h'2p'\(md">
-<map from="[Lmidot]" to="\o'L\(md'">
-<map from="[lstrok]" to="\(/l">
-<map from="[Lstrok]" to="\(/L">
-<map from="[nacute]" to="\o'n\(aa'">
-<map from="[Nacute]" to="\o'N\s+3\(aa\s-3'">
-<!--
-<map from="[eng ]" to="=small eng, Lapp">
-<map from="[ENG ]" to="=capital ENG, Lapp">
--->
-<map from="[napos ]" to="n'">
-<map from="[ncaron]" to="\o'n\(ah'">
-<map from="[Ncaron]" to="\o'N\s+3\(ah\s-3'">
-<map from="[ncedil]" to="\o'n\(ac'">
-<map from="[Ncedil]" to="\o'N\(ac'">
-<map from="[odblac]" to="\o'o\(a&#34;'">
-<map from="[Odblac]" to="\o'O\s+3\(a&#34;\s-3'">
-<map from="[Omacr ]" to="\o'O\s+3\(a-\s-3'">
-<map from="[omacr ]" to="\o'o\(a-'">
-<map from="[oelig ]" to="\(oe">
-<map from="[OElig ]" to="\(OE">
-<map from="[racute]" to="\o'r\(aa'">
-<map from="[Racute]" to="\o'R\s+3\(aa\s-3'">
-<map from="[rcaron]" to="\o'r\(ah'">
-<map from="[Rcaron]" to="\o'R\s+3\(ah\s-3'">
-<map from="[rcedil]" to="\o'r\(ac'">
-<map from="[Rcedil]" to="\o'R\(ac'">
-<map from="[sacute]" to="\o's\(aa'">
-<map from="[Sacute]" to="\o'S\s+3\(aa\s-3'">
-<map from="[scaron]" to="\o's\(ah'">
-<map from="[Scaron]" to="\o'S\s+3\(ah\s-3'">
-<map from="[scedil]" to="\o's\(ac'">
-<map from="[Scedil]" to="\o'S\(ac'">
-<map from="[scirc ]" to="\o's\(a^'">
-<map from="[Scirc ]" to="\o'S\s+3\(a^\s-3'">
-<map from="[tcaron]" to="\o't\(ah'">
-<map from="[Tcaron]" to="\o'T\s+3\(ah\s-3'">
-<map from="[tcedil]" to="\o't\(ac'">
-<map from="[Tcedil]" to="\o'T\(ac'">
-<map from="[tstrok]" to="\o't\(hy'">
-<map from="[Tstrok]" to="\o'T\(hy'">
-<map from="[ubreve]" to="\o'u\(ab">
-<map from="[Ubreve]" to="\o'U\s+3\(ab\s-3'">
-<map from="[udblac]" to="\o'u\(a&#34;'">
-<map from="[Udblac]" to="\o'U\s+3\(a&#34;\s-3'">
-<map from="[umacr ]" to="\o'u\(a-'">
-<map from="[Umacr ]" to="\o'U\s+3\(a-\s-3'">
-<map from="[uogon ]" to="\o'u\N'184''">
-<map from="[Uogon ]" to="\o'U\N'184''">
-<map from="[uring ]" to="\o'u\(ao'">
-<map from="[Uring ]" to="\o'U\s+3\(ao\s-3'">
-<map from="[utilde]" to="\o'u\(a~'">
-<map from="[Utilde]" to="\o'U\s+3\(a~\s-3'">
-<map from="[wcirc ]" to="\o'w\(a^'">
-<map from="[Wcirc ]" to="\o'W\s+3\(a^\s-3'">
-<map from="[ycirc ]" to="\o'y\(a^'">
-<map from="[Ycirc ]" to="\o'Y\s+3\(a^\s-3'">
-<map from="[Yuml ]" to="\o'Y\s+3\(ad\s-3'">
-<map from="[zacute]" to="\o'z\(aa'">
-<map from="[Zacute]" to="\o'Z\s+3\(aa\s-3'">
-<map from="[zcaron]" to="\o'z\(ah'">
-<map from="[Zcaron]" to="\o'Z\s+3\(ah\s-3'">
-<map from="[zdot ]" to="\o'z\(a.'">
-<map from="[Zdot ]" to="\o'Z\s+3\(a.\s-3'">
-
-<!-- Greek Letters -->
-
-<map from="[agr ]" to="\(*a">
-<map from="[Agr ]" to="\(*A">
-<map from="[bgr ]" to="\(*b">
-<map from="[Bgr ]" to="\(*B">
-<map from="[ggr ]" to="\(*g">
-<map from="[Ggr ]" to="\(*G">
-<map from="[dgr ]" to="\(*d">
-<map from="[Dgr ]" to="\(*D">
-<map from="[egr ]" to="\(*e">
-<map from="[Egr ]" to="\(*E">
-<map from="[zgr ]" to="\(*z">
-<map from="[Zgr ]" to="\(*Z">
-<map from="[eegr ]" to="\(*y">
-<map from="[EEgr ]" to="\(*Y">
-<map from="[thgr ]" to="\(*h">
-<map from="[THgr ]" to="\(*H">
-<map from="[igr ]" to="\(*i">
-<map from="[Igr ]" to="\(*I">
-<map from="[kgr ]" to="\(*k">
-<map from="[Kgr ]" to="\(*K">
-<map from="[lgr ]" to="\(*l">
-<map from="[Lgr ]" to="\(*L">
-<map from="[mgr ]" to="\(*m">
-<map from="[Mgr ]" to="\(*M">
-<map from="[ngr ]" to="\(*n">
-<map from="[Ngr ]" to="\(*N">
-<map from="[xgr ]" to="\(*c">
-<map from="[Xgr ]" to="\(*C">
-<map from="[ogr ]" to="\(*o">
-<map from="[Ogr ]" to="\(*O">
-<map from="[pgr ]" to="\(*p">
-<map from="[Pgr ]" to="\(*P">
-<map from="[rgr ]" to="\(*r">
-<map from="[Rgr ]" to="\(*R">
-<map from="[sgr ]" to="\(*s">
-<map from="[Sgr ]" to="\(*S">
-<map from="[sfgr ]" to="\(ts">
-<map from="[tgr ]" to="\(*t">
-<map from="[Tgr ]" to="\(*T">
-<map from="[ugr ]" to="\(*u">
-<map from="[Ugr ]" to="\(*U">
-<map from="[phgr ]" to="\(*f">
-<map from="[PHgr ]" to="\(*F">
-<map from="[khgr ]" to="\(*x">
-<map from="[KHgr ]" to="\(*X">
-<map from="[psgr ]" to="\(*q">
-<map from="[PSgr ]" to="\(*Q">
-<map from="[ohgr ]" to="\(*w">
-<map from="[OHgr ]" to="\(*W">
-
-<!-- Greek Symbols -->
-
-<map from="[alpha ]" to="\(*a">
-<map from="[beta ]" to="\(*b">
-<map from="[gamma ]" to="\(*g">
-<map from="[Gamma ]" to="\(*G">
-<!--
-<map from="[gammad]" to="/digamma">
--->
-<map from="[delta ]" to="\(*d">
-<map from="[Delta ]" to="\(*D">
-<map from="[epsi ]" to="\(*e">
-<!--
-<map from="[epsiv ]" to="/varepsilon">
--->
-<map from="[epsis ]" to="\(*e">
-<map from="[zeta ]" to="\(*z">
-<map from="[eta ]" to="\(*y">
-<map from="[thetas]" to="\(*h">
-<map from="[Theta ]" to="\(*H">
-<map from="[thetav]" to="\(+h">
-<map from="[iota ]" to="\(*i">
-<map from="[kappa ]" to="\(*k">
-<!--
-<map from="[kappav]" to="/varkappa">
--->
-<map from="[lambda]" to="\(*l">
-<map from="[Lambda]" to="\(*L">
-<map from="[mu ]" to="\(*m">
-<map from="[nu ]" to="\(*n">
-<map from="[xi ]" to="\(*c">
-<map from="[Xi ]" to="\(*C">
-<map from="[pi ]" to="\(*p">
-<!--
-<map from="[piv ]" to="\[+p]">
--->
-<map from="[Pi ]" to="\(*P">
-<map from="[rho ]" to="\(*r">
-<!--
-<map from="[rhov ]" to="/varrho">
--->
-<map from="[sigma ]" to="\(*s">
-<map from="[Sigma ]" to="\(*S">
-<map from="[sigmav]" to="\(ts">
-<map from="[tau ]" to="\(*t">
-<map from="[upsi ]" to="\(*u">
-<map from="[Upsi ]" to="\(*U">
-<map from="[phis ]" to="\(*f">
-<map from="[Phi ]" to="\(*F">
-<map from="[phiv ]" to="\(+f">
-<map from="[chi ]" to="\(*x">
-<map from="[psi ]" to="\(*q">
-<map from="[Psi ]" to="\(*X">
-<map from="[omega ]" to="\(*w">
-<map from="[Omega ]" to="\(*W">
-
-<!-- General Technical -->
-
-<map from="[aleph ]" to="\[Ah]">
-<map from="[and ]" to="\[AN]">
-<!--
-<map from="[ang90 ]" to="=right (90 degree) angle">
-<map from="[angsph]" to="/sphericalangle =angle-spherical">
--->
-<map from="[ap ]" to="\(ap">
-<!--
-<map from="[becaus]" to="/because R: =because">
-<map from="[bottom]" to="/bot B: =perpendicular">
--->
-<map from="[cap ]" to="\(ca">
-<map from="[cong ]" to="\(=~">
-<!--
-<map from="[conint]" to="/oint L: =contour integral operator">
--->
-<map from="[cup ]" to="\(cu">
-<map from="[equiv ]" to="\(==">
-<map from="[exist ]" to="\(te">
-<map from="[forall]" to="\[fa]">
-<!--
-<map from="[fnof ]" to="=function of (italic small f)">
--->
-<map from="[ge ]" to="\(>=">
-<map from="[iff ]" to="\[hA]">
-<map from="[infin ]" to="\(if">
-<!--
-<map from="[int ]" to="/int L: =integral operator">
--->
-<map from="[isin ]" to="\(mo">
-<map from="[lang ]" to="\[la]">
-<map from="[lArr ]" to="\(lA">
-<map from="[le ]" to="\(<=">
-<map from="[minus ]" to="\(mi">
-<!--
-<map from="[mnplus]" to="/mp B: =minus-or-plus sign">
--->
-<map from="[nabla ]" to="\(gr">
-<map from="[ne ]" to="\(!=">
-<map from="[ni ]" to="\(st">
-<map from="[or ]" to="\(OR">
-<map from="[par ]" to="\(ba\(ba">
-<!--
-<map from="[part ]" to="\(pd">
-<map from="[permil]" to="=per thousand">
-<map from="[perp ]" to="/perp R: =perpendicular">
-<map from="[prime ]" to="/prime =prime or minute">
-<map from="[Prime ]" to="=double prime or second">
--->
-<map from="[prop ]" to="\(pt">
-<!--
-<map from="[radic ]" to="/surd =radical">
-<map from="[rang ]" to="/rangle C: =right angle bracket">
-<map from="[rArr ]" to="/Rightarrow A: =implies">
-<map from="[sim ]" to="/sim R: =similar">
-<map from="[sime ]" to="/simeq R: =similar, equals">
--->
-<map from="[square]" to="\(sq">
-<map from="[sub ]" to="\(sb">
-<map from="[sube ]" to="\(ib">
-<map from="[sup ]" to="\(sp">
-<map from="[supe ]" to="\(ip">
-<!--
-<map from="[there4]" to="/therefore R: =therefore">
-<map from="[Verbar]" to="/Vert =dbl vertical bar">
-<map from="[angst ]" to="Angstrom =capital A, ring">
-<map from="[bernou]" to="Bernoulli function (script capital B)">
-<map from="[compfn]" to="B: composite function (small circle)">
-<map from="[Dot ]" to="=dieresis or umlaut mark">
-<map from="[DotDot]" to="four dots above">
-<map from="[hamilt]" to="Hamiltonian (script capital H)">
-<map from="[lagran]" to="Lagrangian (script capital L)">
-<map from="[lowast]" to="low asterisk">
-<map from="[notin ]" to="N: negated set membership">
-<map from="[order ]" to="order of (script small o)">
-<map from="[phmmat]" to="physics M-matrix (script capital M)">
-<map from="[tdot ]" to="three dots above">
-<map from="[tprime]" to="triple prime">
-<map from="[wedgeq]" to="R: corresponds to (wedge, equals)">
--->
-
-<!-- Diacritical Marks -->
-
-<map from="[acute ]" to="\&'">
-<map from="[breve ]" to="\(ab">
-<map from="[caron ]" to="\(ah">
-<map from="[cedil ]" to="\(ac">
-<!--
-<map from="#[circ ]" to="\(a^">
--->
-<map from="[circ ]" to="\(ha">
-<map from="[dblac ]" to='\(a"'>
-<map from="[die ]" to="\(ad">
-<map from="[dot ]" to="\(a.">
-<map from="[grave ]" to="`">
-<map from="[macr ]" to="\(a-">
-<map from="[ogon ]" to="\N'184'">
-<map from="[ring ]" to="\(ao">
-<map from="[tilde ]" to="~">
-<map from="[uml ]" to="\(ad">
diff --git a/share/sgml/transpec/transpec.dtd b/share/sgml/transpec/transpec.dtd
deleted file mode 100644
index 4fecae8..0000000
--- a/share/sgml/transpec/transpec.dtd
+++ /dev/null
@@ -1,97 +0,0 @@
-<!--
-
- $Id$
-
- Copyright (C) 1996
- John R. Fieber. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY JOHN R. FIEBER AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL JOHN R. FIEBER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
--->
-
-<!--
-
-This DTD defines the format for instant(1) translation specification
-files. A translation specification contains:
-
- * Character mappings, useful for dealing with characters that
- are magic for the formatter, such as backslash (\) is for
- TeX.
-
- * Sdata mappings. For example, the ISO entity sets define
- special characters as sdata string, &ouml is [ouml ]. These
- sdata strings are marked in the output of the sgml parser
- and the mapping turn them into something useful for the
- formatter.
-
- * A set of translation rules.
-
-See the transpec(5) man page for details.
-
--->
-
-<!ELEMENT transpec - - ((cmap | smap | var)*, rule+)>
-
-<!ELEMENT (cmap, smap) - - (map*)>
-<!ATTLIST (cmap, smap) id ID #IMPLIED>
-
-<!ELEMENT map - o EMPTY>
-<!ATTLIST map from CDATA #REQUIRED
- to CDATA #REQUIRED>
-
-<!ELEMENT var - o (#PCDATA)>
-
-<!--
-A rule consists of an expression to determine if the rule should
-be applied to a given element (match), and the action that should
-be taken if the element matches. Each rule can be named. The
-cmap and smap attributes can specify an alternate to the default
-character and data mapping.
--->
-
-<!ELEMENT rule - o (match, action?)>
-<!ATTLIST rule id CDATA #IMPLIED -- XXX should be ID notCDATA -->
-
-<!ELEMENT match - o (gi | attval | content | context | nthchild
- | pattset | relation | varval | varreval)+>
-<!ELEMENT gi - o (#PCDATA)>
-<!ELEMENT attval - o (#PCDATA)>
-<!ELEMENT content - o (#PCDATA)>
-<!ELEMENT context - o (#PCDATA)>
-<!ELEMENT nthchild - o (#PCDATA)>
-<!ELEMENT pattset - o (#PCDATA)>
-<!ELEMENT relation - o (#PCDATA)>
-<!ELEMENT varval - o (#PCDATA)>
-<!ELEMENT varreval - o (#PCDATA)>
-
-
-<!ELEMENT action - o (do | end | ignore | incr | message | replace
- | quit | set | start)+>
-<!ELEMENT do - o (#PCDATA)>
-<!ELEMENT end - - (#PCDATA)>
-<!ELEMENT ignore - o (#PCDATA)>
-<!ELEMENT incr - o (#PCDATA)>
-<!ELEMENT message - o (#PCDATA)>
-<!ELEMENT replace - - (#PCDATA)>
-<!ELEMENT quit - o (#PCDATA)>
-<!ELEMENT set - o (#PCDATA)>
-<!ELEMENT start - - (#PCDATA)>
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 5f9e8a2..1da7a93 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -1,5 +1,5 @@
# From: @(#)Makefile 8.3 (Berkeley) 1/7/94
-# $Id: Makefile,v 1.85 1997/05/29 15:03:32 wpaul Exp $
+# $Id: Makefile,v 1.86 1997/07/05 14:22:14 peter Exp $
# XXX MISSING: deroff diction graph learn plot
# spell spline struct units xsend
@@ -19,7 +19,7 @@ SUBDIR= apply ar at banner basename biff brandelf cal calendar \
nm nohup opieinfo opiekey opiepasswd pagesize passwd paste pr printenv \
printf quota ranlib rdist renice rev rlogin rpcgen \
rpcinfo rs rsh rup ruptime rusers rwall \
- rwho script sed sgmlfmt sgmls shar showmount size soelim split \
+ rwho script sed shar showmount size soelim split \
strings strip su symorder talk tconv tcopy tee tftp time \
tip tn3270 top touch tput tr true tset tsort tty ul uname \
unexpand unifdef uniq units unvis users uudecode uuencode vacation \
diff --git a/usr.bin/sgmlfmt/Makefile b/usr.bin/sgmlfmt/Makefile
deleted file mode 100644
index 12e52d5..0000000
--- a/usr.bin/sgmlfmt/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id$
-
-MAN1= sgmlfmt.1
-
-afterinstall:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/sgmlfmt.pl ${DESTDIR}${BINDIR}/sgmlfmt
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/sgmlfmt/sgmlfmt.1 b/usr.bin/sgmlfmt/sgmlfmt.1
deleted file mode 100644
index 9b9016e..0000000
--- a/usr.bin/sgmlfmt/sgmlfmt.1
+++ /dev/null
@@ -1,172 +0,0 @@
-.Dd May 9, 1997
-.Os FreeBSD 2.2
-.Dt SGMLFMT 1
-.Sh NAME
-.Nm sgmlfmt
-.Nd Formats linuxdoc and DocBook SGML documents.
-.Sh SYNOPSIS
-.Nm
-.Op Fl d Ar doctype
-.Fl f Ar format
-.Op Fl i Ar name ...
-.Op Fl links
-.Op Fl e Ar encoding
-.Op Fl hdr Ar file
-.Op Fl ftr Ar file
-.Ar file
-.Sh DESCRIPTION
-The
-.Nm
-command reads SGML files tagged according to the linuxdoc or
-DocBook DTD,
-validates them using the
-.Xr sgmls 1
-parser and then converts them to the specified output format.
-Linuxdoc input files must include the following document type
-declaration before any uncommented text:
-.Bd -literal -offset indent
-<!DOCTYPE linuxdoc PUBLIC "-//FreeBSD//DTD linuxdoc//EN">
-.Ed
-.Pp
-Options for
-.Nm
-include the following:
-.Bl -tag -width Ds
-.It Fl d Ar doctype
-Specifies the SGML document type of the source file. Currently
-supported document types are
-.Ar linuxdoc
-and
-.Ar docbook .
-If no
-.Fl d
-option is specified, the default is
-.Ar linuxdoc .
-.It Fl f Ar format
-Determines the output format which can be one of the following:
-.Bl -tag -width Ds
-.It Ar ascii
-Generates a single output file with the extension
-.Pa .ascii
-suitable for viewing on an ASCII terminal.
-.It Ar html
-Generates a set of linked HTML files suitable for use with an
-HTML browser. A top level file,
-.Pa file.html ,
-contains the title, author, date, abstract and brief table of
-contents for the document. A file
-.Pa file_toc.html
-contains a complete table of contents. A series of files named
-.Pa file1.html ,
-.Pa file2.html ...
-.Pa filen.html
-contain the actual text of the document.
-.It Ar koi8-r
-Generates a single output file with the extension
-.Pa .koi8-r
-suitable for viewing on an terminal supporting the KOI8-R
-character encoding.
-.It Ar latin1
-Generates a single output file with the extension
-.Pa .latin1
-suitable for viewing on an terminal supporting the ISO8859-1
-character encoding.
-.It Ar ps
-Generates a single output file with the extension
-.Pa .ps
-suitable for printing or display on a PostScript compatible device.
-.It Ar roff
-Generates a single output file with the extension
-.Pa .roff
-suitable processing with
-.Xr groff 1 .
-This is actually an intermediate conversion used by the
-.Fl f Ar ascii ,
-.Fl f Ar latin1 ,
-.Fl f Ar koi8-r ,
-and
-.Fl f Ar ps
-format options.
-.El
-.It Fl i Ar name
-Pretend that
-.Dl <!ENTITY % name "INCLUDE">
-occurs at the start of the document type declaration subset in
-the document entity. Since repeated definitions of an entity are
-ignored, this definition will take precedence over any other
-definitions of this entity in the document type declaration.
-Multiple
-.Fl i
-options are allowed. If the declaration replaces the reserved
-name INCLUDE then the new reserved name will be the replacement
-text of the entity. Typically the document type declaration will
-contain
-.Dl <!ENTITY % name "IGNORE">
-and will use
-.Li %name;
-in the status keyword specification of a
-marked section declaration. In this case the effect of the
-option will be to cause the marked section not to be ignored.
-.It Fl links
-When used with the
-.Fl f Ar html
-option, this option generates a shell script named
-.Pa file.ln .
-For each
-.Li <label id="foo">
-in the document source,
-.Pa file.ln
-generates a symbolic link
-.Pa foo.html
-pointing to the numbered
-.Pa .html
-file containing the reference. Since the number of the file
-containing a particular section can change when a document
-is modified, this provides a convenient hook by which separate
-documents can provide links into another document without the
-links becoming invalid when the target document is modified.
-When creating a symbolic link, any occurrence of a slash (/) in label
-is replaced with percent (%), while any occurrence of a space is replaced
-with an underscore (_).
-.It Fl e Ar encoding
-When used with the
-.Fl f Ar html
-option, specifies document encoding to use for the generated
-HTML files. If this option is not specified, iso-8859-1 is used.
-.It Fl hdr Ar file
-When used with the
-.Fl f Ar html
-option, the specified file will be inserted at the beginning of the
-body element of each generated HTML file.
-.It Fl ftr Ar file
-When used with the
-.Fl f Ar html
-option, the specified file will be inserted at the end of the
-body element of each generated HTML file.
-.El
-.Pp
-In all cases, the output files are created in the current working
-directory.
-.Sh FILES
-.Pa /usr/share/sgml/transpec
-- directory containing translation specification files for
-.Xr instant 1 .
-.Pp
-.Sh SEE ALSO
-.Xr groff 1 ,
-.Xr instant 1 ,
-.Xr sgmls 1 ,
-.Xr transpec 5
-.Sh HISTORY
-The
-.Nm
-command appeared in Version 2.0.5 FreeBSD UNIX.
-.Sh AUTHORS
-The
-.Nm
-command was written by John Fieber
-.Aq jfieber@FreeBSD.org .
-The linuxdoc DTD was written by Matt Welsh
-.Aq mdw@cs.cornell.edu
-and based on the Qwertz DTD written by Tom Gordon
-.Aq thomas.gordon@gmd.de .
diff --git a/usr.bin/sgmlfmt/sgmlfmt.pl b/usr.bin/sgmlfmt/sgmlfmt.pl
deleted file mode 100755
index 5f9ab85..0000000
--- a/usr.bin/sgmlfmt/sgmlfmt.pl
+++ /dev/null
@@ -1,749 +0,0 @@
-#!/usr/bin/perl
-
-# $Id: sgmlfmt.pl,v 1.25 1997/05/10 20:41:11 jfieber Exp $
-
-# Copyright (C) 1996
-# John R. Fieber. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY JOHN R. FIEBER AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL JOHN R. FIEBER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-
-
-# Format an sgml document tagged according to the linuxdoc DTD.
-# by John Fieber <jfieber@freebsd.org> for the FreeBSD documentation
-# project.
-
-
-require 'newgetopt.pl';
-
-#
-# The SGML parser, and translation engine.
-#
-
-$sgmls = "sgmls";
-$instant = "instant";
-
-#
-# Things to clean up if we exit abnormally
-#
-
-@cleanfiles = ();
-
-#
-# Interrupt handler, remove scratch files.
-#
-
-sub sighandler {
- local($sig) = @_;
- unlink @cleanfiles;
- exit(1);
-}
-
-$SIG{'HUP'} = 'sighandler';
-$SIG{'INT'} = 'sighandler';
-$SIG{'QUIT'} = 'sighandler';
-
-#
-# Display a usage message.
-#
-
-sub usage {
- print "Usage:\n";
- print "sgmlfmt [-d <doctype>] -f <format> [-i <namea> ...] [-links]\n";
- print " [-e encoding] [-hdr file] [-ftr file] file\n";
- print "where <doctype> is one of: linuxdoc (default), docbook.\n";
- print "and <format> is one of: ascii, html, koi8-r, latin1, ps, roff\n";
-}
-
-#
-# Look for the file specified on the command line
-#
-
-sub getfile {
- local($filearg) = @_;
- if (-f "$filearg.sgml") {
- $file = "$filearg.sgml";
- }
- elsif (-f $filearg) {
- $file = $filearg;
- }
- else {
- return 0;
- }
- $fileroot = $file;
- $fileroot =~ s/.*\///; # drop the path
- $fileroot =~ s/\.[^\.]*$//; # drop the extension
- $filepath = $file;
- $filepath =~ s/\/*[^\/]*$//;
- if ($filepath ne "") {
- $ENV{"SGML_PATH"} .= ":$filepath/%S:%S";
- }
- return 1;
-}
-
-#
-# A function to run sgmls and instant on the input file.
-#
-# Arguments:
-# 1. A file handle for the output
-# 2. A translation file
-#
-
-sub sgmlparse {
- local($ifhandle, $replacement) = @_;
- $defines = join(" -i ", @opt_i);
- if ($defines ne "") {
- $defines = "-i $defines";
- }
- open($ifhandle, "$sgmls $defines $decl $file | " .
- "$instant -Dfilename=$fileroot $instantopts -t ${dtd}-${replacement}.ts |");
-}
-
-#
-# Generate roff output
-#
-
-sub gen_roff {
- @cleanfiles = (@cleanfiles, "${fileroot}.roff");
- open (outfile, ">$fileroot.roff");
- &sgmlparse(infile, "roff");
- while (<infile>) {
- print outfile;
- }
- close(infile);
- close(outfile);
-}
-
-#
-# Generate something from roff output
-#
-
-sub do_groff {
- local($driver, $postproc) = @_;
- @cleanfiles = (@cleanfiles, "${fileroot}.trf", "${fileroot}.tmp",
- "${fileroot}.qrf", "${fileroot}.${driver}");
- open (outfile, ">$fileroot.trf");
- &sgmlparse(infile, "roff");
- while (<infile>) {
- print outfile;
- }
- close(infile);
- close(outfile);
- system("groff -T ${driver} -t ${fileroot}.trf ${postproc} > ${fileroot}.${driver}");
-
- # If foo.tmp has been created, then there are cross references
- # in the file and we need a second pass to resolve them correctly.
-
- if (stat("${fileroot}.tmp")) {
- system("groff -T ${driver} -t ${fileroot}.trf ${postproc} > ${fileroot}.${driver}");
- unlink("${fileroot}.qrf");
- }
- unlink("${fileroot}.trf");
-}
-
-#
-# Generate HTML output.
-#
-# HTML is generated in two passes.
-#
-# The first pass takes the output from sgmlsasp and gathers information
-# about the structure of the document that is used in the sceond pass
-# for splitting the file into separate files. Targets for cross
-# references are also stored in this pass.
-#
-# Based on the information from the first pass, the second pass
-# generates a numbered series of HTML files, a "toplevel" file
-# containing the title, author, abstract and a brief table of
-# contents. A detailed table of contents is also generated. The
-# second pass generates links for cross references and URLs.
-
-#
-# Tunable parameters
-#
-$maxlevel = 3; # max section depth
-$num_depth = 4; # depth of numbering
-$m_depth = 2; # depth of menus
-
-
-$sc = 0; # section counter
-$filecount = 0; # file counter
-
-$doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">";
-$BODY = "<BODY text=\"#000000\" bgcolor=\"#ffffff\">";
-
-# Other variables:
-#
-# st_xxxx - Section Table. Arrays containing information about a
-# given section. To be accesssed via the section counter $sc.
-#
-# st_ol - The output level of the given section. I.E. how many
-# levels from the table of contents does it lie in terms
-# of HTML files which is distinct from <sect1>, <sect2> etc.
-# levels.
-#
-# st_sl - The absolute depth of a section. Contrast st_ol.
-#
-# st_num - The section number in the form X.Y.Z....
-#
-# st_file - The HTML file the section belongs to.
-#
-# st_header - The text of the section title.
-#
-# st_parent - The section number of the given sections parent.
-
-sub gen_html {
- local($i, $sl);
-
- # Remove any lingering link file
- unlink("${fileroot}.ln");
-
- $tmpfile = "/tmp/sgmlf.$$";
- @cleanfiles = (@cleanfiles, "$tmpfile", "${fileroot}.html",
- "${fileroot}_toc.html", "${fileroot}.ln");
- open(bar, ">$tmpfile");
-# print STDERR "(Pass 1...";
- &sgmlparse(foo, "html");
- while (<foo>) {
- print bar;
- # count up the number of files to be generated
- # and gather assorted info about the document structure
- if (/^<\@\@sect>/) {
- $sl++; # current section level
- $sc++; # current section number
- $st_sl[$sc] = $sl;
-
- # In case this section has subsections, set the parent
- # pointer for this level to point at this section.
- $parent_pointer[$sl] = $sc;
-
- # Figure out who is the parent if this section.
- $st_parent[$sc] = $parent_pointer[$sl - 1];
-
- # Per level counters
- $counter[$sl]++;
- $counter[$sl + 1] = 0;
-
- # calculate the section number in the form x.y.z.
- if ($sl <= $num_depth) {
- $st_num[$sc] = $st_num[$st_parent[$sc]] . "$counter[$sl].";
- }
-
- # calculate the file number and output level
- if ($sl <= $maxlevel) {
- $filecount++;
- $st_ol[$sc] = $sl;
- @cleanfiles = (@cleanfiles, "${fileroot}${filecount}.html");
- }
- else {
- $st_ol[$sc] = $maxlevel;
- }
-
- $st_file[$sc] = $filecount;
-
- # Calculate the highest level node in which this
- # node should appear as a menu item.
- $st_pl[$sc] = $sl - $m_depth;
- if ($st_pl[$sc] < 0) {
- $st_pl[$sc] = 0;
- }
- if ($st_pl[$sc] > $maxlevel) {
- $st_pl[$sc] = $maxlevel;
- }
- }
- if (/^<\@\@endsect>/) {
- $sl--;
- }
-
- # record section titles
- if (/^<\@\@head>/) {
- chop;
- s/^<\@\@head>//;
- $st_header[$sc] = $_;
- }
-
- # record the section number that a label occurs in
- if (/^<\@\@label>/) {
- chop;
- s/^<\@\@label>//;
- if ($references{$_} eq "") {
- $references{$_} = "$filecount";
- if ($opt_links) {
- &extlink($_, "${fileroot}${filecount}.html");
- }
- }
- else {
- print STDERR "Warning: the label `$_' is multiply-defined.\n";
- }
- }
- }
- close(bar);
-
- open(foofile, $tmpfile);
- &html2html(foofile, "boo");
-
- unlink($tmpfile);
-}
-
-#
-# HTML conversion, pass number 2
-#
-
-sub html2html {
- local($infile, $outfile) = @_;
- local($i);
-
- $sc = 0;
- push(@scs, $sc);
-
- open(tocfile, ">${fileroot}_toc.html");
- print tocfile "$doctype\n<HTML>\n";
-
- while (<$infile>) {
- # change `<' and `>' to `&lt;' and `&gt;' in <pre></pre>
- if (/<pre>/.../<\/pre>/) {
- s/</\&lt;/g;
- s/\&lt;([\/]*)pre>/<\1pre>/g;
- s/>/\&gt;/g;
- s/<([\/]*)pre\&gt;/<\1pre>/g;
- }
-
- # remove extraneous empty paragraphs (it is arguable that this
- # is really a bug with the DTD, but changing it would break
- # almost every document written to this DTD.)
- s/<p><\/p>//;
-
- tagsw: {
- # titles and headings
- if (s/^<\@\@title>//) {
- chop;
- $st_header[0] = $_;
- $st_parent[0] = -1;
- $t = $st_header[0];
- $t =~ s|<[a-zA-Z/][^>]*>||g;
- print tocfile "<HEAD>\n$html_encoding\n<TITLE>$t</TITLE>\n" .
- "</HEAD>\n";
- print tocfile "<H1>$st_header[0]</H1>\n";
-
- $header[$st_ol[$sc]] =
- "$doctype\n<HTML>\n<HEAD>\n$html_encoding\n<TITLE>$t</TITLE>\n" .
- "</HEAD>\n$BODY\n";
- $header[$st_ol[$sc]] .= $html_header;
- $header[$st_ol[$sc]] .= "\n<H1>$st_header[0]</H1>\n";
-
- $footer[$st_ol[$sc]] = "\n";
- $footer[$st_ol[$sc]] .= $html_footer;
- $footer[$st_ol[$sc]] .= "\n</BODY>\n</HTML>\n";
- last tagsw;
- }
-
- #
- # HEADER begin
- #
- if (s/^<\@\@head>//) {
- chop;
-
- if ($part == 1) {
- $text[0] .= "<H1>Part $partnum:<BR>$_";
- last tagsw;
- }
-
- $href = "\"${fileroot}$st_file[$sc].html#$sc\"";
-
- # set up headers and footers
- if ($st_sl[$sc] > 0 && $st_sl[$sc] <= $maxlevel) {
- $t = $_;
- $t =~ s|<[a-zA-Z/][^>]*>||g;
- $header[$st_ol[$sc]] =
- "$doctype\n<HTML>\n<HEAD>\n$html_encoding\n<TITLE>$t</TITLE>\n" .
- "</HEAD>\n$BODY\n";
- $header[$st_ol[$sc]] .= $html_header;
- $header[$st_ol[$sc]] .= "\n$navbar[$st_ol[$sc]]\n<HR NOSHADE>\n";
- $footer[$st_ol[$sc]] = "<HR NOSHADE>\n$navbar[$st_ol[$sc]]\n";
- $footer[$st_ol[$sc]] .= $html_footer;
- $footer[$st_ol[$sc]] .= "\n</BODY>\n</HTML>\n";
- }
-
- # Add this to the master table of contents
- print tocfile "<DD>$st_num[$sc] " .
- "<A HREF=$href>$_";
-
- # Calculate the <H?> level to use in the HTML file
- $hlevel = $st_sl[$sc] - $st_ol[$sc] + 2;
- $shlevel = $st_sl[$sc] - $st_ol[$sc] + 3;
-
- $i = $st_ol[$sc];
-
- # Add the section header
- $text[$i] .= "<H$hlevel><A NAME=\"$sc\"></A>$st_num[$sc] $_";
- $i--;
-
- # And also to the parent
- if ($st_sl[$sc] == $st_ol[$sc] && $i >= 0) {
- $text[$i] .= "<H$shlevel>$st_num[$sc] " .
- "<A HREF=$href>$_";
- $i--;
- }
-
- # and to the grandparents
- for (; $i >= $st_pl[$sc]; $i--) {
- $text[$i] .= "<DD>$st_num[$sc] " .
- "<A HREF=$href>$_";
- }
-
- last tagsw;
- }
-
- #
- # HEADER end
- #
- if (s/^<\@\@endhead>//) {
- if ($part == 1) {
- $text[0] .= "</H1>\n";
- $part = 0;
- last tagsw;
- }
- print tocfile "</A>\n";
-
- $i = $st_ol[$sc];
-
- # Close the section header
- $text[$i] .= "</H$hlevel>\n";
- $i--;
-
- # in the parent...
- if ($st_sl[$sc] == $st_ol[$sc] && $i >= 0) {
- $text[$i] .= "</A></H$shlevel>\n";
- $i--;
- }
-
- # in the grandparent...
- for (; $i >= $st_pl[$sc]; $i--) {
- $text[$i] .= "</A></DD>\n";
- }
- last tagsw;
- }
-
- # sectioning
- if (s/^<\@\@part>//) {
- $part = 1;
- $partnum++;
- last tagsw;
- }
-
- #
- # BEGINNING of a section
- #
- if (s/^<\@\@sect>//) {
- # Increment the section counter and save it on a stack
- # for future reference.
- $sc++;
- push(@scs, $sc);
-
- # Set up the navigation bar
- if ($st_file[$sc] > $st_file[$sc - 1]) {
- &navbar($st_file[$sc], $filecount, $sc);
- }
-
- # Prepare for menu entries in the table of contents and
- # parent file(s).
- if ($st_sl[$sc - 1] < $st_sl[$sc]) {
- print tocfile "<DL>\n";
- $i = $st_ol[$sc] - 1 - ($st_sl[$sc] == $st_ol[$sc]);
- for (; $i >= $st_pl[$sc]; $i--) {
- $text[$i] .= "<DL>\n";
- }
- }
- last tagsw;
- }
-
- #
- # END of a section
- #
- if (s/^<\@\@endsect>//) {
-
- # Remember the section number! Subsections may have
- # altered the global $sc variable.
- local ($lsc) = pop(@scs);
-
- # Close off subsection menus we may have created in
- # parent file(s).
- if ($st_sl[$lsc] > $st_sl[$sc + 1]) {
- print tocfile "</DL>\n";
- if ($st_sl[$lsc] > 1) {
- print tocfile "</DD>\n";
- }
- $i = $st_ol[$lsc] - 1 - ($st_sl[$lsc] == $st_ol[$lsc]);
- for (; $i >= $st_pl[$lsc]; $i--) {
- $text[$i] .= "</DL>\n";
- }
- }
-
- # If this section is below $maxlevel, write it now.
- if ($st_sl[$lsc] <= $maxlevel) {
- open(SECOUT, ">${fileroot}$st_file[$lsc].html");
- print SECOUT "$header[$st_ol[$lsc]] $text[$st_ol[$lsc]] " .
- "$footer[$st_ol[$lsc]]";
- $text[$st_ol[$lsc]] = "";
- close(SECOUT);
- }
- last tagsw;
- }
-
- # cross references
- if (s/^<\@\@label>//) {
- chop;
- $text[$st_ol[$sc]] .= "<A NAME=\"$_\"></A>";
- last tagsw;
- }
- if (s/^<\@\@ref>//) {
- chop;
- $refname = $_;
- if ($references{$_} eq "") {
- print "Warning: Reference to $_ has no defined target\n";
- }
- else {
- $text[$st_ol[$sc]] .=
- "<A HREF=\"${fileroot}$references{$_}.html#$_\">";
- }
- last tagsw;
- }
- if (s/^<\@\@endref>//) {
- $text[$st_ol[$sc]] .= "</A>";
- last tagsw;
- }
- if (s/^<\@\@refnam>//) {
- $text[$st_ol[$sc]] .= "$refname";
- last tagsw;
- }
-
- # If nothing else did anything with this line, just print it.
- $text[$st_ol[$sc]] .= "$_";
- }
- }
-
- print tocfile "</HTML>\n";
- open(SECOUT, ">$fileroot.html");
- print SECOUT "$header[0] $text[0] $footer[0]";
- close(SECOUT);
- close tocfile;
-}
-
-# navbar
-#
-# Generate a navigation bar to go on the top and bottom of the page.
-
-sub navbar {
- local ($fnum, $fmax, $sc) = @_;
- local ($i, $itext, $prv, $nxt, $colon);
-
- $colon = "<b>:</b>";
-
- # Generate the section hierarchy
-
- $navbar[$st_ol[$sc]] =
- "<A HREF=\"${fileroot}.html\"><EM>$st_header[0]</EM></A>\n";
- $i = $st_parent[$sc];
- while ($i > 0) {
- $itext = " $colon <A HREF=\"${fileroot}$st_file[$i].html\"><EM>$st_header[$i]</EM></A>\n$itext";
- $i = $st_parent[$i];
- }
- $navbar[$st_ol[$sc]] .= "$itext $colon <EM>$st_header[$sc]</EM><BR>\n";
-
- # Generate previous and next pointers
-
- # Previous pointer must be in a different file AND must be at the
- # same or higher section level. If the current node is the
- # beginning of a chapter, then previous will go to the beginning
- # of the previous chapter, not the end of the previous chapter.
-
- $prv = $sc;
- while ($prv >= 0 && $st_file[$prv] >= $st_file[$sc] - 1) {
- $prv--;
- }
- $prv++;
- $navbar[$st_ol[$sc]] .=
- "<b>Previous:</b> <A HREF=\"${fileroot}$st_file[$prv].html\"><EM>$st_header[$prv]</EM></A><BR>\n";
-
- # Then next pointer must be in a higher numbered file OR the home
- # page of the document.
-
- $nxt = $sc;
- if ($st_file[$nxt] == $filecount) {
- $nxt = 0;
- }
- else {
- while ($st_file[$nxt] == $st_file[$sc]) {
- $nxt++;
- }
- }
-
- $navbar[$st_ol[$sc]] .=
- "<b>Next:</b> <A HREF=\"${fileroot}$st_file[$nxt].html\"><EM>$st_header[$nxt]</EM></A>\n";
-
- $navbar[$st_ol[$sc]] .= "\n";
-
-}
-
-#
-# Generate html output from docbook input
-#
-
-sub docbook_html {
- @cleanfiles = (@cleanfiles, "${fileroot}.html");
- open (outfile, ">$fileroot.html");
- &sgmlparse(infile, "html");
- while (<infile>) {
- print outfile;
- }
- close(infile);
- close(outfile);
-}
-
-# extlink
-#
-# Build a shell script to create symbolic links from the name in
-# a reference to the numbered
-# html file. Since the file number that any given section has is
-# subject to change as the document goes through revisions, this allows
-# for a fixed target that separate documents can hook into.
-#
-# Slashes (/) in the reference are converted to percents (%) while
-# spaces ( ) are converted to underscores (_);
-
-sub extlink {
- local ($ref, $fn) = @_;
-
- $ref =~ s/\//%/g;
- $ref =~ s/ /_/g;
-
- $file = "$ref.html";
-
- if (!fileno(LINKFILE)) {
- open(LINKFILE, ">${fileroot}.ln");
- }
-
- print LINKFILE "ln -fs $fn $file\n";
-}
-
-# Now, read the command line and take appropriate action
-
-sub main {
- # Check arguments
- if (!&NGetOpt('d=s', 'f=s', 'links', 'i:s@', 'hdr=s', 'ftr=s', 'e=s')) {
- &usage;
- exit 1;
- }
- if (@ARGV == 0) {
- print "An input file must be specified.\n";
- &usage;
- exit 1;
- }
- if (&getfile($ARGV[0]) == 0) {
- print "Cannot locate specified file: $ARGV[0]\n";
- &usage;
- exit 1;
- }
-
- # Figure out which DTD we are using
- if ($opt_d eq "docbook") {
- $dtd = "docbook";
- $decl = "/usr/share/sgml/docbook/docbook.dcl";
- }
- else {
- $dtd = "linuxdoc";
- $decl = "/usr/share/sgml/FreeBSD/linuxdoc.dcl";
- }
-
- # Generate the output
- if ($opt_f eq 'html') {
- # Set the character encoding
- if (! $opt_e) {
- $opt_e = "iso-8859-1";
- }
- $html_encoding = "<META HTTP-EQUIV=\"Content-Type\" " .
- "CONTENT=\"text/html; charset=" . $opt_e . "\">";
-
- if ($dtd eq "docbook") {
- if ($opt_hdr) {$instantopts .= " -D \"inchdr=${opt_hdr}\"";}
- if ($opt_ftr) {$instantopts .= " -D \"incftr=${opt_ftr}\"";}
- &docbook_html();
- }
- else {
- if ($opt_hdr) {$html_header = &gethf($opt_hdr);}
- if ($opt_ftr) {$html_footer = &gethf($opt_ftr);}
- &gen_html();
- }
- }
- elsif ($opt_f eq 'roff') {
- &gen_roff();
- }
- elsif ($opt_f eq 'ascii') {
- &do_groff("ascii", "| col");
- }
- elsif ($opt_f eq 'latin1') {
- &do_groff("latin1", "| col");
- }
- elsif ($opt_f eq 'koi8-r') {
- &do_groff("koi8-r", "| col");
- }
- elsif ($opt_f eq 'ps') {
- &do_groff("ps", "");
- }
- else {
- if ($opt_f eq "") {
- print "An output format must be specified with the -f
- option.\n";
- }
- else {
- print "\"$opt_f\" is an unknown output format.\n";
- }
- &usage;
- exit 1;
- }
-}
-
-&main;
-
-exit 0;
-
-sub getdate {
- @months = ("January", "February", "March", "April", "May","June",
- "July", "August", "September", "October", "November", "December");
- ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
- $year += 1900;
- return "$months[$mon] $mday, $year";
-}
-
-sub gethf {
- local ($file) = @_;
-
- $date = &getdate;
- $data = "";
-
- if (open(IN, $file)) {
- while (<IN>) {
- s/\@\@UPDATE\@\@/Updated $date/;
- $data .= $_;
- }
- close(IN);
- }
- return $data;
-}
diff --git a/usr.bin/sgmls/LICENSE b/usr.bin/sgmls/LICENSE
deleted file mode 100644
index 576ca35..0000000
--- a/usr.bin/sgmls/LICENSE
+++ /dev/null
@@ -1,43 +0,0 @@
- LICENSE AND DISCLAIMER OF WARRANTIES
-
- Standard Generalized Markup Language Users' Group (SGMLUG)
- SGML Parser Materials
-
- 1. License
-
-SGMLUG hereby grants to any user: (1) an irrevocable royalty-free,
-worldwide, non-exclusive license to use, execute, reproduce, display,
-perform and distribute copies of, and to prepare derivative works
-based upon these materials; and (2) the right to authorize others to
-do any of the foregoing.
-
- 2. Disclaimer of Warranties
-
-(a) The SGML Parser Materials are provided "as is" to any USER. USER
-assumes responsibility for determining the suitability of the SGML
-Parser Materials for its use and for results obtained. SGMLUG makes
-no warranty that any errors have been eliminated from the SGML Parser
-Materials or that they can be eliminated by USER. SGMLUG shall not
-provide any support maintenance or other aid to USER or its licensees
-with respect to SGML Parser Materials. SGMLUG shall not be
-responsible for losses of any kind resulting from use of the SGML
-Parser Materials including (without limitation) any liability for
-business expense, machine downtime, or damages caused to USER or third
-parties by any deficiency, defect, error, or malfunction.
-
-(b) SGMLUG DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, ARISING OUT
-OF OR RELATING TO THE SGML PARSER MATERIALS OR ANY USE THEREOF,
-INCLUDING (WITHOUT LIMITATION) ANY WARRANTY WHATSOEVER AS TO THE
-FITNESS FOR A PARTICULAR USE OR THE MERCHANTABILITY OF THE SGML PARSER
-MATERIALS.
-
-(c) In no event shall SGMLUG be liable to USER or third parties
-licensed by USER for any indirect, special, incidental, or
-consequential damages (including lost profits).
-(d) SGMLUG has no knowledge of any conditions that would impair its right
-to license the SGML Parser Materials. Notwithstanding the foregoing,
-SGMLUG does not make any warranties or representations that the
-SGML Parser Materials are free of claims by third parties of patent,
-copyright infringement or the like, nor does SGMLUG assume any
-liability in respect of any such infringement of rights of third
-parties due to USER's operation under this license.
diff --git a/usr.bin/sgmls/Makefile b/usr.bin/sgmls/Makefile
deleted file mode 100644
index 96ce820..0000000
--- a/usr.bin/sgmls/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Bmake file for sgmls
-# $Id$
-#
-
-SUBDIR= libsgmls sgmls instant
-
-.include <bsd.subdir.mk>
-
diff --git a/usr.bin/sgmls/Makefile.inc b/usr.bin/sgmls/Makefile.inc
deleted file mode 100644
index 7a78864..0000000
--- a/usr.bin/sgmls/Makefile.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Bmakefile for rast
-#
-# $Id$
-#
-
-.if exists(${.CURDIR}/../../Makefile.inc)
-.include "${.CURDIR}/../../Makefile.inc"
-.endif
-
-.if exists(${.OBJDIR}/../libsgmls)
-LIBSGMLS= ${.OBJDIR}/../libsgmls/libsgmls.a
-.else
-LIBSGMLS= ${.CURDIR}/../libsgmls/libsgmls.a
-.endif
-
diff --git a/usr.bin/sgmls/README b/usr.bin/sgmls/README
deleted file mode 100644
index e2a8204..0000000
--- a/usr.bin/sgmls/README
+++ /dev/null
@@ -1,138 +0,0 @@
-$Id$
-
-This the sgmls release 1.1 SGML parser written by James Clark
-jjc@jclark.com, repackaged for FreeBSD. The original source may be
-obtained from ftp://ftp.jclark.com/.
-
-Pieces removed include:
- * Test documents: Compiled on FreeBSD, sgmls passes all tests.
- * sgml-mode.el: The sole file covered by the GNU GPL. This is not
- installed anyway and anyone wishing to do serious SGML editing
- would be best to get the psgml package.
- * Makefiles and config files for other operating systems (vms, dos,
- cms).
- * Formatted versions of the man pages.
-
-
-20-Apr-1995 John Fieber <jfieber@freebsd.org>
-
-
-The original README and TODO follow.
-----------------------------------------------------------------------
-This is sgmls, an SGML parser derived from the ARCSGML parser
-materials which were written by Charles F. Goldfarb. (These are
-available for anonymous ftp from ftp.ifi.uio.no [128.240.88.1] in the
-directory SIGhyper/SGMLUG/distrib.)
-
-The version number is given in the file version.c.
-
-The file INSTALL contains installation instructions.
-
-The file NEWS describes recent user-visible changes.
-
-The file sgmls.man contains a Unix manual page; sgmls.txt is the
-formatted version of this.
-
-The file sgml-mode.el contains a very simple SGML mode for GNU Emacs.
-
-The files sgmls.c and sgmls.h contain a small library for parsing the
-output of sgmls. This is used by sgmlsasp, which translates the
-output of sgmls using an ASP replacement file, and by rast, which
-translates the output of sgmls to the format of a RAST result. The
-files sgmlsasp.man and rast.man contain Unix manual pages for sgmlsasp
-and rast; sgmlsasp.txt and rast.txt are the formatted versions of
-these.
-
-The file LICENSE contains the license which applies to arcsgml and
-accordingly to those parts of sgmls derived from arcsgml. See also
-the copyright notice at the beginning of sgmlxtrn.c. The parts that
-were written by me are in the public domain (any files that were
-written entirely by me contain a comment to that effect.) The file
-sgml-mode.el is covered by the GNU GPL.
-
-Please report any bugs to me. When reporting bugs, please include the
-version number, details of your machine, OS and compiler, and a
-complete self-contained file that will allow me to reproduce the bug.
-
-James Clark
-jjc@jclark.com
-
-----------------------------------------------------------------------
-Warn about mixed content models where #PCDATA can't occur everywhere.
-
-Perhaps there should be a configuration option saying what a control
-character is for the purpose of SHUNCHAR CONTROLS.
-
-Should the current character that is printed in error messages be
-taken from be taken from the file entity or the current entity?
-
-Refine SYS_ action. If we distinguish DELNONCH in lexmark, lexgrp,
-lexsd, we can have separate action that ignores the following
-character as well.
-
-Should RSs in CDATA/SDATA entities be ignored as specified in 322:1-2?
-Similarily, do the rules on REs in 322:3-11 apply to CDATA/SDATA
-entities? (I don't think they count as being `in content'.)
-
-What should the entity manager do when it encounters code 13 in an
-input file? (Currently it treats it as an RE.)
-
-Document when invalid exclusions are detected.
-
-Option not to perform capacity checking.
-
-Give a warning if the recommendation of 422:1-3 is contravened.
-
-Should an empty CDATA/RCDATA marked section be allowed in the document
-type declaration subset?
-
-Include example of use of SGML_PATH in documentation.
-
-Try to detect the situation in 310:8-10 (but see 282:1-2).
-
-Resize hash tables if they become too full.
-
-Say something in the man page about message catalogues.
-
-Consider whether support for SHORTREF NONE requires further changes
-(other than disallowing short reference mapping declaration).
-
-Fake /dev/fd/N and /dev/stdin for systems that don't provide it.
-
-Improve the effficiency of the entity manager by not closing and
-reopening files. If we run out of FILEs choose the stream with the
-fewest bytes remaining to be read, and read the rest of it into
-memory. Each entity level will have its own read buffer.
-
-Support multi-line error messages: automatically indent after
-newline. (We could output to a temporary file first, then copy to
-stderr replacing newlines by newline+indent).
-
-Option that says to output out of context things.
-
-Divide up formal public identifier errors. Give these errors their
-own type code.
-
-Consider whether, when OMITTAG is NO, we need to change interpretation
-of an empty start-tag (7.4.1.1).
-
-Possibly turn errors 70 and 136 into warnings.
-
-Make things work with NORMSEP > 2. Would need to keep track of number
-of CDATA and SDATA entities in CDATA attributes.
-
-Handle `SCOPE INSTANCE'.
-
-In entgen.c, truncate filenames for OSs that don't do this themselves.
-
-Provide an option that specifies that maximum number of errors; when
-this limit is exceeded sgmls would exit.
-
-Document non-portable assumptions in the code.
-
-Option to write out SGML declaration. In this case make it write out
-APPINFO parameter.
-
-Allow there to be catalogs mapping public ids to filenames.
-Environment variable SGML_CATALOG containing list of filenames of
-catalogs.
diff --git a/usr.bin/sgmls/configure b/usr.bin/sgmls/configure
deleted file mode 100755
index 7fd1968..0000000
--- a/usr.bin/sgmls/configure
+++ /dev/null
@@ -1,617 +0,0 @@
-#!/bin/sh
-# Generate config.h from unix.cfg.
-
-trap 'rm -f doit doit.c doit.o doit.log config.out; exit 1' 1 2 3 15
-
-on=
-off=
-CC=${CC-cc}
-
-# Normally we use VARARGS if __STDC__ is not defined.
-# Test whether this assumption is wrong.
-
-cat >doit.c <<\EOF
-#ifdef __STDC__
-#include <stdarg.h>
-int foo(char *s,...)
-{
- va_list ap;
-
- va_start(ap, s);
- va_end(ap);
- return 0;
-}
-#else
-int foo = 0;
-#endif
-EOF
-
-$CC $CFLAGS -c doit.c >/dev/null 2>&1
-if test $? -ne 0
-then
- on="$on VARARGS"
-fi
-
-cat >doit.c <<\EOF
-#include <stddef.h>
-int foo = 0;
-EOF
-
-if $CC $CFLAGS -c doit.c >/dev/null 2>&1
-then
- off="$off STDDEF_H_MISSING"
-else
- on="$on STDDEF_H_MISSING"
-fi
-
-cat >doit.c <<\EOF
-#include <stdlib.h>
-int foo = 0;
-EOF
-
-if $CC $CFLAGS -c doit.c >/dev/null 2>&1
-then
- off="$off STDLIB_H_MISSING"
-else
- on="$on STDLIB_H_MISSING"
-fi
-
-cat >doit.c <<\EOF
-#include <limits.h>
-int foo = 0;
-EOF
-
-if $CC $CFLAGS -c doit.c >/dev/null 2>&1
-then
- off="$off LIMITS_H_MISSING"
-else
- on="$on LIMITS_H_MISSING"
-fi
-
-cat >doit.c <<\EOF
-#include <vfork.h>
-int foo = 0;
-EOF
-
-if $CC $CFLAGS -c doit.c >/dev/null 2>&1
-then
- on="$on HAVE_VFORK_H"
-else
- off="$off HAVE_VFORK_H"
-fi
-
-cat >doit.c <<\EOF
-#include <unistd.h>
-int foo = 0;
-EOF
-
-if $CC $CFLAGS -c doit.c >/dev/null 2>&1
-then
- on="$on HAVE_UNISTD_H"
-else
- off="$off HAVE_UNISTD_H"
-fi
-
-cat >doit.c <<\EOF
-#include <sys/types.h>
-#include <sys/stat.h>
-int foo = 0;
-EOF
-
-if $CC $CFLAGS -c doit.c >/dev/null 2>&1
-then
- on="$on HAVE_SYS_STAT_H"
-else
- off="$off HAVE_SYS_STAT_H"
-fi
-
-cat >doit.c <<\EOF
-/* Exit normally unless we need to use isascii. */
-
-#include <ctype.h>
-#include <signal.h>
-
-static int whoops()
-{
- _exit(1);
-}
-
-main()
-{
- int c;
-#ifdef isascii
-#ifdef SIGSEGV
- signal(SIGSEGV, whoops);
-#endif
-#ifdef SIGBUS
- signal(SIGBUS, whoops);
-#endif
-#ifdef SIGIOT
- signal(SIGIOT, whoops);
-#endif
-
- for (c = 128; c < 256; c++) {
- if (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5'
- || c == '6' || c == '7' || c == '8' || c == '9') {
- if (!isdigit(c) || isalpha(c) || iscntrl(c) || isspace(c) || ispunct(c))
- exit(1);
- }
- else if (isdigit(c))
- exit(1);
- else if (isalpha(c)) {
- if (iscntrl(c) || isspace(c) || ispunct(c)
- || (islower(c) && toupper(c) != c && !isupper(toupper(c)))
- || (isupper(c) && tolower(c) != c && !islower(tolower(c))))
- exit(1);
- }
- else if (islower(c) || isupper(c))
- exit(1);
- else if (iscntrl(c)) {
- if (ispunct(c))
- exit(1);
- }
- }
-#endif /* isascii */
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- # This tries to find the symbol that looks like the array
- # used by <ctype.h>, and sees if its length appears to be 128
- # rather than 256.
- if test 1 = `(nm -n doit 2>/dev/null) | awk '
-BEGIN {
- weight["0"] = 0;
- weight["1"] = 1;
- weight["2"] = 2;
- weight["3"] = 3;
- weight["4"] = 4;
- weight["5"] = 5;
- weight["6"] = 6;
- weight["7"] = 7;
- weight["8"] = 8;
- weight["9"] = 9;
- weight["a"] = weight["A"] = 10;
- weight["b"] = weight["B"] = 11;
- weight["c"] = weight["C"] = 12;
- weight["d"] = weight["D"] = 13;
- weight["e"] = weight["E"] = 14;
- weight["f"] = weight["F"] = 15;
-}
-
-/^[0-9a-zA-Z]* D .*ctype/ && ctype_nr == 0 {
- ctype_nr = NR;
- addr = 0;
- len = length($1);
- for (i = 1; i <= len; i++)
- addr = addr*16 + weight[substr($1, i, 1)];
-}
-
-/^[0-9a-zA-Z]* D / && NR == ctype_nr + 1 {
- next_addr = 0;
- len = length($1);
- for (i = 1; i <= len; i++)
- next_addr = next_addr*16 + weight[substr($1, i, 1)];
-}
-
-END {
- size = next_addr - addr;
- if (size >= 128 && size < 256)
- print "1";
- else
- print "0";
-}'`
- then
- on="$on USE_ISASCII"
- else
- if ((yes | man 3 ctype) 2>/dev/null) \
- | sed -e 's/.//g' -e 's/ *$//' -e '/de-$/N' \
- -e 's/-\n//g' -e '/defined$/N' -e '/only$/N' \
- -e '/where$/N' -e '/isascii$/N' -e '/is$/N' \
- -e 's/\n/ /g' -e 's/ */ /g' \
- | grep "defined only where isascii is true" >/dev/null
- then
- on="$on USE_ISASCII"
- else
- off="$off USE_ISASCII"
- fi
- fi
-else
- on="$on USE_ISASCII"
-fi
-
-cat >doit.c <<\EOF
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- remove("foo");
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- off="$off REMOVE_MISSING"
-else
- on="$on REMOVE_MISSING"
-fi
-
-cat >doit.c <<\EOF
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- getopt(argc, argv, "v");
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- on="$on HAVE_GETOPT"
-else
- off="$off HAVE_GETOPT"
-fi
-
-cat >doit.c <<\EOF
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- access("foo", 4);
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- on="$on HAVE_ACCESS"
-else
- off="$off HAVE_ACCESS"
-fi
-
-cat >doit.c <<\EOF
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- vfork();
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- on="$on HAVE_VFORK"
-else
- off="$off HAVE_VFORK"
-fi
-
-cat >doit.c <<\EOF
-main(argc, argv)
-int argc;
-char **argv;
-{
-
- if (argc == 0) {
- int status;
- waitpid(-1, &status, 0);
- }
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- on="$on HAVE_WAITPID"
-else
- off="$off HAVE_WAITPID"
-fi
-
-cat >doit.c <<\EOF
-#include <string.h>
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- strerror(0);
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- off="$off STRERROR_MISSING"
-else
- on="$on STRERROR_MISSING"
-fi
-
-cat >doit.c <<\EOF
-#include <strings.h>
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- bcopy((char *)0, (char *)0, 0);
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- # Only use BSD_STRINGS if ANSI string functions don't work.
- cat >doit.c <<\EOF
-#include <string.h>
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- memcpy((char *)0, (char *)0, 0);
- exit(0);
-}
-EOF
-
- if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
- then
- off="$off BSD_STRINGS"
- else
- on="$on BSD_STRINGS"
- fi
-else
- off="$off BSD_STRINGS"
-fi
-
-cat >doit.c <<\EOF
-#include <signal.h>
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0)
- raise(SIGINT);
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- off="$off RAISE_MISSING"
-else
- on="$on RAISE_MISSING"
-fi
-
-cat >doit.c <<\EOF
-#include <stdio.h>
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0) {
- fpos_t pos;
- fsetpos(stdin, &pos);
- fgetpos(stdin, &pos);
- }
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- off="$off FPOS_MISSING"
-else
- on="$on FPOS_MISSING"
-fi
-
-cat >doit.c <<\EOF
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0) {
- pid_t pid;
- int status;
- long n = sysconf(_SC_OPEN_MAX);
- pid = waitpid(-1, &status, 0);
- WIFSTOPPED(status);
- WIFSIGNALED(status);
- WIFEXITED(status);
- WEXITSTATUS(status);
- WTERMSIG(status);
- WSTOPSIG(status);
- }
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- on="$on POSIX"
-else
- off="$off POSIX"
-fi
-
-cat >doit.c <<\EOF
-#include <stdio.h>
-#include <signal.h>
-
-static int whoops()
-{
- _exit(1);
-}
-
-main()
-{
- char buf[30];
-#ifdef SIGSEGV
- signal(SIGSEGV, whoops);
-#endif
-#ifdef SIGBUS
- signal(SIGBUS, whoops);
-#endif
-#ifdef SIGIOT
- signal(SIGIOT, whoops);
-#endif
- sprintf(buf, "%2$s%2$s%1$s%1$s", "bar", "foo");
- exit(!!strcmp(buf, "foofoobarbar"));
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- on="$on HAVE_EXTENDED_PRINTF"
-else
- off="$off HAVE_EXTENDED_PRINTF"
-fi
-
-cat >doit.c <<\EOF
-#include <nl_types.h>
-
-main(argc, argv)
-int argc;
-char **argv;
-{
- if (argc == 0) {
- nl_catd d = catopen("foo", 0);
- catgets(d, 1, 1, "default");
- catclose(d);
- }
- exit(0);
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- on="$on HAVE_CAT"
-else
- off="$off HAVE_CAT"
-fi
-
-cat >doit.c <<\EOF
-#include <limits.h>
-
-char c = UCHAR_MAX;
-
-main(argc, argv)
-int argc;
-char **argv;
-{
-#if CHAR_MIN < 0
- exit(!(c < 0));
-#else
- exit(!(c > 0));
-#endif
-}
-EOF
-
-if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
-then
- char_signed=
-else
- cat >doit.c <<\EOF
-main()
-{
- int i;
-
- for (i = 0; i < 512; i++) {
- char c = (char)i;
- if (c < 0)
- exit(1);
- }
- exit(0);
-}
-EOF
-
- if $CC $CFLAGS -o doit doit.c $LIBS >/dev/null 2>&1 && ./doit 2>/dev/null
- then
- char_signed=0
- else
- char_signed=1
- fi
-fi
-
-cat >doit.c <<\EOF
-
-typedef void VOID;
-
-extern VOID bar();
-
-VOID foo()
-{
-}
-EOF
-
-if $CC $CFLAGS -c doit.c >/dev/null 2>&1
-then
- void_ret=void
-else
- void_ret=int
-fi
-
-
-cat >doit.c <<\EOF
-
-void *foo()
-{
- static char *buf;
- return buf;
-}
-EOF
-
-if $CC $CFLAGS -c doit.c >doit.log 2>&1
-then
- if test -s doit.log
- then
- void_star="char \*"
- else
- void_star="void \*"
- fi
-
-else
- void_star="char \*"
-fi
-
-edit=
-
-rm -f doit.c doit doit.log doit.o
-
-for var in $on
-do
- edit="$edit -e 's;^/\\* *\\(#define $var [^/]*\\) *\\*/;\\1;'"
-done
-for var in $off
-do
- edit="$edit -e 's;^#define $var [^/]*;/* & */;'"
-done
-
-if test -n "$char_signed"
-then
- edit="$edit -e 's;^/\\* *\\(#define CHAR_SIGNED $char_signed\\) *\\*/;\\1;'"
-fi
-
-edit="$edit -e 's/^typedef .*VOID;/typedef $void_ret VOID;/'"
-edit="$edit -e 's/^typedef .*UNIV;/typedef ${void_star}UNIV;/'"
-
-if test "X$(PREFIX)" != "X/usr/local"
-then
- edit="$edit -e '/DEFAULT_PATH/s;/usr/local;$PREFIX;g'"
-fi
-
-eval sed $edit unix.cfg ">config.out"
-
-mv config.out config.h
-
-exit 0
diff --git a/usr.bin/sgmls/instant/Makefile b/usr.bin/sgmls/instant/Makefile
deleted file mode 100644
index c004f87..0000000
--- a/usr.bin/sgmls/instant/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $Id$
-
-PROG= instant
-SRCS= browse.c info.c main.c tables.c traninit.c translate.c
-SRCS+= tranvar.c util.c
-
-CFLAGS+= -I${.CURDIR}/../libsgmls -I${.CURDIR}/../sgmls
-
-LDADD= ${LIBSGMLS} -lcompat
-DPADD= ${LIBSGMLS} ${LIBCOMPAT}
-
-MAN1= instant.1
-MAN5= transpec.5
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/sgmls/instant/README b/usr.bin/sgmls/instant/README
deleted file mode 100644
index d04547c..0000000
--- a/usr.bin/sgmls/instant/README
+++ /dev/null
@@ -1,150 +0,0 @@
-#
-# Copyright (c) 1994
-# Open Software Foundation, Inc.
-#
-# Permission is hereby granted to use, copy, modify and freely distribute
-# the software in this file and its documentation for any purpose without
-# fee, provided that the above copyright notice appears in all copies and
-# that both the copyright notice and this permission notice appear in
-# supporting documentation. Further, provided that the name of Open
-# Software Foundation, Inc. ("OSF") not be used in advertising or
-# publicity pertaining to distribution of the software without prior
-# written permission from OSF. OSF makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
-#
-
- instant - a formatting application for OSF SGML instances
-____________________________________________________________________________
-
-Requirements
-
- ANSI C compiler (gcc is one)
-
- sgmls 1.1 -- sgml parser from James Clark. Based on Goldfarb's ARC parser.
-
- Vanilla unix make
-
- POSIX C libraries
-
-
-Files for instant program
-
- Module Function
- ------ --------
- browse.c interactive browser
- general.h general definitions
- info.c print information about the instances
- main.c main entry, arg parsing, instance reading
- tables.c table-specific formatting routines (TeX and tbl)
- traninit.c translator initialization (read spec, etc.)
- translate.c main translator
- translate.h structure definitions for translation code
- tranvar.c routines for handling "special variables"
- util.c general utilities
-
-
-Also required
-
- 1. Translation spec (transpec) files. (../transpecs/*.ts)
- 2. SDATA mapping files for mapping sdata entities. (../transpecs/*.sdata)
- 3. Character mapping files for mapping characters. (../transpecs/*.cmap)
-
-
-Platforms tried on
-
- OSF1 1.3 (i486)
- Ultrix 4.2 (mips)
- HP-UX 9.01 (hp 9000/700)
- AIX 3.2 (rs6000)
- SunOS [missing strerror()]
-
-____________________________________________________________________________
-
- General outline of program
- ------- ------- -- -------
-
-To summarize in a sentence, instant reads the output of sgmls, builds a tree
-of the instnace in memory, then traverses the tree in in-order, processing
-the nodes according to a translation spec.
-
-Element tree storage
-------- ---- -------
-
-The first thing instant must do is read the ESIS (output of sgmls) from the
-specified file or stdin, forming a tree in memory. (Nothing makes sense
-without an instance...) Each element of the instance is a node in the tree,
-stored as a structure called Element_t. Elements contain content (what
-else?), which is a mixture of data (#PCDATA, #CDATA, #RCDATA - all the same
-in the ESIS), child elements, and PIs. Each 'chunk' of content is referred
-to by a Content_t structure. A Content_t contains an enum that can point to
-a string (data or PI), another Element_t. For example, if a <p> element
-contains some characters, an <emphasis> element, some more characters,
-a <function> element, then some more characters, it has 5 Content_t children
-as an array.
-
-Element_t's have pointers to their parents, and a next element in a linked
-list (they're stored as a linked list, for cases when you'd want to quickly
-travers all the nodes, in no particular order).
-For convenience, Element_t's have an array of pointers to it's child
-Element_t's. These are just pointers to the same thing contained in the
-Content_t array, without the intervening data or PIs. This makes it easier
-for the program to traverse the elements of the tree (it does not have to
-be concerned with skipping data, etc.). There is an analagous array of
-pointers for the data content, an array of (char *)'s. This makes it easier
-to consider the immediate character content of an element.
-
-Attributes are kept as an array of name-value mappings (using the typedef
-Mapping_t). ID attributes are also stored in a separate list of ID value -
-element pointer pairs so that it is quick to find an element by ID.
-
-Other information kept about each element (in the Element_t struct) includes
-the line number in the EISI where the element occurs, the input filename.
-(These depend on sgmls being run with the "-l" option.) Also stored is
-an element's order in its parent's collection of children and an element's
-depth in the tree.
-
-Translation specs
------------ -----
-
-A translation spec is read into a linked list in memory. As the instance
-tree is traversed, the transpecs are searched in order for a match. As a
-rule, one should position the less specific transpecs later in the file.
-Also, specs for seldom-used element are best placed later in the file, since
-it takes cpu cycles to skip over them for each of the more-used elements.
-
-During translation of a particular element, the list of Content_t structures
-are processed in order. If a content 'chunk' is data, it is printed to
-the output stream. If it is an element, the translation routine is called
-for that elemen, recursively. Hence, in-order traversal.
-
-Miscellaneous information displays
-------------- ----------- --------
-
-There are several informational display options available. They include:
- - a list of element usage (-u) -- lists each element in the instance,
- it's attributes, number of children, parent, data content 'nodes'.
- - statistics about elements (-S) -- lists elements, number of times
- each is used, percent of elements that this is, total char content
- in that element, average number of characters in they element.
- - show context of each element (-x) -- lists each element and its
- context, looking up the tree (this is the same context that
- would match the Context field of a transpec).
- - show the hierarchy of the instance (-h) -- show an ascii 'tree' of
- the instance, where elements deeper in the tree are indented more.
- Numbers after the element name in parentheses are the number of
- element content nodes and the number of data content nodes.
-
-Interactive browser
------------ -------
-
-Originally, the interactive browser was intended as a debugging aid for
-the code developer. It was a way to examine a particular node of the
-instance tree or process a subtree without being distracted by the rest
-of the instance. Many of the commands test functionality of the query
-and search code (such as testing whether a certain element has a given
-relationship to the current position in the tree).
-
-
-____________________________________________________________________________
-
diff --git a/usr.bin/sgmls/instant/browse.c b/usr.bin/sgmls/instant/browse.c
deleted file mode 100644
index c904476..0000000
--- a/usr.bin/sgmls/instant/browse.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-
-/* ________________________________________________________________________
- *
- * Module for interactive browsing.
- *
- * Entry points for this module:
- * Browse() interactive browser
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/browse.c,v 1.2 1996/06/02 21:46:10 fld Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include "general.h"
-
-static void PrElemPlusID(Element_t *);
-static void ls_node(Element_t *, int, char **);
-static void do_query(Element_t *, char *, char *);
-static void do_find(Element_t *, char **);
-
-/* ______________________________________________________________________ */
-
-static char *br_help_msg[] = {
- " ls List info about current element in tree",
- " (context, children, attributes, etc.)",
- " cd N ... Change to Nth elememt child, where N is shown by 'ls'.",
- " N may also be '/' (top) or '..' (up).",
- " cd id I Change to elememt whose ID is I",
- " data N Show data of Nth data node",
- " where Show current position in the tree",
- " id I Show path to element with id I",
- " (using '?' for I will lists all IDs and their paths)",
- " find S Find elements matching spec S. Recognized syntaxes:",
- " find attr <name> <value>",
- " find cont <string>",
- " find parent <gi-name>",
- " find child <gi-name>",
- " find gi <gi-name>",
- " q rel gi Query: report if elem 'gi' has relation to current elem",
- " ('rel' is one of 'child parent ancestor descendant",
- " sibling sibling+ sibling+1 sibling- sibling-1 cousin')",
- "",
- " tran [outfile]",
- " Translate into 'outfile' (stdout)",
- " stat Print statistics (how often elements occur, etc.)",
- " sum Print elem usage summary (# of children, depth, etc.)",
- " tree Print document hierarchy as a tree",
- " cont Print context of each element",
- NULL
-};
-
-/* ______________________________________________________________________ */
-
-void
-Browse()
-{
- char buf[256], *cmd, **av, **sv;
- char *Prompt;
- Element_t *ce; /* current element */
- Element_t *e;
- int i, n, ac;
-
- if (slave) Prompt = "=>\n";
- else Prompt = "=> ";
-
- ce = DocTree;
- while (fputs(Prompt, stdout)) {
- if (!fgets(buf, 256, stdin)) break;
- stripNL(buf);
- if (buf[0] == EOS) {
- fputs(Prompt, stdout);
- continue;
- }
- ac = 20;
- av = Split(buf, &ac, S_ALVEC);
- if (ac > 0) cmd = av[0];
- if (!cmd || !(*cmd)) continue;
-
- if (!strcmp(cmd, "ls")) ls_node(ce, ac, av);
-
- else if (!strcmp(cmd, "cd")) {
- if (av[1]) {
- if (ac == 3 && !strcmp(av[1], "id")) {
- if ((e = FindElemByID(av[2]))) ce = e;
- else printf("Element with ID '%s' not found.\n", av[2]);
- continue;
- }
- for (i=1; i<ac; i++) {
- if (!strcmp(av[i], "..")) {
- if (ce->parent) ce = ce->parent;
- continue;
- }
- if (!strcmp(av[i], "/")) {
- if (ce->parent) ce = DocTree;
- continue;
- }
- if (!isdigit(*av[i])) {
- printf("Expecting digit, '..', or '/', got '%s'.\n",
- av[i]);
- break;
- }
- n = atoi(av[i]);
- if (n < ce->necont) ce = ce->econt[n];
- else {
- printf("Must be in range 0 - %d.\n", ce->necont);
- break;
- }
- }
- }
- }
-
- else if (!strcmp(cmd, "data")) {
- if (av[1] && isdigit(*av[1])) {
- n = atoi(av[1]);
- if (n < ce->ndcont) {
- printf(ce->dcont[n]);
- fputs("\n", stdout);
- }
- else if (ce->ndcont == 0)
- printf("No data at this node.\n");
- else printf("Must be in range 0 - %d.\n", ce->ndcont);
- }
- }
-
- /* show where we are in the tree */
- else if (!strcmp(cmd, "where")) PrintLocation(ce, stdout);
-
- /* show where we are in the tree */
- else if (!strcmp(cmd, "pwd")) PrElemPlusID(ce);
-
- /* perform query with yes/no answer */
- else if (!strcmp(cmd, "q") && av[1] && av[2])
- do_query(ce, av[1], av[2]);
-
- /* perform query printing paths to matching elements */
- else if (!strcmp(cmd, "find") && av[1] && av[2])
- do_find(ce, av);
-
- /* list locations where specified ID(s) occur */
- else if (!strcmp(cmd, "id")) {
- if (ac <= 1) continue;
- if (*av[1] == '?') PrintIDList();
- else {
- /* short: "id i1 i2 ...", long: "id -l i1 i2 ..." */
- if (!strcmp(av[1], "-l")) n = 2;
- else n = 1;
- for (i=n; i<ac; i++) {
- if ((e = FindElemByID(av[i]))) {
- if (n == 2) { /* long (multiline) format */
- if (n != i) putchar('\n');
- PrintLocation(e, stdout);
- }
- else PrElemPlusID(e);
- }
- else printf("Element with ID '%s' not found.\n", av[i]);
- }
- }
- }
-
- /* show and set variables */
- else if (!strcmp(cmd, "show") && av[1]) {
- printf("%s\n", FindMappingVal(Variables, av[1]));
- }
- else if (!strcmp(cmd, "set") && av[1] && av[2]) {
- SetMappingNV(Variables, av[1], av[2]);
- }
-
- /* print summary of tag usage */
- else if (!strcmp(cmd, "sum")) {
- if (ac > 1) PrintElemSummary(ce);
- else PrintElemSummary(DocTree);
- }
- /* print element tree */
- else if (!strcmp(cmd, "tree")) {
- if (ac > 1) PrintElemTree(ce);
- else PrintElemTree(DocTree);
- }
- /* print statistics */
- else if (!strcmp(cmd, "stat")) {
- if (ac > 1) PrintStats(ce);
- else PrintStats(DocTree);
- }
- /* print context of each element of tree */
- else if (!strcmp(cmd, "cont")) {
- if (ac > 1) PrintContext(ce);
- else PrintContext(DocTree);
- }
- /* print translation, given transpec */
- else if (!strcmp(cmd, "tran")) {
- FILE *fp;
- if (ac > 1){
- if (!(fp = fopen(av[1], "w"))) {
- perror("Can not open output file");
- continue;
- }
- }
- else fp = stdout;
- DoTranslate(ce, fp);
- if (ac > 1) fclose(fp);
- }
-
- else if (!strcmp(cmd, "help") || *cmd == '?') {
- sv = br_help_msg;
- while (*sv) puts(*sv++);
- }
-
- /* quit (control-D also works) */
- else if (!strcmp(cmd, "quit")) break;
-
- else
- fprintf(stderr, "Unknown command '%s' - ingored.\n", cmd);
- }
- putc(NL, stdout);
-}
-
-/* ______________________________________________________________________ */
-/* Do the "ls" command.
- * Arguments:
- * Pointer to element under consideration.
- * Arg count from command line (this command, not the shell command).
- * Arg vector.
- */
-
-static void
-ls_node(
- Element_t *e,
- int ac,
- char **av
-)
-{
- int i;
- char buf[LINESIZE];
-
- if (ac > 1 && !strcmp(av[1], "-n")) {
- for(i=0; i<e->ncont; i++) {
- if (IsContElem(e,i)) printf("%s\n", ContElem(e,i)->gi);
- else if (IsContData(e,i)) printf("#data %s\n", ContData(e,i));
- else if (IsContPI(e,i)) printf("#pi %s\n", ContData(e,i));
- }
- return;
- }
-
- printf("Element: %s\tLineNumber: %d\n", e->gi, e->lineno);
- if (e->parent)
- printf("Context: %s\n", FindContext(e, 20, buf));
-
- if (e->natts) {
- printf("%d attributes:\n", e->natts);
- for (i=0; i<e->natts; i++)
- printf("\t%2d: %s = '%s'\n", i, e->atts[i].name, e->atts[i].sval);
- }
- if (e->entity) {
- printf("Entity & notation information:\n");
- if (e->entity->ename)
- printf("Entity name: %s\n", e->entity->ename);
- if (e->entity->nname)
- printf("Notation name: %s\n", e->entity->nname);
- if (e->entity->sysid)
- printf("Sys id: %s\n", e->entity->sysid);
- if (e->entity->pubid)
- printf("Pub id: %s\n", e->entity->pubid);
- if (e->entity->fname)
- printf("Filename: %s\n", e->entity->fname);
- }
-
- if (e->my_eorder >= 0)
- printf("My order among my siblings: %d\n", e->my_eorder);
-
- if (e->necont) {
- printf("%d child element nodes:\n", e->necont);
- for(i=0; i<e->necont; i++) printf("\t%2d: %s\n", i, e->econt[i]->gi);
- }
-
- if (e->ndcont) {
- printf("%d child data nodes:\n", e->ndcont);
- for(i=0; i<e->ndcont; i++) {
- if (strlen(e->dcont[i]) < 40)
- printf("\t%2d: %s\n", i, e->dcont[i]);
- else
- printf("\t%2d: %-40.40s...\n", i, e->dcont[i]);
- }
- }
-}
-
-/* ______________________________________________________________________ */
-/* Perform query. Syntax: find relationship gi. Tells whether gi has
- * given relationship to current element. Result (message) sent to stdout.
- * Args:
- * Pointer to element under consideration.
- * Pointer to name of relationship. (see FindRelByName() for names)
- * Pointer to GI to look for.
- */
-
-static void
-do_query(
- Element_t *e,
- char *rel,
- char *gi
-)
-{
- char *cp;
- Relation_t r;
- Element_t *ep;
-
- for (cp=gi; *cp; cp++) if (islower(*cp)) *cp = toupper(*cp);
-
- if ((r = FindRelByName(rel)) == REL_Unknown) {
- return;
- }
- ep = QRelation(e, gi, r);
- printf("%s, '%s' is%s %s of '%s'.\n", (ep ? "Yes" : "No"), gi,
- (ep ? "" : " not"), rel, e->gi);
-}
-
-/* ______________________________________________________________________ */
-/* Print path to the element and its ID (if it has one) on a single line.
- * Arguments:
- * Pointer to element under consideration.
- */
-static void
-PrElemPlusID(
- Element_t *e
-)
-{
- char buf[LINESIZE];
-
- if (e->id) printf("%s -- ID=%s\n", FindElementPath(e, buf), e->id);
- else printf("%s\n", FindElementPath(e, buf));
-}
-
-/* ______________________________________________________________________ */
-/* Print path to the element and its ID (if it has one) on a single line.
- * Arguments:
- * Pointer to element under consideration.
- */
-
-static void
-match_gi(
- Element_t *e,
- char **av
-)
-{
- if (!strcmp(av[1], e->gi)) PrElemPlusID(e);
-}
-
-/* Shorthand for defining simple finctions, which are just interfaces to
- * calling QRelation(). DescendTree() only passes ptr to element. */
-#define MATCH(Fun,Rel) \
- static void Fun(Element_t *e, char **av) \
- { if (QRelation(e, av[1], Rel)) PrElemPlusID(e); }
-
-MATCH(match_parent, REL_Parent)
-MATCH(match_child, REL_Child)
-MATCH(match_anc, REL_Ancestor)
-MATCH(match_desc, REL_Descendant)
-MATCH(match_sib, REL_Sibling)
-
-static void
-match_attr(
- Element_t *e,
- char **av
-)
-{
- char *atval;
-
- if ((atval = FindAttValByName(e, av[1])) && !strcmp(av[2], atval))
- PrElemPlusID(e);
-}
-
-static void
-match_cont(
- Element_t *e,
- char **av
-)
-{
- int i;
- for (i=0; i<e->ncont; i++) {
- if (IsContData(e,i) && strstr(ContData(e,i), av[1])) {
- PrElemPlusID(e);
- return;
- }
- }
-}
-
-/* Find an element, given the criteria on its command line.
- * Arguments:
- * Pointer to element under consideration.
- */
-static void
-do_find(
- Element_t *e,
- char **av
-)
-{
- av++;
- if (!strcmp(av[0], ".")) av++;
- else e = DocTree;
- if (!strcmp(av[0], "gi")) DescendTree(e, match_gi, 0, 0, av);
- else if (!strcmp(av[0], "attr")) DescendTree(e, match_attr, 0, 0, av);
- else if (!strcmp(av[0], "parent")) DescendTree(e, match_parent, 0, 0, av);
- else if (!strcmp(av[0], "child")) DescendTree(e, match_child, 0, 0, av);
- else if (!strcmp(av[0], "cont")) DescendTree(e, match_cont, 0, 0, av);
- else if (!strcmp(av[0], "sib")) DescendTree(e, match_sib, 0, 0, av);
- else if (!strcmp(av[0], "desc")) DescendTree(e, match_desc, 0, 0, av);
- else if (!strcmp(av[0], "anc")) DescendTree(e, match_anc, 0, 0, av);
- else fprintf(stderr, "Unknown find command: %s.\n", av[0]);
-}
-
-/* ______________________________________________________________________ */
diff --git a/usr.bin/sgmls/instant/general.h b/usr.bin/sgmls/instant/general.h
deleted file mode 100644
index f6e6ea0..0000000
--- a/usr.bin/sgmls/instant/general.h
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Common definitions for "instant" program.
- * ________________________________________________________________________
- */
-
-#ifdef STORAGE
-#ifndef lint
-static char *gen_h_RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/general.h,v 1.5 1996/06/11 20:25:03 fld Exp $";
-#endif
-#endif
-
-/* string/numeric/character definitions */
-
-#define EOS '\0'
-#define NL '\n'
-#define TAB '\t'
-#define CR '\r'
-#define ANCHOR '^'
-
-/* bigmask/flags for the Split() function */
-#define S_STRDUP 0x01
-#define S_ALVEC 0x02
-
-/* Command codes (1st char of esis lines) from sgmls. See its manpage. */
-#define CMD_DATA '-'
-#define CMD_OPEN '('
-#define CMD_CLOSE ')'
-#define CMD_ATT 'A'
-#define CMD_D_ATT 'D'
-#define CMD_NOTATION 'N'
-#define CMD_EXT_ENT 'E'
-#define CMD_INT_ENT 'I'
-#define CMD_SYSID 's'
-#define CMD_PUBID 'p'
-#define CMD_FILENAME 'f'
-#define CMD_LINE 'L'
-#define CMD_PI '?'
-#define CMD_SUBDOC 'S'
-#define CMD_SUBDOC_S '{'
-#define CMD_SUBDOC_E '}'
-#define CMD_EXT_REF '&'
-#define CMD_APPINFO '#'
-#define CMD_CONFORM 'C'
-
-/* Some sizes */
-#define MAX_DEPTH 40
-#define LINESIZE 60000
-
-/* Name of library env variable, and default value. */
-#ifndef TPT_LIB
-#define TPT_LIB "TPT_LIB"
-#endif
-#ifndef DEF_TPT_LIB
-#define DEF_TPT_LIB "/usr/share/sgml/transpec"
-#endif
-
-/* Relationships - for querying */
-typedef enum {
- REL_None, REL_Parent, REL_Child, REL_Ancestor, REL_Descendant,
- REL_Sibling, REL_Preceding, REL_ImmPreceding, REL_Following,
- REL_ImmFollowing, REL_Cousin, REL_Unknown
-} Relation_t;
-
-/* Initial map sizes (IMS) */
-#define IMS_relations 3
-#define IMS_setvar 3
-#define IMS_incvar 3
-#define IMS_sdata 50
-#define IMS_sdatacache 30
-#define IMS_variables 20
-#define IMS_attnames 50
-#define IMS_elemnames 50
-
-/* ----- typedef and other misc definitions ----- */
-
-#ifndef TRUE
-#define TRUE (1 == 1)
-#endif
-
-#ifndef FALSE
-#define FALSE (1 == 0)
-#endif
-
-typedef short bool;
-
-
-/* ----- structure definitions ----- */
-
-/* We use this for variables, attributes, etc., so the caller only needs an
- * opaque handle to the thing below, not worrying about array management. */
-typedef struct {
- char *name; /* name of the thing */
- char *sval; /* string value */
-} Mapping_t;
-
-typedef struct {
- int n_alloc; /* number of elements allocated */
- int n_used; /* number of elements used */
- int slot_incr; /* increment for allocating slots */
- int flags; /* info about this set of mappings */
- Mapping_t *maps; /* array of mappings */
-} Map_t;
-
-/* ______________________________________________________________________ */
-
-/* Information about an entity reference. Not all fields will be used
- * at once. */
-typedef struct _ent {
- char *type; /* entity type */
- char *ename; /* entity name */
- char *nname; /* notation name */
- char *sysid; /* sys id */
- char *pubid; /* pub id */
- char *fname; /* filename */
- struct _ent *next; /* next in linked list */
-} Entity_t;
-
-/* Content (child nodes) of an element (node in the tree) -- both data
- * and other elements. */
-typedef struct {
- char type; /* element, data, or pi? */
- union {
- struct _elem *elem; /* direct children of this elem */
- char *data; /* character data of this elem */
- } ch;
-} Content_t;
-
-/* An element (node in the tree) */
-typedef struct _elem {
- char *gi; /* element GI */
- Content_t *cont; /* content - element & data children */
- int ncont; /* # of content/children */
- struct _elem **econt; /* element children */
- int necont; /* # of element children */
- char **dcont; /* character data children */
- int ndcont; /* # of data children */
- Mapping_t *atts; /* array of attributes */
- int natts; /* # of attributes */
- Entity_t *entity; /* ext entity & notation info */
- char *id; /* for linking */
- int index; /* an internal bookkeeping mechanism */
- int depth; /* how deep in tree */
- int lineno; /* line number */
- char *infile; /* input filename */
- int my_eorder; /* order of this elem of its parent */
- struct _elem *parent; /* this elem's direct parent */
- struct _elem *next; /* kept in linked list */
- void *trans; /* pointer to translation spec */
- /* I'm not crazy about this, but it works */
- int gen_trans[2]; /* refs to generated trans specs */
- int processed; /* was this node processed? */
-} Element_t;
-
-/* For mapping of element IDs to elements themselves. */
-typedef struct id_s {
- char *id; /* ID of the element */
- Element_t *elem; /* pointer to it */
- struct id_s *next;
-} ID_t;
-
-/* ----- global variable declarations ----- */
-
-#ifdef STORAGE
-# define def
-#else
-# define def extern
-#endif
-
-def Element_t *DocTree; /* root of document tree */
-def char **UsedElem; /* a unique list of used elem names */
-def int nUsedElem; /* number of used elem names */
-def char **UsedAtt; /* a unique list of used attrib names */
-def int nUsedAtt; /* number of used attrib names */
-def ID_t *IDList; /* list of IDs used in the doc */
-def Map_t *Variables; /* general, global variables */
-def Map_t *SDATAmap; /* SDATA mappings */
-def Map_t *PImap; /* Processing Instruction mappings */
-def Entity_t *Entities; /* list of entities */
-
-def FILE *outfp; /* where output is written */
-def char *tpt_lib; /* TPT library directory */
-def int verbose; /* flag - verbose output? */
-def int warnings; /* flag - show warnings? */
-def int interactive; /* flag - interactive browsing? */
-def int slave; /* are we slave to another process? */
-def int fold_case; /* flag - fold case of GIs? */
-
-/* ----- some macros for convenience and ease of code reading ----- */
-
-#define stripNL(s) { char *_cp; if ((_cp=strchr(s, NL))) *_cp = EOS; }
-
-/* Similar to calloc(), malloc(), and realloc(), but check for success.
- * Args to all:
- * (1) number of 'elements' to allocate
- * (2) variable to point at allocated space
- * (3) type of 'element'
- * Eg: Calloc(5, e, Element_t) replaces
- * if (!(e = (Element_t *)calloc(5, sizeof(Element_t))) {
- * ... handle error ... ;
- * }
- */
-#define Calloc(N,V,T) \
- { if (!((V) = (T *)calloc((size_t)N, sizeof(T)))) { \
- perror("Calloc failed -- out of memory. Bailing out."); exit(1); \
- }; memset((void *) (V), 0, (size_t) sizeof(T)); }
-#define Malloc(N,V,T) \
- { if (!((V) = (T *)malloc((size_t)N*sizeof(T)))) { \
- perror("Malloc failed -- out of memory. Bailing out."); exit(1); \
- }; memset((void *) (V), 0, (size_t) sizeof(T)); }
-#define Realloc(N,V,T) \
- { if (!((V) = (T *)realloc(V,(size_t)N*sizeof(T)))) { \
- perror("Realloc failed -- out of memory. Bailing out."); exit(1); \
- } }
-
-/* similar to strcmp(), but check first chars first, for efficiency */
-#define StrEq(s1,s2) (s1[0] == s2[0] && !strcmp(s1,s2))
-
-/* similar to isspace(), but check for blank or tab - without overhead
- * of procedure call */
-#define IsWhite(c) (c == ' ' || c == TAB || c == NL)
-
-#define ContType(e,i) (e->cont[i].type)
-#define ContData(e,i) (e->cont[i].ch.data)
-#define ContElem(e,i) (e->cont[i].ch.elem)
-#define IsContData(e,i) (e->cont[i].type == CMD_DATA)
-#define IsContElem(e,i) (e->cont[i].type == CMD_OPEN)
-#define IsContPI(e,i) (e->cont[i].type == CMD_PI)
-
-/* ----- function prototypes ----- */
-
-/* things defined in util.c */
-Element_t *QRelation(Element_t *, char *, Relation_t);
-Relation_t FindRelByName(char *);
-char *FindAttValByName(Element_t *, char *);
-char *FindContext(Element_t *, int, char *);
-char *AddElemName(char *);
-char *AddAttName(char *);
-char *ExpandString(char *);
-void OutputString(char *, FILE *, int);
-char *LookupSDATA(char *);
-FILE *OpenFile(char *);
-char *FilePath(char *);
-char *FindElementPath(Element_t *, char *);
-char *NearestOlderElem(Element_t *, char *);
-void PrintLocation(Element_t *, FILE *);
-char **Split(char *, int *, int);
-void DescendTree(Element_t *, void(*)(), void(*)(), void(*)(), void *);
-Map_t *NewMap(int);
-Mapping_t *FindMapping(Map_t *, const char *);
-char *FindMappingVal(Map_t *, const char *);
-void SetMapping(Map_t *, const char *);
-void SetMappingNV(Map_t *, const char *, const char *);
-void AddID(Element_t *, char *);
-Element_t *FindElemByID(char *);
-
-/* things defined in translate.c */
-void DoTranslate(Element_t*, FILE *);
-void ExpandVariables(char*, char*, Element_t*);
-
-/* things defined in traninit.c */
-void ReadTransSpec(char *);
-
-/* things defined in tranvar.c */
-char *Get_A_C_value(const char *);
-
-/* things defined in info.c */
-void PrintContext(Element_t *e);
-void PrintElemSummary(Element_t *);
-void PrintElemTree(Element_t *);
-void PrintStats(Element_t *);
-void PrintIDList();
-
-/* things defined in table.c */
-void CALStable(Element_t *, FILE *, char **, int);
-
-/* ----- other declarations ----- */
-
-#ifdef ultrix
-#define strdup(s) strcpy((char *)malloc(strlen(s)+1), s)
-#endif
-
diff --git a/usr.bin/sgmls/instant/hyper.c b/usr.bin/sgmls/instant/hyper.c
deleted file mode 100644
index 4f50b97..0000000
--- a/usr.bin/sgmls/instant/hyper.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Hypermedia-related facilities.
- *
- * Entry points for this module:
- * AddID(elem, idval) add elem-id pair to list of known ids
- * FindElemByID(idval) find elem by id
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/hyper.c,v 1.2 1996/06/02 21:46:10 fld Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/types.h>
-
-#include "general.h"
-
-
-/* ______________________________________________________________________ */
-
-void
-AddID(Element *e, char *idval)
-{
- static ID *id_last;
- if (!IDList) {
- Calloc(1, id_last, ID);
- IDList = id_last;
- }
- else {
- Calloc(1, id_last->next, ID);
- id_last = id_last->next;
- }
- id_last->elem = e;
- id_last->id = idval;
-}
-
-Element *
-FindElemByID(char *idval)
-{
- ID *id;
- for (id=IDList; id; id=id->next)
- if (!strcmp(id->id, idval)) return id->elem;
- return 0;
-}
-
-/* ______________________________________________________________________ */
-
diff --git a/usr.bin/sgmls/instant/info.c b/usr.bin/sgmls/instant/info.c
deleted file mode 100644
index 27ab1c7..0000000
--- a/usr.bin/sgmls/instant/info.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Functions for printing information about an instance in the 'instant'
- * program. Most of these are fairly short and simple.
- *
- * Entry points for this module:
- * PrintElemSummary(elem) print summary info of each element
- * PrintContext(elem) print context of each element
- * PrintElemTree(elem) print tree of document
- * PrintStats(elem) print statistics about doc tree
- * PrintIDList(elem) print list of IDs and element context
- * Most Print*() functions start at subtree pointed to by 'elem'.
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/info.c,v 1.2 1996/06/02 21:46:10 fld Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include "general.h"
-
-/* ______________________________________________________________________ */
-/* Print a summary of each tag use in the instance. Things like depth in
- * the tree, number of children, parent, attributes.
- */
-
-/* Do the actual printing. Print the info about the node. If null,
- * print a header for the columns.
- * Arguments:
- * Pointer to element structure of the node to print.
- */
-static void
-print_summ(
- Element_t *e
-)
-{
- int i, n, dsize;
- char *hfmt="%-18.18s %4s %5s %4s %4s %s\n";
- char *fmt ="%-18.18s %4d %5d %4d %4d %s\n";
-
- if (e == NULL) {
- fprintf(outfp, hfmt, "Element", "Att", "Data", "Chd", "Dep", "Parent");
- return;
- }
- for (i=0,n=0; i<e->ncont; i++) if (IsContElem(e,i)) n++;
- for (i=0,dsize=0; i<e->ncont; i++)
- if (IsContElem(e,i)) dsize += strlen(e->cont[i].ch.data);
- fprintf(outfp, fmt, e->gi, e->natts, dsize, n, e->depth,
- e->parent ? e->parent->gi : "-");
-
- for (i=0; i<e->natts; i++) {
- fprintf(outfp, "%45d: %s = %s\n", i, e->atts[i].name,
- e->atts[i].sval ? e->atts[i].sval : "empty");
- }
-}
-
-/* Descend the tree, calling processing routine.
- * Arguments:
- * Pointer to element structure at top of tree to traverse.
- */
-void
-PrintElemSummary(
- Element_t *e
-)
-{
- print_summ(0);
- DescendTree(e, print_summ, 0, 0, 0);
-}
-
-/* ______________________________________________________________________ */
-/* Print the context of each tag in the instance (i.e. the tag with its
- * ancestors).
- */
-
-/* Do the actual printing. Print the context of the node.
- * Arguments:
- * Pointer to element structure of the node to print.
- */
-static void
-print_context(
- Element_t *e
-)
-{
- char buf[LINESIZE];
-
- fprintf(outfp, "%-22s %s\n", e->gi, FindContext(e, 10, buf));
-}
-
-/* Descend the tree, calling processing routine.
- * Arguments:
- * Pointer to element structure at top of tree to traverse.
- */
-void
-PrintContext(
- Element_t *e
-)
-{
- fprintf(outfp, "%-22s %s\n", "Element", "Context");
- fprintf(outfp, "%-22s %s\n", "---------------", "-----------");
- DescendTree(e, print_context, 0, 0, 0);
-
- putc(NL, outfp);
-}
-
-/* ______________________________________________________________________ */
-/* Print tree of the instance. GI's are printed indented by their depth
- * in the tree.
- */
-
-/* Do the actual printing. Print the element name, indented the right amount.
- * Arguments:
- * Pointer to element structure of the node to print.
- */
-static void
-print_indent(
- Element_t *e
-)
-{
- int i, ne, nd;
- for(i=0; i<e->depth; i++) fputs(". ", outfp);
- for(i=0,ne=0; i<e->ncont; i++) if (IsContElem(e,i)) ne++;
- for(i=0,nd=0; i<e->ncont; i++) if IsContData(e,i) nd++;
- fprintf(outfp, "%s (%d,%d)\n", e->gi, ne, nd);
-}
-
-/* Descend the tree, calling processing routine.
- * Arguments:
- * Pointer to element structure at top of tree to traverse.
- */
-void
-PrintElemTree(
- Element_t *e
-)
-{
- DescendTree(e, print_indent, 0, 0, 0);
- putc(NL, outfp);
-}
-
-/* ______________________________________________________________________ */
-/* Print some statistics about the instance.
- */
-
-/* Accumulate the totals for the statistics.
- * Arguments:
- * Pointer to element structure of the node to print.
- * Pointer to the total number of elements.
- * Pointer to the total amount of content data.
- * Pointer to the maximum depth of tree.
- */
-static void
-acc_tots(
- Element_t *e,
- int *tot_el,
- int *tot_data,
- int *max_depth
-)
-{
- int i;
- for(i=0; i<e->necont; i++)
- acc_tots(e->econt[i], tot_el, tot_data, max_depth);
- for (i=0; i<e->necont; i++) (*tot_el)++;
- for (i=0; i<e->ndcont; i++) (*tot_data) += strlen(e->dcont[i]);
- if (e->depth > (*max_depth)) *max_depth = e->depth;
-}
-
-/* Descend the tree (recursively), collecting the statistics.
- * Arguments:
- * Pointer to element structure of the node to print.
- * Pointer to the total number of elements.
- * Pointer to the total amount of content data.
- * Pointer to the maximum depth of tree.
- */
-static void
-elem_usage(
- Element_t *e,
- char *name,
- int *n_used,
- int *nchars
-)
-{
- int i;
- if (!strcmp(name, e->gi)) {
- (*n_used)++;
- for (i=0; i<e->ncont; i++)
- if (IsContData(e,i)) (*nchars) += strlen(ContData(e,i));
- }
- for(i=0; i<e->necont; i++)
- elem_usage(e->econt[i], name, n_used, nchars);
-}
-
-/* Descend the tree, calling processing routine.
- * Arguments:
- * Pointer to element structure at top of tree to traverse.
- */
-void
-PrintStats(
- Element_t *top
-)
-{
- int i, n;
- int dif_el=0, tot_el=0, tot_data=0, nchars, max_depth=0;
- float pct;
-
- fprintf(outfp, "%-22s %s %s\n", "Element name", "Occurrances", "Character Content");
- fprintf(outfp, "%-22s %s %s\n", "---------------", "-----------", "-----------------");
-
- acc_tots(top, &tot_el, &tot_data, &max_depth);
-
- for (i=0; i<nUsedElem; i++) {
- n = 0;
- nchars = 0;
- elem_usage(top, UsedElem[i], &n, &nchars);
- if (n > 0) {
- pct = 100.0 * (float)n / (float)tot_el;
- fprintf(outfp, "%-22s %4d %4.1f%% %6d %4d\n", UsedElem[i],
- n, pct, nchars, (nchars/n));
- dif_el++;
- }
- }
-
- fprintf(outfp, "\nTotal of %d elements used, %d different ones.\n",
- tot_el, dif_el);
- fprintf(outfp, "Total character data: %d.\n", tot_data);
- fprintf(outfp, "Maximum element depth: %d.\n", max_depth);
- putc(NL, outfp);
-}
-
-/* ______________________________________________________________________ */
-/* Print list of: ID, GI, input file, line number, separated by colons.
- * This is better for other programs to manipulate (like for keeping a
- * database of IDs in documents) than humans to read.
- */
-
-void
-PrintIDList()
-{
- ID_t *id;
- Element_t *ep;
-
- for (id=IDList; id; id=id->next) {
- ep = id->elem;
- fprintf(outfp, "%s:%s:%s:%d\n", id->id, ep->gi,
- ep->infile?ep->infile:"-", ep->lineno);
- }
-}
-
-/* ______________________________________________________________________ */
-
diff --git a/usr.bin/sgmls/instant/instant.1 b/usr.bin/sgmls/instant/instant.1
deleted file mode 100644
index 513c84d..0000000
--- a/usr.bin/sgmls/instant/instant.1
+++ /dev/null
@@ -1,183 +0,0 @@
-...\"
-...\" Copyright (c) 1994
-...\" Open Software Foundation, Inc.
-...\"
-...\" Permission is hereby granted to use, copy, modify and freely distribute
-...\" the software in this file and its documentation for any purpose without
-...\" fee, provided that the above copyright notice appears in all copies and
-...\" that both the copyright notice and this permission notice appear in
-...\" supporting documentation. Further, provided that the name of Open
-...\" Software Foundation, Inc. ("OSF") not be used in advertising or
-...\" publicity pertaining to distribution of the software without prior
-...\" written permission from OSF. OSF makes no representations about the
-...\" suitability of this software for any purpose. It is provided "as is"
-...\" without express or implied warranty.
-...\"
-...\" Copyright (c) 1996 X Consortium
-...\" Copyright (c) 1996 Dalrymple Consulting
-...\"
-...\" Permission is hereby granted, free of charge, to any person obtaining a copy
-...\" of this software and associated documentation files (the "Software"), to deal
-...\" in the Software without restriction, including without limitation the rights
-...\" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-...\" copies of the Software, and to permit persons to whom the Software is
-...\" furnished to do so, subject to the following conditions:
-...\"
-...\" The above copyright notice and this permission notice shall be included in
-...\" all copies or substantial portions of the Software.
-...\"
-...\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-...\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-...\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-...\" X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
-...\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-...\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-...\" OTHER DEALINGS IN THE SOFTWARE.
-...\"
-...\" Except as contained in this notice, the names of the X Consortium and
-...\" Dalrymple Consulting shall not be used in advertising or otherwise to
-...\" promote the sale, use or other dealings in this Software without prior
-...\" written authorization.
-...\"
-...\" Translated with /usr/local/lib/tpt/ref-man.ts by fld on cord, Wed 07 Feb 1996, 21:59
-.Dd September 5, 1996
-.Os FreeBSD 2.2
-.Dt SGMLFMT 1
-.Sh "NAME"
-instant - manipulates ESIS from parsed SGML instance
-.Sh "Synopsis"
-.na
-.Pp
-\fBinstant\fP [ \fB-bhuvxHISW\fP ] [ \fB-t\fP \fIfile\fP] [ \fB-o\fP \fIfile\fP] [ \fB-D\fP \fIvariable\fP\fB=\fP\fIvalue\fP ...] [ \fB-i\fP \fIid\fP] [ \fB-l\fP \fIdirectory\fP] [\fIfile\fP]
-.ad
-.Sh "DESCRIPTION"
-.Pp
-The \fBinstant\fP program manipulates an SGML document instance in a variety of ways,
-including translating into a form suitable for a formatting application and printing information about this instance.
-Input to \fBinstant\fP is the output of \fBsgmls\fP, whose format is called Element Structure Information Set (ESIS).
-.Sh "FLAGS"
-.Pp
-The following are the possible command line options to \fBinstant\fP. Output is sent to the standard output, except where otherwise noted.
-.\"'br\" labeled list
-.Bl -tag -width Ds
-.It "\fB-t\fP \fIfile\fP"
-Translate the SGML instance to another form, usually suitable for a formatting application.
-The \fIfile\fP is called a translation spec, which specifies how the tags are to be translated. See \fBtranspec\fP(4).
-By convention, names for \fIfile\fP use the suffix \fB.ts\fP, for \fItranslation spec\fP.
-.It "\fB-d\fP"
-"Data hack" \(em strip newline at the beginning of data records
-.It "\fB-f \fIlength\fR"
-Set the threshold for the length, in characters,
-of an <Entry>, over which it is called a block of filled text, to \fIlength\fR.
-.It "\fB-o\fP \fIfile\fP "
-Write all output (except error and warning messages) to file \fIfile\fP. By default, output goes to stdout.
-.It "\fB-h\fP"
-Print a text representation of the hierarchy of the instance elements.
-The deeper an element is in the tree, the more it is indented. The data content is not printed.
-.It "\fB-u\fP"
-Print a summary of the usage of each element in the instance.
-Information given includes attributes, number of children, and depth in the hierarchy.
-.It "\fB-S\fP"
-Print some statistics about element usage in the instance, including how often each element is used
-and how much PCDATA is contained.
-.It "\fB-x\fP"
-Print the context of each element in the instance, from each element to the root of the document tree.
-.It "\fB-v\fP"
-Validate the SGML instance based on the set of constraints or descriptions in the transpec file.
-This flags tells \fBinstant\fP to turn off normal output, leaving only diagnostics.
-.It "\fB-l\fP \fIdirectory\fP"
-Try to read the translation specs or other files from in the directory \fIdirectory\fP
-if not found in the current directory.
-This is called the library directory.
-The environment variable \fITPT_LIB\fP may also be used to specify this.
-.It "\fB-b\fP"
-Interactive browser mode. The user is prompted for actions,
-which include moving among and examining the various nodes in the hierarchy of the instance, displaying information about them, etc.
-.It "\fB-I\fP"
-List the IDs of all elements in the instance that have an ID. The format is more suitable for other programs than humans.
-Lines show the ID, element GI, filename, and line, separated by colons.
-(This depends on the \fB-l\fP option to \fBsgmls\fP which provide filenames and line numbers.)
-.It "\fB-i\fP \fIid\fP"
-When translating the instance, begin processing at the element whose ID is \fIid\fP instead of the topmost element.
-.It "\fB-D\fP \fIvariable\fP\fB=\fP\fIvalue\fP"
-Define the variable \fIvariable\fP with value \fIvalue\fP.
-.It "\fB-W\fP"
-Do not print warning messages.
-.It "\fB-H\fP"
-Print a help message briefly describing the options.
-.It "\fIfile\fP"
-Read the instance from the file \fIfile\fP.
-This is expected to be the output of the program \fBsgmls\fP.
-If not specified, \fBinstant\fP reads the instance from its standard input.
-.El
-.\"'br\" labeled list end
-.Pp
-In some cases it makes no sense to combine options.
-This is especially true if one of the options is to perform a translation. No checking is done for this.
-.Sh "INTERACTIVE BROWSER"
-.Pp
-These are the commands to the interactive browser:
-.Bl -tag -width Ds
-.\"'br\" labeled list
-.It "\fBcd\fP \fIargs ...\fP"
-Change to a different element in the hierarchy.
-\fBcd\fP \fBid\fP \fIid\fP will change to the element whose ID is \fIid\fP.
-\fBcd\fP \fIN\fP will change to the \fIN\fPth child element of the current element.
-Several values of \fIN\fP may be specified, so the program will change to successively descending elements in the hierarchy.
-The string \fB..\fP may appear for \fIN\fP to move up a level in the hierarchy (like in a unix file system).
-A \fB/\fP may be specified for \fIN\fP to change to the top of the hierarchy.
-.It "\fBcont\fP"
-Print the context of each element.
-.It "\fBdata\fP \fIN\fP"
-Show the data content (PCDATA, RCDATA, and DATA) of child node N.
-.It "\fBfind\fP \fIspec\fP"
-Find paths to elements matching \fIspec\fP, where \fIspec\fP may be one of:
-.Bl -tag -width Ds
-.\".RS +\n(INu
-.It "\fBparent\fP \fIgi\fP"
-Find all elements whose parent element is \fIgi\fP.
-.It "\fBchild\fP \fIgi\fP"
-Find all elements which have a child element \fIgi\fP.
-.It "\fBgi\fP \fIgi\fP"
-Find all elements whose name is \fIgi\fP.
-.It "\fBattr\fP \fIname\fP \fIvalue\fP"
-Find all elements that have a attribute \fIname\fP that have a value \fIvalue\fP.
-.\".RE
-.El
-.It "\fBid\fP \fIID\fP"
-Show location of element whose ID is \fIID\fP.
-If \fIID\fP is \fB?\fP, it will list all IDs with the paths to them.
-.It "\fBls\fP"
-List information about the current element in the hierarchy.
-This includes element name, line number in instance, context, attributes and their values, child elements, data directly within this element,
-and the order of the current element among its siblings.
-.It "\fBq\fP \fIrelation\fP \fIelement\fP"
-Report whether or not the current element has the relation \fIrelation\fP to the named element \fIelement\fP.
-Values of \fIrelation\fP are the same as for \fB_followrel\fP in \fBtranspec\fP reference page.
-.It "\fBstat\fP"
-Show statistics about the hierarchy.
-.It "\fBsum\fP"
-Show a tag usage summary about the hierarchy.
-.It "\fBtran\fP \fIoutfile\fP"
-Write translated output to file \fIoutfile\fP.
-If \fIoutfile\fP is not specified, output is sent to stdout.
-.It "\fBtree\fP"
-Print a textual representation of the hierarchy of the instance, where deeper elements are indented more.
-.It "\fBwhere\fP"
-Show current position in the hierarchy.
-.It "<\fBcontrol-D\fP>"
-Exits the program.
-.El
-.Pp
-The \fBstat\fP, \fBsum\fP, \fBtree\fP, \fBcont\fP commands take an optional first argument (of any value),
-which means to only consider the entire instance instead of the hierarchy from the current element.
-.Sh "FILES"
-.Bl -tag -width Ds
-.It "\fIfile\fP\fB.ts\fP"
-Translation specification file.
-.El
-.Sh "SEE ALSO"
-.Pp
-.Xr transpec 5 ,
-.Xr sgmls 1 ,
-Standard Generalized Markup Language (SGML), ISO 8879.
diff --git a/usr.bin/sgmls/instant/main.c b/usr.bin/sgmls/instant/main.c
deleted file mode 100644
index 2f10537..0000000
--- a/usr.bin/sgmls/instant/main.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Program to read an SGML document instance, creating any of several things:
- *
- * "translated" output for formatting applications (given a trans. spec)
- * validation report (given a appropriate trans spec)
- * tree of the document's structure
- * statistics about the element usage
- * summary of the elements used
- * context of each element used
- * IDs of each element
- *
- * A C structure is created for each element, which includes:
- * name, attributes, parent, children, content
- * The tree is descended, and the desired actions performed.
- *
- * Takes input from James Clark's "sgmls" program (v. 1.1).
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /home/ncvs/src/usr.bin/sgmls/instant/main.c,v 1.1.1.1 1996/09/08 01:55:10 jfieber Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <memory.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <time.h>
-#include <locale.h>
-
-#define STORAGE
-#include "general.h"
-
-static int do_context, do_tree, do_summ, do_stats, do_validate, do_idlist;
-static int do_DATAhack = 0;
-static char *this_prog;
-static char *in_file, *out_file;
-static char *tranfile;
-static char *start_id;
-static char *last_file;
-static int last_lineno;
-
-extern int BOFTTextThresh;
-
-/* forward references */
-static void HandleArgs(int, char *[]);
-static void Initialize1();
-static void Initialize2();
-static void ReadInstance(char *);
-static void DoHelpMessage();
-extern void Browse();
-
-/* external reference to version number */
-char _HeadVeRsIoN_[] = "1.0 (FreeBSD)";
-
-/* ______________________________________________________________________ */
-/* Program entry point. Look at args, read instance, dispatch to the
- * correct routines to do the work, and finish.
- */
-
-int
-main(
- int ac,
- char *av[]
-)
-{
- setlocale(LC_ALL, "");
- Initialize1(av[0]);
- HandleArgs(ac, av);
- Initialize2();
-
- if (tranfile) ReadTransSpec(tranfile);
- ReadInstance(in_file);
-
- if (interactive) {
- Browse(); /* this will handle interactive commands */
- }
- else {
- /* Perform tasks based on command line flags... */
- if (tranfile) {
- Element_t *e;
- /* If user wants to start at a particular ID, point to that
- * element. Else, point to the top of the tree. */
- if (start_id) {
- if (!(e=FindElemByID(start_id))) {
- fprintf(stderr, "Error: Can not find element with ID %s\n",
- start_id);
- exit(1);
- }
- }
- else e = DocTree;
- /* If we're doing validation, make output file pointer null.
- * This means that we generate no output, except error messages. */
- if (do_validate) outfp = NULL;
- if (tranfile)
- DoTranslate(e, outfp);
- else
- fprintf(stderr, "Translation spec file not specified. Skipping translation.\n");
- }
- if (do_summ) PrintElemSummary(DocTree);
- if (do_tree) PrintElemTree(DocTree);
- if (do_stats) PrintStats(DocTree);
- if (do_context) PrintContext(DocTree);
- if (do_idlist) PrintIDList();
- }
- if (out_file && outfp) fclose(outfp);
-
- return 0;
-}
-
-/* ______________________________________________________________________ */
-/* Initialization stuff done before dealing with args.
- * Arguments:
- * Name of program (string).
- */
-
-static void
-Initialize1(
- char *myname
-)
-{
- time_t tnow;
- struct tm *nowtm;
- char *cp, buf[100];
- extern int gethostname(char *, int); /* not in a system .h file... */
-
- /* where we try to find data/library files */
- if (!(tpt_lib=getenv(TPT_LIB))) tpt_lib = DEF_TPT_LIB;
-
- /* set some global variables */
- warnings = 1;
- fold_case = 1;
- this_prog = myname;
-
- /* setup global variable mapping */
- Variables = NewMap(IMS_variables);
-
- /* set some pre-defined variables */
- SetMappingNV(Variables, "user", (cp=getenv("USER")) ? cp : "UnknownUser" );
- time(&tnow);
- nowtm = localtime(&tnow);
- strftime(buf, 100, "%a %d %b %Y, %R", nowtm);
- SetMappingNV(Variables, "date", buf);
- if (gethostname(buf, 100) < 0) strcpy(buf, "unknown-host");
- SetMappingNV(Variables, "host", buf);
- SetMappingNV(Variables, "transpec", tranfile ? tranfile : "??");
-}
-
-/* Initialization stuff done after dealing with args. */
-
-static void
-Initialize2()
-{
- SetMappingNV(Variables, "transpec", tranfile ? tranfile : "??");
-
- /* If user wants to send output to a file, open the file, and set
- * the file pointer. Else we send output to standard out. */
- if (out_file) {
- if (!(outfp = fopen(out_file, "w"))) {
- fprintf(stderr, "Could not open output '%s' file for writing.\n%s",
- out_file, strerror(errno));
- exit(1);
- }
- }
- else outfp = stdout;
-}
-
-/* ______________________________________________________________________ */
-/* Set a variable. If it is one of the "known" variables, set the
- * variable in the C code (this program).
- * Arguments:
- * Variable name/value string - separated by an '=' (eg, "myname=Sally").
- */
-static void
-CmdLineSetVariable(
- char *var
-)
-{
- char *cp, buf[100], **tok;
- int n;
-
- /* Turn '=' into a space, to isolate the name. Then set variable. */
- strcpy(buf, var);
- if ((cp=strchr(buf, '='))) {
- /* we have "var=value" */
- *cp = ' ';
- n = 2;
- tok = Split(buf, &n, 0);
- /* see if variable name matches one of our internal ones */
- if (!strcmp(tok[0], "verbose")) verbose = atoi(tok[1]);
- else if (!strcmp(tok[0], "warnings")) warnings = atoi(tok[1]);
- else if (!strcmp(tok[0], "foldcase")) fold_case = atoi(tok[1]);
- else SetMappingNV(Variables, tok[0], tok[1]);
- }
- else {
- fprintf(stderr, "Expected an '=' in variable assignment: %s. Ignored\n",
- var);
- }
-}
-
-/* ______________________________________________________________________ */
-/* Bounce through arguments, setting variables and flags.
- * Arguments:
- * Argc and Argv, as passed to main().
- */
-static void
-HandleArgs(
- int ac,
- char *av[]
-)
-{
- int c, errflag=0;
- extern char *optarg;
- extern int optind;
-
- while ((c=getopt(ac, av, "df:t:v:o:huSxIl:bHVWi:D:Z")) != -1) {
- switch (c) {
- case 't': tranfile = optarg; break;
- case 'v': do_validate = 1; break;
- case 'h': do_tree = 1; break;
- case 'u': do_summ = 1; break;
- case 'S': do_stats = 1; break;
- case 'x': do_context = 1; break;
- case 'I': do_idlist = 1; break;
- case 'l': tpt_lib = optarg; break;
- case 'i': start_id = optarg; break;
- case 'o': out_file = optarg; break;
- case 'd': do_DATAhack = 1; break;
- case 'f': BOFTTextThresh = atoi(optarg); break;
- case 'b': interactive = 1; break;
- case 'W': warnings = 0; break;
- case 'V': verbose = 1; break;
- case 'Z': slave = 1; break;
- case 'H': DoHelpMessage(); exit(0); break;
- case 'D': CmdLineSetVariable(optarg); break;
- case '?': errflag = 1; break;
- }
- if (errflag) {
- fprintf(stderr, "Try '%s -H' for help.\n", this_prog);
- exit(1);
- }
- }
-
- /* input (ESIS) file name */
- if (optind < ac) in_file = av[optind];
-
- /* If doing interactive/browsing, we can't take ESIS from stdin. */
- if (interactive && !in_file) {
- fprintf(stderr,
- "You must specify ESIS file on cmd line for browser mode.\n");
- exit(1);
- }
-}
-
-/* ______________________________________________________________________ */
-/* Simply print out a help/usage message.
- */
-
-static char *help_msg[] = {
- "",
- " -t file Print translated output using translation spec in <file>",
- " -v Validate using translation spec specified with -t",
- " -i id Consider only subtree starting at element with ID <id>",
- " -b Interactive browser",
- " -S Print statistics (how often elements occur, etc.)",
- " -u Print element usage summary (# of children, depth, etc.)",
- " -x Print context of each element",
- " -h Print document hierarchy as a tree",
- " -o file Write output to <file>. Default is standard output.",
- " -l dir Set library directory to <dir>. (or env. variable TPT_LIB)",
- " -I List all IDs used in the instance",
- " -W Do not print warning messages",
- " -H Print this help message",
- " -Dvar=val Set variable 'var' to value 'val'",
- " file Take input from named file. If not specified, assume stdin.",
- " File should be output from the 'sgmls' program (ESIS).",
- NULL
-};
-
-static void
-DoHelpMessage()
-{
- char **s = help_msg;
- printf("usage: %s [option ...] [file]", this_prog);
- while (*s) puts(*s++);
- printf("\nVersion: %s\n", _HeadVeRsIoN_);
-}
-
-/* ______________________________________________________________________ */
-/* Remember an external entity for future reference.
- * Arguments:
- * Pointer to entity structure to remember.
- */
-
-static void
-AddEntity(
- Entity_t *ent
-)
-{
- static Entity_t *last_ent;
-
- if (!Entities) {
- Malloc(1, Entities, Entity_t);
- last_ent = Entities;
- }
- else {
- Malloc(1, last_ent->next, Entity_t);
- last_ent = last_ent->next;
- }
- *last_ent = *ent;
-
-}
-
-/* Find an entity, given its entity name.
- * Arguments:
- * Name of entity to retrieve.
- */
-static Entity_t *
-FindEntity(
- char *ename
-)
-{
- Entity_t *n;
- for (n=Entities; n; n=n->next)
- if (StrEq(ename, n->ename)) return n;
- return 0;
-}
-
-/* Accumulate lines up to the open tag. Attributes, line number,
- * entity info, notation info, etc., all come before the open tag.
- */
-static Element_t *
-AccumElemInfo(
- FILE *fp
-)
-{
- char buf[LINESIZE+1];
- int c;
- int i, na;
- char *cp, *atval;
- Mapping_t a[100];
- Element_t *e;
- Entity_t ent, *ent2;
- char **tok;
- static int Index=0;
- static Element_t *last_e;
-
-
- Calloc(1, e, Element_t);
- memset(&ent, 0, sizeof ent); /* clean space for entity info */
-
- /* Also, keep a linked list of elements, so we can easily scan through */
- if (last_e) last_e->next = e;
- last_e = e;
-
- e->index = Index++; /* just a unique number for identification */
-
- /* in case these are not set for this element in the ESIS */
- e->lineno = last_lineno;
- e->infile = last_file;
-
- na = 0;
- while (1) {
- if ((c = getc(fp)) == EOF) break;
- fgets(buf, LINESIZE, fp);
- stripNL(buf);
- switch (c) {
- case EOF: /* End of input */
- fprintf(stderr, "Error: Unexpectedly reached end of ESIS.\n");
- exit(1);
- break;
-
- case CMD_OPEN: /* (gi */
- e->gi = AddElemName(buf);
- if (na > 0) {
- Malloc(na, e->atts, Mapping_t);
- memcpy(e->atts, a, na*sizeof(Mapping_t));
- e->natts = na;
- na = 0;
- }
- /* Check if this elem has a notation attr. If yes, and there
- is no notation specified, recall the previous one. (feature
- of sgmls - it does not repeat notation stuff if we the same
- is used twice in a row) */
- if (((atval=FindAttValByName(e, "NAME")) ||
- (atval=FindAttValByName(e, "ENTITYREF")) ||
- (atval=FindAttValByName(e, "EXTERNAL"))) && /* HACK */
- (ent2=FindEntity(atval))) {
- e->entity = ent2;
- }
-
- return e;
- break;
-
- case CMD_ATT: /* Aname val */
- i = 3;
- tok = Split(buf, &i, 0);
- if (!strcmp(tok[1], "IMPLIED"))
- break; /* skip IMPLIED atts. */
- else if (!strcmp(tok[1], "CDATA"))
- {
- /* CDATA attributes must have ESIS escape
- sequences and SDATA entities expanded. */
- char *val = ExpandString(tok[2]);
- a[na].name = AddAttName(tok[0]);
- a[na].sval = AddAttName(val);
- free(val);
- na++;
- }
- else if (!strcmp(tok[1], "TOKEN") ||
- !strcmp(tok[1], "ENTITY") ||!strcmp(tok[1], "NOTATION"))
- {
- a[na].name = AddAttName(tok[0]);
- a[na].sval = AddAttName(tok[2]);
- na++;
- }
- else {
- fprintf(stderr, "Error: Bad attr line (%d): A%s %s...\n",
- e->lineno, tok[0], tok[1]);
- }
- break;
-
- case CMD_LINE: /* Llineno */
- /* These lines come in 2 forms: "L123" and "L123 file.sgml".
- * Filename is given only at 1st occurance. Remember it.
- */
- if ((cp = strchr(buf, ' '))) {
- cp++;
- last_file = strdup(cp);
- }
- last_lineno = e->lineno = atoi(buf);
- e->infile = last_file;
- break;
-
- case CMD_DATA: /* -data */
- fprintf(stderr, "Error: Data in AccumElemInfo, line %d:\n%c%s\n",
- e->lineno, c,buf);
- /*return e;*/
- exit(1);
- break;
-
- case CMD_D_ATT: /* Dename name val */
-
- case CMD_NOTATION: /* Nnname */
- case CMD_PI: /* ?pi */
- /* This should be reworked soon, as it
- forces all PI's before the first GI
- to be ignored. -CSS */
- break;
-
- case CMD_EXT_ENT: /* Eename typ nname */
- i = 3;
- tok = Split(buf, &i, 0);
- ent.ename = strdup(tok[0]);
- ent.type = strdup(tok[1]);
- ent.nname = strdup(tok[2]);
- AddEntity(&ent);
- break;
- case CMD_INT_ENT: /* Iename typ text */
- fprintf(stderr, "Error: Got CMD_INT_ENT in AccumElemInfo: %s\n", buf);
- break;
- case CMD_SYSID: /* ssysid */
- ent.sysid = strdup(buf);
- break;
- case CMD_PUBID: /* ppubid */
- ent.pubid = strdup(buf);
- break;
- case CMD_FILENAME: /* ffilename */
- ent.fname = strdup(buf);
- break;
-
- case CMD_CLOSE: /* )gi */
- case CMD_SUBDOC: /* Sename */
- case CMD_SUBDOC_S: /* {ename */
- case CMD_SUBDOC_E: /* }ename */
- case CMD_EXT_REF: /* &name */
- case CMD_APPINFO: /* #text */
- case CMD_CONFORM: /* C */
- default:
- fprintf(stderr, "Error: Unexpected input in AccumElemInfo, %d:\n%c%s\n",
- e->lineno, c,buf);
- exit(1);
- break;
- }
- }
- fprintf(stderr, "Error: End of AccumElemInfo - should not be here: %s\n",
- e->gi);
-/* return e;*/
- exit(1);
-}
-
-/* Read ESIS lines.
- * Limitation? Max 5000 children per node. (done for efficiency --
- * should do some malloc and bookkeeping games later).
- */
-
-static Element_t *
-ReadESIS(
- FILE *fp,
- int depth
-)
-{
- char *buf;
- int i, c, ncont;
- Element_t *e;
- Content_t cont[5000];
-
- Malloc( LINESIZE+1, buf, char );
-
- /* Read input stream - the output of "sgmls", called "ESIS". */
- e = AccumElemInfo(fp);
- e->depth = depth;
-
- ncont = 0;
- while (1) {
- if ((c = getc(fp)) == EOF) break;
- switch (c) {
- case EOF: /* End of input */
- break;
-
- case CMD_DATA: /* -data */
- fgets(buf, LINESIZE, fp);
- stripNL(buf);
- if (do_DATAhack && (buf[0] == '\\') && (buf[1] == 'n')) {
- if ( ! buf[2] )
- break;
- buf[0] = ' ';
- memcpy(&buf[1], &buf[2], strlen(buf)-1);
- }
- cont[ncont].ch.data = ExpandString(buf);
- cont[ncont].type = CMD_DATA;
- ncont++;
- break;
-
- case CMD_PI: /* ?pi */
- fgets(buf, LINESIZE, fp);
- stripNL(buf);
- cont[ncont].type = CMD_PI;
- cont[ncont].ch.data = strdup(buf);
- ncont++;
- break;
-
- case CMD_CLOSE: /* )gi */
- fgets(buf, LINESIZE, fp);
- stripNL(buf);
- if (ncont) {
- e->ncont = ncont;
- Malloc(ncont, e->cont, Content_t);
- for (i=0; i<ncont; i++) e->cont[i] = cont[i];
- }
- free(buf);
- return e;
- break;
-
- case CMD_OPEN: /* (gi */
-/*fprintf(stderr, "+++++ OPEN +++\n");*/
-/* break;*/
-
- case CMD_ATT: /* Aname val */
- case CMD_D_ATT: /* Dename name val */
- case CMD_NOTATION: /* Nnname */
- case CMD_EXT_ENT: /* Eename typ nname */
- case CMD_INT_ENT: /* Iename typ text */
- case CMD_SYSID: /* ssysid */
- case CMD_PUBID: /* ppubid */
- case CMD_FILENAME: /* ffilename */
- ungetc(c, fp);
- cont[ncont].ch.elem = ReadESIS(fp, depth+1);
- cont[ncont].type = CMD_OPEN;
- cont[ncont].ch.elem->parent = e;
- ncont++;
- break;
-
- case CMD_LINE: /* Llineno */
- fgets(buf, LINESIZE, fp);
- break; /* ignore these here */
-
- case CMD_SUBDOC: /* Sename */
- case CMD_SUBDOC_S: /* {ename */
- case CMD_SUBDOC_E: /* }ename */
- case CMD_EXT_REF: /* &name */
- case CMD_APPINFO: /* #text */
- case CMD_CONFORM: /* C */
- default:
- fgets(buf, LINESIZE, fp);
- fprintf(stderr, "Error: Unexpected input at %d: '%c%s'\n",
- e->lineno, c, buf);
- exit(1);
- break;
- }
- }
- fprintf(stderr, "Error: End of ReadESIS - should not be here: %s\n", e->gi);
- free(buf);
- return NULL;
-}
-
-/* ______________________________________________________________________ */
-/* Read input stream, creating a tree in memory of the elements and data.
- * Arguments:
- * Filename where instance's ESIS is.
- */
-static void
-ReadInstance(
- char *filename
-)
-{
- int i, n;
- FILE *fp;
- Element_t *e;
- char *idatt;
-
- if (filename) { /* if we specified input file. else stdin */
- if ((fp=fopen(filename, "r")) == NULL) {
- perror(filename);
- exit(1);
- }
- }
- else fp = stdin;
- last_file = filename;
- DocTree = ReadESIS(fp, 0);
- if (filename) fclose(fp);
-
- /* Traverse tree, filling in econt and figuring out which child
- * (ie. what birth order) each element is. */
- DocTree->my_eorder = -1;
- for (e=DocTree; e; e=e->next) {
-
- /* count element children */
- for (i=0,n=0; i<e->ncont; i++) if (IsContElem(e,i)) n++;
- if (n > 0) Calloc(n, e->econt, Element_t *);
- for (i=0; i<e->ncont; i++)
- if (IsContElem(e,i)) e->econt[e->necont++] = ContElem(e,i);
-
- /* count data children */
- for (i=0,n=0; i<e->ncont; i++) if (IsContData(e,i)) n++;
- if (n > 0) Calloc(n, e->dcont, char *);
- for (i=0; i<e->ncont; i++)
- if (IsContData(e,i)) e->dcont[e->ndcont++] = ContData(e,i);
-
- /* where in child order order */
- for (i=0; i<e->necont; i++)
- e->econt[i]->my_eorder = i;
-
- /* Does this element have an ID? */
- for (i=0; i<e->natts; i++) {
- if ((idatt=FindAttValByName(e, "ID"))) {
- AddID(e, idatt);
- /* remember ID value for quick reference */
- e->id = idatt;
- break;
- }
- }
- }
- return;
-}
-
-/* ______________________________________________________________________ */
diff --git a/usr.bin/sgmls/instant/tables.c b/usr.bin/sgmls/instant/tables.c
deleted file mode 100644
index 54fd211..0000000
--- a/usr.bin/sgmls/instant/tables.c
+++ /dev/null
@@ -1,2013 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Program to manipulate SGML instances.
- *
- * Originally coded for OSF DTD tables, now recoded (fld 3/27/95)
- * for CALS-type tables (fragment taken from the DocBook DTD). Then,
- * *really* upgraded to CALS tables by FLD on 5/28/96.
- *
- * This module is for handling table markup, printing TeX or tbl
- * (tbl) markup to the output stream. Also, table markup checking is
- * done here. Yes, this depends on the DTD, but it makes translation
- * specs much cleaner (and makes some things possible).
- *
- * Incomplete / not implemented / limitations / notes:
- * vertical alignment (valign attr)
- * vertical spanning
- * row separators are for the whole line, not per cell (the prog looks
- * at rowsep for the 1st cell and applies it to the whole row)
- * trusts that units in colwidths are acceptable to LaTeX and tbl
- * "s" is an acceptable shorthand for "span" in model attributes
- *
- * A note on use of OutputString(): Strings with backslashes (\) need lots
- * of backslashes. You have to escape them for the C compiler, and escape
- * them again for OutputString() itself.
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/tables.c,v 1.11 1996/06/15 03:45:02 fld Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <errno.h>
-
-#include <regexp.h>
-#include "general.h"
-#include "translate.h"
-
-/* text width of page, in inches */
-#define TEXTWIDTH 5.5
-#define MAXCOLS 100
-#define SPAN_NOT 0
-#define SPAN_START 1
-#define SPAN_CONT 2
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
-/*table parameters */
-
-#define TBLMAXCOL 30 /* max number of columns in tbl table */
-#define NAMELEN 40 /* max length of a name */
-#define BOFTTHRESHOLD 35 /* text length over which to consider
- * generating a block of filled text */
-
-
-/* handy declarations */
-
-typedef enum { Left, Right, Center, Justify, Char, Span } tblalign;
-
-typedef enum { TGroup, THead, TFoot, TBody } tblsource; /* source of a spec */
-
-
-/* table line format information structures */
-
-struct tblcolspec {
-
- char name[NAMELEN]; /* colspec's name */
- short num; /* column number */
- tblsource source; /* where defined */
-
- tblalign align; /* column's alignment */
- char alignchar; /* character for alignment */
- short aligncharoff; /* offset for alignment */
- char colwidth[10]; /* width for column */
- char colpwidth[10]; /* proportional widths for column */
- bool colsep; /* separator to right of column? */
- bool rowsep; /* separator to bottom of column? */
- short moreRows; /* value for Morerows */
-
- struct tblcolspec * next; /* next colspec */
-};
-
-struct tblspanspec {
-
- char name[NAMELEN]; /* spanspec's name */
- tblsource source; /* where defined */
-
- struct tblcolspec * start; /* start column */
- struct tblcolspec * end; /* end column */
- tblalign align; /* span's alignment */
- char alignchar; /* character for alignment */
- short aligncharoff; /* offset for alignment */
- bool colsep; /* separator to right of column? */
- bool rowsep; /* separator to bottom of column? */
-
- struct tblspanspec * next; /* next spanspec */
-};
-
-struct tblformat {
- short count; /* count of rows matching this spec */
-
- short cols; /* # of columns */
- short rowNum; /* row number */
- char colformat[TBLMAXCOL]; /* per-column formats */
- char colwidth[TBLMAXCOL][10]; /* per-column widths */
- char colpwidth[TBLMAXCOL][10]; /* per-column proportional widths */
- char font[TBLMAXCOL][3]; /* column fonts (headers) */
- bool colsep[TBLMAXCOL]; /* column separators */
- bool rowsep[TBLMAXCOL]; /* row separators */
- short moreRows[TBLMAXCOL]; /* moreRows indicator */
-
- struct tblformat * next; /* for the next row */
-};
-
-
-/* table state info */
-
-static short tblcols = 0; /* number of columns in the table */
-static short tblrow = 0; /* the current row in the table */
-
-static bool tblTGroupSeen = FALSE; /* seen a TGroup in this table yet? */
-
-static char * tblFrame; /* table frame info */
-static bool tblgcolsep; /* global colsep (in table) */
-static bool tblgrowsep; /* global rowsep (in table) */
-
-static int tblBOFTCount = 0; /* count of bofts that we've created
- * (per table) */
-int BOFTTextThresh = BOFTTHRESHOLD;
- /* length of text before we
- * call it a BOFT */
-static bool tblboft = FALSE; /* within a block of filled text? */
-static bool tblinBOFT = FALSE; /* within a boft now? */
-
-static struct tblformat * formP = 0; /* THead/TBody format lines */
-
-static struct tblcolspec * tblColSpec = 0; /* colspec structure for table */
-static struct tblspanspec * tblSpanSpec = 0; /* spanspec structure for table */
-
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
-
-/* these cover the attributes on the Table, TGroup, Colspec elements */
-typedef struct {
- char *cols;
- char *align, **align_v;
- char *colwidth, **colwidth_v;
- char *colsep, **colsep_v;
- char *rowsep, **rowsep_v;
- char *frame;
- char *orient;
- int pgwide;
- int n_align, n_model, n_colwidth, n_colsep;
- int nc;
-} TableInfo;
-
-
-/* some flags, set when the table tag is processed, used later */
-static int rowsep, siderules;
-static int frametop, framebot, frameall;
-static char basemodel[128]; /* model for table (in formatting language) */
-static int spaninfo[MAXCOLS]; /* 100 columns, max */
-static TableInfo TheTab;
-
-/* forward references */
-void SetTabAtts(Element_t *, TableInfo *, int);
-void FreeTabAtts(TableInfo *);
-void ClearTable(TableInfo *);
-void CheckTable(Element_t *);
-void TblTStart(Element_t *, FILE *);
-void TblTEnd(Element_t *, FILE *);
-void TblTGroup(Element_t *, FILE *);
-void TblTGroupEnd(Element_t *, FILE *);
-void TblTFoot(Element_t *, FILE *);
-void TblBuildFormat(Element_t *, struct tblformat **, tblsource);
-struct tblformat * TblBuild1Format(Element_t *, bool, tblsource);
-char TblGetAlign(short, Element_t *, tblsource);
-char * TblGetWidth(short, Element_t *, bool, tblsource);
-char * TblGetFont(short, Element_t *, tblsource);
-bool TblGetColSep(short, Element_t *, tblsource);
-bool TblGetRowSep(short, Element_t *, tblsource);
-short TblGetMoreRows(short, Element_t *, tblsource);
-bool TblColAdv(short, Element_t *, struct tblformat *, tblsource);
-struct tblcolspec * TblEntryColSpec(short, Element_t *, tblsource);
-struct tblspanspec * TblEntrySpanSpec(short, Element_t *, tblsource);
-bool TblFormatMatch(struct tblformat *, struct tblformat *);
-void TblPrintFormat(FILE *, struct tblformat *);
-void TblTRowStart(Element_t *, FILE *);
-void TblTRowEnd(Element_t *, FILE *);
-void TblTCellStart(Element_t *, FILE *);
-int TblCountContent(Element_t *);
-void TblTCellEnd(Element_t *, FILE *);
-struct tblcolspec * TblDoColSpec(short, Element_t *, struct tblcolspec *, tblsource);
-struct tblspanspec * TblDoSpanSpec(Element_t *, struct tblspanspec *, tblsource);
-struct tblcolspec * TblFindColSpec(char *, tblsource);
-struct tblcolspec * TblFindColNum(short, tblsource);
-struct tblspanspec * TblFindSpanSpec(char *, tblsource);
-void TexTable(Element_t *, FILE *);
-void TexTableCellStart(Element_t *, FILE *);
-void TexTableCellEnd(Element_t *, FILE *);
-void TexTableRowStart(Element_t *, FILE *);
-void TexTableRowEnd(Element_t *, FILE *);
-void TexTableTop(Element_t *, FILE *);
-void TexTableBottom(Element_t *, FILE *);
-
-/* ______________________________________________________________________ */
-/* Hard-coded stuff for CALS-style DTD tables.
- * Here are the TABLE attributes (for handy reference):
- *
- * Table/InformalTable:
- * Colsep NUMBER separate all columns in table?
- * Frame (Top|Bottom|Topbot|All|Sides|None) frame style
- * Orient (Port | Land) orientation
- * Pgwide NUMBER wide table?
- * Rowsep NUMBER separate all rows in the table?
- * Tabstyle NMTOKEN FOSI table style
- *
- * TGroup:
- * Align (Left|Right|Center|Justify|Char) alignment of cols
- * Char CDATA Alignment specifier
- * Charoff NUTOKEN "" ""
- * Cols NUMBER number of columns
- * Colsep NUMBER separate all columns in tgroup?
- * Rowsep NUMBER separate all rows in tgroup?
- * TGroupstyle NMTOKEN FOSI table group style
- *
- * Colspec:
- * Align (Left|Right|Center|Justify|Char) entry align
- * Char CDATA Alignment specifier
- * Charoff NUTOKEN "" ""
- * Colname NMTOKEN Column identifier
- * Colnum NUMBER number of column
- * Colsep NUMBER separate this col from next?
- * Colwidth CDATA width spec
- * Rowsep NUMBER serarate entry from following row?
- *
- * SpanSpec:
- * Align (Left|Right|Center|Justify|Char) entry align
- * Char CDATA Alignment specifier
- * Charoff NUTOKEN "" ""
- * Colsep NUMBER separate this col from next?
- * Nameend NMTOKEN name of rightmost col of a span
- * Namest NMTOKEN name of leftmost col of a span
- * Rowsep NUMBER serarate entry from following row?
- * Spanname NMTOKEN name of a horiz. span
- *
- * THead/TFoot/TBody:
- * VAlign (Top | Middle | Bottom) group placement
- *
- * Row:
- * Rowsep NUMBER separate this row from next?
- * VAlign (Top | Middle | Bottom) row placement
- *
- * Entry:
- * Align (Left|Right|Center|Justify|Char) entry align
- * Char CDATA Alignment specifier
- * Charoff NUTOKEN "" ""
- * Colname NMTOKEN Column identifier
- * Colsep NUMBER separate this col from next?
- * Morerows NUMBER number of addn'l rows in vert straddle
- * Nameend NMTOKEN name of rightmost col of a span
- * Namest NMTOKEN name of leftmost col of a span
- * Rotate NUMBER 90 degree rotation counterclockwise to table?
- * Rowsep NUMBER serarate entry from following row?
- * Spanname NMTOKEN name of a horiz. span
- * VAlign (Top | Middle | Bottom) text vert alignment
- *
- *
- ** OBSOLETE OSF DTD FORM (still used for TeX form):
- ** Usage in transpec: _calstable [tex|check|clear] ['aspect']
- ** where 'aspect' is:
- ** rowstart stuff to do at start of a row (tests for spanning)
- ** rowend stuff to do at end of a row (eg, rules, etc.)
- ** cellstart stuff to do at start of a cell (eg, handle actual
- ** spanning instructions, etc.)
- ** cellend stuff to do at end of a cell (eg, cell separator)
- ** top stuff to do at top of the table
- ** (like whether or not it needs a starting horiz rule)
- ** bottom stuff to do at bottom of the table
- ** (like whether or not it needs an ending horiz rule)
- ** (nothing) the 'cols' param to LaTeX's \begin{tabular}[pos]{cols}
- ** or 'options' and 'formats' part in tbl
- *
- *
- * New tbl form:
- * Usage in transpec: _calstable [tbl] ['aspect']
- * where 'aspect' is:
- * tablestart start a table and do style info
- * tableend end the table and clean up
- * tablegroup table TGroup (.T& if not 1st, line format info)
- * tablegroupend end a TGroup
- * tablefoot TFoot within a TGroup
- * rowstart start of a row
- * rowend end of a row
- * entrystart start of an entry (block of filled text, if
- * appropriate)
- * entryend end of a cell (eg, cell separator)
- */
-
-/* Procedure to
- * Arguments:
- * Pointer to element under consideration.
- * FILE pointer to where to write output.
- * Vector of args to _osftable
- * Count of args to _osftable
- */
-void
-CALStable(
- Element_t *e,
- FILE *fp,
- char **av,
- int ac
-)
-{
- /* Check params and dispatch to appropriate routine */
-
- if (!strcmp(av[1], "tbl")) {
-
- if (ac > 2) {
- if (!strcmp(av[2], "tablestart")) TblTStart(e, fp);
- else if (!strcmp(av[2], "tableend")) TblTEnd(e, fp);
- else if (!strcmp(av[2], "tablegroup")) TblTGroup(e, fp);
- else if (!strcmp(av[2], "tablegroupend")) TblTGroupEnd(e, fp);
- else if (!strcmp(av[2], "tablefoot")) TblTFoot(e, fp);
- else if (!strcmp(av[2], "rowstart")) TblTRowStart(e, fp);
- else if (!strcmp(av[2], "rowend")) TblTRowEnd(e, fp);
- else if (!strcmp(av[2], "entrystart")) TblTCellStart(e, fp);
- else if (!strcmp(av[2], "entryend")) TblTCellEnd(e, fp);
- else fprintf(stderr, "Unknown %s table instruction: %s\n",
- av[1], av[2]);
- }
- else {
- fprintf(stderr, "Incomplete %s table instruction\n");
- }
- }
-
- else if (!strcmp(av[1], "tex")) {
-
- if (ac > 1 && !strcmp(av[1], "check")) CheckTable(e);
-
- else
- if (ac > 1 && !strcmp(av[1], "clear")) ClearTable(&TheTab);
-
- if (ac > 2) {
- if (!strcmp(av[2], "cellstart")) TexTableCellStart(e, fp);
- else if (!strcmp(av[2], "cellend")) TexTableCellEnd(e, fp);
- else if (!strcmp(av[2], "rowstart")) TexTableRowStart(e, fp);
- else if (!strcmp(av[2], "rowend")) TexTableRowEnd(e, fp);
- else if (!strcmp(av[2], "top")) TexTableTop(e, fp);
- else if (!strcmp(av[2], "bottom")) TexTableBottom(e, fp);
- else fprintf(stderr, "Unknown %s table instruction: %s\n",
- av[1], av[2]);
- }
- else TexTable(e, fp);
- }
-
- else fprintf(stderr, "Unknown table type: %s\n", av[1]);
-
-}
-
-/* ClearTable -- start a new table process
- *
- */
-
-
-void
-ClearTable( TableInfo * t )
-{
- memset(t, 0, sizeof(TableInfo));
-}
-
-
-/* ______________________________________________________________________ */
-/* Set values of the our internal table structure based on the table's
- * attributes. (This is called for tables, tgroups, colspecs, and rows,
- * since tables and rows share many of the same attributes.)
- * Arguments:
- * Pointer to element under consideration.
- * Pointer table info structure which will be filled in.
- * Flag saying whether or not to set global variables based on attrs.
- */
-void
-SetTabAtts(
- Element_t *e,
- TableInfo *t,
- int set_globals
-)
-{
- char *at;
- Element_t * ep;
-
- /* remember values of attributes */
- if ((at = FindAttValByName(e, "ALIGN"))) t->align = at;
- if ((at = FindAttValByName(e, "COLWIDTH"))) t->colwidth = at;
- if ((at = FindAttValByName(e, "COLSEP"))) t->colsep = at;
- if ((at = FindAttValByName(e, "FRAME"))) t->frame = at;
- if ((at = FindAttValByName(e, "COLS"))) t->cols = at;
-
- /* Set some things for later when processing this table */
- if (set_globals) {
-
- rowsep = 1;
- frametop = framebot = 1; /* default style */
-
- /* For now we look at the first number of rowsep - it controls the
- * horiz rule for then entire row. (not easy to specify lines that
- * span only some columns in tex or tbl. */
- if ((at = FindAttValByName(e, "ROWSEP"))) rowsep = atoi(at);
- }
-
- if (t->frame) {
- /* Top|Bottom|Topbot|All|Sides|None */
- if (!strcmp(t->frame, "NONE") || !strcmp(t->frame, "SIDES"))
- frametop = framebot = 0;
- else if (!strcmp(t->frame, "TOP")) framebot = 0;
- else if (!strcmp(t->frame, "BOTTOM")) frametop = 0;
- }
-
- /* tbl and tex like lower case for units. convert. */
- if (t->colwidth) {
- char *cp;
- for (cp=t->colwidth; *cp; cp++)
- if (isupper(*cp)) *cp = tolower(*cp);
- }
-
- /* Now, split (space-separated) strings into vectors. Hopefully, the
- * number of elements in each vector matches the number of columns.
- */
- t->align_v = Split(t->align, &t->n_align, S_STRDUP|S_ALVEC);
- t->colwidth_v = Split(t->colwidth, &t->n_colwidth, S_STRDUP|S_ALVEC);
- t->colsep_v = Split(t->colsep, &t->n_colsep, S_STRDUP|S_ALVEC);
-
- /* Determin the _numeric_ number of columns, "nc". MUST be specified
- * in Cols attribute of TGroup element.
- */
- if (t->cols) t->nc = atoi(t->cols);
-}
-
-/* ______________________________________________________________________ */
-
-/* Free the storage of info use by the table info structure. (not the
- * structure itself, but the strings its elements point to)
- * Arguments:
- * Pointer table info structure to be freed.
- */
-void
-FreeTabAtts(
- TableInfo *t
-)
-{
- if (!t) return;
- if (t->align_v) free(*t->align_v);
- if (t->colwidth_v) free(*t->colwidth_v);
- if (t->colsep_v) free(*t->colsep_v);
-}
-
-/* ______________________________________________________________________ */
-/* Check the attributes and children of the table pointed to by e.
- * Report problems and inconsistencies to stderr.
- * Arguments:
- * Pointer to element (table) under consideration.
- */
-
-void
-CheckTable(
- Element_t *e
-)
-{
- int pr_loc=0; /* flag to say if we printed location */
- int i, r, c;
- Element_t *ep, *ep2;
- float wt;
- char *tpref = "Table Check"; /* prefix for err messages */
- char *ncolchk =
- "Table Check: %s ('%s') has wrong number of tokens. Expecting %d.\n";
-
- if (strcmp(e->gi, "TABLE") &&
- strcmp(e->gi, "INFORMALTABLE") &&
- strcmp(e->gi, "TGROUP") &&
- strcmp(e->gi, "COLSPEC") &&
- strcmp(e->gi, "ROW") ) {
- fprintf(stderr, "%s: Not pointing to a table element(%s)!\n",
- tpref, e->gi);
- return;
- }
-
- FreeTabAtts(&TheTab); /* free storage, if allocated earlier */
- SetTabAtts(e, &TheTab, 1); /* look at attributes */
-
-#if FALSE
- /* NCOLS attribute set? */
- if (!TheTab.ncols) {
- pr_loc++;
- fprintf(stderr, "%s: NCOLS attribute missing. Inferred as %d.\n",
- tpref, TheTab.nc);
- }
-
- /* ALIGN attribute set? */
- if (!TheTab.align) {
- pr_loc++;
- fprintf(stderr, "%s: ALIGN attribute missing.\n", tpref);
- }
-
- /* See if the number of cells in each row matches */
- for (r=0; r<e->necont && (ep=e->econt[r]); r++) { /* each TGroup */
- for (i=0; i<ep->necont && (ep2=ep->econt[i]); i++) {
- if ( strcmp(ep2->gi, "TBODY") ) /* only TBodys */
- continue;
-
- for (c=0; c<ep2->necont; c++) {
- if (ep2->econt[c]->necont != TheTab.nc) {
- pr_loc++;
- fprintf(stderr, "%s: COLS (%d) differs from actual number of cells (%d) in row %d.\n",
- tpref, TheTab.nc, ep2->econt[c]->necont, c);
- }
- }
- }
- }
-#endif
-
- /* Check ALIGN */
- if (TheTab.align) {
- if (TheTab.nc != TheTab.n_align) { /* number of tokens OK? */
- pr_loc++;
- fprintf(stderr, ncolchk, "ALIGN", TheTab.align, TheTab.nc);
- }
- else { /* values OK? */
- for (i=0; i<TheTab.nc; i++) {
- if (*TheTab.align_v[i] != 'C' && *TheTab.align_v[i] != 'L' &&
- *TheTab.align_v[i] != 'R') {
- pr_loc++;
- fprintf(stderr, "%s: ALIGN (%d) value wrong: %s\n",
- tpref, i, TheTab.align_v[i]);
- }
- }
- }
- }
-
- /* check COLWIDTH */
- if (TheTab.colwidth) {
- if (TheTab.nc != TheTab.n_colwidth) { /* number of tokens OK? */
- pr_loc++;
- fprintf(stderr, ncolchk, "COLWIDTH", TheTab.colwidth, TheTab.nc);
- }
- else { /* values OK? */
- for (i=0; i<TheTab.nc; i++) {
-
- /* check that the units after the numbers are OK
- we want "in", "cm".
- */
- }
- }
- }
-
- /* check COLSEP */
- if (TheTab.colsep) {
- if (TheTab.nc != TheTab.n_colsep) { /* number of tokens OK? */
- pr_loc++;
- fprintf(stderr, ncolchk, "COLSEP", TheTab.colsep, TheTab.nc);
- }
- else { /* values OK? */
- for (i=0; i<TheTab.nc; i++) {
- }
- }
- }
-
- if (pr_loc) {
- fprintf(stderr, "%s: Above problem in table located at:\n", tpref);
- PrintLocation(e, stderr);
- }
-}
-
-/* ______________________________________________________________________ */
-
-/* Look at colspec attribute for spanning. If set, remember info for when
- * doing the cells. Called by TblTableRowStart() and TexTableRowStart().
- * Arguments:
- * Pointer to element (row) under consideration.
- */
-int
-check_for_spans(
- Element_t *e
-)
-{
- char *at;
- char **spans;
- int n, i, inspan;
-
-#if FALSE /* NOT IMPLEMENTED RIGHT NOW */
-
- /* See if COLSPEC element present */
- for (i=0; i < e->necont; i++) {
-
- }
-
-
- if ((at = FindAttValByName(e, "MODEL"))) {
-
- /* Split into tokens, then look at each for the word "span" */
- n = TheTab.nc;
- spans = Split(at, &n, S_STRDUP|S_ALVEC);
-
- /* Mark columns as start-of-span, in-span, or not spanned. Remember
- * in at list, "spaningo". (Span does not make sense in 1st column.)
- */
- for (i=1,inspan=0; i<n; i++) {
- if (StrEq(spans[i], "span") || StrEq(spans[i], "s")) {
- if (inspan == 0) spaninfo[i-1] = SPAN_START;
- spaninfo[i] = SPAN_CONT;
- inspan = 1;
- }
- else {
- spaninfo[i] = SPAN_NOT;
- inspan = 0;
- }
- }
- free(*spans); /* free string */
- free(spans); /* free vector */
- spaninfo[TheTab.nc] = SPAN_NOT; /* after last cell */
- return 1;
- }
- /* if model not set, mark all as not spanning */
- else
-
-#endif /* NOT CURRENTLY IMPLEMENTED */
-
- for (i=0; i<MAXCOLS; i++) spaninfo[i] = SPAN_NOT;
- return 0;
-}
-
-/* ______________________________________________________________________ */
-/* Do the "right thing" for the table spec for TeX tables. This will
- * generate the arg to \begin{tabular}[xxx].
- * Arguments:
- * Pointer to element (table) under consideration.
- * FILE pointer to where to write output.
- */
-void
-TexTable(
- Element_t *e,
- FILE *fp
-)
-{
- int i, n;
- float tot;
- char *cp, wbuf[1500], **widths=0, **widths_v=0;
-
- FreeTabAtts(&TheTab); /* free storage, if allocated earlier */
- SetTabAtts(e, &TheTab, 1); /* look at attributes */
- SetTabAtts(e->econt[0], &TheTab, 1); /* attrs of TGroup */
-
- /* Figure out the widths, based either on "colwidth".
- */
- if (TheTab.colwidth && TheTab.nc == TheTab.n_colwidth) {
- widths = TheTab.colwidth_v;
- }
-
- siderules = 1;
- if (TheTab.frame)
- if (strcmp(TheTab.frame, "ALL") && strcmp(TheTab.frame, "SIDES"))
- siderules = 0;
-
- if (siderules) OutputString("|", fp, 1);
- for (i=0; i<TheTab.nc; i++) {
- /* If width specified, use it; else if align set, use it; else left. */
- if (widths && widths[i][0] != '0' && widths[i][1] != EOS) {
- fprintf(fp, "%sp{%s}", (i?" ":""), widths[i]);
- }
- else if (TheTab.align && TheTab.nc == TheTab.n_align) {
- fprintf(fp, "%s%s", (i?" ":""), TheTab.align_v[i]);
- }
- else
- fprintf(fp, "%sl", (i?" ":""));
- /* See if we want column separators. */
- if (TheTab.colsep) {
-
- if ( (i+1) < TheTab.nc ) {
- if ( *TheTab.colsep_v[i] == '1' ) {
- fprintf(fp, " |");
- }
- if ( *TheTab.colsep_v[i] == '2' ) {
- fprintf(fp, " ||");
- }
- }
-
- }
- }
- if (siderules) OutputString("|", fp, 1);
-
- if (widths_v) free(widths_v);
-}
-
-/*
- * Arguments:
- * Pointer to element (cell) under consideration.
- * FILE pointer to where to write output.
- */
-void
-TexTableCellStart(
- Element_t *e,
- FILE *fp
-)
-{
- int n, i;
- char buf[50], *at;
-
- if (spaninfo[e->my_eorder] == SPAN_START) {
- for (i=e->my_eorder+1,n=1; ; i++) {
- if (spaninfo[i] == SPAN_CONT) n++;
- else break;
- }
- sprintf(buf, "\\\\multicolumn{%d}{%sc%s}", n,
- (siderules?"|":""), (siderules?"|":""));
- OutputString(buf, fp, 1);
- }
-#ifdef New
- if ((at = FindAttValByName(e->parent, "ALIGN"))) {
- /* no span, but user wants to change the alignment */
- h_v = Split(wbuf, 0, S_ALVEC|S_STRDUP);
- OutputString("\\\\multicolumn{1}{%sc%s}", n,
- fp, 1);
- }
-#endif
-
- if (spaninfo[e->my_eorder] != SPAN_CONT) OutputString("{", fp, 1);
-}
-
-/*
- * Arguments:
- * Pointer to element (cell) under consideration.
- * FILE pointer to where to write output.
- */
-void
-TexTableCellEnd(
- Element_t *e,
- FILE *fp
-)
-{
- if (spaninfo[e->my_eorder] != SPAN_CONT) OutputString("} ", fp, 1);
-
- /* do cell/col separators */
- if (e->my_eorder < (TheTab.nc-1)) {
- if (spaninfo[e->my_eorder] == SPAN_NOT ||
- spaninfo[e->my_eorder+1] != SPAN_CONT)
- OutputString("& ", fp, 1);
- }
-}
-
-/* Look at model for spanning. If set, remember it for when doing the cells.
- * Arguments:
- * Pointer to element (row) under consideration.
- * FILE pointer to where to write output.
- */
-void
-TexTableRowStart(
- Element_t *e,
- FILE *fp
-)
-{
- check_for_spans(e);
-}
-
-/*
- * Arguments:
- * Pointer to element (row) under consideration.
- * FILE pointer to where to write output.
- */
-void
-TexTableRowEnd(
- Element_t *e,
- FILE *fp
-)
-{
- char *at;
-
- /* check this row's attributes */
- if ((at = FindAttValByName(e, "ROWSEP"))) {
- if (at[0] == '1') OutputString("\\\\\\\\[2mm] \\\\hline ", fp, 1);
- }
- else if (rowsep) OutputString("\\\\\\\\ ", fp, 1);
- else
- OutputString("\\\\\\\\ ", fp, 1);
-
-}
-
-/*
- * Arguments:
- * Pointer to element (table) under consideration.
- * FILE pointer to where to write output.
- */
-void
-TexTableTop(Element_t *e, FILE *fp)
-{
- if (frametop) OutputString("\\\\hline", fp, 1);
-}
-
-void
-TexTableBottom(Element_t *e, FILE *fp)
-{
- if (framebot) OutputString("\\\\hline", fp, 1);
-}
-
-/* ______________________________________________________________________ */
-/* ______________________________________________________________________ */
-/* ______________________________________________________________________ */
-/* ______________________________________________________________________ */
-/* ______________________________________________________________________ */
-/* ___________________________| |____________________________ */
-/* ___________________________| TBL STUFF |____________________________ */
-/* ___________________________| |____________________________ */
-/* ___________________________|_____________|____________________________ */
-/* ______________________________________________________________________ */
-/* ______________________________________________________________________ */
-/* ______________________________________________________________________ */
-/* ______________________________________________________________________ */
-
-
-
-/* TblTStart() -- start a table and do style information
- *
- * TO DO:
- *
- * do .TS
- * find global rowsep and colsep
- */
-
-
-void
-TblTStart(Element_t * ep,
- FILE * fP)
-{
- register char * cp;
- register struct Element_t * ep2;
-
-
-
- OutputString("^.TS^", fP, 1);
-
- tblTGroupSeen = FALSE;
- tblinBOFT = FALSE; /* within a boft? */
- tblBOFTCount = 0; /* count of Blocks of Filled Text that
- * we've created */
-
- tblgcolsep = (cp = FindAttValByName(ep, "COLSEP")) && !strcmp(cp, "1");
- tblgrowsep = (cp = FindAttValByName(ep, "ROWSEP")) && !strcmp(cp, "1");
-}
-
-/* TblTEnd() -- end a table and do any cleanup
- *
- * TO DO:
- *
- * do .TE
- *
- * deallocate format line info
- */
-
-
-
-void
-TblTEnd(Element_t * ep,
- FILE * fP)
-{
- register struct tblformat * ffp, * ffp2;
-
-
- if ( tblBOFTCount > 31 ) {
- fprintf(stderr, "# warning, line %d: created %d blocks of filled text in one table\n",
- ep->lineno, tblBOFTCount);
- fprintf(stderr, "#\t\t(31 is the limit in some systems)\n");
- }
-
- OutputString("^.TE^", fP, 1);
-
- for ( ffp=formP; ffp; ffp=ffp2 ) {
- ffp2 = ffp->next;
- free(ffp); /* clear entire list */
- }
- formP = 0;
-}
-
-/* TblTTGroup() -- do body work (row format info)
- *
- * TO DO:
- *
- * set number of columns
- *
- * if this is the first TGroup of this table, do style info:
- * a. alignment
- * b. defaults: tab
- * c. box vx allbox
- *
- * do format info:
- * a. generate tableformat structure
- * b. output it
- *
- * prepare structures for colspecs and spanspecs
- *
- */
-
-
-
-void
-TblTGroup(Element_t * ep,
- FILE * fP)
-{
- register int i, j, k;
- register char * cp, * cp2;
- register Element_t * ep2, ep3;
- register struct tblcolspec * tcsp, * tcsp2;
- register struct tblspanspec * tssp, * tssp2;
-
-
- tblColSpec = 0; /* make sure they're clear */
- tblSpanSpec = 0;
-
- /* set the number of columns */
-
- tblcols = atoi(FindAttValByName(ep, "COLS"));
-
- /* do colspecs */
-
- tblColSpec = tcsp = TblDoColSpec(0, ep, 0, TGroup);
- /* do TGroup first -- it becomes the default */
-
- for ( i=0, k=1; i < ep->necont; i++ ) {
-
- if ( !strcmp(ep->econt[i]->gi, "COLSPEC") ) {
- tcsp2 = TblDoColSpec(k, ep->econt[i], tblColSpec, TGroup);
- tcsp->next = tcsp2; /* put into list */
- tcsp = tcsp2;
- k = tcsp2->num + 1; /* next column number */
- }
-
- if ( !strcmp(ep->econt[i]->gi, "THEAD") ) {
- ep2 = ep->econt[i];
- for ( j=0, k=1; j < ep2->necont; j++ ) {
- if ( !strcmp(ep2->econt[j]->gi, "COLSPEC") ) {
- tcsp2 = TblDoColSpec(k, ep2->econt[j], tblColSpec, THead);
- tcsp->next = tcsp2; /* put into list */
- tcsp = tcsp2;
- k = tcsp2->num + 1; /* next column number */
- }
- }
- }
-
- if ( !strcmp(ep->econt[i]->gi, "TFOOT") ) {
- ep2 = ep->econt[i];
- for ( j=0, k=1; j < ep2->necont; j++ ) {
- if ( !strcmp(ep2->econt[j]->gi, "COLSPEC") ) {
- tcsp2 = TblDoColSpec(k, ep2->econt[j], tblColSpec, TFoot);
- tcsp->next = tcsp2; /* put into list */
- tcsp = tcsp2;
- k = tcsp2->num + 1; /* next column number */
- }
- }
- }
-
- if ( !strcmp(ep->econt[i]->gi, "TBODY") ) {
- ep2 = ep->econt[i];
- for ( j=0, k=1; j < ep2->necont; j++ ) {
- if ( !strcmp(ep2->econt[j]->gi, "COLSPEC") ) {
- tcsp2 = TblDoColSpec(k, ep2->econt[j], tblColSpec, TBody);
- tcsp->next = tcsp2; /* put into list */
- tcsp = tcsp2;
- k = tcsp2->num + 1; /* next column number */
- }
- }
- }
- }
-
- /* do spanspecs */
-
- tblSpanSpec = tssp = TblDoSpanSpec(ep, 0, TGroup);
- /* do TGroup first -- it becomes the default */
-
- for ( i=0; i < ep->necont; i++ ) {
- if ( !strcmp(ep->econt[i]->gi, "SPANSPEC") ) {
- tssp2 = TblDoSpanSpec(ep->econt[i], tblSpanSpec, TGroup);
- tssp->next = tssp2; /* put into list */
- tssp = tssp2;
- }
- }
-
-
- /* if this is the first TGroup in this table, do style stuff */
-
- if ( ! tblTGroupSeen ) {
-
- OutputString("tab(\007)", fP, 1);
-
- ep2 = ep->parent;
- if ( ! (tblFrame = FindAttValByName(ep2, "FRAME")) )
- tblFrame = "";
-
- if ( !strcmp(tblFrame, "ALL") ) {
- if ( tcsp->colsep && tcsp->rowsep )
- OutputString(" allbox", fP, 1);
- else
- OutputString(" box", fP, 1);
- }
-
- if ( (cp = FindAttValByName(ep, "ALIGN")) &&
- !strcmp(cp, "CENTER") ) {
- OutputString(" center", fP, 1);
- }
-
- OutputString(";\n", fP, 1);
-
- tblTGroupSeen = TRUE;
- }
-
-
- /* do format stuff -- step through all THead rows then all TBody
- * rows. Build a list of tblformats that describe all of them.
- * then output the resulting list.
- */
-
- for ( i=0; i < ep->necont; i++ ) {
- if ( !strcmp(ep->econt[i]->gi, "THEAD") ) {
- TblBuildFormat(ep->econt[i], &formP, THead);
- /* add in those rows */
- break;
- }
- }
-
- for ( i=0; i < ep->necont; i++ ) {
- if ( !strcmp(ep->econt[i]->gi, "TBODY") ) {
- TblBuildFormat(ep->econt[i], &formP, TBody);
- /* add in those rows */
- break;
- }
- }
-
- TblPrintFormat(fP, formP);
-
- tblrow = 0; /* the current row within this format */
-}
-
-/* TblTGroupEnd() -- end a TGroup
- *
- * TO DO:
- *
- * deallocate colspecs and spanspecs
- */
-
-
-void
-TblTGroupEnd(Element_t * ep,
- FILE * fP)
-{
- register struct tblcolspec * tcsp, * tcsp2;
- register struct tblspanspec * tssp, * tssp2;
-
-
- for ( tcsp=tblColSpec; tcsp; tcsp=tcsp2 ) {
- tcsp2 = tcsp->next;
- free(tcsp);
- }
- for ( tssp=tblSpanSpec; tssp; tssp=tssp2 ) {
- tssp2 = tssp->next;
- free(tssp);
- }
-}
-
-/* TblTTFoot() -- do body foot work (row format info)
- *
- * TO DO:
- *
- * do format info:
- * a. generate tableformat structure
- * i. if it is only 1 line long and matches the
- * prevailing format, just output rows.
- * ii. else, output a .T& and the new format specs
- */
-
-
-
-void
-TblTFoot(Element_t * ep,
- FILE * fP)
-{
- register struct tblformat * ffp, * ffp2;
- static struct tblformat * tfp, * tfp2;
-
-
- TblBuildFormat(ep, &tfp, TFoot); /* gen format for the foot */
-
- for ( tfp2=formP; tfp2 && tfp2->next; tfp2=tfp2->next )
- ;
-
- if ( tfp->next || !TblFormatMatch(tfp, tfp2) ) {
-
- for ( ffp=formP; ffp; ffp=ffp2 ) {
- ffp2 = ffp->next;
- free(ffp); /* clear entire list */
- }
-
- formP = tfp; /* this becomes the prevailing format */
-
- OutputString("^.T&^", fP, 1);
- TblPrintFormat(fP, formP);
- }
-
- tblrow = 0; /* the current row within this format */
-}
-
-/* TblBuildFormat() -- build a format structure out of a set of
- * rows and columns
- *
- */
-
-
-void
-TblBuildFormat(Element_t * ep, /* parent of rows.. */
- struct tblformat ** fp, /* pointer to head of struct we're
- * building */
- tblsource source) /* type of record */
-{
- register int i;
- register struct tblformat * lfp; /* "current" format */
- register struct tblformat * nfp; /* the next format */
-
-
- for ( lfp= *fp; lfp && lfp->next; lfp=lfp->next )
- ; /* find end of format list */
-
- for ( i=0; i < ep->necont; i++ )
- if ( !strcmp(ep->econt[i]->gi, "ROW") )
- break; /* find where rows start */
-
- for ( ; i < ep->necont; i++ ) {
-
- nfp = TblBuild1Format(ep->econt[i], FALSE, source);
- /* do one row */
-
- if ( !lfp )
- lfp = *fp = nfp; /* first one */
- else
- if ( TblFormatMatch(lfp, nfp) )
- lfp->count++; /* matches */
- else {
- lfp->count = 1; /* only 1 so far */
- lfp->next = nfp; /* new one */
- lfp = nfp;
- }
- }
-}
-
-/* TblBuild1Format() -- build one row's worth of format information
- *
- */
-
-
-
-struct tblformat *
-TblBuild1Format(Element_t * rp, /* the row to deal with */
- bool addinRowsep, /* insert rowsep into model? */
- tblsource source) /* type type of row */
-{
- register int i;
- register bool allProp;
- float totalProp;
- register struct tblformat * tfp;
- register Element_t * ep; /* entry pointer */
-
-
- Calloc(1, tfp, struct tblformat);
- tfp->cols = tblcols;
- ep = (rp->necont) ? rp->econt[0] : 0; /* first entry */
- allProp = TRUE;
- totalProp = 0;
-
- for ( i=1; i <= tblcols; i++ ) {
- tfp->colformat[i] = TblGetAlign(i, ep, source);
- strcpy(tfp->colwidth[i], TblGetWidth(i, ep, TRUE, source));
- strcpy(tfp->colpwidth[i], TblGetWidth(i, ep, FALSE, source));
- if ( allProp ) {
- allProp = tfp->colpwidth[i][0];
- totalProp += atof(tfp->colpwidth[i]);
- }
- strcpy(tfp->font[i], TblGetFont(i, ep, source));
- tfp->colsep[i] = tblgcolsep || TblGetColSep(i, ep, source);
- if ( addinRowsep )
- tfp->rowsep[i] = tblgrowsep || TblGetRowSep(i, ep, source);
- tfp->moreRows[i] = TblGetMoreRows(i, ep, source);
-
- if ( (i < rp->necont) && TblColAdv(i, ep, tfp, source) ) {
- ep = rp->econt[i];
- }
- }
-
- /* turn proportional widths into real widths */
-
- if ( allProp ) {
- for ( i=1; i <= tblcols; i++ ) {
- sprintf(tfp->colwidth[i], "%fi",
- (atof(tfp->colpwidth[i]) / totalProp) * TEXTWIDTH);
- }
- }
-
- return tfp;
-}
-
-/* TblGetAlign() -- get alignment spec for a entry
- *
- */
-
-
-char
-TblGetAlign(short col, /* column number */
- Element_t * entry, /* the entry */
- tblsource source) /* context */
-{
- register struct tblcolspec * tcsp;
- register struct tblspanspec * tssp;
- register tblalign talign;
-
-
- if ( entry && (tssp = TblEntrySpanSpec(col, entry, source)) ) {
- talign = tssp->align;
- free(tssp);
- } else
- if ( entry && (tcsp = TblEntryColSpec(col, entry, source)) ) {
- talign = tcsp->align;
- free(tcsp);
- } else {
- return 'l';
- }
-
- switch ( talign ) {
- case Left: return 'l';
- case Right: return 'r';
- case Center: return 'c';
- case Justify: return 'l';
- case Char: return 'd';
- case Span: return 's';
- }
-}
-
-/* TblGetWidth() -- get width spec, if any, for a entry
- *
- */
-
-
-char *
-TblGetWidth(short col, /* column number */
- Element_t * entry, /* the entry */
- bool literal, /* literal (or proportional) */
- tblsource source) /* context */
-{
- register struct tblcolspec * tcsp;
- register struct tblspanspec * tssp;
- static char colWidth[10];
-
-
- colWidth[0] = 0;
-
- if ( entry &&
- (tcsp = TblEntryColSpec(col, entry, source)) &&
- tcsp->colwidth[0] ) {
-
- if ( !strstr(tcsp->colwidth, "*") ) {
- if ( literal )
- strcpy(colWidth, tcsp->colwidth);
- } else {
- if ( ! literal )
- strcpy(colWidth, tcsp->colwidth);
- }
- free(tcsp);
- }
-
- return colWidth;
-}
-
-/* TblGetFont() -- get font spec, if any, for a entry
- *
- */
-
-
-char *
-TblGetFont(short col, /* column number */
- Element_t * entry, /* the entry */
- tblsource source) /* context */
-{
- register struct tblcolspec * tcsp;
- register struct tblspanspec * tssp;
-
-
- return "";
-}
-
-/* TblGetColSep() -- get column separater spec, if any, for a entry
- *
- */
-
-
-bool
-TblGetColSep(short col, /* column number */
- Element_t * entry, /* the entry */
- tblsource source) /* context */
-{
- register struct tblcolspec * tcsp;
- register struct tblspanspec * tssp;
- register bool colsep;
-
-
- if ( entry && (tssp = TblEntrySpanSpec(col, entry, source)) ) {
- colsep = tssp->colsep;
- free(tssp);
- } else
- if ( entry && (tcsp = TblEntryColSpec(col, entry, source)) ) {
- colsep = tcsp->colsep;
- free(tcsp);
- } else
- colsep = FALSE;
-
- return colsep;
-}
-
-/* TblGetRowSep() -- get row separater spec, if any, for a entry
- *
- */
-
-
-bool
-TblGetRowSep(short col, /* column number */
- Element_t * entry, /* the entry */
- tblsource source) /* context */
-{
- register struct tblcolspec * tcsp;
- register struct tblspanspec * tssp;
- register bool rowsep;
-
- if ( entry && (tssp = TblEntrySpanSpec(col, entry, source)) ) {
- rowsep = tssp->rowsep;
- free(tssp);
- } else
- if ( entry && (tcsp = TblEntryColSpec(col, entry, source)) ) {
- rowsep = tcsp->rowsep;
- free(tcsp);
- } else {
- rowsep = FALSE;
- }
-
- return rowsep;
-}
-
-/* TblGetmoreRows() -- get moreRows value
- *
- */
-
-
-bool
-TblGetMoreRows(short col, /* column number */
- Element_t * entry, /* the entry */
- tblsource source) /* context */
-{
- register char * cp;
-
-
- if ( cp = FindAttValByName(entry, "MOREROWS") )
- return atoi(cp);
- else
- return 0;
-}
-
-/* TblColAdv() -- advance pointer to next entry, if appropriate
- *
- */
-
-
-bool
-TblColAdv(short col, /* the current column */
- Element_t *ep, /* pointer to entry */
- struct tblformat * tfp, /* pointer to prevailing format */
- tblsource source) /* context */
-{
- register bool bump;
- register struct tblspanspec * tssp;
-
-
- bump = TRUE;
-
- if ( tssp = TblEntrySpanSpec(col, ep, source) ) {
- bump = tssp->align != Span;
- free(tssp);
- }
-
- return bump;
-}
-
-/* TblEntryColSpec() -- get a completely localized colspec for an entry
- *
- */
-
-
-struct tblcolspec *
-TblEntryColSpec(short num, /* column number */
- Element_t * ep, /* entry */
- tblsource source) /* context */
-{
- register int i;
- register bool throwAway;
- register char * cp;
- register struct tblcolspec * tcsp, * tcsp2;
-
-
- tcsp = tcsp2 = 0;
- throwAway = FALSE;
-
- if ( (cp = FindAttValByName(ep, "COLNAME")) ) {
- if ( ! (tcsp = TblFindColSpec(cp, source)) ) {
- fprintf(stderr, "? can't find column name '%s'\n", cp);
- }
- }
-
- if ( tcsp2 = TblFindColNum(num, source) ) {
- tcsp = TblDoColSpec(num, ep, tcsp2, source);
- throwAway = TRUE;
- }
-
- tcsp2 = TblDoColSpec(num, ep, tcsp, source);
-
- if ( throwAway )
- free(tcsp);
-
- return tcsp2;
-}
-
-/* TblEntrySpanSpec() -- get a completely localized spanspec for an entry
- *
- */
-
-
-struct tblspanspec *
-TblEntrySpanSpec(short num, /* column number */
- Element_t * ep, /* entry */
- tblsource source) /* context */
-{
- register char * cp, * cp2;
- register struct tblspanspec * tssp, * tssp2;
-
-
- tssp2 = 0;
-
- if ( !(cp = FindAttValByName(ep, "SPANNAME")) ||
- !(tssp2 = TblFindSpanSpec(cp, source)) ) {
-
- if ( !FindAttValByName(ep, "NAMEST") )
- return 0;
- }
-
- tssp = TblDoSpanSpec(ep, tssp2, source);
-
- if ( tssp->start && tssp->end &&
- (tssp->start->num < num) && (tssp->end->num >= num) ) {
- tssp->align = Span;
- }
-
- return tssp;
-}
-
-/* TblFormatMatch() -- compare two format rows for consistency
- *
- */
-
-
-bool
-TblFormatMatch(struct tblformat * tf1, /* one row */
- struct tblformat * tf2) /* the other */
-{
- register int i;
-
- if ( tf1->cols != tf2->cols ) {
- return FALSE;
- }
-
- for ( i=0; i < tf1->cols; i++ ) {
-
- if ( tf1->colformat[i] != tf2->colformat[i] ) {
- return FALSE;
- }
- if ( strcmp(tf1->colwidth[i], tf2->colwidth[i]) ) {
- return FALSE;
- }
- if ( strcmp(tf1->font[i], tf2->font[i]) ) {
- return FALSE;
- }
- if ( tf1->colsep[i] != tf2->colsep[i] ) {
- return FALSE;
- }
- if ( tf1->rowsep[i] != tf2->rowsep[i] ) {
- return FALSE;
- }
- if ( tf1->moreRows[i] || tf2->moreRows[i] ) {
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/* TblPrintFormat() -- print a tbl format structure
- *
- */
-
-
-void
-TblPrintFormat(FILE * fP, /* where to print */
- struct tblformat * tfp) /* the structure */
-{
- register int i;
- register struct tblformat * tfp2, * tfp3;
- static char buf[3] = "\000\000";
-
-
- for ( tfp2=tfp, tfp3=0; tfp2; tfp2=tfp2->next ) {
- for ( i=1; i <= tfp->cols; i++ ) {
- if ( i > 1 )
- OutputString(" ", fP, 1);
- if ( tfp3 && tfp3->moreRows[i] )
- OutputString("\\^", fP, 1);
- else {
- buf[0] = tfp2->colformat[i];
- OutputString(buf, fP, 1);
- }
- if ( tfp2->colwidth[i][0] ) {
- OutputString("w(", fP, 1);
- OutputString(tfp2->colwidth[i], fP, 1);
- OutputString(")", fP, 1);
- }
- if ( tfp2->font[i][0] )
- OutputString(tfp2->font[i], fP, 1);
- if ( tfp2->colsep[i] )
- OutputString("|", fP, 1);
- }
- if ( ! tfp2->next )
- OutputString(".", fP, 1);
- OutputString("^", fP, 1);
- tfp3 = tfp2;
- }
-}
-
-/* TblTRowStart() -- start a row (not much to do)
- *
- * TO DO:
- *
- * nothing..
- *
- */
-
-
-
-void
-TblTRowStart(Element_t * ep,
- FILE * fP)
-{
-
- /* nothing to do */
-
- tblrow++; /* except note that we're within a new row */
-
-}
-
-/* TblTRowEnd() -- end a row
- *
- * TO DO:
- *
- * output a row end character (newline)
- * if the current row had a rowsep, then output a "fake" row
- * with underlines in the proper place(s).
- */
-
-
-
-void
-TblTRowEnd(Element_t * ep,
- FILE * fP)
-{
- register int i, k;
- register tblsource source;
- register bool startedRow, didSep;
- register struct tblformat * rfp;
-
-
- OutputString("^", fP, 1);
-
- /* get the format for this row */
-
- if ( !strcmp(ep->parent->gi, "TFoot") )
- source = TFoot;
- else
- if ( !strcmp(ep->parent->gi, "THead") )
- source = THead;
- else
- source = TBody;
-
- rfp = TblBuild1Format(ep, TRUE, source);
- startedRow = FALSE;
- didSep = FALSE;
-
- for ( i=1; i <= formP->cols; i++ ) {
- if ( rfp->rowsep[i] ||
- (didSep && (rfp->colformat[i] == 's')) ) {
- if ( ! startedRow ) {
- OutputString("^", fP, 1);
- for ( k=1; k < i; k++ )
- OutputString("\007", fP, 1);
- startedRow = TRUE;
- }
- OutputString("_\007", fP, 1);
- didSep = TRUE;
- } else {
- if ( startedRow )
- OutputString("\007", fP, 1);
- }
- didSep = FALSE;
- }
- free(rfp); /* clear that row.. */
-
- if ( startedRow )
- OutputString("^", fP, 1);
-}
-
-/* TblTEntryStart() -- start an entry (block of filled text if
- * appropriate)
- *
- * TO DO:
- *
- * if text length > BOFTTextThresh or there is PI,
- * then output "T{\n", else do nothing
- *
- */
-
-
-
-void
-TblTCellStart(Element_t * ep,
- FILE * fP)
-{
- register int i;
- register Element_t * ep2;
- register bool sawPI;
-
-
- for ( i=0, sawPI=FALSE; (i < ep->ncont) && !sawPI; i++ )
- if ( ep->cont[i].type == '?' )
- sawPI = TRUE;
-
- if ( sawPI || (TblCountContent(ep) > BOFTTextThresh) ) {
- tblBOFTCount++;
- OutputString("T{^", fP, 1);
- tblinBOFT = TRUE; /* within a boft now */
- }
-}
-
-/* TblCountContent() -- count all content below the given element
- *
- *
- */
-
-
-
-int
-TblCountContent(Element_t * ep) /* the element to look under */
-{
- register int i, count;
-
-
- count = 0;
-
- for ( i=0; i < ep->ncont; i++ ) {
- if ( ep->cont[i].type == '-' ) {
- count += strlen(ep->cont[i].ch.data);
- } else
- if ( ep->cont[i].type == '(' ) {
- count += TblCountContent(ep->cont[i].ch.elem);
- }
- }
-
- return count;
-}
-
-/* TblTEntryEnd() -- end an entry
- *
- * TO DO:
- *
- * if within BOFT, output "T}"
- * if not last entry, output tab character
- *
- */
-
-
-
-void
-TblTCellEnd(Element_t * ep,
- FILE * fP)
-{
- register Element_t * ep2;
-
-
- if ( tblinBOFT ) {
- OutputString("^T}", fP, 1);
- tblinBOFT = FALSE; /* back out again */
- }
-
- for ( ep2=ep->next; ep2; ep2=ep2->next ) {
- if ( !strcmp(ep2->gi, "ENTRY") || !strcmp(ep2->gi, "ENTRYTBL") ) {
- OutputString("\007", fP, 1);
- break;
- }
- if ( !strcmp(ep2->gi, "ROW") )
- break;
- }
-}
-
-/* TblDoColSpec() -- process one element to create a new colspec
- *
- *
- */
-
-
-
-struct tblcolspec *
-TblDoColSpec(short number, /* this column number */
- Element_t * ep, /* element containing colspec stuff */
- struct tblcolspec * pcsp, /* prevailing colspec (with defaults) */
- tblsource source) /* precedence level of the resulting spec */
-{
- register char * cp;
- register struct tblcolspec * tcsp;
-
-
- Calloc(1, tcsp, struct tblcolspec);
-
- if ( cp = FindAttValByName(ep, "COLNAME") )
- strcpy(tcsp->name, cp);
-
- tcsp->num = number;
- tcsp->source = source;
-
- if ( cp = FindAttValByName(ep, "ALIGN") ) {
- if ( !strcmp(cp, "LEFT") ) tcsp->align = Left;
- else if ( !strcmp(cp, "RIGHT") ) tcsp->align = Right;
- else if ( !strcmp(cp, "CENTER") ) tcsp->align = Center;
- else if ( !strcmp(cp, "JUSTIFY") ) tcsp->align = Justify;
- else if ( !strcmp(cp, "CHAR") ) tcsp->align = Char;
- } else
- tcsp->align = ( pcsp ) ? pcsp->align : Left;
-
- if ( cp = FindAttValByName(ep, "CHAR") )
- tcsp->alignchar = cp[0];
- else
- tcsp->alignchar = ( pcsp ) ? pcsp->alignchar : 0;
-
- if ( cp = FindAttValByName(ep, "CHAROFF") )
- tcsp->aligncharoff = atoi(cp);
- else
- tcsp->aligncharoff = ( pcsp ) ? pcsp->aligncharoff : 0;
-
- if ( cp = FindAttValByName(ep, "COLWIDTH") )
- strcpy(tcsp->colwidth, cp);
- else
- strcpy(tcsp->colwidth, ( pcsp ) ? pcsp->colwidth : "");
-
- if ( cp = FindAttValByName(ep, "COLSEP") )
- tcsp->colsep = !strcmp(cp, "1");
- else
- tcsp->colsep = ( pcsp ) ? pcsp->colsep : FALSE;
-
- if ( cp = FindAttValByName(ep, "ROWSEP") )
- tcsp->rowsep = !strcmp(cp, "1");
- else
- tcsp->rowsep = ( pcsp ) ? pcsp->rowsep : FALSE;
-
- return tcsp;
-}
-
-/* TblDoSpanSpec() -- process one element to create a new spanspec
- *
- * Note that there's a hack inside here... NameSt and NameEnd are
- * supposed to point at colnames, but if no colname is found, this
- * code will look for a colnum by the same value.
- */
-
-
-
-struct tblspanspec *
-TblDoSpanSpec(Element_t * ep, /* element containing spanspec stuff */
- struct tblspanspec * pssp, /* prevailing spanspec (with defaults) */
- tblsource source) /* precedence level of the resulting spec */
-{
- register char * cp;
- register struct tblspanspec * tssp;
- register struct tblcolspec * tcsp;
-
-
- Calloc(1, tssp, struct tblspanspec);
-
- if ( cp = FindAttValByName(ep, "SPANNAME") ) strcpy(tssp->name, cp);
- tssp->source = source;
-
- if ( cp = FindAttValByName(ep, "NAMEST") ) {
- if ( (tcsp = TblFindColSpec(cp, source)) ||
- (tcsp = TblFindColNum(atoi(cp), source)) ) {
- tssp->start = tcsp;
- } else {
- fprintf(stderr, "? spanspec namest points to unknown column '%s'\n", cp);
- tssp->start = 0;
- }
- } else {
- if ( pssp && pssp->start ) {
- tssp->start = pssp->start;
- }
- }
-
- if ( cp = FindAttValByName(ep, "NAMEEND") ) {
- if ( (tcsp = TblFindColSpec(cp, source)) ||
- (tcsp = TblFindColNum(atoi(cp), source)) ) {
- tssp->end = tcsp;
- } else {
- fprintf(stderr, "? spanspec nameend points to unknown column '%s'\n", cp);
- tssp->end = 0;
- }
- } else {
- if ( pssp && pssp->end ) {
- tssp->end = pssp->end;
- }
- }
-
- if ( cp = FindAttValByName(ep, "ALIGN") ) {
- if ( !strcmp(cp, "LEFT") ) tssp->align = Left;
- else if ( !strcmp(cp, "RIGHT") ) tssp->align = Right;
- else if ( !strcmp(cp, "CENTER") ) tssp->align = Center;
- else if ( !strcmp(cp, "JUSTIFY") ) tssp->align = Justify;
- else if ( !strcmp(cp, "CHAR") ) tssp->align = Char;
- } else {
- if ( pssp )
- tssp->align = pssp->align;
- }
-
- if ( cp = FindAttValByName(ep, "CHAR") )
- tssp->alignchar = cp[0];
- else {
- if ( pssp )
- tssp->alignchar = pssp->alignchar;
- }
- if ( cp = FindAttValByName(ep, "CHAROFF") )
- tssp->aligncharoff = atoi(cp);
- else {
- if ( pssp )
- tssp->alignchar = pssp->alignchar;
- }
-
- if ( cp = FindAttValByName(ep, "COLSEP") )
- tssp->colsep = !strcmp(cp, "1");
- else {
- if ( pssp )
- tssp->colsep = pssp->colsep;
- }
- if ( cp = FindAttValByName(ep, "ROWSEP") )
- tssp->rowsep = !strcmp(cp, "1");
- else {
- if ( pssp )
- tssp->rowsep = pssp->rowsep;
- }
-
- return tssp;
-}
-
-/* TblFindColSpec() -- find a table colspec by name (colname)
- *
- */
-
-
-
-struct tblcolspec *
-TblFindColSpec(char * name, /* the name we're looking for */
- tblsource source) /* the context in which to find it */
-{
- register struct tblcolspec * tcsp;
-
-
- /* first, try to find the one in the right "source" */
-
- for ( tcsp=tblColSpec; tcsp; tcsp=tcsp->next ) {
- if ( (tcsp->source == source) && !strcmp(tcsp->name, name) )
- return tcsp;
- }
-
- /* else, try to find one from a TGroup.. */
-
- for ( tcsp=tblColSpec; tcsp; tcsp=tcsp->next ) {
- if ( (tcsp->source == TGroup) && !strcmp(tcsp->name, name) )
- return tcsp;
- }
-
- /* else not found.. */
-
- return 0;
-}
-
-/* TblFindColNum() -- find a table colspec by number
- *
- */
-
-
-
-struct tblcolspec *
-TblFindColNum(short number, /* the number we're looking for */
- tblsource source) /* the context in which to find it */
-{
- register struct tblcolspec * tcsp;
-
-
-
- /* first, try to find the one in the right "source" */
-
- for ( tcsp=tblColSpec; tcsp; tcsp=tcsp->next ) {
- if ( (tcsp->num == number) &&
- ((tcsp->source == source) ||
- ((source == THead) && (tcsp->source == TGroup))) )
- return tcsp;
- }
-
- /* else, try to find one from a TGroup.. */
-
- for ( tcsp=tblColSpec; tcsp; tcsp=tcsp->next ) {
- if ( (tcsp->source == TGroup) && (tcsp->num == number) )
- return tcsp;
- }
-
- /* else not found.. */
-
- return 0;
-}
-
-/* TblFindSpanSpec() -- find a table spanspec by name (spanname)
- *
- */
-
-
-
-struct tblspanspec *
-TblFindSpanSpec(char * name, /* the name we're looking for */
- tblsource source) /* the context in which to find it */
-{
- register struct tblspanspec * tssp;
-
-
- /* first, try to find the one in the right "source" */
-
- for ( tssp=tblSpanSpec; tssp; tssp=tssp->next ) {
- if ( !strcmp(tssp->name, name) &&
- ((tssp->source == source) ||
- ((source == THead) && (tssp->source == TGroup))) )
- return tssp;
- }
-
- /* else not found.. */
-
- return 0;
-}
diff --git a/usr.bin/sgmls/instant/traninit.c b/usr.bin/sgmls/instant/traninit.c
deleted file mode 100644
index d3df959..0000000
--- a/usr.bin/sgmls/instant/traninit.c
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Program to manipulate SGML instances.
- *
- * This module contains the initialization routines for translation module.
- * They mostly deal with reading data files (translation specs, SDATA
- * mappings, character mappings).
- *
- * Entry points:
- * ReadTransSpec(transfile) read/store translation spec from file
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/local/home/jfieber/src/cvsroot/nsgmlfmt/traninit.c,v 1.1.1.1 1996/01/16 05:14:10 jfieber Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <regexp.h>
-
-#include "general.h"
-#include "translate.h"
-
-#include "sgmls.h"
-#include "config.h"
-#include "std.h"
-
-#ifndef TRUE
-#define TRUE (1 == 1)
-#endif
-
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-/* forward references */
-void RememberTransSpec(Trans_t *, int);
-static void do_data(char *gi, struct sgmls_data *v, int n);
-static void build_ts(char *gi, char* cp);
-void AddCharMap(const char *from, const char* to);
-void AddSDATA(const char *from, const char *to);
-
-/* ______________________________________________________________________ */
-/* Read the translation specs from the input file, storing in memory.
- * Arguments:
- * Name of translation spec file.
- */
-
-static Trans_t T;
-
-
-static
-void input_error(num, str, lineno)
- int num;
- char *str;
- unsigned long lineno;
-{
- fprintf(stderr, "Error at input line %lu: %s\n", lineno, str);
-}
-
-void
-ReadTransSpec(
- char *transfile
-)
-{
- FILE *fp;
- struct sgmls *sp;
- struct sgmls_event e;
- char gi[LINESIZE];
- char buf[LINESIZE];
- char buf2[LINESIZE];
- char *command;
- char *sgmls = "sgmls ";
- char maptype = '\0';
-
- (void)sgmls_set_errhandler(input_error);
- transfile = FilePath(transfile);
- if (!transfile)
- {
- fprintf(stderr, "Error: Could not locate specified transfile\n");
- exit(1);
- }
-
- /* XXX this is a quick, gross hack. Should write a parse() function. */
- Malloc(strlen(sgmls) + strlen(transfile) + 2, command, char);
- sprintf(command, "%s %s", sgmls, transfile);
- fp = popen(command, "r");
-
- sp = sgmls_create(fp);
- while (sgmls_next(sp, &e))
- switch (e.type) {
- case SGMLS_EVENT_DATA:
- do_data(gi, e.u.data.v, e.u.data.n);
- break;
- case SGMLS_EVENT_ENTITY:
- fprintf(stderr, "Hm... got an entity\n");
- break;
- case SGMLS_EVENT_PI:
- break;
- case SGMLS_EVENT_START:
- if (strncmp("RULE", e.u.start.gi, 4) == 0) {
- /* A new transpec, so clear the data structure
- * and look for an ID attribute.
- */
- struct sgmls_attribute *attr = e.u.start.attributes;
- memset(&T, 0, sizeof T);
- while (attr) {
- if (attr->type == SGMLS_ATTR_CDATA
- && strncmp("ID", attr->name, 2) == 0) {
- strncpy(buf, attr->value.data.v->s,
- MIN(attr->value.data.v->len, LINESIZE));
- buf[MIN(attr->value.data.v->len, LINESIZE - 1)] = '\0';
- T.my_id = atoi(buf);
- }
- attr = attr->next;
- }
- }
- else if (strncmp("CMAP", e.u.start.gi, 4) == 0)
- maptype = 'c';
- else if (strncmp("SMAP", e.u.start.gi, 4) == 0)
- maptype = 's';
- else if (strncmp("MAP", e.u.start.gi, 3) == 0) {
- struct sgmls_attribute *attr = e.u.start.attributes;
- char *from = 0;
- char *to = 0;
-
- while (attr) {
- if (attr->value.data.v && strncmp("FROM", attr->name, 4) == 0) {
- strncpy(buf, attr->value.data.v->s,
- MIN(attr->value.data.v->len, LINESIZE - 1));
- buf[MIN(attr->value.data.v->len, LINESIZE - 1)] = '\0';
- }
- if (attr->value.data.v && strncmp("TO", attr->name, 2) == 0) {
- strncpy(buf2, attr->value.data.v->s,
- MIN(attr->value.data.v->len, LINESIZE - 1));
- buf2[MIN(attr->value.data.v->len, LINESIZE - 1)] = '\0';
- }
- attr = attr->next;
- }
- if (maptype == 'c')
- AddCharMap(buf, buf2);
- else if (maptype == 's')
- AddSDATA(buf, buf2);
- else
- fprintf(stderr, "Unknown map type!\n");
- }
- else {
- strncpy(gi, e.u.start.gi, 512);
- sgmls_free_attributes(e.u.start.attributes);
- }
- break;
- case SGMLS_EVENT_END:
- if (strncmp("RULE", e.u.start.gi, 4) == 0)
- RememberTransSpec(&T, e.lineno);
- break;
- case SGMLS_EVENT_SUBSTART:
- break;
- case SGMLS_EVENT_SUBEND:
- break;
- case SGMLS_EVENT_APPINFO:
- break;
- case SGMLS_EVENT_CONFORMING:
- break;
- default:
- abort();
- }
- sgmls_free(sp);
- pclose(fp);
- free(command);
-}
-
-
-static void do_data(char *gi, struct sgmls_data *v, int n)
-{
- int i;
- char *cp;
- static char *buf = 0;
- static int buf_size = 0;
- int buf_pos = 0;
-
-
- /* figure out how much space this element will really
- take, inculding expanded sdata entities. */
-
- if (!buf)
- {
- buf_size = 1024;
- Malloc(buf_size, buf, char);
- }
-
- for (i = 0; i < n; i++)
- {
- char *s;
- int len;
-
- /* Mark the current position. If this is SDATA
- we will have to return here. */
- int tmp_buf_pos = buf_pos;
-
- /* Make sure the buffer is big enough. */
- if (buf_size - buf_pos <= v[i].len)
- {
- buf_size += v[i].len * (n - i);
- Realloc(buf_size, buf, char);
- }
-
- s = v[i].s;
- len = v[i].len;
- for (; len > 0; len--, s++)
- {
- if (*s != RSCHAR) {
- if (*s == RECHAR)
- buf[buf_pos] = '\n';
- else
- buf[buf_pos] = *s;
- buf_pos++;
- }
- }
- if (v[i].is_sdata)
- {
- char *p;
- buf[buf_pos] = '\0';
- p = LookupSDATA(buf + tmp_buf_pos);
- if (p)
- {
- if (buf_size - tmp_buf_pos <= strlen(p))
- {
- buf_size += strlen(p) * (n - i);
- Realloc(buf_size, buf, char);
- }
- strcpy(buf + tmp_buf_pos, p);
- buf_pos = tmp_buf_pos + strlen(p);
- }
- }
- }
-
- /* Clean up the trailing end of the data. */
- buf[buf_pos] = '\0';
- buf_pos--;
- while (buf_pos > 0 && isspace(buf[buf_pos]) && buf[buf_pos] != '\n')
- buf_pos--;
- if (buf[buf_pos] == '\n')
- buf[buf_pos] = '\0';
-
- /* Skip over whitespace at the beginning of the data. */
- cp = buf;
- while (*cp && isspace(*cp))
- cp++;
- build_ts(gi, cp);
-}
-
-/* ______________________________________________________________________ */
-/* Set a transpec parameter
- * Arguments:
- * gi - the parameter to set
- * cp - the value of the parameter
- */
-static void build_ts(char *gi, char* cp)
-{
- if (strcmp("GI", gi) == 0)
- {
- char *cp2;
- /* if we are folding the case of GIs, make all upper (unless
- it's an internal pseudo-GI name, which starts with '_') */
- if (fold_case && cp[0] != '_' && cp[0] != '#')
- {
- for (cp2=cp; *cp2; cp2++)
- if (islower(*cp2)) *cp2 = toupper(*cp2);
- }
- T.gi = AddElemName(cp);
- }
- else if (strcmp("START", gi) == 0)
- T.starttext = strdup(cp);
- else if (strcmp("END", gi) == 0)
- T.endtext = strdup(cp);
- else if (strcmp("RELATION", gi) == 0)
- {
- if (!T.relations)
- T.relations = NewMap(IMS_relations);
- SetMapping(T.relations, cp);
- }
- else if (strcmp("REPLACE", gi) == 0)
- T.replace = strdup(cp);
- else if (strcmp("ATTVAL", gi) == 0)
- {
- if (!T.nattpairs)
- {
- Malloc(1, T.attpair, AttPair_t);
- }
- else
- Realloc((T.nattpairs+1), T.attpair, AttPair_t);
- /* we'll split name/value pairs later */
- T.attpair[T.nattpairs].name = strdup(cp);
- T.nattpairs++;
- }
- else if (strcmp("CONTEXT", gi) == 0)
- T.context = strdup(cp);
- else if (strcmp("MESSAGE", gi) == 0)
- T.message = strdup(cp);
- else if (strcmp("DO", gi) == 0)
- T.use_id = atoi(cp);
- else if (strcmp("CONTENT", gi) == 0)
- T.content = strdup(cp);
- else if (strcmp("PATTSET", gi) == 0)
- T.pattrset = strdup(cp);
- else if (strcmp("VERBATIM", gi) == 0)
- T.verbatim = TRUE;
- else if (strcmp("IGNORE", gi) == 0)
- {
- if (!strcmp(cp, "all"))
- T.ignore = IGN_ALL;
- else if (!strcmp(cp, "data"))
- T.ignore = IGN_DATA;
- else if (!strcmp(cp, "children"))
- T.ignore = IGN_CHILDREN;
- else
- fprintf(stderr, "Bad 'Ignore:' arg in transpec %s: %s\n",
- gi, cp);
- }
- else if (strcmp("VARVAL", gi) == 0)
- {
- char **tok;
- int i = 2;
- tok = Split(cp, &i, S_STRDUP);
- T.var_name = tok[0];
- T.var_value = tok[1];
- }
- else if (strcmp("VARREVAL", gi) == 0)
- {
- char buf[1000];
- char **tok;
- int i = 2;
- tok = Split(cp, &i, S_STRDUP);
- T.var_RE_name = tok[0];
- ExpandVariables(tok[1], buf, 0);
- if (!(T.var_RE_value=regcomp(buf))) {
- fprintf(stderr, "Regex error in VarREValue Content: %s\n",
- tok[1]);
- }
- }
- else if (strcmp("SET", gi) == 0)
- {
- if (!T.set_var)
- T.set_var = NewMap(IMS_setvar);
- SetMapping(T.set_var, cp);
- }
- else if (strcmp("INCR", gi) == 0)
- {
- if (!T.incr_var)
- T.incr_var = NewMap(IMS_incvar);
- SetMapping(T.incr_var, cp);
- }
- else if (strcmp("NTHCHILD", gi) == 0)
- T.nth_child = atoi(cp);
- else if (strcmp("VAR", gi) == 0)
- SetMapping(Variables, cp);
- else if (strcmp("QUIT", gi) == 0)
- T.quit = strdup(cp);
- else
- fprintf(stderr, "Unknown translation spec (skipping it): %s\n", gi);
-
-}
-
-
-/* ______________________________________________________________________ */
-/* Store translation spec 't' in memory.
- * Arguments:
- * Pointer to translation spec to remember.
- * Line number where translation spec ends.
- */
-void
-RememberTransSpec(
- Trans_t *t,
- int lineno
-)
-{
- char *cp;
- int i, do_regex;
- static Trans_t *last_t;
- char buf[1000];
-
- /* If context testing, check some details and set things up for later. */
- if (t->context) {
- /* See if the context specified is a regular expression.
- * If so, compile the reg expr. It is assumed to be a regex if
- * it contains a character other than what's allowed for GIs in the
- * OSF sgml declaration (alphas, nums, '-', and '.').
- */
- for (do_regex=0,cp=t->context; *cp; cp++) {
- if (!isalnum(*cp) && *cp != '-' && *cp != '.' && *cp != ' ') {
- do_regex = 1;
- break;
- }
- }
-
- if (do_regex) {
- t->depth = MAX_DEPTH;
- if (!(t->context_re=regcomp(t->context))) {
- fprintf(stderr, "Regex error in Context: %s\n", t->context);
- }
- }
- else {
- /* If there's only one item in context, it's the parent. Treat
- * it specially, since it's faster to just check parent gi.
- */
- cp = t->context;
- if (!strchr(cp, ' ')) {
- t->parent = t->context;
- t->context = NULL;
- }
- else {
- /* Figure out depth of context string */
- t->depth = 0;
- while (*cp) {
- if (*cp) t->depth++;
- while (*cp && !IsWhite(*cp)) cp++; /* find end of gi */
- while (*cp && IsWhite(*cp)) cp++; /* skip space */
- }
- }
- }
- }
-
- /* Compile regular expressions for each attribute */
- for (i=0; i<t->nattpairs; i++) {
- /* Initially, name points to "name value". Split them... */
- cp = t->attpair[i].name;
- while (*cp && !IsWhite(*cp)) cp++; /* point past end of name */
- if (*cp) { /* value found */
- *cp++ = EOS; /* terminate name */
- while (*cp && IsWhite(*cp)) cp++; /* point to value */
- ExpandVariables(cp, buf, 0); /* expand any variables */
- t->attpair[i].val = strdup(buf);
- }
- else { /* value not found */
- t->attpair[i].val = ".";
- }
- if (!(t->attpair[i].rex=regcomp(t->attpair[i].val))) {
- fprintf(stderr, "Regex error in AttValue: %s %s\n",
- t->attpair[i].name, t->attpair[i].val);
- }
- }
-
- /* Compile regular expression for content */
- t->content_re = 0;
- if (t->content) {
- ExpandVariables(t->content, buf, 0);
- if (!(t->content_re=regcomp(buf)))
- fprintf(stderr, "Regex error in Content: %s\n",
- t->content);
- }
-
- /* If multiple GIs, break up into a vector, then remember it. We either
- * sture the individual, or the list - not both. */
- if (t->gi && strchr(t->gi, ' ')) {
- t->gilist = Split(t->gi, 0, S_ALVEC);
- t->gi = NULL;
- }
-
- /* Now, store structure in linked list. */
- if (!TrSpecs) {
- Malloc(1, TrSpecs, Trans_t);
- last_t = TrSpecs;
- }
- else {
- Malloc(1, last_t->next, Trans_t);
- last_t = last_t->next;
- }
- *last_t = *t;
-}
-
-
-/* ______________________________________________________________________ */
-/* Add an entry to the character mapping table, allocating or
- * expanding the table if necessary.
- * Arguments:
- * Character to map
- * String to map the character to
- * A 'c' or an 's' for character or sdata map
- */
-
-void
-AddCharMap(
- const char *from,
- const char* to
-)
-{
- static int n_alloc = 0;
-
- if (from && to) {
- if (nCharMap >= n_alloc) {
- n_alloc += 32;
- if (!CharMap) {
- Malloc(n_alloc, CharMap, Mapping_t);
- }
- else {
- Realloc(n_alloc, CharMap, Mapping_t);
- }
- }
- CharMap[nCharMap].name = strdup(from);
- CharMap[nCharMap].sval = strdup(to);
- nCharMap++;
- }
-}
-
-/* ______________________________________________________________________ */
-/* Add an entry to the SDATA mapping table.
- * Arguments:
- * String to map
- * String to map to
- */
-
-void
-AddSDATA(
- const char *from,
- const char *to
-)
-{
- if (from && to) {
- if (!SDATAmap)
- SDATAmap = NewMap(IMS_sdata);
- SetMappingNV(SDATAmap, from, to);
- }
-}
-
-/* ______________________________________________________________________ */
diff --git a/usr.bin/sgmls/instant/translate.c b/usr.bin/sgmls/instant/translate.c
deleted file mode 100644
index cc96b25..0000000
--- a/usr.bin/sgmls/instant/translate.c
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Program to manipulate SGML instances.
- *
- * This module is for "translating" an instance to another form, usually
- * suitable for a formatting application.
- *
- * Entry points for this module:
- * DoTranslate(elem, fp)
- * ExpandVariables(in, out, e)
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/translate.c,v 1.11 1996/06/15 22:49:00 fld Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <regexp.h>
-
-#include "general.h"
-#define STORAGE
-#include "translate.h"
-
-static Trans_t NullTrans; /* an empty one */
-
-/* forward references */
-void ProcesOutputSpec(char *, Element_t *, FILE *, int);
-static void WasProcessed(Element_t *);
-
-/* ______________________________________________________________________ */
-/* Translate the subtree starting at 'e'. Output goes to 'fp'.
- * This is the entry point for translating an instance.
- * Arguments:
- * Pointer to element under consideration.
- * FILE pointer to where to write output.
- */
-
-void
-DoTranslate(
- Element_t *e,
- FILE *fp
-)
-{
- Trans_t *t, *tn;
-
- /* Find transpec for each node. */
- DescendTree(e, PrepTranspecs, 0, 0, 0);
-
- /* Stuff to do at start of processing */
- if ((t = FindTransByName("_Start"))) {
- if (t->starttext) ProcesOutputSpec(t->starttext, 0, fp, 1);
- if (t->replace) ProcesOutputSpec(t->replace, 0, fp, 1);
- if (t->message) ProcesOutputSpec(t->message, 0, stderr, 0);
- if (t->endtext) ProcesOutputSpec(t->endtext, 0, fp, 1);
- }
-
- /* Translate topmost/first element. This is recursive. */
- TransElement(e, fp, NULL);
-
- /* Stuff to do at end of processing */
- if ((t = FindTransByName("_End"))) {
- if (t->starttext) ProcesOutputSpec(t->starttext, 0, fp, 1);
- if (t->replace) ProcesOutputSpec(t->replace, 0, fp, 1);
- if (t->message) ProcesOutputSpec(t->message, 0, stderr, 0);
- if (t->endtext) ProcesOutputSpec(t->endtext, 0, fp, 1);
- }
-
- /* Warn about unprocessed elements in this doc tree, if verbose mode. */
- if (verbose)
- DescendTree(e, WasProcessed, 0, 0, 0);
-
- /* Clean up. This is not yet complete, which is no big deal (since the
- * program is normally done at this point anyway. */
- for (t=TrSpecs; t; ) {
- tn = t->next;
- /* free the contents of t here ... */
- (void)free((void* )t);
- t = tn;
- }
- TrSpecs = 0;
-}
-
-/* ______________________________________________________________________ */
-/* Print warning about unprocessed elements in this doc tree (if they
- * were not explicitely ignored).
- * Arguments:
- * Pointer to element under consideration.
- */
-static void
-WasProcessed(
- Element_t *e
-)
-{
- Trans_t *t;
- t = e->trans;
- if (!e->processed && (t && !t->ignore)) {
- fprintf(stderr, "Warning: element '%s' was not processed:\n", e->gi);
- PrintLocation(e, stderr);
- }
-}
-
-/* ______________________________________________________________________ */
-/* For each element find transpec.
- * Arguments:
- * Pointer to element under consideration.
- */
-void
-PrepTranspecs(
- Element_t *e
-)
-{
- Trans_t *t;
- t = FindTrans(e, 0);
- e->trans = t;
-}
-
-/* ______________________________________________________________________ */
-/* Copy a buffer/string into another, expanding regular variables and immediate
- * variables. (Special variables are done later.)
- * Arguments:
- * Pointer to string to expand.
- * Pointer to expanded string. (return)
- * Pointer to element under consideration.
- */
-void
-ExpandVariables(
- char *in,
- char *out,
- Element_t *e
-)
-{
- register int i, j;
- char *ip, *vp, *op;
- char *def_val, *s, *atval, *modifier;
- char vbuf[500];
- int lev;
-
- ip = in;
- op = out;
- while (*ip) {
- /* start of regular variable? */
- if (*ip == '$' && *(ip+1) == L_CURLY && *(ip+2) != '_') {
- ip++;
- ip++; /* point at variable name */
- vp = vbuf;
- /* Look for matching (closing) curly. (watch for nesting)
- * We store the variable content in a tmp buffer, so we don't
- * clobber the input buffer.
- */
- lev = 0;
- while (*ip) {
- if (*ip == L_CURLY) lev++;
- if (*ip == R_CURLY) {
- if (lev == 0) {
- ip++;
- break;
- }
- else lev--;
- }
- *vp++ = *ip++; /* copy to variable buffer */
- }
- *vp = EOS;
- /* vbuf now contains the variable name (stuff between curlys). */
- if (lev != 0) {
- fprintf(stderr, "Botched variable use: %s\n", in);
- /* copy rest of string if we can't recover ?? */
- return;
- }
- /* Now, expand variable. */
- vp = vbuf;
-
- /* Check for immediate variables -- like _special variables but
- * interpreted right now. These start with a "+" */
-
- if ( *vp == '+' ) {
-
- if ( ! strcmp(vp, "+content") ) {
- for ( i=0; i<e->ncont; i++ ) {
- if ( IsContData(e, i) ) {
- j = strlen(ContData(e,i));
- memcpy(op, ContData(e,i), j);
- op += j;
- } else {
- fprintf(stderr, "warning: ${+current} skipped element content\n");
- }
- }
-
- } else {
- fprintf(stderr, "unknown immediate variable: %s\n", vp);
- }
-
- } else {
-
- /* See if this variable has a default [ format: ${varname def} ] */
-
- def_val = vp;
- while (*def_val && *def_val != ' ') def_val++;
- if (*def_val) *def_val++ = EOS;
- else def_val = 0;
- /* def_val now points to default, if it exists, null if not. */
-
- modifier = vp;
- while (*modifier && *modifier != ':') modifier++;
- if (*modifier) *modifier++ = EOS;
- else modifier = 0;
- /* modifier now points to modifier if it exists, null if not. */
-
- s = 0;
- /* if attribute of current elem with this name found, use value */
- if (e && (atval = FindAttValByName(e, vp)))
- s = atval;
- else /* else try for (global) variable with this name */
- s = FindMappingVal(Variables, vp);
-
- /* If we found a value, copy it to the output buffer. */
-
- if (s) {
- if ( modifier && *modifier == 'l' ) {
- while (*s) {
- *op = tolower(*s);
- op++, *s++;
- }
- } else
- while (*s) *op++ = *s++;
- } else
- if (def_val) {
- while (*def_val) *op++ = *def_val++;
- }
- }
- continue;
- }
- *op++ = *ip++;
- }
- *op = EOS; /* terminate string */
-}
-
-/* ______________________________________________________________________ */
-/* Process an "output" translation spec - one of StartText, EndText,
- * Replace, Message. (These are the ones that produce output.)
- * Steps done:
- * Expand attributes and regular varaibles in input string.
- * Pass thru string, accumulating chars to be sent to output stream.
- * If we find the start of a special variable, output what we've
- * accumulated, then find the special variable's "bounds" (ie, the
- * stuff between the curly brackets), and expand that by passing to
- * ExpandSpecialVar(). Continue until done the input string.
- * Arguments:
- * Input buffer (string) to be expanded and output.
- * Pointer to element under consideration.
- * FILE pointer to where to write output.
- * Flag saying whether to track the character position we're on
- * (passed to OutputString).
- */
-void
-ProcesOutputSpec(
- char *ib,
- Element_t *e,
- FILE *fp,
- int track_pos
-)
-{
- char obuf[LINESIZE];
- char vbuf[LINESIZE];
- char *dest, vname[LINESIZE], *cp;
- int esc;
-
- obuf[0] = EOS; /* start with empty output buffer */
-
- ExpandVariables(ib, vbuf, e); /* expand regular variables */
- ib = vbuf;
- dest = obuf;
-
- esc = 0;
- while (*ib) {
- /* If not a $, it's a regular char. Just copy it and go to next. */
- if (*ib != '$') { /* look for att/variable marker */
- *dest++ = *ib++; /* it's not. just copy character */
- continue;
- }
-
- /* We have a $. What we have must be a "special variable" since
- * regular variables have already been expanded, or just a lone $. */
-
- if (ib[1] != L_CURLY) { /* just a stray dollar sign (no variable) */
- *dest++ = *ib++;
- continue;
- }
-
- ib++; /* point past $ */
-
- /* Output what we have in buffer so far. */
- *dest = EOS; /* terminate string */
- if (obuf[0]) OutputString(obuf, fp, track_pos);
- dest = obuf; /* ready for new stuff in buffer */
-
- if (!strchr(ib, R_CURLY)) {
- fprintf(stderr, "Mismatched braces in TranSpec: %s\n", ib);
- /* how do we recover from this? */
- }
- ib++;
- cp = vname;
- while (*ib && *ib != R_CURLY) *cp++ = *ib++;
- *cp = EOS; /* terminate att/var name */
- ib++; /* point past closing curly */
- /* we now have special variable name (stuff in curly {}'s) in vname */
- ExpandSpecialVar(&vname[1], e, fp, track_pos);
- }
- *dest = EOS; /* terminate string in output buffer */
-
- if (obuf[0]) OutputString(obuf, fp, track_pos);
-}
-
-/* ______________________________________________________________________ */
-/* Find the translation spec for the given tag.
- * Returns pointer to first spec that matches (name, depth, etc., of tag).
- * Arguments:
- * e -- Pointer to element under consideration.
- * specID -- name of specid that we're looking for
- * Return:
- * Pointer to translation spec that matches given element's context.
- */
-
-Trans_t *
-FindTrans(
- Element_t *e,
- int specID
-)
-{
- char context[LINESIZE], buf[LINESIZE], *cp, **vec, *atval;
- int i, a, match;
- Trans_t *t, *tt;
-
- /* loop through all transpecs */
- for (t=TrSpecs; t; t=t->next)
- {
- /* Only one of gi or gilist will be set. */
- /* Check if elem name matches */
- if (t->gi && !StrEq(t->gi, e->gi) && !specID) continue;
-
- /* test if we're looking for a specific specID and then if
- * this is it.. */
- if (specID)
- if (!t->my_id || (specID != t->my_id))
- continue;
-
- /* Match one in the list of GIs? */
- if (t->gilist) {
- for (match=0,vec=t->gilist; *vec; vec++) {
- if (StrEq(*vec, e->gi)) {
- match = 1;
- break;
- }
- }
- if (!match) continue;
- }
-
- /* Check context */
-
- /* Special case of context */
- if (t->parent)
- if (!QRelation(e, t->parent, REL_Parent)) continue;
-
- if (t->context) { /* no context specified -> a match */
- FindContext(e, t->depth, context);
-
- /* If reg expr set, do regex compare; else just string compare. */
- if (t->context_re) {
- if (! regexec(t->context_re, context)) continue;
- }
- else {
- /* Is depth of spec deeper than element's depth? */
- if (t->depth > e->depth) continue;
-
- /* See if context of element matches "context" of transpec */
- match = ( (t->context[0] == context[0]) &&
- !strcmp(t->context, context) );
- if (!match) continue;
- }
- }
-
- /* Check attributes. Loop through list, comparing each. */
- if (t->nattpairs) { /* no att specified -> a match */
- for (match=1,a=0; a<t->nattpairs; a++) {
- if (!(atval = FindAttValByName(e, t->attpair[a].name))) {
- match = 0;
- break;
- }
- if (!regexec(t->attpair[a].rex, atval)) match = 0;
- }
- if (!match) continue;
- }
-
- /* Check relationships: child, parent, ancestor, sib, ... */
- if (t->relations) {
- Mapping_t *r;
- match = 1;
- for (r=t->relations->maps,i=0; i<t->relations->n_used; i++) {
- if (!CheckRelation(e, r[i].name, r[i].sval, 0, 0, RA_Current)) {
- match = 0;
- break;
- }
- }
- if (!match) continue;
- }
-
- /* check this element's parent's attribute */
- if (t->pattrset && e->parent) {
- char *p, **tok;
-
- i = 2;
- match = 1;
- tok = Split(t->pattrset, &i, S_STRDUP);
- if ( i == 2 ) {
- p = FindAttValByName(e->parent, tok[0]);
- ExpandVariables(tok[1], buf, 0);
- if ( !p || strcmp(p, buf) )
- match = 0;
- } else {
- if (!FindAttValByName(e->parent, t->pattrset))
- match = 0;
- }
- free(tok[0]);
- if (!match) continue;
- }
-
- /* check this element's "birth order" */
- if (t->nth_child) {
- /* First one is called "1" by the user. Internally called "0". */
- i = t->nth_child;
- if (i > 0) { /* positive # -- count from beginning */
- if (e->my_eorder != (i-1)) continue;
- }
- else { /* negative # -- count from end */
- i = e->parent->necont - i;
- if (e->my_eorder != i) continue;
- }
- }
-
- /* check that variables match */
- if (t->var_name) {
- cp = FindMappingVal(Variables, t->var_name);
- if (!cp || strcmp(cp, t->var_value)) continue;
- }
-
- /* check for variable regular expression match */
- if ( t->var_RE_name ) {
- cp = FindMappingVal(Variables, t->var_RE_name);
- if (!cp || !regexec(t->var_RE_value, cp)) continue;
- }
-
- /* check content */
- if (t->content) { /* no att specified -> a match */
- for (match=0,i=0; i<e->ndcont; i++) {
- if (regexec(t->content_re, e->dcont[i])) {
- match = 1;
- break;
- }
- }
- if (!match) continue;
- }
-
- /* -------- at this point we've passed all criteria -------- */
-
- /* See if we should be using another transpec's actions. */
- if (t->use_id) {
- if (t->use_id < 0) return &NullTrans; /* missing? */
- /* see if we have a pointer to that transpec */
- if (t->use_trans) return t->use_trans;
- for (tt=TrSpecs; tt; tt=tt->next) {
- if (t->use_id == tt->my_id) {
- /* remember pointer for next time */
- t->use_trans = tt;
- return t->use_trans;
- }
- }
- t->use_id = -1; /* flag it as missing */
- fprintf(stderr, "Warning: transpec ID (%d) not found for %s.\n",
- t->use_id, e->gi);
- return &NullTrans;
- }
-
- return t;
- }
-
- /* At this point, we have not found a matching spec. See if there
- * is a wildcard, and if so, use it. (Wildcard GI is named "*".) */
- if ((t = FindTransByName("*"))) return t;
-
- if (warnings && !specID)
- fprintf(stderr, "Warning: transpec not found for %s\n", e->gi);
-
- /* default spec - pass character data and descend node */
- return &NullTrans;
-}
-
-/* ______________________________________________________________________ */
-/* Find translation spec by (GI) name. Returns the first one that matches.
- * Arguments:
- * Pointer to name of transpec (the "gi" field of the Trans structure).
- * Return:
- * Pointer to translation spec that matches name.
- */
-
-Trans_t *
-FindTransByName(
- char *s
-)
-{
- Trans_t *t;
-
- for (t=TrSpecs; t; t=t->next) {
- /* check if tag name matches (first check 1st char, for efficiency) */
- if (t->gi) {
- if (*(t->gi) != *s) continue; /* check 1st character */
- if (!strcmp(t->gi, s)) return t;
- }
- }
- return NULL;
-}
-
-/* Find translation spec by its ID (SpecID).
- * Arguments:
- * Spec ID (an int).
- * Return:
- * Pointer to translation spec that matches name.
- */
-Trans_t *
-FindTranByID(int n)
-{
- Trans_t *t;
-
- for (t=TrSpecs; t; t=t->next)
- if (n == t->my_id) return t;
- return NULL;
-}
-
-/* ______________________________________________________________________ */
-/* Process a "chunk" of content data of an element.
- * Arguments:
- * Pointer to data content to process
- * FILE pointer to where to write output.
- */
-
-void
-DoData(
- char *data,
- FILE *fp,
- int verbatim
-)
-{
- if (!fp) return;
- OutputString(data, fp, 1);
-}
-
-/* ______________________________________________________________________ */
-/* Handle a processing instruction. This is done similarly to elements,
- * where we find a transpec, then do what it says. Differences: PI names
- * start with '_' in the spec file (if a GI does not start with '_', it
- * may be forced to upper case, sgmls keeps PIs as mixed case); the args
- * to the PI are treated as the data of an element. Note that a PI wildcard
- * is "_*"
- * Arguments:
- * Pointer to the PI.
- * FILE pointer to where to write output.
- */
-
-void
-DoPI(
- char *pi,
- FILE *fp
-)
-{
- char buf[250], **tok;
- int n;
- Trans_t *t;
-
- buf[0] = '_';
- strcpy(&buf[1], pi);
- n = 2;
- tok = Split(buf, &n, 0);
- if ((t = FindTransByName(tok[0])) ||
- (t = FindTransByName("_*"))) {
- if (t->replace) ProcesOutputSpec(t->replace, 0, fp, 1);
- else {
- if (t->starttext) ProcesOutputSpec(t->starttext, 0, fp, 1);
- if (t->ignore != IGN_DATA) /* skip data nodes? */
- if (n > 1) OutputString(tok[1], fp, 1);
- if (t->endtext) ProcesOutputSpec(t->endtext, 0, fp, 1);
- }
- if (t->message) ProcesOutputSpec(t->message, 0, stderr, 0);
- }
- else {
- /* If not found, just print the PI in square brackets, along
- * with a warning message. */
- fprintf(fp, "[%s]", pi);
- if (warnings) fprintf(stderr, "Warning: Unrecognized PI: [%s]\n", pi);
- }
-}
-
-/* ______________________________________________________________________ */
-/* Set and increment variables, as appropriate, if the transpec says to.
- * Arguments:
- * Pointer to translation spec for current element.
- */
-
-static void
-set_and_increment(
- Trans_t *t,
- Element_t *e
-)
-{
- Mapping_t *m;
- int i, inc, n;
- char *cp, buf[50];
- char ebuf[500];
-
- /* set/reset variables */
- if (t->set_var) {
- for (m=t->set_var->maps,i=0; i<t->set_var->n_used; i++) {
- ExpandVariables(m[i].sval, ebuf, e); /* do some expansion */
- SetMappingNV(Variables, m[i].name, ebuf);
- }
- }
-
- /* increment counters */
- if (t->incr_var) {
- for (m=t->incr_var->maps,i=0; i<t->incr_var->n_used; i++) {
- cp = FindMappingVal(Variables, m[i].name);
- /* if not set at all, set to 1 */
- if (!cp) SetMappingNV(Variables, m[i].name, "1");
- else {
- if (isdigit(*cp) || (*cp == '-' && isdigit(cp[1]))) {
- n = atoi(cp);
- if (m[i].sval && isdigit(*m[i].sval)) inc = atoi(m[i].sval);
- else inc = 1;
- sprintf(buf, "%d", (n + inc));
- SetMappingNV(Variables, m[i].name, buf);
- } else
- if (!*(cp+1) && isalpha(*cp)) {
- buf[0] = *cp + 1;
- buf[1] = 0;
- SetMappingNV(Variables, m[i].name, buf);
- }
- }
- }
- }
-}
-
-/* ______________________________________________________________________ */
-/* Translate one element.
- * Arguments:
- * Pointer to element under consideration.
- * FILE pointer to where to write output.
- * Pointer to translation spec for current element, or null.
- */
-void
-TransElement(
- Element_t *e,
- FILE *fp,
- Trans_t *t
-)
-{
- int i;
-
- if (!t) t = ((e && e->trans) ? e->trans : &NullTrans);
-
- /* see if we should quit. */
- if (t->quit) {
- fprintf(stderr, "Quitting at location:\n");
- PrintLocation(e, fp);
- fprintf(stderr, "%s\n", t->quit);
- exit(1);
- }
-
- /* See if we want to replace subtree (do text, don't descend subtree) */
- if (t->replace) {
- ProcesOutputSpec(t->replace, e, fp, 1);
- if (t->message) ProcesOutputSpec(t->message, e, stderr, 0);
- set_and_increment(t, e); /* adjust variables, if appropriate */
- return;
- }
-
- if (t->starttext) ProcesOutputSpec(t->starttext, e, fp, 1);
- if (t->message) ProcesOutputSpec(t->message, e, stderr, 0);
-
- /* Process data for this node and descend child elements/nodes. */
- if (t->ignore != IGN_ALL) {
- /* Is there a "generated" node at the front of this one? */
- if (e->gen_trans[0]) {
- Trans_t *tp;
- if ((tp = FindTranByID(e->gen_trans[0]))) {
- if (tp->starttext) ProcesOutputSpec(tp->starttext, e, fp, 1);
- if (tp->message) ProcesOutputSpec(tp->message, e, stderr, 0);
- if (tp->endtext) ProcesOutputSpec(tp->endtext, e, fp, 1);
- }
- }
- /* Loop thruthe "nodes", whether data, child element, or PI. */
- for (i=0; i<e->ncont; i++) {
- if (IsContElem(e,i)) {
- if (t->ignore != IGN_CHILDREN) /* skip child nodes? */
- TransElement(ContElem(e,i), fp, NULL);
- }
- else if (IsContData(e,i)) {
- if (t->ignore != IGN_DATA) /* skip data nodes? */
- DoData(ContData(e,i), fp, t->verbatim);
- }
- else if (IsContPI(e,i))
- DoPI(e->cont[i].ch.data, fp);
- }
- /* Is there a "generated" node at the end of this one? */
- if (e->gen_trans[1]) {
- Trans_t *tp;
- if ((tp = FindTranByID(e->gen_trans[1]))) {
- if (tp->starttext) ProcesOutputSpec(tp->starttext, e, fp, 1);
- if (tp->message) ProcesOutputSpec(tp->message, e, stderr, 0);
- if (tp->endtext) ProcesOutputSpec(tp->endtext, e, fp, 1);
- }
- }
- }
-
- set_and_increment(t, e); /* adjust variables, if appropriate */
-
- if (t->endtext) ProcesOutputSpec(t->endtext, e, fp, 1);
-
- e->processed = 1;
-}
-
-/* ______________________________________________________________________ */
-/* Check if element matches specified relationship, and, if it does, perform
- * action on either current element or matching element (depends on flag).
- * Arguments:
- * Pointer to element under consideration.
- * Pointer to relationship name.
- * Pointer to related element name (GI).
- * Pointer to action to take (string - turned into an int).
- * FILE pointer to where to write output.
- * Flag saying whether to do action on related element (RA_Related)
- * or on current element (RA_Current).
- * Return:
- * Bool, saying whether (1) or not (0) relationship matches.
- */
-
-int
-CheckRelation(
- Element_t *e,
- char *relname, /* relationship name */
- char *related, /* related element */
- char *actname, /* action to take */
- FILE *fp,
- RelAction_t flag
-)
-{
- Element_t *ep;
- Relation_t r;
-
- if ((r = FindRelByName(relname)) == REL_Unknown) return 0;
- if (!(ep=QRelation(e, related, r))) return 0;
-
- if (!actname) return 1; /* no action - return what we found */
-
- switch (flag) {
- case RA_Related: TranTByAction(ep, actname, fp); break;
- case RA_Current: TranTByAction(e, actname, fp); break;
- }
- return 1;
-}
-
-/* ______________________________________________________________________ */
-/* Perform action given by a SpecID on the given element.
- * Arguments:
- * Pointer to element under consideration.
- * SpecID of action to perform.
- * FILE pointer to where to write output.
- *
- */
-void
-TranByAction(
- Element_t *e,
- int n,
- FILE *fp
-)
-{
- Trans_t *t;
-
- t = FindTranByID(n);
- if (!t) {
- fprintf(stderr, "Could not find named action for %d.\n", n);
- return;
- }
- TransElement(e, fp, t);
-}
-
-/* ______________________________________________________________________ */
-/* Perhaps perform action given by a SpecID on the given element.
- * Arguments:
- * Pointer to element under consideration.
- * SpecID of action to perform. Unlike TranByAction, this is the argument
- * as it occurred in the transpec (ASCII) and may end with the letter
- * "t" which means that the transpec mustpass criteria selection.
- * FILE pointer to where to write output.
- */
-void
-TranTByAction(
- Element_t *e,
- char *strn,
- FILE *fp
-)
-{
- int n;
- Trans_t *t;
-
- n = atoi(strn);
- if ( strn[strlen(strn)-1] != 't' ) {
- t = FindTranByID(n);
- if (!t) {
- fprintf(stderr, "Could not find named action for %d.\n", n);
- return;
- }
- } else {
- t = FindTrans(e, n);
- if ( !t || !t->my_id )
- return;
- }
- TransElement(e, fp, t);
-}
-
-/* ______________________________________________________________________ */
diff --git a/usr.bin/sgmls/instant/translate.h b/usr.bin/sgmls/instant/translate.h
deleted file mode 100644
index 777d591..0000000
--- a/usr.bin/sgmls/instant/translate.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * Program to manipulate SGML instances.
- *
- * These are data definitions for the "translating" portion of the program.
- *
- * ________________________________________________________________________
- */
-
-#ifdef STORAGE
-#ifndef lint
-static char *tr_h_RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/translate.h,v 1.3 1996/06/02 21:47:32 fld Exp $";
-#endif
-#endif
-
-#define L_CURLY '{'
-#define R_CURLY '}'
-
-/* things to ignore when processing an element */
-#define IGN_NONE 0
-#define IGN_ALL 1
-#define IGN_DATA 2
-#define IGN_CHILDREN 3
-
-/* for CheckRelation() */
-typedef enum { RA_Current, RA_Related } RelAction_t;
-
-typedef struct {
- char *name; /* attribute name string */
- char *val; /* attribute value string */
- regexp *rex; /* attribute value reg expr (compiled) */
-} AttPair_t;
-
-typedef struct _Trans {
- /* criteria */
- char *gi; /* element name of tag under consideration */
- char **gilist; /* list of element names (multiple gi's) */
- char *context; /* context in tree - looking depth levels up */
- regexp *context_re; /* tree heirarchy looking depth levels up */
- int depth; /* number of levels to look up the tree */
- AttPair_t *attpair; /* attr name-value pairs */
- int nattpairs; /* number of name-value pairs */
- char *parent; /* GI has this element as parent */
- int nth_child; /* GI is Nth child of this of parent element */
- char *content; /* element has this string in content */
- regexp *content_re; /* content reg expr (compiled) */
- char *pattrset; /* is this attr set (any value) in parent? */
- char *var_name; /* variable name */
- char *var_value; /* variable value */
- char *var_RE_name; /* variable name (for VarREValue) */
- regexp *var_RE_value; /* variable value (compiled, for VarREValue) */
- Map_t *relations; /* various relations to check */
-
- /* actions */
- char *starttext; /* string to output at the start tag */
- char *endtext; /* string to output at the end tag */
- char *replace; /* string to replace this subtree with */
- char *message; /* message for stderr, if element encountered */
- int ignore; /* flag - ignore content or data of element? */
- int verbatim; /* flag - pass content verbatim or do cmap? */
- char *var_reset;
- char *increment; /* increment these variables */
- Map_t *set_var; /* set these variables */
- Map_t *incr_var; /* increment these variables */
- char *quit; /* print message and exit */
-
- /* pointers and bookkeeping */
- int my_id; /* unique (hopefully) ID of this transpec */
- int use_id; /* use transpec whose ID is this */
- struct _Trans *use_trans; /* pointer to other transpec */
- struct _Trans *next; /* linked list */
- int lineno; /* line number of end of transpec */
-} Trans_t;
-
-#ifdef def
-#undef def
-#endif
-#ifdef STORAGE
-# define def
-#else
-# define def extern
-#endif
-
-def Trans_t *TrSpecs;
-def Mapping_t *CharMap;
-def int nCharMap;
-
-/* prototypes for things defined in translate.c */
-int CheckRelation(Element_t *, char *, char *, char *, FILE*, RelAction_t);
-Trans_t *FindTrans(Element_t *, int);
-Trans_t *FindTransByName(char *);
-Trans_t *FindTransByID(int);
-void PrepTranspecs(Element_t *);
-void ProcessOneSpec(char *, Element_t *, FILE *, int);
-void TransElement(Element_t *, FILE *, Trans_t *);
-void TranByAction(Element_t *, int, FILE *);
-void TranTByAction(Element_t *, char *, FILE *);
-
-/* prototypes for things defined in tranvar.c */
-void ExpandSpecialVar(char *, Element_t *, FILE *, int);
-
-/* prototypes for things defined in tables.c */
-void OSFtable(Element_t *, FILE *, char **, int);
-
-/* ______________________________________________________________________ */
-
diff --git a/usr.bin/sgmls/instant/transpec.5 b/usr.bin/sgmls/instant/transpec.5
deleted file mode 100644
index 297b9d0..0000000
--- a/usr.bin/sgmls/instant/transpec.5
+++ /dev/null
@@ -1,528 +0,0 @@
-...\"
-...\"
-...\" Copyright (c) 1994
-...\" Open Software Foundation, Inc.
-...\"
-...\" Permission is hereby granted to use, copy, modify and freely distribute
-...\" the software in this file and its documentation for any purpose without
-...\" fee, provided that the above copyright notice appears in all copies and
-...\" that both the copyright notice and this permission notice appear in
-...\" supporting documentation. Further, provided that the name of Open
-...\" Software Foundation, Inc. ("OSF") not be used in advertising or
-...\" publicity pertaining to distribution of the software without prior
-...\" written permission from OSF. OSF makes no representations about the
-...\" suitability of this software for any purpose. It is provided "as is"
-...\" without express or implied warranty.
-...\"
-...\" Copyright (c) 1996 X Consortium
-...\" Copyright (c) 1996 Dalrymple Consulting
-...\"
-...\" Permission is hereby granted, free of charge, to any person obtaining a copy
-...\" of this software and associated documentation files (the "Software"), to deal
-...\" in the Software without restriction, including without limitation the rights
-...\" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-...\" copies of the Software, and to permit persons to whom the Software is
-...\" furnished to do so, subject to the following conditions:
-...\"
-...\" The above copyright notice and this permission notice shall be included in
-...\" all copies or substantial portions of the Software.
-...\"
-...\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-...\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-...\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-...\" X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
-...\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-...\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-...\" OTHER DEALINGS IN THE SOFTWARE.
-...\"
-...\" Except as contained in this notice, the names of the X Consortium and
-...\" Dalrymple Consulting shall not be used in advertising or otherwise to
-...\" promote the sale, use or other dealings in this Software without prior
-...\" written authorization.
-...\"
-...\" Translated with /usr/local/lib/tpt/ref-man.ts by fld on cord, Wed 07 Feb 1996, 22:00
-.TH "\fBtranspec\fP" "file format"
-.SH "Name"
-\fBtranspec\fP - translation specification for \fBinstant\fP
-.SH "Synopsis"
-.na
-.PP
-\fBfile.ts\fP
-.ad
-.SH "Description"
-.PP
-The \fBtranspec\fP file is used by the \fBinstant\fP program to translate an SGML document instance to a format suitable for a formatting application.
-The convention is to name the file with the suffix \fB.ts\fP.
-.PP
-A \fBtranspec\fP file is composed of a number of individual translation specs.
-Each translation spec (transpec) is made up of a number of fields, one per line.
-Translation specs are separated by a line with a leading dash. Text after the dash is ignored.
-Fields are composed of two parts, a name and a value, separated by a colon.
-The colon must immediately follow the name, and any amount of whitespace (blanks and tabs) may be present between the colon and value.
-Values should not be quoted, and you should be careful of trailing spaces.
-(Trailing space will be considered part of the value.)
-Quotes, if they appear, will be considered part of the value of the fields.
-Lines that begin with whitespace (blanks and tabs) are a continuation of the previous line; the leading space is ignored.
-These characteristics are very similar to those of e-mail headers.
-Lines beginning with a \fB#\fP (number sign) are comments and blank lines are ignored.
-.SH "Field Descriptions"
-.PP
-Some fields are for identifying criteria that determines if a particular spec matches an element in the instance.
-Others specify what action is to take place when a match happens, such as sending text to the output stream.
-.SS "Criteria fields"
-.PP
-Criteria fields restrict the conditions under which a single translation spec will apply.
-If each field specified in a particular transpec matches an element under consideration in the document instance,
-then that translation spec is said to match. The appropriate actions, as specified in that spec, are then taken.
-The program, \fBinstant\fP, searches the list of transpecs in the order given in the file.
-Therefore, the more restrictive specs (those with more criteria) should appear before less restrictive ones.
-.PP
-For quick reference, this is a brief summary of the possible criteria fields for translation. A complete discussion of each follows.
-.P
-.TS
-tab(@);
-l l l.
-\fBField Label\fR@\fBField Value\fR@\fBDescription\fR
-GI@gi ...@name of this GI
-AttValue@attname reg-expr@current element has attribute with value
-Content@reg-expr@is reg-expr in char content>
-Context@context@element context, up the tree
-NthChild@number@current element is Nth child of its parent
-PAttSet@attname (val)@parent has this attribute set (optional to value val)
-Relation@relationship gi@gi has relationship to current element
-VarREValue@var REvalue@variable is set to regular expression value
-VarValue@var value@variable is set to value
-.TE
-'br\" labeled list
-.IP "\fBGI:\fP \fIgi\fP [...]"
-\fIgi\fP is the name of the generic identifier, or element name, to consider.
-More than one GI may appear in this field.
-.IP "\fBAttValue:\fP \fIattname\fP \fIregular-expression\fP"
-This is an attribute name-value pair, where \fIattname\fP is an attribute if the GI.
-The \fIregular-expression\fP is of the form accepted by the unix program \fBegrep\fP.
-This pair is compared to the corresponding attribute name-value pairs of the GI under consideration.
-To simply test if an attribute us set, use \fB.\fP (a dot) for \fIregular-expression\fP.
-There may be more than one of these lines for each transpec.
-.IP "\fBContent:\fP \fIregular-expression\fP"
-This specifies that the character content of GI contains a string matching the \fIregular-expression\fP.
-.IP "\fBContext:\fP \fIcontext\fP"
-This specifies the \fIcontext\fP in which to apply this translation spec.
-It is either a list of generic identifiers or a regular expression describing a list of generic identifiers, looking up the hierarchy.
-The first is the parent of the GI.
-.IP "\fBNthChild:\fP \fInumber\fP"
-This specifies that the GI is the \fInumber\fPth child element of its parent.
-Children are numbered starting with \fB1\fP.
-Negative numbers may be used to indicate order counting backwards.
-For example, -1 denotes the last child.
-.IP "\fBPAttSet:\fP \fIattname\fP"
-This specifies that the parent has this attribute, \fIattname\fP, set to any value (not IMPLIED). A value to match may optionally
-be specified after attname.
-.IP "\fBRelation:\fP \fIrelationship\fP \fIgi\fP"
-This specifies that the current element has the \fIrelationship\fP to the named \fIgi\fP.
-The acceptable relationships are: \fBancestor\fP (anywhere up the tree), \fBchild\fP (immediate child),
-\fBdescendant\fP (anywhere down the tree), \fBparent\fP (immediate ancestor), \fBsibling\fP (share same parent element),
-\fBsibling+\fP (any later sibling), \fBsibling+1\fP (the immediately following sibling), \fBsibling-\fP (any earlier sibling),
-\fBsibling-1\fP (the immediately following sibling).
-.IP "\fBVarREValue:\fP \fIvarname\fP \fIREvalue\fP"
-This specifies that the global variable \fIvarname\fP has the value \fIREvalue\fP,
-where \fIREvalue\fP is a regular expression
-(see the \fBVarValue\fP statement).
-.IP "\fBVarValue:\fP \fIvarname\fP \fIvalue\fP"
-This specifies that the global variable \fIvarname\fP has the (literal)
-value \fIvalue\fP (see the \fBVarREValue\fP statement).
-'br\" labeled list end
-.PP
-There are two special GIs.
-If specified, \fB_Start\fP and \fB_End\fP are processed as if they were GIs in the instance at the start and end of the translation, respectively.
-Their criteria are never checked. Only their actions are performed.
-.SS "Action fields"
-.PP
-For quick reference, this is a brief summary of the action fields for translation. They are only performed if all the criteria are satisfied.
-A complete discussion of each follows.
-.P
-.TS
-tab(@);
-l l l.
-\fBField Label\fR@\fBField Value\fR@\fBDescription\fR
-Action@spec-id@use transpec whose spec ID is `spec-id'
-EndText@text@text for end of element
-Increment@name@increment variable `name'
-Ignore@key@flag for ignoring element's children and/or data
-Message@text@text to send to stderr
-Quit@text@print text and quit program
-Replace@text@replace this subtree with text
-Set@name value@set variable \fIname\fP to \fIvalue\fP
-SpecID@spec-id@unique Spec ID (int) of this spec
-StartText@text@text for start of element
-.TE
-'br\" labeled list
-.IP "\fBAction:\fP \fIspec-id\fP"
-Use the actions of the spec identified by the \fBSpecID\fP with matching identifier \fIspec-id\fP.
-.IP "\fBEndText:\fP \fItext\fP"
-This specifies text to be output when the end tag is processed.
-.IP "\fBIgnore:\fP \fIkey\fP"
-This specifies that the data or children for this element are to be ignored.
-Set \fIkey\fP to \fBall\fP to ignore the element (data and child elements),
-to \fBdata\fP to ignore the immediate character data content (child elements are still descended into),
-and to \fBchildren\fP to process the immediate character data content but not descended into child elements.
-Other actions specified in this transpec are still performed, however.
-.IP "\fBIncrement:\fP \fIname\fP"
-This is used to increment a variable whose value is a number.
-If the variable is not a number, no action will be taken.
-The variable must have been previously defined. This action is done immediately before \fBEndText\fP.
-There may be more than one of these lines for each transpec.
-.IP "\fBMessage:\fP \fItext\fP"
-This specifies a string to be printed to the standard error when the matching element is processed.
-It is intended for informing the user of the progress of the translation.
-It is also used for validation of instances (see the \fB-v\fP flag of \fBinstant\fP(1));
-a spec would be written to recognize a construct that is not allowed.
-This action is done immediately after \fBStartText\fP.
-Messages are also useful for debugging spec files; one is able to easily tell when a matching spec is processed,
-without looking at the actual output of the translation.
-Note that the spec writer is responsible for putting newlines (\fB\en\fP) in the message text.
-.IP "\fBReplace:\fP \fItext\fP"
-This specifies text to replace the current subtree with.
-This is equivalent to \fBStartText\fP and \fBIgnore\fP.
-.IP "\fBQuit:\fP \fItext\fP"
-This specifies text to be printed to the standard error. The program then terminates with exit status 1.
-This is intended for bailing out when an undesirable instance is encountered
-(such as when it is known that the formatting application can never handle a class of components, like tables).
-.IP "\fBSet:\fP \fIname\fP \fIvalue\fP"
-This is used to set a variable whose name is \fIname\fP and value is \fIvalue\fP.
-Names that would be valid for GIs in the document instance are valid for variable names.
-\fIvalue\fP is the rest of the line and may be any string. This action is done immediately before \fBEndText\fP.
-There may be more than one of these lines for each transpec.
-See the discussion on variables below.
-.IP "\fBSpecID:\fP \fIspec-id\fP"
-This names the spec with the number \fIspec-id\fP. Other specs may refer to this one by this number by an \fBAction\fP field or an \fB_action\fP special variable.
-This is used for cases where several specs to perform the exact same action.
-.IP "\fBStartText:\fP \fItext\fP"
-This specifies text to be output when the start tag is processed.
-'br\" labeled list end
-.SS "Other Fields"
-.PP
-These fields may appear anywhere. The action occurs when the translation spec file is read, before any elements are translated.
-Theses are independent of any element processing.
-'br\" labeled list
-.IP "\fBVar:\fP \fIname\fP \fIvalue\fP"
-This is used to define a variable whose name is \fIname\fP and value is \fIvalue\fP.
-It is similar to \fBSet\fP, but it may occur anywhere in the file and takes effect when the spec file is read.
-'br\" labeled list end
-.SS "Text Strings"
-.PP
-The \fItext\fP referred to in the \fBStartText\fP, \fBEndText\fP, \fBReplace\fP,
-and \fBMessage\fP actions is more than simple character strings.
-Special sequences allow more complex output.
-.PP
-One type of special sequence is for C-style string processing.
-Most special characters are escaped with a \e (backslash). Like in C or shell programs, to print a \e (backslash), you must escape it with another backslash. These special character strings are:
-'br\" labeled list
-.IP "\fB\en (backslash-n)\fP"
-This specifies that a newline character is to be printed to the output stream.
-.IP "\fB\er (backslash-r)\fP"
-This specifies that a carriage return character is to be printed to the output stream.
-.IP "\fB\et (backslash-t)\fP"
-This specifies that a tab character is to be printed to the output stream.
-.IP "\fB\es (backslash-s)\fP"
-This specifies that a space is to be printed to the output stream.
-This is useful for the end of a transpec line, where it can be difficult to tell if a blank is present at the end.
-.IP "\fB\e007 (backslash-007)\fP"
-This specifies that the character whose octal value is 007 is to be printed to the output stream.
-This works for any octal character value.
-.IP "\fB^ (caret)\fP"
-This specifies the that position in the string will be at the start of a line in the output stream.
-'br\" labeled list end
-.PP
-If the first token of the text string is \fB#include\fP, then the second token is taken to be a file name and that file is included.
-If the file is not found, the library directory, as mentioned above, is searched.
-If the text string starts with a \fB!\fP (exclamation point), the rest of the line is taken to be a command and the output of that command is inserted.
-.PP
-An element's attributes may also be used in the text of output fields.
-To use an attribute value, precede its name with a \fB${\fP (dollar sign-left curly bracket) and follow it with a \fB}\fP (right curly bracket).
-(This style is followed by the Bourne shell.) For example, \fB${TYPE}\fP.
-If the attribute is not set (not IMPLIED), nothing will be printed to the output stream.
-To specify a value to use if the attribute is not set, place the value after the attribute name, separated by a space.
-To return the attribute value in lower-case, add a colon followed by
-lower-case l (\fB${TYPE:l}\fP.
-.SH "Variables"
-.PP
-Variables in \fBinstant\fP are similar to those in many other string-oriented programming languages, such as \fBsh\fP and \fBawk\fP.
-They are set by: \fBVar:\fP \fIname\fP \fIvalue\fP and \fBSet:\fP \fIname\fP \fIvalue\fP.
-Values may be set and reset to any string.
-In a \fBVar\fP line, if the value begins with a \fB!\fP,
-then the rest of the line is executed as a command, and its output is taken as the \fIvalue\fP.
-.PP
-A reference to the value of a variable follows the same syntax as
-a reference to the value of an attribute: \fB${\fIname\fB}\fR.
-If that variable has not been defined, a null value will be returned.
-A default value can be returned instead of null for an undefined variable
-by using the form: \fB${\fIname default\fB}\fR.
-.PP
-Variables may be used as attributes are, that is in any of the text strings mentioned above.
-In fact, if an attribute name is referred to and it is not set for a given element,
-\fBinstant\fP looks for a variable with the same name. This way global defaults can be set.
-If you want to be sure that you are accessing a local variable value, not an attribute value, you can use lower or mixed case names.
-Attribute names, as passed by \fBsgmls\fP, are in upper case.
-.PP
-Any number of \fBVar\fP actions may appear in the spec file. These set the values of the variables before any translation takes place.
-The \fBSet\fP actions within transpecs are performed when that spec is processed when an element matches the given criteria.
-.SS "Preset Variables"
-.PP
-Several variables are preset by \fBinstant\fP upon start of the program.
-Their values may be overridden in transpec files or on the command line.
-'br\" labeled list
-.IP "\fBdate\fP"
-This is the date and time that the program started. The format is: \f(CWTue 10 Aug 1993, 16:52\fP.
-.IP "\fBhost\fP"
-This is the name of the host where the program is run. It is what is returned by the \fBgethostname\fP library call.
-.IP "\fBtranspec\fP"
-This is the translation spec filename.
-.IP "\fBuser\fP"
-This is the login name of the user running the program.
-'br\" labeled list end
-.SS "Special Variables"
-.PP
-There is a collection of special variables called \fIspecial variables\fP.
-These are identified by starting the names with a \fB_\fP (underscore).
-This is a summary of the special variables. A complete discussion of each special variable follows.
-\fBspec-id\fP refers to a number specified in a \fBSpecID\fP field.
-When used in a special variable, it means to perform the action in that translation spec.
-.PP
-Note that when a \fIspec-id\fR is given in a special variable,
-the default is to perform the translation spec named by the \fIspec-id\fR ignoring
-of any criteria statements found there.
-For most special variables that use a \fIspec-id\fP, postpending a "\fBt\fR" to
-the \fIspec-id\fR (with no spaces between them, eg,
-"\fB${_followrel child TITLE 15t}\fR"), will cause the criteria statements
-in the named translation spec to evaluate successfully before that translation
-spec will be processed.
-.P
-.TS
-tab(@);
-l l.
-\fBVariable Usage\fR@\fBDescription\fR
-\fB_action\fP \fIspec-id\fP@do spec with id spec-id
-\fB_allatts\fP@print all attribute/value pairs
-\fB_attval\fP \fIatt\fP [\fIvalue\fP] \fIspec-id\fP@use spec-id if attribute matches
-\fB_chasetogi\fP \fIgi\fP \fIspec-id\fP@follow IDREFs until gi found
-\fB_eachatt\fP \fIatt\fP \fIspec-id\fP [\fIspec-id\fP]@do spec-id for each word of attribute value
-\fB_eachcon\fP \fIspec-id\fP [\fIspec-id\fP]@do spec-id for each word of content
-\fB_env\fP \fIenv-variable\fP@return value of env variable
-\fB_filename\fP@filename of notation
-\fB_find\fP \fIrel\fP \fIgi\fP \fIspec-id\fP@find gi based on relationship
-\fB_followlink\fP [\fIattname\fP] \fIspec-id\fP@follow IDREFs [attname] and use spec-id
-\fB_followrel\fP \fIrel\fP \fIgi\fP \fIspec-id\fP [\fIspec-id\fP]@do spec-id on rel if it matches
-\fB_gi\fP [\fBM|L|U\fP]@return GI name; M, L, U case
-\fB_id\fP \fIid [\fP\fIspec-id\fP]@find element with ID and use spec-id
-\fB_include\fP \fIfilename\fP@insert file here
-\fB_infile\fP [\fBline\fP]@instance filename [and line number]
-\fB_insertnode\fP S|E \fIspec-id\fP@do spec-id when element is traversed
-\fB_isset\fP \fIvar\fP [\fIvalue\fP] \fIspec-id\fP@do spec-id if variable matches
-\fB_location\fP@print location of current element
-\fB_namelist\fP \fIspec-id\fP [\fIspec-id\fP]@content is namelist, do spec-id for each
-\fB_nchild\fP [\fIgi\fP]@number of child elements [named \fIattname\fP]
-\fB_osftable\fP \fIformat\fP [\fIflag\fP]@print table format specification
-\fB_path\fP@print path to current element
-\fB_pattr\fP \fIattname\fP@value of parent's attribute
-\fB_pfind\fP \fIargs ...\fP@same as \fB_find\fP, but start at parent
-\fB_relation\fP \fIrel\fP \fIgi\fP \fIspec-id\fP [\fIspec-id\fP]@do spec-id if relation matches
-\fB_set\fP \fIvar\fP \fIvalue\fP@set variable to value
-\fB_!\fP\fIcommand\fP@command to run
-.TE
-'br\" labeled list
-.IP "\fB_action\fP \fIspec-id\fP"
-Use the actions of the spec identified by the \fBSpecID\fP with matching identifier \fIspec-id\fP.
-This behaves similarly to the \fBAction\fP action, but is in addition to the present translation spec.
-.IP "\fB_allatts\fP"
-Print all attribute name-value pairs of the current element to the output stream.
-The name and value are separated by a \fB=\fP (equals sign), and the value is surrounded by quotes.
-This can be useful for creating a normalized version of the instance.
-.IP "\fB_attval\fP \fIattname\fP [\fIvalue\fP] \fIspec-id\fP"
-If the current element has an attribute named \fIattname\fP, optionally whose value matches \fIvalue\fP,
-use the actions of the transpec identified by \fIspec-id\fP.
-.IP "\fB_chasetogi\fP \fIgi\fP \fIspec-id\fP"
-Follow IDREF attributes until if finds an element whose GI is \fIgi\fP or which has a child element with that GI.
-It will apply the transpec \fIspec-id\fP to that element.
-By default, \fBinstant\fP assumes the attributes named \fBLINKEND\fP, \fBLINKENDS\fP, and \fBIDREF\fP are of type IDREF or IDREFS.
-(This corresponds with the OSF DTDs.)
-You can change this by setting the variable \fBlink_atts\fP to a space-separated list of attribute names.
-.IP "\fB_eachatt\fP \fIatt\fP \fIspec-id\fP [\fIspec-id2\fP]"
-The transpec named by \fIspec-id\fR is invoked once per each word
-found in the value of the attribute \fIatt\fR.
-Inside the target transpec, the current word being processed
-is available in the variable named \fBeach_A\fR (\fB${each_A}\fR).
-If \fIspec-id2\fP is specified, it will use \fIspec-id\fP for the first word
-in the attribute and \fIspec-id2\fP for the others.
-.IP "\fB_eachcon\fP \fIspec-id\fP [\fIspec-id2\fP]"
-The transpec named by \fIspec-id\fR is invoked once per each word
-found in the content of the current element.
-Inside the target transpec, the current word being processed
-is available in the variable named \fBeach_C\fR (\fB${each_C}\fR).
-If \fIspec-id2\fP is specified, it will use \fIspec-id\fP for the first word
-in the content and \fIspec-id2\fP for the others.
-.IP "\fB_env\fP \fIenv-variable\fP"
-Print the value of the environment variable \fIenv-variable\fP to the output stream.
-.IP "\fB_filename\fP"
-Print the filename of the notation associated with this element, if any.
-This is used to get the filename of an external notation entity reference.
-For example, to print the filename in the latex macro from the epsf macro package, use \f(CW\e\eepsfboxi{${_filename}}\fP.
-.IP "\fB_find\fP [\fBtop\fP] \fIrelationship\fP \fIargs ...\fP \fIspec-id\fP"
-Descend the document hierarchy finding elements that match one of several criteria.
-When one is found, the action specified by \fIspec-id\fP is performed.
-If \fBtop\fP is specified, the search starts at the top of the document hierarchy, rather than at the current element.
-The possible values for \fIrelationship\fP are \fBgi\fP, \fBgi-parent\fP, \fBparent\fP, and \fBattr\fP,
-and take different arguments.
-Explanations may be best done by example:
-\fB_find gi CHAPTER 123\fP means to find elements whose GI is CHAPTER, and perform action 123;
-\fB_find gi-parent TITLE CHAPTER 124\fP means to find elements whose GI is TITLE and whose parent is CHAPTER, and perform action 124;
-\fB_find parent BODY 125\fP means to find elements whose parent's GI is BODY, and perform action 125;
-\fB_find attr TYPE UGLY 125\fP means to find elements whose attribute named TYPE is set to UGLY, and perform action 126.
-.IP "\fB_followlink\fP [\fIattname\fP] \fIspec-id\fP"
-When processing an element, \fBinstant\fP will follow the IDREF attributes until an element with no IDREF attributes is found.
-It will then apply the transpec specified by \fIspec-id\fP to that element.
-If specified, it will follow the link pointed to by \fIattname\fP.
-By default, \fBinstant\fP assumes the attributes named \fBLINKEND\fP and \fBLINKENDS\fP are if type IDREF or IDREFS.
-You can change this by setting the variable \fBlink_atts\fP to a space-separated list of attribute names.
-.IP "\fB_followrel\fP \fIrelationship\fP \fIgi\fP \fIspec-id\fP [\fIspec-id2\fP]"
-If the \fIgi\fP has the specified \fIrelationship\fP to the current element,
-perform the action specified by \fIspec-id\fP on the related element.
-If the \fIrelationship\fP to \fIgi\fP does not exist,
-and \fIspec-id2\fP is present, perform \fIspec-id2\fP on the current element.
-See the discussion of the criteria field \fBRelation\fP for acceptable relationship names.
-.IP "\fB_gi\fP [\fBM|L|U\fP]"
-Print the name of the current GI to the output stream.
-If specified, \fBM\fP, \fBL\fP, or \fBU\fP will ensure the GI name is printed in mixed, lower, or upper case, respectively.
-.IP "\fB_id\fP \fIid\fP [\fIspec-id\fP]"
-Find the element with \fIid\fP and use \fIspec-id\fP, if set. If not set, use the spec for that element's context.
-.IP "\fB_include\fP \fIfilename\fP"
-Insert the file \fIfilename\fP into the output stream.
-.IP "\fB_infile\fP [\fBline\fP]"
-Print the name of the sgml instance file to the output stream. If \fBline\fP is specified, also print the line number.
-This depends on \fBsgmls\fP being called with the \fB-l\fP option.
-.IP "\fB_insertnode\fP \fBS\fP|\fBE\fP \fIspec-id\fP"
-Do \fIspec-id\fP when the current element is traversed at a later pass.
-This can be considered inserting a node, without content, into the hierarchy.
-This is only useful if done to elements \fIbefore\fP they are processed.
-Typically \fB_chasetogi\fP or \fB_followlink\fP is specified early in an instance's processing,
-so that when the elements found by one of these actions are processed in their turn, the added actions are performed.
-\fB_insertnode\fP would be specified as the action of a \fIspec-id\fP pointed to in a \fB_chasetogi\fP or \fB_followlink\fP usage.
-.IP "\fB_location\fP"
-The location of the current element is printed to the output stream in several ways: the path to the element (see \fB_path\fP),
-a position hint, which is the nearest title, the line number, if the ESIS (output from \fBsgmls\fP) contains line numbers,
-and the ID of the element, if it has one.
-This is especially useful when using the \fBMessage\fP action to validate an instance.
-.IP "\fB_namelist\fP \fIspec-id\fP [\fIspec-id2\fP]"
-This assumes that the content of the current element is a namelist (a list of element IDs),
-and applies the action based on \fIspec-id\fP for each element pointed to.
-If \fIspec-id2\fP is specified, it will use \fIspec-id\fP for the first ID in the namelist and \fIspec-id2\fP for the others.
-.IP "\fB_nchild\fP [\fIgi\fP]"
-Print the number of child elements of the element to the output stream.
-If \fIgi\fP is specified, print the number of child element with that name.
-.IP "\fB_osftable\fP \fBtex\fP|\fBtbl\fP|\fBcheck\fP [\fIflag\fP]"
-Print table markup into the output stream. The format depends on whether \fBtex\fP or \fBtbl\fP is specified.
-The \fIflag\fP may be one of \fBcellstart\fP, \fBcellend\fP, \fBrowstart\fP, \fBrowend\fP, \fBtop\fP, or \fBbottom\fP.
-The value determines what markup or text will be generated.
-If \fBcellstart\fP is specified, the correct markup for the beginning of a cell is output.
-If \fBtop\fP, \fBbottom\fP, or \fBrowend\fP are specified,
-the correct markup for the end of the appropriate position is printed to the output stream.
-If \fBcheck\fP is specified, the attributes and child elements are checked for errors and consistency.
-.IP "\fB_path\fP"
-Print the path to current GI to the output stream. A path is each element, going down the tree from the topmost element.
-A number in parentheses after each element name shows which child element the next one is in the order of children for that element.
-Ordering starts at 0.
-For example: \f(CWOSF-BOOK(3) BODY(0) CHAPTER(4) SECTION\fP.
-This says the path is \fB<OSF-BOOK>\fP's third child, \fB<BODY>\fP's zeroth,
-and \fB<CHAPTER>\fP's fourth, which is named \fB<SECTION>\fP.
-.IP "\fB_pattr\fP \fIname\fP"
-Print the value of parent's attribute whose name is \fIname\fP to the output stream.
-.IP "\fB_pfind\fP \fIrel\fP \fIgi\fP \fIspec-id\fP"
-This is exactly the same as \fB_find\fP except that the search starts at the current element's parent.
-.IP "\fB_relation\fP \fIrelationship\fP \fIgi\fP \fIspec-id\fP [\fIspec-id2\fP]"
-If the \fIgi\fP has the specified \fIrelationship\fP to the current element,
-perform the action specified by \fIspec-id\fP on the current element.
-If the relationship test fails and \fIspec-id2\fP is specified, perform that action.
-See the discussion of the criteria field \fBRelation\fP for acceptable relationship names.
-.IP "\fB_set\fP \fIvarname\fP \fIvalue\fP"
-Set the value of the variable \fIvarname\fP to \fIvalue\fP.
-.IP "\fB_isset\fP \fIvarname\fP [\fIvalue\fP] \fIspec-id\fP"
-If the value of the variable \fIvarname\fP is set to \fIvalue\fP, then perform action referred to by \fIspec-id\fP.
-If \fIvalue\fP is not specified, action will be performed if \fIvarname\fP is set to any value.
-.IP "\fB_!\fP \fIcommand\fP"
-Run the command \fIcommand\fP, directing its standard output into the output stream.
-'br\" labeled list end
-.SS "Immediate Variables"
-.PP
-\fIImmediate variables\fR are like special variables, except that they
-are expanded when the transpec is originally processed (special
-variables are processed later, near when the final output is being generated).
-The general syntax of immediate variables is \fB${+\fIimmediate_variable\ ...\fB}\fR.
-.PP
-There is currently only one immediate variable defined:
-.IP "\fB+content\fP"
-This special variable is replaced by the data content of the current element.
-.SH "Examples"
-.PP
-The following will output the given string for elements whose generic identifier is \fBP\fP (for paragraph).
-At the start of processing this element, the program ensures that the output starts on a new line,
-the \fBtroff\fP macro \fB<.P>\fP is output, then a newline.
-At the end of this element processing, the program ensures that the output starts on a new line.
-.DS
-.nf
-.ft CW
-GI: P
-StartText: ^.P^
-EndText: ^
--
-.ft R
-.fi
-.DE
-.PP
-The following will output the given string for elements whose generic identifier is \fBCMD-ARGUMENT\fP and which have an
-attribute \fBPRESENCE\fP set to the value \fBOPTIONAL\fP.
-.DS
-.nf
-.ft CW
-GI: CMD-ARGUMENT
-AttValue: PRESENCE OPTIONAL
-StartText: $\e\e[
-EndText: $\e\e]
--
-.ft R
-.fi
-.DE
-.PP
-The following prints the section number, title, and page number of the target of a cross reference.
-Assume the cross reference points to a section element, which contains a title element.
-The criteria for this spec to match is that the attribute \fBOSFROLE\fP is set to the value \fBgetfull\fP.
-The action is to replace the content of the \fB<XREF>\fP element with the given string.
-When processing the string, \fBinstant\fP will follow the IDREF attributes of \fB<XREF>\fP
-until an element with no IDREF attributes is found. It will then apply the transpec numbered \fB87\fP to that element,
-which will print the name of the GI in mixed case into the output stream.
-It will then print the LaTeX reference instruction with the value of the \fBLINKEND\fP attribute as an argument.
-(This will become the section number after processing by LaTeX.)
-It will then follow IDREFs until if finds an element whose GI is \fBTITLE\fP or which has a child element with that GI.
-It will apply the transpec numbered \fB1\fP to that element, which copies the title into the output stream where the cross reference occurs.
-Finally, it will print the word \fBpage\fP followed by the LaTeX instruction to obtain the page number of a reference.
-.DS
-.nf
-.ft CW
-GI: XREF
-AttValue: OSFROLE getfull
-Replace: ${_followlink 87} \e\eref{${LINKEND}},\es
- {\e\ebf ${_chasetogi TITLE 1}}, page \e\epageref{${LINKEND}}
--
-# Print GI name, in mixed case
-GI: _pr_gi_name
-SpecID: 87
-Ignore: 1
-EndText: ${_gi M}
--
-GI: _pass-text
-SpecID: 1
--
-.ft R
-.fi
-.DE
-.SH "Related Information"
-.PP
-\fBinstant\fP(1), \fBsgmls\fP(1), \fBegrep\fP(1).
diff --git a/usr.bin/sgmls/instant/tranvar.c b/usr.bin/sgmls/instant/tranvar.c
deleted file mode 100644
index ab04425..0000000
--- a/usr.bin/sgmls/instant/tranvar.c
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * instant - a program to manipulate SGML instances.
- *
- * This module is for handling "special variables". These act a lot like
- * procedure calls
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/tranvar.c,v 1.5 1996/06/11 22:43:15 fld Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <errno.h>
-
-#include <regexp.h>
-#include "general.h"
-#include "translate.h"
-
-static char **idrefs; /* list of IDREF att names to follow */
-static char *def_idrefs[] = { "LINKEND", "LINKENDS", "IDREF", 0 };
-static char *each_A = 0; /* last seen _eachatt */
-static char *each_C = 0; /* last seen _eachcon */
-
-/* forward references */
-void ChaseIDRefs(Element_t *, char *, char *, FILE *);
-void Find(Element_t *, int, char **, FILE *);
-void GetIDREFnames();
-
-/* ______________________________________________________________________ */
-/* Handle "special" variable - read file, run command, do action, etc.
- * Arguments:
- * Name of special variable to expand.
- * Pointer to element under consideration.
- * FILE pointer to where to write output.
- * Flag saying whether to track the character position we're on
- * (passed to OutputString).
- */
-
-void
-ExpandSpecialVar(
- char *name,
- Element_t *e,
- FILE *fp,
- int track_pos
-)
-{
- FILE *infile;
- char buf[LINESIZE], *cp, *atval;
- char **tok;
- int ntok, n, i, actioni;
- char *action, *action1;
- Element_t *ep;
- Trans_t *t, *tt;
-
- /* Run a command.
- * Format: _! command args ... */
- if (*name == '!') {
- name++;
- if ((infile = popen(name, "r"))) {
- while (fgets(buf, LINESIZE, infile)) fputs(buf, fp);
- pclose(infile);
- fflush(fp);
- }
- else {
- fprintf(stderr, "Could not start program '%s': %s",
- name, strerror(errno));
- }
- return;
- }
-
- /* See if caller wants one of the tokens from _eachatt or _eachcon.
- * If so, output it and return. (Yes, I admit that this is a hack.)
- */
- if (*name == 'A' && name[1] == EOS && each_A) {
- OutputString(each_A, fp, track_pos);
- return;
- }
- if (*name == 'C' && name[1] == EOS && each_C) {
- OutputString(each_C, fp, track_pos);
- return;
- }
-
- ntok = 0;
- tok = Split(name, &ntok, 0);
-
- /* Include another file.
- * Format: _include filename */
- if (StrEq(tok[0], "include")) {
- name = tok[1];
- if (ntok > 1 ) {
- if ((infile=OpenFile(name)) == NULL) {
- sprintf(buf, "Can not open included file '%s'", name);
- perror(buf);
- return;
- }
- while (fgets(buf, LINESIZE, infile)) fputs(buf, fp);
- fclose(infile);
- }
- else fprintf(stderr, "No file name specified for include\n");
- return;
- }
-
- /* Print location (nearest title, line no, path).
- * Format: _location */
- else if (StrEq(tok[0], "location")) {
- PrintLocation(e, fp);
- }
-
- /* Print path to this element.
- * Format: _path */
- else if (StrEq(tok[0], "path")) {
- (void)FindElementPath(e, buf);
- OutputString(buf, fp, track_pos);
- }
-
- /* Print name of this element (gi).
- * Format: _gi [M|L|U] */
- else if (StrEq(tok[0], "gi")) {
- strcpy(buf, e->gi);
- if (ntok >= 2) {
- if (*tok[1] == 'L' || *tok[1] == 'l' ||
- *tok[1] == 'M' || *tok[1] == 'm') {
- for (cp=buf; *cp; cp++)
- if (isupper(*cp)) *cp = tolower(*cp);
- }
- if (*tok[1] == 'M' || *tok[1] == 'm')
- if (islower(buf[0])) buf[0] = toupper(buf[0]);
- }
- OutputString(buf, fp, track_pos);
- }
-
- /* Print filename of this element's associated external entity.
- * Format: _filename */
- else if (StrEq(tok[0], "filename")) {
- if (!e->entity) {
- fprintf(stderr, "Expected ext entity (internal error? bug?):\n");
- PrintLocation(e, stderr);
- return;
- }
- if (!e->entity->fname) {
- fprintf(stderr, "Expected filename (internal error? bug?):\n");
- PrintLocation(e, stderr);
- return;
- }
- OutputString(e->entity->fname, fp, track_pos);
- }
-
- /* Value of parent's attribute, by attr name.
- * Format: _pattr attname */
- else if (StrEq(tok[0], "pattr")) {
- ep = e->parent;
- if (!ep) {
- fprintf(stderr, "Element does not have a parent:\n");
- PrintLocation(ep, stderr);
- return;
- }
- if ((atval = FindAttValByName(ep, tok[1]))) {
- OutputString(atval, fp, track_pos);
- }
- }
-
- /* Use an action, given transpec's SID.
- * Format: _action action */
- else if (StrEq(tok[0], "action")) {
- TranTByAction(e, tok[1], fp);
- }
-
- /* Number of child elements of this element.
- * Format: _nchild */
- else if (StrEq(tok[0], "nchild")) {
- if (ntok > 1) {
- for (n=0,i=0; i<e->necont; i++)
- if (StrEq(e->econt[i]->gi, tok[1])) n++;
- }
- else n = e->necont;
- sprintf(buf, "%d", n);
- OutputString(buf, fp, track_pos);
- }
-
- /* number of 1st child's child elements (grandchildren from first child).
- * Format: _n1gchild */
- else if (StrEq(tok[0], "n1gchild")) {
- if (e->necont) {
- sprintf(buf, "%d", e->econt[0]->necont);
- OutputString(buf, fp, track_pos);
- }
- }
-
- /* Chase this element's pointers until we hit the named GI.
- * Do the action if it matches.
- * Format: _chasetogi gi action */
- else if (StrEq(tok[0], "chasetogi")) {
- if (ntok < 3) {
- fprintf(stderr, "Error: Not enough args for _chasetogi.\n");
- return;
- }
- actioni = atoi(tok[2]);
- if (actioni) ChaseIDRefs(e, tok[1], tok[2], fp);
- }
-
- /* Follow link to element pointed to, then do action.
- * Format: _followlink [attname] action. */
- else if (StrEq(tok[0], "followlink")) {
- char **s;
- if (ntok > 2) {
- if ((atval = FindAttValByName(e, tok[1]))) {
- if ((ep = FindElemByID(atval))) {
- TranTByAction(ep, tok[2], fp);
- return;
- }
- }
- else fprintf(stderr, "Error: Did not find attr: %s.\n", tok[1]);
- return;
- }
- GetIDREFnames();
- for (s=idrefs; *s; s++) {
- /* is this IDREF attr set? */
- if ((atval = FindAttValByName(e, *s))) {
- ntok = 0;
- tok = Split(atval, &ntok, S_STRDUP);
- /* we'll follow the first one... */
- if ((ep = FindElemByID(tok[0]))) {
- TranTByAction(ep, tok[1], fp);
- return;
- }
- else fprintf(stderr, "Error: Can not find elem for ID: %s.\n",
- tok[0]);
- }
- }
- fprintf(stderr, "Error: Element does not have IDREF attribute set:\n");
- PrintLocation(e, stderr);
- return;
- }
-
- /* Starting at this element, decend tree (in-order), finding GI.
- * Do the action if it matches.
- * Format: _find args ... */
- else if (StrEq(tok[0], "find")) {
- Find(e, ntok, tok, fp);
- }
-
- /* Starting at this element's parent, decend tree (in-order), finding GI.
- * Do the action if it matches.
- * Format: _pfind args ... */
- else if (StrEq(tok[0], "pfind")) {
- Find(e->parent ? e->parent : e, ntok, tok, fp);
- }
-
- /* Content is supposed to be a list of IDREFs. Follow each, doing action.
- * If 2 actions are specified, use 1st for the 1st ID, 2nd for the rest.
- * Format: _namelist action [action2] */
- else if (StrEq(tok[0], "namelist")) {
- int id;
- action1 = tok[1];
- if (ntok > 2) action = tok[2];
- else action = action1;
- for (i=0; i<e->ndcont; i++) {
- n = 0;
- tok = Split(e->dcont[i], &n, S_STRDUP);
- for (id=0; id<n; id++) {
- if (fold_case)
- for (cp=tok[id]; *cp; cp++)
- if (islower(*cp)) *cp = toupper(*cp);
- if ((e = FindElemByID(tok[id]))) {
- if (id) TranTByAction(e, action, fp);
- else TranTByAction(e, action1, fp); /* first one */
- }
- else fprintf(stderr, "Error: Can not find ID: %s.\n", tok[id]);
- }
- }
- }
-
- /* For each word in the element's content, do action.
- * Format: _eachcon action [action] */
- else if (StrEq(tok[0], "eachcon")) {
- int id;
- action1 = tok[1];
- if (ntok > 3) action = tok[2];
- else action = action1;
- for (i=0; i<e->ndcont; i++) {
- n = 0;
- tok = Split(e->dcont[i], &n, S_STRDUP|S_ALVEC);
- for (id=0; id<n; id++) {
- each_C = tok[id];
- TranTByAction(e, action, fp);
- }
- free(*tok);
- }
- }
- /* For each word in the given attribute's value, do action.
- * Format: _eachatt attname action [action] */
- else if (StrEq(tok[0], "eachatt")) {
- int id;
- action1 = tok[2];
- if (ntok > 3) action = tok[3];
- else action = action1;
- if ((atval = FindAttValByName(e, tok[1]))) {
- n = 0;
- tok = Split(atval, &n, S_STRDUP|S_ALVEC);
- for (id=0; id<n; id++) {
- each_A = tok[id];
- if (id) TranTByAction(e, action, fp);
- else TranTByAction(e, action1, fp); /* first one */
- }
- free(*tok);
- }
- }
-
- /* Do action on this element if element has [relationship] with gi.
- * Format: _relation relationship gi action [action] */
- else if (StrEq(tok[0], "relation")) {
- if (ntok >= 4) {
- if (!CheckRelation(e, tok[1], tok[2], tok[3], fp, RA_Current)) {
- /* action not done, see if alt action specified */
- if (ntok >= 5)
- TranTByAction(e, tok[4], fp);
- }
- }
- }
-
- /* Do action on followed element if element has [relationship] with gi.
- * If [relationship] is not met, do alternate action on this element.
- * Format: _followrel relationship gi action [action] */
- else if (StrEq(tok[0], "followrel")) {
- if (ntok >= 4) {
- if (!CheckRelation(e, tok[1], tok[2], tok[3], fp, RA_Related)) {
- /* action not done, see if an alt action specified */
- if (ntok >= 5)
- TranTByAction(e, tok[4], fp);
- }
- }
- }
-
- /* Find element with matching ID and do action. If action not specified,
- * choose the right one appropriate for its context.
- * Format: _id id [action] */
- else if (StrEq(tok[0], "id")) {
- if ((ep = FindElemByID(tok[1]))) {
- if (ntok > 2) TranTByAction(ep, tok[2], fp);
- else {
- t = FindTrans(ep, 0);
- TransElement(ep, fp, t);
- }
- }
- }
-
- /* Set variable to value.
- * Format: _set name value */
- else if (StrEq(tok[0], "set")) {
- SetMappingNV(Variables, tok[1], tok[2]);
- }
-
- /* Do action if variable is set, optionally to value.
- * If not set, do nothing.
- * Format: _isset varname [value] action */
- else if (StrEq(tok[0], "isset")) {
- if ((cp = FindMappingVal(Variables, tok[1]))) {
- if (ntok == 3) TranTByAction(e, tok[2], fp);
- else if (ntok > 3 && !strcmp(cp, tok[2]))
- TranTByAction(e, tok[3], fp);
- }
- }
-
- /* Insert a node into the tree at start/end, pointing to action to perform.
- * Format: _insertnode S|E action */
- else if (StrEq(tok[0], "insertnode")) {
- actioni = atoi(tok[2]);
- if (*tok[1] == 'S') e->gen_trans[0] = actioni;
- else if (*tok[1] == 'E') e->gen_trans[1] = actioni;
- }
-
- /* Do an CALS DTD table spec for TeX or troff. Looks through attributes
- * and determines what to output. "check" means to check consistency,
- * and print error messages.
- * This is (hopefully) the only hard-coded part of instant.
- *
- * This was originally written for the OSF DTDs and recoded by FLD for
- * CALS tables (since no one will ever use the OSF tables). Although
- * TeX was addressed first, it seems that a fresh approach was required,
- * and so, tbl is the first to be really *fixed*. Once tbl is stable,
- * and there is a need for TeX again, that part will be recoded.
- *
- * *Obsolete* form (viz, for TeX):
- * Format: _calstable [clear|check|tex]
- * [cellstart|cellend|rowstart|rowend|top|bottom]
- *
- * New, good form:
- *
- * Format: _calstable [tbl]
- * [tablestart|tableend|tablegroup|tablefoot|rowstart|
- * rowend|entrystart|entryend]
- */
-
- else if (StrEq(tok[0], "calstable")) {
- CALStable(e, fp, tok, ntok);
- }
-
- /* Do action if element's attr is set, optionally to value.
- * If not set, do nothing.
- * Format: _attval att [value] action */
- else if (StrEq(tok[0], "attval")) {
- if ((atval = FindAttValByName(e, tok[1]))) {
- if (ntok == 3) TranTByAction(e, tok[2], fp);
- else if (ntok > 3 && !strcmp(atval, tok[2]))
- TranTByAction(e, tok[3], fp);
- }
- }
- /* Same thing, but look at parent */
- else if (StrEq(tok[0], "pattval")) {
- if ((atval = FindAttValByName(e->parent, tok[1]))) {
- if (ntok == 3) {
- TranTByAction(e, tok[2], fp);
- }
- if (ntok > 3 && !strcmp(atval, tok[2]))
- TranTByAction(e, tok[3], fp);
- }
- }
-
- /* Print each attribute and value for the current element, hopefully
- * in a legal sgml form: <elem-name att1="value1" att2="value2:> .
- * Format: _allatts */
- else if (StrEq(tok[0], "allatts")) {
- for (i=0; i<e->natts; i++) {
- if (i != 0) putc(' ', fp);
- fputs(e->atts[i].name, fp);
- fputs("=\"", fp);
- fputs(e->atts[i].sval, fp);
- putc('"', fp);
- }
- }
-
- /* Print the element's input filename, and optionally, the line number.
- * Format: _infile [line] */
- else if (StrEq(tok[0], "infile")) {
- if (e->infile) {
- if (ntok > 1 && !strcmp(tok[1], "root")) {
- strcpy(buf, e->infile);
- if ((cp = strrchr(buf, '.'))) *cp = EOS;
- fputs(buf, fp);
- }
- else {
- fputs(e->infile, fp);
- if (ntok > 1 && !strcmp(tok[1], "line"))
- fprintf(fp, " %d", e->lineno);
- }
- return;
- }
- else fputs("input-file??", fp);
- }
-
- /* Get value of an environement variable */
- else if (StrEq(tok[0], "env")) {
- if (ntok > 1 && (cp = getenv(tok[1]))) {
- OutputString(cp, fp, track_pos);
- }
- }
-
- /* If the element is not empty do specid.
- * Format: _notempty spec-id */
- else if (StrEq(tok[0], "notempty")) {
- if (ntok > 1 && e->ncont) {
- TranTByAction(e, tok[1], fp);
- }
- }
-
- /* Something unknown */
- else {
- fprintf(stderr, "Unknown special variable: %s\n", tok[0]);
- tt = e->trans;
- if (tt && tt->lineno)
- fprintf(stderr, "Used in transpec, line %d\n", tt->lineno);
- }
- return;
-}
-
-/* ______________________________________________________________________ */
-/* return the value for the special variables _A (last processed _eachatt)
- * and _C (last processed _eachcon)
- */
-
-char *
-Get_A_C_value(const char * name)
-{
- if ( !strcmp(name, "each_A") ) {
- if ( each_A ) {
- return each_A;
- } else {
- fprintf(stderr, "Requested value for unset _A variable\n");
- }
- } else
- if ( !strcmp(name, "each_C") ) {
- if ( each_C ) {
- return each_C;
- } else {
- fprintf(stderr, "Requested value for unset _C variable\n");
- }
- } else {
- fprintf(stderr, "Requested value for unknown special variable '%s'\n",
- name);
- }
- return "";
-}
-
-/* ______________________________________________________________________ */
-/* Chase IDs until we find an element whose GI matches. We also check
- * child element names, not just the names of elements directly pointed
- * at (by IDREF attributes).
- */
-
-void
-GetIDREFnames()
-{
- char *cp;
-
- if (!idrefs) {
- /* did user or transpec set the variable */
- if ((cp = FindMappingVal(Variables, "link_atts")))
- idrefs = Split(cp, 0, S_STRDUP|S_ALVEC);
- else
- idrefs = def_idrefs;
- }
-}
-
-/* ______________________________________________________________________ */
-/* Chase ID references - follow IDREF(s) attributes until we find
- * a GI named 'gi', then perform given action on that GI.
- * Arguments:
- * Pointer to element under consideration.
- * Name of GI we're looking for.
- * Spec ID of action to take.
- * FILE pointer to where to write output.
- */
-void
-ChaseIDRefs(
- Element_t *e,
- char *gi,
- char * action,
- FILE *fp
-)
-{
- int ntok, i, ei;
- char **tok, **s, *atval;
-
- /* First, see if we got what we came for with this element */
- if (StrEq(e->gi, gi)) {
- TranTByAction(e, action, fp);
- return;
- }
- GetIDREFnames();
-
- /* loop for each attribute of type IDREF(s) */
- for (s=idrefs; *s; s++) {
- /* is this IDREF attr set? */
- if ((atval = FindAttValByName(e, *s))) {
- ntok = 0;
- tok = Split(atval, &ntok, 0);
- for (i=0; i<ntok; i++) {
- /* get element pointed to */
- if ((e = FindElemByID(tok[i]))) {
- /* OK, we found a matching GI name */
- if (StrEq(e->gi, gi)) {
- /* process using named action */
- TranTByAction(e, action, fp);
- return;
- }
- else {
- /* this elem itself did not match, try its children */
- for (ei=0; ei<e->necont; ei++) {
- if (StrEq(e->econt[ei]->gi, gi)) {
- TranTByAction(e->econt[ei], action, fp);
- return;
- }
- }
- /* try this elem's IDREF attributes */
- ChaseIDRefs(e, gi, action, fp);
- return;
- }
- }
- else {
- /* should not happen, since parser checks ID/IDREFs */
- fprintf(stderr, "Error: Could not find ID %s\n", atval);
- return;
- }
- }
- }
- }
- /* if the pointers didn't lead to the GI, give error */
- if (!s)
- fprintf(stderr, "Error: Could not find '%s'\n", gi);
-}
-
-/* ______________________________________________________________________ */
-
-/* state to pass to recursive routines - so we don't have to use
- * global variables. */
-typedef struct {
- char *gi;
- char *gi2;
- char action[10];
- Element_t *elem;
- FILE *fp;
-} Descent_t;
-
-static void
-tr_find_gi(
- Element_t *e,
- Descent_t *ds
-)
-{
- if (StrEq(ds->gi, e->gi))
- if (ds->action[0]) TranTByAction(e, ds->action, ds->fp);
-}
-
-static void
-tr_find_gipar(
- Element_t *e,
- Descent_t *ds
-)
-{
- if (StrEq(ds->gi, e->gi) && e->parent &&
- StrEq(ds->gi2, e->parent->gi))
- if (ds->action[0]) TranTByAction(e, ds->action, ds->fp);
-}
-
-static void
-tr_find_attr(
- Element_t *e,
- Descent_t *ds
-)
-{
- char *atval;
- if ((atval = FindAttValByName(e, ds->gi)) && StrEq(ds->gi2, atval))
- TranTByAction(e, ds->action, ds->fp);
-}
-
-static void
-tr_find_parent(
- Element_t *e,
- Descent_t *ds
-)
-{
- if (QRelation(e, ds->gi, REL_Parent)) {
- if (ds->action[0]) TranTByAction(e, ds->action, ds->fp);
- }
-}
-
-/* ______________________________________________________________________ */
-/* Descend tree, finding elements that match criteria, then perform
- * given action.
- * Arguments:
- * Pointer to element under consideration.
- * Number of tokens in special variable.
- * Vector of tokens in special variable (eg, "find" "gi" "TITLE")
- * FILE pointer to where to write output.
- */
-void
-Find(
- Element_t *e,
- int ac,
- char **av,
- FILE *fp
-)
-{
- Descent_t DS; /* state passed to recursive routine */
-
- memset(&DS, 0, sizeof(Descent_t));
- DS.elem = e;
- DS.fp = fp;
-
- /* see if we should start at the top of instance tree */
- if (StrEq(av[1], "top")) {
- av++;
- ac--;
- e = DocTree;
- }
- if (ac < 4) {
- fprintf(stderr, "Bad '_find' specification - missing args.\n");
- return;
- }
- /* Find elem whose GI is av[2] */
- if (StrEq(av[1], "gi")) {
- DS.gi = av[2];
- strcpy(DS.action, av[3]);
- DescendTree(e, tr_find_gi, 0, 0, &DS);
- }
- /* Find elem whose GI is av[2] and whose parent GI is av[3] */
- else if (StrEq(av[1], "gi-parent")) {
- DS.gi = av[2];
- DS.gi2 = av[3];
- strcpy(DS.action, av[4]);
- DescendTree(e, tr_find_gipar, 0, 0, &DS);
- }
- /* Find elem whose parent GI is av[2] */
- else if (StrEq(av[0], "parent")) {
- DS.gi = av[2];
- strcpy(DS.action, av[3]);
- DescendTree(e, tr_find_parent, 0, 0, &DS);
- }
- /* Find elem whose attribute av[2] has value av[3] */
- else if (StrEq(av[0], "attr")) {
- DS.gi = av[2];
- DS.gi2 = av[3];
- strcpy(DS.action, av[4]);
- DescendTree(e, tr_find_attr, 0, 0, &DS);
- }
-}
-
-/* ______________________________________________________________________ */
-
diff --git a/usr.bin/sgmls/instant/util.c b/usr.bin/sgmls/instant/util.c
deleted file mode 100644
index eb6015d..0000000
--- a/usr.bin/sgmls/instant/util.c
+++ /dev/null
@@ -1,1109 +0,0 @@
-/*
- * Copyright 1993 Open Software Foundation, Inc., Cambridge, Massachusetts.
- * All rights reserved.
- */
-/*
- * Copyright (c) 1994
- * Open Software Foundation, Inc.
- *
- * Permission is hereby granted to use, copy, modify and freely distribute
- * the software in this file and its documentation for any purpose without
- * fee, provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation. Further, provided that the name of Open
- * Software Foundation, Inc. ("OSF") not be used in advertising or
- * publicity pertaining to distribution of the software without prior
- * written permission from OSF. OSF makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-/*
- * Copyright (c) 1996 X Consortium
- * Copyright (c) 1995, 1996 Dalrymple Consulting
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * X CONSORTIUM OR DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the names of the X Consortium and
- * Dalrymple Consulting shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without prior
- * written authorization.
- */
-/* ________________________________________________________________________
- *
- * General utility functions for 'instant' program. These are used
- * throughout the rest of the program.
- *
- * Entry points for this module:
- * Split(s, &n, flags) split string into n tokens
- * NewMap(slot_incr) create a new mapping structure
- * FindMapping(map, name) find mapping by name; return mapping
- * FindMappingVal(map, name) find mapping by name; return value
- * SetMapping(map, s) set mapping based on string
- * OpenFile(filename) open file, looking in inst path
- * FilePath(filename) find path to a file
- * FindElementPath(elem, s) find path to element
- * PrintLocation(ele, fp) print location of element in tree
- * NearestOlderElem(elem, name) find prev elem up tree with name
- * OutputString(s, fp, track_pos) output string
- * AddElemName(name) add elem to list of known elements
- * AddAttName(name) add att name to list of known atts
- * FindAttByName(elem, name) find an elem's att by name
- * FindContext(elem, lev, context) find context of elem
- * QRelation(elem, name, rel_flag) find relation elem has to named elem
- * DescendTree(elem, enter_f, leave_f, data_f, dp) descend doc tree,
- * calling functions for each elem/node
- * ________________________________________________________________________
- */
-
-#ifndef lint
-static char *RCSid =
- "$Header: /usr/src/docbook-to-man/Instant/RCS/util.c,v 1.4 1996/06/02 21:47:32 fld Exp $";
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <errno.h>
-#include <regexp.h>
-/* CSS don't have it and I don't see where it's used
-#include <values.h>
-*/
-
-#include "general.h"
-#include "translate.h"
-
-/* ______________________________________________________________________ */
-/* "Split" a string into tokens. Given a string that has space-separated
- * (space/tab) tokens, return a pointer to an array of pointers to the
- * tokens. Like what the shell does with *argv[]. The array can be is
- * static or allocated. Space can be allocated for string, or allocated.
- * Arguments:
- * Pointer to string to pick apart.
- * Pointer to max number of tokens to find; actual number found is
- * returned. If 0 or null pointer, use a 'sane' maximum number (hard-
- * code). If more tokens than the number specified, make last token be
- * a single string composed of the rest of the tokens (includes spaces).
- * Flag. Bit 0 says whether to make a copy of input string (since we'll
- * clobber parts of it). To free the string, use the pointer to
- * the first token returned by the function (or *ret_value).
- * Bit 1 says whether to allocate the vector itself. If not, use
- * (and return) a static vector.
- * Return:
- * Pointer to the provided string (for convenience of caller).
- */
-
-char **
-Split(
- char *s, /* input string */
- int *ntok, /* # of tokens desired (input)/found (return) */
- int flag /* dup string? allocate a vector? */
-)
-{
- int maxnt, i=0;
- int n_alloc;
- char **tokens;
- static char *local_tokens[100];
-
- /* Figure max number of tokens (maxnt) to find. 0 means find them all. */
- if (ntok == NULL)
- maxnt = 100;
- else {
- if (*ntok <= 0 || *ntok > 100) maxnt = 100; /* arbitrary size */
- else maxnt = *ntok;
- *ntok = 0;
- }
-
- if (!s) return 0; /* no string */
-
- /* Point to 1st token (there may be initial space) */
- while (*s && IsWhite(*s)) s++; /* skip initial space, if any */
- if (*s == EOS) return 0; /* none found? */
-
- /* See if caller wants us to copy the input string. */
- if (flag & S_STRDUP) s = strdup(s);
-
- /* See if caller wants us to allocate the returned vector. */
- if (flag & S_ALVEC) {
- n_alloc = 20;
- Malloc(n_alloc, tokens, char *);
- /* if caller did not specify max tokens to find, set to more than
- * there will possibly ever be */
- if (!ntok || !(*ntok)) maxnt = 10000;
- }
- else tokens = local_tokens;
-
- i = 0; /* index into vector */
- tokens[0] = s; /* s already points to 1st token */
- while (i<maxnt) {
- tokens[i] = s; /* point vector member at start of token */
- i++;
- /* If we allocated vector, see if we need more space. */
- if ((flag & S_ALVEC) && i >= n_alloc) {
- n_alloc += 20;
- Realloc(n_alloc, tokens, char *);
- }
- if (i >= maxnt) break; /* is this the last one? */
- while (*s && !IsWhite(*s)) s++; /* skip past end of token */
- if (*s == EOS) break; /* at end of input string? */
- if (*s) *s++ = EOS; /* terminate token string */
- while (*s && IsWhite(*s)) s++; /* skip space - to next token */
- }
- if (ntok) *ntok = i; /* return number of tokens found */
- tokens[i] = 0; /* null-terminate vector */
- return tokens;
-}
-
-/* ______________________________________________________________________ */
-/* Mapping routines. These are used for name-value pairs, like attributes,
- * variables, and counters. A "Map" is an opaque data structure used
- * internally by these routines. The caller gets one when creating a new
- * map, then hands it to other routines that need it. A "Mapping" is a
- * name/value pair. The user has access to this.
- * Here's some sample usage:
- *
- * Map *V;
- * V = NewMap(20);
- * SetMappingNV(V, "home", "/users/bowe");
- * printf("Home: %s\n", FindMappingVal(V, "home");
- */
-
-/* Allocate new map structure. Only done once for each map/variable list.
- * Arg:
- * Number of initial slots to allocate space for. This is also the
- * "chunk size" - how much to allocate when we use up the given space.
- * Return:
- * Pointer to the (opaque) map structure. (User passes this to other
- * mapping routines.)
- */
-Map_t *
-NewMap(
- int slot_increment
-)
-{
- Map_t *M;
- Calloc(1, M, Map_t);
- /* should really do the memset's in Calloc/Malloc/Realloc
- macros, but that will have to wait until time permits -CSS */
- memset((char *)M, 0, sizeof(Map_t));
- if (!slot_increment) slot_increment = 1;
- M->slot_incr = slot_increment;
- return M;
-}
-
-/* Given pointer to a Map and a name, find the mapping.
- * Arguments:
- * Pointer to map structure (as returned by NewMap().
- * Variable name.
- * Return:
- * Pointer to the matching mapping structure, or null if not found.
- */
-Mapping_t *
-FindMapping(
- Map_t *M,
- const char *name
-)
-{
- int i;
- Mapping_t *m;
-
- if (!M || M->n_used == 0) return NULL;
- for (m=M->maps,i=0; i<M->n_used; i++)
- if (m[i].name[0] == name[0] && !strcmp(m[i].name, name)) return &m[i];
- return NULL;
-
-}
-
-/* Given pointer to a Map and a name, return string value of the mapping.
- * Arguments:
- * Pointer to map structure (as returned by NewMap().
- * Variable name.
- * Return:
- * Pointer to the value (string), or null if not found.
- */
-char *
-FindMappingVal(
- Map_t *M,
- const char *name
-)
-{
- Mapping_t *m;
-
- if ( !strcmp(name, "each_A") || !strcmp(name, "each_C") ) {
- return Get_A_C_value(name);
- }
-
- /*
- if (!M || M->n_used == 0) return NULL;
- if ((m = FindMapping(M, name))) return m->sval;
- return NULL;
- */
- if (!M || M->n_used == 0) {
- return NULL;
- }
- if ((m = FindMapping(M, name))) {
- return m->sval;
- }
- return NULL;
-
-}
-
-/* Set a mapping/variable in Map M. Input string is a name-value pair where
- * there is some amount of space after the name. The correct mapping is done.
- * Arguments:
- * Pointer to map structure (as returned by NewMap().
- * Pointer to variable name (string).
- * Pointer to variable value (string).
- */
-void
-SetMappingNV(
- Map_t *M,
- const char *name,
- const char *value
-)
-{
- FILE *pp;
- char buf[LINESIZE], *cp;
- int i;
- Mapping_t *m;
-
- /* First, look to see if it's a "well-known" variable. */
- if (!strcmp(name, "verbose")) { verbose = atoi(value); return; }
- if (!strcmp(name, "warnings")) { warnings = atoi(value); return; }
- if (!strcmp(name, "foldcase")) { fold_case = atoi(value); return; }
-
- m = FindMapping(M, name); /* find existing mapping (if set) */
-
- /* OK, we have a string mapping */
- if (m) { /* exists - just replace value */
- free(m->sval);
- if (value) m->sval = strdup(value);
- else m->sval = NULL;
- }
- else {
- if (name) { /* just in case */
- /* Need more slots for mapping structures? Allocate in clumps. */
- if (M->n_used == 0) {
- M->n_alloc = M->slot_incr;
- Malloc(M->n_alloc, M->maps, Mapping_t);
- }
- else if (M->n_used >= M->n_alloc) {
- M->n_alloc += M->slot_incr;
- Realloc(M->n_alloc, M->maps, Mapping_t);
- }
-
- m = &M->maps[M->n_used];
- M->n_used++;
- m->name = strdup(name);
- if (value) m->sval = strdup(value);
- else m->sval = NULL;
- }
- }
-
- if (value)
- {
- /* See if the value is a command to run. If so, run the command
- * and replace the value with the output.
- */
- if (*value == '!') {
- if ((pp = popen(value+1, "r"))) { /* run cmd, read its output */
- i = 0;
- cp = buf;
- while (fgets(cp, LINESIZE-i, pp)) {
- i += strlen(cp);
- cp = &buf[i];
- if (i >= LINESIZE) {
- fprintf(stderr,
- "Prog execution of variable '%s' too long.\n",
- m->name);
- break;
- }
- }
- free(m->sval);
- stripNL(buf);
- m->sval = strdup(buf);
- pclose(pp);
- }
- else {
- sprintf(buf, "Could not start program '%s'", value+1);
- perror(buf);
- }
- }
- }
-}
-
-/* Separate name and value from input string, then pass to SetMappingNV.
- * Arguments:
- * Pointer to map structure (as returned by NewMap().
- * Pointer to variable name and value (string), in form "name value".
- */
-void
-SetMapping(
- Map_t *M,
- const char *s
-)
-{
- char buf[LINESIZE];
- char *name, *val;
-
- if (!M) {
- fprintf(stderr, "SetMapping: Map not initialized.\n");
- return;
- }
- strcpy(buf, s);
- name = val = buf;
- while (*val && !IsWhite(*val)) val++; /* point past end of name */
- if (*val) {
- *val++ = EOS; /* terminate name */
- while (*val && IsWhite(*val)) val++; /* point to value */
- }
- if (name) SetMappingNV(M, name, val);
-}
-
-/* ______________________________________________________________________ */
-/* Opens a file for reading. If not found in current directory, try
- * lib directories (from TPT_LIB env variable, or -l option).
- * Arguments:
- * Filename (string).
- * Return:
- * FILE pointer to open file, or null if it not found or can't open.
- */
-
-FILE *
-OpenFile(
- char *filename
-)
-{
- FILE *fp;
-
- filename = FilePath(filename);
- if ((fp=fopen(filename, "r"))) return fp;
- return NULL;
-}
-
-/* ______________________________________________________________________ */
-/* Opens a file for reading. If not found in current directory, try
- * lib directories (from TPT_LIB env variable, or -l option).
- * Arguments:
- * Filename (string).
- * Return:
- * FILE pointer to open file, or null if it not found or can't open.
- */
-
-char *
-FilePath(
- char *filename
-)
-{
- FILE *fp;
- static char buf[LINESIZE];
- int i;
- static char **libdirs;
- static int nlibdirs = -1;
-
- if ((fp=fopen(filename, "r")))
- {
- fclose(fp);
- strncpy(buf, filename, LINESIZE);
- return buf;
- }
-
- if (*filename == '/') return NULL; /* full path specified? */
-
- if (nlibdirs < 0) {
- char *cp, *s;
- if (tpt_lib) {
- s = strdup(tpt_lib);
- for (cp=s; *cp; cp++) if (*cp == ':') *cp = ' ';
- nlibdirs = 0;
- libdirs = Split(s, &nlibdirs, S_ALVEC);
- }
- else nlibdirs = 0;
- }
- for (i=0; i<nlibdirs; i++) {
- sprintf(buf, "%s/%s", libdirs[i], filename);
- if ((fp=fopen(buf, "r")))
- {
- fclose(fp);
- return buf;
- }
- }
- return NULL;
-}
-
-/* ______________________________________________________________________ */
-/* This will find the path to an tag. The format is the:
- * tag1(n1):tag2(n2):tag3
- * where the tags are going down the tree and the numbers indicate which
- * child (the first is numbered 1) the next tag is.
- * Returns pointer to the string just written to (so you can use this
- * function as a printf arg).
- * Arguments:
- * Pointer to element under consideration.
- * String to write path into (provided by caller).
- * Return:
- * Pointer to the provided string (for convenience of caller).
- */
-char *
-FindElementPath(
- Element_t *e,
- char *s
-)
-{
- Element_t *ep;
- int i, e_path[MAX_DEPTH];
- char *cp;
-
- /* Move up the tree, noting "birth order" of each element encountered */
- for (ep=e; ep; ep=ep->parent)
- e_path[ep->depth-1] = ep->my_eorder;
- /* Move down the tree, printing the element names to the string. */
- for (cp=s,i=0,ep=DocTree; i<e->depth; ep=ep->econt[e_path[i]],i++) {
- sprintf(cp, "%s(%d) ", ep->gi, e_path[i]);
- cp += strlen(cp);
- }
- sprintf(cp, "%s", e->gi);
- return s;
-}
-
-/* ______________________________________________________________________ */
-/* Print some location info about a tag. Helps user locate error.
- * Messages are indented 2 spaces (convention for multi-line messages).
- * Arguments:
- * Pointer to element under consideration.
- * FILE pointer of where to print.
- */
-
-void
-PrintLocation(
- Element_t *e,
- FILE *fp
-)
-{
- char *s, buf[LINESIZE];
-
- if (!e || !fp) return;
- fprintf(fp, " Path: %s\n", FindElementPath(e, buf));
- if ((s=NearestOlderElem(e, "TITLE")))
- fprintf(fp, " Position hint: TITLE='%s'\n", s);
- if (e->lineno) {
- if (e->infile)
- fprintf(fp, " At or near instance file: %s, line: %d\n",
- e->infile, e->lineno);
- else
- fprintf(fp, " At or near instance line: %d\n", e->lineno);
- }
- if (e->id)
- fprintf(fp, " ID: %s\n", e->id);
-}
-
-/* ______________________________________________________________________ */
-/* Finds the data part of the nearest "older" tag (up the tree, and
- * preceding) whose tag name matches the argument, or "TITLE", if null.
- * Returns a pointer to the first chunk of character data.
- * Arguments:
- * Pointer to element under consideration.
- * Name (GI) of element we'll return data from.
- * Return:
- * Pointer to that element's data content.
- */
-char *
-NearestOlderElem(
- Element_t *e,
- char *name
-)
-{
- int i;
- Element_t *ep;
-
- if (!e) return 0;
- if (!name) name = "TITLE"; /* useful default */
-
- for (; e->parent; e=e->parent) /* move up tree */
- for (i=0; i<=e->my_eorder; i++) { /* check preceding sibs */
- ep = e->parent;
- if (!strcmp(name, ep->econt[i]->gi))
- return ep->econt[i]->ndcont ?
- ep->econt[i]->dcont[0] : "-empty-";
- }
-
- return NULL;
-}
-
-/* ______________________________________________________________________ */
-/* Expands escaped strings in the input buffer (things like tabs, newlines,
- * octal characters - using C style escapes).
- */
-
-char *ExpandString(
- char *s
-)
-{
- char c, *sdata, *cp, *ns;
- int len, pos, addn;
-
- if (!s) return s;
-
- len = strlen(s);
- pos = 0;
- Malloc(len + 1, ns, char);
- ns[pos] = EOS;
-
- for ( ; *s; s++) {
- c = *s;
- cp = NULL;
-
- /* Check for escaped characters from sgmls. */
- if (*s == '\\') {
- s++;
- switch (*s) {
- case 'n':
- c = NL;
- break;
-
- case '\\':
- c = '\\';
- break;
-
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- /* for octal numbers (C style) of the form \012 */
- c = *s++ - '0';
- if (*s >= '0' && *s <= '7') {
- c = c * 8 + (*s++ - '0');
- if (*s >= '0' && *s <= '7')
- c = c * 8 + (*s - '0');
- }
- break;
-
- case '|': /* SDATA */
- s++; /* point past \| */
- sdata = s;
- /* find matching/closing \| */
- cp = s;
- while (*cp && *cp != '\\' && cp[1] != '|')
- cp++;
- if (!*cp)
- break;
-
- *cp = EOS; /* terminate sdata string */
- cp++;
- s = cp; /* s now points to | */
-
- cp = LookupSDATA(sdata);
- if (!cp)
- cp = sdata;
- c = 0;
- break;
-
- /* This shouldn't happen. */
- default:
- s--;
- break;
- }
- }
-
- /* Check for character re-mappings. */
- if (nCharMap && c) {
- int i;
-
- for (i = 0; i < nCharMap; i++) {
- if (c != CharMap[i].name[0])
- continue;
- cp = CharMap[i].sval;
- c = 0;
- break;
- }
- }
-
- /* See if there is enough space for the data. */
- /* XXX this should be MUCH smarter about predicting
- how much extra memory it should allocate */
- if (c)
- addn = 1;
- else
- addn = strlen(cp);
-
- /* If not, make some. */
- if (addn > len - pos) {
- len += addn - (len - pos);
- Realloc(len + 1, ns, char);
- }
-
- /* Then copy the data. */
- if (c)
- ns[pos] = c;
- else
- strcpy(&ns[pos], cp);
-
- pos += addn;
- ns[pos] = EOS;
- }
- return(ns);
-}
-
-/* ______________________________________________________________________ */
-/* Expands escaped strings in the input buffer (things like tabs, newlines,
- * octal characters - using C style escapes) and outputs buffer to specified
- * fp. The hat/anchor character forces that position to appear at the
- * beginning of a line. The cursor position is kept track of (optionally)
- * so that this can be done.
- * Arguments:
- * Pointer to element under consideration.
- * FILE pointer of where to print.
- * Flag saying whether or not to keep track of our position in the output
- * stream. (We want to when writing to a file, but not for stderr.)
- */
-
-void
-OutputString(
- char *s,
- FILE *fp,
- int track_pos
-)
-{
- char c;
- static int char_pos = 0; /* remembers our character position */
- char *p;
-
- if (!fp) return;
- if (!s) s = "^"; /* no string - go to start of line */
-
- for (p = s; *p; p++) {
- c = *p;
- /* If caller wants us to track position, see if it's an anchor
- * (ie, align at a newline). */
- if (track_pos) {
- if (c == ANCHOR && (p == s || *(p + 1) == EOS)) {
- /* If we're already at the start of a line, don't do
- * another newline. */
- if (char_pos != 0) c = NL;
- else c = 0;
- }
- else char_pos++;
- if (c == NL) char_pos = 0;
- }
- else if (c == ANCHOR && (p == s || *(p + 1) == EOS)) c = NL;
- if (c) putc(c, fp);
- }
-}
-
-/* ______________________________________________________________________ */
-/* Figure out value of SDATA entity.
- * We rememeber lookup hits in a "cache" (a shorter list), and look in
- * cache before general list. Typically there will be LOTS of entries
- * in the general list and only a handful in the hit list. Often, if an
- * entity is used once, it'll be used again.
- * Arguments:
- * Pointer to SDATA entity token in ESIS.
- * Return:
- * Mapped value of the SDATA entity.
- */
-
-char *
-LookupSDATA(
- char *s
-)
-{
- char *v;
- static Map_t *Hits; /* remember lookup hits */
-
- /* If we have a hit list, check it. */
- if (Hits) {
- if ((v = FindMappingVal(Hits, s))) return v;
- }
-
- v = FindMappingVal(SDATAmap, s);
-
- /* If mapping found, remember it, then return it. */
- if ((v = FindMappingVal(SDATAmap, s))) {
- if (!Hits) Hits = NewMap(IMS_sdatacache);
- SetMappingNV(Hits, s, v);
- return v;
- }
-
- fprintf(stderr, "Error: Could not find SDATA substitution '%s'.\n", s);
- return NULL;
-}
-
-/* ______________________________________________________________________ */
-/* Add tag 'name' of length 'len' to list of tag names (if not there).
- * This is a list of null-terminated strings so that we don't have to
- * keep using the name length.
- * Arguments:
- * Pointer to element name (GI) to remember.
- * Return:
- * Pointer to the SAVED element name (GI).
- */
-
-char *
-AddElemName(
- char *name
-)
-{
- int i;
- static int n_alloc=0; /* number of slots allocated so far */
-
- /* See if it's already in the list. */
- for (i=0; i<nUsedElem; i++)
- if (UsedElem[i][0] == name[0] && !strcmp(UsedElem[i], name))
- return UsedElem[i];
-
- /* Allocate slots in blocks of N, so we don't have to call malloc
- * so many times. */
- if (n_alloc == 0) {
- n_alloc = IMS_elemnames;
- Calloc(n_alloc, UsedElem, char *);
- }
- else if (nUsedElem >= n_alloc) {
- n_alloc += IMS_elemnames;
- Realloc(n_alloc, UsedElem, char *);
- }
- UsedElem[nUsedElem] = strdup(name);
- return UsedElem[nUsedElem++];
-}
-/* ______________________________________________________________________ */
-/* Add attrib name to list of attrib names (if not there).
- * This is a list of null-terminated strings so that we don't have to
- * keep using the name length.
- * Arguments:
- * Pointer to attr name to remember.
- * Return:
- * Pointer to the SAVED attr name.
- */
-
-char *
-AddAttName(
- char *name
-)
-{
- int i;
- static int n_alloc=0; /* number of slots allocated so far */
-
- /* See if it's already in the list. */
- for (i=0; i<nUsedAtt; i++)
- if (UsedAtt[i][0] == name[0] && !strcmp(UsedAtt[i], name))
- return UsedAtt[i];
-
- /* Allocate slots in blocks of N, so we don't have to call malloc
- * so many times. */
- if (n_alloc == 0) {
- n_alloc = IMS_attnames;
- Calloc(n_alloc, UsedAtt, char *);
- }
- else if (nUsedAtt >= n_alloc) {
- n_alloc += IMS_attnames;
- Realloc(n_alloc, UsedAtt, char *);
- }
- UsedAtt[nUsedAtt] = strdup(name);
- return UsedAtt[nUsedAtt++];
-}
-
-/* ______________________________________________________________________ */
-/* Find an element's attribute value given element pointer and attr name.
- * Typical use:
- * a=FindAttByName("TYPE", t);
- * do something with a->val;
- * Arguments:
- * Pointer to element under consideration.
- * Pointer to attribute name.
- * Return:
- * Pointer to the value of the attribute.
- */
-
-/*
-Mapping_t *
-FindAttByName(
- Element_t *e,
- char *name
-)
-{
- int i;
- if (!e) return NULL;
- for (i=0; i<e->natts; i++)
- if (e->atts[i].name[0] == name[0] && !strcmp(e->atts[i].name, name))
- return &(e->atts[i]);
- return NULL;
-}
-*/
-
-char *
-FindAttValByName(
- Element_t *e,
- char *name
-)
-{
- int i;
- if (!e) return NULL;
- for (i=0; i<e->natts; i++)
- if (e->atts[i].name[0] == name[0] && !strcmp(e->atts[i].name, name))
- return e->atts[i].sval;
- return NULL;
-}
-
-/* ______________________________________________________________________ */
-/* Find context of a tag, 'levels' levels up the tree.
- * Space for string is passed by caller.
- * Arguments:
- * Pointer to element under consideration.
- * Number of levels to look up tree.
- * String to write path into (provided by caller).
- * Return:
- * Pointer to the provided string (for convenience of caller).
- */
-
-char *
-FindContext(
- Element_t *e,
- int levels,
- char *con
-)
-{
- char *s;
- Element_t *ep;
- int i;
-
- if (!e) return NULL;
- s = con;
- *s = EOS;
- for (i=0,ep=e->parent; ep && levels; ep=ep->parent,i++,levels--) {
- if (i != 0) *s++ = ' ';
- strcpy(s, ep->gi);
- s += strlen(s);
- }
- return con;
-}
-
-
-/* ______________________________________________________________________ */
-/* Tests relationship (specified by argument/flag) between given element
- * (structure pointer) and named element.
- * Returns pointer to matching tag if found, null otherwise.
- * Arguments:
- * Pointer to element under consideration.
- * Pointer to name of elem whose relationsip we are trying to determine.
- * Relationship we are testing.
- * Return:
- * Pointer to the provided string (for convenience of caller).
- */
-
-Element_t *
-QRelation(
- Element_t *e,
- char *s,
- Relation_t rel
-)
-{
- int i;
- Element_t *ep;
-
- if (!e) return 0;
-
- /* we'll call e the "given element" */
- switch (rel)
- {
- case REL_Parent:
- if (!e->parent || !e->parent->gi) return 0;
- if (!strcmp(e->parent->gi, s)) return e->parent;
- break;
- case REL_Child:
- for (i=0; i<e->necont; i++)
- if (!strcmp(s, e->econt[i]->gi)) return e->econt[i];
- break;
- case REL_Ancestor:
- if (!e->parent || !e->parent->gi) return 0;
- for (ep=e->parent; ep; ep=ep->parent)
- if (!strcmp(ep->gi, s)) return ep;
- break;
- case REL_Descendant:
- if (e->necont == 0) return 0;
- /* check immediate children first */
- for (i=0; i<e->necont; i++)
- if (!strcmp(s, e->econt[i]->gi)) return e->econt[i];
- /* then children's children (recursively) */
- for (i=0; i<e->necont; i++)
- if ((ep=QRelation(e->econt[i], s, REL_Descendant)))
- return ep;
- break;
- case REL_Sibling:
- if (!e->parent) return 0;
- ep = e->parent;
- for (i=0; i<ep->necont; i++)
- if (!strcmp(s, ep->econt[i]->gi) && i != e->my_eorder)
- return ep->econt[i];
- break;
- case REL_Preceding:
- if (!e->parent || e->my_eorder == 0) return 0;
- ep = e->parent;
- for (i=0; i<e->my_eorder; i++)
- if (!strcmp(s, ep->econt[i]->gi)) return ep->econt[i];
- break;
- case REL_ImmPreceding:
- if (!e->parent || e->my_eorder == 0) return 0;
- ep = e->parent->econt[e->my_eorder-1];
- if (!strcmp(s, ep->gi)) return ep;
- break;
- case REL_Following:
- if (!e->parent || e->my_eorder == (e->parent->necont-1))
- return 0; /* last? */
- ep = e->parent;
- for (i=(e->my_eorder+1); i<ep->necont; i++)
- if (!strcmp(s, ep->econt[i]->gi)) return ep->econt[i];
- break;
- case REL_ImmFollowing:
- if (!e->parent || e->my_eorder == (e->parent->necont-1))
- return 0; /* last? */
- ep = e->parent->econt[e->my_eorder+1];
- if (!strcmp(s, ep->gi)) return ep;
- break;
- case REL_Cousin:
- if (!e->parent) return 0;
- /* Now, see if element's parent has that thing as a child. */
- return QRelation(e->parent, s, REL_Child);
- break;
- case REL_None:
- case REL_Unknown:
- fprintf(stderr, "You can not query 'REL_None' or 'REL_Unknown'.\n");
- break;
- }
- return NULL;
-}
-
-/* Given a relationship name (string), determine enum symbol for it.
- * Arguments:
- * Pointer to relationship name.
- * Return:
- * Relation_t enum.
- */
-Relation_t
-FindRelByName(
- char *relname
-)
-{
- if (!strcmp(relname, "?")) {
- fprintf(stderr, "Supported query/relationships %s\n%s.\n",
- "child, parent, ancestor, descendant,",
- "sibling, sibling+, sibling+1, sibling-, sibling-1");
- return REL_None;
- }
- else if (StrEq(relname, "child")) return REL_Child;
- else if (StrEq(relname, "parent")) return REL_Parent;
- else if (StrEq(relname, "ancestor")) return REL_Ancestor;
- else if (StrEq(relname, "descendant")) return REL_Descendant;
- else if (StrEq(relname, "sibling")) return REL_Sibling;
- else if (StrEq(relname, "sibling-")) return REL_Preceding;
- else if (StrEq(relname, "sibling-1")) return REL_ImmPreceding;
- else if (StrEq(relname, "sibling+")) return REL_Following;
- else if (StrEq(relname, "sibling+1")) return REL_ImmFollowing;
- else if (StrEq(relname, "cousin")) return REL_Cousin;
- else fprintf(stderr, "Unknown relationship: %s\n", relname);
- return REL_Unknown;
-}
-
-/* ______________________________________________________________________ */
-/* This will descend the element tree in-order. (enter_f)() is called
- * upon entering the node. Then all children (data and child elements)
- * are operated on, calling either DescendTree() with a pointer to
- * the child element or (data_f)() for each non-element child node.
- * Before leaving the node (ascending), (leave_f)() is called. enter_f
- * and leave_f are passed a pointer to this node and data_f is passed
- * a pointer to the data/content (which includes the data itself and
- * type information). dp is an opaque pointer to any data the caller
- * wants to pass.
- * Arguments:
- * Pointer to element under consideration.
- * Pointer to procedure to call when entering element.
- * Pointer to procedure to call when leaving element.
- * Pointer to procedure to call for each "chunk" of content data.
- * Void data pointer, passed to the avobe 3 procedures.
- */
-
-void
-DescendTree(
- Element_t *e,
- void (*enter_f)(),
- void (*leave_f)(),
- void (*data_f)(),
- void *dp
-)
-{
- int i;
- if (enter_f) (enter_f)(e, dp);
- for (i=0; i<e->ncont; i++) {
- if (e->cont[i].type == CMD_OPEN)
- DescendTree(e->cont[i].ch.elem, enter_f, leave_f, data_f, dp);
- else
- if (data_f) (data_f)(&e->cont[i], dp);
- }
- if (leave_f) (leave_f)(e, dp);
-}
-
-/* ______________________________________________________________________ */
-/* Add element, 'e', whose ID is 'idval', to a list of IDs.
- * This makes it easier to find an element by ID later.
- * Arguments:
- * Pointer to element under consideration.
- * Element's ID attribute value (a string).
- */
-
-void
-AddID(
- Element_t *e,
- char *idval
-)
-{
- static ID_t *id_last;
-
- if (!IDList) {
- Malloc(1, id_last, ID_t);
- IDList = id_last;
- }
- else {
- Malloc(1, id_last->next, ID_t);
- id_last = id_last->next;
- }
- id_last->elem = e;
- id_last->id = idval;
-}
-
-/* ______________________________________________________________________ */
-/* Return pointer to element who's ID is given.
- * Arguments:
- * Element's ID attribute value (a string).
- * Return:
- * Pointer to element whose ID matches.
- */
-
-Element_t *
-FindElemByID(
- char *idval
-)
-{
- ID_t *id;
- for (id=IDList; id; id=id->next)
- if (id->id[0] == idval[0] && !strcmp(id->id, idval)) return id->elem;
- return 0;
-}
-
-/* ______________________________________________________________________ */
-
diff --git a/usr.bin/sgmls/libsgmls/Makefile b/usr.bin/sgmls/libsgmls/Makefile
deleted file mode 100644
index 0d058f3..0000000
--- a/usr.bin/sgmls/libsgmls/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Bmakefile for libsgmls
-#
-# $Id$
-#
-
-LIB= sgmls
-SRCS= sgmls.c
-
-CFLAGS+= -I${.CURDIR}/../sgmls
-
-NOMAN= noman
-NOPROFILE= noprofile
-
-install:
-
-.include <bsd.lib.mk>
diff --git a/usr.bin/sgmls/libsgmls/sgmls.c b/usr.bin/sgmls/libsgmls/sgmls.c
deleted file mode 100644
index 4e25957..0000000
--- a/usr.bin/sgmls/libsgmls/sgmls.c
+++ /dev/null
@@ -1,1032 +0,0 @@
-/* sgmls.c:
- Library for reading output of sgmls.
-
- Written by James Clark (jjc@jclark.com). */
-
-#include "config.h"
-#include "std.h"
-#include "sgmls.h"
-#include "lineout.h"
-
-#ifdef USE_PROTOTYPES
-#define P(parms) parms
-#else
-#define P(parms) ()
-#endif
-
-typedef struct sgmls_data data_s;
-typedef struct sgmls_notation notation_s;
-typedef struct sgmls_internal_entity internal_entity_s;
-typedef struct sgmls_external_entity external_entity_s;
-typedef struct sgmls_entity entity_s;
-typedef struct sgmls_attribute attribute_s;
-typedef struct sgmls_event event_s;
-
-/* lists are sorted in reverse order of level */
-struct list {
- int subdoc_level; /* -1 if associated with finished subdoc */
- struct list *next;
- char *name;
-};
-
-struct entity_list {
- int subdoc_level;
- struct entity_list *next;
- entity_s entity;
-};
-
-struct notation_list {
- int subdoc_level;
- struct notation_list *next;
- notation_s notation;
-};
-
-struct sgmls {
- FILE *fp;
- char *buf;
- unsigned buf_size;
- struct entity_list *entities;
- struct notation_list *notations;
- attribute_s *attributes;
- unsigned long lineno;
- char *filename;
- unsigned filename_size;
- unsigned long input_lineno;
- int subdoc_level;
- char **files; /* from `f' commands */
- int nfiles;
- char *sysid; /* from `s' command */
- char *pubid; /* from `p' command */
-};
-
-enum error_code {
- E_ZERO, /* Not an error */
- E_NOMEM, /* Out of memory */
- E_BADESCAPE, /* Bad escape */
- E_NULESCAPE, /* \000 other than in data */
- E_NUL, /* A null input character */
- E_BADENTITY, /* Reference to undefined entity */
- E_INTERNALENTITY, /* Internal entity when external was needed */
- E_SYSTEM, /* System input error */
- E_COMMAND, /* Bad command letter */
- E_MISSING, /* Missing arguments */
- E_NUMBER, /* Not a number */
- E_ATTR, /* Bad attribute type */
- E_BADNOTATION, /* Reference to undefined notation */
- E_BADINTERNAL, /* Bad internal entity type */
- E_BADEXTERNAL, /* Bad external entity type */
- E_EOF, /* EOF in middle of line */
- E_SDATA, /* \| other than in data */
- E_LINELENGTH /* line longer than UNSIGNED_MAX */
-};
-
-static char *errlist[] = {
- 0,
- "Out of memory",
- "Bad escape",
- "\\0 escape not in data",
- "Nul character in input",
- "Reference to undefined entity",
- "Internal entity when external was needed",
- "System input error",
- "Bad command letter",
- "Missing arguments",
- "Not a number",
- "Bad attribute type",
- "Reference to undefined notation",
- "Bad internal entity type",
- "Bad external entity type",
- "EOF in middle of line",
- "\\| other than in data",
- "Too many V commands",
- "Input line too long"
-};
-
-static void error P((enum error_code));
-static int parse_data P((char *, unsigned long *));
-static void parse_location P((char *, struct sgmls *));
-static void parse_notation P((char *, notation_s *));
-static void parse_internal_entity P((char *, internal_entity_s *));
-static void parse_external_entity
- P((char *, struct sgmls *, external_entity_s *));
-static void parse_subdoc_entity P((char *, external_entity_s *));
-static attribute_s *parse_attribute P((struct sgmls *, char *));
-static void grow_datav P((void));
-static char *unescape P((char *));
-static char *unescape_file P((char *));
-static int unescape1 P((char *));
-static char *scan_token P((char **));
-static int count_args P((char *));
-static struct list *list_find P((struct list *, char *, int));
-static UNIV xmalloc P((unsigned));
-static UNIV xrealloc P((UNIV , unsigned));
-static char *strsave P((char *));
-static int read_line P((struct sgmls *));
-static notation_s *lookup_notation P((struct sgmls *, char *));
-static entity_s *lookup_entity P((struct sgmls *, char *));
-static external_entity_s *lookup_external_entity P((struct sgmls *, char *));
-static void define_external_entity P((struct sgmls *, external_entity_s *));
-static void define_internal_entity P((struct sgmls *, internal_entity_s *));
-static void define_notation P((struct sgmls *, notation_s *));
-static data_s *copy_data P((data_s *, int));
-static void list_finish_level P((struct list **, int));
-static void add_attribute P((attribute_s **, attribute_s *));
-static void default_errhandler P((int, char *, unsigned long));
-
-#define xfree(s) do { if (s) free(s); } while (0)
-
-static sgmls_errhandler *errhandler = default_errhandler;
-static unsigned long input_lineno = 0;
-
-static data_s *datav = 0;
-static int datav_size = 0;
-
-struct sgmls *sgmls_create(fp)
- FILE *fp;
-{
- struct sgmls *sp;
-
- sp = (struct sgmls *)malloc(sizeof(struct sgmls));
- if (!sp)
- return 0;
- sp->fp = fp;
- sp->entities = 0;
- sp->notations = 0;
- sp->attributes = 0;
- sp->lineno = 0;
- sp->filename = 0;
- sp->filename_size = 0;
- sp->input_lineno = 0;
- sp->buf_size = 0;
- sp->buf = 0;
- sp->subdoc_level = 0;
- sp->files = 0;
- sp->nfiles = 0;
- sp->sysid = 0;
- sp->pubid = 0;
- return sp;
-}
-
-void sgmls_free(sp)
- struct sgmls *sp;
-{
- struct entity_list *ep;
- struct notation_list *np;
-
- if (!sp)
- return;
- xfree(sp->filename);
- sgmls_free_attributes(sp->attributes);
-
- for (ep = sp->entities; ep;) {
- struct entity_list *tem = ep->next;
- if (ep->entity.is_internal) {
- xfree(ep->entity.u.internal.data.s);
- free(ep->entity.u.internal.name);
- }
- else {
- int i;
- for (i = 0; i < ep->entity.u.external.nfilenames; i++)
- xfree(ep->entity.u.external.filenames[i]);
- xfree(ep->entity.u.external.filenames);
- xfree(ep->entity.u.external.sysid);
- xfree(ep->entity.u.external.pubid);
- sgmls_free_attributes(ep->entity.u.external.attributes);
- free(ep->entity.u.internal.name);
- }
- free(ep);
- ep = tem;
- }
-
- for (np = sp->notations; np;) {
- struct notation_list *tem = np->next;
- xfree(np->notation.sysid);
- xfree(np->notation.pubid);
- free(np->notation.name);
- free(np);
- np = tem;
- }
-
- xfree(sp->buf);
- xfree(sp->pubid);
- xfree(sp->sysid);
- if (sp->files) {
- int i;
- for (i = 0; i < sp->nfiles; i++)
- free(sp->files[i]);
- free(sp->files);
- }
- free(sp);
-
- xfree(datav);
- datav = 0;
- datav_size = 0;
-}
-
-sgmls_errhandler *sgmls_set_errhandler(handler)
- sgmls_errhandler *handler;
-{
- sgmls_errhandler *old = errhandler;
- if (handler)
- errhandler = handler;
- return old;
-}
-
-int sgmls_next(sp, e)
- struct sgmls *sp;
- event_s *e;
-{
- while (read_line(sp)) {
- char *buf = sp->buf;
-
- e->filename = sp->filename;
- e->lineno = sp->lineno;
-
- switch (buf[0]) {
- case DATA_CODE:
- e->u.data.n = parse_data(buf + 1, &sp->lineno);
- e->u.data.v = datav;
- e->type = SGMLS_EVENT_DATA;
- return 1;
- case START_CODE:
- {
- char *p;
- e->u.start.attributes = sp->attributes;
- sp->attributes = 0;
- e->type = SGMLS_EVENT_START;
- p = buf + 1;
- e->u.start.gi = scan_token(&p);
- return 1;
- }
- case END_CODE:
- {
- char *p = buf + 1;
- e->type = SGMLS_EVENT_END;
- e->u.end.gi = scan_token(&p);
- return 1;
- }
- case START_SUBDOC_CODE:
- case END_SUBDOC_CODE:
- {
- char *p = buf + 1;
- char *name = scan_token(&p);
- if (buf[0] == START_SUBDOC_CODE) {
- e->u.entity = lookup_external_entity(sp, name);
- sp->subdoc_level++;
- e->type = SGMLS_EVENT_SUBSTART;
- }
- else {
- e->type = SGMLS_EVENT_SUBEND;
- list_finish_level((struct list **)&sp->entities, sp->subdoc_level);
- list_finish_level((struct list **)&sp->notations, sp->subdoc_level);
- sp->subdoc_level--;
- e->u.entity = lookup_external_entity(sp, name);
- }
- return 1;
- }
- case ATTRIBUTE_CODE:
- add_attribute(&sp->attributes, parse_attribute(sp, buf + 1));
- break;
- case DATA_ATTRIBUTE_CODE:
- {
- char *p = buf + 1;
- char *name;
- attribute_s *a;
- external_entity_s *ext;
-
- name = scan_token(&p);
- a = parse_attribute(sp, p);
- ext = lookup_external_entity(sp, name);
- add_attribute(&ext->attributes, a);
- }
- break;
- case REFERENCE_ENTITY_CODE:
- {
- char *p = buf + 1;
- char *name;
- name = scan_token(&p);
- e->u.entity = lookup_external_entity(sp, name);
- e->type = SGMLS_EVENT_ENTITY;
- return 1;
- }
- case DEFINE_NOTATION_CODE:
- {
- notation_s notation;
-
- parse_notation(buf + 1, &notation);
- define_notation(sp, &notation);
- }
- break;
- case DEFINE_EXTERNAL_ENTITY_CODE:
- {
- external_entity_s external;
-
- parse_external_entity(buf + 1, sp, &external);
- define_external_entity(sp, &external);
- }
- break;
- case DEFINE_SUBDOC_ENTITY_CODE:
- {
- external_entity_s external;
-
- parse_subdoc_entity(buf + 1, &external);
- define_external_entity(sp, &external);
- }
- break;
- case DEFINE_INTERNAL_ENTITY_CODE:
- {
- internal_entity_s internal;
-
- parse_internal_entity(buf + 1, &internal);
- define_internal_entity(sp, &internal);
- }
- break;
- case PI_CODE:
- e->u.pi.len = unescape1(buf + 1);
- e->u.pi.s = buf + 1;
- e->type = SGMLS_EVENT_PI;
- return 1;
- case LOCATION_CODE:
- parse_location(buf + 1, sp);
- break;
- case APPINFO_CODE:
- e->u.appinfo = unescape(buf + 1);
- e->type = SGMLS_EVENT_APPINFO;
- return 1;
- case SYSID_CODE:
- sp->sysid = strsave(unescape(buf + 1));
- break;
- case PUBID_CODE:
- sp->pubid = strsave(unescape(buf + 1));
- break;
- case FILE_CODE:
- sp->files = xrealloc(sp->files, (sp->nfiles + 1)*sizeof(char *));
- sp->files[sp->nfiles] = strsave(unescape_file(buf + 1));
- sp->nfiles += 1;
- break;
- case CONFORMING_CODE:
- e->type = SGMLS_EVENT_CONFORMING;
- return 1;
- default:
- error(E_COMMAND);
- }
- }
-
- return 0;
-}
-
-static
-int parse_data(p, linenop)
- char *p;
- unsigned long *linenop;
-{
- int n = 0;
- char *start = p;
- char *q;
- int is_sdata = 0;
-
- /* No need to copy before first escape. */
-
- for (; *p != '\\' && *p != '\0'; p++)
- ;
- q = p;
- while (*p) {
- if (*p == '\\') {
- switch (*++p) {
- case '\\':
- *q++ = *p++;
- break;
- case 'n':
- *q++ = RECHAR;
- *linenop += 1;
- p++;
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- int val = *p++ - '0';
- if (*p >= '0' && *p <= '7') {
- val = val*8 + (*p++ - '0');
- if (*p >= '0' && *p <= '7')
- val = val*8 + (*p++ - '0');
- }
- *q++ = (char)val;
- }
- break;
- case '|':
- if (q > start || is_sdata) {
- if (n >= datav_size)
- grow_datav();
- datav[n].s = start;
- datav[n].len = q - start;
- datav[n].is_sdata = is_sdata;
- n++;
- }
- is_sdata = !is_sdata;
- start = q;
- p++;
- break;
- default:
- error(E_BADESCAPE);
- }
- }
- else
- *q++ = *p++;
- }
-
- if (q > start || is_sdata) {
- if (n >= datav_size)
- grow_datav();
- datav[n].s = start;
- datav[n].len = q - start;
- datav[n].is_sdata = is_sdata;
- n++;
- }
- return n;
-}
-
-static
-void grow_datav()
-{
- unsigned size = datav_size ? 2*datav_size : 2;
- datav = (data_s *)xrealloc((UNIV)datav, size*sizeof(data_s));
- datav_size = size;
-}
-
-static
-void parse_location(s, sp)
- char *s;
- struct sgmls *sp;
-{
- unsigned size;
-
- if (*s < '0' || *s > '9' || sscanf(s, "%lu", &sp->lineno) != 1)
- error(E_NUMBER);
- do {
- ++s;
- } while (*s >= '0' && *s <= '9');
-
- if (*s != ' ')
- return;
- s++;
- s = unescape_file(s);
- size = strlen(s) + 1;
- if (size <= sp->filename_size)
- strcpy(sp->filename, s);
- else {
- sp->filename = xrealloc(sp->filename, size);
- strcpy(sp->filename, s);
- sp->filename_size = size;
- }
-}
-
-static
-void parse_notation(s, n)
- char *s;
- notation_s *n;
-{
- n->name = strsave(scan_token(&s));
-}
-
-static
-void parse_internal_entity(s, e)
- char *s;
- internal_entity_s *e;
-{
- char *type;
-
- e->name = strsave(scan_token(&s));
- type = scan_token(&s);
- if (strcmp(type, "CDATA") == 0)
- e->data.is_sdata = 0;
- else if (strcmp(type, "SDATA") == 0)
- e->data.is_sdata = 1;
- else
- error(E_BADINTERNAL);
- e->data.len = unescape1(s);
- if (e->data.len == 0)
- e->data.s = 0;
- else {
- e->data.s = xmalloc(e->data.len);
- memcpy(e->data.s, s, e->data.len);
- }
-}
-
-static
-void parse_external_entity(s, sp, e)
- char *s;
- struct sgmls *sp;
- external_entity_s *e;
-{
- char *type;
- char *notation;
-
- e->name = strsave(scan_token(&s));
- type = scan_token(&s);
- if (strcmp(type, "CDATA") == 0)
- e->type = SGMLS_ENTITY_CDATA;
- else if (strcmp(type, "SDATA") == 0)
- e->type = SGMLS_ENTITY_SDATA;
- else if (strcmp(type, "NDATA") == 0)
- e->type = SGMLS_ENTITY_NDATA;
- else
- error(E_BADEXTERNAL);
- notation = scan_token(&s);
- e->notation = lookup_notation(sp, notation);
-}
-
-static
-void parse_subdoc_entity(s, e)
- char *s;
- external_entity_s *e;
-{
- e->name = strsave(scan_token(&s));
- e->type = SGMLS_ENTITY_SUBDOC;
-}
-
-static
-attribute_s *parse_attribute(sp, s)
- struct sgmls *sp;
- char *s;
-{
- attribute_s *a;
- char *type;
-
- a = (attribute_s *)xmalloc(sizeof(*a));
- a->name = strsave(scan_token(&s));
- type = scan_token(&s);
- if (strcmp(type, "CDATA") == 0) {
- unsigned long lineno = 0;
- a->type = SGMLS_ATTR_CDATA;
- a->value.data.n = parse_data(s, &lineno);
- a->value.data.v = copy_data(datav, a->value.data.n);
- }
- else if (strcmp(type, "IMPLIED") == 0) {
- a->type = SGMLS_ATTR_IMPLIED;
- }
- else if (strcmp(type, "NOTATION") == 0) {
- a->type = SGMLS_ATTR_NOTATION;
- a->value.notation = lookup_notation(sp, scan_token(&s));
- }
- else if (strcmp(type, "ENTITY") == 0) {
- int n, i;
- a->type = SGMLS_ATTR_ENTITY;
- n = count_args(s);
- if (n == 0)
- error(E_MISSING);
- a->value.entity.v = (entity_s **)xmalloc(n*sizeof(entity_s *));
- a->value.entity.n = n;
- for (i = 0; i < n; i++)
- a->value.entity.v[i] = lookup_entity(sp, scan_token(&s));
- }
- else if (strcmp(type, "TOKEN") == 0) {
- int n, i;
- a->type = SGMLS_ATTR_TOKEN;
- n = count_args(s);
- if (n == 0)
- error(E_MISSING);
- a->value.token.v = (char **)xmalloc(n * sizeof(char *));
- for (i = 0; i < n; i++)
- a->value.token.v[i] = strsave(scan_token(&s));
- a->value.token.n = n;
- }
- else
- error(E_ATTR);
- return a;
-}
-
-void sgmls_free_attributes(p)
- attribute_s *p;
-{
- while (p) {
- attribute_s *nextp = p->next;
- switch (p->type) {
- case SGMLS_ATTR_CDATA:
- if (p->value.data.v) {
- free(p->value.data.v[0].s);
- free(p->value.data.v);
- }
- break;
- case SGMLS_ATTR_TOKEN:
- {
- int i;
- for (i = 0; i < p->value.token.n; i++)
- free(p->value.token.v[i]);
- xfree(p->value.token.v);
- }
- break;
- case SGMLS_ATTR_ENTITY:
- xfree(p->value.entity.v);
- break;
- case SGMLS_ATTR_IMPLIED:
- case SGMLS_ATTR_NOTATION:
- break;
- }
- free(p->name);
- free(p);
- p = nextp;
- }
-}
-
-static
-data_s *copy_data(v, n)
- data_s *v;
- int n;
-{
- if (n == 0)
- return 0;
- else {
- int i;
- unsigned total;
- char *p;
- data_s *result;
-
- result = (data_s *)xmalloc(n*sizeof(data_s));
- total = 0;
- for (i = 0; i < n; i++)
- total += v[i].len;
- if (!total)
- total++;
- p = xmalloc(total);
- for (i = 0; i < n; i++) {
- result[i].s = p;
- memcpy(result[i].s, v[i].s, v[i].len);
- result[i].len = v[i].len;
- p += v[i].len;
- result[i].is_sdata = v[i].is_sdata;
- }
- return result;
- }
-}
-
-/* Unescape s, and return nul-terminated data. Give an error
-if the data contains 0. */
-
-static
-char *unescape(s)
- char *s;
-{
- int len = unescape1(s);
- if (
-#ifdef __BORLANDC__
- len > 0 &&
-#endif
- memchr(s, '\0', len))
- error(E_NULESCAPE);
- s[len] = '\0';
- return s;
-}
-
-/* Like unescape(), but REs are represented by 012 not 015. */
-
-static
-char *unescape_file(s)
- char *s;
-{
- char *p;
- p = s = unescape(s);
- while ((p = strchr(p, RECHAR)) != 0)
- *p++ = '\n';
- return s;
-
-}
-
-/* Unescape s, and return length of data. The data may contain 0. */
-
-static
-int unescape1(s)
- char *s;
-{
- const char *p;
- char *q;
-
- q = strchr(s, '\\');
- if (!q)
- return strlen(s);
- p = q;
- while (*p) {
- if (*p == '\\') {
- switch (*++p) {
- case '\\':
- *q++ = *p++;
- break;
- case 'n':
- *q++ = RECHAR;
- p++;
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- int val = *p++ - '0';
- if (*p >= '0' && *p <= '7') {
- val = val*8 + (*p++ - '0');
- if (*p >= '0' && *p <= '7')
- val = val*8 + (*p++ - '0');
- }
- *q++ = (char)val;
- }
- break;
- case '|':
- error(E_SDATA);
- default:
- error(E_BADESCAPE);
- }
- }
- else
- *q++ = *p++;
- }
- return q - s;
-}
-
-static
-char *scan_token(pp)
- char **pp;
-{
- char *start = *pp;
- while (**pp != '\0') {
- if (**pp == ' ') {
- **pp = '\0';
- *pp += 1;
- break;
- }
- *pp += 1;
- }
- if (!*start)
- error(E_MISSING);
- return start;
-}
-
-static
-int count_args(p)
- char *p;
-{
- int n = 0;
-
- while (*p != '\0') {
- n++;
- do {
- ++p;
- if (*p == ' ') {
- p++;
- break;
- }
- } while (*p != '\0');
- }
- return n;
-}
-
-static
-int read_line(sp)
- struct sgmls *sp;
-{
- unsigned i = 0;
- FILE *fp = sp->fp;
- int c;
- char *buf = sp->buf;
- unsigned buf_size = sp->buf_size;
-
- c = getc(fp);
- if (c == EOF) {
- input_lineno = sp->input_lineno;
- if (ferror(fp))
- error(E_SYSTEM);
- return 0;
- }
-
- sp->input_lineno++;
- input_lineno = sp->input_lineno;
- for (;;) {
- if (i >= buf_size) {
- if (buf_size == 0)
- buf_size = 24;
- else if (buf_size > (unsigned)UINT_MAX/2) {
- if (buf_size == (unsigned)UINT_MAX)
- error(E_LINELENGTH);
- buf_size = (unsigned)UINT_MAX;
- }
- else
- buf_size *= 2;
- buf = xrealloc(buf, buf_size);
- sp->buf = buf;
- sp->buf_size = buf_size;
- }
- if (c == '\0')
- error(E_NUL);
- if (c == '\n') {
- buf[i] = '\0';
- break;
- }
- buf[i++] = c;
- c = getc(fp);
- if (c == EOF) {
- if (ferror(fp))
- error(E_SYSTEM);
- else
- error(E_EOF);
- }
- }
- return 1;
-}
-
-static
-notation_s *lookup_notation(sp, name)
-struct sgmls *sp;
-char *name;
-{
- struct notation_list *p
- = (struct notation_list *)list_find((struct list *)sp->notations, name,
- sp->subdoc_level);
- if (!p)
- error(E_BADNOTATION);
- return &p->notation;
-}
-
-static
-entity_s *lookup_entity(sp, name)
-struct sgmls *sp;
-char *name;
-{
- struct entity_list *p
- = (struct entity_list *)list_find((struct list *)sp->entities, name,
- sp->subdoc_level);
- if (!p)
- error(E_BADENTITY);
- return &p->entity;
-}
-
-static
-external_entity_s *lookup_external_entity(sp, name)
-struct sgmls *sp;
-char *name;
-{
- entity_s *p = lookup_entity(sp, name);
- if (p->is_internal)
- error(E_INTERNALENTITY);
- return &p->u.external;
-}
-
-static
-void define_external_entity(sp, e)
-struct sgmls *sp;
-external_entity_s *e;
-{
- struct entity_list *p;
- e->attributes = 0;
- e->filenames = sp->files;
- e->nfilenames = sp->nfiles;
- sp->files = 0;
- sp->nfiles = 0;
- e->pubid = sp->pubid;
- sp->pubid = 0;
- e->sysid = sp->sysid;
- sp->sysid = 0;
- p = (struct entity_list *)xmalloc(sizeof(struct entity_list));
- memcpy((UNIV)&p->entity.u.external, (UNIV)e, sizeof(*e));
- p->entity.is_internal = 0;
- p->subdoc_level = sp->subdoc_level;
- p->next = sp->entities;
- sp->entities = p;
-}
-
-static
-void define_internal_entity(sp, e)
-struct sgmls *sp;
-internal_entity_s *e;
-{
- struct entity_list *p;
- p = (struct entity_list *)xmalloc(sizeof(struct entity_list));
- memcpy((UNIV)&p->entity.u.internal, (UNIV)e, sizeof(*e));
- p->entity.is_internal = 1;
- p->subdoc_level = sp->subdoc_level;
- p->next = sp->entities;
- sp->entities = p;
-}
-
-static
-void define_notation(sp, np)
-struct sgmls *sp;
-notation_s *np;
-{
- struct notation_list *p;
- np->sysid = sp->sysid;
- sp->sysid = 0;
- np->pubid = sp->pubid;
- sp->pubid = 0;
- p = (struct notation_list *)xmalloc(sizeof(struct notation_list));
- memcpy((UNIV)&p->notation, (UNIV)np, sizeof(*np));
- p->subdoc_level = sp->subdoc_level;
- p->next = sp->notations;
- sp->notations = p;
-}
-
-static
-struct list *list_find(p, name, level)
- struct list *p;
- char *name;
- int level;
-{
- for (; p && p->subdoc_level == level; p = p->next)
- if (strcmp(p->name, name) == 0)
- return p;
- return 0;
-}
-
-/* Move all the items in the list whose subdoc level is level to the
-end of the list and make their subdoc_level -1. */
-
-static
-void list_finish_level(listp, level)
- struct list **listp;
- int level;
-{
- struct list **pp, *next_level, *old_level;
- for (pp = listp; *pp && (*pp)->subdoc_level == level; pp = &(*pp)->next)
- (*pp)->subdoc_level = -1;
- next_level = *pp;
- *pp = 0;
- old_level = *listp;
- *listp = next_level;
- for (pp = listp; *pp; pp = &(*pp)->next)
- ;
- *pp = old_level;
-}
-
-static
-void add_attribute(pp, a)
- attribute_s **pp, *a;
-{
-#if 0
- for (; *pp && strcmp((*pp)->name, a->name) < 0; pp = &(*pp)->next)
- ;
-#endif
- a->next = *pp;
- *pp = a;
-}
-
-
-static
-char *strsave(s)
-char *s;
-{
- if (!s)
- return s;
- else {
- char *p = xmalloc(strlen(s) + 1);
- strcpy(p, s);
- return p;
- }
-}
-
-static
-UNIV xmalloc(n)
- unsigned n;
-{
- UNIV p = malloc(n);
- if (!p)
- error(E_NOMEM);
- return p;
-}
-
-/* ANSI C says first argument to realloc can be NULL, but not everybody
- appears to support this. */
-
-static
-UNIV xrealloc(p, n)
- UNIV p;
- unsigned n;
-{
- p = p ? realloc(p, n) : malloc(n);
- if (!p)
- error(E_NOMEM);
- return p;
-}
-
-static
-void error(num)
- enum error_code num;
-{
- (*errhandler)((int)num, errlist[num], input_lineno);
- abort();
-}
-
-static
-void default_errhandler(num, msg, lineno)
- int num;
- char *msg;
- unsigned long lineno;
-{
- fprintf(stderr, "Line %lu: %s\n", lineno, msg);
- exit(1);
-}
diff --git a/usr.bin/sgmls/libsgmls/sgmls.h b/usr.bin/sgmls/libsgmls/sgmls.h
deleted file mode 100644
index 79b2658..0000000
--- a/usr.bin/sgmls/libsgmls/sgmls.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* sgmls.h
- Interface to a library for reading output of sgmls. */
-
-struct sgmls_data {
- char *s;
- unsigned len;
- char is_sdata;
-};
-
-struct sgmls_notation {
- char *name;
- char *sysid;
- char *pubid;
-};
-
-struct sgmls_internal_entity {
- char *name;
- struct sgmls_data data;
-};
-
-enum sgmls_external_entity_type {
- SGMLS_ENTITY_CDATA,
- SGMLS_ENTITY_SDATA,
- SGMLS_ENTITY_NDATA,
- SGMLS_ENTITY_SUBDOC
- };
-
-struct sgmls_external_entity {
- char *name;
- enum sgmls_external_entity_type type;
- char **filenames;
- int nfilenames;
- char *pubid;
- char *sysid;
- struct sgmls_attribute *attributes;
- struct sgmls_notation *notation;
-};
-
-struct sgmls_entity {
- union {
- struct sgmls_internal_entity internal;
- struct sgmls_external_entity external;
- } u;
- char is_internal;
-};
-
-enum sgmls_attribute_type {
- SGMLS_ATTR_IMPLIED,
- SGMLS_ATTR_CDATA,
- SGMLS_ATTR_TOKEN,
- SGMLS_ATTR_ENTITY,
- SGMLS_ATTR_NOTATION
-};
-
-struct sgmls_attribute {
- struct sgmls_attribute *next;
- char *name;
- enum sgmls_attribute_type type;
- union {
- struct {
- struct sgmls_data *v;
- int n;
- } data;
- struct {
- struct sgmls_entity **v;
- int n;
- } entity;
- struct {
- char **v;
- int n;
- } token;
- struct sgmls_notation *notation;
- } value;
-};
-
-enum sgmls_event_type {
- SGMLS_EVENT_DATA, /* data */
- SGMLS_EVENT_ENTITY, /* external entity reference */
- SGMLS_EVENT_PI, /* processing instruction */
- SGMLS_EVENT_START, /* element start */
- SGMLS_EVENT_END, /* element end */
- SGMLS_EVENT_SUBSTART, /* subdocument start */
- SGMLS_EVENT_SUBEND, /* subdocument end */
- SGMLS_EVENT_APPINFO, /* appinfo */
- SGMLS_EVENT_CONFORMING /* the document was conforming */
- };
-
-struct sgmls_event {
- enum sgmls_event_type type;
- union {
- struct {
- struct sgmls_data *v;
- int n;
- } data;
- struct sgmls_external_entity *entity;
- struct {
- char *s;
- unsigned len;
- } pi;
- struct {
- char *gi;
- struct sgmls_attribute *attributes;
- } start;
- struct {
- char *gi;
- } end;
- char *appinfo;
- } u;
- char *filename; /* SGML filename */
- unsigned long lineno; /* SGML lineno */
-};
-
-#ifdef __STDC__
-void sgmls_free_attributes(struct sgmls_attribute *);
-struct sgmls *sgmls_create(FILE *);
-int sgmls_next(struct sgmls *, struct sgmls_event *);
-void sgmls_free(struct sgmls *);
-typedef void sgmls_errhandler(int, char *, unsigned long);
-sgmls_errhandler *sgmls_set_errhandler(sgmls_errhandler *);
-#else /* not __STDC__ */
-void sgmls_free_attributes();
-struct sgmls *sgmls_create();
-int sgmls_next();
-void sgmls_free();
-typedef void sgmls_errhandler();
-sgmls_errhandler *sgmls_set_errhandler();
-#endif /* not __STDC__ */
diff --git a/usr.bin/sgmls/sgmls.pl b/usr.bin/sgmls/sgmls.pl
deleted file mode 100755
index edb9eb6..0000000
--- a/usr.bin/sgmls/sgmls.pl
+++ /dev/null
@@ -1,247 +0,0 @@
-#! /usr/bin/perl
-
-# This is a skeleton of a perl script for processing the output of
-# sgmls. You must change the parts marked with "XXX".
-
-# XXX This is for troff: in data, turn \ into \e (which prints as \).
-# Backslashes in SDATA entities are left as backslashes.
-
-$backslash_in_data = "\\e";
-
-$prog = $0;
-
-$prog =~ s|.*/||;
-
-$level = 0;
-
-while (<STDIN>) {
- chop;
- $command = substr($_, 0, 1);
- substr($_, 0, 1) = "";
- if ($command eq '(') {
- &start_element($_);
- $level++;
- }
- elsif ($command eq ')') {
- $level--;
- &end_element($_);
- foreach $key (keys %attribute_value) {
- @splitkey = split($;, $key);
- if ($splitkey[0] == $level) {
- delete $attribute_value{$key};
- delete $attribute_type{$key};
- }
- }
- }
- elsif ($command eq '-') {
- &unescape_data($_);
- &data($_);
- }
- elsif ($command eq 'A') {
- @field = split(/ /, $_, 3);
- $attribute_type{$level,$field[0]} = $field[1];
- &unescape_data($field[2]);
- $attribute_value{$level,$field[0]} = $field[2];
- }
- elsif ($command eq '&') {
- &entity($_);
- }
- elsif ($command eq 'D') {
- @field = split(/ /, $_, 4);
- $data_attribute_type{$field[0], $field[1]} = $field[2];
- &unescape_data($field[3]);
- $data_attribute_value{$field[0], $field[1]} = $field[3];
- }
- elsif ($command eq 'N') {
- $notation{$_} = 1;
- if (defined($sysid)) {
- $notation_sysid{$_} = $sysid;
- undef($sysid);
- }
- if (defined($pubid)) {
- $notation_pubid{$_} = $pubid;
- undef($pubid);
- }
- }
- elsif ($command eq 'I') {
- @field = split(/ /, $_, 3);
- $entity_type{$field[0]} = $field[1];
- &unescape($field[2]);
- # You may want to substitute \e for \ if the type is CDATA.
- $entity_text{$field[0]} = $field[2];
- $entity_code{$field[0]} = 'I';
- }
- elsif ($command eq 'E') {
- @field = split(/ /, $_);
- $entity_code{$field[0]} = 'E';
- $entity_type{$field[0]} = $field[1];
- $entity_notation{$field[0]} = $field[2];
- if (defined(@files)) {
- foreach $i (0..$#files) {
- $entity_filename{$field[0], $i} = $files[i];
- }
- undef(@files);
- }
- if (defined($sysid)) {
- $entity_sysid{$field[0]} = $sysid;
- undef($sysid);
- }
- if (defined($pubid)) {
- $entity_pubid{$field[0]} = $pubid;
- undef($pubid);
- }
- }
- elsif ($command eq 'S') {
- $entity_code{$_} = 'S';
- if (defined(@files)) {
- foreach $i (0..$#files) {
- $entity_filename{$_, $i} = $files[i];
- }
- undef(@files);
- }
- if (defined($sysid)) {
- $entity_sysid{$_} = $sysid;
- undef($sysid);
- }
- if (defined($pubid)) {
- $entity_pubid{$_} = $pubid;
- undef($pubid);
- }
- }
- elsif ($command eq '?') {
- &unescape($_);
- &pi($_);
- }
- elsif ($command eq 'L') {
- @field = split(/ /, $_);
- $lineno = $field[0];
- if ($#field >= 1) {
- &unescape($field[1]);
- $filename = $field[1];
- }
- }
- elsif ($command eq 'V') {
- @field = split(/ /, $_, 2);
- &unescape($field[1]);
- $environment{$field[0]} = $field[1];
- }
- elsif ($command eq '{') {
- &start_subdoc($_);
- }
- elsif ($command eq '}') {
- &end_subdoc($_);
- }
- elsif ($command eq 'f') {
- &unescape($_);
- push(@files, $_);
- }
- elsif ($command eq 'p') {
- &unescape($_);
- $pubid = $_;
- }
- elsif ($command eq 's') {
- &unescape($_);
- $sysid = $_;
- }
- elsif ($command eq 'C') {
- $conforming = 1;
- }
- else {
- warn "$prog:$ARGV:$.: unrecognized command \`$command'\n";
- }
-}
-
-sub unescape {
- $_[0] =~ s/\\([0-7][0-7]?[0-7]?|.)/&esc($1)/eg;
-}
-
-sub esc {
- local($_) = $_[0];
- if ($_ eq '012' || $_ eq '12') {
- ""; # ignore RS
- }
- elsif (/^[0-7]/) {
- sprintf("%c", oct);
- }
- elsif ($_ eq 'n') {
- "\n";
- }
- elsif ($_ eq '|') {
- "";
- }
- elsif ($_ eq "\\") {
- "\\";
- }
- else {
- $_;
- }
-}
-
-sub unescape_data {
- local($sdata) = 0;
- $_[0] =~ s/\\([0-7][0-7]?[0-7]?|.)/&esc_data($1)/eg;
-}
-
-sub esc_data {
- local($_) = $_[0];
- if ($_ eq '012' || $_ eq '12') {
- ""; # ignore RS
- }
- elsif (/^[0-7]/) {
- sprintf("%c", oct);
- }
- elsif ($_ eq 'n') {
- "\n";
- }
- elsif ($_ eq '|') {
- $sdata = !$sdata;
- "";
- }
- elsif ($_ eq "\\") {
- $sdata ? "\\" : $backslash_in_data;
- }
- else {
- $_;
- }
-}
-
-
-sub start_element {
- local($gi) = $_[0];
- # XXX
-}
-
-sub end_element {
- local($gi) = $_[0];
- # XXX
-}
-
-sub data {
- local($data) = $_[0];
- # XXX
-}
-
-# A processing instruction.
-
-sub pi {
- local($data) = $_[0];
- # XXX
-}
-
-# A reference to an external entity.
-
-sub entity {
- local($name) = $_[0];
- # XXX
-}
-
-sub start_subdoc {
- local($name) = $_[0];
- # XXX
-}
-
-sub end_subdoc {
- local($name) = $_[0];
- # XXX
-}
-
diff --git a/usr.bin/sgmls/sgmls/Makefile b/usr.bin/sgmls/sgmls/Makefile
deleted file mode 100644
index b46e9f6..0000000
--- a/usr.bin/sgmls/sgmls/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Bmakefile for sgmls
-#
-# $Id$
-#
-
-PROG= sgmls
-
-SRCS= lexrf.c pcbrf.c synrf.c context.c md1.c md2.c pars1.c pars2.c serv.c
-SRCS+= sgml1.c sgml2.c sgmlmsg.c sgmlxtrn.c traceset.c entgen.c sgmlio.c
-SRCS+= xfprintf.c main.c unixproc.c sgmldecl.c version.c strerror.c getopt.c
-SRCS+= lineout.c ambig.c lextaba.c catalog.c
-
-CFLAGS+= -I${.CURDIR}/../libsgmls
-
-.include "../Makefile.inc"
-.include <bsd.prog.mk>
-
-
diff --git a/usr.bin/sgmls/sgmls/action.h b/usr.bin/sgmls/sgmls/action.h
deleted file mode 100644
index 03bf478..0000000
--- a/usr.bin/sgmls/sgmls/action.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* ACTION.H: Symbols for all PCB action codes. */
-/* CONACT.H: Symbols for content parse action names (end with '_').
- There must be no conflict with PARSEACT.H, which
- uses 0 through 19, or SGMLACT.H, which uses 20 through 32
- (except that 31 - 32 can be defined here because they are
- used only by PARSEPRO and do not conflict with SGML.C).
-*/
-#define CIR_ 31 /* Invalid character(s) ignored in MDS; restarting parse. */
-#define DTD_ 32 /* Process DOCTYPE declaration. */
-#define DTE_ 33 /* End of DOCTYPE declaration. */
-#define PEP_ 34 /* TEMP: Previous character ended prolog. */
-#define DAS_ 35 /* Current character begins data. */
-#define FCE_ 36 /* Process free character (SR12-18, 21-30). */
-#define DCE_ 37 /* Data character in element text; change PCB. */
-#define LAS_ 38 /* Start lookahead buffer with current character. */
-#define LAM_ 39 /* Move character to lookahead buffer. */
-#define LAF_ 40 /* Flush the lookahead buffer; REPEATCC. */
-#define NED_ 41 /* Process null end-tag delimiter. */
-#define NET_ 42 /* Process null end-tag. */
-#define NST_ 43 /* Process null start-tag. */
-#define NLF_ 44 /* Flush lookahead buffer except for trailing NET or SR. */
-#define ETC_ 45 /* End-tag in CDATA or RCDATA; treat as data if invalid. */
-#define SRMIN 46 /* Dummy for SHORT REFERENCES: srn = SRn - SRMIN. */
-#define SR1_ 47 /* TAB */
-#define SR2_ 48 /* RE */
-#define SR3_ 49 /* RS */
-#define SR4_ 50 /* Leading blanks */
-#define SR5_ 51 /* Null record */
-#define DAR_ 52 /* Flush data buffer after repeating current character. */
-#define SR7_ 53 /* Trailing blanks */
-#define SR8_ 54 /* Space */
-#define SR9_ 55 /* Two or more blanks */
-#define SR10 56 /* Quotation mark (first data character) */
-#define SR11 57 /* Number sign */
-#define SR12 58 /* FCE CHARACTERS start here */
-/* _ 59 */
-#define BSQ_ 60 /* Blank sequence begun; find its end. */
-/* 61 In use by PARSEACT.H */
-/* 62 In use by PARSEACT.H */
-/* 63 In use by PARSEACT.H */
-/* 64 In use by PARSEACT.H */
-#define SR19 65 /* Hyphen */
-#define SR20 66 /* Two hyphens */
-#define SR25 71 /* Left bracket */
-#define SR26 72 /* Right bracket */
-#define RBR_ 73 /* Two right brackets. */
-#define GTR_ 74 /* EOB with pending data character */
-#define MSP_ 75 /* Marked section start in prolog outside DTD */
-#define APP_ 76 /* APPINFO (other than NONE) */
-#define STE_ 77 /* Start tag ended prolog */
-#define ETE_ 78 /* End tag ended prolog */
-
-/* GRPACT.H: Symbols for group tokenization action names (all alpha).
- There must be no conflict with PARSEACT.H, which
- uses 0 - 19.
-*/
-#define AND 20 /* AND connector found. */
-#define DTAG 21 /* Data tag token group occurred (treat as #CHARS). */
-#define GRPE 22 /* Group ended. */
-#define GRP_ 23 /* Group started. */
-#define NAS_ 24 /* Name started in content model or name group. */
-#define NMT_ 25 /* Name or name token started in name token group. */
-#define OPT 26 /* OPT occurrence indicator for previous token. */
-#define OR 27 /* OR connector found. */
-#define OREP 28 /* OREP occurrence indicator for previous token. */
-#define REP 29 /* REP occurrence indicator for previous token. */
-#define RNS_ 30 /* Reserved name started (#PCDATA). */
-#define SEQ 31 /* SEQ connector found. */
-/* LITACT.H: Symbols for content parse action names (end with '_').
- There must be no conflict with PARSEACT.H, which
- uses 0 through 19.
-*/
-#define MLA_ 20 /* Move character to look-aside data buffer. */
-#define LPR_ 21 /* Move previous character to data buffer. */
-#define RSM_ 22 /* Process record start and move it to data buffer. */
-#define FUN_ 23 /* Replace function character with a space. */
-#define LP2_ 24 /* Move previous two characters to data buffer. */
-#define MLE_ 25 /* Minimum literal error: invalid character ignored. */
-#define RPR_ 26 /* Remove previous character from data buffer; terminate. */
-#define TER_ 27 /* Terminate the parse. */
-/* MDACT.H: Symbols for markup declaration parse action names (all alpha).
- There must be no conflict with PARSEACT.H, which
- uses 0 - 19.
-*/
-#define CDR 20 /* CD[1] (MINUS) occurred previously. */
-#define EMD 21 /* End of markup declaration. */
-#define GRPS 22 /* Group started. */
-#define LIT 23 /* Literal started: character data. */
-#define LITE 24 /* Literal started: character data; LITA is delimiter. */
-#define MGRP 25 /* Minus exception group (MINUS,GRPO). */
-#define NAS 26 /* Name started. */
-#define NMT 27 /* Name token started. */
-#define NUM 28 /* Number or number token started. */
-#define PEN 29 /* Parameter entity name being defined (PERO found). */
-#define PGRP 30 /* Plus exception group (PLUS,GRPO). */
-#define RNS 31 /* Reserved name started. */
-#define MDS 32 /* Markup declaration subset start. */
-#define PENR 33 /* REPEATCC; PERO found. */
-/* PARSEACT.H: Symbols for common parse action names (end with '_').
- There must be no conflict with other action name
- files, which use numbers greater than 19.
-*/
-#define CRA_ 1 /* Character reference: alphabetic. */
-#define CRN_ 2 /* Character reference: numeric; non-char refs o.k.. */
-#define NON_ 3 /* Single byte of non-character data found. */
-#define EOF_ 4 /* Error: illegal entity end; resume old input; return. */
-#define ER_ 5 /* Entity reference; start new input source; continue. */
-#define GET_ 6 /* EOB, EOS, or EE: resume old input source; continue. */
-#define INV_ 7 /* Error: invalid char terminated markup; repeat char. */
-#define LEN_ 8 /* Error: length limit exceeded; end markup; repeat char. */
-#define NOP_ 9 /* No action necessary. */
-#define PCI_ 10 /* Previous character was invalid. */
-#define PER_ 11 /* Parameter reference; start new input source; continue. */
-#define RC2_ 12 /* Back up two characters. */
-#define RCC_ 13 /* Repeat current character. */
-#define RCR_ 14 /* Repeat current character and return to caller. */
-#define EE_ 15 /* EOS or EE: resume old input source; return to caller. */
-#define RS_ 16 /* Record start: ccnt=0; ++rcnt. */
-#define ERX_ 17 /* Entity reference; start new input source; return. */
-#define SYS_ 18 /* Error allowed: SYSCHAR in input stream; replace it. */
-#define EOD_ 19 /* End of document. */
-/* Number way out of order to avoid recompilation. */
-#define NSC_ 58 /* Handle DELNONCH/DELXNONCH when NON_ is allowed */
-#define PEX_ 61 /* Parameter entity ref; start new input source; return. */
-#define DEF_ 62 /* Data entity found. */
-#define PIE_ 63 /* PI entity found (needed in markup). */
-#define LNR_ 64 /* LEN_ error with extra REPEATCC. */
-/* SGMLACT.H: Symbols for content parse action names (end with '_')
- that are returned to SGML.C for processing.
- There must be no conflict with PARSEACT.H, which
- uses 0 through 19, or CONACT.H, which uses 34 and above.
- (Note: 31 is also used in CONACT.H, but no conflict
- is created because they are tested only in PARSEPRO.C, which
- completes before SGML.C starts to examine those codes.
- Also, when EOD_ is returned from PARSECON, it is changed
- to LOP_.)
-*/
-#define CON_ 20 /* Normal content action (one of the following). */
-#define DAF_ 21 /* Data found. */
-#define ETG_ 22 /* Process end-tag. */
-#define MD_ 23 /* Process markup declaration (NAMESTRT found). */
-#define MDC_ 24 /* Process markup declaration comment (CD found). */
-#define MSS_ 25 /* Process marked section start. */
-#define MSE_ 26 /* Process marked section end. */
-#define PIS_ 27 /* Processing instruction (string). */
-#define REF_ 28 /* Record end found. */
-#define STG_ 29 /* Process start-tag. */
-#define RSR_ 30 /* Return RS to effect SGML state transition. */
-#define LOP_ 31 /* Loop for new content without returning anything. */
-/* TAGACT.H: Symbols for tag parse action names (all alpha).
- There must be no conflict with PARSEACT.H, which
- uses 0 - 19.
-*/
-#define AVD 20 /* Delimited attribute value started: normal delimiter. */
-#define AVU 21 /* Undelimited value started. */
-#define ETIC 22 /* Tag closed with ETI. */
-#define NVS 23 /* Name of attribute or value started. */
-#define NASV 24 /* Saved NAS was actually an NTV. */
-#define NTV 25 /* Name token value started; get name and full value. */
-#define TAGC 26 /* Tag closed normally. */
-#define TAGO 27 /* Tag closed implicitly by TAGO character. */
-#define AVDA 28 /* Delimited attribute value started: alternative delim. */
-#define DSC 29 /* Closed by DSC character. */
-/* VALACT.H: Symbols for attribute value tokenization action names (all alpha).
-*/
-#define NOPA 0 /* No action necessary. */
-#define INVA 1 /* Invalid character; terminate parse. */
-#define LENA 2 /* Length limit of token exceeded; terminate parse. */
-#define NASA 3 /* Name started. */
-#define NMTA 4 /* Name token started. */
-#define NUMA 5 /* Number or number token started. */
-
-/* SGML declaration parsing actions. */
-
-#define ESGD 20 /* End of SGML declaration. */
-#define LIT1 21 /* Literal started. */
-#define LIT2 22 /* Literal started with LITA delimiter. */
-#define NUM1 23 /* Number started. */
-#define NAS1 24 /* Name started. */
-#define ISIG 25 /* Insignificant character occurred. */
diff --git a/usr.bin/sgmls/sgmls/adl.h b/usr.bin/sgmls/sgmls/adl.h
deleted file mode 100644
index 930e1e8..0000000
--- a/usr.bin/sgmls/sgmls/adl.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* ADL.H: Definitions for attribute descriptor list processing.
-*/
-/* N/C/SDATA external entity types for nxetype member of ne structure. */
-#define ESNCDATA 1 /* External character data entity. */
-#define ESNNDATA 2 /* Non-SGML data entity. */
-#define ESNSDATA 3 /* External specific character data entity. */
-#define ESNSUB 4 /* SGML subdocument entity. */
-
-/* N/C/SDATA control block for AENTITY attributes and NDATA returns.*/
-struct ne { /* N/C/SDATA entity control block. */
- UNIV neid; /* Files for NDATA entity. */
- UNCH *nepubid; /* Public identifier if specified. */
- UNCH *nesysid; /* System identifier if specified. */
- PDCB nedcn; /* Data content notation control block. */
- struct ad *neal; /* Data attribute list (NULL if none). */
- UNCH *neename; /* Ptr to entity name (length and EOS). */
- UNCH nextype; /* Entity type: NDATA SDATA CDATA SUBDOC. */
-};
-#define NESZ (sizeof(struct ne))
-typedef struct ne *PNE;
-/* NDATA entity control block fields. */
-#define NEID(p) (((PNE)p)->neid) /* File ID of NDATA entity. */
-#define NESYSID(p) (((PNE)p)->nesysid) /* System ID of NDATA entity. */
-#define NEPUBID(p) (((PNE)p)->nepubid) /* Public ID of NDATA entity. */
-#define NEDCN(p) (((PNE)p)->nedcn->ename) /* Data content notation name. */
-#define NEDCNSYSID(p) (((PNE)p)->nedcn->sysid) /* Notation system ID.*/
-#define NEDCNPUBID(p) (((PNE)p)->nedcn->pubid) /* Notation public ID.*/
-#define NEDCNDEFINED(p) (((PNE)p)->nedcn->defined) /* Notation defined? */
-#define NEDCNADL(p) (((PNE)p)->nedcn->adl) /* Data content notation attlist.*/
-#define NEENAME(p) (((PNE)p)->neename) /* Entity name pointer. */
-#define NEXTYPE(p) (((PNE)p)->nextype) /* External entity type. */
-#define NEAL(p) (((PNE)p)->neal) /* Data attributes (if any). */
-#define NEDCNMARK(p) DCNMARK(((PNE)p)->nedcn)
-
-/* Attribute descriptor list entry. */
-struct ad {
- UNCH *adname; /* Attribute name with length and EOS. */
- UNCH adflags; /* Attribute flags. */
- UNCH adtype; /* Value type. */
- UNS adnum; /* Group size or member pos in grp. */
- UNS adlen; /* Length of default or value (for capacity). */
- UNCH *addef; /* Default value (NULL if REQUIRED or IMPLIED). */
- union {
- PNE n; /* AENTITY: NDATA control block. */
- PDCB x; /* ANOTEGRP: DCN control block. */
- } addata; /* Special data associated with some attributes.*/
-};
-#define ADSZ (sizeof(struct ad)) /* Size of an ad structure. */
-
-/* Attribute flags for entire list adflags: ADLF. */
-#define ADLREQ 0x80 /* Attribute list: 1=REQUIRED att defined. */
-#define ADLNOTE 0x40 /* Attribute list: 1=NOTATION att defined. */
-#define ADLCONR 0x20 /* Attribute list: 1=CONREF att defined. */
-
-/* Attribute flags for list member adflags: ADFLAGS(n). */
-#define AREQ 0x80 /* Attribute: 0=null; 1=required. */
-#define ACURRENT 0x40 /* Attribute: 0=normal; 1=current. */
-#define AFIXED 0x20 /* Attribute: 0=normal; 1=must equal default. */
-#define AGROUP 0x10 /* Attribute: 0=single; 1=group of ad's. */
-#define ACONREF 0x08 /* Attribute: 0=normal; 1=att is CONREF. */
-#define AINVALID 0x04 /* Attribute: 1=value is invalid; 0=o.k. */
-#define AERROR 0x02 /* Attribute: 1=error was specified; 0=o.k. */
-#define ASPEC 0x01 /* Attribute: 1=value was specified; 0=default. */
-
-/* Attribute types for adtype. */
-#define ANMTGRP 0x00 /* Attribute: Name token group or member. */
-#define ANOTEGRP 0x01 /* Attribute: Notation (name group). */
-#define ACHARS 0x02 /* Attribute: Character string. */
-#define AENTITY 0x03 /* Attribute: Data entity (name). */
-#define AID 0x04 /* Attribute: ID value (name). */
-#define AIDREF 0x05 /* Attribute: ID reference value (name). */
-#define ANAME 0x06 /* Attribute: Name. */
-#define ANMTOKE 0x07 /* Attribute: Name token. */
-#define ANUMBER 0x08 /* Attribute: Number. */
-#define ANUTOKE 0x09 /* Attribute: Number token. */
-#define ATKNLIST 0x0A /* Attribute: >= means value is a token list. */
-#define AENTITYS 0x0A /* Attribute: Data entities (name list). */
-#define AIDREFS 0x0B /* Attribute: ID reference value (name list). */
-#define ANAMES 0x0C /* Attribute: Name list. */
-#define ANMTOKES 0x0D /* Attribute: Name token list. */
-#define ANUMBERS 0x0E /* Attribute: Number list. */
-#define ANUTOKES 0x0F /* Attribute: Number token list. */
-
-/* Field definitions for entries in an attribute list.
- The first argument to all of these is the list address.
-*/
-/* Attribute list: flags. */
-#define ADLF(a) ((a)[0].adflags)
-/* Attribute list: number of list members. */
-#define ADN(a) ((a)[0].adtype)
-/* Attribute list: number of attributes. */
-#define AN(a) ((a)[0].adnum)
-/* Nth attribute in list: name. */
-#define ADNAME(a, n) (((a)[n].adname+1))
-/* Nth att in list: number of val)ues. */
-#define ADNUM(a, n) ((a)[n].adnum)
-/* Nth attribute in list: flags. */
-#define ADFLAGS(a, n) ((a)[n].adflags)
-/* Nth attribute in list: type. */
-#define ADTYPE(a, n) ((a)[n].adtype)
-/* Nth attribute in list: len of def or val.*/
-#define ADLEN(a, n) ((a)[n].adlen)
-/* Nth attribute in list: def or value. */
-#define ADVAL(a, n) ((a)[n].addef)
-/* Nth attribute in list: special data. */
-#define ADDATA(a, n) ((a)[n].addata)
-/* Nth att: token at Pth pos in value. */
-#define ADTOKEN(a, n, p)(((a)[n].addef+(p)))
-
-#define IDHASH 101 /* Size of ID hash table. Must be prime. */
-struct id { /* ID attribute control block. */
- struct id *idnext; /* Next ID in chain. */
- UNCH *idname; /* ID name with length prefix and EOS. */
- UNCH iddefed; /* Non-zero if it has been defined. */
- struct fwdref *idrl; /* Chain of forward references to this ID. */
-};
-#define IDSZ sizeof(struct id)
-typedef struct id *PID; /* Ptr to ID attribute control block. */
diff --git a/usr.bin/sgmls/sgmls/alloc.h b/usr.bin/sgmls/sgmls/alloc.h
deleted file mode 100644
index d732178..0000000
--- a/usr.bin/sgmls/sgmls/alloc.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* alloc.h */
-
-typedef unsigned SIZE_T;
-
-/* Like malloc and realloc, but don't return if no memory is available. */
-
-extern UNIV xmalloc P((SIZE_T));
-extern UNIV xrealloc P((UNIV, SIZE_T));
diff --git a/usr.bin/sgmls/sgmls/ambig.c b/usr.bin/sgmls/sgmls/ambig.c
deleted file mode 100644
index 9da02eb..0000000
--- a/usr.bin/sgmls/sgmls/ambig.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/* ambig.c -
- Content model ambiguity checking.
-
- Written by James Clark (jjc@jclark.com).
-*/
-/*
-This uses the construction in pp8-9 of [1], extended to deal with AND
-groups.
-
-Note that it is not correct for the purposes of ambiguity analysis to
-handle AND groups by turning them into an OR group of SEQ groups
-(consider (a&b?)).
-
-We build an automaton for the entire content model by adding the
-following case for AND:
-
-nullable(v) := nullable(left child) and nullable(right child)
-if nullable(right child) then
- for each x in last(left child) do
- follow(v,x) = follow(left child,x) U first(right child);
-if nullable(left child) then
- for each x in last(right child) do
- follow(v,x) = follow(right child,x) U first(left child);
-first(v) := first(left child) U first(right child);
-last(v) := first(left child) U first(right child);
-
-We also build an automaton for each AND group by building automata for
-each of the members of the AND group using the above procedure and
-then combine the members using:
-
-for each x in last(left child) do
- follow(v,x) = follow(left child,x) U first(right child);
-for each x in last(right child) do
- follow(v,x) = follow(right child,x) U first(left child);
-first(v) := first(left child) U first(right child);
-
-The content model is ambiguous just in case one of these automata is
-non-deterministic. (Note that when checking determinism we need to
-check the `first' set as well as all the `follow' sets.)
-
-Why is this correct? Consider a primitive token in a member of an AND
-group. There are two worst cases for ambiguity: firstly, when none of
-the other members of AND group have been matched; secondly, when just
-the nullable members remain to be matched. The first case is not
-affected by context of the AND group (unless the first case is
-identical to the second case.)
-
-Note that inclusions are not relevant for the purposes of determining
-the ambiguity of content models. Otherwise the case in clause
-11.2.5.1:
-
- An element that can satisfy an element in the content model is
- considered to do so, even if the element is also an inclusion.
-
-could never arise.
-
-[1] Anne Brueggemann-Klein, Regular Expressions into Finite Automata,
-Universitaet Freiburg, Institut fur Informatik, 33 July 1991.
-*/
-
-#include "sgmlincl.h"
-
-/* Sets of states are represented by 0-terminated, ordered lists of
-indexes in gbuf. */
-
-#define MAXSTATES (GRPGTCNT+2)
-#define listcat(x, y) strcat((char *)(x), (char *)(y))
-#define listcpy(x, y) strcpy((char *)(x), (char *)(y))
-
-/* Information about a content token. */
-
-struct contoken {
- UNCH size;
- UNCH nullable;
- UNCH *first;
- UNCH *last;
-};
-
-static VOID contoken P((int, int, struct contoken *));
-static VOID andgroup P((int, int, struct contoken *));
-static VOID orgroup P((int, int, struct contoken *));
-static VOID seqgroup P((int, int, struct contoken *));
-static VOID andambig P((int));
-static int listambig P((UNCH *));
-static VOID listmerge P((UNCH *, UNCH *));
-static struct contoken *newcontoken P((void));
-static VOID freecontoken P((struct contoken *));
-
-
-/* Dynamically allocated vector of follow sets. */
-
-static UNCH **follow;
-static UNCH *mergebuf; /* for use by listmerge */
-
-/* Set to non-zero if the content model is ambiguous. */
-
-static int ambigsw;
-
-/* Check the current content model (in gbuf) for ambiguity. */
-
-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. */
- UNCH *ptr;
- follow = (UNCH **)rmalloc(MAXSTATES*sizeof(UNCH *));
- follow[0] = 0;
- ptr = (UNCH *)rmalloc((MAXSTATES - 1)*MAXSTATES);
- for (i = 1; i < MAXSTATES; i++) {
- follow[i] = ptr;
- ptr += MAXSTATES;
- }
- mergebuf = (UNCH *)rmalloc(MAXSTATES);
- }
-
- for (i = 1; i < MAXSTATES; i++)
- follow[i][0] = 0;
-
- ambigsw = 0;
-
- s = newcontoken();
- contoken(1, 1, s);
-
- ambigsw = ambigsw || listambig(s->first);
-
- freecontoken(s);
-
- for (i = 1; !ambigsw && i < MAXSTATES; i++)
- if (listambig(follow[i]))
- ambigsw = 1;
-
- if (ambigsw)
- mderr(137, (UNCH *)0, (UNCH *)0);
-}
-
-/* Free memory used for ambiguity checking. */
-
-VOID ambigfree()
-{
- if (follow) {
- frem((UNIV)follow[1]);
- frem((UNIV)follow);
- frem((UNIV)mergebuf);
- follow = 0;
- }
-}
-
-/* Determine whether a list of primitive content tokens (each
-represented by its index in gbuf) is ambiguous. */
-
-static
-int listambig(list)
-UNCH *list;
-{
- UNCH *p;
- int chars = 0;
- int rc = 0;
-
- for (p = list; *p; p++) {
- if ((gbuf[*p].ttype & TTMASK) == TTETD) {
- struct etd *e = gbuf[*p].tu.thetd;
- if (e->mark) {
- rc = 1;
- break;
- }
- e->mark = 1;
- }
- else {
- assert((gbuf[*p].ttype & TTMASK) == TTCHARS);
- if (chars) {
- rc = 1;
- break;
- }
- chars = 1;
- }
- }
-
- for (p = list; *p; p++)
- if ((gbuf[*p].ttype & TTMASK) == TTETD)
- gbuf[*p].tu.thetd->mark = 0;
-
- return rc;
-}
-
-
-/* Analyze a content token. The `checkand' argument is needed to ensure
-that the algorithm is not exponential in the AND-group nesting depth.
-*/
-
-static
-VOID contoken(m, checkand, res)
-int m; /* Index of content token in gbuf */
-int checkand; /* Non-zero if AND groups should be checked */
-struct contoken *res; /* Result */
-{
- UNCH flags = gbuf[m].ttype;
- switch (flags & TTMASK) {
- case TTCHARS:
- case TTETD:
- res->first[0] = m;
- res->first[1] = 0;
- res->last[0] = m;
- res->last[1] = 0;
- res->size = 1;
- res->nullable = 0;
- break;
- case TTAND:
- if (checkand)
- andambig(m);
- andgroup(m, checkand, res);
- break;
- case TTOR:
- orgroup(m, checkand, res);
- break;
- case TTSEQ:
- seqgroup(m, checkand, res);
- break;
- default:
- abort();
- }
- if (flags & TREP) {
- UNCH *p;
- for (p = res->last; *p; p++)
- listmerge(follow[*p], res->first);
- }
- if (flags & TOPT)
- res->nullable = 1;
-}
-
-/* Check an AND group for ambiguity. */
-
-static
-VOID andambig(m)
-int m;
-{
- int i, tnum;
- int lim;
- struct contoken *curr;
- struct contoken *next;
-
- tnum = gbuf[m].tu.tnum;
- assert(tnum > 0);
- curr = newcontoken();
- next = newcontoken();
- contoken(m + 1, 0, curr);
- i = m + 1 + curr->size;
- curr->size += 1;
- for (--tnum; tnum > 0; --tnum) {
- UNCH *p;
- contoken(i, 0, next);
- curr->size += next->size;
- i += next->size;
- for (p = curr->last; *p; p++)
- listcat(follow[*p], next->first);
- for (p = next->last; *p; p++)
- listmerge(follow[*p], curr->first);
- listcat(curr->first, next->first);
- listcat(curr->last, next->last);
- }
- lim = m + curr->size;
- for (i = m + 1; i < lim; i++) {
- if (listambig(follow[i]))
- ambigsw = 1;
- follow[i][0] = 0;
- }
- freecontoken(curr);
- freecontoken(next);
-}
-
-/* Handle an AND group. */
-
-static
-VOID andgroup(m, checkand, res)
-int m;
-int checkand;
-struct contoken *res;
-{
- int i, tnum;
- /* union of the first sets of nullable members of the group */
- UNCH *nullablefirst;
- struct contoken *next;
-
- tnum = gbuf[m].tu.tnum;
- assert(tnum > 0);
- contoken(m + 1, checkand, res);
- nullablefirst = (UNCH *)rmalloc(MAXSTATES);
- if (res->nullable)
- listcpy(nullablefirst, res->first);
- else
- nullablefirst[0] = 0;
- i = m + 1 + res->size;
- res->size += 1;
- next = newcontoken();
- for (--tnum; tnum > 0; --tnum) {
- UNCH *p;
- contoken(i, checkand, next);
- res->size += next->size;
- i += next->size;
- if (next->nullable)
- for (p = res->last; *p; p++)
- listcat(follow[*p], next->first);
- for (p = next->last; *p; p++)
- listmerge(follow[*p], nullablefirst);
- listcat(res->first, next->first);
- if (next->nullable)
- listcat(nullablefirst, next->first);
- listcat(res->last, next->last);
- res->nullable &= next->nullable;
- }
- frem((UNIV)nullablefirst);
- freecontoken(next);
-}
-
-/* Handle a SEQ group. */
-
-static
-VOID seqgroup(m, checkand, res)
-int m;
-int checkand;
-struct contoken *res;
-{
- int i, tnum;
- struct contoken *next;
-
- tnum = gbuf[m].tu.tnum;
- assert(tnum > 0);
- contoken(m + 1, checkand, res);
- i = m + 1 + res->size;
- res->size += 1;
- next = newcontoken();
- for (--tnum; tnum > 0; --tnum) {
- UNCH *p;
- contoken(i, checkand, next);
- res->size += next->size;
- i += next->size;
- for (p = res->last; *p; p++)
- listcat(follow[*p], next->first);
- if (res->nullable)
- listcat(res->first, next->first);
- if (next->nullable)
- listcat(res->last, next->last);
- else
- listcpy(res->last, next->last);
- res->nullable &= next->nullable;
- }
- freecontoken(next);
-}
-
-/* Handle an OR group. */
-
-static
-VOID orgroup(m, checkand, res)
-int m;
-int checkand;
-struct contoken *res;
-{
- int i, tnum;
- struct contoken *next;
-
- tnum = gbuf[m].tu.tnum;
- assert(tnum > 0);
- contoken(m + 1, checkand, res);
- i = m + 1 + res->size;
- res->size += 1;
- next = newcontoken();
- for (--tnum; tnum > 0; --tnum) {
- contoken(i, checkand, next);
- res->size += next->size;
- i += next->size;
- listcat(res->first, next->first);
- listcat(res->last, next->last);
- res->nullable |= next->nullable;
- }
- freecontoken(next);
-}
-
-
-/* Merge the second ordered list into the first. */
-
-static
-VOID listmerge(p, b)
-UNCH *p, *b;
-{
- UNCH *a = mergebuf;
-
- strcpy((char *)a, (char *)p);
-
- for (;;) {
- if (*a) {
- if (*b) {
- if (*a < *b)
- *p++ = *a++;
- else if (*a > *b)
- *p++ = *b++;
- else
- a++;
- }
- else
- *p++ = *a++;
- }
- else if (*b)
- *p++ = *b++;
- else
- break;
- }
- *p = '\0';
-}
-
-static
-struct contoken *newcontoken()
-{
- struct contoken *p = (struct contoken *)rmalloc(sizeof(struct contoken)
- + MAXSTATES*2);
- p->first = (UNCH *)(p + 1);
- p->last = p->first + MAXSTATES;
- return p;
-}
-
-static
-VOID freecontoken(p)
-struct contoken *p;
-{
- frem((UNIV)p);
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/appl.h b/usr.bin/sgmls/sgmls/appl.h
deleted file mode 100644
index 2513c98..0000000
--- a/usr.bin/sgmls/sgmls/appl.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* appl.h */
-
-enum {
- E_NOMEM = 1,
- E_DOC,
- E_EXEC,
- E_FORK,
- E_WAIT,
- E_SIGNAL,
- E_OPEN,
- E_CAPBOTCH,
- E_SUBDOC
-};
-
-VOID process_document P((int));
-VOID output_conforming P((void));
-
-VOID appl_error VP((int, ...));
-
-#ifdef SUPPORT_SUBDOC
-int run_process P((char **));
-char **make_argv P((UNIV));
-VOID get_subcaps P((void));
-#endif
-
-#ifdef SUPPORT_SUBDOC
-extern int suberr;
-#endif
-
-extern int suppsw;
-extern int locsw;
diff --git a/usr.bin/sgmls/sgmls/catalog.c b/usr.bin/sgmls/sgmls/catalog.c
deleted file mode 100644
index 28077a8..0000000
--- a/usr.bin/sgmls/sgmls/catalog.c
+++ /dev/null
@@ -1,925 +0,0 @@
-/* Normalize public identifiers to handle ISO 8879[-:]1986 problem.
-What should happen if there's a duplicate in a single catalog entry file? */
-
-#include "config.h"
-#include "std.h"
-#include "catalog.h"
-
-#ifdef USE_PROTOTYPES
-#define P(parms) parms
-#else
-#define P(parms) ()
-#endif
-
-#include "alloc.h"
-
-#define MINIMUM_DATA_CHARS \
-"abcdefghijklmnopqrstuvwxyz\
-ABCDEFGHIJKLMNOPQRSTUVWXYZ\
-0123456789-.'()+,/:=?"
-
-#define N_DECL_TYPE 3
-#define PUBLIC_ID_MAP N_DECL_TYPE
-#define N_TABLES (N_DECL_TYPE + 1)
-
-enum literal_type {
- NORMAL_LITERAL,
- MINIMUM_LITERAL
-};
-
-typedef enum {
- EOF_PARAM,
- NAME_PARAM,
- LITERAL_PARAM
-} PARAM_TYPE;
-
-enum catalog_error {
- E_NAME_EXPECTED,
- E_LITERAL_EXPECTED,
- E_ARG_EXPECTED,
- E_MINIMUM_DATA,
- E_EOF_COMMENT,
- E_EOF_LITERAL,
- E_NUL_CHAR,
- E_CANNOT_OPEN,
- E_GETC,
- E_FCLOSE
-};
-
-#define FIRST_SYSTEM_ERROR E_CANNOT_OPEN
-
-#define HASH_TABLE_INITIAL_SIZE 8
-#define HASH_TABLE_MAX_SIZE (((SIZE_T)-1)/sizeof(struct hash_table_entry *))
-
-struct hash_table_entry {
- int file_index;
- const char *key;
- const char *system_id;
-};
-
-/* Number of bytes per string block. */
-#define BLOCK_SIZE 1000
-
-/* Bytes follow the struct. */
-
-struct string_block {
- struct string_block *next;
-};
-
-struct hash_table {
- struct hash_table_entry **v;
- SIZE_T size; /* must be power of 2 */
- SIZE_T used;
- SIZE_T used_limit;
-};
-
-struct catalog {
- struct hash_table tables[N_TABLES];
- char **files;
- int n_files;
- struct string_block *blocks;
- char *block_ptr;
- SIZE_T block_spare;
- CATALOG_ERROR_HANDLER error_handler;
- int loaded;
-};
-
-struct parser {
- FILE *fp;
- struct catalog *cat;
- char *param;
- SIZE_T param_length;
- SIZE_T param_alloc;
- int file_index;
- const char *filename;
- unsigned long newline_count;
- char minimum_data[256];
-};
-
-static
-VOID add_catalog_file P((struct catalog *cat, const char *filename,
- SIZE_T length));
-static
-VOID load P((struct catalog *cat));
-static
-VOID parse_file P((struct parser *parser));
-static
-VOID parse_public P((struct parser *parser));
-static
-VOID parse_name_map P((struct parser *parser,
- int decl_type));
-static
-int parse_arg P((struct parser *parser));
-static
-PARAM_TYPE parse_param P((struct parser *parser, enum literal_type));
-static
-VOID skip_comment P((struct parser *parser));
-static
-PARAM_TYPE parse_literal P((struct parser *parser, int lit,
- enum literal_type));
-static
-PARAM_TYPE parse_name P((struct parser *parser, int first_char));
-static
-VOID param_grow P((struct parser *parser));
-static
-const char *param_save P((struct parser *parser));
-static
-char *alloc_bytes P((struct catalog *catalog, SIZE_T n));
-static
-int param_equal P((struct parser *parser, const char *key));
-static
-int hash_table_add P((struct hash_table *table, const char *s,
- const char *system_id, int file_index));
-static
-struct hash_table_entry *hash_table_lookup P((struct hash_table *table,
- const char *s));
-static
-struct hash_table_entry *hash_table_lookup_subst P((struct hash_table *table,
- const char *subst_table,
- const char *s));
-static
-VOID hash_table_init P((struct hash_table *p));
-static
-VOID hash_table_delete P((struct hash_table *p));
-static
-SIZE_T hash_table_start_index P((struct hash_table *p, const char *s));
-static
-int subst_equal P((const char *subst_table, const char *s1, const char *s2));
-static
-VOID error P((struct parser *parser, enum catalog_error err));
-
-#define param_char(parser, c) \
- ((((parser)->param_length < (parser)->param_alloc) \
- || (param_grow(parser), 1)), \
- ((parser)->param[(parser)->param_length] = (c)), \
- ((parser)->param_length += 1))
-
-#define param_init(parser) ((parser)->param_length = 0)
-#define param_chop(parser) \
- ((parser)->param_length = (parser)->param_length - 1)
-
-const char *catalog_error_text(error_number)
- int error_number;
-{
- static const char *text[] = {
- "Name expected",
- "Literal expected",
- "Missing argument",
- "Only minimum data characters allowed in a public identifier",
- "End of file in comment",
- "End of file in literal",
- "Nul character is not allowed",
- "Cannot open `%s': %s",
- "Error reading `%s': %s",
- "Error closing `%s': %s"
- };
- if (error_number >= 0 && error_number < sizeof(text)/sizeof(text[0]))
- return text[error_number];
- else
- return "(invalid error number)";
-}
-
-
-CATALOG catalog_create(error_handler)
- CATALOG_ERROR_HANDLER error_handler;
-{
- int i;
- struct catalog *p = (struct catalog *)xmalloc(sizeof(struct catalog));
- p->loaded = 0;
- p->n_files = 0;
- p->files = 0;
- p->error_handler = error_handler;
- p->blocks = 0;
- p->block_spare = 0;
- p->block_ptr = 0;
- for (i = 0; i < N_TABLES; i++)
- hash_table_init(p->tables + i);
- return (CATALOG)p;
-}
-
-VOID catalog_delete(cat)
- CATALOG cat;
-{
- int i;
- struct string_block *block;
- struct catalog *catalog = (struct catalog *)cat;
- for (i = 0; i < 4; i++)
- hash_table_delete(catalog->tables + i);
- if (catalog->files)
- free(catalog->files);
- block = catalog->blocks;
- while (block) {
- struct string_block *tem = block;
- block = block->next;
- free((UNIV)tem);
- }
- catalog->blocks = 0;
- free((UNIV)catalog);
-}
-
-VOID catalog_load_file(p, filename)
- CATALOG p;
- const char *filename;
-{
- add_catalog_file((struct catalog *)p, filename, strlen(filename));
-}
-
-int catalog_lookup_entity(cat, public_id, name, decl_type, subst_table,
- system_id, catalog_file)
- CATALOG cat;
- const char *public_id;
- const char *name;
- enum catalog_decl_type decl_type;
- const char *subst_table;
- const char **system_id;
- const char **catalog_file;
-{
- struct catalog *catalog = (struct catalog *)cat;
- const struct hash_table_entry *entry = 0;
- if (!catalog->loaded)
- load(catalog);
- if (public_id)
- entry = hash_table_lookup(catalog->tables + PUBLIC_ID_MAP, public_id);
- if (name
- && decl_type >= 0
- && decl_type < N_DECL_TYPE
- && (!entry || entry->file_index > 0)) {
- const struct hash_table_entry *entity_entry = 0;
- if (!subst_table)
- entity_entry = hash_table_lookup(catalog->tables + decl_type, name);
- else
- entity_entry = hash_table_lookup_subst(catalog->tables + decl_type,
- subst_table, name);
- if (!entry
- || (entity_entry
- && entity_entry->file_index < entry->file_index))
- entry = entity_entry;
- }
- if (!entry)
- return 0;
- *system_id = entry->system_id;
- *catalog_file = catalog->files[entry->file_index];
- return 1;
-}
-
-static
-VOID add_catalog_file(cat, filename, length)
- struct catalog *cat;
- const char *filename;
- SIZE_T length;
-{
- char *s;
- if (!cat->files)
- cat->files = (char **)xmalloc(sizeof(char *));
- else
- cat->files
- = (char **)xrealloc(cat->files, (cat->n_files + 1)*sizeof(char *));
- s = alloc_bytes(cat, length + 1);
- memcpy(s, filename, length);
- s[length] = '\0';
- cat->files[cat->n_files] = s;
- cat->n_files += 1;
-}
-
-static
-VOID load(cat)
- struct catalog *cat;
-{
- int i;
- const char *p;
- struct parser parser;
- const char *env_var;
- int optional_file_index = cat->n_files;
-
- cat->loaded = 1;
- parser.param = 0;
- parser.param_alloc = 0;
- parser.cat = cat;
- for (i = 0; i < 256; i++)
- parser.minimum_data[i] = 0;
- for (p = MINIMUM_DATA_CHARS; *p; p++)
- parser.minimum_data[(unsigned char)*p] = 1;
- env_var = getenv(CATALOG_FILES_ENV_VAR);
- if (!env_var || *env_var == '\0')
- env_var = DEFAULT_CATALOG_FILES;
- for (;;) {
- for (p = env_var; *p && *p != PATH_FILE_SEP; p++)
- ;
- if (p > env_var)
- add_catalog_file(cat, env_var, p - env_var);
- if (!*p)
- break;
- env_var = p + 1;
- }
- for (i = 0; i < cat->n_files; i++) {
- parser.filename = cat->files[i];
- parser.newline_count = 0;
- parser.fp = fopen(cat->files[i], "r");
- if (!parser.fp) {
- if (i < optional_file_index)
- error(&parser, E_CANNOT_OPEN);
- }
- else {
- parser.file_index = i;
- parse_file(&parser);
- errno = 0;
- if (fclose(parser.fp) < 0)
- error(&parser, E_FCLOSE);
- }
- }
- if (parser.param)
- free(parser.param);
-}
-
-static
-VOID parse_file(parser)
- struct parser *parser;
-{
- int skipping = 0;
- for (;;) {
- PARAM_TYPE type = parse_param(parser, NORMAL_LITERAL);
- if (type == NAME_PARAM) {
- if (param_equal(parser, "PUBLIC"))
- parse_public(parser);
- else if (param_equal(parser, "ENTITY"))
- parse_name_map(parser, CATALOG_ENTITY_DECL);
- else if (param_equal(parser, "DOCTYPE"))
- parse_name_map(parser, CATALOG_DOCTYPE_DECL);
- else if (param_equal(parser, "LINKTYPE"))
- parse_name_map(parser, CATALOG_LINKTYPE_DECL);
- else
- skipping = 1;
- }
- else if (type == EOF_PARAM)
- break;
- else if (!skipping) {
- skipping = 1;
- error(parser, E_NAME_EXPECTED);
- }
- }
-}
-
-static
-VOID parse_public(parser)
- struct parser *parser;
-{
- const char *public_id;
-
- if (parse_param(parser, MINIMUM_LITERAL) != LITERAL_PARAM)
- error(parser, E_LITERAL_EXPECTED);
- public_id = param_save(parser);
- if (!parse_arg(parser))
- return;
- hash_table_add(parser->cat->tables + PUBLIC_ID_MAP,
- public_id, param_save(parser), parser->file_index);
-}
-
-static
-VOID parse_name_map(parser, decl_type)
- struct parser *parser;
- int decl_type;
-{
- const char *name;
-
- if (!parse_arg(parser))
- return;
- name = param_save(parser);
- if (!parse_arg(parser))
- return;
- hash_table_add(parser->cat->tables + decl_type,
- name, param_save(parser), parser->file_index);
-}
-
-static
-int parse_arg(parser)
- struct parser *parser;
-{
- PARAM_TYPE parm = parse_param(parser, NORMAL_LITERAL);
- if (parm != NAME_PARAM && parm != LITERAL_PARAM) {
- error(parser, E_ARG_EXPECTED);
- return 0;
- }
- return 1;
-}
-
-static
-PARAM_TYPE parse_param(parser, lit_type)
- struct parser *parser;
- enum literal_type lit_type;
-{
- for (;;) {
- int c = getc(parser->fp);
- switch (c) {
- case EOF:
- if (ferror(parser->fp))
- error(parser, E_GETC);
- return EOF_PARAM;
- case '"':
- case '\'':
- return parse_literal(parser, c, lit_type);
- case '\n':
- parser->newline_count += 1;
- break;
- case '\t':
- case ' ':
- break;
- case '\0':
- error(parser, E_NUL_CHAR);
- break;
- case '-':
- c = getc(parser->fp);
- if (c == '-') {
- skip_comment(parser);
- break;
- }
- ungetc(c, parser->fp);
- c = '-';
- /* fall through */
- default:
- return parse_name(parser, c);
- }
- }
-}
-
-static
-VOID skip_comment(parser)
- struct parser *parser;
-{
- FILE *fp = parser->fp;
- for (;;) {
- int c = getc(fp);
- if (c == '-') {
- c = getc(fp);
- if (c == '-')
- return;
- }
- if (c == EOF) {
- if (ferror(fp))
- error(parser, E_GETC);
- error(parser, E_EOF_COMMENT);
- return;
- }
- if (c == '\n')
- parser->newline_count += 1;
- }
-}
-
-static
-PARAM_TYPE parse_literal(parser, lit, lit_type)
- struct parser *parser;
- int lit;
- enum literal_type lit_type;
-{
- enum { no, yes_begin, yes_middle } skipping = yes_begin;
- FILE *fp = parser->fp;
- param_init(parser);
- for (;;) {
- int c = getc(fp);
- if (c == lit)
- break;
- switch (c) {
- case '\0':
- error(parser, E_NUL_CHAR);
- break;
- case EOF:
- if (ferror(fp))
- error(parser, E_GETC);
- error(parser, E_EOF_LITERAL);
- return LITERAL_PARAM;
- case '\n':
- parser->newline_count += 1;
- /* fall through */
- case ' ':
- if (lit_type == MINIMUM_LITERAL) {
- if (skipping == no) {
- param_char(parser, ' ');
- skipping = yes_middle;
- }
- }
- else
- param_char(parser, c);
- break;
- default:
- if (lit_type == MINIMUM_LITERAL) {
- if (!parser->minimum_data[c])
- error(parser, E_MINIMUM_DATA);
- else {
- skipping = no;
- param_char(parser, c);
- }
- }
- else
- param_char(parser, c);
- break;
- }
- }
- if (skipping == yes_middle)
- param_chop(parser);
- return LITERAL_PARAM;
-}
-
-static
-PARAM_TYPE parse_name(parser, first_char)
- struct parser *parser;
- int first_char;
-{
- FILE *fp = parser->fp;
- param_init(parser);
- param_char(parser, first_char);
- for (;;) {
- int c = getc(fp);
- switch (c) {
- case '\0':
- error(parser, E_NUL_CHAR);
- break;
- case EOF:
- if (ferror(fp))
- error(parser, E_GETC);
- goto done;
- case '\n':
- parser->newline_count += 1;
- goto done;
- case ' ':
- case '\t':
- goto done;
- case '"':
- case '\'':
- ungetc(c, fp);
- goto done;
- default:
- param_char(parser, c);
- }
- }
- done:
- return NAME_PARAM;
-}
-
-static
-VOID param_grow(parser)
- struct parser *parser;
-{
- if (parser->param_alloc == 0) {
- parser->param_alloc = 256;
- parser->param = xmalloc(parser->param_alloc);
- }
- else {
- parser->param_alloc *= 2;
- parser->param = xrealloc(parser->param, parser->param_alloc);
- }
-}
-
-static
-const char *param_save(parser)
- struct parser *parser;
-{
- char *s = alloc_bytes(parser->cat, parser->param_length + 1);
- memcpy(s, parser->param, parser->param_length);
- s[parser->param_length] = '\0';
- return s;
-}
-
-static
-char *alloc_bytes(catalog, n)
- struct catalog *catalog;
- SIZE_T n;
-{
- char *tem;
- if (n > catalog->block_spare) {
- struct string_block *block;
- SIZE_T block_size = n > BLOCK_SIZE ? n : BLOCK_SIZE;
- block
- = (struct string_block *)xmalloc(sizeof(struct string_block)
- + block_size);
- block->next = catalog->blocks;
- catalog->blocks = block;
- catalog->block_ptr = (char *)(block + 1);
- catalog->block_spare = block_size;
- }
- tem = catalog->block_ptr;
- catalog->block_ptr += n;
- catalog->block_spare -= n;
- return tem;
-}
-
-
-/* Return 1 if the current parameter is equal to key. */
-
-static
-int param_equal(parser, key)
- struct parser *parser;
- const char *key;
-{
- const char *param = parser->param;
- SIZE_T param_length = parser->param_length;
- for (; param_length > 0; param++, param_length--, key++) {
- unsigned char c;
- if (*key == '\0')
- return 0;
- c = *param;
- if (islower(c))
- c = toupper(c);
- if (c != (unsigned char)*key)
- return 0;
- }
- return *key == '\0';
-}
-
-/* Return 0 if it was a duplicate. */
-
-static
-int hash_table_add(table, s, system_id, file_index)
- struct hash_table *table;
- const char *s;
- const char *system_id;
- int file_index;
-{
- SIZE_T i;
- struct hash_table_entry *p;
-
- if (table->size > 0) {
- i = hash_table_start_index(table, s);
- while (table->v[i] != 0) {
- if (strcmp(table->v[i]->key, s) == 0)
- return 0;
- if (i == 0)
- i = table->size;
- i--;
- }
- }
- if (table->used >= table->used_limit) {
- SIZE_T j;
- struct hash_table_entry **old_table = table->v;
- SIZE_T old_size = table->size;
- if (old_size == 0) {
- table->size = HASH_TABLE_INITIAL_SIZE;
- table->used_limit = table->size/2;
- }
- else {
- if (old_size > HASH_TABLE_MAX_SIZE/2) {
- if (old_size == HASH_TABLE_MAX_SIZE)
- return 0; /* FIXME: give an error? */
- table->size = HASH_TABLE_MAX_SIZE;
- table->used_limit = HASH_TABLE_MAX_SIZE - 1;
- }
- else {
- table->size = (old_size << 1);
- table->used_limit = table->size/2;
- }
- }
- table->v
- = (struct hash_table_entry **)xmalloc(sizeof(struct hash_table_entry *)
- * table->size);
- for (j = 0; j < table->size; j++)
- table->v[j] = 0;
- for (j = 0; j < old_size; j++)
- if (old_table[j]) {
- SIZE_T k = hash_table_start_index(table, old_table[j]->key);
- while (table->v[k] != 0) {
- if (k == 0)
- k = table->size;
- k--;
- }
- table->v[k] = old_table[j];
- }
- if (old_table)
- free((UNIV)old_table);
- i = hash_table_start_index(table, s);
- while (table->v[i] != 0) {
- if (i == 0)
- i = table->size;
- i--;
- }
- }
- p = (struct hash_table_entry *)xmalloc(sizeof(struct hash_table_entry));
- p->key = s;
- p->system_id = system_id;
- p->file_index = file_index;
- table->v[i] = p;
- table->used += 1;
- return 1;
-}
-
-static
-struct hash_table_entry *hash_table_lookup(table, s)
- struct hash_table *table;
- const char *s;
-{
- if (table->size > 0) {
- SIZE_T i;
- i = hash_table_start_index(table, s);
- while (table->v[i] != 0) {
- if (strcmp(table->v[i]->key, s) == 0)
- return table->v[i];
- if (i == 0)
- i = table->size;
- i--;
- }
- }
- return 0;
-}
-
-static
-struct hash_table_entry *hash_table_lookup_subst(table, subst_table, s)
- struct hash_table *table;
- const char *subst_table;
- const char *s;
-{
- SIZE_T i;
- for (i = 0; i < table->size; i++) {
- struct hash_table_entry *p = table->v[i];
- if (p && subst_equal(subst_table, s, p->key))
- return p;
- }
- return 0;
-}
-
-static
-VOID hash_table_init(p)
- struct hash_table *p;
-{
- p->v = 0;
- p->size = 0;
- p->used = 0;
- p->used_limit = 0;
-}
-
-static
-VOID hash_table_delete(p)
- struct hash_table *p;
-{
- if (p->v) {
- SIZE_T i;
- for (i = 0; i < p->size; i++)
- if (p->v[i])
- free(p->v[i]);
- free(p->v);
- }
-}
-
-static
-SIZE_T hash_table_start_index(p, s)
- struct hash_table *p;
- const char *s;
-{
- unsigned long h = 0;
- while (*s)
- h = (h << 5) + h + (unsigned char)*s++;
- return (h & (p->size - 1));
-}
-
-/* s1 has already been substituted; s2 has not */
-
-static
-int subst_equal(subst_table, s1, s2)
- const char *subst_table;
- const char *s1;
- const char *s2;
-{
- for (; *s1 == subst_table[(unsigned char)*s2]; s1++, s2++)
- if (*s1 == '\0')
- return 1;
- return 0;
-}
-
-static
-VOID error(parser, err)
- struct parser *parser;
- enum catalog_error err;
-{
- (*parser->cat->error_handler)(parser->filename,
- parser->newline_count + 1,
- err,
- (err >= FIRST_SYSTEM_ERROR
- ? CATALOG_SYSTEM_ERROR
- : 0),
- (err >= FIRST_SYSTEM_ERROR
- ? errno
- : 0));
-}
-
-#ifdef MAIN
-
-static const char *program_name;
-
-#include "getopt.h"
-
-static VOID usage P((void));
-static VOID out_of_memory P((void));
-static VOID handle_catalog_error P((const char *filename,
- unsigned long lineno,
- int error_number,
- unsigned flags,
- int sys_errno));
-
-int main(argc, argv)
- int argc;
- char **argv;
-{
- int entity_flag = 0;
- enum catalog_decl_type entity_type = CATALOG_NO_DECL;
- char *public_id = 0;
- char *name = 0;
- int exit_status;
- int opt;
- CATALOG catalog;
- int i;
- const char *file;
- const char *system_id;
-
- program_name = argv[0];
-
- while ((opt = getopt(argc, argv, "edl")) != -1)
- switch (opt) {
- case 'e':
- entity_flag = 1;
- entity_type = CATALOG_ENTITY_DECL;
- break;
- case 'd':
- entity_flag = 1;
- entity_type = CATALOG_DOCTYPE_DECL;
- break;
- case 'l':
- entity_flag = 1;
- entity_type = CATALOG_LINKTYPE_DECL;
- break;
- case '?':
- usage();
- }
- if (argc - optind < 2)
- usage();
- if (entity_flag)
- name = argv[optind];
- else
- public_id = argv[optind];
-
- catalog = catalog_create(handle_catalog_error);
- for (i = optind + 1; i < argc; i++)
- catalog_load_file(catalog, argv[i]);
- if (catalog_lookup_entity(catalog, public_id, name, entity_type, (char *)0,
- &system_id, &file)) {
- exit_status = 0;
- fprintf(stderr, "%s (%s)\n", system_id, file);
- }
- else {
- fprintf(stderr, "not found\n");
- exit_status = 1;
- }
- catalog_delete(catalog);
- return exit_status;
-}
-
-static
-VOID usage()
-{
- fprintf(stderr, "usage: %s [-e] [-d] [-l] id file ...\n",
- program_name);
- exit(1);
-}
-
-static
-VOID handle_catalog_error(filename, lineno, error_number, flags, sys_errno)
- const char *filename;
- unsigned long lineno;
- int error_number;
- unsigned flags;
- int sys_errno;
-{
- fprintf(stderr, "%s:", program_name);
- if (flags & CATALOG_SYSTEM_ERROR) {
- putc(' ', stderr);
- fprintf(stderr, catalog_error_text(error_number), filename);
- putc('\n', stderr);
- }
- else
- fprintf(stderr, "%s:%lu: %s\n", filename, lineno,
- catalog_error_text(error_number));
- fflush(stderr);
-}
-
-UNIV xmalloc(n)
- SIZE_T n;
-{
- UNIV p = malloc(n);
- if (!p)
- out_of_memory();
- return p;
-}
-
-UNIV xrealloc(p, n)
- UNIV p;
- SIZE_T n;
-{
- p = realloc(p, n);
- if (!p)
- out_of_memory();
- return p;
-}
-
-static
-VOID out_of_memory()
-{
- fprintf(stderr, "%s: out of memory\n", program_name);
- exit(1);
-}
-
-#endif /* MAIN */
diff --git a/usr.bin/sgmls/sgmls/catalog.h b/usr.bin/sgmls/sgmls/catalog.h
deleted file mode 100644
index b9509a5..0000000
--- a/usr.bin/sgmls/sgmls/catalog.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef CATALOG_H
-#define CATALOG_H 1
-
-enum catalog_decl_type {
- CATALOG_NO_DECL = -1,
- CATALOG_ENTITY_DECL,
- CATALOG_DOCTYPE_DECL,
- CATALOG_LINKTYPE_DECL
-};
-
-#define CATALOG_SYSTEM_ERROR 1
-
-#ifdef __STDC__
-
-typedef void *CATALOG;
-typedef void (*CATALOG_ERROR_HANDLER)(const char *filename,
- unsigned long lineno,
- int error_number,
- unsigned flags,
- int sys_errno);
-CATALOG catalog_create(CATALOG_ERROR_HANDLER);
-void catalog_load_file(CATALOG, const char *);
-void catalog_delete(CATALOG);
-int catalog_lookup_entity(CATALOG,
- const char *public_id,
- const char *name,
- enum catalog_decl_type,
- const char *subst_table,
- const char **system_id,
- const char **catalog_file);
-const char *catalog_error_text(int error_number);
-
-#else /* not __STDC__ */
-
-typedef char *CATALOG;
-typedef void (*CATALOG_ERROR_HANDLER)();
-CATALOG catalog_create();
-void catalog_load_file();
-void catalog_delete();
-int catalog_lookup_entity();
-char *catalog_error_text();
-
-#endif /* not __STDC__ */
-
-#endif /* not CATALOG_H */
diff --git a/usr.bin/sgmls/sgmls/config.h b/usr.bin/sgmls/sgmls/config.h
deleted file mode 100644
index a7fa92c..0000000
--- a/usr.bin/sgmls/sgmls/config.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* unix.cfg: Configuration file for sgmls on Unix. */
-
-/* A list of filename templates to use for searching for external entities.
-The filenames are separated by the character specified in PATH_FILE_SEP.
-See sgmls.man for details. */
-#define DEFAULT_PATH "/usr/share/sgml/%O/%C/%T:%N.%X:%N.%D"
-/* The character that separates the filenames templates. */
-#define PATH_FILE_SEP ':'
-/* The character that separates filenames in a system identifier.
-Usually the same as PATH_FILE_SEP. */
-#define SYSID_FILE_SEP ':'
-/* The environment variable that contains the list of filename templates. */
-#define PATH_ENV_VAR "SGML_PATH"
-/* A macro that returns non-zero if the filename is relative to the
- current directory. */
-#define FILE_IS_RELATIVE(p) ((p)[0] != '/')
-/* A string containing the characters that can separate the directory
- part of a filename from the basename. */
-#define DIR_BASE_SEP "/"
-/* The environment variable that contains the list of catalog entry files.
- Filenames are separated by PATH_FILE_SEP. */
-#define CATALOG_FILES_ENV_VAR "SGML_CATALOG_FILES"
-/* Default list of catalog entry files. */
-#define DEFAULT_CATALOG_FILES "CATALOG:/usr/share/sgml/CATALOG"
-
-/* MIN_DAT_SUBS_FROM and MIN_DATS_SUBS_TO tell sgmls how to transform a name
-or system identifier into a legal filename. A character in
-MIN_DAT_SUBS_FROM will be transformed into the character in the
-corresponding position in MIN_DAT_SUBS_TO. If there is no such
-position, then the character is removed. */
-/* This says that spaces should be transformed to underscores, and
-slashes to percents. */
-#define MIN_DAT_SUBS_FROM " /"
-#define MIN_DAT_SUBS_TO "_%"
-
-/* Define this to allow tracing. */
-/* #define TRACE 1 */
-
-/* Define this you want support for subdocuments. This is implemented
-using features that are not part of Standard C, so you might not want
-to define it if you are porting to a new system. Otherwise I suggest
-you leave it defined. */
-#define SUPPORT_SUBDOC 1
-
-/* Define HAVE_EXTENDED_PRINTF if your *printf functions supports
-X/Open extensions; if they do, then, for example,
-
- printf("%2$s%1$s", "bar", "foo")
-
-should print `foobar'. */
-
-/* #define HAVE_EXTENDED_PRINTF 1 */
-
-/* Define HAVE_CAT if your system provides the X/Open message
-catalogue functions catopen() and catgets(), and you want to use them.
-An implementations of these functions is included and will be used if
-you don't define this. On SunOS 4.1.1, if you do define this you
-should set CC=/usr/xpg2bin/cc in the makefile. */
-
-#define HAVE_CAT 1
-
-#ifdef __STDC__
-/* Define this if your compiler supports prototypes. */
-#define USE_PROTOTYPES 1
-#endif
-
-/* Can't use <stdarg.h> without prototypes. */
-#ifndef USE_PROTOTYPES
-#define VARARGS 1
-#endif
-
-/* If your compiler defines __STDC__ but doesn't provide <stdarg.h>,
-you must define VARARGS yourself here. */
-/* #define VARARGS 1 */
-
-/* Define this if you do not have strerror(). */
-/* #define STRERROR_MISSING 1 */
-
-/* Define this unless the character testing functions in ctype.h
-are defined for all values representable as an unsigned char. You do
-not need to define this if your system is ANSI C conformant. You
-should define for old Unix systems. */
-/* #define USE_ISASCII 1 */
-
-/* Define this if your system provides the BSD style string operations
-rather than ANSI C ones (eg bcopy() rather than memcpy(), and index()
-rather than strchr()). */
-/* #define BSD_STRINGS 1 */
-
-/* Define this if you have getopt(). */
-#define HAVE_GETOPT 1
-
-/* Define this if you have access(). */
-#define HAVE_ACCESS 1
-
-/* Define this if you have <unistd.h>. */
-#define HAVE_UNISTD_H 1
-
-/* Define this if you have <sys/stat.h>. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define this if you have waitpid(). */
-#define HAVE_WAITPID 1
-
-/* Define this if your system is POSIX.1 (ISO 9945-1:1990) compliant. */
-#define POSIX 1
-
-/* Define this if you have the vfork() system call. */
-#define HAVE_VFORK 1
-
-/* Define this if you have <vfork.h>. */
-/* #define HAVE_VFORK_H 1 */
-
-/* Define this if you don't have <stdlib.h> */
-/* #define STDLIB_H_MISSING 1 */
-
-/* Define this if you don't have <stddef.h> */
-/* #define STDDEF_H_MISSING 1 */
-
-/* Define this if you don't have <limits.h> */
-/* #define LIMITS_H_MISSING 1 */
-
-/* Define this if you don't have remove(); unlink() will be used instead. */
-/* #define REMOVE_MISSING 1 */
-
-/* Define this if you don't have raise(); kill() will be used instead. */
-/* #define RAISE_MISSING 1 */
-
-/* Define this if you don't have fsetpos() and fgetpos(). */
-/* #define FPOS_MISSING 1 */
-
-/* Universal pointer type. */
-/* If your compiler doesn't fully support void *, change `void' to `char'. */
-typedef void *UNIV;
-
-/* If your compiler doesn't support void as a function return type,
-change `void' to `int'. */
-typedef void VOID;
-
-/* If you don't have an ANSI C conformant <limits.h>, define
-CHAR_SIGNED as 1 or 0 according to whether the `char' type is signed.
-The <limits.h> on some versions of System Release V 3.2 is not ANSI C
-conformant: the value of CHAR_MIN is 0 even though the `char' type is
-signed. */
-
-/* #define CHAR_SIGNED 1 */
-/* #define CHAR_SIGNED 0 */
-#ifndef CHAR_SIGNED
-#include <limits.h>
-#if CHAR_MIN < 0
-#define CHAR_SIGNED 1
-#else
-#define CHAR_SIGNED 0
-#endif
-#endif /* not CHAR_SIGNED */
-
-/* Assume the system character set is ISO Latin-1. */
-#include "latin1.h"
diff --git a/usr.bin/sgmls/sgmls/context.c b/usr.bin/sgmls/sgmls/context.c
deleted file mode 100644
index 10a123a..0000000
--- a/usr.bin/sgmls/sgmls/context.c
+++ /dev/null
@@ -1,451 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-#include "context.h"
-
-#define GI (tags[ts].tetd->etdgi+1) /* GI of current element. */
-#define NEWGI (newetd->etdgi+1) /* GI of new tag. */
-#define STATUS (*statuspt) /* Token status: RCHIT RCMISS RCEND RCREQ RCNREQ*/
-#define PEX (-1) /* GI is a plus exception and not a minus. */
-
-#define ANYHIT(h) (grplongs == 1 ? ((h)[0] != 0) : anyhit(h))
-#define HITSET(h, n) (h[(unsigned)(n-1)>>LONGPOW] \
- |= (1L<<((n-1)&(LONGBITS-1))))
-#define HITON(h, n) (h[(unsigned)(n-1)>>LONGPOW] & (1L<<((n-1)&(LONGBITS-1))))
-
-#define HITOFF(h, n) (!(HITON(h, n)))
-
-#define TOKENHIT HITON(H,T)
-
-static
-VOID copypos(to, from)
-struct mpos *to, *from;
-{
- int i;
- for (i = 0; i <= (int)from[0].t; i++) {
- to[i].g = from[i].g;
- to[i].t = from[i].t;
- memcpy(to[i].h, from[i].h, grplongs*sizeof(unsigned long));
- }
-}
-
-/* CONTEXT: Determine whether a GI is valid in the present structural context.
- Returns RCHIT if valid, RCEND if element has ended, RCREQ if a
- different element is required, and RCMISS if it is totally invalid.
- On entry, pos points to the model token to be tested against the GI.
- TO DO: Save allowed GIs for an error message on an RCMISS.
- Support a "query" mode (what is allowed now?) by working
- with a copy of pos.
-*/
-int context(gi, mod, pos, statuspt, mexts)
-struct etd *gi; /* ETD of new GI. */
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-UNCH *statuspt; /* Token status: RCHIT RCMISS RCEND RCREQ RCNREQ*/
-int mexts; /* >0=stack level of minus grp; -1=plus; 0=none.*/
-{
- UNCH toccsv, gtypesv; /* Save token's TOCC and GTYPE in case grp ends.*/
-
- if (mexts != 0) {
- if (mexts == -1 && STATUS == RCEND)
- return RCPEX;
- copypos(savedpos, pos);
- }
- Tstart = T; /* Save starting token for AND group testing. */
- while (STATUS!=RCMISS && STATUS!=RCEND) {
- TRACEGI("CONTEXT", gi, mod, pos);
- while (TTYPE==TTOR || TTYPE==TTSEQ || TTYPE==TTAND) {
- pos[P+1].g = M++; pos[++P].t = 1; HITCLEAR(H);
- Tstart = T; /* Save starting token for AND group testing. */
- TRACEGI("OPENGRP", gi, mod, pos);
- }
- STATUS = (UNCH)tokenreq(gi, mod, pos);
- TRACEGI("STATUS", gi, mod, pos);
- if (gi==TOKEN.tu.thetd) { /* Hit in model. */
- STATUS = (UNCH)RCHIT;
- gtypesv = GTYPE; toccsv = TOCC;
- newtoken(mod, pos, statuspt);
- if (mexts <= 0)
- return RCHIT;
- else if (gtypesv==TTOR || BITON(toccsv, TOPT)) {
- /* restore position */
- copypos(pos, savedpos);
- return RCMEX;
- }
- else
- return RCHITMEX;
- }
- if (STATUS==RCREQ) {
- if (mexts == -1)
- break;
- STATUS = RCHIT;
- nextetd = TOKEN.tu.thetd;
- newtoken(mod, pos, statuspt);
- return(RCREQ);
- }
- /* else if (STATUS==RCNREQ) */
- if (mexts>0) return(RCMEX);
- newtoken(mod, pos, statuspt);
- }
- if (mexts == -1) {
- copypos(pos, savedpos);
- return STATUS = RCPEX;
- }
- return((int)STATUS);
-}
-/* ECONTEXT: Determine whether the current element can be ended, or whether
- non-optional tokens remain at the current level or higher.
- Returns 1 if element can be ended, or 0 if tokens remain.
- On entry, STATUS==RCEND if there are no tokens left; if not,
- pos points to the next model token to be tested.
- TO DO: Support a "query" mode (what is required now?) by working
- with a copy of pos.
-*/
-int econtext(mod, pos, statuspt)
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-UNCH *statuspt; /* Token status: RCHIT RCMISS RCEND RCREQ RCNREQ*/
-{
- unsigned next; /* Position in AND group of next testable token.*/
-
- Tstart = T;
- TRACEEND("ECONT", mod, pos, 0, 0);
- if (P<=1) {nextetd = 0; return(TOKENHIT || BITON(TOCC, TOPT));}
- nextetd = TTYPE == TTETD ? TOKEN.tu.thetd : 0;
- while (STATUS!=RCMISS && STATUS!=RCEND) {
- STATUS = (UNCH)testend(mod, pos, 0, 0);
- TRACEEND("ECONTEND", mod, pos, 0, 0);
- nextetd = P<=1 || TTYPE != TTETD ? 0 : TOKEN.tu.thetd;
- if (STATUS==RCEND) return(1);
- if (P<=1) return(TOKENHIT || BITON(TOCC, TOPT));
- if (STATUS==RCMISS) {
- if (BITON(TOCC, TOPT)) nextetd = 0;
- return(0);
- }
- if (!tokenopt(mod, pos)) return(0);
-
- STATUS = RCNREQ;
- if (GTYPE!=TTAND) ++T; /* T!=GNUM or group would have ended. */
- else T = (UNCH)(((next = (UNS)offbit(H, (int)T, GNUM))!=0) ?
- next : offbit(H, 0, GNUM));
-
- M = G + grpsz(&GHDR, (int)T-1) + 1;
- TRACEEND("ECONTNEW", mod, pos, 0, 0);
- }
- if (STATUS==RCMISS) {
- if (BITON(TOCC, TOPT)) nextetd = 0;
- return(0);
- }
- return(1); /* STATUS==RCEND */
-}
-/* NEWTOKEN: Find the next token to test. Set STATUS to indicate results:
- RCEND if element has ended (no more tokens to test);
- RCREQ if required new token was found;
- RCNREQ if non-required new token was found;
- RCHIT if a hit token was repeated (now non-required);
- and RCMISS if a new token can't be found because current token
- (which was not hit) was neither unconditionally required nor
- optional.
-*/
-VOID newtoken(mod, pos, statuspt)
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-UNCH *statuspt; /* Token status: RCHIT RCMISS RCEND RCREQ RCNREQ*/
-{
- unsigned nextand = 0; /* Position in AND group of next testable token.*/
- int currhit = (STATUS==RCHIT); /* 1=current GI hit; 0=not. */
-
- /* If the GI was a hit, turn on the hit bit and set the status to
- assume that the token to be tested against the next GI will
- be non-required. If the current token is repeatable, exit so
- it will stand as the next token to test.
- */
- if (STATUS==RCHIT) {
- HITSET(H, T);
- STATUS = RCNREQ;
- if (BITON(TOCC, TREP)) return;
- }
- /* At this point, we must determine the next token to test:
- either against the next GI, if this one was a hit, or
- against the same GI if conditions permit a retry.
- To find the next token, we must first end the current group,
- if possible, and any we can that contain it.
- If the outermost group was a hit and is repeatable, or
- if the element has ended, we exit now.
- If it hasn't ended, or was optional and ended with a miss,
- we can retry the GI against the next token.
- */
- if ((STATUS = (UNCH)testend(mod, pos, 1, 1))!=RCNREQ) return;
-
- /* At this point, the "current token" is either the original one,
- or the token for the highest level unhit group that it ended.
- We will retry a missed GI, by testing it against the next
- token, if the current token:
- 1. Is optional;
- 2. Was hit (i.e., because it is repeatable and was hit by a
- previous GI or because it is a hit group that just ended);
- 3. Is in an AND or OR group and is not the last testable token.
-
- It will be the next sequential one (unhit one, in an AND group);
- if there are none left, use the first unhit token in the group.
- In either case, set M to correspond to the new T.
- */
- retest:
- TRACEEND("RETEST", mod, pos, (int)nextand, 1);
- if (GTYPE==TTAND) {
- nextand = offbit(H, (int)T, GNUM);
- if (!nextand)
- nextand = offbit(H, 0, GNUM);
- }
- if ( BITON(TOCC, TOPT)
- || TOKENHIT
- || GTYPE==TTOR /* T!=GNUM or group would have ended. */
- || nextand ) {
- if (GTYPE!=TTAND) ++T; /* T!=GNUM or group would have ended. */
- else T = nextand;
- M = G + grpsz(&GHDR, (int)T-1) + 1;
- if (GTYPE==TTAND) {
- /* If AND group wrapped, it can end if all non-optionals were
- hit. */
- if (T==Tstart && !currhit) {
- UNCH Psave = P;
- int rc = testend(mod, pos, 0, 1);
- if (Psave!=P) {if ((STATUS = (UNCH)rc)==RCNREQ) goto retest;}
- else STATUS = RCMISS;
- }
-
- /* We only test unhit tokens, so we must use an unhit token
- as Tstart (which is used to detect when the AND group has
- wrapped). */
- else if (HITON(H,Tstart)) Tstart = T;
- }
- }
- else STATUS = RCMISS;
- TRACEEND("NEWTOKEN", mod, pos, (int)nextand, 1);
-}
-/* TESTEND: End the current group, if possible, and any that it is nested in.
- The current token will either be a group header, or some token
- that could not end its group. Return 1 if the (possibly new)
- current token is repeatable; 0 if it is not.
-*/
-int testend(mod, pos, andoptsw, newtknsw)
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-int andoptsw; /* 1=test optional AND members; 0=ignore. */
-int newtknsw; /* 1=new token test; 0=end element test. */
-{
- int rc = 0; /* Return code: RCNREQ RCHIT RCMISS RCEND */
-
- while (!rc) {
- TRACEEND("TRACEEND", mod, pos, rc, andoptsw);
- /* TESTMISS:
- If we've hit no tokens yet in the current group, and
- the current token is the last unhit one in the group we can test,
- we will end the group (it may never really have started!)
- because we might be able to try the token that follows it.
- In any group, a token is the last testable unhit token if it
- is the last sequential one, as the GI was already tested against
- the preceding unhit tokens. In addition,
- in a SEQ group, it is the last testable unhit token if it isn't
- optional, because we can't skip past it to the following ones.
- If we end the group, before popping the level, set M to G, as this
- level`s group header will be the next level's current token.
- */
- if (!ANYHIT(H) && (T==GNUM
- || (GTYPE==TTSEQ && BITOFF(TOCC, TOPT)))) {
- M = G; --P;
- if (P<=1) {
- if (BITON(TOCC, TOPT) || TOKENHIT) rc = RCEND;
- else rc = RCMISS;
- }
- continue;
- }
- /* TESTHIT:
- See if we've hit all the non-optional tokens in the group.
- If so, pop to the previous level and set the group's hit bit.
- If we were called from NEWTOKEN we are trying to find the token
- to test against the next start-tag, so if the group is repeatable,
- process it again. (If not, we were called from ECONTEXT and
- are testing whether the element can be ended.)
- Otherwise, if we are at the first level, the element is over.
- */
- if ((GTYPE==TTOR && TOKENHIT)
- || (GTYPE==TTSEQ && T==(UNCH)GNUM
- && (TOKENHIT || BITON(TOCC, TOPT)))
- || (GTYPE==TTAND && allhit(&GHDR, H, 0, andoptsw))) {
- M = G;
- --P;
- HITSET(H, T);
- Tstart = T;
- if (newtknsw && BITON(TOCC, TREP)) rc = RCHIT;
- else if (P<=1) rc = RCEND;
- /* If we are looking for a new token to test against the next
- start-tag, then we need to consider optional and members
- in this group, even if we didn't need to consider them
- in the group that we just ended because that group had
- wrapped. */
- else if (newtknsw) andoptsw = 1;
- /* Else loop to test new outer group. */
- }
- else rc = RCNREQ; /* No group ended this time, so return. */
- }
- TRACEEND("ENDFOUND", mod, pos, rc, andoptsw);
- return(rc);
-}
-/* TOKENOPT: Return 1 if current token is contextually optional;
- otherwise, return 0.
-*/
-int tokenopt(mod, pos)
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-{
- TRACEEND("TOKENOPT", mod, pos, 0, 0);
- return (BITON(TOCC, TOPT) /* Inherently optional. */
- || TOKENHIT /* Was hit (handles "plus" suffix case). */
- || (!ANYHIT(H) && groupopt(mod, pos)));
- /* In optional group with no hits. */
-}
-/* GROUPOPT: Temporarily makes the current group be the current token so that
- TOKENOPT() can be applied to it. Returns the value returned
- by TOKENOPT.
-*/
-int groupopt(mod, pos)
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-{
- UNCH saveM; /* Save M when testing if group is not required.*/
- int rc; /* 1=contextually optional; 0=not. */
-
- if (P==1) return(BITON(GOCC, TOPT) || TOKENHIT);
- saveM = M; M = G; --P;
- rc = tokenopt(mod, pos);
- ++P; G = M; M = saveM;
- return(rc);
-}
-/* TOKENREQ: Returns RCREQ if the current token is "contextually required".
- That is, it is not contextually optional and
- 1) it is a member of a "seq" group that is either required
- or has at least 1 hit token.
- 2) it is a member of an "and" group in which all other
- tokens were hit.
- Optional tokens are not counted
- if GI is ETDCDATA, as we are looking for an
- omitted start-tag. Otherwise, they are counted,
- as the GI might match one of them.
- Returns RCNREQ if the current token is "not required".
-*/
-int tokenreq(gi, mod, pos)
-struct etd *gi; /* ETD of new GI. */
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-{
- TRACEGI("TOKENREQ", gi, mod, pos);
- return( tokenopt(mod, pos) ? RCNREQ
- : ( GTYPE==TTSEQ && (ANYHIT(H) || groupreq(gi, mod, pos)==RCREQ)
-#if 0
- || (GTYPE==TTAND && allhit(&GHDR, H, T, \*gi!=ETDCDATA*\ 1))
-#endif
- )
- ? RCREQ : RCNREQ );
-}
-/* GROUPREQ: Temporarily makes the current group be the current token so that
- TOKENREQ() can be applied to it. Returns the value returned
- by TOKENREQ.
-*/
-int groupreq(gi, mod, pos)
-struct etd *gi; /* ETD of new GI. */
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-{
- UNCH saveM; /* Save M when testing if group is not required.*/
- int rc; /* Return code: RCREQ RCNREQ */
-
- if (P==1) return(BITOFF(GOCC, TOPT) ? RCREQ : RCNREQ);
- saveM = M; M = G; --P;
- rc = tokenreq(gi, mod, pos);
- ++P; G = M; M = saveM;
- return(rc);
-}
-/* GRPSZ: Returns the number of tokens spanned by a group in the model (M),
- from the group's start (G) to a specified index within the group (T).
- M = 0, plus 1 for each token in the group, plus the size of
- any subgroups (gotten by calling GRPSZ recursively). On entry,
- M must be equal to G at the current level.
-*/
-int grpsz(g, t)
-struct thdr *g; /* mod[G]: Ptr to group in the model. */
-int t; /* T: Index of last token in the group. */
-{
- struct thdr *p = g; /* Ptr to current token in the model. */
- int m = 0; /* Size of group (including nested groups). */
- int i = 0; /* Number of group members (loop counter). */
- UNS type; /* Token type (without TOREP bits). */
-
- while (++i<=t) {
- ++p; ++m;
- type = GET(p->ttype, TTMASK);
- if (type==TTOR || type==TTSEQ || type==TTAND) {
- m += grpsz(p, p->tu.tnum);
- p = g+m;
- }
- }
- return(m);
-}
-/* ALLHIT: Returns 1 if all hit bits for the specified group are turned on,
- (other than those that correspond to optional tokens if "opt" is
- 0) and the "but" bit (all bits if "but" bit is zero). Otherwise,
- returns 0. GRPSZ is used to skip past subgroup tokens.
-*/
-int allhit(p, hits, but, opt)
-struct thdr *p; /* mod[G]: Ptr to group in the model. */
-unsigned long *hits; /* H: Hit bits to be tested. */
-int but; /* Index of bit to ignore; 0=test all. */
-int opt; /* 1=optional tokens must be hit; 0=ignore. */
-{
- int b = 0; /* Index of bit being tested in hits. */
- int e = p->tu.tnum; /* Ending index (number of bits to test). */
- unsigned type; /* Token type (without TOREP bits). */
-
- while (++p, ++b<=e) {
- if (HITOFF(hits,b) && (opt || BITOFF(p->ttype,TOPT)) && b!=but)
- return 0;
- if ((type = GET(p->ttype,TTMASK))==TTOR || type==TTSEQ || type==TTAND)
- p += grpsz(p, p->tu.tnum);
- }
- return 1;
-}
-/* OFFBIT: Returns the index of the first unset bit after (i.e., not including)
- the caller's "first" bit. If all bits through the
- specified last bit are on, it returns 0.
-*/
-int offbit(bits, first, last)
-unsigned long *bits; /* Bits to be tested. */
-int first; /* Index of first bit to be tested in bits. */
-int last; /* Index of last bit to be tested in bits. */
-{
- while (++first <= last)
- if (HITOFF(bits, first))
- return first;
- return 0;
-}
-
-/* ANYHIT: Return 1 if any bit is set. */
-
-int anyhit(bits)
-unsigned long *bits;
-{
- int i;
- for (i = 0; i < grplongs; i++)
- if (bits[i] != 0)
- return 1;
- return 0;
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/context.h b/usr.bin/sgmls/sgmls/context.h
deleted file mode 100644
index 01f4383..0000000
--- a/usr.bin/sgmls/sgmls/context.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* context.h */
-
-#define M pos[0].g /* Index of current token in model. */
-#ifdef P
-#undef P
-#endif
-#define P pos[0].t /* Index of current group in pos. */
-#define G pos[P].g /* Index of current group in model. */
-#define T pos[P].t /* Index of current token in its group. */
-#define Tstart pos[P].tstart /* Index of starting token in its group
- for AND group testing. */
-#define H pos[P].h /* Pointer to hit bits for current group. */
-#define GHDR mod[G] /* Current group header. */
-#define TOKEN mod[M] /* Current token. */
-#define TTYPE (GET(TOKEN.ttype, TTMASK)) /* Token type of current token. */
-#define TOCC (GET(TOKEN.ttype, TOREP)) /* Occurrence for current token. */
-#define GTYPE (GET(GHDR.ttype, TTMASK)) /* Token type of current group. */
-#define GOCC (GET(GHDR.ttype, TOREP)) /* Occurrence for current group. */
-#define GNUM GHDR.tu.tnum /* Number of tokens in current grp. */
diff --git a/usr.bin/sgmls/sgmls/dosproc.c b/usr.bin/sgmls/sgmls/dosproc.c
deleted file mode 100644
index 99b526d..0000000
--- a/usr.bin/sgmls/sgmls/dosproc.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* dosproc.c -
-
- MS-DOS implementation of run_process().
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-
-#ifdef SUPPORT_SUBDOC
-
-#include "std.h"
-#include "entity.h"
-#include "appl.h"
-
-#include <process.h>
-
-int run_process(argv)
-char **argv;
-{
- int ret;
- fflush(stdout);
- fflush(stderr);
- ret = spawnvp(P_WAIT, argv[0], argv);
- if (ret < 0)
- appl_error(E_EXEC, argv[0], strerror(errno));
- return ret;
-}
-
-#endif /* SUPPORT_SUBDOC */
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/ebcdic.c b/usr.bin/sgmls/sgmls/ebcdic.c
deleted file mode 100644
index b8188c7..0000000
--- a/usr.bin/sgmls/sgmls/ebcdic.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ASCII to EBCDIC (ISO 8859-1 to IBM CP 37v2) table. */
-/* Contributed by C. M. Sperberg-McQueen <u35395@uicvm.uic.edu>. */
-
-/* The mapping must be 1 to 1. The positions of *CHAR and *CH in the table
-must not be changed, although the values in ebcdic.h can be. */
-
-#include "ebcdic.h"
-
-unsigned char charset[] = {
- 0, 1, 2, 3, 55, 45, 46, 47,
- GENRECHAR, TABCHAR, RSCHAR, 11, 12, RECHAR, 14, 15,
- 16, 17, 18, 19, 60, 61, 50, 38,
- 24, 25, EOFCHAR, 39, EOBCHAR, DELCDATA, DELSDATA, DELNONCH,
- SPCCHAR, 90, 127, 123, 91, 108, 80, 125,
- 77, 93, 92, 78, 107, 96, 75, 97,
-240, 241, 242, 243, 244, 245, 246, 247,
-248, 249, 122, 94, 76, 126, 110, 111,
-124, 193, 194, 195, 196, 197, 198, 199,
-200, 201, 209, 210, 211, 212, 213, 214,
-215, 216, 217, 226, 227, 228, 229, 230,
-231, 232, 233, 173, 224, 189, 176, 109,
-121, 129, 130, 131, 132, 133, 134, 135,
-136, 137, 145, 146, 147, 148, 149, 150,
-151, 152, 153, 162, 163, 164, 165, 166,
-167, 168, 169, 192, 79, 208, 161, 7,
- 4, 6, 8, 9, 10, 20, 21, 23,
- 26, 27, 32, 33, 34, 35, 36, 40,
- 41, 42, 43, 44, 48, 49, 51, 52,
- 53, 54, 56, 57, 58, 59, 62, 255,
- 65, 170, 74, 177, 159, 178, 106, 181,
-187, 180, 154, 138, 95, 202, 175, 188,
-144, 143, 234, 250, 190, 160, 182, 179,
-157, 218, 155, 139, 183, 184, 185, 171,
-100, 101, 98, 102, 99, 103, 158, 104,
-116, 113, 114, 115, 120, 117, 118, 119,
-172, 105, 237, 238, 235, 239, 236, 191,
-128, 253, 254, 251, 252, 186, 174, 89,
- 68, 69, 66, 70, 67, 71, 156, 72,
- 84, 81, 82, 83, 88, 85, 86, 87,
-140, 73, 205, 206, 203, 207, 204, 225,
-112, 221, 222, 219, 220, 141, 142, 223,
-};
diff --git a/usr.bin/sgmls/sgmls/ebcdic.h b/usr.bin/sgmls/sgmls/ebcdic.h
deleted file mode 100644
index 3e0f3bd..0000000
--- a/usr.bin/sgmls/sgmls/ebcdic.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SGML Character Use: EBCDIC
-*/
-
-#define EOFCHAR '\077' /* FUNCTION: EE (entity end: files). */
-#define EOBCHAR '\034' /* NONCHAR: EOB (file entity: end of buffer. */
-#define RSCHAR '\045' /* FUNCTION: RS (record start). */
-#define RECHAR '\015' /* FUNCTION: RE (record end). */
-#define TABCHAR '\005' /* FUNCTION: TAB (horizontal tab). */
-#define SPCCHAR '\100' /* FUNCTION: SPACE (horizontal space). */
-#define GENRECHAR '\026' /* NONCHAR: Generated RE. */
-#define DELCDATA '\035' /* NONCHAR: Delimiter for CDATA entity in
- attribute value. */
-#define DELSDATA '\036' /* NONCHAR: Delimiter for SDATA entity in
- attribute value. */
-#define DELNONCH '\037' /* NONCHAR: non-SGML character prefix. */
-
-/* This should work for EBCDIC. See comment in latin1.h. */
-#define SHIFTNON(ch) ((UNCH)(ch) | 0200)
-#define UNSHIFTNON(ch) ((UNCH)(ch) & ~0200)
-
-/* See comment in latin1.h. */
-#define CANON_NONSGML 255
-
-/* See comment in latin1.h. */
-#define CANON_DATACHAR 254
diff --git a/usr.bin/sgmls/sgmls/entgen.c b/usr.bin/sgmls/sgmls/entgen.c
deleted file mode 100644
index 2146829..0000000
--- a/usr.bin/sgmls/sgmls/entgen.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/* entgen.c -
-
- Implement entgen() which generates a list of filenames from a struct fpi.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-
-#ifdef HAVE_ACCESS
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* For R_OK. */
-#endif /* HAVE_UNISTD_H */
-
-#ifndef R_OK
-#define R_OK 4
-#endif /* not R_OK */
-
-#endif /* HAVE_ACCESS */
-
-#include "sgmlaux.h"
-
-/* Environment variable that contains path. */
-#ifndef PATH_ENV_VAR
-#define PATH_ENV_VAR "SGML_PATH"
-#endif
-/* Default search path. See field() for interpretation of %*. */
-#ifndef DEFAULT_PATH
-#define DEFAULT_PATH "/usr/local/lib/sgml/%O/%C/%T:%N.%X:%N.%D"
-#endif
-
-#ifndef PATH_FILE_SEP
-#define PATH_FILE_SEP ':'
-#endif
-
-#ifndef SYSID_FILE_SEP
-#define SYSID_FILE_SEP ':'
-#endif
-
-/* This says: change space to underscore, slash to percent. */
-
-#ifndef MIN_DAT_SUBS_FROM
-#define MIN_DAT_SUBS_FROM " /"
-#endif
-#ifndef MIN_DAT_SUBS_TO
-#define MIN_DAT_SUBS_TO "_%"
-#endif
-
-static int field P((struct fpi *, int, char *));
-static int mindatcpy P((char *, char *, int, int));
-static int testopen P((char *));
-static UNIV sysidgen P((char *));
-static UNIV catsysidgen P((const char *, const char *));
-static const char *basename P((const char *));
-
-static char *path = 0;
-
-/* Non-zero if searching should be performed when a system identifier
-is specified. */
-static int sysidsrch = 0;
-
-#define EMPTY_VERSION "default"
-
-static char *classes[] = {
- "capacity",
- "charset",
- "notation",
- "syntax",
- "document",
- "dtd",
- "elements",
- "entities",
- "lpd",
- "nonsgml",
- "shortref",
- "subdoc",
- "text"
- };
-
-/* This is mainly for compatibility with arcsgml. */
-
-static char *genext[] = {
- "nsd", /* Non-SGML data entity. */
- "gml", /* GML document or text entity. */
- "spe", /* System parameter entity. */
- "dtd", /* Document type definition. */
- "lpd", /* Link process definition. */
- "pns", /* Public non-SGML data entity. */
- "pge", /* Public general entity. */
- "ppe", /* Public parameter entity. */
- "pdt", /* Public document type definition. */
- "plp", /* Public link process definition. */
- "vns", /* Display version non-SGML data entity. */
- "vge", /* Display version general entity. */
- "vpe", /* Display version parameter entity. */
- "vdt", /* Display version document type definition.*/
- "vlp", /* Display version link process definition.*/
-};
-
-static char *ext[] = {
- "sgml", /* SGML subdocument */
- "data", /* Data */
- "text", /* General text */
- "parm", /* Parameter entity */
- "dtd", /* Document type definition */
- "lpd", /* Link process definition */
-};
-
-static CATALOG catalog;
-
-VOID entginit(swp)
-struct switches *swp;
-{
- catalog = swp->catalog;
-}
-
-/* Like memcpy, but substitute, fold to lower case (if fold is
-non-zero) and null terminate. This is used both for minimum data and
-for names. If p is NULL, do nothing. Return len. */
-
-static int mindatcpy(p, q, len, fold)
-char *p, *q;
-int len;
-int fold;
-{
- static char subsfrom[] = MIN_DAT_SUBS_FROM;
- static char substo[] = MIN_DAT_SUBS_TO;
- int n;
-
- if (!p)
- return len;
- for (n = len; --n >= 0; q++) {
- char *r = strchr(subsfrom, *q);
- if (!r) {
- if (fold && ISASCII(*q) && isupper((UNCH)*q))
- *p++ = tolower((UNCH)*q);
- else
- *p++ = *q;
- }
- else {
- int i = r - subsfrom;
- if (i < sizeof(substo) - 1)
- *p++ = substo[i];
- }
- }
- *p = '\0';
- return len;
-}
-
-
-/* Return length of field. Copy into buf if non-NULL. */
-
-static int field(f, c, buf)
-struct fpi *f;
-int c;
-char *buf;
-{
- int n;
-
- switch (c) {
- case '%':
- if (buf) {
- buf[0] = '%';
- buf[1] = '\0';
- }
- return 1;
- case 'N': /* the entity, document or dcn name */
- return mindatcpy(buf, (char *)f->fpinm, ustrlen(f->fpinm),
- (f->fpistore != 1 && f->fpistore != 2 && f->fpistore != 3
- ? NAMECASE
- : ENTCASE));
- case 'D': /* dcn name */
- if (f->fpistore != 1) /* not a external data entity */
- return -1;
- if (f->fpinedcn == 0) /* it's a SUBDOC */
- return -1;
- return mindatcpy(buf, (char *)f->fpinedcn, ustrlen(f->fpinedcn),
- NAMECASE);
- case 'X':
- /* This is for compatibility with arcsgml */
- if (f->fpistore < 1 || f->fpistore > 5)
- return -1;
- n = (f->fpipubis != 0)*(f->fpiversw > 0 ? 2 : 1)*5+f->fpistore - 1;
- if (buf)
- strcpy(buf, genext[n]);
- return strlen(genext[n]);
- case 'Y': /* tYpe */
- n = f->fpistore;
- if (n < 1 || n > 5)
- return -1;
- if (n == 1 && f->fpinedcn == 0) /* it's a SUBDOC */
- n = 0;
- if (buf)
- strcpy(buf, ext[n]);
- return strlen(ext[n]);
- case 'P': /* public identifier */
- if (!f->fpipubis)
- return -1;
- return mindatcpy(buf, (char *)f->fpipubis, ustrlen(f->fpipubis), 0);
- case 'S': /* system identifier */
- if (!f->fpisysis)
- return -1;
- else {
- UNCH *p;
- n = 0;
- for (p = f->fpisysis; *p; p++)
- if (*p != RSCHAR) {
- if (buf)
- buf[n] = *p == RECHAR ? '\n' : *p;
- n++;
- }
- return n;
- }
- }
- /* Other fields need a formal public identifier. */
- /* 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;
- case 'I': /* Is it ISO? */
- return f->fpiot == '!' ? 0 : -1;
- case 'R': /* Is it registered? */
- return f->fpiot == '+' ? 0 : -1;
- case 'U': /* Is it unregistered? */
- return f->fpiot == '-' ? 0 : -1;
- case 'L': /* public text language */
- if (f->fpic == FPICHARS)
- return -1;
- /* it's entered in all upper case letters */
- return mindatcpy(buf, (char *)f->fpipubis + f->fpil, f->fpill, 1);
- case 'O': /* owner identifier */
- return mindatcpy(buf, (char *)f->fpipubis + f->fpio, f->fpiol, 0);
- case 'C': /* public text class */
- n = f->fpic - 1;
- if (n < 0 || n >= sizeof(classes)/sizeof(classes[0]))
- return -1;
- if (buf)
- strcpy(buf, classes[n]);
- return strlen(classes[n]);
- case 'T': /* text description */
- return mindatcpy(buf, (char *)f->fpipubis + f->fpit, f->fpitl, 0);
- case 'V':
- if (f->fpic < FPICMINV) /* class doesn't have version */
- return -1;
- if (f->fpiversw > 0) /* no version */
- return -1;
- if (f->fpivl == 0) { /* empty version: */
- /* use device-independent version*/
- if (buf)
- strcpy(buf, EMPTY_VERSION);
- return strlen(EMPTY_VERSION);
- }
- return mindatcpy(buf, (char *)f->fpipubis + f->fpiv, f->fpivl, 0);
- case 'E': /* public text designating (escape) sequence */
- if (f->fpic != FPICHARS)
- return -1;
- return mindatcpy(buf, (char *)f->fpipubis + f->fpil, f->fpill, 0);
- default:
- break;
- }
- return -1;
-}
-
-static int testopen(pathname)
-char *pathname;
-{
-#ifdef HAVE_ACCESS
- return access(pathname, R_OK) >= 0;
-#else /* not HAVE_ACCESS */
- FILE *fp;
- fp = fopen(pathname, "r");
- if (!fp)
- return 0;
- fclose(fp);
- return 1;
-#endif /* not HAVE_ACCESS */
-}
-
-/* Return a pointer to an dynamically-allocated buffer that contains
- the names of the files containing this entity, with each filename
- terminated by a '\0', and with the list of filenames terminated by
- another '\0'. */
-
-UNIV entgen(f)
-struct fpi *f;
-{
- char *qname;
- char *file;
- enum catalog_decl_type dtype;
- char *subst = 0;
- const char *sysid;
- const char *catfile;
-
- assert(f->fpistore != 6); /* Musn't call entgen for a notation. */
- if (!path) {
- char *p;
- char c;
- path = getenv(PATH_ENV_VAR);
- if (!path)
- path = DEFAULT_PATH;
- p = path;
-
- /* Only search for system identifiers if path uses %S. */
- while ((c = *p++) != '\0')
- if (c == '%') {
- if (*p == 'S') {
- sysidsrch = 1;
- break;
- }
- if (*p != '\0' && *p != PATH_FILE_SEP)
- p++;
- }
- }
-
- if (f->fpisysis && !sysidsrch)
- return sysidgen((char *)f->fpisysis);
-
- qname = (char *)f->fpinm;
-
- switch (f->fpistore) {
- case 3:
- /* fall through */
- qname--; /* hack */
- case 1:
- case 2:
- dtype = CATALOG_ENTITY_DECL;
- if (ENTCASE)
- subst = getsubst();
- break;
- case 4:
- dtype = CATALOG_DOCTYPE_DECL;
- if (NAMECASE)
- subst = getsubst();
- break;
- default:
- dtype = CATALOG_NO_DECL;
- }
-
- if (catalog_lookup_entity(catalog,
- (char *)f->fpipubis,
- qname,
- dtype,
- (char *)subst,
- &sysid,
- &catfile))
- return catsysidgen(sysid, catfile);
- if (f->fpisysis
- && (strchr((char *)f->fpisysis, SYSID_FILE_SEP)
- || strcmp((char *)f->fpisysis, STDINNAME) == 0))
- return sysidgen((char *)f->fpisysis);
-
- file = path;
-
- for (;;) {
- char *p;
- int len = 0;
- char *fileend = strchr(file, PATH_FILE_SEP);
- if (!fileend)
- fileend = strchr(file, '\0');
-
- /* Check that all substitutions are non-null, and calculate
- the resulting total length of the filename. */
- for (p = file; p < fileend; p++)
- if (*p == '%') {
- int n;
- /* Set len to -1 if a substitution is invalid. */
- if (++p >= fileend) {
- len = -1;
- break;
- }
- n = field(f, *p, (char *)0);
- if (n < 0) {
- len = -1;
- break;
- }
- len += n;
- }
- else
- len++;
-
- if (len > 0) {
- /* We've got a valid non-empty filename. */
- char *s;
- char *buf;
-
- s = buf = (char *)rmalloc(len + 2);
- for (p = file; p < fileend; p++)
- if (*p == '%')
- s += field(f, *++p, s);
- else
- *s++ = *p;
- *s++ = '\0';
- if (testopen(buf)) {
- /* Terminate the array of filenames. */
- *s++ = '\0';
- return buf;
- }
- free((UNIV)buf);
- }
- if (*fileend == '\0')
- break;
- file = ++fileend;
- }
- return 0;
-}
-
-/* Handle a system identifier without searching. */
-
-static
-UNIV sysidgen(s)
-char *s;
-{
- char *buf, *p;
-
- buf = (char *)rmalloc(strlen(s) + 2);
-
- for (p = buf; *s; s++) {
- if (*s == SYSID_FILE_SEP) {
- if (p > buf && p[-1] != '\0')
- *p++ = '\0';
- }
- else if (*s == RECHAR)
- *p++ = '\n';
- else if (*s != RSCHAR)
- *p++ = *s;
- }
- /* Terminate this filename. */
- if (p > buf && p[-1] != '\0')
- *p++ = '\0';
- if (p == buf) {
- /* No filenames. */
- frem((UNIV)buf);
- return 0;
- }
- /* Terminate the list. */
- *p++ = '\0';
- return buf;
-}
-
-/* Handle a system id in a catalog entry file. */
-static
-UNIV catsysidgen(s, catfile)
-const char *s;
-const char *catfile;
-{
- const char *p;
- char *bufp;
- char *buf;
- int nrelative = 0;
- int catdirlen = 0;
- if (FILE_IS_RELATIVE(s))
- nrelative++;
- for (p = s; *p; p++)
- if (*p == SYSID_FILE_SEP
- && FILE_IS_RELATIVE(p + 1))
- nrelative++;
- if (nrelative) {
- const char *base = basename(catfile);
- catdirlen = base - catfile;
- }
- buf = (char *)rmalloc(p - s + 2 + nrelative*catdirlen);
- bufp = buf;
- for (;;) {
- if (!*s)
- break;
- if (*s != SYSID_FILE_SEP && FILE_IS_RELATIVE(s)) {
- memcpy(bufp, catfile, catdirlen);
- bufp += catdirlen;
- }
- for (;;) {
- if (*s == SYSID_FILE_SEP) {
- s++;
- break;
- }
- *bufp++ = *s++;
- if (*s == '\0')
- break;
- }
- if (bufp > buf && bufp[-1] != '\0')
- *bufp++ = '\0';
- }
- if (bufp == buf) {
- frem((UNIV)buf);
- return 0;
- }
- *bufp++ = '\0';
- return buf;
-}
-
-static
-const char *basename(s)
-const char *s;
-{
- const char *p = s;
- while (*p)
- p++;
- if (p > s) {
- while (--p > s)
- if (strchr(DIR_BASE_SEP, *p))
- return p + 1;
- }
- return s;
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/entity.h b/usr.bin/sgmls/sgmls/entity.h
deleted file mode 100644
index 84a3515..0000000
--- a/usr.bin/sgmls/sgmls/entity.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Struct dcncb: attribute list added to support data attributes. */
-#ifndef ENTITY_H /* Don't include this file more than once. */
-#define ENTITY_H
-/* ENTITY.H: Definitions and control block templates for entity management.
-*/
-#include "tools.h" /* Definitions for type declarations, etc. */
-#include "msgcat.h"
-#include "catalog.h"
-
-#define STDINNAME "-" /* File name that refers to standard input. */
-
-#define EOS '\0' /* NONCHAR: EE (entity end: strings). */
-
-#define AVALCASE 2 /* 2=untranslated string of name characters. */
-
-#define REFNAMELEN 8 /* reference quantity set NAMELEN */
-#define REFLITLEN 240 /* reference quantity set LITLEN */
-
-/* Minimization status of returned tags.
-*/
-#define MINNONE 0 /* Minimization: tag not minimized. */
-#define MINNULL 1 /* Minimization: tag was null. */
-#define MINNET 2 /* Minimization: end-tag was NET delimiter. */
-#define MINDATA 3 /* Minimization: end-tag was data tag. */
-#define MINSTAG 4 /* Minimization: tag implied by start-tag. */
-#define MINETAG 5 /* Minimization: end-tag implied by end-tag. */
-
-/* Formal public identifier public text classes.
-*/
-#define FPICAP 1
-#define FPICHARS 2
-#define FPINOT 3
-#define FPISYN 4
-#define FPICMINV 5 /* Minimum fpic value for versionable text. */
-#define FPIDOC 5
-#define FPIDTD 6
-#define FPIELEM 7
-#define FPIENT 8
-#define FPILPD 9
-#define FPINON 10
-#define FPISHORT 11
-#define FPISUB 12
-#define FPITEXT 13
-struct fpi { /* Formal public identifier. */
- UNCH fpiot; /* Owner type: + or - or ! (for ISO). */
- UNS fpiol; /* Length of owner identifier. */
- UNS fpio; /* Offset in pubis of owner identifier (no EOS).*/
- int fpic; /* Public text class. */
- UNCH fpitt; /* Text type: - or + (for available). */
- UNS fpitl; /* Length of text identifier. */
- UNS fpit; /* Offset in pubis of text identifier (no EOS). */
- UNS fpill; /* Language/designating sequence length. */
- UNS fpil; /* Offset in pubis of language. */
- UNS fpivl; /* Length of display version . */
- UNS fpiv; /* Offset in pubis of display version (no EOS). */
- int fpiversw; /* 1=use best ver; 0=use stated ver; -1=error. */
- UNCH *fpinm; /* Entity/DCN name (EOS, no length). */
- UNCH fpistore; /* 1=NDATA 2=general 3=parm 4=DTD 5=LPD 6=DCN. */
- /* Name of the entity's DCN. Valid only when fpistore == 1.
- NULL if it's a SUBDOC. */
- UNCH *fpinedcn;
- UNCH *fpipubis; /* Public ID string (EOS). */
- UNCH *fpisysis; /* System ID string (EOS). */
-};
-#define FPISZ sizeof(struct fpi)
-typedef struct fpi *PFPI; /* Ptr to FPI control block. */
-
-/* General control blocks.
-*/
-#define NONONCH 1 /* Character references to non-chars invalid. */
-#define OKNONCH 0 /* Character references to non-chars allowed. */
-struct parse { /* Parse control block. */
- char *pname; /* Parse name; content, tag, etc. */
- UNCH *plex; /* Lexical analysis table. */
- UNCH **ptab; /* State and action table. */
- UNS state; /* State. */
- UNS input; /* Input. */
- UNS action; /* Action. */
- UNS newstate; /* Next state. */
-};
-struct restate {
- UNS sstate; /* State. */
- UNS sinput; /* Input. */
- UNS saction; /* Action. */
- UNS snext; /* Next state. */
-};
-struct map {
- UNCH *mapnm; /* Name followed by EOS. */
- int mapdata; /* Data associated with that name. */
-};
-struct hash { /* Dummy structure for function arguments. */
- struct hash *enext; /* Next entry in chain. */
- UNCH *ename; /* Entry name with size and EOS. */
-};
-typedef struct hash *PHASH; /* Ptr to hash table entry. */
-typedef struct hash **THASH; /* Ptr to hash table. */
-
-struct fwdref { /* A forward id reference. */
- struct fwdref *next; /* Pt to next reference in chain. */
- UNIV msg; /* Ptr to saved error messsage. */
-};
-#define FWDREFSZ sizeof(struct fwdref)
-
-struct dcncb { /* Data content notation control block. */
- struct dcncb *enext; /* Next DCN in chain. */
- UNCH *ename; /* Notation name followed by EOS. */
- UNCH mark; /* For use by application. */
- UNCH entsw; /* Entity defined with this notation? */
- UNCH defined; /* Has this notation been defined. */
- UNCH *sysid; /* System identifier of notation. */
- UNCH *pubid; /* Public identifier of notation. */
- struct ad *adl; /* Data attribute list (NULL if none). */
-};
-#define DCBSZ sizeof(struct dcncb)
-#define DCNMARK(p) ((p)->mark ? 1 : ((p)->mark = 1, 0))
-
-typedef struct dcncb *PDCB; /* Ptr to DCN control block. */
-
-/* Number of capacities in a capacity set. */
-
-#define NCAPACITY 17
-
-struct sgmlcap {
- char **name;
- UNCH *points;
- long *number;
- long *limit;
-};
-
-struct sgmlstat { /* Document statistics. */
- UNS dcncnt; /* Number of data content notations defined. */
- UNS pmexgcnt; /* Number of plus or minus exception groups. */
- UNS etdcnt; /* Number of element types declared. */
- UNS etdercnt; /* Number of element types defined by default. */
- UNS pmexcnt; /* Number of plus/minus exception grp members. */
- UNS modcnt; /* Number of content model tokens defined. */
- UNS attcnt; /* Number of attributes defined. */
- UNS attdef; /* Characters of attribute defaults defined. */
- UNS attgcnt; /* Number of att value grp members (incl dcn). */
- UNS idcnt; /* Number of ID attributes specified. */
- UNS idrcnt; /* Number of ID references specified. */
- UNS ecbcnt; /* Number of entities declared. */
- UNS ecbtext; /* Characters of entity text defined. */
- UNS srcnt; /* Number of short reference tables defined. */
- UNS dcntext; /* Characters of notation identifiers defined. */
-};
-struct switches { /* Parser control switches (1=non-standard). */
- int swdupent; /* 1=msg if duplicate ENTITY def attempted;0=no.*/
- int swcommnt; /* 1=return comment declarations as data; 0=no. */
- int swrefmsg; /* 1=msg if undeclared ref is defaulted; 0=no. */
- UNS swbufsz; /* Size of source file buffer for READ(). */
- int swenttr; /* 1=trace entity stack in error messages; 0=no.*/
- int sweltr; /* 1=trace element stack in error messages; 0=no. */
- int swambig; /* 1=check content model ambiguity */
- int swundef; /* 1=warn about undefined elements. */
- int swcap; /* 1=report capcity errors */
- char *prog; /* Program name for error messages. */
-#ifdef TRACE
- char *trace; /* What to trace in the body. */
- char *ptrace; /* What to trace in the prolog. */
-#endif /* TRACE */
- nl_catd catd; /* Message catalog descriptor. */
- long nopen; /* Number of open document entities */
- int onlypro; /* Parse only the prolog. */
- char **includes; /* List of parameter entities to be defined
- as "INCLUDE"; NULL terminated.*/
- VOID (*die) P((void)); /* Function to call on fatal error. */
- CATALOG catalog; /* Catalog for generating system identifiers. */
-};
-struct markup { /* Delimiter strings for text processor. */
- UNCH *cro; /* LEXCON markup string: CRO */
- UNCH *dso; /* LEXCON markup string: DSO */
- UNCH *ero; /* LEXCON markup string: ERO */
- UNCH *etag; /* LEXMARK markup string: end-tag */
- UNCH *lit; /* LEXMARK markup string: LIT */
- UNCH *lita; /* LEXMARK markup string: LITA */
- UNCH *mdc; /* LEXCON markup string: MDC */
- UNCH *mdo; /* LEXCON markup string: MDO */
- UNCH *mse; /* LEXCON markup string: mse */
- UNCH *mss; /* LEXCON markup string: mss */
- UNCH *mssc; /* LEXCON markup string: mss CDATA */
- UNCH *mssr; /* LEXCON markup string: mss RCDATA */
- UNCH *pic; /* LEXCON markup string: PIC */
- UNCH *pio; /* LEXCON markup string: PIO */
- UNCH *refc; /* LEXGRP markup string: REFC */
- UNCH *stag; /* LEXMARK markup string: start-tag */
- UNCH *tagc; /* LEXMARK markup string: TAGC */
- UNCH *vi; /* LEXMARK markup string: VI */
- int lennet; /* LEXMARK markup string length: null end-tag. */
- int lennst; /* LEXMARK markup string length: null start-tag.*/
-};
-#endif /* ndef ENTITY_H */
diff --git a/usr.bin/sgmls/sgmls/error.h b/usr.bin/sgmls/sgmls/error.h
deleted file mode 100644
index d37d493..0000000
--- a/usr.bin/sgmls/sgmls/error.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ERROR.H: Symbols for SGML error codes (start with 'E_').
- Numbers 46 - 56 are generated by ERROR.C.
- Later numbers are coded directly.
-*/
-/* SGMLERR.C: General errors and syntax errors.
-*/
-#define E_CONTEXT 1 /* W GI not allowed at this point in structure. */
-#define E_MDNAME 2 /* E Invalid markup declaration name. */
-/*efine E_LEN 3 E Syntax error: length exceeded. */
-#define E_SYS 4 /* W Illegal system character. */
-#define E_ETAG 5 /* E End-tag does not match any open start-tag. */
-#define E_STAGMAX 6 /* E Maximum number of open elements exceeded. */
-/* E_ALLNULL 7 W Start- and end-tag omitted with null content. */
-#define E_EOF 8 /* E/W Illegal entity end in markup or delimited text. */
-/* fine E_INV 9 E Markup error: invalid character. */
-#define E_CHARS 10 /* W Data found in content that doesn't allow it. */
-/* fine E_NOETDE 11 E End-tag GI not defined by element declaration. */
-#define E_BADNM 12 /* E Name is not syntactically valid. */
-#define E_BADATT 13 /* E Attribute was not defined by element declaration. */
-#define E_VALINV 14 /* W Att value/declaration conflict: invalid char. */
-#define E_VALLEN 15 /* W Att value/declaration conflict: token too long. */
-#define E_VALCNT 16 /* W Att value/declaration conflict: too many tokens. */
-#define E_VALTYPE 17 /* W Att value/declaration conflict: wrong token type.*/
-#define E_VALGRP 18 /* W Att value/declaration conflict: token not in grp.*/
-#define E_VALREQ 19 /* W Att value/declaration conflict: req unspecified. */
-/* E_EMIN 20 W End-tag implied by end-tag; not minimizable. */
-/* E_SMIN 21 W Omitted start-tag was not minimizable. */
-#define E_POSSATT 22 /* E Possible att found but not defined; used as data.*/
-/* Late additions numbered out of order to avoid recompilation. */
-/*efine E_ENTSYNC 37 E Entity and group nesting levels out of sync. */
-#define E_BADVAL 25 /* W Att value omitted (null); default used. */
-/* E_ECONTXT 30 W Element ended prematurely (some content omitted).*/
-/* E_EMINST 39 W End-tag implied by start-tag; not minimizable. */
-/* E_MEXTAG 40 W *** In Use *** */
-#define E_MEXERR 41 /* W Attempt to exclude contextually required element.*/
-#define E_DOCTYPE 42 /* W No document type defined; *DOCTYPE assumed. */
-/* E_NOETDS 43 E Start-tag GI not defined by element declaration. */
-#define E_RESTART 44 /* E Invalid chars ignored; trying to restart parse. */
-
-/* MDERROR.C: Errors in markup declarations.
-*/
-/*efine E_DUP 23 E Duplicate specification. */
-/*efine E_KEY 24 E Incorrect keyword for parameter. */
-/*efine E_MSE 26 E MSE occurred with no corresponding MS. */
-/*efine E_MSS 27 E MSS exceeded maximum nesting level. */
-/*efine E_NUM 28 E Incorrect number of parameters. */
-#define E_TYPE 29 /* E Incorrect parameter type. */
-/* Late additions numbered out of order to avoid recompilation. */
-/*efine E_VAL 38 W Incorrect parameter value. */
-
-/* RESERROR.C: Errors in resource routines.
-*/
-/* Unused I End of primary source entity. */
-/* fine E_FILBUF 31 E Could not read next buffer. */
-/* fine E_ERFILE 32 E Could not open file. */
-/* fine E_MALLOC 33 T Could not obtain required main storage. */
-/* fine E_ERMAX 34 E Maximum number of open entities exceeded. */
-/* fine E_ERNAME 35 E Referenced entity undeclared. */
-/* fine E_ERLOOP 36 E Entity referenced within itself: ref ignored. */
-/* Late additions numbered out of order to avoid recompilation. */
-/* E_ERDEF 45 E Referenced entity undeclared; SYSTEM assumed. */
diff --git a/usr.bin/sgmls/sgmls/etype.h b/usr.bin/sgmls/sgmls/etype.h
deleted file mode 100644
index 8ec64c1..0000000
--- a/usr.bin/sgmls/sgmls/etype.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ETYPE.H: Definitions for element type and group processing.
-*/
-#define MCHARS 0x80 /* Model: contains #CHARS. */
-#define MGI 0x40 /* Model: contains GI names. */
-#define MPHRASE 0x20 /* Model: first token is #CHARS. */
-#define MKEYWORD 0x1F /* Model: defined with single keyword. */
-#define MNONE 0x10 /* Model: contains no GIs or #CHARS. */
-#define MANY 0x08 /* Model: contains any GIs or #CHARS. */
-#define MRCDATA 0x04 /* Model: contains RCDATA. */
-#define MCDATA 0x02 /* Model: contains CDATA. */
-
-#define TOREP (TOPT+TREP) /* 11000000 Optional and repeatable. */
-#define TOPT 0x80 /* Token: 1=optional; 0=required. */
-#define TREP 0x40 /* Token: 1=repeatable; 0=not. */
-#define TXOREP (TXOPT+TXREP) /* * explicitly specified */
-#define TXOPT 0x20 /* ? explicitly specified */
-#define TXREP 0x10 /* + explicitly specified */
-#define TTMASK 0x0F /* 00001111 Mask for testing token type. */
-#define TTETD 4 /* 00000100 Token is an ETD. */
-#define TTAND 3 /* 00000011 Token is an AND group. */
-#define TTSEQ 2 /* 00000010 Token is a sequence group. */
-#define TTOR 1 /* 00000001 Token is an OR group. */
-#define TTCHARS 0 /* 00000000 Token is #CHARS. */
-
-struct thdr { /* Token header or model header. */
- UNCH ttype; /* Token type attributes or model content. */
- union {
- int tnum; /* Group token: tokens in group.
- Model header: content tokens at any level. */
- struct etd *thetd; /* GI token: ptr to etd. */
- } tu;
-};
-#define THSZ (sizeof(struct thdr))
-
-#define ETDHASH 211 /* Size of element hash table. Must be prime. */
-#define SMO 0x40 /* ETDMIN: Start-tag O minimization. */
-#define EMO 0x04 /* ETDMIN: End-tag O minimization. */
-#define EMM 0x02 /* ETDMIN: End-tag minimization explicitly
- specified to be minus */
-#define ETDDCL 0x80 /* ETDMIN: Element was declared. */
-#define ETDUSED 0x20 /* ETDMIN: Element used in another declaration. */
-#define ETDOCC 0x10 /* ETDMIN: Element occurred in document. */
-
-struct etd { /* Element type definition. */
- struct etd *etdnext; /* Next element type definition in hash chain. */
- UNCH *etdgi; /* GI preceded by its length, followed by EOS. */
- UNCH etdmin; /* Flag bits: minimization. */
- UNCH mark; /* Mark bit: for ambiguity checking */
- struct thdr *etdmod; /* Content model. */
- struct etd **etdmex; /* Minus exceptions. */
- struct etd **etdpex; /* Plus exceptions. */
- struct ad *adl; /* Attribute descriptor list. */
- struct entity **etdsrm; /* Short reference map. */
-};
-#define ETDSZ (sizeof(struct etd))
-typedef struct etd *PETD;
-extern struct etd dumetd[];
-
-/* Number of bits in a long must be >= 1<<LONGPOW */
-#define LONGPOW 5
-
-#define LONGBITS (1<<LONGPOW)
-
-struct mpos { /* Position of current element in model. */
- UNCH g; /* Index of this group in the model. */
- UNCH t; /* Index of the current token in this group. */
- UNCH tstart; /* Index of starting token for AND group
- testing. */
- unsigned long *h; /* Hit bits of this group's tokens. */
-};
-
-#define HITCLEAR(h) MEMZERO((UNIV)(h), grplongs*sizeof(unsigned long))
-
-#define TAGCONER 0x01 /* 00000001 (contersw) Tag was out of context. */
-#define TAGNET 0x02 /* 00000010 (etisw) Tag has NET enabled. */
-#define TAGPEX 0x04 /* 00000100 (pexsw) Tag was plus exception. */
-#define TAGREF 0x08 /* 00001000 (conrefsw) Tag had CONREF or EMPTY.*/
-struct tag { /* Tag control block. */
- UNCH status; /* Status of context check. */
- UNCH tflags; /* Flags: TAGCONER TAGNET TAGPEX TAGREF */
- struct etd *tetd; /* Element type definition for tag. */
- struct entity **tsrm; /* Current short reference map. */
- struct mpos *tpos; /* Position of next tag in this model. */
-};
-
-#define RCEND 1 /* No more tokens: end element and retry GI. */
-#define RCREQ 2 /* Required GI must precede proposed GI. */
-#define RCMISS 3 /* GI invalid: not element end; no required GI. */
-#define RCHIT 4 /* GI is the one expected next. */
-#define RCMEX 5 /* GI invalid: minus exception. */
-#define RCHITMEX 6 /* RCMEX with invalid attempted minus exclusion.*/
-#define RCPEX 7 /* GI is valid solely because of plus exclusion.*/
-#define RCNREQ 8 /* Token is not required; can retry invalid GI. */
diff --git a/usr.bin/sgmls/sgmls/exclude.c b/usr.bin/sgmls/sgmls/exclude.c
deleted file mode 100644
index 7d72cc0..0000000
--- a/usr.bin/sgmls/sgmls/exclude.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* exclude.c -
- Exclusion checking.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "sgmlincl.h"
-
-static int excktok P((struct thdr *, int, int *));
-static int exmark P((int));
-
-/* Check that the current exclusions are legal for the content model
-of the current element. */
-
-VOID exclude()
-{
- struct thdr *mod = tags[ts].tetd->etdmod;
-
- if ((mod->ttype & MKEYWORD) == 0 && exmark(1)) {
- int excl;
-
- excktok(mod + 1, 0, &excl);
- exmark(0);
- }
-}
-
-/* Set the mark field of all current exclusions to val. Return 1 if
-there are some current exclusions. */
-
-static
-int exmark(val)
-int val;
-{
- int i;
- int gotone = 0;
-
- for (i = ts; i > 0; --i) {
- struct etd **p = tags[i].tetd->etdmex;
- if (p) {
- for (; *p; p++)
- (*p)->mark = val;
- gotone = 1;
- }
- }
- return gotone;
-}
-
-/* Check exclusions for this token. Return size of token. */
-
-static
-int excktok(t, orgrp, excl)
-struct thdr *t;
-int orgrp; /* 1 if token is member of or group */
-int *excl; /* Set to 1 if token is excluded. */
-{
- int size;
- struct thdr *tem;
- int tnum;
- int optional = 0;
- int hadopt, hadreq;
-
- *excl = 0;
-
- switch (t->ttype & TTMASK) {
- case TTETD:
- if (t->tu.thetd->mark) {
- if (orgrp || (t->ttype & TOPT))
- *excl = 1;
- else
- sgmlerr(217, &pcbstag, t->tu.thetd->etdgi + 1,
- tags[ts].tetd->etdgi + 1);
- }
- /* fall through */
- case TTCHARS:
- size = 1;
- break;
- case TTOR:
- case TTAND:
- case TTSEQ:
- tem = t + 1;
- hadopt = 0;
- hadreq = 0;
- for (tnum = t->tu.tnum; tnum > 0; --tnum) {
- int ex;
- int n = excktok(tem, (t->ttype & TTMASK) == TTOR, &ex);
- if (!ex) {
- if (tem->ttype & TOPT)
- hadopt = 1;
- else
- hadreq = 1;
- }
- tem += n;
- }
- size = tem - t;
- if ((t->ttype & TTMASK) == TTOR)
- optional = hadreq ? hadopt : 1;
- else
- optional = !hadreq;
- break;
- default:
- abort();
- }
-
- /* Was required, but exclusions have made it optional.
- eg <!element foo - - (a | b) -(a, b)> */
-
- if (optional && !(t->ttype & TOPT))
- sgmlerr(216, &pcbstag, tags[ts].tetd->etdgi + 1, (UNCH *)0);
-
- return size;
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/genlex.c b/usr.bin/sgmls/sgmls/genlex.c
deleted file mode 100644
index b653d14..0000000
--- a/usr.bin/sgmls/sgmls/genlex.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* genlex: Generate lexical tables for non-ASCII charsets. */
-
-#include "config.h"
-#include "std.h"
-#include "tools.h"
-
-#define CANON_ASCII_NONSGML 255 /* Canonical non-SGML character in ASCII. */
-#define CANON_ASCII_DATACHAR 254 /* Canonical DATACHAR in ASCII. */
-
-extern unsigned char charset[];
-extern UNCH *lextabs[];
-extern UNCH lextran[];
-
-static char *lextabnames[] = {
- "lexcnm", "lexcon", "lexgrp", "lexlms", "lexmark", "lexsd", "lextoke",
- "lexmin"
-};
-
-#define UNUSED -1
-
-extern int iso646charset[];
-extern int iso646G0charset[];
-extern int iso646C0charset[];
-extern int iso8859_1charset[];
-extern int iso6429C1charset[];
-
-static struct {
- char *name;
- int *map;
-} charsets[] = {
- { "iso646charset", iso646charset },
- { "iso646G0charset", iso646G0charset },
- { "iso646G0charset", iso646G0charset },
- { "iso8859_1charset", iso8859_1charset },
- { "iso646C0charset", iso646C0charset },
- { "iso6429C1charset", iso6429C1charset },
-};
-
-static VOID print_tab(s, t)
- char *s;
- UNCH *t;
-{
- int i;
- printf("UNCH %s[] = {\n", s);
- for (i = 0; i < 256; i++)
- printf("%2d,%c", t[i], (i + 1) % 16 == 0 ? '\n' : ' ');
- fputs("};\n\n", stdout);
-}
-
-int main(argc, argv)
- int argc;
- char **argv;
-{
- int i;
- UNCH tab[256];
- char special[256];
- /* Shunned character numbers in the reference concrete syntax. */
- 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
- };
- char shunned[256];
- char *program_name;
-
- program_name = strrchr(argv[0], '/');
- if (program_name)
- program_name++;
- else
- program_name = argv[0];
-
- /* Check that the mapping is 1-1. */
- for (i = 0; i < 256; i++)
- tab[i] = 0;
- for (i = 0; i < 256; i++)
- tab[charset[i]] = 1;
- for (i = 0; i < 256; i++)
- if (!tab[i]) {
- fprintf(stderr, "%s: bad mapping: no character mapped to %d\n",
- program_name, i);
- exit(EXIT_FAILURE);
- }
-
- /* Compute special. */
- for (i = 0; i < 256; i++)
- special[i] = 0;
- for (i = 0; lextabs[i]; i++) {
- int j;
- for (j = 0; j < 256; j++)
- if (lextabs[i][j] != lextabs[i][CANON_ASCII_NONSGML]
- && lextabs[i][j] != lextabs[i][CANON_ASCII_DATACHAR])
- special[charset[j]] = 1;
- }
-
- /* Compute shunned. */
- for (i = 0; i < 256; i++)
- shunned[i] = 0;
- for (i = 0; i < sizeof(refshun); i++)
- shunned[refshun[i]] = 1;
-
- printf("/* This file was automatically generated by %s. Do not edit. */\n\n",
- program_name);
- fputs("#include \"config.h\"\n#include \"entity.h\"\n#include \"sgmldecl.h\"\n\n",
- stdout);
-
- /* Generate each of the lexical tables. */
- for (i = 0; lextabs[i]; i++) {
- int j;
- for (j = 0; j < 256; j++)
- tab[charset[j]] = lextabs[i][j];
-
- for (j = 0; j < 256; j++)
- if (!special[j]) {
- if (shunned[j])
- tab[j] = lextabs[i][CANON_ASCII_NONSGML];
- else
- tab[j] = lextabs[i][CANON_ASCII_DATACHAR];
- }
- print_tab(lextabnames[i], tab);
- }
-
- /* Generate lextran. */
- for (i = 0; i < 256; i++)
- tab[charset[i]] = charset[lextran[i]];
- print_tab("lextran", tab);
-
- /* Generate charsets. */
- for (i = 0; i < sizeof(charsets)/sizeof(charsets[0]); i++) {
- int j;
- int *map = charsets[i].map;
- printf("\nint %s[] = {\n", charsets[i].name);
- for (j = 0; j < 256; j++)
- if (map[j] == UNUSED)
- printf("UNUSED,%c", (j + 1) % 8 == 0 ? '\n' : ' ');
- else
- printf("%3d,%c", charset[map[j]], (j + 1) % 16 == 0 ? '\n' : ' ');
- fputs("};\n", stdout);
- }
-
- exit(EXIT_SUCCESS);
-}
diff --git a/usr.bin/sgmls/sgmls/getopt.c b/usr.bin/sgmls/sgmls/getopt.c
deleted file mode 100644
index 9a218b3..0000000
--- a/usr.bin/sgmls/sgmls/getopt.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* getopt.c -
- getopt() for those systems that don't have it.
-
- Derived from comp.sources.unix/volume3/att_getopt.
- Modified by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-
-#ifndef HAVE_GETOPT
-
-#include "std.h"
-#include "getopt.h"
-
-#ifdef SWITCHAR
-#include <dos.h>
-#endif
-
-int opterr = 1;
-int optind = 1;
-int optopt;
-char *optarg;
-
-#ifndef OPTION_CHAR
-#define OPTION_CHAR '-'
-#endif
-
-int getopt(argc, argv, opts)
-int argc;
-char **argv;
-char *opts;
-{
-#ifdef SWITCHAR
- union REGS regs;
- static char switchar = '\0';
-#endif
- static int sp = 1;
- register int c;
- register char *cp;
- char *message;
-#ifdef SWITCHAR
- if (switchar == '\0') {
- regs.x.ax = 0x3700;
- intdos(&regs, &regs);
- if (!regs.x.cflag)
- switchar = regs.h.dl;
- else
- switchar = '/';
- }
-#endif
- if (sp == 1) {
- if (optind >= argc)
- return EOF;
- if ((
-#ifdef SWITCHAR
- argv[optind][0] != switchar &&
-#endif
- argv[optind][0] != OPTION_CHAR) || argv[optind][1] == '\0') {
-#ifdef REORDER_ARGS
- int i;
- for (i = optind; i < argc; i++)
- if ((
-#ifdef SWITCHAR
- argv[i][0] == switchar ||
-#endif
- argv[i][0] == OPTION_CHAR) && argv[i][1] != '\0')
- break;
- if (i < argc) {
- c = argv[i][1];
-#ifdef CASE_INSENSITIVE_OPTIONS
- if (isupper(c))
- c = tolower(c);
-#endif
- if (c != ':' && c != OPTION_CHAR && (cp = strchr(opts, c)) != NULL
- && cp[1] == ':' && argv[i][2] == 0 && i < argc - 1) {
- int j;
- char *temp1 = argv[i];
- char *temp2 = argv[i+1];
- for (j = i - 1; j >= optind; j--)
- argv[j+2] = argv[j];
- argv[optind] = temp1;
- argv[optind+1] = temp2;
- }
- else {
- int j;
- char *temp = argv[i];
- for (j = i - 1; j >= optind; j--)
- argv[j+1] = argv[j];
- argv[optind] = temp;
- }
- }
- else
-#endif
- return EOF;
- }
- if ((argv[optind][0] == OPTION_CHAR && argv[optind][1] == OPTION_CHAR
- && argv[optind][2] == '\0')
-#ifdef SWITCHAR
- || (argv[optind][0] == switchar && argv[optind][1] == switchar
- && argv[optind][2] == '\0')
-#endif
- ) {
- optind++;
- return(EOF);
- }
- }
- optopt = c = argv[optind][sp];
-#ifdef CASE_INSENSITIVE_OPTIONS
- if (
-#ifdef USE_ISASCII
- isascii(c) &&
-#endif /* USE_ISASCII */
- isupper((unsigned char)c))
- optopt = c = tolower((unsigned char)c);
-#endif /* CASE_INSENSITIVE_OPTIONS */
- if (c == ':' || (cp = strchr(opts, c)) == NULL) {
- if (argv[optind][++sp] == '\0') {
- optind++;
- sp = 1;
- }
- message = ": illegal option -- ";
- goto bad;
- }
- if (*++cp == ':') {
- if (argv[optind][sp+1] != '\0')
- optarg = &argv[optind++][sp+1];
- else if (++optind >= argc) {
- sp = 1;
- message = ": option requires an argument -- ";
- goto bad;
- }
- else
- optarg = argv[optind++];
- sp = 1;
- }
- else {
- if (argv[optind][++sp] == '\0') {
- sp = 1;
- optind++;
- }
- optarg = NULL;
- }
- return c;
-bad:
- if (opterr) {
- fputs(argv[0], stderr);
- fputs(message, stderr);
- fputc(optopt, stderr);
- fputc('\n', stderr);
- }
- return '?';
-}
-
-#endif /* not HAVE_GETOPT */
-
-/*
-Local Variables:
-c-indent-level: 4
-c-continued-statement-offset: 4
-c-brace-offset: 4
-c-argdecl-indent: 4
-c-label-offset: -4
-tab-width: 4
-End:
-*/
-
diff --git a/usr.bin/sgmls/sgmls/getopt.h b/usr.bin/sgmls/sgmls/getopt.h
deleted file mode 100644
index 4856560..0000000
--- a/usr.bin/sgmls/sgmls/getopt.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Declare getopt() and associated variables. */
-
-/* Don't use prototypes in case some system header file has a
-conflicting definition. Systems differ on how they declare the second
-parameter. */
-
-extern int getopt();
-
-extern char *optarg;
-extern int optind;
-extern int opterr;
diff --git a/usr.bin/sgmls/sgmls/keyword.h b/usr.bin/sgmls/sgmls/keyword.h
deleted file mode 100644
index 6c092f0..0000000
--- a/usr.bin/sgmls/sgmls/keyword.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* KEYWORD.H: Definitions for markup declaration keyword processing.
-*/
-/* Default value types for attribute definition list declaration.
-*/
-#define DNULL 1 /* Default value: implied attribute. */
-#define DREQ 2 /* Default value: required attribute. */
-#define DCURR 3 /* Default value: current attribute. */
-#define DCONR 4 /* Default value: content reference attribute. */
-#define DFIXED 5 /* Default value: fixed attribute. */
-
-/* External identifier types for entity and notation declarations.
-*/
-#define EDSYSTEM 1 /* SYSTEM (but not PUBLIC) identifier specified.*/
-#define EDPUBLIC 2 /* PUBLIC (but not SYSTEM) identifier specified.*/
-#define EDBOTH 3 /* PUBLIC and also SYSTEM identifiers specified.*/
-
-/* Marked section keywords.
-*/
-#define MSTEMP 1
-#define MSRCDATA 2
-#define MSCDATA 3
-#define MSIGNORE 4
diff --git a/usr.bin/sgmls/sgmls/latin1.h b/usr.bin/sgmls/sgmls/latin1.h
deleted file mode 100644
index c6df696..0000000
--- a/usr.bin/sgmls/sgmls/latin1.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* SGML Character Use: ISO Latin 1.
-*/
-#define EOFCHAR '\032' /* FUNCTION: EE (entity end: files). */
-#define EOBCHAR '\034' /* NONCHAR: EOB (file entity: end of buffer. */
-#define RSCHAR '\012' /* FUNCTION: RS (record start). */
-#define RECHAR '\015' /* FUNCTION: RE (record end). */
-#define TABCHAR '\011' /* FUNCTION: TAB (horizontal tab). */
-#define SPCCHAR '\040' /* FUNCTION: SPACE (horizontal space). */
-#define GENRECHAR '\010' /* NONCHAR: Generated RE. */
-#define DELCDATA '\035' /* NONCHAR: Delimiter for CDATA entity in
- attribute value. */
-#define DELSDATA '\036' /* NONCHAR: Delimiter for SDATA entity in
- attribute value. */
-#define DELNONCH '\037' /* NONCHAR: non-SGML character prefix. */
-
-/* These two macros are used to handle non-SGML characters. A non-SGML
-by character is represented by a DELNONCH character followed by
-SHIFTNON(original_character). SHIFTNON must transform any character
-in the set 0, EOFCHAR, EOBCHAR, GENRECHAR, DELCDATA, DELSDATA,
-DELNONCH into a character that is not one of the set 0, EOFCHAR,
-EOBCHAR. Furthermore UNSHIFTNON(SHIFTNON(c)) must be equal to c for
-every character c in the former set. */
-/* This is a simple definition that works for ASCII-like character sets. */
-#define SHIFTNON(ch) ((UNCH)(ch) | 0100)
-#define UNSHIFTNON(ch) ((UNCH)(ch) & ~0100)
-
-/* A canonical NONSGML character. The character number that is shunned
-in the reference concrete syntax and is not the number of a
-significant (in the reference concrete syntax) character nor one of
-the above characters nor 0. */
-#define CANON_NONSGML 255
-
-/* A canonical DATACHAR character. The character number that is not
-shunned in the reference concrete syntax and is not the number of a
-significant (in the reference concrete syntax) SGML character nor one
-of the above characters. */
-#define CANON_DATACHAR 254
diff --git a/usr.bin/sgmls/sgmls/lexcode.h b/usr.bin/sgmls/sgmls/lexcode.h
deleted file mode 100644
index d34e3e6..0000000
--- a/usr.bin/sgmls/sgmls/lexcode.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Definitions of lexical codes needed by both lextaba.c and lexrf.c. */
-
-#define FCE 27 /* FRE Free character in use as an entity reference */
-#define FRE 0 /* FREECHAR that is not in a CON delimiter-in-context. */
-#define LITC 21 /* LIT LITA PIC or EE in use as a literal terminator */
-#define MINLITC 13 /* LIT LITA as literal terminator in minimum data */
-#define MSC3 15 /* ] Also MSC[2]. */
-#define NET 17 /* / When enabled. */
-#define ETI 16 /* / Actually ETAGO[2] */
-#define SPCR 19 /* Space in use as SR8. */
-#define TGO2 25 /* < TAGO; also MDO[1], PIO[1] */
-#define CDE 11 /* NONSGML delcdata CDATA/SDATA delimiter */
diff --git a/usr.bin/sgmls/sgmls/lexrf.c b/usr.bin/sgmls/sgmls/lexrf.c
deleted file mode 100644
index 643b336..0000000
--- a/usr.bin/sgmls/sgmls/lexrf.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* LEXRF: Lexical tables for reference concrete syntax.
-*/
-
-#include "config.h"
-#include "entity.h" /* Templates for entity control blocks. */
-#include "synxtrn.h" /* Declarations for concrete syntax constants. */
-#include "action.h" /* Action names for all parsing. */
-#include "lexcode.h"
-
-static UNCH SRTAB[] = { TABCHAR, '\0' };
-static UNCH SRRE[] = { RECHAR, '\0' };
-static UNCH SRRS[] = { RSCHAR, '\0' };
-static UNCH SRRSB[] = { RSCHAR, 'B', '\0' };
-static UNCH SRRSRE[] = { RSCHAR, RECHAR, '\0' };
-static UNCH SRRSBRE[] = { RSCHAR, 'B', RECHAR, '\0' };
-static UNCH SRBRE[] = { 'B', RECHAR, '\0' };
-
-struct lexical lex = { /* Delimiter set constants for parser use. */
- { /* Markup strings for text processor use. */
- (UNCH *)"\4&#", /* LEXCON markup string: CRO */
- (UNCH *)"[", /* LEXCON markup string: DSO */
- (UNCH *)"\3&", /* LEXCON markup string: ERO */
- (UNCH *)"\4</", /* LEXMARK markup string: end-tag */
- (UNCH *)"\3\"", /* LEXMARK markup string: LIT */
- (UNCH *)"\3'", /* LEXMARK markup string: LITA */
- (UNCH *)"\3>", /* LEXCON markup string: MDC */
- (UNCH *)"\4<!", /* LEXCON markup string: MDO */
- (UNCH *)"\5]]>", /* LEXCON markup string: mse */
- (UNCH *)"\5<![", /* LEXCON markup string: mss */
- (UNCH *)"\13<![CDATA[", /* LEXCON markup string: mss CDATA */
- (UNCH *)"\14<![RCDATA[", /* LEXCON markup string: mss RCDATA */
- (UNCH *)"\3>", /* LEXCON markup string: PIC */
- (UNCH *)"\4<?", /* LEXCON markup string: PIO */
- (UNCH *)"\3;", /* LEXGRP markup string: ref close. */
- (UNCH *)"\3<", /* LEXMARK markup string: start-tag */
- (UNCH *)"\3>", /* LEXMARK markup string: TAGC */
- (UNCH *)"\3=", /* LEXMARK markup string: VI */
- 3, /* LEXMARK: length of null end-tag. */
- 2 /* LEXMARK: length of null start-tag. */
- },
- { /* Short reference delimiters. */
- { /* Short reference delimiter table. */
- {(UNCH *)"", SRCT}, /* Dummy entry to store SR count. */
- {SRTAB, 1}, /* TAB */
- {SRRE, 2}, /* RE */
- {SRRS, 3}, /* RS */
- {SRRSB, 4}, /* Leading blanks */
- {SRRSRE, 5}, /* Null record */
- {SRRSBRE, 6}, /* Blank record */
- {SRBRE, 7}, /* Trailing blanks */
- {(UNCH *)" ", 8}, /* Space */
- {(UNCH *)"BB", 9}, /* Two or more blanks */
- {(UNCH *)"\"", 10}, /* Quotation mark (first data character) */
- {(UNCH *)"#", 11}, /* Number sign */
- {(UNCH *)"%", 12}, /* FCE CHARACTERS start here */
- {(UNCH *)"'", 13},
- {(UNCH *)"(", 14},
- {(UNCH *)")", 15},
- {(UNCH *)"*", 16},
- {(UNCH *)"+", 17},
- {(UNCH *)",", 18},
- {(UNCH *)"-", 19}, /* Hyphen */
- {(UNCH *)"--", 20}, /* Two hyphens */
- {(UNCH *)":", 21},
- {(UNCH *)";", 22},
- {(UNCH *)"=", 23},
- {(UNCH *)"@", 24},
- {(UNCH *)"[", 25},
- {(UNCH *)"]", 26},
- {(UNCH *)"^", 27},
- {(UNCH *)"_", 28}, /* Low line */
- {(UNCH *)"{", 29},
- {(UNCH *)"|", 30},
- {(UNCH *)"}", 31},
- {(UNCH *)"~", 32},
- {0, 0}
- },
- { /* Printable form of unprintable SR delims.*/
- "", /* Dummy entry to balance s.dtb. */
- "&#TAB;", /* TAB */
- "&#RE;", /* RE */
- "&#RS;", /* RS */
- "&#RS;B", /* Leading blanks */
- "&#RS;&#RE;", /* Null record */
- "&#RS;B&#RE;", /* Blank record */
- "B&#RE;", /* Trailing blanks */
- "&#SPACE;" /* Space */
- },
- 12, /* LEXCNM: Index of first FCE in srdeltab. */
- 20, /*LEXCNM:Index of "two hyphens" in srdeltab*/
- 10, /* LEXCNM: Index of first SR with data char. */
- 19, /* LEXCNM: Index of hyphen in srdeltab. */
- SRNPRT+1, /* LEXCNM: Index of 1st printable SR. */
- 8, /* LEXCNM: Index of space in srdeltab. */
- 25, /* LEXCNM: Index of left bracket in srdeltab. */
- 26, /* LEXCNM: Index of right bracket in srdeltab. */
- }, /* End of short reference delimiters. */
- { /* General delimiter characters. */
- GENRECHAR, /*LEXCNM:(BS)Generated RE; can't be markup.*/
- '"', /* LEXMARK: Char used as LIT delimiter.*/
- '\'', /* LEXMARK: Char used as LITA delimiter.*/
- '>', /* LEXLMS: Char used as MDC delimiter.*/
- ']', /* LEXLMS: Char used as MSC when enabled.*/
- '/', /* LEXCON: Char used as NET when enabled.*/
- '%', /* LEXMARK: Char used as PERO delimiter. */
- '>', /* LEXCON: Char used as PIC delimiter.*/
- '<' /* LEXCON: Char used as TAGO when enabled.*/
- },
- { /* Lexical table code assignments. */
- FCE, /* LEXCNM: FRE char as entity reference.*/
- FRE, /* LEXLMS: Free character not an entity ref.*/
- LITC, /* LEXLMS: Literal close delimiter enabled. */
- MINLITC, /* LEXMIN: Literal close delimiter enabled. */
- MSC3, /* LEXLMS: Marked section close delim enabled. */
- NET, /* LEXCON: Null end-tag delimiter enabled. */
- ETI, /* LEXCON: NET disabled; still used as ETI. */
- SPCR, /* LEXCNM: Space in use as SHORTREF delim. */
- TGO2, /* LEXCON: Tag open delimiter enabled. */
- CDE /* LEXLMS: CDATA/SDATA delimiters. */
- }
-};
-
-UNCH *lextabs[] = {
- lexcnm, lexcon, lexgrp, lexlms, lexmark, lexsd, lextoke, lexmin, 0
-};
diff --git a/usr.bin/sgmls/sgmls/lextaba.c b/usr.bin/sgmls/sgmls/lextaba.c
deleted file mode 100644
index a851d85..0000000
--- a/usr.bin/sgmls/sgmls/lextaba.c
+++ /dev/null
@@ -1,750 +0,0 @@
-/* lextaba.c: lexical tables for ASCII. */
-
-/* These tables are munged by setnonsgml(). */
-
-#include "config.h"
-#include "entity.h"
-#include "lexcode.h"
-#include "sgmldecl.h"
-
-/* LEXCNM: Lexical table for mixed content (PCBCONM) parse.
-*/
-/* Symbols for SGML character set divisions and function characters. */
-#define NU 1 /* NUMERAL Numerals */
-#define NMC 2 /* LC/UCNMCHAR . - Period and hyphen */
-#define NMS 3 /* LC/UCNMSTRT Lower and uppercase letters */
-#define SPC 4 /* SPACE 32 Space */
-#define NON 5 /* NONSGML 0-31 127 255 Unused, except for: */
-#define EE 6 /* NONSGML 00 26 Entity end (end of file) */
-#define EOB 7 /* NONSGML 28 End disk buffer */
-#define RS 8 /* Function 10 Line feed */
-#define RE 9 /* Function 13 Carrier return */
-#define SEP 10 /* SEPCHAR 09 TAB: horizontal tab */
-#define NSC 12 /* NONSGML delnonch Non-SGML character prefix */
-
-/* Symbols for SGML delimiter roles in CON and CXT.
- ETI and NET must be the same in LEXCNM and LEXCON.
- FRE characters are changed to FCE if an FCE entity is declared.
- They are changed back to FRE when the entity is canceled.
-*/
-#define ERO 13 /* & Also CRO[1] */
-#define NMRE 14 /* 08 Generated non-markup RE */
-#define COM 15 /* - For MDO context; also SR19 and SR20. */
-#undef LIT1
-#define LIT1 18 /* " SR10 */
-#define MDO 20 /* ! Actually MDO[2] */
-#define MSC1 21 /* ] Both MSC[1] and MSC[2]; also SR26. */
-#define MSO 22 /* [ For MDO context; also SR25. */
-#define PIO 23 /* ? Actually PIO[2] */
-#define RNI 24 /* # For CRO[2]; also SR11. */
-#define TGC1 25 /* > For TAGO and MSC context; also MDC, PIC */
-#define TGO1 26 /* < TAGO; also MDO[1], PIO[1] */
-
-UNCH lexcnm[256] = { /*
-000 001       bs tab lf home ff cr so si */
-EE, NON, NON, NON, NON, NON, NON, NON, NMRE,SEP, RS, NON, NON, RE, NON, NON, /*
-          eof esc rt left up down */
-NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE, NON, EOB, NON, NON, NSC, /*
-032 ! " # $ % & ' ( ) * + , - . / */
-SPC, MDO, LIT1,RNI, FRE, FRE ,ERO, FRE, FRE, FRE, FRE, FRE, FRE, COM, NMC, ETI, /*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NU , NU , NU , NU , NU , NU , NU , NU , NU , NU , FRE, FRE, TGO1,FRE, TGC1,PIO, /*
-@ A B C D E F G H I J K L M N O */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, MSO, FRE, MSC1,FRE, FRE, /*
-` a b c d e f g h i j k l m n o */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, FRE, FRE, FRE, FRE, NON,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, NON
-};
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti lit spcr mdo msc mso net pio rni tagc tago fce */
-#undef ERO
-#undef NMRE
-#undef COM
-#undef LIT1
-/* def SPCR*/
-#undef MDO
-#undef MSC1
-#undef MSO
-#undef PIO
-#undef RNI
-#undef TGC1
-/* def TGO1*/
-/* def FCE*/
-/* LEXCON: Lexical table for RCDATA and CDATA content (PCBCON?),
- prolog (PCBPRO), and nested declaration set (PCBMDS) parses.
- Note: NMC is same as FRE; kept for consistency with LEXCNM and LEXLMS.
-*/
-/* Symbols for SGML character set divisions and function characters. */
-/* Same as for LEXCNM. */
-
-/* Symbols for SGML delimiter roles in CON, CXT, and DS.
- ETI and NET must be the same in LEXCNM and LEXCON.
- FRE characters are changed to FCE if an FCE entity is declared.
- They are changed back to FRE when the entity is canceled.
-*/
-#define ERO 13 /* & Also CRO[1] */
-#define NMRE 14 /* 08 Generated non-markup RE */
-#define COM 15 /* - For MDO context. */
-/*#define ETI 16 / Actually ETAGO[2] */
-/*#define NET 17 / When enabled. */
-#define MDO 18 /* ! Actually MDO[2] */
-#define MSC2 19 /* ] Both MSC[1] and MSC[2]. */
-#define MSO 20 /* [ For MDO context. */
-#define PERO 21 /* % For prolog */
-#define PIO 22 /* ? Actually PIO[2] */
-#define RNI 23 /* # For CRO[2]. */
-#define TGC2 24 /* > For TAGO and MSC context; also MDC, PIC */
-
-UNCH lexcon[256] = { /*
-000 001       bs tab lf home ff cr so si */
-EE, NON, NON, NON, NON, NON, NON, NON, NMRE,SEP, RS, NON, NON, RE, NON, NON, /*
-          eof esc rt left up down */
-NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE, NON, EOB, NON, NON, NSC, /*
-032 ! " # $ % & ' ( ) * + , - . / */
-SPC, MDO, FRE, RNI, FRE, PERO,ERO, FRE, FRE, FRE, FRE, FRE, FRE, COM, NMC, ETI, /*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NU , NU , NU , NU , NU , NU , NU , NU , NU , NU , FRE, FRE, TGO2,FRE, TGC2,PIO, /*
-@ A B C D E F G H I J K L M N O */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, MSO, FRE, MSC2,FRE, FRE, /*
-` a b c d e f g h i j k l m n o */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, FRE, FRE, FRE, FRE, NON,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, NON
-};
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-#undef FRE
-#undef NU
-#undef NMC
-#undef NMS
-#undef SPC
-#undef NON
-#undef EE
-#undef EOB
-#undef RS
-#undef RE
-#undef SEP
-#undef NSC
-#undef ERO
-#undef NMRE
-#undef COM
-/* def ETI*/
-/* def NET*/
-#undef MDO
-#undef MSC2
-#undef MSO
-#undef PERO
-#undef PIO
-#undef RNI
-#undef TGC2
-/* LEXGRP: Lexical table for group parses, including PCBREF.
-*/
-/* Symbols for SGML character set divisions. */
-#define BIT 0 /* Bit combinations (not NONCHAR) not allowed in a group. */
-#define NMC 1 /* NAMECHAR . - Period, underscore, and numerals */
-#define NMS 2 /* NAMESTRT Lower and uppercase letters */
-#define RE 3 /* Function 13 Carrier return */
-#define SPC 4 /* SPACE 32 09 Space; includes TAB */
-#define NON 5 /* NONCHAR 0-31 127 255 Unused, except for: */
-#define EE 6 /* Function 26 00 EE: entity end (end of file) */
-#define EOB 7 /* NONCHAR 28 End disk buffer. */
-#define RS 8 /* Function 10 RS: record start (line feed) */
-
-/* Symbols for SGML delimiter roles in GRP. */
-#define AND1 9 /* & */
-#define GRPC 10 /* ) */
-#define GRPO 11 /* ( */
-#undef LIT2
-#define LIT2 12 /* " For datatags. */
-#define LITA 13 /* ' For datatags. */
-#define DTGC 14 /* ] For datatags. */
-#define DTGO 15 /* [ For datatags. */
-#define OPT1 16 /* ? */
-#define OR1 17 /* | */
-#define PERO 18 /* % */
-#define PLUS 19 /* + */
-#define REP1 20 /* * */
-#define RNI 21 /* # For #CHARS */
-#define SEQ1 22 /* , */
-#define REFC 23 /* ; For references */
-
-UNCH lexgrp[256] = { /*
-000 001       bs tab lf home ff cr so si */
-EE , NON, NON, NON, NON, NON, NON, NON, NON, SPC, RS, NON, NON, RE, NON, NON, /*
-          eof esc rt left up down */
-NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE , NON, EOB, NON, NON, NON, /*
-032 ! " # $ % & ' ( ) * + , - . / */
-SPC, BIT, LIT2,RNI, BIT, PERO,AND1,LITA,GRPO,GRPC,REP1,PLUS,SEQ1,NMC, NMC, BIT, /*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NMC, NMC, NMC, NMC, NMC, NMC, NMC, NMC, NMC, NMC, BIT, REFC,BIT, BIT, BIT, OPT1,/*
-@ A B C D E F G H I J K L M N O */
-BIT, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, DTGO,BIT, DTGC,BIT, BIT, /*
-` a b c d e f g h i j k l m n o */
-BIT, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, BIT, OR1, BIT, BIT, NON,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, NON
-};
-/* bit nmc nms re spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-#undef BIT
-#undef NMC
-#undef NMS
-#undef RE
-#undef SPC
-#undef NON
-#undef EE
-#undef EOB
-#undef RS
-#undef AND1
-#undef GRPC
-#undef GRPO
-#undef LIT2
-#undef LITA
-#undef DTGC
-#undef DTGO
-#undef OPT1
-#undef OR1
-#undef PERO
-#undef PLUS
-#undef REP1
-#undef RNI
-#undef SEQ1
-#undef REFC
-/* LEXLMS: Lexical table for literal parses and marked sections.
-*/
-/* Symbols for SGML character set divisions and function characters.
-*/
-#define FRE 0 /* Free char: not in a delimiter or minimum literal. */
-#define NU 1 /* Numeral Numerals */
-#undef MIN
-#define MIN 2 /* Minimum literal '()+,-./:?= */
-#define NMS 3 /* LC/UCNMSTRT Lower and uppercase letters */
-#define SPC 4 /* SPACE 32 Space */
-#define NON 5 /* NONSGML 0-31 127 255 Unused, except for: */
-#define EE 6 /* NONSGML 00 26 Entity end (end of file) */
-#define EOB 7 /* NONSGML 28 End disk buffer */
-#define RS 8 /* Function 10 Line feed */
-#define RE 9 /* Function 13 Carrier return */
-#define SEP 10 /* SEPCHAR 09 TAB: horizontal tab */
-/*#define CDE 11 NONSGML delcdata CDATA/SDATA delimiter */
-#define NSC 12 /* NONSGML delnonch Non-SGML character prefix */
-/* Symbols for SGML delimiter roles in LIT, PI, and marked sections.
- Either LIT, LITA, PIC, or EE, is changed to LITC when a literal is begun.
- It is changed back when the LITC occurs (i.e., when the literal ends).
-*/
-#define ERO 13 /* & */
-#define MDO 14 /* ! Actually MDO[2] */
-#define MSO 16 /* [ For MDO context. */
-#define PERO 17 /* % For prolog. */
-#define RNI 18 /* # For CRO[2] */
-#define TGC3 19 /* > Also MDC for MSC context. */
-#define TGO3 20 /* < TAGO; also MDO[1] */
-
-/* Room has been left in the parse tables in case re-parsing of text
- is eventually supported (i.e., saved parsed text is used by the
- application to create a new SGML document, but CDATA and SDATA
- entities in literals, and non-SGML characters, are left in their
- parsed state to avoid the overhead of reconstituting the original
- markup). In such a case, the two non-SGML characters DELCDATA and
- DELSDATA are changed to CDE.
- NOTE: The idea is a bad one, because the generated document would
- be non-conforming, as it would contain non-SGML characters.
-*/
-UNCH lexlms[256] = { /*
-000 001       bs tab lf home ff cr so si */
-EE, NON, NON, NON, NON, NON, NON, NON, NON ,SEP, RS, NON, NON, RE, NON, NON, /*
-          eof esc rt left up down */
-NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE, NON, EOB, NON, NON, NSC, /*
-032 ! " # $ % & ' ( ) * + , - . / */
-SPC, MDO, FRE, RNI, FRE, PERO,ERO, MIN, MIN, MIN, FRE, MIN, MIN, MIN, MIN, MIN, /*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NU , NU , NU , NU , NU , NU , NU , NU , NU , NU , MIN, FRE, TGO3,MIN, TGC3,MIN, /*
-@ A B C D E F G H I J K L M N O */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, MSO, FRE, MSC3,FRE, FRE, /*
-` a b c d e f g h i j k l m n o */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, FRE, FRE, FRE, FRE, NON,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, NON
-};
-/* free nu min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tago tagc litc */
-/* def FRE*/
-#undef NU
-#undef MIN
-#undef NMS
-#undef SPC
-#undef NON
-#undef EE
-#undef EOB
-#undef RS
-#undef RE
-#undef SEP
-/* def CDE*/
-/* def NSC*/
-#undef ERO
-#undef MDO
-/* def MSC3*/
-#undef MSO
-#undef PERO
-#undef RNI
-#undef TGC3
-#undef TGO3
-/* def LITC*/
-/* LEXMIN: Lexical table for minimum data literals.
-*/
-/* Symbols for SGML character set divisions and function characters.
-*/
-#define FRE 0 /* Free char: not in a delimiter or minimum literal. */
-#define NU 1 /* Numeral Numerals */
-#undef MIN
-#define MIN 2 /* Minimum literal '()+,-./:?= */
-#define NMS 3 /* LC/UCNMSTRT Lower and uppercase letters */
-#define SPC 4 /* SPACE 32 Space */
-#define NON 5 /* NONSGML 0-31 127 255 Unused, except for: */
-#define EE 6 /* NONSGML 00 26 Entity end (end of file) */
-#define EOB 7 /* NONSGML 28 End disk buffer */
-#define RS 8 /* Function 10 Line feed */
-#define RE 9 /* Function 13 Carrier return */
-#define SEP 10 /* SEPCHAR 09 TAB: horizontal tab */
-/*#define CDE 11 NONSGML delcdata CDATA/SDATA delimiter */
-#define NSC 12 /* NONSGML delnonch Non-SGML character prefix */
-/* Either LIT or LITA changed to LITC when a literal is begun.
- It is changed back when the LITC occurs (i.e., when the literal ends).
-*/
-UNCH lexmin[256] = { /*
-000 001       bs tab lf home ff cr so si */
-EE, NON, NON, NON, NON, NON, NON, NON, NON ,SEP, RS, NON, NON, RE, NON, NON, /*
-          eof esc rt left up down */
-NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE, NON, EOB, NON, NON, NSC, /*
-032 ! " # $ % & ' ( ) * + , - . / */
-SPC, FRE, FRE, FRE, FRE, FRE, FRE, MIN, MIN, MIN, FRE, MIN, MIN, MIN, MIN, MIN, /*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NU , NU , NU , NU , NU , NU , NU , NU , NU , NU , MIN, FRE, FRE, MIN, FRE, MIN, /*
-@ A B C D E F G H I J K L M N O */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, FRE, FRE, FRE, FRE, FRE, /*
-` a b c d e f g h i j k l m n o */
-FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, FRE, FRE, FRE, FRE, NON,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
-FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, NON
-};
-/* free nu min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tago tagc litc */
-/* def FRE*/
-#undef NU
-#undef MIN
-#undef NMS
-#undef SPC
-#undef NON
-#undef EE
-#undef EOB
-#undef RS
-#undef RE
-#undef SEP
-/* def CDE*/
-/* def NSC*/
-/* def LITC*/
-/* LEXMARK: Lexical scan table for markup: PCBMD? and PCB?TAG.
-*/
-/* Symbols for SGML character set divisions. */
-#define BIT 0 /* Bit combinations not allowed; includes ESC SO SI */
-#define NMC 1 /* NAMECHAR . _ Period and underscore */
-#define NU 2 /* NUMERAL Numerals */
-#define NMS 3 /* NAMESTRT Lower and uppercase letters */
-#define SPC 4 /* SPACE 32 13 09 Space; includes RE TAB */
-#define NON 5 /* NONCHAR 0-31 127 255 Unused, except for: */
-#define EE 6 /* Function 26 00 EE: entity end (end of file) */
-#define EOB 7 /* NONCHAR 28 End disk buffer. */
-#define RS 8 /* Function 10 RS: record start (line feed) */
-
-/* Symbols for SGML delimiter roles in MD and TAG. */
-#define COM1 9 /* - Actually COM[1]; also COM[2], MINUS. */
-#define ETIB 10 /* / ETI; actually ETAGO[2]. */
-#define GRPO 11 /* ( */
-#define LIT3 12 /* " */
-#define LITA 13 /* ' */
-#define DSO 14 /* [ */
-#define DSC1 15 /* ] For data attribute specifications */
-#define PERO 16 /* % */
-#define PLUS 17 /* + */
-#define REFC 18 /* ; For references */
-#define RNI 19 /* # Also CRO[2] */
-#define TGC4 20 /* > Also MDC, PIC */
-#define TGO4 21 /* < TAGO; also MDO[1] */
-#define VI 22 /* = */
-
-UNCH lexmark[256] = { /*
-000 001       bs tab lf home ff cr so si */
-EE , NON, NON, NON, NON, NON, NON, NON, NON, SPC, RS, NON, NON, SPC, NON, NON, /*
-          eof esc rt left up down */
-NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE , NON, EOB, NON, NON, NON, /*
-032 ! " # $ % & ' ( ) * + , - . / */
-SPC, BIT, LIT3,RNI, BIT, PERO,BIT, LITA,GRPO,BIT, BIT, PLUS,BIT, COM1,NMC ,ETIB,/*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NU, NU, NU, NU, NU, NU, NU, NU, NU, NU, BIT, REFC,TGO4,VI, TGC4,BIT, /*
-@ A B C D E F G H I J K L M N O */
-BIT, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, DSO, BIT, DSC1, BIT, BIT, /*
-` a b c d e f g h i j k l m n o */
-BIT, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, BIT, BIT, BIT, BIT, NON,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT,
-BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, BIT, NON
-};
-/* bit nmc nu nms spc non ee eob rs com eti grpo lit lita
- dso pero plus refc rni tagc tago vi */
-#undef BIT
-#undef NMC
-#undef NU
-#undef NMS
-#undef SPC
-#undef NON
-#undef EE
-#undef EOB
-#undef RS
-#undef COM1
-#undef ETIB
-#undef GRPO
-#undef LIT3
-#undef LITA
-#undef DSO
-#undef DSC
-#undef PERO
-#undef PLUS
-#undef REFC
-#undef RNI
-#undef TGC4
-#undef TGO4
-#undef VI
-/* LEXSD: Lexical scan table for SGML declaration.
-*/
-
-/* Symbols for SGML character set divisions. */
-#define SIG 0 /* Significant SGML characters. */
-#define DAT 1 /* DATACHAR Not significant, and not non-sgml. */
-#define NU 2 /* NUMERAL Numerals */
-#define NMS 3 /* NAMESTRT Lower and uppercase letters */
-#define SPC 4 /* SPACE 32 13 09 Space; includes RE TAB */
-#define NON 5 /* NONCHAR NONSGML */
-#define EE 6 /* Function 26 00 EE: entity end (end of file) */
-#define EOB 7 /* NONCHAR 28 End disk buffer. */
-#define RS 8 /* Function 10 RS: record start (line feed) */
-/* Symbols for SGML delimiter roles in SGML declaration. */
-#define COM1 9 /* - Actually COM[1]; also COM[2]. */
-#define LIT3 10 /* " */
-#define LITA 11 /* ' */
-#define TGC4 12 /* > Also MDC, PIC */
-
-UNCH lexsd[256] = { /*
-000 001       bs tab lf home ff cr so si */
-EE , NON, NON, NON, NON, NON, NON, NON, NON, SPC, RS, NON, NON, SPC, NON, NON, /*
-          eof esc rt left up down */
-NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE , NON, EOB, NON, NON, NON, /*
-032 ! " # $ % & ' ( ) * + , - . / */
-SPC, SIG, LIT3,SIG, DAT, SIG ,SIG, LITA,SIG, SIG, SIG, SIG, SIG, COM1,SIG ,SIG,/*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NU, NU, NU, NU, NU, NU, NU, NU, NU, NU, SIG, SIG, SIG, SIG, TGC4,SIG, /*
-@ A B C D E F G H I J K L M N O */
-SIG, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, SIG, DAT, SIG, SIG, SIG, /*
-` a b c d e f g h i j k l m n o */
-DAT, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, SIG, SIG, SIG, SIG, NON,
-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, 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, 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, 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, DAT, DAT, DAT, NON
-};
-
-#undef SIG
-#undef DAT
-#undef NON
-#undef NU
-#undef NMS
-#undef SPC
-#undef EE
-#undef EOB
-#undef RS
-#undef COM1
-#undef LIT3
-#undef LITA
-#undef TGC4
-
-/* LEXTRAN: Translation table for SGML names.
-*/
-UNCH lextran[256] = { /*
-000 001       bs tab lf home ff cr so si */
-0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , /*
-          eof esc rt left up down */
-16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , /*
-space! " # $ % & ' ( ) * + , - . / */
-32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , /*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 , 63 , /*
-@ A B C D E F G H I J K L M N O */
-64 , 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-80 , 81 , 82 , 83 , 84 , 85 , 86 , 87 , 88 , 89 , 90 , 91 , 92 , 93 , 94 , 95 , /*
-` a b c d e f g h i j k l m n o */
-96 , 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , /*
-p q r s t u v w x y z { | } ~ 127 */
-80 , 81 , 82 , 83 , 84 , 85 , 86 , 87 , 88 , 89 , 90 , 123, 124, 125, 126, 127,
-128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
-144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
-160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
-176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
-192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
-208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
-224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
-};
-/* LEXTOKE: Lexical class table for tokenization scan.
-*/
-#include "lextoke.h" /* Symbols for tokenization lexical classes. */
-UNCH lextoke[256] = { /*
-
-000 001       bs tab lf home ff cr   */
-INV, INV, INV, INV, INV, INV, INV, INV, INV, SEP, REC, INV, INV, REC, INV, INV, /*
-          eof esc rt left up down */
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, EOB, INV, INV, INV, /*
-space! " # $ % & ' ( ) * + , - . / */
-SP , INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, NMC, NMC, INV, /*
-0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
-NU , NU , NU , NU , NU , NU , NU , NU , NU , NU , INV, INV, INV, INV, INV, INV, /*
-@ A B C D E F G H I J K L M N O */
-INV, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-P Q R S T U V W X Y Z [ \ ] ^ _ */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, INV, INV, INV, INV, INV, /*
-` a b c d e f g h i j k l m n o */
-INV, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
-p q r s t u v w x y z { | } ~ 127 */
-NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV,
-INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV, INV
-};
-
-/* This table maps ASCII to the system character set. */
-int iso646charset[] = {
-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,
-32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
-96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
-112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-/* This table maps the C0 part of ISO646 to the system character set. */
-/* We through in 32 and 127 for free, since ISO 2022 maps them in
-automatically. */
-int iso646C0charset[] = {
-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,
-32, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, 127,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-/* This table maps the G0 part of ISO646 to the system character set. */
-int iso646G0charset[] = {
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
-96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
-112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-int iso8859_1charset[] = {
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
-176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
-192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
-208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
-224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-int iso6429C1charset[] = {
-128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
-144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
diff --git a/usr.bin/sgmls/sgmls/lextabe.c b/usr.bin/sgmls/sgmls/lextabe.c
deleted file mode 100644
index 5cfe0de..0000000
--- a/usr.bin/sgmls/sgmls/lextabe.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/* This file was automatically generated by genlex. Do not edit. */
-
-#include "config.h"
-#include "entity.h"
-#include "sgmldecl.h"
-
-UNCH lexcnm[] = {
- 6, 5, 5, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 9, 5, 5,
- 5, 5, 5, 5, 5, 5, 14, 5, 5, 5, 5, 5, 7, 5, 5, 12,
- 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 26, 0, 0, 0,
-13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0,
-15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 23,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 18,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 22, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 5,
-};
-
-UNCH lexcon[] = {
- 6, 5, 5, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 9, 5, 5,
- 5, 5, 5, 5, 5, 5, 14, 5, 5, 5, 5, 5, 7, 5, 5, 12,
- 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 0, 0, 0,
-13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,
-15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 24, 22,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 20, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 5,
-};
-
-UNCH lexgrp[] = {
- 6, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 3, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 5, 5, 5,
- 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 11, 19, 17,
- 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 10, 23, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 18, 0, 0, 16,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 13, 0, 12,
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 15, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0,
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 5,
-};
-
-UNCH lexlms[] = {
- 6, 5, 5, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 9, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 5, 5, 12,
- 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20, 2, 2, 0,
-13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 2, 0, 0,
- 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17, 0, 19, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18, 0, 2, 2, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 5,
-};
-
-UNCH lexmark[] = {
- 6, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 5, 5, 5,
- 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 21, 11, 17, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0,
- 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 20, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 13, 22, 12,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 14, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 5,
-};
-
-UNCH lexsd[] = {
- 6, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 5, 5, 5,
- 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6,
- 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1,
- 9, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 12, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 11, 0, 10,
- 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 0, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 0, 1, 1,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 5,
-};
-
-UNCH lextoke[] = {
- 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0,
-};
-
-UNCH lexmin[] = {
- 6, 5, 5, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 9, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 5, 5, 12,
- 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 5,
-};
-
-UNCH lextran[] = {
- 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,
-32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
-96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
-112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
-128, 193, 194, 195, 196, 197, 198, 199, 200, 201, 138, 139, 140, 141, 142, 143,
-144, 209, 210, 211, 212, 213, 214, 215, 216, 217, 154, 155, 156, 157, 158, 159,
-160, 161, 226, 227, 228, 229, 230, 231, 232, 233, 170, 171, 172, 173, 174, 175,
-176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
-192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
-208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
-224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
-};
-
-
-int iso646charset[] = {
- 0, 1, 2, 3, 55, 45, 46, 47, 22, 5, 37, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,
- 64, 90, 127, 123, 91, 108, 80, 125, 77, 93, 92, 78, 107, 96, 75, 97,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 122, 94, 76, 126, 110, 111,
-124, 193, 194, 195, 196, 197, 198, 199, 200, 201, 209, 210, 211, 212, 213, 214,
-215, 216, 217, 226, 227, 228, 229, 230, 231, 232, 233, 173, 224, 189, 176, 109,
-121, 129, 130, 131, 132, 133, 134, 135, 136, 137, 145, 146, 147, 148, 149, 150,
-151, 152, 153, 162, 163, 164, 165, 166, 167, 168, 169, 192, 79, 208, 161, 7,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-int iso646G0charset[] = {
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
- 64, 90, 127, 123, 91, 108, 80, 125, 77, 93, 92, 78, 107, 96, 75, 97,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 122, 94, 76, 126, 110, 111,
-124, 193, 194, 195, 196, 197, 198, 199, 200, 201, 209, 210, 211, 212, 213, 214,
-215, 216, 217, 226, 227, 228, 229, 230, 231, 232, 233, 173, 224, 189, 176, 109,
-121, 129, 130, 131, 132, 133, 134, 135, 136, 137, 145, 146, 147, 148, 149, 150,
-151, 152, 153, 162, 163, 164, 165, 166, 167, 168, 169, 192, 79, 208, 161, 7,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-int iso646G0charset[] = {
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
- 64, 90, 127, 123, 91, 108, 80, 125, 77, 93, 92, 78, 107, 96, 75, 97,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 122, 94, 76, 126, 110, 111,
-124, 193, 194, 195, 196, 197, 198, 199, 200, 201, 209, 210, 211, 212, 213, 214,
-215, 216, 217, 226, 227, 228, 229, 230, 231, 232, 233, 173, 224, 189, 176, 109,
-121, 129, 130, 131, 132, 133, 134, 135, 136, 137, 145, 146, 147, 148, 149, 150,
-151, 152, 153, 162, 163, 164, 165, 166, 167, 168, 169, 192, 79, 208, 161, 7,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-int iso8859_1charset[] = {
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
- 65, 170, 74, 177, 159, 178, 106, 181, 187, 180, 154, 138, 95, 202, 175, 188,
-144, 143, 234, 250, 190, 160, 182, 179, 157, 218, 155, 139, 183, 184, 185, 171,
-100, 101, 98, 102, 99, 103, 158, 104, 116, 113, 114, 115, 120, 117, 118, 119,
-172, 105, 237, 238, 235, 239, 236, 191, 128, 253, 254, 251, 252, 186, 174, 89,
- 68, 69, 66, 70, 67, 71, 156, 72, 84, 81, 82, 83, 88, 85, 86, 87,
-140, 73, 205, 206, 203, 207, 204, 225, 112, 221, 222, 219, 220, 141, 142, 223,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-int iso646C0charset[] = {
- 0, 1, 2, 3, 55, 45, 46, 47, 22, 5, 37, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,
- 64, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, 7,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
-
-int iso6429C1charset[] = {
- 4, 6, 8, 9, 10, 20, 21, 23, 26, 27, 32, 33, 34, 35, 36, 40,
- 41, 42, 43, 44, 48, 49, 51, 52, 53, 54, 56, 57, 58, 59, 62, 255,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED,
-};
diff --git a/usr.bin/sgmls/sgmls/lextoke.h b/usr.bin/sgmls/sgmls/lextoke.h
deleted file mode 100644
index d2bcfa0..0000000
--- a/usr.bin/sgmls/sgmls/lextoke.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* LEXTOKE.H: Symbols for tokenization lexical classes.
-*/
-#define INV 0 /* Invalid Chars Not allowed in an SGML name. */
-#define REC 1 /* Record Boundary RS and RE. */
-#define SEP 2 /* Separator TAB. */
-#define SP 3 /* SPACE */
-#define NMC 4 /* NAMECHAR . _ Period, underscore (plus NMS, NUM). */
-#define NMS 5 /* NAMESTRT Lower and uppercase letters */
-#define NU 6 /* NUMERAL Numerals */
-#define EOB 7 /* NONCHAR 28 End disk buffer. */
diff --git a/usr.bin/sgmls/sgmls/lineout.c b/usr.bin/sgmls/sgmls/lineout.c
deleted file mode 100644
index 794eff8..0000000
--- a/usr.bin/sgmls/sgmls/lineout.c
+++ /dev/null
@@ -1,656 +0,0 @@
-/* lineout.c -
- Implements line-oriented output format.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-#include "std.h"
-#include "entity.h" /* Templates for entity control blocks. */
-#include "adl.h" /* Definitions for attribute list processing. */
-#include "sgmlmain.h" /* Main interface to SGML services. */
-#include "lineout.h"
-#include "appl.h"
-
-static VOID flush_data P((void));
-static VOID define_external_entity P((PNE));
-static VOID define_entity P((UNCH *));
-static VOID handle_attributes P((UNCH *, struct ad *));
-static VOID handle_token_list P((UNCH *, struct ad *, int));
-static VOID handle_single_token P((UNCH *, struct ad *, int));
-static VOID output_notation P((UNCH *, UNCH *, UNCH *));
-static VOID output_internal_entity P((UNCH *, int, UNCH *));
-static VOID output_external_entity P((UNCH *, int, UNIV, UNCH *, UNCH *,
- UNCH *));
-static VOID output_subdoc P((UNCH *, UNIV, UNCH *, UNCH *));
-#ifdef SUPPORT_SUBDOC
-static VOID process_subdoc P((UNCH *, UNIV));
-#endif /* SUPPORT_SUBDOC */
-static VOID output_record_end P((void));
-static VOID output_pcdata P((UNS, UNCH *));
-static VOID output_cdata P((UNS, UNCH *));
-static VOID output_sdata P((UNS, UNCH *));
-static VOID output_entity_reference P((UNCH *));
-static VOID output_start_tag P((UNCH *));
-static VOID output_end_tag P((UNCH *));
-static VOID output_processing_instruction P((UNS, UNCH *));
-static VOID output_implied_attribute P((UNCH *, UNCH *));
-static char *attribute_type_string P((int));
-static VOID output_begin_attribute P((UNCH *, UNCH *, int));
-static VOID output_attribute_token P((UNS, UNCH *));
-static VOID output_end_attribute P((void));
-static VOID print_data P((UNS, UNCH *, int));
-static VOID print_string P((UNS, UNCH *, int));
-static VOID print_id P((UNIV, UNCH *, UNCH *));
-static VOID print_filename P((char *));
-static VOID output_location P((void));
-static VOID output_appinfo P((UNS, UNCH *));
-
-static int have_data = 0;
-static char *current_filename = 0;
-static unsigned long current_lineno = 0;
-
-VOID process_document(subdocsw)
-int subdocsw;
-{
- enum sgmlevent rc;
- struct rcbtag rcbtag;
- struct rcbdata rcbdaf;
-
- while ((rc = sgmlnext(&rcbdaf, &rcbtag)) != SGMLEOD) {
-#ifdef SUPPORT_SUBDOC
- if (rc == SGMLDAF && !CONTERSW(rcbdaf) && NDESW(rcbdaf)
- && NEXTYPE(NEPTR(rcbdaf)) == ESNSUB) {
- if (!suppsw && !sgmlment(NEENAME(NEPTR(rcbdaf))))
- define_external_entity(NEPTR(rcbdaf));
- process_subdoc(NEENAME(NEPTR(rcbdaf)) + 1,
- NEID(NEPTR(rcbdaf)));
- continue;
- }
-#endif /* SUPPORT_SUBDOC */
- if (!suppsw)
- switch (rc) {
- case SGMLDAF:
- if (CONTERSW(rcbdaf))
- break;
- if (CDESW(rcbdaf))
- output_cdata(CDATALEN(rcbdaf), CDATA(rcbdaf));
- else if (SDESW(rcbdaf))
- output_sdata(CDATALEN(rcbdaf), CDATA(rcbdaf));
- else if (NDESW(rcbdaf)) {
- assert(NEXTYPE(NEPTR(rcbdaf)) != ESNSUB);
- if (!sgmlment(NEENAME(NEPTR(rcbdaf))))
- define_external_entity(NEPTR(rcbdaf));
- output_entity_reference(NEENAME(NEPTR(rcbdaf)) + 1);
- }
- else
- output_pcdata(CDATALEN(rcbdaf), CDATA(rcbdaf));
- break;
- case SGMLSTG:
- if (CONTERSW(rcbtag))
- break;
- if (ALPTR(rcbtag))
- handle_attributes((UNCH *)NULL, ALPTR(rcbtag));
- output_start_tag(CURGI(rcbtag));
- break;
- case SGMLETG:
- if (CONTERSW(rcbtag))
- break;
- output_end_tag(CURGI(rcbtag));
- break;
- case SGMLPIS:
- if (CONTERSW(rcbdaf))
- break;
- output_processing_instruction(PDATALEN(rcbdaf),
- PDATA(rcbdaf));
- break;
- case SGMLREF:
- if (CONTERSW(rcbdaf))
- break;
- output_record_end();
- break;
- case SGMLAPP:
- if (CONTERSW(rcbdaf))
- break;
- if (!subdocsw)
- output_appinfo(ADATALEN(rcbdaf), ADATA(rcbdaf));
- break;
- default:
- abort();
- }
- }
-}
-
-/* Output an indication that the document was conforming. */
-
-VOID output_conforming()
-{
- if (!suppsw)
- printf("%c\n", CONFORMING_CODE);
-}
-
-static VOID define_external_entity(p)
-PNE p;
-{
- if (NEXTYPE(p) == ESNSUB)
- output_subdoc(NEENAME(p) + 1, NEID(p), NEPUBID(p), NESYSID(p));
- else {
- if (!NEDCNMARK(p))
- output_notation(NEDCN(p) + 1, NEDCNPUBID(p), NEDCNSYSID(p));
- output_external_entity(NEENAME(p) + 1, NEXTYPE(p), NEID(p),
- NEPUBID(p), NESYSID(p), NEDCN(p) + 1);
- if (NEAL(p))
- handle_attributes(NEENAME(p) + 1, NEAL(p));
- }
-}
-
-static VOID define_entity(ename)
-UNCH *ename;
-{
- int rc;
- PNE np;
- UNCH *tp;
-
- if (sgmlment(ename)) /* already defined it */
- return;
- rc = sgmlgent(ename, &np, &tp);
- switch (rc) {
- case 1:
- define_external_entity(np);
- break;
- case 2:
- case 3:
- output_internal_entity(ename + 1, rc == 3, tp);
- break;
- }
-}
-
-/* ENT is the name of the entity with which these attributes are associated;
-if it's NULL, they're associated with the next start tag. */
-
-static VOID handle_attributes(ent, al)
-UNCH *ent;
-struct ad *al;
-{
- int aln;
-
- for (aln = 1; aln <= ADN(al); aln++) {
- if (GET(ADFLAGS(al, aln), AERROR))
- ;
- else if (GET(ADFLAGS(al, aln), AINVALID))
- ;
- else if (ADVAL(al, aln) == NULL)
- output_implied_attribute(ent, ADNAME(al, aln));
- else if (ADTYPE(al, aln) >= ATKNLIST)
- handle_token_list(ent, al, aln);
- else
- handle_single_token(ent, al, aln);
- if (BITON(ADFLAGS(al, aln), AGROUP))
- aln += ADNUM(al, aln);
- }
-}
-
-static VOID handle_token_list(ent, al, aln)
-UNCH *ent;
-struct ad *al;
-int aln;
-{
- UNCH *ptr;
- int i;
- if (ADTYPE(al, aln) == AENTITYS) {
- ptr = ADVAL(al, aln);
- for (i = 0; i < ADNUM(al, aln); i++) {
- /* Temporarily make token look like normal
- name with length and EOS. */
- UNCH c = ptr[*ptr + 1];
- ptr[*ptr + 1] = '\0';
- *ptr += 2;
- define_entity(ptr);
- *ptr -= 2;
- ptr += *ptr + 1;
- *ptr = c;
- }
- }
- output_begin_attribute(ent, ADNAME(al, aln), ADTYPE(al, aln));
- ptr = ADVAL(al, aln);
- for (i = 0; i < ADNUM(al, aln); i++) {
- /* The first byte is a length NOT including the length
- byte; the tokens are not EOS terminated. */
- output_attribute_token(*ptr, ptr + 1);
- ptr += *ptr + 1;
- }
- output_end_attribute();
-}
-
-static VOID handle_single_token(ent, al, aln)
-UNCH *ent;
-struct ad *al;
-int aln;
-{
- if (ADTYPE(al, aln) == ANOTEGRP && !DCNMARK(ADDATA(al, aln).x))
- output_notation(ADVAL(al, aln) + 1,
- ADDATA(al, aln).x->pubid,
- ADDATA(al, aln).x->sysid);
- else if (ADTYPE(al, aln) == AENTITY)
- define_entity(ADVAL(al, aln));
- output_begin_attribute(ent, ADNAME(al, aln), ADTYPE(al, aln));
- if (ADTYPE(al, aln) == ACHARS) {
- putchar(' ');
- print_string(ustrlen(ADVAL(al, aln)), ADVAL(al, aln), 0);
- }
- else
- output_attribute_token(*ADVAL(al, aln) - 2, ADVAL(al, aln) + 1);
- output_end_attribute();
-}
-
-static VOID output_notation(name, pubid, sysid)
-UNCH *name;
-UNCH *pubid, *sysid;
-{
- flush_data();
- print_id((UNIV)0, pubid, sysid);
- printf("%c%s\n", DEFINE_NOTATION_CODE, name);
-}
-
-static VOID output_internal_entity(ename, is_sdata, text)
-UNCH *ename;
-int is_sdata;
-UNCH *text;
-{
- flush_data();
- printf("%c%s %s ", DEFINE_INTERNAL_ENTITY_CODE, ename,
- is_sdata ? "SDATA" : "CDATA");
- print_string(text ? ustrlen(text) : 0, text, 0);
- putchar('\n');
-}
-
-static VOID output_subdoc(nm, id, pubid, sysid)
-UNCH *nm;
-UNIV id;
-UNCH *pubid, *sysid;
-{
- flush_data();
- print_id(id, pubid, sysid);
- printf("%c%s\n", DEFINE_SUBDOC_ENTITY_CODE, nm);
-}
-
-#ifdef SUPPORT_SUBDOC
-
-static VOID process_subdoc(nm, id)
-UNCH *nm;
-UNIV id;
-{
- if (!suppsw) {
- flush_data();
- output_location();
- printf("%c%s\n", START_SUBDOC_CODE, nm);
- fflush(stdout);
- }
- fflush(stderr);
-
- if (id) {
- char **argv;
- int ret;
-
- argv = make_argv(id);
- ret = run_process(argv);
- if (ret != 0)
- suberr++;
-
- current_filename = 0;
- free(argv);
- if (ret == 0)
- get_subcaps();
- }
- else {
- suberr++;
- appl_error(E_SUBDOC, nm);
- }
-
- if (!suppsw)
- printf("%c%s\n", END_SUBDOC_CODE, nm);
-}
-
-#endif /* SUPPORT_SUBDOC */
-
-static VOID output_external_entity(nm, xtype, id, pubid, sysid, dcn)
-UNCH *nm, *dcn;
-UNIV id;
-UNCH *pubid, *sysid;
-int xtype;
-{
- char *type;
-
- flush_data();
-
- print_id(id, pubid, sysid);
-
- switch (xtype) {
- case ESNCDATA:
- type = "CDATA";
- break;
- case ESNNDATA:
- type = "NDATA";
- break;
- case ESNSDATA:
- type = "SDATA";
- break;
- default:
- return;
- }
- printf("%c%s %s %s\n", DEFINE_EXTERNAL_ENTITY_CODE, nm, type, dcn);
-}
-
-static VOID output_record_end()
-{
- static UNCH re = RECHAR;
- print_data(1, &re, 0);
-}
-
-static VOID output_pcdata(n, s)
-UNS n;
-UNCH *s;
-{
- print_data(n, s, 0);
-}
-
-static VOID output_cdata(n, s)
-UNS n;
-UNCH *s;
-{
- print_data(n, s, 0);
-}
-
-static VOID output_sdata(n, s)
-UNS n;
-UNCH *s;
-{
- print_data(n, s, 1);
-}
-
-static VOID output_entity_reference(s)
-UNCH *s;
-{
- flush_data();
- output_location();
- printf("%c%s\n", REFERENCE_ENTITY_CODE, s);
-}
-
-static VOID output_start_tag(s)
-UNCH *s;
-{
- flush_data();
- output_location();
- printf("%c%s\n", START_CODE, s);
-}
-
-static VOID output_end_tag(s)
-UNCH *s;
-{
- flush_data();
- printf("%c%s\n", END_CODE, s);
-}
-
-static VOID output_processing_instruction(n, s)
-UNS n;
-UNCH *s;
-{
- flush_data();
- output_location();
- putchar(PI_CODE);
- print_string(n, s, 0);
- putchar('\n');
-}
-
-static VOID output_appinfo(n, s)
-UNS n;
-UNCH *s;
-{
- flush_data();
- output_location();
- putchar(APPINFO_CODE);
- print_string(n, s, 0);
- putchar('\n');
-}
-
-
-static VOID output_implied_attribute(ent, aname)
-UNCH *ent, *aname;
-{
- flush_data();
- if (ent)
- printf("%c%s %s IMPLIED\n", DATA_ATTRIBUTE_CODE, ent, aname);
- else
- printf("%c%s IMPLIED\n", ATTRIBUTE_CODE, aname);
-}
-
-static char *attribute_type_string(type)
-int type;
-{
- switch (type) {
- case ANMTGRP:
- case ANAME:
- case ANMTOKE:
- case ANUTOKE:
- case ANUMBER:
- case ANAMES:
- case ANMTOKES:
- case ANUTOKES:
- case ANUMBERS:
- case AID:
- case AIDREF:
- case AIDREFS:
- return "TOKEN";
- case ANOTEGRP:
- return "NOTATION";
- case ACHARS:
- return "CDATA";
- case AENTITY:
- case AENTITYS:
- return "ENTITY";
- }
-#if 0
- fatal("invalid attribute type %d", type);
-#endif
- return "INVALID";
-}
-
-static VOID output_begin_attribute(ent, aname, type)
-UNCH *ent, *aname;
-int type;
-{
- flush_data();
- if (ent)
- printf("%c%s %s %s", DATA_ATTRIBUTE_CODE, ent, aname,
- attribute_type_string(type));
- else
- printf("%c%s %s", ATTRIBUTE_CODE, aname,
- attribute_type_string(type));
-
-}
-
-static VOID output_attribute_token(vallen, val)
-UNS vallen;
-UNCH *val;
-{
- putchar(' ');
- for (; vallen > 0; --vallen, ++val)
- putchar(*val);
-}
-
-static VOID output_end_attribute()
-{
- putchar('\n');
-}
-
-static VOID print_data(n, s, is_sdata)
-UNS n;
-UNCH *s;
-int is_sdata;
-{
- if (n > 0 || is_sdata) {
- if (n == 1 && *s == RECHAR)
- current_lineno++;
- else
- output_location();
- if (!have_data)
- putchar(DATA_CODE);
- print_string(n, s, is_sdata);
- have_data = 1;
- }
-}
-
-static VOID flush_data()
-{
- if (have_data) {
- putchar('\n');
- have_data = 0;
- }
-}
-
-static VOID output_location()
-{
- char *filename;
- unsigned long lineno;
- int filename_changed = 0;
-
- if (!locsw)
- return;
- if (!sgmlloc(&lineno, &filename))
- return;
- if (!current_filename || strcmp(filename, current_filename) != 0)
- filename_changed = 1;
- else if (lineno == current_lineno)
- return;
- flush_data();
- printf("%c%lu", LOCATION_CODE, lineno);
- current_lineno = lineno;
- if (filename_changed) {
- putchar(' ');
- print_filename(filename);
- current_filename = filename;
- }
- putchar('\n');
-}
-
-static VOID print_string(slen, s, is_sdata)
-UNS slen;
-UNCH *s;
-int is_sdata;
-{
- if (is_sdata)
- fputs("\\|", stdout);
- while (slen > 0) {
- UNCH ch = *s++;
- slen--;
- if (ch == DELSDATA) {
- if (is_sdata)
- ; /* I don't think this should happen */
- else
- fputs("\\|", stdout);
- ;
- }
- else if (ch == DELCDATA)
- ;
- else {
- if (ch == DELNONCH) {
- if (!slen)
- break;
- ch = UNSHIFTNON(*s);
- s++;
- slen--;
- }
- switch (ch) {
- case RECHAR:
- fputs("\\n", stdout);
- break;
- case '\\':
- fputs("\\\\", stdout);
- break;
- default:
- if (ISASCII(ch) && isprint(ch))
- putchar(ch);
- else
- printf("\\%03o", ch);
- break;
- }
- }
- }
- if (is_sdata)
- fputs("\\|", stdout);
-}
-
-
-static VOID print_id(id, pubid, sysid)
-UNIV id;
-UNCH *pubid;
-UNCH *sysid;
-{
-
- if (pubid) {
- putchar(PUBID_CODE);
- print_string(ustrlen(pubid), pubid, 0);
- putchar('\n');
- }
-
- if (sysid) {
- putchar(SYSID_CODE);
- print_string(ustrlen(sysid), sysid, 0);
- putchar('\n');
- }
-
- if (id) {
- char *p;
-
- for (p = id; *p != '\0'; p++) {
- putchar(FILE_CODE);
- do {
- switch (*p) {
- case '\\':
- fputs("\\\\", stdout);
- break;
- case '\n':
- fputs("\\n", stdout);
- break;
- default:
- if (ISASCII(*p) && isprint((UNCH)*p))
- putchar(*p);
- else
- printf("\\%03o", (UNCH)*p);
- break;
- }
- } while (*++p);
- putchar('\n');
- }
- }
-}
-
-static VOID print_filename(s)
-char *s;
-{
- for (; *s; s++)
- switch (*s) {
- case '\\':
- fputs("\\\\", stdout);
- break;
- case '\n':
- fputs("\\n", stdout);
- break;
- default:
- if (ISASCII(*s) && isprint((UNCH)*s))
- putchar(*s);
- else
- printf("\\%03o", (UNCH)*s);
- break;
- }
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/lineout.h b/usr.bin/sgmls/sgmls/lineout.h
deleted file mode 100644
index f3c4231..0000000
--- a/usr.bin/sgmls/sgmls/lineout.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* lineout.h */
-
-/* Output codes used by sgmls. */
-
-#define DATA_CODE '-'
-#define START_CODE '('
-#define END_CODE ')'
-#define ATTRIBUTE_CODE 'A'
-#define DATA_ATTRIBUTE_CODE 'D'
-#define REFERENCE_ENTITY_CODE '&'
-#define DEFINE_NOTATION_CODE 'N'
-#define DEFINE_EXTERNAL_ENTITY_CODE 'E'
-#define DEFINE_INTERNAL_ENTITY_CODE 'I'
-#define PI_CODE '?'
-#define DEFINE_SUBDOC_ENTITY_CODE 'S'
-#define START_SUBDOC_CODE '{'
-#define END_SUBDOC_CODE '}'
-#define LOCATION_CODE 'L'
-#define APPINFO_CODE '#'
-#define PUBID_CODE 'p'
-#define SYSID_CODE 's'
-#define FILE_CODE 'f'
-#define CONFORMING_CODE 'C'
diff --git a/usr.bin/sgmls/sgmls/main.c b/usr.bin/sgmls/sgmls/main.c
deleted file mode 100644
index 25ead40..0000000
--- a/usr.bin/sgmls/sgmls/main.c
+++ /dev/null
@@ -1,650 +0,0 @@
-/* main.c -
- Main program for sgmls.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-#include "std.h"
-#include "getopt.h"
-#include "entity.h" /* Templates for entity control blocks. */
-#include "adl.h" /* Definitions for attribute list processing. */
-#include "sgmlmain.h" /* Main interface to SGML services. */
-#include "appl.h"
-#include "alloc.h"
-
-#define READCNT 512
-
-/* Before using argv[0] in error messages, strip off everything up to and
-including the last character in prog that occurs in PROG_PREFIX. */
-
-#ifndef PROG_PREFIX
-#define PROG_PREFIX "/"
-#endif /* not PROG_PREFIX */
-
-/* Message catalogue name. */
-#define CAT_NAME "sgmls"
-/* Message set to use for application error messages. */
-#define APP_SET 4
-/* Message set to use for error messages from catalog.c. */
-#define CAT_SET 5
-#define CATALOG_ERROR_HEADER_MSGNO 20
-#define CATALOG_ERROR_HEADER_TEXT "Catalog error at %s, line %lu"
-
-#ifdef HAVE_EXTENDED_PRINTF
-#define xvfprintf vfprintf
-#else
-extern int xvfprintf P((FILE *, char *, va_list));
-#endif
-
-static VOID usage P((void));
-static VOID fatal VP((int, ...));
-static VOID do_error P((int, va_list));
-static VOID swinit P((struct switches *));
-static VOID write_caps P((char *, struct sgmlcap *));
-static VOID do_catalog_error();
-
-static UNIV make_docent P((int, char **));
-static char *munge_program_name P((char *, char *));
-static VOID die P((void));
-#ifdef SUPPORT_SUBDOC
-static VOID build_subargv P((struct switches *));
-static VOID cleanup P((void));
-static char *create_subcap_file P((void));
-#endif /* SUPPORT_SUBDOC */
-
-static char *errlist[] = {
- 0,
- "Out of memory",
- "Cannot open SGML document entity",
- "Cannot exec `%s': %s",
- "Cannot fork: %s",
- "Error waiting for process: %s",
- "Program %s got fatal signal %d",
- "Cannot open `%s': %s",
- "Subdocument capacity botch",
- "Non-existent subdocument entity `%s' not processed",
-};
-
-int suppsw = 0; /* Non-zero means suppress output. */
-int locsw = 0; /* Non-zero means generate location info. */
-static char *prog; /* Program name (for error messages). */
-static nl_catd catd; /* Message catalogue descriptor. */
-static char *capfile = 0; /* File for capacity report. */
-extern char *version_string;
-static CATALOG catalog; /* Entity catalog. */
-
-char options[] = {
- 'c', ':', 'd', 'e', 'g', 'i', ':', 'l', 'o', ':', 'p', 'r', 's', 'u', 'v',
- 'm', ':',
-#ifdef CANT_REDIRECT_STDERR
- 'f', ':',
-#endif /* CANT_REDIRECT_STDERR */
-#ifdef TRACE
- 'x', ':', 'y', ':',
-#endif /* TRACE */
- '\0'
-};
-
-#ifdef SUPPORT_SUBDOC
-int suberr = 0; /* Error in subdocument. */
-static char *subargv[sizeof(options)];
-static int subargc = 0;
-static char nopenbuf[sizeof(long)*3 + 1];
-static char sgmldecl_file[L_tmpnam];
-static char subcap_file[L_tmpnam];
-#endif
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
- static char stderr_buf[BUFSIZ];
- int opt;
-#ifdef CANT_REDIRECT_STDERR
- char *errfile = 0;
-#endif
- struct sgmlcap cap;
- struct switches sw;
- int nincludes = 0; /* number of -i options */
- setbuf(stderr, stderr_buf);
-
- /* Define MAIN_HOOK in config.h if some function needs to be called here. */
-#ifdef MAIN_HOOK
- MAIN_HOOK(argc, argv);
-#endif
-#ifdef SUPPORT_SUBDOC
- subargv[subargc++] = argv[0];
-#endif
-
- prog = argv[0] = munge_program_name(argv[0], "sgmls");
-
- catd = catopen(CAT_NAME, 0);
- catalog = catalog_create(do_catalog_error);
- swinit(&sw);
-
- while ((opt = getopt(argc, argv, options)) != -1) {
- switch (opt) {
- case 'm':
- catalog_load_file(catalog, optarg);
- break;
- case 'l': /* Generate location information. */
- locsw = 1;
- break;
- case 'c': /* Print capacity usage. */
- sw.swcap = 1;
- capfile = optarg;
- break;
- case 's': /* Suppress output. */
- suppsw = 1;
- break;
- case 'd': /* Report duplicate entity declarations. */
- sw.swdupent = 1;
- break;
- case 'e': /* Provide entity stack trace in error msg. */
- sw.swenttr = 1;
- break;
-#ifdef CANT_REDIRECT_STDERR
- case 'f': /* Redirect errors. */
- errfile = optarg;
- break;
-#endif /* CANT_REDIRECT_STDERR */
- case 'g': /* Provide GI stack trace in error messages. */
- sw.sweltr = 1;
- break;
- case 'p': /* Parse only the prolog. */
- sw.onlypro = 1;
- suppsw = 1;
- break;
- case 'r': /* Give warning for defaulted references. */
- sw.swrefmsg = 1;
- break;
- case 'u':
- sw.swundef = 1;
- break;
-#ifdef TRACE
- case 'x': /* Trace options for the document body. */
- sw.trace = optarg;
- break;
- case 'y': /* Trace options for the prolog. */
- sw.ptrace = optarg;
- break;
-#endif /* TRACE */
- case 'v': /* Print the version number. */
- fprintf(stderr, "sgmls version %s\n", version_string);
- fflush(stderr);
- break;
- case 'o':
- sw.nopen = atol(optarg);
- if (sw.nopen <= 0)
- usage();
- break;
- case 'i': /* Define parameter entity as "INCLUDE". */
- sw.includes = (char **)xrealloc((UNIV)sw.includes,
- (nincludes + 2)*sizeof(char *));
- sw.includes[nincludes++] = optarg;
- sw.includes[nincludes] = 0;
- break;
- case '?':
- usage();
- default:
- abort();
- }
- }
-
-#ifdef CANT_REDIRECT_STDERR
- if (errfile) {
- FILE *fp;
- errno = 0;
- fp = fopen(errfile, "w");
- if (!fp)
- fatal(E_OPEN, errfile, strerror(errno));
- fclose(fp);
- errno = 0;
- if (!freopen(errfile, "w", stderr)) {
- /* Can't use fatal() since stderr is now closed */
- printf("%s: ", prog);
- printf(errlist[E_OPEN], errfile, strerror(errno));
- putchar('\n');
- exit(EXIT_FAILURE);
- }
- }
-#endif /* CANT_REDIRECT_STDERR */
-
- (void)sgmlset(&sw);
-
-#ifdef SUPPORT_SUBDOC
- build_subargv(&sw);
-#endif
- if (sgmlsdoc(make_docent(argc - optind, argv + optind)))
- fatal(E_DOC);
-
- process_document(sw.nopen > 0);
- sgmlend(&cap);
- if (capfile)
- write_caps(capfile, &cap);
-#ifdef SUPPORT_SUBDOC
- cleanup();
- if (suberr)
- exit(EXIT_FAILURE);
-#endif /* SUPPORT_SUBDOC */
- if (sgmlgcnterr() > 0)
- exit(EXIT_FAILURE);
- if (!sw.nopen)
- output_conforming();
- exit(EXIT_SUCCESS);
-}
-
-static char *munge_program_name(arg, dflt)
-char *arg, *dflt;
-{
- char *p;
-#ifdef PROG_STRIP_EXTENSION
- char *ext;
-#endif
- if (!arg || !*arg)
- return dflt;
- p = strchr(arg, '\0');
- for (;;) {
- if (p == arg)
- break;
- --p;
- if (strchr(PROG_PREFIX, *p)) {
- p++;
- break;
- }
- }
- arg = p;
-#ifdef PROG_STRIP_EXTENSION
- ext = strrchr(arg, '.');
- if (ext) {
- p = (char *)xmalloc(ext - arg + 1);
- memcpy(p, arg, ext - arg);
- p[ext - arg] = '\0';
- arg = p;
- }
-#endif /* PROG_STRIP_EXTENSION */
-#ifdef PROG_FOLD
-#ifdef PROG_STRIP_EXTENSION
- if (!ext) {
-#endif
- p = xmalloc(strlen(arg) + 1);
- strcpy(p, arg);
- arg = p;
-#ifdef PROG_STRIP_EXTENSION
- }
-#endif
- for (p = arg; *p; p++)
- if (ISASCII((unsigned char)*p) && isupper((unsigned char)*p))
- *p = tolower((unsigned char)*p);
-#endif /* PROG_FOLD */
- return arg;
-}
-
-static UNIV make_docent(argc, argv)
-int argc;
-char **argv;
-{
- UNS len = 1;
- int i;
- UNIV res;
- char *ptr;
- static char *stdinname = STDINNAME;
-
- if (argc == 0) {
- argv = &stdinname;
- argc = 1;
- }
-
- for (i = 0; i < argc; i++)
- len += strlen(argv[i]) + 1;
-
- res = xmalloc(len);
- ptr = (char *)res;
- for (i = 0; i < argc; i++) {
- strcpy(ptr, argv[i]);
- ptr = strchr(ptr, '\0') + 1;
- }
- *ptr = '\0';
- return res;
-}
-
-
-static VOID usage()
-{
- /* Don't mention -o since this are for internal use only. */
- fprintf(stderr, "Usage: %s [-deglprsuv]%s [-c file] [-i entity] [-m file]%s [filename ...]\n",
- prog,
-#ifdef CANT_REDIRECT_STDERR
- " [-f file]",
-#else /* not CANT_REDIRECT_STDERR */
- "",
-#endif /* not CANT_REDIRECT_STDERR */
-#ifdef TRACE
- " [-x flags] [-y flags]"
-#else /* not TRACE */
- ""
-#endif /* not TRACE */
- );
- exit(EXIT_FAILURE);
-}
-
-static VOID die()
-{
-#ifdef SUPPORT_SUBDOC
- cleanup();
-#endif /* SUPPORT_SUBDOC */
- exit(EXIT_FAILURE);
-}
-
-static VOID swinit(swp)
-struct switches *swp;
-{
- swp->swenttr = 0;
- swp->sweltr = 0;
- swp->swbufsz = READCNT+2;
- swp->prog = prog;
- swp->swdupent = 0;
- swp->swrefmsg = 0;
-#ifdef TRACE
- swp->trace = 0;
- swp->ptrace = 0;
-#endif /* TRACE */
- swp->catd = catd;
- swp->catalog = catalog;
- swp->swambig = 1; /* Always check for ambiguity. */
- swp->swundef = 0;
- swp->swcap = 0; /* Don't check capacities. */
- swp->nopen = 0;
- swp->onlypro = 0;
- swp->includes = 0;
- swp->die = die;
-}
-
-#ifdef SUPPORT_SUBDOC
-
-static VOID build_subargv(swp)
-struct switches *swp;
-{
- if (suppsw)
- subargv[subargc++] = "-s";
- if (locsw)
- subargv[subargc++] = "-l";
- if (swp->swdupent)
- subargv[subargc++] = "-d";
- if (swp->swenttr)
- subargv[subargc++] = "-e";
- if (swp->sweltr)
- subargv[subargc++] = "-g";
- if (swp->swrefmsg)
- subargv[subargc++] = "-r";
-#ifdef TRACE
- if (swp->trace) {
- subargv[subargc++] = "-x";
- subargv[subargc++] = swp->trace;
- }
- if (swp->ptrace) {
- subargv[subargc++] = "-y";
- subargv[subargc++] = swp->ptrace;
- }
-#endif /* TRACE */
- subargv[subargc++] = "-o";
- sprintf(nopenbuf, "%ld", swp->nopen + 1);
- subargv[subargc++] = nopenbuf;
-}
-
-
-static
-VOID handler(sig)
-int sig;
-{
- signal(sig, SIG_DFL);
- cleanup();
- raise(sig);
-}
-
-static
-VOID cleanup()
-{
- if (sgmldecl_file[0]) {
- (void)remove(sgmldecl_file);
- sgmldecl_file[0] = '\0';
- }
- if (subcap_file[0]) {
- (void)remove(subcap_file);
- subcap_file[0] = '\0';
- }
-}
-
-static
-char *store_sgmldecl()
-{
- if (!sgmldecl_file[0]) {
- FILE *fp;
- if (signal(SIGINT, SIG_IGN) != SIG_IGN)
- signal(SIGINT, handler);
-#ifdef SIGTERM
- if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
- signal(SIGTERM, handler);
-#endif /* SIGTERM */
-#ifdef SIGPIPE
- if (signal(SIGPIPE, SIG_IGN) != SIG_IGN)
- signal(SIGPIPE, handler);
-#endif
-#ifdef SIGHUP
- if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
- signal(SIGHUP, handler);
-#endif
- tmpnam(sgmldecl_file);
- errno = 0;
- fp = fopen(sgmldecl_file, "w");
- if (!fp)
- fatal(E_OPEN, sgmldecl_file, strerror(errno));
- sgmlwrsd(fp);
- fclose(fp);
- }
- return sgmldecl_file;
-}
-
-static
-char *create_subcap_file()
-{
- if (subcap_file[0] == '\0') {
- FILE *fp;
- tmpnam(subcap_file);
- fp = fopen(subcap_file, "w");
- if (!fp)
- fatal(E_OPEN, subcap_file, strerror(errno));
- fclose(fp);
- }
- return subcap_file;
-}
-
-char **make_argv(id)
-UNIV id;
-{
- int nfiles;
- char *p;
- char **argv;
- int i;
-
- 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";
- argv[i++] = create_subcap_file();
-
- argv[i++] = store_sgmldecl();
-
- for (p = (char *)id; *p; p = strchr(p, '\0') + 1)
- argv[i++] = p;
- argv[i] = 0;
- return argv;
-}
-
-VOID get_subcaps()
-{
- long cap[NCAPACITY];
- FILE *fp;
- int i;
-
- if (!subcap_file[0])
- return;
- errno = 0;
- fp = fopen(subcap_file, "r");
- if (!fp)
- fatal(E_OPEN, subcap_file, strerror(errno));
- for (i = 0; i < NCAPACITY; i++)
- if (fscanf(fp, "%*s %ld", cap + i) != 1)
- fatal(E_CAPBOTCH);
- fclose(fp);
- sgmlsubcap(cap);
-}
-
-
-#endif /* SUPPORT_SUBDOC */
-
-/* Print capacity statistics.*/
-
-static VOID write_caps(name, p)
-char *name;
-struct sgmlcap *p;
-{
- FILE *fp;
- int i;
- fp = fopen(name, "w");
- if (!fp)
- fatal(E_OPEN, name, strerror(errno));
- /* This is in RACT format. */
- for (i = 0; i < NCAPACITY; i++)
- fprintf(fp, "%s %ld\n", p->name[i], p->number[i]*p->points[i]);
- fclose(fp);
-}
-
-UNIV xmalloc(n)
-UNS n;
-{
- UNIV p = malloc(n);
- if (!p)
- fatal(E_NOMEM);
- return p;
-}
-
-UNIV xrealloc(s, n)
-UNIV s;
-UNS n;
-{
- s = s ? realloc(s, n) : malloc(n);
- if (!s)
- fatal(E_NOMEM);
- return s;
-}
-
-static
-#ifdef VARARGS
-VOID fatal(va_alist) va_dcl
-#else
-VOID fatal(int errnum,...)
-#endif
-{
-#ifdef VARARGS
- int errnum;
-#endif
- va_list ap;
-
-#ifdef VARARGS
- va_start(ap);
- errnum = va_arg(ap, int);
-#else
- va_start(ap, errnum);
-#endif
- do_error(errnum, ap);
- va_end(ap);
- exit(EXIT_FAILURE);
-}
-
-#ifdef VARARGS
-VOID appl_error(va_alist) va_dcl
-#else
-VOID appl_error(int errnum,...)
-#endif
-{
-#ifdef VARARGS
- int errnum;
-#endif
- va_list ap;
-
-#ifdef VARARGS
- va_start(ap);
- errnum = va_arg(ap, int);
-#else
- va_start(ap, errnum);
-#endif
- do_error(errnum, ap);
- va_end(ap);
-}
-
-static
-VOID do_error(errnum, ap)
-int errnum;
-va_list ap;
-{
- char *text;
- fprintf(stderr, "%s: ", prog);
- assert(errnum > 0);
- assert(errnum < sizeof(errlist)/sizeof(errlist[0]));
- text = catgets(catd, APP_SET, errnum, errlist[errnum]);
- assert(text != 0);
- xvfprintf(stderr, text, ap);
- fputc('\n', stderr);
- fflush(stderr);
-}
-
-static
-VOID do_catalog_error(filename, lineno, error_number, flags, sys_errno)
-char *filename;
-unsigned long lineno;
-int error_number;
-unsigned flags;
-int sys_errno;
-{
- char *text;
- unsigned indent;
- text = catgets(catd, CAT_SET, error_number,
- (char *)catalog_error_text(error_number)); /* XXX */
- assert(text != 0);
- fprintf(stderr, "%s: ", prog);
- indent = strlen(prog) + 2;
- if (flags & CATALOG_SYSTEM_ERROR)
- fprintf(stderr, text, filename, strerror(sys_errno));
- else {
- unsigned i;
- fprintf(stderr,
- catgets(catd, APP_SET,
- CATALOG_ERROR_HEADER_MSGNO,
- CATALOG_ERROR_HEADER_TEXT),
- filename, lineno);
- fputs(":\n", stderr);
- for (i = 0; i < indent; i++)
- putc(' ', stderr);
- fputs(text, stderr);
- }
- putc('\n', stderr);
- fflush(stderr);
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/md1.c b/usr.bin/sgmls/sgmls/md1.c
deleted file mode 100644
index 66c476d..0000000
--- a/usr.bin/sgmls/sgmls/md1.c
+++ /dev/null
@@ -1,866 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-/* MDADL: Process ATTLIST declaration.
-*/
-VOID mdadl(tbuf)
-UNCH *tbuf; /* Work area for tokenization (tbuf). */
-{
- int i; /* Loop counter; temporary variable. */
- int adlim; /* Number of unused ad slots in al. */
- struct ad *alperm = 0; /* Attribute definition list. */
- int stored = 0;
-
- mdname = key[KATTLIST]; /* Identify declaration for messages. */
- subdcl = 0; /* No subject as yet. */
- parmno = 0; /* No parameters as yet. */
- mdessv = es; /* Save es level for entity nesting check. */
- reqadn = noteadn = 0; /* No required attributes yet. */
- idadn = conradn = 0; /* No special atts yet.*/
- AN(al) = 0; /* Number of attributes defined. */
- ADN(al) = 0; /* Number of ad's in al (atts + name vals).*/
- /* PARAMETER 1: Element name or a group of them.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1: element name or group");
- switch (pcbmd.action) {
- case NAS:
- nmgrp[0] = etddef(tbuf);
- nmgrp[1] = 0;
- break;
- case GRPS:
- parsegrp(nmgrp, &pcbgrnm, tbuf);
- break;
- case RNS: /* Reserved name started. */
- if (ustrcmp(tbuf+1, key[KNOTATION])) {
- mderr(118, tbuf+1, key[KNOTATION]);
- return;
- }
- mdnadl(tbuf);
- return;
- default:
- mderr(121, (UNCH *)0, (UNCH *)0);
- return;
- }
- /* Save first GI for error msgs. */
- if (nmgrp[0])
- subdcl = nmgrp[0]->etdgi+1;
- /* PARAMETER 2: Attribute definition list.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("2: attribute list");
- if (pcbmd.action!=NAS) {
- mderr(120, (UNCH *)0, (UNCH *)0);
- return;
- }
- while (pcbmd.action==NAS) {
- al[ADN(al)+1].adname = savenm(tbuf);
- if ((adlim = ATTCNT-((int)++ADN(al)))<0) {
- mderr(111, (UNCH *)0, (UNCH *)0);
- adlfree(al, 1);
- return;
- }
- ++AN(al);
- if (mdattdef(adlim, 0)) {
- adlfree(al, 1);
- return;
- }
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- }
- if (AN(al)>0) { /* Save list only if 1 or more good atts. */
- if (reqadn) SET(ADLF(al), ADLREQ); /* Element must have start-tag. */
- if (noteadn) SET(ADLF(al), ADLNOTE); /* Element cannot be EMPTY. */
- if (conradn) SET(ADLF(al), ADLCONR); /* Element cannot be EMPTY. */
- alperm = (struct ad *)rmalloc((1+ADN(al))*ADSZ);
- memcpy((UNIV)alperm, (UNIV)al, (1+ADN(al))*ADSZ );
- ds.attcnt += AN(al); /* Number of attributes defined. */
- ds.attgcnt += ADN(al) - AN(al); /* Number of att grp members. */
- TRACEADL(alperm);
- }
- /* Clear attribute list for next declaration. */
- MEMZERO((UNIV)al, (1+ADN(al))*ADSZ);
-
- /* PARAMETER 3: End of declaration.
- */
- /* Next pcb.action was set during attribute definition loop. */
- TRACEMD(emd);
- if (pcbmd.action!=EMD) {mderr(126, (UNCH *)0, (UNCH *)0); return;}
- if (es!=mdessv) synerr(37, &pcbmd);
-
- /* EXECUTE: Store the definition for each element name specified.
- */
- TRACEGRP(nmgrp);
- for (i = 0; nmgrp[i]; i++) {
- if (nmgrp[i]->adl) { /* Error if an ADL exists. */
- mderr(112, (UNCH *)0, (UNCH *)0);
- continue;
- }
- nmgrp[i]->adl = alperm; /* If virgin, store the adl ptr. */
- stored = 1;
- if (alperm && nmgrp[i]->etdmod)
- etdadl(nmgrp[i]); /* Check for conflicts with ETD. */
- }
- if (!stored && alperm) {
- adlfree(alperm, 1);
- frem((UNIV)alperm);
- }
-}
-/* ETDADL: Check compatibility between ETD and ADL.
-*/
-VOID etdadl(p)
-struct etd *p; /* Pointer to element type definition. */
-{
- parmno = 0;
- /* Minimizable element cannot have required attribute. */
- if (GET(p->etdmin, SMO) && GET(p->adl[0].adflags, ADLREQ)) {
- mderr(40, (UNCH *)0, (UNCH *)0);
- RESET(p->etdmin, SMO);
- }
- /* Empty element cannot have NOTATION attribute.
- Attribute is not removed (too much trouble), but we trap
- attempts to specify it on the start-tag in adlval().
- */
- if (GET(p->etdmod->ttype, MNONE)) {
- if (GET(p->adl[0].adflags, ADLNOTE))
- mderr(83, (UNCH *)0, (UNCH *)0);
-
- /* Empty element cannot have CONREF attribute.
- Attribute is not removed because it just acts
- like IMPLIED anyway.
- */
- if (GET(p->adl[0].adflags, ADLCONR))
- mderr(85, (UNCH *)0, (UNCH *)0);
- }
-#if 0
- /* "-" should not be specified for the end-tag minimization if
- the element has a content reference attribute. */
- if (GET(p->adl[0].adflags, ADLCONR) && BITON(p->etdmin, EMM))
- mderr(153, (UNCH *)0, (UNCH *)0);
-#endif
-}
-/* MDNADL: Process ATTLIST declaration for notation.
- TO DO: Pass deftab and dvtab as parameters so
- that prohibited types can be handled by leaving
- them out of the tables.
-*/
-VOID mdnadl(tbuf)
-UNCH *tbuf; /* Work area for tokenization (tbuf). */
-{
- int i; /* Loop counter; temporary variable. */
- int adlim; /* Number of unused ad slots in al. */
- struct ad *alperm = 0; /* Attribute definition list. */
- int stored = 0;
-
- /* PARAMETER 1: Notation name or a group of them.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1: notation name or group");
- switch (pcbmd.action) {
- case NAS:
- nnmgrp[0] = dcndef(tbuf);
- nnmgrp[1] = 0;
- break;
- case GRPS:
- parsngrp(nnmgrp, &pcbgrnm, tbuf);
- break;
- default:
- mderr(121, (UNCH *)0, (UNCH *)0);
- return;
- }
- subdcl = nnmgrp[0]->ename+1; /* Save first name for error msgs. */
- /* PARAMETER 2: Attribute definition list.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("2: attribute list");
- if (pcbmd.action!=NAS) {
- mderr(120, (UNCH *)0, (UNCH *)0);
- return;
- }
- while (pcbmd.action==NAS) {
- al[ADN(al)+1].adname = savenm(tbuf);
- if ((adlim = ATTCNT-((int)ADN(al)++))<0) {
- mderr(111, (UNCH *)0, (UNCH *)0);
- adlfree(al, 1);
- return;
- }
- ++AN(al);
- if (mdattdef(adlim, 1)) {
- adlfree(al, 1);
- return;
- }
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- }
- if (AN(al)>0) { /* Save list only if 1 or more good atts. */
- alperm = (struct ad *)rmalloc((1+ADN(al))*ADSZ);
- memcpy((UNIV)alperm, (UNIV)al, (1+ADN(al))*ADSZ );
- ds.attcnt += AN(al); /* Number of attributes defined. */
- ds.attgcnt += ADN(al) - AN(al); /* Number of att grp members. */
- TRACEADL(alperm);
- }
- /* Clear attribute list for next declaration. */
- MEMZERO((UNIV)al, (1+ADN(al))*ADSZ);
-
- /* PARAMETER 3: End of declaration.
- */
- /* Next pcb.action was set during attribute definition loop. */
- TRACEMD(emd);
- if (pcbmd.action!=EMD) {mderr(126, (UNCH *)0, (UNCH *)0); return;}
- if (es!=mdessv) synerr(37, &pcbmd);
-
- /* EXECUTE: Store the definition for each notation name specified.
- */
- TRACENGR(nnmgrp);
- for (i = 0; nnmgrp[i]; i++) {
- if (nnmgrp[i]->adl) { /* Error if an ADL exists. */
- mderr(112, (UNCH *)0, (UNCH *)0);
- continue;
- }
- nnmgrp[i]->adl = alperm; /* If virgin, store the adl ptr. */
- if (nnmgrp[i]->entsw)
- fixdatt(nnmgrp[i]);
- stored = 1;
- TRACEDCN(nnmgrp[i]);
- }
- if (!stored && alperm) {
- adlfree(alperm, 1);
- frem((UNIV)alperm);
- }
-}
-
-/* Data attributes have been specified for notation p, but entities
-have already been declared with notation p. Fix up the definitions of
-all entities with notation p. Generate an error for any data
-attribute that was required. */
-
-VOID fixdatt(p)
-struct dcncb *p;
-{
- int i;
- for (i = 0; i < ENTHASH; i++) {
- struct entity *ep;
- for (ep = etab[i]; ep; ep = ep->enext)
- if (ep->estore == ESN && ep->etx.n && ep->etx.n->nedcn == p) {
- int adn;
- initatt(p->adl);
- /* Don't use adlval because if there were required
- attributes the error message wouldn't say what
- entity was involved. */
- for (adn = 1; adn <= ADN(al); adn++) {
- if (GET(ADFLAGS(al,adn), AREQ)) {
- sgmlerr(218, &pcbstag, ADNAME(al,adn),
- ep->ename + 1);
- SET(ADFLAGS(al,adn), AINVALID);
- }
- if (BITON(ADFLAGS(al, adn), AGROUP))
- adn += ADNUM(al, adn);
- }
- storedatt(ep->etx.n);
- }
- }
-}
-
-/* MDATTDEF: Process an individual attribute definition.
- The attribute name is parsed by the caller.
- Duplicate attributes are parsed, but removed from list.
- Returns 0 if successful, otherwise returns 1.
-*/
-int mdattdef(adlim, datt)
-int adlim; /* Remaining capacity of al (in tokens).*/
-int datt; /* Non-zero if a data attribute. */
-{
- int deftype; /* Default value type: 0=not keyword. */
- int errsw = 0; /* 1=semantic error; ignore att. */
- int novalsw = 0; /* 1=semantic error; treat as IMPLIED. */
- int attadn = (int)ADN(al); /* Save ad number of this attribute. */
- struct parse *grppcb = NULL; /* PCB for name/token grp parse. */
- int errcode; /* Error type returned by PARSEVAL, ANMTGRP. */
- UNCH *advalsv; /* Save area for permanent value ptr. */
-
- /* PARAMETER 1: Attribute name (parsed by caller).
- */
- TRACEMD("1: attribute name");
- if (anmget((int)ADN(al)-1, al[attadn].adname)) {
- errsw = 1;
- mderr(99, ADNAME(al,attadn), (UNCH *)0);
- }
- ADNUM(al,attadn) = ADFLAGS(al,attadn) = ADLEN(al,attadn) = 0;
- ADVAL(al,attadn) = 0; ADDATA(al,attadn).x = 0; ADTYPE(al,attadn) = ANMTGRP;
- /* PARAMETER 2: Declared value.
- */
- parsemd(lbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("2: declared value");
- switch (pcbmd.action) {
- case NAS: /* Keyword for value type. */
- switch (ADTYPE(al,attadn) = (UNCH)mapsrch(dvtab, lbuf+1)) {
- case 0:
- mderr(100, ADNAME(al,attadn), lbuf+1);
- return 1;
- case ANOTEGRP:
- if (datt) {
- errsw = 1;
- mderr(156, (UNCH *)0, (UNCH *)0);
- }
- else if (!noteadn) noteadn = ADN(al);
- else {
- errsw = 1;
- mderr(101, ADNAME(al,attadn), (UNCH *)0);
- }
- grppcb = &pcbgrnm; /* NOTATION requires name grp. */
- parsemd(lbuf, NAMECASE, &pcblitp, NAMELEN);/* Get GRPO*/
- break;
- case AID:
- if (datt) {
- errsw = 1;
- mderr(144, (UNCH *)0, (UNCH *)0);
- }
- else if (!idadn)
- idadn = attadn;
- else {
- errsw = 1;
- mderr(102, ADNAME(al,attadn), (UNCH *)0);
- }
- break;
- case AIDREF:
- case AIDREFS:
- if (datt) {
- errsw = 1;
- mderr(155, (UNCH *)0, (UNCH *)0);
- }
- break;
- case AENTITY:
- case AENTITYS:
- if (datt) {
- errsw = 1;
- mderr(154, (UNCH *)0, (UNCH *)0);
- }
- break;
- }
- break;
- case GRPS:
- grppcb = &pcbgrnt; /* Normal grp is name token grp. */
- break;
- case EMD:
- mderr(103, ADNAME(al,attadn), (UNCH *)0);
- return 1;
- default:
- mderr(104, ADNAME(al,attadn), (UNCH *)0);
- return 1;
- }
- /* PARAMETER 2A: Name token group.
- */
- if (grppcb != NULL) {
- TRACEMD("2A: name group");
- switch (pcbmd.action) {
- case GRPS: /* Name token list. */
- SET(ADFLAGS(al,attadn), AGROUP);
- /* Call routine to parse group, create ad entries in adl. */
- errcode = anmtgrp(grppcb, al+attadn,
- (GRPCNT<adlim ? GRPCNT+1 : adlim+1),
- &al[attadn].adnum, ADN(al));
- if (errcode<=0) {
- if (adlim < GRPCNT)
- mderr(111, (UNCH *)0, (UNCH *)0);
- else
- mderr(105, ADNAME(al,attadn), (UNCH *)0);
- return 1;
- }
- ADN(al) += ADNUM(al,attadn); /* Add grp size to total ad cnt.*/
- break;
- default:
- mderr(106, ADNAME(al,attadn), (UNCH *)0);
- return 1;
- }
- }
- /* PARAMETER 3: Default value keyword.
- */
- parsemd(lbuf, AVALCASE,
- (ADTYPE(al,attadn)==ACHARS) ? &pcblitr : &pcblitt, LITLEN);
- TRACEMD("3: default keyword");
- switch (pcbmd.action) {
- case RNS: /* Keyword. */
- deftype = mapsrch(deftab, lbuf+1);
- switch (deftype) {
- case DFIXED: /* FIXED */
- SET(ADFLAGS(al,attadn), AFIXED);
- parsemd(lbuf, AVALCASE,
- (ADTYPE(al,attadn)==ACHARS) ? &pcblitr : &pcblitt,
- LITLEN); /* Real default. */
- goto parm3x; /* Go process specified value. */
- case DCURR: /* CURRENT: If ID, treat as IMPLIED. */
- if (ADTYPE(al,attadn)==AID) {
- mderr(80, ADNAME(al,attadn), (UNCH *)0);
- break;
- }
- if (datt) {
- mderr(157, (UNCH *)0, (UNCH *)0);
- break;
- }
- SET(ADFLAGS(al,attadn), ACURRENT);
- break;
- case DREQ: /* REQUIRED */
- SET(ADFLAGS(al,attadn), AREQ); ++reqadn;
- break;
- case DCONR: /* CONREF */
- if (ADTYPE(al,attadn)==AID) {
- mderr(107, ADNAME(al,attadn), (UNCH *)0);
- break;
- }
- if (datt) {
- mderr(158, (UNCH *)0, (UNCH *)0);
- break;
- }
- SET(ADFLAGS(al,attadn), ACONREF); conradn = 1;
- case DNULL: /* IMPLIED */
- break;
- default: /* Unknown keyword is an error. */
- mderr(108, ADNAME(al,attadn), lbuf+1);
- errsw = 1;
- }
- if (errsw) {
- /* Ignore erroneous att. */
- adlfree(al, attadn);
- --AN(al);
- ADN(al) = (UNCH)attadn-1;
- }
- return(0);
- default:
- break;
- }
- /* PARAMETER 3x: Default value (non-keyword).
- */
- parm3x:
- TRACEMD("3x: default (non-keyword)");
- if (ADTYPE(al,attadn)==AID) { /* If ID, treat as IMPLIED. */
- mderr(81, ADNAME(al,attadn), (UNCH *)0);
- novalsw = 1; /* Keep parsing to keep things straight. */
- }
- switch (pcbmd.action) {
- case LIT: /* Literal. */
- case LITE: /* Literal. */
- /* Null string (except CDATA) is error: msg and treat as IMPLIED. */
- if (*lbuf == '\0' && ADTYPE(al,attadn)!=ACHARS) {
- mderr(82, ADNAME(al,attadn), (UNCH *)0);
- novalsw = 1;
- }
- break;
- case NAS: /* Name character string. */
- case NMT: /* Name character string. */
- case NUM: /* Number or number token string. */
- /* The name won't have a length byte because AVALCASE was specified. */
- break;
- case CDR:
- parsetkn(lbuf, NMC, LITLEN);
- break;
- case EMD:
- mderr(109, ADNAME(al,attadn), (UNCH *)0);
- return 1;
- default:
- mderr(110, ADNAME(al,attadn), (UNCH *)0);
- return 1;
- }
- if (errsw) {
- /* Ignore erroneous att. */
- adlfree(al, attadn);
- --AN(al);
- ADN(al) = (UNCH)attadn-1;
- return(0);
- }
- if (novalsw) return(0);
-
- /* PARAMETER 3y: Validate and store default value.
- */
- if (ADTYPE(al,attadn)==ACHARS) {
- UNS len = vallen(ACHARS, 0, lbuf);
- if (len > LITLEN) {
- /* Treat as implied. */
- sgmlerr(224, &pcbmd, ADNAME(al,attadn), (UNCH *)0);
- return 0;
- }
- /* No more checking for CDATA value. */
- ADNUM(al,attadn) = 0; /* CDATA is 0 tokens. */
- ADVAL(al,attadn) = savestr(lbuf);/* Store default; save ptr. */
- ADLEN(al,attadn) = len;
- ds.attdef += len;
- return 0;
- }
- /* Parse value and save token count (GROUP implies 1 token). */
- advalsv = (UNCH *)rmalloc(ustrlen(lbuf)+2); /* Storage for tokenized value. */
- errcode = parseval(lbuf, (UNS)ADTYPE(al,attadn), advalsv);
- if (BITOFF(ADFLAGS(al,attadn), AGROUP)) ADNUM(al,attadn) = (UNCH)tokencnt;
-
- /* If value was invalid, or was a group member that was not in the group,
- issue an appropriate message and set the error switch. */
- if (errcode)
- {sgmlerr((UNS)errcode, &pcbmd, ADNAME(al,attadn), lbuf); errsw = 1;}
- else if ( BITON(ADFLAGS(al,attadn), AGROUP)
- && !amemget(&al[attadn], (int)ADNUM(al,attadn), advalsv) ) {
- sgmlerr(79, &pcbmd, ADNAME(al,attadn), advalsv+1);
- errsw = 1;
- }
- ADLEN(al,attadn) = vallen(ADTYPE(al,attadn), ADNUM(al,attadn), advalsv);
- if (ADLEN(al,attadn) > LITLEN) {
- sgmlerr(224, &pcbmd, ADNAME(al,attadn), (UNCH *)0);
- ADLEN(al,attadn) = 0;
- errsw = 1;
- }
- /* For valid tokenized value, save it and update statistics. */
- if (!errsw) {
- ADVAL(al,attadn) = advalsv;
- ds.attdef += ADLEN(al,attadn);
- return 0;
- }
- /* If value was bad, free the value's storage and treat as
- IMPLIED or REQUIRED. */
- frem((UNIV)advalsv); /* Release storage for value. */
- ADVAL(al,attadn) = NULL; /* And make value NULL. */
- return 0;
-}
-/* ANMTGRP: Parse a name or name token group, create attribute descriptors
- for its members, and add them to the attribute descriptor list.
- The parse either terminates or returns a good token, so no
- switch is needed.
-*/
-int anmtgrp(pcb, nt, grplim, adn, adsz)
-struct parse *pcb; /* PCB for name or name token grp. */
-struct ad nt[]; /* Buffer for creating name token list. */
-int grplim; /* Maximum size of list (plus 1). */
-UNS *adn; /* Ptr to number of names or tokens in grp. */
-int adsz; /* Size of att def list. */
-{
- UNCH adtype = (UNCH)(pcb==&pcbgrnt ? ANMTGRP:ANOTEGRP);/*Attribute type.*/
- int essv = es; /* Entity stack level when grp started. */
-
- *adn = 0; /* Group is empty to start. */
- while (parse(pcb)!=GRPE && *adn<grplim) {
- switch (pcb->action) {
- case NAS_: /* Name or name token (depending on pcb). */
- case NMT_:
- parsenm(lbuf, NAMECASE);
- nt[*adn+1].adname = savenm(lbuf);
- if (antvget((int)(adsz+*adn), nt[*adn+1].adname, (UNCH **)0))
- mderr(98, ntoa((int)*adn+1), nt[*adn+1].adname+1);
- nt[++*adn].adtype = adtype;
- nt[*adn].addef = NULL;
- continue;
-
- case EE_: /* Entity ended (correctly or incorrectly). */
- if (es<essv) {synerr(37, pcb); essv = es;}
- continue;
-
- case PIE_: /* PI entity reference (invalid). */
- entpisw = 0; /* Reset PI entity indicator. */
- synerr(59, pcb);
- continue;
-
- default:
- break;
- }
- break;
- }
- if (es!=essv) synerr(37, pcb);
- if (*adn==grplim) return -1;
- else return *adn; /* Return number of tokens. */
-}
-/* MDDTDS: Process start of DOCTYPE declaration (through MSO).
-*/
-VOID mddtds(tbuf)
-UNCH *tbuf; /* Work area for tokenization[LITLEN+2]. */
-{
- struct fpi fpicb; /* Formal public identifier structure. */
- union etext etx; /* Ptr to entity text. */
- UNCH estore = ESD; /* Entity storage class. */
- int emdsw = 0; /* 1=end of declaration found; 0=not yet. */
-
- mdname = key[KDOCTYPE]; /* Identify declaration for messages. */
- subdcl = NULL; /* No subject as yet. */
- parmno = 0; /* No parameters as yet. */
- mdessv = es; /* Save es for checking entity nesting. */
- dtdrefsw = 0; /* No external DTD entity as yet. */
- /* PARAMETER 1: Document type name.
- */
- pcbmd.newstate = 0;
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1: doc type name");
- if (pcbmd.action!=NAS) {mderr(120, (UNCH *)0, (UNCH *)0); return;}
- dtype = savenm(tbuf);
- subdcl = dtype+1; /* Subject of declaration for error msgs. */
-
- /* PARAMETER 2: External identifier keyword or MDS.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("2: extid or MDS");
- switch (pcbmd.action) {
- case NAS:
- if (mdextid(tbuf, &fpicb, dtype+1, &estore, (PNE)0)==0) return;
- if ((etx.x = entgen(&fpicb))==0)
- mderr(146, dtype+1, (UNCH *)0);
- else
- dtdrefsw = 1; /* Signal external DTD entity. */
- break;
- case MDS:
- goto execute;
- default:
- mderr(128, (UNCH *)0, (UNCH *)0);
- return;
- }
- /* PARAMETER 3: MDS or end of declaration.
- */
- TRACEMD("3: MDS or EMD");
- switch (pcbmd.action) {
- default: /* Treat as end of declaration. */
- mderr(126, (UNCH *)0, (UNCH *)0);
- case EMD:
- emdsw = 1;
- case MDS:
- break;
- }
- /* EXECUTE: Store entity definition if an external ID was specified.
- */
- execute:
- if (es!=mdessv) synerr(37, &pcbmd);
- propcb = &pcbmds; /* Prepare to parse doc type definition (MDS). */
- if (dtdrefsw) {
- /* TO DO: If concurrent DTD's supported, free existing
- etext for all but first DTD (or reuse it). */
- entdef(indtdent, estore, &etx);
- ++ds.ecbcnt; ds.ecbtext += entlen;
- if (emdsw) {
- REPEATCC; /* Push back the MDC. */
- *FPOS = lex.d.msc; /* Simulate end of DTD subset. */
- REPEATCC; /* Back up to read MSC next. */
- delmscsw = 1; /* Insert MSC after referenced DTD. */
- }
- }
- indtdsw = 1; /* Allow "DTD only" parameters. */
- return;
-}
-/* MDDTDE: Process DOCTYPE declaration end.
-*/
-VOID mddtde(tbuf)
-UNCH *tbuf; /* Work area for tokenization. */
-{
- mdessv = es; /* Save es for checking entity nesting. */
- propcb = &pcbpro; /* Restore normal prolog parse. */
- indtdsw = 0; /* Prohibit "DTD only" parameters. */
-
- mdname = key[KDOCTYPE]; /* Identify declaration for messages. */
- subdcl = dtype+1; /* Subject of declaration for error msgs. */
- parmno = 0; /* No parameters as yet. */
- /* PARAMETER 4: End of declaration.
- */
- pcbmd.newstate = pcbmdtk;
- parsemd(tbuf, NAMECASE, &pcblitp, LITLEN);
- TRACEMD(emd);
- if (pcbmd.action!=EMD) mderr(126, (UNCH *)0, (UNCH *)0);
- if (es!=mdessv) synerr(37, &pcbmd);
-}
-/* MDELEM: Process ELEMENT declaration.
-*/
-VOID mdelem(tbuf)
-UNCH *tbuf; /* Work area for tokenization (tbuf). */
-{
- UNCH *ranksuff = lbuf; /* Rank suffix. */
- UNS dctype = 0; /* Declared content type (from dctab). */
- UNCH fmin = 0; /* Minimization bit flags. */
- int i; /* Loop counter. */
- UNS u; /* Temporary variable. */
- struct etd **mexgrp, **pexgrp; /* Ptr to model exceptions array. */
- struct thdr *cmod, *cmodsv; /* Ptr to content model. */
- UNCH *etdgi; /* GI of current etd (when going through group).*/
- int minomitted = 0; /* Tag minimization parameters omitted. */
-
- mdname = key[KELEMENT]; /* Identify declaration for messages. */
- subdcl = NULL; /* No subject as yet. */
- parmno = 0; /* No parameters as yet. */
- mdessv = es; /* Save es level for entity nesting check. */
- ranksuff[0] = 0;
- mexgrp = pexgrp = 0;
-
- /* PARAMETER 1: Element name or a group of them.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1: element name or grp");
- switch (pcbmd.action) {
- case NAS:
- nmgrp[0] = etddef(tbuf);
- nmgrp[1] = 0;
- break;
- case GRPS:
- parsegrp(nmgrp, &pcbgrnm, tbuf);
- break;
- default:
- mderr(121, (UNCH *)0, (UNCH *)0);
- return;
- }
- /* Save first GI for trace and error messages. */
- if (nmgrp[0])
- subdcl = nmgrp[0]->etdgi+1;
-
- /* PARAMETER 1A: Rank suffix (optional).
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1A: rank suffix");
- switch (pcbmd.action) {
- case NUM:
- ustrcpy(ranksuff, tbuf);
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- default:
- break;
- }
- /* PARAMETER 2A: Start-tag minimization.
- */
- TRACEMD("2A: start min");
- switch (pcbmd.action) {
- case CDR:
- break;
- case NAS:
- if (!ustrcmp(tbuf+1, key[KO])) {
- if (OMITTAG==YES) SET(fmin, SMO);
- break;
- }
- /* fall through */
- default:
- if (OMITTAG==NO) {minomitted=1; break;}
- mderr(129, tbuf+1, (UNCH *)0);
- return;
- }
- /* Must omit omitted end-tag minimization, if omitted
- start-tag minimization was omitted (because OMITTAG == NO). */
- if (!minomitted) {
- /* PARAMETER 2B: End-tag minimization.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("2B: end min");
- switch (pcbmd.action) {
- case NAS:
- if (ustrcmp(tbuf+1, key[KO])) {mderr(129, tbuf+1, (UNCH *)0); return;}
- if (OMITTAG==YES) SET(fmin, EMO);
- break;
- case MGRP:
- REPEATCC;
- /* fall through */
- case CDR:
- SET(fmin, EMM);
- break;
- default:
- mderr(129, tbuf+1, (UNCH *)0);
- return;
- }
- /* PARAMETER 3: Declared content.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- }
- TRACEMD("3: declared content");
- switch (pcbmd.action) {
- case NAS:
- dctype = mapsrch(dctab, tbuf+1);
- if (!dctype) {mderr(24, tbuf+1, (UNCH *)0); return;}
- /* Eliminate incompatibilities among parameters. */
- if (GET(fmin, SMO) && GET(dctype, MNONE+MCDATA+MRCDATA)) {
- mderr(58, (UNCH *)0, (UNCH *)0);
- RESET(fmin, SMO);
- }
- if (GET(dctype, MNONE) && BITON(fmin, EMM)) {
- mderr(87, (UNCH *)0, (UNCH *)0);
- SET(fmin, EMO);
- }
- /* If valid, process like a content model. */
- case GRPS:
- cmodsv = parsemod((int)(pcbmd.action==GRPS ? 0 : dctype));
- if (cmodsv==0) return;
- u = (dctype ? 1 : cmodsv->tu.tnum+2) * THSZ;
- cmod = (struct thdr *)rmalloc(u);
- memcpy((UNIV)cmod , (UNIV)cmodsv, u );
- ds.modcnt += cmod->tu.tnum;
- TRACEMOD(cmod);
- break;
- default:
- mderr(130, (UNCH *)0, (UNCH *)0);
- return;
- }
- /* PARAMETERS 3A, 3B: Exceptions or end.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- if (BITOFF(cmod->ttype, MCDATA+MRCDATA+MNONE)) {
- /* PARAMETER 3A: Minus exceptions.
- */
- TRACEMD("3A: -grp");
- switch (pcbmd.action) {
- case MGRP:
- /* We cheat and use nnmgrp for this. */
- mexgrp = copygrp((PETD *)nnmgrp,
- u = parsegrp((PETD *)nnmgrp, &pcbgrnm, tbuf));
- ++ds.pmexgcnt; ds.pmexcnt += u-1;
- TRACEGRP(mexgrp);
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- default:
- break;
- }
- /* PARAMETER 3B: Plus exceptions.
- */
- TRACEMD("3B: +grp");
- switch (pcbmd.action) {
- case PGRP:
- pexgrp = copygrp((PETD *)nnmgrp,
- u = parsegrp((PETD *)nnmgrp, &pcbgrnm, tbuf));
- ++ds.pmexgcnt; ds.pmexcnt += u-1;
- TRACEGRP(pexgrp);
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- default:
- break;
- }
- }
- /* PARAMETER 4: End of declaration.
- */
- TRACEMD(emd);
- if (pcbmd.action!=EMD) mderr(126, (UNCH *)0, (UNCH *)0);
- if (es!=mdessv) synerr(37, &pcbmd);
-
- /* EXECUTE: Store the definition for each element name specified.
- */
- TRACEGRP(nmgrp);
- for (i = -1; nmgrp[++i];) {
- etdgi = nmgrp[i]->etdgi;
- if (*ranksuff) {
- if ((tbuf[0] = *etdgi + ustrlen(ranksuff)) - 2 > NAMELEN) {
- mderr(131, etdgi+1, ranksuff);
- continue;
- }
- memcpy(tbuf+1, etdgi+1, *etdgi-1);
- ustrcpy(tbuf+*etdgi-1, ranksuff);
- etdcan(etdgi);
- nmgrp[i] = etddef(tbuf);
- }
- if (nmgrp[i]->etdmod) {mderr(56, etdgi+1, (UNCH *)0); continue;}
- etdset(nmgrp[i], fmin+ETDDCL, cmod, mexgrp, pexgrp, nmgrp[i]->etdsrm);
- ++ds.etdcnt;
- if (nmgrp[i]->adl) etdadl(nmgrp[i]); /* Check ETD conflicts. */
- TRACEETD(nmgrp[i]);
- }
-}
-
-VOID adlfree(al, aln)
-struct ad *al;
-int aln;
-{
- for (; aln <= ADN(al); aln++) {
- frem((UNIV)al[aln].adname);
- if (ADVAL(al, aln))
- frem((UNIV)ADVAL(al, aln));
- if (BITON(ADFLAGS(al, aln), AGROUP)) {
- int i;
- for (i = 0; i < ADNUM(al, aln); i++)
- frem((UNIV)al[aln + i + 1].adname);
- aln += ADNUM(al, aln);
- }
- }
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/md2.c b/usr.bin/sgmls/sgmls/md2.c
deleted file mode 100644
index df7e57e..0000000
--- a/usr.bin/sgmls/sgmls/md2.c
+++ /dev/null
@@ -1,792 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-/* MDENTITY: Process ENTITY declaration.
-*/
-VOID mdentity(tbuf)
-UNCH *tbuf; /* Work area for tokenization[LITLEN+2]. */
-{
- struct fpi fpicb; /* Formal public identifier structure. */
- struct fpi *fpis = &fpicb; /* Ptr to current or #DEFAULT fpi. */
- union etext etx; /* Ptr to entity text. */
- UNCH estore = ESM; /* Entity storage class. */
- struct entity *ecb; /* Ptr to entity control block. */
- int parmsw = 0; /* 1=parameter entity declaration; 0 = not. */
- int defltsw = 0; /* 1=#DEFAULT declaration; 0=not. */
- PNE pne = 0; /* Ptr to N/C/SDATA entity control block. */
-
- mdname = key[KENTITY]; /* Declaration name for messages. */
- subdcl = NULL; /* No subject as yet. */
- parmno = 0; /* No parameters as yet. */
- mdessv = es; /* Save es for checking entity nesting. */
- /* PARAMETER 1: Entity name.
- */
- pcbmd.newstate = 0;
- parsemd(nmbuf, ENTCASE, &pcblitp, NAMELEN);
- TRACEMD("1: entity nm");
- switch (pcbmd.action) {
- case PEN:
- parsemd(nmbuf + 1, ENTCASE, &pcblitp, NAMELEN);
- if (pcbmd.action!=NAS) {mderr(120, (UNCH *)0, (UNCH *)0); return;}
- if (nmbuf[1] == NAMELEN + 2) {
- /* It was too long. */
- nmbuf[0] = NAMELEN + 2;
- nmbuf[NAMELEN + 1] = '\0';
- mderr(65, (UNCH *)0, (UNCH *)0);
- }
- else
- nmbuf[0] = nmbuf[1] + 1; /* Increment length for PERO. */
- nmbuf[1] = lex.d.pero; /* Prefix PERO to name. */
- parmsw = 1; /* Indicate parameter entity. */
- case NAS:
- break;
- case RNS: /* Reserved name started. */
- if (ustrcmp(nmbuf+1, key[KDEFAULT])) {
- mderr(118, nmbuf+1, key[KDEFAULT]);
- return;
- }
- memcpy(nmbuf, indefent, *indefent);/* Copy #DEFAULT to name buffer. */
- fpis = &fpidf; /* Use #DEFAULT fpi if external. */
- defltsw = 1; /* Indicate #DEFAULT is being defined.*/
- break;
- default:
- mderr(122, (UNCH *)0, (UNCH *)0);
- return;
- }
- subdcl = nmbuf+1; /* Subject name for error messages. */
- /* PARAMETER 2: Entity text keyword (optional).
- */
- parsemd(tbuf, NAMECASE, &pcblitp, LITLEN);
- TRACEMD("2: keyword");
- switch (pcbmd.action) {
- case NAS:
- if ((estore = (UNCH)mapsrch(enttab, tbuf+1))==0) {
- estore = parmsw ? ESP : ESF;
- pne = (PNE)rmalloc(NESZ);
- if (mdextid(tbuf, fpis, nmbuf+1+parmsw, &estore, pne)==0)
- return;
- if (defltsw) etx.x = NULL;
- else if ((etx.x = entgen(&fpicb))==0) {
- if (parmsw)
- mderr(148, nmbuf+2, (UNCH *)0);
- else
- mderr(147, nmbuf+1, (UNCH *)0);
- }
- goto parm4;
- }
- if (parmsw && (estore==ESX || estore==ESC)) {
- mderr(38, tbuf+1, (UNCH *)0);
- estore = ESM;
- }
- parsemd(tbuf, NAMECASE, &pcblitp, LITLEN);
- break;
- default:
- estore = ESM;
- break;
- }
- /* PARAMETER 3: Parameter literal.
- */
- TRACEMD("3: literal");
- switch (pcbmd.action) {
- case LITE:
- case LIT:
- switch (estore) {
- case ESM: /* LITERAL: parameter literal required. */
- case ESC: /* CDATA: parameter literal required. */
- case ESX: /* SDATA: parameter literal required. */
- case ESI: /* PI: parameter literal required. */
- etx.c = savestr(tbuf);
- break;
- case ESMD: /* MD: parameter literal required. */
- 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);
- goto bcheck;
- case ESS: /* STARTTAG: parameter literal required. */
- etx.c = sandwich(tbuf, lex.m.stag, lex.m.tagc);
- goto bcheck;
- case ESE: /* ENDTAG: parameter literal required. */
- etx.c = sandwich(tbuf, lex.m.etag, lex.m.tagc);
- bcheck:
- if (etx.c == 0) {
- mderr(225, (UNCH *)0, (UNCH *)0);
- return;
- }
- break;
- }
- break;
- default:
- mderr(123, (UNCH *)0, (UNCH *)0);
- return;
- }
- /* PARAMETER 4: End of declaration.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, LITLEN);
- parm4:
- TRACEMD(emd);
- if (pcbmd.action!=EMD) mderr(126, (UNCH *)0, (UNCH *)0);
- if (es!=mdessv) synerr(37, &pcbmd);
-
- /* EXECUTE: If the entity already exists, ignore the new definition.
- If it is a new entity, store the definition.
- */
- if ((ecb = entfind(nmbuf))!=0 && ecb->estore) {
- if (ecb->dflt) {
- mderr(228, nmbuf + 1, (UNCH *)0);
- hout((THASH)etab, nmbuf, hash(nmbuf, ENTHASH));
- if (ecb->estore == ESN) {
- frem((UNIV)NEID(ecb->etx.n));
- frem((UNIV)ecb->etx.n);
- }
- else if (ecb->estore >= ESFM)
- frem((UNIV)ecb->etx.x);
- frem((UNIV)ecb);
- }
- else {
- /* Duplicate definition: not an error. */
- if (sw.swdupent) mderr(68, nmbuf+1, (UNCH *)0);
- if (estore<ESFM) frem((UNIV)etx.c);
- return;
- }
- }
- ++ds.ecbcnt; /* Do capacity before NOTATION. */
- ds.ecbtext += estore<ESFM ? ustrlen(etx.c) : entlen;
- ecb = entdef(nmbuf, estore, &etx); /* Define the entity. */
- if (estore==ESN) { /* If entity is external: */
- NEENAME(pne) = ecb->ename; /* Store entity name in ne. */
- NEID(pne) = etx.x; /* Store system fileid in ne. */
- NESYSID(pne) = fpis->fpisysis ? savestr(fpis->fpisysis) : 0;
- NEPUBID(pne) = fpis->fpipubis ? savestr(fpis->fpipubis) : 0;
- ecb->etx.n = pne; /* Store ne control block in etx. */
- TRACEESN(pne);
- }
- else if (pne)
- frem((UNIV)pne);
- if (defltsw) {
- ecbdeflt = ecb; /* If #DEFAULT save ecb. */
- if (fpidf.fpipubis)
- fpidf.fpipubis = savestr(fpidf.fpipubis);
- if (fpidf.fpisysis)
- fpidf.fpisysis = savestr(fpidf.fpisysis);
- }
-}
-/* SANDWICH: Catenate a prefix and suffix to a string.
- The result has an EOS but no length.
- Return 0 if the result if longer than LITLEN.
-*/
-UNCH *sandwich(s, pref, suff)
-UNCH *s; /* String, with EOS. */
-UNCH *pref; /* Prefix, with length and EOS. */
-UNCH *suff; /* Suffix, with length and EOS. */
-{
- UNCH *pt;
- UNS slen, tlen;
-
- slen = ustrlen(s);
- tlen = slen + (*pref - 2) + (*suff - 2);
- if (tlen > LITLEN)
- return 0;
- pt = (UNCH *)rmalloc(tlen + 1);
- memcpy(pt, pref + 1, *pref - 2);
- memcpy(pt + (*pref - 2), s, slen);
- memcpy(pt + (*pref - 2) + slen, suff + 1, *suff - 1);
- return pt;
-}
-/* MDEXTID: Process external identifier parameter of a markup declaration.
- On entry, tbuf contains SYSTEM or PUBLIC if all is well.
- NULL is returned if an error, otherwise fpis. If it is a
- valid external data entity, the caller's estore is set to ESN
- and its nxetype is set to the code for the external entity type.
- The event that terminated the parse is preserved in pcb.action,
- so the caller should process it before further parsing.
-*/
-struct fpi *mdextid(tbuf, fpis, ename, estore, pne)
-UNCH *tbuf; /* Work area for tokenization[2*(LITLEN+2)]. */
-struct fpi *fpis; /* FPI structure. */
-UNCH *ename; /* Entity or notation name, with EOS, no length.*/
- /* NOTE: No PERO on parameter entity name. */
-UNCH *estore; /* DTD, general or parameter entity, DCN. */
-PNE pne; /* Caller's external entity ptr. */
-{
- PDCB dcb; /* Ptr to DCN control block. */
- int exidtype; /* External ID type: 0=none 1=system 2=public. */
- int exetype; /* External entity type. */
-
- MEMZERO((UNIV)fpis, (UNS)FPISZ); /* Initialize fpi structure. */
- /* Move entity name into fpi (any PERO was stripped by caller). */
- fpis->fpinm = ename;
- entlen = 0; /* Initialize external ID length. */
-
- /* PARAMETER 1: External identifier keyword or error.
- */
- TRACEMD("1: extid keyword");
- if ((exidtype = mapsrch(exttab, tbuf+1))==0) {
- mderr(29, (UNCH *)0, (UNCH *)0);
- return (struct fpi *)0;
- }
- if (exidtype==EDSYSTEM) goto parm3;
-
- /* PARAMETER 2: Public ID literal.
- */
- /* The length of a minimum literal cannot exceed the value of LITLEN
- in the reference quantity set. */
- parsemd(pubibuf, NAMECASE, &pcblitv, REFLITLEN);
- TRACEMD("2: pub ID literal");
- switch (pcbmd.action) {
- case LITE: /* Use alternative literal delimiter. */
- case LIT: /* Save literal as public ID string. */
- entlen = ustrlen(pubibuf);
- fpis->fpipubis = pubibuf;
- break;
- default:
- mderr(117, (UNCH *)0, (UNCH *)0);
- return (struct fpi *)0; /* Signal error to caller. */
- }
- /* PARAMETER 3: System ID literal.
- */
- parm3:
- parsemd(sysibuf, NAMECASE, &pcblitc, LITLEN);
- TRACEMD("3: sys ID literal");
- if (pcbmd.action==LIT || pcbmd.action==LITE) {
- entlen += ustrlen(sysibuf);
- fpis->fpisysis = sysibuf;
- parsemd(tbuf, NAMECASE, &pcblitp, LITLEN);
- }
- else memcpy(tbuf, sysibuf, *sysibuf);
- if (*estore!=ESF || pcbmd.action!=NAS) goto genfpi;
-
- /* PARAMETER 4: Entity type keyword.
- */
- TRACEMD("4: Entity type");
- if ((exetype = mapsrch(extettab, tbuf+1))==0) {
- mderr(24, tbuf+1, (UNCH *)0);
- return (struct fpi *)0;
- }
- if (exetype==ESNSUB && SUBDOC == NO) {
- mderr(90, tbuf+1, (UNCH *)0);
- return (struct fpi *)0;
- }
-
- NEXTYPE(pne) = (UNCH)exetype; /* Save entity type in caller's ne. */
- *estore = ESN; /* Signal that entity is a data entity. */
-
- if (exetype==ESNSUB) {
- pne->nedcn = 0;
- parsemd(tbuf, NAMECASE, &pcblitp, LITLEN);
- goto genfpi;
- }
- /* PARAMETER 5: Notation name.
- */
- parsemd(lbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("5: notation");
- if (pcbmd.action!=NAS) {mderr(119, tbuf+1, (UNCH *)0); return (struct fpi *)0;}
- /* Locate the data content notation. */
- pne->nedcn = dcb = dcndef(lbuf);
- /* Note that we have defined an entity with this notation.
- If attributes are later defined for this notation, we'll
- have to fix up this entity. */
- dcb->entsw = 1;
-
- /* PARAMETER 6: Data attribute specification.
- */
- parsemd(lbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("6: [att list]");
- if (pcbmd.action!=MDS) { /* No attributes specified. */
- if (dcb->adl == 0)
- NEAL(pne) = 0;
- else {
- initatt(dcb->adl);
- adlval((int)ADN(al), (struct etd *)0);
- storedatt(pne);
- }
- goto genfpi;
- }
- if (dcb->adl==0) { /* Atts specified, but none defined. */
- mderr(22, (UNCH *)0, (UNCH *)0);
- return (struct fpi *)0;
- }
- pcbstag.newstate = pcbstan; /* First separator is optional. */
- if ((parseatt(dcb->adl, tbuf))==0)/* Empty list. */
- mderr(91, (UNCH *)0, (UNCH *)0);
- else {
- adlval((int)ADN(al), (struct etd *)0);
- storedatt(pne);
- }
- parse(&pcbeal); /* Parse the list ending. */
- parsemd(tbuf, NAMECASE, &pcblitp, LITLEN);
-
- /* GENFPI: Builds a formal public identifier structure, including the
- entity name, offsets of the components of the public ID, and
- other data a system might use to identify the actual file.
- */
- genfpi:
- TRACEMD("7: generate fpi");
- fpis->fpistore = *estore - ESFM + 1; /* External entity type: 1-6. */
- if (*estore == ESN) {
- if (NEXTYPE(pne) == ESNSUB)
- fpis->fpinedcn = 0;
- else
- fpis->fpinedcn = NEDCN(pne) + 1;
- }
- /* Analyze public ID and make structure entries. */
- if (exidtype==EDPUBLIC) {
- if (parsefpi(fpis)>0) {
- if (FORMAL==YES)
- mderr(88, fpis->fpipubis, (UNCH *)0);
- fpis->fpiversw = -1; /* Signal bad formal public ID. */
- }
- }
- return fpis;
-}
-
-/* Store a data attribute. */
-
-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++) {
- if (GET(ADFLAGS(al, i), ASPEC))
- ds.attdef += ADLEN(al, i);
- if (NEAL(pne)[i].addef != 0)
- NEAL(pne)[i].addef = savestr(NEAL(pne)[i].addef);
- }
- ds.attcnt += AN(al); /* Number of attributes defined. */
-#if 0
- /* I can't see any reason to increase AVGRPCNT here. */
- ds.attgcnt += ADN(al) - AN(al); /* Number of att grp members. */
-#endif
-}
-
-/* PARSEFPI: Parses a formal public identifier and builds a control block.
- PARSEFPI returns a positive error code (1-10), or 0 if no errors.
- It set fpiversw if no version was specified in the ID and the
- public text is in a class that permits display versions.
- Note: An empty version ("//") can be specified (usually it is
- the non-device-specific form, such as a definitional entity set).
-*/
-int parsefpi(f)
-PFPI f; /* Ptr to formal public identifier structure. */
-{
- UNCH *l; /* Pointer to EOS of public identifier. */
- UNCH *p, *q; /* Ptrs to current field in public identifier. */
- UNS len; /* Field length */
-
- p = f->fpipubis; /* Point to start of identifier. */
- l = p + ustrlen(p); /* Point to EOS of identifier. */
- if ((*p=='+' || *p=='-')
- && p[1] == '/' && p[2] == '/') { /* If owner registered,
- unregistered. */
- f->fpiot = *p; /* Save owner type. */
- p += 3;
- }
- else f->fpiot = '!'; /* Indicate ISO owner identifier. */
- if ((q = pubfield(p, l, '/', &len))==0) /* Find end of owner ID field. */
- return 2;
- f->fpiol = len; /* Save owner ID length. */
- f->fpio = p - f->fpipubis; /* Save offset in pubis to owner ID. */
-
- if ((p = pubfield(q, l, ' ', &len))==0) /* Find end of text class field. */
- return 3;
- *(--p) = EOS; /* Temporarily make class a string. */
- f->fpic = mapsrch(pubcltab, q); /* Check for valid uc class name.*/
- *p++ = ' '; /* Restore the SPACE delimiter. */
- if (f->fpic==0) return 4; /* Error if not valid uc class name.*/
-
- /* The public text class in a notation identifier must be NOTATION. */
- if (f->fpistore == ESK - ESFM + 1 && f->fpic != FPINOT) return 10;
-
- if (*p=='-' && p[1] == '/' && p[2] == '/') { /* If text is unavailable
- public text.*/
- f->fpitt = *p; /* Save text type. */
- p += 3;
- }
- else f->fpitt = '+'; /* Indicate available public text. */
- if ((q = pubfield(p, l, '/', &len))==0) /* Find end of text description. */
- return 6;
- f->fpitl = len; /* Save text description length. */
- f->fpit = p - f->fpipubis; /* Save ptr to description.*/
-
- p = pubfield(q, l, '/', &len); /* Bound language field. */
- if (f->fpic != FPICHARS) {
- int i;
- /* Language must be all upper-case letters. */
- /* The standard only says that it *should* be two letters, so
- don't enforce that. */
- /* Language must be a name, which means it can't be empty. */
- if (len == 0)
- return 7;
- for (i = 0; i < len; i++) {
- /* Don't assume ASCII. */
- if (!strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", q[i]))
- return 7;
- }
- }
- f->fpill = len;
- f->fpil = q - f->fpipubis;
- if (p!=0) { /* If there is a version field: */
- if (f->fpic<FPICMINV) /* Error if class prohibits versions. */
- return 8;
- if ((pubfield(p, l, '/', &len))!=0) /* Bound version field. */
- return 9; /* Error if yet another field. */
- f->fpivl = len; /* Save version length. */
- f->fpiv = p - f->fpipubis; /* Save ptr (in pubis) to version. */
- }
- else if (f->fpic>=FPICMINV) f->fpiversw = 1;/* No version: get the best. */
- return(0);
-}
-/* PUBFIELD: Returns ptr to next field, or NULL if ID has ended.
-*/
-#ifdef USE_PROTOTYPES
-UNCH *pubfield(UNCH *p, UNCH *l, UNCH d, UNS *lenp)
-#else
-UNCH *pubfield(p, l, d, lenp)
-UNCH *p; /* Public identifier field (no length or EOS). */
-UNCH *l; /* Pointer to EOS of public identifier. */
-UNCH d; /* Field delimiter: ' ' or '/'. */
-UNS *lenp; /* Gets field length */
-#endif
-{
- UNCH *psv = p+1; /* Save starting value of p. */
-
- while (p<l) {
- if (*p++==d) { /* Test for delimiter character. */
- *lenp = p - psv; /* Save field length (no len or EOS). */
- if (d=='/' && *p++!=d) /* Solidus requires a second one. */
- continue;
- return(p); /* Return ptr to next field. */
- }
- }
- *lenp = p - --psv; /* Save field length (no len or EOS). */
- return NULL;
-}
-/* MDMS: Process marked section start.
- If already in special parse, bump the level counters and return
- without parsing the declaration.
-*/
-struct parse *mdms(tbuf, pcb)
-UNCH *tbuf; /* Work area for tokenization [NAMELEN+2]. */
-struct parse *pcb; /* Parse control block for this parse. */
-{
- int key; /* Index of keyword in mslist. */
- int ptype; /* Parameter token type. */
- int pcbcode = 0; /* Parse code: 0=same; 2-4 per defines. */
-
- if (++mslevel>TAGLVL) {
- --mslevel;
- sgmlerr(27, (struct parse *)0, ntoa(TAGLVL), (UNCH *)0);
- }
-
- /* If already in IGNORE mode, return without parsing parameters. */
- if (msplevel) {++msplevel; return(pcb);}
-
- parmno = 0; /* No parameters as yet. */
- mdessv = es; /* Save es for checking entity nesting. */
- pcbmd.newstate = pcbmdtk; /* First separator is optional. */
-
- /* PARAMETERS: TEMP, RCDATA, CDATA, IGNORE, INCLUDE, or MDS. */
- while ((ptype = parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN))==NAS){
- if ((key = mapsrch(mstab, tbuf+1))==0) {
- sgmlerr(64, (struct parse *)0, ntoa(parmno), tbuf+1);
- continue;
- }
- if (key==MSTEMP) continue; /* TEMP: for documentation. */
- msplevel = 1; /* Special parse required. */
- if (key>pcbcode) pcbcode = key; /* Update if higher priority. */
- }
- if (ptype!=MDS) {
- NEWCC; /* Syntax error did REPEATCC. */
- sgmlerr(97, (struct parse *)0, lex.m.dso, (UNCH *)0);
- REPEATCC; /* 1st char of marked section. */
- }
- if (es!=mdessv) synerr(37, pcb);
- TRACEMS(1, pcbcode, mslevel, msplevel);
- if (pcbcode==MSIGNORE) pcb = &pcbmsi;
- else if (pcbcode) {
- pcb = pcbcode==MSCDATA ? &pcbmsc : (rcessv = es, &pcbmsrc);
- }
- return(pcb); /* Tell caller whether to change the parse. */
-}
-/* MDMSE: Process marked section end.
- Issue an error if no marked section had started.
-*/
-int mdmse()
-{
- int retcode = 0; /* Return code: 0=same parse; 1=cancel special. */
-
- if (mslevel) --mslevel;
- else sgmlerr(26, (struct parse *)0, (UNCH *)0, (UNCH *)0);
-
- if (msplevel) if (--msplevel==0) retcode = 1;
- TRACEMS(0, retcode, mslevel, msplevel);
- return retcode;
-}
-/* MDNOT: Process NOTATION declaration.
-*/
-VOID mdnot(tbuf)
-UNCH *tbuf; /* Work area for tokenization[LITLEN+2]. */
-{
- struct fpi fpicb; /* Formal public identifier structure. */
- PDCB dcb; /* Ptr to notation entity in dcntab. */
- UNCH estore = ESK; /* Entity storage class. */
-
- mdname = key[KNOTATION]; /* Identify declaration for messages. */
- subdcl = NULL; /* No subject as yet. */
- parmno = 0; /* No parameters as yet. */
- mdessv = es; /* Save es for checking entity nesting. */
-
- /* PARAMETER 1: Notation name.
- */
- pcbmd.newstate = 0;
- parsemd(lbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1: name");
- if (pcbmd.action!=NAS) {mderr(120, (UNCH *)0, (UNCH *)0); return;}
- subdcl = lbuf+1; /* Save notation name for error msgs. */
-
- /* PARAMETER 2: External identifier keyword.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("2: extid");
- if (pcbmd.action!=NAS) {mderr(29, (UNCH *)0, (UNCH *)0); return;}
- if (mdextid(tbuf, &fpicb, lbuf+1, &estore, (PNE)0)==0) return;
-
- /* PARAMETER 3: End of declaration.
- Token was parsed by MDEXTID.
- */
- TRACEMD(emd);
- if (pcbmd.action!=EMD) mderr(126, (UNCH *)0, (UNCH *)0);
- if (es!=mdessv) synerr(37, &pcbmd);
-
- /* EXECUTE: Store notation name.
- */
- if ((dcb = dcnfind(lbuf)) != 0 && dcb->defined) {
- mderr(56, lbuf+1, (UNCH *)0);
- return;
- }
- /* else */
- dcb = dcndef(lbuf);
- dcb->defined = 1;
- dcb->sysid = fpicb.fpisysis ? savestr(fpicb.fpisysis) : 0;
- dcb->pubid = fpicb.fpipubis ? savestr(fpicb.fpipubis) : 0;
- ++ds.dcncnt;
- ds.dcntext += entlen;
- TRACEDCN(dcb);
- return;
-}
-/* DCNDEF: Define a notation and return its DCNCB.
- If caller does not care if it already exists,
- he should specify NULL for the notation text
- so we don't clobber the existing text (if any).
-*/
-struct dcncb *dcndef(nname)
-UNCH *nname; /* Notation name (with length and EOS). */
-{
- return((PDCB)hin((THASH)dcntab, nname, 0, DCBSZ));
-}
-/* DCNFIND: If a notation was declared, return its DCNCB.
- Return NULL if it is not defined.
-*/
-struct dcncb *dcnfind(nname)
-UNCH *nname; /* Notation name (with length and EOS). */
-{
- return((PDCB)hfind((THASH)dcntab, nname, 0));
-}
-#define SRM(i) (srhptr->srhsrm[i]) /* Current entry in SHORTREF map. */
-/* MDSRMDEF: Process short reference mapping declaration.
-*/
-VOID mdsrmdef(tbuf)
-UNCH *tbuf; /* Work area for tokenization[LITLEN+2]. */
-{
- struct entity *entcb; /* Ptr to defined entity. */
- PSRH srhptr; /* Ptr to short reference map hdr (in srhtab).*/
- int srn; /* Short reference delimiter number in srdeltab.*/
- int mapused = 0; /* Has map already been used? */
-
- mdname = key[KSHORTREF]; /* Identify declaration for messages. */
- subdcl = NULL; /* No subject as yet. */
- parmno = 0; /* No parameters as yet. */
- if (!sd.shortref) {mderr(198, (UNCH *)0, (UNCH *)0); return;}
- mdessv = es; /* Save es for checking entity nesting. */
- /* PARAMETER 1: SHORTREF map name.
- */
- pcbmd.newstate = 0;
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1: map nm");
- if (pcbmd.action!=NAS) {mderr(120, (UNCH *)0, (UNCH *)0); return;}
- if ((srhptr = srhfind(tbuf))!=0) {
- mapused = 1;
- /* Error if map was declared (not just used). */
- if (SRM(0)) {mderr(56, tbuf+1, (UNCH *)0); return;}
- }
- else srhptr = srhdef(tbuf); /* Create map with SRs mapped to NULL.*/
- SRM(0) = (PECB)srhptr; /* Indicate map was actually declared.*/
- subdcl = srhptr->ename+1; /* Save map name for error msgs. */
-
- while (parsemd(tbuf, NAMECASE, &pcblitp, SRMAXLEN) == LIT
- || pcbmd.action==LITE ) {
- /* PARAMETER 2: Delimiter string.
- */
- TRACEMD("2: SR string");
- if ((srn = mapsrch(lex.s.dtb, tbuf))==0) {
- mderr(124, tbuf, (UNCH *)0);
- goto cleanup;
- }
- /* PARAMETER 3: Entity name.
- */
- parsemd(tbuf, ENTCASE, &pcblitp, NAMELEN);
- TRACEMD("3: entity");
- if (pcbmd.action!=NAS) {mderr(120, (UNCH *)0, (UNCH *)0); goto cleanup;}
- if ((entcb = entfind(tbuf))==0) {
- union etext etx;
- etx.x = 0;
- entcb = entdef(tbuf, '\0', &etx);
- }
- if (SRM(srn)) {
- mderr(56, (srn<lex.s.prtmin ? (UNCH *)lex.s.pdtb[srn]
- : lex.s.dtb[srn].mapnm), (UNCH *)0);
- continue;
- }
- SRM(srn) = entcb;
- if (srn>=lex.s.fce && srn!=lex.s.hyp && srn!=lex.s.hyp2
- && srn!=lex.s.lbr && srn!=lex.s.rbr)
- lexcnm[*lex.s.dtb[srn].mapnm] = lex.l.fce;
- else if (srn==lex.s.spc) lexcnm[' '] = lex.l.spcr;
- }
- /* PARAMETER 4: End of declaration.
- */
- TRACEMD(emd);
- if (parmno==2)
- {mderr((UNS)(pcbmd.action==EMD ? 28:123), (UNCH *)0, (UNCH *)0); goto cleanup;}
- if (pcbmd.action!=EMD) mderr(126, (UNCH *)0, (UNCH *)0);
- if (es!=mdessv) synerr(37, &pcbmd);
- ++ds.srcnt;
- TRACESRM("SHORTREF", srhptr->srhsrm, (UNCH *)0);
- return;
-
- cleanup:
- /* Don't free the map if the map was in use (because of a USEMAP
- declaration) before this declaration. */
- if (mapused)
- MEMZERO((UNIV)srhptr->srhsrm, sizeof(PECB)*(lex.s.dtb[0].mapdata+1));
- else {
- frem((UNIV)srhptr->srhsrm);
- hout((THASH)srhtab, srhptr->ename, 0);
- frem((UNIV)srhptr);
- }
-}
-/* MDSRMUSE: Activate a short reference map.
-*/
-VOID mdsrmuse(tbuf)
-UNCH *tbuf; /* Work area for tokenization[LITLEN+2]. */
-{
- PSRH srhptr; /* Ptr to short reference map hdr (in srhtab).*/
- TECB srmptr; /* Ptr to short reference map (in header). */
- int i; /* Loop counter; temporary variable. */
-
- mdname = key[KUSEMAP]; /* Identify declaration for messages. */
- subdcl = NULL; /* No subject as yet. */
- parmno = 0; /* No parameters as yet. */
- mdessv = es; /* Save es for checking entity nesting. */
- /* PARAMETER 1: SHORTREF map name or "#EMPTY".
- */
- pcbmd.newstate = 0;
- parsemd(lbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("1: map nm");
- subdcl = lbuf+1; /* Subject name for error messages. */
- switch (pcbmd.action) {
- case RNS: /* Empty SHORTREF map requested. */
- if (ustrcmp(lbuf+1, key[KEMPTY])) {
- mderr(118, lbuf+1, key[KEMPTY]);
- return;
- }
- srmptr = SRMNULL;
- break;
- case NAS: /* Map name specified; save if undefined. */
- if ((srhptr = srhfind(lbuf))==0) {
- if (!indtdsw) {mderr(125, (UNCH *)0, (UNCH *)0); return;}
- srmptr = NULL;
- }
- else
- srmptr = srhptr->srhsrm;
- break;
- default:
- mderr(120, (UNCH *)0, (UNCH *)0);
- return;
- }
- /* PARAMETER 2: Element name or a group of them. (In DTD only.)
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD("2: GI or grp");
- switch (pcbmd.action) {
- case NAS:
- if (!indtdsw) {mderr(142, (UNCH *)0, (UNCH *)0); return;}
- nmgrp[0] = etddef(tbuf);
- nmgrp[1] = (PETD)NULL;
- break;
- case GRPS:
- if (!indtdsw) {mderr(142, (UNCH *)0, (UNCH *)0); return;}
- parsegrp(nmgrp, &pcbgrnm, tbuf);
- break;
- case EMD:
- if (indtdsw) {mderr(28, (UNCH *)0, (UNCH *)0); return;}
- if (docelsw) {mderr(233, (UNCH *)0, (UNCH *)0); return;}
- tags[ts].tsrm = srmptr;
- TRACESRM("USEMAP", tags[ts].tsrm, tags[ts].tetd->etdgi+1);
- goto realemd;
- default:
- mderr(indtdsw ? 121 : 126, (UNCH *)0, (UNCH *)0);
- return;
- }
- /* PARAMETER 3: End of declaration.
- */
- parsemd(tbuf, NAMECASE, &pcblitp, NAMELEN);
- TRACEMD(emd);
- if (pcbmd.action!=EMD) mderr(126, (UNCH *)0, (UNCH *)0);
- /* If map has not yet been defined, do it and get map pointer. */
- if (!srmptr) srmptr = (srhdef(lbuf))->srhsrm;
-
- /* Store the map pointer for each element name specified.
- */
- TRACEGRP(nmgrp);
- for (i = -1; nmgrp[++i];) {
- if (!nmgrp[i]->etdsrm) nmgrp[i]->etdsrm = srmptr;
- else if (sw.swdupent) mderr(68, nmgrp[i]->etdgi+1, (UNCH *)0);
- }
- realemd:
- if (es!=mdessv) synerr(37, &pcbmd);
-}
-/* SRHDEF: Define a SHORTREF map and return ptr to its header.
- All entries in map are mapped to NULL.
- Caller must determine whether it already exists.
-*/
-PSRH srhdef(sname)
-UNCH *sname; /* SHORTREF map name (with length and EOS). */
-{
- PSRH srh; /* Ptr to SHORTREF map hdr in srhtab. */
-
- (srh = (PSRH)hin((THASH)srhtab, sname, 0, SRHSZ))->srhsrm =
- (TECB)rmalloc((UNS)(lex.s.dtb[0].mapdata+1)*sizeof(PECB));
- return(srh);
-}
-/* SRHFIND: If a SHORTREF map was declared, return the ptr to its header.
- Return NULL if it is not defined.
-*/
-PSRH srhfind(sname)
-UNCH *sname; /* SHORTREF map name (with length and EOS). */
-{
- return((PSRH)hfind((THASH)srhtab, sname, 0));
-}
-#undef SRM
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/msg.h b/usr.bin/sgmls/sgmls/msg.h
deleted file mode 100644
index 5526337..0000000
--- a/usr.bin/sgmls/sgmls/msg.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
-Severity codes:
-I information (not an SGML error at all)
-W warning (an SGML markup error but it knows what you mean)
-E error
-C critical (fatal)
-
-Type codes:
-R resource
-C ?context/content
-M minimization
-Q quantity
-S syntax
-D declaration
-U unsupported feature
-*/
-struct {
- char *text;
- char severity;
- char type;
-} messages[] = {
-/* 0 */ {0},
-/* 1 */ {"%s element not allowed at this point in %s element", 'E', 'C'},
-/* 2 */ {"%s markup declaration not permitted here; declaration ended", 'E', 'D'},
-/* 3 */ {"Length of name, number, or token exceeded NAMELEN or LITLEN limit", 'E', 'Q'},
-/* 4 */ {"Non-SGML character ignored", 'E', 'S'},
-/* 5 */ {"%s end-tag ignored: doesn't end any open element (current is %s)", 'E', 'C'},
-/* 6 */ {"%s start-tag exceeds open element limit; possible lies from %s on", 'E', 'Q'},
-/* 7 */ {"Start-tag omitted from %s with empty content", 'E', 'M'},
-/* 8 */ {"Illegal entity end in markup or delimited text", 'E', 'S'},
-/* 9 */ {"Incorrect character in markup; markup terminated", 'E', 'S'},
-/* 10 */ {"Data not allowed at this point in %s element", 'E', 'C'},
-/* 11 */ {"No element declaration for %s end-tag GI; end-tag ignored", 'E', 'C'},
-/* 12 */ {"%s name ignored: not a syntactically valid SGML name", 'E', 'S'},
-/* 13 */ {"%s = \"%s\" attribute ignored: not defined for this element", 'E', 'C'},
-/* 14 */ {"%s = \"%s\" attribute value defaulted: invalid character", 'E', 'S'},
-/* 15 */ {"%s = \"%s\" attribute value defaulted: token too long", 'E', 'Q'},
-/* 16 */ {"%s = \"%s\" attribute value defaulted: too many tokens", 'E', 'C'},
-/* 17 */ {"%s = \"%s\" attribute value defaulted: wrong token type", 'E', 'C'},
-/* 18 */ {"%s = \"%s\" attribute value defaulted: token not in group", 'E', 'C'},
-/* 19 */ {"Required %s attribute was not specified; may affect processing", 'E', 'C'},
-/* 20 */ {"%s end-tag implied by %s end-tag; not minimizable", 'E', 'M'},
-/* 21 */ {"%s start-tag implied by %s start-tag; not minimizable", 'W', 'M'},
-/* 22 */ {"Possible attributes treated as data because none were defined", 'E', 'C'},
-/* 23 */ {"Duplicate specification occurred for \"%s\"; may affect processing", 'E', 'D'},
-/* 24 */ {"\"%s\" keyword invalid; declaration terminated", 'E', 'D'},
-/* 25 */ {"%s = \"%s\" attribute defaulted: empty string not allowed for token", 'E', 'C'},
-/* 26 */ {"Marked section end ignored; not in a marked section", 'E', 'S'},
-/* 27 */ {"Marked section start ignored; %s marked sections open already", 'E', 'Q'},
-/* 28 */ {"One or more parameters missing; declaration ignored", 'E', 'D'},
-/* 29 */ {"\"PUBLIC\" or \"SYSTEM\" required; declaration terminated", 'E', 'D'},
-/* 30 */ {"%s element ended prematurely; required %s omitted", 'E', 'C'},
-/* 31 */ {"Entity \"%s\" terminated: could not read file", 'E', 'R'},
-/* 32 */ {"Could not open file for entity \"%s\"; entity reference ignored", 'E', 'R'},
-/* 33 */ {"Insufficient main memory; unable to continue parsing", 'C', 'R'},
-/* 34 */ {"%s entity reference ignored; exceeded open entity limit (%s)", 'E', 'Q'},
-/* 35 */ {"No declaration for entity \"%s\"; reference ignored", 'E', 'C'},
-/* 36 */ {"%s entity reference occurred within own text; reference ignored", 'E', 'C'},
-/* 37 */ {"Entity nesting level out of sync", 'E', 'S'},
-/* 38 */ {"Parameter entity text cannot have %s keyword; keyword ignored", 'E', 'D'},
-/* 39 */ {"%s end-tag implied by %s start-tag; not minimizable", 'W', 'M'},
-/* 40 */ {"Start-tag minimization ignored; element has required attribute", 'E', 'D'},
-/* 41 */ {"Required %s element cannot be excluded from %s element", 'E', 'C'},
-/* 42 */ {"No DOCTYPE declaration; document type is unknown", 'E', 'C'},
-/* 43 */ {"Undefined %1$s start-tag GI was used in DTD; \"%1$s O O ANY\" assumed", 'E', 'C'},
-/* 44 */ {"Invalid character(s) ignored; attempting to resume DOCTYPE subset", 'E', 'S'},
-/* 45 */ {"No declaration for entity \"%s\"; default definition used", 'I', 'C'},
-/* 46 */ {"%s end-tag implied by NET delimiter; not minimizable", 'W', 'M'},
-/* 47 */ {"%s end-tag implied by data; not minimizable", 'W', 'M'},
-/* 48 */ {"%s end-tag implied by short start-tag (no GI); not minimizable", 'W', 'M'},
-/* 49 */ {"%s start-tag implied by data; not minimizable", 'W', 'M'},
-/* 50 */ {"%s start-tag implied by short start-tag (no GI); not minimizable", 'W', 'M'},
-/* 51 */ {"Short end-tag (no GI) ignored: no open elements", 'E', 'C'},
-/* 52 */ {"No definition for %1$s document type; \"%1$s O O ANY\" assumed", 'E', 'C'},
-/* 53 */ {"No definition for %1$s implied start-tag; \"%1$s O O ANY\" assumed", 'E', 'C'},
-/* 54 */ {"%s element ended prematurely; required subelement omitted", 'E', 'C'},
-/* 55 */ {"Content model token %s: connectors conflict; first was used", 'E', 'D'},
-/* 56 */ {"Duplicate specification occurred for \"%s\"; duplicate ignored", 'E', 'D'},
-/* 57 */ {"Bad end-tag in R/CDATA element; treated as short (no GI) end-tag", 'E', 'S'},
-/* 58 */ {"Start-tag minimization should be \"-\" for element with declared content", 'I', 'D'},
-/* 59 */ {"Reference to PI entity not permitted here; reference ignored", 'E', 'S'},
-/* 60 */ {"Non-SGML character found; should have been character reference", 'W', 'S'},
-/* 61 */ {"Numeric character reference exceeds 255; reference ignored", 'E', 'S'},
-/* 62 */ {"Invalid alphabetic character reference ignored", 'E', 'S'},
-/* 63 */ {"Invalid character in minimum literal; character ignored", 'E', 'S'},
-/* 64 */ {"Keyword %s ignored; \"%s\" is not a valid marked section keyword", 'E', 'D'},
-/* 65 */ {"Parameter entity name longer than (NAMELEN-1); truncated", 'E', 'Q'},
-/* 66 */ {"Start-tag length exceeds TAGLEN limit; parsed correctly", 'W', 'Q'},
-/* 67 */ {"%s attribute defaulted: FIXED attribute must equal default", 'W', 'C'},
-/* 68 */ {"Duplicate specification occurred for \"%s\"; duplicate ignored", 'I', 'D'},
-/* 69 */ {"%s = \"%s\" IDREF attribute ignored: referenced ID does not exist", 'E', 'C'},
-/* 70 */ {"%s = \"%s\" IDREF attribute ignored: number of IDs in list exceeds GRPCNT limit", 'E', 'Q'},
-/* 71 */ {"%s = \"%s\" ID attribute ignored: ID in use for another element", 'E', 'C'},
-/* 72 */ {"%s = \"%s\" ENTITY attribute not general entity; may affect processing", 'E', 'C'},
-/* 73 */ {"%s = \"%s\" attribute ignored: previously specified in same list", 'W', 'C'},
-/* 74 */ {"\"?\" = \"%s\" name token ignored: not in any group in this list", 'E', 'C'},
-/* 75 */ {"Normalized attribute specification length over ATTSPLEN limit", 'E', 'Q'},
-/* 76 */ {"%s = \"%s\" NOTATION ignored: element content is empty", 'E', 'C'},
-/* 77 */ {"%s = \"%s\" NOTATION undefined: may affect processing", 'E', 'C'},
-/* 78 */ {"Entity \"%2$s\" has undefined notation \"%1$s\"", 'E', 'C'},
-/* 79 */ {"%s = \"%s\" default attribute value not in group; #IMPLIED used", 'E', 'C'},
-/* 80 */ {"#CURRENT default value treated as #IMPLIED for %s ID attribute", 'E', 'D'},
-/* 81 */ {"ID attribute %s cannot have a default value; treated as #IMPLIED", 'E', 'D'},
-/* 82 */ {"%s attribute must be token, not empty string; treated as #IMPLIED", 'E', 'D'},
-/* 83 */ {"NOTATION attribute ignored for EMPTY element", 'E', 'D'},
-/* 84 */ {"%s = \"%s\" NOTATION ignored: content reference specified", 'E', 'C'},
-/* 85 */ {"#CONREF default value treated as #IMPLIED for EMPTY element", 'W', 'D'},
-/* 86 */ {"%s = \"%s\" entity not data entity; may affect processing", 'E', 'C'},
-/* 87 */ {"End-tag minimization should be \"O\" for EMPTY element", 'I', 'D'},
-/* 88 */ {"Formal public identifier \"%s\" invalid; treated as informal", 'E', 'S'},
-/* 89 */ {"Out-of-context %2$s start-tag ended %1$s document element (and parse)", 'E', 'C'},
-/* 90 */ {"\"%s\" keyword is for unsupported feature; declaration terminated", 'E', 'D'},
-/* 91 */ {"Attribute specification list in prolog cannot be empty", 'E', 'D'},
-/* 92 */ {"Document ended invalidly within a literal; parsing ended", 'C', 'S'},
-/* 93 */ {"General entity \"%s\" in short reference map \"%s\" undeclared", 'E', 'D'},
-/* 94 */ {"Could not reopen file to continue entity \"%s\"; entity terminated", 'E', 'R'},
-/* 95 */ {"Out-of-context data ended %s document element (and parse)", 'E', 'C'},
-/* 96 */ {"Short start-tag (no GI) ended %s document element (and parse)", 'E', 'C'},
-/* 97 */ {"DSO delimiter (%s) omitted from marked section declaration", 'E', 'D'},
-/* 98 */ {"Group token %s: duplicate name or name token \"%s\" ignored", 'E', 'D'},
-/* 99 */ {"Attempt to redefine %s attribute ignored", 'E', 'D'},
-/* 100 */ {"%s definition ignored: %s is not a valid declared value keyword", 'E', 'D'},
-/* 101 */ {"%s definition ignored: NOTATION attribute already defined", 'E', 'D'},
-/* 102 */ {"%s definition ignored: ID attribute already defined", 'E', 'D'},
-/* 103 */ {"%s definition ignored: no declared value specified", 'E', 'D'},
-/* 104 */ {"%s definition ignored: invalid declared value specified", 'E', 'D'},
-/* 105 */ {"%s definition ignored: number of names or name tokens in group exceeded GRPCNT limit", 'E', 'D'},
-/* 106 */ {"%s definition ignored: name group omitted for NOTATION attribute", 'E', 'D'},
-/* 107 */ {"#CONREF default value treated as #IMPLIED for %s ID attribute", 'E', 'D'},
-/* 108 */ {"%s definition ignored: %s is not a valid default value keyword", 'E', 'D'},
-/* 109 */ {"%s definition ignored: no default value specified", 'E', 'D'},
-/* 110 */ {"%s definition ignored: invalid default value specified", 'E', 'D'},
-/* 111 */ {"More than ATTCNT attribute names and/or name (token) values; terminated", 'E', 'D'},
-/* 112 */ {"Attempted redefinition of attribute definition list ignored", 'E', 'D'},
-/* 113 */ {"Content model token %s: more than GRPCNT model group tokens; terminated", 'E', 'Q'},
-/* 114 */ {"Content model token %s: more than GRPGTCNT content model tokens; terminated", 'E', 'Q'},
-/* 115 */ {"Content model token %s: more than GRPLVL nested model groups; terminated", 'E', 'Q'},
-/* 116 */ {"Content model token %s: %s invalid; declaration terminated", 'E', 'D'},
-/* 117 */ {"\"PUBLIC\" specified without public ID; declaration terminated", 'E', 'D'},
-/* 118 */ {"\"%s\" keyword invalid (only %s permitted); declaration terminated", 'E', 'D'},
-/* 119 */ {"\"%s\" specified without notation name; declaration terminated", 'E', 'D'},
-/* 120 */ {"Parameter must be a name; declaration terminated", 'E', 'D'},
-/* 121 */ {"Parameter must be a GI or a group of them; declaration terminated", 'E', 'D'},
-/* 122 */ {"Parameter must be a name or PERO (%%); declaration terminated", 'E', 'D'},
-/* 123 */ {"Parameter must be a literal; declaration terminated", 'E', 'D'},
-/* 124 */ {"\"%s\" not valid short reference delimiter; declaration terminated", 'E', 'D'},
-/* 125 */ {"Map does not exist; declaration ignored", 'E', 'C'},
-/* 126 */ {"MDC delimiter (>) expected; following text may be misinterpreted", 'E', 'D'},
-/* 127 */ {"Document ended invalidly within prolog; parsing ended", 'C', 'S'},
-/* 128 */ {"\"PUBLIC\" or \"SYSTEM\" or DSO ([) required; declaration terminated", 'E', 'D'},
-/* 129 */ {"Minimization must be \"-\" or \"O\" (not \"%s\"); declaration terminated", 'E', 'D'},
-/* 130 */ {"Content model or keyword expected; declaration terminated", 'E', 'D'},
-/* 131 */ {"Rank stem \"%s\" + suffix \"%s\" more than NAMELEN characters; not defined", 'E', 'D'},
-/* 132 */ {"Undefined %s start-tag GI ignored; not used in DTD", 'E', 'C'},
-/* 133 */ {"Document ended invalidly within a markup declaration; parsing ended", 'C', 'S'},
-/* 134 */ {"Normalized length of literal exceeded %s; markup terminated", 'E', 'Q'},
-/* 135 */ {"R/CDATA marked section in declaration subset; prolog terminated", 'E', 'D'},
-/* 136 */ {"%s = \"%s\" ENTITIES attribute ignored: more than GRPCNT in list", 'E', 'Q'},
-/* 137 */ {"Content model is ambiguous", 'W', 'D'},
-/* 138 */ {"Invalid parameter entity name \"%s\"", 'E', 'S'},
-/* 139 */ {"Document ended invalidly within a marked section; parsing ended", 'C', 'S'},
-/* 140 */ {"Element \"%s\" used in DTD but not defined", 'I', 'D'},
-/* 141 */ {"Invalid NDATA or SUBDOC entity reference occurred; ignored", 'E', 'S'},
-/* 142 */ {"Associated element type not allowed in document instance", 'E', 'C'},
-/* 143 */ {"Illegal DSC character; in different entity from DSO", 'E', 'C'},
-/* 144 */ {"Declared value of data attribute cannot be ID", 'E', 'D' },
-/* 145 */ {"Invalid reference to external CDATA or SDATA entity; ignored", 'E', 'S'},
-/* 146 */ {"Could not find external document type \"%s\"", 'E', 'R'},
-/* 147 */ {"Could not find external general entity \"%s\"", 'I', 'R'},
-/* 148 */ {"Could not find external parameter entity \"%s\"", 'I', 'R'},
-/* 149 */ {"Reference to non-existent general entity \"%s\" ignored", 'E', 'R'},
-/* 150 */ {"Could not find entity \"%s\" using default declaration", 'I', 'R'},
-/* 151 */ {"Could not find entity \"%2$s\" in attribute %1$s using default declaration", 'E', 'R'},
-/* 152 */ {"Short reference map \"%s\" used in USEMAP declaration but not defined; declaration will be ignored", 'E', 'D'},
-/* 153 */ {"End-tag minimization should be \"O\" for element with CONREF attribute", 'I', 'D'},
-/* 154 */ {"Declared value of data attribute cannot be ENTITY or ENTITIES", 'E', 'D' },
-/* 155 */ {"Declared value of data attribute cannot be IDREF or IDREFS", 'E', 'D' },
-/* 156 */ {"Declared value of data attribute cannot be NOTATION", 'E', 'D' },
-/* 157 */ {"CURRENT cannot be specified for a data attribute", 'E', 'D' },
-/* 158 */ {"CONREF cannot be specified for a data attribute", 'E', 'D' },
-/* 159 */ {"Parameter must be a number or CONTROLS or NONE", 'E', 'D'},
-/* 160 */ {"Cannot create temporary file", 'C', 'R'},
-/* 161 */ {"Document ended invalidly within SGML declaration", 'C', 'D'},
-/* 162 */ {"Capacity limit %s exceeded by %s points", 'W', 'Q'},
-/* 163 */ {"Amendment 1 requires \"ISO 8879:1986\" instead of \"ISO 8879-1986\"", 'W', 'D'},
-/* 164 */ {"Non-markup, non-minimum data character in SGML declaration", 'E', 'D'},
-/* 165 */ {"Parameter cannot be a literal", 'E', 'D'},
-/* 166 */ {"Invalid concrete syntax scope \"%s\"", 'E', 'D'},
-/* 167 */ {"Parameter must be a number", 'E', 'D'},
-/* 168 */ {"\"%s\" should have been \"%s\"", 'E', 'D'},
-/* 169 */ {"Character number %s is not supported as an additional name character", 'E', 'U'},
-/* 170 */ {"Parameter must be a literal or \"%s\"", 'E', 'D'},
-/* 171 */ {"Bad character description for character %s", 'E', 'D'},
-/* 172 */ {"Character number %s is described more than once", 'W', 'D'},
-/* 173 */ {"Character number plus number of characters exceeds 256", 'E', 'D'},
-/* 174 */ {"No description for upper half of character set: assuming \"128 128 UNUSED\"", 'W', 'D'},
-/* 175 */ {"Character number %s was not described; assuming UNUSED", 'E', 'D'},
-/* 176 */ {"Non-significant shunned character number %s not declared UNUSED", 'E', 'D'},
-/* 177 */ {"Significant character \"%s\" cannot be non-SGML", 'E', 'D'},
-/* 178 */ {"Unknown capacity set \"%s\"", 'E', 'U'},
-/* 179 */ {"No capacities specified." , 'E', 'D'},
-/* 180 */ {"Unknown concrete syntax \"%s\"", 'E', 'U'},
-/* 181 */ {"Character number exceeds 255", 'E', 'D'},
-/* 182 */ {"Concrete syntax SWITCHES not supported", 'E', 'U'},
-/* 183 */ {"\"INSTANCE\" scope not supported", 'E', 'U'},
-/* 184 */ {"Value of \"%s\" feature must be one or more", 'E', 'D'},
-/* 185 */ {"\"%s\" invalid; must be \"YES\" or \"NO\"", 'E', 'D'},
-/* 186 */ {"\"%s\" invalid; must be \"PUBLIC\" or \"SGMLREF\"", 'E', 'D'},
-/* 187 */ {"Feature \"%s\" is not supported", 'E', 'U'},
-/* 188 */ {"Too many open subdocument entities", 'E', 'Q'},
-/* 189 */ {"Invalid formal public identifier", 'W', 'D'},
-/* 190 */ {"Public text class must be \"%s\"", 'W', 'D'},
-/* 191 */ {"Use of character number %s as an SGML character is not supported", 'W', 'U'},
-/* 192 */ {"Notation \"%s\" not defined in DTD", 'W', 'D'},
-/* 193 */ {"Unclosed start or end tag requires \"SHORTTAG YES\"", 'W', 'M'},
-/* 194 */ {"Net-enabling start tag requires \"SHORTTAG YES\"", 'W', 'M'},
-/* 195 */ {"Attribute name omission requires \"SHORTTAG YES\"", 'W', 'M'},
-/* 196 */ {"Undelimited attribute value requires \"SHORTTAG YES\"", 'W', 'M'},
-/* 197 */ {"Attribute specification omitted for \"%s\": requires markup minimization", 'W', 'M'},
-/* 198 */ {"Concrete syntax does not have any short reference delimiters", 'E', 'D'},
-/* 199 */ {"Character number %s not in the base character set; assuming UNUSED", 'E', 'D'},
-/* 200 */ {"Character number %s is UNUSED in the syntax reference character set", 'E', 'D'},
-/* 201 */ {"Character number %s was not described in the syntax reference character set", 'E', 'D'},
-/* 202 */ {"Character number %s in the syntax reference character set has no corresponding character in the system character set", 'E', 'D'},
-/* 203 */ {"Character number %s was described using an unknown base set", 'E', 'D'},
-/* 204 */ {"Duplication specification for added function \"%s\"", 'E', 'D'},
-/* 205 */ {"Added function character cannot be \"%s\"", 'E', 'D'},
-/* 206 */ {"Only reference concrete syntax function characters supported", 'E', 'U'},
-/* 207 */ {"Only reference concrete syntax general delimiters supported", 'E', 'U'},
-/* 208 */ {"Only reference concrete syntax short reference delimiters supported", 'E', 'U'},
-/* 209 */ {"Unrecognized keyword \"%s\"", 'E', 'D'},
-/* 210 */ {"Unrecognized quantity name \"%s\"", 'E', 'D'},
-/* 211 */ {"Interpretation of \"%s\" is not a valid name in the declared concrete syntax", 'E', 'D'},
-/* 212 */ {"Replacement reserved name \"%s\" cannot be reference reserved name", 'E', 'D'},
-/* 213 */ {"Duplicate replacement reserved name \"%s\"", 'E', 'D'},
-/* 214 */ {"Quantity \"%s\" must not be less than %s", 'E', 'D'},
-/* 215 */ {"Only values up to %2$s are supported for quantity \"%1$s\"", 'E', 'U'},
-/* 216 */ {"%s element cannot be excluded from %s element because it is neither inherently optional nor a member of an or group", 'E', 'C'},
-/* 217 */ {"Marked section not allowed in other prolog", 'E', 'C'},
-/* 218 */ {"Required %s attribute was not specified for entity %s", 'E', 'C'},
-/* 219 */ {"UCNMSTRT must have the same number of characters as LCNMSTRT", 'E', 'D'},
-/* 220 */ {"UCNMCHAR must have the same number of characters as LCNMCHAR", 'E', 'D'},
-/* 221 */ {"Character number %s assigned to both LCNMSTRT or UCNMSTRT and LCNMCHAR or UCNMCHAR", 'E', 'D'},
-/* 222 */ {"Character number %s cannot be an additional name character", 'E', 'D'},
-/* 223 */ {"It is unsupported for \"-\" not to be assigned to UCNMCHAR or LCNMCHAR", 'E', 'U'},
-/* 224 */ {"Normalized length of value of attribute \"%s\" exceeded LITLEN", 'E', 'Q'},
-/* 225 */ {"Length of interpreted parameter literal exceeds LITLEN less the length of the bracketing delimiters", 'E', 'Q'},
-/* 226 */ {"Start tag of document element omitted; not minimizable", 'W', 'M'},
-/* 227 */ {"Unrecognized designating escape sequence \"%s\"", 'I', 'U'},
-/* 228 */ {"Earlier reference to entity \"%s\" used default entity", 'I', 'D'},
-/* 229 */ {"Reference to non-existent parameter entity \"%s\" ignored", 'E', 'R'},
-/* 230 */ {"DSC within marked section; marked section terminated", 'E', 'C'},
-/* 231 */ {"Document element end tag can only occur in document element because entity end not allowed in other prolog", 'E', 'C'},
-/* 232 */ {"Character reference not allowed in other prolog", 'E', 'C'},
-/* 233 */ {"USEMAP declaration not allowed in other prolog", 'E', 'D'},
-/* 234 */ {"Entity reference not allowed in other prolog", 'E', 'C'},
-/* 235 */ {"Value assigned to capacity %s exceeds value assigned to TOTALCAP", 'W', 'D'},
-};
diff --git a/usr.bin/sgmls/sgmls/msgcat.c b/usr.bin/sgmls/sgmls/msgcat.c
deleted file mode 100644
index 5c7ee9f..0000000
--- a/usr.bin/sgmls/sgmls/msgcat.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/* msgcat.c -
- X/Open message catalogue functions and gencat utility.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-
-#ifndef HAVE_CAT
-
-/* In this implementation the message catalogue format is the same as the
-message text source file format (see pp 42-43 of the X/Open
-Portability Guide, Issue 3, Volume 3.) This means that you don't have
-to use the gencat utility, but it is still useful for checking and
-merging catalogues. */
-
-/* Compile this with -DGENCAT to get the gencat utility. */
-
-#include "std.h"
-#include "msgcat.h"
-
-#ifdef USE_PROTOTYPES
-#define P(parms) parms
-#else
-#define P(parms) ()
-#endif
-
-#ifdef USE_ISASCII
-#define ISASCII(c) isascii(c)
-#else
-#define ISASCII(c) (1)
-#endif
-
-/* Default message set. */
-#define NL_SETD 1
-
-#ifndef PATH_FILE_SEP
-#define PATH_FILE_SEP ':'
-#endif
-
-#ifndef DEFAULT_NLSPATH
-#define DEFAULT_NLSPATH ""
-#endif
-
-#ifndef DEFAULT_LANG
-#define DEFAULT_LANG "default"
-#endif
-
-#define HASH_TAB_SIZE 251
-
-struct message {
- struct message *next;
- unsigned msgnum;
- unsigned setnum;
- char *text;
-};
-
-struct cat {
- char *name;
- int loaded;
- int bad;
- struct message *table[HASH_TAB_SIZE];
-};
-
-static char *read_buf = 0;
-static unsigned read_buf_len = 0;
-
-/* Errors that can be generated by read_catalog. */
-
-enum cat_err {
- E_ZERO, /* not an error */
- E_BADARG,
- E_NOMEM,
- E_NOSUCHCOMMAND,
- E_INPUT,
- E_EOF,
- E_BADSEP,
- E_BADLINE
-};
-
-#ifdef GENCAT
-/* These must match enum cat_err. */
-static char *cat_errlist[] = {
- "Error 0",
- "Invalid argument to command",
- "Out of memory",
- "Unrecognized command",
- "Input error",
- "Unexpected end of file",
- "Space or tab expected after message number",
- "Invalid line",
-};
-#endif /* GENCAT */
-
-#ifndef GENCAT
-/* The value of NLSPATH. */
-static char *nlspath = 0;
-/* The value of LANG. */
-static char *lang = 0;
-#endif /* not GENCAT */
-
-static int current_lineno = -1;
-static enum cat_err cat_errno = E_ZERO;
-
-#ifndef GENCAT
-static void load_catalog P((struct cat *));
-static FILE *find_catalog P((char *, char **));
-#endif
-static int read_catalog P((FILE *, struct message **));
-static void delete_set P((struct message **, unsigned));
-static void delete_message P((struct message **, unsigned, unsigned));
-static int hash P((unsigned setnum, unsigned msgnum));
-static char *parse_text P((FILE *, int));
-
-#ifndef GENCAT
-
-nl_catd catopen(name, oflag)
-char *name;
-int oflag;
-{
- struct cat *catp;
- int i;
-
- if (!name)
- return 0;
-
- catp = (struct cat *)malloc(sizeof *catp);
- if (!catp)
- return 0;
- for (i = 0; i < HASH_TAB_SIZE; i++)
- catp->table[i] = 0;
- catp->name = malloc(strlen(name) + 1);
- catp->loaded = 0;
- catp->bad = 0;
- strcpy(catp->name, name);
- return (nl_catd)catp;
-}
-
-int catclose(catd)
-nl_catd catd;
-{
- int i;
- struct cat *catp = (struct cat *)catd;
-
- if (!catp)
- return 0;
-
- for (i = 0; i < HASH_TAB_SIZE; i++) {
- struct message *p, *nextp;
- for (p = catp->table[i]; p; p = nextp) {
- nextp = p->next;
- free(p->text);
- free((char *)p);
- }
- }
- if (catp->name)
- free(catp->name);
- free((char *)catp);
- return 0;
-}
-
-char *catgets(catd, setnum, msgnum, dflt)
-nl_catd catd;
-int setnum, msgnum;
-char *dflt;
-{
- struct message *p;
- struct cat *catp;
-
- /* setnum and msgnum are required to be >= 1. */
- if (!catd || setnum <= 0 || msgnum <= 0)
- return dflt;
- catp = (struct cat *)catd;
- if (!catp->loaded)
- load_catalog(catp);
- if (catp->bad)
- return dflt;
- for (p = catp->table[hash(setnum, msgnum)]; p; p = p->next)
- if (p->msgnum == msgnum && p->setnum == setnum)
- break;
- if (!p)
- return dflt;
- return p->text;
-}
-
-static
-VOID load_catalog(catp)
-struct cat *catp;
-{
- FILE *fp;
- char *path;
-
- catp->loaded = 1;
- fp = find_catalog(catp->name, &path);
- if (!fp) {
- catp->bad = 1;
- return;
- }
- current_lineno = 0;
- if (read_catalog(fp, catp->table) < 0)
- catp->bad = 1;
- fclose(fp);
- if (read_buf) {
- free(read_buf);
- read_buf = 0;
- }
- read_buf_len = 0;
- free(path);
-}
-
-static
-FILE *find_catalog(name, pathp)
-char *name;
-char **pathp;
-{
- char *path;
-
- if (!name)
- return 0;
- if (!nlspath) {
- nlspath = getenv("NLSPATH");
- if (!nlspath)
- nlspath = DEFAULT_NLSPATH;
- }
- if (!lang) {
- lang = getenv("LANG");
- if (!lang)
- lang = DEFAULT_LANG;
- }
- path = nlspath;
- for (;;) {
- char *p;
- unsigned len = 0;
-
- for (p = path; *p != '\0' && *p != PATH_FILE_SEP; p++) {
- if (*p == '%') {
- if (p[1] == 'N') {
- p++;
- len += strlen(name);
- }
- else if (p[1] == 'L') {
- p++;
- len += strlen(lang);
- }
- else if (p[1] == '%') {
- p++;
- len++;
- }
- else
- len++;
-
- }
- else
- len++;
- }
- if (len > 0) {
- char *s, *try;
- FILE *fp;
- s = try = malloc(len + 1);
- if (!s)
- return 0;
- for (p = path; *p != '\0' && *p != PATH_FILE_SEP; p++) {
- if (*p == '%') {
- if (p[1] == 'N') {
- p++;
- strcpy(s, name);
- s += strlen(name);
- }
- else if (p[1] == 'L') {
- p++;
- strcpy(s, lang);
- s += strlen(lang);
- }
- else if (p[1] == '%') {
- p++;
- *s++ = '%';
- }
- else
- *s++ = *p;
- }
- else
- *s++ = *p;
- }
- *s++ = '\0';
- fp = fopen(try, "r");
- if (fp) {
- *pathp = try;
- return fp;
- }
- free(try);
- }
- if (*p == '\0')
- break;
- path = ++p;
- }
- return 0;
-}
-
-#endif /* not GENCAT */
-
-/* 0 success, -1 error */
-
-static
-int parse_message(c, fp, table, setnum, quote)
-int c;
-FILE *fp;
-struct message **table;
-unsigned setnum;
-int quote;
-{
- unsigned msgnum;
- struct message *msgp;
- char *text;
- int hc;
-
- msgnum = c - '0';
- for (;;) {
- c = getc(fp);
- if (!isdigit(c))
- break;
- msgnum = msgnum*10 + (c - '0');
- }
- if (c == '\n') {
- delete_message(table, setnum, msgnum);
- return 0;
- }
- if (c != ' ' && c != '\t') {
- cat_errno = E_BADSEP;
- return -1;
- }
- text = parse_text(fp, quote);
- if (!text)
- return -1;
- hc = hash(setnum, msgnum);
- for (msgp = table[hc]; msgp; msgp = msgp->next)
- if (msgp->setnum == setnum && msgp->msgnum == msgnum)
- break;
- if (msgp)
- free(msgp->text);
- else {
- msgp = (struct message *)malloc(sizeof *msgp);
- if (!msgp) {
- cat_errno = E_NOMEM;
- return -1;
- }
- msgp->next = table[hc];
- table[hc] = msgp;
- msgp->msgnum = msgnum;
- msgp->setnum = setnum;
- }
- msgp->text = text;
- return 0;
-}
-
-static
-char *parse_text(fp, quote)
-FILE *fp;
-int quote;
-{
- unsigned i = 0;
- char *p;
- int c;
- int quoted;
-
- c = getc(fp);
- if (c == quote) {
- quoted = 1;
- c = getc(fp);
- }
- else
- quoted = 0;
- for (;; c = getc(fp)) {
- if (c == EOF) {
- if (ferror(fp)) {
- cat_errno = E_INPUT;
- return 0;
- }
- break;
- }
- if (c == '\n')
- break;
- /* XXX
-
- Can quotes be used in quoted message text if protected by \ ?
-
- Is it illegal to omit the closing quote if there's an opening
- quote?
-
- Is it illegal to have anything after a closing quote?
-
- */
-
- if (quoted && c == quote) {
- /* Skip the rest of the line. */
- while ((c = getc(fp)) != '\n')
- if (c == EOF) {
- if (ferror(fp)) {
- cat_errno = E_INPUT;
- return 0;
- }
- break;
- }
- break;
- }
- if (c == '\\') {
- int d;
-
- c = getc(fp);
- if (c == EOF)
- break;
- switch (c) {
- case '\n':
- current_lineno++;
- continue;
- case 'n':
- c = '\n';
- break;
- case 'b':
- c = '\b';
- break;
- case 'f':
- c = '\f';
- break;
- case 't':
- c = '\t';
- break;
- case 'v':
- c = '\v';
- break;
- case 'r':
- c = '\r';
- break;
- case '\\':
- c = '\\';
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- c -= '0';
- d = getc(fp);
- if (d >= '0' && d <= '7') {
- c = c*8 + d - '0';
- d = getc(fp);
- if (d >= '0' && d <= '7')
- c = c*8 + d - '0';
- else if (d != EOF)
- ungetc(d,fp);
- }
- else if (d != EOF)
- ungetc(d, fp);
- if (c == '\0')
- continue; /* XXX */
- break;
- default:
- /* Ignore the quote. */
- break;
- }
- }
- if (i >= read_buf_len) {
- if (!read_buf)
- read_buf = malloc(read_buf_len = 40);
- else
- read_buf = realloc(read_buf, read_buf_len *= 2);
- if (!read_buf) {
- cat_errno = E_NOMEM;
- return 0;
- }
- }
- read_buf[i++] = c;
- }
- p = malloc(i + 1);
- if (!p) {
- cat_errno = E_NOMEM;
- return 0;
- }
- memcpy(p, read_buf, i);
- p[i] = '\0';
- return p;
-}
-
-/* 0 success, -1 error */
-
-static
-int parse_command(fp, table, setnump, quotep)
-FILE *fp;
-struct message **table;
-unsigned *setnump;
-int *quotep;
-{
- char buf[128];
- if (fgets(buf, 128, fp) == NULL) {
- cat_errno = ferror(fp) ? E_INPUT : E_EOF;
- return -1;
- }
- if (buf[0] == ' ' || buf[0] == '\t' || buf[0] == '\n')
- /* a comment */;
- else if (strncmp(buf, "set", 3) == 0) {
- if (sscanf(buf + 3, "%u", setnump) != 1) {
- cat_errno = E_BADARG;
- return -1;
- }
-
- }
- else if (strncmp(buf, "delset", 6) == 0) {
- unsigned num;
- if (sscanf(buf + 6, "%u", &num) != 1) {
- cat_errno = E_BADARG;
- return -1;
- }
- delete_set(table, num);
- *setnump = NL_SETD;
- }
- else if (strncmp(buf, "quote", 5) == 0) {
- char *p = buf + 5;
- while (*p == ' ' || *p == '\t')
- p++;
- /* XXX should \ be allowed as the quote character? */
- if (*p == '\0' || *p == '\n')
- *quotep = -1;
- else
- *quotep = *p;
- }
- else {
- cat_errno = E_NOSUCHCOMMAND;
- return -1;
- }
- if (strchr(buf, '\n') == 0) {
- int c;
- while ((c = getc(fp)) != '\n' && c != EOF)
- ;
- }
- return 0;
-}
-
-
-static
-VOID delete_set(table, setnum)
-struct message **table;
-unsigned setnum;
-{
- int i;
-
- for (i = 0; i < HASH_TAB_SIZE; i++) {
- struct message *p, *nextp;
- for (p = table[i], table[i] = 0; p; p = nextp) {
- nextp = p->next;
- if (p->setnum == setnum)
- free((char *)p);
- else {
- p->next = table[i];
- table[i] = p;
- }
- }
- }
-}
-
-static
-VOID delete_message(table, setnum, msgnum)
-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;
- *pp = p->next;
- free(p->text);
- free((char *)p);
- break;
- }
-}
-
-/* 0 success, -1 error. On error cat_errno is set to the error number. */
-
-static
-int read_catalog(fp, table)
-FILE *fp;
-struct message **table;
-{
- int c;
- unsigned setnum = NL_SETD;
- int quote_char = -1;
-
- for (;;) {
- /* start of line */
- c = getc(fp);
- if (c == EOF)
- break;
- ++current_lineno;
- if (isdigit(c)) {
- if (parse_message(c, fp, table, setnum, quote_char) < 0)
- return -1;
- }
- else if (c == '$') {
- if (parse_command(fp, table, &setnum, &quote_char) < 0)
- return -1;
- }
- else if (c != '\n') {
- while ((c = getc(fp)) != '\n' && c != EOF)
- if (c != ' ' && c != '\t') {
- cat_errno = E_BADLINE;
- return -1;
- }
- if (c == EOF)
- break;
- }
- }
- return 0;
-}
-
-static
-int hash(setnum, msgnum)
-unsigned setnum, msgnum;
-{
- return ((setnum << 8) + msgnum) % HASH_TAB_SIZE;
-}
-
-#ifdef GENCAT
-
-static char *program_name;
-
-static int message_compare P((UNIV, UNIV));
-static void print_text P((char *, FILE *));
-static void usage P((void));
-
-#ifdef VARARGS
-static void fatal();
-#else
-static void fatal P((char *,...));
-#endif
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
- FILE *fp;
- int i, j, nmessages;
- struct message **list;
- unsigned setnum;
- struct message *table[HASH_TAB_SIZE];
-
- program_name = argv[0];
-
- if (argc < 3)
- usage();
-
- for (i = 0; i < HASH_TAB_SIZE; i++)
- table[i] = 0;
- for (i = 1; i < argc; i++) {
- errno = 0;
- fp = fopen(argv[i], "r");
- if (!fp) {
- if (i > 1)
- fatal("can't open `%s': %s", argv[i], strerror(errno));
- }
- else {
- current_lineno = 0;
- cat_errno = E_ZERO;
- if (read_catalog(fp, table) < 0) {
- assert(cat_errno != E_ZERO);
- assert(cat_errno
- < sizeof(cat_errlist)/sizeof(cat_errlist[0]));
- fatal("%s:%d: %s", argv[i], current_lineno,
- cat_errlist[cat_errno]);
- }
- fclose(fp);
- }
- }
-
- errno = 0;
- fp = fopen(argv[1], "w");
- if (!fp)
- fatal("can't open `%s' for output: %s", argv[1], strerror(errno));
- nmessages = 0;
- for (i = 0; i < HASH_TAB_SIZE; i++) {
- struct message *p;
- for (p = table[i]; p; p = p->next)
- nmessages++;
- }
- list = (struct message **)malloc(nmessages*sizeof(struct message *));
- if (!list)
- fatal("out of memory");
- j = 0;
- for (i = 0; i < HASH_TAB_SIZE; i++) {
- struct message *p;
- for (p = table[i]; p; p = p->next)
- list[j++] = p;
- }
- assert(j == nmessages);
-
- qsort((UNIV)list, nmessages, sizeof(struct message *), message_compare);
-
- setnum = NL_SETD;
- for (i = 0; i < nmessages; i++) {
- struct message *p = list[i];
- if (p->setnum != setnum) {
- setnum = p->setnum;
- fprintf(fp, "$set %u\n", setnum);
- }
- fprintf(fp, "%u ", p->msgnum);
- print_text(p->text, fp);
- putc('\n', fp);
- }
- if (fclose(fp) == EOF)
- fatal("error closing `%s'", argv[1]);
- return 0;
-}
-
-static
-VOID usage()
-{
- fprintf(stderr, "usage: %s catfile msgfile...\n", program_name);
- exit(1);
-}
-
-static
-#ifdef VARARGS
-VOID fatal(va_alist) va_dcl
-#else /* not VARARGS */
-VOID fatal(char *message,...)
-#endif /* not VARARGS */
-{
- va_list ap;
-
-#ifdef VARARGS
- char *message;
- va_start(ap);
- message = va_arg(ap, char *);
-#else /* not VARARGS */
- va_start(ap, message);
-#endif /* not VARARGS */
-
- fprintf(stderr, "%s: ", program_name);
- vfprintf(stderr, message, ap);
- putc('\n', stderr);
- va_end(ap);
- exit(1);
-}
-
-static
-int message_compare(p1, p2)
-UNIV p1;
-UNIV p2;
-{
- struct message *m1 = *(struct message **)p1;
- struct message *m2 = *(struct message **)p2;
-
- if (m1->setnum < m2->setnum)
- return -1;
- if (m1->setnum > m2->setnum)
- return 1;
- if (m1->msgnum < m2->msgnum)
- return -1;
- if (m1->msgnum > m2->msgnum)
- return 1;
- return 0;
-}
-
-static
-VOID print_text(s, fp)
-char *s;
-FILE *fp;
-{
- for (; *s; s++) {
- if (*s == '\\')
- fputs("\\\\", fp);
- else if (ISASCII(*s) && isprint((unsigned char)*s))
- putc(*s, fp);
- else {
- switch (*s) {
- case '\n':
- fputs("\\n", fp);
- break;
- case '\b':
- fputs("\\b", fp);
- break;
- case '\f':
- fputs("\\f", fp);
- break;
- case '\t':
- fputs("\\t", fp);
- break;
- case '\v':
- fputs("\\v", fp);
- break;
- case '\r':
- fputs("\\r", fp);
- break;
- default:
- fprintf(fp, "\\%03o", (unsigned char)*s);
- break;
- }
- }
- }
-}
-
-#endif /* GENCAT */
-
-#ifdef TEST
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
- nl_catd catd;
- int msgnum, setnum;
-
- if (argc != 2) {
- fprintf(stderr, "usage: %s catalogue\n", argv[0]);
- exit(1);
- }
- catd = catopen(argv[1], 0);
- fprintf(stderr, "Enter set number, message number pairs:\n");
- fflush(stderr);
- while (scanf("%d %d", &setnum, &msgnum) == 2) {
- char *msg = catgets(catd, setnum, msgnum, "<default>");
- fprintf(stderr, "Returned \"%s\"\n", msg);
- fflush(stderr);
- }
- return 0;
-}
-
-#endif /* TEST */
-
-#endif /* not HAVE_CAT */
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/msgcat.h b/usr.bin/sgmls/sgmls/msgcat.h
deleted file mode 100644
index 83e998a..0000000
--- a/usr.bin/sgmls/sgmls/msgcat.h
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#ifdef HAVE_CAT
-#include <nl_types.h>
-#else
-typedef UNIV nl_catd;
-#endif
-
-/* Don't use prototypes here in case nl_types.h declares a conflicting
-prototype. */
-
-nl_catd catopen();
-int catclose();
-char *catgets();
diff --git a/usr.bin/sgmls/sgmls/pars1.c b/usr.bin/sgmls/sgmls/pars1.c
deleted file mode 100644
index 0a67cbc..0000000
--- a/usr.bin/sgmls/sgmls/pars1.c
+++ /dev/null
@@ -1,984 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-#define GI (tags[ts].tetd->etdgi+1) /* GI of current element. */
-#define NEWGI (newetd->etdgi+1) /* GI of new tag. */
-
-static VOID doincludes P((void));
-static int pentname P((char *));
-static struct mpos *newmpos P((void));
-static VOID commbufs P((void));
-static VOID checkdtd P((void));
-
-/* PARSECON: Parse content of an element.
-*/
-int parsecon(tbuf, pcb)
-UNCH *tbuf; /* Work area for tokenization. */
-struct parse *pcb; /* Parse control block for this parse. */
-{
- int srn; /* SHORTREF delimiter number (1-32). */
- int refrc; /* Return code from sentref, stagetd, etc. */
-
- TRACECON(etagimct, dostag, datarc, pcb, conrefsw, didreq);
- if (eodsw) return(EOD_);
- if (didreq && (conrefsw & TAGREF)) {didreq = 0; goto conr;}
- if (etagimct>0) {etagimsw = --etagimct ? 1 : 0; destack(); return(ETG_);}
- if (dostag) {
- conrefsw = conrefsv;
- etisw = etiswsv;
- if (charmode) {dostag = 0; return datarc;}
- return stag(datarc);
- }
- if (conrefsw) {
- conr:
- destack();
- conrefsw = 0;
- return ETG_;
- }
- else if (eofsw) return(EOD_);
-
- datarc = 0;
- while (1) {
- parse(pcb);
- srn = (int)pcb->action - SRMIN; /* Just in case it's a SHORTREF. */
- switch (pcb->action) {
- case DCE_: /* Data character in element content. */
- /* The data character might be a non-SGML character so
- reprocess it using pcbconm. */
- REPEATCC;
- pcb = conpcb = &pcbconm;
- pcb->newstate = pcbcnet;
- continue;
- case DAS_: /* Current character begins data. */
- data = FPOS;
- continue;
-
- case NLF_: /* NET or SR returns data in lookahead buffer. */
- datalen = (UNS)(ptcon - data); REPEATCC;
- goto rcc;
-
- case LAF_: /* Return data in lookahead buffer: mixed. */
- datalen = (UNS)(ptcon+1 - data);
- goto rcc;
-
- case NON_: /* Single nonchar in nonchbuf. */
- datalen = 2; data = nonchbuf;
- goto nrcc;
-
- case DAR_: /* Return data except for last char. */
- REPEATCC;
- case DAF_: /* Return data in source entity buffer. */
- datalen = (UNS)(FPOS - data);
- rcc:
- REPEATCC;
- case DEF_: /* Return data in data entity. */
- nrcc:
- datarc = DAF_;
- if (pcb==&pcbcone) {
- pcbconm.newstate = pcbcnet;
- conpcb = &pcbconm;
- }
- if (charmode) return(datarc);
- stagmin = MINNONE; stagreal = newetd = ETDCDATA;
- return(stag(datarc));
-
- case LAS_: /* Start lookahead buffer with current char. */
- *(ptcon = data = tbuf+1) = *FPOS;
- continue;
-
- case LAM_: /* Move character to lookahead buffer. */
- *++ptcon = *FPOS;
- continue;
-
- case STG_: /* Process non-null start-tag. */
- CTRSET(tagctr); /* Start counting tag length. */
- tages = es;
- parsenm(tbuf, NAMECASE); /* Get the GI. */
- newetd = etdref(tbuf);
- if (newetd && newetd->adl) {
- parseatt(newetd->adl, tbuf);
- adlval((int)ADN(al), newetd);
- }
- parsetag(&pcbstag); /* Parse the tag ending. */
- if ((CTRGET(tagctr)-tagdelsw)>=TAGLEN)
- sgmlerr(66, &pcbstag, (UNCH *)0, (UNCH *)0);
- if (!newetd) {
- sgmlerr(132, pcb, tbuf+1, (UNCH *)0);
- continue;
- }
- return(stagetd(&pcbstag));
-
- case NST_: /* Process null start-tag. */
- return nstetd();
-
- case ETC_: /* End-tag in CDATA or RCDATA. */
- case ETG_: /* Process non-null end-tag. */
- newetd = etdref(parsenm(tbuf, NAMECASE)); /* Get the GI. */
- parsetag(&pcbetag); /* Parse tag end. */
- if (!newetd) /* Error: undefined.*/
- sgmlerr(11, &pcbetag, tbuf+1, (UNCH *)0);
- else if (etagetd(&pcbetag)>=0) return ETG_;/* Open element. */
- if (pcb->action!=ETC_) continue;
- /* Tag is undefined or not for an open element and we are in
- a CDATA or RCDATA element; issue message and treat as
- null end-tag (</>).
- */
- sgmlerr(57, &pcbetag, (UNCH *)0, (UNCH *)0);
- case NET_: /* Process null end-tag. */
- if ((refrc = netetd(conpcb))!=0) return ETG_;
- continue;
-
- case NED_: /* Process null end-tag delimiter. */
- etagmin = MINNET;
- newetd = etagreal = ETDNET;
- etagimct = etag();
- etagimsw = etagimct ? 1 : 0; destack();
- return ETG_;
- case GTR_:
- if (entget()!=-1) {
- data = FPOS;
- continue;
- }
- /* fall through */
- case EOD_: /* End of primary file. */
- if (ts<1) return(EOD_); /* Normal end: stack is empty. */
- etagimct = ts-1; /* Treat as end-tag for top tag on stack. */
- etagmin = MINETAG; etagreal = tags[0].tetd;
- destack();
- eofsw = 1; /* Return EOD_ after destacking all. */
- return ETG_;
-
- /* Short references ending with blanks:
- If the blank sequence is followed by RE, go do SR7 or SR6.
- If the entity is undefined and we are in mixed content,
- the blanks must be returned as data. If not, they
- can be ignored.
- */
- case SR9_: /* Process SR9 (two or more blanks). */
- REPEATCC; /* Make first blank the CC. */
- case SR4_: /* Process SR4 (RS, blanks). */
- parseseq(tbuf, BSEQLEN); /* Squeeze out all blanks. */
- if (*FPOS=='\r') {srn = (srn==9) ? 7 : 6; data = tbuf; goto sr6;}
- else REPEATCC;
- if ((refrc = shortref(srn, pcb))==DEF_) goto nrcc;
- if (refrc>0) return refrc;
- if (refrc==ENTUNDEF && pcb==&pcbconm)
- {data = tbuf; goto nrcc;}
- continue;
-
- /* Short references ending with RE:
- If the reference is defined, the RE is ignored.
- For RE and RS RE,
- no special action is needed if the reference is undefined,
- as the RE will be processed immediately as the current character.
- For B RE and RS B RE,
- the input is primed with a special character that will
- be treated as an RE that cannot be a short reference.
- */
- case SR7_: /* Process SR7 (blanks, RE). */
- datalen = (UNS)(FPOS - data);
- case SR2_: /* Process SR2 (RE). */
- case SR5_: /* Process SR5 (RS, RE). */
- sr6: /* Process SR6 (RS, blanks, RE). */
- if ((refrc = shortref(srn, pcb))!=ENTUNDEF) {
- if (refrc==DEF_) goto nrcc; /* Defined: data entity. */
- if (refrc>0) return refrc; /* Defined: tag entity. */
- continue; /* Defined: not tag. */
- }
- if (pcb!=&pcbconm) continue; /* Not mixed; ignore chars. */
- if (srn>=6) /* Return blanks as data. */
- {*FPOS = lex.d.genre; REPEATCC; goto nrcc;}
- case REF_: /* Undefined SR with RE; return record end. */
- datarc = REF_;
- if (charmode) return(datarc);
-#if 0
- /* The standard says this situation can force a tag.
- See 323:3-6, 412:1-7. */
- /* If RE would be ignored, don't treat it as start-tag
- because it could force a required tag; but do change
- state to show that an RE was ignored.
- */
- if (scbsgml[pss].snext==scbsgmst) {
- scbsgml[pss].snext = scbsgmnr;
- TRACEGML(scbsgml, pss, conactsw, conact);
- continue;
- }
-#endif
- stagmin = MINNONE; stagreal = newetd = ETDCDATA;
- return(stag(datarc));
-
- case SR3_: /* Process SR3 (RS). */
- REPEATCC;
- if ((refrc = shortref(srn, pcb))==DEF_) goto nrcc;
- if (refrc>0) return refrc;
- continue;
-
- case RBR_: /* Two right brackets */
- srn = 26;
- REPEATCC;
- /* fall through */
- case SR1_: /* Process SR1 (TAB). */
- case SR8_: /* Process SR8 (space). */
- case SR19: /* Process SR19 (-). */
- case SR26: /* Process SR26 (]). */
- REPEATCC;
- goto srproc;
-
- case FCE_: /* Process free character (SR11-18, SR21-32). */
- fce[0] = *FPOS;
- srn = mapsrch(&lex.s.dtb[lex.s.fce], fce);
- case SR10: /* Process SR10 ("). */
- case SR11: /* Process SR11 (#). */
- case SR20: /* Process SR20 (-). */
- case SR25: /* Process SR25 ([). */
- srproc:
- if ((refrc = shortref(srn, pcb))==DEF_) goto nrcc;
- if (refrc>0) return refrc;
- if (refrc==ENTUNDEF) { /* Treat the SR as data. */
- data = FPOS - (srn==lex.s.hyp2);/* Two data chars if SR20.*/
- if (pcb!=&pcbconm) { /* If not in mixed content: */
- if (srn>=lex.s.data) { /* Change PCB. */
- pcb = conpcb = &pcbconm;
- pcb->newstate = pcbcnda;
- }
- }
- else pcb->newstate = pcbcnda;/* Now in data found state. */
- }
- continue;
-
- case ERX_: /* Entity ref in RCDATA: cancel ending delims.*/
- lexcon[lex.d.tago] = lex.l.fre;
- lexcon[lex.d.net] = lex.l.nonet;
- lexlms[lex.d.msc] = lex.l.fre;
- continue;
-
- case EE_: /* Entity end in RCDATA: check nesting. */
- if (es<rcessv) {synerr(37, pcb); rcessv = es;}
- /* If back at top level, re-enable the ending delimiters. */
- if (es==rcessv) {
- lexcon[lex.d.tago] = lex.l.tago;
- lexcon[lex.d.net] = etictr ? lex.l.net : lex.l.nonet;
- lexlms[lex.d.msc] = lex.l.msc;
- }
- continue;
-
- case PIE_: /* PI entity: same as PIS_. */
- return PIS_;
-
- case RSR_: /* Record start: ccnt=0; ++rcnt.*/
- ++RCNT; CTRSET(RSCC);
- return RSR_;
- case MSS_:
- if (ts == 0) synerr(217, pcb);
- return MSS_;
- default:
- return (int)pcb->action; /* Default (MD_ MDC_ MSS_ MSE_ PIS_). */
- }
- }
-}
-/* STAGETD: Process start-tag etd.
-*/
-int stagetd(pcb)
-struct parse *pcb; /* Parse control block for this parse. */
-{
- if (!newetd->etdmod) {
- sgmlerr(43, pcb, newetd->etdgi+1, (UNCH *)0);
- ++ds.etdercnt;
- etdset(newetd, (UNCH)SMO+EMO+ETDOCC, &undechdr,
- (PETD *)0, (PETD *)0, (PECB *)0);
- TRACEETD(newetd);
- }
- stagmin = MINNONE; stagreal = newetd;
- return stag(0);
-}
-/* NSTETD: Process null start-tag etd.
-*/
-int nstetd()
-{
- if (sd.omittag && ts > 0)
- newetd = tags[ts].tetd;
- else if (!sd.omittag && lastetd != 0)
- newetd = lastetd;
- else
- newetd = tags[0].tetd->etdmod[2].tu.thetd;
- stagmin = MINNULL; stagreal = ETDNULL;
- etisw = 0;
- return stag(0);
-}
-/* ETAGETD: Process end-tag etd.
-*/
-int etagetd(pcb)
-struct parse *pcb; /* Parse control block for this parse. */
-{
- etagmin = MINNONE; etagreal = newetd;
- if ((etagimct = etag())<0) {
- sgmlerr(E_ETAG, pcb, NEWGI, tags[ts].tetd->etdgi+1);
- return etagimct;
- }
- etagimsw = etagimct ? 1 : 0; destack();
- return ETG_;
-}
-/* NETETD: Process null end-tag etd.
-*/
-int netetd(pcb)
-struct parse *pcb; /* Parse control block for this parse. */
-{
- if (ts<1) {
- sgmlerr(51, pcb, (UNCH *)0, (UNCH *)0);
- return 0;
- }
- etagmin = MINNULL; etagreal = ETDNULL;
- etagimsw = 0; destack();
- return ETG_;
-}
-/* SHORTREF: Process a short (alternative) reference to an entity.
- Returns ENTUNDEF if entity is not defined, otherwise returns
- the return code from stagetd or etagetd if the entity was
- a tag, or zero if an error occurred somewhere.
-*/
-int shortref(srn, pcb)
-int srn; /* Short reference number. */
-struct parse *pcb; /* Parse control block for this parse. */
-{
- int rc; /* Return code from entopen. */
-
- if (tags[ts].tsrm==SRMNULL || !tags[ts].tsrm[srn]) return ENTUNDEF;
- rc = entopen(tags[ts].tsrm[srn]);
- if (rc==ENTDATA) return DEF_;
- if (rc==ENTPI) return PIS_;
- return(0);
-}
-/* PARSEPRO: Parse prolog.
- Note: ptpro cannot overrun tbuf (and therefore needn't be
- tested), as long as the buffer exceeds the longest
- lookahead sequence in the content parse tables.
-*/
-int parsepro()
-{
- struct parse *oldpcb;
-
- while (1) {
- int rc; /* Return code: DAF MSS DCE */
- switch (parse(propcb)) {
-
- case LAS_: /* Start lookahead buffer with current char. */
- *(ptpro = data = tbuf+1) = *FPOS;
- continue;
- case LAM_: /* Move character to lookahead buffer. */
- *++ptpro = *FPOS;
- continue;
- case LAF_: /* Return data in lookahead buffer. */
- datalen = (UNS)(ptpro+1 - data);
- REPEATCC;
- rc = DAF_;
- break; /* Prolog ended; data pending. */
-
- case DTD_: /* Process document type declaration. */
- parsenm(tbuf, NAMECASE); /* Get declaration name. */
- if (!ustrcmp(tbuf+1, sgmlkey)
- && !dtdsw && !sgmlsw++) {
-#if 0
- parse(&pcbmdi);
-#endif
- /* If we got some appinfo, return. */
- if (sgmldecl())
- return APP_;
- continue;
- }
- if (!ustrcmp(tbuf+1, key[KDOCTYPE]) && !dtdsw++) {
- startdtd();
- mddtds(tbuf);
- continue;
- }
- sgmlerr(E_MDNAME, propcb, tbuf+1, (UNCH *)0);
- continue;
- case DTE_: /* DOCTYPE declaration (and prolog) ended. */
- REPEATCC; /* Put back char that followed MSC. */
- if (es != 0)
- sgmlerr(143, propcb, (UNCH *)0, (UNCH *)0);
- else if (dtdrefsw) {/* Process referenced DTD before real DTE. */
- dtdrefsw = 0; /* Keep us from coming through here again. */
- REPEATCC; /* Put back MSC so it follows referenced DTD. */
- entref(indtdent);
- }
- else {
- if (mslevel > 0) {
- sgmlerr(230, propcb, (UNCH *)0, (UNCH *)0);
- mslevel = 0;
- msplevel = 0;
- }
- mddtde(tbuf);
- }
- continue;
-
- case MD_:
- /* Process markup declaration within DTD or LPD. */
- parsenm(tbuf, NAMECASE); /* Get declaration name. */
- if (!ustrcmp(tbuf+1, key[KENTITY]))
- mdentity(tbuf);
- else if (!ustrcmp(tbuf+1, key[KUSEMAP]))
- mdsrmuse(tbuf);
- else if (!ustrcmp(tbuf+1, key[KATTLIST]))
- mdadl(tbuf);
- else if (!ustrcmp(tbuf+1, key[KSHORTREF]))
- mdsrmdef(tbuf);
- else if (!ustrcmp(tbuf+1, key[KELEMENT]))
- mdelem(tbuf);
- else if (!ustrcmp(tbuf+1, key[KNOTATION]))
- mdnot(tbuf);
- else
- sgmlerr(E_MDNAME, propcb, tbuf+1, (UNCH *)0);
- continue;
- case MDC_: /* Process markup declaration comment. */
- sgmlsw++; /* SGML declaration not allowed after comment */
- parsemd(tbuf, NAMECASE, (struct parse *)0, NAMELEN);
- continue;
-
- case MSS_: /* Process marked section start. */
- oldpcb = propcb;
- propcb = mdms(tbuf, propcb);
- if (propcb==&pcbmsc || propcb==&pcbmsrc) {
- if (oldpcb == &pcbmds)
- sgmlerr(135, oldpcb, (UNCH *)0, (UNCH *)0);
- conpcb = propcb;
- rc = DCE_;
- break;
- }
- continue;
- case MSE_: /* Process marked section end. */
- if (mdmse()) propcb = &pcbmds;
- continue;
- case MSP_: /* Marked section start in prolog outside DTD */
- rc = MSS_;
- break;
- case PIE_: /* PI entity: same as PIS_. */
- return(PIS_);
-
- case EOD_: /* Return end of primary entity. */
- if (dtdsw && propcb == &pcbpro) {
- /* We've had a DTD, so check it. */
- setdtype();
- checkdtd();
- }
- if (!sw.onlypro || propcb != &pcbpro || !dtdsw)
- sgmlerr(127, propcb, (UNCH *)0, (UNCH *)0);
- return propcb->action;
- case PIS_: /* Return processing instruction (string). */
- sgmlsw++; /* SGML declaration not allowed after PI */
- return((int)propcb->action); /* Prolog will continue later. */
-
- case CIR_: /* Chars ignored; trying to resume parse. */
- synerr(E_RESTART, propcb);
- REPEATCC;
- continue;
- case ETE_: /* End tag ended prolog */
- REPEATCC;
- /* fall through */
- case STE_: /* Start tag ended prolog */
- REPEATCC;
- REPEATCC;
- rc = STE_;
- break;
- case PEP_: /* Previous character ended prolog. */
- REPEATCC;
- case DCE_: /* Data character ended prolog. */
- REPEATCC;
- rc = DCE_;
- break;
- case EE_: /* Illegal entity end in ignored marked section. */
- /* An error message has already been given. */
- continue;
- default:
- abort();
- } /* switch */
- setdtype(); /* First pass only: set document type. */
- checkdtd();
- if (sw.onlypro)
- return EOD_;
- TRACESET(); /* Set trace switches. */
- endprolog();
- /* *DOC is first element; stack it at level 0. */
- stack(newetd = nextetd = stagreal = etagreal = docetd);
- return(rc);
- } /* while */
-}
-
-/* Allocate buffers that are used in the DTD. */
-
-VOID startdtd()
-{
- nmgrp = (struct etd **)rmalloc((GRPCNT+1)*sizeof(struct etd *));
- nnmgrp = (PDCB *)rmalloc((GRPCNT+1)*sizeof(PDCB));
- gbuf = (struct thdr *)rmalloc((GRPGTCNT+3)*sizeof(struct thdr));
- /* The extra 1 is for parsing the name of a parameter entity in
- mdentity(). */
- nmbuf = (UNCH *)rmalloc(NAMELEN+3);
- pubibuf = (UNCH *)rmalloc(LITLEN+1);
- sysibuf = (UNCH *)rmalloc(LITLEN+1);
- commbufs();
- doincludes();
-}
-
-static
-VOID checkdtd()
-{
- struct dcncb *np;
- struct srh *sp;
-
- if (sw.swundef) {
- int i;
- struct etd *ep;
-
- for (i = 0; i < ETDHASH; i++)
- for (ep = etdtab[i]; ep; ep = ep->etdnext)
- if (!ep->etdmod)
- sgmlerr(140, (struct parse *)0, ep->etdgi + 1,
- (UNCH *)0);
- }
- for (sp = srhtab[0]; sp; sp = sp->enext)
- if (sp->srhsrm[0] == 0)
- sgmlerr(152, (struct parse *)0, sp->ename + 1, (UNCH *)0);
- else {
- int i;
- for (i = 1; i < lex.s.dtb[0].mapdata + 1; i++) {
- struct entity *ecb = sp->srhsrm[i];
- if (ecb && !ecb->estore) {
- sgmlerr(93, (struct parse *)0,
- ecb->ename + 1,
- sp->srhsrm[0]->ename + 1);
- sp->srhsrm[i] = 0;
- }
- }
- }
- for (np = dcntab[0]; np; np = np->enext)
- if (!np->defined)
- sgmlerr(192, (struct parse *)0, np->ename + 1, (UNCH *)0);
-}
-
-/* Return non-zero if s is a valid parameter entity name.
-If so put a transformed name in entbuf. */
-
-static
-int pentname(s)
-char *s;
-{
- int i;
- if (lextoke[(UNCH)*s] != NMS)
- return 0;
- entbuf[2] = ENTCASE ? lextran[(UNCH)*s] : (UNCH)*s;
- for (i = 1; s[i]; i++) {
- if (i > NAMELEN - 1)
- return 0;
- if (lextoke[(UNCH)s[i]] < NMC || s[i] == EOBCHAR)
- return 0;
- entbuf[i + 2] = ENTCASE ? lextran[(UNCH)s[i]] : (UNCH)s[i];
- }
- entbuf[1] = lex.d.pero;
- entbuf[i + 2] = '\0';
- entbuf[0] = (UNCH)(i + 3); /* length byte, PERO and '\0' */
- return 1;
-}
-
-/* Handle sw.includes. */
-
-static
-VOID doincludes()
-{
- char **p;
- if (!sw.includes)
- return;
- for (p = sw.includes; *p; p++) {
- if (pentname(*p)) {
- if (!entfind(entbuf)) {
- union etext etx;
- etx.c = savestr(key[KINCLUDE]);
- entdef(entbuf, ESM, &etx);
- ++ds.ecbcnt;
- ds.ecbtext += ustrlen(key[KINCLUDE]);
- }
- }
- else
- sgmlerr(138, (struct parse *)0, (UNCH *)*p, (UNCH *)0);
- }
-}
-
-/* Allocate buffers that are use both in the DTD and the instance. */
-
-static
-VOID commbufs()
-{
- al = (struct ad *)rmalloc((ATTCNT+2)*sizeof(struct ad));
- lbuf = (UNCH *)rmalloc(LITLEN + 1);
-}
-
-static
-struct mpos *newmpos()
-{
- int j;
- unsigned long *h;
- struct mpos *p = (struct mpos *)rmalloc((GRPLVL+2)*sizeof(struct mpos));
-
- assert(grplongs > 0);
- h = (unsigned long *)rmalloc((GRPLVL+2)*grplongs*sizeof(unsigned long));
- for (j = 0; j < GRPLVL+2; j++) {
- p[j].h = h;
- h += grplongs;
- }
- return p;
-}
-
-/* Perform end of prolog buffer allocation. */
-
-VOID endprolog()
-{
- int i;
-
- ambigfree();
- if (dtdsw) {
- frem((UNIV)nmgrp);
- frem((UNIV)nnmgrp);
- frem((UNIV)gbuf);
- frem((UNIV)nmbuf);
- frem((UNIV)sysibuf);
- frem((UNIV)pubibuf);
- }
- else {
- commbufs();
- doincludes();
- }
- scbsgml = (struct restate *)rmalloc((TAGLVL+1)*sizeof(struct restate));
- tags = (struct tag *)rmalloc((TAGLVL+1)*sizeof(struct tag));
- grplongs = (GRPCNT + LONGBITS - 1)/LONGBITS;
- for (i = 0; i < TAGLVL+1; i++)
- tags[i].tpos = newmpos();
- savedpos = newmpos();
-}
-
-/* SETDTYPE: Establish specified or default document type.
-*/
-VOID setdtype()
-{
- /* Initialize default model hdr for declared content. */
- undechdr.ttype = MANY+MCHARS+MGI; /* Declared content is ANY. */
- undechdr.tu.tnum = 0; /* No content model. */
-
- /* Initialize content model and etd for *DOC. */
- prcon[0].ttype = MGI; /* Model is an element model. */
- prcon[0].tu.tnum = 2; /* A single group with a single GI in it. */
- prcon[1].ttype = TTSEQ; /* Non-repeatable SEQ group. */
- prcon[1].tu.tnum = 1; /* Only one token in group. */
- prcon[2].ttype = TTETD; /* Token is an etd. */
- docetd = etddef(indocetd); /* etd for document as a whole. */
- etdset(docetd, ETDOCC, prcon, (PETD *)0, (PETD *)0, SRMNULL);
-
- /* Put specified or default document type etd in *DOC model. */
- if (!dtype) {
- sgmlerr(E_DOCTYPE, propcb, (UNCH *)0, (UNCH *)0);
- dtype = indefetd;
- }
- prcon[2].tu.thetd = etddef(dtype);
- if (!prcon[2].tu.thetd->etdmod) {
- if (dtype != indefetd)
- sgmlerr(52, propcb, dtype+1, (UNCH *)0);
- ++ds.etdercnt;
- etdset(prcon[2].tu.thetd, (UNCH)SMO+EMO+ETDUSED+ETDOCC, &undechdr,
- (PETD *)0, (PETD *)0, (PECB *)0);
- }
- TRACEETD(docetd);
- TRACEMOD(prcon);
- TRACEETD(prcon[2].tu.thetd);
- return;
-}
-/* PARSETAG: Tag end parser for SGML documents.
- For start-tags, it
- sets etisw to TAGNET if tag ended with ETI; otherwise to 0.
-*/
-VOID parsetag(pcb)
-struct parse *pcb; /* Parse control block: pcbstag or pcbetag. */
-{
- tagdelsw = 1; /* Assume tag had an ETI or TAGC. */
- switch (parse(pcb)) {
- case ETIC: /* Tag closed with ETI. */
- if (!sd.shorttag) synerr(194, pcb);
- etisw = TAGNET; /* Set switch for stack entry flag. */
- return;
- case DSC:
- synerr(9, pcb);
- REPEATCC;
- etisw = 0;
- return;
- case NVS: /* Att name or value token found. */
- case NTV: /* Name token value found. */
- synerr(E_POSSATT, pcb);
- pcb->newstate = 0; /* Reset parse state. */
- REPEATCC; /* Put it back for next read. */
- tagdelsw = 0; /* Tag had no closing delimiter. */
- etisw = 0; /* Don't flag stack entry. */
- return;
- case TAGO: /* Tag closing implied by TAGO. */
- if (!sd.shorttag) synerr(193, pcb);
- REPEATCC; /* Put it back for next read. */
- tagdelsw = 0; /* Tag had no closing delimiter. */
- case TAGC: /* Normal close. */
- default: /* Invalid character (msg was sent). */
- etisw = 0; /* Don't flag stack entry. */
- return;
- }
-}
-/* STAG: Check whether a start-tag is valid at this point in the document
- structure, or whether other tags must precede it.
- Special case processing is done for the fake tag, #CDATA, as
- it is never stacked.
-*/
-int stag(dataret)
-int dataret; /* Data pending: DAF_ REF_ 0=not #PCDATA. */
-{
- int rc, realrc; /* Return code from context or other test. */
- int mexts = 0; /* >0=stack level of minus grp; -1=plus; 0=none.*/
-
- badresw = pexsw = 0;
- /* If real element (i.e., not #PCDATA) set mexts and test if empty. */
- if (dataret==0) {
- mexts = pexmex(newetd);
- /* If element is declared empty, it is same as a conref. */
- if (GET(newetd->etdmod->ttype, MNONE)) conrefsw = TAGREF;
- }
- if (GET(tags[ts].tetd->etdmod->ttype, MANY))
- rc = mexts>0 ? RCMEX : RCHIT;
- else rc = context(newetd, tags[ts].tetd->etdmod, tags[ts].tpos,
- &tags[ts].status, mexts);
- TRACESTG(newetd, dataret, rc, nextetd, mexts);
-
- switch (rc) {
- case RCEND: /* End current element, then retry start-tag. */
- if (ts<1) realrc = RCMISS;
- else realrc = RCEND;
- break;
- case RCREQ: /* Stack compulsory GI, then retry start-tag. */
- realrc = RCREQ;
- break;
- case RCMISS: /* Start-tag invalid (#PCDATA or real). */
- if (ts>0 && GET(tags[ts].tetd->etdmod->ttype, MANY))
- realrc = RCEND;
- else realrc = RCMISS;
- break;
- case RCMEX: /* Start-tag invalid (minus exception). */
- etagimct = ts - mexts;
- realrc = RCEND;
- break;
- case RCHITMEX: /* Invalid minus exclusion for required element. */
- sgmlerr(216, &pcbstag, NEWGI, tags[mexts].tetd->etdgi+1);
- /* fall through */
- case RCHIT: /* Start-tag was valid. */
- realrc = RCHIT;
- break;
- case RCPEX: /* Start-tag valid only because of plus exception. */
- pexsw = TAGPEX;
- realrc = RCHIT;
- break;
- default:
- abort();
- }
-
- switch (realrc) {
- case RCEND: /* End current element, then retry start-tag. */
- if (didreq) sgmlerr(07, &pcbstag, nextetd->etdgi+1, (UNCH *)0);
- didreq = 0; /* No required start-tag done. */
- dostag = 1; etiswsv = etisw; /* Save real start-tag status. */
- conrefsv = conrefsw; /* Save real start-tag conref. */
- conrefsw = 0; /* Current element is not empty. */
- etagmin = MINSTAG; destack(); /* Process omitted end-tag. */
- return ETG_;
- case RCREQ: /* Stack compulsory GI, then retry start-tag. */
- if (!BADPTR(nextetd)) {
- if ((mexts = pexmex(nextetd))>0)
- sgmlerr(E_MEXERR, &pcbstag, nextetd->etdgi+1,
- tags[mexts].tetd->etdgi+1);
- if (!nextetd->etdmod) {
- sgmlerr(53, &pcbstag, nextetd->etdgi+1, (UNCH *)0);
- etdset(nextetd, (UNCH)SMO+EMO+ETDOCC, &undechdr,
- (PETD *)0, (PETD *)0, (PECB *)0);
- ++ds.etdercnt;
- TRACEETD(nextetd);
- }
- }
- if (BITOFF(nextetd->etdmin, SMO)) {
- if (!BADPTR(stagreal))
- sgmlerr(21, &pcbstag, nextetd->etdgi+1, stagreal->etdgi+1);
- else if (stagreal==ETDCDATA)
- sgmlerr(49, &pcbstag, nextetd->etdgi+1, (UNCH *)0);
- else sgmlerr(50, &pcbstag, nextetd->etdgi+1, (UNCH *)0);
- }
- didreq = 1; /* Required start-tag done. */
- dostag = 1; etiswsv = etisw; /* Save real start-tag status. */
- etisw = 0; conrefsv = conrefsw; /* Save real start-tag conref. */
- /* If element is declared empty, it is same as a conref. */
- conrefsw = (GET(nextetd->etdmod->ttype, MNONE)) ? TAGREF : 0;
- stack(nextetd); /* Process omitted start-tag. */
- return STG_;
- case RCMISS: /* Start-tag invalid (#PCDATA or actual). */
- dostag = 0; contersw |= 1; didreq = 0;
- if (dataret) {
- if (dataret==REF_) badresw = 1;
- else sgmlerr(E_CHARS, conpcb, tags[ts].tetd->etdgi+1, (UNCH *)0);
- return dataret;
- }
- sgmlerr(E_CONTEXT, &pcbstag, NEWGI, tags[ts].tetd->etdgi+1);
- if (stagmin!=MINNULL) stagmin = MINNONE; stack(newetd);
- return STG_;
- case RCHIT: /* Start-tag was valid. */
- dostag = 0; didreq = 0;
- if (dataret) return dataret;
- stack(newetd);
- return STG_;
- }
- return NOP_; /* To avoid Borland C++ warning */
-}
-/* PEXMEX: See if a GI is in a plus or minus exception group on the stack.
- If in a minus, returns stack level of minus group; otherwise,
- returns -1 if in a plus and not a minus, and zero if in neither.
-*/
-int pexmex(curetd)
-struct etd *curetd; /* The etd for this GI. */
-{
- int tsl; /* Temporary stack level for looping. */
- int pex = 0; /* 1=found in plus grp; 0=not. */
-
- for (tsl = ts; tsl>0; --tsl) {
- if (tags[tsl].tetd->etdmex && ingrp(tags[tsl].tetd->etdmex, curetd))
- return(tsl);
- if (tags[tsl].tetd->etdpex && ingrp(tags[tsl].tetd->etdpex, curetd))
- pex = -1;
- }
- return(pex);
-}
-/* STACK: Add a new entry to the tag stack.
- If there is no room, issue a message and reuse last position.
-*/
-VOID stack(curetd)
-struct etd *curetd; /* The etd for this entry. */
-{
- /* Stack the new element type definition (error if no room). */
- if (++ts>TAGLVL)
- sgmlerr(E_STAGMAX, conpcb, curetd->etdgi+1, tags[--ts].tetd->etdgi+1);
- tags[ts].tetd = curetd;
-
- /* Set flags: plus exception + tag had ETI + context error + empty. */
- tags[ts].tflags = (UNCH)pexsw + etisw + contersw + conrefsw; contersw = 0;
-
- /* If tag had ETI, update ETI counter and enable NET if first ETI. */
- if (etisw && ++etictr==1) lexcon[lex.d.net] = lexcnm[lex.d.net] = lex.l.net;
-
- /* If etd has ALT table, use it; otherwise, use last element's ALT. */
- if (curetd->etdsrm) {
- if (curetd->etdsrm != SRMNULL && curetd->etdsrm[0] == NULL) {
- /* Map hasn't been defined. Ignore it.
- We already gave an error. */
- curetd->etdsrm = 0;
- tags[ts].tsrm = tags[ts-1].tsrm;
- }
- else
- tags[ts].tsrm = curetd->etdsrm;
- }
- else
- tags[ts].tsrm = tags[ts-1].tsrm;
-
- /* Initialize rest of stack entry. */
- tags[ts].status = 0;
- tags[ts].tpos[0].g = 1; /* M: Index in model of next token to test.*/
- tags[ts].tpos[0].t = 1; /* P: Index in tpos of current group. */
- HITCLEAR(tags[ts].tpos[0].h);
- tags[ts].tpos[1].g = 1; /* Index of group in model (dummy grp). */
- tags[ts].tpos[1].t = 1; /* 1st token is next in grp to be tested. */
- HITCLEAR(tags[ts].tpos[1].h); /* No hits yet as yet. */
- TRACESTK(&tags[ts], ts, etictr);
- return;
-}
-/* ETAG: Check validity of an end-tag by seeing if it matches any tag
- on the stack. If so, return the offset of the match from the
- current entry (0=current). If there is no match, issue a message
- and return an error code (-1).
- If the newetd is ETDNET, a NET delimiter was found, so check for
- a tag that ended with ETI instead of a matching GI.
-*/
-int etag()
-{
- int tsl = ts+1; /* Temporary stack level for looping. */
-
- /* See if end-tag is anywhere on stack, starting at current entry. */
- while (--tsl) {
- if (newetd!=ETDNET ? newetd==tags[tsl].tetd : tags[tsl].tflags) {
- TRACEETG(&tags[ts], newetd, tsl, ts-tsl);
- return(ts-tsl);
- }
- }
- return (-1); /* End-tag didn't match any start-tag. */
-}
-/* DESTACK:
- Call ECONTEXT to see if element can be ended at this point.
- and issue message if there are required tags left.
- Remove the current entry from the tag stack.
- Issue an error if the destacked element was not minimizable
- and its end-tag was omitted.
-*/
-VOID destack()
-{
- register int ecode = 0; /* Error code (0=o.k.). */
- UNCH *eparm2 = NULL; /* Second parameter of error message. */
- register int minmsgsw; /* 1=message if tag omitted; 0=no message. */
-
- /* If element has a content model (i.e., not a keyword) and there
- are required tags left, and no CONREF attribute was specified,
- issue an error message.
- */
- lastetd = tags[ts].tetd;
- if (!GET(tags[ts].tetd->etdmod->ttype, MKEYWORD)
- && !conrefsw
- && !econtext(tags[ts].tetd->etdmod, tags[ts].tpos, &tags[ts].status)) {
- if (BADPTR(nextetd))
- sgmlerr(54, conpcb, tags[ts].tetd->etdgi+1, (UNCH *)0);
- else
- sgmlerr(30, conpcb, tags[ts].tetd->etdgi+1, nextetd->etdgi+1);
- }
- /* If the current tag ended with ETI, decrement the etictr.
- If etictr is now zero, disable the NET delimiter.
- */
- if (GET(tags[ts--].tflags, TAGNET) && --etictr==0)
- lexcon[lex.d.net] = lexcnm[lex.d.net] = lex.l.nonet;
-
- minmsgsw = BITOFF(tags[ts+1].tetd->etdmin, EMO);
- if (!conrefsw && minmsgsw && (etagimsw || etagmin==MINETAG)) {
- /* Minimization caused by NET delimiter. */
- if (BADPTR(etagreal)) ecode = 46;
- /* Minimization caused by a containing end-tag. */
- else {ecode = 20; eparm2 = etagreal->etdgi+1;}
- }
- else if (!conrefsw && etagmin==MINSTAG && (minmsgsw || ts<=0)) {
- /* Minimization caused by out-of-context start-tag. */
- if (!BADPTR(stagreal)) {
- ecode = ts>0 ? 39 : 89;
- eparm2 = stagreal->etdgi+1;
- }
- /* Minimization caused by out-of-context data. */
- else if (stagreal==ETDCDATA) ecode = ts>0 ? 47 : 95;
- /* Minimization caused by out-of-context short start-tag. */
- else ecode = ts>0 ? 48 : 96;
- if (ts<=0 && ecode) eodsw = 1;
- }
- if (ecode) sgmlerr((UNS)ecode, conpcb, tags[ts+1].tetd->etdgi+1, eparm2);
- /* TEMP: See if parser bug caused stack to go below zero. */
- else if (ts<0) {sgmlerr(64, conpcb, (UNCH *)0, (UNCH *)0); ts = 0;}
- TRACEDSK(&tags[ts], &tags[ts+1], ts, etictr);
- if (ts == 0) {
- docelsw = 1; /* Finished document element. */
- if (es > 0) sgmlerr(231, conpcb, (UNCH *)0, (UNCH *)0);
- }
-}
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/pars2.c b/usr.bin/sgmls/sgmls/pars2.c
deleted file mode 100644
index 4249797..0000000
--- a/usr.bin/sgmls/sgmls/pars2.c
+++ /dev/null
@@ -1,1333 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-/* PARSE: Parse a source input stream with specified lexical and state tables.
- Return to caller with action code.
-*/
-int parse(pcb)
-struct parse *pcb; /* Current parse control block. */
-{
- int rc; /* Return code from ENTREF. */
-
- while (1) {
- NEWCC;
- pcb->input = pcb->plex[*FPOS];
- pcb->state = pcb->newstate;
- pcb->newstate = (*(pcb->ptab + pcb->state)) [pcb->input];
- pcb->action = (*(pcb->ptab + pcb->state + 1)) [pcb->input];
- TRACEPCB(pcb);
- switch (pcb->action) {
- case RC2_: /* Back up two characters. */
- REPEATCC;
- case RCC_: /* Repeat current character. */
- REPEATCC;
- case NOP_: /* No action necessary.*/
- continue;
-
- case RS_: /* Record start: ccnt=0; ++rcnt.*/
- ++RCNT; CTRSET(RSCC);
- continue;
-
- case GET_: /* EOB or dull EOS or EE found: keep going.*/
- if (entget()==-1) {pcb->action = EOD_; break;}/* Signal if EOD.*/
- continue;
-
- case EOF_: /* Illegal entity end; return EE_. */
- synerr(E_EOF, pcb);
- pcb->action = EE_;
- case EE_: /* Important EOS or EE found: return to caller.*/
- if (entget()==-1) pcb->action = EOD_; /* Signal if EOD. */
- break;
-
- case PER_: /* Parameter entity reference. */
- REPEATCC; /* Use PERO as 1st char of entity name. */
- parsenm(entbuf, ENTCASE);
- parse(&pcbref); /* Handle REFC or other terminator. */
- rc = entref(entbuf);
- if (rc==ENTPI) {pcb->action = PIE_; break;}
- continue;
-
- case ER_: /* General entity reference; continue. */
- parsenm(entbuf, ENTCASE);
- parse(&pcbref); /* Handle REFC or other terminator. */
- rc = entref(entbuf);
- if (rc==ENTDATA) {pcb->action = DEF_; break;}
- if (rc==ENTPI) {pcb->action = PIE_; break;}
- continue;
-
-
- case PEX_: /* Parameter entity reference; return. */
- REPEATCC; /* Use PERO as 1st char of entity name. */
- case ERX_: /* General entity reference; return. */
- parsenm(entbuf, ENTCASE);
- parse(&pcbref); /* Handle REFC or other terminator. */
- rc = entref(entbuf);
- if (rc == ENTDATA){
- /* Reference to external data/subdoc entity in replaceable
- character data. */
- if (BITON(entdatsw, NDECONT)) {
- switch (((PNE)data)->nextype) {
- case ESNCDATA:
- case ESNSDATA:
- /* The standard says `non-SGML data entity'
- but the amendment should have changed it
- to `external data entity'. */
- synerr(145, pcb);
- break;
- case ESNNDATA:
- case ESNSUB:
- /* This is definitely illegal. */
- synerr(141, pcb);
- break;
- }
- entdatsw = 0;
- continue;
- }
- pcb->action = DEF_;
- }
- else if (rc == ENTPI) {
- /* Reference to PI entity not allowed in replaceable
- character data. */
- synerr(59, pcb);
- entpisw = 0;
- continue;
- }
- else if (rc) pcb->action = EE_;
- break;
-
- case CRN_: /* Character reference: numeric. */
- parsetkn(entbuf, NU, NAMELEN);
- parse(&pcbref); /* Handle reference terminator. */
- pcb->action = charrefn(entbuf, pcb);
- if (pcb->action==CRN_) continue; /* Invalid reference */
- break;
-
- case CRA_: /* Character reference: alphabetic. */
- parsenm(entbuf, NAMECASE);
- parse(&pcbref); /* Handle reference terminator. */
- charrefa(entbuf);
- if (docelsw) synerr(232, pcb);
- continue;
-
- case SYS_: /* Invalid NONCHAR: send msg and ignore. */
- synerr(E_SYS, pcb);
- if (*FPOS == DELNONCH) NEWCC;
- continue;
-
- case NON_: /* Valid NONCHAR: prefix and shift encoding. */
- synerr(60, pcb);
- pcb->action = datachar(*FPOS, pcb);
- break;
- case NSC_:
- synerr(60, pcb);
- NEWCC;
- nonchbuf[1] = *FPOS;
- pcb->action = NON_;
- break;
- case PCI_: /* Previous character was invalid (INV_). */
- REPEATCC;
- case INV_: /* Markup ended by invalid char; repeat char. */
- synerr(9, pcb);
- REPEATCC;
- break;
-
- case LNR_: /* Previous char exceeded len; back up to it. */
- REPEATCC;
- case LEN_: /* Token too long; ignore excess character. */
- synerr(3, pcb);
- continue;
-
- case RCR_: /* Repeat current char and return to caller. */
- REPEATCC;
- default: /* Actions for specific parse. */
- break;
- }
- return (int)pcb->action;
- }
-}
-/* CHARREFA: Resolve an alphabetical reference to a function character
- and put the character in the read buffer.
- If reference is bad, issue an error message.
-*/
-VOID charrefa(r)
-UNCH *r; /* Undelimited char ref (with length and EOS). */
-{
- UNCH thechar;
-
- thechar = mapsrch(funtab, r+1);
- if (thechar == 0)
- synerr(62, &pcbref);
- else {
- /* This isn't ideal, because the character position will still
- be wrong for one line. */
- if (thechar == RSCHAR) RCNT--;
- setcurchar(thechar);
- REPEATCC;
- }
-}
-
-/* Make the current character ch. */
-
-VOID setcurchar(ch)
-int ch;
-{
- /* If we're reading directly from an internal entity, we can't
- 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) {
- if (!FILESW && !COPIEDSW) {
- UNCH *s = savestr(FBUF + 1);
- FPOS = s + (FPOS - FBUF - 1);
- FBUF = s - 1;
- COPIEDSW = 1;
- }
- *FPOS = ch;
- }
-}
-
-/* CHARREFN: Resolve a numeric character reference.
- If reference is bad, issue an error message.
-*/
-
-int charrefn(r, pcb)
-UNCH *r; /* Undelimited character reference. */
-struct parse *pcb; /* Current parse control block. */
-{
- int thechar;
-
- thechar = atoi((char *)r);
- if (thechar<0 || thechar>255) {
- synerr(61, &pcbref);
- return((int)pcb->action);
- }
- return datachar(thechar, pcb);
-}
-
-/* Return ch as a datachar. If this a non-SGML character which might
-confuse the parser, shift it to a code that won't and place it in a
-special buffer which has DELNONCH in the preceding byte. Otherwise
-put it the read buffer. */
-
-int datachar(ch, pcb)
-int ch;
-struct parse *pcb;
-{
- switch (ch) {
- case EOS:
- case EOFCHAR:
- case EOBCHAR:
- case GENRECHAR:
- case DELCDATA:
- case DELSDATA:
- case DELNONCH:
- /* A potentially confusing character which must be prefixed
- with DELNONCH. */
- nonchbuf[1] = SHIFTNON((UNCH)ch);
- return NON_;
- }
- setcurchar(ch);
- /* If in content, return DCE_ for element content, DAF_ for mixed. */
- /* If not content, it must be a literal parse, so return MLA_. */
- if (pcb == conpcb) {
- if (pcb == &pcbcone)
- return DCE_;
- else {
- data = FPOS;
- /* Action for DAF_ will do REPEATCC. */
- NEWCC;
- return DAF_;
- }
- }
- else
- return MLA_;
-}
-/* INITATT: Initialize al with adl. */
-
-VOID initatt(adl)
-struct ad *adl;
-{
- notadn = 0; /* No NOTATION attribute yet. */
- conrefsw = 0; /* Assume no content reference att. */
- /* Copy attribute definition list as a template. */
- memcpy((UNIV)al, (UNIV)adl, (1+ADN(adl))*ADSZ);
-}
-
-/* PARSEATT: Parse attribute specification list.
- Make a current copy of the attribute definition list
- and update it with the user's specifications.
- Indicate each attribute that was specified in the
- list (as opposed to defaulted) by setting the ASPEC flag.
- If no attributes were specified, return NULL. Otherwise,
- if in the prolog, make a permanent copy of the list and
- return its pointer. If not in the prolog, return al.
-*/
-struct ad *parseatt(adl, pt)
-struct ad *adl; /* Attribute definition list. */
-UNCH *pt; /* Tokenization area: tbuf[TAGLEN+ATTSPLEN]. */
-{
- UNCH *antvptr;
- UNCH *nm = 0; /* Pointer to saved name in tbuf (with length). */
- int adn = -1; /* Position of attribute in list (-1=empty). */
- UNCH *tbuflim = pt + ATTSPLEN;
- mdessv = es; /* Save es for checking entity nesting. */
- initatt(adl);
- while (pt<=tbuflim) {
- parse(&pcbstag);
- switch (pcbstag.action) {
- case NVS: /* Att name or value token found. */
- parsenm(pt, NAMECASE); /* Case translation wanted on name. */
- pt += *(nm = pt); /* Save name while pointing past it. */
- continue;
-
- case AVD: /* Delimited value found. */
- case AVDA: /* Delimited value found (alternate delimiter). */
- /* Find position (adn) of saved attribute name in list. */
- adn = anmget((int)ADN(al), nm);
- parselit(pt,
- (adn == 0 || ADTYPE(al, adn) == ACHARS)
- ? &pcblitr
- : &pcblitt,
- LITLEN,
- (pcbstag.action==AVD) ? lex.d.lit : lex.d.lita);
- if (adn == 0) {
- /* Error: unrecognized attribute name. */
- sgmlerr(13, &pcbstag, nm+1, pt);
- continue;
- }
- /* Tokenize and validate value; let it default if an error. */
- /* Put value in list and bump ptr by the normalized length
- (which is always >= the actual length). */
- if (!attval(1, pt, adn, adl)) pt += ADLEN(al,adn);
- continue;
- case AVU: /* Attribute value found: undelimited. */
- if (!sd.shorttag) sgmlerr(196, &pcbstag, (UNCH *)0, (UNCH *)0);
- parsetkn(pt, NMC, LITLEN);
- /* Find position (adn) of saved attribute name in list. */
- if ((adn = anmget((int)ADN(al), nm))==0) {
- /* Error: unrecognized attribute name. */
- sgmlerr(13, &pcbstag, nm+1, pt);
- continue;
- }
- /* Tokenize and validate value; let it default if an error. */
- /* Put value in list and bump ptr by the normalized length
- (which is always >= the actual length). */
- if (!attval(1, pt, adn, adl)) pt += ADLEN(al,adn);
- continue;
-
- case NASV: /* Saved NVS was really an NTV. */
- REPEATCC; /* Put back next token starter. */
- pt = nm; /* Back up to NVS. */
- case NTV: /* Name token value found. */
- if (!sd.shorttag) sgmlerr(195, &pcbstag, (UNCH *)0, (UNCH *)0);
- if (pcbstag.action==NTV) parsenm(pt, NAMECASE);
- if ((adn = antvget((int)ADN(al), pt, &antvptr))==0) {
- /* Error: unrecognized name token value. */
- sgmlerr(74, &pcbstag, pt+1, (UNCH *)0);
- continue;
- }
- /* Validate value; let it default if an error. */
- /* Put value in list and bump ptr by the normalized length
- (which is always >= the actual length). */
- if (!attval(0, antvptr+1, adn, adl)) pt += ADLEN(al,adn);
- continue;
-
- default: /* All attributes have been parsed. */
- REPEATCC; /* Put next char back for tag close parse. */
- break;
- }
- break;
- }
- if (pt>tbuflim) synerr(75, &pcbstag);
- if (es!=mdessv) synerr(37, &pcbstag);
- if (adn<0) return((struct ad *)0); /* List was empty. */
- TRACEADL(al);
- return al;
-}
-/* ATTVAL: Validate a specified attribute value. Issue a message if it is
- the wrong type (or otherwise is not up to spec), and use the default.
- Call PARSEVAL to tokenize the value, unless it is a CDATA string.
- If the attribute is a group, the value is a string.
- For other types, the token count is set by PARSEVAL if the value
- is syntactically correct. If incorrect (or if CDATA) the token
- count is zero (i.e., the value is a string).
- The length of a token does not include the length byte, and
- there is no EOS. A string length (as always) includes both
- the length byte and the EOS.
- If it is a CONREF attribute, set a switch for STAG().
- If it is a CURRENT attribute, store the value as the new default.
-*/
-#define DEFVAL adl[adn].addef /* Default value of current attribute. */
-#define DEFNUM adl[adn].adnum /* Default group size of current attribute. */
-#define DEFLEN adl[adn].adlen /* Length of default value of current attribute.*/
-int attval(mtvsw, adval, adn, adl)
-int mtvsw; /* Must tokenize value: 1=yes; 0=no. */
-UNCH *adval; /* Untokenized attribute value. */
-int adn; /* Attribute's position in list. */
-struct ad *adl; /* Element's master att def list. */
-{
- int errcode; /* Value/declaration conflict error code. */
-
- if (GET(ADFLAGS(al,adn), ASPEC)) /* Can't respecify same attribute. */
- {sgmlerr(73, &pcbstag, ADNAME(al,adn), adval); return(1);}
- SET(ADFLAGS(al,adn), ASPEC); /* Indicate att was specified. */
- if (GET(ADFLAGS(al,adn), ACONREF)) /* If attribute is content reference: */
- conrefsw = TAGREF; /* Set switch for STAG(). */
- if (mtvsw && ADTYPE(al,adn)!=ACHARS) {
- /* If no syntax errors, check for proper group membership. */
- if ( ((errcode = parseval(adval, ADTYPE(al,adn), lbuf))==0)
- && GET(ADFLAGS(al,adn), AGROUP)
- && !amemget(&al[adn], ADNUM(al,adn), lbuf) ) errcode = 18;
- /* If syntax or group membership error, send message and exit. */
- if (errcode) {
- sgmlerr(errcode, &pcbstag, ADNAME(al,adn), adval);
- SET(ADFLAGS(al,adn), AERROR);
- return(1);
- }
- /* Replace specified value in adval with tokenized in lbuf. */
- ustrcpy(adval, lbuf);
- if (BITOFF(ADFLAGS(al,adn), AGROUP)) ADNUM(al,adn) = (UNCH)tokencnt;
- }
- if (!mtvsw)
- adval--;
- /* If attribute is FIXED, specified value must equal default. */
- if (BITON(ADFLAGS(al,adn), AFIXED) && ustrcmp(adval, DEFVAL)) {
- /* Since the value has been tokenized, don't use it in the
- error message. */
- sgmlerr(67, &pcbstag, ADNAME(al,adn), (UNCH *)0);
- SET(ADFLAGS(al,adn), AERROR);
- return(1);
- }
- ADLEN(al,adn) = vallen(ADTYPE(al,adn), ADNUM(al,adn), adval);
- if (ADLEN(al,adn) > LITLEN) {
- sgmlerr(224, &pcbstag, ADNAME(al,adn), (UNCH *)0);
- SET(ADFLAGS(al,adn), AERROR);
- return 1;
- }
- ADVAL(al,adn) = adval;
- /* If attribute is CURRENT, value is new default.*/
- if (GET(ADFLAGS(al,adn), ACURRENT)) {
- if (ADLEN(al,adn)>DEFLEN) {
- ds.attdef += (ADLEN(al,adn) - DEFLEN);
- DEFLEN = ADLEN(al,adn);
- }
- DEFVAL = replace(DEFVAL, ADVAL(al,adn));
- DEFNUM = ADNUM(al,adn);
- }
- return(0); /* Indicate value was valid. */
-}
-/* ADLVAL: Validate the completed attribute definition list (defaults plus
- specified values). Issue a message if an
- attribute is required or current and its value is NULL.
-*/
-VOID adlval(adsz, newetd)
-int adsz; /* Size of list. */
-struct etd *newetd; /* Element type definition for this element. */
-{
- int adn = 1; /* Position in list. */
- UNCH *npt, *pt; /* Ptr save areas. */
- UNCH nptsv; /* Save area for ptr value (length?). */
- struct dcncb *dpt; /* Save area for dcncb ptr. */
-
- aentctr = 0; /* Number of AENTITY tokens in this att list. */
- idrctr = 0; /* Number of IDREF tokens in this att list. */
- do {
- if (ADVAL(al,adn)==NULL) { /* NULL value */
- if (GET(ADFLAGS(al,adn), AREQ+ACURRENT)) { /*Error if REQ, CURRENT*/
- sgmlerr(19, &pcbstag, ADNAME(al,adn), (UNCH *)0);
- SET(ADFLAGS(al,adn), AINVALID);
- }
- }
- else switch (ADTYPE(al,adn)) {
- case AENTITY: /* Return data ecb pointer if valid entity. */
- aenttst(adn, ADVAL(al,adn));
- break;
- case AENTITYS: /* Return data ecb pointers if valid entities. */
- pt = ADVAL(al,adn);
- tokencnt = (int)ADNUM(al,adn);
- while (tokencnt--) {
- nptsv = *(npt = pt + *pt+1);
- *pt += 2; *npt = EOS;
- aenttst(adn, pt);
- *pt -= 2; *(pt = npt) = nptsv;
- }
- break;
- case AID:
- /* Define ID; msg if it already exists. */
- if (iddef(ADVAL(al,adn))) {
- sgmlerr(71, &pcbstag, ADNAME(al,adn), ADVAL(al,adn)+1);
- SET(ADFLAGS(al,adn), AINVALID);
- continue;
- }
- ++ds.idcnt;
- break;
- case AIDREF:
- idreftst(adn, ADVAL(al,adn));
- break;
- case AIDREFS:
- pt = ADVAL(al,adn);
- tokencnt = (int)ADNUM(al,adn);
- while (tokencnt--) {
- nptsv = *(npt = pt + *pt+1);
- *pt += 2; *npt = EOS;
- idreftst(adn, pt);
- *pt -= 2; *(pt = npt) = nptsv;
- }
- break;
- case ANOTEGRP: /* Return notation identifier. */
- if (GET(ADFLAGS(al,adn), ASPEC)) notadn = adn;/*NOTATION specified*/
- if ((dpt = dcnfind(ADVAL(al,adn)))==0) {
- sgmlerr(77, &pcbstag, ADNAME(al,adn), ADVAL(al,adn)+1);
- SET(ADFLAGS(al,adn), AINVALID);
- }
- else ADDATA(al,adn).x = dpt;
- break;
- }
- if (!sd.shorttag && !sd.omittag && ADVAL(al,adn)!=NULL
- && !GET(ADFLAGS(al,adn), ASPEC+AINVALID))
- sgmlerr(197, &pcbstag, ADNAME(al,adn), (UNCH *)0);
- } while ((adn+=BITON(ADFLAGS(al,adn),AGROUP) ? (int)ADNUM(al,adn)+1 : 1)<=adsz);
-
- /* Error if NOTATION specified with CONREF attribute or EMPTY element. */
- if (notadn && (conrefsw
- || (newetd && GET(newetd->etdmod->ttype, MNONE)))) {
- sgmlerr((UNS)(conrefsw ? 84 : 76), &pcbstag,
- ADNAME(al,notadn), ADVAL(al,notadn)+1);
- SET(ADFLAGS(al,notadn), AINVALID);
- }
-}
-/* AENTTST: Validate an individual ENTITY token in AENTITY or AENTITYS value.
-*/
-VOID aenttst(adn, pt)
-int adn; /* Position in list. */
-UNCH *pt; /* Ptr to current ENTITY token in value. */
-{
- struct entity *ept; /* Save area for ecb ptr. */
-
- if (++aentctr>GRPCNT) {
- sgmlerr(136, &pcbstag, ADNAME(al,adn), pt+1);
- SET(ADFLAGS(al,adn), AINVALID);
- return;
- }
- if ( (ept = entfind(pt))==0
- && (ecbdeflt==0 || (ept = usedef(pt))==0) ) {
- sgmlerr(ecbdeflt ? 151 : 72, &pcbstag, ADNAME(al,adn), pt+1);
- SET(ADFLAGS(al,adn), AINVALID);
- return;
- }
- if (ept->estore==ESX || ept->estore==ESC || ept->estore==ESN) {
- /* Error if DCN has no notation identifier. */
- if (ept->estore==ESN && NEXTYPE(ept->etx.n)!=ESNSUB
- && !NEDCNDEFINED(ept->etx.n)) {
- sgmlerr(78, &pcbstag, NEDCN(ept->etx.n)+1,
- pt+1);
- SET(ADFLAGS(al,adn), AINVALID);
- }
- }
- else {
- sgmlerr(86, &pcbstag, ADNAME(al,adn), pt+1);
- SET(ADFLAGS(al,adn), AINVALID);
- }
-}
-/* IDREFTST: Validate an individual IDREF token in an IDREF or IDREFS value.
-*/
-VOID idreftst(adn, pt)
-int adn; /* Position in list. */
-UNCH *pt; /* Ptr to current IDREF token in value. */
-{
- struct fwdref *rp;
- if (++idrctr>GRPCNT) {
- sgmlerr(70, &pcbstag, ADNAME(al,adn), pt+1);
- SET(ADFLAGS(al,adn), AINVALID);
- return;
- }
- /* Note IDREF; indicate if ID exists. */
- if ((rp = idref(pt)) != 0)
- rp->msg = saverr(69, &pcbstag, ADNAME(al,adn), pt+1);
- ++ds.idrcnt;
-}
-/* ANMGET: Locate an attribute name in an attribute definition list.
-*/
-int anmget(adsz, nm)
-int adsz; /* Size of list. */
-UNCH *nm; /* Value to be found (with length byte). */
-{
- int adn = 0; /* Position in list. */
-
- while (++adn <= adsz && ustrcmp(nm+1, ADNAME(al,adn))) {
- if (BITON(ADFLAGS(al,adn), AGROUP)) adn += (int)ADNUM(al,adn);
- }
- return (adn > adsz) ? 0 : adn;
-}
-/* ANTVGET: Find the position of a name token value in an attribute list.
- Return the position of the attribute definition, or zero
- if none was found. Set pp to the value, if non-NULL.
-*/
-int antvget(adsz, nm, pp)
-int adsz; /* Size of list. */
-UNCH *nm; /* Value to be found (with length byte). */
-UNCH **pp; /* Store value here */
-{
- int adn = 0; /* Position in list. */
-
- while (++adn<=adsz) {
- /* Test only name group members. */
- if (BITON(ADFLAGS(al,adn), AGROUP)) {
- int advn; /* Position of value in sub-list. */
- if ((advn = amemget(&al[adn], (int)ADNUM(al,adn), nm))!=0) {
- if (pp)
- *pp = al[adn+advn].adname;
- return adn;
- }
- adn += (int)ADNUM(al,adn);
- }
- }
- return 0;
-}
-/* AMEMGET: Get the position of a member in an attribute name token group.
- Returns the position, or zero if not found.
- The length byte is ignored in the comparison so that final
- form tokens from ATTVAL can be compared to group members.
-*/
-int amemget(anmtgrp, adsz, nm)
-struct ad anmtgrp[]; /* Name token group. */
-int adsz; /* Size of group. */
-UNCH *nm; /* Name to be found (with length byte). */
-{
- int adn = 0; /* Position in group. */
-
- while ( ++adn<=adsz && ustrncmp(nm+1, anmtgrp[adn].adname+1, (UNS)*nm-1)) ;
- return (adn>adsz) ? 0 : adn;
-}
-/* VALLEN: Returns the length of an attribute value for capacity
- calculations. Normally, the length is NORMSEP plus the number
- of characters. For tokenized lists, it is NORMSEP,
- plus the number of characters in the tokens, plus
- NORMSEP for each token.
- ACHARS and tokenized lists don't have a length byte.
-
-*/
-UNS vallen(type, num, def)
-int type; /* ADTYPE(al,adn) */
-int num; /* ADNUM(al,adn) */
-UNCH *def; /* ADVAL(al,adn) */
-{
- if (type == ACHARS)
- return ustrlen(def) + NORMSEP;
- if (type < ATKNLIST)
- return *def - 2 + NORMSEP;
- return ustrlen(def) + num * (NORMSEP - 1) + NORMSEP;
-}
-/* PARSEGRP: Parse GI names, get their etds, and form an array of pointers
- to them. The array is terminated by a NULL pointer.
- The number of pointers (including the NULL) is returned.
- The grp buffer must have room for GRPCNT+1 etds.
-*/
-UNS parsegrp(grp, pcb, tbuf)
-struct etd *grp[]; /* Buffer for building the group. */
-struct parse *pcb; /* Current parse control block. */
-UNCH *tbuf;
-{
- int grpcnt = 0; /* Number of etds in the group. */
- int i;
- int essv = es; /* Entity stack level when grp started. */
-
- while (parse(pcb)!=GRPE && grpcnt<GRPCNT) {
- switch (pcb->action) {
- case NAS_: /* GI name: get its etd for the group. */
- grp[grpcnt] = etddef(parsenm(tbuf, NAMECASE));
- for (i = 0; i < grpcnt; i++)
- if (grp[i] == grp[grpcnt]) {
- mderr(98, ntoa(grpcnt + 1), grp[grpcnt]->etdgi + 1);
- break;
- }
- if (i == grpcnt)
- grpcnt++;
- continue;
-
- case EE_: /* Entity ended (correctly or incorrectly). */
- if (es<essv) {synerr(37, pcb); essv = es;}
- continue;
-
- case PIE_: /* PI entity reference (invalid). */
- entpisw = 0; /* Reset PI entity indicator. */
- synerr(59, pcb);
- continue;
-
- default:
- break;
- }
- break;
- }
- grp[grpcnt++] = 0; /* NULL pointer indicates end of group. */
- if (es!=essv) synerr(37, pcb);
- return grpcnt; /* Return number of ptrs in group. */
-}
-/* PARSNGRP: Parse notation names, get their dcncbs, and form an array of
- pointers to them. The array is terminated by a NULL pointer.
- The number of pointers (including the NULL) is returned.
- The grp buffer must have room for GRPCNT+1 members.
-*/
-UNS parsngrp(grp, pcb, tbuf)
-struct dcncb *grp[]; /* Buffer for building the group. */
-struct parse *pcb; /* Current parse control block. */
-UNCH *tbuf;
-{
- int grpcnt = 0; /* Number of members in the group. */
- int i;
- int essv = es; /* Entity stack level when grp started. */
-
- while (parse(pcb)!=GRPE && grpcnt<GRPCNT) {
- switch (pcb->action) {
- case NAS_: /* Member name: get its control block. */
- grp[grpcnt] = dcndef(parsenm(tbuf, NAMECASE));
- for (i = 0; i < grpcnt; i++)
- if (grp[i] == grp[grpcnt]) {
- mderr(98, ntoa(grpcnt + 1), grp[grpcnt]->ename + 1);
- break;
- }
- if (i == grpcnt)
- grpcnt++;
- continue;
-
- case EE_: /* Entity ended (correctly or incorrectly). */
- if (es<essv) {synerr(37, pcb); essv = es;}
- continue;
-
- case PIE_: /* PI entity reference (invalid). */
- entpisw = 0; /* Reset PI entity indicator. */
- synerr(59, pcb);
- continue;
-
- default:
- break;
- }
- break;
- }
- grp[grpcnt++] = 0; /* NULL pointer indicates end of group. */
- if (es!=essv) synerr(37, pcb);
- return grpcnt; /* Return number of ptrs in group. */
-}
-/* COPYGRP: Allocate storage for a group and copy the group into it.
-*/
-PETD *copygrp(pg, grpsz)
-PETD pg[]; /* Pointer to a group (array of etd ptrs). */
-UNS grpsz; /* Number of ptrs in grp, including final NULL. */
-{
- UNS glen; /* Group length in characters. */
- PETD *gnm; /* Ptr to permanent name group. */
-
- if (pg==0) return (PETD *)0;
- glen = grpsz * sizeof(struct etd *);
- memcpy( (UNIV)(gnm = (struct etd **)rmalloc(glen)) , (UNIV)pg, glen );
- return gnm;
-}
-/* INGRP: Locate an etd in a name group and return its index+1 (or zero
- if not found).
-*/
-int ingrp(pg, ketd)
-PETD pg[]; /* Array of pointers to etds. */
-PETD ketd; /* Pointer to etd to be found in group. */
-{
- int i = 0; /* Array index. */
-
- while (pg[i]) if (pg[i++]==ketd) return i;
- return 0;
-}
-/* PARSELIT: Parse a delimited string and collect it into a token.
- Caller supplies buffer, which must be 1 longer than
- maximum string allowed.
- Caller also supplies character that delimits the string.
- TODO: Return 1 if CDATA, SDATA or NONSGML occurred.
-*/
-#ifdef USE_PROTOTYPES
-VOID parselit(UNCH *tbuf, struct parse *pcb, UNS maxlen, UNCH del)
-#else
-VOID parselit(tbuf, pcb, maxlen, del)
-UNCH *tbuf; /* Work area for tokenization (parmlen+1). */
-struct parse *pcb; /* Current parse control block. */
-UNS maxlen; /* Maximum length of token. */
-UNCH del; /* Literal delimiter: LIT LITA PIC EOS */
-#endif
-{
- UNCH *pt = tbuf; /* Current pointer into tbuf. */
- UNCH lexsv = pcb->plex[del];/* Saved value of delimiter in lexical table. */
- int essv = es; /* Entity stack level when literal started. */
- UNCH datadel; /* Delimiter for CDATA/SDATA entity. */
- int parmlen = (int)maxlen + 1; /* Working limit (to be decremented). */
- int overflow = 0; /* Did the buffer overflow? */
-
- pcb->plex[del] = pcb->plex == lexlms ? lex.l.litc : lex.l.minlitc;
-
- /* The RPR_ action may cause the length of the literal to decrease by
- 1 (this discards a final space in a minimum literal); so while
- building the literal, the length must be allowed to grow to
- maxlen + 1. */
-
- do {
- switch (parse(pcb)) {
- case LP2_: /* Move 2nd char back to buffer; redo prev.*/
- REPEATCC;
- case LPR_: /* Move previous char to buffer; REPEATCC; */
- REPEATCC;
- case MLA_: /* Move character to buffer. */
- if (parmlen <= 0) { overflow = 1; break; }
- *pt++ = *FPOS; --parmlen;
- continue;
-
- case FUN_: /* Function char found; replace with space.*/
- if (parmlen <= 0) { overflow = 1; break; }
- *pt++ = ' '; --parmlen;
- continue;
-
- case RSM_: /* Record start: ccnt=0; ++rcnt.*/
- ++RCNT; CTRSET(RSCC);
- if (parmlen <= 0) { overflow = 1; break; }
- *pt++ = *FPOS; --parmlen;
- continue;
-
- case ERX_: /* Entity reference: cancel LITC delim. */
- case PEX_: /* Parameter entity ref: cancel LITC delim.*/
- lexlms[del] = lexsv;
- continue;
-
- case EE_:
- if (es<essv) {
- synerr(37, pcb);
- essv = es;
- }
- /* If back at top level, re-enable the LITC delimiter. */
- if (es==essv) lexlms[del] = lex.l.litc;
- continue;
-
- case MLE_: /* Char not allowed in minimum literal. */
- synerr(63, pcb);
- continue;
-
- case DEF_: /* Data entity: add it to buffer. */
- if (pcb == &pcblitt) {
- int parmlensv = parmlen;
- entdatsw = 0;
- parmlen = tokdata(pt, parmlen);
- if (parmlen < 0)
- break;
- pt += parmlensv - parmlen;
- continue;
- }
- if (parmlen < datalen + 2) {
- entdatsw = 0;
- overflow = 1;
- break;
- }
- parmlen -= datalen + 2;
- *pt++ = datadel =
- BITON(entdatsw, CDECONT) ? DELCDATA : DELSDATA;
- entdatsw = 0;
- memcpy( pt , data, datalen );
- pt += datalen;
- *pt++ = datadel;
- continue;
-
- case NON_: /* Non-SGML char (delimited and shifted). */
- if (parmlen < 2) { overflow = 1; break; }
- parmlen -= 2;
- memcpy( pt , nonchbuf, 2 );
- pt += 2;
- continue;
-
- case RPR_: /* Remove character from buffer. */
- --pt; ++parmlen;
- break;
-
- case EOD_:
- exiterr(92, pcb);
-
- default:
- break;
- }
- break;
- } while (!overflow && pcb->action!=TER_);
-
- if (parmlen <= 0) {
- --pt;
- overflow = 1;
- }
- if (overflow)
- sgmlerr(134, pcb, ntoa((int)maxlen),(UNCH *)0);
-
- datalen = (UNS)(pt-tbuf);/* To return PI string to text processor. */
- *pt++ = EOS;
- pcb->plex[del] = lexsv; /* Restore normal delimiter handling. */
- if (es!=essv) synerr(37, pcb);
-}
-
-/* Handle a data entity in a tokenized attribute value literal.
-Parmlen is amount of space left. Return new parmlen. If there's not
-enough space return -1, and copy up to parmlen + 1 characters. Only
-tokenization should be done, not attribute value interpretation. */
-
-int tokdata(pt, parmlen)
-UNCH *pt;
-int parmlen;
-{
- int skip = (pcblitt.newstate == 0);
- int i;
-
- for (i = 0; parmlen >= 0 && i < datalen; i++) {
- switch (data[i]) {
- case SPCCHAR:
- if (!skip) {
- *pt++ = data[i];
- parmlen--;
- skip = 1;
- }
- break;
- default:
- if (data[i] == DELNONCH) {
- assert(i + 1 < datalen);
- if ((parmlen -= 2) < 0)
- break;
- *pt++ = DELNONCH;
- *pt++ = data[++i];
- skip = 0;
- }
- else {
- *pt++ = data[i];
- parmlen--;
- skip = 0;
- }
- break;
- }
- }
- pcblitt.newstate = skip ? 0 : pcblittda;
- return parmlen;
-}
-
-
-/* PARSEMD: Parser for markup declarations.
- It returns a token each time it is called.
-
-*/
-int parsemd(pt, namecase, lpcb, tokenlen)
-UNCH *pt; /* Token buffer: >=tokenlen+2. */
-int namecase; /* Case translation: ENTCASE NAMECASE AVALCASE. */
-struct parse *lpcb; /* Parse control block for literal parse. */
-UNS tokenlen; /* Max length of expected token: NAMELEN LITLEN */
-{
- struct parse *pcb; /* Current parse control block. */
-
- pcb = (lpcb) ? &pcbmd : &pcbmdc; /* If no literal pcb, dcl is comment. */
-
- doparse: while (parse(pcb)==EE_)
- if (es<mdessv) {synerr(37, pcb); mdessv = es;}
- if (pcb->action==PIE_) { /* PI entity reference not allowed. */
- entpisw = 0; /* Reset PI entity indicator. */
- synerr(59, pcb);
- goto doparse;
- }
- ++parmno; /* Increment parameter counter. */
- switch (pcb->action) {
- case CDR: /* COM[1] (MINUS) occurred previously. */
- REPEATCC;
- return (int)pcb->action;
- case LIT: /* Literal: CDATA with LIT delimiter. */
- parselit(pt, lpcb, tokenlen, lex.d.lit);
- return (int)pcb->action;
- case LITE: /* Literal: CDATA with LITA delimiter. */
- parselit(pt, lpcb, tokenlen, lex.d.lita);
- return((int)(pcb->action = LIT));
- case RNS: /* Reserved name started (after RNI). */
- parsenm(pt, NAMECASE);
- return (int)pcb->action;
- case NAS: /* Name started. */
- if (namecase!=AVALCASE) {
- parsenm(pt, namecase);
- return (int)pcb->action;
- }
- /* Treat attribute value as name character string. */
- case NMT: /* Name token string. */
- parsetkn(pt, NMC, (int)tokenlen); /* Get undelimited value. */
- return (int)pcb->action;
- case NUM: /* Number or number token string. */
- parsetkn(pt, (UNCH)((int)tokenlen<=NAMELEN ? NU:NMC), (int)tokenlen);
- if (tokenlen > NAMELEN) pcb->newstate = 0;
- return (int)pcb->action;
- case PENR:
- REPEATCC;
- return (pcb->action = PEN);
- case EOD_:
- exiterr(133, pcb);
- /* EXIT */
- default: /* End of declaration. */
- return (int)pcb->action; /* EMD GRPS MGRP PEN PGRP */
- }
-}
-/* PARSEMOD: If the declared content was a keyword, the token count is zero
- and it is only necessary to save the type. Otherwise,
- collect the outermost token count and model type bytes for a model.
- The count includes tokens found in nested groups also.
- After building the model, parse for its occurrence indicator.
-*/
-struct thdr *parsemod(dctype)
-int dctype; /* Content type (0=model). */
-{
- gbuf[0].ttype = (UNCH)dctype; /* Initialize content flags byte. */
- if (dctype) {gbuf[0].tu.tnum = 0; return gbuf;} /* Return if not model. */
-
- gbuf[0].tu.tnum = 0; /* Don't count 1st group or model header. */
- gbuf[1].ttype = 0; /* Initialize 1st group type ... */
- gbuf[1].tu.tnum = 0; /* and count. */
- grplvl = 1; /* Content model is 1st level group. */
- pcbgrcm.newstate = 0; /* Go parse the model group. */
- /* Empty group is trapped during syntax parse; other errors return NULL. */
- if (!parsegcm(&pcbgrcm, &gbuf[1], &gbuf[0])) return (struct thdr *)0;
- parse(&pcbgrcs); /* Get the model suffix, if there is one. */
- switch(pcbgrcs.action) {
- case OPT: /* OPT occurrence indicator for model. */
- SET(gbuf[1].ttype, TOPT|TXOPT);
- break;
- case REP: /* REP occurrence indicator for model. */
- SET(gbuf[1].ttype, TREP|TXREP);
- break;
- case OREP: /* OREP occurrence indicator for model. */
- SET(gbuf[1].ttype, TOREP|TXOREP);
- break;
- case EE_:
- if (es < mdessv) {
- synerr(37, &pcbmd);
- mdessv = es;
- }
- default: /* RCR_: Repeat char and return. */
- break;
- }
- if (sw.swambig) ambig(); /* Check content model for ambiguity. */
- return gbuf;
-}
-/* PARSEGCM: Collect token headers (struct thdr) into a group (array).
- An etd is defined for each GI (if none exists) and its pointer is
- stored in the header. The function is called recursively.
-*/
-struct thdr *parsegcm(pcb, pgh, gbuf)
-struct parse *pcb; /* Current parse control block. */
-struct thdr *pgh; /* Current group header in group buffer. */
-struct thdr *gbuf; /* Header for outermost group (model). */
-{
-#define MCON gbuf->ttype /* Model type (content attributes). */
- struct thdr *pg=pgh; /* Current group token. */
- struct thdr *pgsv=pgh; /* Saved current token for occ indicator. */
- int optcnt = 0; /* Count of optional tokens in group. */
- int essv = es; /* Entity stack level when grp started. */
-
- while (gbuf->tu.tnum<=GRPGTCNT && pgh->tu.tnum<=GRPCNT && parse(pcb)!=GRPE)
- switch (pcb->action) {
-
- case NAS_: /* GI name: get its etd and store it. */
- ++gbuf->tu.tnum; ++pgh->tu.tnum;
- (pgsv = ++pg)->ttype = TTETD;
- pg->tu.thetd = etddef(parsenm(tbuf, NAMECASE));
- SET(MCON, MGI);
- continue;
-
- case RNS_: /* Reserved name started (#PCDATA). */
- parsenm(tbuf, NAMECASE);
- if (ustrcmp(tbuf+1, key[KPCDATA])) {
- mderr(116, ntoa(gbuf->tu.tnum), tbuf+1);
- return (struct thdr *)0;
- }
- /* If #PCDATA is the first non-group token, model is a phrase. */
- if (!MCON) SET(MCON, MPHRASE);
- case DTAG: /* Data tag template ignored; treat as #PCDATA. */
- if (pcb->action==DTAG) SET(pgh->ttype, TTSEQ); /* DTAG is SEQ grp. */
- ++gbuf->tu.tnum; ++pgh->tu.tnum;
- (++pg)->ttype = TTCHARS+TOREP;/* #PCDATA is OPT and REP. */
- pg->tu.thetd = ETDCDATA;
- ++optcnt; /* Ct opt tokens to see if grp is opt.*/
- SET(MCON, MCHARS);
- continue;
-
- case GRP_: /* Group started. */
- ++gbuf->tu.tnum; ++pgh->tu.tnum;
- (pgsv = ++pg)->ttype = 0; /* Type will be set by connector. */
- pg->tu.tnum = 0; /* Group has number instead of etd. */
- if (++grplvl>GRPLVL) {
- mderr(115, ntoa(gbuf->tu.tnum), (UNCH *)0);
- return (struct thdr *)0;
- }
- pg = parsegcm(pcb, pg, gbuf);
- if (!pg) return (struct thdr *)0;
- if (GET(pgsv->ttype, TOPT)) ++optcnt; /* Indicate nested opt grp. */
- --grplvl;
- continue;
-
- case OREP: /* OREP occurrence indicator for current token.*/
- SET(pgsv->ttype, TREP|TXREP);
- /* Now treat like OPT. */
- case OPT: /* OPT occurrence indicator for current token. */
- SET(pgsv->ttype, TXOPT);
- if (GET(pgsv->ttype, TOPT)) continue; /* Exit if nested opt grp. */
- SET(pgsv->ttype, TOPT);
- ++optcnt; /* Count opt tokens to see if grp is optional. */
- continue;
- case REP: /* REP occurrence indicator for current token. */
- SET(pgsv->ttype, TREP|TXREP);
- continue;
-
- case OR: /* OR connector found. */
- if BITOFF(pgh->ttype, TTAND) SET(pgh->ttype, TTOR);
- else if (GET(pgh->ttype, TTAND)!=TTOR)
- mderr(55, ntoa(gbuf->tu.tnum), (UNCH *)0);
- continue;
- case AND: /* AND connector found. */
- if BITOFF(pgh->ttype, TTAND) SET(pgh->ttype, TTAND);
- else if (GET(pgh->ttype, TTAND)!=TTAND)
- mderr(55, ntoa(gbuf->tu.tnum), (UNCH *)0);
- continue;
- case SEQ: /* SEQ connector found. */
- if BITOFF(pgh->ttype, TTAND) SET(pgh->ttype, TTSEQ);
- else if (GET(pgh->ttype, TTAND)!=TTSEQ)
- mderr(55, ntoa(gbuf->tu.tnum), (UNCH *)0);
- continue;
-
- case EE_: /* Entity ended (correctly or incorrectly). */
- if (es<essv) {synerr(37, pcb); essv = es;}
- continue;
-
- case PIE_: /* PI entity reference (not permitted). */
- entpisw = 0; /* Reset PI entity indicator. */
- synerr(59, pcb);
- continue;
-
- default: /* Syntax errors return in disgrace. */
- synerr(37, pcb);
- return (struct thdr *)0;
- }
- if (pgh->tu.tnum>GRPCNT) {
- mderr(113, ntoa(gbuf->tu.tnum), (UNCH *)0);
- return (struct thdr *)0;
- }
- if (gbuf->tu.tnum>GRPGTCNT) {
- mderr(114, ntoa(gbuf->tu.tnum), (UNCH *)0);
- return (struct thdr *)0;
- }
- if (pgh->tu.tnum==1) SET(pgh->ttype, TTSEQ); /* Unit grp is SEQ. */
- /* An optional token in an OR group makes the group optional. */
- if (GET(pgh->ttype, TTMASK)==TTOR && optcnt) SET(pgh->ttype, TOPT);
- /* If all tokens in any group are optional, so is the group. */
- if (pgh->tu.tnum<=optcnt) SET(pgh->ttype, TOPT);
-
- if (es!=essv) synerr(37, pcb);
- return pg; /* Return pointer to GRPS token. */
-}
-/* PARSENM: Parser for SGML names, which can be translated with LEXTRAN.
- The input is read from the entity stack. CC is 1st char of name.
- Returns a pointer to the parsed name.
-*/
-UNCH *parsenm(tbuf, nc)
-UNCH *tbuf; /* Buffer for name: >=NAMELEN+2. */
-int nc; /* Namecase translation: 1=yes; 0=no. */
-{
- UNCH len; /* Length of name (incl EOS & length byte). */
-
- *(tbuf + (len = 1) ) = nc ? lextran[*FPOS] : *FPOS;
- while ((NEWCC, (int)lextoke[*FPOS]>=NMC) && (len<NAMELEN)) {
- TRACETKN(NMC, lextoke);
- if (lextoke[*(tbuf + ++len) = (nc ? lextran[*FPOS] : *FPOS)]==EOB) {
- --len;
- entget();
- }
- }
- REPEATCC; /* Put back the non-token character. */
- *(tbuf + ++len) = EOS; /* Terminate name with standard EOS. */
- *tbuf = ++len; /* Store length ahead of name. */
- return tbuf;
-}
-/* PARSETKN: Parser for start-tag attribute value tokens.
- First character of token is already in *FPOS.
- Returns a pointer to the parsed token.
- Parsed token has EOS but no length byte.
-*/
-#ifdef USE_PROTOTYPES
-UNCH *parsetkn(UNCH *tbuf, UNCH scope, int maxlen)
-#else
-UNCH *parsetkn(tbuf, scope, maxlen)
-UNCH *tbuf; /* Buffer for token: >=maxlen+1. */
-UNCH scope; /* Minimum lexical class allowed. */
-int maxlen; /* Maximum length of a token. */
-#endif
-{
- int i = 1;
- tbuf[0] = *FPOS;
- while (i < maxlen) {
- NEWCC;
- if (lextoke[*FPOS] < scope) {
- REPEATCC;
- break;
- }
- TRACETKN(scope, lextoke);
- if (*FPOS == EOBCHAR)
- entget();
- else
- tbuf[i++] = *FPOS;
- }
- tbuf[i] = EOS;
- return tbuf;
-}
-/* PARSESEQ: Parser for blank sequences (i.e., space and TAB characters ).
- First character of sequence is already in *FPOS.
-*/
-VOID parseseq(tbuf, maxlen)
-UNCH *tbuf; /* Buffer for storing found sequence. */
-int maxlen; /* Maximum length of a blank sequence. */
-{
- tbuf[0] = *FPOS;
- datalen = 1;
- for (;;) {
- NEWCC;
- if (*FPOS == EOBCHAR) {
- entget();
- continue;
- }
- if ((lextoke[*FPOS] != SEP && *FPOS != SPCCHAR)
- || datalen >= maxlen)
- break;
- tbuf[datalen++] = *FPOS;
- TRACETKN(SEP, lextoke);
- }
-}
-/* S2VALNM: Parser for attribute values that are tokenized like names.
- The input is read from a string (hence S ("string") 2 ("to") VALNM).
- It stops at the first bad character.
- Returns a pointer to the created name.
-*/
-#ifdef USE_PROTOTYPES
-UNCH *s2valnm(UNCH *nm, UNCH *s, UNCH scope, int translate)
-#else
-UNCH *s2valnm(nm, s, scope, translate)
-UNCH *nm; /* Name to be created. */
-UNCH *s; /* Source string to be parsed as name. */
-UNCH scope; /* Minimum lexical class allowed. */
-int translate; /* Namecase translation: 1=yes; 0=no. */
-#endif
-{
- UNCH len = 0; /* Length of name (incl EOS and length). */
-
- for (; (int)lextoke[*s] >= scope && len < NAMELEN; s++)
- nm[++len] = translate ? lextran[*s] : *s;
- nm[++len] = EOS; /* Terminate name with standard EOS. */
- *nm = ++len; /* Store length ahead of name. */
- return nm;
-}
-/* PARSEVAL: Parser for attribute values.
- The input is read from a string and tokenized in a buffer.
- The input is terminated by EOS.
- Each token is preceded by its actual length; there is no EOS.
- If an error occurs while parsing, or
- if a token doesn't conform, set the token count to 0 to show that
- value was not tokenized and return the error code.
- After successful parse, return buffer length and 0 error code.
- The number of tokens found is set in external variable tokencnt.
-*/
-int parseval(s, atype, tbuf)
-UNCH *s; /* Source string to be parsed as token list. */
-UNS atype; /* Type of token list expected. */
-UNCH *tbuf; /* Work area for tokenization. */
-{
- int t;
- UNCH *pt = tbuf;
-
- pcbval.newstate = 0; tokencnt = 0;
- while (1) {
- for (;;) {
- pcbval.input = lextoke[*s];
- pcbval.state = pcbval.newstate;
- pcbval.newstate = (*(pcbval.ptab + pcbval.state)) [pcbval.input];
- pcbval.action = (*(pcbval.ptab + pcbval.state+1)) [pcbval.input];
- TRACEVAL(&pcbval, atype, s, tokencnt);
- if (pcbval.action != NOPA)
- break;
- s++;
- }
-
-
- switch (pcbval.action) {
- case INVA: /* Invalid character; terminate parse. */
- if (*s == '\0') goto alldone; /* Normal termination. */
- tokencnt = 0; /* Value was not tokenized. */
- return(14);
- case LENA: /* Length limit of token exceeded; end parse. */
- tokencnt = 0; /* Value was not tokenized. */
- return(15);
- default: /* Token begun: NUMA, NASA, or NMTA. */
- break;
- }
-
- ++tokencnt; /* One token per iteration. */
- switch (atype) {
- case AENTITY:
- if (tokencnt>1) {tokencnt = 0; return(16);}
- case AENTITYS:
- if (pcbval.action!=NASA) {tokencnt = 0; return(17);}
- s2valnm(pt, s, NMC, ENTCASE);
- break;
-
- case AID:
- case AIDREF:
- case ANAME:
- case ANOTEGRP:
- if (tokencnt>1) {tokencnt = 0; return(16);}
- case AIDREFS:
- case ANAMES:
- if (pcbval.action!=NASA) {tokencnt = 0; return(17);}
- s2valnm(pt, s, NMC, NAMECASE);
- break;
-
- case ANMTGRP:
- case ANMTOKE:
- if (tokencnt>1) {tokencnt = 0; return(16);}
- case ANMTOKES:
- /* No test needed because NMTA, NUMA and NASA are all valid. */
- s2valnm(pt, s, NMC, NAMECASE);
- break;
-
- case ANUMBER:
- if (tokencnt>1) {tokencnt = 0; return(16);}
- case ANUMBERS:
- if (pcbval.action!=NUMA) {tokencnt = 0; return(17);}
- s2valnm(pt, s, NU, NAMECASE);
- t = lextoke[s[*pt - 2]];
- if (t == NMS || t == NMC) {tokencnt = 0; return(17);}
- break;
-
- case ANUTOKE:
- if (tokencnt>1) {tokencnt = 0; return(16);}
- case ANUTOKES:
- if (pcbval.action!=NUMA) {tokencnt = 0; return(17);}
- s2valnm(pt, s, NMC, NAMECASE);
- break;
- }
- *pt -= 2;
- s += *pt;
- pt += *pt + 1;
- }
- alldone:
- *pt++ = EOS;
- if (*tbuf == '\0')
- return 25;
- if (atype < ATKNLIST)
- *tbuf += 2; /* include length and EOS */
- return 0;
-}
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/pcbrf.c b/usr.bin/sgmls/sgmls/pcbrf.c
deleted file mode 100644
index 554fdfb..0000000
--- a/usr.bin/sgmls/sgmls/pcbrf.c
+++ /dev/null
@@ -1,1351 +0,0 @@
-/* PCBRF: Parse tables for reference concrete syntax.
-*/
-#include "config.h"
-#include "entity.h" /* Templates for entity control blocks. */
-#include "action.h" /* Action names for all parsing. */
-#include "synxtrn.h" /* Declarations for concrete syntax constants. */
-#include "adl.h" /* Definitions for attribute list processing. */
-/* PCBCONM: State and action table for content parse of mixed content.
- Initial state assumes a start-tag was just processed.
-*/
-/* Symbols for state names (end with a number). */
-#define ET0 0 /* Markup found or buffer flushed; no data. */
-#define DA0 2 /* Data in buffer. */
-#define DA1 4 /* Data and space in buffer. */
-#define ER0 6 /* ERO found; start lookahead buffer. */
-#define CR0 8 /* CRO found (ERO, RNI). */
-#define RS0 10 /* RS found; possible SR 3-6. */
-#define ME0 12 /* MSC found; possible SR26. */
-#define ME1 14 /* MSC, MSC found. */
-#define ES0 16 /* TAGO found; start lookahead buffer. */
-#define EE0 18 /* End-tag start (TAGO,ETI); move to lookahead buffer. */
-#define NE0 20 /* End-tag start (TAGO,NET); process NET if not end-tag. */
-#define MD0 22 /* MDO found (TAGO, MDO[2]). */
-#define MC0 24 /* MDO, COM found. */
-#define SC0 26 /* COM found; possible SR19-20. */
-#define SP0 28 /* Space found; data pending; possible SR7 or SR9. */
-#define SR0 30 /* SPCR found; possible SR7 or SR9. */
-#define TB0 32 /* TAB found; possible SR7 or SR9. */
-
-int pcbcnet = ET0; /* PCBCONM: markup found or data buffer flushed.*/
-int pcbcnda = DA0; /* PCBCONM: data in buffer. */
-
-static UNCH
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-et0 []={DA0 ,DA0 ,DA0 ,DA0 ,SP0 ,ET0 ,ET0 ,ET0 ,RS0 ,ET0 ,TB0 ,DA0 ,ET0 ,ER0 ,
- ET0 ,SC0 ,DA0 ,ET0 ,ET0 ,SR0 ,DA0 ,ME0 ,ET0 ,DA0 ,ET0 ,DA0 ,ES0 ,ET0 },/*et0*/
-et0a[]={DAS_,DAS_,DAS_,DAS_,DAS_,NON_,GET_,GET_,RSR_,SR2_,DAS_,DAS_,NSC_,LAS_,
- REF_,NOP_,DAS_,NED_,SR10,DAS_,DAS_,NOP_,SR25,DAS_,SR11,DAS_,LAS_,FCE_},
-
-da0 []={DA0 ,DA0 ,DA0 ,DA0 ,DA1 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,DA0 ,ET0 ,DA0 ,ET0 ,ET0 },/*da0*/
-da0a[]={NOP_,NOP_,NOP_,NOP_,NOP_,DAF_,DAF_,DAF_,DAF_,DAF_,DAF_,NOP_,DAF_,DAF_,
- DAF_,DAF_,NOP_,DAF_,DAF_,DAF_,NOP_,DAF_,DAF_,NOP_,DAF_,NOP_,DAF_,DAF_},
-
-da1 []={DA0 ,DA0 ,DA0 ,DA0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,DA0 ,ET0 ,DA0 ,ET0 ,ET0 },/*da1*/
-da1a[]={NOP_,NOP_,NOP_,NOP_,DAR_,DAF_,DAF_,DAR_,DAF_,DAR_,DAR_,NOP_,DAF_,DAF_,
- DAF_,DAF_,NOP_,DAF_,DAF_,DAR_,NOP_,DAF_,DAF_,NOP_,DAF_,NOP_,DAF_,DAF_},
-
-er0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ER0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,CR0 ,ET0 ,ET0 ,ET0 },/*er0*/
-er0a[]={LAF_,LAF_,LAF_,ER_ ,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAM_,LAF_,LAF_,LAF_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-cr0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,CR0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*cr0*/
-cr0a[]={NLF_,CRN_,NLF_,CRA_,NLF_,NLF_,NLF_,GET_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,
- NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_},
-
-rs0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,RS0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*rs0*/
-rs0a[]={SR3_,SR3_,SR3_,SR3_,SR4_,SR3_,SR3_,GET_,SR3_,SR5_,SR4_,SR3_,SR3_,SR3_,
- SR3_,SR3_,SR3_,NED_,SR3_,SR4_,SR3_,SR3_,SR3_,SR3_,SR3_,SR3_,SR3_,SR3_},
-
-me0 []={ET0, ET0, ET0, ET0, ET0 ,ET0, ET0, ME0, ET0 ,ET0 ,ET0 ,ET0, ET0, ET0,
- ET0 ,ET0 ,ET0 ,ET0, ET0, ET0, ET0, ME1 ,ET0, ET0, ET0 ,ET0, ET0, ET0 },/*me0*/
-me0a[]={SR26,SR26,SR26,SR26,SR26,SR26,SR26,GET_,SR26,SR26,SR26,SR26,SR26,SR26,
- SR26,SR26,SR26,SR26,SR26,SR26,SR26,NOP_,SR26,SR26,SR26,SR26,SR26,SR26},
-
-me1 []={ET0, ET0, ET0, ET0, ET0 ,ET0, ET0, ME1, ET0 ,ET0 ,ET0 ,ET0, ET0, ET0,
- ET0 ,ET0 ,ET0 ,ET0, ET0, ET0, ET0, ET0 ,ET0, ET0, ET0 ,ET0, ET0, ET0 },/*me1*/
-me1a[]={RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,GET_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,
- RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,MSE_,RBR_,RBR_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-es0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ES0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,EE0 ,NE0 ,ET0 ,ET0 ,MD0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*es0*/
-es0a[]={LAF_,LAF_,LAF_,STG_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAM_,LAM_,LAF_,LAF_,LAM_,LAF_,LAF_,PIS_,LAF_,NST_,LAF_,LAF_},
-
-ee0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,EE0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*ee0*/
-ee0a[]={LAF_,LAF_,LAF_,ETG_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,NET_,LAF_,LAF_},
-
-ne0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,NE0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*ne0*/
-ne0a[]={NLF_,NLF_,NLF_,ETG_,NLF_,NLF_,NLF_,GET_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,
- NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NET_,NLF_,NLF_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-md0 []={ET0, ET0, ET0, ET0, ET0 ,ET0, ET0, MD0, ET0 ,ET0 ,ET0 ,ET0, ET0, ET0,
- ET0 ,MC0 ,ET0 ,ET0, ET0, ET0, ET0, ET0 ,ET0, ET0, ET0 ,ET0, ET0, ET0 },/*md0*/
-md0a[]={LAF_,LAF_,LAF_,MD_ ,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAM_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,MSS_,LAF_,LAF_,MDC_,LAF_,LAF_},
-
-mc0 []={ET0, ET0, ET0, ET0, ET0, ET0 ,ET0, MC0, ET0 ,ET0, ET0 ,ET0, ET0, ET0,
- ET0 ,ET0 ,ET0 ,ET0, ET0, ET0, ET0, ET0 ,ET0 ,ET0 ,ET0 ,ET0, ET0, ET0 },/*mc0*/
-mc0a[]={NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,GET_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,
- NLF_,MDC_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_},
-
-sc0 []={ET0, ET0, ET0, ET0, ET0, ET0 ,ET0, SC0, ET0 ,ET0, ET0 ,ET0, ET0, ET0,
- ET0 ,ET0 ,ET0 ,ET0, ET0, ET0, ET0, ET0 ,ET0 ,ET0 ,ET0 ,ET0, ET0, ET0 },/*sc0*/
-sc0a[]={SR19,SR19,SR19,SR19,SR19,SR19,SR19,GET_,SR19,SR19,SR19,SR19,SR19,SR19,
- SR19,SR20,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-sp0 []={DA0 ,DA0 ,DA0 ,DA0 ,ET0 ,ET0 ,ET0 ,SP0 ,ET0 ,ET0 ,ET0 ,DA0 ,DA0 ,ET0 ,
- ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,ET0 ,DA0 ,ET0 ,ET0 ,DA0 ,DA0 ,DA0 ,ET0 ,ET0 },/*sp0*/
-sp0a[]={NOP_,NOP_,NOP_,NOP_,SR9_,DAF_,DAF_,GTR_,DAF_,SR7_,SR9_,NOP_,NOP_,DAF_,
- DAF_,DAF_,NOP_,DAF_,DAF_,SR9_,NOP_,DAF_,DAF_,NOP_,NOP_,NOP_,DAF_,DAF_},
-
-sr0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,SR0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*sr0*/
-sr0a[]={SR8_,SR8_,SR8_,SR8_,SR9_,SR8_,SR8_,GET_,SR8_,SR7_,SR9_,SR8_,SR8_,SR8_,
- SR8_,SR8_,SR8_,SR8_,SR8_,SR9_,SR8_,SR8_,SR8_,SR8_,SR8_,SR8_,SR8_,SR8_},
-
-tb0 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,TB0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*tb0*/
-tb0a[]={SR1_,SR1_,SR1_,SR1_,SR9_,SR1_,SR1_,GET_,SR1_,SR7_,SR9_,SR1_,SR1_,SR1_,
- SR1_,SR1_,SR1_,SR1_,SR1_,SR9_,SR1_,SR1_,SR1_,SR1_,SR1_,SR1_,SR1_,SR1_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-
-*conmtab[] = {et0, et0a, da0, da0a, da1, da1a, er0, er0a, cr0, cr0a, rs0, rs0a,
- me0, me0a, me1, me1a, es0, es0a, ee0, ee0a, ne0, ne0a, md0, md0a,
- mc0, mc0a, sc0, sc0a, sp0, sp0a, sr0, sr0a, tb0, tb0a };
-struct parse pcbconm = {"CONM", lexcnm, conmtab, 0, 0, 0, 0};
-#undef ET0
-#undef DA0
-#undef DA1
-#undef ER0
-#undef CR0
-#undef RS0
-#undef ME0
-#undef ME1
-#undef ES0
-#undef EE0
-#undef NE0
-#undef MD0
-#undef MC0
-#undef SC0
-#undef SP0
-#undef SR0
-#undef TB0
-/* PCBCONE: State and action table for content parse of element content.
- Initial state assumes a start-tag was just processed.
-*/
-/* Symbols for state names (end with a number). */
-#define ET2 0 /* Markup found. */
-#define ER2 2 /* ERO found; start lookahead buffer. */
-#define CR2 4 /* CRO found (ERO, RNI). */
-#define RS2 6 /* RS found; possible SR 3-6 if they were declared. */
-#define ME2 8 /* MSC found. */
-#define ME3 10 /* MSC, MSC found. */
-#define ES2 12 /* TAGO found; start lookahead buffer. */
-#define EE2 14 /* End-tag start (TAGO,ETI); move to lookahead buffer. */
-#define NE2 16 /* End-tag start (TAGO,NET); process NET if not end-tag. */
-#define MD2 18 /* MDO found (TAGO, MDO[2]). */
-#define MC2 20 /* MDO, COM found. */
-#define SC2 22 /* COM found; possible SR19-20 if they were mapped. */
-#define SP2 24 /* Space found; possible SR7 or SR9. */
-#define SR2 26 /* SPCR found; possible SR7 or SR9. */
-#define TB2 28 /* TAB found; possible SR7 or SR9. */
-
-static UNCH
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-et2 []={ET2 ,ET2 ,ET2 ,ET2 ,SP2 ,ET2 ,ET2 ,ET2 ,RS2 ,ET2 ,TB2 ,ET2 ,ET2 ,ER2 ,
- ET2 ,SC2 ,ET2 ,ET2 ,ET2 ,SR2 ,ET2 ,ME2 ,ET2 ,ET2 ,ET2 ,ET2 ,ES2 ,ET2 },/*et2*/
-et2a[]={DCE_,DCE_,DCE_,DCE_,NOP_,DCE_,GET_,GET_,RS_ ,SR2_,NOP_,DCE_,DCE_,LAS_,
- NOP_,NOP_,DCE_,NED_,SR10,NOP_,DCE_,NOP_,SR25,DCE_,SR11,DCE_,LAS_,FCE_},
-
-er2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ER2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,CR2 ,ET2 ,ET2 ,ET2 },/*er2*/
-er2a[]={LAF_,LAF_,LAF_,ER_ ,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAM_,LAF_,LAF_,LAF_},
-
-cr2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,CR2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 },/*cr2*/
-cr2a[]={NLF_,CRN_,NLF_,CRA_,NLF_,NLF_,NLF_,GET_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,
- NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_},
-
-rs2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,RS2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 },/*rs2*/
-rs2a[]={SR3_,SR3_,SR3_,SR3_,SR4_,SR3_,SR3_,GET_,SR3_,SR5_,SR4_,SR3_,SR3_,SR3_,
- SR3_,SR3_,SR3_,NED_,SR3_,SR4_,SR3_,SR3_,SR3_,SR3_,SR3_,SR3_,SR3_,SR3_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spcr mdo msc mso pio rni tagc tago fce */
-me2 []={ET2, ET2, ET2, ET2, ET2 ,ET2, ET2, ME2, ET2 ,ET2 ,ET2 ,ET2, ET2, ET2,
- ET2 ,ET2, ET2 ,ET2, ET2, ET2, ET2, ME3 ,ET2, ET2, ET2 ,ET2, ET2, ET2 },/*me2*/
-me2a[]={SR26,SR26,SR26,SR26,SR26,SR26,SR26,GET_,SR26,SR26,SR26,SR26,SR26,SR26,
- SR26,SR26,SR26,SR26,SR26,SR26,SR26,NOP_,SR26,SR26,SR26,SR26,SR26,SR26},
-
-me3 []={ET2, ET2, ET2, ET2, ET2 ,ET2, ET2, ME3, ET2 ,ET2 ,ET2 ,ET2, ET2, ET2,
- ET2 ,ET2, ET2 ,ET2, ET2, ET2, ET2, ET2 ,ET2, ET2, ET2 ,ET2, ET2, ET2 },/*me3*/
-me3a[]={RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,GET_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,
- RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,RBR_,MSE_,RBR_,RBR_},
-
-es2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ES2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,EE2 ,NE2 ,ET2 ,ET2 ,MD2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 },/*es2*/
-es2a[]={LAF_,LAF_,LAF_,STG_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAM_,LAM_,LAF_,LAF_,LAM_,LAF_,LAF_,PIS_,LAF_,NST_,LAF_,LAF_},
-
-ee2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,EE2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 },/*ee2*/
-ee2a[]={LAF_,LAF_,LAF_,ETG_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,NET_,LAF_,LAF_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spc mdo msc mso pio rni tagc tago fce */
-ne2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,NE2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 },/*ne2*/
-ne2a[]={NLF_,NLF_,NLF_,ETG_,NLF_,NLF_,NLF_,GET_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,
- NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NET_,NLF_,NLF_},
-
-md2 []={ET2, ET2, ET2, ET2, ET2 ,ET2, ET2, MD2, ET2 ,ET2 ,ET2 ,ET2, ET2, ET2,
- ET2 ,MC2, ET2 ,ET2, ET2, ET2, ET2, ET2 ,ET2, ET2, ET2 ,ET2, ET2, ET2 },/*md2*/
-md2a[]={LAF_,LAF_,LAF_,MD_ ,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAM_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,MSS_,LAF_,LAF_,MDC_,LAF_,LAF_},
-
-mc2 []={ET2, ET2, ET2, ET2, ET2, ET2 ,ET2, MC2, ET2 ,ET2, ET2 ,ET2, ET2, ET2,
- ET2 ,ET2, ET2 ,ET2, ET2, ET2, ET2, ET2 ,ET2 ,ET2 ,ET2 ,ET2, ET2, ET2 },/*mc2*/
-mc2a[]={NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,GET_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,
- NLF_,MDC_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_,NLF_},
-
-sc2 []={ET2, ET2, ET2, ET2, ET2, ET2 ,ET2, SC2, ET2 ,ET2, ET2 ,ET2, ET2, ET2,
- ET2 ,ET2 ,ET2 ,ET2, ET2, ET2, ET2, ET2 ,ET2 ,ET2 ,ET2 ,ET2, ET2, ET2 },/*sc2*/
-sc2a[]={SR19,SR19,SR19,SR19,SR19,SR19,SR19,GET_,SR19,SR19,SR19,SR19,SR19,SR19,
- SR19,SR20,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19,SR19},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net lit spc mdo msc mso pio rni tagc tago fce */
-sp2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,SP2 ,RS2 ,ET2 ,ET2 ,ET2 ,ET2 ,ER2 ,
- ET2 ,SC2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ME2 ,ET2 ,ET2 ,ET2 ,ET2 ,ES2 ,ET2 },/*sp2*/
-sp2a[]={DCE_,DCE_,DCE_,DCE_,SR9_,DCE_,GET_,GET_,RS_ ,SR7_,SR9_,DCE_,DCE_,LAS_,
- NOP_,NOP_,DCE_,NED_,SR10,SR9_,DCE_,LAS_,DCE_,DCE_,SR11,DCE_,LAS_,DCE_},
-
-sr2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,SR2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 },/*sr2*/
-sr2a[]={SR8_,SR8_,SR8_,SR8_,SR9_,SR8_,SR8_,GET_,SR8_,SR7_,SR9_,SR8_,SR8_,SR8_,
- SR8_,SR8_,SR8_,SR8_,SR8_,SR9_,SR8_,SR8_,SR8_,SR8_,SR8_,SR8_,SR8_,SR8_},
-
-tb2 []={ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,TB2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,
- ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 },/*tb2*/
-tb2a[]={SR1_,SR1_,SR1_,SR1_,SR9_,SR1_,SR1_,GET_,SR1_,SR7_,SR9_,SR1_,SR1_,SR1_,
- SR1_,SR1_,SR1_,SR1_,SR1_,SR9_,SR1_,SR1_,SR1_,SR1_,SR1_,SR1_,SR1_,SR1_},
-
-*conetab[] = {et2, et2a, er2, er2a, cr2, cr2a, rs2, rs2a, me2, me2a, me3, me3a,
- es2, es2a, ee2, ee2a, ne2, ne2a, md2, md2a, mc2, mc2a, sc2, sc2a,
- sp2, sp2a, sr2, sr2a, tb2, tb2a };
-struct parse pcbcone = {"CONE", lexcnm, conetab, 0, 0, 0, 0};
-#undef ET2
-#undef ER2
-#undef CR2
-#undef RS2
-#undef ME2
-#undef ME3
-#undef ES2
-#undef EE2
-#undef NE2
-#undef MD2
-#undef MC2
-#undef SC2
-#undef SP2
-#undef SR2
-#undef TB2
-/* PCBCONR: State and action table for content parse of replaceable character
- data. Initial state assumes a start-tag was just processed.
- Only entity references and character references are recognized.
-*/
-/* Symbols for state names (end with a number). */
-#define ET4 0 /* Markup found or buffer flushed; no data. */
-#define DA4 2 /* Data in buffer. */
-#define ER4 4 /* ERO found; start lookahead buffer. */
-#define CR4 6 /* CRO found (ER2, RNI). */
-#define ES4 8 /* TAGO found; start lookahead buffer. */
-#define EE4 10 /* End-tag start (TAGO,ETI); move to lookahead buffer. */
-#define NE4 12 /* End-tag start (TAGO,NET); process NET if not end-tag. */
-
-static UNCH
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-et4 []={DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,DA4 ,DA4 ,ET4 ,ER4 ,
- ET4 ,DA4 ,DA4 ,ET4 ,DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,ES4 },/*et4*/
-et4a[]={DAS_,DAS_,DAS_,DAS_,DAS_,NON_,EE_ ,GET_,RS_ ,REF_,DAS_,DAS_,NSC_,LAS_,
- REF_,DAS_,DAS_,NED_,DAS_,DAS_,DAS_,DAS_,DAS_,DAS_,DAS_,LAS_},
-
-da4 []={DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,DA4 ,DA4 ,ET4 ,ET4 ,
- ET4 ,DA4 ,DA4 ,ET4 ,DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,DA4 ,ET4 },/*da4*/
-da4a[]={NOP_,NOP_,NOP_,NOP_,NOP_,DAF_,DAF_,DAF_,DAF_,DAF_,NOP_,NOP_,DAF_,DAF_,
- DAF_,NOP_,NOP_,DAF_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,DAF_},
-
-er4 []={ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ER4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,
- ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,CR4 ,ET4 ,ET4 },/*er4*/
-er4a[]={LAF_,LAF_,LAF_,ERX_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAM_,LAF_,LAF_},
-
-cr4 []={ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,CR4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,
- ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 },/*cr4*/
-cr4a[]={LAF_,CRN_,LAF_,CRA_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-es4 []={ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ES4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,
- ET4 ,ET4 ,EE4 ,NE4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 },/*es4*/
-es4a[]={LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAM_,LAM_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_},
-
-ee4 []={ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,EE4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,
- ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 },/*ee4*/
-ee4a[]={LAF_,LAF_,LAF_,ETC_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,NET_,LAF_},
-
-ne4 []={EE4 ,EE4 ,EE4 ,ET4 ,EE4 ,EE4 ,EE4 ,NE4 ,EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,
- EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,EE4 ,ET4 ,EE4 },/*ne4*/
-ne4a[]={RC2_,RC2_,RC2_,ETC_,RC2_,RC2_,RC2_,GET_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,
- RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,NET_,RC2_},
-
-*conrtab[] = {et4, et4a, da4, da4a, er4, er4a, cr4, cr4a,
- es4, es4a, ee4, ee4a, ne4, ne4a};
-struct parse pcbconr = {"CONR", lexcon, conrtab, 0, 0, 0, 0};
-#undef ET4
-#undef DA4
-#undef ER4
-#undef CR4
-#undef ES4
-#undef EE4
-#undef NE4
-/* PCBCONC: State and action table for content parse of character data.
- Initial state assumes a start-tag was just processed.
-*/
-/* Symbols for state names (end with a number). */
-#define ET6 0 /* Markup found or buffer flushed; no data. */
-#define DA6 2 /* Data in buffer. */
-#define ES6 4 /* TAGO found; start lookahead buffer. */
-#define EE6 6 /* End-tag start (TAGO,ETI); move to lookahead buffer. */
-#define NE6 8 /* End-tag start (TAGO,NET); process NET if not end-tag. */
-
-static UNCH
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-et6 []={DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,DA6 ,DA6 ,ET6 ,DA6 ,
- ET6 ,DA6 ,DA6 ,ET6 ,DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,ES6 },/*et6*/
-et6a[]={DAS_,DAS_,DAS_,DAS_,DAS_,NON_,EOF_,GET_,RS_ ,REF_,DAS_,DAS_,NSC_,DAS_,
- REF_,DAS_,DAS_,NED_,DAS_,DAS_,DAS_,DAS_,DAS_,DAS_,DAS_,LAS_},
-
-da6 []={DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,DA6 ,DA6 ,ET6 ,ET6 ,
- ET6 ,DA6 ,DA6 ,ET6 ,DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,DA6 ,ET6 },/*da6*/
-da6a[]={NOP_,NOP_,NOP_,NOP_,NOP_,DAF_,DAF_,DAF_,DAF_,DAF_,NOP_,NOP_,DAF_,DAF_,
- DAF_,NOP_,NOP_,DAF_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,DAF_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-es6 []={ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ES6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,
- ET6 ,ET6 ,EE6 ,NE6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 },/*es6*/
-es6a[]={LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAM_,LAM_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_},
-
-ee6 []={ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,EE6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,
- ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 ,ET6 },/*ee6*/
-ee6a[]={LAF_,LAF_,LAF_,ETC_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,NET_,LAF_},
-
-ne6 []={EE6 ,EE6 ,EE6 ,ET6 ,EE6 ,EE6 ,EE6 ,NE6 ,EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,
- EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,EE6 ,ET6 ,EE6 },/*ne6*/
-ne6a[]={RC2_,RC2_,RC2_,ETC_,RC2_,RC2_,RC2_,GET_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,
- RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,RC2_,NET_,RC2_},
-
-*conctab[] = {et6, et6a, da6, da6a, es6, es6a, ee6, ee6a, ne6, ne6a};
-struct parse pcbconc = {"CONC", lexcon, conctab, 0, 0, 0, 0};
-#undef ET6
-#undef DA6
-#undef ES6
-#undef EE6
-#undef NE6
-/* PCBPRO: State and action table for prolog parse.
- Initial state assumes document just began.
-*/
-/* Symbols for state names (end with a number). */
-#define ET7 0 /* Markup found. */
-#define ES7 2 /* TAGO found; start lookahead buffer. */
-#define MD7 4 /* MDO found (TAGO, MDO[2]). */
-#define MC7 6 /* MDO, COM found. */
-#define EE7 8 /* TAGO, ETI found */
-
-static UNCH
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-et7 []={ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,
- ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ES7 },/*et7*/
-et7a[]={DCE_,DCE_,DCE_,DCE_,NOP_,DCE_,EE_ ,GET_,RS_ ,NOP_,NOP_,DCE_,DCE_,DCE_,
- DCE_,DCE_,DCE_,DCE_,DCE_,DCE_,DCE_,DCE_,DCE_,DCE_,DCE_,LAS_},
-
-es7 []={ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ES7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,
- ET7 ,ET7 ,EE7 ,ET7 ,MD7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 },/*es7*/
-es7a[]={PEP_,PEP_,PEP_,STE_,PEP_,PEP_,PEP_,GET_,PEP_,PEP_,PEP_,PEP_,PEP_,PEP_,
- PEP_,PEP_,LAM_,PEP_,LAM_,PEP_,PEP_,PEP_,PIS_,PEP_,STE_,PEP_},
-
-md7 []={ET7, ET7, ET7, ET7, ET7 ,ET7, ET7, MD7, ET7 ,ET7 ,ET7 ,ET7, ET7, ET7,
- ET7, MC7, ET7, ET7, ET7, ET7 ,ET7, ET7, ET7, ET7 ,ET7, ET7 },/*md7*/
-md7a[]={LAF_,LAF_,LAF_,DTD_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAM_,LAF_,LAF_,LAF_,LAF_,MSP_,LAF_,LAF_,LAF_,NOP_,LAF_},
-
-mc7 []={ET7, ET7, ET7, ET7, ET7, ET7 ,ET7, MC7, ET7 ,ET7, ET7 ,ET7, ET7, ET7,
- ET7, ET7, ET7, ET7, ET7, ET7 ,ET7 ,ET7, ET7 ,ET7 ,ET7, ET7 },/*mc7*/
-mc7a[]={LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,MDC_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_},
-
-ee7 []={ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,EE7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,
- ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 ,ET7 },/*ee7*/
-ee7a[]={LAF_,LAF_,LAF_,ETE_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,ETE_,LAF_},
-
-*protab[] = {et7, et7a, es7, es7a, md7, md7a, mc7, mc7a, ee7, ee7a};
-struct parse pcbpro = {"PRO", lexcon, protab, 0, 0, 0, 0};
-#undef ET7
-#undef ES7
-#undef MD7
-#undef MC7
-#undef EE7
-/* PCBMDS: State and action table for parse of markup declaration subset.
- Initial state assumes subset just began (MSO found).
-*/
-/* Symbols for state names (end with a number). */
-#define ET8 0 /* Markup found. */
-#define ER8 2 /* PERO found; start lookahead buffer. */
-#define ME8 4 /* MSC found. */
-#define ME9 6 /* MSC, MSC found. */
-#define ES8 8 /* TAGO found; start lookahead buffer. */
-#define MD8 10 /* MDO found (TAGO, MDO[2]). */
-#define MC8 12 /* MDO, CD found. */
-#define DC8 14 /* Data characters found (erroneously). */
-
-static UNCH
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-et8 []={DC8 ,DC8 ,DC8 ,DC8 ,ET8 ,DC8 ,ET8 ,ET8 ,ET8 ,ET8 ,ET8 ,DC8 ,DC8 ,DC8 ,
- DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,ME8 ,DC8 ,ER8 ,DC8 ,DC8 ,DC8 ,ES8 },/*et8*/
-et8a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,GET_,GET_,RS_ ,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-er8 []={DC8 ,DC8 ,DC8 ,ET8 ,DC8 ,DC8 ,DC8 ,ER8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,
- DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 },/*er8*/
-er8a[]={NOP_,NOP_,NOP_,PER_,NOP_,SYS_,NOP_,GET_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-me8 []={ET8, ET8, ET8, ET8, ET8 ,ET8, ET8, ME8, ET8 ,ET8 ,ET8 ,ET8, ET8, ET8,
- ET8 ,ET8, ET8 ,ET8, ET8, ME9 ,ET8, ET8, ET8, ET8 ,ET8, ET8 },/*me8*/
-me8a[]={DTE_,DTE_,DTE_,DTE_,DTE_,DTE_,DTE_,GET_,DTE_,DTE_,DTE_,DTE_,DTE_,DTE_,
- DTE_,DTE_,DTE_,DTE_,DTE_,NOP_,DTE_,DTE_,DTE_,DTE_,DTE_,DTE_},
-
-me9 []={DC8, DC8, DC8, DC8, DC8 ,DC8, DC8, ME9, DC8 ,DC8 ,DC8 ,DC8, DC8, DC8,
- DC8 ,DC8, DC8 ,DC8, DC8, DC8 ,DC8, DC8, DC8, DC8 ,ET8, DC8 },/*me9*/
-me9a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,GET_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,MSE_,NOP_},
-
-/* free nu nmc nms spc non ee eob rs re sep cde nsc ero
- nmre com eti net mdo msc mso pero pio rni tagc tago */
-es8 []={DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,ES8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,
- DC8 ,DC8 ,DC8 ,DC8 ,MD8 ,DC8 ,DC8 ,DC8 ,ET8 ,DC8 ,DC8 ,DC8 },/*es8*/
-es8a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,GET_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,PIS_,NOP_,NOP_,NOP_},
-
-md8 []={DC8, DC8, DC8, ET8, DC8 ,DC8, DC8, MD8, DC8 ,DC8 ,DC8 ,DC8, DC8, DC8,
- DC8 ,MC8, DC8 ,DC8, DC8, DC8 ,ET8, DC8, DC8, DC8 ,ET8, DC8 },/*md8*/
-md8a[]={NOP_,NOP_,NOP_,MD_ ,NOP_,SYS_,NOP_,GET_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,MSS_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-mc8 []={DC8, DC8, DC8, DC8, DC8, DC8 ,DC8, MC8, DC8 ,DC8, DC8 ,DC8, DC8, DC8,
- DC8 ,ET8, DC8 ,DC8, DC8, DC8 ,DC8 ,DC8, DC8 ,DC8 ,DC8, DC8 },/*mc8*/
-mc8a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,GET_,NOP_,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,MDC_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-dc8 []={DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,
- DC8 ,DC8 ,DC8 ,DC8 ,DC8 ,ET8 ,DC8 ,ET8 ,DC8 ,DC8 ,DC8 ,ET8 },/*dc8*/
-dc8a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,GET_,GET_,RS_ ,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,CIR_,NOP_,CIR_,NOP_,NOP_,NOP_,CIR_},
-
-*mdstab[] = {et8, et8a, er8, er8a, me8, me8a, me9, me9a,
- es8, es8a, md8, md8a, mc8, mc8a, dc8, dc8a};
-struct parse pcbmds = {"MDS", lexcon, mdstab, 0, 0, 0, 0};
-#undef ET8
-#undef ER8
-#undef ME8
-#undef ME9
-#undef ES8
-#undef MD8
-#undef MC8
-#undef DC8
-/* PCBGRCM: State and action table for content model group.
- Groups can nest. Reserved names are allowed.
- Data tag token groups are allowed.
- A non-reserved name or model group can have a suffix.
- Columns are based on LEXGRP.C.
-*/
-/* Symbols for state names (end with a number). */
-#define TK1 0 /* Token expected: name, #CHARS, data tag grp, model. */
-#define CO1 2 /* Connector between tokens expected. */
-#define ER1 4 /* PERO found when token was expected. */
-#define SP1 6 /* Name or model: suffix or connector expected. */
-#define RN1 8 /* RNI found; possible #PCDATA. */
-#define DG1 10 /* Data tag: group begun; name expected. */
-#define DN1 12 /* Data tag: name found; SEQ connector expected. */
-#define DT1 14 /* Data tag: ignore template and pattern; MSC expected. */
-#define DR1 16 /* PERO found when data tag name was expected. */
-#define LI1 18 /* Literal in data tag group; search for LIT. */
-#define LA1 20 /* Literal in data tag group; search for LITA. */
-
-static UNCH
-/* bit nmc nms re spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-tk01 []={TK1 ,TK1 ,SP1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,DG1 ,TK1 ,TK1 ,ER1 ,TK1 ,TK1 ,RN1 ,TK1 ,TK1 },/*tk1*/
-tk01a[]={INV_,INV_,NAS_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,INV_,INV_,GRP_,INV_,INV_,
- INV_,GRP_,INV_,INV_,NOP_,INV_,INV_,NOP_,INV_,INV_},
-
-co01 []={TK1 ,TK1 ,TK1 ,CO1 ,CO1 ,CO1 ,CO1 ,CO1 ,CO1 ,TK1 ,SP1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*co1*/
-co01a[]={INV_,INV_,INV_,NOP_,NOP_,SYS_,EE_ ,GET_,RS_ ,AND ,GRPE,INV_,INV_,INV_,
- INV_,INV_,INV_,OR ,INV_,INV_,INV_,INV_,SEQ ,INV_},
-
-er01 []={TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,ER1 ,TK1 ,ER1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*er1*/
-er01a[]={PCI_,PCI_,PER_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-sp01 []={TK1 ,TK1 ,TK1 ,CO1 ,CO1 ,SP1 ,CO1 ,SP1 ,CO1 ,TK1 ,SP1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,CO1 ,TK1 ,TK1 ,CO1 ,CO1 ,TK1 ,TK1 ,TK1 },/*sp1*/
-sp01a[]={INV_,LEN_,LEN_,NOP_,NOP_,SYS_,EE_ ,GET_,RS_ ,AND ,GRPE,INV_,INV_,INV_,
- INV_,INV_,OPT ,OR ,INV_,REP ,OREP,INV_,SEQ ,LEN_},
-
-/* bit nmc nms spc spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-rn01 []={TK1 ,TK1 ,CO1 ,TK1 ,TK1 ,RN1 ,TK1 ,RN1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*rn1*/
-rn01a[]={PCI_,PCI_,RNS_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-dg01 []={TK1 ,TK1 ,DN1 ,DG1 ,DG1 ,DG1 ,DG1 ,DG1 ,DG1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,DR1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*dg1*/
-dg01a[]={INV_,INV_,NAS_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,INV_,INV_,INV_,INV_,INV_,
- INV_,INV_,INV_,INV_,NOP_,INV_,INV_,INV_,INV_,INV_},
-
-dn01 []={TK1 ,TK1 ,TK1 ,DN1 ,DN1 ,DN1 ,DN1 ,DN1 ,DN1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,DT1 ,TK1 },/*dn1*/
-dn01a[]={INV_,INV_,INV_,NOP_,NOP_,SYS_,EE_ ,GET_,RS_ ,INV_,INV_,INV_,INV_,INV_,
- INV_,INV_,INV_,INV_,INV_,INV_,INV_,INV_,DTAG,INV_},
-
-dt01 []={TK1 ,TK1 ,TK1 ,DT1 ,DT1 ,DT1 ,DT1 ,DT1 ,DT1 ,TK1 ,DT1 ,DT1 ,LI1 ,LA1 ,
- SP1 ,TK1 ,TK1 ,DT1 ,DT1 ,TK1 ,TK1 ,TK1 ,DT1 ,TK1 },/*dt1*/
-dt01a[]={INV_,INV_,INV_,NOP_,NOP_,SYS_,EE_ ,GET_,RS_ ,INV_,NOP_,NOP_,NOP_,NOP_,
- GRPE,INV_,INV_,NOP_,NOP_,INV_,INV_,INV_,NOP_,INV_},
-
-/* bit nmc nms spc spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-dr01 []={TK1 ,TK1 ,DG1 ,TK1 ,TK1 ,DR1 ,TK1 ,DR1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*dr1*/
-dr01a[]={PCI_,PCI_,PER_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-li01 []={LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,DT1 ,LI1 ,
- LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 },/*li1*/
-li01a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-la01 []={LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,DT1 ,
- LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 },/*la1*/
-la01a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-*grcmtab[] = {tk01, tk01a, co01, co01a, er01, er01a, sp01, sp01a,
- rn01, rn01a, dg01, dg01a, dn01, dn01a, dt01, dt01a,
- dr01, dr01a, li01, li01a, la01, la01a};
-struct parse pcbgrcm = {"GRCM", lexgrp, grcmtab, 0, 0, 0, 0};
-#undef TK1
-#undef CO1
-#undef ER1
-#undef SP1
-#undef RN1
-#undef DG1
-#undef DN1
-#undef DT1
-#undef DR1
-#undef LI1
-#undef LA1
-/* PCBGRCS: State and action table for content model suffix.
- If suffix occurs, process it. Otherwise, put character
- back for the next parse.
-*/
-/* Symbols for state names (end with a number). */
-#define SP4 0 /* Suffix expected. */
-
-static UNCH
-/* bit nmc nms re spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-sp04 []={SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,
- SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 ,SP4 },/*sp4*/
-sp04a[]={RCR_,RCR_,RCR_,RCR_,RCR_,SYS_,EE_ ,GET_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,
- RCR_,RCR_,OPT ,RCR_,RCR_,REP ,OREP,RCR_,RCR_,RCR_},
-
-*grcstab[] = {sp04, sp04a};
-struct parse pcbgrcs = {"GRCS", lexgrp, grcstab, 0, 0, 0, 0};
-#undef SP4
-/* PCBGRNT: State and action table for name token group parse.
- Groups cannot nest. Reserved names are not allowed.
- No suffixes or data tag pattern groups.
-*/
-/* Symbols for state names (end with a number). */
-#define TK1 0 /* Token expected: name, #CHARS, data tag grp, model. */
-#define CO1 2 /* Connector between tokens expected. */
-#define ER1 4 /* PERO found when token was expected. */
-
-static UNCH
-/* bit nmc nms re spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-tk02 []={TK1 ,CO1 ,CO1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,ER1 ,TK1 ,TK1 ,TK1 ,TK1 ,CO1 },/*tk1*/
-tk02a[]={INV_,NMT_,NMT_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,INV_,INV_,INV_,INV_,INV_,
- INV_,INV_,INV_,INV_,NOP_,INV_,INV_,INV_,INV_,NMT_},
-
-co02 []={TK1 ,TK1 ,TK1 ,CO1 ,CO1 ,CO1 ,CO1 ,CO1 ,CO1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*co1*/
-co02a[]={INV_,INV_,INV_,NOP_,NOP_,SYS_,EE_ ,GET_,RS_ ,NOP_,GRPE,INV_,INV_,INV_,
- INV_,INV_,INV_,NOP_,INV_,INV_,INV_,INV_,NOP_,INV_},
-
-er02 []={TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,ER1 ,TK1 ,ER1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*er1*/
-er02a[]={PCI_,PCI_,PER_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-*grnttab[] = {tk02, tk02a, co02, co02a, er02, er02a};
-struct parse pcbgrnt = {"GRNT", lexgrp, grnttab, 0, 0, 0, 0};
-#undef TK1
-#undef CO1
-#undef ER1
-/* PCBGRNM: State and action table for name group parse.
- Groups cannot nest. Reserved names are not allowed.
- No suffixes or data tag pattern groups.
-*/
-/* Symbols for state names (end with a number). */
-#define TK1 0 /* Token expected: name, #CHARS, data tag grp, model. */
-#define CO1 2 /* Connector between tokens expected. */
-#define ER1 4 /* PERO found when token was expected. */
-
-static UNCH
-/* bit nmc nms re spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-tk03 []={TK1 ,TK1 ,CO1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,ER1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*tk1*/
-tk03a[]={INV_,INV_,NAS_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,INV_,INV_,INV_,INV_,INV_,
- INV_,INV_,INV_,INV_,NOP_,INV_,INV_,INV_,INV_,INV_},
-
-co03 []={TK1 ,TK1 ,TK1 ,CO1 ,CO1 ,CO1 ,CO1 ,CO1 ,CO1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*co1*/
-co03a[]={INV_,INV_,INV_,NOP_,NOP_,SYS_,EE_ ,GET_,RS_ ,NOP_,GRPE,INV_,INV_,INV_,
- INV_,INV_,INV_,NOP_,INV_,INV_,INV_,INV_,NOP_,INV_},
-
-er03 []={TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,ER1 ,TK1 ,ER1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*er1*/
-er03a[]={PCI_,PCI_,PER_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-*grnmtab[] = {tk03, tk03a, co03, co03a, er03, er03a};
-struct parse pcbgrnm = {"GRNM", lexgrp, grnmtab, 0, 0, 0, 0};
-#undef TK1
-#undef CO1
-#undef ER1
-/* PCBREF: State and action table to find the end of entity, parameter entity,
- and character references. The opening delimiter and name
- have already been found; the parse determines whether the
- tokenization of the name ended normally and processes the REFC.
-*/
-/* Symbols for state names (end with a number). */
-#define ER5 0 /* Handle REFC or other entity reference termination. */
-#define ER6 2 /* Return to caller and reset state for next call. */
-
-static UNCH
-/* bit nmc nms re spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-er05 []={ER5 ,ER6 ,ER6 ,ER6 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,
- ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER6 },/*er5*/
-er05a[]={RCR_,LEN_,LEN_,NOP_,RCR_,SYS_,RCR_,GET_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,
- RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,NOP_},
-
-er06 []={ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,
- ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 ,ER5 },/*er6*/
-er06a[]={RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,
- RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_,RCR_},
-
-*reftab[]={er05, er05a, er06, er06a};
-struct parse pcbref = {"ENTREF", lexgrp, reftab, 0, 0, 0, 0};
-#undef ER5
-#undef ER6
-/*
-Use (typical) Name Ending Chsw References RS RE SEP
-Parameter literal LITPC LIT/A OK Parm,Char RSM_ LAM_ LAM_
- Data tag template NO
-System ID LITC LIT/A n/a none RSM_ LAM_ LAM_
- Processing instruction PIC
-Attribute value LITRV LIT/A NO Gen,Char RS_ FUN_ FUN_
-Minimum literal LITV LIT/A n/a none RS_ FUN_ MLE_
-*/
-/* PCBLITP: Literal parse with parameter and character references;
- no function character translation.
-*/
-/* Symbols for state names (end with a number). */
-#define DA0 0 /* Data in buffer. */
-#define ER0 2 /* ERO found. */
-#define CR0 4 /* CRO found (ER0, RNI). */
-#define PR0 6 /* PRO found (for PCBLITP). */
-
-static UNCH
-/* free num min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-da13 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,ER0 ,
- DA0 ,DA0 ,DA0 ,PR0 ,DA0 ,DA0 ,DA0 ,DA0 },/*da3*/
-da13a[]={MLA_,MLA_,MLA_,MLA_,MLA_,NON_,EE_ ,GET_,RSM_,MLA_,MLA_,MLA_,NSC_,NOP_,
- MLA_,MLA_,MLA_,NOP_,MLA_,MLA_,MLA_,TER_},
-
-er13 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,ER0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,CR0 ,DA0 ,DA0 ,DA0 },/*er3*/
-er13a[]={LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,GET_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,
- LPR_,LPR_,LPR_,LPR_,NOP_,LPR_,LPR_,LPR_},
-
-cr13 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,CR0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*cr3*/
-cr13a[]={LP2_,CRN_,LP2_,CRA_,LP2_,LP2_,LP2_,GET_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,
- LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_},
-
-pr13 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,PR0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*pr3*/
-pr13a[]={LPR_,LPR_,LPR_,PEX_,LPR_,LPR_,LPR_,GET_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,
- LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_},
-
-*litptab[] = {da13, da13a, er13, er13a, cr13, cr13a, pr13, pr13a};
-struct parse pcblitp = {"LITP", lexlms, litptab, 0, 0, 0, 0};
-#undef DA0
-#undef ER0
-#undef CR0
-#undef PR0
-/* PCBLITC: Literal parse; no references; no function char translation.
- Used for character data (system data).
-*/
-/* Symbols for state names (end with a number). */
-#define DA0 0 /* Data in buffer. */
-
-static UNCH
-/* free num min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-da2 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*da2*/
-da2a[]={MLA_,MLA_,MLA_,MLA_,MLA_,SYS_,EOF_,GET_,RSM_,MLA_,MLA_,MLA_,SYS_,MLA_,
- MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,TER_},
-
-*litctab[] = {da2, da2a};
-struct parse pcblitc = {"LITC", lexlms, litctab, 0, 0, 0, 0};
-#undef DA0
-/* PCBLITR: Attribute value parse; general and character references;
- function chars are translated.
-*/
-/* Symbols for state names (end with a number). */
-#define DA0 0 /* Data in buffer. */
-#define ER0 2 /* ERO found. */
-#define CR0 4 /* CRO found (ER0, RNI). */
-
-static UNCH
-/* free num min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-da11 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,ER0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*da1*/
-da11a[]={MLA_,MLA_,MLA_,MLA_,MLA_,NON_,EE_ ,GET_,RS_ ,FUN_,FUN_,MLA_,NSC_,NOP_,
- MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,TER_},
-
-er11 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,ER0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,CR0 ,DA0 ,DA0 ,DA0 },/*er1*/
-er11a[]={LPR_,LPR_,LPR_,ERX_,LPR_,LPR_,LPR_,GET_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,
- LPR_,LPR_,LPR_,LPR_,NOP_,LPR_,LPR_,LPR_},
-
-cr11 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,CR0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*cr1*/
-cr11a[]={LP2_,CRN_,LP2_,CRA_,LP2_,LP2_,LP2_,GET_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,
- LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_},
-
-*litrtab[] = {da11, da11a, er11, er11a, cr11, cr11a};
-struct parse pcblitr = {"LITR", lexlms, litrtab, 0, 0, 0, 0};
-#undef DA0
-#undef ER0
-#undef CR0
-/* PCBLITV: Literal parse; no references; RS ignored; RE/SPACE sequences
- become single SPACE. Only minimum data characters allowed.
-*/
-/* Symbols for state names (end with a number). */
-#define LS0 0 /* Leading SPACE or RE found. */
-#define VA0 2 /* Valid character found. */
-#define SP0 4 /* SPACE/RE sequence begun. */
-
-static UNCH
-/* free num min nms spc non ee eob rs re sep cde nsc
- litc */
-ls10 []={VA0 ,VA0 ,VA0 ,VA0 ,LS0 ,VA0 ,LS0 ,LS0 ,LS0 ,LS0 ,LS0 ,VA0 ,VA0 ,
- LS0 },/*ls0*/
-ls10a[]={MLE_,MLA_,MLA_,MLA_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,MLE_,SYS_,SYS_,
- TER_},
-va10 []={VA0 ,VA0 ,VA0 ,VA0 ,SP0 ,VA0 ,VA0 ,VA0 ,VA0 ,SP0 ,SP0 ,VA0 ,VA0 ,
- LS0 },/*va0*/
-da10a[]={MLE_,MLA_,MLA_,MLA_,MLA_,SYS_,EOF_,GET_,RS_ ,FUN_,MLE_,SYS_,SYS_,
- TER_},
-sp10 []={VA0 ,VA0 ,VA0 ,VA0 ,SP0 ,VA0 ,VA0 ,SP0 ,SP0 ,SP0 ,SP0 ,VA0 ,VA0 ,
- LS0 },/*sp0*/
-sp10a[]={MLE_,MLA_,MLA_,MLA_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,MLE_,SYS_,SYS_,
- RPR_},
-
-*litvtab[] = {ls10, ls10a, va10, da10a, sp10, sp10a};
-struct parse pcblitv = {"LITV", lexmin, litvtab, 0, 0, 0, 0};
-#undef LS0
-#undef VA0
-#undef SP0
-/* PCBLITT: Tokenized attribute value parse.
-*/
-
-/* PCBLITT: Attribute value parse; general and character references;
- function chars are translated.
-*/
-/* Symbols for state names (end with a number). */
-#define SP0 0 /* Ignore spaces */
-#define DA0 2 /* Data character */
-#define ER0 4 /* ERO found; ignore space */
-#define ER1 6 /* ERO found; don't ignore space */
-#define CR0 8 /* CRO found (ER0, RNI); ignore space */
-#define CR1 10 /* CR0 found; don't ignore space */
-
-int pcblittda = DA0;
-
-static UNCH
-/* free num min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-
-sp14 []={DA0 ,DA0 ,DA0 ,DA0 ,SP0 ,DA0 ,DA0 ,SP0 ,SP0 ,SP0 ,SP0 ,DA0 ,DA0 ,ER0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*sp0*/
-sp14a[]={MLA_,MLA_,MLA_,MLA_,NOP_,NON_,EE_ ,GET_,RS_ ,NOP_,NOP_,MLA_,NSC_,NOP_,
- MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,TER_},
-
-da14 []={DA0 ,DA0 ,DA0 ,DA0 ,SP0 ,DA0 ,DA0 ,DA0 ,DA0 ,SP0 ,SP0 ,DA0 ,DA0 ,ER1 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,SP0 },/*da0*/
-da14a[]={MLA_,MLA_,MLA_,MLA_,MLA_,NON_,EE_ ,GET_,RS_ ,FUN_,FUN_,MLA_,NSC_,NOP_,
- MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,MLA_,TER_},
-
-er14 []={DA0 ,DA0 ,DA0 ,SP0 ,DA0 ,DA0 ,DA0 ,ER0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,CR0 ,DA0 ,DA0 ,DA0 },/*er0*/
-er14a[]={LPR_,LPR_,LPR_,ERX_,LPR_,LPR_,LPR_,GET_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,
- LPR_,LPR_,LPR_,LPR_,NOP_,LPR_,LPR_,LPR_},
-
-er15 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,ER1 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,CR1 ,DA0 ,DA0 ,DA0 },/*er1*/
-er15a[]={LPR_,LPR_,LPR_,ERX_,LPR_,LPR_,LPR_,GET_,LPR_,LPR_,LPR_,LPR_,LPR_,LPR_,
- LPR_,LPR_,LPR_,LPR_,NOP_,LPR_,LPR_,LPR_},
-
-cr14 []={DA0 ,DA0 ,DA0 ,SP0 ,DA0 ,DA0 ,DA0 ,CR0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*cr0*/
-cr14a[]={LP2_,CRN_,LP2_,CRA_,LP2_,LP2_,LP2_,GET_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,
- LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_},
-
-cr15 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,CR1 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,
- DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*cr1*/
-cr15a[]={LP2_,CRN_,LP2_,CRA_,LP2_,LP2_,LP2_,GET_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,
- LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_,LP2_},
-
-*litttab[] = {sp14, sp14a, da14, da14a, er14, er14a, er15, er15a, cr14, cr14a,
- cr15, cr15a};
-struct parse pcblitt = {"LITT", lexlms, litttab, 0, 0, 0, 0};
-#undef SP0
-#undef DA0
-#undef ER0
-#undef ER1
-#undef CR0
-#undef CR1
-/* PCBMD: State and action table for markup declaration tokenization.
- Columns are based on LEXMARK.C.
-*/
-/* Symbols for state names (end with a number). */
-#define SP1 0 /* Separator before token expected (but not -). */
-#define SP2 2 /* Separator before token expected. */
-#define TK1 4 /* Token expected. */
-#define CM1 6 /* COM[1] found: possible comment, MGRP, or minus.*/
-#define CM2 8 /* COM[2] found; in comment. */
-#define CM3 10 /* Ending COM[1] found; end comment or continue it. */
-#define PR1 12 /* PERO found when token was expected. */
-#define PX1 14 /* PLUS found: PGRP or error. */
-#define RN1 16 /* RNI found; possible reserved name start. */
-
-int pcbmdtk = TK1; /* PCBMD: token expected. */
-
-static UNCH
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-sp21 []={SP1 ,SP1 ,SP1 ,SP1 ,TK1 ,SP1 ,TK1 ,SP1 ,TK1 ,SP1 ,SP1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,SP1 ,PR1 ,PX1 ,SP1 ,RN1 ,SP1 ,SP1 ,SP1 },
-sp21a[]={INV_,LEN_,LEN_,LEN_,NOP_,SYS_,EE_ ,GET_,RS_ ,LEN_,INV_,GRPS,LIT ,LITE,
- MDS ,INV_,NOP_,NOP_,INV_,NOP_,EMD ,INV_,INV_},
-
-sp22 []={SP2 ,SP2 ,SP2 ,SP2 ,TK1 ,SP2 ,TK1 ,SP2 ,TK1 ,CM1 ,SP2 ,TK1 ,TK1 ,TK1 ,
- TK1 ,SP2 ,PR1 ,PX1 ,SP2 ,RN1 ,SP2 ,SP2 ,SP2 },
-sp22a[]={INV_,LEN_,LEN_,LEN_,NOP_,SYS_,EE_ ,GET_,RS_ ,NOP_,INV_,GRPS,LIT ,LITE,
- MDS ,INV_,NOP_,NOP_,INV_,NOP_,EMD ,INV_,INV_},
-
-tk21 []={SP1 ,SP1 ,SP2 ,SP1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,CM1 ,SP1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,SP1 ,PR1 ,PX1 ,SP1 ,RN1 ,SP1 ,SP1 ,SP1 },
-tk21a[]={INV_,NMT ,NUM ,NAS ,NOP_,SYS_,EE_ ,GET_,RS_ ,NOP_,INV_,GRPS,LIT ,LITE,
- MDS ,INV_,NOP_,NOP_,INV_,NOP_,EMD ,INV_,INV_},
-
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-
-cm21 []={TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,CM1 ,TK1 ,CM1 ,TK1 ,CM2 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },
-cm21a[]={CDR ,CDR ,CDR ,CDR ,CDR ,SYS_,CDR ,GET_,CDR ,NOP_,CDR ,MGRP,CDR ,CDR ,
- CDR ,CDR ,CDR ,CDR ,CDR ,CDR ,CDR ,CDR ,CDR },
-
-cm22 []={CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,TK1 ,CM2 ,CM2 ,CM3 ,CM2 ,CM2 ,CM2 ,CM2 ,
- CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 },
-cm22a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-cm23 []={CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM3 ,TK1 ,CM3 ,CM2 ,TK1 ,CM2 ,CM2 ,CM2 ,CM2 ,
- CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 ,CM2 },
-cm23a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-pr21 []={SP1 ,SP1 ,SP1 ,TK1 ,TK1 ,PR1 ,SP2 ,PR1 ,TK1 ,SP2 ,SP1 ,SP1 ,SP1 ,SP1 ,
- SP1 ,SP1 ,SP2 ,SP1 ,SP1 ,TK1 ,SP1 ,SP1 ,SP1 },
-pr21a[]={PCI_,PCI_,PCI_,PER_,PEN ,SYS_,PENR,GET_,PEN ,PENR,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PENR,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-px21 []={SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,PX1 ,SP1 ,PX1 ,SP1 ,SP1 ,SP1 ,TK1 ,SP1 ,SP1 ,
- SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 },
-px21a[]={PCI_,PCI_,PCI_,PCI_,PCI_,SYS_,PCI_,GET_,PCI_,PCI_,PCI_,PGRP,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-rn21 []={TK1 ,TK1 ,TK1 ,SP1 ,TK1 ,RN1 ,TK1 ,RN1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,
- TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },
-rn21a[]={PCI_,PCI_,PCI_,RNS ,PCI_,SYS_,PCI_,GET_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-*mdtab[] = {sp21, sp21a, sp22, sp22a, tk21, tk21a, cm21, cm21a, cm22, cm22a,
- cm23, cm23a, pr21, pr21a, px21, px21a, rn21, rn21a};
-struct parse pcbmd = {"MD", lexmark, mdtab, 0, 0, 0, 0};
-#undef SP1
-#undef SP2
-#undef TK1
-#undef CM1
-#undef CM2
-#undef CM3
-#undef PR1
-#undef PX1
-#undef RN1
-/* PCBMDC: State and action table for comment declaration.
-*/
-/* Symbols for state names (end with a number). */
-#define CD2 0 /* COM[2] found; in comment. */
-#define CD3 2 /* Ending COM[1] found; end comment or continue it. */
-#define EM1 4 /* Ending COM[2] found; start new comment or end. */
-#define CD1 6 /* COM[1] found; new comment or error. */
-
-static UNCH
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-cd22 []={CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD3 ,CD2 ,CD2 ,CD2 ,CD2 ,
- CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 },
-cd22a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-cd23 []={CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD3 ,CD2 ,CD3 ,CD2 ,EM1 ,CD2 ,CD2 ,CD2 ,CD2 ,
- CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 },
-cd23a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-em21 []={CD2 ,CD2 ,CD2 ,CD2 ,EM1 ,EM1 ,CD2 ,EM1 ,EM1 ,CD1 ,CD2 ,CD2 ,CD2 ,CD2 ,
- CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 },
-em21a[]={INV_,INV_,INV_,INV_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,INV_,INV_,INV_,INV_,
- INV_,INV_,INV_,INV_,INV_,INV_,EMD ,INV_,INV_},
-
-cd21 []={CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD1 ,CD2 ,CD1 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,
- CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 ,CD2 },
-cd21a[]={PCI_,PCI_,PCI_,PCI_,PCI_,SYS_,EOF_,GET_,PCI_,NOP_,PCI_,PCI_,PCI_,PCI_,
- PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_,PCI_},
-
-*mdctab[] = {cd22, cd22a, cd23, cd23a, em21, em21a, cd21, cd21a};
-struct parse pcbmdc = {"MDC", lexmark, mdctab, 0, 0, 0, 0};
-#undef CD2
-#undef CD3
-#undef EM1
-#undef CD1
-/* PCBMDI: State and action table for ignoring markup declarations.
- Literals are handled properly so a TAGC won't end the declaration.
- An error is noted if the entity ends within a declaration that
- is being ignored.
- TO DO: Handle nested declaration sets.
-*/
-/* Symbols for state names (end with a number). */
-#define NC1 0 /* Not in a comment; TAGC ends declaration. */
-#define IC1 2 /* COM[1] found; possible comment. */
-#define IC2 4 /* COM[2] found; in comment. */
-#define IC3 6 /* Ending COM[1] found; end comment or continue it. */
-#define LI1 8 /* Literal parameter; search for LIT. */
-#define LA1 10 /* Literal parameter; search for LITA. */
-
-static UNCH
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-nc21 []={NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,IC1 ,NC1 ,NC1 ,LI1 ,LA1 ,
- NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 },
-nc21a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,EMD ,NOP_,NOP_},
-
-ic21 []={NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,IC1 ,NC1 ,IC1 ,NC1 ,IC2 ,NC1 ,NC1 ,LI1 ,LA1 ,
- NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 ,NC1 },
-ic21a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,EMD ,NOP_,NOP_},
-
-ic22 []={IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,NC1 ,IC2 ,IC2 ,IC3 ,IC2 ,IC2 ,IC2 ,IC2 ,
- IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 },
-ic22a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-ic23 []={IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC3 ,NC1 ,IC3 ,IC2 ,NC1 ,IC2 ,IC2 ,IC2 ,IC2 ,
- IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 ,IC2 },/*ic3*/
-ic23a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-li21 []={LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,NC1 ,LI1 ,
- LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 ,LI1 },/*li1*/
-li21a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-la21 []={LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,NC1 ,
- LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 ,LA1 },/*la1*/
-la21a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,NOP_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-*mditab[] = {nc21, nc21a, ic21, ic21a, ic22, ic22a,
- ic23, ic23a, li21, li21a, la21, la21a};
-struct parse pcbmdi = {"MDI", lexmark, mditab, 0, 0, 0, 0};
-#undef NC1
-#undef IC1
-#undef IC2
-#undef IC3
-#undef LI1
-#undef LA1
-/* PCBMSRC: State and action table for marked section in RCDATA mode.
- Nested marked sections are not recognized; the first MSE ends it.
- Initial state assumes an MS declaration was processed.
- Columns are based on LEXLMS.C but LITC column needn't exist.
-*/
-/* Symbols for state names (end with a number). */
-#define ET0 0 /* MSS processed or buffer flushed; no data. */
-#define DA0 2 /* Data in buffer. */
-#define ER0 4 /* ERO found; start lookahead buffer. */
-#define CR0 6 /* CRO found (ER0, RNI). */
-#define ME0 8 /* MSC found. */
-#define ME1 10 /* MSC, MSC found. */
-
-static UNCH
-/* free nu min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-et30 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,DA0 ,DA0 ,ET0 ,ER0 ,
- DA0 ,ME0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*et0*/
-et30a[]={DAS_,DAS_,DAS_,DAS_,DAS_,NON_,EE_ ,GET_,RS_ ,REF_,DAS_,DAS_,NSC_,LAS_,
- DAS_,LAS_,DAS_,DAS_,DAS_,DAS_,DAS_,DAS_},
-
-da30 []={DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,DA0 ,DA0 ,ET0 ,ET0 ,
- DA0 ,ET0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 ,DA0 },/*da0*/
-da30a[]={NOP_,NOP_,NOP_,NOP_,NOP_,DAF_,DAF_,DAF_,DAF_,DAF_,NOP_,NOP_,DAF_,DAF_,
- NOP_,DAF_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-er30 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ER0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,CR0 ,ET0 ,ET0 ,ET0 },/*er0*/
-er30a[]={LAF_,LAF_,LAF_,ERX_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAM_,LAF_,LAF_,LAF_},
-
-/* free nu min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-cr30 []={ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,CR0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,
- ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 ,ET0 },/*cr0*/
-cr30a[]={LAF_,CRN_,LAF_,CRA_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_},
-
-me30 []={ET0, ET0, ET0, ET0, ET0 ,ET0, ET0, ME0, ET0 ,ET0 ,ET0 ,ET0, ET0 ,ET0 ,
- ET0, ME1, ET0 ,ET0, ET0 ,ET0, ET0 ,ET0 },/*me0*/
-me30a[]={LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAM_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_},
-
-me31 []={ET0, ET0, ET0, ET0, ET0 ,ET0, ET0, ME1, ET0 ,ET0 ,ET0 ,ET0, ET0 ,ET0 ,
- ET0, ET0, ET0 ,ET0, ET0 ,ET0, ET0 ,ET0,},/*me1*/
-me31a[]={LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,MSE_,LAF_,LAF_},
-
-*msrctab[]={et30, et30a, da30, da30a, er30, er30a, cr30, cr30a,
- me30, me30a, me31, me31a};
-struct parse pcbmsrc = {"MSRCDATA", lexlms, msrctab, 0, 0, 0, 0};
-#undef ET0
-#undef DA0
-#undef ER0
-#undef CR0
-#undef ME0
-#undef ME1
-/* PCBMSC: State and action table for marked section in CDATA mode.
- Nested marked sections are not recognized; the first MSE ends it.
- Initial state assumes an MS declaration was processed.
-*/
-/* Symbols for state names (end with a number). */
-#define ET2 0 /* MSS processed or buffer flushed; no data. */
-#define DA2 2 /* Data in buffer. */
-#define ME2 4 /* MSC found. */
-#define ME3 6 /* MSC, MSC found. */
-
-static UNCH
-/* free nu min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-et32 []={DA2 ,DA2 ,DA2 ,DA2 ,DA2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,DA2 ,DA2 ,ET2 ,DA2 ,
- DA2 ,ME2 ,DA2 ,DA2 ,DA2 ,DA2 ,DA2 ,DA2 },/*et2*/
-et32a[]={DAS_,DAS_,DAS_,DAS_,DAS_,NON_,EOF_,GET_,RS_ ,REF_,DAS_,DAS_,NSC_,DAS_,
- DAS_,LAS_,DAS_,DAS_,DAS_,DAS_,DAS_,DAS_},
-
-da32 []={DA2 ,DA2 ,DA2 ,DA2 ,DA2 ,ET2 ,ET2 ,ET2 ,ET2 ,ET2 ,DA2 ,DA2 ,ET2 ,DA2 ,
- DA2 ,ET2 ,DA2 ,DA2 ,DA2 ,DA2 ,DA2 ,DA2 },/*da2*/
-da32a[]={NOP_,NOP_,NOP_,NOP_,NOP_,DAF_,DAF_,DAF_,DAF_,DAF_,NOP_,NOP_,DAF_,NOP_,
- NOP_,DAF_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-me32 []={ET2, ET2, ET2, ET2, ET2 ,ET2, ET2, ME2, ET2 ,ET2 ,ET2 ,ET2, ET2 ,ET2 ,
- ET2, ME3, ET2 ,ET2, ET2 ,ET2, ET2, ET2,},/*me2*/
-me32a[]={LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAM_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_},
-
-me33 []={ET2, ET2, ET2, ET2, ET2 ,ET2, ET2, ME3, ET2 ,ET2 ,ET2 ,ET2, ET2 ,ET2 ,
- ET2, ET2, ET2 ,ET2, ET2 ,ET2, ET2, ET2,},/*me3*/
-me33a[]={LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,GET_,LAF_,LAF_,LAF_,LAF_,LAF_,LAF_,
- LAF_,LAF_,LAF_,LAF_,LAF_,MSE_,LAF_,LAF_},
-
-*msctab[]={et32, et32a, da32, da32a, me32, me32a, me33, me33a};
-struct parse pcbmsc = {"MSCDATA", lexlms, msctab, 0, 0, 0, 0};
-#undef ET2
-#undef DA2
-#undef ME2
-#undef ME3
-/* PCBMSI: State and action table for marked section in IGNORE mode.
- Nested marked sections are recognized; the matching MSE ends it.
- Initial state assumes an MS declaration, MSS, or MSE was processed.
-*/
-/* Symbols for state names (end with a number). */
-#define ET4 0 /* Markup found or buffer flushed; no data. */
-#define ME4 2 /* MSC found. */
-#define ME5 4 /* MSC, MSC found. */
-#define ES4 6 /* TAGO found. */
-#define MD4 8 /* MDO found (TAGO, MDO[2]). */
-
-static UNCH
-/* free nu min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc refc */
-et34 []={ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,
- ET4 ,ME4 ,ET4 ,ET4 ,ET4 ,ET4 ,ES4 ,ET4 ,ET4 },/*et4*/
-et34a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-me34 []={ET4, ET4, ET4, ET4, ET4 ,ET4, ET4, ME4, ET4 ,ET4 ,ET4 ,ET4, ET4, ET4 ,
- ET4, ME5 ,ET4, ET4, ET4 ,ET4, ET4, ET4, ET4,},/*me4*/
-me34a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-me35 []={ET4, ET4, ET4, ET4, ET4 ,ET4, ET4, ME5, ET4 ,ET4 ,ET4 ,ET4, ET4, ET4 ,
- ET4, ET4 ,ET4, ET4, ET4 ,ET4, ET4, ET4, ET4,},/*me5*/
-me35a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,MSE_,NOP_,NOP_,NOP_},
-
-/* free nu min nms spc non ee eob rs re sep cde nsc ero
- mdo msc mso pero rni tagc tago litc */
-es34 []={ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ES4 ,ET4 ,ES4 ,ET4 ,ET4 ,ET4 ,ET4 ,ES4 ,ET4 ,
- MD4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 ,ET4 },/*es4*/
-es34a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-md34 []={ET4, ET4, ET4, ET4, ET4 ,MD4, ET4, MD4, ET4 ,ET4 ,ET4 ,ET4, ET4, ET4 ,
- ET4, ET4 ,ET4, ET4, ET4 ,ET4, ET4, ET4,},/*md4*/
-md34a[]={NOP_,NOP_,NOP_,NOP_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,NOP_,NOP_,SYS_,NOP_,
- NOP_,NOP_,MSS_,NOP_,NOP_,NOP_,NOP_,NOP_},
-
-*msitab[]={et34, et34a, me34, me34a, me35, me35a, es34, es34a, md34, md34a};
-struct parse pcbmsi = {"MSIGNORE", lexlms, msitab, 0, 0, 0, 0};
-#undef ET4
-#undef ME4
-#undef ME5
-#undef ES4
-#undef MD4
-#undef NS4
-/* PCBSTAG: State and action table for start-tag parse.
- Columns are based on LEXMARK.C.
-*/
-/* Symbols for state names (end with a number). */
-#define SP1 0 /* Separator before name expected. */
-#define AN1 2 /* Attribute name expected. */
-#define SP2 4 /* Separator or value indicator expected. */
-#define VI1 6 /* Value indicator expected. */
-#define AV1 8 /* Attribute value expected. */
-
-int pcbstan = AN1; /* PCBSTAG: attribute name expected. */
-
-static UNCH
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-sp41 []={SP1 ,SP1 ,SP1 ,SP1 ,AN1 ,SP1 ,SP1 ,SP1 ,AN1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,
- SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 },
-sp41a[]={INV_,LEN_,LEN_,LEN_,NOP_,SYS_,EOF_,GET_,RS_ ,LEN_,ETIC,INV_,INV_,INV_,
- INV_,DSC ,INV_,INV_,INV_,INV_,TAGC,TAGO,INV_},
-
-an41 []={SP1 ,SP1 ,SP1 ,SP2 ,AN1 ,AN1 ,AN1 ,AN1 ,AN1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,
- SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 },
-an41a[]={INV_,NTV ,NTV ,NVS ,NOP_,SYS_,EOF_,GET_,RS_ ,NTV ,ETIC,INV_,INV_,INV_,
- INV_,DSC ,INV_,INV_,INV_,INV_,TAGC,TAGO,INV_},
-
-sp42 []={SP1 ,SP1 ,SP1 ,SP1 ,VI1 ,SP2 ,SP2 ,SP2 ,VI1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,
- SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,AV1 },
-sp42a[]={INV_,LEN_,LEN_,LEN_,NOP_,SYS_,EOF_,GET_,RS_ ,LEN_,NASV,INV_,INV_,INV_,
- INV_,NASV,INV_,INV_,INV_,INV_,NASV,NASV,NOP_},
-
-/* bit nmc num nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-vi41 []={SP1 ,AN1 ,AN1 ,AN1 ,VI1 ,VI1 ,VI1 ,VI1 ,VI1 ,AN1 ,SP1 ,SP1 ,SP1 ,SP1 ,
- SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,AV1 },
-vi41a[]={INV_,NASV,NASV,NASV,NOP_,SYS_,EOF_,GET_,RS_ ,NASV,NASV,INV_,INV_,INV_,
- INV_,NASV,INV_,INV_,INV_,INV_,NASV,NASV,NOP_},
-
-av41 []={SP1 ,SP1 ,SP1 ,SP1 ,AV1 ,AV1 ,AV1 ,AV1 ,AV1 ,SP1 ,SP1 ,SP1 ,AN1 ,AN1 ,
- SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 ,SP1 },
-av41a[]={INV_,AVU ,AVU ,AVU ,NOP_,SYS_,EOF_,GET_,RS_ ,AVU ,INV_,INV_,AVD ,AVDA,
- INV_,INV_,INV_,INV_,INV_,INV_,INV_,INV_,INV_},
-
-*stagtab[] = {sp41, sp41a, an41, an41a, sp42, sp42a, vi41, vi41a, av41, av41a};
-struct parse pcbstag = {"STAG", lexmark, stagtab, 0, 0, 0, 0};
-#undef SP1
-#undef AN1
-#undef SP2
-#undef VI1
-#undef AV1
-/* PCBETAG: State and action table for end-tag parse.
-*/
-#define TC1 0 /* Tag close expected (no attributes allowed). */
-
-static UNCH
-/* bit nmc nu nms spc non ee eob rs com eti grpo lit lita
- dso dsc pero plus refc rni tagc tago vi */
-tc41 []={TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,
- TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 ,TC1 },/*tc1*/
-tc41a[]={INV_,INV_,INV_,INV_,NOP_,SYS_,EOF_,GET_,RS_ ,INV_,INV_,INV_,INV_,INV_,
- INV_,INV_,INV_,INV_,INV_,INV_,TAGC,TAGO,INV_},
-
-*etagtab[] = {tc41, tc41a};
-struct parse pcbetag = {"ETAG", lexmark, etagtab, 0, 0, 0, 0};
-#undef TC1
-/* PCBVAL: State and action table for tokenizing attribute values.
- Columns are based on lextoke (but EOB cannot occur).
-*/
-/* Symbols for state names (end with a number). */
-#define TK1 0 /* Token expected. */
-#define SP1 2 /* Separator before token expected. */
-
-static UNCH
-/* inv rec sep sp nmc nms nu eob */
-tk51 []={TK1 ,TK1 ,TK1 ,TK1 ,SP1 ,SP1 ,SP1 },/*tk1*/
-tk51a[]={INVA,INVA,INVA,NOPA,NMTA,NASA,NUMA},
-
-sp51 []={TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 },/*sp1*/
-sp51a[]={INVA,INVA,INVA,NOPA,LENA,LENA,LENA},
-
-*valtab[] = {tk51, tk51a, sp51, sp51a};
-struct parse pcbval = {"VAL", lextoke, valtab, 0, 0, 0, 0};
-#undef TK1
-#undef SP1
-/* PCBEAL: State and action table for end of attribute specification list.
- If delimiter occurs, process it. Otherwise, put invalid character
- back for the next parse.
-*/
-/* Symbols for state names (end with a number). */
-#define AL0 0 /* Delimiter expected. */
-
-static UNCH
-/* bit nmc nms re spc non ee eob rs and grpc grpo lit lita
- dtgc dtgo opt or pero plus rep rni seq refc */
-al00 []={AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,
- AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 ,AL0 },/*al0*/
-al00a[]={INV_,INV_,INV_,INV_,INV_,SYS_,EE_ ,GET_,INV_,INV_,INV_,INV_,INV_,INV_,
- GRPE,INV_,INV_,INV_,INV_,INV_,INV_,INV_,INV_,INV_},
-
-*ealtab[] = {al00, al00a};
-struct parse pcbeal = {"EAL", lexgrp, ealtab, 0, 0, 0, 0};
-#undef AL0
-
-/* PCBSD: State and action tables for SGML declaration parsing. */
-
-/* Symbols for state names. */
-
-#define SP1 0 /* Separator before token expected (but not -) */
-#define SP2 2 /* Separator before token expected. */
-#define TK1 4 /* Token expected. */
-#define CM1 6 /* COM[1] found: possible comment.*/
-#define CM2 8 /* COM[2] found; in comment. */
-#define CM3 10 /* Ending COM[1] found; end comment or continue it. */
-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 ,SP1 ,TK1 ,TK1 ,SP1 },
-sp31a[]={INV_,ISIG,LEN_,LEN_,NOP_,SYS_,EOF_,GET_,RS_ ,LEN_,LIT1,LIT2,ESGD},
-
-sp32 []={SP2 ,SP2 ,SP2 ,SP2 ,TK1 ,SP2 ,SP2 ,SP2 ,TK1 ,CM1 ,TK1 ,TK1 ,SP2 },
-sp32a[]={INV_,ISIG,LEN_,LEN_,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,LIT1,LIT2,ESGD},
-
-tk31 []={TK1 ,TK1 ,SP2 ,SP1 ,TK1 ,TK1 ,TK1 ,TK1 ,TK1 ,CM1 ,TK1 ,TK1 ,SP1 },
-tk31a[]={INV_,ISIG,NUM1,NAS1,NOP_,SYS_,EOF_,GET_,RS_ ,NOP_,LIT1,LIT2,ESGD},
-
-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_},
-
-*sdtab[]={sp31, sp31a, sp32, sp32a, tk31, tk31a, cm31, cm31a, cm32, cm32a,
- cm33, cm33a};
-
-struct parse pcbsd = {"SD", lexsd, sdtab, 0, 0, 0, 0};
-
-#undef SP1
-#undef SP2
-#undef TK1
-#undef CM1
-#undef CM2
-#undef CM3
diff --git a/usr.bin/sgmls/sgmls/portproc.c b/usr.bin/sgmls/sgmls/portproc.c
deleted file mode 100644
index a057d24..0000000
--- a/usr.bin/sgmls/sgmls/portproc.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* portproc.c -
-
- Semi-portable implementation of run_process().
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-
-#ifdef SUPPORT_SUBDOC
-
-#include "std.h"
-#include "entity.h"
-#include "appl.h"
-#include "alloc.h"
-
-/* This code shows how you might use system() to implement run_process().
-ANSI C says very little about the behaviour of system(), and so this
-is necessarily system dependent. */
-
-/* Characters that are significant to the shell and so need quoting. */
-#define SHELL_MAGIC "$\\\"';&()|<>^ \t\n"
-/* Character with which to quote shell arguments. */
-#define SHELL_QUOTE_CHAR '\''
-/* String that can be used to get SHELL_QUOTE_CHAR into a quoted argument. */
-#define SHELL_ESCAPE_QUOTE "'\\''"
-/* Character that can be used to separate arguments to the shell. */
-#define SHELL_ARG_SEP ' '
-
-static UNS shell_quote P((char *, char *));
-
-int run_process(argv)
-char **argv;
-{
- char **p;
- char *s, *command;
- int ret;
- UNS len = 0;
-
- for (p = argv; *p; p++)
- len += shell_quote(*p, (char *)0);
- len += p - argv;
- s = command = xmalloc(len);
- for (p = argv; *p; ++p) {
- if (s > command)
- *s++ = SHELL_ARG_SEP;
- s += shell_quote(*p, s);
- }
- *s++ = '\0';
- errno = 0;
- ret = system(command);
- if (ret < 0)
- appl_error(E_EXEC, argv[0], strerror(errno));
- free(command);
- return ret;
-}
-
-/* Quote a string so that it appears as a single argument to the
-shell (as used for system()). Store the quoted argument in result, if
-result is not NULL. Return the length. */
-
-static
-UNS shell_quote(s, result)
-char *s, *result;
-{
- UNS len = 0;
- int quoted = 0;
-
- if (strpbrk(s, SHELL_MAGIC)) {
- quoted = 1;
- len++;
- if (result)
- result[0] = SHELL_QUOTE_CHAR;
- }
- for (; *s; s++) {
- if (*s == SHELL_QUOTE_CHAR) {
- if (result)
- strcpy(result + len, SHELL_ESCAPE_QUOTE);
- len += strlen(SHELL_ESCAPE_QUOTE);
- }
- else {
- if (result)
- result[len] = *s;
- len++;
- }
- }
- if (quoted) {
- if (result)
- result[len] = SHELL_QUOTE_CHAR;
- len++;
- }
- return len;
-}
-
-#endif /* SUPPORT_SUBDOC */
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/serv.c b/usr.bin/sgmls/sgmls/serv.c
deleted file mode 100644
index b9699d2..0000000
--- a/usr.bin/sgmls/sgmls/serv.c
+++ /dev/null
@@ -1,299 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-/* ETDDEF: Define an element type definition.
- Use an existing one if there is one; otherwise create one, which
- rmalloc initializes to zero which shows it is a virgin etd.
-*/
-PETD etddef(ename)
-UNCH *ename; /* Element name (GI) with length byte. */
-{
- PETD p; /* Pointer to an etd. */
- int hnum; /* Hash number for ename. */
-
- if ((p = (PETD)hfind((THASH)etdtab,ename,hnum = hash(ename, ETDHASH)))==0){
- p = (PETD)hin((THASH)etdtab, ename, hnum, ETDSZ);
- }
- return p;
-}
-/* ETDSET: Store data in an element type definition.
- The etd must be valid and virgin (except for adl and etdmin).
- As an etd cannot be modified, there is no checking for existing
- pointers and no freeing of their storage.
-*/
-#ifdef USE_PROTOTYPES
-PETD etdset(PETD p, UNCH fmin, struct thdr *cmod, PETD *mexgrp, PETD *pexgrp,
- struct entity **srm)
-#else
-PETD etdset(p, fmin, cmod, mexgrp, pexgrp, srm)
-PETD p; /* Pointer to an etd. */
-UNCH fmin; /* Minimization bit flags. */
-struct thdr *cmod; /* Pointer to content model. */
-PETD *mexgrp; /* Pointers to minus and plus exception lists. */
-PETD *pexgrp; /* Pointers to minus and plus exception lists. */
-struct entity **srm; /* Short reference map. */
-#endif
-{
- p->etdmin |= fmin;
- p->etdmod = cmod;
- p->etdmex = mexgrp;
- p->etdpex = pexgrp;
- p->etdsrm = srm;
- return p;
-}
-/* ETDREF: Retrieve the pointer to an element type definition.
-*/
-PETD etdref(ename)
-UNCH *ename; /* Element name (GI) with length byte.. */
-{
-
- return (PETD)hfind((THASH)etdtab, ename, hash(ename, ETDHASH));
-}
-/* ETDCAN: Cancel an element definition. The etd is freed and is removed
- from the hash table, but its model and other pointers are not freed.
-*/
-VOID etdcan(ename)
-UNCH *ename; /* GI name (with length and EOS). */
-{
- PETD p;
-
- if ((p = (PETD)hout((THASH)etdtab, ename, hash(ename, ETDHASH)))!=0)
- frem((UNIV)p);
-}
-/* SYMBOL TABLE FUNCTIONS: These functions manage hash tables that are used
- for entities, element type definitions, IDs, and other purposes. The
- interface will be expanded in the future to include multiple environments,
- probably by creating arrays of the present hash tables with each table
- in the array corresponding to an environment level.
-*/
-/* HASH: Form hash value for a string.
- From the Dragon Book, p436.
-*/
-int hash(s, hashsize)
-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++;
- if ((g = h & 0xf0000000) != 0) {
- h ^= g >> 24;
- h ^= g;
- }
- }
- return (int)(h % hashsize);
-}
-/* HFIND: Look for a name in a hash table.
-*/
-struct hash *hfind(htab, s, h)
-struct hash *htab[]; /* Hash table. */
-UNCH *s; /* Entity name. */
-int h; /* Hash value for entity name. */
-{
- struct hash *np;
-
- for (np = htab[h]; np != 0; np = np->enext)
- if (ustrcmp(s, np->ename) == 0) return np; /* Found it. */
- return (struct hash *)0; /* Not found. */
-}
-/* HIN: Locates an entry in a hash table, or allocates a new one.
- Returns a pointer to a structure containing a name
- and a pointer to the next entry. Other data in the
- structure must be maintained by the caller.
-*/
-struct hash *hin(htab, name, h, size)
-struct hash *htab[]; /* Hash table. */
-UNCH *name; /* Entity name. */
-int h; /* Hash value for entity name. */
-UNS size; /* Size of structures pointed to by table. */
-{
- struct hash *np;
-
- if ((np = hfind(htab, name, h))!=0) return np; /* Return if name found. */
- /* Allocate space for structure and name. */
- np = (struct hash *)rmalloc(size + name[0]);
- np->ename = (UNCH *)np + size;
- memcpy(np->ename, name, name[0]); /* Store name in it. */
- np->enext = htab[h]; /* 1st entry is now 2nd.*/
- htab[h] = np; /* New entry is now 1st.*/
- return np; /* Return new entry ptr. */
-}
-/* HOUT: Remove an entry from a hash table and return its pointer.
- The caller must free any pointers in the entry and then
- free the entry itself if that is what is desired; this
- routine does not free any storage.
-*/
-struct hash *hout(htab, s, h)
-struct hash *htab[]; /* Hash table. */
-UNCH *s; /* Search argument entry name. */
-int h; /* Hash value for search entry name. */
-{
- struct hash **pp;
-
- for (pp = &htab[h]; *pp != 0; pp = &(*pp)->enext)
- if (ustrcmp(s, (*pp)->ename) == 0) { /* Found it. */
- struct hash *tem = *pp;
- *pp = (*pp)->enext;
- return tem;
- }
- return 0; /* NULL if not found; else ptr. */
-}
-/* SAVESTR: Save a null-terminated string
-*/
-UNCH *savestr(s)
-UNCH *s;
-{
- UNCH *rp;
-
- rp = (UNCH *)rmalloc(ustrlen(s) + 1);
- ustrcpy(rp, s);
- return rp;
-}
-/* SAVENM: Save a name (with length and EOS)
-*/
-UNCH *savenm(s)
-UNCH *s;
-{
- UNCH *p;
- p = (UNCH *)rmalloc(*s);
- memcpy(p, s, *s);
- return p;
-}
-/* REPLACE: Free the storage for the old string (p) and store the new (s).
- If the specified ptr is NULL, don't free it.
-*/
-UNCH *replace(p, s)
-UNCH *p;
-UNCH *s;
-{
- if (p) frem((UNIV)p); /* Free old storage (if any). */
- if (!s) return(s); /* Return NULL if new string is NULL. */
- return savestr(s);
-}
-/* RMALLOC: Interface to memory allocation with error handling.
- If storage is not available, fatal error message is issued.
- Storage is initialized to zeros.
-*/
-UNIV rmalloc(size)
-unsigned size; /* Number of bytes of initialized storage. */
-{
- UNIV p = (UNIV)calloc(size, 1);
- if (!p) exiterr(33, (struct parse *)0);
- return p;
-}
-UNIV rrealloc(p, n)
-UNIV p;
-UNS n;
-{
- UNIV r = realloc(p, n);
- if (!r)
- exiterr(33, (struct parse *)0);
- return r;
-}
-
-UNCH *pt;
-/* FREM: Free specified memory area gotten with rmalloc().
-*/
-VOID frem(ptr)
-UNIV ptr; /* Memory area to be freed. */
-{
- free(ptr);
-}
-/* MAPSRCH: Find a string in a table and return its associated value.
- The last entry must be a dummy consisting of a NULL pointer for
- the string and whatever return code is desired if the
- string is not found in the table.
-*/
-int mapsrch(maptab, name)
-struct map maptab[];
-UNCH *name;
-{
- int i = 0;
-
- do {
- UNCH *mapnm, *nm;
- for (mapnm = maptab[i].mapnm, nm=name; *nm==*mapnm; mapnm++) {
- if (!*nm++) return maptab[i].mapdata;
- }
- } while (maptab[++i].mapnm);
- return maptab[i].mapdata;
-}
-/* IDDEF: Define an ID control block; return -1 if it already exists.
-*/
-int iddef(iname)
-UNCH *iname; /* ID name (with length and EOS). */
-{
- PID p;
- struct fwdref *r;
-
- p = (PID)hin((THASH)itab, iname, hash(iname, IDHASH), IDSZ);
- if (p->iddefed) return(-1);
- p->iddefed = 1;
- TRACEID("IDDEF", p);
- /* Delete any forward references. */
- r = p->idrl;
- p->idrl = 0;
- while (r) {
- struct fwdref *tem = r->next;
- if (r->msg)
- msgsfree(r->msg);
- frem((UNIV)r);
- r = tem;
- }
- return(0);
-}
-/* IDREF: Store a reference to an ID and define the ID if it doesn't yet exist.
- Return 0 if already defined, otherwise pointer to a fwdref.
-*/
-struct fwdref *idref(iname)
-UNCH *iname; /* ID name (with length and EOS). */
-{
- PID p;
- int hnum;
- struct fwdref *rp;
-
- if ((p = (PID)hfind((THASH)itab, iname, (hnum = hash(iname, IDHASH))))==0)
- p = (PID)hin((THASH)itab, iname, hnum, IDSZ);
- if (p->iddefed)
- return 0;
- rp = (struct fwdref *)rmalloc(FWDREFSZ);
- rp->next = p->idrl;
- p->idrl = rp;
- rp->msg = 0;
- TRACEID("IDREF", p);
- return rp;
-}
-/* IDRCK: Check idrefs.
-*/
-VOID idrck()
-{
- int i;
- PID p;
- struct fwdref *r;
-
- for (i = 0; i < IDHASH; i++)
- for (p = itab[i]; p; p = p->idnext)
- if (!p->iddefed)
- for (r = p->idrl; r; r = r->next)
- svderr(r->msg);
-}
-/* NTOA: Converts a positive integer to an ASCII string (abuf)
- No leading zeros are generated.
-*/
-UNCH *ntoa(i)
-int i;
-{
- static UNCH buf[1 + 3*sizeof(int) + 1];
- sprintf((char *)buf, "%d", i);
- return buf;
-}
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/sgml1.c b/usr.bin/sgmls/sgmls/sgml1.c
deleted file mode 100644
index c138c9f..0000000
--- a/usr.bin/sgmls/sgmls/sgml1.c
+++ /dev/null
@@ -1,485 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-
-#define ETDCON (tags[ts].tetd->etdmod->ttype) /* ETD content flags. */
-
-/* SGML: Main SGML driver routine.
-*/
-enum sgmlevent sgmlnext(rcbdafp, rcbtagp)
-struct rcbdata *rcbdafp;
-struct rcbtag *rcbtagp;
-{
- while (prologsw && !conactsw) {
- int oconact;
- conact = parsepro();
- conactsw = 0; /* Assume sgmlact() will not be skipped. */
- switch(conact) {
-
- case PIS_:
- case EOD_:
- case APP_: /* APPINFO */
- conactsw = 1; /* We can skip sgmlact() in opening state. */
- break;
-
- case DAF_:
- newetd = stagreal = ETDCDATA;
- conact = stag(datarc = DAF_);
- conactsw = 1; /* We can skip sgmlact() in opening state. */
- prologsw = 0; /* End the prolog. */
- break;
- case DCE_:
- case MSS_:
- /* prcon[2].tu.thetd holds the etd for the document element. */
- newetd = stagreal = prcon[2].tu.thetd;
- stagmin = MINSTAG; /* This tag was minimized. */
- /* It's an error if the start tag of the document element
- is not minimizable. */
- if (BITOFF(newetd->etdmin, SMO))
- sgmlerr(226, conpcb, (UNCH *)0, (UNCH *)0);
- oconact = conact; /* Save conact. */
- conact = stag(0); /* Start the document element. */
- conactsw = 1; /* conact needs processing. */
- prologsw = 0; /* The prolog is finished. */
- if (oconact == MSS_) {
- if (msplevel==0) conpcb = getpcb((int)ETDCON);
- conpcb = mdms(tbuf, conpcb); /* Parse the marked section
- start. */
- }
- break;
- default: /* STE_: not defined in SGMLACT.H. */
- if (msplevel==0) conpcb = getpcb((int)ETDCON);
- prologsw = 0; /* End the prolog. */
- break;
- }
- }
- for (;;) {
- unsigned swact; /* Switch action: saved conact, new, or sgmlact.*/
-
- if (conactsw) {
- conactsw = 0;
- swact = conact;
- contersw = contersv;
- }
- else {
- conact = parsecon(tbuf, conpcb);
- swact = sgmlact((UNCH)(conact != EOD_ ? conact : LOP_));
- }
-
- switch (swact) {
-
- case MD_: /* Process markup declaration. */
- parsenm(tbuf, NAMECASE); /* Get declaration name. */
- if (!ustrcmp(tbuf+1, key[KUSEMAP])) mdsrmuse(tbuf);
- else sgmlerr(E_MDNAME, conpcb, tbuf+1, (UNCH *)0);
- continue;
- case MDC_: /* Process markup declaration comment. */
- if (*FPOS!=lex.d.mdc)
- parsemd(tbuf, NAMECASE, (struct parse *)0, NAMELEN);
- continue;
-
- case MSS_: /* Process marked section start. */
- conpcb = mdms(tbuf, conpcb);
- continue;
- case MSE_: /* Process marked section end (drop to LOP_). */
- if (mdmse()) conpcb = getpcb((int)ETDCON);
- continue;
-
- case PIS_: /* Return processing instruction (string). */
- if (entpisw) rcbdafp->data = data;
- else {
- parselit(tbuf, &pcblitc, PILEN, lex.d.pic);
- rcbdafp->data = tbuf;
- }
- rcbdafp->datalen = datalen;
- rcbdafp->contersw = entpisw;
- entpisw = 0; /* Reset for next time.*/
- scbset(); /* Update location in current scb. */
- return SGMLPIS;
-
- case APP_:
- rcbdafp->data = tbuf;
- rcbdafp->datalen = ustrlen(tbuf);
- rcbdafp->contersw = 0;
- scbset();
- return SGMLAPP;
- case ETG_: /* Return end-tag. */
- charmode = 0; /* Not in char mode unless CDATA or RCDATA.*/
- if (msplevel==0) conpcb = getpcb((int)ETDCON);
- rcbtagp->contersw = tags[ts+1].tflags;
- rcbtagp->tagmin = etagimsw ? MINETAG : etagmin;
- rcbtagp->curgi = tags[ts+1].tetd->etdgi;
- rcbtagp->ru.oldgi = tags[ts].tetd->etdgi;
- if (etagmin==MINSTAG) rcbtagp->tagreal =
- BADPTR(stagreal) ? stagreal : (PETD)stagreal->etdgi;
- else rcbtagp->tagreal =
- BADPTR(etagreal) ? etagreal : (PETD)etagreal->etdgi;
- rcbtagp->etictr = etictr;
- rcbtagp->srmnm = tags[ts].tsrm!=SRMNULL ? tags[ts].tsrm[0]->ename
- : 0;
- scbset(); /* Update location in current scb. */
- return SGMLETG;
-
- case STG_: /* Return start-tag. */
- charmode = 0; /* Not in char mode unless CDATA or RCDATA.*/
- if (!conrefsw && msplevel==0) conpcb = getpcb((int)ETDCON);
- rcbtagp->contersw = tags[ts].tflags;
- rcbtagp->tagmin = dostag ? MINSTAG : stagmin;
- rcbtagp->curgi = tags[ts].tetd->etdgi;
- /* Get attribute list if one was defined for this element. */
- rcbtagp->ru.al = !tags[ts].tetd->adl ? 0 :
- rcbtagp->tagmin==MINNONE ? al : tags[ts].tetd->adl;
- rcbtagp->tagreal = BADPTR(stagreal)?stagreal:(PETD)stagreal->etdgi;
- rcbtagp->etictr = etictr;
- rcbtagp->srmnm = tags[ts].tsrm!=SRMNULL ? tags[ts].tsrm[0]->ename
- : 0;
- scbset(); /* Update location in current scb. */
- return SGMLSTG;
-
- case DAF_: /* Return data in source entity buffer. */
- charmode = 1;
- rcbdafp->datalen = datalen;
- rcbdafp->data = data;
- rcbdafp->contersw = contersw | entdatsw;
- contersw = entdatsw = 0;/* Reset for next time.*/
- scbset(); /* Update location in current scb. */
- return SGMLDAF;
-
- case CON_: /* Process conact after returning REF_. */
- conactsw = 1;
- contersv = contersw;
- case REF_: /* Return RE found. */
- if (badresw) {
- badresw = 0;
- sgmlerr(E_CHARS, &pcbconm, tags[ts].tetd->etdgi+1, (UNCH *)0);
- continue;
- }
- charmode = 1;
- rcbdafp->contersw = contersw;
- contersw = 0; /* Reset for next time.*/
- scbset(); /* Update location in current scb. */
- return SGMLREF;
-
- case EOD_: /* End of source document entity. */
- if (mslevel != 0) sgmlerr(139, conpcb, (UNCH *)0, (UNCH *)0);
- idrck(); /* Check idrefs. */
- scbset(); /* Update location in current scb. */
- return SGMLEOD;
-
- default: /* LOP_: Loop again with no action. */
- continue;
- }
- }
-}
-/* PCBSGML: State and action table for action codes returned to text processor
- by SGML.C.
- Columns are based on SGMLACT.H values minus DAF_, except that end
- of document has input code LOP_, regardless of its action code.
-*/
-/* Symbols for state names (end with a number). */
-#define ST1 0 /* Just had a start tag. */
-#define NR1 2 /* Just had an RS or RE. */
-#define DA1 4 /* Just had some data. */
-#define NR2 6 /* Just had an RE; RE pending. */
-#define ST2 8 /* Had only markup since last RE/RS; RE pending. */
-
-static UNCH sgmltab[][11] = {
-/*daf_ etg_ md_ mdc_ mss_ mse_ pis_ ref_ stg_ rsr_ eod */
- {DA1 ,DA1 ,ST1 ,ST1 ,ST1 ,ST1 ,ST1 ,NR1 ,ST1 ,NR1 ,ST1 },/*st1*/
- {DAF_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,LOP_,STG_,LOP_,EOD_},
-
- {DA1 ,DA1 ,ST1 ,ST1 ,ST1 ,ST1 ,ST1 ,NR2 ,ST1 ,NR1 ,ST1 },/*nr1*/
- {DAF_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,LOP_,STG_,LOP_,EOD_},
-
- {DA1 ,DA1 ,DA1 ,DA1 ,DA1 ,DA1 ,DA1 ,NR2 ,ST1 ,NR1 ,ST1 },/*da1*/
- {DAF_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,LOP_,STG_,LOP_,EOD_},
-
- {DA1 ,DA1 ,ST2 ,ST2 ,ST2 ,ST2 ,ST2 ,NR2 ,ST1 ,NR2 ,ST1 },/*nr2*/
- {CON_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,REF_,CON_,LOP_,EOD_},
-
- {DA1 ,DA1 ,ST2 ,ST2 ,ST2 ,ST2 ,ST2 ,NR2 ,ST1 ,NR2 ,ST1 },/*st2*/
- {CON_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,LOP_,CON_,LOP_,EOD_},
-};
-int scbsgmst = ST1; /* SCBSGML: trailing stag or markup; ignore RE. */
-int scbsgmnr = NR1; /* SCBSGML: new record; do not ignore RE. */
-/* SGMLACT: Determine action to be taken by SGML.C based on current state and
- specified input.
- For start or end of a plus exception element, push or pop the
- pcbsgml stack.
- Return to caller with action code.
-*/
-#ifdef USE_PROTOTYPES
-int sgmlact(UNCH conret)
-#else
-int sgmlact(conret)
-UNCH conret; /* Action returned to SGML.C by content parse. */
-#endif
-{
- int action;
-
- if (conret==STG_ && GET(tags[ts].tflags, TAGPEX))
- {++pss; scbsgml[pss].snext = ST1;}
- scbsgml[pss].sstate = scbsgml[pss].snext;
- scbsgml[pss].snext = sgmltab[scbsgml[pss].sstate]
- [scbsgml[pss].sinput = conret-DAF_];
- scbsgml[pss].saction = sgmltab[scbsgml[pss].sstate+1][scbsgml[pss].sinput];
- TRACEGML(scbsgml, pss, conactsw, conact);
- action = scbsgml[pss].saction;
- if (conret==ETG_ && GET(tags[ts+1].tflags, TAGPEX)) {
- pss--;
- /* An included subelement affects the enclosing state like a
- processing instruction (or MDC_ or MD_),
- that is to say NR1 is changed to ST1 and NR2 to ST2. */
- scbsgml[pss].sstate = scbsgml[pss].snext;
- scbsgml[pss].snext = sgmltab[scbsgml[pss].sstate][PIS_ - DAF_];
- }
- return action;
-}
-/* GETPCB: Choose pcb for new or resumed element.
-*/
-struct parse *getpcb(etdcon)
-int etdcon; /* Content type of new or resumed element. */
-{
- if (BITON(etdcon, MGI)) {
- return(BITON(etdcon, MCHARS) ? &pcbconm : &pcbcone);
- }
- if (BITON(etdcon, MCDATA) || BITON(etdcon, MRCDATA)) {
- charmode = 1;
- return(BITON(etdcon, MCDATA) ? &pcbconc : (rcessv = es, &pcbconr));
- }
- return(&pcbconm);
-}
-
-struct markup *sgmlset(swp)
-struct switches *swp;
-{
- /* Initialize variables based on switches structure members. */
- sw = *swp;
- rbufs = (UNCH *)rmalloc((UNS)3+sw.swbufsz) + 3; /* DOS file read area. */
- TRACEPRO(); /* Set trace switches for prolog. */
- msginit(swp);
- ioinit(swp);
- entginit(swp);
- sdinit();
- return &lex.m;
-}
-
-/* Points for each capacity, indexed by *CAP in sgmldecl.h. We'll replace
-2 with the real NAMELEN at run time. */
-
-static UNCH cappoints[] = {
- 1,
- 2,
- 1,
- 2,
- 2,
- 2,
- 2,
- 2,
- 1,
- 2,
- 2,
- 1,
- 2,
- 2,
- 2,
- 2,
- 2
-};
-
-static long capnumber[NCAPACITY];
-static long maxsubcap[NCAPACITY];
-
-VOID sgmlend(p)
-struct sgmlcap *p;
-{
- int i;
- for (; es >= 0; --es)
- if (FILESW)
- fileclos();
-
- capnumber[NOTCAP] = ds.dcncnt;
- capnumber[EXGRPCAP] = ds.pmexgcnt;
- capnumber[ELEMCAP] = ds.etdcnt+ds.etdercnt;
- capnumber[EXNMCAP] = ds.pmexcnt;
- capnumber[GRPCAP] = ds.modcnt;
- capnumber[ATTCAP] = ds.attcnt;
- capnumber[ATTCHCAP] = ds.attdef;
- capnumber[AVGRPCAP] = ds.attgcnt;
- capnumber[IDCAP] = ds.idcnt;
- capnumber[IDREFCAP] = ds.idrcnt;
- capnumber[ENTCAP] = ds.ecbcnt;
- capnumber[ENTCHCAP] = ds.ecbtext;
- capnumber[MAPCAP] = ds.srcnt + ds.srcnt*lex.s.dtb[0].mapdata;
- capnumber[NOTCHCAP] = ds.dcntext;
-
- capnumber[TOTALCAP] = 0;
-
- for (i = 1; i < NCAPACITY; i++) {
- if (cappoints[i] > 1)
- cappoints[i] = NAMELEN;
- capnumber[i] += maxsubcap[i]/cappoints[i];
- capnumber[TOTALCAP] += (long)capnumber[i] * cappoints[i];
- }
- p->number = capnumber;
- p->points = cappoints;
- p->limit = sd.capacity;
- p->name = captab;
-
- if (sw.swcap) {
- for (i = 0; i < NCAPACITY; i++) {
- long excess = capnumber[i]*cappoints[i] - sd.capacity[i];
- if (excess > 0) {
- char buf[sizeof(long)*3 + 1];
- sprintf(buf, "%ld", excess);
- sgmlerr(162, (struct parse *)0,
- (UNCH *)captab[i], (UNCH *)buf);
- }
- }
- }
-}
-
-VOID sgmlsubcap(v)
-long *v;
-{
- int i;
- for (i = 0; i < NCAPACITY; i++)
- if (v[i] > maxsubcap[i])
- maxsubcap[i] = v[i];
-}
-
-int sgmlsdoc(ptr)
-UNIV ptr;
-{
- struct entity *e;
- union etext etx;
- etx.x = ptr;
-
- e = entdef(indocent, ESF, &etx);
- if (!e)
- return -1;
- return entopen(e);
-}
-
-/* SGMLGENT: Get a data entity.
- Returns:
- -1 if the entity does not exist
- -2 if it is not a data entity
- 1 if it is an external entity
- 2 if it is an internal cdata entity
- 3 if it is an internal sdata entity
-*/
-int sgmlgent(iname, np, tp)
-UNCH *iname;
-PNE *np;
-UNCH **tp;
-{
- PECB ep; /* Pointer to an entity control block. */
-
- ep = entfind(iname);
- if (!ep)
- return -1;
- switch (ep->estore) {
- case ESN:
- if (np)
- *np = ep->etx.n;
- return 1;
- case ESC:
- if (tp)
- *tp = ep->etx.c;
- return 2;
- case ESX:
- if (tp)
- *tp = ep->etx.c;
- return 3;
- }
- return -2;
-}
-
-/* Mark an entity. */
-
-int sgmlment(iname)
-UNCH *iname;
-{
- PECB ep;
- int rc;
-
- ep = entfind(iname);
- if (!ep)
- return -1;
- rc = ep->mark;
- ep->mark = 1;
- return rc;
-}
-
-int sgmlgcnterr()
-{
- return msgcnterr();
-}
-
-char *getsubst()
-{
- return (char *)lextran;
-}
-
-/* This is for error handling functions that want to print a gi backtrace. */
-
-UNCH *getgi(i)
-int i;
-{
- return i >= 0 && i <= ts ? tags[i].tetd->etdgi + 1 : NULL;
-}
-
-/* Returns the value of prologsw for the use by error handling functions. */
-
-int inprolog()
-{
- return prologsw;
-}
-
-/* Used by the error handling functions to access scbs. */
-
-int getlocation(level, locp)
-int level;
-struct location *locp;
-{
- if (level < 0 || level > es)
- return 0;
- if (locp) {
- int es = level;
- /* source macros access a variable called `es' */
-
- locp->filesw = FILESW;
- locp->rcnt = RCNT;
- locp->ccnt = CCNT;
- locp->ename = ENTITY + 1;
- locp->fcb = SCBFCB;
- locp->curchar = CC;
- locp->nextchar = NEXTC;
- }
- return 1;
-}
-
-int sgmlloc(linenop, filenamep)
-unsigned long *linenop;
-char **filenamep;
-{
- int level = es;
- int es;
-
- for (es = level; es >= 0 && !FILESW; es--)
- ;
- if (es < 0)
- return 0;
- *linenop = RCNT;
- *filenamep = ioflid(SCBFCB);
- return 1;
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/sgml2.c b/usr.bin/sgmls/sgmls/sgml2.c
deleted file mode 100644
index df75b6a..0000000
--- a/usr.bin/sgmls/sgmls/sgml2.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/* Added exiterr() for terminal errors to prevent SGML.MSG errors. */
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-static int iorc; /* Return code from io* functions */
-/* ENTDEF: Process an entity definition and return the pointer to it.
- The entity text must be in permanent storage.
- There is no checking to see if the entity already exists;
- the caller must have done that.
-*/
-#ifdef USE_PROTOTYPES
-PECB entdef(UNCH *ename, UNCH estore, union etext *petx)
-#else
-PECB entdef(ename, estore, petx)
-UNCH *ename; /* Entity name (with length and EOS). */
-UNCH estore; /* Entity storage class. */
-union etext *petx; /* Ptr to entity text union. */
-#endif
-{
- PECB p;
-
- p = (PECB)hin((THASH)etab, ename, hash(ename, ENTHASH), ENTSZ);
- memcpy((UNIV)&p->etx, (UNIV)petx, ETEXTSZ);
- p->estore = estore;
- TRACEECB("ENTDEF", p);
- return(p);
-}
-/* ENTFIND: If an entity exists, return ptr to its ecb.
- Return NULL if it is not defined.
-*/
-PECB entfind(ename)
-UNCH *ename; /* Entity name (with length and EOS). */
-{
- PECB p;
-
- p = (PECB)hfind((THASH)etab, ename, hash(ename, ENTHASH));
- TRACEECB("ENTFIND", p);
- return p;
-}
-/* ENTREF: Process a general or parameter entity reference.
- If the entity is defined it returns the return code from ENTOPEN.
- It returns ENTUNDEF for undefined parameter entity references
- and for general entity references when defaulting is not allowed.
- Otherwise, it uses the default entity text.
-*/
-int entref(ename)
-UNCH *ename; /* Entity name (with length and EOS). */
-{
- PECB ecb; /* Entity control block. */
-
- /* Get the entity control block, if the entity has been defined. */
- if ((ecb = (PECB)hfind((THASH)etab, ename, hash(ename, ENTHASH)))==0
- || ecb->estore == 0) {
- if (ename[1] == lex.d.pero || ecbdeflt == 0) {
- sgmlerr(35, (struct parse *)0, ename+1, (UNCH *)0);
- return(ENTUNDEF);
- }
- else
- ecb = usedef(ename);
- }
- return(entopen(ecb));
-}
-/* ENTOPEN: Open a newly referenced entity.
- Increment the stack pointer (es) and initialize the new entry.
- ENTDATA if entity is CDATA or SDATA, ENTPI if it is PI,
- 0 if normal and all o.k.; <0 if not.
-*/
-int entopen(ecb)
-struct entity *ecb; /* Entity control block. */
-{
- int i; /* Loop counter. */
-
- /* See if we have exceeded the entity nesting level. */
- if (es>=ENTLVL) {
- sgmlerr(34, (struct parse *)0, ecb->ename+1, ntoa(ENTLVL));
- return(ENTMAX);
- }
- if (docelsw) sgmlerr(234, (struct parse *)0, (UNCH *)0, (UNCH *)0);
- /* If entity is an etd, pi, or data, return it without creating an scb. */
- switch (ecb->estore) {
- case ESN:
- if (NEXTYPE(ecb->etx.n)!=ESNSUB) {
- if (!NEDCNDEFINED(ecb->etx.n))
- sgmlerr(78, (struct parse *)0, NEDCN(ecb->etx.n)+1,
- ecb->ename+1);
- }
- else {
-#if 0
- if (!NEID(ecb->etx.n)) {
- sgmlerr(149, (struct parse *)0, ecb->ename + 1, (UNCH *)0);
- return ENTFILE;
- }
-#endif
- if (sw.nopen >= sd.subdoc)
- sgmlerr(188, (struct parse *)0,
- (UNCH *)NULL, (UNCH *)NULL);
- }
- data = (UNCH *)ecb->etx.n;
- entdatsw = NDECONT;
- return(ENTDATA);
- case ESC:
- case ESX:
- datalen = ustrlen(ecb->etx.c);
- /* Ignore reference to empty CDATA entity. */
- if (datalen == 0 && ecb->estore == ESC) return(0);
- data = ecb->etx.c;
- entdatsw = (ecb->estore==ESC) ? CDECONT : SDECONT;
- return(ENTDATA);
- case ESI:
- datalen = ustrlen(ecb->etx.c);
- data = ecb->etx.c;
- entpisw = 4;
- return(ENTPI);
- }
- /* If the same entity is already open, send msg and ignore it.
- Level 0 needn't be tested, as its entity name is always *DOC.
- */
- for (i = 0; ++i<=es;) if (scbs[i].ecb.enext==ecb) {
- sgmlerr(36, (struct parse *)0, ecb->ename+1, (UNCH *)0);
- return(ENTLOOP);
- }
- /* Update SCB if entity trace is wanted in messages or entity is a file.
- (Avoid this at start when es==-1 or memory will be corrupted.)
- */
- if (es >= 0 && (sw.swenttr || FILESW)) scbset();
-
- /* Stack the new source control block (we know there is room). */
- ++es; /* Increment scbs index. */
- RCNT = CCO = RSCC = 0; /* No records or chars yet. */
- COPIEDSW = 0;
- memcpy((UNIV)&ECB, (UNIV)ecb, (UNS)ENTSZ); /* Copy the ecb into the scb. */
- ECBPTR = ecb; /* Save the ecb pointer in scb.ecb.enext. */
- TRACEECB("ENTOPEN", ECBPTR);
-
- /* For memory entities, the read buffer is the entity text.
- The text starts at FBUF, so FPOS should be FBUF-1
- because it is bumped before each character is read.
- */
- if (ECB.estore<ESFM) {FPOS = (FBUF = ECB.etx.c)-1; return 0;}
-
- /* For file entities, suspend any open file and do first read. */
- if (ECB.etx.x == 0) {
- --es;
- switch (ecb->estore) {
- case ESF:
- sgmlerr(149, (struct parse *)0, ecb->ename + 1, (UNCH *)0);
- break;
- case ESP:
- sgmlerr(229, (struct parse *)0, ecb->ename + 2, (UNCH *)0);
- break;
- default:
- abort();
- }
- return ENTFILE;
- }
- fileopen(); /* Open new external file. */
- if (iorc<0) { /* If open not successful: */
- FPOS = FBUF-1; /* Clean CCNT for OPEN error msg.*/
- filerr(32, ecb->ename+1);
- --es; /* Pop the stack. */
- return(ENTFILE);
- }
- filepend(es); /* Suspend any open file. */
- fileread(); /* First read of file must be ok.*/
- return 0;
-}
-/* ENTGET: Get next record of entity (if there is one).
- Otherwise, close the file (if entity is a file) and
- pop the entity stack. If nothing else is on the stack,
- return -1 to advise the caller.
-*/
-int entget()
-{
- RSCC += (CCO = FPOS-FBUF);
- /* Characters-in-record (ignore EOB/EOF). */
- if (es == tages)
- tagctr += CCO; /* Update tag length counter. */
- switch (*FPOS) {
- case EOBCHAR: /* End of file buffer: refill it. */
- rbufs[-2] = FPOS[-2];
- rbufs[-1] = FPOS[-1];
- fileread(); /* Read the file. */
- if (iorc > 0) break;
- readerr:
- filerr(31, ENTITY+1); /* Treat error as EOF. */
- case EOFCHAR: /* End of file: close it. */
- fileclos(); /* Call SGMLIO to close file. */
- conterr:
- if (es==0) { /* Report if it is primary file. */
- FPOS = FBUF-1; /* Preserve CCNT for omitted end-tags. */
- return -1;
- }
- case EOS: /* End of memory entity: pop the stack. */
- TRACEECB("ENTPOP", ECBPTR);
- if (COPIEDSW) {
- frem((UNIV)(FBUF + 1));
- COPIEDSW = 0;
- }
- --es; /* Pop the SCB stack. */
- if (FBUF) break; /* Not a PEND file. */
- filecont(); /* Resume previous file. */
- if (iorc<0) { /* If CONT not successful: */
- filerr(94, ENTITY+1);
- goto conterr;
- }
- fileread(); /* Read the file. */
- if (iorc<=0) goto readerr; /* If READ not successful: */
- rbufs[-1] = SCB.pushback;
- FPOS += CCO;
- CCO = 0;
- if (delmscsw && es==0) { /* End of DTD. */
- delmscsw = 0;
- *rbufs = lex.d.msc;
- }
- break;
- }
- return 0;
-}
-/* USEDEF: Use the default value for an entity reference.
- Returns the ECB for the defaulted entity.
-*/
-PECB usedef(ename)
-UNCH *ename; /* Entity name (with length and EOS). */
-{
- union etext etx; /* Save return from entgen. */
- PECB ecb; /* Entity control block. */
- PNE pne = 0; /* Ptr to NDATA entity control block. */
- UNCH estore; /* Default entity storage type. */
-
- if ((estore = ecbdeflt->estore)<ESFM) /* Default is an internal string. */
- etx.c = ecbdeflt->etx.c;
- else {
- /* Move entity name into fpi. */
- fpidf.fpinm = ename + 1;
- if ((etx.x = entgen(&fpidf))==0)
- sgmlerr(150, (struct parse *)0, ename + 1, (UNCH *)0);
- if (estore==ESN) {
- memcpy((UNIV)(pne=(PNE)rmalloc((UNS)NESZ)),(UNIV)ecbdeflt->etx.n,(UNS)NESZ);
- NEID(pne) = etx.x;
- etx.n = pne;
- }
- }
- if (sw.swrefmsg) sgmlerr(45, (struct parse *)0, ename+1, (UNCH *)0);
- ++ds.ecbcnt;
- ecb = entdef(ename, estore, &etx);
- ecb->dflt = 1;
- if (pne) NEENAME(pne) = ecb->ename;
- return(ecb);
-}
-/* SCBSET: Set source control block to current location in the current entity.
- This routine is called by SGML when it returns to the text
- processor and by ERROR when it reports an error.
-*/
-VOID scbset()
-{
- if (es >= 0 && FBUF) {
- CC = *FPOS;
- if (*FPOS == DELNONCH)
- NEXTC = FPOS[1];
- else
- NEXTC = 0;
- CCO = FPOS + 1 - FBUF;
- }
-}
-/* FILEOPEN: Call IOOPEN to open an external entity (file).
-*/
-VOID fileopen() /* Open an external entity's file. */
-{
- iorc = ioopen(ECB.etx.x, &SCBFCB);
-}
-/* FILEREAD: Call IOREAD to read an open external entity (file).
-*/
-VOID fileread() /* Read the current external entity's file. */
-{
- int newfile;
- iorc = ioread(SCBFCB, rbufs, &newfile);
- FPOS = (FBUF = rbufs) - 1; /* Actual read buffer. */
- if (newfile) RCNT = 0;
-}
-/* FILEPEND: Call IOPEND to close an open external entity (file) temporarily.
-*/
-VOID filepend(es) /* Close the current external entity's file. */
-int es; /* Local index to scbs. */
-{
- while (--es>=0) { /* Find last external file on stack. */
- int off;
- if (!FILESW) continue; /* Not an external file. */
- if (!FBUF) continue; /* Already suspended. */
- off = CCO;
- assert(off >= -1);
- if (off < 0) off = 0;
- else CCO = 0;
- FPOS -= CCO;
- SCB.pushback = FPOS[-1];
- FBUF = 0; /* Indicate pending file. */
- RSCC += off; /* Update characters-in-record counter. */
- if (es == tages)
- tagctr += off; /* Update tag length counter. */
- iopend(SCBFCB, off, rbufs);
- return;
- }
-}
-/* FILECONT: Call IOCONT to reopen an external entity (file).
-*/
-VOID filecont() /* Open an external entity's file. */
-{
- iorc = iocont(SCBFCB);
-}
-/* FILECLOS: Call IOCLOSE to close an open external entity (file).
-*/
-VOID fileclos() /* Close the current external entity's file. */
-{
- if (!SCBFCB)
- return;
- ioclose(SCBFCB);
- /* The fcb will have been freed by sgmlio.
- Make sure we don't access it again. */
- SCBFCB = NULL;
-}
-/* ERROR: Interface to text processor SGML I/O services for error handling.
-*/
-VOID error(e)
-struct error *e;
-{
- scbset(); /* Update location in source control block. */
- msgprint(e);
-}
-/* PTRSRCH: Find a pointer in a list and return its index.
- Search key must be on list as there is no limit test.
- This routine is internal only -- not for user data.
-*/
-UNIV mdnmtab[] = {
- (UNIV)key[KATTLIST],
- (UNIV)key[KDOCTYPE],
- (UNIV)key[KELEMENT],
- (UNIV)key[KENTITY],
- (UNIV)key[KLINKTYPE],
- (UNIV)key[KLINK],
- (UNIV)key[KNOTATION],
- (UNIV)sgmlkey,
- (UNIV)key[KSHORTREF],
- (UNIV)key[KUSELINK],
- (UNIV)key[KUSEMAP]
-};
-UNIV pcbtab[] = {
- (UNIV)&pcbconc,
- (UNIV)&pcbcone,
- (UNIV)&pcbconm,
- (UNIV)&pcbconr,
- (UNIV)&pcbetag,
- (UNIV)&pcbgrcm,
- (UNIV)&pcbgrcs,
- (UNIV)&pcbgrnm,
- (UNIV)&pcbgrnt,
- (UNIV)&pcblitc,
- (UNIV)&pcblitp,
- (UNIV)&pcblitr,
- (UNIV)&pcblitt,
- (UNIV)&pcblitv,
- (UNIV)&pcbmd,
- (UNIV)&pcbmdc,
- (UNIV)&pcbmdi,
- (UNIV)&pcbmds,
- (UNIV)&pcbmsc,
- (UNIV)&pcbmsi,
- (UNIV)&pcbmsrc,
- (UNIV)&pcbpro,
- (UNIV)&pcbref,
- (UNIV)&pcbstag,
- (UNIV)&pcbval,
- (UNIV)&pcbeal,
- (UNIV)&pcbsd,
-};
-UNS ptrsrch(ptrtab, ptr)
-UNIV ptrtab[];
-UNIV ptr;
-{
- UNS i;
-
- for (i = 0; ; ++i)
- if (ptrtab[i] == ptr)
- break;
- return i;
-}
-/* MDERR: Process errors for markup declarations.
- Prepare the special parameters that only exist for
- markup declaration errors.
-*/
-VOID mderr(number, parm1, parm2)
-UNS number; /* Error number. */
-UNCH *parm1; /* Additional parameters (or NULL). */
-UNCH *parm2; /* Additional parameters (or NULL). */
-{
- struct error err;
- errorinit(&err, subdcl ? MDERR : MDERR2, number);
- err.parmno = parmno;
- err.subdcl = subdcl;
- err.eparm[0] = (UNIV)parm1;
- err.eparm[1] = (UNIV)parm2;
- err.errsp = (sizeof(pcbtab)/sizeof(pcbtab[0])) + ptrsrch(mdnmtab,
- (UNIV)mdname);
- error(&err);
-}
-/* SGMLERR: Process errors for SGML parser.
-*/
-VOID sgmlerr(number, pcb, parm1, parm2)
-UNS number; /* Error number. */
-struct parse *pcb; /* Current parse control block. */
-UNCH *parm1; /* Error message parameters. */
-UNCH *parm2; /* Error message parameters. */
-{
- struct error err;
- errorinit(&err, DOCERR, number);
- if (!pcb) pcb = prologsw ? propcb : conpcb;
- err.errsp = ptrsrch(pcbtab, (UNIV)pcb);
- err.eparm[0] = (UNIV)parm1;
- err.eparm[1] = (UNIV)parm2;
- error(&err);
-}
-/* SAVERR: Save an error for possible later use.
-*/
-UNIV saverr(number, pcb, parm1, parm2)
-UNS number; /* Error number. */
-struct parse *pcb; /* Current parse control block. */
-UNCH *parm1; /* Error message parameters. */
-UNCH *parm2; /* Error message parameters. */
-{
- struct error err;
- errorinit(&err, DOCERR, number);
- if (!pcb) pcb = prologsw ? propcb : conpcb;
- err.errsp = ptrsrch(pcbtab, (UNIV)pcb);
- err.eparm[0] = (UNIV)parm1;
- err.eparm[1] = (UNIV)parm2;
- scbset();
- return msgsave(&err);
-}
-/* SAVMDERR: Save an md error for possible later use.
-*/
-UNIV savmderr(number, parm1, parm2)
-UNS number; /* Error number. */
-UNCH *parm1; /* Additional parameters (or NULL). */
-UNCH *parm2; /* Additional parameters (or NULL). */
-{
- struct error err;
- errorinit(&err, subdcl ? MDERR : MDERR2, number);
- err.parmno = parmno;
- err.subdcl = subdcl;
- err.eparm[0] = (UNIV)parm1;
- err.eparm[1] = (UNIV)parm2;
- err.errsp = (sizeof(pcbtab)/sizeof(pcbtab[0])) + ptrsrch(mdnmtab,
- (UNIV)mdname);
- scbset();
- return msgsave(&err);
-}
-/* SVDERR: Print a saved error.
-*/
-VOID svderr(p)
-UNIV p;
-{
- msgsprint(p);
-}
-/* EXITERR: Process terminal errors for SGML parser.
-*/
-VOID exiterr(number, pcb)
-UNS number; /* Error number. */
-struct parse *pcb; /* Current parse control block. */
-{
- struct error err;
- errorinit(&err, EXITERR, number);
- if (!pcb) pcb = prologsw ? propcb : conpcb;
- err.errsp = ptrsrch(pcbtab, (UNIV)pcb);
- error(&err);
- /* The error handler should have exited. */
- abort();
-}
-/* SYNERR: Process syntax errors for SGML parser.
-*/
-VOID synerr(number, pcb)
-UNS number; /* Error number. */
-struct parse *pcb; /* Current parse control block. */
-{
- struct error err;
- errorinit(&err, DOCERR, number);
- err.errsp = ptrsrch(pcbtab, (UNIV)pcb);
- error(&err);
-}
-/* FILERR: Process a file access error.
-*/
-VOID filerr(number, parm)
-UNS number;
-UNCH *parm;
-{
- struct error err;
- errorinit(&err, FILERR, number);
- err.eparm[0] = (UNIV)parm;
- err.sverrno = errno;
- error(&err);
-}
-/* ERRORINIT: Constructor for struct error.
-*/
-VOID errorinit(e, type, number)
-struct error *e;
-UNS type;
-UNS number;
-{
- int i;
- e->errtype = type;
- e->errnum = number;
- e->errsp = 0;
- for (i = 0; i < MAXARGS; i++)
- e->eparm[i] = 0;
- e->parmno = 0;
- e->subdcl = 0;
-}
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/sgmlaux.h b/usr.bin/sgmls/sgmls/sgmlaux.h
deleted file mode 100644
index 6073e66..0000000
--- a/usr.bin/sgmls/sgmls/sgmlaux.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* This file controls the interface between the parser core and the auxiliary
-functions in entgen.c, sgmlio.c, and sgmlmsg.c */
-
-#include "std.h"
-#include "entity.h"
-#include "sgmldecl.h"
-
-/* Error types (ERRTYPE) for calls to error-handling services
- performed for SGML by the text processor (SGMLIO).
- NOTE: Strings in these blocks have no lengths, but cannot exceed
- NAMELEN (plus 1 more byte for the zero terminator).
-*/
-#define FILERR 0 /* Error: file access. */
-#define DOCERR 1 /* Error: in document markup. */
-#define MDERR 2 /* Error: in markup declaration with subdcl. */
-#define MDERR2 3 /* Error: in markup declaration with no subdcl. */
-#define EXITERR 4 /* Error: terminal error in document markup. */
-/* Quantities affecting error messages and their arguments.
-*/
-#define MAXARGS 2 /* Maximum number of arguments in a msg. */
-
-/* NOTE: Error handler must return, or next call to SGML must be RSET or END,
- except for EXITERR errors which must not return.
-*/
-struct error { /* IPB for error messages. */
- UNS errtype; /* Type of error: DOC, MD, MD2, FIL. */
- UNS errnum; /* Error number. */
- UNS errsp; /* Special parameter index in message file. */
- int sverrno; /* Saved value of errno. */
- int parmno; /* MDERROR: declaration parameter number. */
- UNCH *subdcl; /* MDERROR: subject of declaration. */
- UNIV eparm[MAXARGS]; /* Ptrs to arguments (no length, but EOS). */
-};
-
-struct location {
- int filesw;
- unsigned long rcnt;
- int ccnt;
- UNCH curchar;
- UNCH nextchar;
- UNCH *ename;
- UNIV fcb;
-};
-
-int ioopen P((UNIV, UNIV*));
-VOID ioclose P((UNIV));
-int ioread P((UNIV, UNCH *, int *));
-VOID iopend P((UNIV, int, UNCH *));
-int iocont P((UNIV));
-VOID ioinit P((struct switches *));
-char *ioflid P((UNIV));
-
-UNIV entgen P((struct fpi *));
-VOID entginit P((struct switches *));
-
-VOID msgprint P((struct error *));
-VOID msginit P((struct switches *));
-UNIV msgsave P((struct error *));
-VOID msgsprint P((UNIV));
-VOID msgsfree P((UNIV));
-int msgcnterr P((void));
-
-
-int inprolog P((void));
-UNCH *getgi P((int));
-
-int getlocation P((int, struct location *));
-UNIV rmalloc P((unsigned int));
-UNIV rrealloc P((UNIV, UNS));
-VOID frem P((UNIV));
-VOID exiterr P((unsigned int,struct parse *));
-char *getsubst P((void));
diff --git a/usr.bin/sgmls/sgmls/sgmldecl.c b/usr.bin/sgmls/sgmls/sgmldecl.c
deleted file mode 100644
index 6ef6b68..0000000
--- a/usr.bin/sgmls/sgmls/sgmldecl.c
+++ /dev/null
@@ -1,1804 +0,0 @@
-/* sgmldecl.c -
- SGML declaration parsing.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "sgmlincl.h"
-
-/* Symbolic names for the error numbers that are be generated only by
-this module. */
-
-#define E_SHUNCHAR 159
-#define E_STANDARD 163
-#define E_SIGNIFICANT 164
-#define E_BADLIT 165
-#define E_SCOPE 166
-#define E_XNUM 167
-#define E_BADVERSION 168
-#define E_NMUNSUP 169
-#define E_XNMLIT 170
-#define E_CHARDESC 171
-#define E_CHARDUP 172
-#define E_CHARRANGE 173
-#define E_7BIT 174
-#define E_CHARMISSING 175
-#define E_SHUNNED 176
-#define E_NONSGML 177
-#define E_CAPSET 178
-#define E_CAPMISSING 179
-#define E_SYNTAX 180
-#define E_CHARNUM 181
-#define E_SWITCHES 182
-#define E_INSTANCE 183
-#define E_ZEROFEATURE 184
-#define E_YESNO 185
-#define E_CAPACITY 186
-#define E_NOTSUPPORTED 187
-#define E_FORMAL 189
-#define E_BADCLASS 190
-#define E_MUSTBENON 191
-#define E_BADBASECHAR 199
-#define E_SYNREFUNUSED 200
-#define E_SYNREFUNDESC 201
-#define E_SYNREFUNKNOWN 202
-#define E_SYNREFUNKNOWNSET 203
-#define E_FUNDUP 204
-#define E_BADFUN 205
-#define E_FUNCHAR 206
-#define E_GENDELIM 207
-#define E_SRDELIM 208
-#define E_BADKEY 209
-#define E_BADQUANTITY 210
-#define E_BADNAME 211
-#define E_REFNAME 212
-#define E_DUPNAME 213
-#define E_QUANTITY 214
-#define E_QTOOBIG 215
-#define E_NMSTRTCNT 219
-#define E_NMCHARCNT 220
-#define E_NMDUP 221
-#define E_NMBAD 222
-#define E_NMMINUS 223
-#define E_UNKNOWNSET 227
-#define E_TOTALCAP 235
-
-#define CANON_NMC '.' /* Canonical name character. */
-#define CANON_NMS 'A' /* Canonical name start character. */
-#define CANON_MIN ':' /* Canonical minimum data character. */
-
-#define SUCCESS 1
-#define FAIL 0
-#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
-#define matches(tok, str) (ustrcmp((tok)+1, (str)) == 0)
-
-static UNCH standard[] = "ISO 8879:1986";
-
-#define REFERENCE_SYNTAX "ISO 8879:1986//SYNTAX Reference//EN"
-#define CORE_SYNTAX "ISO 8879:1986//SYNTAX Core//EN"
-
-static UNCH (*newkey)[REFNAMELEN+1] = 0;
-
-struct pmap {
- char *name;
- UNIV value;
-};
-
-/* The reference capacity set. */
-#define REFCAPSET \
-{ 35000L, 35000L, 35000L, 35000L, 35000L, 35000L, 35000L, 35000L, 35000L, \
-35000L, 35000L, 35000L, 35000L, 35000L, 35000L, 35000L, 35000L }
-
-long refcapset[NCAPACITY] = REFCAPSET;
-
-/* A pmap of known capacity sets. */
-
-static struct pmap capset_map[] = {
- { "ISO 8879:1986//CAPACITY Reference//EN", (UNIV)refcapset },
- { 0 },
-};
-
-/* Table of capacity names. Must match *CAP in sgmldecl.h. */
-
-char *captab[] = {
- "TOTALCAP",
- "ENTCAP",
- "ENTCHCAP",
- "ELEMCAP",
- "GRPCAP",
- "EXGRPCAP",
- "EXNMCAP",
- "ATTCAP",
- "ATTCHCAP",
- "AVGRPCAP",
- "NOTCAP",
- "NOTCHCAP",
- "IDCAP",
- "IDREFCAP",
- "MAPCAP",
- "LKSETCAP",
- "LKNMCAP",
-};
-
-/* The default SGML declaration. */
-#define MAXNUMBER 99999999L
-
-/* Reference quantity set */
-
-#define REFATTCNT 40
-#define REFATTSPLEN 960
-#define REFBSEQLEN 960
-#define REFDTAGLEN 16
-#define REFDTEMPLEN 16
-#define REFENTLVL 16
-#define REFGRPCNT 32
-#define REFGRPGTCNT 96
-#define REFGRPLVL 16
-#define REFNORMSEP 2
-#define REFPILEN 240
-#define REFTAGLEN 960
-#define REFTAGLVL 24
-
-#define ALLOC_MAX 65534
-
-#define BIGINT 30000
-
-#define MAXATTCNT ((ALLOC_MAX/sizeof(struct ad)) - 2)
-#define MAXATTSPLEN BIGINT
-#define MAXBSEQLEN BIGINT
-#define MAXDTAGLEN 16
-#define MAXDTEMPLEN 16
-#define MAXENTLVL ((ALLOC_MAX/sizeof(struct source)) - 1)
-#define MAXGRPCNT MAXGRPGTCNT
-/* Must be between 96 and 253 */
-#define MAXGRPGTCNT 253
-#define MAXGRPLVL MAXGRPGTCNT
-#define MAXLITLEN BIGINT
-/* This guarantees that NAMELEN < LITLEN (ie there's always space for a name
-in a buffer intended for a literal.) */
-#define MAXNAMELEN (REFLITLEN - 1)
-#define MAXNORMSEP 2
-#define MAXPILEN BIGINT
-#define MAXTAGLEN BIGINT
-#define MAXTAGLVL ((ALLOC_MAX/sizeof(struct tag)) - 1)
-
-/* 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",
-};
-
-static int max_quantity[] = {
- MAXATTCNT,
- MAXATTSPLEN,
- MAXBSEQLEN,
- MAXDTAGLEN,
- MAXDTEMPLEN,
- MAXENTLVL,
- MAXGRPCNT,
- MAXGRPGTCNT,
- MAXGRPLVL,
- MAXLITLEN,
- MAXNAMELEN,
- MAXNORMSEP,
- MAXPILEN,
- MAXTAGLEN,
- MAXTAGLVL,
-};
-
-static char *quantity_changed;
-
-/* Non-zero means the APPINFO parameter was not NONE. */
-static int appinfosw = 0;
-
-struct sgmldecl sd = {
- REFCAPSET, /* capacity */
-#ifdef SUPPORT_SUBDOC
- MAXNUMBER, /* subdoc */
-#else /* not SUPPORT_SUBDOC */
- 0, /* subdoc */
-#endif /* not SUPPORT_SUBDOC */
- 1, /* formal */
- 1, /* omittag */
- 1, /* shorttag */
- 1, /* shortref */
- { 1, 0 }, /* general/entity name case translation */
- { /* reference quantity set */
- REFATTCNT,
- REFATTSPLEN,
- REFBSEQLEN,
- REFDTAGLEN,
- REFDTEMPLEN,
- REFENTLVL,
- REFGRPCNT,
- REFGRPGTCNT,
- REFGRPLVL,
- REFLITLEN,
- REFNAMELEN,
- REFNORMSEP,
- REFPILEN,
- REFTAGLEN,
- REFTAGLVL,
- },
-};
-
-static int systemcharset[] = {
-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,
-32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
-96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
-112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
-128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
-144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
-160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
-176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
-192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
-208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
-224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
-};
-
-/* This is a private use designating sequence that by convention
-refers to the whole system character set whatever it is. */
-
-#define SYSTEM_CHARSET_DESIGNATING_SEQUENCE "ESC 2/5 2/15 3/0"
-
-static struct pmap charset_map[] = {
- { "ESC 2/5 4/0", (UNIV)iso646charset }, /* ISO 646 IRV */
- { "ESC 2/8 4/2", (UNIV)iso646G0charset }, /* ISO Registration Number 6, ASCII */
- { "ESC 2/8 4/0", (UNIV)iso646G0charset }, /* ISO Registration Number 6, ASCII */
- { "ESC 2/13 4/1", (UNIV)iso8859_1charset }, /* Latin 1 */
- { "ESC 2/1 4/0", (UNIV)iso646C0charset }, /* ISO 646, C0 */
- { "ESC 2/2 4/3", (UNIV)iso6429C1charset }, /* ISO 6429, C1 */
- { SYSTEM_CHARSET_DESIGNATING_SEQUENCE, (UNIV)systemcharset },
- /* system character set */
- { 0 }
-};
-
-static int synrefcharset[256]; /* the syntax reference character set */
-
-#define CHAR_NONSGML 01
-#define CHAR_SIGNIFICANT 02
-#define CHAR_MAGIC 04
-#define CHAR_SHUNNED 010
-
-static UNCH char_flags[256];
-static int done_nonsgml = 0;
-static UNCH *nlextoke = 0; /* new lextoke */
-static UNCH *nlextran = 0; /* new lextran */
-#define MAX_SAVED_ERRS 4
-static UNIV saved_errs[MAX_SAVED_ERRS];
-static int nsaved_errs = 0;
-
-static UNCH kcharset[] = "CHARSET";
-static UNCH kbaseset[] = "BASESET";
-static UNCH kdescset[] = "DESCSET";
-static UNCH kunused[] = "UNUSED";
-static UNCH kcapacity[] = "CAPACITY";
-static UNCH kpublic[] = "PUBLIC";
-static UNCH ksgmlref[] = "SGMLREF";
-static UNCH kscope[] = "SCOPE";
-static UNCH kdocument[] = "DOCUMENT";
-static UNCH kinstance[] = "INSTANCE";
-static UNCH ksyntax[] = "SYNTAX";
-static UNCH kswitches[] = "SWITCHES";
-static UNCH kfeatures[] = "FEATURES";
-static UNCH kminimize[] = "MINIMIZE";
-static UNCH kdatatag[] = "DATATAG";
-static UNCH komittag[] = "OMITTAG";
-static UNCH krank[] = "RANK";
-static UNCH kshorttag[] = "SHORTTAG";
-static UNCH klink[] = "LINK";
-static UNCH ksimple[] = "SIMPLE";
-static UNCH kimplicit[] = "IMPLICIT";
-static UNCH kexplicit[] = "EXPLICIT";
-static UNCH kother[] = "OTHER";
-static UNCH kconcur[] = "CONCUR";
-static UNCH ksubdoc[] = "SUBDOC";
-static UNCH kformal[] = "FORMAL";
-static UNCH kyes[] = "YES";
-static UNCH kno[] = "NO";
-static UNCH kappinfo[] = "APPINFO";
-static UNCH knone[] = "NONE";
-static UNCH kshunchar[] = "SHUNCHAR";
-static UNCH kcontrols[] = "CONTROLS";
-static UNCH kfunction[] = "FUNCTION";
-static UNCH krs[] = "RS";
-static UNCH kre[] = "RE";
-static UNCH kspace[] = "SPACE";
-static UNCH knaming[] = "NAMING";
-static UNCH klcnmstrt[] = "LCNMSTRT";
-static UNCH kucnmstrt[] = "UCNMSTRT";
-static UNCH klcnmchar[] = "LCNMCHAR";
-static UNCH kucnmchar[] = "UCNMCHAR";
-static UNCH knamecase[] = "NAMECASE";
-static UNCH kdelim[] = "DELIM";
-static UNCH kgeneral[] = "GENERAL";
-static UNCH kentity[] = "ENTITY";
-static UNCH kshortref[] = "SHORTREF";
-static UNCH knames[] = "NAMES";
-static UNCH kquantity[] = "QUANTITY";
-
-#define sderr mderr
-
-static UNIV pmaplookup P((struct pmap *, char *));
-static UNCH *ltous P((long));
-static VOID sdfixstandard P((UNCH *, int));
-static int sdparm P((UNCH *, struct parse *));
-static int sdname P((UNCH *, UNCH *));
-static int sdckname P((UNCH *, UNCH *));
-static int sdversion P((UNCH *));
-static int sdcharset P((UNCH *));
-static int sdcsdesc P((UNCH *, int *));
-static int sdpubcapacity P((UNCH *));
-static int sdcapacity P((UNCH *));
-static int sdscope P((UNCH *));
-static VOID setlexical P((void));
-static VOID noemptytag P((void));
-static int sdpubsyntax P((UNCH *));
-static int sdsyntax P((UNCH *));
-static int sdxsyntax P((UNCH *));
-static int sdtranscharnum P((UNCH *));
-static int sdtranschar P((int));
-static int sdshunchar P((UNCH *));
-static int sdsynref P((UNCH *));
-static int sdfunction P((UNCH *));
-static int sdnaming P((UNCH *));
-static int sddelim P((UNCH *));
-static int sdnames P((UNCH *));
-static int sdquantity P((UNCH *));
-static int sdfeatures P((UNCH *));
-static int sdappinfo P((UNCH *));
-static VOID sdsaverr P((UNS, UNCH *, UNCH *));
-
-static VOID bufsalloc P((void));
-static VOID bufsrealloc P((void));
-
-/* Parse the SGML declaration. Return non-zero if there was some appinfo. */
-
-int sgmldecl()
-{
- int i;
- int errsw = 0;
- UNCH endbuf[REFNAMELEN+2]; /* buffer for parsing terminating > */
- static int (*section[]) P((UNCH *)) = {
- sdversion,
- sdcharset,
- sdcapacity,
- sdscope,
- sdsyntax,
- sdfeatures,
- sdappinfo,
- };
- /* These are needed if we use mderr. */
- parmno = 0;
- mdname = sgmlkey;
- subdcl = NULL;
- nsaved_errs = 0;
- for (i = 0; i < SIZEOF(section); i++)
- if ((*section[i])(tbuf) == FAIL) {
- errsw = 1;
- break;
- }
- if (sd.formal) {
- /* print saved errors */
- int i;
- for (i = 0; i < nsaved_errs; i++)
- svderr(saved_errs[i]);
- }
- else {
- /* free saved errors */
- int i;
- for (i = 0; i < nsaved_errs; i++)
- msgsfree(saved_errs[i]);
- }
-
- if (!errsw)
- setlexical();
- bufsrealloc();
- /* Parse the >. Don't overwrite the appinfo. */
- if (!errsw)
- sdparm(endbuf, 0);
- /* We must exit if we hit end of document. */
- if (pcbsd.action == EOD_)
- exiterr(161, &pcbsd);
- if (!errsw && pcbsd.action != ESGD)
- sderr(126, (UNCH *)0, (UNCH *)0);
- return appinfosw;
-}
-
-/* Parse the literal (which should contain the version of the
-standard) at the beginning of a SGML declaration. */
-
-static int sdversion(tbuf)
-UNCH *tbuf;
-{
- if (sdparm(tbuf, &pcblitv) != LIT1) {
- sderr(123, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- sdfixstandard(tbuf, 0);
- if (ustrcmp(tbuf, standard) != 0)
- sderr(E_BADVERSION, tbuf, standard);
- return SUCCESS;
-}
-
-/* Parse the CHARSET section. Use one token lookahead. */
-
-static int sdcharset(tbuf)
-UNCH *tbuf;
-{
- int i;
- int status[256];
-
- if (sdname(tbuf, kcharset) == FAIL) return FAIL;
- (void)sdparm(tbuf, 0);
-
- if (sdcsdesc(tbuf, status) == FAIL)
- return FAIL;
-
-#if 0
- for (i = 128; i < 256; i++)
- if (status[i] != UNDESC)
- break;
- if (i >= 256) {
- /* Only a 7-bit character set was described. Fill it out to 8-bits. */
- for (i = 128; i < 256; i++)
- status[i] = UNUSED;
-#if 0
- sderr(E_7BIT, (UNCH *)0, (UNCH *)0);
-#endif
- }
-#endif
- /* Characters that are declared UNUSED in the document character set
- are assigned to non-SGML. */
- for (i = 0; i < 256; i++) {
- if (status[i] == UNDESC) {
-#if 0
- sderr(E_CHARMISSING, ltous((long)i), (UNCH *)0);
-#endif
- char_flags[i] |= CHAR_NONSGML;
- }
- else if (status[i] == UNUSED)
- char_flags[i] |= CHAR_NONSGML;
- }
- done_nonsgml = 1;
- return SUCCESS;
-}
-
-/* Parse a character set description. Uses one character lookahead. */
-
-static int sdcsdesc(tbuf, status)
-UNCH *tbuf;
-int *status;
-{
- int i;
- int nsets = 0;
- struct fpi fpi;
-
- for (i = 0; i < 256; i++)
- status[i] = UNDESC;
-
- for (;;) {
- int nchars;
- int *baseset = 0;
-
- if (pcbsd.action != NAS1) {
- if (nsets == 0) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- break;
- }
- if (!matches(tbuf, kbaseset)) {
- if (nsets == 0) {
- sderr(118, tbuf+1, kbaseset);
- return FAIL;
- }
- break;
- }
- nsets++;
- MEMZERO((UNIV)&fpi, FPISZ);
- if (sdparm(tbuf, &pcblitv) != LIT1) {
- sderr(123, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- fpi.fpipubis = tbuf;
- /* Give a warning if it is not a CHARSET fpi. */
- if (parsefpi(&fpi))
- sdsaverr(E_FORMAL, (UNCH *)0, (UNCH *)0);
- else if (fpi.fpic != FPICHARS)
- sdsaverr(E_BADCLASS, kcharset, (UNCH *)0);
- else {
- fpi.fpipubis[fpi.fpil + fpi.fpill] = '\0';
- baseset = (int *)pmaplookup(charset_map,
- (char *)fpi.fpipubis + fpi.fpil);
- if (!baseset)
- sderr(E_UNKNOWNSET, fpi.fpipubis + fpi.fpil, (UNCH *)0);
- }
- if (sdname(tbuf, kdescset) == FAIL) return FAIL;
- nchars = 0;
- for (;;) {
- long start, count;
- long basenum;
- if (sdparm(tbuf, 0) != NUM1)
- break;
- start = atol((char *)tbuf);
- if (sdparm(tbuf, 0) != NUM1) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- count = atol((char *)tbuf);
- switch (sdparm(tbuf, &pcblitv)) {
- case NUM1:
- basenum = atol((char *)tbuf);
- break;
- case LIT1:
- basenum = UNKNOWN;
- break;
- case NAS1:
- if (matches(tbuf, kunused)) {
- basenum = UNUSED;
- break;
- }
- /* fall through */
- default:
- sderr(E_CHARDESC, ltous(start), (UNCH *)0);
- return FAIL;
- }
- if (start + count > 256)
- sderr(E_CHARRANGE, (UNCH *)0, (UNCH *)0);
- else {
- int i;
- int lim = (int)start + count;
- for (i = (int)start; i < lim; i++) {
- if (status[i] != UNDESC)
- sderr(E_CHARDUP, ltous((long)i), (UNCH *)0);
- else if (basenum == UNUSED || basenum == UNKNOWN)
- status[i] = (int)basenum;
- else if (baseset == 0)
- status[i] = UNKNOWN_SET;
- else {
- int n = basenum + (i - start);
- if (n < 0 || n > 255)
- sderr(E_CHARRANGE, (UNCH *)0, (UNCH *)0);
- else {
- if (baseset[n] == UNUSED)
- sderr(E_BADBASECHAR, ltous((long)n),
- (UNCH *)0);
- status[i] = baseset[n];
- }
- }
- }
- }
- nchars++;
- }
- if (nchars == 0) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- }
- return SUCCESS;
-}
-
-/* Parse the CAPACITY section. Uses one token lookahead. */
-
-static int sdcapacity(tbuf)
-UNCH *tbuf;
-{
- int ncap;
- int i;
-
- if (sdckname(tbuf, kcapacity) == FAIL)
- return FAIL;
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, kpublic))
- return sdpubcapacity(tbuf);
- if (!matches(tbuf, ksgmlref)) {
- sderr(E_CAPACITY, tbuf+1, (UNCH *)0);
- return FAIL;
- }
- memcpy((UNIV)sd.capacity, (UNIV)refcapset, sizeof(sd.capacity));
- ncap = 0;
- for (;;) {
- int capno = -1;
- int i;
-
- if (sdparm(tbuf, 0) != NAS1)
- break;
- for (i = 0; i < SIZEOF(captab); i++)
- if (matches(tbuf, captab[i])) {
- capno = i;
- break;
- }
- if (capno < 0)
- break;
- if (sdparm(tbuf, 0) != NUM1) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- sd.capacity[capno] = atol((char *)tbuf);
- ncap++;
- }
- if (ncap == 0) {
- sderr(E_CAPMISSING, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- for (i = 1; i < NCAPACITY; i++)
- if (sd.capacity[i] > sd.capacity[0])
- sderr(E_TOTALCAP, (UNCH *)captab[i], (UNCH *)0);
- return SUCCESS;
-}
-
-/* Parse a CAPACITY section that started with PUBLIC. Must do one
-token lookahead, since sdcapacity() also does. */
-
-static int sdpubcapacity(tbuf)
-UNCH *tbuf;
-{
- UNIV ptr;
- if (sdparm(tbuf, &pcblitv) != LIT1) {
- sderr(123, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- sdfixstandard(tbuf, 1);
- ptr = pmaplookup(capset_map, (char *)tbuf);
- if (!ptr)
- sderr(E_CAPSET, tbuf, (UNCH *)0);
- else
- memcpy((UNIV)sd.capacity, (UNIV)ptr, sizeof(sd.capacity));
- (void)sdparm(tbuf, 0);
- return SUCCESS;
-}
-
-/* Parse the SCOPE section. Uses no lookahead. */
-
-static int sdscope(tbuf)
-UNCH *tbuf;
-{
- if (sdckname(tbuf, kscope) == FAIL)
- return FAIL;
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, kdocument))
- ;
- else if (matches(tbuf, kinstance))
- sderr(E_INSTANCE, (UNCH *)0, (UNCH *)0);
- else {
- sderr(E_SCOPE, tbuf+1, (UNCH *)0);
- return FAIL;
- }
- return SUCCESS;
-}
-
-/* Parse the SYNTAX section. Uses one token lookahead. */
-
-static int sdsyntax(tbuf)
-UNCH *tbuf;
-{
- if (sdname(tbuf, ksyntax) == FAIL) return FAIL;
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, kpublic))
- return sdpubsyntax(tbuf);
- return sdxsyntax(tbuf);
-}
-
-/* Parse the SYNTAX section which starts with PUBLIC. Uses one token
-lookahead. */
-
-static int sdpubsyntax(tbuf)
-UNCH *tbuf;
-{
- int nswitches;
- if (sdparm(tbuf, &pcblitv) != LIT1)
- return FAIL;
- sdfixstandard(tbuf, 1);
- if (ustrcmp(tbuf, CORE_SYNTAX) == 0)
- sd.shortref = 0;
- else if (ustrcmp(tbuf, REFERENCE_SYNTAX) == 0)
- sd.shortref = 1;
- else
- sderr(E_SYNTAX, tbuf, (UNCH *)0);
- if (sdparm(tbuf, 0) != NAS1)
- return SUCCESS;
- if (!matches(tbuf, kswitches))
- return SUCCESS;
- nswitches = 0;
- for (;;) {
- int errsw = 0;
-
- if (sdparm(tbuf, 0) != NUM1)
- break;
- if (atol((char *)tbuf) > 255) {
- sderr(E_CHARNUM, (UNCH *)0, (UNCH *)0);
- errsw = 1;
- }
- if (sdparm(tbuf, 0) != NUM1) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (!errsw) {
- if (atol((char *)tbuf) > 255)
- sderr(E_CHARNUM, (UNCH *)0, (UNCH *)0);
- }
- nswitches++;
- }
- if (nswitches == 0) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- sderr(E_SWITCHES, (UNCH *)0, (UNCH *)0);
- return SUCCESS;
-}
-
-/* Parse an explicit concrete syntax. Uses one token lookahead. */
-
-static
-int sdxsyntax(tbuf)
-UNCH *tbuf;
-{
- static int (*section[]) P((UNCH *)) = {
- sdshunchar,
- sdsynref,
- sdfunction,
- sdnaming,
- sddelim,
- sdnames,
- sdquantity,
- };
- int i;
-
- for (i = 0; i < SIZEOF(section); i++)
- if ((*section[i])(tbuf) == FAIL)
- return FAIL;
- return SUCCESS;
-}
-
-/* Parse the SHUNCHAR section. Uses one token lookahead. */
-
-static
-int sdshunchar(tbuf)
-UNCH *tbuf;
-{
- int i;
- for (i = 0; i < 256; i++)
- char_flags[i] &= ~CHAR_SHUNNED;
-
- if (sdckname(tbuf, kshunchar) == FAIL)
- return FAIL;
-
- if (sdparm(tbuf, 0) == NAS1) {
- if (matches(tbuf, knone)) {
- (void)sdparm(tbuf, 0);
- return SUCCESS;
- }
- if (matches(tbuf, kcontrols)) {
- for (i = 0; i < 256; i++)
- if (ISASCII(i) && iscntrl(i))
- char_flags[i] |= CHAR_SHUNNED;
- if (sdparm(tbuf, 0) != NUM1)
- return SUCCESS;
- }
- }
- if (pcbsd.action != NUM1) {
- sderr(E_SHUNCHAR, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- do {
- long n = atol((char *)tbuf);
- if (n > 255)
- sderr(E_CHARNUM, (UNCH *)0, (UNCH *)0);
- else
- char_flags[(int)n] |= CHAR_SHUNNED;
- } while (sdparm(tbuf, 0) == NUM1);
- return SUCCESS;
-}
-
-/* Parse the syntax reference character set. Uses one token lookahead. */
-
-static
-int sdsynref(tbuf)
-UNCH *tbuf;
-{
- return sdcsdesc(tbuf, synrefcharset);
-}
-
-/* Translate a character number from the syntax reference character set
-to the system character set. If it can't be done, give an error message
-and return -1. */
-
-static
-int sdtranscharnum(tbuf)
-UNCH *tbuf;
-{
- long n = atol((char *)tbuf);
- if (n > 255) {
- sderr(E_CHARNUM, (UNCH *)0, (UNCH *)0);
- return -1;
- }
- return sdtranschar((int)n);
-}
-
-
-static
-int sdtranschar(n)
-int n;
-{
- int ch = synrefcharset[n];
- if (ch >= 0)
- return ch;
- switch (ch) {
- case UNUSED:
- sderr(E_SYNREFUNUSED, ltous((long)n), (UNCH *)0);
- break;
- case UNDESC:
- sderr(E_SYNREFUNDESC, ltous((long)n), (UNCH *)0);
- break;
- case UNKNOWN:
- sderr(E_SYNREFUNKNOWN, ltous((long)n), (UNCH *)0);
- break;
- case UNKNOWN_SET:
- sderr(E_SYNREFUNKNOWNSET, ltous((long)n), (UNCH *)0);
- break;
- default:
- abort();
- }
- return -1;
-}
-
-
-/* Parse the function section. Uses two tokens lookahead. "NAMING"
-could be a function name. */
-
-static
-int sdfunction(tbuf)
-UNCH *tbuf;
-{
- static UNCH *fun[] = { kre, krs, kspace };
- static int funval[] = { RECHAR, RSCHAR, ' ' };
- int i;
- int had_tab = 0;
- int changed = 0; /* attempted to change reference syntax */
-
- if (sdckname(tbuf, kfunction) == FAIL)
- return FAIL;
- for (i = 0; i < SIZEOF(fun); i++) {
- int ch;
- if (sdname(tbuf, fun[i]) == FAIL)
- return FAIL;
- if (sdparm(tbuf, 0) != NUM1) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- ch = sdtranscharnum(tbuf);
- if (ch >= 0 && ch != funval[i])
- changed = 1;
- }
- for (;;) {
- int tabsw = 0;
- int namingsw = 0;
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, (UNCH *)"TAB")) {
- tabsw = 1;
- if (had_tab)
- sderr(E_FUNDUP, (UNCH *)0, (UNCH *)0);
- }
- else {
- for (i = 0; i < SIZEOF(fun); i++)
- if (matches(tbuf, fun[i]))
- sderr(E_BADFUN, fun[i], (UNCH *)0);
- if (matches(tbuf, knaming))
- namingsw = 1;
- else
- changed = 1;
- }
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (namingsw) {
- if (matches(tbuf, klcnmstrt))
- break;
- changed = 1;
- }
- if (sdparm(tbuf, 0) != NUM1) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (tabsw && !had_tab) {
- int ch = sdtranscharnum(tbuf);
- if (ch >= 0 && ch != TABCHAR)
- changed = 1;
- had_tab = 1;
- }
-
- }
- if (!had_tab)
- changed = 1;
- if (changed)
- sderr(E_FUNCHAR, (UNCH *)0, (UNCH *)0);
- return SUCCESS;
-}
-
-/* Parse the NAMING section. Uses no lookahead. */
-
-static
-int sdnaming(tbuf)
-UNCH *tbuf;
-{
- int i;
- int bad = 0;
- static UNCH *classes[] = { klcnmstrt, kucnmstrt, klcnmchar, kucnmchar };
- static UNCH *types[] = { kgeneral, kentity };
-
-#define NCLASSES SIZEOF(classes)
-
- int bufsize = 4; /* allocated size of buf */
- UNCH *buf = (UNCH *)rmalloc(bufsize); /* holds characters
- in naming classes */
- int bufi = 0; /* next index into buf */
- int start[NCLASSES]; /* index of first character for each class */
- int count[NCLASSES]; /* number of characters for each class */
-
- for (i = 0; i < NCLASSES; i++) {
- UNCH *s;
-
- if (sdckname(tbuf, classes[i]) == FAIL) {
- frem((UNIV)buf);
- return FAIL;
- }
- if (sdparm(tbuf, &pcblitp) != LIT1) {
- sderr(123, (UNCH *)0, (UNCH *)0);
- frem((UNIV)buf);
- return FAIL;
- }
- start[i] = bufi;
-
- for (s = tbuf; *s; s++) {
- int c = *s;
- if (c == DELNONCH) {
- c = UNSHIFTNON(*s);
- s++;
- }
- c = sdtranschar(c);
- if (c < 0)
- bad = 1;
- else if ((char_flags[c] & (CHAR_SIGNIFICANT | CHAR_MAGIC))
- && c != '.' && c != '-') {
- int class = lextoke[c];
- if (class == SEP || class == SP || class == NMC
- || class == NMS || class == NU)
- sderr(E_NMBAD, ltous((long)c), (UNCH *)0);
- else
- sderr(E_NMUNSUP, ltous((long)c), (UNCH *)0);
- bad = 1;
- }
- if (bufi >= bufsize)
- buf = (UNCH *)rrealloc((UNIV)buf, bufsize *= 2);
- buf[bufi++] = c;
- }
-
- count[i] = bufi - start[i];
- (void)sdparm(tbuf, 0);
- }
- if (!bad && count[0] != count[1]) {
- sderr(E_NMSTRTCNT, (UNCH *)0, (UNCH *)0);
- bad = 1;
- }
- if (!bad && count[2] != count[3]) {
- sderr(E_NMCHARCNT, (UNCH *)0, (UNCH *)0);
- bad = 1;
- }
- if (!bad) {
- nlextoke = (UNCH *)rmalloc(256);
- memcpy((UNIV)nlextoke, lextoke, 256);
- nlextoke['.'] = nlextoke['-'] = INV;
-
- nlextran = (UNCH *)rmalloc(256);
- memcpy((UNIV)nlextran, lextran, 256);
-
- for (i = 0; i < count[0]; i++) {
- UNCH lc = buf[start[0] + i];
- UNCH uc = buf[start[1] + i];
- nlextoke[lc] = NMS;
- 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];
- if (nlextoke[lc] == NMS) {
- sderr(E_NMDUP, ltous((long)lc), (UNCH *)0);
- bad = 1;
- }
- else if (nlextoke[uc] == NMS) {
- sderr(E_NMDUP, ltous((long)uc), (UNCH *)0);
- bad = 1;
- }
- else {
- nlextoke[lc] = NMC;
- nlextoke[uc] = NMC;
- nlextran[lc] = uc;
- }
- }
- if (nlextoke['-'] != NMC) {
- sderr(E_NMMINUS, (UNCH *)0, (UNCH *)0);
- bad = 1;
- }
- if (bad) {
- if (nlextoke) {
- frem((UNIV)nlextoke);
- nlextoke = 0;
- }
- if (nlextran) {
- frem((UNIV)nlextran);
- nlextran = 0;
- }
- }
- }
-
- frem((UNIV)buf);
-
- if (sdckname(tbuf, knamecase) == FAIL)
- return FAIL;
- for (i = 0; i < SIZEOF(types); ++i) {
- if (sdname(tbuf, types[i]) == FAIL)
- return FAIL;
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, kyes))
- sd.namecase[i] = 1;
- else if (matches(tbuf, kno))
- sd.namecase[i] = 0;
- else {
- sderr(E_YESNO, tbuf+1, (UNCH *)0);
- return FAIL;
- }
- }
- return SUCCESS;
-}
-
-/* Parse the DELIM section. Uses one token lookahead. */
-
-static
-int sddelim(tbuf)
-UNCH *tbuf;
-{
- int changed = 0;
- if (sdname(tbuf, kdelim) == FAIL
- || sdname(tbuf, kgeneral) == FAIL
- || sdname(tbuf, ksgmlref) == FAIL)
- return FAIL;
- for (;;) {
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, kshortref))
- break;
- if (sdparm(tbuf, &pcblitp) != LIT1) {
- sderr(123, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- changed = 1;
- }
- if (changed) {
- sderr(E_GENDELIM, (UNCH *)0,(UNCH *)0);
- changed = 0;
- }
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, ksgmlref))
- sd.shortref = 1;
- else if (matches(tbuf, knone))
- sd.shortref = 0;
- else {
- sderr(118, tbuf+1, ksgmlref); /* probably they forgot SGMLREF */
- return FAIL;
- }
- while (sdparm(tbuf, &pcblitp) == LIT1)
- changed = 1;
- if (changed)
- sderr(E_SRDELIM, (UNCH *)0, (UNCH *)0);
- return SUCCESS;
-}
-
-/* Parse the NAMES section. Uses one token lookahead. */
-
-static
-int sdnames(tbuf)
-UNCH *tbuf;
-{
- int i;
- if (sdckname(tbuf, knames) == FAIL)
- return FAIL;
- if (sdname(tbuf, ksgmlref) == FAIL)
- return FAIL;
-
- while (sdparm(tbuf, 0) == NAS1) {
- int j;
- if (matches(tbuf, kquantity))
- break;
- for (i = 0; i < NKEYS; i++)
- if (matches(tbuf, key[i]))
- break;
- if (i >= NKEYS) {
- sderr(E_BADKEY, tbuf+1, (UNCH *)0);
- return FAIL;
- }
- if (sdparm(tbuf, &pcblitp) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (!newkey) {
- newkey = (UNCH (*)[REFNAMELEN+1])rmalloc((REFNAMELEN+1)*NKEYS);
- MEMZERO((UNIV)newkey, (REFNAMELEN+1)*NKEYS);
- }
- for (j = 0; j < NKEYS; j++) {
- if (matches(tbuf, key[j])) {
- sderr(E_REFNAME, tbuf + 1, (UNCH *)0);
- break;
- }
- if (matches(tbuf, newkey[j])) {
- sderr(E_DUPNAME, tbuf + 1, (UNCH *)0);
- break;
- }
- }
- if (j >= NKEYS)
- ustrcpy(newkey[i], tbuf + 1);
- }
- /* Now install the new keys. */
- if (newkey) {
- 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);
- }
- }
- return SUCCESS;
-}
-
-/* Parse the QUANTITY section. Uses one token lookahead. */
-
-static int sdquantity(tbuf)
-UNCH *tbuf;
-{
- int quantity[NQUANTITY];
- int i;
-
- for (i = 0; i < NQUANTITY; i++)
- quantity[i] = -1;
- if (sdckname(tbuf, kquantity) == FAIL)
- return FAIL;
- if (sdname(tbuf, ksgmlref) == FAIL)
- return FAIL;
- while (sdparm(tbuf, 0) == NAS1 && !matches(tbuf, kfeatures)) {
- long n;
- for (i = 0; i < SIZEOF(quantity_names); i++)
- if (matches(tbuf, quantity_names[i]))
- break;
- if (i >= SIZEOF(quantity_names)) {
- sderr(E_BADQUANTITY, tbuf + 1, (UNCH *)0);
- return FAIL;
- }
- if (sdparm(tbuf, 0) != NUM1) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- n = atol((char *)tbuf);
- if (n < sd.quantity[i])
- sderr(E_QUANTITY, (UNCH *)quantity_names[i],
- ltous((long)sd.quantity[i]));
- else if (n > max_quantity[i]) {
- sderr(E_QTOOBIG, (UNCH *)quantity_names[i],
- ltous((long)max_quantity[i]));
- quantity[i] = max_quantity[i];
- }
- else
- quantity[i] = (int)n;
- }
- for (i = 0; i < NQUANTITY; i++)
- if (quantity[i] > 0) {
- sd.quantity[i] = quantity[i];
- if (!quantity_changed)
- quantity_changed = (char *)rmalloc(NQUANTITY);
- quantity_changed[i] = 1;
- }
- return SUCCESS;
-}
-
-/* Parse the FEATURES section. Uses no lookahead. */
-
-static int sdfeatures(tbuf)
-UNCH *tbuf;
-{
- static struct {
- UNCH *name;
- UNCH argtype; /* 0 = no argument, 1 = boolean, 2 = numeric */
- UNIV valp; /* UNCH * if boolean, long * if numeric. */
- } features[] = {
- { kminimize, 0, 0 },
- { kdatatag, 1, 0 },
- { komittag, 1, (UNIV)&sd.omittag },
- { krank, 1, 0 },
- { kshorttag, 1, (UNIV)&sd.shorttag },
- { klink, 0, 0 },
- { ksimple, 2, 0 },
- { kimplicit, 1, 0 },
- { kexplicit, 2, 0 },
- { kother, 0, 0 },
- { kconcur, 2, 0 },
- { ksubdoc, 2, (UNIV)&sd.subdoc },
- { kformal, 1, (UNIV)&sd.formal },
- };
-
- int i;
-
- if (sdckname(tbuf, kfeatures) == FAIL)
- return FAIL;
- for (i = 0; i < SIZEOF(features); i++) {
- if (sdname(tbuf, features[i].name) == FAIL) return FAIL;
- if (features[i].argtype > 0) {
- long n;
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (matches(tbuf, kyes)) {
- if (features[i].argtype > 1) {
- if (sdparm(tbuf, 0) != NUM1) {
- sderr(E_XNUM, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- n = atol((char *)tbuf);
- if (n == 0)
- sderr(E_ZEROFEATURE, features[i].name, (UNCH *)0);
- }
- else
- n = 1;
- }
- else if (matches(tbuf, kno))
- n = 0;
- else {
- sderr(E_YESNO, tbuf+1, (UNCH *)0);
- return FAIL;
- }
- if (features[i].valp == 0) {
- if (n > 0)
- sderr(E_NOTSUPPORTED, features[i].name,
- (UNCH *)0);
- }
- else if (features[i].argtype > 1)
- *(long *)features[i].valp = n;
- else
- *(UNCH *)features[i].valp = (UNCH)n;
- }
- }
- if (!sd.shorttag)
- noemptytag();
- return SUCCESS;
-}
-
-/* Parse the APPINFO section. Uses no lookahead. */
-
-static int sdappinfo(tbuf)
-UNCH *tbuf;
-{
- if (sdname(tbuf, kappinfo) == FAIL) return FAIL;
- switch (sdparm(tbuf, &pcblitv)) {
- case LIT1:
- appinfosw = 1;
- break;
- case NAS1:
- if (matches(tbuf, knone))
- break;
- sderr(118, tbuf+1, knone);
- return FAIL;
- default:
- sderr(E_XNMLIT, knone, (UNCH *)0);
- return FAIL;
- }
- return SUCCESS;
-}
-
-/* Change a prefix of ISO 8879-1986 to ISO 8879:1986. Amendment 1 to
-the standard requires the latter. */
-
-static VOID sdfixstandard(tbuf, silently)
-UNCH *tbuf;
-int silently;
-{
- if (strncmp((char *)tbuf, "ISO 8879-1986", 13) == 0) {
- if (!silently)
- sderr(E_STANDARD, (UNCH *)0, (UNCH *)0);
- tbuf[8] = ':';
- }
-}
-
-static int sdname(tbuf, key)
-UNCH *tbuf;
-UNCH *key;
-{
- if (sdparm(tbuf, 0) != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (!matches(tbuf, key)) {
- sderr(118, tbuf+1, key);
- return FAIL;
- }
- return SUCCESS;
-}
-
-static int sdckname(tbuf, key)
-UNCH *tbuf;
-UNCH *key;
-{
- if (pcbsd.action != NAS1) {
- sderr(120, (UNCH *)0, (UNCH *)0);
- return FAIL;
- }
- if (!matches(tbuf, key)) {
- sderr(118, tbuf+1, key);
- return FAIL;
- }
- return SUCCESS;
-}
-
-/* Parse a SGML declaration parameter. If lpcb is NULL, pt must be
-REFNAMELEN+2 characters long, otherwise at least LITLEN+2 characters
-long. LPCB should be NULL if a literal is not allowed. */
-
-static int sdparm(pt, lpcb)
-UNCH *pt; /* Token buffer. */
-struct parse *lpcb; /* PCB for literal parse. */
-{
- for (;;) {
- parse(&pcbsd);
- if (pcbsd.action != ISIG)
- break;
- sderr(E_SIGNIFICANT, (UNCH *)0, (UNCH *)0);
- }
- ++parmno;
- switch (pcbsd.action) {
- case LIT1:
- if (!lpcb) {
- sderr(E_BADLIT, (UNCH *)0, (UNCH *)0);
- REPEATCC;
- return pcbsd.action = INV_;
- }
- parselit(pt, lpcb, REFLITLEN, lex.d.lit);
- return pcbsd.action;
- case LIT2:
- if (!lpcb) {
- sderr(E_BADLIT, (UNCH *)0, (UNCH *)0);
- REPEATCC;
- return pcbsd.action = INV_;
- }
- parselit(pt, lpcb, REFLITLEN, lex.d.lita);
- return pcbsd.action = LIT1;
- case NAS1:
- parsenm(pt, 1);
- return pcbsd.action;
- case NUM1:
- parsetkn(pt, NU, REFNAMELEN);
- return pcbsd.action;
- }
- return pcbsd.action;
-}
-
-VOID sdinit()
-{
- int i;
- /* Shunned character numbers in the reference concrete syntax. */
- 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
- };
- UNCH **p;
- /* A character is magic if it is a non-SGML character used for
- some internal purpose in the parser. */
- char_flags[EOS] |= CHAR_MAGIC;
- char_flags[EOBCHAR] |= CHAR_MAGIC;
- char_flags[EOFCHAR] |= CHAR_MAGIC;
- char_flags[GENRECHAR] |= CHAR_MAGIC;
- char_flags[DELNONCH] |= CHAR_MAGIC;
- char_flags[DELCDATA] |= CHAR_MAGIC;
- char_flags[DELSDATA] |= CHAR_MAGIC;
-
- /* Figure out the significant SGML characters. */
- for (p = lextabs; *p; p++) {
- UNCH datclass = (*p)[CANON_DATACHAR];
- UNCH nonclass = (*p)[CANON_NONSGML];
- for (i = 0; i < 256; i++)
- if (!(char_flags[i] & CHAR_MAGIC)
- && (*p)[i] != datclass && (*p)[i] != nonclass)
- char_flags[i] |= CHAR_SIGNIFICANT;
- }
- for (i = 0; i < SIZEOF(refshun); i++)
- char_flags[refshun[i]] |= CHAR_SHUNNED;
- for (i = 0; i < 256; i++)
- if (ISASCII(i) && iscntrl(i))
- char_flags[i] |= CHAR_SHUNNED;
- bufsalloc();
-}
-
-
-static
-VOID bufsalloc()
-{
- scbs = (struct source *)rmalloc((REFENTLVL+1)*sizeof(struct source));
- tbuf = (UNCH *)rmalloc(REFATTSPLEN+REFLITLEN+1);
- /* entbuf is used for parsing numeric character references */
- entbuf = (UNCH *)rmalloc(REFNAMELEN + 2);
-}
-
-static
-VOID bufsrealloc()
-{
- UNS size;
-
- if (ENTLVL != REFENTLVL)
- scbs = (struct source *)rrealloc((UNIV)scbs,
- (ENTLVL+1)*sizeof(struct source));
- /* Calculate the size for tbuf. */
- size = LITLEN + ATTSPLEN;
- if (PILEN > size)
- size = PILEN;
- if (BSEQLEN > size)
- size = BSEQLEN;
- if (size != REFATTSPLEN + REFLITLEN)
- tbuf = (UNCH *)rrealloc((UNIV)tbuf, size + 1);
- if (NAMELEN != REFNAMELEN)
- entbuf = (UNCH *)rrealloc((UNIV)entbuf, NAMELEN + 2);
-}
-
-
-/* Check that the non-SGML characters are compatible with the concrete
-syntax and munge the lexical tables accordingly. If IMPLIED is
-non-zero, then the SGML declaration was implied; in this case, don't
-give error messages about shunned characters not being declared
-non-SGML. Also make any changes that are required by the NAMING section.
-*/
-
-static VOID setlexical()
-{
- int i;
- UNCH **p;
-
- if (nlextoke) {
- /* Handle characters that were made significant by the
- NAMING section. */
- for (i = 0; i < 256; i++)
- if (nlextoke[i] == NMC || nlextoke[i] == NMS)
- char_flags[i] |= CHAR_SIGNIFICANT;
- }
-
- for (i = 0; i < 256; i++)
- if (char_flags[i] & CHAR_SIGNIFICANT) {
- /* Significant SGML characters musn't be non-SGML. */
- if (char_flags[i] & CHAR_NONSGML) {
- UNCH buf[2];
- buf[0] = i;
- buf[1] = '\0';
- sderr(E_NONSGML, buf, (UNCH *)0);
- char_flags[i] &= ~CHAR_NONSGML;
- }
- }
- else {
- /* Shunned characters that are not significant SGML characters
- must be non-SGML. */
- if ((char_flags[i] & (CHAR_SHUNNED | CHAR_NONSGML))
- == CHAR_SHUNNED) {
- sderr(E_SHUNNED, ltous((long)i), (UNCH *)0);
- char_flags[i] |= CHAR_NONSGML;
- }
- }
-
-
- /* Now munge the lexical tables. */
- for (p = lextabs; *p; p++) {
- UNCH nonclass = (*p)[CANON_NONSGML];
- UNCH datclass = (*p)[CANON_DATACHAR];
- UNCH nmcclass = (*p)[CANON_NMC];
- UNCH nmsclass = (*p)[CANON_NMS];
- UNCH minclass = (*p)[CANON_MIN];
- for (i = 0; i < 256; i++) {
- if (char_flags[i] & CHAR_NONSGML) {
- /* We already know that it's not significant. */
- if (!(char_flags[i] & CHAR_MAGIC))
- (*p)[i] = nonclass;
- }
- else {
- if (char_flags[i] & CHAR_MAGIC) {
- sderr(E_MUSTBENON, ltous((long)i), (UNCH *)0);
- }
- else if (!(char_flags[i] & CHAR_SIGNIFICANT))
- (*p)[i] = datclass;
- else if (*p == lexmin) {
- /* If it used to be NONSGML, but its now significant,
- treat it like a datachar. */
- if ((*p)[i] == nonclass)
- (*p)[i] = datclass;
- }
- else if (nlextoke
- /* This relies on the fact that lextoke
- occurs last in lextabs. */
- && lextoke[i] != nlextoke[i]) {
- switch (nlextoke[i]) {
- case NMC:
- (*p)[i] = nmcclass;
- break;
- case NMS:
- (*p)[i] = nmsclass;
- break;
- case INV:
- /* This will happen if period is not a
- name character. */
- (*p)[i] = minclass;
- break;
- default:
- abort();
- }
- }
- }
- }
- }
- if (nlextran) {
- memcpy((UNIV)lextran, (UNIV)nlextran, 256);
- frem((UNIV)nlextran);
- }
- if (nlextoke) {
- frem((UNIV)nlextoke);
- nlextoke = 0;
- }
-
-}
-
-/* Munge parse tables so that empty start and end tags are not recognized. */
-
-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;
- UNCH *plex = pcbs[i]->plex;
- UNCH **ptab = pcbs[i]->ptab;
-
- /* Figure out the maximum lexical class. */
- maxclass = 0;
- for (j = 0; j < 256; j++)
- if (plex[j] > maxclass)
- maxclass = plex[j];
-
- /* Now figure out the maximum state number and at the same time
- change actions. */
-
- maxstate = 0;
-
- for (j = 0; j <= maxstate; j += 2) {
- for (k = 0; k <= maxclass; k++)
- if (ptab[j][k] > maxstate)
- maxstate = ptab[j][k];
- /* If the '>' class has an empty start or end tag action,
- change it to the action that the NMC class has. */
- act = ptab[j + 1][plex['>']];
- if (act == NET_ || act == NST_)
- ptab[j + 1][plex['>']] = ptab[j + 1][plex['_']];
- }
- }
-}
-
-/* Lookup the value of the entry in pmap PTR whose key is KEY. */
-
-static UNIV pmaplookup(ptr, key)
-struct pmap *ptr;
-char *key;
-{
- for (; ptr->name; ptr++)
- if (strcmp(key, ptr->name) == 0)
- return ptr->value;
- return 0;
-}
-
-/* Return an ASCII representation of N. */
-
-static UNCH *ltous(n)
-long n;
-{
- static char buf[sizeof(long)*3 + 2];
- sprintf(buf, "%ld", n);
- return (UNCH *)buf;
-}
-
-VOID sgmlwrsd(fp)
-FILE *fp;
-{
- int i;
- int changed;
- char *p;
- char uc[256]; /* upper case characters (with different lower
- case characters) */
- char lcletter[256]; /* LC letters: a-z */
-
- fprintf(fp, "<!SGML \"%s\"\n", standard);
- fprintf(fp,
- "CHARSET\nBASESET \"-//Dummy//CHARSET Dummy//%s\"\nDESCSET\n",
- SYSTEM_CHARSET_DESIGNATING_SEQUENCE);
-
- if (!done_nonsgml) {
- done_nonsgml = 1;
- for (i = 0; i < 256; i++)
- if ((char_flags[i] & (CHAR_SIGNIFICANT | CHAR_SHUNNED))
- == CHAR_SHUNNED)
- char_flags[i] |= CHAR_NONSGML;
- }
- i = 0;
- while (i < 256) {
- int j;
- for (j = i + 1; j < 256; j++)
- if ((char_flags[j] & CHAR_NONSGML)
- != (char_flags[i] & CHAR_NONSGML))
- break;
- if (char_flags[i] & CHAR_NONSGML)
- fprintf(fp, "%d %d UNUSED\n", i, j - i);
- else
- fprintf(fp, "%d %d %d\n", i, j - i, i);
- i = j;
- }
- fprintf(fp, "CAPACITY\n");
- changed = 0;
- for (i = 0; i < NCAPACITY; i++)
- if (refcapset[i] != sd.capacity[i]) {
- if (!changed) {
- fprintf(fp, "SGMLREF\n");
- changed = 1;
- }
- fprintf(fp, "%s %ld\n", captab[i], sd.capacity[i]);
- }
- 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)
- break;
- if (i == 256)
- fprintf(fp, " NONE\n");
- else {
- for (; i < 256; i++)
- if (char_flags[i] & CHAR_SHUNNED)
- fprintf(fp, " %d", i);
- fprintf(fp, "\n");
- }
-
- fprintf(fp,
- "BASESET \"-//Dummy//CHARSET Dummy//%s\"\nDESCSET 0 256 0\n",
- SYSTEM_CHARSET_DESIGNATING_SEQUENCE);
-
- fprintf(fp, "FUNCTION\nRE %d\nRS %d\nSPACE %d\nTAB SEPCHAR %d\n",
- RECHAR, RSCHAR, ' ', TABCHAR);
-
- MEMZERO((UNIV)uc, 256);
- for (i = 0; i < 256; i++)
- if (lextran[i] != i)
- uc[lextran[i]] = 1;
-
- MEMZERO((UNIV)lcletter, 256);
- for (p = "abcdefghijklmnopqrstuvwxyz"; *p; p++)
- lcletter[(unsigned char)*p]= 1;
-
- fprintf(fp, "NAMING\n");
- fputs("LCNMSTRT \"", fp);
- for (i = 0; i < 256; i++)
- if (lextoke[i] == NMS && !uc[i] && !lcletter[i])
- fprintf(fp, "&#%d;", i);
- fputs("\"\n", fp);
- fputs("UCNMSTRT \"", fp);
- for (i = 0; i < 256; i++)
- if (lextoke[i] == NMS && !uc[i] && !lcletter[i])
- fprintf(fp, "&#%d;", lextran[i]);
- fputs("\"\n", fp);
- fputs("LCNMCHAR \"", fp);
- for (i = 0; i < 256; i++)
- if (lextoke[i] == NMC && !uc[i])
- fprintf(fp, "&#%d;", i);
- fputs("\"\n", fp);
- fputs("UCNMCHAR \"", fp);
- for (i = 0; i < 256; i++)
- if (lextoke[i] == NMC && !uc[i])
- fprintf(fp, "&#%d;", lextran[i]);
- fputs("\"\n", fp);
-
- fprintf(fp, "NAMECASE\nGENERAL %s\nENTITY %s\n",
- sd.namecase[0] ? "YES" : "NO",
- sd.namecase[1] ? "YES" : "NO");
- fprintf(fp, "DELIM\nGENERAL SGMLREF\nSHORTREF %s\n",
- sd.shortref ? "SGMLREF" : "NONE");
- fprintf(fp, "NAMES SGMLREF\n");
- if (newkey) {
- /* The reference key was saved in newkey. */
- for (i = 0; i < NKEYS; i++)
- if (newkey[i][0])
- fprintf(fp, "%s %s\n", newkey[i], key[i]);
- }
- fprintf(fp, "QUANTITY SGMLREF\n");
- if (quantity_changed)
- for (i = 0; i < NQUANTITY; i++)
- if (quantity_changed[i])
- fprintf(fp, "%s %d\n", quantity_names[i], sd.quantity[i]);
- fprintf(fp,
- "FEATURES\nMINIMIZE\nDATATAG NO OMITTAG %s RANK NO SHORTTAG %s\n",
- sd.omittag ? "YES" : "NO",
- sd.shorttag ? "YES" : "NO");
- fprintf(fp, "LINK SIMPLE NO IMPLICIT NO EXPLICIT NO\n");
- fprintf(fp, "OTHER CONCUR NO ");
- if (sd.subdoc > 0)
- fprintf(fp, "SUBDOC YES %ld ", sd.subdoc);
- else
- fprintf(fp, "SUBDOC NO ");
- fprintf(fp, "FORMAL %s\n", sd.formal ? "YES" : "NO");
- fprintf(fp, "APPINFO NONE");
- fprintf(fp, ">\n");
-}
-
-/* Save an error to be printed only if FORMAL is declared as YES. */
-
-static
-VOID sdsaverr(number, parm1, parm2)
-UNS number;
-UNCH *parm1;
-UNCH *parm2;
-{
- saved_errs[nsaved_errs++] = savmderr(number, parm1, parm2);
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/sgmldecl.h b/usr.bin/sgmls/sgmls/sgmldecl.h
deleted file mode 100644
index 1111f72..0000000
--- a/usr.bin/sgmls/sgmls/sgmldecl.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* 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 QNAMELEN 10
-#define QNORMSEP 11
-#define QPILEN 12
-#define QTAGLEN 13
-#define QTAGLVL 14
-
-#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 NOTCAP 10
-#define NOTCHCAP 11
-#define IDCAP 12
-#define IDREFCAP 13
-#define MAPCAP 14
-#define LKSETCAP 15
-#define LKNMCAP 16
-
-extern char *captab[];
-
-struct sgmldecl {
- long capacity[NCAPACITY];
- long subdoc;
- UNCH formal;
- UNCH omittag;
- UNCH shorttag;
- UNCH shortref;
- UNCH namecase[2]; /* case translation of general/entity names */
- int quantity[NQUANTITY];
-};
-
-extern struct sgmldecl sd;
-
-#define OMITTAG (sd.omittag)
-#define SUBDOC (sd.subdoc)
-#define SHORTTAG (sd.shorttag)
-#define FORMAL (sd.formal)
-
-#define ATTCNT (sd.quantity[QATTCNT])
-#define ATTSPLEN (sd.quantity[QATTSPLEN])
-#define BSEQLEN (sd.quantity[QBSEQLEN])
-#define ENTLVL (sd.quantity[QENTLVL])
-#define GRPGTCNT (sd.quantity[QGRPGTCNT])
-#define GRPCNT (sd.quantity[QGRPCNT])
-#define GRPLVL (sd.quantity[QGRPLVL])
-#define LITLEN (sd.quantity[QLITLEN])
-#define NAMELEN (sd.quantity[QNAMELEN])
-#define NORMSEP (sd.quantity[QNORMSEP])
-#define PILEN (sd.quantity[QPILEN])
-#define TAGLEN (sd.quantity[QTAGLEN])
-#define TAGLVL (sd.quantity[QTAGLVL])
-
-#define NAMECASE (sd.namecase[0])
-#define ENTCASE (sd.namecase[1])
-
-#define YES 1
-#define NO 0
-
-#define UNUSED -1
-#define UNKNOWN -2
-#define UNDESC -3
-#define UNKNOWN_SET -4
-
-extern int iso646charset[];
-extern int iso646G0charset[];
-extern int iso646C0charset[];
-extern int iso8859_1charset[];
-extern int iso6429C1charset[];
-
-
diff --git a/usr.bin/sgmls/sgmls/sgmlfnsm.h b/usr.bin/sgmls/sgmls/sgmlfnsm.h
deleted file mode 100644
index 3003d67..0000000
--- a/usr.bin/sgmls/sgmls/sgmlfnsm.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* SGMLFNSM.H: SGML function declarations (ANSI prototypes). */
-VOID adlfree P((struct ad *, int));
-VOID adlval P((int,struct etd *));
-VOID aenttst P((int, UNCH *));
-int allhit P((struct thdr *,unsigned long *,int,int));
-VOID ambig P((void));
-VOID ambigfree P((void));
-int amemget P((struct ad *,int,UNCH *));
-int anmget P((int,UNCH *));
-int anmtgrp P((struct parse *,struct ad *,int,UNS *,int));
-int antvget P((int,UNCH *,UNCH **));
-int anyhit P((unsigned long *));
-int attval P((int,UNCH *,int,struct ad *));
-VOID charrefa P((UNCH *));
-int charrefn P((UNCH *, struct parse *));
-int context P((struct etd *,struct thdr *,struct mpos *,UNCH *,int));
-struct etd **copygrp P((struct etd **,unsigned int));
-int datachar P((int, struct parse *));
-struct dcncb *dcnfind P((UNCH *));
-VOID destack P((void));
-int econtext P((struct thdr *,struct mpos *,UNCH *));
-VOID endprolog P((void));
-struct entity *entfind P((UNCH *));
-int entopen P((struct entity *));
-/* VOID eposset P((void)); NOT YET IN USE. */
-VOID error P((struct error *));
-VOID errorinit P((struct error *, unsigned, unsigned));
-int etag P((void));
-int etagetd P((struct parse *));
-VOID etdadl P((struct etd *));
-VOID etdcan P((UNCH *));
-struct etd *etddef P((UNCH *));
-struct etd *etdref P((UNCH *));
-VOID exclude P((void));
-VOID fileclos P((void));
-VOID filecont P((void));
-VOID fileopen P((void));
-VOID filepend P((int));
-VOID fileread P((void));
-VOID filerr P((unsigned, UNCH *));
-VOID fixdatt P((struct dcncb *));
-struct parse *getpcb P((int));
-int groupopt P((struct thdr *,struct mpos *));
-int groupreq P((struct etd *,struct thdr *,struct mpos *));
-int grpsz P((struct thdr *,int));
-int hash P((UNCH *,int));
-struct hash *hfind P((struct hash **,UNCH *,int));
-struct hash *hin P((struct hash **,UNCH *,int,unsigned int));
-int iddef P((UNCH *));
-VOID idrck P((void));
-struct fwdref *idref P((UNCH *));
-VOID idreftst P((int,UNCH *));
-int ingrp P((struct etd **,struct etd *));
-VOID initatt P((struct ad *));
-int mapsrch P((struct map *,UNCH *));
-VOID mdadl P((UNCH *));
-int mdattdef P((int, int));
-VOID mddtde P((UNCH *));
-VOID mddtds P((UNCH *));
-VOID mdelem P((UNCH *));
-VOID mdentity P((UNCH *));
-VOID mderr P((unsigned int,UNCH *,UNCH *));
-struct parse *mdms P((UNCH *,struct parse *));
-int mdmse P((void));
-VOID mdnadl P((UNCH *));
-VOID mdnot P((UNCH *));
-VOID mdsrmdef P((UNCH *));
-VOID mdsrmuse P((UNCH *));
-int netetd P((struct parse *));
-VOID newtoken P((struct thdr *,struct mpos *,UNCH *));
-int nstetd P((void));
-UNCH *ntoa P((int));
-int offbit P((unsigned long *,int,int));
-int parsecon P((UNCH *,struct parse *));
-int parsefpi P((struct fpi *));
-struct thdr *parsegcm P((struct parse *,struct thdr *,struct thdr *));
-VOID parselit P((UNCH *,struct parse *,unsigned int,UNCH));
-struct thdr *parsemod P((int));
-int parsepro P((void));
-VOID parseseq P((UNCH *,int));
-VOID parsetag P((struct parse *));
-int parseval P((UNCH *,unsigned int,UNCH *));
-int pexmex P((struct etd *));
-unsigned int ptrsrch P((UNIV *,UNIV));
-UNCH *pubfield P((UNCH *,UNCH *,UNCH,UNS *));
-UNCH *replace P((UNCH *,UNCH *));
-UNCH *sandwich P((UNCH *,UNCH *,UNCH *));
-UNIV saverr P((unsigned int,struct parse *,UNCH *,UNCH *));
-UNIV savmderr P((unsigned int,UNCH *,UNCH *));
-VOID scbset P((void));
-VOID sdinit P((void));
-VOID setcurchar P((int));
-VOID setdtype P((void));
-int sgmlact P((UNCH));
-int sgmldecl P((void));
-VOID sgmlerr P((unsigned int,struct parse *,UNCH *,UNCH *));
-int shortref P((int,struct parse *));
-struct srh *srhfind P((UNCH *));
-VOID stack P((struct etd *));
-int stag P((int));
-int stagetd P((struct parse *));
-VOID startdtd P((void));
-UNCH *savenm P((UNCH *));
-UNCH *savestr P((UNCH *));
-VOID storedatt P((PNE));
-VOID svderr P((UNIV));
-VOID synerr P((unsigned int,struct parse *));
-int testend P((struct thdr *,struct mpos *,int,int));
-int tokenopt P((struct thdr *,struct mpos *));
-int tokenreq P((struct etd *,struct thdr *,struct mpos *));
-UNS vallen P((int,int,UNCH *));
-struct dcncb *dcndef P((UNCH *));
-struct entity *entdef P((UNCH *,UNCH,union etext *));
-int entget P((void));
-int entref P((UNCH *));
-struct etd *etdset P((struct etd *,UNCH,struct thdr *,struct etd **,
- struct etd **, struct entity **));
-struct hash *hout P((struct hash **,UNCH *,int));
-struct fpi *mdextid P((UNCH *,struct fpi *,UNCH *,UNCH *,struct ne *));
-int parse P((struct parse *));
-struct ad *parseatt P((struct ad *,UNCH *));
-unsigned int parsegrp P((struct etd **,struct parse *, UNCH *));
-unsigned int parsngrp P((struct dcncb **,struct parse *, UNCH *));
-int parsemd P((UNCH *,int,struct parse *,unsigned int));
-UNCH *parsenm P((UNCH *,int));
-UNCH *parsetkn P((UNCH *,UNCH,int));
-UNCH *s2valnm P((UNCH *,UNCH *,UNCH,int));
-struct srh *srhdef P((UNCH *));
-int tokdata P((UNCH *, int));
-struct entity *usedef P((UNCH *));
diff --git a/usr.bin/sgmls/sgmls/sgmlincl.h b/usr.bin/sgmls/sgmls/sgmlincl.h
deleted file mode 100644
index c4eb5cc..0000000
--- a/usr.bin/sgmls/sgmls/sgmlincl.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* SGMLINCL.H: Include file for parser core. */
-#ifndef SGMLINCL /* Don't include this file more than once. */
-#define SGMLINCL 1
-#include "config.h"
-#include "std.h"
-#include "entity.h" /* Templates for entity control blocks. */
-#include "action.h" /* Action names for all parsing. */
-#include "adl.h" /* Definitions for attribute list processing. */
-#include "error.h" /* Symbols for error codes. */
-#include "etype.h" /* Definitions for element type processing. */
-#include "keyword.h" /* Definitions for keyword processing. */
-#include "lextoke.h" /* Symbols for tokenization lexical classes. */
-#include "source.h" /* Templates for source entity control blocks. */
-#include "synxtrn.h" /* Declarations for concrete syntax constants. */
-#include "sgmlxtrn.h" /* External variable declarations. */
-#include "trace.h" /* Declarations for internal trace functions. */
-#include "sgmlmain.h"
-#include "sgmlaux.h"
-#include "sgmlfnsm.h" /* ANSI C: Declarations for SGML functions. */
-#endif /* ndef SGMLINCL */
diff --git a/usr.bin/sgmls/sgmls/sgmlio.c b/usr.bin/sgmls/sgmls/sgmlio.c
deleted file mode 100644
index c78bb7a..0000000
--- a/usr.bin/sgmls/sgmls/sgmlio.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/* sgmlio.c -
- IO functions for core parser.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-/* SGML must see a file in which records start with RS and end with
- RE, and EOFCHAR (Ctl-Z) is present at the end. This module must
- supply these characters if they are not naturally present in the
- file. SGML will open two files at a time: when an entity is
- nested, the new file is opened before closing the old in order to
- make sure the open is successful. If it is, the original open file
- is closed temporarily (IOPEND); when the stack is popped, the new
- file is closed and the original file is re-opened (IOCONT). SGML
- will check error returns for the initial open of a file and all
- reads, and for re-openings when the stack is popped, but not for
- closes. Returning <0 indicates an error; 0 or more is a successful
- operation, except for IOREAD where the return value is the number
- of characters read, and must exceed 0 to be successful. The first
- READ must always be successful, and normally consists of just
- priming the buffer with EOBCHAR (or RS EOBCHAR). SGMLIO must
- assure that there is an EOBCHAR at the end of each block read,
- except for the last block of the entity, which must have an
- EOFCHAR.
-
- SGML views an entity as a contiguous whole, without regard to its
- actual form of storage. SGMLIO supports entities that are
- equivalent to a single file of one or more records, or to a
- concatenation of files.
-*/
-
-/* Uses only stream I/O. This module should be portable to most ANSI
- systems. */
-/* We try to ensure that if an IO operation fails, then errno will contain
- a meaningful value (although it may be zero.) */
-
-#include "config.h"
-#ifdef HAVE_O_NOINHERIT
-#include <fcntl.h>
-#include <io.h>
-#endif /* HAVE_O_NOINHERIT */
-
-#include "sgmlaux.h" /* Include files for auxiliary functions.. */
-
-#ifdef HAVE_O_NOINHERIT
-#define FOPENR(file) nifopen(file)
-FILE *nifopen P((char *));
-#else /* not HAVE_O_NOINHERIT */
-#define FOPENR(file) fopen((file), "r")
-#endif /* not HAVE_O_NOINHERIT */
-
-struct iofcb { /* I/O file control block. */
- FILE *fp; /* File handle. */
- fpos_t off; /* Offset in file of current read block. */
- char *next; /* Next file (NULL if no more). */
- char *file; /* Current file (no length byte). */
- int pendoff; /* Offset into line when file suspended. */
- char bol; /* Non-zero if currently at beginning of line. */
- char first; /* Non-zero if the first read. */
- char wasbol; /* Non-zero if current block was at beginning of line. */
- char canseek;
- UNCH *pendbuf; /* Saved partial buffer for suspended file
- that can't be closed and reopened. */
-};
-
-static char *lastfile; /* The name of the last file closed. */
-static int bufsize; /* Size of buffer passed to ioread(). */
-static char ismagic[256]; /* Table of magic chars that need to be prefixed
- by DELNONCH. */
-static int stdinused = 0;
-
-static char *nextstr P((char *)); /* Iterate over list of strings. */
-static FILE *openfile P((char *, char *));
-static int closefile P((FILE *));
-static int isreg P((FILE *));
-
-VOID ioinit(swp)
-struct switches *swp;
-{
- ismagic[EOBCHAR] = 1;
- ismagic[EOFCHAR] = 1;
- ismagic[EOS] = 1;
- ismagic[(UNCH)DELNONCH] = 1;
- ismagic[(UNCH)GENRECHAR] = 1;
- bufsize = swp->swbufsz;
-}
-
-int ioopen(id, pp)
-UNIV id;
-UNIV *pp;
-{
- struct iofcb *f;
- char *s;
- errno = 0;
- if (!id)
- return -1;
- s = id;
- if (!*s)
- return -1;
- f = (struct iofcb *)rmalloc((UNS)sizeof(struct iofcb));
- f->file = s;
- f->next = nextstr(s);
- errno = 0;
- f->fp = openfile(f->file, &f->canseek);
- f->bol = 1;
- f->first = 1;
- f->pendbuf = 0;
- *pp = (UNIV)f;
- return f->fp ? 1 : -1;
-}
-
-VOID ioclose(p)
-UNIV p;
-{
- struct iofcb *f = (struct iofcb *)p;
- if (f->fp)
- closefile(f->fp);
- lastfile = f->file;
- frem((UNIV)f);
-}
-
-VOID iopend(p, off, buf)
-UNIV p;
-int off;
-UNCH *buf;
-{
- struct iofcb *f = (struct iofcb *)p;
- if (!f->canseek) {
- UNCH *s;
- for (s = buf + off; *s != EOFCHAR && *s != EOBCHAR; s++)
- ;
- s++;
- f->pendbuf = (UNCH *)rmalloc((UNS)(s - buf - off));
- memcpy((UNIV)f->pendbuf, (UNIV)(buf + off), (UNS)(s - buf - off));
- return;
- }
- f->bol = 0;
- if (f->wasbol) {
- if (off == 0)
- f->bol = 1;
- else
- off--;
- }
- f->pendoff = off;
- if (f->fp) {
- fclose(f->fp);
- f->fp = 0;
- }
-}
-
-int iocont(p)
-UNIV p;
-{
- struct iofcb *f = (struct iofcb *)p;
- int c = EOF;
- int off = f->pendoff;
-
- if (!f->canseek)
- return 0;
-
- errno = 0;
- f->fp = FOPENR(f->file);
- if (!f->fp)
- return -1;
- if (fsetpos(f->fp, &f->off))
- return -1;
- while (--off >= 0) {
- c = getc(f->fp);
- if (c != EOF && ismagic[c])
- off--;
- }
- if (c == '\n')
- f->bol = 1;
- if (ferror(f->fp))
- return -1;
- return 0;
-}
-
-/* Return -1 on error, otherwise the number of bytes read. The
-strategy is to concatenate the files, insert a RS at the beginning of
-each line, and change each '\n' into a RE. The returned data
-shouldn't cross a file boundary, otherwise error messages might be
-inaccurate. The first read must always succeed. */
-
-int ioread(p, buf, newfilep)
-UNIV p;
-UNCH *buf;
-int *newfilep;
-{
- int i = 0;
- struct iofcb *f = (struct iofcb *)p;
- FILE *fp;
- int c;
-
- *newfilep = 0;
- if (f->first) {
- buf[i] = EOBCHAR;
- f->first = 0;
- return 1;
- }
- if (f->pendbuf) {
- for (i = 0;
- (buf[i] = f->pendbuf[i]) != EOBCHAR && buf[i] != EOFCHAR;
- i++)
- ;
- frem((UNIV)f->pendbuf);
- f->pendbuf = 0;
- return i + 1;
- }
- fp = f->fp;
- for (;;) {
- errno = 0;
- if (f->canseek && fgetpos(fp, &f->off))
- f->canseek = 0;
- errno = 0;
- c = getc(fp);
- if (c != EOF)
- break;
- if (ferror(fp))
- return -1;
- if (closefile(fp) == EOF)
- return -1;
- if (!f->next){
- f->fp = 0;
- buf[0] = EOFCHAR;
- return 1;
- }
- f->file = f->next;
- f->next = nextstr(f->next);
- *newfilep = 1;
- errno = 0;
- fp = f->fp = openfile(f->file, &f->canseek);
- if (!fp)
- return -1;
- f->bol = 1;
- }
- if (f->bol) {
- f->bol = 0;
- buf[i++] = RSCHAR;
- f->wasbol = 1;
- }
- else
- f->wasbol = 0;
- errno = 0;
- for (;;) {
- if (c == '\n') {
- f->bol = 1;
- buf[i++] = RECHAR;
- break;
- }
- if (ismagic[c]) {
- buf[i++] = DELNONCH;
- buf[i++] = SHIFTNON(c);
- }
- else
- buf[i++] = c;
- if (i >= bufsize - 2)
- break;
- c = getc(fp);
- if (c == EOF) {
- if (ferror(fp))
- return -1;
- /* This is in the middle of a line. */
- break;
- }
- }
- buf[i++] = EOBCHAR;
- return i;
-}
-
-static char *nextstr(p)
-char *p;
-{
- p = strchr(p, '\0');
- return *++p ? p : 0;
-}
-
-/* Return the filename associated with p. If p is NULL, return the filename
-of the last file closed. */
-
-char *ioflid(p)
-UNIV p;
-{
- if (!p)
- return lastfile;
- return ((struct iofcb *)p)->file;
-}
-
-static
-FILE *openfile(name, seekp)
-char *name;
-char *seekp;
-{
- FILE *fp;
- if (strcmp(name, STDINNAME) == 0) {
- if (stdinused)
- return 0;
- stdinused = 1;
- *seekp = 0;
- return stdin;
- }
- fp = FOPENR(name);
- if (fp)
- *seekp = isreg(fp);
- return fp;
-}
-
-/* Return -1 on error, 0 otherwise. */
-
-static
-int closefile(fp)
-FILE *fp;
-{
- if (fp == stdin) {
- stdinused = 0;
- clearerr(fp);
- return 0;
- }
- else
- return fclose(fp);
-}
-
-#ifdef HAVE_O_NOINHERIT
-
-/* This is the same as fopen(name, "r") except that it tells DOS that
-the file descriptor should not be inherited by child processes. */
-
-FILE *nifopen(name)
-char *name;
-{
- int fd = open(name, O_RDONLY|O_NOINHERIT|O_TEXT);
- if (fd < 0)
- return 0;
- return fdopen(fd, "r");
-}
-
-#endif /* HAVE_O_NOINHERIT */
-
-#ifdef HAVE_SYS_STAT_H
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifndef S_ISREG
-#ifdef S_IFMT
-#ifdef S_IFREG
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif /* S_IFREG */
-#endif /* S_IFMT */
-#endif /* not S_ISREG */
-
-#endif /* HAVE_SYS_STAT_H */
-
-/* Return 1 if fp might be associated with a regular file. 0
-otherwise. We check this because on many Unix systems lseek() will
-succeed on a (pseudo-)terminal although terminals aren't seekable in
-the way we need. */
-
-static
-int isreg(fp)
-FILE *fp;
-{
-#ifdef S_ISREG
- struct stat sb;
-
- /* This assumes that a system that has S_ISREG will also have
- fstat() and fileno(). */
- if (fstat(fileno(fp), &sb) == 0)
- return S_ISREG(sb.st_mode);
-#endif /* S_ISREG */
- return 1;
-}
-
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-comment-column: 30
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/sgmlmain.h b/usr.bin/sgmls/sgmls/sgmlmain.h
deleted file mode 100644
index 3911f76..0000000
--- a/usr.bin/sgmls/sgmls/sgmlmain.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* SGMLMAIN: Main interface to SGML services.
-
-Preprocessor variable names are the only supported interface
-to data maintained by SGML. They are defined in this file or in adl.h.
-*/
-/* Return control block types (RCBTYPE) from calls to parser (SGML):
- Names and strings follow the convention for the IPBs.
-*/
-enum sgmlevent {
- SGMLEOD, /* End of document. */
- SGMLDAF, /* Data found. */
- SGMLSTG, /* Start-tag found. */
- SGMLETG, /* End-tag found. */
- SGMLREF, /* Record end found. */
- SGMLPIS, /* Processing instruction (string). */
- SGMLAPP /* APPINFO (string) */
-};
-
-struct rcbdata { /* Return control block: DAF EOD REF PIS APP. */
- UNS contersw; /* 1=context error; 2,4,8=data type; 0=not. */
- UNS datalen; /* Length of data or PI (0=single nonchar). */
- UNCH *data; /* Data, PI, single nonSGML, or NDATA ecb ptr. */
-};
-
-struct rcbtag { /* Return control block for STG and ETG. */
- UNS contersw; /* 1=context error; 2=NET enabled; 0/0=not. */
- UNS tagmin; /* Minim: NONE NULL NET DATA; implied by S/ETAG */
- UNCH *curgi; /* Start-tag (or end-tag) GI. */
- union {
- struct ad *al; /* Start-tag: attribute list. */
- UNCH *oldgi; /* End-tag: resumed GI. */
- } ru;
- struct ad *lal; /* Start-tag: link attribute list (UNUSED). */
- UNS format; /* Format class for default processing. */
- struct etd *tagreal; /* Dummy etd or ptr to GI that implied this tag.*/
- int etictr; /* Number of elements on stack with NET enabled.*/
- UNCH *srmnm; /* Current SHORTREF map name (NULL=#EMPTY). */
-};
-
-/* Accessors for rcbdata and rcbtag. */
-/* Datatype abbreviations: C=unsigned char S=string U=unsigned int L=4 bytes
- A=array P=ptr to structure N=name (see sgmlcb.h)
-*/
-/* Data control block fields: processing instructions (SGMLPIS).
-*/
-#define PDATA(d) ((d).data) /*S PI string. */
-#define PDATALEN(d) ((d).datalen) /*U Length of PI string. */
-#define PIESW(d) (((d).contersw & 4)) /*U 1=PIDATA entity returned. */
-/* Data control block fields: other data types.
-*/
-#define CDATA(d) ((d).data) /*S CDATA content string. */
-#define CDATALEN(d) ((d).datalen) /*U Length of CDATA content string. */
-#define CONTERSW(d) (((d).contersw &1))/*U 1=CDATA or TAG out of context. */
-#define CDESW(d) (((d).contersw & 2)) /*U 1=CDATA entity returned. */
-#define SDESW(d) (((d).contersw & 4)) /*U 1=SDATA entity returned. */
-#define NDESW(d) (((d).contersw & 8)) /*U 1=NDATA entity returned. */
-#define NEPTR(d) ((PNE)(d).data) /*P Ptr to NDATA control block. */
-#define MARKUP(d) ((d).data) /*A Markup delimiter strings. */
-#define DTYPELEN(d) ((d).datalen) /*U Length of doc type name +len+EOS. */
-#define DOCTYPE(d) ((d).data) /*S Document type name (with len+EOS). */
-#define ADATA(d) ((d).data) /*S APPINFO */
-#define ADATALEN(d) ((d).datalen) /*U Length of APPINFO string. */
-/* Tag control block fields.
-*/
-#define ALPTR(t) ((t).ru.al) /*P Ptr to SGML attribute list. */
-#define CURGI(t) ((t).curgi+1) /*N GI of started or ended element. */
-#define OLDGI(t) ((t).ru.oldgi) /*S GI of resumed element. */
-#define TAGMIN(t) (t).tagmin /*U Minimization for current tag. */
-#define TAGREAL(t) ((t).tagreal) /*P Dummy etd that implied this tag. */
-#define TAGRLNM(t) ((UNCH *)(t).tagreal) /*P GI of tag that implied this tag.*/
-#define ETISW(t) (((t).contersw & 2)) /*U 1=NET delimiter enabled by ETI. */
-#define PEXSW(t) (((t).contersw & 4)) /*U 1=Element was plus exception. */
-#define MTYSW(t) (((t).contersw & 8)) /*U 1=Element is empty. */
-#define ETICTR(t) ((t).etictr) /*U Number of active NET delimiters. */
-#define SRMNM(t) ((t).srmnm) /*S Name of current SHORTREF map. */
-#define SRMCNT(t) ((t).contersw) /*U Number of SHORTREF maps defined. */
-#define FORMAT(t) ((t).format) /*U Format class.*/
-
-/* These function names are chosen so as to be distinct in the first 6
-letters. */
-
-/* Initialize. */
-struct markup *sgmlset P((struct switches *));
-/* Cleanup and return capacity usage statistics. */
-VOID sgmlend P((struct sgmlcap *));
-/* Set document entity. */
-int sgmlsdoc P((UNIV));
-/* Get entity. */
-int sgmlgent P((UNCH *, PNE *, UNCH **));
-/* Mark an entity. Return is non-zero if already marked.*/
-int sgmlment P((UNCH *));
-/* Get the next sgml event. */
-enum sgmlevent sgmlnext P((struct rcbdata *, struct rcbtag *));
-/* Get the error count. */
-int sgmlgcnterr P((void));
-/* Get the current location. */
-int sgmlloc P((unsigned long *, char **));
-/* Write out the SGML declaration. */
-VOID sgmlwrsd P((FILE *));
-/* Note subdocument capacity usage. */
-VOID sgmlsubcap P((long *));
diff --git a/usr.bin/sgmls/sgmls/sgmlmsg.c b/usr.bin/sgmls/sgmls/sgmlmsg.c
deleted file mode 100644
index 4d98c55..0000000
--- a/usr.bin/sgmls/sgmls/sgmlmsg.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/* sgmlmsg.c -
- message handling for core parser
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-#include "sgmlaux.h"
-#include "msg.h"
-
-static nl_catd catd;
-
-#define TEXT_SET 1 /* message set number for text of messages */
-#define HEADER_SET 2 /* message set number for header strings */
-#define PARM_SET 3 /* message set number for special parameters */
-
-#ifdef HAVE_EXTENDED_PRINTF
-#define xfprintf fprintf
-#else
-extern int xfprintf VP((FILE *, char *,...));
-#endif
-
-#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
-
-static char *gettext P((int));
-static char *getheader P((int));
-static char *getparm P((int));
-static VOID elttrace P((FILE *, int));
-static int printit P((FILE *, struct error *));
-static char *transparm P((UNCH *, char *));
-static VOID spaces P((FILE *, int));
-
-#define PARMBUFSIZ 50
-static char parmbuf[PARMBUFSIZ*2];
-static char *parmbuf1 = parmbuf;
-static char *parmbuf2 = parmbuf + PARMBUFSIZ;
-
-static char *prog; /* program name */
-static int sweltr; /* non-zero means print an element trace */
-static int swenttr; /* non-zero means print an entity trace */
-static int cnterr = 0;
-static VOID (*die) P((void));
-
-static char *headers[] = {
-"In file included",
-"SGML error", /* parameters: type, severity, number */
-"Unsupported feature", /* type U errors */
-"Error", /* for type R errors */
-"Warning", /* severity type I */
-" at %s, %.0sline %lu", /* ignore entity name and ccnt */
-" at entity %s, line %lu",
-"%.0s%.0s in declaration parameter %d", /* ignore first two parameters */
-"%.0s in declaration parameter %d", /* ignore first parameter */
-"%.0s", /* parse mode */
-" at end of file",
-" at end of entity",
-" at record start",
-" at record end",
-" at \"%c\"",
-" at \"\\%03o\"",
-" accessing \"%s\"",
-"Element structure:"
-};
-
-/* 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 HDREOF 10
-#define HDREE 11
-#define HDRRS 12
-#define HDRRE 13
-#define HDRPRT 14
-#define HDRCTL 15
-#define HDRFIL 16
-#define HDRELT 17
-
-/* Special parameters (error::errsp) */
-static char *parms[] = {
-"character data",
-"element content",
-"mixed content",
-"replaceable character data",
-"tag close",
-"content model group",
-"content model occurrence indicator",
-"name group",
-"name token group",
-"system data",
-"parameter literal",
-"attribute value literal",
-"tokenized attribute value literal",
-"minimum literal",
-"markup declaration",
-"markup declaration comment",
-"ignored markup declaration",
-"declaration subset",
-"CDATA marked section",
-"IGNORE marked section",
-"RCDATA marked section",
-"prolog",
-"reference",
-"attribute specification list",
-"tokenized attribute value",
-"attribute specification list close",
-"SGML declaration",
-"attribute definition list",
-"document type",
-"element",
-"entity",
-"link type",
-"link set",
-"notation",
-"SGML",
-"short reference mapping",
-"link set use",
-"short reference use",
-};
-
-static FILE *tfp; /* temporary file for saved messages */
-
-struct saved {
- long start;
- long end;
- char exiterr;
- char countit;
-};
-
-VOID msgprint(e)
-struct error *e;
-{
- if (printit(stderr, e))
- ++cnterr;
- fflush(stderr);
- if (e->errtype == EXITERR) {
- if (die) {
- (*die)();
- abort();
- }
- else
- exit(EXIT_FAILURE);
- }
-}
-
-/* Save an error message. */
-
-UNIV msgsave(e)
-struct error *e;
-{
- struct saved *sv;
-
- sv = (struct saved *)rmalloc(sizeof(struct saved));
- if (!tfp) {
- tfp = tmpfile();
- if (!tfp)
- exiterr(160, (struct parse *)0);
- }
- sv->start = ftell(tfp);
- sv->countit = (char)printit(tfp, e);
- sv->end = ftell(tfp);
- sv->exiterr = (char)(e->errtype == EXITERR);
- return (UNIV)sv;
-}
-
-/* Print a saved error message. */
-
-VOID msgsprint(p)
-UNIV p;
-{
- struct saved *sv = (struct saved *)p;
- long cnt;
-
- assert(p != 0);
- assert(tfp != 0);
- if (fseek(tfp, sv->start, SEEK_SET) < 0)
- return;
- /* Temporary files are opened in binary mode, so this is portable. */
- cnt = sv->end - sv->start;
- while (--cnt >= 0) {
- int c = getc(tfp);
- if (c == EOF)
- break;
- putc(c, stderr);
- }
- fflush(stderr);
- if (sv->countit)
- ++cnterr;
- if (sv->exiterr)
- exit(EXIT_FAILURE);
-}
-
-/* Free a sved error message. */
-
-VOID msgsfree(p)
-UNIV p;
-{
- frem(p);
-}
-
-/* Return 1 if it should be counted as an error. */
-
-static int printit(efp, e)
-FILE *efp;
-struct error *e;
-{
- int indent;
- int countit;
- int hdrcode;
- int filelevel = -1, prevfilelevel = -1, toplevel;
- struct location loc;
- char type[2], severity[2];
-
- assert(e->errnum < SIZEOF(messages));
- assert(messages[e->errnum].text != NULL);
- if (prog) {
- fprintf(efp, "%s: ", prog);
- indent = strlen(prog) + 2; /* don't rely on return value of fprintf */
- /* Don't want to waste too much space on indenting. */
- if (indent > 10)
- indent = 4;
- }
- else
- indent = 4;
-
- for (toplevel = 0; getlocation(toplevel, &loc); toplevel++)
- if (loc.filesw) {
- prevfilelevel = filelevel;
- filelevel = toplevel;
- }
- toplevel--;
-
- if (e->errtype == FILERR) {
- toplevel--;
- filelevel = prevfilelevel;
- }
- if (swenttr && filelevel > 0) {
- int level = 0;
- int middle = 0; /* in the middle of a line */
- do {
- (void)getlocation(level, &loc);
- if (loc.filesw) {
- if (middle) {
- fputs(":\n", efp);
- spaces(efp, indent);
- }
- else
- middle = 1;
- xfprintf(efp, getheader(HDRPFX));
- xfprintf(efp, getheader(HDRLOC), ioflid(loc.fcb),
- loc.ename, loc.rcnt, loc.ccnt);
- }
- else if (middle)
- xfprintf(efp, getheader(HDRELOC),
- loc.ename, loc.rcnt + 1, loc.ccnt);
- }
- while (++level != filelevel);
- if (middle) {
- fputs(":\n", efp);
- spaces(efp, indent);
- }
- }
-
- /* We use strings for the type and severity,
- so that the format can use %.0s to ignore them. */
-
- type[0] = messages[e->errnum].type;
- type[1] = '\0';
- severity[0] = messages[e->errnum].severity;
- severity[1] = '\0';
-
- countit = (severity[0] != 'I');
- if (!countit)
- hdrcode = HDRWARN;
- else if (type[0] == 'R')
- hdrcode = HDRSYS;
- else if (type[0] == 'U')
- hdrcode = HDRUNSUP;
- else
- hdrcode = HDRALL;
-
- xfprintf(efp, getheader(hdrcode), type, severity, e->errnum);
-
- if (filelevel >= 0) {
- (void)getlocation(filelevel, &loc);
- xfprintf(efp, getheader(HDRLOC),
- ioflid(loc.fcb), loc.ename, loc.rcnt, loc.ccnt);
- while (filelevel < toplevel) {
- ++filelevel;
- if (swenttr) {
- (void)getlocation(filelevel, &loc);
- xfprintf(efp, getheader(HDRELOC),
- loc.ename, loc.rcnt + 1, loc.ccnt);
- }
- }
- }
-
- /* It is necessary to copy the result of getparm() because
- the specification of catgets() says in can return a
- pointer to a static buffer which may get overwritten
- by the next call to catgets(). */
-
- switch (e->errtype) {
- case MDERR:
- strncpy(parmbuf, getparm(e->errsp), PARMBUFSIZ*2 - 1);
- xfprintf(efp, getheader(HDRMD), parmbuf,
- (e->subdcl ? e->subdcl : (UNCH *)""), e->parmno);
- break;
- case MDERR2:
- /* no subdcl parameter */
- strncpy(parmbuf, getparm(e->errsp), PARMBUFSIZ*2 - 1);
- xfprintf(efp, getheader(HDRMD2), parmbuf, e->parmno);
- break;
- case DOCERR:
- case EXITERR:
- if (toplevel < 0)
- break;
- strncpy(parmbuf, getparm(e->errsp), PARMBUFSIZ*2 - 1);
- xfprintf(efp, getheader(HDRMODE), parmbuf);
- switch (loc.curchar) {
- case EOFCHAR:
- xfprintf(efp, getheader(HDREOF));
- break;
- case RSCHAR:
- xfprintf(efp, getheader(HDRRS));
- break;
- case RECHAR:
- xfprintf(efp, getheader(HDRRE));
- break;
- case DELNONCH:
- xfprintf(efp, getheader(HDRCTL), UNSHIFTNON(loc.nextchar));
- break;
- case EOS:
- xfprintf(efp, getheader(HDREE));
- break;
- case EOBCHAR:
- break;
- default:
- if (ISASCII(loc.curchar) && isprint(loc.curchar))
- xfprintf(efp, getheader(HDRPRT), loc.curchar);
- else
- xfprintf(efp, getheader(HDRCTL), loc.curchar);
- break;
- }
- break;
- case FILERR:
- if (getlocation(toplevel + 1, &loc))
- xfprintf(efp, getheader(HDRFIL), ioflid(loc.fcb));
- break;
- }
- fputs(":\n", efp);
-
- if (e->errtype == FILERR && e->sverrno != 0) {
- char *errstr = strerror(e->sverrno);
- UNS len = strlen(errstr);
- /* Strip a trailing newline if there is one. */
- if (len > 0 && errstr[len - 1] == '\n')
- len--;
- spaces(efp, indent);
- for (; len > 0; len--, errstr++)
- putc(*errstr, efp);
- fputs(":\n", efp);
- }
-
- spaces(efp, indent);
-
- xfprintf(efp, gettext(e->errnum),
- transparm((UNCH *)e->eparm[0], parmbuf1),
- transparm((UNCH *)e->eparm[1], parmbuf2));
- putc('\n', efp);
-
- if (sweltr)
- elttrace(efp, indent);
- return countit;
-}
-
-/* Print an element trace. */
-static VOID elttrace(efp, indent)
-FILE *efp;
-int indent;
-{
- int i = 1;
- UNCH *gi;
-
- gi = getgi(i);
- if (!gi)
- return;
- spaces(efp, indent);
- xfprintf(efp, getheader(HDRELT));
- do {
- fprintf(efp, " %s", (char *)gi);
- gi = getgi(++i);
- } while (gi);
- putc('\n', efp);
-}
-
-static VOID spaces(efp, indent)
-FILE *efp;
-int indent;
-{
- while (--indent >= 0)
- putc(' ', efp);
-}
-
-VOID msginit(swp)
-struct switches *swp;
-{
- catd = swp->catd;
- prog = swp->prog;
- sweltr = swp->sweltr;
- swenttr = swp->swenttr;
- die = swp->die;
-}
-
-/* Return the error count. */
-
-int msgcnterr()
-{
- return cnterr;
-}
-
-/* Transform a parameter into a form suitable for printing. */
-
-static char *transparm(s, buf)
-UNCH *s;
-char *buf;
-{
- char *ptr;
- int cnt;
-
- if (!s)
- return 0;
-
- ptr = buf;
- cnt = PARMBUFSIZ - 4; /* space for `...\0' */
-
- while (*s) {
- UNCH ch = *s++;
- if (ch == DELNONCH) {
- if (*s == '\0')
- break;
- ch = UNSHIFTNON(*s);
- s++;
- }
- if (ch == DELCDATA || ch == DELSDATA)
- ;
- else if (ch == '\\') {
- if (cnt < 2)
- break;
- *ptr++ = '\\';
- *ptr++ = '\\';
- cnt -= 2;
- }
- else if (ISASCII(ch) && isprint(ch)) {
- if (cnt < 1)
- break;
- *ptr++ = ch;
- cnt--;
- }
- else {
- if (cnt < 4)
- break;
- sprintf(ptr, "\\%03o", ch);
- ptr += 4;
- cnt -= 4;
- }
- }
- if (!*s)
- *ptr = '\0';
- else
- strcpy(ptr, "...");
- return buf;
-}
-
-/* The message and set numbers in the catgets function must be > 0. */
-
-static char *gettext(n)
-int n;
-{
- assert(n > 0 && n < SIZEOF(messages));
- assert(messages[n].text != 0);
- return catgets(catd, TEXT_SET, n, messages[n].text);
-}
-
-static char *getheader(n)
-int n;
-{
- assert(n >= 0 && n < SIZEOF(headers));
- return catgets(catd, HEADER_SET, n + 1, headers[n]);
-}
-
-static char *getparm(n)
-int n;
-{
- assert(n >= 0 && n < SIZEOF(parms));
- return catgets(catd, PARM_SET, n + 1, parms[n]);
-}
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/sgmls.1 b/usr.bin/sgmls/sgmls/sgmls.1
deleted file mode 100644
index bd92c92..0000000
--- a/usr.bin/sgmls/sgmls/sgmls.1
+++ /dev/null
@@ -1,970 +0,0 @@
-'\" $Id$
-'\" t
-.\" Uncomment the next line to get a man page accurate for MS-DOS
-.\"nr Os 1
-.\" Uncomment the next line if tracing is enabled.
-.\"nr Tr 1
-.if \n(.g .if !r Os .nr Os 0
-.tr \(ts"
-.ds S \s-1SGML\s0
-.de TS
-.br
-.sp .5
-..
-.de TE
-.br
-.sp .5
-..
-.de TQ
-.br
-.ns
-.TP \\$1
-..
-.TH SGMLS 1
-.SH NAME
-sgmls \- a validating SGML parser
-.sp
-An \*S System Conforming to
-.if n .br
-International Standard ISO 8879 \(em
-.br
-Standard Generalized Markup Language
-.SH SYNOPSIS
-.B sgmls
-[
-.B \-deglprsuv
-]
-[
-.BI \-c file
-]
-.if \n(Os=1 \{\
-[
-.BI \-f file
-]
-.\}
-[
-.BI \-i name
-]
-[
-.BI \-m file
-]
-.if \n(Tr \{\
-[
-.BI \-x flags
-]
-[
-.BI \-y flags
-]
-.\}
-[
-.I filename\|.\|.\|.
-]
-.SH DESCRIPTION
-.I Sgmls
-parses and validates
-the \*S document entity in
-.I filename\|.\|.\|.
-and prints on the standard output a simple \s-1ASCII\s0 representation of its
-Element Structure Information Set.
-(This is the information set which a structure-controlled
-conforming \*S application should act upon.)
-Note that the document entity may be spread amongst several files;
-for example, the SGML declaration, document type declaration and document
-instance set could each be in a separate file.
-If no filenames are specified, then
-.I sgmls
-will read the document entity from the standard input.
-A filename of
-.B \-
-can also be used to refer to the standard input.
-.LP
-The following options are available:
-.TP
-.BI \-c file
-Report any capacity limits that are exceeded
-and write a report of capacity usage to
-.IR file .
-The report is in the format of a RACT result.
-RACT is the Reference Application for Capacity Testing defined in the
-Proposed American National Standard
-.I
-Conformance Testing for Standard Generalized Markup Language (SGL) Systems
-(X3.190-199X),
-Draft July 1991.
-.TP
-.B \-d
-Warn about duplicate entity declarations.
-.TP
-.B \-e
-Describe open entities in error messages.
-Error messages always include the position of the most recently
-opened external entity.
-.if \n(Os=1 \{\
-.TP
-.BI \-f file
-Redirect errors to
-.IR file .
-.\}
-.TP
-.B \-g
-Show the \s-1GI\s0s of open elements in error messages.
-.TP
-.BI \-i name
-Pretend that
-.RS
-.IP
-.BI <!ENTITY\ %\ name\ \(tsINCLUDE\(ts>
-.LP
-occurs at the start of the document type declaration subset
-in the \*S document entity.
-Since repeated definitions of an entity are ignored,
-this definition will take precedence over any other definitions
-of this entity in the document type declaration.
-Multiple
-.B \-i
-options are allowed.
-If the \*S declaration replaces the reserved name
-.B INCLUDE
-then the new reserved name will be the replacement text of the entity.
-Typically the document type declaration will contain
-.IP
-.BI <!ENTITY\ %\ name\ \(tsIGNORE\(ts>
-.LP
-and will use
-.BI % name ;
-in the status keyword specification of a marked section declaration.
-In this case the effect of the option will be to cause the marked
-section not to be ignored.
-.RE
-.TP
-.B \-l
-Output
-.B L
-commands giving the current line number and filename.
-.TP
-.BI \-m file
-Map public identifiers and entity names to system identifiers
-using the catalog entry file
-.IR file .
-Multiple
-.B \-m
-options are allowed.
-Catalog entry files specified with the
-.B -m
-option will be searched before the defaults.
-.TP
-.B \-p
-Parse only the prolog.
-.I Sgmls
-will exit after parsing the document type declaration.
-Implies
-.BR \-s .
-.TP
-.B \-r
-Warn about defaulted references.
-.TP
-.B \-s
-Suppress output.
-Error messages will still be printed.
-.TP
-.B \-u
-Warn about undefined elements: elements used in the DTD but not defined.
-.TP
-.B \-v
-Print the version number.
-.if \n(Tr \{\
-.TP
-.BI \-x flags
-.br
-.ns
-.TP
-.BI \-y flags
-Enable debugging output;
-.B \-x
-applies to the document body,
-.B \-y
-to the prolog.
-Each character in the
-.I flags
-argument enables tracing of a particular activity.
-.RS
-.TP
-.B t
-Trace state transitions.
-.TP
-.B a
-Trace attribute activity.
-.TP
-.B c
-Trace context checking.
-.TP
-.B d
-Trace declaration parsing.
-.TP
-.B e
-Trace entities.
-.TP
-.B g
-Trace groups.
-.TP
-.B i
-Trace \s-1ID\s0s.
-.TP
-.B m
-Trace marked sections.
-.TP
-.B n
-Trace notations.
-.RE
-.\}
-.SS "Entity Manager"
-An external entity resides in one or more files.
-The entity manager component of
-.I sgmls
-maps a sequence of files into an entity in three sequential stages:
-.IP 1.
-each carriage return character is turned into a non-SGML character;
-.IP 2.
-each newline character is turned into a record end character,
-and at the same time
-a record start character is inserted at the beginning of each line;
-.IP 3.
-the files are concatenated.
-.LP
-A system identifier is
-interpreted as a list of filenames separated by
-.if \n(Os=0 colons.
-.if \n(Os=1 semi-colons.
-A filename of
-.B \-
-can be used to refer to the standard input.
-.LP
-If a system identifier is not specified,
-then the entity manager can generate one using catalog
-entry files in the format defined in the SGML Open Draft Technical
-Resolution on Entity Management. A catalog entry file contains a
-sequence of entries in one of the following four forms:
-.TP
-.BI PUBLIC\ pubid\ sysid
-This specifies that
-.I sysid
-should be used as the system identifier if the public
-identifier is
-.IR pubid .
-.I Sysid
-is a system identifier as defined in ISO 8879 and
-.I pubid
-is a public identifier as defined in ISO 8879.
-.TP
-.BI ENTITY\ name\ sysid
-This specifies that
-.I sysid
-should be used as the system identifier if the entity is a general
-entity whose name is
-.IR name .
-.TP
-.BI ENTITY\ % name\ sysid
-This specifies that
-.I sysid
-should be used as the system identifier if the entity is a parameter
-entity whose name is
-.IR name .
-Note that there is no space between the
-.B %
-and the
-.IR name .
-.TP
-.BI DOCTYPE\ name\ sysid
-This specifies that
-.I sysid
-should be used as the system identifier if the entity is an
-entity declared in a document type declaration whose document type name is
-.IR name .
-.LP
-The last two forms are extensions to the SGML Open format.
-The delimiters can be omitted from the
-.I sysid
-provided it does not contain any white space.
-Comments are allowed between parameters delimited by
-.B --
-as in SGML.
-The environment variable
-.B \s-1SGML_CATALOG_FILES\s0
-contains a
-.if \n(Os=0 colon-separated
-.if \n(Os=1 semicolon-separated
-list of catalog entry files.
-These will be searched after any catalog entry files specified
-using the
-.B \-m
-option.
-If this environment variable is not set,
-then a system dependent list of catalog entry files will be used.
-A match in a catalog entry file for a PUBLIC entry will take
-precedence over a match in the same file for an ENTITY
-or DOCTYPE entry.
-A filename in a system identifier in a catalog entry file
-is interpreted relative to the directory containing the catalog
-entry file.
-.LP
-If no match can be found in a catalog entry file, then the entity
-manager will attempt to generate a filename using the public
-identifier (if there is one) and other information available to it.
-Notation identifiers are not subject to this treatment. This process
-is controlled by the environment variable
-.BR \s-1SGML_PATH\s0 ;
-this contains a
-.if \n(Os=0 colon-separated
-.if \n(Os=1 semicolon-separated
-list of filename templates.
-A filename template is a filename that may contain
-substitution fields; a substitution field is a
-.B %
-character followed by a single letter that indicates the value
-of the substitution.
-The value of a substitution can either be a string
-or it can be
-.IR null .
-The entity manager transforms the list of
-filename templates into a list of filenames by substituting for each
-substitution field and discarding any template
-that contained a substitution field whose value was null.
-It then uses the first resulting filename that exists and is readable.
-Substitution values are transformed before being used for substitution:
-firstly, any names that were subject to upper case substitution
-are folded to lower case;
-secondly,
-.if \n(Os=0 \{\
-.\" Unix
-space characters are mapped to underscores
-and slashes are mapped to percents.
-.\}
-.if \n(Os=1 \{\
-.\" MS-DOS
-the characters
-.B +,./:=?
-and space characters are deleted.
-.\}
-The value of the
-.B %S
-field is not transformed.
-The values of substitution fields are as follows:
-.TP
-.B %%
-A single
-.BR % .
-.TP
-.B %D
-The entity's data content notation.
-This substitution will succeed only for external data entities.
-.TP
-.B %N
-The entity, notation or document type name.
-.TP
-.B %P
-The public identifier if there was a public identifier,
-otherwise null.
-.TP
-.B %S
-The system identifier if there was a system identifier
-otherwise null.
-.TP
-.B %X
-(This is provided mainly for compatibility with \s-1ARCSGML\s0.)
-A three-letter string chosen as follows:
-.LP
-.RS
-.ne 11
-.TS
-tab(&);
-c|c|c s
-c|c|c s
-c|c|c|c
-c|c|c|c
-l|lB|lB|lB.
-&&With public identifier
-&&_
-&No public&Device&Device
-&identifier&independent&dependent
-_
-Data or subdocument entity&nsd&pns&vns
-General SGML text entity&gml&pge&vge
-Parameter entity&spe&ppe&vpe
-Document type definition&dtd&pdt&vdt
-Link process definition&lpd&plp&vlp
-.TE
-.LP
-The device dependent version is selected if the public text class
-allows a public text display version but no public text display
-version was specified.
-.RE
-.TP
-.B %Y
-The type of thing for which the filename is being generated:
-.TS
-tab(&);
-l lB.
-SGML subdocument entity&sgml
-Data entity&data
-General text entity&text
-Parameter entity&parm
-Document type definition&dtd
-Link process definition&lpd
-.TE
-.LP
-The value of the following substitution fields will be null
-unless a valid formal public identifier was supplied.
-.TP
-.B %A
-Null if the text identifier in the
-formal public identifier contains an unavailable text indicator,
-otherwise the empty string.
-.TP
-.B %C
-The public text class, mapped to lower case.
-.TP
-.B %E
-The public text designating sequence (escape sequence)
-if the public text class is
-.BR \s-1CHARSET\s0 ,
-otherwise null.
-.TP
-.B %I
-The empty string if the owner identifier in the formal public identifier
-is an \s-1ISO\s0 owner identifier,
-otherwise null.
-.TP
-.B %L
-The public text language, mapped to lower case,
-unless the public text class is
-.BR \s-1CHARSET\s0 ,
-in which case null.
-.TP
-.B %O
-The owner identifier (with the
-.B +//
-or
-.B \-//
-prefix stripped.)
-.TP
-.B %R
-The empty string if the owner identifier in the formal public identifier
-is a registered owner identifier,
-otherwise null.
-.TP
-.B %T
-The public text description.
-.TP
-.B %U
-The empty string if the owner identifier in the formal public identifier
-is an unregistered owner identifier,
-otherwise null.
-.TP
-.B %V
-The public text display version.
-This substitution will be null if the public text class
-does not allow a display version or if no version was specified.
-If an empty version was specified, a value of
-.B default
-will be used.
-.LP
-Normally if the external identifier for an entity includes a system
-identifier, the entity manager will use the specified system
-identifier and not attempt to generate one.
-If, however,
-.B \s-1SGML_PATH\s0
-uses the
-.B %S
-field,
-then the entity manager will first search for a matching
-entry in the catalog entry files.
-If a match is found, then this will be used instead of the
-specified system identifier.
-Otherwise,
-if the specified system identifier does not contain any
-.if \n(Os=0 colons,
-.if \n(Os=1 semi-colons,
-the entity manager will use
-.B \s-1SGML_PATH\s0
-to generate a filename.
-Otherwise the entity manager will use the specified system identifier.
-.br
-.ne 18
-.SS "System declaration"
-The system declaration for
-.I sgmls
-is as follows:
-.LP
-.TS
-tab(&);
-c1 s1 s1 s1 s1 s1 s1 s1 s
-c s s s s s s s s
-l l s s s s s s s
-l l s s s s s s s
-l l s s s s s s s
-l l l s s s s s s
-c s s s s s s s s
-l l l l l l l l l
-l l l l l l l l l
-l l l l l l l l l
-l l s s s s s s s
-l l l s s s s s s
-l l l s s s s s s
-c s s s s s s s s
-l l l l l l l l l.
-SYSTEM "ISO 8879:1986"
-CHARSET
-BASESET&"ISO 646-1983//CHARSET
-&\h'\w'"'u'International Reference Version (IRV)//ESC 2/5 4/0"
-DESCSET&0\0128\00
-CAPACITY&PUBLIC&"ISO 8879:1986//CAPACITY Reference//EN"
-FEATURES
-MINIMIZE&DATATAG&NO&OMITTAG&YES&RANK&NO&SHORTTAG&YES
-LINK&SIMPLE&NO&IMPLICIT&NO&EXPLICIT&NO
-OTHER&CONCUR&NO&SUBDOC&YES 1&FORMAL&YES
-SCOPE&DOCUMENT
-SYNTAX&PUBLIC&"ISO 8879:1986//SYNTAX Reference//EN"
-SYNTAX&PUBLIC&"ISO 8879:1986//SYNTAX Core//EN"
-VALIDATE
-&GENERAL&YES&MODEL&YES&EXCLUDE&YES&CAPACITY&YES
-&NONSGML&YES&SGML&YES&FORMAL&YES
-.T&
-c s s s s s s s s
-l l l l l l l l l.
-SDIF
-&PACK&NO&UNPACK&NO
-.TE
-.LP
-Exceeding a capacity limit will be ignored unless the
-.B \-c
-option is given.
-.LP
-The memory usage of
-.I sgmls
-is not a function of the capacity points used by a document;
-however,
-.I sgmls
-can handle capacities significantly greater than the reference capacity set.
-.LP
-In some environments,
-higher values may be supported for the \s-1SUBDOC\s0 parameter.
-.LP
-Documents that do not use optional features are also supported.
-For example, if
-.B FORMAL\ NO
-is specified in the \*S declaration,
-public identifiers will not be required to be valid formal public identifiers.
-.LP
-Certain parts of the concrete syntax may be changed:
-.RS
-.LP
-The shunned character numbers can be changed.
-.LP
-Eight bit characters can be assigned to
-\s-1LCNMSTRT\s0, \s-1UCNMSTRT\s0, \s-1LCNMCHAR\s0 and \s-1UCNMCHAR\s0.
-.LP
-Uppercase substitution can be performed or not performed
-both for entity names and for other names.
-.LP
-Either short reference delimiters assigned by the reference delimiter set
-or no short reference delimiters are supported.
-.LP
-The reserved names can be changed.
-.LP
-The quantity set can be increased within certain limits
-subject to there being sufficient memory available.
-The upper limit on \s-1\%NAMELEN\s0 is 239.
-The upper limits on
-\s-1\%ATTCNT\s0, \s-1\%ATTSPLEN\s0, \s-1\%BSEQLEN\s0, \s-1\%ENTLVL\s0,
-\s-1\%LITLEN\s0, \s-1\%PILEN\s0, \s-1\%TAGLEN\s0, and \s-1\%TAGLVL\s0
-are more than thirty times greater than the reference limits.
-The upper limit on
-\s-1\%GRPCNT\s0, \s-1\%GRPGTCNT\s0, and \s-1\%GRPLVL\s0 is 253.
-\s-1\%NORMSEP\s0
-cannot be changed.
-\s-1\%DTAGLEN\s0
-are
-\s-1\%DTEMPLEN\s0
-irrelevant since
-.I sgmls
-does not support the
-\s-1\%DATATAG\s0
-feature.
-.RE
-.SS "\*S declaration"
-The \*S declaration may be omitted,
-the following declaration will be implied:
-.TS
-tab(&);
-c1 s1 s1 s1 s1 s1 s1 s1 s
-c s s s s s s s s
-l l s s s s s s s.
-<!SGML "ISO 8879:1986"
-CHARSET
-BASESET&"ISO 646-1983//CHARSET
-&\h'\w'"'u'International Reference Version (IRV)//ESC 2/5 4/0"
-DESCSET&\0\00\0\09\0UNUSED
-&\0\09\0\02\0\09
-&\011\0\02\0UNUSED
-&\013\0\01\013
-&\014\018\0UNUSED
-&\032\095\032
-&127\0\01\0UNUSED
-.T&
-l l l s s s s s s
-l l s s s s s s s
-l l l s s s s s s
-c s s s s s s s s
-l l l l l l l l l.
-CAPACITY&PUBLIC&"ISO 8879:1986//CAPACITY Reference//EN"
-SCOPE&DOCUMENT
-SYNTAX&PUBLIC&"ISO 8879:1986//SYNTAX Reference//EN"
-FEATURES
-MINIMIZE&DATATAG&NO&OMITTAG&YES&RANK&NO&SHORTTAG&YES
-LINK&SIMPLE&NO&IMPLICIT&NO&EXPLICIT&NO
-OTHER&CONCUR&NO&SUBDOC&YES 99999999&FORMAL&YES
-.T&
-c s s s s s s s s.
-APPINFO NONE>
-.TE
-with the exception that characters 128 through 254 will be assigned to
-\s-1DATACHAR\s0.
-.LP
-.I Sgmls
-identifies base character sets using the designating sequence in the
-public identifier. The following designating sequences are
-recognized:
-.TS
-tab(&);
-c c c c c
-c c c c ^
-c c c c ^
-l n n n l.
-Designating&ISO&Minimum&Number&Description
-Escape&Registration&Character&of&
-Sequence&Number&Number&Characters&
-_
-ESC 2/5 4/0&-&0&128&full set of ISO 646 IRV
-ESC 2/8 4/0&2&33&94&G0 set of ISO 646 IRV
-ESC 2/8 4/2&6&33&94&G0 set of ASCII
-ESC 2/13 4/1&100&32&96&G1 set of ISO 8859-1
-ESC 2/1 4/0&1&0&32&C0 set of ISO 646
-ESC 2/2 4/3&77&0&32&C1 set of ISO 6429
-ESC 2/5 2/15 3/0&-&0&256&the system character set
-.TE
-.LP
-When one of the G0 sets is used as a base set, the characters SPACE
-and DELETE are treated as occurring at positions 32 and 127
-respectively; although these characters are not part of the character
-sets designated by the escape sequences, this mimics the behaviour of
-ISO 2022 with respect to these code positions.
-.SS "Output format"
-The output is a series of lines.
-Lines can be arbitrarily long.
-Each line consists of an initial command character
-and one or more arguments.
-Arguments are separated by a single space,
-but when a command takes a fixed number of arguments
-the last argument can contain spaces.
-There is no space between the command character and the first argument.
-Arguments can contain the following escape sequences.
-.TP
-.B \e\e
-A
-.BR \e.
-.TP
-.B \en
-A record end character.
-.TP
-.B \e|
-Internal \s-1SDATA\s0 entities are bracketed by these.
-.TP
-.BI \e nnn
-The character whose code is
-.I nnn
-octal.
-.LP
-A record start character will be represented by
-.BR \e012 .
-Most applications will need to ignore
-.B \e012
-and translate
-.B \en
-into newline.
-.LP
-The possible command characters and arguments are as follows:
-.TP
-.BI ( gi
-The start of an element whose generic identifier is
-.IR gi .
-Any attributes for this element
-will have been specified with
-.B A
-commands.
-.TP
-.BI ) gi
-The end an element whose generic identifier is
-.IR gi .
-.TP
-.BI \- data
-Data.
-.TP
-.BI & name
-A reference to an external data entity
-.IR name ;
-.I name
-will have been defined using an
-.B E
-command.
-.TP
-.BI ? pi
-A processing instruction with data
-.IR pi .
-.TP
-.BI A name\ val
-The next element to start has an attribute
-.I name
-with value
-.I val
-which takes one of the following forms:
-.RS
-.TP
-.B IMPLIED
-The value of the attribute is implied.
-.TP
-.BI CDATA\ data
-The attribute is character data.
-This is used for attributes whose declared value is
-.BR \s-1CDATA\s0 .
-.TP
-.BI NOTATION\ nname
-The attribute is a notation name;
-.I nname
-will have been defined using a
-.B N
-command.
-This is used for attributes whose declared value is
-.BR \s-1NOTATION\s0 .
-.TP
-.BI ENTITY\ name\|.\|.\|.
-The attribute is a list of general entity names.
-Each entity name will have been defined using an
-.BR I ,
-.B E
-or
-.B S
-command.
-This is used for attributes whose declared value is
-.B \s-1ENTITY\s0
-or
-.BR \s-1ENTITIES\s0 .
-.TP
-.BI TOKEN\ token\|.\|.\|.
-The attribute is a list of tokens.
-This is used for attributes whose declared value is anything else.
-.RE
-.TP
-.BI D ename\ name\ val
-This is the same as the
-.B A
-command, except that it specifies a data attribute for an
-external entity named
-.IR ename .
-Any
-.B D
-commands will come after the
-.B E
-command that defines the entity to which they apply, but
-before any
-.B &
-or
-.B A
-commands that reference the entity.
-.TP
-.BI N nname
-.IR nname.
-Define a notation
-This command will be preceded by a
-.B p
-command if the notation was declared with a public identifier,
-and by a
-.B s
-command if the notation was declared with a system identifier.
-A notation will only be defined if it is to be referenced
-in an
-.B E
-command or in an
-.B A
-command for an attribute with a declared value of
-.BR \s-1NOTATION\s0 .
-.TP
-.BI E ename\ typ\ nname
-Define an external data entity named
-.I ename
-with type
-.I typ
-.RB ( \s-1CDATA\s0 ,
-.B \s-1NDATA\s0
-or
-.BR \s-1SDATA\s0 )
-and notation
-.IR not.
-This command will be preceded by one or more
-.B f
-commands giving the filenames generated by the entity manager from the system
-and public identifiers,
-by a
-.B p
-command if a public identifier was declared for the entity,
-and by a
-.B s
-command if a system identifier was declared for the entity.
-.I not
-will have been defined using a
-.B N
-command.
-Data attributes may be specified for the entity using
-.B D
-commands.
-An external data entity will only be defined if it is to be referenced in a
-.B &
-command or in an
-.B A
-command for an attribute whose declared value is
-.B \s-1ENTITY\s0
-or
-.BR \s-1ENTITIES\s0 .
-.TP
-.BI I ename\ typ\ text
-Define an internal data entity named
-.I ename
-with type
-.I typ
-.RB ( \s-1CDATA\s0
-or
-.BR \s-1SDATA\s0 )
-and entity text
-.IR text .
-An internal data entity will only be defined if it is referenced in an
-.B A
-command for an attribute whose declared value is
-.B \s-1ENTITY\s0
-or
-.BR \s-1ENTITIES\s0 .
-.TP
-.BI S ename
-Define a subdocument entity named
-.IR ename .
-This command will be preceded by one or more
-.B f
-commands giving the filenames generated by the entity manager from the system
-and public identifiers,
-by a
-.B p
-command if a public identifier was declared for the entity,
-and by a
-.B s
-command if a system identifier was declared for the entity.
-A subdocument entity will only be defined if it is referenced
-in a
-.B {
-command
-or in an
-.B A
-command for an attribute whose declared value is
-.B \s-1ENTITY\s0
-or
-.BR \s-1ENTITIES\s0 .
-.TP
-.BI s sysid
-This command applies to the next
-.BR E ,
-.B S
-or
-.B N
-command and specifies the associated system identifier.
-.TP
-.BI p pubid
-This command applies to the next
-.BR E ,
-.B S
-or
-.B N
-command and specifies the associated public identifier.
-.TP
-.BI f filename
-This command applies to the next
-.B E
-or
-.B S
-command and specifies an associated filename.
-There will be more than one
-.B f
-command for a single
-.B E
-or
-.B S
-command if the system identifier used a
-.if \n(Os=0 colon.
-.if \n(Os=1 semi-colon.
-.TP
-.BI { ename
-The start of the \*S subdocument entity
-.IR ename ;
-.I ename
-will have been defined using a
-.B S
-command.
-.TP
-.BI } ename
-The end of the \*S subdocument entity
-.IR ename .
-.TP
-.BI L lineno\ file
-.TQ
-.BI L lineno
-Set the current line number and filename.
-The
-.I filename
-argument will be omitted if only the line number has changed.
-This will be output only if the
-.B \-l
-option has been given.
-.TP
-.BI # text
-An \s-1APPINFO\s0 parameter of
-.I text
-was specified in the \*S declaration.
-This is not strictly part of the ESIS, but a structure-controlled
-application is permitted to act on it.
-No
-.B #
-command will be output if
-.B \s-1APPINFO\s0\ \s-1NONE\s0
-was specified.
-A
-.B #
-command will occur at most once,
-and may be preceded only by a single
-.B L
-command.
-.TP
-.B C
-This command indicates that the document was a conforming \*S document.
-If this command is output, it will be the last command.
-An \*S document is not conforming if it references a subdocument entity
-that is not conforming.
-.SH BUGS
-Some non-SGML characters in literals are counted as two characters for the
-purposes of quantity and capacity calculations.
-.SH "SEE ALSO"
-The \*S Handbook, Charles F. Goldfarb
-.br
-\s-1ISO\s0 8879 (Standard Generalized Markup Language),
-International Organization for Standardization
-.SH ORIGIN
-\s-1ARCSGML\s0 was written by Charles F. Goldfarb.
-.LP
-.I Sgmls
-was derived from \s-1ARCSGML\s0 by James Clark (jjc@jclark.com),
-to whom bugs should be reported.
diff --git a/usr.bin/sgmls/sgmls/sgmlxtrn.c b/usr.bin/sgmls/sgmls/sgmlxtrn.c
deleted file mode 100644
index 74d7894..0000000
--- a/usr.bin/sgmls/sgmls/sgmlxtrn.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Standard Generalized Markup Language Users' Group (SGMLUG)
- SGML Parser Materials (ARCSGML 1.0)
-
-(C) 1983-1988 Charles F. Goldfarb (assigned to IBM Corporation)
-(C) 1988-1991 IBM Corporation
-
-Licensed to the SGML Users' Group for distribution under the terms of
-the following license: */
-
-char license[] =
-"SGMLUG hereby grants to any user: (1) an irrevocable royalty-free,\n\
-worldwide, non-exclusive license to use, execute, reproduce, display,\n\
-perform and distribute copies of, and to prepare derivative works\n\
-based upon these materials; and (2) the right to authorize others to\n\
-do any of the foregoing.\n";
-
-#include "sgmlincl.h"
-
-/* SGMLXTRN: Storage allocation and initialization for all public variables.
- Exceptions: Constants lex????? and del????? are defined in
- LEX?????.C modules; constants pcb????? are defined in PCB?????.c.
-*/
-int badresw = 0; /* 1=REF_ out of context; 0=valid. */
-int charmode = 0; /* >0=in #CHARS; 0=not. */
-int conactsw = 0; /* 1=return saved content action 0=get new one.*/
-int conrefsw = 0; /* 1=content reference att specified; 0=no. */
-int contersv = 0; /* Save contersw while processing pending REF. */
-int contersw = 0; /* 1=element or #CHARS out of context; 0=valid. */
-int datarc = 0; /* Return code for data: DAF_ or REF_. */
-int delmscsw = 0; /* 1=DELMSC must be read on return to es==0. */
-int didreq = 0; /* 1=required implied tag processed; 0=no. */
-int docelsw = 0; /* 1=had document element; 0=no */
-int dostag = 0; /* 1=retry newetd instead of parsing; 0=parse. */
-int dtdsw = 0; /* DOCTYPE declaration found: 1=yes; 0=no. */
-int entdatsw = 0; /* 2=CDATA entity; 4=SDATA; 8=NDATA; 0=none. */
-int entpisw = 0; /* 4=PI entity occurred; 0=not. */
-int eodsw = 0; /* 1=eod found in error; 0=not yet. */
-int eofsw = 0; /* 1=eof found in body of document; 0=not yet. */
-int es = -1; /* Index of current source in stack. */
-int etagimct = 0; /* Implicitly ended elements left on stack. */
-int etagimsw = 0; /* 1=end-tag implied by other end-tag; 0=not. */
-int etagmin = MINNONE; /* Minim: NONE NULL NET DATA; implied by S/ETAG*/
-int etictr = 0; /* Number of "NET enabled" tags on stack. */
-int etisw = 0; /* 1=tag ended with eti; 0=did not. */
-int indtdsw = 0; /* Are we in the DTD? 1=yes; 0=no. */
-int mslevel = 0; /* Nesting level of marked sections. */
-int msplevel = 0; /* Nested MS levels subject to special parse. */
-int prologsw = 1; /* 1=in prolog; 0=not. */
-int pss = 0; /* SGMLACT: scbsgml stack level. */
-int sgmlsw = 0; /* SGML declaration found: 1=yes; 0=no. */
-int stagmin = MINNONE; /* Minimization: NONE, NULL tag, implied by STAG*/
-int tagctr = 0; /* Tag source chars read. */
-int tages = -1; /* ES level at start of tag. */
-int ts = -1; /* Index of current tag in stack. */
-struct parse *propcb = &pcbpro; /* Current PCB for prolog parse. */
-int aentctr = 0; /* Number of ENTITY tokens in this att list. */
-int conact = 0; /* Return code from content parse. */
-int conrefsv = 0; /* Save conrefsw when doing implied start-tag.*/
-int dtdrefsw = 0; /* External DTD? 1=yes; 0=no. */
-int etiswsv = 0; /* Save etisw when processing implied start-tag.*/
-int grplvl = 0; /* Current level of nested grps in model. */
-int idrctr = 0; /* Number of IDREF tokens in this att list. */
-int mdessv = 0; /* ES level at start of markup declaration. */
-int notadn = 0; /* Position of NOTATION attribute in list. */
-int parmno = 0; /* Current markup declaration parameter number. */
-int pexsw = 0; /* 1=tag valid solely because of plus exception.*/
-int rcessv = 0; /* ES level at start of RCDATA content. */
-int tagdelsw = 0; /* 1=tag ended with delimiter; 0=no delimiter. */
-int tokencnt = 0; /* Number of tokens found in attribute value. */
-struct entity *ecbdeflt = 0; /* #DEFAULT ecb (NULL if no default entity). */
-struct etd *docetd = 0; /* The etd for the document as a whole. */
-struct etd *etagreal = 0; /* Actual or dummy etd that implied this tag. */
-struct etd *newetd = 0; /* The etd for a start- or end-tag recognized. */
-struct etd *nextetd = 0; /* ETD that must come next (only one choice). */
-struct etd *lastetd = 0; /* most recently ended ETD. */
-struct etd *stagreal = 0; /* Actual or dummy etd that implied this tag. */
-struct parse *conpcb = 0; /* Current PCB for content parse. */
-UNCH *data = 0; /* Pointer to returned data in buffer. */
-UNCH *mdname = 0; /* Name of current markup declaration. */
-UNCH *ptcon = 0; /* Current pointer into tbuf. */
-UNCH *ptpro = 0; /* Current pointer into tbuf. */
-UNCH *rbufs = 0; /* DOS file read area: start position for read. */
-UNCH *subdcl = 0; /* Subject of markup declaration (e.g., GI). */
-UNS conradn = 0; /* 1=CONREF attribute in list (0=no). */
-UNS datalen = 0; /* Length of returned data in buffer. */
-UNS entlen = 0; /* Length of TAG or EXTERNAL entity text. */
-UNS idadn = 0; /* Number of ID attribute (0 if none). */
-UNS noteadn = 0; /* Number of NOTATION attribute (0 if none). */
-UNS reqadn = 0; /* Num of atts with REQUIRED default (0=none). */
-int grplongs; /* Number of longs for GRPCNT bitvector. */
-
-/* Variable arrays and structures.
-*/
-struct ad *al = 0; /* Current attribute list work area. */
-struct dcncb *dcntab[1]; /* List of data content notation names. */
-struct entity *etab[ENTHASH]; /* Entity hash table. */
-struct etd *etdtab[ETDHASH]; /* Element type definition hash table. */
-struct fpi fpidf; /* Fpi for #DEFAULT entity. */
-struct id *itab[IDHASH]; /* Unique identifier hash table. */
-struct etd **nmgrp = 0; /* Element name group */
-PDCB *nnmgrp = 0; /* Notation name group */
-struct restate *scbsgml = 0; /* SGMLACT: return action state stack. */
-struct source *scbs = 0; /* Stack of open sources ("SCB stack"). */
-struct srh *srhtab[1]; /* List of SHORTREF table headers. */
-struct sgmlstat ds; /* Document statistics. */
-struct switches sw; /* Parser control switches set by text proc. */
-struct tag *tags = 0; /* Stack of open elements ("tag stack"). */
-struct thdr *gbuf = 0; /* Buffer for creating group. */
-struct thdr prcon[3]; /* 0-2: Model for *DOC content. */
-struct thdr undechdr; /* 0:Default model hdr for undeclared content.*/
-UNCH *dtype = 0; /* Document type name. */
-UNCH *entbuf = 0; /* Buffer for entity reference name. */
-UNCH fce[2]; /* String form of FCE char.
- (fce[1] must be EOS).*/
-/* Buffer for non-SGML character reference.*/
-UNCH nonchbuf[2] = { DELNONCH };
-UNCH *tbuf; /* Work area for tokenization. */
-UNCH *lbuf = 0; /* In tbuf: Literal parse area.*/
-UNCH *sysibuf = 0; /* Buffer for system identifiers. */
-UNCH *pubibuf = 0; /* Buffer for public identifiers. */
-UNCH *nmbuf = 0; /* Name buffer used by mdentity. */
-struct mpos *savedpos;
-
-/* Constants.
-*/
-struct map dctab[] = { /* Keywords for declared content parameter.*/
- { key[KRCDATA], MRCDATA+MPHRASE },
- { key[KCDATA], MCDATA+MPHRASE },
- { key[KANY], MANY+MCHARS+MGI },
- { key[KEMPTY], MNONE+MPHRASE },
- { NULL, 0 }
-};
-struct map deftab[] = { /* Default value keywords. */
- { key[KIMPLIED], DNULL },
- { key[KREQUIRED], DREQ },
- { key[KCURRENT], DCURR },
- { key[KCONREF], DCONR },
- { key[KFIXED], DFIXED},
- { NULL, 0}
-};
-struct map dvtab[] = { /* Declared value: keywords and type codes.*/
-/* TYPE NUMBER */
-/* grp ANMTGRP Case 1 0 Grp size */
-/* grp member ANMTGRP Case 0 Position */
-/* grp ANOTEGRP Case 1 1 Grp size */
- { key[KNOTATION], ANOTEGRP}, /* Case 1 Position */
- { key[KCDATA], ACHARS }, /* Case 2 Always 0 */
- { key[KENTITY], AENTITY }, /* Case 3 Normal 1 */
- { key[KID], AID }, /* Case 4 Normal 1 */
- { key[KIDREF], AIDREF }, /* Case 5 Normal 1 */
- { key[KNAME], ANAME }, /* Case 6 Normal 1 */
- { key[KNMTOKEN], ANMTOKE }, /* Case 7 Normal 1 */
- { key[KNUMBER], ANUMBER }, /* Case 8 Normal 1 */
- { key[KNUTOKEN], ANUTOKE }, /* Case 9 Normal 1 */
- { key[KENTITIES], AENTITYS}, /* Case A Normal 1 */
- { key[KIDREFS], AIDREFS }, /* Case B # tokens */
- { key[KNAMES], ANAMES }, /* Case C # tokens */
- { key[KNMTOKENS], ANMTOKES}, /* Case D # tokens */
- { key[KNUMBERS], ANUMBERS}, /* Case E # tokens */
- { key[KNUTOKENS], ANUTOKES}, /* Case F # tokens */
- { NULL, 0 } /* Case 0 ERROR */
-};
-struct map enttab[] = { /* Entity declaration second parameter. */
- { key[KCDATA], ESC },
- { key[KSDATA], ESX },
- { key[KMS], ESMS},
- { key[KPI], ESI },
- { key[KSTARTTAG], ESS },
- { key[KENDTAG], ESE },
- { key[KMD], ESMD},
- { NULL, 0 }
-};
-struct map exttab[] = { /* Keywords for external identifier. */
- { key[KSYSTEM], EDSYSTEM },
- { key[KPUBLIC], EDPUBLIC },
- { NULL, 0 }
-};
-struct map extettab[] = { /* Keywords for external entity type. */
- { key[KCDATA], ESNCDATA },
- { key[KNDATA], ESNNDATA },
- { key[KSDATA], ESNSDATA },
- { key[KSUBDOC], ESNSUB },
- { NULL, 0 }
-};
-struct map funtab[] = { /* Function character reference names. */
- { key[KRE], RECHAR },
- { key[KRS], RSCHAR },
- { key[KSPACE], SPCCHAR },
- /* We should use an extra table for added functions. */
- { (UNCH *)"TAB", TABCHAR },
- { NULL, 0 }
-};
-struct map mstab[] = { /* Marked section keywords. */
- { key[KTEMP], MSTEMP },
- { key[KINCLUDE], MSTEMP }, /* Treat INCLUDE like TEMP; both are NOPs.*/
- { key[KRCDATA], MSRCDATA},
- { key[KCDATA], MSCDATA },
- { key[KIGNORE], MSIGNORE},
- { NULL, 0 }
-};
-struct map pubcltab[] = { /* Names for public text class. */
- { (UNCH *)"CAPACITY", FPICAP },
- { (UNCH *)"CHARSET", FPICHARS},
- { (UNCH *)"DOCUMENT", FPIDOC },
- { (UNCH *)"DTD", FPIDTD },
- { (UNCH *)"ELEMENTS", FPIELEM },
- { (UNCH *)"ENTITIES", FPIENT },
- { (UNCH *)"LPD", FPILPD },
- { (UNCH *)"NONSGML", FPINON },
- { (UNCH *)"NOTATION", FPINOT },
- { (UNCH *)"SHORTREF", FPISHORT},
- { (UNCH *)"SUBDOC", FPISUB },
- { (UNCH *)"SYNTAX", FPISYN },
- { (UNCH *)"TEXT", FPITEXT },
- { NULL, 0 }
-};
-UNCH indefent[] = "\12#DEFAULT"; /* Internal name: default entity name. */
-UNCH indefetd[] = "\12*DOCTYPE"; /* Internal name: default document type. */
-UNCH indocent[] = "\12*SGMLDOC"; /* Internal name: SGML document entity. */
-UNCH indocetd[] = "\6*DOC"; /* Internal name: document level etd. */
-UNCH indtdent[] = "\11*DTDENT"; /* Internal name: external DTD entity. */
-
-struct etd dumetd[3];
-struct entity *dumpecb;
-UNCH sgmlkey[] = "SGML";
diff --git a/usr.bin/sgmls/sgmls/sgmlxtrn.h b/usr.bin/sgmls/sgmls/sgmlxtrn.h
deleted file mode 100644
index e551200..0000000
--- a/usr.bin/sgmls/sgmls/sgmlxtrn.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* SGMLXTRN.H: External declarations for SGML public variables.
- Exceptions: Constants lex????? and del????? are defined in
- LEX?????.C modules; constants pcb????? are defined in PCB?????.c.
-*/
-#ifndef SGMLXTRN /* Don't include this file more than once. */
-#define SGMLXTRN
-extern int badresw; /* 1=REF_ out of context; 0=valid. */
-extern int charmode; /* >0=in #CHARS; 0=not. */
-extern int conactsw; /* 1=return saved content action 0=get new one.*/
-extern int conrefsw; /* 1=content reference att specified; 0=no. */
-extern int contersv; /* Save contersw while processing pending REF. */
-extern int contersw; /* 1=element or #CHARS out of context; 0=valid. */
-extern int datarc; /* Return code for data: DAF_ or REF_. */
-extern int delmscsw; /* 1=DELMSC must be read on return to es==0. */
-extern int didreq; /* 1=required implied tag processed; 0=no. */
-extern int docelsw; /* 1=had document element; 0=no */
-extern int dostag; /* 1=retry newetd instead of parsing; 0=parse. */
-extern int dtdsw; /* DOCTYPE declaration found: 1=yes; 0=no. */
-extern int entdatsw; /* 2=CDATA entity; 4=SDATA; 8=NDATA; 0=none. */
-extern int entpisw; /* 4=PI entity occurred; 0=not. */
-extern int eodsw; /* 1=eod found in error; 0=not yet. */
-extern int eofsw; /* 1=eof found in body of document; 0=not yet. */
-extern int etagimct; /* Implicitly ended elements left on stack. */
-extern int etagimsw; /* 1=end-tag implied by other end-tag; 0=not. */
-extern int etagmin; /* Minim: NONE NULL NET DATA; implied by S/ETAG*/
-extern int etictr; /* Number of "NET enabled" tags on stack. */
-extern int etisw; /* 1=tag ended with eti; 0=did not. */
-extern int indtdsw; /* Are we in the DTD? 1=yes; 0=no. */
-extern int mslevel; /* Nesting level of marked sections. */
-extern int msplevel; /* Nested MS levels subject to special parse. */
-extern int prologsw; /* 1=in prolog; 0=not. */
-extern int pss; /* SGMLACT: scbsgml stack level. */
-extern int sgmlsw; /* SGML declaration found: 1=yes; 0=no. */
-extern int stagmin; /* Minimization: NONE, NULL tag, implied by STAG*/
-extern int tagctr; /* Tag source chars read. */
-extern int tages; /* ES level at start of tag. */
-extern int ts; /* Index of current tag in stack. */
-extern struct parse *propcb; /* Current PCB for prolog parse. */
-extern int aentctr; /* Number of ENTITY tokens in this att list. */
-extern int conact; /* Return code from content parse. */
-extern int conrefsv; /* Save conrefsw when doing implied start-tag.*/
-extern int dtdrefsw; /* External DTD? 1=yes; 0=no. */
-extern int etiswsv; /* Save etisw when processing implied start-tag.*/
-extern int grplvl; /* Current level of nested grps in model. */
-extern int idrctr; /* Number of IDREF tokens in this att list. */
-extern int mdessv; /* ES level at start of markup declaration. */
-extern int notadn; /* Position of NOTATION attribute in list. */
-extern int parmno; /* Current markup declaration parameter number. */
-extern int pexsw; /* 1=tag valid solely because of plus exception.*/
-extern int rcessv; /* ES level at start of RCDATA content. */
-extern int tagdelsw; /* 1=tag ended with delimiter; 0=no delimiter. */
-extern int tokencnt; /* Number of tokens found in attribute value. */
-extern struct entity *ecbdeflt; /* #DEFAULT ecb (NULL if no default entity). */
-extern struct etd *docetd; /* The etd for the document as a whole. */
-extern struct etd *etagreal; /* Actual or dummy etd that implied this tag. */
-extern struct etd *newetd; /* The etd for a start- or end-tag recognized. */
-extern struct etd *nextetd; /* ETD that must come next (only one choice). */
-extern struct etd *lastetd; /* Most recently ended ETD. */
-extern struct etd *stagreal; /* Actual or dummy etd that implied this tag. */
-extern struct parse *conpcb; /* Current PCB for content parse. */
-extern UNCH *data; /* Pointer to returned data in buffer. */
-extern UNCH *mdname; /* Name of current markup declaration. */
-extern UNCH *ptcon; /* Current pointer into tbuf. */
-extern UNCH *ptpro; /* Current pointer into tbuf. */
-extern UNCH *rbufs; /* DOS file read area: start position for read. */
-extern UNCH *subdcl; /* Subject of markup declaration (e.g., GI). */
-extern UNS conradn; /* 1=CONREF attribute in list (0=no). */
-extern UNS datalen; /* Length of returned data in buffer. */
-extern UNS entlen; /* Length of TAG or EXTERNAL entity text. */
-extern UNS idadn; /* Number of ID attribute (0 if none). */
-extern UNS noteadn; /* Number of NOTATION attribute (0 if none). */
-extern UNS reqadn; /* Num of atts with REQUIRED default (0=none). */
-extern int grplongs; /* Number of longs for GRPCNT bitvector. */
-/* Variable arrays and structures.
-*/
-extern struct ad *al; /* Current attribute list work area. */
-extern struct dcncb *dcntab[];/* List of data content notation names. */
-extern struct entity *etab[]; /* Entity hash table. */
-extern struct etd *etdtab[]; /* Element type definition hash table. */
-extern struct fpi fpidf; /* Fpi for #DEFAULT entity. */
-extern struct id *itab[]; /* Unique identifier hash table. */
-extern struct etd **nmgrp; /* Element name group */
-extern PDCB *nnmgrp; /* Notation name group */
-extern struct restate *scbsgml; /* SGMLACT: return action state stack. */
-extern struct srh *srhtab[]; /* List of SHORTREF table headers. */
-extern struct sgmlstat ds; /* Document statistics. */
-extern struct switches sw; /* Parser control switches set by text proc. */
-extern struct tag *tags; /* Stack of open elements ("tag stack"). */
-extern struct thdr *gbuf; /* Buffer for creating group. */
-extern struct thdr prcon[]; /* 0-2: Model for *DOC content. */
-extern struct thdr undechdr; /* 0: Default model hdr for undeclared content. */
-extern UNCH *dtype; /* Document type name. */
-extern UNCH *entbuf; /* Buffer for entity reference name. */
-extern UNCH fce[]; /* String form of FCE char (fce[1] must be EOS).*/
-extern UNCH nonchbuf[]; /* Buffer for valid nonchar character reference.*/
-extern UNCH *tbuf; /* Work area for tokenization. */
-extern UNCH *lbuf; /* In tbuf: Literal parse area; TAGLEN limit.*/
-extern struct entity *dumpecb; /* SRMNULL points to this. */
-extern UNCH *sysibuf;
-extern UNCH *pubibuf;
-extern UNCH *nmbuf; /* Name buffer used by mdentity. */
-extern struct mpos *savedpos;
-
-/* Constants.
-*/
-extern int scbsgmnr; /* SCBSGML: new record; do not ignore RE. */
-extern int scbsgmst; /* SCBSGML: trailing stag or markup; ignore RE. */
-extern struct map dctab[]; /* Keywords for declared content parameter. */
-extern struct map deftab[]; /* Default value keywords. */
-extern struct map dvtab[]; /* Declared value: keywords and type codes.*/
-extern struct map enttab[]; /* Entity declaration second parameter. */
-extern struct map exttab[]; /* Keywords for external identifier. */
-extern struct map extettab[]; /* Keywords for external entity type. */
-extern struct map funtab[]; /* Function character reference names. */
-extern struct map mstab[]; /* Marked section keywords. */
-extern struct map pubcltab[]; /* Keywords for public text class. */
-extern UNCH indefent[]; /* Internal name: default entity name. */
-extern UNCH indefetd[]; /* Internal name: default document type. */
-extern UNCH indocent[]; /* Internal name: SGML document entity. */
-extern UNCH indocetd[]; /* Internal name: etd for document as a whole. */
-extern UNCH indtdent[]; /* Internal name: external DTD entity. */
-extern char license[]; /* SGML Users' Group free license. */
-#endif /* ndef SGMLXTRN */
diff --git a/usr.bin/sgmls/sgmls/source.h b/usr.bin/sgmls/sgmls/source.h
deleted file mode 100644
index 32cc85a..0000000
--- a/usr.bin/sgmls/sgmls/source.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* SOURCE.H: Entity and source control block structures and definitions.
-*/
-#define ENTHASH 503 /* Size of entity hash table. Must be prime. */
-/* Entity storage class values for estore member of entity structure. */
-#define EST 1 /* String: Tag (usually a fixed STARTGI). */
- /* <MDENTITY sets these:> */
-#define ESMD 2 /* String: Markup declaration. */
-#define ESMS 3 /* String: Marked section. */
-#define ESM 4 /* String: ordinary text. */
- /* <ENTOPEN treats these specially:> */
-#define ESS 5 /* ETD: Start-tag. */
-#define ESE 6 /* ETD: End-tag. */
-#define ESI 7 /* String: PI. */
-#define ESX 8 /* String: SDATA general entity. */
-#define ESC 9 /* String: CDATA general entity. */
- /* </MDENTITY> <MDEXTID sets these:> */
-#define ESFM 10 /* LPU: minimum external (file) storage class. */
-#define ESN 10 /* XCB: N/C/SDATA or SUBDOC control block. */
- /* </ENTOPEN> */
-#define ESF 11 /* LPU: General entity. */
-#define ESP 12 /* LPU: Parameter entity. */
-#define ESD 13 /* LPU: Document type definition. */
-#define ESL 14 /* LPU: Link process definition. */
-#define ESK 15 /* LPU: Data content notation. */
- /* </MDEXTID> */
-
-union etext { /* Entity text. */
- UNIV x; /* External ID generated by system. */
- UNCH *c; /* Character string. */
- struct ne *n; /* N/C/SDATA or SUBDOC entity control block. */
-};
-#define ETEXTSZ sizeof(union etext)
-struct entity { /* Entity control block. */
- struct entity *enext; /* Next entity in chain. */
- UNCH *ename; /* Entity name with length and EOS. */
- UNCH estore; /* Storage class (see values above). */
- UNCH dflt; /* Declared as default entity. */
- UNCH mark; /* For use by for sgmlment. */
- union etext etx; /* Entity text. */
-};
-#define ENTSZ sizeof(struct entity)
-typedef struct entity *PECB; /* Ptr to entity control block. */
-typedef struct entity **TECB; /* Table of entity control blocks. */
-
-struct source { /* Source control block. */
- struct entity ecb; /* Entity control block. */
- unsigned long rcnt; /* Source record number. */
- int ccnt; /* Source record chars since last RS. */
- int curoff; /* Offset of curchar (chars read in this block).*/
- UNCH curchar; /* Current character. */
- UNCH nextchar; /* If curchar was DELNONCH, next character. */
- UNIV fcb; /* SGMLIO fcb ptr returned by OPEN. */
- UNCH *fbuf; /* 1st char in buffer (0=PEND) or entity text. */
- UNCH *fpos; /* Current char in buffer or entity text. */
- UNCH pushback; /* Character before pend position */
- char copied; /* Is this a copy of the internal entity? */
-};
-#define SCBSZ sizeof(struct source)
-typedef struct source *PSCB; /* Ptr to source control block. */
-
-extern int es; /* Index of current source in stack. */
-extern struct source *scbs; /* Stack of open sources ("SCB stack"). */
-
-/* Member definitions for source and entity control blocks.
-*/
-#define SCB (scbs[es]) /* Ptr to current source control block. */
-
-#define ECB SCB.ecb /* Pointer to current entity control block. */
-#define FBUF SCB.fbuf /* Pointer to start of entity buffer. */
-#define FPOS SCB.fpos /* Pointer to current char of current source. */
-#define RSCC SCB.ccnt /* CCNT at start of block (across EOB/EOS/EOF). */
-#define CCO SCB.curoff /* Offset in read buffer of current char. */
-#define CC SCB.curchar /* Current character of current source entity. */
-#define NEXTC SCB.nextchar /* Next character in current source entity. */
-#define CCNT (SCB.ccnt+CCO) /* Position of CC in current record (RS=0). */
-#define RCNT SCB.rcnt /* Position of record in entity (origin=1). */
-#define SCBFCB SCB.fcb /* Current file control block (if FILESW). */
-#define ECBPTR ((ECB.enext)) /* Pointer to this entity's ECB. */
-#define ENTITY ((ECB.ename)) /* Current entity name. */
-#define FILESW (ECB.estore>=ESFM) /* 1=Entity is external file; 0=internal. */
-#define NEWCC (++FPOS) /* Get next current character. */
-#define REPEATCC (--FPOS) /* Repeat previous current character. */
-#define COPIEDSW SCB.copied /* Non-zero means entity was copied. */
-
-struct srh { /* Short reference map header. */
- struct srh *enext; /* Next short reference map in chain. */
- UNCH *ename; /* Short reference map name. */
- TECB srhsrm; /* Ptr to short reference map. */
-};
-#define SRHSZ (sizeof(struct srh))
-typedef struct srh *PSRH; /* Ptr to short reference map header. */
-#define SRMNULL (&dumpecb) /* Dummy ptr to empty short reference map. */
-
-/* Definitions for ENTOPEN/ENTREF return codes.
-*/
-#define ENTUNDEF -1 /* Callers of ENTOPEN: entity undefined. */
-#define ENTLOOP -2 /* ENTOPEN: endless loop entity. */
-#define ENTMAX -3 /* ENTOPEN: too many open entities. */
-#define ENTFILE -4 /* ENTOPEN: file I/O error. */
-#define ENTDATA -5 /* ENTOPEN: CDATA or SDATA entity. */
-#define ENTPI -6 /* ENTOPEN: PI entity. */
-
-/* Definitions for ENTDATA switches set in contersw.
-*/
-#define CDECONT 2 /* 0010 CDATA entity referenced. */
-#define SDECONT 4 /* 0100 SDATA entity referenced. */
-#define NDECONT 8 /* 1000 NDATA entity referenced. */
-
-/* Definitions for manipulating signed source character counters.
-*/
-#define CTRSET(CTR) (CTR = (int) -(FPOS+1-FBUF)) /* Init source char ctr. */
-#define CTRGET(CTR) (CTR + (int) (FPOS+1-FBUF)) /* Read source char ctr. */
-
-
diff --git a/usr.bin/sgmls/sgmls/std.h b/usr.bin/sgmls/sgmls/std.h
deleted file mode 100644
index 4e6e856..0000000
--- a/usr.bin/sgmls/sgmls/std.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* std.h -
- Include standard header files.
-*/
-
-#ifndef STD_H
-#define STD_H 1
-
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <assert.h>
-#ifdef SUPPORT_SUBDOC
-#include <signal.h>
-#endif /* SUPPORT_SUBDOC */
-
-#ifndef STDDEF_H_MISSING
-#include <stddef.h>
-#endif /* not STDDEF_H_MISSING */
-
-#ifndef LIMITS_H_MISSING
-#include <limits.h>
-#endif /* not LIMITS_H_MISSING */
-
-#ifndef UINT_MAX
-#define UINT_MAX (sizeof(unsigned int) == 2 ? 0x7fff : \
- (sizeof(unsigned int) == 4 ? 0x7fffffff : cant_guess_UINT_MAX))
-#endif
-
-#ifdef VARARGS
-#include <varargs.h>
-#else
-#include <stdarg.h>
-#endif
-
-#ifdef BSD_STRINGS
-#include <strings.h>
-#define memcpy(to, from, n) bcopy(from, to, n)
-#define memcmp(p, q, n) bcmp(p, q, n)
-#define strchr(s, c) index(s, c)
-#define strrchr(s, c) rindex(s, c)
-#else /* not BSD_STRINGS */
-#include <string.h>
-#endif /* not BSD_STRINGS */
-
-extern char *strerror();
-
-#ifdef STDLIB_H_MISSING
-UNIV malloc();
-UNIV calloc();
-UNIV realloc();
-char *getenv();
-long atol();
-#else /* not STDLIB_H_MISSING */
-#include <stdlib.h>
-#endif /* not STDLIB_H_MISSING */
-
-#ifdef REMOVE_MISSING
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#define remove unlink
-#endif /* REMOVE_MISSING */
-
-#ifdef RAISE_MISSING
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#define raise(sig) kill(getpid(), sig)
-#endif /* RAISE_MISSING */
-
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-#endif
-
-#ifdef FPOS_MISSING
-typedef long fpos_t;
-#define fsetpos(stream, pos) fseek(stream, *(pos), SEEK_SET)
-#define fgetpos(stream, pos) ((*(pos) = ftell(stream)) == -1L)
-#endif /* FPOS_MISSING */
-
-/* Old BSD systems lack L_tmpnam and tmpnam(). This is a partial
-emulation using mktemp(). It requires that the argument to tmpnam()
-be non-NULL. */
-
-#ifndef L_tmpnam
-#define tmpnam_template "/tmp/sgmlsXXXXXX"
-#define L_tmpnam (sizeof(tmpnam_template))
-#undef tmpnam
-#define tmpnam(buf) \
- (mktemp(strcpy(buf, tmpnam_template)) == 0 || (buf)[0] == '\0' ? 0 : (buf))
-#endif /* not L_tmpnam */
-
-#ifndef errno
-extern int errno;
-#endif
-
-#endif /* not STD_H */
diff --git a/usr.bin/sgmls/sgmls/stklen.c b/usr.bin/sgmls/sgmls/stklen.c
deleted file mode 100644
index 43af5dd..0000000
--- a/usr.bin/sgmls/sgmls/stklen.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* This tells Borland C++ to allocate a 14k stack. */
-unsigned _stklen = 14*1024;
diff --git a/usr.bin/sgmls/sgmls/strerror.c b/usr.bin/sgmls/sgmls/strerror.c
deleted file mode 100644
index f5679c0..0000000
--- a/usr.bin/sgmls/sgmls/strerror.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* strerror.c -
- ANSI C strerror() function.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-
-#ifdef STRERROR_MISSING
-#include <stdio.h>
-
-char *strerror(n)
-int n;
-{
- extern int sys_nerr;
- extern char *sys_errlist[];
- static char buf[sizeof("Error ") + 1 + 3*sizeof(int)];
-
- if (n >= 0 && n < sys_nerr && sys_errlist[n] != 0)
- return sys_errlist[n];
- else {
- sprintf(buf, "Error %d", n);
- return buf;
- }
-}
-
-#endif /* STRERROR_MISSING */
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/synrf.c b/usr.bin/sgmls/sgmls/synrf.c
deleted file mode 100644
index 2076107..0000000
--- a/usr.bin/sgmls/sgmls/synrf.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* SYNRF: Reserved names and other constants for reference concrete syntax.
-*/
-#include "config.h"
-#include "entity.h" /* Templates for entity control blocks. */
-#include "synxtrn.h" /* Declarations for concrete syntax constants. */
-#include "adl.h" /* Definitions for attribute list processing. */
-UNCH key[NKEYS][REFNAMELEN+1] = {
- "ANY",
- "ATTLIST",
- "CDATA",
- "CONREF",
- "CURRENT",
- "DEFAULT",
- "DOCTYPE",
- "ELEMENT",
- "EMPTY",
- "ENDTAG",
- "ENTITIES",
- "ENTITY",
- "FIXED",
- "ID",
- "IDLINK",
- "IDREF",
- "IDREFS",
- "IGNORE",
- "IMPLIED",
- "INCLUDE",
- "INITIAL",
- "LINK",
- "LINKTYPE",
- "MD",
- "MS",
- "NAME",
- "NAMES",
- "NDATA",
- "NMTOKEN",
- "NMTOKENS",
- "NOTATION",
- "NUMBER",
- "NUMBERS",
- "NUTOKEN",
- "NUTOKENS",
- "O",
- "PCDATA",
- "PI",
- "POSTLINK",
- "PUBLIC",
- "RCDATA",
- "RE",
- "REQUIRED",
- "RESTORE",
- "RS",
- "SDATA",
- "SHORTREF",
- "SIMPLE",
- "SPACE",
- "STARTTAG",
- "SUBDOC",
- "SYSTEM",
- "TEMP",
- "USELINK",
- "USEMAP"
-};
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/synxtrn.h b/usr.bin/sgmls/sgmls/synxtrn.h
deleted file mode 100644
index 1cdf9a0..0000000
--- a/usr.bin/sgmls/sgmls/synxtrn.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* SYNXTRN.H: External declarations for concrete syntax constants.
-*/
-/* Short References
-*/
-#define SRCT 32 /* Number of short reference delimiters. */
-#define SRMAXLEN 3 /* Maximum length of a SHORTREF delimiter. */
-#define SRNPRT 8 /* Number of non-printable SHORTREF delimiters. */
-struct srdel {
- struct map dtb[SRCT+2]; /* LEXCNM: Short reference delimiters. */
- char *pdtb[SRNPRT+1]; /* LEXCNM: Printable form of unprintable SRs. */
- int fce; /* LEXCNM: Index of first FCE in srdeltab. */
- int hyp2; /* LEXCNM: Index of "two hyphens" in srdeltab. */
- int data; /* LEXCNM: Index of first SR with data char. */
- int hyp; /* LEXCNM: Index of hyphen in srdeltab. */
- int prtmin; /* LEXCNM: Index of 1st printable SR. */
- int spc; /* LEXCNM: Index of space in srdeltab. */
- int lbr; /* LEXCNM: Index of left bracket in srdeltab. */
- int rbr; /* LEXCNM: Index of right bracket in srdeltab. */
-};
-struct delim {
- UNCH genre; /* LEXCON: Generated RE; cannot be markup. */
- UNCH lit; /* LEXMARK: Char used as LIT delimiter.*/
- UNCH lita; /* LEXMARK: Char used as LITA delimiter.*/
- UNCH mdc; /* LEXLMS: Char used as MDC delimiter.*/
- UNCH msc; /* LEXCON: Char used as MSC delimiter. */
- UNCH net; /* LEXCON: Char used as NET when enabled.*/
- UNCH pero; /* LEXMARK: Char used as PERO delimiter. */
- UNCH pic; /* LEXCON: Char used as PIC delimiter.*/
- UNCH tago; /* LEXCON: Char used as TAGO when enabled.*/
-};
-struct lexcode {
- UNCH fce; /* LEXCNM: FRE character as entity reference. */
- UNCH fre; /* LEXCON: Free character not an entity ref. */
- UNCH litc; /* LEXLMS: Literal close delimiter enabled. */
- UNCH minlitc; /* LEXMIN: Literal close delimiter enabled. */
- UNCH msc; /* LEXLMS: Marked section close delim enabled. */
- UNCH net; /* LEXCON: Null end-tag delimiter enabled. */
- UNCH nonet; /* LEXCON: NET disabled; still used as ETI. */
- UNCH spcr; /* LEXCNM: Space in use as SHORTREF delimiter. */
- UNCH tago; /* LEXCON: Tag open delimiter enabled. */
- UNCH cde; /* LEXLMS: CDATA/SDATA delimiters. */
-};
-struct lexical {
- struct markup m; /* Markup strings for text processor. */
- struct srdel s; /* Short reference delimiters. */
- struct delim d; /* General delimiter characters. */
- struct lexcode l; /* Lexical table code assignments. */
-};
-extern struct lexical lex; /* Delimiter set constants. */
-extern UNCH lexcnm[]; /* Lexical table: mixed content. */
-extern UNCH lexcon[]; /* Lexical table for content (except mixed). */
-extern UNCH lexgrp[]; /* Lexical table for groups. */
-extern UNCH lexlms[]; /* Lexical table: literals and marked sections. */
-extern UNCH lexmin[]; /* Lexical table: minimum data literal. */
-extern UNCH lexmark[]; /* Lexical table for markup. */
-extern UNCH lexsd[]; /* Lexical table for SGML declaration. */
-extern UNCH lextran[]; /* Case translation table for SGML names. */
-extern UNCH lextoke[]; /* Lexical table for tokenization. */
-extern UNCH *lextabs[]; /* List of all lexical tables. */
-extern struct parse pcbconc; /* PCB: character data. */
-extern struct parse pcbcone; /* PCB: element content (no data allowed). */
-extern struct parse pcbconm; /* PCB: mixed content (data allowed). */
-extern struct parse pcbconr; /* PCB: replaceable character data. */
-extern struct parse pcbetag; /* PCB: end-tags. */
-extern struct parse pcbgrcm; /* PCB: content model group. */
-extern struct parse pcbgrcs; /* PCB: content model suffix. */
-extern struct parse pcbgrnm; /* PCB: name group. */
-extern struct parse pcbgrnt; /* PCB: name token group. */
-extern struct parse pcblitc; /* PCB: literal with CDATA. */
-extern struct parse pcblitp; /* PCB: literal with CDATA, parm & char refs. */
-extern struct parse pcblitr; /* PCB: attribute value with general refs. */
-extern struct parse pcblitt; /* PCB: tokenized attribute value. */
-extern struct parse pcblitv; /* PCB: literal with CDATA, function char trans.*/
-extern struct parse pcbmd; /* PCB: markup declaration. */
-extern struct parse pcbmdc; /* PCB: comment declaration. */
-extern struct parse pcbmdi; /* PCB: markup declaration (ignored). */
-extern struct parse pcbmds; /* PCB: markup declaration subset. */
-extern struct parse pcbmsc; /* PCB: marked section in CDATA mode. */
-extern struct parse pcbmsi; /* PCB: marked section in IGNORE mode. */
-extern struct parse pcbmsrc; /* PCB: marked section in RCDATA mode. */
-extern struct parse pcbpro; /* PCB: prolog. */
-extern struct parse pcbref; /* PCB: reference. */
-extern struct parse pcbstag; /* PCB: start-tag. */
-extern struct parse pcbval; /* PCB: attribute value. */
-extern struct parse pcbeal; /* PCB: end of attribute list. */
-extern struct parse pcbsd; /* PCB: SGML declaration. */
-extern int pcbcnda; /* PCBCONM: data in buffer. */
-extern int pcbcnet; /* PCBCONM: markup found or data buffer flushed.*/
-extern int pcbmdtk; /* PCBMD: token expected. */
-extern int pcbstan; /* PCBSTAG: attribute name expected. */
-extern int pcblittda; /* PCBLITT: data character found */
-
-#define KANY 0
-#define KATTLIST 1
-#define KCDATA 2
-#define KCONREF 3
-#define KCURRENT 4
-#define KDEFAULT 5
-#define KDOCTYPE 6
-#define KELEMENT 7
-#define KEMPTY 8
-#define KENDTAG 9
-#define KENTITIES 10
-#define KENTITY 11
-#define KFIXED 12
-#define KID 13
-#define KIDLINK 14
-#define KIDREF 15
-#define KIDREFS 16
-#define KIGNORE 17
-#define KIMPLIED 18
-#define KINCLUDE 19
-#define KINITIAL 20
-#define KLINK 21
-#define KLINKTYPE 22
-#define KMD 23
-#define KMS 24
-#define KNAME 25
-#define KNAMES 26
-#define KNDATA 27
-#define KNMTOKEN 28
-#define KNMTOKENS 29
-#define KNOTATION 30
-#define KNUMBER 31
-#define KNUMBERS 32
-#define KNUTOKEN 33
-#define KNUTOKENS 34
-#define KO 35
-#define KPCDATA 36
-#define KPI 37
-#define KPOSTLINK 38
-#define KPUBLIC 39
-#define KRCDATA 40
-#define KRE 41
-#define KREQUIRED 42
-#define KRESTORE 43
-#define KRS 44
-#define KSDATA 45
-#define KSHORTREF 46
-#define KSIMPLE 47
-#define KSPACE 48
-#define KSTARTTAG 49
-#define KSUBDOC 50
-#define KSYSTEM 51
-#define KTEMP 52
-#define KUSELINK 53
-#define KUSEMAP 54
-
-#define NKEYS (KUSEMAP+1)
-
-extern UNCH key[NKEYS][REFNAMELEN+1];
-
-/* Holds the SGML keyword (not alterable by concrete syntax). */
-extern UNCH sgmlkey[];
diff --git a/usr.bin/sgmls/sgmls/tools.h b/usr.bin/sgmls/sgmls/tools.h
deleted file mode 100644
index 57ce45a..0000000
--- a/usr.bin/sgmls/sgmls/tools.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* TOOLS.H: Definitions for type declarations, printing, bit handling, etc.
-*/
-
-#if CHAR_SIGNED
-typedef unsigned char UNCH;
-#else
-typedef char UNCH;
-#endif
-
-#if CHAR_SIGNED
-#define ustrcmp(s1, s2) strcmp((char *)(s1), (char *)(s2))
-#define ustrcpy(s1, s2) strcpy((char *)(s1), (char *)(s2))
-#define ustrchr(s, c) (UNCH *)strchr((char *)(s), c)
-#define ustrncmp(s1, s2, n) strncmp((char *)(s1), (char *)(s2), n)
-#define ustrncpy(s1, s2, n) strncpy((char *)(s1), (char *)(s2), n)
-#define ustrlen(s1) strlen((char *)(s1))
-#else
-#define ustrcmp strcmp
-#define ustrcpy strcpy
-#define ustrchr strchr
-#define ustrncmp strncmp
-#define ustrncpy strncpy
-#define ustrlen strlen
-#endif
-
-#if 0
-int ustrcmp(UNCH *, UNCH *);
-UNCH *ustrchr(UNCH *, int);
-int ustrncmp(UNCH *, UNCH *, UNS);
-int ustrncpy(UNCH *, UNCH *, UNS);
-int ustrlen(UNCH *);
-#endif
-
-typedef unsigned UNS;
-
-#ifdef USE_ISASCII
-#define ISASCII(c) isascii(c)
-#else
-#define ISASCII(c) (1)
-#endif
-
-#ifdef BSD_STRINGS
-#define MEMZERO(s, n) bzero(s, n)
-#else /* not BSD_STRINGS */
-#define MEMZERO(s, n) memset(s, '\0', n)
-#endif /* not BSD_STRINGS */
-
-/* Macros for bit manipulation.
-*/
-#define SET(word, bits) ((word) |= (bits)) /* Turn bits on */
-#define RESET(word, bits) ((word) &= ~(bits)) /* Turn bits off */
-#define GET(word, bits) ((word) & (bits)) /* 1=any bit on */
-#define BITOFF(word, bits) (GET(word, bits)==0) /* 1=no bits on */
-#define BITON(word, bits) ((word) & (bits)) /* 1=any bit on */
-
-#define ETDCDATA (dumetd) /* Dummy etd pointer for #PCDATA. */
-#define ETDNULL (dumetd + 1) /* Dummy etd pointer for null tag. */
-#define ETDNET (dumetd + 2) /* Dummy etd pointer for NET delimiter. */
-#define BADPTR(p) \
- ((p) == NULL || (p) == ETDCDATA || (p) == ETDNULL || (p) == ETDNET)
-#define PTRNUM(p) ((p) == NULL ? 0 : ((p) - dumetd) + 1)
-
-#ifdef USE_PROTOTYPES
-#define P(parms) parms
-#else
-#define P(parms) ()
-#endif
-
-/* VP is used for prototypes of varargs functions. You can't have a
-prototype if the function is defined using varargs.h rather than
-stdarg.h. */
-#ifdef VARARGS
-#define VP(parms) ()
-#else
-#define VP(parms) P(parms)
-#endif
diff --git a/usr.bin/sgmls/sgmls/trace.h b/usr.bin/sgmls/sgmls/trace.h
deleted file mode 100644
index f917a26..0000000
--- a/usr.bin/sgmls/sgmls/trace.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* TRACE.H: Declarations for internal trace functions. */
-
-#ifdef TRACE
-
-/* Trace variables.
-*/
-extern int trace; /* Switch: 1=trace state transitions; 0=don't. */
-extern int atrace; /* Switch: 1=trace attribute activity; 0=don't. */
-extern int ctrace; /* Switch: 1=trace context checking; 0=don't. */
-extern int dtrace; /* Switch: 1=trace declaration parsing; 0=don't.*/
-extern int etrace; /* Switch: 1=trace entity activity; 0=don't.*/
-extern int gtrace; /* Switch: 1=trace group creations; 0=don't. */
-extern int itrace; /* Switch: 1=trace ID activity; 0=don't. */
-extern int mtrace; /* Switch: 1=trace MS activity; 0=don't. */
-extern int ntrace; /* Switch: 1=trace data notation activity. */
-extern char emd[]; /* For "EMD" parameter type in dtrace calls. */
-
-VOID traceadl P((struct ad *));
-VOID tracecon P((int,int,int,struct parse *,int,int));
-VOID tracedcn P((struct dcncb *));
-VOID tracedsk P((struct tag *,struct tag *,int,int));
-VOID traceecb P((char *,struct entity *));
-VOID traceend P((char *,struct thdr *,struct mpos *,int,int));
-VOID traceesn P((struct ne *));
-VOID traceetd P((struct etd *));
-VOID traceetg P((struct tag *,struct etd *,int,int));
-VOID tracegi P((char *,struct etd *,struct thdr *,struct mpos *));
-VOID tracegml P((struct restate *,int,int,int));
-VOID tracegrp P((struct etd **));
-VOID traceid P((char *,struct id *));
-VOID tracemd P((char *));
-VOID tracemod P((struct thdr *));
-VOID tracems P((int,int,int,int));
-VOID tracengr P((struct dcncb **));
-VOID tracepcb P((struct parse *));
-VOID tracepro P((void));
-VOID traceset P((void));
-VOID tracesrm P((char *,struct entity **,UNCH *));
-VOID tracestg P((struct etd *,int,int,struct etd *,int));
-VOID tracestk P((struct tag *,int,int));
-VOID tracetkn P((int,UNCH *));
-VOID traceval P((struct parse *,unsigned int,UNCH *,int));
-
-#define TRACEADL(al) ((void)(atrace && (traceadl(al), 1)))
-#define TRACECON(etagimct, dostag, datarc, pcb, conrefsw, didreq) \
- ((void)(gtrace \
- && (tracecon(etagimct, dostag, datarc, pcb, conrefsw, didreq), 1)))
-#define TRACEDCN(dcn) ((void)(ntrace && (tracedcn(dcn), 1)))
-#define TRACEDSK(pts, ptso, ts3, etictr) \
- ((void)(gtrace && (tracedsk(pts, ptso, ts3, etictr), 1)))
-#define TRACEECB(action, p) \
- ((void)(etrace && (traceecb(action, p), 1)))
-#define TRACEEND(stagenm, mod, pos, rc, opt) \
- ((void)(ctrace && (traceend(stagenm, mod, pos, rc, opt), 1)))
-#define TRACEESN(p) \
- ((void)((etrace || atrace || ntrace) && (traceesn(p), 1)))
-#define TRACEETD(p) ((void)(gtrace && (traceetd(p), 1)))
-#define TRACEETG(pts, curetd, tsl, etagimct) \
- ((void)(gtrace && (traceetg(pts, curetd, tsl, etagimct), 1)))
-#define TRACEGI(stagenm, gi, mod, pos) \
- ((void)(ctrace && (tracegi(stagenm, gi, mod, pos), 1)))
-#define TRACEGML(scb, pss, conactsw, conact) \
- ((void)(trace && (tracegml(scb, pss, conactsw, conact), 1)))
-#define TRACEGRP(p) ((void)(gtrace && (tracegrp(p), 1)))
-#define TRACEID(action, p) ((void)(itrace && (traceid(action, p), 1)))
-#define TRACEMD(p) ((void)(dtrace && (tracemd(p), 1)))
-#define TRACEMOD(p) ((void)(gtrace && (tracemod(p), 1)))
-#define TRACEMS(action, code, mslevel, msplevel) \
- ((void)(mtrace && (tracems(action, code, mslevel, msplevel), 1)))
-#define TRACENGR(p) ((void)(gtrace && (tracengr(p), 1)))
-#define TRACEPCB(p) ((void)(trace && (tracepcb(p), 1)))
-#define TRACEPRO() (tracepro())
-#define TRACESET() (traceset())
-#define TRACESRM(action, pg, gi) \
- ((void)(etrace && (tracesrm(action, pg, gi), 1)))
-#define TRACESTG(curetd, dataret, rc, nextetd, mexts) \
- ((void)(gtrace && (tracestg(curetd, dataret, rc, nextetd, mexts), 1)))
-#define TRACESTK(pts, ts2, etictr) \
- ((void)(gtrace && (tracestk(pts, ts2, etictr), 1)))
-#define TRACETKN(scope, lextoke) \
- ((void)(trace && (tracetkn(scope, lextoke), 1)))
-#define TRACEVAL(pcb, atype, aval, tokencnt) \
- ((void)(atrace && (traceval(pcb, atype, aval, tokencnt), 1)))
-
-#else /* not TRACE */
-
-#define TRACEADL(al) /* empty */
-#define TRACECON(etagimct, dostag, datarc, pcb, conrefsw, didreq) /* empty */
-#define TRACEDCN(dcn) /* empty */
-#define TRACEDSK(pts, ptso, ts3, etictr) /* empty */
-#define TRACEECB(action, p) /* empty */
-#define TRACEEND(stagenm, mod, pos, rc, opt) /* empty */
-#define TRACEESN(p) /* empty */
-#define TRACEETG(pts, curetd, tsl, etagimct) /* empty */
-#define TRACEETD(p) /* empty */
-#define TRACEGI(stagenm, gi, mod, pos) /* empty */
-#define TRACEGML(scb, pss, conactsw, conact) /* empty */
-#define TRACEGRP(p) /* empty */
-#define TRACEID(action, p) /* empty */
-#define TRACEMD(p) /* empty */
-#define TRACEMOD(p) /* empty */
-#define TRACEMS(action, code, mslevel, msplevel) /* empty */
-#define TRACENGR(p) /* empty */
-#define TRACEPCB(p) /* empty */
-#define TRACEPRO() /* empty */
-#define TRACESET() /* empty */
-#define TRACESRM(action, pg, gi) /* empty */
-#define TRACESTG(curetd, dataret, rc, nextetd, mexts) /* empty */
-#define TRACESTK(pts, ts2, etictr) /* empty */
-#define TRACETKN(scope, lextoke) /* empty */
-#define TRACEVAL(pcb, atype, aval, tokencnt) /* empty */
-
-#endif /* not TRACE */
diff --git a/usr.bin/sgmls/sgmls/traceset.c b/usr.bin/sgmls/sgmls/traceset.c
deleted file mode 100644
index e57003f..0000000
--- a/usr.bin/sgmls/sgmls/traceset.c
+++ /dev/null
@@ -1,462 +0,0 @@
-#include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
-
-#ifdef TRACE
-
-#include "context.h"
-
-/* Token status: RCHIT RCMISS RCEND RCREQ RCNREQ */
-#define STATUX tags[ts].status
-
-/* Trace variables.
-*/
-int trace = 0; /* Switch: 1=trace state transitions; 0=don't. */
-int atrace = 0; /* Switch: 1=trace attribute activity; 0=don't. */
-int ctrace = 0; /* Switch: 1=trace context checking; 0=don't. */
-int dtrace = 0; /* Switch: 1=trace declaration parsing; 0=don't.*/
-int etrace = 0; /* Switch: 1=trace entity activity; 0=don't.*/
-int gtrace = 0; /* Switch: 1=trace group creations; 0=don't. */
-int itrace = 0; /* Switch: 1=trace ID activity; 0=don't. */
-int mtrace = 0; /* Switch: 1=trace MS activity; 0=don't. */
-int ntrace = 0; /* Switch: 1=trace notation activity; 0=don't. */
-char emd[] = "EMD"; /* For "EMD" parameter type in dtrace calls. */
-
-/* Return a printable representation of c.
-*/
-static
-char *printable(c)
-int c;
-{
- static char buf[5];
- if (c >= 040 && c < 0177) {
- buf[0] = c;
- buf[1] = '\0';
- }
- else
- sprintf(buf, "\\%03o", (UNCH)c);
- return buf;
-}
-
-static
-VOID dotrace(s)
-char *s;
-{
- trace = (s && strchr(s, 't') != 0);
- atrace = (s && strchr(s, 'a') != 0);
- ctrace = (s && strchr(s, 'c') != 0);
- dtrace = (s && strchr(s, 'd') != 0);
- etrace = (s && strchr(s, 'e') != 0);
- gtrace = (s && strchr(s, 'g') != 0);
- itrace = (s && strchr(s, 'i') != 0);
- mtrace = (s && strchr(s, 'm') != 0);
- ntrace = (s && strchr(s, 'n') != 0);
-}
-/* TRACESET: Set switches for tracing body of document.
-*/
-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",
- trace, atrace, ctrace, dtrace, etrace, gtrace, itrace,
- mtrace, ntrace);
-}
-/* TRACEPRO: Set switches for tracing prolog.
- */
-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",
- trace, atrace, dtrace, etrace, gtrace, mtrace, ntrace);
-}
-/* TRACEPCB: Trace character just parsed and other pcb data.
- */
-VOID tracepcb(pcb)
-struct parse *pcb;
-{
- fprintf(stderr, "%-8s %2u-%2u-%2u-%2u from %s [%3d] in %s, %lu:%d.\n",
- pcb->pname, pcb->state, pcb->input, pcb->action,
- pcb->newstate, printable(*FPOS), *FPOS, ENTITY+1, RCNT,
- RSCC+FPOS+1-FBUF);
-}
-/* TRACETKN: Trace character just read during token parse.
- */
-VOID tracetkn(scope, lextoke)
-int scope;
-UNCH lextoke[]; /* Lexical table for token and name parses. */
-{
- fprintf(stderr, "TOKEN %2d-%2d from %s [%3d] in %s, %lu:%d.\n",
- scope, lextoke[*FPOS],
- printable(*FPOS), *FPOS, ENTITY+1, RCNT,
- RSCC+FPOS+1-FBUF);
-}
-/* TRACEGML: Trace state of main SGML driver routine.
- */
-VOID tracegml(scb, pss, conactsw, conact)
-struct restate *scb;
-int pss, conactsw, conact;
-{
- fprintf(stderr,
- "SGML%02d %2d-%2d-%2d-%2d in main driver; conactsw=%d; conact=%d.\n",
- pss, scb[pss].sstate, scb[pss].sinput, scb[pss].saction,
- scb[pss].snext, conactsw, conact);
-}
-/* TRACEVAL: Trace parse of an attribute value that is a token list.
- */
-VOID traceval(pcb, atype, aval, tokencnt)
-struct parse *pcb;
-UNS atype; /* Type of token list expected. */
-UNCH *aval; /* Value string to be parsed as token list. */
-int tokencnt; /* Number of tokens found in attribute value. */
-{
- fprintf(stderr,
- "%-8s %2d-%2d-%2d-%2d at %p, atype=%02x, tokencnt=%d: ",
- pcb->pname, pcb->state, pcb->input, pcb->action,
- pcb->newstate, (UNIV)aval, atype, tokencnt);
- fprintf(stderr, "%s\n", aval);
-}
-/* TRACESTK: Trace entry just placed on tag stack.
- */
-VOID tracestk(pts, ts2, etictr)
-struct tag *pts; /* Stack entry for this tag. */
-int ts2; /* Stack depth. */
-int etictr; /* Number of "netok" tags on stack. */
-{
- fprintf(stderr,
- "STACK %s begun; stack depth %d; tflag=%02x; etictr=%d",
- pts->tetd->etdgi+1, ts2, pts->tflags, etictr);
- fprintf(stderr, " srm=%s.\n",
- pts->tsrm!=SRMNULL ? (char *)(pts->tsrm[0]->ename+1) : "#EMPTY");
-}
-/* TRACEDSK: Trace entry just removed from tag stack.
- */
-VOID tracedsk(pts, ptso, ts3, etictr)
-struct tag *pts; /* Stack entry for new open tag. */
-struct tag *ptso; /* Stack entry for tag just ended. */
-int ts3; /* Stack depth. */
-int etictr; /* Number of "netok" tags on stack. */
-{
- fprintf(stderr,
- "DESTACK %s ended; otflag=%02x; %s resumed; depth=%d; tflag=%02x; etictr=%d",
- ptso->tetd->etdgi+1, ptso->tflags,
- pts->tetd->etdgi+1, ts3, pts->tflags, etictr);
- fprintf(stderr, " srm=%s.\n",
- pts->tsrm!=SRMNULL ? (char *)(pts->tsrm[0]->ename+1) : "#EMPTY");
-}
-/* TRACECON: Trace interactions between content parse and stag/context
- processing.
- */
-VOID tracecon(etagimct, dostag, datarc, pcb, conrefsw, didreq)
-int etagimct; /* Implicitly ended elements left on stack. */
-int dostag; /* 1=retry newetd instead of parsing; 0=parse. */
-int datarc; /* Return code for data: DAF_ or REF_ or zero. */
-struct parse *pcb; /* Parse control block for this parse. */
-int conrefsw; /* 1=content reference att specified; 0=no. */
-int didreq; /* 1=required implied empty tag processed; 0=no.*/
-{
- fprintf(stderr,
- "CONTENT etagimct=%d dostag=%d datarc=%d pname=%s action=%d \
-conrefsw=%d didreq=%d\n",
- etagimct, dostag, datarc, pcb->pname, pcb->action,
- conrefsw, didreq);
-}
-/* TRACESTG: Trace start-tag context validation input and results.
- */
-VOID tracestg(curetd, dataret, rc, nextetd, mexts)
-struct etd *curetd; /* The etd for this tag. */
-int dataret; /* Data pending: DAF_ REF_ 0=not #PCDATA. */
-int rc; /* Return code from context or other test. */
-struct etd *nextetd; /* The etd for a forced start-tag (if rc==2). */
-int mexts; /* >0=stack level of minus grp; -1=plus; 0=none.*/
-{
- fprintf(stderr,
- "STARTTAG newetd=%p; dataret=%d; rc=%d; nextetd=%p; mexts=%d.\n",
- (UNIV)curetd, dataret, rc, (UNIV)nextetd, mexts);
-}
-/* TRACEETG: Trace end-tag matching test on stack.
- */
-VOID traceetg(pts, curetd, tsl, etagimct)
-struct tag *pts; /* Stack entry for this tag. */
-struct etd *curetd; /* The etd for this tag. */
-int tsl; /* Temporary stack level for looping. */
-int etagimct; /* Num of implicitly ended tags left on stack. */
-{
- fprintf(stderr,
- "ENDTAG tsl=%d; newetd=%p; stacketd=%p; tflags=%02x; etagimct=%d.\n",
- tsl, (UNIV)curetd, (UNIV)pts->tetd, pts->tflags, etagimct);
-}
-/* TRACEECB: Trace entity control block activity.
- */
-VOID traceecb(action, p)
-char *action;
-struct entity *p;
-{
- static char estype1[] = " TMMMSEIXCNFPDLK";
- static char estype2[] = " DS ";
- if (!p)
- return;
- fprintf(stderr,
- "%-8s (es=%d) type %c%c entity %s at %p containing ",
- action, es, estype1[p->estore], estype2[p->estore], p->ename+1,
- (UNIV)p);
- if (p->estore==ESN && strcmp(action, "ENTDEF"))
- traceesn(p->etx.n);
- else if (p->etx.x==0)
- fprintf(stderr, "[NOTHING]");
- else
- fprintf(stderr, "%s",
- p->etx.c[0] ? (char *)p->etx.c : "[EMPTY]");
- putc('\n', stderr);
-}
-/* TRACEDCN: Trace data content notation activity.
- */
-VOID tracedcn(p)
-struct dcncb *p;
-{
- fprintf(stderr,
- "DCN dcn=%p; adl=%p; notation is %s\n",
- (UNIV)p, (UNIV)p->adl, p->ename+1);
- if (p->adl)
- traceadl(p->adl);
-}
-/* TRACEESN: Print a data entity control block.
- */
-VOID traceesn(p)
-PNE p;
-{
- fprintf(stderr, "ESN Entity name is %s; entity type is %s.\n",
- (NEENAME(p)!=0) ? ((char *)NEENAME(p))+1 : "[UNDEFINED]",
- /* NEXTYPE(p)); */
- (NEXTYPE(p)==1 ? "CDATA" : (NEXTYPE(p)==2 ? "NDATA" : "SDATA")));
- fprintf(stderr, " System ID is %s\n",
- (NEID(p)!=0) ? (char *)NEID(p) : "[UNDEFINED]");
- if (p->nedcn!=0)
- tracedcn(p->nedcn);
-}
-/* TRACESRM: Print the members of a short reference map.
- */
-VOID tracesrm(action, pg, gi)
-char *action;
-TECB pg;
-UNCH *gi;
-{
- int i = 0; /* Loop counter. */
-
- if (pg==SRMNULL)
- fprintf(stderr, "%-8s SHORTREF table empty for %s.\n", action, gi);
- else {
- fprintf(stderr, "%-8s %s at %p mapped for %s.\n",
- action, pg[0]->ename+1, (UNIV)pg,
- gi ? (char *)gi : "definition");
- while (++i<=lex.s.dtb[0].mapdata)
- if (pg[i])
- fprintf(stderr, "%14s%02u %p %s\n",
- "SR", i, (UNIV)pg[i], pg[i]->ename+1);
- }
-}
-/* TRACEADL: Print an attribute definition list.
- */
-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,
- (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",
- &al[i], ADNAME(al,i), ADFLAGS(al,i), ADTYPE(al,i), ADNUM(al,i),
- ADLEN(al,i), ADVAL(al,i), ADDATA(al,i).x);
- if (ADVAL(al,i)) {
- fprintf(stderr, "%s", ADVAL(al,i));
- if (ADTYPE(al,i)==AENTITY && ADDATA(al,i).n!=0) {
- fprintf(stderr, "=>");
- traceesn(ADDATA(al,i).n);
- }
- else if (ADTYPE(al,i)==ANOTEGRP) {
- fprintf(stderr, "=>");
- tracedcn(ADDATA(al,i).x);
- }
- }
- else
- fprintf(stderr, "[%s]",
- GET(ADFLAGS(al,i), AREQ)
- ? "REQUIRED"
- : (GET(ADFLAGS(al,i), ACURRENT) ? "CURRENT" : "NULL"));
- }
- fprintf(stderr, "\n");
-}
-/* TRACEMOD: Print the members of a model.
- */
-VOID tracemod(pg)
-struct thdr pg[];
-{
- fprintf(stderr, "MODEL %p %02x %d\n",
- (UNIV)&pg[0], pg[0].ttype, pg[0].tu.tnum);
- if ((pg[0].ttype & MKEYWORD) == 0) {
- int i;
-
- for (i = 1; i < pg[0].tu.tnum + 2; i++) {
- if (GET(pg[i].ttype, TTMASK) == TTETD)
- fprintf(stderr, " %p %02x %s\n",
- (UNIV)&pg[i], pg[i].ttype, pg[i].tu.thetd->etdgi+1);
- else if (GET(pg[i].ttype, TTMASK) == TTCHARS)
- fprintf(stderr, " %p %02x %s\n",
- (UNIV)&pg[i], pg[i].ttype, "#PCDATA");
- else
- fprintf(stderr, " %p %02x %d\n",
- (UNIV)&pg[i], pg[i].ttype, pg[i].tu.tnum);
- }
- }
- fprintf(stderr, "\n");
-}
-/* TRACEGRP: Print the members of a name (i.e., etd) group.
- */
-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);
-}
-/* TRACENGR: Print the members of a notation (i.e., dcncb) group.
- */
-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);
-}
-/* TRACEETD: Print an element type definition.
- */
-VOID traceetd(p)
-struct etd *p; /* Pointer to an etd. */
-{
- 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);
- fprintf(stderr, "adl=%p, srm=%s.\n",
- (UNIV)p->adl,
- (p->etdsrm==SRMNULL)
- ? "#EMPTY"
- : (p->etdsrm) ? (char *)(p->etdsrm[0]->ename+1) : "#CURRENT");
-}
-/* TRACEID: Print an ID control block.
- */
-VOID traceid(action, p)
-char *action;
-struct id *p; /* Pointer to an ID. */
-{
- fprintf(stderr, "%-8s %s at %p is %s; ", action, p->idname+1, (UNIV)p,
- p->iddefed ? "defined" : "undefined");
- fprintf(stderr, "last ref=%p\n", (UNIV)p->idrl);
-}
-/* TRACEMD: Trace a markup declaration parameter.
- */
-VOID tracemd(parmid)
-char *parmid; /* Parameter identifier. */
-{
- fprintf(stderr, "MDPARM %-8s for %-8s, token %02d, type %02u, %s.\n",
- mdname, subdcl ? (char *)subdcl : "[NONE]", parmno, pcbmd.action, parmid);
-}
-/* TRACEMS: Trace marked section activity.
- */
-VOID tracems(action, code, mslevel, msplevel)
-int action; /* 1=began new level; 0=resumed previous. */
-int code;
-int mslevel; /* Nesting level of marked sections. */
-int msplevel; /* Nested MS levels subject to special parse. */
-{
- fprintf(stderr,
- "MS%c %2d %s nesting level %d (msp %d).\n",
- (action ? ' ' : 'E'), code, (action ? "began" : "resumed"),
- mslevel, msplevel);
-}
-
-static
-VOID tracehits(h)
-unsigned long *h;
-{
- int i;
- fprintf(stderr, " H=");
- for (i = grplongs - 1; i >= 0; --i)
- fprintf(stderr, "%0*lx", LONGBITS/4, h[i]);
-}
-
-/* TRACEGI: Trace GI testing stages in CONTEXT.C processing.
- */
-VOID tracegi(stagenm, gi, mod, pos)
-char *stagenm;
-struct etd *gi; /* ETD of new GI. */
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-{
- int i = 0; /* Loop counter. */
-
- fprintf(stderr, "%-10s %d:", stagenm, P);
- while (++i<=P)
- fprintf(stderr, " %d-%d", pos[i].g, pos[i].t);
- fprintf(stderr, " (%u) gocc=%02x gtype=%02x gnum=%d",
- M, GOCC, GTYPE, GNUM);
- tracehits(H);
- fprintf(stderr, " status=%d Tstart=%d\n", STATUX, Tstart);
- fprintf(stderr,
- "=>%-8s tocc=%02x ttype=%02x thetd=%p (%s) gietd=%p (%s)\n",
- tags[ts].tetd->etdgi+1, TOCC, TTYPE, (UNIV)TOKEN.tu.thetd,
- (TTYPE
- ? (TTYPE==TTETD ? (char *)(TOKEN.tu.thetd->etdgi+1) : "#GROUP")
- : "#PCDATA"),
- (UNIV)gi,
- (gi==ETDCDATA ? "#PCDATA" : (char *)(gi->etdgi+1)));
-}
-/* TRACEEND: Trace testing for end of group in CONTEXT.C processing.
- */
-VOID traceend(stagenm, mod, pos, rc, opt)
-char *stagenm;
-struct thdr mod[]; /* Model of current open element. */
-struct mpos pos[]; /* Position in open element's model. */
-int rc; /* Return code: RCNREQ RCHIT RCMISS RCEND */
-int opt; /* ALLHIT parm: 1=test optionals; 0=ignore. */
-{
- int i = 0; /* Loop counter. */
-
- fprintf(stderr, "%-10s %d:", stagenm, P);
- while (++i<=P)
- fprintf(stderr, " %d-%d", pos[i].g, pos[i].t);
- fprintf(stderr, " (%u) gocc=%02x gtype=%02x gnum=%d",
- M, GOCC, GTYPE, GNUM);
- tracehits(H);
- fprintf(stderr, " status=%d Tstart=%d\n", STATUX, Tstart);
- fprintf(stderr, "=>%-8s tocc=%02x ttype=%02x thetd=%p (%s)",
- tags[ts].tetd->etdgi+1, TOCC, TTYPE, (UNIV)TOKEN.tu.thetd,
- (TTYPE
- ? (TTYPE==TTETD ? (char *)(TOKEN.tu.thetd->etdgi+1) : "#GROUP")
- : "#PCDATA"));
- fprintf(stderr, " rc=%d offbitT=%d allhit=%d\n",
- rc, offbit(H, (int)T, GNUM), allhit(&GHDR, H, 0, opt));
-}
-
-#endif /* TRACE */
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/unix.cfg b/usr.bin/sgmls/sgmls/unix.cfg
deleted file mode 100644
index 0bc8410..0000000
--- a/usr.bin/sgmls/sgmls/unix.cfg
+++ /dev/null
@@ -1,147 +0,0 @@
-/* unix.cfg: Configuration file for sgmls on Unix. */
-
-/* A list of filename templates to use for searching for external entities.
-The filenames are separated by the character specified in PATH_FILE_SEP.
-See sgmls.man for details. */
-#define DEFAULT_PATH "/usr/local/lib/sgml/%O/%C/%T:%N.%X:%N.%D"
-/* The character that separates the filenames templates. */
-#define PATH_FILE_SEP ':'
-/* The character that separates filenames in a system identifier.
-Usually the same as PATH_FILE_SEP. */
-#define SYSID_FILE_SEP ':'
-/* The environment variable that contains the list of filename templates. */
-#define PATH_ENV_VAR "SGML_PATH"
-
-/* MIN_DAT_SUBS_FROM and MIN_DATS_SUBS_TO tell sgmls how to transform a name
-or system identifier into a legal filename. A character in
-MIN_DAT_SUBS_FROM will be transformed into the character in the
-corresponding position in MIN_DAT_SUBS_TO. If there is no such
-position, then the character is removed. */
-/* This says that spaces should be transformed to underscores, and
-slashes to percents. */
-#define MIN_DAT_SUBS_FROM " /"
-#define MIN_DAT_SUBS_TO "_%"
-
-/* Define this to allow tracing. */
-/* #define TRACE 1 */
-
-/* Define this you want support for subdocuments. This is implemented
-using features that are not part of Standard C, so you might not want
-to define it if you are porting to a new system. Otherwise I suggest
-you leave it defined. */
-#define SUPPORT_SUBDOC 1
-
-/* Define HAVE_EXTENDED_PRINTF if your *printf functions supports
-X/Open extensions; if they do, then, for example,
-
- printf("%2$s%1$s", "bar", "foo")
-
-should print `foobar'. */
-
-/* #define HAVE_EXTENDED_PRINTF 1 */
-
-/* Define HAVE_CAT if your system provides the X/Open message
-catalogue functions catopen() and catgets(), and you want to use them.
-An implementations of these functions is included and will be used if
-you don't define this. On SunOS 4.1.1, if you do define this you
-should set CC=/usr/xpg2bin/cc in the makefile. */
-
-/* #define HAVE_CAT 1 */
-
-#ifdef __STDC__
-/* Define this if your compiler supports prototypes. */
-#define USE_PROTOTYPES 1
-#endif
-
-/* Can't use <stdarg.h> without prototypes. */
-#ifndef USE_PROTOTYPES
-#define VARARGS 1
-#endif
-
-/* If your compiler defines __STDC__ but doesn't provide <stdarg.h>,
-you must define VARARGS yourself here. */
-/* #define VARARGS 1 */
-
-/* Define this if you do not have strerror(). */
-#define STRERROR_MISSING 1
-
-/* Define this unless the character testing functions in ctype.h
-are defined for all values representable as an unsigned char. You do
-not need to define this if your system is ANSI C conformant. You
-should define for old Unix systems. */
-/* #define USE_ISASCII 1 */
-
-/* Define this if your system provides the BSD style string operations
-rather than ANSI C ones (eg bcopy() rather than memcpy(), and index()
-rather than strchr()). */
-/* #define BSD_STRINGS 1 */
-
-/* Define this if you have getopt(). */
-#define HAVE_GETOPT 1
-
-/* Define this if you have access(). */
-#define HAVE_ACCESS 1
-
-/* Define this if you have <unistd.h>. */
-#define HAVE_UNISTD_H 1
-
-/* Define this if you have <sys/stat.h>. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define this if you have waitpid(). */
-#define HAVE_WAITPID 1
-
-/* Define this if your system is POSIX.1 (ISO 9945-1:1990) compliant. */
-#define POSIX 1
-
-/* Define this if you have the vfork() system call. */
-#define HAVE_VFORK 1
-
-/* Define this if you have <vfork.h>. */
-#define HAVE_VFORK_H 1
-
-/* Define this if you don't have <stdlib.h> */
-/* #define STDLIB_H_MISSING 1 */
-
-/* Define this if you don't have <stddef.h> */
-/* #define STDDEF_H_MISSING 1 */
-
-/* Define this if you don't have <limits.h> */
-/* #define LIMITS_H_MISSING 1 */
-
-/* Define this if you don't have remove(); unlink() will be used instead. */
-#define REMOVE_MISSING 1
-
-/* Define this if you don't have raise(); kill() will be used instead. */
-#define RAISE_MISSING 1
-
-/* Define this if you don't have fsetpos() and fgetpos(). */
-#define FPOS_MISSING 1
-
-/* Universal pointer type. */
-/* If your compiler doesn't fully support void *, change `void' to `char'. */
-typedef void *UNIV;
-
-/* If your compiler doesn't support void as a function return type,
-change `void' to `int'. */
-typedef void VOID;
-
-/* If you don't have an ANSI C conformant <limits.h>, define
-CHAR_SIGNED as 1 or 0 according to whether the `char' type is signed.
-The <limits.h> on some versions of System Release V 3.2 is not ANSI C
-conformant: the value of CHAR_MIN is 0 even though the `char' type is
-signed. */
-
-/* #define CHAR_SIGNED 1 */
-/* #define CHAR_SIGNED 0 */
-#ifndef CHAR_SIGNED
-#include <limits.h>
-#if CHAR_MIN < 0
-#define CHAR_SIGNED 1
-#else
-#define CHAR_SIGNED 0
-#endif
-#endif /* not CHAR_SIGNED */
-
-/* Assume the system character set is ISO Latin-1. */
-#include "latin1.h"
diff --git a/usr.bin/sgmls/sgmls/unixproc.c b/usr.bin/sgmls/sgmls/unixproc.c
deleted file mode 100644
index 9e79d62..0000000
--- a/usr.bin/sgmls/sgmls/unixproc.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* unixproc.c -
-
- Unix implementation of run_process().
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-#include "config.h"
-
-#ifdef SUPPORT_SUBDOC
-
-#ifdef POSIX
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#endif /* POSIX */
-
-#include "std.h"
-#include "entity.h"
-#include "appl.h"
-
-#ifndef POSIX
-
-#define WIFSTOPPED(s) (((s) & 0377) == 0177)
-#define WIFSIGNALED(s) (((s) & 0377) != 0 && ((s) & 0377 != 0177))
-#define WIFEXITED(s) (((s) & 0377) == 0)
-#define WEXITSTATUS(s) (((s) >> 8) & 0377)
-#define WTERMSIG(s) ((s) & 0177)
-#define WSTOPSIG(s) (((s) >> 8) & 0377)
-#define _SC_OPEN_MAX 0
-#define sysconf(name) (20)
-typedef int pid_t;
-
-#endif /* not POSIX */
-
-#ifndef HAVE_VFORK
-#define vfork() fork()
-#endif /* not HAVE_VFORK */
-
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
-#endif /* HAVE_VFORK_H */
-
-int run_process(argv)
-char **argv;
-{
- pid_t pid;
- int status;
- int ret;
-
- /* Can't trust Unix implementations to support fflush(NULL). */
- fflush(stderr);
- fflush(stdout);
-
- pid = vfork();
- if (pid == 0) {
- /* child */
- int i;
- int open_max = (int)sysconf(_SC_OPEN_MAX);
-
- for (i = 3; i < open_max; i++)
- (void)close(i);
- execvp(argv[0], argv);
- appl_error(E_EXEC, argv[0], strerror(errno));
- fflush(stderr);
- _exit(127);
- }
- if (pid < 0) {
- appl_error(E_FORK, strerror(errno));
- return -1;
- }
- /* parent */
- while ((ret = wait(&status)) != pid)
- if (ret < 0) {
- appl_error(E_WAIT, strerror(errno));
- return -1;
- }
- if (WIFSIGNALED(status)) {
- appl_error(E_SIGNAL, argv[0], WTERMSIG(status));
- return -1;
- }
- /* Must have exited normally. */
- return WEXITSTATUS(status);
-}
-
-#endif /* SUPPORT_SUBDOC */
-
-/*
-Local Variables:
-c-indent-level: 5
-c-continued-statement-offset: 5
-c-brace-offset: -5
-c-argdecl-indent: 0
-c-label-offset: -5
-End:
-*/
diff --git a/usr.bin/sgmls/sgmls/version.c b/usr.bin/sgmls/sgmls/version.c
deleted file mode 100644
index f3b2d7c..0000000
--- a/usr.bin/sgmls/sgmls/version.c
+++ /dev/null
@@ -1 +0,0 @@
-char *version_string = "1.1.91";
diff --git a/usr.bin/sgmls/sgmls/xfprintf.c b/usr.bin/sgmls/sgmls/xfprintf.c
deleted file mode 100644
index 1c50469..0000000
--- a/usr.bin/sgmls/sgmls/xfprintf.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/* xfprintf.c -
- X/Open extended v?fprintf implemented in terms of v?fprintf.
-
- Written by James Clark (jjc@jclark.com).
-*/
-
-/* Compile with:
-
- -DVARARGS to use varargs.h instead of stdarg.h
- -DLONG_DOUBLE_MISSING if your compiler doesn't like `long double'
- -DFP_SUPPORT to include floating point stuff
-*/
-
-#include "config.h"
-
-#ifndef HAVE_EXTENDED_PRINTF
-
-#include "std.h"
-
-#ifdef lint
-/* avoid stupid lint warnings */
-#undef va_arg
-#define va_arg(ap, type) (ap, (type)0)
-#endif
-
-#ifdef FP_SUPPORT
-#ifdef LONG_DOUBLE_MISSING
-typedef double long_double;
-#else
-typedef long double long_double;
-#endif
-#endif /* FP_SUPPORT */
-
-#ifdef USE_PROTOTYPES
-#define P(parms) parms
-#else
-#define P(parms) ()
-#endif
-
-#ifdef VARARGS
-typedef int (*printer)();
-#else
-typedef int (*printer)(UNIV, const char *, ...);
-#endif
-
-enum arg_type {
- NONE,
- INT,
- UNSIGNED,
- LONG,
- UNSIGNED_LONG,
-#ifdef FP_SUPPORT
- DOUBLE,
- LONG_DOUBLE,
-#endif /* FP_SUPPORT */
- PCHAR,
- PINT,
- PLONG,
- PSHORT
-};
-
-union arg {
- int i;
- unsigned u;
- long l;
- unsigned long ul;
-#ifdef FP_SUPPORT
- double d;
- long_double ld;
-#endif /* FP_SUPPORT */
- char *pc;
- UNIV pv;
- int *pi;
- short *ps;
- long *pl;
-};
-
-#define NEXT 0
-#define MISSING 10
-
-struct spec {
- enum arg_type type;
- char pos;
- char field_width;
- char precision;
-};
-
-#define FLAG_CHARS "-+ #0"
-
-static int parse_spec P((const char **, struct spec *));
-static int find_arg_types P((const char *, enum arg_type *));
-static void get_arg P((enum arg_type, va_list *, union arg *));
-static int do_arg P((UNIV, printer, const char *, enum arg_type, union arg *));
-static int xdoprt P((UNIV, printer, const char *, va_list));
-static int printit P((UNIV, printer, const char *, va_list, int, union arg *));
-static int maybe_positional P((const char *));
-
-/* Return 1 if sucessful, 0 otherwise. **pp points to character after % */
-
-static int parse_spec(pp, sp)
-const char **pp;
-struct spec *sp;
-{
- char modifier = 0;
- sp->pos = NEXT;
- if (isdigit((unsigned char)(**pp)) && (*pp)[1] == '$') {
- if (**pp == '0')
- return 0;
- sp->pos = **pp - '0';
- *pp += 2;
- }
-
- while (**pp != '\0' && strchr(FLAG_CHARS, **pp))
- *pp += 1;
-
- /* handle the field width */
-
- sp->field_width = MISSING;
- if (**pp == '*') {
- *pp += 1;
- if (isdigit((unsigned char)**pp) && (*pp)[1] == '$') {
- if (**pp == '0')
- return 0;
- sp->field_width = **pp - '0';
- *pp += 2;
- }
- else
- sp->field_width = NEXT;
- }
- else {
- while (isdigit((unsigned char)**pp))
- *pp += 1;
- }
-
- /* handle the precision */
- sp->precision = MISSING;
- if (**pp == '.') {
- *pp += 1;
- if (**pp == '*') {
- *pp += 1;
- if (isdigit((unsigned char)**pp) && (*pp)[1] == '$') {
- if (**pp == '0')
- return 0;
- sp->precision = **pp - '0';
- *pp += 2;
- }
- else
- sp->precision = NEXT;
- }
- else {
- while (isdigit((unsigned char)**pp))
- *pp += 1;
- }
- }
- /* handle h l or L */
-
- if (**pp == 'h' || **pp == 'l' || **pp == 'L') {
- modifier = **pp;
- *pp += 1;
- }
-
- switch (**pp) {
- case 'd':
- case 'i':
- sp->type = modifier == 'l' ? LONG : INT;
- break;
- case 'o':
- case 'u':
- case 'x':
- case 'X':
- sp->type = modifier == 'l' ? UNSIGNED_LONG : UNSIGNED;
- break;
-#ifdef FP_SUPPORT
- case 'e':
- case 'E':
- case 'f':
- case 'g':
- case 'G':
- sp->type = modifier == 'L' ? LONG_DOUBLE : DOUBLE;
- break;
-#endif /* FP_SUPPORT */
- case 'c':
- sp->type = INT;
- break;
- case 's':
- sp->type = PCHAR;
- break;
- case 'p':
- /* a pointer to void has the same representation as a pointer to char */
- sp->type = PCHAR;
- break;
- case 'n':
- if (modifier == 'h')
- sp->type = PSHORT;
- else if (modifier == 'l')
- sp->type = PLONG;
- else
- sp->type = PINT;
- break;
- case '%':
- sp->type = NONE;
- break;
- default:
- return 0;
- }
- *pp += 1;
- return 1;
-}
-
-
-static int find_arg_types(format, arg_type)
- const char *format;
- enum arg_type *arg_type;
-{
- int i, pos;
- const char *p;
- struct spec spec;
-
- for (i = 0; i < 9; i++)
- arg_type[i] = NONE;
-
- pos = 0;
-
- p = format;
- while (*p)
- if (*p == '%') {
- p++;
- if (!parse_spec(&p, &spec))
- return 0;
- if (spec.type != NONE) {
- int n;
- if (spec.pos == NEXT)
- n = pos++;
- else
- n = spec.pos - 1;
- if (n < 9) {
- enum arg_type t = arg_type[n];
- if (t != NONE && t != spec.type)
- return 0;
- arg_type[n] = spec.type;
- }
- }
- if (spec.field_width != MISSING) {
- int n;
- if (spec.field_width == NEXT)
- n = pos++;
- else
- n = spec.field_width - 1;
- if (n < 9) {
- enum arg_type t = arg_type[n];
- if (t != NONE && t != INT)
- return 0;
- arg_type[n] = INT;
- }
- }
- if (spec.precision != MISSING) {
- int n;
- if (spec.precision == NEXT)
- n = pos++;
- else
- n = spec.precision - 1;
- if (n < 9) {
- enum arg_type t = arg_type[n];
- if (t != NONE && t != INT)
- return 0;
- arg_type[n] = INT;
- }
- }
- }
- else
- p++;
- return 1;
-}
-
-static void get_arg(arg_type, app, argp)
- enum arg_type arg_type;
- va_list *app;
- union arg *argp;
-{
- switch (arg_type) {
- case NONE:
- break;
- case INT:
- argp->i = va_arg(*app, int);
- break;
- case UNSIGNED:
- argp->u = va_arg(*app, unsigned);
- break;
- case LONG:
- argp->l = va_arg(*app, long);
- break;
- case UNSIGNED_LONG:
- argp->ul = va_arg(*app, unsigned long);
- break;
-#ifdef FP_SUPPORT
- case DOUBLE:
- argp->d = va_arg(*app, double);
- break;
- case LONG_DOUBLE:
- argp->ld = va_arg(*app, long_double);
- break;
-#endif /* FP_SUPPORT */
- case PCHAR:
- argp->pc = va_arg(*app, char *);
- break;
- case PINT:
- argp->pi = va_arg(*app, int *);
- break;
- case PSHORT:
- argp->ps = va_arg(*app, short *);
- break;
- case PLONG:
- argp->pl = va_arg(*app, long *);
- break;
- default:
- abort();
- }
-}
-
-static int do_arg(handle, func, buf, arg_type, argp)
- UNIV handle;
- printer func;
- const char *buf;
- enum arg_type arg_type;
- union arg *argp;
-{
- switch (arg_type) {
- case NONE:
- return (*func)(handle, buf);
- case INT:
- return (*func)(handle, buf, argp->i);
- case UNSIGNED:
- return (*func)(handle, buf, argp->u);
- case LONG:
- return (*func)(handle, buf, argp->l);
- case UNSIGNED_LONG:
- return (*func)(handle, buf, argp->ul);
-#ifdef FP_SUPPORT
- case DOUBLE:
- return (*func)(handle, buf, argp->d);
- case LONG_DOUBLE:
- return (*func)(handle, buf, argp->ld);
-#endif /* FP_SUPPORT */
- case PCHAR:
- return (*func)(handle, buf, argp->pc);
- case PINT:
- return (*func)(handle, buf, argp->pi);
- case PSHORT:
- return (*func)(handle, buf, argp->ps);
- case PLONG:
- return (*func)(handle, buf, argp->pl);
- default:
- abort();
- }
- /* NOTREACHED */
-}
-
-static int printit(handle, func, p, ap, nargs, arg)
- UNIV handle;
- printer func;
- const char *p;
- va_list ap;
- int nargs;
- union arg *arg;
-{
- char buf[512]; /* enough for a spec */
- int count = 0;
- int pos = 0;
-
- while (*p)
- if (*p == '%') {
- char *q;
- struct spec spec;
- const char *start;
- int had_field_width;
- union arg *argp;
- union arg a;
- int res;
-
- start = ++p;
- if (!parse_spec(&p, &spec))
- abort(); /* should have caught it in find_arg_types */
-
- buf[0] = '%';
- q = buf + 1;
-
- if (spec.pos != NEXT)
- start += 2;
-
- /* substitute in precision and field width if necessary */
- had_field_width = 0;
- while (start < p) {
- if (*start == '*') {
- char c;
- int n, val;
-
- start++;
- if (!had_field_width && spec.field_width != MISSING) {
- c = spec.field_width;
- had_field_width = 1;
- }
- else
- c = spec.precision;
- if (c == NEXT)
- n = pos++;
- else {
- start += 2;
- n = c - 1;
- }
- if (n >= nargs)
- val = va_arg(ap, int);
- else
- val = arg[n].i;
-
- /* ignore negative precision */
- if (val >= 0 || q[-1] != '.') {
- (void)sprintf(q, "%d", val);
- q = strchr(q, '\0');
- }
- }
- else
- *q++ = *start++;
- }
- *q++ = '\0';
-
- argp = 0;
- if (spec.type != NONE) {
- int n = spec.pos == NEXT ? pos++ : spec.pos - 1;
- if (n >= nargs) {
- get_arg(spec.type, &ap, &a);
- argp = &a;
- }
- else
- argp = arg + n;
- }
-
- res = do_arg(handle, func, buf, spec.type, argp);
- if (res < 0)
- return -1;
- count += res;
- }
- else {
- if ((*func)(handle, "%c", *p++) < 0)
- return -1;
- count++;
- }
- return count;
-}
-
-/* Do a quick check to see if it may contains any positional thingies. */
-
-static int maybe_positional(format)
- const char *format;
-{
- const char *p;
-
- p = format;
- for (;;) {
- p = strchr(p, '$');
- if (!p)
- return 0;
- if (p - format >= 2
- && isdigit((unsigned char)p[-1])
- && (p[-2] == '%' || p[-2] == '*'))
- break; /* might be a positional thingy */
- }
- return 1;
-}
-
-static int xdoprt(handle, func, format, ap)
- UNIV handle;
- printer func;
- const char *format;
- va_list ap;
-{
- enum arg_type arg_type[9];
- union arg arg[9];
- int nargs, i;
-
- if (!find_arg_types(format, arg_type))
- return -1;
-
- for (nargs = 0; nargs < 9; nargs++)
- if (arg_type[nargs] == NONE)
- break;
-
- 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);
-
- return printit(handle, func, format, ap, nargs, arg);
-}
-
-#ifdef VARARGS
-static int do_fprintf(va_alist) va_dcl
-#else
-static int do_fprintf(UNIV p, const char *format,...)
-#endif
-{
-#ifdef VARARGS
- UNIV p;
- const char *format;
-#endif
- va_list ap;
- int res;
-
-#ifdef VARARGS
- va_start(ap);
- p = va_arg(ap, UNIV);
- format = va_arg(ap, char *);
-#else
- va_start(ap, format);
-#endif
-
- res = vfprintf((FILE *)p, format, ap);
- va_end(ap);
- return res;
-}
-
-#ifdef VARARGS
-int xfprintf(va_alist) va_dcl
-#else
-int xfprintf(FILE *fp, const char *format, ...)
-#endif
-{
-#ifdef VARARGS
- FILE *fp;
- char *format;
-#endif
- va_list ap;
- int res;
-
-#ifdef VARARGS
- va_start(ap);
- fp = va_arg(ap, FILE *);
- format = va_arg(ap, char *);
-#else
- va_start(ap, format);
-#endif
- if (maybe_positional(format))
- res = xdoprt((UNIV)fp, do_fprintf, format, ap);
- else
- res = vfprintf(fp, format, ap);
- va_end(ap);
- return res;
-}
-
-int xvfprintf(fp, format, ap)
- FILE *fp;
- const char *format;
- va_list ap;
-{
- int res;
- if (maybe_positional(format))
- res = xdoprt((UNIV)fp, do_fprintf, format, ap);
- else
- res = vfprintf(fp, format, ap);
- return res;
-}
-
-#endif /* not HAVE_EXTENDED_PRINTF */
diff --git a/usr.bin/sgmls/unix.cfg b/usr.bin/sgmls/unix.cfg
deleted file mode 100644
index 4245511..0000000
--- a/usr.bin/sgmls/unix.cfg
+++ /dev/null
@@ -1,165 +0,0 @@
-/* unix.cfg: Configuration file for sgmls on Unix. */
-
-/* A list of filename templates to use for searching for external entities.
-The filenames are separated by the character specified in PATH_FILE_SEP.
-See sgmls.man for details. */
-#define DEFAULT_PATH "/usr/local/lib/sgml/%O/%C/%T:%N.%X:%N.%D"
-/* The character that separates the filenames templates. */
-#define PATH_FILE_SEP ':'
-/* The character that separates filenames in a system identifier.
-Usually the same as PATH_FILE_SEP. */
-#define SYSID_FILE_SEP ':'
-/* The environment variable that contains the list of filename templates. */
-#define PATH_ENV_VAR "SGML_PATH"
-/* A macro that returns non-zero if the filename is relative to the
- current directory. */
-#define FILE_IS_RELATIVE(p) ((p)[0] != '/')
-/* A string containing the characters that can separate the directory
- part of a filename from the basename. */
-#define DIR_BASE_SEP "/"
-/* The environment variable that contains the list of catalog entry files.
- Filenames are separated by PATH_FILE_SEP. */
-#define CATALOG_FILES_ENV_VAR "SGML_CATALOG_FILES"
-/* Default list of catalog entry files. */
-#define DEFAULT_CATALOG_FILES "CATALOG:/usr/local/lib/sgml/CATALOG"
-
-/* MIN_DAT_SUBS_FROM and MIN_DATS_SUBS_TO tell sgmls how to transform a name
-or system identifier into a legal filename. A character in
-MIN_DAT_SUBS_FROM will be transformed into the character in the
-corresponding position in MIN_DAT_SUBS_TO. If there is no such
-position, then the character is removed. */
-/* This says that spaces should be transformed to underscores, and
-slashes to percents. */
-#define MIN_DAT_SUBS_FROM " /"
-#define MIN_DAT_SUBS_TO "_%"
-
-/* Define this to allow tracing. */
-/* #define TRACE 1 */
-
-/* Define this you want support for subdocuments. This is implemented
-using features that are not part of Standard C, so you might not want
-to define it if you are porting to a new system. Otherwise I suggest
-you leave it defined. */
-#define SUPPORT_SUBDOC 1
-
-/* Define HAVE_EXTENDED_PRINTF if your *printf functions supports
-X/Open extensions; if they do, then, for example,
-
- printf("%2$s%1$s", "bar", "foo")
-
-should print `foobar'. */
-
-/* #define HAVE_EXTENDED_PRINTF 1 */
-
-/* Define HAVE_CAT if your system provides the X/Open message
-catalogue functions catopen() and catgets(), and you want to use them.
-An implementations of these functions is included and will be used if
-you don't define this. On SunOS 4.1.1, if you do define this you
-should set CC=/usr/xpg2bin/cc in the makefile. */
-
-/* #define HAVE_CAT 1 */
-
-#ifdef __STDC__
-/* Define this if your compiler supports prototypes. */
-#define USE_PROTOTYPES 1
-#endif
-
-/* Can't use <stdarg.h> without prototypes. */
-#ifndef USE_PROTOTYPES
-#define VARARGS 1
-#endif
-
-/* If your compiler defines __STDC__ but doesn't provide <stdarg.h>,
-you must define VARARGS yourself here. */
-/* #define VARARGS 1 */
-
-/* Define this if you do not have strerror(). */
-#define STRERROR_MISSING 1
-
-/* Define this unless the character testing functions in ctype.h
-are defined for all values representable as an unsigned char. You do
-not need to define this if your system is ANSI C conformant. You
-should define for old Unix systems. */
-/* #define USE_ISASCII 1 */
-
-/* Define this if your system provides the BSD style string operations
-rather than ANSI C ones (eg bcopy() rather than memcpy(), and index()
-rather than strchr()). */
-/* #define BSD_STRINGS 1 */
-
-/* Define this if you have getopt(). */
-#define HAVE_GETOPT 1
-
-/* Define this if you have access(). */
-#define HAVE_ACCESS 1
-
-/* Define this if you have <unistd.h>. */
-#define HAVE_UNISTD_H 1
-
-/* Define this if you have <sys/stat.h>. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define this if you have waitpid(). */
-#define HAVE_WAITPID 1
-
-/* Define this if your system is POSIX.1 (ISO 9945-1:1990) compliant. */
-#define POSIX 1
-
-/* Define this if you have the vfork() system call. */
-#define HAVE_VFORK 1
-
-/* Define this if you have <vfork.h>. */
-#define HAVE_VFORK_H 1
-
-/* Define this if you don't have <stdlib.h> */
-/* #define STDLIB_H_MISSING 1 */
-
-/* Define this if you don't have <stddef.h> */
-/* #define STDDEF_H_MISSING 1 */
-
-/* Define this if you don't have <limits.h> */
-/* #define LIMITS_H_MISSING 1 */
-
-/* Define this if you don't have remove(); unlink() will be used instead. */
-#define REMOVE_MISSING 1
-
-/* Define this if you don't have raise(); kill() will be used instead. */
-#define RAISE_MISSING 1
-
-/* Define this if you don't have fsetpos() and fgetpos(). */
-#define FPOS_MISSING 1
-
-/* Universal pointer type. */
-/* If your compiler doesn't fully support void *, change `void' to `char'. */
-typedef void *UNIV;
-
-/* If your compiler doesn't support void as a function return type,
-change `void' to `int'. */
-typedef void VOID;
-
-/* If your compiler doesn't understand const, define it to be nothing. */
-#ifndef __STDC__
-#ifndef const
-#define const /* as nothing */
-#endif
-#endif
-
-/* If you don't have an ANSI C conformant <limits.h>, define
-CHAR_SIGNED as 1 or 0 according to whether the `char' type is signed.
-The <limits.h> on some versions of System Release V 3.2 is not ANSI C
-conformant: the value of CHAR_MIN is 0 even though the `char' type is
-signed. */
-
-/* #define CHAR_SIGNED 1 */
-/* #define CHAR_SIGNED 0 */
-#ifndef CHAR_SIGNED
-#include <limits.h>
-#if CHAR_MIN < 0
-#define CHAR_SIGNED 1
-#else
-#define CHAR_SIGNED 0
-#endif
-#endif /* not CHAR_SIGNED */
-
-/* Assume the system character set is ISO Latin-1. */
-#include "latin1.h"
OpenPOWER on IntegriCloud