From df0392fc255cf7e082d0cb26f1a940c2777759d4 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 3 Jul 2021 18:34:31 -0600 Subject: [PATCH] dthelp/parser.ccdf: delete never used module --- cde/programs/dthelp/parser.ccdf/Imakefile | 12 - .../bitmaps/CHANGE-FOR-NEXT-RELEASE | 10 - .../dthelp/parser.ccdf/bitmaps/cauticon.pm | 43 - .../dthelp/parser.ccdf/bitmaps/noteicon.pm | 42 - .../dthelp/parser.ccdf/bitmaps/warnicon.pm | 43 - .../dthelp/parser.ccdf/helpcomp/Imakefile | 17 - .../dthelp/parser.ccdf/helpcomp/helpcomp.c | 479 --- .../dthelp/parser.ccdf/helptag/cauticon.pm | 43 - .../dthelp/parser.ccdf/helptag/helpchar.ent | 327 -- .../dthelp/parser.ccdf/helptag/helptag | 531 --- .../dthelp/parser.ccdf/helptag/helptag.man | 345 -- .../dthelp/parser.ccdf/helptag/noteicon.pm | 42 - .../dthelp/parser.ccdf/helptag/warnicon.pm | 43 - .../dthelp/parser.ccdf/htag/Imakefile | 12 - .../dthelp/parser.ccdf/htag/build/Imakefile | 83 - .../dthelp/parser.ccdf/htag/build/build.c | 72 - .../dthelp/parser.ccdf/htag/build/build.h | 424 -- .../dthelp/parser.ccdf/htag/build/buildutl.c | 170 - .../dthelp/parser.ccdf/htag/build/context.dat | 819 ---- .../dthelp/parser.ccdf/htag/build/eltree.c | 67 - .../dthelp/parser.ccdf/htag/build/except.c | 45 - .../dthelp/parser.ccdf/htag/build/fsa.c | 740 ---- .../dthelp/parser.ccdf/htag/build/out.c | 668 --- .../dthelp/parser.ccdf/htag/build/param.c | 329 -- .../dthelp/parser.ccdf/htag/build/proto.h | 231 -- .../dthelp/parser.ccdf/htag/build/scan.c | 171 - .../dthelp/parser.ccdf/htag/build/sref.c | 204 - .../dthelp/parser.ccdf/htag/build/tree.c | 74 - .../dthelp/parser.ccdf/htag/eltdef/Imakefile | 81 - .../parser.ccdf/htag/eltdef/context.dat | 722 ---- .../dthelp/parser.ccdf/htag/eltdef/eltdef.c | 93 - .../dthelp/parser.ccdf/htag/eltdef/eltdef.h | 240 -- .../dthelp/parser.ccdf/htag/eltdef/eltutil.c | 672 --- .../dthelp/parser.ccdf/htag/eltdef/entity.c | 73 - .../dthelp/parser.ccdf/htag/eltdef/proto.h | 139 - .../dthelp/parser.ccdf/htag/eltdef/scan.c | 162 - .../dthelp/parser.ccdf/htag/helptag/Imakefile | 88 - .../parser.ccdf/htag/helptag/calculat.c | 37 - .../parser.ccdf/htag/helptag/calculat.h | 828 ---- .../parser.ccdf/htag/helptag/charconv.h | 156 - .../dthelp/parser.ccdf/htag/helptag/custom.c | 382 -- .../dthelp/parser.ccdf/htag/helptag/default.c | 138 - .../dthelp/parser.ccdf/htag/helptag/delim.bld | 73 - .../dthelp/parser.ccdf/htag/helptag/delim.elt | 58 - .../dthelp/parser.ccdf/htag/helptag/delim.par | 39 - .../dthelp/parser.ccdf/htag/helptag/figure.c | 29 - .../dthelp/parser.ccdf/htag/helptag/fproto.h | 447 -- .../dthelp/parser.ccdf/htag/helptag/global.h | 740 ---- .../dthelp/parser.ccdf/htag/helptag/grphpar.c | 29 - .../dthelp/parser.ccdf/htag/helptag/grphpar.h | 28 - .../dthelp/parser.ccdf/htag/helptag/help.c | 2863 ------------- .../dthelp/parser.ccdf/htag/helptag/help.if | 3689 ----------------- .../dthelp/parser.ccdf/htag/helptag/hptag.dtd | 1572 ------- .../dthelp/parser.ccdf/htag/helptag/make.c | 48 - .../dthelp/parser.ccdf/htag/helptag/need.c | 24 - .../dthelp/parser.ccdf/htag/helptag/option.c | 346 -- .../dthelp/parser.ccdf/htag/helptag/out.c | 533 --- .../dthelp/parser.ccdf/htag/helptag/roman8.h | 288 -- .../dthelp/parser.ccdf/htag/helptag/special.c | 227 - .../dthelp/parser.ccdf/htag/helptag/special.h | 244 -- .../dthelp/parser.ccdf/htag/helptag/table.c | 24 - .../dthelp/parser.ccdf/htag/helptag/tex.h | 288 -- .../dthelp/parser.ccdf/htag/helptag/xref.c | 532 --- .../dthelp/parser.ccdf/htag/parser/Imakefile | 125 - .../dthelp/parser.ccdf/htag/parser/actutil.c | 318 -- .../dthelp/parser.ccdf/htag/parser/addinput.c | 24 - .../dthelp/parser.ccdf/htag/parser/charconv.h | 155 - .../dthelp/parser.ccdf/htag/parser/closent.c | 36 - .../dthelp/parser.ccdf/htag/parser/code.c | 45 - .../parser.ccdf/htag/parser/context.dat | 681 --- .../dthelp/parser.ccdf/htag/parser/cyclent.c | 71 - .../dthelp/parser.ccdf/htag/parser/dcurelt.c | 45 - .../dthelp/parser.ccdf/htag/parser/delfree.c | 61 - .../dthelp/parser.ccdf/htag/parser/dmpline.c | 50 - .../dthelp/parser.ccdf/htag/parser/end.c | 45 - .../dthelp/parser.ccdf/htag/parser/entity.c | 108 - .../dthelp/parser.ccdf/htag/parser/eprefix.c | 36 - .../dthelp/parser.ccdf/htag/parser/errline.c | 42 - .../dthelp/parser.ccdf/htag/parser/error.c | 416 -- .../dthelp/parser.ccdf/htag/parser/esuffix.c | 43 - .../dthelp/parser.ccdf/htag/parser/exit.c | 38 - .../dthelp/parser.ccdf/htag/parser/findpar.c | 92 - .../dthelp/parser.ccdf/htag/parser/getc.c | 35 - .../dthelp/parser.ccdf/htag/parser/getsign.c | 42 - .../dthelp/parser.ccdf/htag/parser/ifdata.c | 71 - .../dthelp/parser.ccdf/htag/parser/input.c | 162 - .../dthelp/parser.ccdf/htag/parser/level.c | 61 - .../dthelp/parser.ccdf/htag/parser/lookent.c | 56 - .../dthelp/parser.ccdf/htag/parser/minim.c | 423 -- .../dthelp/parser.ccdf/htag/parser/openent.c | 36 - .../dthelp/parser.ccdf/htag/parser/openfrst.c | 36 - .../dthelp/parser.ccdf/htag/parser/optstrg.c | 60 - .../dthelp/parser.ccdf/htag/parser/param.c | 351 -- .../dthelp/parser.ccdf/htag/parser/parcount.c | 44 - .../dthelp/parser.ccdf/htag/parser/pardef.c | 61 - .../dthelp/parser.ccdf/htag/parser/parent.c | 49 - .../dthelp/parser.ccdf/htag/parser/parname.c | 58 - .../dthelp/parser.ccdf/htag/parser/parser.c | 118 - .../dthelp/parser.ccdf/htag/parser/parser.h | 455 -- .../dthelp/parser.ccdf/htag/parser/parutil.c | 133 - .../dthelp/parser.ccdf/htag/parser/parvalok.c | 54 - .../dthelp/parser.ccdf/htag/parser/pi.c | 49 - .../dthelp/parser.ccdf/htag/parser/procscmp.c | 39 - .../dthelp/parser.ccdf/htag/parser/proto.h | 302 -- .../dthelp/parser.ccdf/htag/parser/scan.c | 1139 ----- .../dthelp/parser.ccdf/htag/parser/setopt.c | 36 - .../dthelp/parser.ccdf/htag/parser/setpar.c | 44 - .../dthelp/parser.ccdf/htag/parser/signmsg.c | 40 - .../dthelp/parser.ccdf/htag/parser/start.c | 44 - .../dthelp/parser.ccdf/htag/parser/startdoc.c | 39 - .../dthelp/parser.ccdf/htag/parser/string.c | 38 - .../dthelp/parser.ccdf/htag/parser/struct.c | 746 ---- .../dthelp/parser.ccdf/htag/parser/tex.h | 288 -- .../dthelp/parser.ccdf/htag/parser/text.c | 70 - .../dthelp/parser.ccdf/htag/parser/trace.c | 46 - .../dthelp/parser.ccdf/htag/parser/userinc.h | 37 - .../dthelp/parser.ccdf/htag/util/Imakefile | 60 - .../dthelp/parser.ccdf/htag/util/allwhite.c | 41 - .../dthelp/parser.ccdf/htag/util/basic.h | 66 - .../dthelp/parser.ccdf/htag/util/chartype.h | 290 -- .../dthelp/parser.ccdf/htag/util/common.h | 85 - .../dthelp/parser.ccdf/htag/util/cont.h | 153 - .../dthelp/parser.ccdf/htag/util/context.c | 243 -- .../dthelp/parser.ccdf/htag/util/conutil.c | 656 --- .../dthelp/parser.ccdf/htag/util/dtddef.h | 103 - .../dthelp/parser.ccdf/htag/util/dtdext.h | 68 - .../dthelp/parser.ccdf/htag/util/emptyfil.c | 38 - .../dthelp/parser.ccdf/htag/util/entdef.h | 43 - .../dthelp/parser.ccdf/htag/util/entext.h | 44 - .../dthelp/parser.ccdf/htag/util/entout.c | 214 - .../dthelp/parser.ccdf/htag/util/error.c | 304 -- .../dthelp/parser.ccdf/htag/util/exit.c | 39 - .../dthelp/parser.ccdf/htag/util/fclndir.c | 162 - .../dthelp/parser.ccdf/htag/util/inctest.c | 45 - .../dthelp/parser.ccdf/htag/util/initct.c | 47 - .../dthelp/parser.ccdf/htag/util/itoa.c | 64 - .../dthelp/parser.ccdf/htag/util/letter.c | 34 - .../dthelp/parser.ccdf/htag/util/lower.c | 35 - .../dthelp/parser.ccdf/htag/util/malloc.c | 143 - .../dthelp/parser.ccdf/htag/util/openchk.c | 45 - .../dthelp/parser.ccdf/htag/util/paramu.c | 141 - .../dthelp/parser.ccdf/htag/util/scanutil.c | 252 -- .../dthelp/parser.ccdf/htag/util/sparse.c | 40 - .../dthelp/parser.ccdf/htag/util/sparse.h | 38 - .../dthelp/parser.ccdf/htag/util/sref.h | 32 - .../dthelp/parser.ccdf/htag/util/strstr.c | 40 - .../dthelp/parser.ccdf/htag/util/trie.c | 132 - .../dthelp/parser.ccdf/htag/util/trie.h | 60 - .../dthelp/parser.ccdf/htag/util/triecnt.c | 97 - .../dthelp/parser.ccdf/htag/util/triedump.c | 66 - .../dthelp/parser.ccdf/htag/util/triepdmp.c | 65 - .../dthelp/parser.ccdf/htag/util/trieplk.c | 61 - .../dthelp/parser.ccdf/htag/util/trierset.c | 61 - .../dthelp/parser.ccdf/htag/util/upcmp8.c | 73 - .../dthelp/parser.ccdf/htag/util/upper.c | 36 - .../dthelp/parser.ccdf/htag/util/upstrcmp.c | 44 - .../dthelp/parser.ccdf/htag/util/version.h | 27 - .../dthelp/parser.ccdf/htag/util/wchar.c | 240 -- .../dthelp/parser.ccdf/htag/util/whitesp.c | 41 - .../dthelp/parser.ccdf/misc/helpchar.ent | 157 - .../dthelp/parser.ccdf/misc/helpicon.ent | 10 - .../dthelp/parser.ccdf/misc/helplang.ent | 39 - .../dthelp/parser.ccdf/misc/helptag.opt | 1 - .../dthelp/parser.ccdf/volumegen/Imakefile | 22 - .../dthelp/parser.ccdf/volumegen/Pstack.c | 182 - .../dthelp/parser.ccdf/volumegen/PstackI.h | 139 - .../dthelp/parser.ccdf/volumegen/Volumegen.c | 764 ---- .../dthelp/parser.ccdf/volumegen/admindefines | 11 - 168 files changed, 35604 deletions(-) delete mode 100644 cde/programs/dthelp/parser.ccdf/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/bitmaps/CHANGE-FOR-NEXT-RELEASE delete mode 100644 cde/programs/dthelp/parser.ccdf/bitmaps/cauticon.pm delete mode 100644 cde/programs/dthelp/parser.ccdf/bitmaps/noteicon.pm delete mode 100644 cde/programs/dthelp/parser.ccdf/bitmaps/warnicon.pm delete mode 100644 cde/programs/dthelp/parser.ccdf/helpcomp/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/helpcomp/helpcomp.c delete mode 100644 cde/programs/dthelp/parser.ccdf/helptag/cauticon.pm delete mode 100644 cde/programs/dthelp/parser.ccdf/helptag/helpchar.ent delete mode 100755 cde/programs/dthelp/parser.ccdf/helptag/helptag delete mode 100644 cde/programs/dthelp/parser.ccdf/helptag/helptag.man delete mode 100644 cde/programs/dthelp/parser.ccdf/helptag/noteicon.pm delete mode 100644 cde/programs/dthelp/parser.ccdf/helptag/warnicon.pm delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/build.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/build.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/buildutl.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/context.dat delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/eltree.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/except.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/fsa.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/out.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/param.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/proto.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/scan.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/sref.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/build/tree.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/context.dat delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/eltutil.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/entity.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/proto.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/eltdef/scan.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/charconv.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/custom.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/default.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/delim.bld delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/delim.elt delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/delim.par delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/figure.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/fproto.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/global.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/grphpar.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/grphpar.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/help.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/help.if delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/hptag.dtd delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/make.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/need.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/option.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/out.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/roman8.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/special.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/special.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/table.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/tex.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/helptag/xref.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/actutil.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/addinput.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/charconv.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/closent.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/code.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/context.dat delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/cyclent.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/dcurelt.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/delfree.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/dmpline.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/end.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/entity.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/eprefix.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/errline.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/error.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/esuffix.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/exit.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/findpar.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/getc.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/getsign.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/ifdata.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/input.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/level.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/lookent.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/minim.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/openent.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/openfrst.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/optstrg.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/param.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/parcount.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/pardef.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/parent.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/parname.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/parser.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/parser.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/parutil.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/parvalok.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/pi.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/procscmp.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/proto.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/scan.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/setopt.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/setpar.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/signmsg.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/start.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/startdoc.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/string.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/struct.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/tex.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/text.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/trace.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/parser/userinc.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/allwhite.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/basic.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/chartype.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/common.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/cont.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/context.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/conutil.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/dtddef.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/dtdext.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/emptyfil.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/entdef.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/entext.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/entout.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/error.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/exit.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/fclndir.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/inctest.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/initct.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/itoa.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/letter.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/lower.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/malloc.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/openchk.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/paramu.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/scanutil.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/sparse.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/sparse.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/sref.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/strstr.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/trie.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/trie.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/triecnt.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/triedump.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/triepdmp.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/trieplk.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/trierset.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/upcmp8.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/upper.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/upstrcmp.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/version.h delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/wchar.c delete mode 100644 cde/programs/dthelp/parser.ccdf/htag/util/whitesp.c delete mode 100644 cde/programs/dthelp/parser.ccdf/misc/helpchar.ent delete mode 100644 cde/programs/dthelp/parser.ccdf/misc/helpicon.ent delete mode 100644 cde/programs/dthelp/parser.ccdf/misc/helplang.ent delete mode 100644 cde/programs/dthelp/parser.ccdf/misc/helptag.opt delete mode 100644 cde/programs/dthelp/parser.ccdf/volumegen/Imakefile delete mode 100644 cde/programs/dthelp/parser.ccdf/volumegen/Pstack.c delete mode 100644 cde/programs/dthelp/parser.ccdf/volumegen/PstackI.h delete mode 100644 cde/programs/dthelp/parser.ccdf/volumegen/Volumegen.c delete mode 100644 cde/programs/dthelp/parser.ccdf/volumegen/admindefines diff --git a/cde/programs/dthelp/parser.ccdf/Imakefile b/cde/programs/dthelp/parser.ccdf/Imakefile deleted file mode 100644 index 4f4432627..000000000 --- a/cde/programs/dthelp/parser.ccdf/Imakefile +++ /dev/null @@ -1,12 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/3 1995/11/08 11:10:12 rswiston $ -#define IHaveSubdirs -#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' - - -SUBDIRS = htag volumegen helpcomp -LINTSUBDIRS = htag volumegen helpcomp - - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -LintSubdirs($(LINTSUBDIRS)) diff --git a/cde/programs/dthelp/parser.ccdf/bitmaps/CHANGE-FOR-NEXT-RELEASE b/cde/programs/dthelp/parser.ccdf/bitmaps/CHANGE-FOR-NEXT-RELEASE deleted file mode 100644 index 2f062da23..000000000 --- a/cde/programs/dthelp/parser.ccdf/bitmaps/CHANGE-FOR-NEXT-RELEASE +++ /dev/null @@ -1,10 +0,0 @@ - -The icons in this directory should be replaced with the ones we ship -with the HP DT run-time online help. They are stored in: - - .../hp/rivers/help/graphicsShared/noteicon.pm - .../hp/rivers/help/graphicsShared/cauticon.pm - .../hp/rivers/help/graphicsShared/warnicon.pm - -It was noticed that these files were out of synch too late to make it into -the IF3 release. diff --git a/cde/programs/dthelp/parser.ccdf/bitmaps/cauticon.pm b/cde/programs/dthelp/parser.ccdf/bitmaps/cauticon.pm deleted file mode 100644 index 6b1d14938..000000000 --- a/cde/programs/dthelp/parser.ccdf/bitmaps/cauticon.pm +++ /dev/null @@ -1,43 +0,0 @@ -/* XPM */ -/* $XConsortium: cauticon.pm /main/3 1995/07/18 17:15:44 drk $ */ -static char * cauticon [] = { -/* width height ncolors cpp [x_hot y_hot] */ -"32 32 4 1 0 0", -/* colors */ -" s none m none c none", -". s iconColor1 m black c black", -"X s iconColor5 m black c blue", -"o s iconColor6 m white c yellow", -/* pixels */ -" ", -" ..... ", -" .XXXXX. ", -" .XXoooXX. ", -" .XXoooooXX. ", -" .XoooooooX. ", -" .XXoooooooXX. ", -" .XXoooXXXoooXX. ", -" .XoooXXXXXoooX. ", -" .XXoooXXXXXoooXX. ", -" .XXooooXXXXXooooXX. ", -" .XoooooXXXXXoooooX. ", -" .XXoooooXXXXXoooooXX. ", -" .XXooooooXXXXXooooooXX. ", -" .XooooooooXXXooooooooX. ", -" .XXooooooooXXXooooooooXX. ", -" .XXoooooooooXXXoooooooooXX. ", -" .XooooooooooXXXooooooooooX. ", -" .XXooooooooooXXXooooooooooXX. ", -".XXoooooooooooooooooooooooooX. ", -".XXoooooooooooooooooooooooooXX. ", -".XooooooooooooXXXooooooooooooX. ", -".XoooooooooooXXXXXoooooooooooX. ", -".XoooooooooooXXXXXoooooooooooX. ", -".XXoooooooooooXXXoooooooooooXX. ", -" .XoooooooooooooooooooooooooX. ", -" .XXXoooooooooooooooooooooXXX. ", -" ..XXXXXXXXXXXXXXXXXXXXXXX.. ", -" ....................... ", -" ", -" ", -" "}; diff --git a/cde/programs/dthelp/parser.ccdf/bitmaps/noteicon.pm b/cde/programs/dthelp/parser.ccdf/bitmaps/noteicon.pm deleted file mode 100644 index df4f68a65..000000000 --- a/cde/programs/dthelp/parser.ccdf/bitmaps/noteicon.pm +++ /dev/null @@ -1,42 +0,0 @@ -/* XPM */ -/* $XConsortium: noteicon.pm /main/3 1995/07/18 17:15:52 drk $ */ -static char * noteicon [] = { -/* width height ncolors cpp [x_hot y_hot] */ -"32 32 3 1 -1 -1", -/* colors */ -" s none m none c none", -". s iconGray2 m white c #bdbdbdbdbdbd", -"X s iconColor5 m black c blue", -/* pixels */ -" ", -" ........ ", -" .............. ", -" .................. ", -" .................... ", -" ...................... ", -" ..........XXX........... ", -" ..........XXXXX........... ", -" ..........XXXXX........... ", -" ...........XXXXX............ ", -" ............XXX............. ", -" ............................ ", -" .............................. ", -" ..............XXX............. ", -" ............XXXXX............. ", -" ............XXXXX............. ", -" .............XXXX............. ", -" .............XXXX............. ", -" .............XXXX............. ", -" ............XXXX............ ", -" ............XXXX............ ", -" ............XXXX............ ", -" ...........XXXX........... ", -" ...........XXXX.......... ", -" .........XXXXXX......... ", -" ........XXXXXX........ ", -" .................... ", -" .................. ", -" .............. ", -" ........ ", -" ", -" "}; diff --git a/cde/programs/dthelp/parser.ccdf/bitmaps/warnicon.pm b/cde/programs/dthelp/parser.ccdf/bitmaps/warnicon.pm deleted file mode 100644 index 9c3602401..000000000 --- a/cde/programs/dthelp/parser.ccdf/bitmaps/warnicon.pm +++ /dev/null @@ -1,43 +0,0 @@ -/* XPM */ -/* $XConsortium: warnicon.pm /main/3 1995/07/18 17:16:00 drk $ */ -static char * warnicon [] = { -/* width height ncolors cpp [x_hot y_hot] */ -"32 32 4 1 -1 -1", -/* colors */ -" s none m none c none", -". s iconColor1 m black c black", -"X s iconColor3 m black c red", -"o s iconColor6 m white c yellow", -/* pixels */ -" ", -" ..... X ", -" .ooooo. XXX ", -" .ooXXXoo. XXXX ", -" .ooXXXXXoo. XXXXXXX ", -" .oXXXXXXXo. XXXXXXX ", -" .ooXXXXXXXooXXXXXXX ", -" .ooXXXXXXXXXoXXXXXX ", -" .oXXXXXXXXXoXXXXX ", -" .ooXXXXXXXXoooXX ", -" .ooXXXXXXXXoooooXXX ", -" .oXXXXXXXXooooooXoX ", -" .ooXXXXXXXooooooXXoo. ", -" .ooXXXXXXXooooooXXXXoo. ", -" .oXXXXXXXooooooXXXXXXo. ", -" .ooXXXXXXooooooXXXXXXXoo. ", -" .ooXXXXXXXXXoooXXXXXXXXXoo. ", -" .oXXXXXXXXXXooooXXXXXXXXXo. ", -" .ooXXXXXXXXXooooooXXXXXXXXoo. ", -".ooXXXXXXXXXoooooXXXXXXXXXXXo. ", -".ooXXXXXXXXoooooXXXXXXXXXXXXoo. ", -".oXXXXXXXXooooXXXXXXXXXXXXXXXo. ", -".oXXXXXXXXoooXXXXXXXXXXXXXXXXo. ", -".oXXXXXXXoooXXXXXXXXXXXXXXXXXo. ", -".ooXXXXXoooooXXXXXXXXXXXXXXXoo. ", -"..oXXXXooooXXXXXXXXXXXXXXXXXo. ", -" .oooooooXXXXXXXXXXXXXXXXXooo. ", -" ..oXXXooooooooooooooooooo.. ", -" XXXX.................... ", -" XXX ", -" XX ", -" X "}; diff --git a/cde/programs/dthelp/parser.ccdf/helpcomp/Imakefile b/cde/programs/dthelp/parser.ccdf/helpcomp/Imakefile deleted file mode 100644 index 1b2b21a70..000000000 --- a/cde/programs/dthelp/parser.ccdf/helpcomp/Imakefile +++ /dev/null @@ -1,17 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/4 1996/05/09 17:31:53 drk $ -PROGRAMS = helpcomp - - -SRCS = helpcomp.c - -OBJS = helpcomp.o - -NormalLibraryObjectRule() -ComplexProgramTarget($(PROGRAMS)) - -saber_src: $(SRCS) - XCOMM setopt load_flags $(CFLAGS) - XCOMM load $(SRCS) $(LOCAL_LIBRARIES) - -unsaber_src: - XCOMM unload $(SRCS) diff --git a/cde/programs/dthelp/parser.ccdf/helpcomp/helpcomp.c b/cde/programs/dthelp/parser.ccdf/helpcomp/helpcomp.c deleted file mode 100644 index 4bb3c326d..000000000 --- a/cde/programs/dthelp/parser.ccdf/helpcomp/helpcomp.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* Copyright 1992 Hewlett-Packard Co. */ -static char *version = "$XConsortium: helpcomp.c /main/3 1995/11/08 11:10:34 rswiston $"; - -#include -#include -#include -#include -#include -#include -#include - -typedef char LineBuff[BUFSIZ]; -typedef char FileBuff[BUFSIZ]; -typedef char *FileName; - -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) - -static char *prog_name; -static char fileNamePrefix[] = "hc"; -static FileName newHvFileName, newHtFileName, - topicFileName, topicZFileName; - - -/* issues an error message, cleans up temp files and exits */ -void -ErrorExit(const char *who, const char *how) -{ -fprintf(stderr, "%s -> %s: %s\n", prog_name, who, how); - -if (newHvFileName) unlink(newHvFileName); -if (newHtFileName) unlink(newHtFileName); -if (topicFileName) unlink(topicFileName); -if (topicZFileName) unlink(topicZFileName); - -exit(1); -} - - -/* converts errno into a string and calls ErrorExit() */ -void -ErrorIntExit(const char *who, const int how) -{ -ErrorExit(who, strerror(how)); -} - - -/* copies a file by name to another file by name */ -int -CopyFile(const char *toName, const char *fromName) -{ -int toFile, fromFile; -int bytesRead; -FileBuff fileBuff; - -toFile = open(toName, O_WRONLY|O_CREAT, 0666); -if (toFile < 0) - { - ErrorIntExit(toName, errno); - } - -fromFile = open(fromName, O_RDONLY); -if (fromFile < 0) - { - ErrorIntExit(fromName, errno); - } - -while ((bytesRead = read(fromFile, fileBuff, sizeof(fileBuff))) > 0) - { - if (write(toFile, fileBuff, bytesRead) != bytesRead) - { - ErrorIntExit(toName, errno); - } - if (bytesRead < sizeof(fileBuff)) - break; - } - -close(fromFile); -close(toFile); - -if (bytesRead < 0) - return 1; - -return 0; -} - - -/* - * Here's the idea: - * - * Open the old .hv file and a temp file to contain the new .hv file. - * - * Copy lines from the old to the new up to and including the line - * "# Topic Locations". - * - * Then, iteratively look for lines containing the string ".filename:", - * copying lines from the old .hv to the new until such a line is found. - * Copy the found line to the new .hv as well. - * - * If the file name specified after the found string specifies a new - * file, finish writing the last open .ht if one exists (i.e., we are - * not in the first pass through the loop. Close the previous old .ht - * file and the previous new .ht file and move the new one to replace - * the old one. Open the recent .ht file specified and open a temp file - * to contain the new .ht file. - * - * Read the next line from the old .hv file to get the offset into the - * file of the next topic. Subtract the current offset from the next - * offset to get the size of the current topic. Read that many bytes - * from the old .ht file into a newly created topic file. Close the topic - * file and execute compress(1) on it. Attempt to open the topic file - * this time with a .Z extension. If possible, the topic was compressed. - * If not possible, reopen the topic file as an uncompressed topic. - * - * Append either a 0x0 (compressed) or 0xff (uncompressed) byte to the - * new .ht file followed by three bytes holding the size of the topic - * determined by fstat'ing the open topic file. The three bytes are - * computed using div/mod rather than right shift and mask to avoid byte - * sex problems. - * - * Append the contents of the topic file to the new .ht file. - * - * Continue opening, compressing and appending compressed topic files - * until a blank line is found in the old .hv file. - * - * When the blank line is found, copy the remaining lines of the old .hv - * file to the new .hv file. When finished, move the new .hv file to - * replace the old one. -*/ -int -main(int argc, char **argv) -{ -char *pc; -FILE *oldHvFile, *newHvFile; -int oldHtFile, newHtFile, topicZFile; -FileName oldHvFileName; -LineBuff lineBuff, string1, string2, lastString2, command; -FileBuff fileBuff; -int oldOffset, newOffset; -int bytesToRead, bytesRead, totalBytes, zFileSize; -unsigned char zTmp[4]; -int doBreak, firstPass, result; -struct stat statBuf; - -pc = strrchr(argv[0], '/'); -if (pc) pc++; -else pc = argv[0]; -prog_name = malloc(strlen(pc) + 1); -if (!prog_name) - { - fprintf(stderr, "%s: could not copy the program name (no memory)", pc); - return 1; - } -strcpy(prog_name, pc); - -if (argc != 2) - { - fprintf(stderr, "usage: %s \n", prog_name); - return 1; - } - -oldHvFileName = malloc(strlen(argv[1]) + 3 + 1); /* add ".hv" and null */ -if (!oldHvFileName) - { - ErrorExit("malloc", "could not create a temporary file name"); - } -strcpy(oldHvFileName, argv[1]); -strcat(oldHvFileName, ".hv"); -oldHvFile = fopen(oldHvFileName, "r"); -if (!oldHvFile) - { - ErrorIntExit(oldHvFileName, errno); - } - -newHvFileName = tempnam(NULL, fileNamePrefix); -if (!newHvFileName) - { - ErrorExit("tempnam", "could not create a temporary file name"); - } -newHvFile = fopen(newHvFileName, "w"); -if (!newHvFile) - { - ErrorIntExit(newHvFileName, errno); - } - -do { - if (!fgets(lineBuff, sizeof(lineBuff), oldHvFile)) - { - ErrorExit(oldHvFileName, "premature end of input file"); - } - fputs(lineBuff, newHvFile); - } -while (strncmp(lineBuff, "# Topic Locations", sizeof("# Topic Locations") - 1)); - - -firstPass = 1; - -topicFileName = tempnam(NULL, fileNamePrefix); -if (!topicFileName) - { - ErrorExit("tempnam", "could not create a temporary file name"); - } -strcpy(command, "compress "); -strcat(command, topicFileName); - -topicZFileName = malloc(strlen(topicFileName) + 2 + 1); /* add ".Z" and null */ -if (!topicZFileName) - { - ErrorExit("malloc", "could not create a temporary file name"); - } -strcpy(topicZFileName, topicFileName); -strcat(topicZFileName, ".Z"); - -newHtFileName = tempnam(NULL, fileNamePrefix); -if (!newHtFileName) - { - ErrorExit("tempnam", "could not create a temporary file name"); - } -newHtFile = open(newHtFileName, O_WRONLY|O_CREAT, 0666); -if (!newHtFile) - { - ErrorIntExit(newHtFileName, errno); - } -totalBytes = 0; - -doBreak = 0; -result = 0; -while (1) - { - if (!fgets(lineBuff, sizeof(lineBuff), oldHvFile)) - { - ErrorExit(oldHvFileName, "premature end of input file"); - } - if (*lineBuff != '\n') - { - char *pc; - - fputs(lineBuff, newHvFile); - sscanf(lineBuff, "%s %s", string1, string2); - pc = strrchr(string1, '.'); - if (!pc || (strcmp(pc, ".filename:") != 0)) - continue; - if (firstPass) - { - firstPass = 0; - oldOffset = 0; - strcpy(lastString2, string2); - if ((oldHtFile = open(string2, O_RDONLY)) < 0) - { - ErrorIntExit(string2, errno); - } - } - } - else - { - doBreak = 1; - string2[0] = 0; - } - if (strcmp(string2, lastString2) != 0) - { - topicZFile = open(topicFileName, O_WRONLY|O_CREAT, 0666); - if (topicZFile < 0) - { - ErrorIntExit(topicFileName, errno); - } - while (bytesRead = read(oldHtFile, fileBuff, sizeof(fileBuff))) - { - if (write(topicZFile, fileBuff, bytesRead) != bytesRead) - { - ErrorIntExit(string2, errno); - } - if (bytesRead < sizeof(fileBuff)) - break; - } - close(topicZFile); - system(command); - - zTmp[0] = 0; - if ((topicZFile = open(topicZFileName, O_RDONLY)) < 0) - { - zTmp[0] = ~0; - topicZFile = open(topicFileName, O_RDONLY); - } - if (topicZFile < 0) - { - char *who; - - who = (char *) malloc(strlen(topicFileName) + - strlen(topicZFileName) + - sizeof(" or ")); - strcpy(who, topicFileName); - strcat(who, " or "); - strcat(who, topicZFileName); - ErrorIntExit(who, errno); - } - - if (fstat(topicZFile, &statBuf) < 0) - { - ErrorIntExit(topicZFileName, errno); - } - - zFileSize = statBuf.st_size; - - zTmp[3] = zFileSize % 256; - zFileSize /= 256; - zTmp[2] = zFileSize % 256; - zFileSize /= 256; - zTmp[1] = zFileSize % 256; - if (write(newHtFile, zTmp, 4) != 4) - { - ErrorIntExit(newHtFileName, errno); - } - - while (bytesRead = read(topicZFile, fileBuff, sizeof(fileBuff))) - { - if (write(newHtFile, fileBuff, bytesRead) != bytesRead) - { - ErrorIntExit(string2, errno); - } - if (bytesRead < sizeof(fileBuff)) - break; - } - close(topicZFile); - unlink(topicFileName); - unlink(topicZFileName); - - unlink(lastString2); - result = CopyFile(lastString2, newHtFileName); - unlink(newHtFileName); - - if (doBreak || result) - break; - - newHtFile = open(newHtFileName, O_WRONLY|O_CREAT, 0666); - if (!newHtFile) - { - ErrorIntExit(newHtFileName, errno); - } - totalBytes = 0; - - strcpy(lastString2, string2); - oldOffset = 0; - if ((oldHtFile = open(string2, O_RDONLY)) < 0) - { - ErrorIntExit(string2, errno); - } - } - if (!fgets(lineBuff, sizeof(lineBuff), oldHvFile)) - { - ErrorIntExit(oldHvFileName, errno); - } - sscanf(lineBuff, "%s %d", string1, &newOffset); - if (newOffset != oldOffset) - { - bytesToRead = newOffset - oldOffset; - topicZFile = open(topicFileName, O_WRONLY|O_CREAT, 0666); - if (topicZFile < 0) - { - ErrorIntExit(topicFileName, errno); - } - while (bytesRead = read(oldHtFile, - fileBuff, - MIN(bytesToRead, sizeof(fileBuff)))) - { - if (write(topicZFile, fileBuff, bytesRead) != bytesRead) - { - ErrorIntExit(topicFileName, errno); - } - if ((bytesToRead -= bytesRead) == 0) - break; - } - close(topicZFile); - system(command); - - zTmp[0] = 0; - if ((topicZFile = open(topicZFileName, O_RDONLY)) < 0) - { - zTmp[0] = ~0; - topicZFile = open(topicFileName, O_RDONLY); - } - if (topicZFile < 0) - { - char *who; - - who = (char *) malloc(strlen(topicFileName) + - strlen(topicZFileName) + - sizeof(" or ")); - strcpy(who, topicFileName); - strcat(who, " or "); - strcat(who, topicZFileName); - ErrorIntExit(who, errno); - } - - if (fstat(topicZFile, &statBuf) < 0) - { - ErrorIntExit(topicZFileName, errno); - } - - zFileSize = statBuf.st_size; - - zTmp[3] = zFileSize % 256; - zFileSize /= 256; - zTmp[2] = zFileSize % 256; - zFileSize /= 256; - zTmp[1] = zFileSize % 256; - if (write(newHtFile, zTmp, 4) != 4) - { - ErrorIntExit(newHtFileName, errno); - } - - totalBytes += statBuf.st_size + 4; - - while (bytesRead = read(topicZFile, fileBuff, sizeof(fileBuff))) - { - if (write(newHtFile, fileBuff, bytesRead) != bytesRead) - { - ErrorIntExit(newHtFileName, errno); - } - if (bytesRead < sizeof(fileBuff)) - break; - } - close(topicZFile); - unlink(topicFileName); - unlink(topicZFileName); - - fprintf(newHvFile, "%s\t%d\n", string1, totalBytes); - oldOffset = newOffset; - } - else - fputs(lineBuff, newHvFile); - } - -if (result) - { - ErrorExit(lastString2, "bad file copy"); - } - -putc('\n', newHvFile); -while (!feof(oldHvFile)) - { - fgets(lineBuff, sizeof(lineBuff), oldHvFile); - if (feof(oldHvFile)) - break; - fputs(lineBuff, newHvFile); - } -fclose(oldHvFile); -fclose(newHvFile); - -unlink(oldHvFileName); -result = CopyFile(oldHvFileName, newHvFileName); -if (result) - { - ErrorExit(oldHvFileName, "bad file copy"); - } -unlink(newHvFileName); - -return 0; -} diff --git a/cde/programs/dthelp/parser.ccdf/helptag/cauticon.pm b/cde/programs/dthelp/parser.ccdf/helptag/cauticon.pm deleted file mode 100644 index f4115fd23..000000000 --- a/cde/programs/dthelp/parser.ccdf/helptag/cauticon.pm +++ /dev/null @@ -1,43 +0,0 @@ -/* XPM */ -/* $XConsortium: cauticon.pm /main/3 1995/07/18 17:16:10 drk $ */ -static char * cauticon [] = { -/* width height ncolors cpp [x_hot y_hot] */ -"32 32 4 1 0 0", -/* colors */ -" s none m none c none", -". s iconColor1 m black c black", -"X s iconColor5 m black c blue", -"o s iconColor6 m white c yellow", -/* pixels */ -" ", -" ..... ", -" .XXXXX. ", -" .XXoooXX. ", -" .XXoooooXX. ", -" .XoooooooX. ", -" .XXoooooooXX. ", -" .XXoooXXXoooXX. ", -" .XoooXXXXXoooX. ", -" .XXoooXXXXXoooXX. ", -" .XXooooXXXXXooooXX. ", -" .XoooooXXXXXoooooX. ", -" .XXoooooXXXXXoooooXX. ", -" .XXooooooXXXXXooooooXX. ", -" .XooooooooXXXooooooooX. ", -" .XXooooooooXXXooooooooXX. ", -" .XXoooooooooXXXoooooooooXX. ", -" .XooooooooooXXXooooooooooX. ", -" .XXooooooooooXXXooooooooooXX. ", -".XXoooooooooooooooooooooooooX. ", -".XXoooooooooooooooooooooooooXX. ", -".XooooooooooooXXXooooooooooooX. ", -".XoooooooooooXXXXXoooooooooooX. ", -".XoooooooooooXXXXXoooooooooooX. ", -".XXoooooooooooXXXoooooooooooXX. ", -" .XoooooooooooooooooooooooooX. ", -" .XXXoooooooooooooooooooooXXX. ", -" ..XXXXXXXXXXXXXXXXXXXXXXX.. ", -" ....................... ", -" ", -" ", -" "}; diff --git a/cde/programs/dthelp/parser.ccdf/helptag/helpchar.ent b/cde/programs/dthelp/parser.ccdf/helptag/helpchar.ent deleted file mode 100644 index f11671d0b..000000000 --- a/cde/programs/dthelp/parser.ccdf/helptag/helpchar.ent +++ /dev/null @@ -1,327 +0,0 @@ - - -<0x61>"> -<0x62>"> -<0x67>"> -<0x64>"> - - -<0x65>"> -<0x7A>"> -<0x68>"> -<0x71>"> -<0x4A>"> - -<0x69>"> -<0x6B>"> -<0x6C>"> -<0x6D>"> -<0x6E>"> - -<0x78>"> - -<0x70>"> -<0x76>"> -<0x72>"> - - -<0x73>"> - -<0x74>"> -<0x75>"> - -<0x66>"> -<0x6A>"> -<0x63>"> -<0x79>"> -<0x77>"> - - -<0x47>"> -<0x44>"> -<0x51>"> -<0x4C>"> -<0x58>"> - -<0x50>"> -<0x53>"> -<0xA1>"> -<0x46>"> -<0x59>"> - -<0x57>"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<0xC0>"> - -<0x22>"> - - - -<0x24>"> - -<0xD1>"> -<0xD8>"> - - -<0xD6>"> - - - - - -<0xC3>"> - - - -<0xC2>"> - - -<0xA7>"> -<0xC1>"> -<0xD0>"> -<0xA8>"> - -<0xB6>"> - -<0xA9>"> -<0xA5>"> - - -<0xAA>"> -<0xA7>"> -<0xB6>"> - - -<0xE5>"> - - -<0xD5>"> - - - - - - - - - - - - -<0xC7>"> -<0xDA>"> - -<0xC8>"> - -<0xD9>"> - - -<0xC5>"> -<0xD7>"> - - - - -<0xC4>"> - - - -<0xC6>"> - - - - -<0xE0>"> - - - - - - -<0xB7>"> - - - - - - - -<0xBA>"> - - - - - - - - - - - -<0xCC>"> -<0xC9>"> -<0xBB>"> - -<0xCD>"> - -<0xCA>"> -<0x40>"> - - - - -<0xCE>"> - -<0xB5>"> - - - - - - - - - - -<0x5E>"> - - - - - -<0xB9>"> - - - - - - - - - - - - - - - - - - - - - - - - - - -<0xAC>"> - -<0xAD>"> -<0xDC>"> - - -<0xDD>"> -<0xAE>"> - -<0xAF>"> -<0xDE>"> - - -<0xDF>"> -<0xAB>"> - - - -<0xDB>"> - - - - - - - - - - - - - - - - - - - - - - - -<0x56>"> - -<0x5C>"> - -<0x60>"> - -<0xA6>"> - -<0xBF>"> - -<0xCF>"> - -<0xA1>"> - -<0xA4>"> - -<0xA5>"> - -<0xAB>"> - -<0xB2>"> - -<0xB3>"> - -<0xBB>"> - -<0xBC>"> - -<0xBD>"> - -<0xBE>"> - -<0xBF>"> - diff --git a/cde/programs/dthelp/parser.ccdf/helptag/helptag b/cde/programs/dthelp/parser.ccdf/helptag/helptag deleted file mode 100755 index 3134e0e39..000000000 --- a/cde/programs/dthelp/parser.ccdf/helptag/helptag +++ /dev/null @@ -1,531 +0,0 @@ -: Bourne shell -# helptag -# -# Info for 'what' strings ... -# -# @(#) -# @(#)HP Help System - HelpTag Software -- Version A.01.00 -# @(#) -# @(#)Copyright (c) 1986 - 1993 Hewlett-Packard Company. -# @(#) All rights reserved. -# @(#) User Interface Technology Division, Corvallis, OR -# @(#) -######################################################### - -USESYSTEMUTILS=${USESYSTEMUTILS:-"YES"} -if [ $USESYSTEMUTILS = "YES" ] -then - HELPTAGPARSER=${HELPTAGPARSER:-htag} - VOLUMEGEN=${VOLUMEGEN:-volumegen} - HELPCOMP=${HELPCOMP:-helpcomp} -else - HELPTAGPARSER=${ALT_HELPTAGPARSER:-htag} - VOLUMEGEN=${ALT_VOLUMEGEN:-volumegen} - HELPCOMP=${ALT_HELPCOMP:-helpcomp} -fi - - -RM="/bin/rm -f " - -directory=`/bin/pwd` -listfiles="no" -optlist="" -charset="default" - -export optlist tagname extension -export directory statfile - -# clean up if the user interrupts this script -bailout(){ - # Remove the stat file ... - rm $statfile 2> /dev/null - exit 2 - } -trap bailout 1 2 3 4 5 6 7 8 10 12 13 14 15 16 17 - -if [ -z "$1" ] -then - echo "Usage: helptag [options] " - echo " (For more information: helptag -help)" - exit 2 -fi - -# determine what behavior we have from basename(1). On some systems, -# the second parameter to basename(1) is a simple string; on others, -# it's a regular expression. Since we want to find out if our input -# file name ends in ".", we need to use either "\." or "." depending -# on whether the "." is taken as an RE or a string. -string=`basename string .` -if [ $string = string ] -then - dotsuffix=. -else - dotsuffix=\\. -fi - -# function to return extension, if any of a file name. -# when called, the file name should already have been broken into parts -# at any periods. -split_name() -{ -if [ $# -eq 0 ] -then - extension="" -elif [ $# -eq 1 ] -then - extension="" -else - shift `expr $# - 1` - extension=".$1" -fi -} - - -# function used to simply return the positional parameters to their -# original state, i.e., what they were before calling "split_name". -reset() -{ -true -} - - -# function to parse a file name. -parse_name() -{ -# don't try to get extension if file ends in period -remdot=`basename "$1" $dotsuffix` -predot=`basename "$1"` -if [ "$remdot" = "$predot" ] -then - # save original parameters and field separators - saveParm="$*" - saveIFS="$IFS" - - # cause file name to be split at periods - IFS=. - q=$1 - - # get the extension, if any - split_name $q - - # restore original field separators and file name - IFS="$saveIFS" - reset "$saveParm" -else - extension="." - tagname="$remdot" -fi - -# get the directory, will be "." if none -directory=`dirname $1` - -# get the file base name and remove trailing period, if any and no extension -tagname=`basename $1 $extension` -if [ "$extension" = "" ] -then - tagname=`basename $tagname $dotsuffix` -fi -} - - -# Check command line for options: -gotfile=no -while [ $1 ] -do - case $1 in - -charset) shift - if [ -z "$2" ] - then - echo "" - echo "Sorry! \007Missing either a character set name or filename." - echo "" - echo " Usage: helptag -charset ." - echo "" - exit 1 - fi - charset=$1 - ;; - -clean) shift - if [ -z "$1" ] - then - echo "Delete all files generated by HelpTag" - echo "Sorry, \007Please specify a file name (with no extension)" - echo "For example: $0 tagfilename" - exit 1 - fi - for commandline - do - echo "Deleting HelpTag-generated files for $commandline" - # check for .htg or .ttg extension - saveCommandLine="$*" - parse_name $commandline - reset $saveCommandLine - if [ \( "$extension" != ".htg" \) -a \( "$extension" != ".ttg" \) ] - then - tagname=$tagname$extension - fi - if [ "$shortnames" = "yes" ] - then - workfile=`echo $tagname | cut -c1-6` - else - workfile=$tagname - fi - workfile=$directory/$workfile - $RM $workfile.err - $RM $workfile.hv - $RM $workfile.hvk - $RM $workfile.hmi - $RM $workfile*.ht - $RM $workfile.idt - $RM $workfile.tpc - $RM $workfile.xrh - $RM $workfile.idx - $RM $directory/.$tagname.st - $RM $workfile.'xrh' - $RM $workfile.'dr' - done - exit 0 - ;; - -debug) - save=yes - optlist="$optlist onerror=go" - ;; - -files) - listfiles="yes" - ;; - -help) - echo "______________________________" - echo "To create run-time help files:" - echo "" - echo " helptag [options] " - echo "" - echo "... where the options are:" - echo "" - echo " -memo Includes writer's memos entered with ." - echo " -verbose Displays parser activity." - echo " -shortnames Truncates all generated filenames for portability." - echo " -debug Intermediate files (normally deleted) are saved." - echo " Also, help topic (.ht) files are not compressed." - echo " -charset Sets the default characterset to ." - echo "" - echo "_________________________________________" - echo "To remove all files generated by HelpTag:" - echo "" - echo " helptag -clean " - echo "" - echo "_________________________________" - echo "To list all of the file entities:" - echo "" - echo " helptag -files " - echo "" - exit 2 - ;; - -memo) - memo=yes - ;; - -nomemo) - memo=no - ;; - -shortnames) - shortnames=yes - ;; - -verbose) - background=no - ;; - @*) optlist="$optlist $1" - ;; - *) if [ "$gotfile" = no ] - then - tagname=$1 - gotfile=yes - else - optlist="$optlist $1" - fi - ;; - esac - shift -done - - -echo "Running HelpTag Version A.01.00 ..." - -if [ "$gotfile" = no ] -then - echo You must specify an input filename. - echo "A \".htg\" extension is assumed if you don't provide one." - exit 2 -fi - -# Analyze file name: -# if no extension -> append .htg -# if extension -> use as is -# if trailing . -> use without extension -parse_name $tagname -if [ "$extension" = "" ] -then - extension=".htg" -fi - -# see if tag file exists -if [ ! -r $directory/$tagname$extension ] -then - echo File $directory/$tagname$extension not found or not readable. - exit 2 -fi - - -# Remove old status file, if any. -statfile="$directory/.$tagname.st" -$RM $statfile - - -# Do we want a list of the files declared through entities? -if [ "$listfiles" = yes ] -then - echo "" - echo "Preparing to list files entered as entity declartions ..." - echo "" - $HELPTAGPARSER $directory/$tagname$extension f $optlist - exit 2 -fi - - -# Check write access to current directory -(echo "testing" > $statfile) -if [ $? -gt 0 ] -then - echo Job not accepted. - echo You may lack write permission in the current directory. - exit 2 -fi - - -# Should the parser ignore writer memos? -if [ "$memo" = yes ] -then - optlist="$optlist memo" -elif [ "$memo" = no ] -then - optlist="$optlist nomemo" -fi - - -# Does the user wish to truncate file names for portability? -if [ "$shortnames" = "yes" ] -then - optlist="$optlist short" - workfile=`echo $tagname | cut -c1-6` -else - workfile=$tagname -fi -workfile=$directory/$workfile - -if [ "$background" = "no" ] -then - moreinfo="" -else - moreinfo=" See file ${workfile}.err for more information." -fi - -# Write the header (time stamp, etc.) to the status file. -echo "HelpTag Version A.01.00" > $statfile -echo `date` >> $statfile - -# Call the parser with the appropriate options. -echo Starting HelpTag parser. >> $statfile -if [ "$background" = no ] -then - echo Verbose mode started. - $HELPTAGPARSER $directory/$tagname$extension - $optlist - trouble=$? - if [ \( $trouble -eq 77 \) -o \( $trouble -eq 66 \) ] - then - echo "Re-running parser to resolve xrefs" >> $statfile - echo "Re-running parser to resolve xrefs" - $HELPTAGPARSER $directory/$tagname$extension - $optlist - trouble=$? - fi - if [ \( "$save" != "yes" \) -a \ - \( $trouble -ne 0 \) -a \( $trouble -ne 2 \) -a \( $trouble -ne 66 \) ] - then - echo "Error(s) in run of $HELPTAGPARSER -- exiting helptag." - if [ "$save" != "yes" ] - then - $RM $workfile.'idt' - $RM $workfile.'tpc' - $RM $workfile.'xrh' - $RM $workfile.'dr' - $RM $workfile.'hmi' - $RM $workfile.'idx' - fi - # Remove the stat file ... - rm $statfile 2> /dev/null - exit 1 - fi -else - $HELPTAGPARSER $directory/$tagname$extension - $optlist 1>/dev/null 2>&1 - trouble=$? - if [ \( $trouble -eq 77 \) -o \( $trouble -eq 66 \) ] - then - echo "Re-running parser to resolve xrefs" >> $statfile - $HELPTAGPARSER $directory/$tagname$extension - $optlist 1>/dev/null 2>&1 - trouble=$? - fi - if [ \( "$save" != "yes" \) -a \ - \( $trouble -ne 0 \) -a \( $trouble -ne 2 \) -a \( $trouble -ne 66 \) ] - then - echo "Parser errors occurred!$moreinfo" - if [ "$save" != yes ] - then - $RM $workfile.'idt' - $RM $workfile.'tpc' - $RM $workfile.'xrh' - $RM $workfile.'dr' - $RM $workfile.'hmi' - $RM $workfile.'idx' - fi - # Remove the stat file ... - rm $statfile 2> /dev/null - exit 1 - fi -fi - -# If there were parser errors, report them to the status file, and stdout. -echo "Parser done. \c" >> $statfile -if [ $trouble -gt 0 ] -then - echo "Parser errors occurred!$moreinfo" >> $statfile - if [ "$save" = yes ] - then - echo "Continuing due to a -debug option" >> $statfile - else - echo "Continuing due to an onerror=go option" >> $statfile - fi - echo "Parser errors occurred!$moreinfo" - if [ "$save" = yes ] - then - echo "Continuing due to a -debug option" - else - echo "Continuing due to an onerror=go option" - fi -else - echo No parser errors. >> $statfile -fi - -# Assemble the intermediate files into the run-time files ... - -# Save the charset (if specified) ... -if [ "$charset" != "default" ] -then - echo NOTE: Add this to the help volume file: \"*.characterSet: $charset\" -fi - - -# Sort the .idx file prior to running volumegen -echo "Sorting the keyword index file." >> $statfile -if [ "$background" = "no" ] -then - echo "Sorting the keyword index file." -fi - -tr "\0" "\1" < $workfile.idx > $workfile.tmp -sort -f $workfile.tmp > $workfile.idx -tr "\1" "\0" < $workfile.idx > $workfile.tmp -mv $workfile.tmp $workfile.idx - -echo "sort complete." >> $statfile -if [ "$background" = "no" ] -then - echo "sorting complete." -fi - - -# Run the volumegen utility to create the Help Volume File ... -echo "Running $VOLUMEGEN to create the Help Volume File." >> $statfile -if [ "$background" = "no" ] -then - echo "Running $VOLUMEGEN to create the Help Volume File." -fi - -$VOLUMEGEN $workfile -if [ $? -ne 0 ] -then - echo "Error in run of $VOLUMEGEN." >> $statfile - echo "Error in run of $VOLUMEGEN -- exiting helptag." - if [ "$save" != yes ] - then - $RM $workfile.'idt' - $RM $workfile.'tpc' - $RM $workfile.'xrh' - $RM $workfile.'dr' - $RM $workfile.'hmi' - $RM $workfile.'idx' - fi - # Remove the stat file ... - rm $statfile 2> /dev/null - exit 1 -fi - -echo "$VOLUMEGEN complete." >> $statfile -if [ "$background" = "no" ] -then - echo "$VOLUMEGEN complete." -fi - - -# Run the helpcomp utility to compress the Help Topic Files ... -echo "Running $HELPCOMP to compress the Help Topic Files." >> $statfile -if [ "$background" = "no" ] -then - echo "Running $HELPCOMP to compress the Help Topic Files." -fi - -if [ "$save" != yes ] -then - $HELPCOMP $workfile -fi -if [ $? -ne 0 ] -then - echo "Error in run of $HELPCOMP." >> $statfile - echo "Error in run of $HELPCOMP -- exiting helptag." - if [ "$save" != yes ] - then - $RM $workfile.'idt' - $RM $workfile.'tpc' - $RM $workfile.'xrh' - $RM $workfile.'dr' - $RM $workfile.'hmi' - $RM $workfile.'idx' - fi - # Remove the stat file ... - rm $statfile 2> /dev/null - exit 1 -fi - -echo "$HELPCOMP complete." >> $statfile -if [ "$background" = "no" ] -then - echo "$HELPCOMP complete." -fi - - -# Remove the intermediate files ... -# Note: currently the save option is set to save no intermediate files ... -if [ "$background" = "no" ] -then - echo "Removing intermediate files." -fi - -if [ "$save" != yes ] -then - $RM $workfile.'idt' - $RM $workfile.'tpc' - $RM $workfile.'dr' - $RM $workfile.'hmi' - $RM $workfile.'idx' -fi - - -# All done ... -echo DONE >> $statfile -echo "Done." diff --git a/cde/programs/dthelp/parser.ccdf/helptag/helptag.man b/cde/programs/dthelp/parser.ccdf/helptag/helptag.man deleted file mode 100644 index 0dd73b412..000000000 --- a/cde/programs/dthelp/parser.ccdf/helptag/helptag.man +++ /dev/null @@ -1,345 +0,0 @@ -.\" $XConsortium: helptag.man /main/2 1995/07/17 10:51:02 drk $ -.TH helptag 1 -.ds )H Hewlett-Packard Company -.ds ]W A.00.00 -.SH NAME -helptag \- Driver program to process -.B "HP Help System" -documents -.SH SYNOPSIS -.B helptag -.RI [ \|options\| ] -.I file -.RI [ \|parser\-options\| ] -.SH DESCRIPTION -.I helptag -is the driver program for the three phases of preparing an -.B "HP Help System" -document -for use in presenting online help. -These three phases -are parsing, creating a volume and keyword index and compressing the -resulting topic files. -.P -The -.I helptag -command accepts a single file name as an argument. If the file name -contains a period ("."), any characters after the last period are -considered to be the extension. The -.I helptag -command will remove all characters after the last period and use the -resulting name as the base name for all intermediate files and for the -final output files. If the -.IR file -argument has no periods, -.I helptag -uses the argument as the base name for intermediate and output files -and assumes and extension of -.B .htg -for the input file. -.P -Several options -directing the -.I helptag -process may precede the file name. Several arguments directing the -parsing phase of the -.I helptag -process may follow the file name. -.P -The output files are: -.RS -.TP 3 -\(bu -.IR file ##.ht -\- where ## is replaced by 00, 01, etc., are the text of the help -topics. -.TP -\(bu -.IR file .hv -\- is an index into the -.B .ht -files for finding the beginning of topics. -.TP -\(bu -.IR file .hvk -\- is a list of keywords and their associated topics. -.TP -\(bu -.IR file .err -\- contains a log of the parsing activity along with any errors generated -during the parse. -.TP -\(bu -.IR file .xrh -\- is used in generating cross references. This file is not used by the -runtime -.B "HP Help System" -engine. It is used between passes of the parser phase -of the -.I helptag -process. Retaining this file between invocations of -.I helptag -often eliminates the need for a second pass of the parser. -.RE -.SS Options -.br -.PP -The following options are recognized by -.I helptag -and must be placed before the -specified -.IR file. -.TP 10 -.B \-clean -.br -The -.B \-clean -option removes all -.I helptag -generated files corresponding to the -.IR file -specified. -.TP -.B \-files -.br -This option emits a list of files entered as entity declarations in the -.IR file -argument. -.TP -.B \-help -.br -The -.B \-help -option prints a list of -.I helptag -options and their meanings to the standard output. -.TP -.B \-shortnames -.br -The -.B \-shortnames -option causes all generated file names to be less than -eight characters before the extension. This length limitation is -achieved by truncating the input -.IR file -argument to six characters so that adding, for example, "00.ht" produces -an eight character file name and a two character extension. -.TP -.B \-verbose -.br -Setting the -.B \-verbose -option will cause -.I helptag -to be much more descriptive about the parser phase. -.SS "Parser Options" -.br -Any -.IR "parser options" -follow the -.IR file -argument on the command line and take the form -.B option=value -for those options taking a parameter and simply -.B option -for those options not taking a parameter. -Parser options may also be set in the environment variable TAGOPT, in a -.B helptag.opt -file or in a file named -.IR file .opt -in the current directory. -The -.B helptag.opt -file may reside in the current directory or in the directory in which -.I helptag -is placed. -.P -The order of precedence of the option settings is: -.RS -.TP 3 -\(bu -The file -.B helptag.opt -in the helptag installation directory. This -directory defaults to -.B /usr/vhelp/bin. -.TP -\(bu -The environment variable TAGOPT -.TP -\(bu -The file -.B helptag.opt -in the current directory. -.TP -\(bu -The file -.IR file .opt -in the current directory. -.TP -\(bu -The command line. -.RE -.P -Parser options set later in the list will override options set earlier. -.P -The parser options supported by -.I helptag -are: -.TP -.B onerror=go -.br -Cause errors to be non-fatal. That is, parsing will continue and later -phases of the -.I helptag -process will be run even if syntax errors were encountered in the parse. -.TP -.B onerror=stop -.br -This is the default setting of the -.B onerror= -option. It causes the -.I helptag -process to stop upon completion of the parser phase if syntax errors were -encountered during the parse. -.TP -.B charset=name -.br -The default character set used by the -.B "HP Help System" -is ISO8859-1. A -different character set may be specified, e.g., -.B name, -using the -.B charset= -option. The character set may also be set in the -.B helplang.ent -file described in the -.IR "HP Help System Developers' Guide". -.TP -.B search=path -.br -Adds -.B path -to the list of directories searched for file and image entities. -.TP -.B clearsearch -.br -Clears the list of directories searched for file and -image entities. -.TP -.B memo -.br -The -.B memo -option causes authors' memos to be included in the output document. -.TP -.B nomemo -Is the inverse of the -.B memo -option. Both -.B memo -and -.B nomemo -may be specified but the last one mentioned will override -any previous setting. -.TP -.B shortfiles -.br -Neither the -.B shortfiles -.IR "parser-option" -nor any of its synonyms should be used. Rather, the -.B \-shortfiles -option should be given as an -.IR option -to -.I helptag. -The -.I helptag -driver needs to know whether the user has requested short file names since -.I helptag -must know the names of the intermediate files. -.TP -.B shortfile -is a synonym for -.B shortfiles. -.TP -.B short -is a synonym for -.B shortfiles. -.TP -.B longfiles -.br -Neither this option nor any of its synonyms should be used for the same -reason that the -.B shortfiles -option should not be used. -.TP -.B " " -Long, untruncated, file names are the default. -.TP -.B longfile -is a synonym for -.B longfiles. -.TP -.B long -is a synonym for -.B longfiles. -.SH EXTERNAL INFLUENCES -.SS Environment Variables -.SM LANG -determines the language in which the input -.IR file -is interpreted. The -.SM LANG -environment variable can be overridden in the -.B helplang.ent -file described in the -.IR "HP Help System Developers' Guide". -.PP -.SM TAGOPT -may be used to set parser options as described earlier. -.SS International Code Set Support -Single- and multi-byte character code sets are supported. -.SH AUTHOR -.I helptag -was developed by HP. -.SH FILES -.PD 0 -.TP 30 -file.htg -input file -.TP -file##.ht -help topic text -.TP -file.hv -index into .ht files -.TP -file.hvk -keyword index file -.TP -file.err -run log and error listing -.TP -file.xrh -cross-reference file -.TP -\\.file.st -status file and log -.TP -file.hmi -intermediate -.TP -file.idt -intermediate -.TP -file.tpc -intermediate -.TP -file.idx -intermediate -.PD 1 -.SH SEE ALSO -.IR "The HP Help System Developers' Guide" diff --git a/cde/programs/dthelp/parser.ccdf/helptag/noteicon.pm b/cde/programs/dthelp/parser.ccdf/helptag/noteicon.pm deleted file mode 100644 index 1b8f225f3..000000000 --- a/cde/programs/dthelp/parser.ccdf/helptag/noteicon.pm +++ /dev/null @@ -1,42 +0,0 @@ -/* XPM */ -/* $XConsortium: noteicon.pm /main/3 1995/07/18 17:16:18 drk $ */ -static char * noteicon [] = { -/* width height ncolors cpp [x_hot y_hot] */ -"32 32 3 1 -1 -1", -/* colors */ -" s none m none c none", -". s iconGray2 m white c #bdbdbdbdbdbd", -"X s iconColor5 m black c blue", -/* pixels */ -" ", -" ........ ", -" .............. ", -" .................. ", -" .................... ", -" ...................... ", -" ..........XXX........... ", -" ..........XXXXX........... ", -" ..........XXXXX........... ", -" ...........XXXXX............ ", -" ............XXX............. ", -" ............................ ", -" .............................. ", -" ..............XXX............. ", -" ............XXXXX............. ", -" ............XXXXX............. ", -" .............XXXX............. ", -" .............XXXX............. ", -" .............XXXX............. ", -" ............XXXX............ ", -" ............XXXX............ ", -" ............XXXX............ ", -" ...........XXXX........... ", -" ...........XXXX.......... ", -" .........XXXXXX......... ", -" ........XXXXXX........ ", -" .................... ", -" .................. ", -" .............. ", -" ........ ", -" ", -" "}; diff --git a/cde/programs/dthelp/parser.ccdf/helptag/warnicon.pm b/cde/programs/dthelp/parser.ccdf/helptag/warnicon.pm deleted file mode 100644 index 39ceded1b..000000000 --- a/cde/programs/dthelp/parser.ccdf/helptag/warnicon.pm +++ /dev/null @@ -1,43 +0,0 @@ -/* XPM */ -/* $XConsortium: warnicon.pm /main/3 1995/07/18 17:16:25 drk $ */ -static char * warnicon [] = { -/* width height ncolors cpp [x_hot y_hot] */ -"32 32 4 1 -1 -1", -/* colors */ -" s none m none c none", -". s iconColor1 m black c black", -"X s iconColor3 m black c red", -"o s iconColor6 m white c yellow", -/* pixels */ -" ", -" ..... X ", -" .ooooo. XXX ", -" .ooXXXoo. XXXX ", -" .ooXXXXXoo. XXXXXXX ", -" .oXXXXXXXo. XXXXXXX ", -" .ooXXXXXXXooXXXXXXX ", -" .ooXXXXXXXXXoXXXXXX ", -" .oXXXXXXXXXoXXXXX ", -" .ooXXXXXXXXoooXX ", -" .ooXXXXXXXXoooooXXX ", -" .oXXXXXXXXooooooXoX ", -" .ooXXXXXXXooooooXXoo. ", -" .ooXXXXXXXooooooXXXXoo. ", -" .oXXXXXXXooooooXXXXXXo. ", -" .ooXXXXXXooooooXXXXXXXoo. ", -" .ooXXXXXXXXXoooXXXXXXXXXoo. ", -" .oXXXXXXXXXXooooXXXXXXXXXo. ", -" .ooXXXXXXXXXooooooXXXXXXXXoo. ", -".ooXXXXXXXXXoooooXXXXXXXXXXXo. ", -".ooXXXXXXXXoooooXXXXXXXXXXXXoo. ", -".oXXXXXXXXooooXXXXXXXXXXXXXXXo. ", -".oXXXXXXXXoooXXXXXXXXXXXXXXXXo. ", -".oXXXXXXXoooXXXXXXXXXXXXXXXXXo. ", -".ooXXXXXoooooXXXXXXXXXXXXXXXoo. ", -"..oXXXXooooXXXXXXXXXXXXXXXXXo. ", -" .oooooooXXXXXXXXXXXXXXXXXooo. ", -" ..oXXXooooooooooooooooooo.. ", -" XXXX.................... ", -" XXX ", -" XX ", -" X "}; diff --git a/cde/programs/dthelp/parser.ccdf/htag/Imakefile b/cde/programs/dthelp/parser.ccdf/htag/Imakefile deleted file mode 100644 index 461c9e37d..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/Imakefile +++ /dev/null @@ -1,12 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/3 1995/11/08 11:10:56 rswiston $ -#define IHaveSubdirs -#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)' - -#if !UseCCMakeDepend - MDEP_DIR = makedepend -#endif - -SUBDIRS = util build eltdef helptag parser - -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/Imakefile b/cde/programs/dthelp/parser.ccdf/htag/build/Imakefile deleted file mode 100644 index 33aba6b42..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/Imakefile +++ /dev/null @@ -1,83 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/3 1995/11/08 11:11:08 rswiston $ -/* build Imakefile */ - -ARCCMD = arc u -UNARCCMD = arc x -ARCDELCMD = arc d - -HELPTAG = .. -HELPTAGSRC = $(HELPTAG)/helptag -HELPPARSERSRC = $(HELPTAG)/parser -HELPELTDEFSRC = $(HELPTAG)/eltdef -HELPDTDFILE = $(HELPTAGSRC)/hptag.dtd -HELPUTILSRC = $(HELPTAG)/util -HELPBUILDSRC = $(HELPTAG)/build -HELPUTILLIB = $(HELPTAG)/util/libutil.a - -INCLUDES = -I. -I$(HELPUTILSRC) - -SRCS = \ - build.c buildutl.c eltree.c except.c fsa.c out.c param.c \ - scan.c sref.c tree.c - -OBJS = \ - build.o buildutl.o eltree.o except.o fsa.o out.o param.o \ - scan.o sref.o tree.o - -CHPRODS = context.h delim.h -CCPRODS = case.c - -BHPRODS = arc.h dtd.h entity.h -BCPRODS = - -CTRASH = error delim.dat -BTRASH = error template - -CPRODS = $(CHPRODS) $(CCPRODS) -BPRODS = $(BHPRODS) $(BCPRODS) -TRASH = error delim.dat template - -PRODUCTS = $(CPRODS) $(BPRODS) - -LOCAL_LIBRARIES = $(HELPUTILLIB) - -/* Don't use shared libs for hp */ -#ifdef HPArchitecture -#if OSMajorVersion > 7 -EXTRA_LOAD_FLAGS = -Wl,-a archive -#endif -#endif - -all:: $(PRODUCTS) - -$(BPRODS): build $(HELPDTDFILE) - $(RM) $(BPRODS) $(BTRASH) - ./build < $(HELPDTDFILE) - -NormalLibraryObjectRule() -NormalProgramTarget(build,$(OBJS),delim.h $(LOCAL_LIBRARIES),$(LOCAL_LIBRARIES),) - -$(CPRODS): $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.bld context.dat - $(RM) $(CPRODS) $(CTRASH) - /* get application-specific delim.dat */ - $(CP) $(HELPTAGSRC)/delim.bld delim.dat - $(HELPUTILSRC)/context sparse - -$(HELPUTILSRC)/context: - cd $(HELPUTILSRC); make context - - -arc package : - if exist util.arc $(CP) build.arc old.arc - $(ARCCMD) util.arc *.c *.h makefile - -unarc dearc : - $(UNARCCMD) util.arc - -clean:: - $(RM) $(PRODUCTS) $(TRASH) - -depend:: $(SRCS) -DependTarget() - -includes:: $(PRODUCTS) diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/build.c b/cde/programs/dthelp/parser.ccdf/htag/build/build.c deleted file mode 100644 index 6183275b7..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/build.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: build.c /main/3 1995/11/08 11:11:18 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Build.c contains the main procedure for program BUILD */ - -#include -#include -#include "context.h" -#define BUILDEF -#include "build.h" -#include "delim.h" -#include "entdef.h" - -/* Main procedure */ -int main(argc, argv) -int argc ; -char **argv ; -{ -int m_prevcon ; - -if (argc > 1) - { - if (strchr(argv[1], 'a')) m_malftrace = TRUE ; - if (strchr(argv[1], 'A')) m_malftrace = TRUE ; - if (strchr(argv[1], 'a')) m_malftrace = TRUE ; - if (strchr(argv[1], 'H')) m_heapchk = TRUE ; - if (strchr(argv[1], 'm')) standard = TRUE ; - if (strchr(argv[1], 'M')) standard = TRUE ; - if (strchr(argv[1], 's')) scantrace = TRUE ; - if (strchr(argv[1], 'S')) scantrace = TRUE ; - } -initialize() ; -while (TRUE) - { - m_token = scan() ; - m_prevcon = curcon ; - curcon = m_newcon(m_prevcon - 1, m_token - 1) ; - if (scantrace) - printf( - "m_prevcon=%d, m_token=%d, curcon=%d, scanval = %c (%d), line=%d\n", - m_prevcon, m_token, curcon, scanval, scanval, m_line) ; - #include "case.c" - if (m_token == ENDFILE) exit(FALSE) ; - } -return EXIT_SUCCESS; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/build.h b/cde/programs/dthelp/parser.ccdf/htag/build/build.h deleted file mode 100644 index 573acf801..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/build.h +++ /dev/null @@ -1,424 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: build.h /main/3 1995/11/08 11:11:27 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Build.h is the primary include file for allocation of global variables - for program BUILD. */ - - -#if defined(BUILDEF) -#define BUILDEXTERN -#define BUILDINIT(a) = a -#else -#define BUILDEXTERN extern -#define BUILDINIT(a) -#endif - -#include -#include "basic.h" -#include "trie.h" -#include "common.h" - -/* Defined types */ -typedef struct arc ARC ; -typedef struct state STATE ; -typedef struct tree TREE ; -typedef struct statelist STATELIST ; -typedef struct parameter PARAMETER ; -typedef struct exception EXCEPTION ; -typedef struct ptype PTYPE ; -typedef struct eltstruct ELTSTRUCT ; -typedef struct lhsstruct LHS ; -typedef struct stack STACK ; -typedef struct srefstruct SREFSTRUCT ; -typedef struct srefdata SREFDATA ; -typedef struct mapstruct MAP ; -typedef struct andgroup ANDGROUP ; - -/* Each item in a list of states contains value, a pointer to a state; - next, a pointer to the next item in the list; and level, which - indicates the level of nested subexpressions within the regular expression - when the state was added to the FSA. */ -struct statelist { - STATE *value ; - STATELIST *next ; - int level ; - } ; - -struct stack { - STACK *oldtop ; - STATELIST *starts ; - STATELIST *finals ; - STATELIST *allfinal ; - STATELIST *newfinal ; - ARC *starta ; - } ; - -BUILDEXTERN STACK bot -#if defined(BUILDEF) - = { - NULL, NULL, NULL, NULL, NULL, NULL - } -#endif - ; - -BUILDEXTERN STACK *top BUILDINIT(&bot) ; - -BUILDEXTERN int stacklevels BUILDINIT(0) ; - - -/* Used to report nondeterminism in and groups */ -#define ANDCONFLICT 1 -#define DATACONFLICT 2 -#define ELTCONFLICT 3 - -/* Name of an element, and of the first element on the left-hand side of - the current rule */ -#define thisrule lhs->elt->enptr - -/* Set declared entity type */ -#define SETETYPE(p,t) adddefent(p) ; entity->type = t - -/* Definitions for entities */ - -#define EMPTYMAP 1 - -#define ERREXIT 1 - -/* Prefix for default short reference map and entities */ -#define M_PREFIX "M-" - -/* State transition network generated by CONTEXT */ -#define sparse -#include "sparse.h" - -/* Function prototypes */ -#include "proto.h" - -/* Frequently output strings */ -#define ndif "}\n#endif\n ;\n\n" -#define SUBONE else fputs("[1] ;\n\n", dtd) ; - -/* An array used to indicate which characters can appear within - element names */ -#if defined(BUILDEF) -#include "chartype.h" -#else -extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ; -#endif - -/* Current state of the finite-state machine which controls BUILD */ -BUILDEXTERN int curcon BUILDINIT(RULE) ; -BUILDEXTERN int m_token ; -BUILDEXTERN M_WCHAR scanval ; - -/* Used to pass names and literals from the scanner */ -BUILDEXTERN M_WCHAR name[M_NAMELEN + 1] ; -BUILDEXTERN M_WCHAR literal[M_LITLEN + 1] ; - -/* Scanner buffer for read-ahead */ -BUILDEXTERN int toundo BUILDINIT(0) ; -BUILDEXTERN int maxundo BUILDINIT(0) ; -/* Size of scanner buffer for read-ahead */ -#define SAVECHAR 50 -BUILDEXTERN int savechar[SAVECHAR] ; - -/* Whether errors have occurred */ -BUILDEXTERN LOGICAL errexit BUILDINIT(FALSE) ; - -/* FSA storage */ - -/* Each state in an FSA is represented by a flag indicating whether it is - a final state, a pointer to a list of transitions from the state, - and a flag that indicates whether parsed character data is possible - from the state */ -struct state { - LOGICAL final ; - LOGICAL datacontent ; - LOGICAL frompcdata ; - ARC *first ; - int count ; - STATE *next ; - } ; -BUILDEXTERN STATE *firststate BUILDINIT(NULL) ; -BUILDEXTERN STATE **nextstate BUILDINIT(&firststate) ; -BUILDEXTERN STATE *startstate ; - -/* Each arc in an FSA is an element in the arc list emanating from a - particular state. Associated fields include label, a pointer to - the name of the element labelling the arc (garbage if the label is an - and group); optional, a flag indicating whether or not the label is - contextually required; minim, a flag indicating whether or not the arc - corresponds to an element selected by explicit minimization; - and group, a pointer to the list of FSA's making - up the andgroup if the arc's label is an andgroup; to, a pointer to the - state entered by the arc; next, a pointer to the next arc - in the current arc list; and finally, id, a pointer to the node in the - tree representation of the model corresponding to the arc (id is used - in the detection of ambiguity to differentiate between arcs with the same - label corresponding to one model token and those with the same label - corresponding to more than one model token). - */ -struct arc { - ELTSTRUCT *label ; - LOGICAL optional ; - LOGICAL minim ; - ANDGROUP *group ; - STATE *to ; - ARC *next ; - int id ; - } ; - -/* Andgroups are elements in a list of the FSA's corresponding to the -content submodels in an andgroup. Each list element contains a pointer -to the start state of the FSA and a pointer to the next element in the -list */ -struct andgroup{ - STATE *start ; - ANDGROUP *nextptr ; - ANDGROUP *next ; - int count ; - } ; -BUILDEXTERN ANDGROUP *firstand BUILDINIT(NULL) ; -BUILDEXTERN ANDGROUP **nextand BUILDINIT(&firstand) ; - -/* Tree representation of a rule */ -/* Each node in the tree representation corresponds to a submodel. - Associated with the node is the submodel's connector and occurrence - indicator; terminal, a flag indicating whether the submodel in turn - has submodels; value, the element of which a terminal submodel consists; - pointers first and last to the first and last submodel of the node; - and right pointing to the node's next sibling in the tree. */ -struct tree { - int connector, occurrence ; - ELTSTRUCT *value ; - LOGICAL terminal ; - LOGICAL minim ; - TREE *first, *right, *parent ; - int eltid ; - } ; -BUILDEXTERN TREE *ruletree BUILDINIT(NULL) ; -BUILDEXTERN TREE *curtree ; - -/* Various counters */ -BUILDEXTERN int eltsinrule BUILDINIT(0) ; -BUILDEXTERN int stateused BUILDINIT(0) ; -BUILDEXTERN int andused BUILDINIT(0) ; - -/* Element names on the left-hand side of the current rule */ -struct lhsstruct { - ELTSTRUCT *elt ; - LHS *next ; - } ; -BUILDEXTERN LHS *lhs BUILDINIT(NULL) ; -BUILDEXTERN LHS **nextlhs BUILDINIT(&lhs) ; - -/* Content type (regular expression, ANY, NONE, CDATA, RCDATA) of the - current rule. */ -BUILDEXTERN int contype ; - -/* Indicates whether , , or fields have occurred in - current rule */ -BUILDEXTERN LOGICAL poccur, uoccur, moccur ; - -/* Indicates whether an ID parameter for this rule has occurred */ -BUILDEXTERN LOGICAL idoccur ; - -/* Short reference map for this rule */ -BUILDEXTERN int srefp ; -BUILDEXTERN LOGICAL useoradd ; - -/* Whether start- and end-tag minimization are permitted for the current - rule */ -BUILDEXTERN LOGICAL smin, emin ; - -/* Suffix for generated entity names */ -BUILDEXTERN int egensuf ; - -/* Storage for exceptions */ -BUILDEXTERN int excount BUILDINIT(0) ; -struct exception { - int element ; - EXCEPTION *next ; - EXCEPTION *nextptr ; - } ; -BUILDEXTERN EXCEPTION *firstex BUILDINIT(NULL) ; -BUILDEXTERN EXCEPTION **nextex BUILDINIT(&firstex) ; -BUILDEXTERN EXCEPTION *exlist ; - -/* Total number of parameters for all elements */ -BUILDEXTERN int parcount BUILDINIT(0) ; - -/* Primary representation of parameters */ -struct parameter { - M_WCHAR *paramname ; - int type ; - int kwlist ; - PTYPE *ptypep ; - int deftype ; - int defval ; - M_WCHAR *defstring ; - /* Next parameter for this element */ - PARAMETER *next ; - /* Link for list of all parameters for all elements */ - PARAMETER *nextptr ; - } ; -BUILDEXTERN PARAMETER *newpar BUILDINIT(NULL) ; -BUILDEXTERN PARAMETER *plist BUILDINIT(NULL) ; -BUILDEXTERN PARAMETER *firstpar BUILDINIT(NULL) ; -BUILDEXTERN PARAMETER **nextpar BUILDINIT(&firstpar) ; - -/* Storage for parameter names */ -BUILDEXTERN int pnamelen BUILDINIT(0) ; - -/* Storage for parameter values that are named keywords */ -BUILDEXTERN int ptypelen BUILDINIT(0) ; -struct ptype { - M_WCHAR *keyword ; - int next ; - PTYPE *nextptr ; - } ; -BUILDEXTERN PTYPE *firstptype BUILDINIT(NULL) ; -BUILDEXTERN PTYPE *thisptype ; -BUILDEXTERN PTYPE **nextptype BUILDINIT(&firstptype) ; -BUILDEXTERN int kwlen BUILDINIT(0) ; - -/* Storage for parameter default values */ -BUILDEXTERN int deflen BUILDINIT(0) ; - -/* Characters needed for element names */ -BUILDEXTERN int enamelen BUILDINIT(0) ; - -/* Description of an element: */ -struct eltstruct { - /* Pointer to element name */ - M_WCHAR *enptr ; - /* Start state of element's content model's FSA */ - STATE *model ; - /* Type of element's content (Regular expression, ANY, RCDATA, etc) */ - int content ; - /* Pointer to element's inclusion list */ - int inptr ; - /* Pointer to element's exclusion list */ - int exptr ; - /* Pointer to element's parameter list */ - PARAMETER *parptr ; - /* Index in output of first item in element's parameter list */ - int parindex ; - /* Number of element's parameters */ - int paramcount ; - /* Whether start- and end-tag minimization are permitted */ - LOGICAL stmin, etmin ; - /* Pointer to short reference map, if any */ - int srefptr ; - /* TRUE for USEMAP, FALSE for ADDMAP */ - LOGICAL useoradd ; - - ELTSTRUCT *next ; - int eltno ; - } ; -BUILDEXTERN ELTSTRUCT *firstelt BUILDINIT(NULL) ; -BUILDEXTERN ELTSTRUCT **nextelt BUILDINIT(&firstelt) ; - -/* Most number of parameters had by a single element */ -BUILDEXTERN int maxpar BUILDINIT(0) ; -/* Number of parameters current element has */ -BUILDEXTERN int pcount ; - -BUILDEXTERN FILE *dtd ; -BUILDEXTERN FILE *m_errfile ; - -/* Line number in input file */ -BUILDEXTERN int m_line BUILDINIT(1) ; - -/* Options */ -/* Scan trace */ -BUILDEXTERN LOGICAL scantrace BUILDINIT(FALSE) ; -/* Trace calls to malloc/free */ -BUILDEXTERN LOGICAL m_malftrace BUILDINIT(FALSE) ; -/* Test validity of heap in calls to malloc/free */ -BUILDEXTERN LOGICAL m_heapchk BUILDINIT(FALSE) ; -/* Flag set if strictly conforming to ISO 8879 */ -BUILDEXTERN LOGICAL standard BUILDINIT(FALSE) ; - -/* File pointer used by utilities in ..\util\scanutil for input file */ -BUILDEXTERN FILE *ifile ; - -/* Element names are stored in a trie. */ -BUILDEXTERN M_TRIE eltree ; - -/* Count of elements */ -BUILDEXTERN int ecount BUILDINIT(0) ; - -/* Storage for short reference map names and definitions */ -BUILDEXTERN M_TRIE maptree ; -BUILDEXTERN M_TRIE sreftree ; -BUILDEXTERN int mapcnt BUILDINIT(0) ; -BUILDEXTERN int curmap ; -struct srefstruct { - int srefcnt ; - SREFDATA *data ; - SREFSTRUCT *next ; - } ; -BUILDEXTERN SREFSTRUCT *firstsref BUILDINIT(NULL) ; -BUILDEXTERN SREFSTRUCT **nextsref BUILDINIT(&firstsref) ; -struct srefdata { - int map ; - int entidx ; - SREFDATA *next ; - } ; -BUILDEXTERN SREFDATA *thissref ; -BUILDEXTERN int sreflen BUILDINIT(0) ; -BUILDEXTERN M_WCHAR mapname[M_NAMELEN + 1] ; -BUILDEXTERN int maxsr ; -BUILDEXTERN int maxseq ; -struct mapstruct { - int map ; - M_WCHAR *mapname ; - LOGICAL defined ; - MAP *nextptr ; - } ; -BUILDEXTERN MAP *firstmap BUILDINIT(NULL) ; -BUILDEXTERN MAP **nextmap BUILDINIT(&firstmap) ; - - -/* Storage for entities */ -BUILDEXTERN M_TRIE m_enttrie[1] ; -BUILDEXTERN M_ENTITY *entity ; -BUILDEXTERN M_ENTITY *lastent BUILDINIT(NULL) ; -BUILDEXTERN M_ENTITY *firstent BUILDINIT(NULL) ; -BUILDEXTERN M_WCHAR entcontent[M_LITLEN + 1] ; -BUILDEXTERN int entclen ; -BUILDEXTERN int m_entcnt BUILDINIT(0) ; -BUILDEXTERN FILE *entfile ; - -BUILDEXTERN LOGICAL entrule BUILDINIT(FALSE) ; - -BUILDEXTERN M_WCHAR genname[M_NAMELEN + sizeof(M_PREFIX)] ; - -M_WCHAR *MakeWideCharString(const char *from); diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/buildutl.c b/cde/programs/dthelp/parser.ccdf/htag/build/buildutl.c deleted file mode 100644 index 7ba1b45e8..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/buildutl.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: buildutl.c /main/3 1995/11/08 11:11:37 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Buildult.c contains the main supporting utilities for program BUILD */ - -#include -#include "context.h" -#include "build.h" -#include "delim.h" - -#include "version.h" - -/* Verify that , or has not previously occurred in - this rule */ -void found(flag, delim) -LOGICAL *flag; -char *delim; -{ -M_WCHAR wcbuff[129]; -size_t length; - -wcbuff[128] = 0; -length = mbstowcs(wcbuff,delim,128); -if (length < 0) - { - m_error("An invalid multibyte character was seen"); - wcbuff[0] = 0; - } - -if (*flag) - { - m_err1("A rule can contain only one %s clause", wcbuff) ; - return ; - } -*flag = TRUE ; -} - -/* Program initialization */ -void initialize(void) -{ -char **mb_delims; -M_WCHAR **wc_delims; - -ifile = stdin ; -m_openchk(&m_errfile, "error", "w") ; - -fprintf(stderr, "MARKUP System - BUILD %s\n", M_VERSION) ; -fprintf(stderr, "Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.\n") ; -if (! standard) - warning("Warning: optional enhancements of SGML enabled.") ; - -mb_delims = mb_dlmptr; -wc_delims = m_dlmptr; - -while (*mb_delims) - { - *wc_delims++ = MakeWideCharString(*mb_delims); - mb_delims++; - } -*wc_delims = 0; - -ruleinit() ; -} - - -/* Initialization before starting a new rule */ -void ruleinit(void) - { - /* Reinitialize for next rule */ - lhs = NULL ; - nextlhs = &lhs ; - eltsinrule = 0 ; - plist = NULL ; - pcount = 0 ; - dellist(&bot.finals) ; - dellist(&bot.allfinal) ; - dellist(&bot.newfinal) ; - poccur = uoccur = moccur = FALSE ; - smin = emin = FALSE ; - srefp = 0 ; - useoradd = TRUE ; - egensuf = 1 ; - idoccur = FALSE ; - } - -/* Rule end processing */ -void rulend(void) - { - STATE *fsa ; - LOGICAL canbenull ; - LHS *lhsp ; - LHS *discard ; - int inptr ; - int exptr ; - - if (contype == GRPO) fsa = startfsa(ruletree, &canbenull) ; - if (pcount > maxpar) maxpar = pcount ; - inptr = lhs->elt->inptr ; - exptr = lhs->elt->exptr ; - for (lhsp = lhs ; lhsp ; ) { - lhsp->elt->model = contype == GRPO ? fsa : (STATE *) M_NULLVAL ; - lhsp->elt->content = contype ; - lhsp->elt->inptr = inptr ; - lhsp->elt->exptr = exptr ; - if (plist) { - if (lhsp->elt->parptr) - warning1("Redefining parameter list for element %s", - lhsp->elt->enptr) ; - lhsp->elt->parptr = plist ; - lhsp->elt->paramcount = pcount ; - lhsp->elt->parindex = parcount - pcount + 1 ; - } - lhsp->elt->stmin = smin ; - lhsp->elt->etmin = emin ; - lhsp->elt->srefptr = srefp ; - lhsp->elt->useoradd = useoradd ; - discard = lhsp ; - lhsp = lhsp->next ; - m_free((M_POINTER) discard, "lhs") ; - } - if (ruletree) freetree(ruletree) ; - ruletree = NULL ; - ruleinit() ; - } - -/* Skip rest of statement after an error */ -void skiptoend(void) - { - int i ; - static errlev = 0 ; - - if (! errlev++) { - curcon = ERROR ; - for (i = scan() ; ; i = scan()) - if ((i == REND && ! entrule) || - (i == TAGC && entrule) || - i == ENDFILE) break ; - curcon = RULE ; - entrule = FALSE ; - } - errlev-- ; - ruleinit() ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/context.dat b/cde/programs/dthelp/parser.ccdf/htag/build/context.dat deleted file mode 100644 index 8629021b0..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/context.dat +++ /dev/null @@ -1,819 +0,0 @@ -/* $XConsortium: context.dat /main/2 1995/07/17 10:35:41 drk $ */ -comment - comcon:comcon { -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. - -Context.dat defines the state transitions for program BUILD. -*/ - } - ; - -produces - postel:content - postsref:entity - post2sref:entity2 - ; - -except - lastm:excon - postc:excon - ; - -paropen - rule:firstparname - ; - -param - sref:pcon, - postc:pcon, - skipex:pcon, - excon:pcon, - lastm:pcon, - mcon:pcon, - postuse:pcon, - typedent:pcon {found(&poccur, param) ;} - - postsref:pcon { - adddefent(thisrule); - found(&poccur, param); - } - ; - -shortref - rule:scon - ; - -usemap - pcon:ucon, - postc:ucon, - skipex:ucon, - excon:ucon, - lastm:ucon, - mcon:ucon, - default:ucon, - iddefault:ucon, - postdef:ucon, - curdef:ucon {found(&uoccur, " or ") ;} - ; - -addmap - pcon:ucon, - postc:ucon, - skipex:ucon, - excon:ucon, - lastm:ucon, - mcon:ucon, - default:ucon, - iddefault:ucon, - postdef:ucon, - curdef:ucon { - if (standard) - { - M_WCHAR *w_addmap, *w_tagc; - - w_addmap = MakeWideCharString(addmap); - w_tagc = MakeWideCharString(tagc); - m_err2("%s%s not defined in the SGML standard",w_addmap,w_tagc); - m_free(w_addmap,"wide character string"); - m_free(w_tagc,"wide character string"); - } - else { - useoradd = FALSE; - found(&uoccur, " or "); - } - } - ; - -empty - ucon:postucon {srefp = EMPTYMAP ;} - ; - -entstart - rule:entdec {entrule = TRUE ;} - ; - -tagc - postucon:skipex - - ucon:sref { - defmapname(); - if (addmapname(genname, TRUE)) srefp = curmap + 1; - else m_err1("Default map name %s already in use", genname) ; - } - - sconet:s2ref - parname:p2con - error:error - - entval:rule, - typedec:rule, - postent:rule {entrule = FALSE ;} - ; - -ero - entity:entname - entity2:ent2name - ; - -entsystem - entity:typedent {SETETYPE(thisrule, M_SYSTEM) ;} - entity2:typed2ent {SETETYPE(mapname, M_SYSTEM) ;} - entval:typedec {entity->type = M_SYSTEM ;} - ; - -entst - entity:typedent {SETETYPE(thisrule, M_STARTTAG) ;} - entity2:typed2ent {SETETYPE(mapname, M_STARTTAG) ;} - entval:typedec {entity->type = M_STARTTAG ;} - mcon:mcon {smin = TRUE ;} - ; - -entet - entity:typedent {SETETYPE(thisrule, M_ENDTAG) ;} - entity2:typed2ent {SETETYPE(mapname, M_ENDTAG) ;} - entval:typedec {entity->type = M_ENDTAG ;} - mcon:mcon {emin = TRUE ;} - ; - -entmd - entity:typedent {SETETYPE(thisrule, M_MD) ;} - entity2:typed2ent {SETETYPE(mapname, M_MD) ;} - entval:typedec {entity->type = M_MD ;} - ; - -entpi - entity:typedent {SETETYPE(thisrule, M_PI) ;} - entity2:typed2ent {SETETYPE(mapname, M_PI) ;} - entval:typedec {entity->type = M_PI ;} - ; - -entsdata - entity:typedent {SETETYPE(thisrule, M_SDATA) ;} - entity2:typed2ent {SETETYPE(mapname, M_SDATA) ;} - entval:typedec {entity->type = M_SDATA ;} - ; - -min - pcon:mcon, - sref:mcon, - postc:mcon, - skipex:mcon, - excon:mcon, - lastm:mcon, - default:mcon, - iddefault:mcon, - postdef:mcon, - curdef:mcon, - postuse:mcon, - typedent:mcon {found(&moccur, min) ;} - - postsref:mcon { - adddefent(thisrule); - found(&moccur, min); - } - ; - -grpo - rule:ngname - content:model { - contype = m_token; - ruletree = curtree = gettreenode(); - } - model:model { - curtree->first = gettreenode(); - curtree->first->parent = curtree; - curtree = curtree->first; - } - submod:model { - curtree->right = gettreenode(); - curtree->right->parent = curtree->parent; - curtree = curtree->right; - } - openex:exname - - type:ntname, - type2:nt2name { - newpar->type = m_token; - newpar->kwlist = M_NULLVAL; - } - ; - -grpc - namegroup:postel - - modcon:occur2, - samecon:occur2, - occur:occur2, - occur2:occur2 {endmodel() ;} - - exlist:excon - ntgroup:default - nt2group:default2 - ; - -emi - model:neednm { - if (standard) - m_error("Explicit minimization is not provided in IS 8879"); - else { - curtree->first = gettreenode(); - curtree->first->parent = curtree; - curtree = curtree->first; - curtree->terminal = TRUE; - curtree->minim = TRUE; - } - } - submod:neednm2 { - if (standard) - m_error("Explicit minimization is not provided in IS 8879"); - else { - curtree->right = gettreenode(); - curtree->right->parent = curtree->parent; - curtree = curtree->right; - curtree->terminal = TRUE; - curtree->minim = TRUE; - } - } - ; - -incl - excon:openex { - lhs->elt->inptr = excount + 1; - exlist = NULL; - } - ; - -excl - excon:openex { - lhs->elt->exptr = excount + 1; - exlist = NULL; - } - ; - -psep - default:pcon - default2:p2con - iddefault:pcon - id2default:p2con - postdef:pcon - post2def:p2con - curdef:pcon - cur2def:p2con - postuse:sref - post2use:s2ref - typedent:sref - typed2ent:s2ref - postsref:sref {adddefent(thisrule) ;} - post2sref:s2ref {adddefent(mapname) ;} - ; - -rend - rule:rule - - lastm:rule, - skipex:rule, - postc:rule, - excon:rule, - default:rule, - iddefault:rule, - postdef:rule, - curdef:rule, - error:rule, - mcon:rule, - postuse:rule, - pcon:rule, - sref:rule, - typedent:rule {rulend() ;} - - postsref:rule { - adddefent(thisrule); - rulend(); - } - - default2:rule, - id2default:rule, - post2def:rule, - cur2def:rule {prulend() ;} - - post2use:rule, - s2ref:rule, - typed2ent:rule {ruleinit() ;} - - post2sref:rule { - adddefent(mapname); - ruleinit(); - } - ; - -opt - lastm:postc, - occur:modcon, - occur2:samecon {curtree->occurrence = m_token ;} - ; - -plus - lastm:postc, - occur:modcon, - occur2:samecon {curtree->occurrence = m_token ;} - ; - -rep - lastm:postc, - occur:modcon, - occur2:samecon {curtree->occurrence = m_token ;} - ; - -seq - modcon:submod, - occur:submod {curtree->parent->connector = SEQ ; } - - samecon:submod, - occur2:submod { - if (m_token != curtree->parent->connector) - m_error("All connectors in a submodel should be identical"); - } - ; - -or - modcon:submod, - occur:submod {curtree->parent->connector = OR ; } - - samecon:submod, - occur2:submod { - if (m_token != curtree->parent->connector) - m_error("All connectors in a submodel should be identical"); - } - ; - -and - modcon:submod, - occur:submod {curtree->parent->connector = AND ; } - - samecon:submod, - occur2:submod { - if (m_token != curtree->parent->connector) - m_error("All connectors in a submodel should be identical"); - } - ; - -vi - curdef:defval, - cur2def:def2val { - if (standard) { - M_WCHAR *w_current; - - w_current = MakeWideCharString(current); - warning1("Warning: %s initial values disallowed in ISO 8879", - w_current); - warning2(" Parameter %s for element %s", - newpar->paramname, - thisrule); - m_free(w_current,"wide character string"); - } - } - ; - -entlit - entity:litent { - adddefent(thisrule); - entclen = 0; - } - entity2:lit2ent { - adddefent(mapname); - entclen = 0; - } - - declitent:postent, - litent:postuse, - lit2ent:post2use, - edeclitent:postent, - elitent:postuse, - elit2ent:post2use { - entcontent[entclen] = M_EOS; - entity->content = - (M_WCHAR *) m_malloc(entclen + 1, "entity content"); - w_strcpy(entity->content, entcontent); - entity->wheredef = M_DBUILD; - } - - entval:declitent, - typedec:declitent, - typedent:litent, - typed2ent:lit2ent {entclen = 0 ;} - ; - -lit - litcon:litcon - default:default - default2:default2 - defval:defval - def2val:def2val - sref:sref - s2ref:s2ref - ; - -entlita - entity:litaent { - adddefent(thisrule); - entclen = 0; - } - entity2:lita2ent { - adddefent(mapname); - entclen = 0; - } - - declitaent:postent, - litaent:postuse, - lita2ent:post2use, - edclitaent:postent - elitaent:postuse - elita2ent:post2use { - entcontent[entclen] = M_EOS; - entity->content = - (M_WCHAR *) m_malloc(entclen + 1, "entity content"); - w_strcpy(entity->content, entcontent); - entity->wheredef = M_DBUILD; - } - - entval:declitaent, - typedec:declitaent, - typedent:litaent, - typed2ent:lita2ent {entclen = 0 ;} - ; - -lita - litcon:litcon - default:default - default2:default2 - defval:defval - def2val:def2val - sref:sref - s2ref:s2ref - ; - -rnicdata - model:modcon { - curtree->first = gettreenode(); - curtree->first->parent = curtree; - curtree = curtree->first; - curtree->terminal = TRUE; - curtree->value = NULL; - /* While the SGML Standard treats #CDATA as a single character - with the occurrence indicator REP (optional and repeatable), here - it is treated as a variable-length string with occurrence - indicator OPT (optional). As a result, a single error message - is issued when text occurs in an invalid context instead of - repeating the diagnostic for each character */ - curtree->occurrence = OPT; - } - - submod:samecon { - curtree->right = gettreenode(); - curtree->right->parent = curtree->parent; - curtree = curtree->right; - curtree->terminal = TRUE; - curtree->value = NULL; - curtree->occurrence = OPT; - } - ; - -connor - namegroup:ngname - exlist:exname - ntgroup:ntname - nt2group:nt2name - ; - -connseq - namegroup:ngname - exlist:exname - ntgroup:ntname - nt2group:nt2name - ; - -connand - namegroup:ngname - exlist:exname - ntgroup:ntname - nt2group:nt2name - ; - -current - default:curdef, - default2:cur2def { - newpar->deftype = m_token; - newpar->defval = M_NULLVAL; - } - ; - -required - iddefault:postdef, - default:postdef, - id2default:post2def, - default2:post2def {newpar->deftype = m_token ;} - ; - -nulldef - default:postdef - default2:post2def - iddefault:postdef - id2default:post2def - ; - -any - content:postc {contype = m_token ;} - ; - -none - content:skipex {contype = m_token ;} - ; - -rcdata - content:skipex {contype = m_token ;} - ; - -cdata - content:skipex {contype = m_token ;} - - type:default, - type2:default2 {newpar->type = m_token ;} - - entity:typedent {SETETYPE(thisrule, M_CDATAENT) ;} - entity2:typed2ent {SETETYPE(mapname, M_CDATAENT) ;} - entval:typedec {entity->type = M_CDATAENT ;} - ; - -cro - litcon:litcon - ; - -litrs - litcon:litcon - ; - -litrsc - litcon:litcon - ; - -litre - litcon:litcon - ; - -litrec - litcon:litcon - ; - -littab - litcon:litcon - ; - -littabc - litcon:litcon - ; - -litspace - litcon:litcon - ; - -litcspace - litcon:litcon - ; - -refc - charent:charent - ; - -id - type:iddefault, - type2:id2default { - if (idoccur) m_error("Only one ID parameter allowed in a rule"); - else { - idoccur = TRUE; - newpar->type = m_token; - } - } - ; - -idref - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -idrefs - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -nametype - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -names - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -nmtoken - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -nmtokens - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -number - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -numbers - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -nutoken - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -nutokens - type:default, - type2:default2 {newpar->type = m_token ;} - ; - -entatt - type:default, - type2:default2 {newpar->type = m_token ;} - ; - - -endfile - curdef:rule, - default:rule, - iddefault:rule, - excon:rule, - lastm:rule, - postc:rule, - postdef:rule, - skipex:rule, - mcon:rule, - postuse:rule, - typedent:rule { - rulend() ; - done(); - } - - postsref:rule { - adddefent(thisrule); - rulend(); - done(); - } - - cur2def:rule, - default2:rule, - id2default:rule, - post2def:rule {prulend() ; done() ;} - - rule:rule, - post2use:rule, - post2sref:rule, - typed2ent:rule {done() ;} - ; - -name - default:postdef, - default2:post2def { - newpar->deftype = NAME; - setdefault(name); - } - - defval:postdef, - def2val:post2def {setdefault(name) ;} - - exname:exlist {addex() ;} - - model:occur { - curtree->first = gettreenode(); - curtree->first->parent = curtree; - curtree = curtree->first; - curtree->terminal = TRUE; - curtree->value = ntrelt(name); - } - - submod:occur2 { - curtree->right = gettreenode(); - curtree->right->parent = curtree->parent; - curtree = curtree->right; - curtree->terminal = TRUE; - curtree->value = ntrelt(name); - } - - neednm:occur, - neednm2:occur2 - {curtree->value = ntrelt(name) ;} - - ngname:namegroup {savelhs(FALSE) ;} - - nt2name:nt2group, - ntname:ntgroup {addkeyword() ;} - - pcon:type, - p2con:type2 {addpar() ;} - - rule:postel {savelhs(FALSE) ;} - - ucon:postucon { - addmapname(name, FALSE); - srefp = curmap + 1; - } - - entname:postuse, - ent2name:post2use {addndent(name) ;} - - firstparname:parname, - parname:parname {savelhs(TRUE) ;} - - scon:sconet { - if (! addmapname(name, TRUE)) - m_err1("Map name %s already in use", name); - else w_strcpy(mapname, name); - } - - entdec:entval { - if (! addent(name)) - m_err1("Entity %s already defined", name); - } - ; - -literal - default:postdef, - default2:post2def { - newpar->deftype = NAME; - setdefault(literal); - } - - defval:postdef, - def2val:post2def {setdefault(literal) ;} - - sref:postsref, - s2ref:post2sref {addsref(literal) ;} - ; - -text - declitent:declitent { - if (entclen >= M_LITLEN) { - curcon = EDECLITENT; - m_error("Entity content too long"); - } - else entcontent[entclen++] = scanval; - } - declitaent:declitaent { - if (entclen >= M_LITLEN) { - curcon = EDCLITAENT; - m_error("Entity content too long"); - } - else entcontent[entclen++] = scanval; - } - litent:litent { - if (entclen >= M_LITLEN) { - curcon = ELITENT; - m_error("Entity content too long"); - } - else entcontent[entclen++] = scanval; - } - lit2ent:lit2ent { - if (entclen >= M_LITLEN) { - curcon = ELIT2ENT; - m_error("Entity content too long"); - } - else entcontent[entclen++] = scanval; - } - litaent:litaent { - if (entclen >= M_LITLEN) { - curcon = ELITAENT; - m_error("Entity content too long"); - } - else entcontent[entclen++] = scanval; - } - lita2ent:lita2ent { - if (entclen >= M_LITLEN) { - curcon = ELITA2ENT; - m_error("Entity content too long"); - } - else entcontent[entclen++] = scanval; - } - - edeclitent:edeclitent - edclitaent:edclitaent - elitent:elitent - elit2ent:elit2ent - elitaent:elitaent - elita2ent:elita2ent - ; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/eltree.c b/cde/programs/dthelp/parser.ccdf/htag/build/eltree.c deleted file mode 100644 index 4701e02be..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/eltree.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: eltree.c /main/3 1995/11/08 11:11:48 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Eltree.c contains procedures that manipulate element names */ - -#include -#include -#include "build.h" - -/* Enters an element name into the element name tree */ -ELTSTRUCT *ntrelt(p) - M_WCHAR *p ; - { - ELTSTRUCT *new ; - ELTSTRUCT *old ; - int length ; - - new = (ELTSTRUCT *) m_malloc(sizeof(ELTSTRUCT), "element structure") ; - if (old = (ELTSTRUCT *) m_ntrtrie(p, &eltree, (M_TRIE *) new)) { - m_free((M_POINTER) new, "element structure") ; - return(old) ; - } - *nextelt = new ; - nextelt = &new->next ; - new->eltno = ++ecount ; - length = w_strlen(p) + 1 ; - enamelen += length ; - new->enptr = (M_WCHAR *) m_malloc(length, "element name") ; - w_strcpy(new->enptr, p) ; - new->model = M_NULLVAL ; - new->content = M_NULLVAL ; - new->inptr = new->exptr = 0 ; - new->parptr = NULL ; - new->parindex = M_NULLVAL ; - new->paramcount = M_NULLVAL ; - new->stmin = new->etmin = FALSE ; - new->srefptr = M_NULLVAL ; - new->useoradd = TRUE ; - new->next = NULL ; - return(new) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/except.c b/cde/programs/dthelp/parser.ccdf/htag/build/except.c deleted file mode 100644 index 48437cc12..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/except.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: except.c /main/3 1995/11/08 11:12:04 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Except.c contains procedures related to exceptions for program BUILD */ - -#include "build.h" - -/* Add an exception (inclusion or exclusion) for the current element */ -void addex(void) - { - excount++ ; - *nextex = (EXCEPTION *) m_malloc(sizeof(EXCEPTION), "exception") ; - if (exlist) exlist->next = *nextex ; - exlist = *nextex ; - (*nextex)->next = NULL ; - (*nextex)->nextptr = NULL ; - (*nextex)->element = ntrelt(name)->eltno ; - nextex = &(*nextex)->nextptr ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/fsa.c b/cde/programs/dthelp/parser.ccdf/htag/build/fsa.c deleted file mode 100644 index e89448a01..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/fsa.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: fsa.c /main/3 1995/11/08 11:12:14 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Fsa.c contains the procedures used by program BUILD to convert a tree - representation of a content model to an FSA */ - -#include -#include "build.h" -#include "context.h" -#include "delim.h" - -/* Addarc adds an arc from FSA state to state setting other - fields as indicated by the other parameters.*/ -int addarc(STATE *from, STATE *to, ELTSTRUCT *label, ANDGROUP *and, LOGICAL optional, int id, LOGICAL minim, ELTSTRUCT **errelt) - { - ARC *parc, *qarc ; - int determ ; - - determ = checkdfsa(from, label, and, id, errelt) ; - parc = from->first ; - qarc = (ARC *) m_malloc(sizeof(ARC), "arc") ; - from->first = qarc ; - qarc->label = label ; - qarc->optional = optional ; - qarc->minim = minim ; - qarc->group = and ; - qarc->to = to ; - qarc->next = parc ; - qarc->id = id ; - return(determ) ; - } - -/*checkand is used to verify nondeterminism from start and final states - of FSA's generated from and groups*/ -void checkand(andstart, andptr, start, root, errelt) - ANDGROUP *andstart, *andptr ; - STATE *start ; - TREE *root ; - ELTSTRUCT **errelt ; - { - ARC *parc ; - ANDGROUP *pand ; - int c ; - - for (parc = start->first ; parc ; parc = parc->next) { - if (parc->group) { - if (parc->group != andstart) - for (pand = parc->group ; pand ; pand = pand->next) - checkand(andstart, andptr, pand->start, root, errelt) ; - } - else if (c = checkdfsa(andptr->start, - parc->label, - parc->group, - parc->id, - errelt)) - nondeterm(root, c, *errelt) ; - } - } - -/*Checkdfsa is called when adding an arc to an FSA in order to verify that -no existing arc from the same state (or from a start state of an and-group -FSA labelling an arc from the same state) has the same label. */ -int checkdfsa(from, label, and, id, errelt) - STATE *from ; - ELTSTRUCT *label ; - ANDGROUP *and ; - int id ; - ELTSTRUCT **errelt ; - { - int c ; - ARC *parc ; - ANDGROUP *group ; - - for (parc = from->first ; parc ; parc = parc->next) { - if (parc->group) { - if (and == parc->group) return(ANDCONFLICT) ; - for (group = parc->group ; group ; group = group->next) - if (c = checkdfsa(group->start, label, and, id, errelt)) - return(c) ; - } - else if (! and && label == parc->label && parc->id != id) { - if (label) { - *errelt = label ; - return(ELTCONFLICT) ; - } - return(DATACONFLICT) ; - } - } - return(FALSE) ; - } - -/* Check use of repeated models with and groups */ -int checkrepeat(from, and, errelt) - STATE *from ; - ANDGROUP *and ; - ELTSTRUCT **errelt ; - { - ARC *parc ; - int c ; - - for (; and ; and = and->next) - for (parc = and->start->first ; parc ; parc = parc->next) { - if (parc->group) - if (c = checkrepeat(from, parc->group, errelt)) return(c) ; - else ; - else - if (c = checkdfsa(from, - parc->label, - M_NULLVAL, - parc->id, - errelt)) - return(c) ; - else ; - } - return(FALSE) ; - } - -/* Copyintolist copies one list of states into another */ -void copyintolist(from, to) - STATELIST *from, **to ; - { - STATELIST **new, *old ; - - old = *to ; - new = to ; - for ( ; from ; from = from->next) { - if (notinlist(from, old)) { - *new = (STATELIST *) m_malloc(sizeof(STATELIST), "state list") ; - (*new)->value = from->value ; - (*new)->level = from->level ; - new = &(*new)->next ; - } - } - *new = old ; - } - -/* Dellist deletes a list of states */ -void dellist(list) - STATELIST **list ; - { - STATELIST *p, *q ; - - for (p = *list ; p ; ) { - q = p ; - p = p->next ; - m_free(q, "state list") ; - } - *list = NULL ; - } - -/* Delstartarcs deletes the contents of the starta list of arcs from start - states of a submodel */ -void delstartarcs(void) - { - ARC *arcptr ; - ARC *discard ; - - for (arcptr = top->starta ; arcptr ; ) { - discard = arcptr ; - arcptr = arcptr->next ; - m_free(discard, "arc") ; - } - top->starta = NULL ; - } - -/* Getand allocates and initializes a new andgroup structure */ -ANDGROUP *getand(void) - { - ANDGROUP *new ; - - new = (ANDGROUP *) m_malloc(sizeof(ANDGROUP), "and group") ; - new->nextptr = new->next = NULL ; - new->count = ++andused ; - *nextand = new ; - nextand = &new->nextptr ; - return(new) ; - } - -/* Getstate obtains an FSA state */ -STATE *getstate(void) - { - STATE *new ; - - new = (STATE *) m_malloc(sizeof(STATE), "state") ; - new->final = FALSE ; - new->datacontent = FALSE ; - new->frompcdata = FALSE ; - new->first = NULL ; - new->count = ++stateused ; - new->next = NULL ; - *nextstate = new ; - nextstate = &new->next ; - return(new) ; - } - -/* Makeand processes a submodel whose connector is & */ -void makeand(canbenull, root, optional) - LOGICAL *canbenull ; - TREE *root ; - int optional ; - { - TREE *child ; - STATELIST *start, *final ; - LOGICAL groupbenull ; - ANDGROUP *andptr, *saveand, *otherand ; - STATELIST *index ; - ELTSTRUCT *errelt ; - - for (child = root->first ; child ; child = child->right) { - if (child == root->first) { - *canbenull = TRUE ; - andptr = getand() ; - saveand = andptr ; - push() ; - copyintolist(top->oldtop->allfinal, &top->allfinal) ; - } - else { - andptr->next = getand() ; - andptr = andptr->next ; - } - andptr->start = startfsa(child, &groupbenull) ; - if (andptr->start->datacontent) - for (index = top->oldtop->starts ; index ; index = index->next) - index->value->datacontent = TRUE ; - if (! groupbenull) *canbenull = FALSE ; - /* Check for ambiguity between start state of branch just completed - and start state of the and-group (i.e., parent of branch just - completed) */ - for (start = top->oldtop->starts ; start ; start = start->next) - checkand(saveand, andptr, start->value, root, &errelt) ; - /* Check for ambiguity between start state of branch just completed - and final states of previous branches */ - for (final = top->allfinal ; final ; final = final->next) - checkand(saveand, andptr, final->value, root, &errelt) ; - copyintolist(top->finals, &top->allfinal) ; - copyintolist(top->newfinal, &top->allfinal) ; - copyintolist(top->finals, &top->oldtop->newfinal) ; - copyintolist(top->newfinal, &top->oldtop->newfinal) ; - dellist(&top->finals) ; - dellist(&top->newfinal) ; - /* Check for ambiguity between start states of branch just completed - and start states of previous branches */ - for (otherand = saveand ; otherand != andptr ; - otherand = otherand->next) - checkand(saveand, andptr, otherand->start, root, &errelt) ; - } - pop() ; - if (*canbenull) optional = stacklevels + 1 ; - simplebranch(root, M_NULLVAL, saveand, optional) ; - if (*canbenull) copyintolist(top->starts, &top->finals) ; - for (final = top->finals ; final ; final = final->next) - final->level = stacklevels ; - } - -/* Makefsa builds the portion of an FSA that corresponds to an entire - submodel (i.e., a subtree of the tree representation of the rule). - The value returned indicates whether the submodel can be null (i.e., - whether all its elements are optional). The parameters are a pointer - to the root of the subtree and an integer indicating the level of - nesting (if any) of submodels at which the subtree became optional. - Note that as used here, "optional" means "not contextually required" in - the terminology of the Standard rather than "contextually optional". - - Makefsa is a recursive procedure. As the FSA is built, a stack is - maintained of the nested content models that have been encountered - but not yet terminated. For each open model on the stack, starts is - a list of its start states (i.e., FSA states from which transitions - correspond to elements which can occur at the beginning of the rule - being processed), finals is a list of its final states, starta is a - list of arcs emanating from the start states of the model, and - allfinal and newfinal are lists of final states used in checking for - determinism when and-groups are used. In more detail, allfinal is a - list of final states of FSA's in and-groups that may occur just prior - to the current context; i.e., 1) when starting a new FSA in an and-group, - the set of final states of already-constructed FSA's in the same group - (or final states of FSA's in submodel and-groups that end such FSA's) - or 2) the set of final states of FSA's in an and-group that precedes - the current context (e.g., the final states of the and-group FSA's - when processing 'x' in ((a&b),x)). At each stage in the parse (or level - on the stack), newfinal is the set of states to be added to those in - allfinal as a result of processing at that level. Information in - allfinal is passed from model to submodel; information in newfinal - goes from submodel to model. - */ -LOGICAL makefsa(root, optional) - TREE *root ; - int optional ; - { - LOGICAL canbenull ; - - canbenull = FALSE ; - if (root->occurrence == OPT || root->occurrence == REP) - optional = stacklevels + 1 ; - /* The branch consists of a single element name */ - if (root->terminal) - simplebranch(root, root->value, M_NULLVAL, optional) ; - /* The submodel's connector is SEQ (,) */ - else if (root->connector == SEQ) - makeseq(&canbenull, root, optional) ; - /* The submodel's connector is OR (|) */ - else if (root->connector == OR) - makeor(&canbenull, root) ; - /* The submodel's connector is AND (&) */ - else if (root->connector == AND) - makeand(&canbenull, root, optional) ; - /* The submodel is a single item in parentheses */ - else canbenull = makefsa(root->first, optional) ; - - /* The FSA is built, now repeat if occurrence indicator so indicates */ - if (root->occurrence == OPT || root->occurrence == REP) canbenull = TRUE ; - if (root->occurrence == OPT) copyintolist(top->starts, &top->finals) ; - else if (root->occurrence == REP) { - repeat(root) ; - copyintolist(top->starts, &top->finals) ; - } - else if (root->occurrence == PLUS) repeat(root) ; - return(canbenull) ; - } - -/* Makeor processes a submodel whose connector is | */ -void makeor(canbenull, root) - LOGICAL *canbenull ; - TREE *root ; - { - TREE *child ; - STATELIST *final ; - - push() ; - copyintolist(top->oldtop->starts, &top->starts) ; - copyintolist(top->oldtop->allfinal, &top->allfinal) ; - for (child = root->first ; child ; child = child->right) { - if (makefsa(child, stacklevels)) *canbenull = TRUE ; - savestartarcs() ; - delstartarcs() ; - copyintolist(top->finals, &top->oldtop->finals ) ; - dellist(&top->finals) ; - } - copyintolist(top->newfinal, &top->oldtop->newfinal) ; - pop() ; - for (final = top->finals ; final ; final = final->next) - final->level = stacklevels ; - } - -/* Makeseq processes a submodel whose connector is , */ -void makeseq(canbenull, root, optional) - LOGICAL *canbenull ; - TREE *root ; - int optional ; - { - LOGICAL branchnull ; - STATELIST *keepfinal = NULL, *final ; - TREE *child ; - - push() ; - *canbenull = TRUE ; - copyintolist(top->oldtop->starts, &top->starts) ; - copyintolist(top->oldtop->allfinal, &top->allfinal) ; - for (child = root->first ; child ; child = child->right) { - branchnull = makefsa(child, optional) ; - if (*canbenull) savestartarcs() ; - if (! branchnull) { - *canbenull = FALSE ; - dellist(&top->allfinal) ; - dellist(&keepfinal) ; - } - copyintolist(top->newfinal, &top->allfinal) ; - copyintolist(top->newfinal, &keepfinal) ; - dellist(&top->newfinal) ; - delstartarcs() ; - dellist(&top->starts) ; - copyintolist(top->finals, &top->starts) ; - dellist(&top->finals) ; - if (! child->occurrence || child->occurrence == PLUS) - optional = FALSE ; - } - copyintolist(top->starts, &top->oldtop->finals) ; - copyintolist(keepfinal, &top->oldtop->newfinal) ; - dellist(&keepfinal) ; - pop() ; - for (final = top->finals ; final ; final = final->next) - final->level = stacklevels ; - } - -/* Nondeterm issues a diagnostic when a nondeterministic model is - encountered */ -void nondeterm(root, c, eltp) - TREE *root ; - int c ; - ELTSTRUCT *eltp ; - { - M_WCHAR *wtemp; - - switch (c) { - case ANDCONFLICT: - wtemp = MakeWideCharString(and); - warning2("Error in model for %s: Conflict in use of '%s'", - thisrule, - wtemp) ; - m_free(wtemp, "wide character string"); - break ; - case DATACONFLICT: - wtemp = MakeWideCharString(rnicdata); - warning2("Error in model for %s: Conflict in use of '%s'", - thisrule, - wtemp) ; - m_free(wtemp, "wide character string"); - break ; - case ELTCONFLICT: - warning2("Error in model for %s: Conflict in use of '%s'", - thisrule, - eltp->enptr) ; - break ; - } - regenerate(ruletree, root) ; - msgline(" . . .\n") ; - } - -/* Notinlist returns TRUE iff item is not in list. If item is in list, - it makes sure that the stored nesting level is the smaller of the two */ -LOGICAL notinlist(item, list) - STATELIST *item, *list ; - { - for ( ; list ; list = list->next) - if (list->value == item->value) { - if (item->level < list->level) list->level = item->level ; - return(FALSE) ; - } - return(TRUE) ; - } - -/* Returns true if the arc is labeled #PCDATA or with an and-group that - has an arc labelled #PCDATA from a start state */ -LOGICAL permitspcd(a) - ARC *a ; - { - ANDGROUP *pand ; - ARC *b ; - - if (a->group) { - for (pand = a->group ; pand ; pand = pand->next) - for (b = pand->start->first ; - b ; - b = b->next) - if (permitspcd(b)) return(TRUE) ; - return(FALSE) ; - } - /* Not an and-group */ - if (a->label) return(FALSE) ; - return(TRUE) ; - } - -/* Pop pops the submodel stack when the end of the current submodel is - encountered */ -void pop(void) - { - STACK *discard ; - - dellist(&top->starts) ; - dellist(&top->finals) ; - dellist(&top->allfinal) ; - dellist(&top->newfinal) ; - delstartarcs() ; - stacklevels-- ; - discard = top ; - top = top->oldtop ; - m_free((M_POINTER) discard, "stack entry") ; - } - -/* Push pushes the submodel stack when a new group is encountered */ -void push(void) - { - STACK *new ; - - new = (STACK *) m_malloc(sizeof(STACK), "stack entry") ; - new->oldtop = top ; - top = new ; - stacklevels++ ; - top->starts = top->finals = top->newfinal = top->allfinal = NULL ; - top->starta = M_NULLVAL ; - } - -/* Regenerate is used in error processing to print the portion of a grammar - rule preceding an error */ -LOGICAL regenerate(start, stop) -TREE *start, *stop ; -{ -TREE *child ; - -if (start == stop) return(TRUE) ; - -if (start->terminal) - { - char *mb_enptr; - - if (start->value) - mb_enptr = MakeMByteString(start->value->enptr); - else - mb_enptr = NULL; - msg1line("%s", mb_enptr ? mb_enptr : rnicdata) ; - if (mb_enptr) - m_free(mb_enptr,"multi-byte string"); - } -else - { - msgline("(") ; - for (child = start->first ; child ; child = child->right) - { - if (regenerate(child, stop)) return(TRUE) ; - if (child->right) - { - if (start->connector == SEQ) msg1line("%s", seq) ; - if (start->connector == OR) msg1line("%s", or) ; - if (start->connector == AND) msg1line("%s", and) ; - } - } - msgline(")") ; - } - -if (start->occurrence == OPT) msg1line("%s", opt) ; -if (start->occurrence == PLUS) msg1line("%s", plus) ; -if (start->occurrence == REP) msg1line("%s", rep) ; - -return(FALSE) ; -} - -/* Repeat is called after a partial FSA is built for a submodel whose - occurrence indicator is RPT (*) or PLUS (+). It handles repetition - by adding arcs from all the final states to all the states reachable - in one transition from a start state, labelling them as arcs from - start states are labelled. */ -void repeat(root) - TREE *root ; - { - STATELIST *final ; - ARC *a ; - int c ; - ELTSTRUCT *errelt ; - M_WCHAR *wtemp; - - copyintolist(top->newfinal, &top->allfinal) ; - dellist(&top->newfinal) ; - for (a = top->starta ; a ; a = a->next) { - for (final = top->allfinal ; final ; final = final->next) { - if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) { - wtemp = MakeWideCharString(root->occurrence == PLUS ? plus : rep); - warning1("Conflict in use of %s", wtemp); - m_free(wtemp, "wide character string"); - nondeterm(root, c, errelt) ; - } - else - ; - else - if (c = checkdfsa(final->value, - a->label, - a->group, - a->id, - &errelt)) - nondeterm (root, c, errelt) ; - else - ; - } - for (final = top->finals ; final ; final = final->next) { - if (samelabelarc(a, final->value)) continue ; - if (a->group) - if (c = checkrepeat(final->value, a->group, &errelt)) - nondeterm(root, c, errelt) ; - if (a->label || - a->group || - ! final->value->frompcdata) { - if (c = addarc(final->value, a->to, a->label, - a->group, TRUE, a->id, - a->minim, &errelt)) - nondeterm(root, c, errelt) ; - if (permitspcd(a)) final->value->datacontent = TRUE ; - } - } - } - } - -/* Used during processing of occurrence indicators in content models such - as (a+)+ to prohibit duplicate arcs */ -LOGICAL samelabelarc(a, s) - ARC *a ; - STATE *s ; - { - ARC *b ; - - for (b = s->first ; b ; b = b->next) - if (b->id == a->id) return(TRUE) ; - return(FALSE) ; - } - -/* Saves the name of an element appearing on the left-hand side of a - grammar rule */ -void savelhs(LOGICAL param) - { - STATE *end ; - ELTSTRUCT *errelt ; - ELTSTRUCT *thiselt ; - - *nextlhs = (LHS *) m_malloc(sizeof(LHS), "lhs") ; - (*nextlhs)->next = NULL ; - thiselt = ntrelt(name) ; - (*nextlhs)->elt = thiselt ; - nextlhs = &(*nextlhs)->next ; - if (! startstate) { - startstate = getstate() ; - end = getstate() ; - addarc(startstate, end, thiselt, M_NULLVAL, FALSE, 1, FALSE, &errelt) ; - end->final = TRUE ; - } - if (param && thiselt->parptr) { - m_err1("Parameters for %s already defined", thiselt->enptr) ; - return ; - } - if (! param && thiselt->model) - warning1("Duplicate model for element %s", thiselt->enptr) ; - } - -/* Called when arcs are added to the start state of a submodel that is - also a start state of the parent model to set the parent model's - starta list */ -void savestartarcs(void) - { - ARC *carcptr, *parcptr ; - - for (carcptr = top->starta ; carcptr ; carcptr = carcptr->next) { - parcptr = (ARC *) m_malloc(sizeof(ARC), "arc") ; - parcptr->label = carcptr->label ; - parcptr->optional = carcptr->optional ; - parcptr->minim = carcptr->minim ; - parcptr->group = carcptr->group ; - parcptr->to = carcptr->to ; - parcptr->next = top->oldtop->starta ; - parcptr->id = carcptr->id ; - top->oldtop->starta = parcptr ; - } - } - -/* Simplebranch adds a new state and transition to it in an FSA when a - submodel consists of a single element or of an and group */ -void simplebranch(root, value, group, optional) - TREE *root ; - ELTSTRUCT *value ; - ANDGROUP *group ; - int optional ; - { - STATE *new = NULL ; - STATELIST *index ; - int c ; - ELTSTRUCT *errelt ; - - /* Check for ambiguity between an arc to be added and arcs from final - states of and-groups that terminate at the start state of the new - arc */ - for (index = top->allfinal ; index ; index = index->next) - if (c = checkdfsa(index->value, value, group, root->eltid, &errelt)) - nondeterm(root, c, errelt) ; - for (index = top->starts ; index ; index = index->next) { - if (! group && ! value && index->value->frompcdata) - continue ; - if (! new) { - new = getstate() ; - new->frompcdata = (LOGICAL) (! group && ! value) ; - } - c = addarc(index->value, new, value, group, - (LOGICAL) (optional > index->level), - root->eltid, root->minim, &errelt) ; - if (c) nondeterm(root, c, errelt) ; - if (! group && ! value) index->value->datacontent = TRUE ; - } - if (new) { - top->finals = (STATELIST *) m_malloc(sizeof(STATELIST), "state list") ; - top->finals->value = new ; - top->finals->level = stacklevels ; - top->finals->next = NULL ; - top->starta = (ARC *) m_malloc(sizeof(ARC), "arc") ; - top->starta->label = value ; - top->starta->optional = FALSE ; - top->starta->minim = root->minim ; - top->starta->group = group ; - top->starta->to = new ; - top->starta->next = NULL ; - top->starta->id = root->eltid ; - } - else copyintolist(top->starts, &top->finals) ; - } - -/* Startfsa creates a new FSA. It is called once for each content model and - once for each and group. Its parameters are the root of the - subtree in the tree representing the grammar rule being processed and - the pointer to a flag that is set to indicate whether or not the - submodel can be null. */ -STATE *startfsa(root, canbenull) - TREE *root ; - LOGICAL *canbenull ; - { - STATELIST *item ; - STATE *first ; - - top->starts = (STATELIST *) m_malloc(sizeof(STATELIST), "state list") ; - first = getstate() ; - top->starts->value = first ; - top->starts->level = stacklevels ; - top->starts->next = NULL ; - *canbenull = makefsa(root, FALSE) ; - for (item = top->finals ; item ; item = item->next) - item->value->final = TRUE ; - dellist(&top->starts) ; - delstartarcs() ; - return(first) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/out.c b/cde/programs/dthelp/parser.ccdf/htag/build/out.c deleted file mode 100644 index a13b2dcf3..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/out.c +++ /dev/null @@ -1,668 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: out.c /main/3 1995/11/08 11:12:25 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Out.c contains the procedures used by program BUILD to output results */ - -#include -#include -#include "context.h" -#include "build.h" -#include "delim.h" -#include "entdef.h" - -#define boolean(x) x ? "TRUE" : "FALSE" - -/* Macro names written to dtd.h */ -char many[] = "M_ANY" ; -char mcdata[] = "M_CDATA" ; -char mcdataent[] = "CDATAENT" ; -char mcdata_att[] = "M_CDATT" ; -char mcurrent[] = "M_CURRENT" ; -char mentatt[] = "M_ENTATT" ; -char merror[] = "M_ERROR" ; -char mgeneral[] = "" ; -char midrefs[] = "M_IDRFS" ; -char midref[] = "M_IDRF" ; -char mid[] = "M_ID" ; -char mkeyword[] = "M_KEYWORD" ; -char mnamedef[] = "M_NAMEDEF" ; -char mnamepar[] = "M_NAMEPAR" ; -char mnames[] = "M_NAMES" ; -char mnmtkns[] = "M_NMSTOKEN" ; -char mnmtoken[] = "M_NMTOKEN" ; -char mnone[] = "M_NONE" ; -char mnulldef[] = "M_NULLDEF" ; -char mnumbers[] = "M_NUMS" ; -char mnumber[] = "M_NUMBER" ; -char mnutkns[] = "M_NUSTOKEN" ; -char mnutoken[] = "M_NUTOKEN" ; -char mrcdata[] = "M_RCDATA" ; -char mregexp[] = "M_REGEXP" ; -char mrequired[] = "M_REQUIRED" ; - -/* Deftype returns a string indicating the default type of the nth parameter. - */ -char *deftype(n) - int n ; - { - switch (n) { - case NAME: return(mnamedef) ; - case CURRENT: return(mcurrent) ; - case REQUIRED: return(mrequired) ; - case NULLDEF: return(mnulldef) ; - default: - errexit = ERREXIT ; - return(merror) ; - } - } - -/* Called after all input is read to generate output */ -void done(void) - { - - if (! eltree.data) { - warning("Error: no elements specified") ; - return ; - } - eltreeout() ; - parout() ; - srefout() ; - entout("entity") ; - fsa() ; - exout() ; - template() ; - } - -/* Prints data value of an entry in the element name tree */ -void dumpentnode(file, value) - FILE *file ; - M_TRIE *value ; - { - - fprintf(file, ", %d", ((ELTSTRUCT *) value)->eltno) ; - } - -/* Prints data value of an entry in the trie of short reference map names, - reporting any maps that are referenced but not defined */ -void dumpmapnode(file, value) - FILE *file ; - M_TRIE *value ; - { - fprintf(file, ", %d", ((MAP *) value)->map) ; - if (! ((MAP *) value)->defined) - warning1("Short reference map \"%s\" referenced but not defined.", - ((MAP *) value)->mapname) ; - } - - -/* Prints data value of an entry in the trie of short reference delimiters */ -void dumpsrefnode(file, value) - FILE *file ; - M_TRIE *value ; - { - fprintf(file, ", %d", ((SREFSTRUCT *) value)->srefcnt) ; - } - - -/* Controls printing of element blocks in alphabetical order to the - template file */ -void eltblocks(tempfile) - FILE *tempfile ; - { - int n ; - M_TRIE *node[M_NAMELEN + 1] ; - M_TRIE *current ; - char symbol ; - - n = 0 ; - current = eltree.data ; - while (TRUE) { - symbol = current->symbol ; - node[n] = current->next ; - if (! symbol) { - tempelt((ELTSTRUCT *) current->data, tempfile) ; - current = current->next ; - while (! current) { - n-- ; - if (n < 0) return ; - current = node[n] ; - } - } - else { - current = current->data ; - n++ ; - } - } - } - - -/* Writes data about elements */ -void eltreeout(void) - { - M_WCHAR *p ; - int enameindex = 0 ; - ELTSTRUCT *eltp ; - LOGICAL first ; - - m_openchk(&dtd, "dtd.h", "w") ; - - fputs("#if defined(M_DTDDEF)\n", dtd) ; - fputs("#define M_DTDEXTERN\n", dtd) ; - fputs("#define M_DTDINIT(a) = a\n", dtd) ; - fputs("#else\n", dtd) ; - fputs("#define M_DTDEXTERN extern\n", dtd) ; - fputs("#define M_DTDINIT(a)\n", dtd) ; - fputs("#endif\n\n", dtd) ; - - fputs("#include \"dtddef.h\"\n\n", dtd) ; - - dumpptrie(&eltree, "m_entree", dtd, "M_DTDEXTERN", "M_DTDDEF", - dumpentnode) ; - - fprintf(dtd, "M_DTDEXTERN M_WCHAR m_ename[%d]\n", enamelen) ; - fputs("#if defined(M_DTDDEF)\n = {\n", dtd) ; - first = TRUE ; - for (eltp = firstelt ; eltp ; eltp = eltp->next) { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - for (p = eltp->enptr ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; - fputs(" 0", dtd) ; - } - fputs(ndif, dtd) ; - - - fprintf(dtd, "M_DTDEXTERN int m_elcount M_DTDINIT(%d) ;\n", ecount) ; - fprintf(dtd, - "M_DTDEXTERN M_ELTSTRUCT m_element[%d]\n#if defined(M_DTDDEF)\n = {\n", - ecount) ; - first = TRUE ; - for (eltp = firstelt ; eltp ; eltp = eltp->next) { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - if (! eltp->content) - warning1("No content model for element %s", eltp->enptr) ; - fprintf(dtd, " %d, %d, %s, ", - enameindex, eltp->model ? eltp->model->count : 0, - typecon(eltp->content)) ; - fprintf(dtd, "%d, %d, ", eltp->inptr, eltp->exptr) ; - fprintf(dtd, "%d, %d, %d", - eltp->parindex, eltp->paramcount, eltp->srefptr) ; - enameindex += w_strlen(eltp->enptr) + 1 ; - fprintf(dtd, ", %s, %s, %s", - boolean(eltp->stmin), boolean(eltp->etmin), boolean(eltp->useoradd)) ; - } - fputs(ndif, dtd) ; - } - -/* Enttype returns a string indicating the type of an entity */ -char *enttype(n) - int n ; - { - switch(n) { - case M_GENERAL: return(mgeneral) ; - case M_SYSTEM: return(entsystem) ; - case M_STARTTAG: return(entst) ; - case M_ENDTAG: return(entet) ; - case M_MD: return(entmd) ; - case M_PI: return(entpi) ; - case M_CDATAENT: return(cdata) ; - case M_SDATA: return(entsdata) ; - default: - errexit = ERREXIT ; - return(merror) ; - } - } - -/* Outputs exception lists */ -void exout(void) - { - EXCEPTION *ex ; - int exindex = 0 ; - LOGICAL first = TRUE ; - - fputs("M_DTDEXTERN M_EXCEPTION m_exception", dtd) ; - if (excount) { - fprintf(dtd, - "[%d]\n#if defined(M_DTDDEF)\n = {\n", - excount) ; - for (ex = firstex ; ex ; ex = ex->nextptr) { - if (! first) fputs(",\n", dtd) ; - first = FALSE ; - exindex++ ; - fprintf(dtd, " %d, %d", ex->element, ex->next ? exindex + 1 : 0) ; - } - fputs(ndif, dtd) ; - } - SUBONE - } - -/* Outputs FSA definitions */ -void fsa(void) - { - int arcount = 0 ; - STATE *pstate ; - FILE *farc ; - LOGICAL first ; - ANDGROUP *pand ; - ARC *parc ; - - m_openchk(&farc, "arc.h", "w") ; - - fprintf(dtd, - "M_DTDEXTERN M_STATESTRUCT m_state[%d]\n#if defined(M_DTDDEF)\n = {\n", - stateused) ; - - for (pstate = firststate ; pstate ; pstate = pstate->next) - for (parc = pstate->first ; parc ; parc = parc->next) - ++arcount ; - fprintf(farc, - "M_DTDEXTERN M_ARCSTRUCT m_arc[%d]\n#if defined(M_DTDDEF)\n = {\n", - arcount) ; - - arcount = 0 ; - first = TRUE ; - for (pstate = firststate ; pstate ; pstate = pstate->next) { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - fprintf(dtd, " %s, %s, %d", - boolean(pstate->final), boolean(pstate->datacontent), - pstate->first ? ++arcount : 0) ; - for (parc = pstate->first ; parc ; parc = parc->next) { - if (arcount > 1) fputs(",\n", farc) ; - fprintf(farc, " %d, %s, %d, %d, %d, %d", - parc->label ? parc->label->eltno : 0, - boolean(parc->optional), - parc->minim ? parc->id : 0, - parc->group ? parc->group->count : 0, - parc->to->count, - parc->next ? ++arcount : 0 - ) ; - } - } - fputs(ndif, dtd) ; - fputs(ndif, farc) ; - - fputs("M_DTDEXTERN M_ANDSTRUCT m_andgroup", dtd) ; - if (andused) { - fprintf(dtd, "[%d]\n#if defined(M_DTDDEF)\n = {\n", andused) ; - first = TRUE ; - for (pand = firstand ; pand ; pand = pand->nextptr) { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d", - pand->start->count, - pand->next ? pand->next->count : M_NULLVAL) ; - } - fputs(ndif, dtd) ; - } - SUBONE - fclose(farc) ; - } - -/* Writes data about parameters */ -void parout(void) -{ -PARAMETER *paramp ; -LOGICAL first = TRUE ; -int pnameindex = 0 ; -M_WCHAR *p ; -int kw ; -int defindex = 0 ; -PTYPE *ptypep ; - -fputs("M_DTDEXTERN M_WCHAR m_keyword", dtd) ; -if (kwlen) - { - fprintf(dtd, - "[%d]\n#if defined(M_DTDDEF)\n = {\n", /* keep the "}" balanced */ - kwlen) ; - first = TRUE ; - for (ptypep = firstptype ; ptypep ; ptypep = ptypep->nextptr) - { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - for (p = ptypep->keyword ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; - fputs(" 0", dtd) ; - } - fputs(ndif, dtd) ; - } -SUBONE - -fputs("M_DTDEXTERN M_WCHAR m_defval", dtd) ; -if (deflen) - { - fprintf(dtd, - "[%d]\n#if defined(M_DTDDEF)\n = {\n", /* keep the "}" balanced */ - deflen) ; - first = TRUE ; - for (paramp = firstpar ; paramp ; paramp = paramp->nextptr) - if (paramp->defstring) - { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - for (p = paramp->defstring ; *p ; p++) - fprintf(dtd, " %d,\n", *p) ; - fputs(" 0", dtd) ; - } - fputs(ndif, dtd) ; - } -SUBONE - -fputs( -"M_DTDEXTERN struct {\n int keyword, next ;\n } m_ptype", -dtd) ; -if (ptypelen) - { - fprintf(dtd, "[%d]\n#if defined(M_DTDDEF)\n = {\n", ptypelen) ; - /* keep the "}" balanced */ - kw = 0 ; - first = TRUE ; - for (ptypep = firstptype ; ptypep ; ptypep = ptypep->nextptr) - { - if (first) first = FALSE ; - else fprintf(dtd, ",\n") ; - fprintf(dtd, " %d, %d", kw, ptypep->next) ; - kw += w_strlen(ptypep->keyword) + 1 ; - } - fputs(ndif, dtd) ; - } -SUBONE - -fputs("M_DTDEXTERN M_PARAMETER m_parameter", dtd) ; -if (parcount) - { - kw = 0 ; - fprintf(dtd, - "[%d]\n#if defined(M_DTDDEF)\n = {\n", /* keep the "}" balanced */ - parcount) ; - first = TRUE ; - for (paramp = firstpar ; paramp ; paramp = paramp->nextptr) - { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - fprintf(dtd, - " %d, %s, %d, %s, ", - pnameindex, - partype(paramp->type), - paramp->kwlist, - deftype(paramp->deftype)) ; - pnameindex += w_strlen(paramp->paramname) + 1 ; - if (paramp->defval) - fprintf(dtd, "&m_keyword[%d]", paramp->defval - 1) ; - else if (paramp->defstring) - { - fprintf(dtd, "&m_defval[%d]", defindex) ; - defindex += w_strlen(paramp->defstring) + 1 ; - } - else - fputs("NULL", dtd) ; - } - fputs(ndif, dtd) ; - } -SUBONE - -fputs("M_DTDEXTERN M_WCHAR m_pname", dtd) ; -if (pnamelen) - { - fprintf(dtd, - "[%d]\n#if defined(M_DTDDEF)\n = {\n", /* keep the "}" balanced */ - pnamelen) ; - first = TRUE ; - for (paramp = firstpar ; paramp ; paramp = paramp->nextptr) - { - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - for (p = paramp->paramname ; *p ; p++) fprintf(dtd, " %d,\n", *p) ; - fputs(" 0", dtd) ; - } - fputs(ndif, dtd) ; - } -SUBONE - -fprintf(dtd, "#define M_MAXPAR %d\n\n", maxpar) ; -} - -/* Partype returns a string indicating the type of the nth parameter. */ -char *partype(n) - int n ; - { - switch(n) { - case GRPO: return(mkeyword) ; - case CDATA: return(mcdata_att) ; - case ID: return(mid) ; - case IDREF: return(midref) ; - case IDREFS: return(midrefs) ; - case NAMETYPE: return(mnamepar) ; - case NAMES: return(mnames) ; - case NMTOKEN: return(mnmtoken) ; - case NMTOKENS: return(mnmtkns) ; - case NUMBER: return(mnumber) ; - case NUMBERS: return(mnumbers) ; - case NUTOKEN: return(mnutoken) ; - case NUTOKENS: return(mnutkns) ; - case ENTATT: return(mentatt) ; - default: - errexit = ERREXIT ; - return(merror) ; - } - } - -/* Write short reference information */ -void srefout(void) - { - LOGICAL first = TRUE ; - int *mapbysref ; - SREFSTRUCT *srefp ; - SREFDATA *data ; - int count = 0 ; - int thisrow ; - int i, j ; - - fprintf(dtd, "#define M_MAXSR %d\n", maxsr) ; - fprintf(dtd, "#define M_MAXSEQ %d\n", maxseq) ; - fprintf(dtd, "#define M_SREFCNT %d\n", sreflen) ; - dumpptrie(&maptree, "m_maptree", dtd, "M_DTDEXTERN", "M_DTDDEF", - dumpmapnode) ; - dumpptrie(&sreftree, "m_sreftree", dtd, "M_DTDEXTERN", "M_DTDDEF", - dumpsrefnode) ; - - fputs("M_DTDEXTERN int m_map", dtd) ; - if (mapcnt) { - mapbysref = (int *) calloc(mapcnt * sreflen, sizeof(int)) ; - if (! mapbysref) { - m_error("Unable to allocate workspace to process short references") ; - exit(TRUE) ; - } - for (srefp = firstsref ; srefp ; srefp = srefp->next) - for (data = srefp->data ; data ; data = data->next) - if (data->entidx) - mapbysref[sreflen * (data->map - 1) + srefp->srefcnt - 1] = - data->entidx ; - fprintf(dtd, "[%d]\n#if defined(M_DTDDEF)\n = {\n", mapcnt) ; - for (i = 0 ; i < mapcnt ; i++) { - if (i) fputs(",\n", dtd) ; - thisrow = 0 ; - for (j = 0 ; j < sreflen ; j++) - if (mapbysref[sreflen * i + j]) thisrow++ ; - fprintf(dtd, " %d", thisrow ? count + 1 : M_NULLVAL) ; - count += thisrow ; - } - fputs(ndif, dtd) ; - } - SUBONE - - fputs( - "M_DTDEXTERN M_SREF m_sref", dtd) ; - if (count) { - fprintf(dtd, "[%d]\n#if defined(M_DTDDEF)\n = {\n", count) ; - first = TRUE ; - count = 0 ; - for (i = 0 ; i < mapcnt ; i++) - for (j = 0 ; j < sreflen ; ) - if (mapbysref[sreflen * i + j]) { - count++ ; - if (first) first = FALSE ; - else fputs(",\n", dtd) ; - fprintf(dtd, " %d, %d, ", j + 1, mapbysref[sreflen * i + j]) ; - for (j++ ; j < sreflen ; j++) - if (mapbysref[sreflen * i + j]) break ; - fprintf(dtd, "%d", j < sreflen ? count + 1 : 0) ; - } - else j++ ; - fputs(ndif, dtd) ; - } - SUBONE - } - -/* Output one element block in a template */ -void tempelt(eltp, tempfile) -ELTSTRUCT *eltp ; -FILE *tempfile ; -{ -PARAMETER *paramp ; -PTYPE *ptypep ; -M_WCHAR *p ; -char *mb_paramname; -int indent ; -int i ; - -fprintf(tempfile, "\n\n", eltp->enptr) ; -if (eltp->parptr) - { - fputs(" /*\n", tempfile) ; - fputs(" \n", tempfile) ; - for (paramp = eltp->parptr ; paramp ; paramp = paramp->next) - { - fputs(" ", tempfile) ; - indent = 9 ; - for (p = paramp->paramname ; *p ; p++, indent += 2) - { - int length; - char mbyte[32]; /* larger than any multibyte character */ - char *pc, c; - - length = wctomb(mbyte, *p); - if (length < 0) - m_error("Invalid multibyte character found in an element"); - else - { - pc = mbyte; - if (length == 1) - { - c = *pc; - putc(isupper(c) ? tolower(c) : c, tempfile) ; - } - else - while (--length >= 0) putc(*pc++, tempfile) ; - } - } - mb_paramname = MakeMByteString(paramp->paramname); - fprintf(tempfile, " = %s ", mb_paramname) ; - m_free(mb_paramname,"multi-byte string"); - if (paramp->type == GRPO) - { - putc('(', tempfile) ; - for (ptypep = paramp->ptypep ; ptypep ; ) - { - char *mb_keyword; - - mb_keyword = MakeMByteString(ptypep->keyword); - fprintf(tempfile, - "%s = %s", - ptypep->keyword, - ptypep->keyword) ; - m_free(mb_keyword,"multi-byte string"); - ptypep = ptypep->next ? ptypep->nextptr : (PTYPE *) NULL ; - if (ptypep) - { - fputs(",\n", tempfile) ; - for (i = 0 ; i < indent ; i++) putc(' ', tempfile) ; - } - } - putc(')', tempfile) ; - } - fputs(" ;\n", tempfile) ; - } - fputs(" */\n", tempfile) ; - } -fputs(" /**/\n", tempfile) ; -fputs(" \n", tempfile) ; -fputs(" <\\START-STRING>\n", tempfile) ; -fputs(" /**/\n", tempfile) ; -fputs(" /**/\n", tempfile) ; -fputs(" \n", tempfile) ; -fputs(" <\\END-STRING>\n", tempfile) ; -} - -/* Write template */ -void template(void) - { - FILE *tempfile ; - M_ENTITY *ent ; - LOGICAL undefent = FALSE ; - - m_openchk(&tempfile, "template", "w") ; - for (ent = firstent ; ent ; ent = ent->next) { - if (! ent->wheredef) { - if (! undefent) { - fputs("/*\n", tempfile) ; - undefent = TRUE ; - } - fprintf(tempfile, "\n", - ent->name, - enttype(ent->type) - ) ; - } - } - if (undefent) fputs("*/\n", tempfile) ; - fputs("\n", tempfile) ; - fputs("\n\n\n", tempfile) ; - eltblocks(tempfile) ; - fclose(tempfile) ; - } - -/* Typecon returns a string indicating the content type of the nth element.*/ -char *typecon(n) - int n ; - { - switch(n) { - case GRPO: return(mregexp) ; - case ANY: return(many) ; - case NONE: return(mnone) ; - case CDATA: return(mcdata) ; - case RCDATA: return(mrcdata) ; - default: - errexit = ERREXIT ; - return(merror) ; - } - } - -#include "entout.c" diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/param.c b/cde/programs/dthelp/parser.ccdf/htag/build/param.c deleted file mode 100644 index 2fb2d549d..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/param.c +++ /dev/null @@ -1,329 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: param.c /main/3 1995/11/08 11:12:36 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Param.c contains procedures related to parameters for program BUILD */ - -#include -#include -#include "build.h" -#include "context.h" -#include "delim.h" - -/* Add a keyword to the list of possible values of a keyword parameter for - the current element -*/ -void addkeyword(void) -{ -int length ; -PARAMETER *par ; -PTYPE *kw ; - -/* Check if duplicate keyword for this parameter */ -for (kw = newpar->ptypep ; kw ; kw = kw->nextptr) - if (w_strcmp(kw->keyword, name) == 0) - { - warning3("Warning: Repeated keyword %s in parameter %s of %s", - name, - newpar->paramname, - thisrule) ; - return ; - } - -/* Check if duplicate keyword within parameters of this element */ -for (par = plist ; par != newpar ; par = par->next) - for (kw = par->ptypep ; kw ; kw = kw->nextptr) - { - if (w_strcmp(kw->keyword, name) == 0) - warning4("Keyword %s used in parameters %s and %s of %s", - name, - par->paramname, - newpar->paramname, - thisrule) ; - if (! kw->next) break ; - } - -*nextptype = (PTYPE *) m_malloc(sizeof(PTYPE), "ptype") ; -if (newpar->kwlist) thisptype->next = ptypelen + 1 ; -else - { - newpar->kwlist = ptypelen + 1 ; - newpar->ptypep = *nextptype ; - } -thisptype = *nextptype ; -thisptype->next = M_NULLVAL ; -thisptype->nextptr = NULL ; -nextptype = &(thisptype->nextptr) ; -length = w_strlen(name) + 1 ; -thisptype->keyword = (M_WCHAR *) m_malloc(length, "keyword") ; -w_strcpy(thisptype->keyword, name) ; -kwlen += length ; -ptypelen++ ; -} - -/* Add a parameter to the current element */ -void addpar(void) -{ -PARAMETER *paramp, *last ; -int length ; - -parcount++ ; -pcount++ ; -for (paramp = plist ; paramp ; paramp = paramp->next) - { - if (w_strcmp(name, paramp->paramname) == 0) - warning2("Multiple definition of parameter %s for element %s", - name, - thisrule) ; - last = paramp ; - } -newpar = (PARAMETER *) m_malloc(sizeof(PARAMETER), "parameter") ; -if (! plist) - plist = newpar ; -else - last->next = newpar ; -*nextpar = newpar ; -nextpar = &newpar->nextptr ; -*nextpar = NULL ; -newpar->next = NULL ; -newpar->deftype = NULLDEF ; -newpar->defval = M_NULLVAL ; -newpar->defstring = NULL ; -newpar->kwlist = M_NULLVAL ; -length = w_strlen(name) + 1 ; -pnamelen += length ; -newpar->paramname = (M_WCHAR *) m_malloc(length, "parameter name") ; -w_strcpy(newpar->paramname, name) ; -newpar->ptypep = NULL ; -} - - -/* Check that specified default value is legal parameter value */ -LOGICAL checkdefault( const M_WCHAR *string ) -{ -const M_WCHAR *p ; -int len ; -LOGICAL first ; - -if (newpar->type == CDATA) return(TRUE) ; -if (m_allwhite(string)) return(FALSE) ; - -first = TRUE ; -switch (newpar->type) - { - case IDREF: - case NAMETYPE: - case ENTATT: - case NMTOKEN: - case NUMBER: - case NUTOKEN: - /* Check length of default */ - if (w_strlen(string) > M_NAMELEN) return(FALSE) ; - - for (p = string ; *p ; p++) - { - if (m_cttype(*p) == M_NONNAME) return(FALSE) ; - else if (first || newpar->type == NUMBER) - switch (newpar->type) - { - case IDREF: - case NAMETYPE: - case ENTATT: - if (m_cttype(*p) != M_NMSTART) return(FALSE) ; - break ; - case NUMBER: - case NUTOKEN: - if (m_cttype(*p) != M_DIGIT) return(FALSE) ; - break ; - } - first = FALSE ; - } - return(TRUE) ; - case IDREFS: - case NAMES: - case NMTOKENS: - case NUMBERS: - case NUTOKENS: - len = 1 ; - for (p = string ; *p ; p++) - { - if (m_cttype(*p) == M_NONNAME) - { - if (! m_whitespace(*p)) return(FALSE) ; - len = 1 ; - } - else if (len == 1) - switch (newpar->type) - { - case IDREFS: - case NAMES: - if (m_cttype(*p) != M_NMSTART) return(FALSE) ; - break ; - case NUMBERS: - case NUTOKENS: - if (m_cttype(*p) != M_DIGIT) return(FALSE) ; - break ; - } - else if (newpar->type == NUMBERS && - m_cttype(*p) != M_DIGIT) return(FALSE) ; - if (len++ > M_NAMELEN) return(FALSE) ; - } - break ; - } -} - -/* Normalize parameter default. Change tabs and RE's to spaces, capitalize - all letters (unless type is CDATA), remove extra space in lists */ -void normdefault(M_WCHAR *string ) -{ -M_WCHAR *p, *q ; -int i ; - -switch (newpar->type) - { - case IDREF: - case NAMETYPE: - case NMTOKEN: - case NUTOKEN: - case ENTATT: - for ( ; *string ; string++) - *string = m_ctupper(*string) ; - return ; - case IDREFS: - case NAMES: - case NMTOKENS: - case NUTOKENS: - case NUMBERS: - /* Remove leading spaces */ - for (p = string; *p ; p++) - if (! m_whitespace(*p)) break ; - w_strcpy(string, p) ; - - /* Capitalize and normalize white space */ - for (p = string, i = 0 ; *p ; p++, i++) - if (m_whitespace(*p)) - { - mbtowc(p, " ", 1); - for (q = p + 1 ; m_whitespace(*q); q++) ; - w_strcpy(p + 1, q) ; - } - else - *p = m_ctupper(*p) ; - - if (i && m_whitespace(string[i - 1])) string[i - 1] = M_EOS ; - return ; - - default: - for ( ; *string ; string++) - { - char mbyte[32]; /* bigger than the biggest multibyte char */ - int length; - - length = wctomb(mbyte, *string); - if (length < 0) - { - m_error("Invalid wide character seen"); - mbyte[0] = ' '; - mbyte[1] = 0; - } - if ((length == 1) && (*mbyte == '\n' || *mbyte == '\t')) - mbtowc(string, " ", 1); - } - return ; - } -} - -/* Called at end of parameter attribute list rule */ -void prulend(void) -{ -LHS *lhsp ; -LHS *discard ; - -if (pcount > maxpar) maxpar = pcount ; -for (lhsp = lhs ; lhsp ; ) - { - if (lhsp->elt->parptr) - m_err1( - "Program error: prulend for %s, element with predefined parameters", - lhsp->elt->enptr) ; - lhsp->elt->parptr = plist ; - lhsp->elt->paramcount = pcount ; - lhsp->elt->parindex = parcount - pcount + 1 ; - discard = lhsp ; - lhsp = lhsp->next ; - m_free((M_POINTER) discard, "lhs") ; - } -ruleinit() ; -} - -/* Make string the default for the current parameter of the current element */ -void setdefault(const M_WCHAR *string) -{ -PTYPE *kw ; -int keycount ; -int length ; - -/* Process default for non-keyword parameter*/ -if (newpar->type != GRPO) - { - /* First check it is a legitimate value */ - if (! checkdefault(string)) - { - m_err2("\"%s\": Not a valid default value for parameter %s", - string, - newpar->paramname) ; - return ; - } - - length = w_strlen(string) + 1 ; - newpar->defstring = (M_WCHAR *) m_malloc(length, "default") ; - w_strcpy(newpar->defstring, string) ; - deflen += length ; - - /* Value is valid. Change tabs and RE's to spaces, if value is not - CDATA, put it in all caps, remove extra white space. */ - normdefault(newpar->defstring) ; - } -else - { - /* It is a keyword parameter, store a pointer to the value */ - for (kw = newpar->ptypep ; kw ; kw = kw->nextptr) - { - if (! m_wcupstrcmp(string, kw->keyword)) - { - for (keycount = 0 ; kw ; kw = kw->nextptr) - keycount += w_strlen(kw->keyword) + 1 ; - newpar->defval = kwlen - keycount + 1; - return ; - } - } - m_err2("Invalid default: %s not a valid value for %s", - string, - newpar->paramname) ; - } -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/proto.h b/cde/programs/dthelp/parser.ccdf/htag/build/proto.h deleted file mode 100644 index a8b7c96c2..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/proto.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: proto.h /main/3 1995/11/08 11:12:46 rswiston $ */ -/* - Copyright (c) 1988, 1989 Hewlett-Packard Co. -*/ - -/* Proto.h contains function prototypes for program BUILD. */ -/* Proto.h contains function prototypes for program BUILD. */ - - -int addarc(STATE *from, STATE *to, ELTSTRUCT *label, ANDGROUP *and, LOGICAL optional, - int id, LOGICAL minim, ELTSTRUCT **errelt); - -void adddefent(M_WCHAR *mapname); - -LOGICAL addent(M_WCHAR *name); - -void addex(void); - -void addkeyword(void); - -LOGICAL addmapname(M_WCHAR *p, LOGICAL define); - -void addndent(M_WCHAR *p); - -void addpar(void); - -void addsref(M_WCHAR *p); - -LOGICAL m_allwhite(const M_WCHAR *string); - -void checkand(ANDGROUP *andstart, ANDGROUP *andptr, STATE *start, TREE *root, - ELTSTRUCT **errelt); - -LOGICAL checkdefault(const M_WCHAR *string); - -int checkdfsa(STATE *from, ELTSTRUCT *label, ANDGROUP *and, int id, ELTSTRUCT **errelt); - -int checkrepeat(STATE *from, ANDGROUP *and, ELTSTRUCT **errelt); - -void copyintolist(STATELIST *from, STATELIST **to); - -void countdown(M_TRIE *parent, int *count); - -void defmapname(void); - -char *deftype(int n); - -void dellist(STATELIST **list); - -void delstartarcs(void); - -void done(void); - -void dumpentnode(FILE *file, M_TRIE *value); - -void dumpmapnode(FILE *file, M_TRIE *value); - -void dumpsrefnode(FILE *file, - M_TRIE *value); - -void dumpptrie(M_TRIE *intname, char *extname, FILE *file, char *externdef, char *defdef, - void (*proc)( FILE *, M_TRIE *)); - -void m_dumptrie(FILE *file, - M_TRIE *xtrie, - char *extname, - int *count, - void (*proc)(M_ENTITY *)); - -void eltblocks(FILE *tempfile); - -void eltreeout(void); - -void endmodel(void); - -void entout(char *fname); - -char *enttype(int n); - -void m_error(char *text); - -void m_err1(const char *text, const M_WCHAR *arg); - -void m_mberr1(char *text, const char *arg); - -void m_err2(const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2); - -void exout(void); - -void m_free(void *block, char *msg); - -void freetree(TREE *ruletree); - -void found(LOGICAL *flag, char *delim); - -void fsa(void); - -int getachar(void); - -ANDGROUP *getand(void); - -LOGICAL getname(int first); - -STATE *getstate(void); - -int gettoken(int *c, int context); - -TREE *gettreenode(void); - -void m_initctype(void); - -void initialize(void); - -LOGICAL litproc(int delim); - -void main(int argc, char **argv); - -void makeand(LOGICAL *canbenull, TREE *root, int optional); - -LOGICAL makefsa(TREE *root, int optional); - -void makeor(LOGICAL *canbenull, TREE *root); - -void makeseq(LOGICAL *canbenull, TREE *root, int optional); - -void *m_malloc(int size, char *msg); - -void msgline(char *text); - -void msg1line(char *text, char *arg1); - -void nondeterm(TREE *root, int c, ELTSTRUCT *eltp); - -void normdefault(M_WCHAR *string); - -LOGICAL notinlist(STATELIST *item, STATELIST *list); - -ELTSTRUCT *ntrelt(M_WCHAR *p); - -void m_openchk(FILE **ptr, char *name, char *mode); - -void parout(void); - -char *partype(int n); - -LOGICAL permitspcd(ARC *a); - -void pop(void); - -void prulend(void); - -void push(void); - -LOGICAL regenerate(TREE *start, TREE *stop); - -void repeat(TREE *root); - -void ruleinit(void); - -void rulend(void); - -LOGICAL samelabelarc(ARC *a, STATE *s); - -void savelhs(LOGICAL param); - -void savestartarcs(void); - -int scan(void); - -void setdefault(const M_WCHAR *string); - -void simplebranch(TREE *root, ELTSTRUCT *value, ANDGROUP *group, int optional); - -void skiptoend(void); - -int m_sprscon(int i, int j); - -void srefout(void); - -STATE *startfsa(TREE *root, LOGICAL *canbenull); - -void tempelt(ELTSTRUCT *eltp, FILE *tempfile); - -void template(void); - -char *typecon(int n); - -void undodelim(M_WCHAR *delim); - -void ungetachar(int c); - -int m_wcupstrcmp(const M_WCHAR *p, const M_WCHAR *q); - -int m_wcmbupstrcmp(const M_WCHAR *p, const char *q); - -int m_mbmbupstrcmp(const char *p, const char *q); - -void warning(char *text); - -void warning1(char *text, M_WCHAR *arg); - -void warning2(char *text, M_WCHAR *arg1, M_WCHAR *arg2); - -void warning3(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3); - -void warning4(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, M_WCHAR *arg4); - -LOGICAL m_whitespace(M_WCHAR c); - diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/scan.c b/cde/programs/dthelp/parser.ccdf/htag/build/scan.c deleted file mode 100644 index 362d831bc..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/scan.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: scan.c /main/3 1995/11/08 11:12:55 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Scan.c contains scanner procedures for program BUILD */ - -#include -#include "build.h" -#define M_CONDEF -#include "context.h" -#define M_DELIMDEF -#include "delim.h" -#include "sref.h" - -/* Reads a name */ -LOGICAL getname(first) - int first; -{ -M_WCHAR *p; -int c; - -*(p = name) = first; -if ((curcon != DEFAULT && curcon != DEFVAL && -curcon != DEFAULT2 && curcon != DEF2VAL) || -newpar->type != CDATA) -*p = m_ctupper(*p); -while (TRUE) - { - c = getachar(); - *++p = (M_WCHAR) c; - if (m_cttype(*p) == M_NONNAME) break; - if (p >= name + M_NAMELEN) - { - *(name + M_NAMELEN) = M_EOS; - m_error("Name too long"); - return(FALSE); - } - if ((curcon != DEFAULT && curcon != DEFVAL && - curcon != DEFAULT2 && curcon != DEF2VAL) || - newpar->type != CDATA) - *p = m_ctupper(*p); - } -ungetachar(c); -*p = M_EOS; -return(TRUE); -} - -/* Returns the next token to the main procedure */ -int scan(void) -{ -int c; -int n; -M_WCHAR wsp, wnl, wtb; - -mbtowc(&wsp, " ", 1); -mbtowc(&wnl, "\n", 1); -mbtowc(&wtb, "\t", 1); - -while (TRUE) - { - if (! m_newcon(curcon - 1, TEXT - 1)) - { - while ((n = gettoken(&c, COMCON)) == COMMENT) - while ((n = gettoken(&c, COMCON)) != COMMENT) - if (c == EOF) - { - m_error("EOF occurred within comment"); - exit(ERREXIT); - } - ungetachar(c); - } - n = gettoken(&c, curcon); - if (n) - { - if (n != LIT && n != LITA) return(n); - if (litproc(n)) - { - if (scantrace) - { - char *mb_literal; - - mb_literal = MakeMByteString(literal); - printf("literal '%s'\n", mb_literal); - m_free(mb_literal, "multibyte string"); - } - return(LITERAL); - } - /* Litproc returns FALSE in case of error, when returned have - scanned to the end of erroneous rule */ - else continue; - } - if (c == wsp || c == wnl || c == wtb) - { - if (m_newcon(curcon - 1, TEXT - 1)) - { - scanval = (M_WCHAR) c; - return(TEXT); - } - else continue; - } - if (m_newcon(curcon - 1, NAME - 1)) - if (m_cttype(c) == M_NMSTART || - (m_cttype(c) != M_NONNAME && - (curcon == DEFAULT || curcon == DEFVAL || curcon == NTNAME || - curcon == DEFAULT2 || curcon == DEF2VAL || curcon == NT2NAME - )) - ) - { - if (getname(c)) - { - if (scantrace) - { - char *mb_name; - - mb_name = MakeMByteString(name); - printf("name '%s'\n", mb_name); - m_free(mb_name, "multibyte string"); - } - return(NAME); - } - else continue; - } - if (c == EOF) return(ENDFILE); - if (m_newcon(curcon - 1, TEXT - 1)) - { - scanval = (M_WCHAR) c; - return(TEXT); - } - if (curcon != ERROR) - { - char mbyte[32]; /* bigger than the biggest multibyte char */ - - wctomb(mbyte, c); - - fprintf(stderr, "\n'%s' (%d)", mbyte, c); - fprintf(m_errfile, "\n'%s' (%d)", mbyte, c); - m_error("Unexpected character"); - } - } /* End while */ -} /* End scan */ - -#include "scanutil.c" - -#if defined(sparse) -#include "sparse.c" -#endif diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/sref.c b/cde/programs/dthelp/parser.ccdf/htag/build/sref.c deleted file mode 100644 index bcfac4565..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/sref.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: sref.c /main/3 1995/11/08 11:13:04 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Sref.c contains procedures related to short reference map declarations */ - -#include -#include -#include "build.h" -#include "sref.h" -#include "entdef.h" - -static M_WCHAR *wc_prefix = NULL; - -/* Add an entity with the default name constructed by adding a suffix - to the name of the short reference map in which it is invoked, and - a prefix m- */ -void adddefent(mapname) -M_WCHAR *mapname; -{ -M_WCHAR *p; -int n, length; -char c; - -if (!wc_prefix) - { - wc_prefix = MakeWideCharString(M_PREFIX); - w_strcpy(genname, wc_prefix); - } - -w_strcpy(&genname[w_strlen(wc_prefix)], mapname); -p = &genname[w_strlen(genname)]; -for (n = egensuf ; n ; n /= 10) - { - if (p - genname > M_NAMELEN) - { - m_err1("Entity name based on %s too long", mapname); - return; - } - c = ('0' + (n % 10)); - mbtowc(p, &c, 1); - *p++; - } -*p = M_EOS; -egensuf++; -if (! addent(genname)) - { - m_err1("Default entity name %s already in use", genname); - return; - } -thissref->entidx = entity->index; -} - -/* Add an entity, return FALSE if already there, TRUE if adding it. - Pointer to the entity structure is in global M_STRUCT *entity. */ -LOGICAL addent(name) -M_WCHAR *name; -{ -M_ENTITY *new; - -new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity"); -if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) - { - m_free((M_POINTER) new, "entity"); - return(FALSE); - } -entity = new; -if (lastent) lastent->next = entity; -else firstent = entity; -lastent = entity; -entity->type = M_GENERAL; -entity->wheredef = FALSE; -entity->content = NULL; -entity->name = (M_WCHAR *) m_malloc(w_strlen(name) + 1, "entity name"); -entity->index = ++m_entcnt; -entity->next = NULL; -w_strcpy(entity->name, name); -return(TRUE); -} - -/* Add a short reference map name */ -LOGICAL addmapname(M_WCHAR* p, LOGICAL define) -{ -MAP *old; -MAP *new; -LOGICAL retval; - -new = (MAP *) m_malloc(sizeof(MAP), "map"); -if (old = (MAP *) m_ntrtrie(p, &maptree, (M_TRIE *) new)) - { - m_free(new, "map"); - curmap = old->map; - retval = old->defined; - if (define) old->defined = TRUE; - return((LOGICAL) (retval ? FALSE : TRUE)); - } -curmap = ++mapcnt; -new->map = mapcnt; -new->mapname = (M_WCHAR *) m_malloc(w_strlen(p) + 1, "map name"); -w_strcpy(new->mapname, p); -new->defined = define; -new->nextptr = NULL; -*nextmap = new; -nextmap = &new->nextptr; -return(TRUE); -} - -/* Add a named entity to a short reference map */ -void addndent(p) -M_WCHAR *p; -{ -addent(p); -thissref->entidx = entity->index; -} - -/* Add a short reference delimiter */ -void addsref(p) -M_WCHAR *p; -{ -SREFSTRUCT *delim; -SREFSTRUCT *prevsr; -M_WCHAR *q; -M_WCHAR c; -int noseq = 0; - -/* Define the delimiter */ -delim = (SREFSTRUCT *) - m_malloc(sizeof(SREFSTRUCT), "short reference delimiter"); -if (prevsr = (SREFSTRUCT *) m_ntrtrie(p, &sreftree, (M_TRIE *) delim)) - { - m_free(delim, "short reference delimiter"); - delim = prevsr; - } -else - { - for (q = p ; *q ; q++) - { - c = m_ctupper(*q); - if (m_cttype(c) == M_NMSTART) - { - if (c != BLANKSEQ && c != WSSEQ && c != RS) - { - m_free(delim, "short reference delimiter"); - m_err1( - "Letters not permitted in short reference delimiters: %s", - p); - return; - } - if (c != RS) noseq++; - } - } - if (w_strlen(p) > maxsr) maxsr = w_strlen(p); - if (noseq > maxseq) maxseq = noseq; - delim->srefcnt = ++sreflen; - *nextsref = delim; - nextsref = &delim->next; - delim->next = NULL; - delim->data = NULL; - } - -/* Add the delimiter to this map and prepare for the associated - entity */ -thissref = (SREFDATA *) - m_malloc(sizeof(SREFDATA), "short reference delimiter"); -thissref->map = curmap; -thissref->entidx = M_NULLVAL; -thissref->next = delim->data; -delim->data = thissref; -} - -/* Prefix left-hand side with "M-" to create default short reference map - name, truncating to M_NAMELEN characters if necessary */ -void defmapname(void) -{ -if (!wc_prefix) - { - wc_prefix = MakeWideCharString(M_PREFIX); - w_strcpy(genname, wc_prefix); - } - -w_strcpy(&genname[w_strlen(wc_prefix)], thisrule); -genname[M_NAMELEN] = M_EOS; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/build/tree.c b/cde/programs/dthelp/parser.ccdf/htag/build/tree.c deleted file mode 100644 index 052c70299..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/build/tree.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: tree.c /main/3 1995/11/08 11:13:14 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Tree.c has procedures used by BUILD to construct the tree representation - of a content model */ - -#include -#include "build.h" -#include "context.h" - -/* Called after a right parenthesis is read while scanning a content model. - Resets curcon if it is the outermost submodel. */ -void endmodel(void) - { - curtree = curtree->parent ; - if (! curtree->parent) curcon = LASTM ; - else if (curtree == curtree->parent->first) curcon = OCCUR ; - } - -/* Release storage used for the tree representation of a rule */ -void freetree(treep) - TREE *treep ; - { - TREE *child, *discard ; - - for (child = treep->first ; child ; ) { - discard = child->right ; - freetree(child) ; - child = discard ; - } - m_free((M_POINTER) treep, "tree node") ; - } - -/* Gettreenode obtains a node to use in the tree representation of a rule */ -TREE *gettreenode(void) - { - TREE *new ; - - new = (TREE *) m_malloc(sizeof(TREE), "tree node") ; - new->first = new->right = new->parent = NULL ; - new->connector = new->occurrence = M_NULLVAL ; - new->value = NULL ; - new->terminal = FALSE ; - new->minim = FALSE ; - new->eltid = eltsinrule++ ; - return(new) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/Imakefile b/cde/programs/dthelp/parser.ccdf/htag/eltdef/Imakefile deleted file mode 100644 index e7e465118..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/Imakefile +++ /dev/null @@ -1,81 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/3 1995/11/08 11:13:29 rswiston $ -/* eltdef Imakefile */ - -ARCCMD = arc u -UNARCCMD = arc x -ARCDELCMD = arc d - -HELPTAG = .. -HELPTAGSRC = $(HELPTAG)/helptag -HELPPARSERSRC = $(HELPTAG)/parser -HELPELTDEFSRC = $(HELPTAG)/eltdef -HELPDTDFILE = $(HELPTAGSRC)/hptag.dtd -HELPUTILSRC = $(HELPTAG)/util -HELPBUILDSRC = $(HELPTAG)/build -HELPUTILLIB = $(HELPTAG)/util/libutil.a -HELPIFFILE = $(HELPTAGSRC)/help.if - -INCLUDES = -I. -I$(HELPUTILSRC) -I$(HELPBUILDSRC) - -SRCS = eltdef.c eltutil.c entity.c scan.c - -OBJS = eltdef.o eltutil.o entity.o scan.o - -CCPRODS = case.c -ECPRODS = efile.c entfile.c pfile.c sfile.c stfile.c tfile.c - -CHPRODS = context.h delim.h -EHPRODS = entity2.h globdec.h globdef.h if.h pval.h signon.h signonx.h - -CPRODS = $(CCPRODS) $(CHPRODS) -EPRODS = $(ECPRODS) $(EHPRODS) - -CTRASH = delim.dat error -ETRASH = estring.h error -TRASH = delim.dat estring.h error - -PRODUCTS = $(CPRODS) $(EPRODS) - -LOCAL_LIBRARIES = $(HELPUTILLIB) - -/* Don't use shared libs for hp */ -#ifdef HPArchitecture -#if OSMajorVersion > 7 -EXTRA_LOAD_FLAGS = -Wl,-a archive -#endif -#endif - -all:: $(PRODUCTS) - -NormalLibraryObjectRule() -NormalProgramTarget(eltdef,$(OBJS),delim.h $(LOCAL_LIBRARIES),$(LOCAL_LIBRARIES),) - -$(EPRODS): eltdef $(HELPIFFILE) - $(RM) $(EPRODS) $(ETRASH) - ./eltdef $(HELPIFFILE) - -$(CPRODS): $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.elt context.dat - $(RM) $(CPRODS) $(CTRASH) - /* get application-specific delim.dat */ - $(CP) $(HELPTAGSRC)/delim.elt delim.dat - $(HELPUTILSRC)/context - -$(HELPUTILSRC)/context: - cd $(HELPUTILSRC); make context - - -arc package : - if exist util.arc $(CP) build.arc old.arc - $(ARCCMD) util.arc *.c *.h makefile - -unarc dearc : - $(UNARCCMD) util.arc - -clean:: - $(RM) $(PRODUCTS) $(TRASH) - -depend:: - -includes:: $(PRODUCTS) - -DependTarget() diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/context.dat b/cde/programs/dthelp/parser.ccdf/htag/eltdef/context.dat deleted file mode 100644 index f0d4fdb2a..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/context.dat +++ /dev/null @@ -1,722 +0,0 @@ -/* $XConsortium: context.dat /main/2 1995/07/17 10:35:49 drk $ */ -startcomment - comcon:comcon { -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. - -Context.dat defines the state transitions for program ELTDEF. -*/ - } - - ; - -endcomment - incom:incom - ; - -entstart - start:entdec - error:entdec - ; - -entsystem - entval:typedec {enttype(M_SYSTEM) ;} - ; - -entst - entval:typedec {enttype(M_STARTTAG) ;} - ; - -entet - entval:typedec {enttype(M_ENDTAG) ;} - ; - -entmd - entval:typedec {enttype(M_MD) ;} - ; - -entpi - entval:piorsdata {enttype(M_PI) ;} - ; - -entsdata - entval:piorsdata {enttype(M_SDATA) ;} - ; - -entcdata - entval:typedec {enttype(M_CDATAENT) ;} - ; - -typecode - piorsdata:codetagc { - entity->wheredef = M_DELTDEF ; - enttype(entity->type == M_PI ? M_CODEPI : M_CODESDATA) ; - entity->codeindex = ++codeent ; - } - ; - -endofcode - inentc:start - ; - -lit - value:value, - litcon:litcon - ; - -lita - value:value, - litcon:litcon - ; - -entlit - entval:declitent, - piorsdata:declitent, - typedec:declitent {entclen = 0 ;} - - declitent:postent, - edeclitent:postent { - entcontent[entclen] = M_EOS ; - entity->content = - (M_WCHAR *) m_malloc(entclen + 1, "entity content") ; - w_strcpy(entity->content, entcontent) ; - entity->wheredef = M_DELTDEF ; - } - ; - -entlita - entval:declitaent, - piorsdata:declitaent, - typedec:declitaent {entclen = 0 ;} - - declitaent:postent, - edclitaent:postent { - entcontent[entclen] = M_EOS ; - entity->content = - (M_WCHAR *) m_malloc(entclen + 1, "entity content") ; - w_strcpy(entity->content, entcontent) ; - entity->wheredef = M_DELTDEF ; - } - ; - -cro - litcon:litcon - ; - -litrs - litcon:litcon - ; - -litrsc - litcon:litcon - ; - -litre - litcon:litcon - ; - -litrec - litcon:litcon - ; - -littab - litcon:litcon - ; - -littabc - litcon:litcon - ; - -litspace - litcon:litcon - ; - -litcspace - litcon:litcon - ; - -refc - charent:charent - ; - -signon - start:insignon {restart = RSIGNON ;} - error:insignon - ; - -gdef - start:globdef, - insignon:globdef { - endsignon() ; - restart = RGLOBDEF ; - /* fprintf(globdef, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - - error:globdef { - endsignon() ; - /* fprintf(globdef, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - - ; - -gdec - start:globdec, - insignon:globdec { - endsignon() ; - restart = RGLOBDEC ; - /* fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - globdef:globdec { - restart = RGLOBDEC ; - /* fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - - error:globdec { - if (! signonend) endsignon() ; - restart = RGLOBDEC ; - /* fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - ; - -inisstring - start:iniss, - insignon:iniss { - endsignon() ; - gss = stringcnt ; - instring = TRUE ; - } - - inies:iniss { - endstring() ; - gss = stringcnt ; - if (gss) - m_error("Multiple specification of global start string") ; - instring = TRUE ; - } - - inisc:iniss, - iniec:iniss, - initc:iniss, - inipc:iniss, - inistc:iniss { - if (gss) - m_error("Multiple specification of global start string") ; - gss = stringcnt ; - instring = TRUE ; - } - - globdef:iniss, - globdec:iniss { - gss = stringcnt ; - instring = TRUE ; - } - ; - -iniestring - start:inies, - insignon:inies { - endsignon() ; - ges = stringcnt ; - instring = TRUE ; - } - - iniss:inies { - if (ges) - m_error("Multiple specification of global end string") ; - endstring() ; - ges = stringcnt ; - instring = TRUE ; - } - - inisc:inies, - iniec:inies, - initc:inies, - inipc:inies, - inistc:inies { - if (ges) - m_error("Multiple specification of global end string") ; - ges = stringcnt ; - instring = TRUE ; - } - - globdef:inies, - globdec:inies { - ges = stringcnt ; - instring = TRUE ; - } - ; - -inistring - start:inistc, - insignon:inistc { - endsignon() ; - /* fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - finistc = FALSE ; - } - - iniss:inistc, - inies:inistc { - finistc = FALSE ; - endstring() ; - if (! finistc) - m_error("Multiple specification of global string code") ; - } - - iniec:inistc, - initc:inistc, - inipc:inistc, - inisc:inistc { - if (! finistc) - m_error("Multiple specification of global string code") ; - /* fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - finistc = FALSE ; - } - - globdef:inistc, - globdec:inistc { - finistc = FALSE ; - /* fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - ; - -inistart - start:inisc, - insignon:inisc { - endsignon() ; - /* fprintf(sfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - - iniss:inisc, - inies:inisc {endstring() ;} - - iniec:inisc, - initc:inisc, - inipc:inisc, - inistc:inisc, - globdef:inisc, - globdec:inisc { - /* fprintf(sfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - ; - -iniend - start:iniec, - insignon:iniec { - endsignon() ; - /* fprintf(efile, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - - iniss:iniec, - inies:iniec {endstring() ;} - - inisc:iniec, - initc:iniec, - inipc:iniec, - inistc:iniec, - globdef:iniec, - globdec:iniec { - /* fprintf(efile, "#line %d \"%s\"\n", m_line, iffile) ; */ - } - ; - -initext - start:initc, - insignon:initc { - endsignon() ; - /* fprintf(tfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - finitext = FALSE ; - } - - iniss:initc, - inies:initc {endstring() ;} - - inisc:initc, - iniec:initc, - inipc:initc, - inistc:initc, - globdef:initc, - globdec:initc { - /* fprintf(tfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - finitext = FALSE ; - } - ; - -initpi - start:inipc, - insignon:inipc { - endsignon() ; - /* fprintf(pfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - finipi = FALSE ; - } - - iniss:inipc, - inies:inipc {endstring() ;} - - inisc:inipc, - iniec:inipc, - initc:inipc, - inistc:inipc, - globdef:inipc, - globdec:inipc { - /* fprintf(pfile, "#line %d \"%s\"\n", m_line, iffile) ; */ - finipi = FALSE ; - } - ; - -elt - start:needn, - insignon:needn { - endsignon() ; - endini() ; - } - - inelt:needn - - globdef:needn, - globdec:needn, - inisc:needn, - iniec:needn, - initc:needn, - inipc:needn {endini() ;} - - inss:needn, - ines:needn {endstring() ;} - - insc:needn - inec:needn - intc:needn - inpc:needn - instc:needn - inparam:needn - preparam:needn - error:needn - ; - -tagc - postent:start - codetagc:inentc { - startcode(entity->codeindex, &inent, entfile, - "c", "void", "void", "") ; - } - close:preparam - sschain:inss { - *getaction(starray) = stringcnt ; - instring = TRUE ; - } - eschain:ines { - *getaction(etarray) = stringcnt ; - instring = TRUE ; - } - pcchain:inpc { - *getaction(pcarray) = ++pactions ; - startcode(pactions, &inpc, pfile, "p", pproto, pformal, pftype) ; - } - tcchain:intc { - *getaction(tcarray) = ++tactions ; - startcode(tactions, &intext, tfile, "t", tproto, tformal, - tftype) ; - } - scchain:insc { - *getaction(scarray) = ++sactions ; - startcode(sactions, &insc, sfile, "s", "void", "void", "") ; - } - ecchain:inec { - *getaction(ecarray) = ++eactions ; - startcode(eactions, &inec, efile, "e", "void", "void", "") ; - } - stcchain:instc { - *getaction(stcarray) = ++stactions ; - startcode(stactions, &instc, stfile, "st", stproto, stformal, - stft) ; - } - ; - -sep - sschain:sschain {*getaction(starray) = stringcnt ;} - eschain:eschain {*getaction(etarray) = stringcnt ;} - pcchain:pcchain {*getaction(pcarray) = pactions + 1 ;} - tcchain:tcchain {*getaction(tcarray) = tactions + 1 ;} - scchain:scchain {*getaction(scarray) = sactions + 1 ;} - ecchain:ecchain {*getaction(ecarray) = eactions + 1 ;} - stcchain:stcchain {*getaction(stcarray) = stactions + 1 ;} - postvalue:invalue - ; - -param - preparam:inparam - ; - -vi - cvar:pname - cvalue:value - ; - -rend - postpname:inparam - ; - -grpo - postpname:invalue - ; - -grpc - invalue:postpname - postvalue:postpname - ; - - -sss - inelt:sschain - inss:sschain, - ines:sschain {endstring() ;} - - inpc:sschain - intc:sschain - insc:sschain - inec:sschain - instc:sschain - inparam:sschain - preparam:sschain - ; - -ess - iniss:inisc, - inss:inelt {endstring() ;} - ; - -ses - inelt:eschain - inss:eschain, - ines:eschain {endstring() ;} - - inpc:eschain - intc:eschain - insc:eschain - inec:eschain - instc:eschain - inparam:eschain - preparam:eschain - ; - -ees - inies:inisc, - ines:inelt {endstring() ;} - ; - -scode - inss:scchain, - ines:scchain {endstring() ;} - - inparam:scchain - inelt:scchain - inpc:scchain - intc:scchain - insc:scchain - inec:scchain - instc:scchain - preparam:scchain - ; - -ecode - inss:ecchain, - ines:ecchain {endstring() ;} - - insc:ecchain - inparam:ecchain - inelt:ecchain - inec:ecchain - intc:ecchain - inpc:ecchain - instc:eschain - preparam:ecchain - ; - -tcode - inss:tcchain, - ines:tcchain {endstring() ;} - - insc:tcchain - inec:tcchain - inparam:tcchain - inelt:tcchain - preparam:tcchain - inpc:tcchain - intc:tcchain - instc:tcchain - ; - -pcode - inelt:pcchain - preparam:pcchain - inparam:pcchain - inss:pcchain, - ines:pcchain {endstring() ;} - inpc:pcchain - intc:pcchain - insc:pcchain - inec:pcchain - instc:pcchain - ; - -stcode - inelt:stcchain - preparam:stcchain - inparam:stcchain - inss:stcchain, - ines:stcchain {endstring() ;} - - inpc:stcchain - intc:stcchain - insc:stcchain - inec:stcchain - instc:stcchain - ; - -endfile - start:finish, - insignon:finish { - endsignon() ; - endini() ; - } - - globdef:finish, - globdec:finish, - inistc:finish, - inisc:finish, - iniec:finish, - initc:finish, - inipc:finish {endini() ;} - ; - -wildcard - stcchain:stcchain, - sschain:sschain, - eschain:eschain, - scchain:scchain, - ecchain:ecchain, - tcchain:tcchain, - pcchain:pcchain { - *nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ; - (*nextchain)->elt = 1 ; - (*nextchain)->next = NULL ; - nextchain = &(*nextchain)->next ; - } - ; - -literal - value:postvalue {value(literal) ;} - ; - -name - needn:close {startelement() ;} - inparam:cvar {storecvar() ;} - pname:postpname {storepname() ;} - invalue:cvalue {cvalue() ;} - value:postvalue {value(name) ;} - entdec:entval {addent() ;} - - stcchain:stcchain, - sschain:sschain, - eschain:eschain, - scchain:scchain, - ecchain:ecchain, - tcchain:tcchain, - pcchain:pcchain { - *nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ; - (*nextchain)->next = NULL ; - if ((*nextchain)->elt = m_packedlook(m_entree, name)) - (*nextchain)->elt++ ; - else - m_err1("Undefined element: %s", name) ; - nextchain = &(*nextchain)->next ; - } - ; - -text - declitent:declitent { - if (entclen >= M_LITLEN) { - curcon = EDECLITENT ; - m_error("Entity content too long") ; - } - else entcontent[entclen++] = textchar ; - } - declitaent:declitaent { - if (entclen >= M_LITLEN) { - curcon = EDCLITAENT ; - m_error("Entity content too long") ; - } - else entcontent[entclen++] = textchar ; - } - edeclitent:edeclitent - edclitaent:edclitaent - insignon:insignon { - socr = (LOGICAL) (textchar == '\n') ; - signonmsg[sochar++] = textchar ; - if (sochar >= SOCHAR) { - m_error("Exceeded buffer for sign-on message") ; - exit(TRUE) ; - } - } - globdef:globdef { - fprintf(globdef, "%c", textchar) ; - /* if (textchar == '\n') fprintf(globdef, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - globdec:globdec { - fprintf(globdec, "%c", textchar) ; - /* if (textchar == '\n') fprintf(globdec, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - iniss:iniss, - inss:inss { - if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; - stringstart = FALSE ; - stringcnt++ ; - } - inies:inies, - ines:ines { - if (! stringstart) fprintf(string, ",\n") ; - fprintf(string, " %d", textchar) ; - stringstart = FALSE ; - stringcnt++ ; - } - inisc:inisc, - insc:insc { - fprintf(sfile, "%c", textchar) ; - /* if (textchar == '\n') fprintf(sfile, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - iniec:iniec, - inec:inec { - fprintf(efile, "%c", textchar) ; - /* if (textchar == '\n') fprintf(efile, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - initc:initc, - intc:intc { - fprintf(tfile, "%c", textchar) ; - /* if (textchar == '\n') fprintf(tfile, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - inipc:inipc, - inpc:inpc { - fprintf(pfile, "%c", textchar) ; - /* if (textchar == '\n') fprintf(pfile, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - inistc:inistc, - instc:instc { - fprintf(stfile, "%c", textchar) ; - /* if (textchar == '\n') fprintf(stfile, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - inentc:inentc { - fprintf(entfile, "%c", textchar) ; - /* if (textchar == '\n') fprintf(entfile, "#line %d \"%s\"\n", - m_line, iffile) ; */ - } - ; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.c b/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.c deleted file mode 100644 index 46506ecf2..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: eltdef.c /main/3 1995/11/08 11:13:39 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Eltdef.c contains the main program for ELTDEF */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" - -#define M_DTDDEF -#include "dtd.h" - -#include "context.h" -#include "delim.h" -#define ELTDEF -#include "eltdef.h" -#define M_ENTDEF -#include "entity.h" - -/* Main program */ -void main(argc, argv) - int argc ; - char **argv ; - { - int m_token ; - - if (argc > 2) - if (*argv[2] == '-') { - if (strchr(argv[2], 'a')) m_malftrace = TRUE ; - if (strchr(argv[2], 'A')) m_malftrace = TRUE ; - if (strchr(argv[2], 'd')) debug = TRUE ; - if (strchr(argv[2], 'D')) debug = TRUE ; - if (strchr(argv[2], 'h')) m_heapchk = TRUE ; - if (strchr(argv[2], 'H')) m_heapchk = TRUE ; - if (strchr(argv[2], 's')) scantrace = TRUE ; - if (strchr(argv[2], 'S')) scantrace = TRUE ; - } - else - fprintf(stderr, - "****Starting with MARKUP 2.0, ELTDEF no longer writes a statistics file" - ) ; - if (argc < 2) { - fprintf(stderr, "**** Specify interface file ****\n") ; - exit(TRUE) ; - } - strncpy(iffile, argv[1], IFLEN) ; - initialize() ; - while (TRUE) { - m_token = scan() ; - if (m_token == ELT) restart = RELEMENT ; - m_prevcon = curcon ; - curcon = m_newcon(m_prevcon - 1, m_token - 1) ; - if (scantrace) - printf( - "Main: m_prevcon=%d,m_token=%d,curcon=%d,textchar='%c'(%d), line=%d\n", - m_prevcon, m_token, curcon, textchar, textchar, m_line) ; -#include "case.c" - if (m_token == ENDFILE) break ; - if (! curcon) { - m_error("Parsing table error") ; - break ; - } - } - done() ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.h b/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.h deleted file mode 100644 index 17921b2d3..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltdef.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: eltdef.h /main/3 1995/11/08 11:13:48 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Eltdef.h is the include file for allocating global variables in ELTDEF */ - -#if defined(ELTDEF) -#define ELTEXTERN -#define ELTINIT(a) = a -#else -#define ELTEXTERN extern -#define ELTINIT(a) -#endif - -#include "common.h" - -/* Error recovery status */ -#define RENTITY 0 -#define RSIGNON 1 -#define RGLOBDEC 2 -#define RGLOBDEF 3 -#define RELEMENT 4 - -/* State transition network generated by CONTEXT */ -#include "sparse.h" - -/* Indicates whether, and if so where, each character can appear in - a name */ -#if defined(ELTDEF) -#include "chartype.h" -#else -extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ; -#endif - -/* Scanned name or literal */ -ELTEXTERN M_WCHAR name[M_NAMELEN + 1] ; -ELTEXTERN M_WCHAR literal[M_LITLEN + 1] ; - -/* Associates a C variable with a particular parameter */ -typedef struct cvarstruct CVARSTRUCT ; -struct cvarstruct { - int param ; - M_WCHAR *cvarptr ; - CVARSTRUCT *next ; - } ; -ELTEXTERN CVARSTRUCT *cvarlist ; -/* Current and previous context (state) of transition system - controlling ELTDEF */ -ELTEXTERN int curcon ELTINIT(START) ; -ELTEXTERN int m_prevcon ; - -/* Character read-ahead buffer */ -ELTEXTERN int toundo ELTINIT(0) ; -ELTEXTERN int maxundo ELTINIT(0) ; -#define SAVECHAR 50 -ELTEXTERN int savechar[SAVECHAR] ; - -/* Chain of elements named in pseudo-tag */ -typedef struct chain CHAIN ; -struct chain { - M_ELEMENT elt ; - CHAIN *next ; - } ; -ELTEXTERN CHAIN *firstchain ELTINIT(NULL) ; -ELTEXTERN CHAIN **nextchain ELTINIT(&firstchain) ; - -/* Text character returned from scanner */ -ELTEXTERN M_WCHAR textchar ; - -/* Identifying index of element currently being processed */ -ELTEXTERN M_ELEMENT openelt ELTINIT(M_NULLVAL) ; - -/* Output files */ -ELTEXTERN FILE *globdec, *globdef, *string, - *pfile, *tfile, *sfile, *efile, *entfile, *ifile, *stfile, *ifh, *pvalh ; - -/* Flags indicating whether currently in the middle of processing - an action */ -ELTEXTERN LOGICAL intext ELTINIT(FALSE), - inent ELTINIT(FALSE), - inpc ELTINIT(FALSE), - insc ELTINIT(FALSE), - inec ELTINIT(FALSE), - instc ELTINIT(FALSE), - instring ELTINIT(FALSE) ; - -/* Location of global start-string and end-string, if any */ -ELTEXTERN int gss ELTINIT(0), - ges ELTINIT(0) ; - -/* Flags indicating whether default code setments are to be used */ -ELTEXTERN LOGICAL finitext ELTINIT(TRUE), - finipi ELTINIT(TRUE), - finistc ELTINIT(TRUE) ; - -/* Whether have finished the sign-on message */ -ELTEXTERN LOGICAL signonend ELTINIT(FALSE) ; - -/* Whether errors have occurred */ -ELTEXTERN LOGICAL errexit ELTINIT(FALSE) ; - -/* Number of characters currently written to stext.h and etext.h */ -ELTEXTERN int stringcnt ELTINIT(1) ; - -/* Number of actions so far written to code files */ -ELTEXTERN int sactions ELTINIT(1), - eactions ELTINIT(1), - tactions ELTINIT(1), - pactions ELTINIT(1), - stactions ELTINIT(1) ; - -/* Pool of ponters for associating a chain of elements with an action string - or code */ -typedef struct action ACTION ; -struct action { - int data ; - M_ELEMENT element ; - int count ; - ACTION *son ; - ACTION *next ; - ACTION *nextact ; - } ; -ELTEXTERN int actlen ELTINIT(0) ; -ELTEXTERN ACTION *firstact ELTINIT(NULL) ; -ELTEXTERN ACTION **nextact ELTINIT(&firstact) ; - -/* Number of elements defined in the document type */ -#if defined(M_DTDDEF) -#define ELCOUNT sizeof(m_element)/sizeof(m_element[0]) -#else -#define ELCOUNT -#endif - -/* Action arrays, indexed by the element in which they occur. Each element - is a linked list for actions qualified by the context in which they - occur. */ -ELTEXTERN ACTION *starray[ELCOUNT], - *etarray[ELCOUNT], - *scarray[ELCOUNT], - *ecarray[ELCOUNT], - *tcarray[ELCOUNT], - *pcarray[ELCOUNT], - *stcarray[ELCOUNT] ; - -/* Store the sign-on message */ -#define SOCHAR 512 -ELTEXTERN char signonmsg[SOCHAR] ; -ELTEXTERN int sochar ELTINIT(0) ; - -/* Indicates which elements have been processed at a particular time */ -ELTEXTERN LOGICAL processed[ELCOUNT] ; - -/* Flags to indicate whether data has yet been written to various files */ -ELTEXTERN LOGICAL stringstart ELTINIT(TRUE) ; - -/* Flag indicating whether a carriage return was the last character of - the signon message */ -ELTEXTERN LOGICAL socr ELTINIT(FALSE) ; - -/* Number of current input line */ -ELTEXTERN int m_line ELTINIT(1) ; - -/* Pointer to file error for error messages */ -ELTEXTERN FILE *m_errfile ; - -/* Name of interface file */ -#define IFLEN 512 -ELTEXTERN char iffile[IFLEN] ; - -/* Pointer to current entity */ -ELTEXTERN M_ENTITY *entity ; - -/* Count of code entities defined */ -ELTEXTERN int codeent ELTINIT(0) ; - -/* Content of entity being defined */ -ELTEXTERN int entclen ; -ELTEXTERN M_WCHAR entcontent[M_LITLEN + 1] ; - -/* Error recovery status */ -ELTEXTERN int restart ELTINIT(RENTITY) ; - -/* Strings to write to generated files */ -#define pproto "M_WCHAR *m_pi, M_WCHAR *m_entname, int m_enttype" -#define pformal "m_pi, m_entname, m_enttype" -#define pftype " M_WCHAR *m_pi ;\n M_WCHAR *m_entname ;\n int m_enttype ;" -#define tproto "M_WCHAR m_textchar" -#define tformal "m_textchar" -#define tftype " M_WCHAR m_textchar ;\n" -#define stproto "M_WCHAR *m_string, LOGICAL M_START, LOGICAL M_END" -#define stformal "m_string, M_START, M_END" -#define stft " M_WCHAR *m_string ;\n LOGICAL M_START ;\n LOGICAL M_END ;\n" - -/* Structures for generating defines for parameter values */ -ELTEXTERN M_TRIE parval ; -typedef struct { - M_WCHAR *cname ; - M_WCHAR *value ; - int line ; - } PARVAL ; -ELTEXTERN PARVAL *pval ; - -/* Function prototypes */ -#include "proto.h" - -/* Flag to open fewer files for convenience of debugging with - CodeView */ -ELTEXTERN LOGICAL debug ELTINIT(FALSE) ; -/* Scanner trace for debugging */ -ELTEXTERN LOGICAL scantrace ELTINIT(FALSE) ; -/* Test validity of heap in calls to malloc/free */ -ELTEXTERN LOGICAL m_heapchk ELTINIT(FALSE) ; -/* Trace calls to malloc/free */ -ELTEXTERN LOGICAL m_malftrace ELTINIT(FALSE) ; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltutil.c b/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltutil.c deleted file mode 100644 index b83887531..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/eltutil.c +++ /dev/null @@ -1,672 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: eltutil.c /main/3 1995/11/08 11:13:59 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Eltutil.c contains procedures for program ELTDEF */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" - -#include "dtdext.h" - -#include "eltdef.h" -#include "delim.h" -#include "context.h" - -#include "entext.h" - -#include "version.h" - -/* Output indicated action pointer array to if.h */ -void actptrout(array, name) - ACTION **array; - char *name; - { - int i; - - fprintf(ifh, "M_IFEXTERN int %s[%d]\n#if defined(M_IFDEF)\n = {\n", - name, m_elcount); - for (i = 0 ; i < m_elcount ; i++) { - if (i > 0) fprintf(ifh, ",\n"); - fprintf(ifh, " %d", array[i] ? array[i]->count : M_NULLVAL); - } - fprintf(ifh, "}\n#endif\n ;\n"); - } - - -/* Close a code file and write jump table at the end */ -void closeiffile(LOGICAL flag, FILE *file, int count, char *table, char *proto) - { - int i; - - endcode(flag, file); - if (count) { - fprintf(file, - "void (*m_%stable[])(%s) = {\n", - table, proto); - fprintf(file, " m_%s1, /* Place holder for 1-based indexing */\n", - table); - for (i = 1 ; i <= count ; i++) { - fprintf(file, " m_%s%d", table, i); - if (i != count) fputs(",\n", file); - } - fputs("} ;\n", file); - } - else - fprintf(file, - "void (*m_%stable[1])(%s) ;\n", - table, proto); - fclose(file); - } - -/* Called when the C identifier to be #define'd to a parameter value is - scanned */ -void cvalue(void) - { - PARVAL *new; - - new = (PARVAL *) m_malloc(sizeof(PARVAL), "parameter value"); - if (pval = (PARVAL *) m_ntrtrie(name, &parval, (M_TRIE *) new)) - m_free(new, "parameter value"); - else { - new->line = 0; - new->value = NULL; - new->cname = (M_WCHAR *) m_malloc(w_strlen(name) + 1, "C name"); - w_strcpy(new->cname, name); - pval = new; - } - } - - -/* Called after last input character is read to place closing punctuation - at end of output files and close them */ -void done(void) - { - M_ENTITY *ent; - ACTION *actp; - LOGICAL first; - int i; - - closeiffile(inent, entfile, codeent, "c", "void"); - closeiffile(intext, tfile, tactions, "t", tproto); - closeiffile(inpc, pfile, pactions, "p", pproto); - closeiffile(insc, sfile, sactions, "s", "void"); - closeiffile(inec, efile, eactions, "e", "void"); - closeiffile(instc, stfile, stactions, "st", stproto); - - endstring(); - fclose(string); - - /* Write if.h (which was opened for sign-on message) */ - fprintf(ifh, "M_IFEXTERN int m_gss M_IFINIT(%d) ;\n", gss); - fprintf(ifh, "M_IFEXTERN int m_ges M_IFINIT(%d) ;\n", ges); - fputs("M_IFEXTERN struct {\n", ifh); - fputs(" int data ;\n", ifh); - fputs(" M_ELEMENT element ;\n", ifh); - fputs(" int son ;\n", ifh); - fputs(" int next ;\n", ifh); - if (actlen) { - fprintf(ifh, - " } m_action[%d]\n#if defined(M_IFDEF)\n = {\n", - actlen); - - first = TRUE; - for (actp = firstact ; actp ; actp = actp->nextact) { - if (first) first = FALSE; - else fprintf(ifh, ",\n"); - fprintf(ifh, " %d, %d, %d, %d", - actp->data, actp->element, - actp->son ? actp->son->count : M_NULLVAL, - actp->next ? actp->next->count : M_NULLVAL); - } - fprintf(ifh, "}\n#endif\n ;\n"); - } - else fputs(" } m_action[1] ;\n", ifh); - - actptrout(starray, "m_starray"); - actptrout(etarray, "m_etarray"); - actptrout(scarray, "m_scarray"); - actptrout(ecarray, "m_ecarray"); - actptrout(tcarray, "m_tcarray"); - actptrout(pcarray, "m_pcarray"); - actptrout(stcarray, "m_stcarray"); - - outstring(); - m_openchk(&pvalh, "pval.h", "w"); - fputs("/* Parameter values specified in the interface */\n", pvalh); - if (parval.data) outpval(parval.data); - - fclose(ifh); - - /* Report any elements and entities left undefined */ - for (i = 0 ; i < m_elcount ; i++) - if (! processed[i]) - warning1("Warning: No specification for element %s", - &m_ename[m_element[i].enptr]); - - for (ent = firstent ; ent ; ent = ent->next) - if (! ent->wheredef) - warning1("Warning: Entity %s undefined", ent->name); - entout("entity2"); - - exit(errexit); - } - -/* Called when finished reading a section of code from the input file */ -void endcode(LOGICAL flag, FILE *file) - { - if (flag) fprintf(file, "}}\n\n"); - } - -/* Called at the end of all initial fields in the interface definition */ -void endini(void) - { - if (finitext) - fputs(" putc(m_textchar, m_outfile);\n", tfile); - if (finipi) - fputs(" fputs(m_pi, m_outfile) ;\n", pfile); - if (finistc) - { - fputs(" {\n", stfile); - fputs(" char *mb_string;\n", stfile); - fputs(" mb_string = MakeMByteString(m_string);\n", stfile); - fputs(" fputs(mb_string, m_outfile) ;\n", stfile); - fputs(" m_free(mb_string,\"multi-byte string\");;\n", stfile); - fputs(" }\n", stfile); - } - } - -/* End the sign-on message */ -#include -void endsignon(void) - { - long storetime; - char *p; - char *timeofday; - static char signon1[] = "Interface generated from "; - static char signon2[] = " on "; - int i; - int len; - FILE *sgfile; - - signonend = TRUE; - /* Discard a trailing carriage return in the sign-on message */ - if (socr) sochar--; - - time(&storetime); - timeofday = ctime(&storetime); - - len = - sochar+strlen(signon1)+strlen(signon2)+strlen(iffile)+strlen(timeofday) - /* a byte for end of string marker */ - + 1 - /* a byte for a carriage return after any user-supplied message */ - + (sochar ? 1 : 0); - m_openchk(&sgfile, "signonx.h", "w"); - fprintf(sgfile, "extern char m_signon[%d] ;\n", len); - fclose(sgfile); - m_openchk(&sgfile, "signon.h", "w"); - fprintf(sgfile, "char m_signon[%d] = {\n", len); - - for (i = 0 ; i type == M_PI && type == M_CODEPI) || - (entity->type == M_SDATA && type == M_CODESDATA)); - else if (entity->type != M_GENERAL && - entity->type != (unsigned char) type) - warning1("Redefining type of entity %s", name); - entity->type = (unsigned char) type; - } - -/* Free storage used for a context-specification chain */ -void freechain(void) - { - CHAIN *chainp, *dchainp; - - for (chainp = firstchain ; chainp ;) { - dchainp = chainp; - chainp = chainp->next; - m_free(dchainp, "chain"); - } - firstchain = NULL; - nextchain = &firstchain; - } - -/* Returns pointer to data field in action node for current chain of - elements */ -int *getaction(array) - ACTION **array; - { - ACTION *start, *node; - CHAIN *chainp; - - if (! array[openelt - 1]) { - array[openelt - 1] = getactstruct(); - array[openelt - 1]->element = openelt + 1; - } - start = array[openelt - 1]; - for (chainp = firstchain ; chainp ; chainp = chainp->next) { - if (! start->son) { - for ( ; chainp ; chainp = chainp->next) { - start->son = getactstruct(); - start->son->element = chainp->elt; - start = start->son; - } - freechain(); - return(&start->data); - } - for (node = start->son ; node ; start = node, node = node->next) - if (node->element == chainp->elt) break; - if (! node) { - start->next = getactstruct(); - start->next->element = chainp->elt; - start = start->next; - } - else start = node; - } - if (start->data) m_error("Duplicate specification"); - freechain(); - return(&start->data); - } - -/* Allocate new action structure */ -ACTION *getactstruct(void) - { - ACTION *new; - - new = (ACTION *) m_malloc(sizeof(ACTION), "action"); - new->count = ++actlen; - new->data = M_NULLVAL; - new->son = new->next = new->nextact = NULL; - *nextact = new; - nextact = &new->nextact; - return(new); - } - -/* Program initialization */ -void initialize(void) -{ -char **mb_delims; -M_WCHAR **wc_delims; - -fprintf(stderr, "MARKUP System - ELTDEF %s\n", M_VERSION); -fprintf(stderr, "Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.\n"); - -m_openchk(&ifh, "if.h", "w"); -m_openchk(&globdef, "globdef.h", "w"); -m_openchk(&globdec, "globdec.h", "w"); -m_openchk(&pfile, "pfile.c", "w"); -/* ELTDEF opens too many files for use with CodeView debugger. If -this option is set, all code segments are written to one file */ -if (debug) - { - tfile = - sfile = - efile = - stfile = - entfile = - pfile; - } -else - { - m_openchk(&tfile, "tfile.c", "w"); - m_openchk(&sfile, "sfile.c", "w"); - m_openchk(&efile, "efile.c", "w"); - m_openchk(&stfile, "stfile.c", "w"); - m_openchk(&entfile, "entfile.c", "w"); - } -m_openchk(&string, "estring.h", "w"); -m_openchk(&m_errfile, "error", "w"); -m_openchk(&ifile, iffile, "r"); - -mb_delims = mb_dlmptr; -wc_delims = m_dlmptr; - -while (*mb_delims) - { - *wc_delims++ = MakeWideCharString(*mb_delims); - mb_delims++; - } -*wc_delims = 0; - -/* Start array for sign-on message on globals.h. Also, -make sure there is at least one line in globals.h, because -DOS copy does not copy an empty file */ - -fputs("/* Global definitions specified by interface designer*/\n", -globdef); -fputs("/* Global declarations specified by interface designer*/\n", -globdec); - -fputs("#if defined(M_IFDEF)\n", ifh); -fputs("#define M_IFEXTERN\n", ifh); -fputs("#define M_IFINIT(a) = a\n", ifh); -fputs("#else\n", ifh); -fputs("#define M_IFEXTERN extern\n", ifh); -fputs("#define M_IFINIT(a)\n", ifh); -fputs("#endif\n", ifh); - -startcode(pactions, &inpc, pfile, "p", pproto, pformal, pftype); -startcode(tactions, &intext, tfile, "t", tproto, tformal, tftype); -startcode(sactions, &insc, sfile, "s", "void", "void", ""); -startcode(eactions, &inec, efile, "e", "void", "void", ""); -startcode(stactions, &instc, stfile, "st", stproto, stformal, stft); -} - -/* Output definitions for strings */ -void outstring(void) - { - int c; - - m_openchk(&string, "estring.h", "r"); - fprintf(ifh, "M_IFEXTERN char m_string[%d]\n", - stringcnt > 1 ? stringcnt - 1 : 1); - if (stringcnt - 1) { - fputs("#if defined(M_IFDEF)\n = {\n", ifh); - while ((c = getc(string)) != EOF) putc(c, ifh); - fputs("}\n#endif\n", ifh); - } - fputs(" ;\n", ifh); - fclose(string); - } - -/* Output #define's for parameter values */ -void outpval(p) -M_TRIE *p; -{ -M_WCHAR *q; - -for ( ; p ; p = p->next) - if (p->symbol) outpval(p->data); - else - { - char *mb_cname; - - mb_cname = MakeMByteString(((PARVAL *) p->data)->cname); - fprintf(pvalh, - "/* line %d \"%s\" */\n", - ((PARVAL *) p->data)->line, - iffile); - fprintf(pvalh, "#define %s \"", mb_cname); - m_free(mb_cname,"multi-byte string"); - if (q = ((PARVAL *) p->data)->value) - for ( ; *q ; q++) - { - char mbq[32]; /* larger than largest possible mbyte char */ - int length; - - length = wctomb(mbq, *q); - if (length == 1) - switch (*mbq) - { - case '\n': - fputs("\\n", pvalh); - break; - case '"': - fputs("\\\"", pvalh); - break; - default: - putc(*mbq, pvalh); - break; - } - else - fputs(mbq, pvalh); - } - fputs("\"\n", pvalh); - } -} - -/* Skip rest of statement after an error */ -void skiptoend(void) - { - int i; - static errlev = 0; - CVARSTRUCT *cvarp, *dvarp; - - for (cvarp = cvarlist ; cvarp ;) { - dvarp = cvarp; - m_free(cvarp->cvarptr, "C variable name"); - cvarp = cvarp->next; - m_free(dvarp, "C variable"); - } - cvarlist = NULL; - freechain(); - if (! errlev++) { - curcon = ERROR; - while (TRUE) { - i = scan(); - if (i == ENDFILE) break; - else if (i == ELT) { - if (restart <= RSIGNON) endsignon(); - restart = RELEMENT; - curcon = NEEDN; - break; - } - else if (i == GDEF && restart < RGLOBDEF) { - if (restart <= RSIGNON) endsignon(); - restart = RGLOBDEF; - curcon = GLOBDEF; - break; - } - else if (i == GDEC && restart < RGLOBDEC) { - if (restart <= RSIGNON) endsignon(); - restart = RGLOBDEC; - curcon = GLOBDEC; - break; - } - else if (i == SIGNON && restart < RSIGNON) { - curcon = INSIGNON; - restart = RSIGNON; - break; - } - else if (i == ENTSTART && restart == RENTITY) { - curcon = ENTDEC; - break; - } - curcon = ERROR; - } /* end while */ - } /* end if ! errlev */ - errlev--; - } - -/* Starts processing a code segment from the input file */ -void startcode(caseno, flag, file, prefix, proto, formal, formtype) -int caseno; -LOGICAL *flag; -FILE *file; -char *prefix; -char *proto; -char *formal; -char *formtype; -{ -CVARSTRUCT *cvarp; - -endcode(*flag, file); -*flag = TRUE; -/* protoype */ -fprintf(file, - "void m_%s%d(%s) ;\n", - prefix, - caseno, - proto); - -/* ANSI defines */ -fprintf(file, "void m_%s%d(%s)\n {\n", prefix, caseno, proto); -); - -for (cvarp = cvarlist ; cvarp ; cvarp = cvarp->next) - { - char *mb_cvarptr; - - mb_cvarptr = MakeMByteString(cvarp->cvarptr); - fprintf(file, " M_WCHAR *%s ;\n", mb_cvarptr); - m_free(mb_cvarptr,"multi-byte string"); - } - -for (cvarp = cvarlist ; cvarp ; cvarp = cvarp->next) - { - char *mb_cvarptr; - - mb_cvarptr = MakeMByteString(cvarp->cvarptr); - fprintf(file, - " m_setparam(&%s, %d) ;\n", - mb_cvarptr, - cvarp->param); - m_free(mb_cvarptr,"multi-byte string"); - } -fprintf(file, "{\n/* line %d \"%s\" */\n", m_line, iffile); /* balance "}" */ -} - -/* Begins processing a new element */ -void startelement(void) - { - CVARSTRUCT *cvarp; - CVARSTRUCT *discard; - - for (cvarp = cvarlist ; cvarp ; ) { - discard = cvarp; - m_free(cvarp->cvarptr, "C variable name"); - cvarp = cvarp->next; - m_free(discard, "C variable"); - } - cvarlist = NULL; - if (openelt = m_packedlook(m_entree, name)) { - if (processed[openelt - 1]) - warning1("Warning: Element %s already processed", name); - processed[openelt - 1] = TRUE; - } - else m_err1("Undefined element: %s", name); - } - -/* Stores the name of a C variable read from the input file */ -void storecvar(void) - { - CVARSTRUCT *new; - - new = (CVARSTRUCT *) m_malloc(sizeof(CVARSTRUCT), "C variable"); - new->cvarptr = (M_WCHAR *) m_malloc(w_strlen(name) + 1, - "C variable name"); - w_strcpy(new->cvarptr, name); - new->next = cvarlist; - cvarlist = new; - } - -/* Compares the parameter name associated with a C variable in the input - file with the names of all parameters of the current element. Stores - result for later output with code segments */ -void storepname(void) - { - int i, par; - - for (i = 0, par = m_element[openelt - 1].parptr; - i < m_element[openelt - 1].parcount; - i++, par++) - if (! w_strcmp(&m_pname[m_parameter[par - 1].paramname], name)) - break; - if (i >= m_element[openelt - 1].parcount) { - m_err2("%s: No such parameter for element %s", name, - &m_ename[m_element[openelt - 1].enptr]); - return; - } - cvarlist->param = i; - } - -/* Called when a possible parameter value to be defined is encountered */ -void value(p) -M_WCHAR *p; -{ -char buffer[5]; - -if (m_partype(cvarlist->param + m_element[openelt - 1].parptr, p)) - { - if (pval->line) - { - if (w_strcmp(pval->value, p)) - { - M_WCHAR *w_buffer; - - sprintf(buffer, "%d", pval->line); - w_buffer = MakeWideCharString(buffer); - m_err5("Can't #define %s to %s. %s #define'd to %s on line %s", - pval->cname, - p, - pval->cname, - pval->value, - w_buffer); - m_free(w_buffer, "wide character string"); - } - } - else { - pval->value = (M_WCHAR *) m_malloc(w_strlen(p) + 1, "pval value"); - w_strcpy(pval->value, p); - pval->line = m_line; - } - } -else m_err3("\"%s\" illegal value for parameter %s of %s", - p, - &m_pname[m_parameter[cvarlist->param + - m_element[openelt - 1].parptr - 1].paramname], - &m_ename[m_element[openelt-1].enptr]); -} - -#include "paramu.c" diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/entity.c b/cde/programs/dthelp/parser.ccdf/htag/eltdef/entity.c deleted file mode 100644 index ca391efe8..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/entity.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: entity.c /main/3 1995/11/08 11:14:09 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Entity.c has ELTDEF procedures relevant to entities */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "eltdef.h" -#include "entext.h" - -/* Add an entity */ -void addent(void) - { - M_ENTITY *new ; - - new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity") ; - if (entity = (M_ENTITY *) m_ntrtrie(name, m_enttrie, (M_TRIE *) new)) { - m_free(new, "entity") ; - if (! entity->wheredef) return ; - if (entity->wheredef == M_DBUILD) { - warning1("Redefining %s: entity defined in BUILD", entity->name) ; - entity->type = M_GENERAL ; - entity->wheredef = FALSE ; - entity->content = NULL ; - return ; - } - else - m_err1("Attempt to redefine %s", entity->name) ; - return ; - } - entity = new ; - if (lastent) lastent->next = entity ; - else firstent = entity ; - lastent = entity ; - entity->type = M_GENERAL ; - entity->wheredef = FALSE ; - entity->content = NULL ; - entity->name = - (M_WCHAR *) m_malloc(w_strlen(name) + 1, "entity name") ; - entity->index = ++m_entcnt ; - entity->codeindex = M_NULLVAL ; - entity->next = NULL ; - w_strcpy(entity->name, name) ; - return ; - } - -#include "entout.c" diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/proto.h b/cde/programs/dthelp/parser.ccdf/htag/eltdef/proto.h deleted file mode 100644 index 1a42c1934..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/proto.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: proto.h /main/3 1995/11/08 11:14:19 rswiston $ */ -/* - Copyright (c) 1988, 1989 Hewlett-Packard Co. -*/ - -/* Proto.h contains function prototypes for program ELTDEF. */ - - -void actptrout(ACTION **array, char *name); - -void addent(void); - -LOGICAL m_allwhite(const M_WCHAR *string); - -void closeiffile(LOGICAL flag, FILE *file, int count, char *table, char *proto); - -void countdown(M_TRIE *parent, int *count); - -void cvalue(void); - -void done(void); - -void m_dumptrie(FILE *file, M_TRIE *xtrie, char *extname, int *count, void (*proc)(M_ENTITY *)); - -void endcode(LOGICAL flag, FILE *file); - -void endini(void); - -void endsignon(void); - -void endstring(void); - -void entout(char *fname); - -void enttype(int type); - -void m_error(char *text); - -void m_err1(const char *text, const M_WCHAR *arg); - -void m_mberr1(char *text, const char *arg); - -void m_err2(const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2); - -void m_err3(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3); - -void m_err5(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, M_WCHAR *arg4, M_WCHAR *arg5); - -void m_exit(int status); - -void m_free(void *block, char *msg); - -void freechain(void); - -int getachar(void); - -int *getaction(ACTION **array); - -ACTION *getactstruct(void); - -void getname(int first); - -int gettoken(int *c, int context); - -void m_initctype(void); - -void initialize(void); - -LOGICAL m_letter(M_WCHAR c); - -LOGICAL litproc(int delim); - -void main(int argc, char **argv); - -void *m_malloc(int size, char *msg); - -void m_openchk(FILE **ptr, char *name, char *mode); - -void outpval(M_TRIE *p); - -void outstring(void); - -int m_packedlook(M_PTRIE *xptrie, M_WCHAR *name); - -const M_WCHAR *m_partype(const int par, const M_WCHAR *string); - -int scan(void); - -void skiptoend(void); - -void startcode(int caseno, LOGICAL *flag, FILE *file, char *prefix, char *proto, - char *formal, char *formtype); - -void startelement(void); - -void storecvar(void); - -void storepname(void); - -void undodelim(M_WCHAR *delim); - -void ungetachar(int c); - -int m_wcupstrcmp(const M_WCHAR *p, const M_WCHAR *q); - -int m_wcmbupstrcmp(const M_WCHAR *p, const char *q); - -int m_mbmbupstrcmp(const char *p, const char *q); - -void value(M_WCHAR *p); - -void warning(char *text); - -void warning1(char *text, M_WCHAR *arg); - -LOGICAL m_whitespace(M_WCHAR c); - diff --git a/cde/programs/dthelp/parser.ccdf/htag/eltdef/scan.c b/cde/programs/dthelp/parser.ccdf/htag/eltdef/scan.c deleted file mode 100644 index ab10a6527..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/eltdef/scan.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: scan.c /main/3 1995/11/08 11:14:28 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Scan.c contains scanner procedures for program ELTDEF */ - -#include -#include -#include "basic.h" -#include "trie.h" - -#include "dtdext.h" - -#include "eltdef.h" -#define M_CONDEF -#include "context.h" -#define M_DELIMDEF -#include "delim.h" - -/* Reads a name token */ -void getname(first) -int first; -{ -M_WCHAR *p, wus; -int c, cttype; -LOGICAL cname; - -mbtowc(&wus, "_", 1); - -cname = (LOGICAL) (curcon == INPARAM || curcon == INVALUE); -*(p = name) = (M_WCHAR) first; -if (! cname) *p = m_ctupper(*p); -while (TRUE) - { - c = getachar(); - if (c == EOF) break; - *++p = (M_WCHAR) c; - cttype = m_cttype(*p); - if (! cname) - { - if (cttype == M_NONNAME) break; - } - else - { - if ((cttype != M_NMSTART) && (cttype != M_DIGIT) && (*p != wus)) - break; - } - if (p >= name + M_NAMELEN) - { - *(name + M_NAMELEN) = M_EOS; - m_error("Element name too long"); - } - if (! cname) *p = m_ctupper(*p); - } -ungetachar(c); -*p = M_EOS; -} - -/* Reads the next token and returns it to the main procedure */ -int scan(void) -{ -int c; -int n; -static char unexp[] = "c"; -M_WCHAR wus; - -mbtowc(&wus, "_", 1); - -while (TRUE) - { - while ((n = gettoken(&c, COMCON)) == STARTCOMMENT) - while ((n = gettoken(&c, INCOM)) != ENDCOMMENT) - if (c == EOF) - { - m_error("EOF occurred within comment"); - done(); - exit(TRUE); - } - ungetachar(c); - n = gettoken(&c, curcon); - if (n) - { - if (n != LIT && n != LITA) return(n); - if (litproc(n)) - { - if (scantrace) - { - char *mbyte; - - mbyte = MakeMByteString(literal); - printf("literal '%s'\n", mbyte); - m_free(mbyte, "multi-byte string"); - } - return(LITERAL); - } - } - if (c == EOF) return(ENDFILE); - if (m_newcon(curcon - 1, TEXT - 1)) - { - textchar = (M_WCHAR) c; - return(TEXT); - } - if (m_whitespace((M_WCHAR) c)) continue; - if (m_newcon(curcon - 1, NAME - 1)) - { - if (curcon == INPARAM || curcon == INVALUE) - { - /* Check for C identifier */ - if (m_letter((M_WCHAR) c) || c == wus) - { - getname(c); - return(NAME); - } - } - else - { - /* Check for SGML name */ - if ((m_cttype(c) == M_NMSTART) || - (m_cttype(c) != M_NONNAME && curcon == VALUE)) - { - getname(c); - return(NAME); - } - } - } - if (curcon != ERROR) - { - m_mberr1("Unexpected character: '%s'", unexp); - } - } /* End while */ -} /* End scan */ - -#include "scanutil.c" - -#if defined(sparse) -#include "sparse.c" -#endif diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/Imakefile b/cde/programs/dthelp/parser.ccdf/htag/helptag/Imakefile deleted file mode 100644 index 247f2a98a..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/Imakefile +++ /dev/null @@ -1,88 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/4 1996/05/09 17:32:04 drk $ -/* helptag Imakefile */ - -ARCCMD = arc u -UNARCCMD = arc x -ARCDELCMD = arc d - -.SUFFIXES : .e .arc .c .h .t - -HELPTAG = .. -HELPTAGSRC = $(HELPTAG)/helptag -HELPPARSERSRC = $(HELPTAG)/parser -HELPELTDEFSRC = $(HELPTAG)/eltdef -HELPDTDFILE = $(HELPTAGSRC)/hptag.dtd -HELPUTILSRC = $(HELPTAG)/util -HELPBUILDSRC = $(HELPTAG)/build -HELPUTILLIB = $(HELPTAG)/util/libutil.a -HELPIFFILE = $(HELPTAGSRC)/help.if - -INCLUDES = -I. -I$(HELPUTILSRC) -I$(HELPPARSERSRC) -I$(HELPELTDEFSRC) - -ELTHDRS = $(HELPUTILSRC)/entdef.h $(HELPUTILSRC)/entext.h - -XCOMM PARSEHDRS are header files used by many parser routines -PARSEHDRS = $(HELPUTILSRC)/basic.h $(HELPUTILSRC)/trie.h \ - $(HELPUTILSRC)/common.h $(HELPUTILSRC)/dtddef.h \ - $(HELPUTILSRC)/dtdext.h $(HELPUTILSRC)/sparse.h \ - parser.h proto.h - -APPLHDRS = $(PARSEHDRS) $(ELTHDRS) \ - $(HELPUTILSRC)/version.h \ - $(HELPTAGSRC)/global.h $(HELPTAGSRC)/charconv.h \ - $(HELPTAGSRC)/roman8.h $(HELPTAGSRC)/fproto.h \ - ../parser/pval.h ../parser/globdec.h ../parser/signonx.h \ - ../parser/userinc.h - -SRCS = custom.c default.c \ - help.c make.c option.c out.c special.c xref.c - -OBJS = custom.o default.o \ - help.o make.o option.o out.o special.o xref.o - -TOBJS = custom.t default.t \ - help.t make.t option.t out.t special.t xref.t - -LOCAL_LIBRARIES = $(HELPUTILLIB) - -/* Don't use shared libs for hp */ -#ifdef HPArchitecture -#if OSMajorVersion > 7 -EXTRA_LOAD_FLAGS = -Wl,-a archive -#endif -#endif - -all:: $(TOBJS) - -$(TOBJS):: $(OBJS) - -.o.t: - $(RM) $*.t - $(CP) $*.o $*.t - -NormalLibraryObjectRule() - -htag: $(HELPPARSERSRC)/parser - $(RM) htag - $(CP) (HELPPARSERSRC)/parser htag - -clean:: - $(RM) *.t - $(RM) htag - - -DependTarget() - -arcappl archptag : - if exist hptag.arc $(CP) hptag.arc hptag.old - $(ARCCMD) hptag.arc *.c *.h linkcmd.dos linkcmd.unx $(HELPDTDFILE) \ - tex.if makefile makefile.doc make.ini delim.* - -unarcappl unarchptag : - $(UNARCCMD) hptag.arc - -tags :: - etags -t *.c *.h *.if - -etags :: - etags -t *.c *.h *.if diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.c deleted file mode 100644 index 5e2dd98f2..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: calculat.c /main/3 1995/11/08 11:14:57 rswiston $ */ -/* - * Copyright 1989 Hewlett-Packard Co. - * - * - * procedures used by calculator elements for 1.2 release 26jul89-pj - * - * NOTE : This file is used as a Microsoft Linker overlay, so it cannot - * have functions as pointers, eg. (proc *) f(). Routines that are - * or invoke function pointers should be in tex.c. - * - */ - -/* Obsolete */ - diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.h b/cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.h deleted file mode 100644 index bf5416835..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/calculat.h +++ /dev/null @@ -1,828 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: calculat.h /main/3 1995/11/08 11:15:08 rswiston $ */ -/* this file contains special character expansions for various characters - * in Dot Matrix (computer), Menu Label (ml), and White Menu Label (wl) - * arrays are: ccompspec[] --> computer specials - * cmenlspec[] --> menu label specials - * cwmenlspec[]--> white menu label specials - */ - -/* special computer expansions for dot matrix in calculator style */ -EXTERN char *ccompspec[256] -#if defined(DEFINE) -= { -/* Char Name TeX Expansion */ -/* */ -/* 0: ^@ NUL */ 0, -/* 1: ^A SOH */ 0, -/* 2: ^B STX */ 0, -/* 3: ^C ETX */ 0, -/* 4: ^D EOT */ 0, -/* 5: ^E ENQ */ 0, -/* 6: ^F ACK */ 0, -/* 7: ^G BEL */ 0, -/* 8: ^H BS */ 0, -/* 9: ^I HT */ 0, -/* 10: ^J LF */ 0, -/* 11: ^K VT */ 0, -/* 12: ^L FF */ 0, -/* 13: ^M CR */ 0, -/* 14: ^N SO */ 0, -/* 15: ^O SI */ 0, -/* 16: ^P DLE */ 0, -/* 17: ^Q DC1 */ 0, -/* 18: ^R DC2 */ 0, -/* 19: ^S DC3 */ 0, -/* 20: ^T DC4 */ 0, -/* 21: ^U NAK */ 0, -/* 22: ^V SYN */ 0, -/* 23: ^W ETB */ 0, -/* 24: ^X CAN */ 0, -/* 25: ^Y EM */ 0, -/* 26: ^Z SUB */ 0, -/* 27: ^[ ESC */ 0, -/* 28: ^\ FS */ 0, -/* 29: ^] GS */ 0, -/* 30: ^^ RS */ 0, -/* 31: ^_ US */ 0, -/* 32: SP */ 0, -/* 33: ! */ 0, -/* 34: " */ 0, -/* 35: # */ "\\#", -/* 36: $ */ "{\\dollar}", -/* 37: % */ "\\%", -/* 38: & */ "\\&", -/* 39: ' */ "{'}", -/* 40: ( */ 0, -/* 41: ) */ 0, -/* 42: * */ 0, -/* 43: + */ 0, -/* 44: , */ 0, -/* 45: - */ "{-}", -/* 46: . */ 0, -/* 47: / */ 0, -/* 48: 0 */ 0, -/* 49: 1 */ 0, -/* 50: 2 */ 0, -/* 51: 3 */ 0, -/* 52: 4 */ 0, -/* 53: 5 */ 0, -/* 54: 6 */ 0, -/* 55: 7 */ 0, -/* 56: 8 */ 0, -/* 57: 9 */ 0, -/* 58: : */ 0, -/* 59: ; */ 0, -/* 60: < */ "{\\tendmb\\char'045}", -/* 61: = */ 0, -/* 62: > */ "{\\tendmb\\char'046}", -/* 63: ? */ 0, -/* 64: @ */ 0, -/* 65: A */ 0, -/* 66: B */ 0, -/* 67: C */ 0, -/* 68: D */ 0, -/* 69: E */ 0, -/* 70: F */ 0, -/* 71: G */ 0, -/* 72: H */ 0, -/* 73: I */ 0, -/* 74: J */ 0, -/* 75: K */ 0, -/* 76: L */ 0, -/* 77: M */ 0, -/* 78: N */ 0, -/* 79: O */ 0, -/* 80: P */ 0, -/* 81: Q */ 0, -/* 82: R */ 0, -/* 83: S */ 0, -/* 84: T */ 0, -/* 85: U */ 0, -/* 86: V */ 0, -/* 87: W */ 0, -/* 88: X */ 0, -/* 89: Y */ 0, -/* 90: Z */ 0, -/* 91: [ */ 0, -/* 92: \\ */ "{\\tendmb\\char'047}", -/* 93: ] */ 0, -/* 94: ^ */ "{\\tendmb\\char'064}", -/* 95: _ */ "{\\tendmb\\char'066}", -/* 96: ` */ "{`}", -/* 97: a */ 0, -/* 98: b */ 0, -/* 99: c */ 0, -/* 100: d */ 0, -/* 101: e */ 0, -/* 102: f */ 0, -/* 103: g */ 0, -/* 104: h */ 0, -/* 105: i */ 0, -/* 106: j */ 0, -/* 107: k */ 0, -/* 108: l */ 0, -/* 109: m */ 0, -/* 110: n */ 0, -/* 111: o */ 0, -/* 112: p */ 0, -/* 113: q */ 0, -/* 114: r */ 0, -/* 115: s */ 0, -/* 116: t */ 0, -/* 117: u */ 0, -/* 118: v */ 0, -/* 119: w */ 0, -/* 120: x */ 0, -/* 121: y */ 0, -/* 122: z */ 0, -/* 123: { */ "{\\tendmb\\char'070}", -/* 124: | */ "{\\tendmb\\char'104}", -/* 125: } */ "{\\tendmb\\char'107}", -/* 126: ~ */ "{\\tendmb\\char'116}", -/* 127: DEL */ 0, -/* 128: undefined */ 0, -/* 129: undefined */ 0, -/* 130: undefined */ 0, -/* 131: undefined */ 0, -/* 132: undefined */ 0, -/* 133: undefined */ 0, -/* 134: undefined */ 0, -/* 135: undefined */ 0, -/* 136: undefined */ 0, -/* 137: undefined */ 0, -/* 138: undefined */ 0, -/* 139: undefined */ 0, -/* 140: undefined */ 0, -/* 141: undefined */ 0, -/* 142: undefined */ 0, -/* 143: undefined */ 0, -/* 144: undefined */ 0, -/* 145: undefined */ 0, -/* 146: undefined */ 0, -/* 147: undefined */ 0, -/* 148: undefined */ 0, -/* 149: undefined */ 0, -/* 150: undefined */ 0, -/* 151: undefined */ 0, -/* 152: undefined */ 0, -/* 153: undefined */ 0, -/* 154: undefined */ 0, -/* 155: undefined */ 0, -/* 156: undefined */ 0, -/* 157: undefined */ 0, -/* 158: undefined */ 0, -/* 159: undefined */ 0, -/* 160: undefined */ 0, -/* 161: A grave */ "{\\tendmc\\char'041}", -/* 162: A circumflex */ "{\\tendmc\\char'042}", -/* 163: E grave */ "{\\tendmc\\char'043}", -/* 164: E circumflex */ "{\\tendmc\\char'044}", -/* 165: E dieresis */ "{\\tendmc\\char'045}", -/* 166: I circumflex */ "{\\tendmc\\char'046}", -/* 167: I dieresis */ "{\\tendmc\\char'047}", -/* 168: acute accent */ "{\\tendma\\char'023}", -/* 169: grave accent */ "{\\tendma\\char'022}", -/* 170: circumflex */ "{\\tendma\\char'136}", -/* 171: dieresis */ "{\\tendma\\char'177}", -/* 172: tilde */ "{\\tendma\\char'176}", -/* 173: U grave */ "{\\tendmc\\char'050}", -/* 174: U circumflex */ "{\\tendmc\\char'051}", -/* 175: Italian Lira */ 0, -/* 176: overbar */ 0, -/* 177: Y acute */ "{\\tendmc\\char'053}", -/* 178: y acute */ "{\\tendmc\\char'054}", -/* 179: degree */ 0, -/* 180: C cedilla */ "{\\tendma\\char'030}", -/* 181: c cedilla */ "{\\tendma\\char'030}", -/* 182: N tilde */ "{\\tendmc\\char'055}", -/* 183: n tilde */ "{\\tendmc\\char'056}", -/* 184: inverted exclamation mark */ "{\\tendma\\char'074}", -/* 185: inverted question mark */ "{\\tendma\\char'076}", -/* 186: currency sign */ 0, -/* 187: pound sterling */ 0, -/* 188: Yen */ 0, -/* 189: Section sign */ 0, -/* 190: florin */ 0, -/* 191: Cent sign */ 0, -/* 192: a circumflex */ "{\\tendmc\\char'063}", -/* 193: e circumflex */ "{\\tendmc\\char'064}", -/* 194: o circumflex */ "{\\tendmc\\char'065}", -/* 195: u circumflex */ "{\\tendmc\\char'066}", -/* 196: a acute */ "{\\tendmc\\char'067}", -/* 197: e acute */ "{\\tendmc\\char'070}", -/* 198: o acute */ "{\\tendmc\\char'071}", -/* 199: u acute */ "{\\tendmc\\char'072}", -/* 200: a grave */ "{\\tendmc\\char'073}", -/* 201: e grave */ "{\\tendmc\\char'074}", -/* 202: o grave */ "{\\tendmc\\char'075}", -/* 203: u grave */ "{\\tendmc\\char'076}", -/* 204: a dieresis */ "{\\tendmc\\char'077}", -/* 205: e dieresis */ "{\\tendmc\\char'100}", -/* 206: o dieresis */ "{\\tendmc\\char'101}", -/* 207: u dieresis */ "{\\tendmc\\char'102}", -/* 208: A angstrom */ "{\\tendmc\\char'103}", -/* 209: i circumflex */ "{\\tendmc\\char'104}", -/* 210: O slash */ "{\\tendma\\char'037}", -/* 211: AE ligature */ "{\\tendma\\char'035}", -/* 212: a angstrom */ "{\\tendmc\\char'105}", -/* 213: i acute */ "{\\tendmc\\char'106}", -/* 214: o slash */ "{\\tendma\\char'034}", -/* 215: ae ligature */ "{\\tendma\\char'032}", -/* 216: A dieresis */ "{\\tendmc\\char'107}", -/* 217: i grave */ "{\\tendmc\\char'110}", -/* 218: O dieresis */ "{\\tendmc\\char'111}", -/* 219: U dieresis */ "{\\tendmc\\char'112}", -/* 220: E acute */ "{\\tendmc\\char'113}", -/* 221: i dieresis */ "{\\tendmc\\char'114}", -/* 222: SS ligature */ "{\\tendma\\char'031}", -/* 223: O circumflex */ "{\\tendmc\\char'115}", -/* 224: A acute */ "{\\tendmc\\char'116}", -/* 225: A tilde */ "{\\tendmc\\char'117}", -/* 226: a tilde */ "{\\tendmc\\char'120}", -/* 227: Eth */ 0, -/* 228: eth */ 0, -/* 229: I acute */ "{\\tendmc\\char'121}", -/* 230: I grave */ "{\\tendmc\\char'122}", -/* 231: O acute */ "{\\tendmc\\char'123}", -/* 232: O grave */ "{\\tendmc\\char'124}", -/* 233: O tilde */ "{\\tendmc\\char'125}", -/* 234: o tilde */ "{\\tendmc\\char'126}", -/* 235: S caron */ "{\\tendmc\\char'127}", -/* 236: s caron */ "{\\tendmc\\char'130}", -/* 237: U acute */ "{\\tendmc\\char'131}", -/* 238: Y dieresis */ "{\\tendmc\\char'132}", -/* 239: y dieresis */ "{\\tendmc\\char'133}", -/* 240: Thorn */ 0, -/* 241: thorn */ 0, -/* 242: undefined */ 0, -/* 243: mu */ 0, -/* 244: paragraph sign */ 0, -/* 245: fraction 3/4 */ 0, -/* 246: long dash */ 0, -/* 247: fraction 1/4 */ 0, -/* 248: fraction 1/2 */ 0, -/* 249: Female ordinal */ 0, -/* 250: Male ordinal */ 0, -/* 251: French double open quote */ 0, -/* 252: Solid square */ 0, -/* 253: French double close quote */ 0, -/* 254: Plus over minus sign */ 0, -/* 255: undefined */ 0 -} -#endif -; - -/* special menu label character expansions */ -EXTERN char *cmenlspec[256] -#if defined(DEFINE) -= { -/* Char Name TeX Expansion */ -/* */ -/* 0: ^@ NUL */ 0, -/* 1: ^A SOH */ 0, -/* 2: ^B STX */ 0, -/* 3: ^C ETX */ 0, -/* 4: ^D EOT */ 0, -/* 5: ^E ENQ */ 0, -/* 6: ^F ACK */ 0, -/* 7: ^G BEL */ 0, -/* 8: ^H BS */ 0, -/* 9: ^I HT */ 0, -/* 10: ^J LF */ 0, -/* 11: ^K VT */ 0, -/* 12: ^L FF */ 0, -/* 13: ^M CR */ 0, -/* 14: ^N SO */ 0, -/* 15: ^O SI */ 0, -/* 16: ^P DLE */ 0, -/* 17: ^Q DC1 */ 0, -/* 18: ^R DC2 */ 0, -/* 19: ^S DC3 */ 0, -/* 20: ^T DC4 */ 0, -/* 21: ^U NAK */ 0, -/* 22: ^V SYN */ 0, -/* 23: ^W ETB */ 0, -/* 24: ^X CAN */ 0, -/* 25: ^Y EM */ 0, -/* 26: ^Z SUB */ 0, -/* 27: ^[ ESC */ 0, -/* 28: ^\ FS */ 0, -/* 29: ^] GS */ 0, -/* 30: ^^ RS */ 0, -/* 31: ^_ US */ 0, -/* 32: SP */ "{\\tenmlb\\char'146}", -/* 33: ! */ 0, -/* 34: " */ 0, -/* 35: # */ "\\#", -/* 36: $ */ "{\\dollar}", -/* 37: % */ "\\%", -/* 38: & */ "\\&", -/* 39: ' */ "{'}", -/* 40: ( */ 0, -/* 41: ) */ 0, -/* 42: * */ 0, -/* 43: + */ 0, -/* 44: , */ 0, -/* 45: - */ "{-}", -/* 46: . */ 0, -/* 47: / */ 0, -/* 48: 0 */ 0, -/* 49: 1 */ 0, -/* 50: 2 */ 0, -/* 51: 3 */ 0, -/* 52: 4 */ 0, -/* 53: 5 */ 0, -/* 54: 6 */ 0, -/* 55: 7 */ 0, -/* 56: 8 */ 0, -/* 57: 9 */ 0, -/* 58: : */ 0, -/* 59: ; */ 0, -/* 60: < */ "{\\tenmlb\\char'045}", -/* 61: = */ 0, -/* 62: > */ "{\\tenmlb\\char'046}", -/* 63: ? */ 0, -/* 64: @ */ 0, -/* 65: A */ 0, -/* 66: B */ 0, -/* 67: C */ 0, -/* 68: D */ 0, -/* 69: E */ 0, -/* 70: F */ 0, -/* 71: G */ 0, -/* 72: H */ 0, -/* 73: I */ 0, -/* 74: J */ 0, -/* 75: K */ 0, -/* 76: L */ 0, -/* 77: M */ 0, -/* 78: N */ 0, -/* 79: O */ 0, -/* 80: P */ 0, -/* 81: Q */ 0, -/* 82: R */ 0, -/* 83: S */ 0, -/* 84: T */ 0, -/* 85: U */ 0, -/* 86: V */ 0, -/* 87: W */ 0, -/* 88: X */ 0, -/* 89: Y */ 0, -/* 90: Z */ 0, -/* 91: [ */ 0, -/* 92: \\ */ "{\\tenmlb\\char'047}", -/* 93: ] */ 0, -/* 94: ^ */ "{\\tenmlb\\char'064}", -/* 95: _ */ "{\\tenmlb\\char'066}", -/* 96: ` */ "{`}", -/* 97: a */ 0, -/* 98: b */ 0, -/* 99: c */ 0, -/* 100: d */ 0, -/* 101: e */ 0, -/* 102: f */ 0, -/* 103: g */ 0, -/* 104: h */ 0, -/* 105: i */ 0, -/* 106: j */ 0, -/* 107: k */ 0, -/* 108: l */ 0, -/* 109: m */ 0, -/* 110: n */ 0, -/* 111: o */ 0, -/* 112: p */ 0, -/* 113: q */ 0, -/* 114: r */ 0, -/* 115: s */ 0, -/* 116: t */ 0, -/* 117: u */ 0, -/* 118: v */ 0, -/* 119: w */ 0, -/* 120: x */ 0, -/* 121: y */ 0, -/* 122: z */ 0, -/* 123: { */ "{\\tenmlb\\char'070}", -/* 124: | */ "{\\tenmlb\\char'104}", -/* 125: } */ "{\\tenmlb\\char'107}", -/* 126: ~ */ "{\\tenmlb\\char'116}", -/* 127: DEL */ 0, -/* 128: undefined */ 0, -/* 129: undefined */ 0, -/* 130: undefined */ 0, -/* 131: undefined */ 0, -/* 132: undefined */ 0, -/* 133: undefined */ 0, -/* 134: undefined */ 0, -/* 135: undefined */ 0, -/* 136: undefined */ 0, -/* 137: undefined */ 0, -/* 138: undefined */ 0, -/* 139: undefined */ 0, -/* 140: undefined */ 0, -/* 141: undefined */ 0, -/* 142: undefined */ 0, -/* 143: undefined */ 0, -/* 144: undefined */ 0, -/* 145: undefined */ 0, -/* 146: undefined */ 0, -/* 147: undefined */ 0, -/* 148: undefined */ 0, -/* 149: undefined */ 0, -/* 150: undefined */ 0, -/* 151: undefined */ 0, -/* 152: undefined */ 0, -/* 153: undefined */ 0, -/* 154: undefined */ 0, -/* 155: undefined */ 0, -/* 156: undefined */ 0, -/* 157: undefined */ 0, -/* 158: undefined */ 0, -/* 159: undefined */ 0, -/* 160: undefined */ 0, -/* 161: A grave */ "{\\tenmlc\\char'041}", -/* 162: A circumflex */ "{\\tenmlc\\char'042}", -/* 163: E grave */ "{\\tenmlc\\char'043}", -/* 164: E circumflex */ "{\\tenmlc\\char'044}", -/* 165: E dieresis */ "{\\tenmlc\\char'045}", -/* 166: I circumflex */ "{\\tenmlc\\char'046}", -/* 167: I dieresis */ "{\\tenmlc\\char'047}", -/* 168: acute accent */ "{\\tenmla\\char'023}", -/* 169: grave accent */ "{\\tenmla\\char'022}", -/* 170: circumflex */ "{\\tenmla\\char'136}", -/* 171: dieresis */ "{\\tenmla\\char'177}", -/* 172: tilde */ "{\\tenmla\\char'176}", -/* 173: U grave */ "{\\tenmlc\\char'050}", -/* 174: U circumflex */ "{\\tenmlc\\char'051}", -/* 175: Italian Lira */ 0, -/* 176: overbar */ 0, -/* 177: Y acute */ "{\\tenmlc\\char'053}", -/* 178: y acute */ "{\\tenmlc\\char'054}", -/* 179: degree */ 0, -/* 180: C cedilla */ "{\\tenmla\\char'030}", -/* 181: c cedilla */ "{\\tenmla\\char'030}", -/* 182: N tilde */ "{\\tenmlc\\char'055}", -/* 183: n tilde */ "{\\tenmlc\\char'056}", -/* 184: inverted exclamation mark */ "{\\tenmla\\char'074}", -/* 185: inverted question mark */ "{\\tenmla\\char'076}", -/* 186: currency sign */ 0, -/* 187: pound sterling */ 0, -/* 188: Yen */ 0, -/* 189: Section sign */ 0, -/* 190: florin */ 0, -/* 191: Cent sign */ 0, -/* 192: a circumflex */ "{\\tenmlc\\char'063}", -/* 193: e circumflex */ "{\\tenmlc\\char'064}", -/* 194: o circumflex */ "{\\tenmlc\\char'065}", -/* 195: u circumflex */ "{\\tenmlc\\char'066}", -/* 196: a acute */ "{\\tenmlc\\char'067}", -/* 197: e acute */ "{\\tenmlc\\char'070}", -/* 198: o acute */ "{\\tenmlc\\char'071}", -/* 199: u acute */ "{\\tenmlc\\char'072}", -/* 200: a grave */ "{\\tenmlc\\char'073}", -/* 201: e grave */ "{\\tenmlc\\char'074}", -/* 202: o grave */ "{\\tenmlc\\char'075}", -/* 203: u grave */ "{\\tenmlc\\char'076}", -/* 204: a dieresis */ "{\\tenmlc\\char'077}", -/* 205: e dieresis */ "{\\tenmlc\\char'100}", -/* 206: o dieresis */ "{\\tenmlc\\char'101}", -/* 207: u dieresis */ "{\\tenmlc\\char'102}", -/* 208: A angstrom */ "{\\tenmlc\\char'103}", -/* 209: i circumflex */ "{\\tenmlc\\char'104}", -/* 210: O slash */ "{\\tenmla\\char'037}", -/* 211: AE ligature */ "{\\tenmla\\char'035}", -/* 212: a angstrom */ "{\\tenmlc\\char'105}", -/* 213: i acute */ "{\\tenmlc\\char'106}", -/* 214: o slash */ "{\\tenmla\\char'034}", -/* 215: ae ligature */ "{\\tenmla\\char'032}", -/* 216: A dieresis */ "{\\tenmlc\\char'107}", -/* 217: i grave */ "{\\tenmlc\\char'110}", -/* 218: O dieresis */ "{\\tenmlc\\char'111}", -/* 219: U dieresis */ "{\\tenmlc\\char'112}", -/* 220: E acute */ "{\\tenmlc\\char'113}", -/* 221: i dieresis */ "{\\tenmlc\\char'114}", -/* 222: SS ligature */ "{\\tenmla\\char'031}", -/* 223: O circumflex */ "{\\tenmlc\\char'115}", -/* 224: A acute */ "{\\tenmlc\\char'116}", -/* 225: A tilde */ "{\\tenmlc\\char'117}", -/* 226: a tilde */ "{\\tenmlc\\char'120}", -/* 227: Eth */ 0, -/* 228: eth */ 0, -/* 229: I acute */ "{\\tenmlc\\char'121}", -/* 230: I grave */ "{\\tenmlc\\char'122}", -/* 231: O acute */ "{\\tenmlc\\char'123}", -/* 232: O grave */ "{\\tenmlc\\char'124}", -/* 233: O tilde */ "{\\tenmlc\\char'125}", -/* 234: o tilde */ "{\\tenmlc\\char'126}", -/* 235: S caron */ "{\\tenmlc\\char'127}", -/* 236: s caron */ "{\\tenmlc\\char'130}", -/* 237: U acute */ "{\\tenmlc\\char'131}", -/* 238: Y dieresis */ "{\\tenmlc\\char'132}", -/* 239: y dieresis */ "{\\tenmlc\\char'133}", -/* 240: Thorn */ 0, -/* 241: thorn */ 0, -/* 242: undefined */ 0, -/* 243: mu */ 0, -/* 244: paragraph sign */ 0, -/* 245: fraction 3/4 */ 0, -/* 246: long dash */ 0, -/* 247: fraction 1/4 */ 0, -/* 248: fraction 1/2 */ 0, -/* 249: Female ordinal */ 0, -/* 250: Male ordinal */ 0, -/* 251: French double open quote */ 0, -/* 252: Solid square */ 0, -/* 253: French double close quote */ 0, -/* 254: Plus over minus sign */ 0, -/* 255: undefined */ 0 -} -#endif -; - -/* white menu label special character expansions */ -EXTERN char *cwmenlspec[256] -#if defined(DEFINE) -= { -/* Char Name TeX Expansion */ -/* */ -/* 0: ^@ NUL */ 0, -/* 1: ^A SOH */ 0, -/* 2: ^B STX */ 0, -/* 3: ^C ETX */ 0, -/* 4: ^D EOT */ 0, -/* 5: ^E ENQ */ 0, -/* 6: ^F ACK */ 0, -/* 7: ^G BEL */ 0, -/* 8: ^H BS */ 0, -/* 9: ^I HT */ 0, -/* 10: ^J LF */ 0, -/* 11: ^K VT */ 0, -/* 12: ^L FF */ 0, -/* 13: ^M CR */ 0, -/* 14: ^N SO */ 0, -/* 15: ^O SI */ 0, -/* 16: ^P DLE */ 0, -/* 17: ^Q DC1 */ 0, -/* 18: ^R DC2 */ 0, -/* 19: ^S DC3 */ 0, -/* 20: ^T DC4 */ 0, -/* 21: ^U NAK */ 0, -/* 22: ^V SYN */ 0, -/* 23: ^W ETB */ 0, -/* 24: ^X CAN */ 0, -/* 25: ^Y EM */ 0, -/* 26: ^Z SUB */ 0, -/* 27: ^[ ESC */ 0, -/* 28: ^\ FS */ 0, -/* 29: ^] GS */ 0, -/* 30: ^^ RS */ 0, -/* 31: ^_ US */ 0, -/* 32: SP */ "{\\tenwlb\\char'146}", -/* 33: ! */ 0, -/* 34: " */ 0, -/* 35: # */ "\\#", -/* 36: $ */ "{\\dollar}", -/* 37: % */ "\\%", -/* 38: & */ "\\&", -/* 39: ' */ "{'}", -/* 40: ( */ 0, -/* 41: ) */ 0, -/* 42: * */ 0, -/* 43: + */ 0, -/* 44: , */ 0, -/* 45: - */ "{-}", -/* 46: . */ 0, -/* 47: / */ 0, -/* 48: 0 */ 0, -/* 49: 1 */ 0, -/* 50: 2 */ 0, -/* 51: 3 */ 0, -/* 52: 4 */ 0, -/* 53: 5 */ 0, -/* 54: 6 */ 0, -/* 55: 7 */ 0, -/* 56: 8 */ 0, -/* 57: 9 */ 0, -/* 58: : */ 0, -/* 59: ; */ 0, -/* 60: < */ "{\\tenwlb\\char'045}", -/* 61: = */ 0, -/* 62: > */ "{\\tenwlb\\char'046}", -/* 63: ? */ 0, -/* 64: @ */ 0, -/* 65: A */ 0, -/* 66: B */ 0, -/* 67: C */ 0, -/* 68: D */ 0, -/* 69: E */ 0, -/* 70: F */ 0, -/* 71: G */ 0, -/* 72: H */ 0, -/* 73: I */ 0, -/* 74: J */ 0, -/* 75: K */ 0, -/* 76: L */ 0, -/* 77: M */ 0, -/* 78: N */ 0, -/* 79: O */ 0, -/* 80: P */ 0, -/* 81: Q */ 0, -/* 82: R */ 0, -/* 83: S */ 0, -/* 84: T */ 0, -/* 85: U */ 0, -/* 86: V */ 0, -/* 87: W */ 0, -/* 88: X */ 0, -/* 89: Y */ 0, -/* 90: Z */ 0, -/* 91: [ */ 0, -/* 92: \\ */ "{\\tenwlb\\char'047}", -/* 93: ] */ 0, -/* 94: ^ */ "{\\tenwlb\\char'064}", -/* 95: _ */ "{\\tenwlb\\char'066}", -/* 96: ` */ "{`}", -/* 97: a */ 0, -/* 98: b */ 0, -/* 99: c */ 0, -/* 100: d */ 0, -/* 101: e */ 0, -/* 102: f */ 0, -/* 103: g */ 0, -/* 104: h */ 0, -/* 105: i */ 0, -/* 106: j */ 0, -/* 107: k */ 0, -/* 108: l */ 0, -/* 109: m */ 0, -/* 110: n */ 0, -/* 111: o */ 0, -/* 112: p */ 0, -/* 113: q */ 0, -/* 114: r */ 0, -/* 115: s */ 0, -/* 116: t */ 0, -/* 117: u */ 0, -/* 118: v */ 0, -/* 119: w */ 0, -/* 120: x */ 0, -/* 121: y */ 0, -/* 122: z */ 0, -/* 123: { */ "{\\tenwlb\\char'070}", -/* 124: | */ "{\\tenwlb\\char'104}", -/* 125: } */ "{\\tenwlb\\char'107}", -/* 126: ~ */ "{\\tenwlb\\char'116}", -/* 127: DEL */ 0, -/* 128: undefined */ 0, -/* 129: undefined */ 0, -/* 130: undefined */ 0, -/* 131: undefined */ 0, -/* 132: undefined */ 0, -/* 133: undefined */ 0, -/* 134: undefined */ 0, -/* 135: undefined */ 0, -/* 136: undefined */ 0, -/* 137: undefined */ 0, -/* 138: undefined */ 0, -/* 139: undefined */ 0, -/* 140: undefined */ 0, -/* 141: undefined */ 0, -/* 142: undefined */ 0, -/* 143: undefined */ 0, -/* 144: undefined */ 0, -/* 145: undefined */ 0, -/* 146: undefined */ 0, -/* 147: undefined */ 0, -/* 148: undefined */ 0, -/* 149: undefined */ 0, -/* 150: undefined */ 0, -/* 151: undefined */ 0, -/* 152: undefined */ 0, -/* 153: undefined */ 0, -/* 154: undefined */ 0, -/* 155: undefined */ 0, -/* 156: undefined */ 0, -/* 157: undefined */ 0, -/* 158: undefined */ 0, -/* 159: undefined */ 0, -/* 160: undefined */ 0, -/* 161: A grave */ "{\\tenwlc\\char'041}", -/* 162: A circumflex */ "{\\tenwlc\\char'042}", -/* 163: E grave */ "{\\tenwlc\\char'043}", -/* 164: E circumflex */ "{\\tenwlc\\char'044}", -/* 165: E dieresis */ "{\\tenwlc\\char'045}", -/* 166: I circumflex */ "{\\tenwlc\\char'046}", -/* 167: I dieresis */ "{\\tenwlc\\char'047}", -/* 168: acute accent */ "{\\tenwla\\char'023}", -/* 169: grave accent */ "{\\tenwla\\char'022}", -/* 170: circumflex */ "{\\tenwla\\char'136}", -/* 171: dieresis */ "{\\tenwla\\char'177}", -/* 172: tilde */ "{\\tenwla\\char'176}", -/* 173: U grave */ "{\\tenwlc\\char'050}", -/* 174: U circumflex */ "{\\tenwlc\\char'051}", -/* 175: Italian Lira */ 0, -/* 176: overbar */ 0, -/* 177: Y acute */ "{\\tenwlc\\char'053}", -/* 178: y acute */ "{\\tenwlc\\char'054}", -/* 179: degree */ 0, -/* 180: C cedilla */ "{\\tenwla\\char'030}", -/* 181: c cedilla */ "{\\tenwla\\char'030}", -/* 182: N tilde */ "{\\tenwlc\\char'055}", -/* 183: n tilde */ "{\\tenwlc\\char'056}", -/* 184: inverted exclamation mark */ "{\\tenwla\\char'074}", -/* 185: inverted question mark */ "{\\tenwla\\char'076}", -/* 186: currency sign */ 0, -/* 187: pound sterling */ 0, -/* 188: Yen */ 0, -/* 189: Section sign */ 0, -/* 190: florin */ 0, -/* 191: Cent sign */ 0, -/* 192: a circumflex */ "{\\tenwlc\\char'063}", -/* 193: e circumflex */ "{\\tenwlc\\char'064}", -/* 194: o circumflex */ "{\\tenwlc\\char'065}", -/* 195: u circumflex */ "{\\tenwlc\\char'066}", -/* 196: a acute */ "{\\tenwlc\\char'067}", -/* 197: e acute */ "{\\tenwlc\\char'070}", -/* 198: o acute */ "{\\tenwlc\\char'071}", -/* 199: u acute */ "{\\tenwlc\\char'072}", -/* 200: a grave */ "{\\tenwlc\\char'073}", -/* 201: e grave */ "{\\tenwlc\\char'074}", -/* 202: o grave */ "{\\tenwlc\\char'075}", -/* 203: u grave */ "{\\tenwlc\\char'076}", -/* 204: a dieresis */ "{\\tenwlc\\char'077}", -/* 205: e dieresis */ "{\\tenwlc\\char'100}", -/* 206: o dieresis */ "{\\tenwlc\\char'101}", -/* 207: u dieresis */ "{\\tenwlc\\char'102}", -/* 208: A angstrom */ "{\\tenwlc\\char'103}", -/* 209: i circumflex */ "{\\tenwlc\\char'104}", -/* 210: O slash */ "{\\tenwla\\char'037}", -/* 211: AE ligature */ "{\\tenwla\\char'035}", -/* 212: a angstrom */ "{\\tenwlc\\char'105}", -/* 213: i acute */ "{\\tenwlc\\char'106}", -/* 214: o slash */ "{\\tenwla\\char'034}", -/* 215: ae ligature */ "{\\tenwla\\char'032}", -/* 216: A dieresis */ "{\\tenwlc\\char'107}", -/* 217: i grave */ "{\\tenwlc\\char'110}", -/* 218: O dieresis */ "{\\tenwlc\\char'111}", -/* 219: U dieresis */ "{\\tenwlc\\char'112}", -/* 220: E acute */ "{\\tenwlc\\char'113}", -/* 221: i dieresis */ "{\\tenwlc\\char'114}", -/* 222: SS ligature */ "{\\tenwla\\char'031}", -/* 223: O circumflex */ "{\\tenwlc\\char'115}", -/* 224: A acute */ "{\\tenwlc\\char'116}", -/* 225: A tilde */ "{\\tenwlc\\char'117}", -/* 226: a tilde */ "{\\tenwlc\\char'120}", -/* 227: Eth */ 0, -/* 228: eth */ 0, -/* 229: I acute */ "{\\tenwlc\\char'121}", -/* 230: I grave */ "{\\tenwlc\\char'122}", -/* 231: O acute */ "{\\tenwlc\\char'123}", -/* 232: O grave */ "{\\tenwlc\\char'124}", -/* 233: O tilde */ "{\\tenwlc\\char'125}", -/* 234: o tilde */ "{\\tenwlc\\char'126}", -/* 235: S caron */ "{\\tenwlc\\char'127}", -/* 236: s caron */ "{\\tenwlc\\char'130}", -/* 237: U acute */ "{\\tenwlc\\char'131}", -/* 238: Y dieresis */ "{\\tenwlc\\char'132}", -/* 239: y dieresis */ "{\\tenwlc\\char'133}", -/* 240: Thorn */ 0, -/* 241: thorn */ 0, -/* 242: undefined */ 0, -/* 243: mu */ 0, -/* 244: paragraph sign */ 0, -/* 245: fraction 3/4 */ 0, -/* 246: long dash */ 0, -/* 247: fraction 1/4 */ 0, -/* 248: fraction 1/2 */ 0, -/* 249: Female ordinal */ 0, -/* 250: Male ordinal */ 0, -/* 251: French double open quote */ 0, -/* 252: Solid square */ 0, -/* 253: French double close quote */ 0, -/* 254: Plus over minus sign */ 0, -/* 255: undefined */ 0 -} -#endif -; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/charconv.h b/cde/programs/dthelp/parser.ccdf/htag/helptag/charconv.h deleted file mode 100644 index a41cc65a1..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/charconv.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: charconv.h /main/3 1995/11/08 11:15:21 rswiston $ */ -EXTERN M_WCHAR pc8_to_r8 [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\264','\317', - '\305','\300','\314','\310','\324','\265','\301','\315','\311','\335', - '\321','\331','\330','\320','\334','\327','\323','\302','\316','\312', - '\303','\313','\357','\332','\333','\277','\273','\274','\120','\276', - '\304','\325','\306','\307','\267','\266','\371','\372','\271','\055', - '\052','\370','\367','\270','\373','\375','\374','\374','\374','\174', - '\053','\043','\053','\053','\043','\043','\174','\043','\043','\053', - '\043','\053','\053','\053','\053','\053','\055','\053','\043','\053', - '\043','\043','\043','\043','\043','\075','\043','\043','\053','\043', - '\053','\053','\043','\043','\053','\053','\043','\053','\053','\374', - '\374','\374','\374','\374','\052','\336','\052','\052','\052','\052', - '\363','\052','\052','\052','\052','\052','\052','\326','\052','\052', - '\052','\376','\052','\052','\174','\174','\057','\176','\263','\362', - '\362','\052','\052','\052','\374','\377' - } -#endif - ; - -EXTERN M_WCHAR pc8dn_to_r8 [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\264','\317', - '\305','\300','\314','\310','\324','\265','\301','\315','\311','\335', - '\321','\331','\330','\320','\334','\327','\323','\302','\316','\312', - '\303','\313','\357','\332','\333','\326','\273','\322','\114','\154', - '\304','\325','\306','\307','\267','\266','\352','\351','\271','\342', - '\341','\154','\156','\270','\052','\272','\374','\374','\374','\174', - '\053','\043','\053','\053','\043','\043','\174','\043','\043','\053', - '\043','\053','\053','\053','\053','\053','\055','\053','\043','\053', - '\043','\043','\043','\043','\043','\075','\043','\043','\053','\043', - '\053','\053','\043','\043','\053','\053','\043','\053','\053','\374', - '\374','\374','\374','\374','\052','\336','\052','\052','\052','\052', - '\363','\052','\052','\052','\052','\052','\052','\326','\052','\052', - '\052','\376','\052','\052','\174','\174','\057','\176','\263','\362', - '\362','\052','\052','\052','\374','\377' - } -#endif - ; - -EXTERN M_WCHAR r8_to_pc8 [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\200','\201', - '\202','\203','\204','\205','\206','\207','\210','\211','\212','\213', - '\214','\215','\216','\217','\220','\221','\222','\223','\224','\225', - '\226','\227','\230','\231','\232','\233','\234','\235','\236','\237', - '\040','\101','\101','\105','\105','\105','\111','\111','\047','\140', - '\136','\042','\176','\125','\125','\234','\055','\131','\171','\370', - '\200','\207','\245','\244','\255','\250','\052','\234','\235','\052', - '\237','\233','\203','\210','\223','\226','\240','\202','\242','\243', - '\205','\212','\225','\227','\204','\211','\224','\201','\217','\214', - '\117','\222','\206','\241','\355','\221','\216','\215','\231','\232', - '\220','\213','\341','\117','\101','\101','\141','\104','\144','\111', - '\111','\117','\117','\117','\157','\123','\163','\125','\131','\230', - '\052','\052','\372','\346','\052','\052','\304','\254','\253','\246', - '\247','\256','\376','\257','\361','\040' - } -#endif - ; - -EXTERN M_WCHAR r8_to_pc8dn [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\200','\201', - '\202','\203','\204','\205','\206','\207','\210','\211','\212','\213', - '\214','\215','\216','\217','\220','\221','\222','\223','\224','\225', - '\226','\227','\230','\231','\232','\233','\234','\235','\236','\237', - '\040','\101','\101','\105','\105','\105','\111','\111','\047','\140', - '\136','\042','\176','\125','\125','\234','\055','\131','\171','\370', - '\200','\207','\245','\244','\255','\250','\257','\234','\131','\052', - '\146','\143','\203','\210','\223','\226','\240','\202','\242','\243', - '\205','\212','\225','\227','\204','\211','\224','\201','\217','\214', - '\235','\222','\206','\241','\233','\221','\216','\215','\231','\232', - '\220','\213','\341','\117','\101','\252','\251','\104','\144','\111', - '\111','\117','\117','\247','\246','\123','\163','\125','\131','\230', - '\052','\052','\372','\346','\052','\052','\304','\052','\052','\052', - '\052','\074','\376','\076','\361','\040' - } -#endif - ; - -/* Obsolete */ diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/custom.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/custom.c deleted file mode 100644 index f39f88017..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/custom.c +++ /dev/null @@ -1,382 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: custom.c /main/3 1995/11/08 11:15:34 rswiston $ */ -/* -Copyright (c) 1988, 1989 Hewlett-Packard Co. -*/ - -/* Custom.c contains standard PARSER functions, customized for the HP - HelpTag formatting system. */ - -#include "userinc.h" -#include "globdec.h" -#include - -/* Write input file and line number for an error message */ -void m_dumpline(file, line) -M_WCHAR *file; -int line; -{ -char buffer[10]; -char *mbyte; - -m_errline("Line "); -sprintf(buffer, "%d", line); -m_errline(buffer); -if (!file) - { /* no entity file */ - if (inputname) - { /* use main input, instead. Only if set though. */ - mbyte = MakeMByteString(inputname); - m_errline(" of "); - m_errline(mbyte); - m_free(mbyte, "multi-byte string"); - } - } -else - { /* yes, entity file */ - mbyte = MakeMByteString(file); - m_errline(" of "); - m_errline(mbyte); - m_free(mbyte, "multi-byte string"); - } -} - -/* Write error message prefix */ -void m_eprefix(void) -{ -m_errline("\n*****\n"); -m_dumpline(m_thisfile(), m_thisline()); -m_errline(",\n"); -} - -/* Process error message text */ -void m_errline(p) -char *p; -{ -char c; - -for ( ; *p ; p++) - { - if (m_errfile) putc(*p, m_errfile); - putc(*p, stderr); - } -} - -/* Write error message suffix */ -void m_esuffix(void) -{ -m_errline(":\n"); -m_lastchars(); -if (++m_errcnt == m_errlim) - { - m_error("Too many errors, processing stopped"); - m_exit(TRUE); - } -} - -/* Exit procedure */ -void m_exit(status) -int status; -{ -if (filefound) - { - if (m_outfile && (m_outfile != stdout)) - { - if (have_index) - { /* sph: is this really necessary? */ - fseek(m_outfile, 0L, SEEK_END); - } - fclose(m_outfile); - if (prebye == postpreamble) - m_error("No text in document"); - } - } - -if (status) - { - if (status == 77) /* tell helptag to re-run for forward xrefs */ - { - if (stoponerror) - { - if (m_errcnt == 0) - exit(77); - else - exit(1); - } - else - exit(66); - } - - if (stoponerror) - exit(1); /* tell helptag to quit */ - - exit(2); /* tell helptag to continue to next phases */ - } - -exit(0); -} - -/* Get-char procedure */ -int m_getc(m_ptr) -void *m_ptr; -{ -int c; -M_WCHAR wc; -char badch[2]; -char mbyte[32]; /* make this bigger than any possible multi-byte char */ -int length; -static M_WCHAR wcr = 0, wsb, wsp, wtb; -char tab, space; - -/* Unix/Dos compatibility: 0D0A handling */ -if (!wcr) - { - mbtowc(&wcr, "\r", 1); - mbtowc(&wsb, "\032", 1); - - space = M_SPACE; - mbtowc(&wsp, &space, 1); - - tab = M_TAB; - mbtowc(&wtb, &tab, 1); - } - -do { - length = 0; - if ((c = getc((FILE *) m_ptr)) == EOF) return(EOF); - while (1) - { - mbyte[length++] = c; - mbyte[length] = 0; - if (mblen(mbyte,length) != -1) break; /* hurray! */ - if (length == MB_CUR_MAX) - { /* reached max without a hit */ - m_error("An invalid multi-byte character was found in the input"); - c = ' '; - length = 1; - break; - } - if ((c = getc((FILE *) m_ptr)) == EOF) - { /* huh? */ - m_error("End-of-file found in within a multi-byte character"); - return(EOF); - } - } - mbtowc(&wc,mbyte,length); - } -while ((wc == wcr) || (wc == wsb)); - -/* Change tabs to spaces */ -if (wc == wtb) return((int) wsp); -return((int) wc); -} - -/* Open SYSTEM entity procedure */ -void *m_openent(entcontent) -M_WCHAR *entcontent; -{ -FILE *open; -char *filename; -SEARCH *searchp; -char *mb_entcontent; - -mb_entcontent = MakeMByteString(entcontent); -if (!*mb_entcontent) return NULL; /* null file name, don't open a directory */ - -open = fopen(mb_entcontent, "r"); -if (open) - { - m_free(mb_entcontent, "multi-byte string"); - return((void *) open); - } - -for (searchp = path ; searchp ; searchp = searchp->next) - { - filename = (char *) - m_malloc(strlen(searchp->directory) + - strlen(mb_entcontent) + 1, - "filename"); - strcpy(filename, searchp->directory); - strcat(filename, mb_entcontent); - open = fopen(filename, "r"); - m_free(filename, "filename"); - if (open) - { - m_free(mb_entcontent, "multi-byte string"); - return((void *) open); - } - } - -m_free(mb_entcontent, "multi-byte string"); -return(NULL); -} - -/* Open input file */ -void *m_openfirst(void) -{ -FILE *first; -char *input; -int length; - -if (defaultext) - { - input = (char *) - m_malloc(strlen(m_argv[1]) + strlen(".htg") + 1, "input file name"); - strcpy(input, m_argv[1]); - strcat(input, ".htg"); - m_openchk(&first, input, "r"); - if (filelist) puts(input); - /* keep name for global use */ - length = strlen(input); - inputname = (M_WCHAR *) m_malloc(length + 1, "saved input file name"); - mbstowcs(inputname, input, length + 1); - m_free(input, "input file name"); - } -else - { - if (filelist) puts(m_argv[1]); - m_openchk(&first, m_argv[1], "r"); - length = strlen(m_argv[1]); - inputname = (M_WCHAR *) m_malloc(length + 1, "saved input file name"); - mbstowcs(inputname, m_argv[1], length + 1); - } - -/* Set E option (to suppress error message on duplicate entity - declarations) if file begins with ""}, - {"biglongrightarrow", "==>"}, - {"longleftrightarrow", "<-->"}, - {"biglongleftrightarrow", "<==>"}, - {"longmapsto", "|-->"}, - {"hookrightarrow", "hookrightarrow"}, - {"rightharpoonup", "rightharpoonup"}, - {"rightharpoondown", "rightharpoondown"}, - {"nearrow", "NEarrow"}, - {"searrow", "SEarrow"}, - {"swarrow", "SWarrow"}, - {"nwarrow", "NWarrow"}, - {"half", "1/2"}, - {"third", "1/3"}, - {"quarter", "1/4"}, - {"threequarter", "3/4"}, - {"fifth", "1/5"}, - {"sixth", "1/6"}, - {"eighth", "1/8"}, - {"sixteenth", "1/16"}, - {"space", "\\symbol{20}"}, - {"INSTMAN", "instman"}, - {"HAZVOLT", "hazvolt"}, - {"GROUND", "ground"}, - {"DCVOLT", "dcvolt"}, - {"NEGPULSE", "negpulse"}, - {"POSPULSE", "pospulse"}, - {"SINEWAVE", "sinewave"}, - {"SAWWAVE", "sawwave"}, - {"RAMPWAVE", "rampwave"}, - {"TRIWAVE", "triwave"}, - {"SQWAVE", "sqwave"}, - /* - * the last entry in this array should always be - * '{NULL, NULL}' - */ - {NULL, NULL} -}; - - -/* Verify Tag dimension, else issue error message */ -M_WCHAR *checkdimen( val, paramname, elt ) -M_WCHAR *val; -M_WCHAR *paramname; -M_WCHAR *elt; -{ -/* returns val if a valid TeX dimension, else NULL */ -M_WCHAR *valid = NULL; - -if ( val == NULL ) return ( NULL ); -if ((valid = okdimen(val)) != NULL) return(valid); -if ( valid == NULL ) - { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err5 ("[%s] Illegal value of %s for %s%s%s", - val, - paramname, - wc_stago, - elt, - wc_tagc ); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } -return ( valid ); -} - - -M_WCHAR *mb_checkdimen( val, paramname, elt ) -M_WCHAR *val; -char *paramname; -char *elt; -{ -M_WCHAR *wc_paramname, *wc_elt, *retval; - -wc_paramname = MakeWideCharString(paramname); -wc_elt = MakeWideCharString(elt); - -retval = checkdimen(val, wc_paramname, wc_elt); - -m_free(wc_paramname,"wide character string"); -m_free(wc_elt,"wide character string"); -} - -/* Check through search (like openent()) paths of SYSTEM entity name to - construct fully qualified or relative path names, if any */ -M_WCHAR *checkent(entcontent) -M_WCHAR *entcontent; -{ -M_WCHAR *filename; -SEARCH *searchp; -char *mb_entc, mb_filen[2048]; -int dir_leng, econt_leng; - -mb_entc = MakeMByteString(entcontent); -if (access(mb_entc, 04)==0) - { /* entcontent is readable */ - filename = (M_WCHAR *) m_malloc(w_strlen(entcontent) + 1, - "checkent figinpath"); - w_strcpy(filename, entcontent); - m_free(mb_entc,"multi-byte string"); - return(filename); - } - -econt_leng = strlen(mb_entc); -for (searchp = path; searchp ; searchp = searchp->next) - { - if (((dir_leng = strlen(searchp->directory)) + econt_leng) >= 2048) - { - M_WCHAR *wc; - - wc = MakeWideCharString(searchp->directory); - m_err2("%s and %s overflow the file name space", - wc, - entcontent); - m_free(wc,"wide character string"); - continue; - } - strcpy(mb_filen, searchp->directory); - strcpy(mb_filen + dir_leng, mb_entc); - if (access(mb_filen, 04)==0) /* entcontent is readable */ - { - m_free(mb_entc,"multi-byte string"); - return MakeWideCharString(mb_filen); - } - } - -m_free(mb_entc,"multi-byte string"); -return(NULL); -} - - -/* Called at end of manual to report terms that occurred in the document - but not entered in the glossary */ -void checkgloss(void) -{ -int n; -M_WCHAR id[MAXTERM + 1]; -M_TRIE *node[MAXTERM + 1]; -M_TRIE *current; - -if (! gtree.data) return; -n = 0; -current = gtree.data; -while (TRUE) - { - id[n] = current->symbol; - node[n] = current->next; - if (! id[n]) - { - if ((unsigned) current->data != DEFINETERM) - m_err1("No glossary definition for %s", id); - current = current->next; - while (! current) - { - n--; - if (n < 0) return; - current = node[n]; - } - } - else - { - current = current->data; - n++; - } - } -} - - -/* End Error _DtMessage macro \starterrmsg call, check to see if Error _DtMessage - head is user specified or default */ -void checkmsghead(void) -{ -char *string = - GetDefaultHeaderString("MessagesElementDefaultHeadingString", - M_SDATA, - "Messages"); -if (emsghead == DEFHEAD) - { /* head not output yet */ - fprintf(outfile, - "%s%s%s", - "<TYPE serif><WEIGHT bold><SIZE 14>", - string, - "</TYPE></WEIGHT></SIZE>\n"); - emsghead = FALSE; - } -else if (emsghead == USERHEAD) - { /* user specified head */ - emsghead = FALSE; - } -m_free(string, "GetDefaultHeaderString return"); -} /* end checkmsghead() */ - - -/* Verify that val is an acceptable real number value */ -M_WCHAR * -checkreal (M_WCHAR *val, M_WCHAR *paramname, LOGICAL msgout, M_WCHAR *elt) -{ -/* returns val if a valid real number, else NULL */ -double num; -M_WCHAR *valid = NULL; -char s1[M_NAMELEN+1]; -char *mbyte; - -if (val == NULL) return NULL; - -mbyte = MakeMByteString(val); - -if (sscanf (mbyte, "%lf", &num ) == 1 ) valid = val; - -if (sscanf(mbyte, "%lf%s", &num, s1 ) == 2 ) - valid = NULL; /* no characters allowed */ - -if ( valid == NULL ) - { - M_WCHAR *wc_stago, *wc_tagc; - - if (msgout) - { - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err5("[%s] Illegal value of %s for %s%s%s", - val, - paramname, - wc_stago, - elt, - wc_tagc ); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - } - -m_free(mbyte,"multi-byte string"); -return ( valid ); -} /* END checkreal procedure */ - - -/* end a help node */ -void endhelpnode(void) -{ -} - -/* End code for and */ -void exvexend (textsize) -M_WCHAR *textsize; -{ -int tsize; - -tsize = vextextsize(textsize); -if (tsize==NORMAL) - { - fputs("\n\n", outfile); - } -else - { /* textsize is either SMALLER or SMALLEST */ - fputs("\n\n\n", outfile); - } -} /* END exvexend() */ - - -/* Starting stuff for and */ -void exvexstart (M_WCHAR *type, M_WCHAR *textsize, char *listinfo) -{ -int tsize; - -STARTSTUFF -rshnewclear(); -parspace(); -tsize = vextextsize(textsize); -if (tsize==NORMAL) - { - fprintf(outfile, - "", - listinfo, - LEFTINDENT, - LEFTINDENT); - } -else - { /* textsize is either SMALLER or SMALLEST */ - fprintf(outfile, - "", - listinfo, - LEFTINDENT, - LEFTINDENT); - if (tsize==SMALLER) - { - fputs("", outfile); - } - else - { - fputs("", outfile); - } - } -} /* END exvexstart() */ - - -/* construct a qualified file name */ -int mb_getqualified ( qualname, unqualname ) -char *qualname; -char *unqualname; -{ -#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) -FILE *f; -#endif -char fn[FNAMELEN]; -char tokstr [ 20 ], *gp, *p, *pp, *fnp, curdir[FNAMELEN-1]; -int roomleft = FNAMELEN - 1; - -if (!unqualname) - { - *qualname = M_EOS; - return( 0 ); - } - -if (strlen(unqualname) < FNAMELEN) - strcpy(fn, unqualname ); -else - { - m_mberr1("Internal Error. File name too long for qualifying: %s", - unqualname); - return (-1); - } - -fnp = fn; - -#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) -qualname[0] = '\0'; -gp = qualname + strlen(qualname); -roomleft = roomleft - strlen(qualname); - -/* if path is from root, tack that on, else tack on the current - directory (for the referenced drive, if MS-DOS) */ -/* We assume FNAMELEN is at least three (3), so no range checking here */ -if ( *fnp == CSEP ) - { - strcat(qualname, SSEP); - roomleft--; - ++fnp; - } -else - { - f = popen("/bin/pwd", "r"); - fscanf(f, "%s", gp); - pclose(f); - if (strlen(gp) >= roomleft) - { - m_mberr1("Internal error: possible stray pointer in getqualified(): %s", - gp); - return(-1); - } - strcat(qualname,SSEP); - roomleft--; - } -#else -/* if MS-DOS, force to upper case, then get drive spec */ -strupr ( fn ); -if ( fn[1] == ':' ) { -strncpy ( qualname, fn, 2 ); -fnp += 2; -} -else { -getcwd(qualname, roomleft); -} -qualname[2] = '\0'; -gp = qualname + strlen ( qualname ); -roomleft = roomleft - strlen ( qualname ); -/* if path is from root, tack that on, else tack on the current - directory (for the referenced drive, if MS-DOS) */ -if ( *fnp == CSEP ) { -strcat ( qualname, SSEP ); -roomleft--; -++fnp; -} -else { -/* assume current directory always !!! */ -*gp = CSEP; -getcwd(curdir, FNAMELEN-1); -if (*curdir != *qualname) { - m_err1("Relative directory %s for non-current drive, can't qualify", - unqualname); - return (-1); - } -if (strlen(curdir) > 3) { - if ((strlen(curdir+3)+1) < roomleft) { /* "1" for SSEP */ - strcpy( gp+1, curdir+3 ); - strcat ( qualname, SSEP ); - roomleft = roomleft - strlen(curdir+3) - 1; /* "1" for SSEP */ - } - else { - m_err1("Internal error. File name too long for qualifying: %s", - unqualname); - return (-1); - } - } -} -#endif - -strcpy(tokstr, " \r\n\t"); -strcat(tokstr, SSEP); -p = NULL; -do { - p = strtok(( p == NULL ) ? fnp : NULL, tokstr); - if ( p == NULL ) break; - if ( *p == '.' ) /* alias */ - { - if ( *(p+1) == '.' ) /* parent */ - { - *strrchr(qualname, CSEP) = '\0'; - pp = strrchr(qualname, CSEP); - if (pp == NULL) /* FAIL */ - { - m_mberr1("Internal error. Failed in qualifying %s", unqualname); - return ( -1 ); - } - else - { - *(pp+1) = '\0'; - } - } - } - else - { - if ((strlen(p)+1) < roomleft) - { /* "1" for SSEP */ - strcat(qualname, p); - strcat(qualname, SSEP); - roomleft = roomleft - strlen(p) - 1; - } - else - { - m_mberr1("Internal error. File name too long for qualifying: %s", - unqualname); - return (-1); - } - } - } -while (1); -*strrchr(qualname, CSEP) = '\0'; - -#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) -#else -strupr ( qualname ); -#endif - -return ( 0 ); -} /* end mb_getqualified */ - - -int getqualified (qualname, unqualname) -M_WCHAR *qualname; -M_WCHAR *unqualname; -{ -int retval; -char mb_qualname[FNAMELEN], - mb_unqualname[FNAMELEN]; - -wcstombs(mb_qualname, qualname, FNAMELEN); -wcstombs(mb_unqualname, unqualname, FNAMELEN); - -retval = mb_getqualified(mb_qualname, mb_unqualname); - -mbstowcs(qualname, mb_qualname, FNAMELEN); -mbstowcs(unqualname, mb_unqualname, FNAMELEN); - -return retval; -} - - -/* handle the common link and graphic code for

and */ -void -handle_link_and_graphic(parent, - gentity, - gposition, - ghyperlink, - glinktype, - gdescription) -M_WCHAR *parent, *gentity, *gposition, *ghyperlink, *glinktype, *gdescription; -{ -unsigned char etype, wheredef; -char *mb_content; -static M_WCHAR empty = M_EOS; - -/* handle graphic specific code */ -/* initialize some stuff first: -- file is the entity name, -- f_file is the content of the entity, used only if f_content nonNULL -- f_content is f_file with the relative pathname, initialized to NULL, -- f_contqual is fully qualified f_file, assigned ONLY IF - f_content nonNULL -*/ -file_ent = FALSE; -f_content = NULL; -f_contqual[0] = M_EOS; - -/* check ENTITY and determine the figure type */ -if (gentity) - { - m_lookent(gentity, &etype, &f_file, &wheredef); - if (etype != M_SYSTEM) - { - M_WCHAR *wc_entsystem, *wc_entkw, *wc_stago, *wc_tagc; - - wc_entsystem = MakeWideCharString(m_entsystem); - wc_entkw = MakeWideCharString(m_entkw); - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err6( - "%s not a %s %s, as required for the ENTITY parameter of %s%s%s", - gentity, - wc_entsystem, - wc_entkw, - wc_stago, - m_parent(0), - wc_tagc); - m_free(wc_entsystem,"wide character string"); - m_free(wc_entkw,"wide character string"); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - else - { - file_ent = TRUE; - f_content = searchforfile(f_file); - if (f_content) - { - if (getqualified(f_contqual, f_content)) - { - /* unsuccessful qual */ - if (w_strlen(f_content) < FNAMELEN) - w_strcpy(f_contqual, f_content); - else - { - m_err1("Internal error. File name too long: %s", - f_content); - m_exit(m_errexit); - } - } - } - else - { - m_err2("Can't find file %s (declared in entity %s)", - f_file, - gentity); - } - } - if (!f_content) f_content = ∅ - - mb_content = MakeMByteString(f_content); - fprintf(outfile, " graphic %s", mb_content); - m_free(mb_content,"multi-byte string"); - } - -/* and the position now */ -if (gposition) - { - M_WCHAR *wc_left, *wc_right; - - wc_left = MakeWideCharString(QLEFT); - if (!m_wcupstrcmp(gposition, wc_left)) - { - fputs(" gpos left", outfile); - } - else - { - wc_right = MakeWideCharString(QRIGHT); - if (!m_wcupstrcmp(gposition, wc_right)) - { - fputs(" gpos right", outfile); - } - else - { - m_err1("Invalid value for gposition: `%s'", gposition); - } - m_free(wc_right,"wide character string"); - } - m_free(wc_left,"wide character string"); - } - -/* end handling graphic specific code */ -/* handle link specific code */ -if (!glinktype) - { /* default to type jump */ - /* do nothing */ - } -else - { /* type is set, choose which is correct */ - M_WCHAR *wc_stago, *wc_tagc; - - if (!m_wcmbupstrcmp(glinktype, QJUMP)) - { fputs(" gtypelink 0", outfile); } - else if (!m_wcmbupstrcmp(glinktype, QJUMPNEWVIEW)) - { fputs(" gtypelink 1", outfile); } - else if (!m_wcmbupstrcmp(glinktype, QDEFINITION)) - { fputs(" gtypelink 2", outfile); } - else if (!m_wcmbupstrcmp(glinktype, QEXECUTE)) - { fputs(" gtypelink 3", outfile); } - else if (!m_wcmbupstrcmp(glinktype, QMAN)) - { fputs(" gtypelink 4", outfile); } - else if (!m_wcmbupstrcmp(glinktype, QAPPDEFINED)) - { fputs(" gtypelink 5", outfile); } - else - { /* parser won't let this case happen */ - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err3( - "%sLINK%s (glinktype=``%s'') did not match an allowed value", - wc_stago, - wc_tagc, - glinktype); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - } - -if (ghyperlink) - { - char *mb_ghyperlink; - - mb_ghyperlink = MakeMByteString(ghyperlink); - fprintf(outfile, " glink \"%s\"", mb_ghyperlink); - m_free(mb_ghyperlink,"multi-byte string"); - } -else - { - if (glinktype || gdescription) - { - m_eprefix(); - fprintf(stderr, - "Error: %sP%s ghyperlink was undefined.\n", - m_stago, - m_tagc); - fprintf(m_errfile, - "Error: %sP%s ghyperlink was undefined.\n", - m_stago, - m_tagc); - fprintf(stderr, - "Beware of using a reserved value such as:\n%s, %s, %s, %s, %s, or %s.\n", - QJUMP, - QJUMPNEWVIEW, - QDEFINITION, - QEXECUTE, - QAPPDEFINED, - QMAN); - fprintf(m_errfile, - "Beware of using a reserved value such as:\n%s, %s, %s, %s, %s, or %s.\n", - QJUMP, - QJUMPNEWVIEW, - QDEFINITION, - QEXECUTE, - QAPPDEFINED, - QMAN); - m_errline("Use ``ghyperlink='' if the value contains non-alphabetics"); - m_esuffix(); - fputs(" glink _undefined", outfile); - } - } - -if (gdescription) - { - fprintf(outfile, " description \"%s\"", gdescription); - } -/* end of link specific code */ -} - -/* Process an item in a list */ -void item(id) -M_WCHAR *id; -{ -char orderString[32]; -static char *ROMAN0[] = - {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}; -static char *ROMAN10[] = - {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"}; -static char *ROMAN100[] = - {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"}; -static char ALPHABET[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -static char *roman0[] = - {"", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"}; -static char *roman10[] = - {"", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"}; -static char *roman100[] = - {"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"}; -static char alphabet[] = "abcdefghijklmnopqrstuvwxyz"; -static char numbers[] = "0123456789"; -int count, metaCount; - -if (lastlist->lastlist->type == ORDER) - fprintf(outfile, "lastlist->space == TIGHT) - { - fputs(" after 0", outfile); - } -lastlist->lastlist->where = FIRST; - -orderString[0] = '\0'; -count = ++lastlist->lastlist->count; -if (count > 999) count = 999; /* holy cow! Big list. */ -switch (lastlist->lastlist->order) - { - case UROMAN: - strcpy(orderString, ROMAN100[count / 100]); - strcat(orderString, ROMAN10[(count / 10) % 10]); - strcat(orderString, ROMAN0[count % 10]); - if ((count = strlen(orderString)) < 4) - { - char tmpString[32]; - - tmpString[0] = '\0'; - count = 4 - count; - while (--count >= 0) strcat(tmpString, "\\ "); - strcat(tmpString, orderString); - strcpy(orderString, tmpString); - } - break; - case UALPHA: - metaCount = 1; - while ((count -= 26) > 0) metaCount++; - count = lastlist->lastlist->count; - if (count > 999) count = 999; - count -= 1; - count %= 26; - while (--metaCount >= 0) strncat(orderString, &ALPHABET[count], 1); - break; - case ARABIC: - if (metaCount = (count / 100)) - strncat(orderString, &numbers[metaCount], 1); - if (metaCount || ((count / 10) % 10)) - strncat(orderString, &numbers[(count / 10) % 10], 1); - strncat(orderString, &numbers[count % 10], 1); - break; - case LROMAN: - strcpy(orderString, roman100[count / 100]); - strcat(orderString, roman10[(count / 10) % 10]); - strcat(orderString, roman0[count % 10]); - if ((count = strlen(orderString)) < 4) - { - char tmpString[32]; - - tmpString[0] = '\0'; - count = 4 - count; - while (--count >= 0) strcat(tmpString, "\\ "); - strcat(tmpString, orderString); - strcpy(orderString, tmpString); - } - break; - case LALPHA: - metaCount = 1; - while ((count -= 26) > 0) metaCount++; - count = lastlist->lastlist->count; - if (count > 999) count = 999; - count -= 1; - count %= 26; - while (--metaCount >= 0) strncat(orderString, &alphabet[count], 1); - break; - } - -if (lastlist->lastlist->type == ORDER) - { - fprintf( /* keep the '('s balanced */ - outfile, - ">

\n", outfile); - -if (ftonumber) - { - fprintf(outfile, "%s %d. ", string, figno); - } -m_free(string, "default header string return"); -} - -void endterm( M_WCHAR *base, M_WCHAR *gloss, int linktype) -{ -M_WCHAR *p; -M_WCHAR wnl, wsp, wus; - -tooutput = TRUE; - -mbtowc(&wnl, "\n", 1); -mbtowc(&wsp, " ", 1); -mbtowc(&wus, "_", 1); - -/* strip possible newlines out of base form */ -if (base) - { - for (p = base; *p ; p++) - { - if (*p == wnl) *p = wsp; - } - } - -/* terminate the term string */ -if (termp - term > MAXTERM) termp = &term[MAXTERM]; -*termp = M_EOS; - -/* trim possible last space */ -if (termp - term > 1 && *(termp-1) == wsp) - { - *(termp-1) = M_EOS; - } - -/* Check if it should be entered into the glossary structure */ -if (vgloss(gloss) == GLOSS) - { - m_ntrtrie(base ? base : term, >ree, (M_TRIE *) ENTERTERM); - fprintf(outfile, "", outfile); - } - -/* Handle the output */ -mb_strcode("", outfile); - -if (m_mblevel("EXAMPLESEG") || m_mblevel("IMAGE")) - { - /* Are we in one of these? */ - for(p = term; *p; p++) - { - exoutchar(*p); - } - } -else - { /* normal case */ - for(p = term; *p; p++) - { - outchar(*p, outfile); - } - } - -mb_strcode("", outfile); - -if (vgloss(gloss) == GLOSS) - { - mb_strcode("", outfile); - } - -if (echo) mb_echohead("++"); -} - -M_WCHAR wc_toupper(M_WCHAR wc) -{ -if ((wc >= 0) && (wc <= 255)) - { - return _toupper(wc); - } -return wc; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/help.if b/cde/programs/dthelp/parser.ccdf/htag/helptag/help.if deleted file mode 100644 index 4919b94e3..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/help.if +++ /dev/null @@ -1,3689 +0,0 @@ -/* Copyright (c) 1986, 1987, 1988, 1989, 1990 Hewlett-Packard Co. */ -/* Interface definition for HP Tag/TeX translator */ - -/* Things to watch out for: - - 1. Index processing. Notice for a number of tags ( for example), - there is specific code when the tag is in : - , etc. - Many tags don't have empty <* IDX> string-code processing, to save - on executable size. Therefore, when you add string-code processing - to a tag, make sure you add empty string-code for <* IDX>. - 2. Index processing for , , . They all have - hardcoded default values for their parameters to save on program - size (otherwise we have to uncomment parameter code). This is not - a problem since parameters is unimplemented. Need to watch out for - this when we do implement. -*/ - -/* Redefine m-starttextincell to enable */ - - - -<0xB1>"> -<0xB8>"> -<0xB4>"> -<0xA3>"> -<0xB3>"> -<0xB9>"> -<0xE3>"> -<0xE2>"> -<0xE4>"> -<0xBC>"> - - - - -<0xA2>"> -<0xB2>"> -<0xB0>"> - - - -<0xBE> "> - -<0xA2>"> -<0xA3>"> - - - - - - - -"> - - - - time_t nseconds; - struct tm *timefoo; - int maxsize = 20; - char s[20]; - - nseconds = time(NULL); - timefoo = localtime(&nseconds); - strftime(s, maxsize, "%x", timefoo); - fprintf(outfile, "%s\n", s); -<\CODE> - - time_t nseconds; - struct tm *timefoo; - int maxsize = 20; - char s[20]; - - nseconds = time(NULL); - timefoo = localtime(&nseconds); - strftime(s, maxsize, "%X", timefoo); - fprintf(outfile, "%s\n", s); -<\CODE> - - - -/* entities for service documentation, not in doctype */ -/* -* -* -* -* -* -* -* -* -* -* -* -*/ -/**/ - -/* Code entities for toggling debugging traces */ - - m_malftrace = (LOGICAL) ! m_malftrace ; - <\CODE> - - - m_chtrace = (LOGICAL) ! m_chtrace ; - <\CODE> - - - m_cdtrace = (LOGICAL) ! m_cdtrace ; - <\CODE> - - - m_heapchk = (LOGICAL) ! m_heapchk ; - <\CODE> - - - tracetostd = (LOGICAL) ! tracetostd ; - <\CODE> - -/* This option pertains to automatic index processing only (called by the - scripts only), so we don't need it in pi's. - - - parentsrch = (LOGICAL) ! parentsrch ; - <\CODE> - -*/ - - - m_scantrace = (LOGICAL) ! m_scantrace ; - <\CODE> - - - m_tagtrace = (LOGICAL) ! m_tagtrace ; - <\CODE> - -/* This option does not pertain to a given document, so we don't - need it in pi's. - - - showmem = (LOGICAL) ! showmem ; - <\CODE> -*/ - -/* Code entities for MARKUP and HP Tag versions */ - - { - M_WCHAR *wc_1, *wc_2; - - wc_1 = MakeWideCharString(M_VERSION); - wc_2 = MakeWideCharString("m-markup-ver"); - m_piaction(wc_1, wc_2, M_SDATA) ; - m_free(wc_1,"wide character string"); - m_free(wc_2,"wide character string"); - } - <\CODE> - - - { - M_WCHAR *wc_1, *wc_2; - - wc_1 = MakeWideCharString(version); - wc_2 = MakeWideCharString("m-tagver"); - m_piaction(wc_1, wc_2, M_SDATA) ; - m_free(wc_1,"wide character string"); - m_free(wc_2,"wide character string"); - } - <\CODE> - - -#if defined(hpux) - { - M_WCHAR *wc_1, *wc_2; - - wc_1 = MakeWideCharString("HPUX"); - wc_2 = MakeWideCharString("m-machine"); - m_piaction(wc_1, wc_2, M_SDATA) ; - m_free(wc_1,"wide character string"); - m_free(wc_2,"wide character string"); - } -#else -#if defined(_AIX) - { - M_WCHAR *wc_1, *wc_2; - - wc_1 = MakeWideCharString("AIX"); - wc_2 = MakeWideCharString("m-machine"); - m_piaction(wc_1, wc_2, M_SDATA) ; - m_free(wc_1,"wide character string"); - m_free(wc_2,"wide character string"); - } -#else -#if defined(sun) - { - M_WCHAR *wc_1, *wc_2; - - wc_1 = MakeWideCharString("SUN"); - wc_2 = MakeWideCharString("m-machine"); - m_piaction(wc_1, wc_2, M_SDATA) ; - m_free(wc_1,"wide character string"); - m_free(wc_2,"wide character string"); - } -#else - m_piaction("UNDEFINED MACHINE", - "m-machine", - M_SDATA) ; -#endif -#endif -#endif - <\CODE> - -HP HelpTag Formatting System. - Version A.01.00 (DTD Version A.01.23) - -#define DEFINE -#include "global.h" -static char ident1[]="@(#)Help Tag Parser"; -static char ident2[]="@(#)Version Number: A.01.00"; -static char ident3[]="@(#)Copyright (c) 1993 Hewlett-Packard Company. All rights reserved."; - - -#include "global.h" - - - SEARCH *new ; - char *p ; - char *q ; - - /* Pick version number out of sign-on message */ - if (p = strstr(m_signon, VERSION)) { - p += strlen(VERSION) + 1 ; - for (q = p ; *q && *q != '\n'; q++) ; - if (*q == '\n') { - version = (char *) m_malloc(q - p + 1, "version") ; - *q = M_EOS ; - strcpy(version, p) ; - *q = '\n' ; - } - } - - /* Following: please refer to comments in custom.c, m_setoptions() */ - if (m_argc > 2) { - if ((strchr(m_argv[2], 'p')) || (strchr(m_argv[2], 'P'))) - parentsrch = TRUE ; /* Implies we are processing indexes */ - } - - helpcharset = MakeWideCharString("iso8859-1"); - - basename(); - - options(FALSE) ; - if (m_errexit && stoponerror) m_exit(m_errexit) ; - - if (indir) { - new = (SEARCH *) m_malloc(sizeof(SEARCH), "search path") ; - new->directory = indir ; - new->next = path ; - path = new ; - } - - - int i; - prebye = ftell(outfile) ; - fseek(outfile, texcomplete, SEEK_SET) ; - fseek(outfile, 0L, SEEK_END) ; - dumpxref() ; - if (glossary) checkgloss() ; - - /* end last node */ - fprintf(outfile, "\n"); - - /* finish topic map */ - - fputs("\n", topicmapfp); - while (lastnodelevel--) { - /* indent routine >here< */ - for (i = lastnodelevel; i > 0; i--) { fputs(" ", topicmapfp); } - fputs("}\n", topicmapfp); - } - - /* polish up .hmi file */ - if (!hadtitle) { - fprintf(docregfp, "*title:\t\"No title specified.\"\n"); - } - /* else -- handled in element title */ - - if (!hadabstract) { - fprintf(docregfp, "*abstract:\t\"No abstract specified."); - if (hadtitle) { - char *mb_savedtitle; - - mb_savedtitle = MakeMByteString(savedtitle); - fprintf(docregfp, " Title was ``%s''.", mb_savedtitle); - m_free(mb_savedtitle,"multi-byte string"); - } - fprintf(docregfp, "\"\n"); - } - /* else -- handled in element abstract */ - - fprintf(docregfp, "*version:\t\"%s\"\n", version); - - { - char *mb_charset; - - mb_charset = MakeMByteString(helpcharset); - fprintf(docregfp, "*charSet:\t%s\n", mb_charset); - m_free(mb_charset, "multi-byte string"); - } - - /* warn if we have forward xrefs */ - if (have_forward_xrefs) { - m_exit(77); - } - - - outchar(m_textchar, outfile) ; - - - outpi(m_enttype, m_pi, m_entname) ; - - - - - where = WHERE (QTOC = TOC, - QFOOTER = FOOTER, - QBOTH = BOTH) ; - - abbrev = TRUE ; - - abbrev = TRUE ; - fabbrev = (LOGICAL) - (! m_wcmbupstrcmp(where, QFOOTER) || - ! m_wcmbupstrcmp(where, QBOTH)) ; - if (fabbrev) { - didabbrev = TRUE ; - newhline = 0 ; - } - abbrev = TRUE ; - fputs("", outfile); - - abbrev = TRUE ; - - abbrev = TRUE ; - fabbrev = (LOGICAL) - (! m_wcmbupstrcmp(where, QFOOTER) || - ! m_wcmbupstrcmp(where, QBOTH)) ; - if (fabbrev) { - newhline = 0 ; - } - fputs("", outfile); - - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - - abbrev = TRUE ; - fabbrev = (LOGICAL) - (! m_wcmbupstrcmp(where, QFOOTER) || - ! m_wcmbupstrcmp(where, QBOTH)) ; - if (fabbrev) { - newhline = 0 ; - } - m_err2("Unimplemented %sABBREV%s reached", wc_stago, wc_tagc); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - - fabbrev = FALSE ; - abbrev = FALSE ; - - fabbrev = FALSE ; - abbrev = FALSE ; - fputs("\n", outfile); - - - - - M_WCHAR *wc_abstract; - - wc_abstract = MakeWideCharString("_ABSTRACT"); - - hadabstract = TRUE; - needabstracthead = TRUE; - starthelpnode(wc_abstract, TRUE); - fputs("*abstract:\t", docregfp); - m_free(wc_abstract,"wide character string"); - - fputs("\n", docregfp); - - outchar(m_textchar, outfile); - if (m_textchar == '\n') { - fputs(" \\\n", docregfp); - } - else { - char mb_textchar[32]; - int length; - - length = wctomb(mb_textchar, m_textchar); - mb_textchar[length] = '\0'; - fputs(mb_textchar, docregfp) ; - } - - - - if (echo) { - mb_echohead(m_stago); - echohead(m_parent(0)) ; - mb_echohead(m_net); - } - - if (echo) mb_echohead(m_net) ; - - - - - POPFONT ; - - indexchar(m_textchar) ; - - outchar(wc_toupper(m_textchar), outfile) ; - - - - fputs("\n", outfile); - - fputs("\n", outfile); - - - - id = ID ; - letter = LETTER ; - include = INCLUDE; - exclude = EXCLUDE; - - appstart(id, letter) ; - thisnodelevel = 1; - starthelpnode(id, FALSE); - - rseqend() ; - endhelpnode(); - - - - - unimp(m_parent(0)) ; - /* when implementing: */ - /* (1) Don't forget need begin/end */ - /* (2) Check code for */ - /* (3) Suppression of need between head and text? */ - /* (4) Consider if missing rev end check needed */ - - - outfile = m_outfile; - - - - - - char *string = - GetDefaultHeaderString("BinderNumberElementDefaultHeadingString", - M_SDATA, - "Binder Number"); - - mb_starthelpnode("_BINDERNO", TRUE); - fprintf(outfile, -"<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", - string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - mb_strcode("", outfile) ; - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - - mb_strcode("", outfile) ; - if (echo) mb_echohead(m_net) ; - - - - - indexchar(m_textchar) ; - - - - figcaption = TRUE ; - newhline = 0 ; - savhd = TRUE ; - hderr = FALSE ; - svheadlen = 0 ; - tooutput = TRUE ; - fputs("", outfile); - - savehead[svheadlen] = M_EOS ; - savhd = FALSE ; - tooutput = TRUE ; - fputs("", outfile); - - - - callno = CALLNO ; - - - - - STARTSTUFF - /* In a tight list, paragraphs will have no trailing blank line. - * To match HPTag behavior, we need to emit a blank line and - * supress the leading blank line of the next paragraph, figure, - * example, etc., if any. - */ - ncwTightList = ""; - if ((lastlist->lastlist->space == TIGHT) && - (lastlist->lastlist->where == INSIDE)) { - ncwTightList = " before 1"; - } - - rshnewclear() ; - notehead = FALSE ; - - STARTSTUFF - ncwTightList = ""; - rshnewclear() ; - notehead = FALSE ; - - fputs("\n\n", outfile); - lastlist->lastlist->where = FOLLOW; /* supress leading newline */ - - fputs("\n\n", outfile); - - - - - - file = ENTITY ; - startrow = STARTROW ; - endrow = ENDROW ; - clip = CLIP ; - margin = MARGIN ; - - - - /* ignore data chars meant only for cdrom */ - /* we need CDROMsaveoutfile and can't just say m_outfile, - since we may be inside a table that has already - been sending things to nullfile and it would be incorrect - to start sending to m_outfile now. I.e., if outfile is - currently nullfile, we keep sending to nullfile in the - end-code*/ - CDROMsaveoutfile = outfile; - outfile = nullfile; - - /* OK, let the data flow. CDROM is ending. */ - outfile = CDROMsaveoutfile; - - - - style = CELLSPEC ; - span = SPAN ; - vspan = VSPAN ; - - - - emsghead = USERHEAD ; - - - - id = ID ; - number = NUMBER ; - include = INCLUDE ; - exclude = EXCLUDE ; - - assert_hometopic_exists(); - chapstart(id, number, "chapter") ; /* opens new help file, too */ - thisnodelevel = 1; - starthelpnode(id, FALSE); - - rseqend() ; - endhelpnode(); - - - - if (echo) mb_echohead("((") ; - mb_strcode("(", outfile) ; - outchar (m_textchar, outfile) ; - mb_strcode(")", outfile) ; - if (echo) mb_echohead("))") ; - - - - indexchar('('); - indexchar(m_textchar) ; - indexchar(')'); - - - - - - - - - - - - - - style = CELLSPEC ; - vspan = VSPAN ; - span = SPAN ; - - - - - - mb_strcode("", outfile); - if (echo) mb_echohead("``") ; - - POPFONT ; - mb_strcode("", outfile); - if (echo) mb_echohead("''") ; - - esoutchar(m_textchar) ; - - exoutchar(m_textchar) ; - - exoutchar(m_textchar) ; - - - - - indexchar(m_textchar) ; - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - mb_starthelpnode("_CONVENTIONS", TRUE); - - - - mb_starthelpnode("_COPYRIGHT", TRUE); - fprintf(outfile, "\n"); - /* No Head. Let author have a clean slate. */ - - - - char *string = - GetDefaultHeaderString("CountryElementDefaultHeadingString", - M_SDATA, - "Country"); - - mb_starthelpnode("_COUNTRY", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - - - file = ENTITY ; - graphics = GRAPHICS (QNOGRAPHICS = NOGRAPHICS, - QGRAPHICS = GRAPHICS) ; - width = WIDTH ; - height = HEIGHT ; - - - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - - if (echo) mb_echohead(m_net) ; - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - - esoutchar(m_textchar) ; - - - - - - char *mb_parent; - - mb_parent = MakeMByteString(m_parent(0)); - notimp(mb_parent, "BIG/SMALL page styles") ; - m_free(mb_parent,"multi-byte string"); - - outfile = m_outfile ; - - - - type = TYPE (QKEYS2 = KEYS2, - QCOMMAND = COMMAND) ; - graphics = GRAPHICS (QNOGRAPHICS = NOGRAPHICS, - QGRAPHICS = GRAPHICS) ; - displines = DISPLINES (QTWO = TWO, - QFOUR = FOUR, - QEIGHT = EIGHT, - QOTHER = OTHER) ; - - char *mb_parent; - - mb_parent = MakeMByteString(m_parent(0)); - notimp(mb_parent, "BIG/SMALL page styles") ; - m_free(mb_parent,"multi-byte string"); - - outfile = m_outfile ; - - - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - - if (echo) mb_echohead(m_net) ; - - esoutchar(m_textchar) ; - - exoutchar(m_textchar) ; - - - - - indexchar(m_textchar) ; - - - - calcqrgwidth = CALCQRGWIDTH ; - ctbltype = CTBLTYPE (QKEYS2 = KEYS2, - QCOMMAND = COMMAND) ; - ctblgraphics = CTBLGRAPHICS (QNOGRAPHICS = NOGRAPHICS, - QGRAPHICS = GRAPHICS) ; - ctbldisplines = CTBLDISPLINES (QTWO = TWO, - QFOUR = FOUR, - QEIGHT = EIGHT, - QOTHER = OTHER) ; - extype = EXTYPE (QCOMPUTER = COMPUTER, - QDISPLAY = DISPLAY) ; - expos = EXPOS (QLEFT = LEFT, - QINDENT = INDENT, - QCENTER = CENTER) ; - exnotes = EXNOTES (QSIDE = SIDE, - QSTACK = STACK) ; - exlines = EXLINES (QNUMBER = NUMBER, - QNONUMBER = NONUMBER) ; - extextsize = EXTEXTSIZE (QNORMAL = NORMAL, - QSMALLER = SMALLER, - QSMALLEST = SMALLEST) ; - gloss = GLOSS (QGLOSS = GLOSS, - QNOGLOSS = NOGLOSS) ; - type = LISTTYPE (QORDER = ORDER, - QBULLET = BULLET, - QPLAIN = PLAIN, - QMILSPEC = MILSPEC, - QCHECK = CHECK) ; - order = LISTORDERTYPE (QUALPHA = UALPHA, - QLALPHA = LALPHA, - QARABIC = ARABIC, - QUROMAN = UROMAN, - QLROMAN = LROMAN) ; - spacing = LISTSPACING (QTIGHT = TIGHT, - QLOOSE = LOOSE) ; - longlabel = LONGLABEL (QWRAP = WRAP, - QNOWRAP = NOWRAP) ; - labelwidth = LABELWIDTH ; - tableborder = TABLEBORDER (QBOX = BOX, - QNOBOX = NOBOX) ; - tablerule = TABLERULE ; - allvr = TABLEALLVR ; - allhr = TABLEALLHR ; - tablevr = TABLEVR ; - tablehr = TABLEHR ; - tablespacing = TABLESPACING (QTIGHT = TIGHT, - QLOOSE = LOOSE) ; - tablepos = TABLEPOS (QLEFT = LEFT, - QINDENT = INDENT, - QCENTER = CENTER) ; - tabwidth = TABLEWIDTH (QFULL = FULL) ; - tabletextsize = TABLETEXTSIZE (QNORMAL = NORMAL, - QSMALLER = SMALLER, - QSMALLEST = SMALLEST) ; - notab = NUMBERTABLES (QNUMBER = NUMBER, - QNONUMBER = NONUMBER) ; - figtype = FIGTYPE (QART = ART, - QPCL = PCL, - QTIFF = TIFF, - QTIF = TIF, - QLISTING = LISTING, - QTEXT = TEXT, - QHPGL = HPGL, - QHPG = HPG) ; - oldfigtype = OLDFIGTYPE (QART = ART, - QPCL = PCL, - QTIFF = TIFF, - QLISTING = LISTING, - QTEXT = TEXT) ; - figmagnify = FIGMAGNIFY (QFIT = FIT) ; - figwidth = FIGWIDTH (QFULL = FULL, - QTEXT = TEXT, - QCURRENT = CURRENT) ; - figheight = FIGHEIGHT (QNATURAL = NATURAL) ; - figborder = FIGBORDER (QTOP = TOP, - QBOTTOM = BOTTOM, - QBOX = BOX, - QSCREEN = SCREEN, - QNOBOX = NOBOX); - figvideo = FIGVIDEO (QINVERSE = INVERSE, - QNOINVERSE = NOINVERSE) ; - figstrip = FIGSTRIP (QSTRIP = STRIP, - QNOSTRIP = NOSTRIP) ; - figmargin = FIGMARGIN ; - figclip = FIGCLIP ; - figpenwidth = FIGPENWIDTH ; - figsnap = FIGSNAP (QSNAP = SNAP, - QNOSNAP = NOSNAP) ; - figautoscale = FIGAUTOSCALE (QAUTOSCALE = AUTOSCALE, - QNOAUTOSCALE = NOAUTOSCALE) ; - figplottype = FIGPLOTTYPE ; - listtextsize = LISTTEXTSIZE (QNORMAL = NORMAL, - QSMALLER = SMALLER, - QSMALLEST = SMALLEST) ; - nofig = NUMBERFIGS (QNUMBER = NUMBER, - QNONUMBER = NONUMBER) ; - eqn = EQN (QTEX = TEX) ; - rsectp = RSECTPAGEBREAK (QNEWPAGE = NEWPAGE, - QSAMEPAGE = SAMEPAGE) ; - - - - fputs("\n\n", outfile); - - - - /* we are not handling calculator here */ - - mb_strcode("", outfile); - if (echo) mb_echohead("::") ; - - POPFONT ; - mb_strcode("", outfile); - if (echo) mb_echohead("::") ; - - esoutchar(m_textchar) ; - - exoutchar(m_textchar) ; - - - - - indexchar(m_textchar) ; - - - - termp = term ; - tooutput = FALSE; - - M_WCHAR *p ; - tooutput = TRUE; - *termp = M_EOS ; - /* trim possible (perhaps) last space */ - if (termp - term > 1 && *(termp-1) == ' ') { - *(termp-1) = M_EOS; - } - if (m_ntrtrie(term, >ree, (M_TRIE *) DEFINETERM)) { - if (! m_resettrie(>ree, term, (M_TRIE *) DEFINETERM)) { - m_error("Internal error. Can't reset glossary trie") ; - m_exit(TRUE) ; - } - } - fputs("", outfile); - /* handle .idt file, too */ - { - char *mb_nodeid; - - mb_nodeid = MakeMByteString(nodeid); - fprintf(idtablefp, "%s> ", mb_nodeid); - m_free(mb_nodeid,"multi-byte string"); - } - for (p = term; *p ; p++) { - if (*p == ' ') { - fputc('_', idtablefp); - } - else { - M_WCHAR uwc; - char mb_uwc[32]; /* arbitrarily large */ - int length; - - uwc = wc_toupper(*p); - length = wctomb(mb_uwc, uwc); - mb_uwc[length] = '\0'; - fputs(mb_uwc, idtablefp); - } - } - fputs("_DEF\n", idtablefp); - /* end */ - fputs("", outfile); - for(p = term; *p; p++) { - outchar(*p, outfile) ; - } - fputs("", outfile); - - termchar(m_textchar) ; - - termpi(m_enttype, m_pi, m_entname) ; - - - - char *string = - GetDefaultHeaderString("EditionElementDefaultHeadingString", - M_SDATA, - "Edition"); - - mb_starthelpnode("_EDITION", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - mb_strcode("", outfile) ; - if (echo) mb_echohead("!!") ; - - mb_strcode("", outfile) ; - if (echo) mb_echohead("!!") ; - - - - - indexchar(m_textchar) ; - - - - mb_starthelpnode("_ENTRYPOINTSET", TRUE); - fprintf(outfile, "%s\n\n", "Entrypointset"); - - - - - - formatter = FORMATTER (QTEX = TEX) ; - - fputs("", outfile); - unimp(m_parent(0)) ; - - fputs("\n", outfile); - - - - - - indexchar(m_textchar) ; - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - - if (echo) mb_echohead(m_net) ; - - - - type = TYPE (QCOMPUTER = COMPUTER, - QDISPLAY = DISPLAY) ; - position = POSITION (QLEFT = LEFT, - QINDENT = INDENT, - QCENTER = CENTER) ; - notes = NOTES (QSIDE = SIDE, - QSTACK = STACK) ; - width = WIDTH ; - lines = LINES (QNUMBER = NUMBER, - QNONUMBER = NONUMBER) ; - textsize = TEXTSIZE (QNORMAL = NORMAL, - QSMALLER = SMALLER, - QSMALLEST = SMALLEST) ; - - /* In a tight list, paragraphs will have no trailing blank line. - * To match HPTag behavior, we need to emit a blank line and - * supress the leading blank line of the next paragraph, figure, - * example, etc., if any. - */ - char *listinfo; - - listinfo = ""; - if ((lastlist->lastlist->space == TIGHT) && - (lastlist->lastlist->where == INSIDE)) { - listinfo = " before 1"; - } - - exvexstart(type, textsize, listinfo); - tonumexlines = (LOGICAL) (vnumber(lines) == NUMBER); - exlineno = 1 ; - - exvexstart(type, textsize, "") ; - tonumexlines = (LOGICAL) (vnumber(lines) == NUMBER); - exlineno = 1 ; - - /* Clear tonumexlines for other elements (e.g., image) which may - follow */ - tonumexlines = FALSE ; - exvexend(textsize); - lastlist->lastlist->where = FOLLOW; /* supress leading newline */ - - /* Clear tonumexlines for other elements (e.g., image) which may - follow */ - tonumexlines = FALSE ; - exvexend(textsize); - - - - if (tonumexlines) fprintf(outfile, " %d: ", exlineno) ; - - exlineno++ ; - - exoutchar(m_textchar) ; - - - - - - char *string = - GetDefaultHeaderString("FichenoElementDefaultHeadingString", - M_SDATA, - "Ficheno"); - - mb_starthelpnode("_FICHENO", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - if (ftype != ART) - { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err3("%s%s%s allowed only in ART figures", - wc_stago, - m_parent(0), - wc_tagc) ; - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - fignote = TRUE ; - - - - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - if (ftype != TEXT) - { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err3("%s%s%s allowed only in TEXT figures", - wc_stago, - m_parent(0), - wc_tagc) ; - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - - - - number = NUMBER ; - tonumber = TONUMBER (QNUMBER = NUMBER, - QNONUMBER = NONUMBER) ; - id = ID ; - file = ENTITY ; - figpos = FIGPOS (QLEFT = LEFT, - QCENTER = CENTER, - QRIGHT = RIGHT) ; - cappos = CAPPOS (QLEFT = LEFT, - QCENTER = CENTER, - QRIGHT = RIGHT) ; - oldtype = OLDTYPE (QART = ART, - QPCL = PCL, - QTIFF = TIFF, - QLISTING = LISTING, - QTEXT = TEXT) ; - xwidth = WIDTH (QFULL = FULL, - QTEXT = TEXT, - QCURRENT = CURRENT) ; - xdepth = HEIGHT (QNATURAL = NATURAL) ; - xhadjust = HADJUST ; - xvadjust = VADJUST ; - border = BORDER (QTOP = TOP, - QBOTTOM = BOTTOM, - QBOX = BOX, - QSCREEN = SCREEN, - QNOBOX = NOBOX) ; - type = TYPE (QART = ART, - QPCL = PCL, - QTIFF = TIFF, - QTIF = TIF, - QLISTING = LISTING, - QTEXT = TEXT, - QHPGL = HPGL, - QHPG = HPG); - xmagnify = MAGNIFY (QFIT = FIT) ; - video = VIDEO (QINVERSE = INVERSE, - QNOINVERSE = NOINVERSE) ; - strip = STRIP (QSTRIP = STRIP, - QNOSTRIP = NOSTRIP) ; - mirror = MIRROR (QMIRROR = MIRROR) ; - margin = MARGIN ; - clip = CLIP ; - penwidth = PENWIDTH ; - snap = SNAP (QSNAP = SNAP, - QNOSNAP = NOSNAP) ; - autoscale = AUTOSCALE (QAUTOSCALE = AUTOSCALE, - QNOAUTOSCALE = NOAUTOSCALE) ; - plottype = PLOTTYPE ; - callout = CALLOUT ; - textsize = TEXTSIZE (QNORMAL = NORMAL, - QSMALLER = SMALLER, - QSMALLEST = SMALLEST) ; - ghyperlink = GHYPERLINK ; - glinktype = GLINKTYPE (QJUMP = JUMP, - QJUMPNEWVIEW = JUMPNEWVIEW, - QDEFINITION = DEFINITION, - QEXECUTE = EXECUTE, - QAPPDEFINED = APPDEFINED, - QMAN = MAN) ; - gdescription = GDESCRIPTION ; - - /* In a tight list, paragraphs will have no trailing blank line. - * To match HPTag behavior, we need to emit a blank line and - * supress the leading blank line of the next paragraph, figure, - * example, etc., if any. - */ - char *listinfo; - - listinfo = ""; - if ((lastlist->lastlist->space == TIGHT) && - (lastlist->lastlist->where == INSIDE)) { - listinfo = " before 1"; - } - - figure(number, - tonumber, - id, - file, - figpos, - cappos, - oldtype, - xwidth, - xdepth, - xhadjust, - xvadjust, - border, - type, - xmagnify, - video, - strip, - mirror, - margin, - clip, - penwidth, - snap, - autoscale, - plottype, - callout, - textsize, - ghyperlink, - glinktype, - gdescription, - listinfo); - - figure(number, - tonumber, - id, - file, - figpos, - cappos, - oldtype, - xwidth, - xdepth, - xhadjust, - xvadjust, - border, - type, - xmagnify, - video, - strip, - mirror, - margin, - clip, - penwidth, - snap, - autoscale, - plottype, - callout, - textsize, - ghyperlink, - glinktype, - gdescription, - ""); - - fputs("\n
\n\n\n", outfile); - if (id) { - /* id handling */ - char *mb_nodeid, *mb_id; - - mb_nodeid = MakeMByteString(nodeid); - mb_id = MakeMByteString(id); - fprintf(idtablefp, "%s> %s\n", mb_nodeid, mb_id); - m_free(mb_nodeid,"multi-byte string"); - m_free(mb_id,"multi-byte string"); - } - lastlist->lastlist->where = FOLLOW; /* supress leading newline */ - - fputs("\n\n\n\n", outfile); - if (id) { - /* id handling */ - char *mb_nodeid, *mb_id; - - mb_nodeid = MakeMByteString(nodeid); - mb_id = MakeMByteString(id); - fprintf(idtablefp, "%s> %s\n", mb_nodeid, mb_id); - m_free(mb_nodeid,"multi-byte string"); - m_free(mb_id,"multi-byte string"); - } - - - - - length = LENGTH (QEND = END) ; - - if (m_wcmbupstrcmp(length, QEND)) - { - char *mb_parent; - - mb_parent = MakeMByteString(m_parent(0)); - if (mb_checkdimen( length, "LENGTH", mb_parent )) - { - /* check for negative values */ - M_WCHAR wmi; - - mbtowc(&wmi, "-", 1); - if (w_strchr(length, wmi)) - { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err3("Negative value [%s] for %sFILLIN%s, positive assumed", - length, - wc_stago, - wc_tagc) ; - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - } - m_free(mb_parent,"multi-byte string"); - } - - - - /* Headers and footers make no sense to Cache Creek; throw away - * all content. We could do this with empty text-code here and - * context sensitive empty text-code in all elements of the model - * group that define their own text-code but that's really error - * prone and difficult to maintain. - */ - HFsaveoutfile = outfile; - outfile = nullfile; - - outfile = HFsaveoutfile; - - - /* When implementing, check conditionals of in

*/ - - outchar(m_textchar, outfile) ; - - footnoteno++; - POPFONT; - - - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - if (!had_an_otherfront_head) { - endhead(); - } - - - - char *string = - GetDefaultHeaderString("GlossaryElementDefaultHeadingString", - M_SDATA, - "Glossary"); - - open_new_helpfile(); - thisnodelevel = 1; - mb_starthelpnode("_GLOSSARY", FALSE); - strcpy(chapstring, string) ; - if (strlen(chapstring) + 1 > sizeof(chapstring)) { - m_error("Program error: exceeded chapstring") ; - m_exit(TRUE) ; - } - fputs("\nGlossary\n", stderr) ; - glossary = TRUE ; - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n", string) ; - m_free(string, "default header string return"); - - endhelpnode(); - - - - id = ID ; - file = ENTITY ; - - unsigned char etype, wheredef ; - /* Code from figstart */ - if (id) { - mbstowcs(xrefstring, "\\", 400); - xstrlen = w_strlen(xrefstring) ; - m_getline(&xrffile, &xrfline) ; - if (xrffile == NULL) { - /* set to primary input source */ - xrffile = inputname; - } - setid(id, - TRUE, - FALSE, - inchapter, - chapstring, - xrffile, - xrfline, - FALSE) ; - - { - char *mb_nodeid, *mb_id; - - mb_nodeid = MakeMByteString(nodeid); - mb_id = MakeMByteString(id); - fprintf(idtablefp, "%s> %s\n", mb_nodeid, mb_id); - m_free(mb_nodeid,"multi-byte string"); - m_free(mb_id,"multi-byte string"); - } - } - /* initialize some stuff first: - - file is the entity name, - - f_file is the content of the entity, - used only if f_content nonNULL - - f_content is f_file with the relative pathname, initialized to NULL, - - f_contqual is fully qualified f_file, assigned ONLY IF - f_content nonNULL - */ - file_ent = FALSE ; - f_content = NULL ; - f_contqual[0] = M_EOS ; - - /* check ENTITY and determine the figure type */ - if (file) { - m_lookent(file, &etype, &f_file, &wheredef) ; - if (etype != M_SYSTEM) { - M_WCHAR *wc_stago, *wc_tagc, *wc_entsystem, *wc_entkw; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - wc_entsystem = MakeWideCharString(m_entsystem); - wc_entkw = MakeWideCharString(m_entkw); - m_err6("%s not a %s %s, as required for the ENTITY parameter of %s%s%s", - file, - wc_entsystem, - wc_entkw, - wc_stago, - m_parent(0), - wc_tagc) ; - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - m_free(wc_entsystem,"wide character string"); - m_free(wc_entkw,"wide character string"); - } - else { - file_ent = TRUE ; - f_content = searchforfile(f_file) ; - if (f_content) { - if (getqualified(f_contqual, f_content)) { - /* unsuccessful qual */ - if (w_strlen(f_content) < FNAMELEN) - w_strcpy(f_contqual, f_content) ; - else { - m_err1("Internal error. File name too long: %s", f_content) ; - m_exit(m_errexit) ; - } - } - } - else { - m_err2("Can't find file %s (declared in entity %s)", f_file, file) ; - } - } - } - - { - char *mb_content; - static M_WCHAR empty = M_EOS; - - if (!f_content) f_content = ∅ - - mb_content = MakeMByteString(f_content); - fprintf(outfile, "", outfile); - - - - char *string = - GetDefaultHeaderString("HardwareElementDefaultHeadingString", - M_SDATA, - "Hardware"); - - mb_starthelpnode("_HARDWARE", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - newhline = 0 ; - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - -/* Accent headings */ - - notehead = TRUE ; - newhline = 0 ; - fprintf(outfile, ncwStart, ncwTightList); -/* Other headings */ - - newhline = 0 ; - fputs("", outfile); -/* Other headings */ - - newhline = 0 ; - fputs("", outfile); -/* Other headings */ - - newhline = 0 ; - fputs("", outfile); -/* Node headings */ - - newhline = 0 ; - echo = TRUE ; - savhd = TRUE ; - hderr = FALSE ; - svheadlen = 0 ; - fputs("<TYPE serif><WEIGHT bold><SIZE 14>", outfile); -/* Non node headings */ - <START-CODE OTHERHEAD, CHAPHEAD RSUB, CHAPHEAD MSGSUB> - newhline = 0 ; - echo = TRUE ; - savhd = TRUE ; - hderr = FALSE ; - svheadlen = 0 ; - fputs("<PARAGRAPH><TYPE serif><WEIGHT bold><SIZE 12>", outfile); -/* Other headings */ /* notably procedure */ - <START-CODE CHAPHEAD PROCEDURE> - newhline = 0 ; - echo = TRUE ; - savhd = TRUE ; - hderr = FALSE ; - svheadlen = 0 ; - fputs("<PARAGRAPH><TYPE serif><WEIGHT bold>", outfile); -/* Other headings */ - <START-CODE CHAPHEAD> - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err2("Unimplemented %sCHAPHEAD%s reached", wc_stago, wc_tagc); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); -/* Node heading */ - <START-CODE PART> -/* Non-node headings */ - <START-CODE FRONTSUB> - echo = TRUE ; - newhline = 0 ; - fputs("<PARAGRAPH><TYPE serif><WEIGHT bold><SIZE 12>", outfile); -/* Non-node headings */ - <START-CODE LEGAL, SAFETY, MAP, ABSTRACT, PREFACE, CONVENTIONS, HISTORY> - echo = TRUE ; - newhline = 0 ; - needabstracthead = FALSE; - fputs("<TITLE><TYPE serif><WEIGHT bold><SIZE 12>", outfile); -/* Node headings */ - <START-CODE OTHERFRONT> - had_an_otherfront_head = TRUE; - newhline = 0 ; - echo = TRUE ; - savhd = TRUE ; - hderr = FALSE ; - svheadlen = 0 ; - fputs("<TITLE><TYPE serif><WEIGHT bold><SIZE 14>", outfile); -/* Node headings.*/ - <START-CODE MESSAGE> - echo = TRUE ; - newhline = 0 ; - /* Check MESSAGE, MSGSUB, BIBLIO, BIBSUB when implementing need begin */ - fputs("<TITLE><TYPE serif><WEIGHT bold><SIZE 14>", outfile); -/* Other headings.*/ - <START-CODE BIBLIO, BIBSUB> - echo = TRUE ; - newhline = 0 ; - /* Check MESSAGE, MSGSUB, BIBLIO, BIBSUB when implementing need begin */ - fputs("<PARAGRAPH><TYPE serif><WEIGHT bold><SIZE 12>", outfile); -/* Accent headings */ - <END-CODE NOTE> - char *iconName = - GetDefaultHeaderString("NoteElementDefaultIconFile", M_SYSTEM, ""); - - fprintf(outfile, ncwEnd, ""); - if (*iconName) - { - fprintf(outfile, ncwGraphic, iconName); - m_free(iconName, "icon name"); - } - <END-CODE CAUTION> - char *iconName = - GetDefaultHeaderString("CautionElementDefaultIconFile", M_SYSTEM, ""); - - fprintf(outfile, ncwEnd, ""); - if (*iconName) - { - fprintf(outfile, ncwGraphic, iconName); - m_free(iconName, "icon name"); - } - <END-CODE WARNING> - char *iconName = - GetDefaultHeaderString("WarningElementDefaultIconFile", M_SYSTEM, ""); - - fprintf(outfile, ncwEnd, ""); - if (*iconName) - { - fprintf(outfile, ncwGraphic, iconName); - m_free(iconName, "icon name"); - } -<END-CODE> - fputs("\n\n", outfile); -/* Other headings */ - <END-CODE P> - fputs("</WEIGHT></TYPE></PARAGRAPH>\n\n", outfile); -/* Other headings */ - <END-CODE LIST, LABLIST, EX, SYNTAX> - fputs("</WEIGHT></TYPE></PARAGRAPH>\n\n", outfile); -/* Other headings */ - <END-CODE IMAGE> - fputs("</WEIGHT></TYPE></PARAGRAPH>\n\n", outfile); -/* Non node headings */ - <END-CODE FRONTSUB> - echo = FALSE ; - fputs("</SIZE></WEIGHT></TYPE></PARAGRAPH>\n\n", outfile); -/* Non node headings */ - <END-CODE LEGAL, SAFETY, MAP, ABSTRACT, PREFACE, CONVENTIONS, HISTORY> - echo = FALSE ; - fputs("</SIZE></WEIGHT></TYPE>\n\n", outfile); -/* Node headings. */ - - endhead() ; - fputs("\n", outfile); -/* Node headings. */ - - echo = FALSE ; - fputs("\n", outfile); -/* Other headings. */ - - echo = FALSE ; - fputs("\n\n", outfile); -/* Other headings */ - - endhead() ; - fputs("\n\n", outfile); -/* Non node headings */ - - endhead() ; - fputs("\n\n", outfile); - - endhead() ; - fputs("\n\n", outfile); -/* Node headings */ - - endhead() ; - fputs("\n", outfile); - - - endhead() ; - fputs("\n", outfile); - - endhead() ; - fputs("\n", outfile); - - endhead() ; - fputs("\n", outfile); - - outchar(m_textchar, outfile) ; - - - - /* Headers and footers make no sense to Cache Creek; throw away - * all content. We could do this with empty text-code here and - * context sensitive empty text-code in all elements of the model - * group that define their own text-code but that's really error - * prone and difficult to maintain. - */ - HFsaveoutfile = outfile; - outfile = nullfile; - - outfile = HFsaveoutfile; - - - - author = AUTHOR ; - language = LANGUAGE (QENGLISH = ENGLISH, - QNORWEGIAN = NORWEGIAN, - QSWEDISH = SWEDISH, - QDANISH = DANISH, - QFINNISH = FINNISH, - QDUTCH = DUTCH, - QFRENCH = FRENCH, - QGERMAN = GERMAN, - QITALIAN = ITALIAN, - QSPANISH = SPANISH) ; - idxvol = IDXVOL ; - status = STATUS ; - - thisnodelevel = 0; - - mb_starthelpnode("_VERYTOP", TRUE); - manustart(language, idxvol, status) ; - - endhelpnode(); - - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - mb_starthelpnode("_HISTORY", TRUE); - - - - if (newhline == MAXHEADLINES) - m_error("Too many lines in header") ; - fputs("\n", outfile); - - if (newhline == MAXHEADLINES) - m_error("Too many lines in footer") ; - if (newhline++) fputs("\n", outfile) ; - - if (fabbrev) { - if (newhline++) { - fputs("\n", outfile); - } - } - - if (newhline++) - mb_shstring("\n", - &svheadlen, - (sizeof(savehead) / sizeof(M_WCHAR)), - savehead, - "Too many characters in head or caption", - &hderr) ; - - - - if (newhline++) { - fputs(" ", stderr) ; - fputs("", outfile) ; - if (savid) shchar(' ', - &xstrlen, - (sizeof(xrefstring) / sizeof(M_WCHAR)), - xrefstring, - idstring, - "Too many characters in corresponding cross-reference", - &iderr) ; - shchar(' ', - &svheadlen, - (sizeof(savehead) / sizeof(M_WCHAR)), - savehead, - svhdstring, - "Too many characters in head or caption", - &hderr) ; - } - - if (newhline++) { - fputs("", outfile) ; - fputs("\\\n", docregfp) ; - } - - if (newhline++) fputc(' ', outfile) ; - - putc('\n', stderr) ; - - putc('\n', stderr) ; - fputs("\\\n\\\n", docregfp) ; - - - - - - mb_starthelpnode("_HOMETOPIC", FALSE); - nohometopic = FALSE; - - - - rule = RULE (QNORULE = NORULE, - QRULE = RULE, - QBLANK = BLANK) ; - - - - - - - - - - - main = MAIN ; - range = RANGE (QBEGIN = BEGIN, - QEND = END) ; - - have_index = TRUE ; - print[0] = '\0'; - subprint[0] = '\0'; - sort[0] = '\0'; - subsort[0] = '\0'; - - /* ignore 's in cache creek */ - if (!range || (range && m_wcmbupstrcmp(range, QEND)) ) - { /* sort field */ - char *mb_print, *mb_nodeid; - M_WCHAR *pwc, wnl, wsp; - - mbtowc(&wnl, "\n", 1); - mbtowc(&wsp, " ", 1); - - pwc = print; - while (pwc = w_strchr(pwc, wnl)) - *pwc = wsp; - mb_print = MakeMByteString(print); - if (w_strlen(sort) > 0) - { /* use sort[] */ - char *mb_sort; - - pwc = sort; - while (pwc = w_strchr(pwc, wnl)) - *pwc = wsp; - mb_sort = MakeMByteString(sort); - if (w_strlen(subsort) > 0 || w_strlen(subprint) > 0) - { - /* append subsort or subprint */ - char *mb_sub; - M_WCHAR *pwcSub; - - pwcSub = (w_strlen(subsort) > 0) ? subsort : subprint; - pwc = pwcSub; - while (pwc = w_strchr(pwc, wnl)) - *pwc = wsp; - mb_sub = MakeMByteString(pwcSub); - fprintf(indexfp, "%s, %s", mb_sort, mb_sub); - m_free(mb_sub,"multi-byte string"); - } - else - { /* plain sort */ - fprintf(indexfp, "%s", mb_sort); - } - m_free(mb_sort,"multi-byte string"); - } - else - { /* use print field */ - if (w_strlen(subsort) > 0 || w_strlen(subprint) > 0) - { - /* append subsort or subprint */ - char *mb_sub; - M_WCHAR *pwcSub; - - pwcSub = (w_strlen(subsort) > 0) ? subsort : subprint; - pwc = pwcSub; - while (pwc = w_strchr(pwc, wnl)) - *pwc = wsp; - mb_sub = MakeMByteString(pwcSub); - fprintf(indexfp, "%s, %s", mb_print, mb_sub); - m_free(mb_sub,"multi-byte string"); - } - else - { /* plain print */ - fprintf(indexfp, "%s", mb_print); - } - } - putc('\036', indexfp); - - /* print field */ - if (w_strlen(subprint) > 0) - { - char *mb_subprint; - - pwc = subprint; - while (pwc = w_strchr(pwc, wnl)) - *pwc = wsp; - mb_subprint = MakeMByteString(subprint); - fprintf(indexfp, "%s, %s", mb_print, mb_subprint); - m_free(mb_subprint,"multi-byte string"); - } - else - { - fprintf(indexfp, "%s", mb_print); - } - m_free(mb_print,"multi-byte string"); - putc('\036', indexfp); - - /* id field */ - - pwc = nodeid; - while (pwc = w_strchr(pwc, wnl)) - *pwc = wsp; - mb_nodeid = MakeMByteString(nodeid); - fprintf(indexfp, "%s", mb_nodeid); - m_free(mb_nodeid,"multi-byte string"); - putc('\036', indexfp); - putc('\n', indexfp); - } - - indexchar(m_textchar) ; - - - - - - main = MAIN ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - have_index = TRUE ; - print[0] = '\0'; - subprint[0] = '\0'; - sort[0] = '\0'; - subsort[0] = '\0'; - - indexchar(m_textchar) ; - - - - indent = INDENT ; - id = ID; - gentity = GENTITY ; - gposition = GPOSITION (QLEFT = LEFT, - QRIGHT = RIGHT) ; - ghyperlink = GHYPERLINK ; - glinktype = GLINKTYPE (QJUMP = JUMP, - QJUMPNEWVIEW = JUMPNEWVIEW, - QDEFINITION = DEFINITION, - QEXECUTE = EXECUTE, - QAPPDEFINED = APPDEFINED, - QMAN = MAN) ; - gdescription = GDESCRIPTION ; - /* - = NUMBER ; - */ - - STARTSTUFF - indentp = indent; - imagegentityp = gentity; - imagegpositionp = gposition; - imageghyperlinkp = ghyperlink; - imageglinktypep = glinktype; - imagegdescription = gdescription; - rshnewclear() ; - parspace(); - if (id) { - if (imageId) - m_free(imageId,"multi-byte string"); - imageId = MakeMByteString(id); - mbstowcs(xrefstring, "\\", 400); - xstrlen = w_strlen(xrefstring) ; - m_getline(&xrffile, &xrfline) ; - if (xrffile == NULL) { - /* set to primary input source */ - xrffile = inputname; - } - setid(id, - TRUE, - FALSE, - inchapter, - chapstring, - xrffile, - xrfline, - FALSE) ; - - { - char *mb_nodeid, *mb_id; - - mb_nodeid = MakeMByteString(nodeid); - mb_id = MakeMByteString(id); - fprintf(idtablefp, "%s> %s\n", mb_nodeid, mb_id); - m_free(mb_nodeid,"multi-byte string"); - m_free(mb_id,"multi-byte string"); - } - } - - exoutchar(m_textchar) ; - - - - M_WCHAR *wc_image; - - fputs("", outfile); - - fputs("\n\n", outfile); - - - - - - - - idxsavlen = 0; - didsort = FALSE; - - /* capture saved term unless got it already */ - if (! didsort) { - idxsav[idxsavlen] = M_EOS; - w_strcpy(print, idxsav); - - } - else { /* save the sort field */ - idxsav[idxsavlen] = M_EOS; - w_strcpy(sort, idxsav); - } - - - - idxsavlen = 0; - didsubsort = FALSE; - - /* capture saved term unless got it already */ - if (! didsubsort) { - idxsav[idxsavlen] = M_EOS; - w_strcpy(subprint, idxsav); - } - else { /* save the sort field */ - idxsav[idxsavlen] = M_EOS; - w_strcpy(subsort, idxsav); - } - - - - - if (echo) mb_echohead("``") ; - - - if (echo) mb_echohead("''") ; - - - - newhline = 0 ; - - newhline = 0 ; - - - - - id = ID ; - - if (lastlist->lastlist->type == PLAIN) { - leaderok = TRUE ; /* allow only in */ - } - rshnewclear() ; - item(id) ; - - leaderok = FALSE ; - fputs("\n\n", outfile); - - - - /* also does special handling for calculator--supers/subs */ - /*handles super and subs in keys */ - mb_strcode("[", outfile) ; - if (echo) mb_echohead("[[") ; - - mb_strcode("]", outfile) ; - if (echo) mb_echohead("]]") ; - - esoutchar(m_textchar) ; - - - indexchar('['); - - indexchar(']'); - - indexchar(m_textchar) ; - - - - - - rshnewclear() ; - fputs("\n", outfile); - - - - fputs("\n", outfile); - - - - fputs("", outfile); - - fputs("\n", outfile); - fputs("\n", outfile); - - - - - - longlabel = LONGLABEL (QWRAP = WRAP, - QNOWRAP = NOWRAP) ; - width = WIDTH ; - spacing = SPACING (QTIGHT = TIGHT, - QLOOSE = LOOSE) ; - - char *mb_parent; - - mb_parent = MakeMByteString(m_parent(0)); - startlablist(longlabel, mb_checkdimen(width, "WIDTH", mb_parent), spacing) ; - m_free(mb_parent,"multi-byte string"); - - list-- ; - fputs("\n", outfile); - - - - type = TYPE (QSPACE = SPACE, - QDOTS = DOTS) ; - - if (leaderok==TRUE) - { - if (! m_wcmbupstrcmp(type, QDOTS)) - { - } - else if (! m_wcmbupstrcmp(type, QSPACE)) - { - } - else - { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err2("Internal error: element %sLEADER%s in tex.if", - wc_stago, - wc_tagc) ; - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - } - else - { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err4("%sLEADER%s only allowed in %sLIST PLAIN%s", - wc_stago, - wc_tagc, - wc_stago, - wc_tagc) ; - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - mb_starthelpnode("_LEGAL", TRUE); - - - - id = ID ; - - char mb_xrefstring[400]; - - if (! tonumexlines) - m_error( - "Preparing cross-reference to a line in an example without line numbers" - ) ; - sprintf(mb_xrefstring, "%d", exlineno) ; - mbstowcs(xrefstring, mb_xrefstring, 400); - xstrlen = w_strlen(xrefstring) ; - m_getline(&xrffile, &xrfline) ; - if (xrffile == NULL) { - /* set to primary input */ - xrffile = inputname; - } - setid(id, - TRUE, - FALSE, - inchapter, - chapstring, - xrffile, - xrfline, - TRUE) ; - { - char *mb_id; - - mb_id = MakeMByteString(id); - fprintf(outfile, "", mb_id); - m_free(mb_id,"multi-byte string"); - } - - - - hyperlink = HYPERLINK ; - type = TYPE (QJUMP = JUMP, - QJUMPNEWVIEW = JUMPNEWVIEW, - QDEFINITION = DEFINITION, - QEXECUTE = EXECUTE, - QAPPDEFINED = APPDEFINED, - QMAN = MAN) ; - description = DESCRIPTION ; - - fputs("", outfile); - - /* reset link type to default. This is braindead, but enough. - - E.g., - - <\link> - - will do the right thing (remember that xref turns to an implicit link). - Right_thing => xref becomes definition link. - - However, in - - Test <\link> <\link> - - the xref will think that is supposed to become a link of type jump, - not definition. This case is odd, so we won't worry about it. - */ - global_linktype = 0; - fputs("", outfile); - - - - type = TYPE (QORDER = ORDER, - QBULLET = BULLET, - QPLAIN = PLAIN, - QMILSPEC = MILSPEC, - QCHECK = CHECK) ; - order = ORDERTYPE (QUALPHA = UALPHA, - QLALPHA = LALPHA, - QARABIC = ARABIC, - QUROMAN = UROMAN, - QLROMAN = LROMAN) ; - spacing = SPACING (QTIGHT = TIGHT, - QLOOSE = LOOSE) ; - cont = CONTINUE ; - - startlist(type, order, spacing, cont) ; - - LIST *curlist ; - CONTCHAIN *chain, *xchain ; - - curlist = lastlist->lastlist ; - for (chain = lastlist->chain ; chain ; chain = xchain) { - xchain = chain->next ; - m_free(chain, "list chain") ; - } - m_free(lastlist, "list structure") ; - lastlist = curlist ; - for (chain = lastlist->chain ; chain ; chain = chain->next) { - fseek(outfile, chain->where, SEEK_SET) ; - if (lastlist->count > 999) { - m_error("Unable to support more than 999 items in an ordered list") ; - lastlist->count = 999 ; - } - fseek(outfile, 0L, SEEK_END) ; - } - if (lastlist->type == BULLET) bulcount-- ; - list-- ; - fputs("\n\n", outfile); - - - - id = ID ; - - if (id) { - char mb_xrefstring[400]; - - sprintf(mb_xrefstring, "\\") ; - mbstowcs(xrefstring, mb_xrefstring, 400); - xstrlen = w_strlen(xrefstring) ; - m_getline(&xrffile, &xrfline) ; - if (xrffile == NULL) { - /* set to primary input source */ - xrffile = inputname; - } - setid(id, - TRUE, - FALSE, - inchapter, - chapstring, - xrffile, - xrfline, - FALSE) ; - - { - char *mb_nodeid, *mb_id; - - mb_nodeid = MakeMByteString(nodeid); - mb_id = MakeMByteString(id); - fprintf(idtablefp, "%s> %s\n", mb_nodeid, mb_id); - fprintf(outfile, "", mb_id); - m_free(mb_nodeid,"multi-byte string"); - m_free(mb_id,"multi-byte string"); - } - } - - fprintf(outfile, ""); - - - - - language = LANGUAGE (QENGLISH = ENGLISH, - QNORWEGIAN = NORWEGIAN, - QSWEDISH = SWEDISH, - QDANISH = DANISH, - QFINNISH = FINNISH, - QDUTCH = DUTCH, - QFRENCH = FRENCH, - QGERMAN = GERMAN, - QITALIAN = ITALIAN, - QSPANISH = SPANISH) ; - idxvol = IDXVOL ; - status = STATUS ; - - thisnodelevel = 0; - mb_starthelpnode("_VERYTOP", TRUE); - manustart(language, idxvol, status) ; - - endhelpnode(); - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - mb_starthelpnode("_MAP", TRUE); - - - - - - if (memo && !final) { - if (! m_wcmbupstrcmp(m_parent(1), "TEXT")) - fputs("", outfile) ; - } - - if (memo && !final) { - POPFONT ; - fputs("", outfile) ; - } - - if (memo) { - if (m_textchar == '"') { /* handle funny quote in memo bug */ - } - else { - outchar(m_textchar, outfile); - } - } - - /* could need to handle calculator context sensitive entities - * here if needed to reduce tex macro count - */ - if (memo) { - outpi(m_enttype, m_pi, m_entname) ; - } - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - open_new_helpfile(); - thisnodelevel = 1; - mb_starthelpnode("_MESSAGE", FALSE); - chapst = FALSE ; - fprintf(stderr, "\nMessages.\n") ; - emsghead = DEFHEAD ; - - endhelpnode(); - - - - - - char *string = - GetDefaultHeaderString("MfgNumberElementDefaultHeadingString", - M_SDATA, - "Manufacturing Number"); - - mb_starthelpnode("_MFGNO", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - newhline = 0 ; - - newhline = 0 ; - - - - checkmsghead() ; - fprintf(outfile, "\n"); - - fprintf(outfile, "\n"); - - - - fprintf(outfile, "\\ \\ "); - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - checkmsghead() ; - chapst = TRUE ; - savid = checkid(NULL) ; /* hook for possible future ID */ - iderr = FALSE ; - - - - checkmsghead() ; - fprintf(outfile, ""); - - fprintf(outfile, "\n"); - - - - type = TYPE (QBEGIN = BEGIN, - QEND = END, - QTOGETHER = TOGETHER) ; - depth = AMOUNT ; - - - - fputs("", outfile) ; - - fputs("", outfile) ; - fputs("\\\n", docregfp) ; - - - - - if (rsectsame) - rsectholdnew = TRUE ; - - - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - - if (echo) mb_echohead(m_net) ; - - - - - indexchar(m_textchar) ; - - - outchar(m_textchar, outfile) ; - - - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - - if (echo) mb_echohead(m_net) ; - - - - - indexchar(m_textchar) ; - - - outchar(m_textchar, outfile) ; - - - - STARTSTUFF - /* In a tight list, paragraphs will have no trailing blank line. - * To match HPTag behavior, we need to emit a blank line and - * supress the leading blank line of the next paragraph, figure, - * example, etc., if any. - */ - ncwTightList = ""; - if ((lastlist->lastlist->space == TIGHT) && - (lastlist->lastlist->where == INSIDE)) { - ncwTightList = " before 1"; - } - - rshnewclear() ; - notehead = FALSE ; - - STARTSTUFF - ncwTightList = ""; - rshnewclear() ; - notehead = FALSE ; - - fputs("\n\n", outfile); - lastlist->lastlist->where = FOLLOW; /* supress leading newline */ - - fputs("\n\n", outfile); - - - - - - indexchar(m_textchar) ; - - - outchar(m_textchar, outfile) ; - - - - synelcnt = 0; - fputs("[", outfile); - - fputs("]", outfile); - - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - if (!id) { - m_error("Warning: topic will not be reachable because it has no ID"); - m_errcnt--; - } - starthelpnode(id, TRUE); - had_an_otherfront_head = FALSE; - savid = checkid(id) ; - iderr = FALSE ; - - if (id && !had_an_otherfront_head) { - m_errline("You must use a tag after \n"); - } - - - - - - if (echo) mb_echohead("``") ; - - - if (echo) mb_echohead("''") ; - - - - newhline = 0 ; - - newhline = 0 ; - - - - - indent = INDENT ; - id = ID; - gentity = GENTITY ; - gposition = GPOSITION (QLEFT = LEFT, - QRIGHT = RIGHT) ; - ghyperlink = GHYPERLINK ; - glinktype = GLINKTYPE (QJUMP = JUMP, - QJUMPNEWVIEW = JUMPNEWVIEW, - QDEFINITION = DEFINITION, - QEXECUTE = EXECUTE, - QAPPDEFINED = APPDEFINED, - QMAN = MAN) ; - gdescription = GDESCRIPTION ; - - char *listinfo; - - listinfo = ""; - if (lastlist->lastlist->space == TIGHT) { - if (lastlist->lastlist->where == INSIDE) - listinfo = " before 1 after 0"; - else if (lastlist->lastlist->where == FOLLOW) - listinfo = " after 0"; - } - lastlist->lastlist->where = INSIDE; - - paragraph(indent, - id, - gentity, - gposition, - ghyperlink, - glinktype, - gdescription, - listinfo); - - paragraph(indent, - id, - gentity, - gposition, - ghyperlink, - glinktype, - gdescription, - ""); - - fputs("\n\n", outfile); - - - - - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; /* '|' */ - } - - if (echo) mb_echohead(m_net) ; /* '|' */ - - - /* We perhaps should allow to be used in . - Since we are now dependent on LaserROM, we just can't - add it in (as an inclusion exception to idx). - So, we take out the code that would inplement it and - give an error message. */ - - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err4("%sPARM%s not allowed in %sIDX%s.", - wc_stago, - wc_tagc, - wc_stago, - wc_tagc); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - - - indexchar(m_textchar) ; - - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err2("%sPARM%s not allowed in headings.", wc_stago, wc_tagc); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - - - - POPFONT ; - - - - id = ID ; - number = NUMBER ; - include = INCLUDE ; - exclude = EXCLUDE ; - - char *string = - GetDefaultHeaderString("PartElementDefaultHeadingString", - M_SDATA, - "Part"); - - unimp(m_parent(0)) ; - outfile = m_outfile; /* we want part not to trigger nullfile */ - m_free(string, "default header string return"); - - endhelpnode(); - - - - - - char *string = - GetDefaultHeaderString("PartNumberElementDefaultHeadingString", - M_SDATA, - "Part Number"); - - mb_starthelpnode("_PARTNO", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - mb_starthelpnode("_PREFACE", TRUE); - - - - - char *string = - GetDefaultHeaderString("DatePrintedElementDefaultHeadingString", - M_SDATA, - "Date Printed"); - - mb_starthelpnode("_PRINTDATE", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - - - char *string = - GetDefaultHeaderString("ProductElementDefaultHeadingString", - M_SDATA, - "Product"); - - mb_starthelpnode("_PRODUCT", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - - - mb_strcode("\\\"", outfile) ; - if (echo) putc('"', stderr) ; - - mb_strcode("\\\"", outfile) ; - if (echo) putc('"', stderr) ; - - - mb_strcode("``", outfile) ; - if (echo) putc('"', stderr) ; - - mb_strcode("''", outfile) ; - if (echo) putc('"', stderr) ; - - - indexchar('\"') ; - - indexchar('\"') ; - - indexchar(m_textchar) ; - - - - - - char *string = - GetDefaultHeaderString("ReplacesElementDefaultHeadingString", - M_SDATA, - "Replaces"); - - mb_starthelpnode("_REPLACES", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - synelcnt = 0; - fputs("{", outfile); - - fputs("}", outfile); - - - - delim = DELIM (QBEGIN = BEGIN, - QEND = END, - QDELETE = DELETE) ; - revid = REVID ; - - - - - - - - - - - style = CELLSPEC ; - span = SPAN ; - vspan = VSPAN ; - - - - id = ID ; - pagebreak = PAGEBREAK (QNEWPAGE = NEWPAGE, - QSAMEPAGE = SAMEPAGE) ; - include = INCLUDE ; - exclude = EXCLUDE ; - - assert_hometopic_exists(); - if (!rsectseq) thisnodelevel = lastnodelevel + 1; - starthelpnode(id, FALSE); - rsectstart(id, pagebreak) ; - - if (st4) { - st4 = FALSE ; - } - endhelpnode(); - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - rshnewclear() ; - - if (rsectsame) st4 = TRUE ; - rshnewclear() ; - - if (st4) st4 = FALSE ; - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - assert_hometopic_exists(); - thisnodelevel = 2; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - chapst = TRUE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 3; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 4; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - thisnodelevel = 4; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 5; - starthelpnode(id, FALSE); - savid = checkid(id) ; - iderr = FALSE ; - st4 = TRUE ; - - thisnodelevel = 5; - starthelpnode(id, FALSE); - savid = checkid(id) ; - iderr = FALSE ; - st4 = TRUE ; - - if (st4) st4 = FALSE ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 6; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 7; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 8; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 9; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 10; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - include = INCLUDE ; - exclude = EXCLUDE ; - - mb_starthelpnode("_SAFETY", TRUE); - - - - - char *string = - GetDefaultHeaderString("SDCElementDefaultHeadingString", - M_SDATA, - "SDC"); - - mb_starthelpnode("_SDC", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - IDXSTRT - - IDXEND - - - - IDXSTRT - - IDXEND - - - - IDXSTRT - - IDXEND - - - - IDXSTRT - - IDXEND - - - - char *string = - GetDefaultHeaderString("SerialNumberElementDefaultHeadingString", - M_SDATA, - "Serial Number"); - - mb_starthelpnode("_SERIALNO", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - m_free(string, "default header string return"); - - - - - if (newhline++) indexchar(' '); - - indexchar(m_textchar) ; - - skchars = 0 ; - - - - newhline = 0 ; - - - indexchar(m_textchar) ; - - - sklines = 0 ; - skchars = 0 ; - if (echo) mb_echohead("{{") ; - - if (echo) mb_echohead("}}") ; - - esoutchar(m_textchar) ; - skchars++ ; - - - - didsort = TRUE; - idxsav[idxsavlen] = M_EOS; - w_strcpy(print, idxsav); - idxsavlen = 0; - - idxsav[idxsavlen] = M_EOS; - w_strcpy(sort, idxsav); - - didsubsort = TRUE; - idxsav[idxsavlen] = M_EOS; - w_strcpy(subprint, idxsav); - idxsavlen = 0; - - idxsav[idxsavlen] = M_EOS; - w_strcpy(subsort, idxsav); - - - - - - char *string = - GetDefaultHeaderString("SourceElementDefaultHeadingString", - M_SDATA, - "Source"); - - mb_starthelpnode("_SOURCE", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - if (echo) mb_echohead("__") ; - - if (echo) mb_echohead("__") ; - - if (echo) mb_echohead("__") ; - - if (echo) mb_echohead("__") ; - - if (echo) mb_echohead("__") ; - - if (echo) mb_echohead("__") ; - - - - - indexchar(m_textchar) ; - - - outchar(m_textchar, outfile) ; - - - outchar(m_textchar, outfile) ; - - - - newhline = 0 ; - - - - if (echo) mb_echohead("^^") ; - - if (echo) mb_echohead("^^") ; - - outchar(m_textchar, outfile) ; - - - - indexchar(m_textchar) ; - - - outchar(m_textchar, outfile) ; - - - - if (synelcnt++) { - fputs("\n", outfile); - } - - - fputs("\n", outfile); - - if (m_textchar == M_SPACE) fputs("\\ ", outfile) ; - else outchar(m_textchar, outfile) ; - - - - - - /* In a tight list, paragraphs will have no trailing blank line. - * To match HPTag behavior, we need to emit a blank line and - * supress the leading blank line of the next paragraph, figure, - * example, etc., if any. - */ - char *listinfo; - STARTSTUFF - - listinfo = ""; - if ((lastlist->lastlist->space == TIGHT) && - (lastlist->lastlist->where == INSIDE)) { - listinfo = " before 1"; - } - rshnewclear() ; - fprintf(outfile, - "", - listinfo, - LEFTINDENT, - LEFTINDENT); - - STARTSTUFF - rshnewclear() ; - fprintf(outfile, "", LEFTINDENT, LEFTINDENT); - - fputs("\n\n", outfile); - lastlist->lastlist->where = FOLLOW; /* supress leading newline */ - - fputs("\n\n", outfile); - - if (m_textchar == M_SPACE) fputs("\\ ", outfile) ; - else outchar(m_textchar, outfile) ; - - - - style = COLSPEC ; - id = ID ; - number = NUMBER ; - tonumber = TONUMBER (QNUMBER = NUMBER, - QNONUMBER = NONUMBER) ; - box = BOX (QBOX = BOX, - QNOBOX = NOBOX) ; - rule = RULE (QNORULE = NORULE, - QHEADRULE = HEADRULE, - QGRID = GRID) ; - vrule = ALLVRULES ; - hrule = ALLHRULES ; - vcount = VRULE ; - hcount = HRULE ; - spacing = SPACING (QTIGHT = TIGHT, - QLOOSE = LOOSE) ; - width = WIDTH (QFULL = FULL) ; - position = POSITION (QLEFT = LEFT, - QINDENT = INDENT, - QCENTER = CENTER) ; - divide = DIVIDE ; - textsize = TEXTSIZE (QNORMAL = NORMAL, - QSMALLER = SMALLER, - QSMALLEST = SMALLEST) ; - - fputs("", outfile); - unimp(m_parent(0)) ; - - fputs("\n", outfile); - - - - - - base = BASE ; - gloss = GLOSS (QGLOSS = GLOSS, - QNOGLOSS = NOGLOSS) ; - - termp = term ; - wsterm = FALSE ; - tooutput = FALSE; - if (echo) mb_echohead("++") ; - - endterm(base, gloss, 0); /* 0 => don't use definition window for link */ - - endterm(base, gloss, 2); /* 2 => use definition window for link */ - - termchar(m_textchar) ; - - /* could need to handle calculator context sensitive entities - * here if needed to reduce tex macro count - */ - termpi(m_enttype, m_pi, m_entname) ; - - - - id = ID ; - include = INCLUDE ; - exclude = EXCLUDE ; - - thisnodelevel = 2; - starthelpnode(id, FALSE); - rsectseq = FALSE ; - chapst = TRUE ; - savid = checkid(id) ; - iderr = FALSE ; - - rseqend() ; - endhelpnode(); - - - - char *iconName = - GetDefaultHeaderString("NoteElementDefaultIconFile", M_SYSTEM, ""); - char *string = - GetDefaultHeaderString("NoteElementDefaultHeadingString", - M_SDATA, - "NOTE"); - - - /* Write default note head if no user-specified head was encountered */ - if (! notehead) { - fprintf(outfile, ncwStart, ncwTightList); - fprintf(outfile, ncwEnd, string); - if (*iconName) - { - fprintf(outfile, ncwGraphic, iconName); - m_free(iconName, "icon name"); - } - notehead = TRUE; - } - m_free(string, "default header string return"); - - char *iconName = - GetDefaultHeaderString("CautionElementDefaultIconFile", M_SYSTEM, ""); - char *string = - GetDefaultHeaderString("CautionElementDefaultHeadingString", - M_SDATA, - "CAUTION"); - - - /* Write default caution head if no user-specified head was encountered */ - if (! notehead) { - fprintf(outfile, ncwStart, ncwTightList); - fprintf(outfile, ncwEnd, string); - if (*iconName) - { - fprintf(outfile, ncwGraphic, iconName); - m_free(iconName, "icon name"); - } - notehead = TRUE; - } - m_free(string, "default header string return"); - - char *iconName = - GetDefaultHeaderString("WarningElementDefaultIconFile", M_SYSTEM, ""); - char *string = - GetDefaultHeaderString("WarningElementDefaultHeadingString", - M_SDATA, - "WARNING"); - - /* Write default warning head if no user-specified head was encountered */ - if (! notehead) { - fprintf(outfile, ncwStart, ncwTightList); - fprintf(outfile, ncwEnd, string); - if (*iconName) - { - fprintf(outfile, ncwGraphic, iconName); - m_free(iconName, "icon name"); - } - notehead = TRUE; - } - m_free(string, "default header string return"); - - if (!had_an_otherfront_head) { - endhead(); - } - - checkmsghead() ; - - if (needabstracthead) - { - fprintf(outfile, "\n"); - needabstracthead = FALSE; - } - - fputs("\n", outfile); - - - - char *string = - GetDefaultHeaderString("TitleElementDefaultHeadingString", - M_SDATA, - "Title"); - - hadtitle = TRUE; - mb_starthelpnode("_TITLE", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - newhline = 0 ; - savhd = TRUE ; - hderr = FALSE ; - svheadlen = 0 ; - tooutput = TRUE ; - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - savehead[svheadlen] = M_EOS ; - savhd = FALSE ; - if (hderr) { - m_error("Error collecting title characters."); - } - - { - char *mb_savehead; - - mb_savehead = MakeMByteString(savehead); - fprintf(docregfp, "*title:\t%s\n", mb_savehead); - m_free(mb_savehead,"multi-byte string"); - } - - savedtitle = (M_WCHAR *) m_malloc(w_strlen(savehead) + 1, "saved title"); - w_strcpy(savedtitle, savehead); - - - - - - tnoteid = ID ; - - - - tnoteid = ID ; - - - - - - if (echo) { - mb_echohead(m_stago) ; - echohead(m_parent(0)) ; - mb_echohead(m_net) ; - } - mb_strcode("", outfile); - - esoutchar(m_textchar) ; - - if (echo) mb_echohead(m_net) ; - mb_strcode("", outfile); - - exoutchar(m_textchar) ; - - - - - indexchar(m_textchar) ; - - - - mb_strcode("", outfile) ; - if (echo) mb_echohead("%%") ; - - mb_strcode("", outfile) ; - if (echo) mb_echohead("%%") ; - - - - - indexchar(m_textchar) ; - - - POPFONT ; - mb_strcode("", outfile) ; - - /* added to fix calculator computer chars */ - - if (m_textchar == M_SPACE) fputs("\\ ", outfile) ; - else outchar(m_textchar, outfile) ; - - - - char *string = - GetDefaultHeaderString("VersionElementDefaultHeadingString", - M_SDATA, - "Version"); - - mb_starthelpnode("_VERSION", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - type = TYPE (QCOMPUTER = COMPUTER, - QDISPLAY = DISPLAY) ; - position = POSITION (QLEFT = LEFT, - QINDENT = INDENT, - QCENTER = CENTER) ; - lines = LINES (QNUMBER = NUMBER, - QNONUMBER = NONUMBER) ; - textsize = TEXTSIZE (QNORMAL = NORMAL, - QSMALLER = SMALLER, - QSMALLEST = SMALLEST) ; - - /* In a tight list, paragraphs will have no trailing blank line. - * To match HPTag behavior, we need to emit a blank line and - * supress the leading blank line of the next paragraph, figure, - * example, etc., if any. - */ - char *listinfo; - - listinfo = ""; - if ((lastlist->lastlist->space == TIGHT) && - (lastlist->lastlist->where == INSIDE)) { - listinfo = " before 1"; - } - - exvexstart(type, textsize, listinfo) ; - tonumexlines = (LOGICAL) (vnumber(lines) == NUMBER); - exlineno = 1 ; - if (tonumexlines) fprintf(outfile, " %d. ", exlineno) ; - - exvexstart(type, textsize, "") ; - tonumexlines = (LOGICAL) (vnumber(lines) == NUMBER); - exlineno = 1 ; - if (tonumexlines) fprintf(outfile, " %d. ", exlineno) ; - - exvexend(textsize); - lastlist->lastlist->where = FOLLOW; /* supress leading newline */ - - exvexend(textsize); - - exoutchar(m_textchar) ; - - - - char *string = - GetDefaultHeaderString("VolumeElementDefaultHeadingString", - M_SDATA, - "Volume"); - - mb_starthelpnode("_VOLUME", TRUE); - fprintf(outfile, "<TYPE serif><WEIGHT bold><SIZE 14>%s</SIZE></WEIGHT></TYPE>\n\n", string); - fputs("", outfile); - m_free(string, "default header string return"); - - fputs("\n\n", outfile); - - - - STARTSTUFF - /* In a tight list, paragraphs will have no trailing blank line. - * To match HPTag behavior, we need to emit a blank line and - * supress the leading blank line of the next paragraph, figure, - * example, etc., if any. - */ - ncwTightList = ""; - if ((lastlist->lastlist->space == TIGHT) && - (lastlist->lastlist->where == INSIDE)) { - ncwTightList = " before 1"; - } - - rshnewclear() ; - notehead = FALSE ; - - STARTSTUFF - ncwTightList = ""; - rshnewclear() ; - notehead = FALSE ; - - fputs("\n\n", outfile); - lastlist->lastlist->where = FOLLOW; /* supress leading newline */ - - fputs("\n\n", outfile); - - - - original = ORIGINAL ; - - --m_errcnt ; /* this is a message, not really an error */ - if (original) - m_err1("Convert %s WHATSIT to Tag markup", original) ; - else - m_error("Convert WHATSIT to Tag markup") ; - - - - newhline = 0 ; - - indexchar(m_textchar) ; - - - -/* Cross-referencing that allows forward references is inherently a two-pass -process. However, this interface assumes a two-pass process. MARKUP -provides the first pass and TeX the second. MARKUP can therefore define -a TeX macro for every cross-reference and write a file of definitions of -these macros that is read at the beginning of the TeX pass. In fact, -information about cross-references is stored in a trie by MARKUP. Data is -entered into this structure both when a cross-reference is defined (with -an id parameter on a chapter, figure, etc.) and when it is used (with the -xref element). At the end of the manual, the file xref.tex is written -with definitions of macros corresponding to all cross-references defined -or accessed. In addition, the file xreftbl is written to save this -information in a form that can be read to initialize the trie the next -time the manual is processed. Saving cross-reference information across -runs of MARKUP allows a manual to be processed a chapter at a time without -invalidating interchapter references. The file xreftbl should be -deleted before final processing, however, to verify that no cross-references -remain to an id that existed at one time and was deleted. Such an id could -remain in the cross-reference table indefinitely. -*/ - - id = ID ; - - - indexchar(m_textchar) ; - - xrefexpand(id) ; diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/hptag.dtd b/cde/programs/dthelp/parser.ccdf/htag/helptag/hptag.dtd deleted file mode 100644 index d02e452ee..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/hptag.dtd +++ /dev/null @@ -1,1572 +0,0 @@ --- HP Tag Document-Type Definition - Copyright (c) Hewlett-Packard Company, 1987-1991 - Version 1.22 (9/21/91)-with Calculator Additions - $XConsortium: hptag.dtd /main/2 1996/11/07 11:55:13 drk $ --- - --- Standard pre-defined HP Tag Entities -- - -- Math symbols -- - -- Minus sign -- - -- Plus or minus sign -- - -- Division sign -- - -- Multiplication sign -- - -- Less than or equals sign -- - -- Greater than or equals sign -- - -- Not equals sign -- - - -- Special typographical symbols -- - - - - - - - - - - - - -- Single quote, non-directional -- - -- Double quote, non-directional -- - - - -- Visible blank for syntax descriptions -- - - -- Pound sterling -- - -- Discretionary hyphen -- - -- Significant space -- - - - -- Special technical symbols -- - - - - -- Keycap arrows -- - - - - - - - - -- Miscellaneous entities -- - - - - - -- Entities for service documentation -- --- - - - - - - - - - - --- - -- Entities for partext short references -- - - - - - - - - - - - - - - - - -- Miscellaneous entities for system use-- - - - - - - - --- m-starttextincell is used in possible applications (such as that - generated by the empty interface) that do not insert markup into - the input stream. Unfortunately, the HP Tag to TeX converter does - do this horrible thing in order to distinguish cells from quadded - cells automatically. The Tag to TeX converter supports this - "feature" by redefining this entity to the null string and - inserting either or in the start-code for - and -- - - - - - - - - - - - - - - - - - - - - - - - - - - -- Entities for MARKUP delimiters -- - - - - - -- For localizable "special characters" head in - automatically generated index -- - - - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - "W--W" -> &emdash, - "W--W&#RE;" -> &emdash, - "&#RE;W--W" -> &emdash, - "-?" -> &m-d-, - "!!" -> &m-startemph, - "``" -> &m-startcomputer, - "::" -> &m-startdisplay, - '"' -> &m-startquote, - "[[" -> &m-startkeycap, - "{{" -> "&m-startsoftkey;&m-startskline;", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - "%%" -> &m-startvar, - "++" -> &m-startterm, - "((" -> &m-startcircle, - "@@" -> &m-startineqn, - "{{{" -> &m-startwhitemenu, - ; - -infostart -> (!helpvolume | manual) - STARTTAG ENDTAG - ; - -helpvolume -> (hyphenations?, - reviewers?, - (front|metainfo)?, - toc?, - hometopic?, - (part* | !chapter* | (s1*, rsect*)), - appendix*, - message?, - biblio?, - glossary?, - idxsyn?, - index?) - +(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - - author CDATA, - language CDATA, - idxvol NAMETOKEN, - status CDATA, - - STARTTAG ENDTAG - ; - -hometopic -> (chaphead, !text?) - ENDTAG - ; - -otherhead -> (head, !text?) - ENDTAG - ; - -manual -> (hyphenations?, - reviewers?, - front?, - toc?, - (part* | !chapter*), - appendix*, - message?, - biblio?, - glossary?, - idxsyn?, - index?) - +(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - - author CDATA, - language CDATA, - idxvol NAMETOKEN, - status CDATA, - - STARTTAG ENDTAG - ; - -memo -> CDATA -- A writer's note to self or reviewer -- - - audience NAMES - ; - - -link -> (partext) - - hyperlink CDATA, - type (JUMP | JUMPNEWVIEW | DEFINITION | EXECUTE | APPDEFINED | MAN), - description CDATA - ; - -location -> (partext?) - - id ID #REQUIRED - ; - -default -> EMPTY - - -- Changes to this element's parameters require changes in the HP - Tag to TeX interface, functions setdefault(), texinit(), - texuptodate(). -- - calcqrgwidth CDATA, - ctbltype ( KEYS2 | COMMAND), - ctblgraphics (NOGRAPHICS | GRAPHICS), - ctbldisplines (TWO | FOUR | EIGHT | OTHER), - extype (COMPUTER | DISPLAY), - expos (LEFT | INDENT | CENTER), - exnotes (SIDE | STACK), - exlines (NUMBER | NONUMBER), - extextsize (NORMAL | SMALLER | SMALLEST), - gloss (GLOSS | NOGLOSS), - listtype (ORDER | BULLET | PLAIN | MILSPEC | CHECK), - listordertype (UALPHA | LALPHA | ARABIC | UROMAN | LROMAN), - listspacing (TIGHT | LOOSE), - longlabel (WRAP | NOWRAP), - labelwidth CDATA, - tableborder (BOX | NOBOX), - tablerule (NORULE | HEADRULE | GRID), - tableallvr (VRULE), - tableallhr (HRULE), - tablevr NUMBER, - tablehr NUMBER, - tablespacing (TIGHT | LOOSE), - tablepos (LEFT | INDENT | CENTER), - tablewidth NAMETOKEN, - tabletextsize (NORMAL | SMALLER | SMALLEST), - numbertables (NUMBER | NONUMBER), - figtype NAME, - oldfigtype (ART | PCL | TIFF | LISTING | TEXT), - figmagnify NAMETOKEN, - figwidth NAMETOKEN, - figheight NAMETOKEN, - figborder (TOP | BOTTOM | BOX | SCREEN | NOBOX), - figvideo (INVERSE | NOINVERSE), - figstrip (STRIP | NOSTRIP), - figmargin CDATA, - figclip CDATA, - figpenwidth CDATA, - figsnap (SNAP | NOSNAP), - figautoscale (AUTOSCALE | NOAUTOSCALE), - figplottype CDATA, - listtextsize (NORMAL | SMALLER | SMALLEST), - numberfigs (NUMBER | NONUMBER), - eqn NAME, - rsectpagebreak (NEWPAGE | SAMEPAGE), - ; - -(header | footer) - -> ((inside, middle?, outside?) | (middle, outside?) | outside) - -(header | footer | fillin | location | idx | newpage | need) - ; - --- * instead of + on hline below allows for blanking a header or - footer field -- -(inside | middle | outside) - -> (hline*) - - "W\" -> &m-starthline, - "&&#RE;" -> " ", - ENDTAG - ; - -rev -> EMPTY - - delim (BEGIN | END | DELETE) #REQUIRED, - revid CDATA - ; - -whatsit -> (partext) - -(fillin) - - original CDATA - ; - -hyphenations -> (hyphentry*) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - ENDTAG - ; - -hyphentry -> (#PCDATA) - - "&#RE;" -> ENDTAG "hyphentry", - "&#RS;&#RE;" -> ENDTAG "hyphentry" - STARTTAG - ; - -reviewers -> (reviewer +) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need | fillin) - ENDTAG - ; - -reviewer -> (partext) - - "&#RE;" -> ENDTAG "reviewer", - "&#RS;&#RE;" -> ENDTAG "reviewer", - "&&#RE;" -> " ", - STARTTAG - ; - --- Front matter -- -(metainfo | front) -> (idsection, legal?, history?, safety?, - map?, abstract?, preface?, conventions?, otherfront*, entrypointset?) - -(footnote) - ENDTAG - ; - -idsection -> - (title & - volume? & - country? & - copyright & - hardware? & - serialno? & - version? & - source? & - partno? & - mfgno? & - ficheno? & - product? & - edition? & - printdate? & - sdc? & - binderno? & - replaces? & - titlefig?) - STARTTAG ENDTAG - ; - -title -> (hline +) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - ENDTAG - - "&#RE;" -> ENDTAG "title", - "W\" -> &m-starthline, - "&&#RE;" -> " ", - ; - -(volume | country | version | partno | mfgno | ficheno | product | edition | - printdate | sdc | binderno | replaces) - -> (partext) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - ENDTAG - ; - -serialno -> (text) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - ENDTAG - ; - -hardware -> (hline +, subcategory?) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - ENDTAG - - "W\" -> &m-starthline, - "W:W" -> STARTTAG "subcategory", - ; - -subcategory -> (hline +) - ENDTAG - - "W\" -> &m-starthline, - ; - -copyright -> (text) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - ENDTAG - ; - -source -> (partext) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - ENDTAG - ; - -frontsub -> (head, text) - ENDTAG - - include CDATA, - exclude CDATA - ; - -(legal | safety | map | abstract | preface | conventions | history) - -> (head?, !text?, frontsub*) - ENDTAG - - include CDATA, - exclude CDATA - ; - -otherfront -> (head?, !text?, frontsub*) - ENDTAG - - id ID, - include CDATA, - exclude CDATA - ; - -entrypointset -> (entrypoint +) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need | fillin) - ENDTAG - ; - -entrypoint -> (partext) - - "&#RE;" -> ENDTAG "entrypoint", - "&#RS;&#RE;" -> ENDTAG "entrypoint", - "&&#RE;" -> " ", - STARTTAG - ; - -toc -> EMPTY - ; - --- Chapter Structure -- -part -> (!head?, !text?, chapter +) - ENDTAG - - id ID, - number NUMBER #IMPLIED, - include CDATA, - exclude CDATA - ; - -(chapter | appendix) -> (chaphead, !text?, (test* | (s1*, rsect*)) ) - ENDTAG - ; - - - id ID, - number NUMBERTOKEN #IMPLIED, - include CDATA, - exclude CDATA - ; - - - letter NAMETOKEN #IMPLIED, - id ID, - include CDATA, - exclude CDATA - ; - -test -> (chaphead, !text?, s1*, rsect*) - ENDTAG - ; - -s1 -> (chaphead, !text?, s2*, rsect*) - ENDTAG - ; - -s2 -> (chaphead, !text?, s3*, rsect*) - ENDTAG - ; - -s3 -> (chaphead, !text?, s4*, rsect*) - ENDTAG - ; - -s4 -> (chaphead, !text?, s5*, rsect*) - ENDTAG - ; - -s5 -> (chaphead, !text?, s6*, rsect*) - ENDTAG - ; - -s6 -> (chaphead, !text?, s7*, rsect*) - ENDTAG - ; - -s7 -> (chaphead, !text?, s8*, rsect*) - ENDTAG - ; - -s8 -> (chaphead, !text?, s9*, rsect*) - ENDTAG - ; - -s9 -> (chaphead, !text?) - ENDTAG - ; - -procedure -> (chaphead, !text?) - -(procedure) - ENDTAG - ; - -rsect -> (chaphead, !text?, rsub*) - ENDTAG - - id ID, - pagebreak (NEWPAGE | SAMEPAGE), - include CDATA, - exclude CDATA - ; - -rsub -> (chaphead, text?) - ENDTAG - - include CDATA, - exclude CDATA - ; - -chaphead -> (head, abbrev?) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need | fillin | footnote) - STARTTAG ENDTAG - ; - -head -> (hline +) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - STARTTAG ENDTAG - - "&#RE;" -> ENDTAG "head", - "W\" -> &m-starthline, - "&&#RE;" -> " ", - ; - -hline -> (partext?) - STARTTAG ENDTAG - ; - -abbrev -> (hline +) - -(need | footnote) - ENDTAG - - where (TOC | FOOTER | BOTH) BOTH - - "&#RE;" -> ENDTAG "abbrev", - "&&#RE;" -> " ", - "W\" -> &m-starthline, - ; - --- TEXT -- -text -> (!p | note | caution | warning | lablist | list | ex | vex | esc | - csyntax | cspot | ctable | otherhead | procedure | syntax | figure | - table | eqn | image | cdrom)* - STARTTAG ENDTAG - ; - - - number NUMBER, - indent (INDENT), - id ID, - gentity ENTITY, - gposition (LEFT | RIGHT), - ghyperlink CDATA, - glinktype (JUMP | JUMPNEWVIEW | DEFINITION | EXECUTE | APPDEFINED | MAN), - gdescription CDATA - ; - -p -> (head?, partext) - +(newline, parm) - - "&#RS;&#RE;" -> ENDTAG "p", -- blank line -- - STARTTAG ENDTAG - ; - -newline -> EMPTY - ; - -image -> (head?, imagetext) - -(footnote) - - -- Leading spaces on first line should trigger start-tag -- - " " -> "&sigspace;", - ; - -imagetext -> (partext) - STARTTAG ENDTAG - - -- Record ends are significant around em-dashes -- - "W--W&#RE;" -> "&emdash&#RE;", - "&#RE;W--W" -> "&#RE;&emdash", - ; - -(note | caution | warning) - -> (head?, text) - -(note | caution | warning | footnote) - ; - -list -> (head?, item +) - - "&#RS;W*" -> STARTTAG "item", - - type (ORDER | BULLET | PLAIN | MILSPEC | CHECK) #IMPLIED, - ordertype (UALPHA | LALPHA | ARABIC | UROMAN | LROMAN) #IMPLIED, - spacing (TIGHT | LOOSE) #IMPLIED, - continue (CONTINUE) - ; - -item -> (text) - +(parm) - - id ID - ENDTAG - ; - -lablist -> (head?, labheads?, (label, text)+) - - "&#RS;W\" -> STARTTAG "label", - - longlabel (WRAP | NOWRAP) #IMPLIED, - width CDATA #IMPLIED, - spacing (TIGHT | LOOSE) #IMPLIED - ; - -labheads -> (labh, labhtext) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need) - - "W\" -> STARTTAG "labh", - "&#RS;W\" -> STARTTAG "labh", - ENDTAG - ; - -labh -> (partext) - - "W\" -> &m-startpartext, - "&#RS;W\" -> &m-startpartext, - STARTTAG ENDTAG - ; - -labhtext -> (partext) - - "&#RS;W\" -> STARTTAG "label", - STARTTAG ENDTAG - ; - -label -> (partext) - +(parm) - - "W\" -> &m-starttext, - "&#RS;W\" -> &m-starttext, - ENDTAG - ; - -ex -> (head?, (!exampleseg, annotation?)+) - -(ex | vex | note | caution | warning | syntax | footnote) +(parm) - - type (COMPUTER | DISPLAY) #IMPLIED, - position (LEFT | INDENT | CENTER) #IMPLIED, - notes (SIDE | STACK) #IMPLIED, - width CDATA #IMPLIED, - lines (NUMBER | NONUMBER) #IMPLIED, - textsize (NORMAL | SMALLER | SMALLEST) #IMPLIED, - - -- Leading spaces on first line should trigger start-tag -- - " " -> "&sigspace;", - "<<" -> STARTTAG "annotation", - -- Line-final & expands to nothing here, but to a space in head - and other elements -- - "&&#RE;" -> "", - -- partext short references -- - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "``" -> &m-startcomputer, - "::" -> &m-startdisplay, - "[[" -> &m-startkeycap, - "{{" -> "&m-startsoftkey;&m-startskline;", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - "%%" -> &m-startvar, - ; - -exampleseg -> (partext) - +(lineno) - STARTTAG ENDTAG - ; - -lineno -> EMPTY - id ID #REQUIRED - ; - -annotation -> (partext?) - +(newline) - - ">>" -> ENDTAG "annotation", - -- partext short references -- - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - "W--W" -> &emdash, - "W--W&#RE;" -> &emdash, - "&#RE;W--W" -> &emdash, - "-?" -> &m-d-, - "!!" -> &m-startemph, - "``" -> &m-startcomputer, - "::" -> &m-startdisplay, - '"' -> &m-startquote, - "[[" -> &m-startkeycap, - "{{" -> "&m-startsoftkey;&m-startskline;", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - "%%" -> &m-startvar, - "++" -> &m-startterm, - "((" -> &m-startcircle, - "@@" -> &m-startineqn, - "{{{" -> &m-startwhitemenu, - ; - -vex -> CDATA - - type (COMPUTER | DISPLAY) #IMPLIED, - position (LEFT | INDENT | CENTER) #IMPLIED, - lines (NUMBER | NONUMBER) #IMPLIED, - textsize (NORMAL | SMALLER | SMALLEST) #IMPLIED, - ; - -csyntax -> (cmdname, cmddesc, cmdtype, csynheads?, crow +) - - "&#RS;W=" -> &m-startcrow, - "W||" -> &m-startccell, - ; - -cmdname -> (partext) - - "W||" -> &m-startcmddesc, - "@@" -> &m-startineqn, - "!!" -> &m-startemph, - "^^" -> &m-startsuper, - "__" -> &m-startsub, - STARTTAG ENDTAG - ; - -cmddesc -> (#PCDATA) - - "W||" -> &m-startcmdtype, - ENDTAG - ; - -cmdtype -> (#PCDATA) - ENDTAG - ; - -cspot -> (!text?, s3*, s4*) - -(table, ctable, figure, cspot, list) - - entity ENTITY, - graphics (NOGRAPHICS | GRAPHICS) #IMPLIED, - width NAMETOKEN #IMPLIED, - height NAMETOKEN #IMPLIED, - ; - -csynheads -> (ccell +) - - "W||" -> &m-startccell, - "&#RE;" -> ENDTAG "csynheads", - "&#RS;&#RE;" -> ENDTAG "csynheads", - "@@" -> &m-startineqn, - "^^" -> &m-startsuper, - "__" -> &m-startsub, - "%%" -> &m-startvar, - ENDTAG - ; - -crow -> (ccell +) - - "W||" -> &m-startccell, - "&#RE;" -> ENDTAG "crow", - "&#RS;&#RE;" -> ENDTAG "crow", - "@@" -> &m-startineqn, - "^^" -> &m-startsuper, - "__" -> &m-startsub, - "%%" -> &m-startvar, - "??" -> &m-startcsuser, - '"' -> '&m-startcsuser;"&m-endcsuser;', - "'" -> "&m-startcsuser;'&m-endcsuser", - "{" -> "&m-startcsuser;{&m-endcsuser;", - "}" -> "&m-startcsuser;}&m-endcsuser;", - "[" -> "&m-startcsuser;[&m-endcsuser;", - "]" -> "&m-startcsuser;]&m-endcsuser;", - "(" -> "&m-startcsuser;(&m-endcsuser;", - ")" -> "&m-startcsuser;)&m-endcsuser;", - ENDTAG - ; - -csuser -> (#PCDATA | keycap | var | ineqn | super | sub | esc)* - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - "[[" -> &m-startkeycap, - "%%" -> &m-startvar, - "@@" -> &m-startineqn, - "??" -> &m-endcsuser, - "^^" -> &m-startsuper, - "__" -> &m-startsub - ; - -ccell -> (partext) - STARTTAG ENDTAG - ; - --- synel + allows short reference of RE -> ENDTAG "synel" -- -syntax -> (head?, synel +) - - "[[" -> &m-startkeycap, - "%%" -> &m-startvar, - "[" -> STARTTAG "optblock", - "{" -> STARTTAG "reqblock", - "&&#RE;" -> " ", - "]" -> &m-endopt, - "}" -> &m-endreq, - -- partext short references -- - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - ; - -synel -> (#PCDATA | esc | var | ineqn | keycap | optblock | reqblock | parm)+ - - "&#RE;" -> ENDTAG "synel", - "@@" -> &m-startineqn, - STARTTAG ENDTAG - ; - -optblock -> (synel)+ - ; - -reqblock -> (synel)+ - ; - -footnote -> (p +) - -(footnote) - ; - -eqn -> RCDATA - - formatter NAME #IMPLIED - ; - -idx -> (indexprimary, indexsub?) - -(term | footnote | location | idx | newpage | need | fillin) - - main (MAIN), - range (BEGIN | END) - - -- idx cannot inherit short-reference map from manual because if - idx is called from within a partext element with identical open - and close short-ref delimiters (e.g., !! or %%), a first - occurrence of the delimiter within the idx should be an open - instead of a close-- - ; - -indexprimary -> (partext, sort?) - - "W:W" -> STARTTAG "indexsub", - STARTTAG ENDTAG - ; - -indexsub -> (partext, sort?) - ENDTAG - ; - -sort -> (#PCDATA | esc)+ - ENDTAG - ; - -graphic -> EMPTY - - id ID, - entity ENTITY, - ; - -(titlefig | figure) -> (!caption?, calltext*, figtext?, (fignote?)) - -(figure, graphic) - - number NUMBER #IMPLIED, - tonumber (NUMBER | NONUMBER) #IMPLIED, - id ID, - entity ENTITY, - figpos (LEFT | CENTER | RIGHT) #IMPLIED, - cappos (LEFT | CENTER | RIGHT) #IMPLIED, - oldtype (ART | PCL | TIFF | LISTING | TEXT) #IMPLIED, - width NAMETOKEN #IMPLIED, - height NAMETOKEN #IMPLIED, - --The next two parameters are NAMETOKENs instead of - NUMBERTOKENs so they can be negative numbers-- - hadjust NAMETOKEN, - vadjust NAMETOKEN, - border (TOP | BOTTOM | BOX | SCREEN | NOBOX) #IMPLIED, - continue (CONTINUE), - type NAME #IMPLIED, - magnify NAMETOKEN #IMPLIED, - video (INVERSE | NOINVERSE) #IMPLIED, - strip (STRIP | NOSTRIP) #IMPLIED, - mirror (MIRROR), - margin CDATA #IMPLIED, - clip CDATA, - penwidth CDATA, - snap (SNAP | NOSNAP) #IMPLIED, - autoscale (AUTOSCALE | NOAUTOSCALE) #IMPLIED, - plottype CDATA, - callout NUMBER, - textsize (NORMAL | SMALLER | SMALLEST) #IMPLIED, - ghyperlink CDATA, - glinktype (JUMP | JUMPNEWVIEW | DEFINITION | EXECUTE | APPDEFINED | MAN), - gdescription CDATA - ; - -figtext -> (text?) - ENDTAG - ; - -calltext -> (#PCDATA) - - callno NUMBER #REQUIRED, - ENDTAG - ; - -caption -> (!hline +, abbrev?) - -(memo | default | pageno | header | footer | rev | - location | idx | newpage | need | fillin) - - "&#RE;" -> ENDTAG "caption", - "&&#RE;" -> " ", - "W\" -> &m-starthline, - STARTTAG ENDTAG - ; - -fignote -> CDATA - ENDTAG - ; - -ctable -> ( (cmd, cmddescrip, input....., output....)* | - (descrip, keys, cdisplay)* ) - - type (KEYS2 | COMMAND) #IMPLIED, - graphics (NOGRAPHICS | GRAPHICS) #IMPLIED, - displines (TWO | FOUR | EIGHT | OTHER) #IMPLIED, - ENDTAG - - ; - -cmd -> (partext) - -(ctable | location | idx) - - "W:W" -> STARTTAG "cmddescrip", - -- partext short references -- - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - ".W.W." -> &ellipsis, - "W--W" -> &emdash, - "W--W&#RE;" -> &emdash, - "&#RE;W--W" -> &emdash, - "-?" -> &m-d-, - "!!" -> &m-startemph, - "``" -> &m-startcomputer, - "::" -> &m-startdisplay, - '"' -> &m-startquote, - "[[" -> &m-startkeycap, - "{{" -> "&m-startsoftkey;&m-startskline;", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - "%%" -> &m-startvar, - "++" -> &m-startterm, - "@@" -> &m-startineqn, - "{{{" -> &m-startwhitemenu, - - ENDTAG - ; - -cmddescrip -> (partext) - -(ctable) - ENDTAG - ; - -input..... -> (#PCDATA | var | csuser | ineqn | user | cursor | super | - sub | esc)* - -(ctable | location | idx) - - "[[" -> "[[", - "??" -> &m-startcsuser, - ENDTAG - ; - -output.... -> (#PCDATA | var | csuser | ineqn | user | cursor | super | - sub | esc)* - -(ctable | location | idx) - - "[[" -> "[[", - "??" -> &m-startcsuser, - ENDTAG - ; - -keys -> (partext)* - -(ctable) +(newline) - ENDTAG - ; - -cdisplay -> EMPTY - - entity ENTITY, - startrow NUMBER, - endrow NUMBER, - clip CDATA, - margin CDATA - ; - -descrip -> (p)* - -(ctable) - ENDTAG - ; - --- COLH is not allowed directly in TABLE, but is in COLHEADS - and TABLEHEAD. Context checking is done in the interface -- -table -> (!caption?, ((colheads, hsep?) | tablehead)?, (!row, hsep?)+) - -(table | note | caution | warning | footnote) - - colspec CDATA #REQUIRED, - id ID, - number NUMBER #IMPLIED, - tonumber (NUMBER | NONUMBER) #IMPLIED, - box (BOX | NOBOX) #IMPLIED, - rule (NORULE | HEADRULE | GRID) #IMPLIED, - allvrules (VRULE) #IMPLIED, - allhrules (HRULE) #IMPLIED, - vrule NUMBER, - hrule NUMBER, - spacing (TIGHT | LOOSE) #IMPLIED, - width NAMETOKEN, - position (LEFT | INDENT | CENTER) #IMPLIED, - divide NUMBER #IMPLIED, - textsize (NORMAL | SMALLER | SMALLEST) #IMPLIED, - - "&#RS;W=" -> "&m-startrow;&m-startcell;&m-starttextincell", - "W||" -> "&m-startcell;&m-starttextincell", - ; - -tablehead -> ((!row, hsep?)+) - -(cell) - - "&#RS;W=" -> "&m-startrow;&m-startcolh;&m-starthline;&m-startpartext", - "W||" -> "&m-startcolh;&m-starthline;&m-startpartext", - "W\" -> "&m-starthline" -; - -colheads -> (!colh)+ - - "&#RS;W=" -> "&m-startrow;&m-startcell;&m-starttextincell", - "W||" -> "&m-startcolh;&m-starthline;&m-startpartext", - "W\" -> &m-starthline, - ENDTAG - ; - -colh -> (hline +) - - span NUMBER 1, - vspan NUMBER 1, - cellspec CDATA, - STARTTAG ENDTAG - ; - --- Cell is not contextually required, but it is never minimized. It is - started by a short reference or has an explicit tag with parameters -- -row -> ((rowh?, cell*) | colh*) - -(newpage | need | hsep) - STARTTAG ENDTAG - ; - -cell -> (! partext | quadcell) - - span NUMBER 1, - vspan NUMBER 1, - cellspec CDATA, - STARTTAG ENDTAG - ; - -rowh -> (! text | quadcell) - - span NUMBER 1, - vspan NUMBER 1, - cellspec CDATA, - ENDTAG - ; - -quadcell -> (partext) - ENDTAG - ; - -hsep -> EMPTY - rule (NORULE | RULE | BLANK) RULE - ; - -tnote -> (p +) - -(tnote, footnote) - - id NAME #IMPLIED - ; - -tnoteref -> EMPTY - - id NAME #REQUIRED - ; - --- Included text elements -- --- If modify definition of "partext", check exclusions to "term"-- --- NOTE: tnote and tnoteref should only be allowed in table, - exceptions are handled in the interface, should probably be in dtd --- -partext -> (#PCDATA | acro | emph | computer | display | graphic | term | var | - circle | ineqn | quote | keycap | softkey | csuser | user | - cursor | whitemenu | super | sub | book | whatsit | number | - xref | not | footnote | nobreak | esc | fillin | leader | - location | tnote | tnoteref | link)* - STARTTAG ENDTAG - ; - -acro -> (#PCDATA | esc | super | sub)* - ; - -esc -> CDATA - ; - -emph -> (partext) - - "!!" -> ENDTAG "emph", - ; - -parm -> (partext) - -(parm) - ; - -cdrom -> (partext) - +(eqn, ex, figure, image, p, vex) -(acro | ineqn | csuser | user | - cursor | whitemenu | super | sub | whatsit | number | - xref | not | footnote | nobreak | fillin | leader | - tnote | tnoteref | cdrom) - ; - -fillin -> EMPTY - - length NAMETOKEN #REQUIRED - ; - -leader -> EMPTY - - type (SPACE | DOTS) DOTS, - ; - - - underline (UL| NOUL) NOUL, - intensity (FULLBRIGHT | HALFBRIGHT) FULLBRIGHT, - video (NOINVERSE | INVERSE) NOINVERSE, - blinking (BLINK | NOBLINK) NOBLINK - ; - -computer -> (#PCDATA | quote | keycap | var | ineqn | user | cursor | - super | sub | esc)* - - '"' -> &m-startquote, - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - "''" -> &m-endcomp, - "[[" -> &m-startkeycap, - "%%" -> &m-startvar, - "~~" -> "&m-endcomp;&m-startchi;", - "$$" -> "&m-endcomp;&m-startcfi;", - "@@" -> &m-startineqn, - "``" -> "&m-endcomp;&m-startcomputer", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - ; - -display -> (#PCDATA | keycap | var | ineqn | user | cursor | super | sub | - esc)* - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - "::" -> &m-enddisplay, - "[[" -> &m-startkeycap, - "%%" -> &m-startvar, - "@@" -> &m-startineqn, - "``" -> "&m-enddisplay;&m-startdisplay;", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - ; - -user -> (#PCDATA | keycap | var | ineqn | super | sub | esc | cursor)* - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - "[[" -> &m-startkeycap, - "%%" -> &m-startvar, - "~~" -> "&m-enduser;&m-startuhi;", - "$$" -> "&m-enduser;&m-startufi;", - "``" -> "&m-enduser;&m-startuser;", - "@@" -> &m-startineqn, - "^^" -> &m-startsuper, - "__" -> &m-startsub - ; - -cursor -> (#PCDATA | keycap | var | ineqn | super | sub | esc)* - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "W.W.W.W" -> &ellipsis, - "W.W.W.W.W" -> &pellipsis, - "[[" -> &m-startkeycap, - "%%" -> &m-startvar, - "~~" -> "&m-endcursor;&m-startcurhi;", - "$$" -> "&m-endcursor;&m-startcurfi;", - "``" -> "&m-endcursor;&m-startcursor;", - "@@" -> &m-startineqn, - "^^" -> &m-startsuper, - "__" -> &m-startsub - ; - -term -> (partext) - - -(emph | computer | display | term | var | ineqn | quote | user | - cursor | book | number | footnote | whatsit) - - base CDATA, - gloss (GLOSS | NOGLOSS) - - "++" -> ENDTAG "term", - ; - -quote -> (partext) - - '"' -> ENDTAG "quote", - ; - -number -> (#PCDATA) - ; - -keycap -> (#PCDATA | super | sub | esc)+ - -(need) - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "]]" -> ENDTAG "keycap", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - ; - -whitemenu -> (#PCDATA | super | sub | esc)+ - - "}}}" -> ENDTAG "whitemenu", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - ; - -softkey -> (skline +) - -(need) - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "}}" -> ENDTAG "softkey", - "W\" -> STARTTAG "skline", - "&#RS;W\" -> STARTTAG "skline", - "^^" -> &m-startsuper, - "__" -> &m-startsub, - ; - -skline -> (#PCDATA | super | sub | esc)+ - STARTTAG ENDTAG - ; - -super -> (#PCDATA | esc | super | sub | var)+ - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "%%" -> &m-startvar, - "__" -> &m-startsub, - "^^" -> ENDTAG "super" - ; - -sub -> (#PCDATA | esc | super | sub | var)+ - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "%%" -> &m-startvar, - "^^" -> &m-startsuper, - "__" -> ENDTAG "sub" - ; - -var -> (#PCDATA | sub | super | esc)+ - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "%%" -> ENDTAG "var", - "^^" -> &m-startsuper, - "__" -> &m-startsub - ; - -circle -> (#PCDATA) - -(need) - - "&\" -> &m-backslash, - "&<" -> &m-lt, - "&&" -> &m-and, - "))" -> ENDTAG "circle", - ; - -ineqn -> (#PCDATA | esc)+ - - "@@" -> ENDTAG "ineqn", - ; - -book -> (partext) - -(book) - ; - -not -> (#PCDATA | esc)+ - ; - -xref -> EMPTY - - id IDREF #REQUIRED - ; - --- Stuff following the chapters and appendixes: error messages, - bibliography, and glossary --- - -- Error Messages -- -message -> (chaphead?, !text?, (msg + | msgsub + ) ) - ENDTAG - - include CDATA, - exclude CDATA - ; - -msgsub -> (chaphead, !text?, msg +) - STARTTAG ENDTAG - - include CDATA, - exclude CDATA - ; - -msg -> (!msgnum?, msgtext, explain?) - ENDTAG - - "&#RE;" -> "&m-msgtxtst;" - ; - -msgnum -> (#PCDATA | esc)+ - - "&#RE;" -> "&m-msgnumend;&m-msgtxtst;", - STARTTAG ENDTAG - ; - -msgtext -> (partext) - +(newline) - STARTTAG ENDTAG - - ; - -explain -> (text) - ENDTAG - - ; - - -- Bibliography -- -biblio -> (head, !text?, bibsub +) - -(footnote) - ENDTAG - ; - -bibsub -> (!head?, !text?, references) - STARTTAG ENDTAG - ; - -references -> (item +) - - "&#RS;W*" -> STARTTAG "item", - ENDTAG - ; - - -- Glossary -- -glossary -> (!text?, (dterm, definition)+) - ENDTAG - ; - -dterm -> (partext) - -(term) - ENDTAG - - "&#RE;" -> ENDTAG "dterm", - "&&#RE;" -> " ", - ; - -definition -> (text) - STARTTAG ENDTAG - ; - --- List of index synonyms for "SEE" entries -- -idxsyn -> (synonym +) - -(term | footnote | need | fillin) - ENDTAG - ; - -synonym -> (seefromprimary, seefromsub?, seetoprimary, seetosub?) - STARTTAG ENDTAG - ; - -seefromprimary -> (partext, sort?) - - "W:W" -> STARTTAG "seefromsub", - "W->W" -> STARTTAG "seetoprimary", - STARTTAG ENDTAG - ; - -seefromsub -> (partext, sort?) - - "W->W" -> STARTTAG "seetoprimary", - STARTTAG ENDTAG - ; - -seetoprimary -> (partext, sort?) - - "W:W" -> STARTTAG "seetosub", - "&#RE;" -> ENDTAG "synonym", - STARTTAG ENDTAG - ; - -seetosub -> (partext, sort?) - - "&#RE;" -> ENDTAG "synonym", - STARTTAG ENDTAG - ; - --- Index -- --- Note: The index is automatically generated. It is included in - this DTD to simplify interface development, since many of its - subelements contain partext. -- - -index -> (idx-sect +) - -(idx | location) - ENDTAG - ; - -idx-sect -> (idx-letter, idx-entry +) - STARTTAG ENDTAG - ; - -idx-letter -> (partext) - STARTTAG ENDTAG - ; - -idx-entry -> (idx-primary-and-ref, idx-sub-and-ref*) - STARTTAG ENDTAG - ; - -idx-primary-and-ref -> (idx-primary, idx-refs?) - STARTTAG ENDTAG - ; - -idx-sub-and-ref -> (idx-sub, idx-refs) - STARTTAG ENDTAG - ; - -idx-refs -> (!idx-chap-ref*, (idx-vol, idx-chap-ref +)*, idx-syn*) - - ",W" -> STARTTAG "idx-chap-ref", - "-" -> STARTTAG "idx-start", - "W--W" -> STARTTAG "idx-end" - STARTTAG ENDTAG - ; - -idx-chap-ref -> (!idx-chap?, idx-start, (idx-ff | idx-end)?) - - main (MAIN) - STARTTAG ENDTAG - ; - -(idx-primary, idx-sub, idx-vol, idx-syn) -> - (partext) - STARTTAG ENDTAG - - ; - -(idx-chap, idx-start, idx-end) -> - (partext) - STARTTAG ENDTAG - ; - -idx-ff -> EMPTY - STARTTAG ENDTAG - ; - --- Formatting elements -- -newpage -> EMPTY - ; - -need -> EMPTY - - type (BEGIN | END | TOGETHER), - amount NUMBERTOKEN - ; - -nobreak -> (partext) - -(nobreak | need) - ; - -pageno -> EMPTY - - initial NAMETOKEN 1, - rev (BEGINREV | ENDREV) - ; diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/make.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/make.c deleted file mode 100644 index b53a1647c..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/make.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: make.c /main/3 1995/11/08 11:18:04 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ -/* Functions for pseudo-make features of HP Tag/TeX translator, i.e., - for testing which generated files are current and which must be - recreated. */ -/* - NOTE : This file is used as a Microsoft Linker overlay, so it cannot - have functions as pointers, eg. (proc *) f(). Routines that are - or invoke function pointers should be in tex.c. -*/ - -#if defined(hpux) || defined(_AIX) || defined(sun) -#include -#include -#endif - -#include - -#if defined(hpux) || defined(_AIX) || defined(sun) -#undef M_PI /* M_PI is used by markup, we don't need the math PI */ -#endif - -#include "userinc.h" -#include "globdec.h" - -/* Obsolete */ diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/need.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/need.c deleted file mode 100644 index 11bcf7a8e..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/need.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: need.c /main/3 1995/11/08 11:18:17 rswiston $ */ -/* Obsolete */ diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/option.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/option.c deleted file mode 100644 index f16728e84..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/option.c +++ /dev/null @@ -1,346 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: option.c /main/3 1995/11/08 11:18:32 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989, 1992 Hewlett-Packard Co. */ -/* Functions for command-line options for Help Tag/Cache Creek translator */ -#include "userinc.h" -#include "globdec.h" - -#if defined(hpux) || defined(_AIX) || defined(sun) -/* get definition of getenv(3c) for getting of environment variables */ -#include -#endif - - -/* Interpret options from command line and specified files */ -#define OPTLEN 512 /* If OPTLEN changes, change fscanf call below */ -#define TAGDOTOPT "helptag.opt" -#define DOTOPT ".opt" - -void options(LOGICAL filelenonly) -{ -int i; -FILE *optfile; -char option[OPTLEN + 1]; -char *nameofoptfile; - -/* Check helptag.opt in installation directory */ -nameofoptfile = (char *) m_malloc(strlen(install) + strlen(TAGDOTOPT) + 1, - "installation helptag.opt"); -strcpy(nameofoptfile, install); -strcat(nameofoptfile, TAGDOTOPT); -if (optfile = fopen(nameofoptfile, "r")) - { - while (fscanf(optfile, "%512s", option) != EOF) - setopt(option, filelenonly); - fclose(optfile); - } -m_free(nameofoptfile, "installation helptag.opt"); - -#if defined(hpux) || defined(_AIX) || defined(sun) -{ -char *opts; - -/* Check options in $TAGOPT */ -opts = getenv("TAGOPT"); -if (opts) - { - while (m_whitespace(*opts)) opts++; - while (sscanf(opts, "%512s", option) != EOF) - { - setopt(option, filelenonly); - opts += strlen(option); - while (m_whitespace(*opts)) opts++; - } - } -} -#endif /* hpux or _AIX or sun */ - -/* Check helptag.opt in input directory */ -if (indir) - { - nameofoptfile = (char *) m_malloc(strlen(indir) + strlen(TAGDOTOPT) + 1, - "input helptag.opt"); - strcpy(nameofoptfile, indir); - strcat(nameofoptfile, TAGDOTOPT); - } -else nameofoptfile = TAGDOTOPT; - -if (optfile = fopen(nameofoptfile, "r")) - { - while (fscanf(optfile, "%512s", option) != EOF) - setopt(option, filelenonly); - fclose(optfile); - } - -if (indir) m_free(nameofoptfile, "input helptag.opt"); - -/* Check basename.opt in input directory */ -nameofoptfile = (char *) m_malloc((indir ? strlen(indir) : 0) + - strlen(nodirbase) + strlen(DOTOPT) + 1, - "basename.opt"); -*nameofoptfile = M_EOS; - -if (indir) strcpy(nameofoptfile, indir); - -strcat(nameofoptfile, nodirbase); -strcat(nameofoptfile, DOTOPT); - -if (optfile = fopen(nameofoptfile, "r")) - { - while (fscanf(optfile, "%512s", option) != EOF) - setopt(option, filelenonly); - fclose(optfile); - } -m_free(nameofoptfile, "basename.opt"); - -/* Read command line options */ -for (i = 3 ; i < m_argc ; i++) - if (*m_argv[i] == '@') - { - if (optfile = fopen(m_argv[i] + 1, "r")) - { - while (fscanf(optfile, "%512s", option) != EOF) - setopt(option, filelenonly); - fclose(optfile); - } - else - { - m_mberr1("Unable to open option file %s", (m_argv[i] + 1)); - } - } - else setopt(m_argv[i], filelenonly); - -if (filelenonly) return ; - -if (optval) - { - m_mberr1("%s: Expecting value for option on command line or in option file", - optkey[optval - 1]); - } -optval = M_NULLVAL; -} - - -/* Set a single option */ -/* Workonly parameter described with function options()*/ -void setopt(char *string, LOGICAL filelenonly) -{ -char *p; -int thisopt; -LOGICAL ok; - -if (optval) - { - /* Ignore '=' by itself */ - if (*string == '=' && *(string + 1) == M_EOS) return; - setvalopt(optval, string, filelenonly); - optval = M_NULLVAL; - return; - } - -if (p = strchr(string, '=')) - { - *p = M_EOS; - for (thisopt = 0 ; thisopt < NUMOPTIONS ; thisopt++) - if (! m_mbmbupstrcmp(string, optkey[thisopt])) - break; - - /* Note: call setvalopt only if thisopt < NUMOPTIONS */ - ok = (LOGICAL) - ((thisopt < NUMOPTIONS) && setvalopt(thisopt + 1, p + 1, filelenonly)); - *p = '='; - if (! ok && ! filelenonly) - m_mberr1("%s: Unrecognized option on command line or in option file", - string); - return; - } /* End strchr(string, '=') */ - -for (thisopt = 0 ; thisopt < NUMOPTIONS ; thisopt++) - if (! m_mbmbupstrcmp(string, optkey[thisopt])) - break; - -if (thisopt >= NUMOPTIONS) - { - if (! filelenonly) - m_mberr1("%s: Unrecognized option on command line or in option file", - string); - return; - } -else switch(thisopt + 1) - { - case ONERROR: - case CHARSET: - case SEARCHKEY: - optval = thisopt + 1; - break; - case DRAFT: - final = FALSE; - break; - case FINAL: - final = TRUE; - break; -#if defined(FUTURE_FEATURE) - case GRAPHICS: - dofigure = SMOOTH; - break; - case NOGRAPHICS: - dofigure = FALSE; - break; - case REV: - prntrevs = TRUE; - break; - case NOREV: - prntrevs = FALSE; - break; - case TOC: - toc = TRUE; - if (tocfile!=NULL) - { - m_free(tocfile, "TOC option"); - tocfile = NULL; - } - break; - case NOTOC: - toc = FALSE; - if (tocfile!=NULL) - { - m_free(tocfile, "NOTOC option"); - tocfile = NULL; - } - break; - case INDEX: - break; - case NOINDEX: - break; -#endif /* FUTURE_FEATURE */ - case MEMO: - memo = TRUE; - break; - case NOMEMO: - memo = FALSE; - break; - case CLEARSEARCH: - { - SEARCH *searchp, *searchq; - - for (searchp = path ; searchp ;) - { - searchq = searchp; - searchp = searchp->next; - m_free(searchq->directory, "search directory"); - m_free(searchq, "search path"); - } - path = NULL; - endpath = &path; - break; - } - case LONGFILES: - case LONGFILE: - case LONG: - usingshortnames = FALSE; - break; - case SHORTFILES: - case SHORTFILE: - case SHORT: - usingshortnames = TRUE; - break; - } -} - -/* Process a value for a command line option */ -LOGICAL setvalopt(int thisopt, char *string, LOGICAL filelenonly) -{ -char *p; -int i; -char *tempstr; - -/* Ignore leading = (occurs if "option =val" is entered in .opt file) */ -if (*string == '=') string++; - -/* Check for empty string (occurs if "option= val" is entered in .opt file) */ -if (! *string) - switch(thisopt) - { - case SEARCHKEY: - case CHARSET: - case ONERROR: - optval = thisopt; - return TRUE; - default: - return FALSE; - } - -switch (thisopt) - { - case SEARCHKEY: - if ( (parentsrch==TRUE) && (*string!=M_EOS) && (*string!=dirsep) ) - { - /* prepend "..", for index processing in temporary sub-directory */ - tempstr = (char *) m_malloc( strlen(string) + 4, "tempstr search"); - strcpy(tempstr, ".."); - strcat(tempstr, SSEP); - strcat(tempstr, string); - } - else - { - tempstr = (char *) m_malloc( strlen(string) + 1, "tempstr search"); - strcpy(tempstr, string); - } - - *endpath = (SEARCH *) m_malloc(sizeof(SEARCH), "search path"); - p = strchr(tempstr, M_EOS); - if (p != tempstr && *(p - 1) != dirsep) - { - i = strlen(tempstr); - (*endpath)->directory = (char *) m_malloc(i + 2, - "search directory"); - strcpy((*endpath)->directory, tempstr); - (*endpath)->directory[i] = dirsep; - (*endpath)->directory[i + 1] = M_EOS; - } - else - { - (*endpath)->directory = (char *) m_malloc(strlen(tempstr) + 1, - "search directory"); - strcpy((*endpath)->directory, tempstr); - } - (*endpath)->next = NULL; - endpath = &(*endpath)->next; - m_free(tempstr, "tempstr search"); - return(TRUE); - case CHARSET: - m_free(helpcharset, "help charset"); - helpcharset = MakeWideCharString(string); - return TRUE; - case ONERROR: - if (! m_mbmbupstrcmp(string, "GO")) - stoponerror = FALSE; - else if (! m_mbmbupstrcmp(string, "STOP")) - stoponerror = TRUE; - else m_mberr1("Invalid ONERROR option: %s", string); - return(TRUE); - default: - return(FALSE); - } -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/out.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/out.c deleted file mode 100644 index 97cc0da1e..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/out.c +++ /dev/null @@ -1,533 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: out.c /main/4 1996/03/25 13:08:14 ageorge $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ -/* Functions for HPTag/TeX translator relevant to output of heads and - data characters */ - -#include "userinc.h" -#include "globdec.h" - - -/* Echo part of a head to the screen to indicate how much of the document - has been processed */ -void echohead(p) -M_WCHAR *p; -{ -char *mb_p,*mb_string; - -mb_string = MakeMByteString(p); - -fprintf(stderr, "%s", mb_string); - -m_free(mb_string,"multi-byte string"); -} - -/* call echohead with a literal string */ -void mb_echohead(p) -char *p; -{ -M_WCHAR *wc; - -wc = MakeWideCharString(p); -echohead(wc); -m_free(wc,"wide character string"); -} - - -/* Called at end of a head in a chapter, appendix, section, or - reference section */ -void endhead(void) -{ -if (savid) - { - if (w_strlen(xrefstring) + 1 > (sizeof(xrefstring) / sizeof(M_WCHAR))) - { - m_error("ID expansion too long"); - m_exit(TRUE); - } - - mb_shchar(M_EOS, - &xstrlen, - (sizeof(xrefstring) / sizeof(M_WCHAR)), - xrefstring, - idstring, - "Too many characters in corresponding cross-reference", - &iderr); - setid(savid, - TRUE, - TRUE, - inchapter, - chapstring, - xrffile, - xrfline, - TRUE); - } - -savehead[svheadlen] = M_EOS; -echo = savhd = FALSE; -} - -/* Process a character in an environment where spaces must be escaped */ -void esoutchar(M_WCHAR textchar) -{ -static M_WCHAR wsp = 0; - -if (!wsp) - { - char space[2]; - - space[0] = M_SPACE; - space[1] = 0; - mbtowc(&wsp, space, 1); - } - -if (textchar == wsp) - { - mb_strcode("\\", outfile); - } -outchar(textchar, outfile); -} - -/* Process a character in an example or an image paragraph */ -void exoutchar(M_WCHAR textchar) -{ -static M_WCHAR wsp = 0, wre; - -if (!wsp) - { - char string[2]; - - string[1] = 0; - string[0] = M_SPACE; - mbtowc(&wsp, string, 1); - string[0] = M_RE; - mbtowc(&wre, string, 1); - } - -if (textchar == wsp) fputs("\\ ", outfile); -else if (textchar == wre) - { - fputs("\n", outfile); - exlineno++; - if (tonumexlines) fprintf(outfile, " %d: ", exlineno); - } -else outchar(textchar, outfile); -} - -/* Write a character to be passed to the index file */ -void indexchar(M_WCHAR textchar) -{ -if (idxsavlen + 4 > (sizeof(idxsav) / sizeof(M_WCHAR))) - { - m_error("Internal error. Exceeded save buffer for index"); - m_exit(TRUE); - } -idxsav[idxsavlen++] = textchar; -} - - -/* Processes output for call out text */ -void outcall(M_WCHAR textchar, FILE *outfile) -{ -if (textchar != M_RE) - outchar(textchar, outfile); -} - -/* Processes a data character */ -void outchar(M_WCHAR textchar, FILE *outfile) -{ -M_WCHAR buffer[2]; -static M_WCHAR wnl = 0; -char mb_textchar[32]; /* arbitrarily large */ -unsigned char index; -int length; - -if (!wnl) - mbtowc(&wnl, "\n", 1); - -if (textchar == wnl) - { - if (multi_cr_flag) - { - return; - } - multi_cr_flag = TRUE; - } -else - { - multi_cr_flag = FALSE; - } - -if (echo) - { - buffer[0] = textchar; - buffer[1] = M_EOS; - echohead(buffer); - } - -cur_char = textchar; - -length = wctomb(mb_textchar, textchar); - -index = (unsigned char) mb_textchar[0]; -if ((length == 1) && special[index]) - mb_strcode(special[index], outfile); -else - realoutchar(textchar, outfile); -} /* end procedure outchar() */ - - -/* Called for processing instruction */ -void outpi(enttype, pi, entname) -int enttype; -M_WCHAR *pi; -M_WCHAR *entname; -{ -if (enttype == M_SDATA) - { - rshnewclear(); - } - -strcode(pi, outfile); - -if (echo) - { - if (entname) - { - mb_echohead(m_ero); - echohead(entname); - mb_echohead(m_refc); - } - else - { - mb_echohead(m_pio); - echohead(pi); - mb_echohead(m_pic); - } - } -} - -/* Called for normal paragraph spacing */ -void parspace(void) -{ -if (unleaded) /* unleaded is a one-shot flag */ - unleaded = FALSE; -} - -/* Really output a character */ -void realoutchar(M_WCHAR textchar, FILE *outfile) -{ -rshnewclear(); -if (! abbrev || fabbrev) - { - char mb_textchar[32]; /* arbitrarily large */ - int length, i; - - length = wctomb(mb_textchar, textchar); - if (tooutput) - for (i = 0; i < length; i++) - putc(mb_textchar[i], outfile); - - if (savid) - shchar(textchar, - &xstrlen, - (sizeof(xrefstring) / sizeof(M_WCHAR)), - xrefstring, - idstring, - "Too many characters in corresponding cross-reference", - &iderr); - - if (savhd) - shchar(textchar, - &svheadlen, - (sizeof(savehead) / sizeof(M_WCHAR)), - savehead, - svhdstring, - "Too many characters in head or caption", - &hderr); - - if (savtc) - shchar(textchar, - &svtclen, - (sizeof(savetabcap) / sizeof(M_WCHAR)), - savetabcap, - svtcstring, - "Too many characters in table caption", - &hderr); - } -} - -/* Save a character in the array used to store table of contents entries - when processing a head */ -void shchar(M_WCHAR textchar, int *len, int max, M_WCHAR *string, void (*proc)(M_WCHAR *string), char *msg, LOGICAL *errflg) -{ -char mb_textchar[32]; /* arbitrarily large */ -unsigned char index; -int length; - -length = wctomb(mb_textchar, textchar); - -index = (unsigned char) mb_textchar[0]; -if ((length == 1) && special[index]) - { - M_WCHAR *wc_special; - - wc_special = MakeWideCharString(special[index]); - (*proc)(wc_special); - m_free(wc_special,"wide character string"); - } -else - { - if (*len + 1 + 1 > max) - { - if (! *errflg) - { - m_error(msg); - *errflg = TRUE; - } - } - else - string[(*len)++] = textchar; - } -} - - -void mb_shchar(char textchar, - int *len, - int max, - M_WCHAR *string, - void (*proc)(M_WCHAR *string), - char *msg, LOGICAL *errflg) -{ -M_WCHAR wc_textchar; - -mbtowc(&wc_textchar, &textchar, 1); - -shchar(wc_textchar, len, max, string, proc, msg, errflg); -} - - -/* Save a string in the array used to store table of contents entries - when processing a head */ -void shstring(addstring, len, max, storestring, msg, errflg) -M_WCHAR *addstring; -int *len; -int max; -M_WCHAR *storestring; -char *msg; -LOGICAL *errflg; -{ -int addlength; - -addlength = w_strlen(addstring); -if (*len + addlength + 1 > max) - { - if (! *errflg) - { - m_error(msg); - *errflg = TRUE; - } - } -else - { - w_strcpy(&storestring[*len], addstring); - *len += addlength; - } -} - - -void mb_shstring(addstring, len, max, storestring, msg, errflg) -char *addstring; -int *len; -int max; -M_WCHAR *storestring; -char *msg; -LOGICAL *errflg; -{ -M_WCHAR *wc_addstring; - -wc_addstring = MakeWideCharString(addstring); -shstring(wc_addstring, len, max, storestring, msg, errflg); -m_free(wc_addstring,"wide character string"); -} - -/* Writes a string to the output file, and if appropriate saves it */ -void strcode(string, outfile) -M_WCHAR *string; -FILE *outfile; -{ -if (! abbrev || fabbrev) - { - if (tooutput) - { - char *mb_string; - - mb_string = MakeMByteString(string); - fputs(mb_string, outfile); - m_free(mb_string,"multi-byte string"); - } - - if (savid) - shstring(string, - &xstrlen, - (sizeof(xrefstring) / sizeof(M_WCHAR)), - xrefstring, - "Too many characters in corresponding cross-reference", - &iderr); - - if (savhd) - shstring(string, - &svheadlen, - (sizeof(savehead) / sizeof(M_WCHAR)), - savehead, - "Too many characters in head or caption", - &hderr); - - if (savtc) - shstring(string, - &svtclen, - (sizeof(savetabcap) / sizeof(M_WCHAR)), - savetabcap, - "Too many characters in table caption", - &hderr); - } -} - - -void mb_strcode(string, outfile) -char *string; -FILE *outfile; -{ -M_WCHAR *wc; - -wc = MakeWideCharString(string); -strcode(wc, outfile); -m_free(wc,"wide character string"); -} - -/* Copies string to end of buffer where saving head for table of contents */ -void svhdstring(string) -M_WCHAR *string; -{ -int length; - -length = w_strlen(string); -if (svheadlen + length + 1 > (sizeof(savehead) / sizeof(M_WCHAR))) - { - if (! hderr) - { - m_error("Too many characters in head or caption"); - hderr = TRUE; - } - return; - } -w_strcpy(&savehead[svheadlen], string); -svheadlen += length; -} - -/* Copies string to end of buffer where saving table caption */ -void svtcstring(string) -M_WCHAR *string; -{ -int length; - -length = w_strlen(string); -if (svtclen + length + 1 > (sizeof(savetabcap) / sizeof(M_WCHAR))) - { - if (! hderr) - { - m_error("Too many characters in table caption"); - hderr = TRUE; - } - return; - } -w_strcpy(&savetabcap[svtclen], string); -svtclen += length; -} - -/* Process a character in a term */ -void termchar(M_WCHAR textchar) -{ -if (termp - term >= MAXTERM) - { - if (termp - term == MAXTERM) - { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err4("Too many characters in %sTERM%s or %sDTERM%s", - wc_stago, - wc_tagc, - wc_stago, - wc_tagc); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - } - termp++; - } -if (! m_whitespace(textchar)) - { - *termp++ = textchar; - wsterm = FALSE; - } -else if (! wsterm) - { - wsterm = TRUE; - mbtowc(termp, " ", 1); - termp++; - } -} - -/* Process a PI in a term */ -void termpi(m_enttype, m_pi, m_entname) -int m_enttype; -M_WCHAR *m_pi; -M_WCHAR *m_entname; -{ -M_WCHAR *p, wc; -char *pc; - -outpi(m_enttype, m_pi, m_entname); -if (m_enttype == M_SDATA) - { - /* check for output of \needbegin, SDATA only */ - mbtowc(&wc, " ", 1); - if (! m_wcmbupstrcmp(m_entname, "SIGSPACE")) termchar(wc); - else - { - for (pc = m_ero ; *pc ; pc++) - { - mbtowc(&wc, pc, 1); - termchar(wc); - } - for (p = m_entname ; *p ; p++) termchar(*p); - for (pc = m_refc ; *pc ; pc++) - { - mbtowc(&wc, pc, 1); - termchar(wc); - } - } - } -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/roman8.h b/cde/programs/dthelp/parser.ccdf/htag/helptag/roman8.h deleted file mode 100644 index 546a01fcd..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/roman8.h +++ /dev/null @@ -1,288 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: roman8.h /main/3 1995/11/08 11:19:02 rswiston $ */ -EXTERN char *special[256] -#if defined(DEFINE) -= { -/* Char Name Roman8 Expansion (none needed) */ -/* */ -/* 0: ^@ NUL */ 0, -/* 1: ^A SOH */ 0, -/* 2: ^B STX */ 0, -/* 3: ^C ETX */ 0, -/* 4: ^D EOT */ 0, -/* 5: ^E ENQ */ 0, -/* 6: ^F ACK */ 0, -/* 7: ^G BEL */ 0, -/* 8: ^H BS */ 0, -/* 9: ^I HT */ 0, -/* 10: ^J LF */ 0, -/* 11: ^K VT */ 0, -/* 12: ^L FF */ 0, -/* 13: ^M CR */ 0, -/* 14: ^N SO */ 0, -/* 15: ^O SI */ 0, -/* 16: ^P DLE */ 0, -/* 17: ^Q DC1 */ 0, -/* 18: ^R DC2 */ 0, -/* 19: ^S DC3 */ 0, -/* 20: ^T DC4 */ 0, -/* 21: ^U NAK */ 0, -/* 22: ^V SYN */ 0, -/* 23: ^W ETB */ 0, -/* 24: ^X CAN */ 0, -/* 25: ^Y EM */ 0, -/* 26: ^Z SUB */ 0, -/* 27: ^[ ESC */ 0, -/* 28: ^\ FS */ 0, -/* 29: ^] GS */ 0, -/* 30: ^^ RS */ 0, -/* 31: ^_ US */ 0, -/* 32: SP */ 0, -/* 33: ! */ 0, -/* 34: " */ 0, -/* 35: # */ 0, -/* 36: $ */ 0, -/* 37: % */ 0, -/* 38: & */ 0, -/* 39: ' */ 0, -/* 40: ( */ 0, -/* 41: ) */ 0, -/* 42: * */ 0, -/* 43: + */ 0, -/* 44: , */ 0, -/* 45: - */ 0, -/* 46: . */ 0, -/* 47: / */ 0, -/* 48: 0 */ 0, -/* 49: 1 */ 0, -/* 50: 2 */ 0, -/* 51: 3 */ 0, -/* 52: 4 */ 0, -/* 53: 5 */ 0, -/* 54: 6 */ 0, -/* 55: 7 */ 0, -/* 56: 8 */ 0, -/* 57: 9 */ 0, -/* 58: : */ 0, -/* 59: ; */ 0, -/* 60: < */ "\\<", -/* 61: = */ 0, -/* 62: > */ 0, -/* 63: ? */ 0, -/* 64: @ */ 0, -/* 65: A */ 0, -/* 66: B */ 0, -/* 67: C */ 0, -/* 68: D */ 0, -/* 69: E */ 0, -/* 70: F */ 0, -/* 71: G */ 0, -/* 72: H */ 0, -/* 73: I */ 0, -/* 74: J */ 0, -/* 75: K */ 0, -/* 76: L */ 0, -/* 77: M */ 0, -/* 78: N */ 0, -/* 79: O */ 0, -/* 80: P */ 0, -/* 81: Q */ 0, -/* 82: R */ 0, -/* 83: S */ 0, -/* 84: T */ 0, -/* 85: U */ 0, -/* 86: V */ 0, -/* 87: W */ 0, -/* 88: X */ 0, -/* 89: Y */ 0, -/* 90: Z */ 0, -/* 91: [ */ 0, -/* 92: \\ */ "\\\\", -/* 93: ] */ 0, -/* 94: ^ */ 0, -/* 95: _ */ 0, -/* 96: ` */ 0, -/* 97: a */ 0, -/* 98: b */ 0, -/* 99: c */ 0, -/* 100: d */ 0, -/* 101: e */ 0, -/* 102: f */ 0, -/* 103: g */ 0, -/* 104: h */ 0, -/* 105: i */ 0, -/* 106: j */ 0, -/* 107: k */ 0, -/* 108: l */ 0, -/* 109: m */ 0, -/* 110: n */ 0, -/* 111: o */ 0, -/* 112: p */ 0, -/* 113: q */ 0, -/* 114: r */ 0, -/* 115: s */ 0, -/* 116: t */ 0, -/* 117: u */ 0, -/* 118: v */ 0, -/* 119: w */ 0, -/* 120: x */ 0, -/* 121: y */ 0, -/* 122: z */ 0, -/* 123: { */ 0, -/* 124: | */ 0, -/* 125: } */ 0, -/* 126: ~ */ 0, -/* 127: DEL */ 0, -/* 128: undefined */ 0, -/* 129: undefined */ 0, -/* 130: undefined */ 0, -/* 131: undefined */ 0, -/* 132: undefined */ 0, -/* 133: undefined */ 0, -/* 134: undefined */ 0, -/* 135: undefined */ 0, -/* 136: undefined */ 0, -/* 137: undefined */ 0, -/* 138: undefined */ 0, -/* 139: undefined */ 0, -/* 140: undefined */ 0, -/* 141: undefined */ 0, -/* 142: undefined */ 0, -/* 143: undefined */ 0, -/* 144: undefined */ 0, -/* 145: undefined */ 0, -/* 146: undefined */ 0, -/* 147: undefined */ 0, -/* 148: undefined */ 0, -/* 149: undefined */ 0, -/* 150: undefined */ 0, -/* 151: undefined */ 0, -/* 152: undefined */ 0, -/* 153: undefined */ 0, -/* 154: undefined */ 0, -/* 155: undefined */ 0, -/* 156: undefined */ 0, -/* 157: undefined */ 0, -/* 158: undefined */ 0, -/* 159: undefined */ 0, -/* 160: undefined */ 0, -/* 161: A grave */ 0, -/* 162: A circumflex */ 0, -/* 163: E grave */ 0, -/* 164: E circumflex */ 0, -/* 165: E dieresis */ 0, -/* 166: I circumflex */ 0, -/* 167: I dieresis */ 0, -/* 168: acute accent */ 0, -/* 169: grave accent */ 0, -/* 170: circumflex */ 0, -/* 171: dieresis */ 0, -/* 172: tilde */ 0, -/* 173: U grave */ 0, -/* 174: U circumflex */ 0, -/* 175: Italian Lira */ 0, -/* 176: overbar */ 0, -/* 177: Y acute */ 0, -/* 178: y acute */ 0, -/* 179: degree */ 0, -/* 180: C cedilla */ 0, -/* 181: c cedilla */ 0, -/* 182: N tilde */ 0, -/* 183: n tilde */ 0, -/* 184: inverted exclamation mark */ 0, -/* 185: inverted question mark */ 0, -/* 186: currency sign */ 0, -/* 187: pound sterling */ 0, -/* 188: Yen */ 0, -/* 189: Section sign */ 0, -/* 190: florin */ 0, -/* 191: Cent sign */ 0, -/* 192: a circumflex */ 0, -/* 193: e circumflex */ 0, -/* 194: o circumflex */ 0, -/* 195: u circumflex */ 0, -/* 196: a acute */ 0, -/* 197: e acute */ 0, -/* 198: o acute */ 0, -/* 199: u acute */ 0, -/* 200: a grave */ 0, -/* 201: e grave */ 0, -/* 202: o grave */ 0, -/* 203: u grave */ 0, -/* 204: a dieresis */ 0, -/* 205: e dieresis */ 0, -/* 206: o dieresis */ 0, -/* 207: u dieresis */ 0, -/* 208: A angstrom */ 0, -/* 209: i circumflex */ 0, -/* 210: O slash */ 0, -/* 211: AE ligature */ 0, -/* 212: a angstrom */ 0, -/* 213: i acute */ 0, -/* 214: o slash */ 0, -/* 215: ae ligature */ 0, -/* 216: A dieresis */ 0, -/* 217: i grave */ 0, -/* 218: O dieresis */ 0, -/* 219: U dieresis */ 0, -/* 220: E acute */ 0, -/* 221: i dieresis */ 0, -/* 222: SS ligature */ 0, -/* 223: O circumflex */ 0, -/* 224: A acute */ 0, -/* 225: A tilde */ 0, -/* 226: a tilde */ 0, -/* 227: Eth */ 0, -/* 228: eth */ 0, -/* 229: I acute */ 0, -/* 230: I grave */ 0, -/* 231: O acute */ 0, -/* 232: O grave */ 0, -/* 233: O tilde */ 0, -/* 234: o tilde */ 0, -/* 235: S caron */ 0, -/* 236: s caron */ 0, -/* 237: U acute */ 0, -/* 238: Y dieresis */ 0, -/* 239: y dieresis */ 0, -/* 240: Thorn */ 0, -/* 241: thorn */ 0, -/* 242: undefined */ 0, -/* 243: mu */ 0, -/* 244: paragraph sign */ 0, -/* 245: fraction 3/4 */ 0, -/* 246: long dash */ 0, -/* 247: fraction 1/4 */ 0, -/* 248: fraction 1/2 */ 0, -/* 249: Female ordinal */ 0, -/* 250: Male ordinal */ 0, -/* 251: French double open quote */ 0, -/* 252: Solid square */ 0, -/* 253: French double close quote */ 0, -/* 254: Plus over minus sign */ 0, -/* 255: undefined */ 0 -} -#endif -; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/special.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/special.c deleted file mode 100644 index a95e1ea7e..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/special.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: special.c /main/3 1995/11/08 11:19:19 rswiston $ */ -/****************************************************************************/ -/* */ -/* This program generates either one or both of two include files needed */ -/* for other programs. */ -/* */ -/* For the portion of HP Tag/Vectra that transforms characters into */ -/* their TeX equivalents, this program produces a file with entries that */ -/* consist of a comment field and either a 0 or a string entry. Within */ -/* the comment field is the character's eight-bit character code plus */ -/* the name of the character, as: */ -/* */ -/* 0: ^@ NUL */ -/* 60: < */ -/* 65: A */ -/* 159: undefined */ -/* 161: A grave */ -/* */ -/* and so on. The string entry is of the form: */ -/* */ -/* "\`A", */ -/* "\^A", */ -/* "{\bslash}", */ -/* */ -/* and so on. */ -/* */ -/* For the collating program used with indexing, this program produces a */ -/* file with entries that consist of a comment field, a number */ -/* representing the collating position of the character, a "handling" */ -/* field, and the character code of the lowercase representation of */ -/* those characters that also have uppercase representations. The */ -/* "handling" field is one of NORMAL, SPECIAL, or UNSUPP. Here are */ -/* examples showing the fields: */ -/* */ -/* * 63: ? * 54, SPECIAL, 63, */ -/* * 64: @ * 55, SPECIAL, 64, */ -/* * 65: A * 92, NORMAL, 97, */ -/* * 161: A grave * 94, NORMAL, 200, */ -/* * 162: A circumflex * 93, NORMAL, 192, */ -/* * 200: a grave * 86, NORMAL, 200, */ -/* */ -/* The question mark has ROMAN8 character code 63. Its collating */ -/* position as defined for the indexing program is 54. (That is, it */ -/* collates just before the at-sign.) It is given SPECIAL handling by */ -/* the collating program. Since it has no lowercase representation, the */ -/* number in this position is the same as its ROMAN8 character code. */ -/* The uppercase A has ROMAN8 character code 65. Its collating position */ -/* as defined for the indexing program is 92. (That is, it collates */ -/* just before A circumflex.) It is given NORMAL handling by the */ -/* collating program. Its lowercase representation is 200, the same as */ -/* lowercase a grave. */ -/* */ -/* The collating order for this program is specified in SPECIAL.H. The */ -/* collating order to be used by the indexing program can be changed by */ -/* modifying SPECIAL.H and recompiling and rerunning this program. For */ -/* example, at the moment, two of the lines in SPECIAL.H are: */ -/* */ -/* 162, "A circumflex", NORMAL, "\\^A", 192, */ -/* 161, "A grave", NORMAL, "\\`A", 200, */ -/* */ -/* Thus, A circumflex is specified to collate before A grave. If this */ -/* changes, and it is determined that A grave should collate first, it */ -/* would be necessary only to switch the lines, so they look like this: */ -/* */ -/* 161, "A grave", NORMAL, "\\`A", 200, */ -/* 162, "A circumflex", NORMAL, "\\^A", 192, */ -/* */ -/* In SPECIAL.H, only those characters that have ROMAN8 representations */ -/* are listed. The program generates the undefined positions in both */ -/* outputs. */ -/* */ -/* To output only the include file for generating TeX characters, run */ -/* this program with the "s" switch: */ -/* */ -/* SPECIAL S > output_file_name */ -/* */ -/* To output only the include file for generating the collating */ -/* sequence, run this program with the "c" switch: */ -/* */ -/* SPECIAL C > output_file_name */ -/* */ -/* To output both, run this program with the "b" switch, or with no */ -/* specification: */ -/* */ -/* SPECIAL B > output_file_name */ -/* SPECIAL > output_file_name */ -/* */ -/* In all cases, if you specify no redirected file name, the output goes */ -/* to the Vectra's screen. */ -/* */ -/****************************************************************************/ - -#define NORMAL 1 -#define SPECIAL 2 -#define UNSUPP 3 - -#define TRUE 1 -#define FALSE 0 - -#include -#include - -typedef wchar_t M_WCHAR; - -struct { - int charcode; - char *name ; - int handling; - char *texexpand ; - int lower; - } specials[] = { -#include "special.h" - } ; - -#define NOSPECIALS sizeof(specials)/sizeof(specials[0]) -#define NO8BITCHARS 256 -int invert[NO8BITCHARS], emptycell; - -main(argc, argv) -int argc; -char *argv[]; -{ -int i, both = FALSE, spec = FALSE, coll = FALSE, error = FALSE ; - -if (argc < 3) - { /* Either one argument or none; not more */ - if (argc == 2) - { - if (!stricmp(argv[1], "b")) both = TRUE; - else if (!stricmp(argv[1], "s")) spec = TRUE; - else if (!stricmp(argv[1], "c")) coll = TRUE; - else error = TRUE; - } - else both = TRUE; - } -else error = TRUE; -if (error) - { - fprintf(stderr,"Usage: SPECIAL [b | s | c]\n"); - exit (0); - } -for (i = 0 ; i < NOSPECIALS ; i++) -invert[specials[i].charcode] = i + 1; -if (both || spec) - { - printf("/* Char Name TeX Expansion */\n"); - printf("/* */\n"); - for (i = 0 ; i < NO8BITCHARS ; i++) - { - if (invert[i]) - { - printf("/* %3d: %-31s */ ", i, specials[invert[i] - 1].name) ; - if (specials[invert[i] - 1].texexpand) - printf("\"%s\"", specials[invert[i] - 1].texexpand) ; - else putchar('0') ; - } - else printf("/* %3d: undefined */ 0", i) ; - if (i < NO8BITCHARS - 1) putchar(',') ; - putchar('\n') ; - } - } -if (both || coll) - { - printf( - "/* */\n"); - printf( - "/* Char Name Coll Status Lower */\n"); - printf( - "/* */\n"); - for (i = 0, emptycell = NOSPECIALS + 1; i < NO8BITCHARS ; i++) - { - if (invert[i]) - { - printf("/* %3d: %-31s */ %3d, ", - specials[invert[i] - 1].charcode, - specials[invert[i] - 1].name, invert[i]) ; - switch (specials[invert[i] - 1].handling) - { - case NORMAL: - printf("NORMAL,"); - break; - case SPECIAL: - printf("SPECIAL,"); - break; - case UNSUPP: - printf("UNSUPP,"); - break; - } - if (specials[invert[i] - 1].lower) - printf(" %3d", specials[invert[i] - 1].lower); - else - printf(" %3d", specials[invert[i] - 1].charcode); - } - else - printf( - "/* %3d: undefined */ %3d, UNSUPP, %3d", - i, - emptycell++, - i) ; - if (i < NO8BITCHARS - 1) putchar(',') ; - putchar('\n') ; - } - } -return 0; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/special.h b/cde/programs/dthelp/parser.ccdf/htag/helptag/special.h deleted file mode 100644 index c0bd2f0eb..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/special.h +++ /dev/null @@ -1,244 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: special.h /main/3 1995/11/08 11:19:34 rswiston $ */ - 0, "^@ NUL", SPECIAL, NULL, 0, - 1, "^A SOH", SPECIAL, NULL, 0, - 2, "^B STX", SPECIAL, NULL, 0, - 3, "^C ETX", SPECIAL, NULL, 0, - 4, "^D EOT", SPECIAL, NULL, 0, - 5, "^E ENQ", SPECIAL, NULL, 0, - 6, "^F ACK", SPECIAL, NULL, 0, - 7, "^G BEL", SPECIAL, NULL, 0, - 8, "^H BS", SPECIAL, NULL, 0, - 9, "^I HT", SPECIAL, NULL, 0, - 10, "^J LF", SPECIAL, NULL, 0, - 11, "^K VT", SPECIAL, NULL, 0, - 12, "^L FF", SPECIAL, NULL, 0, - 13, "^M CR", SPECIAL, NULL, 0, - 14, "^N SO", SPECIAL, NULL, 0, - 15, "^O SI", SPECIAL, NULL, 0, - 16, "^P DLE", SPECIAL, NULL, 0, - 17, "^Q DC1", SPECIAL, NULL, 0, - 18, "^R DC2", SPECIAL, NULL, 0, - 19, "^S DC3", SPECIAL, NULL, 0, - 20, "^T DC4", SPECIAL, NULL, 0, - 21, "^U NAK", SPECIAL, NULL, 0, - 22, "^V SYN", SPECIAL, NULL, 0, - 23, "^W ETB", SPECIAL, NULL, 0, - 24, "^X CAN", SPECIAL, NULL, 0, - 25, "^Y EM", SPECIAL, NULL, 0, - 26, "^Z SUB", SPECIAL, NULL, 0, - 27, "^[ ESC", SPECIAL, NULL, 0, - 28, "^\\ FS", SPECIAL, NULL, 0, - 29, "^] GS", SPECIAL, NULL, 0, - 30, "^^ RS", SPECIAL, NULL, 0, - 31, "^_ US", SPECIAL, NULL, 0, - 32, "SP", SPECIAL, NULL, 0, - 33, "!", SPECIAL, NULL, 0, - 34, "\"", SPECIAL, NULL, 0, - 35, "#", SPECIAL, "\\\\#", 0, - 36, "$", SPECIAL, "\\\\dollar{}", 0, - 37, "%", SPECIAL, "\\\\%", 0, - 38, "&", SPECIAL, "\\\\&", 0, - 39, "'", SPECIAL, NULL, 0, - 40, "(", SPECIAL, NULL, 0, - 41, ")", SPECIAL, NULL, 0, - 42, "*", SPECIAL, NULL, 0, - 43, "+", SPECIAL, NULL, 0, - 44, ",", SPECIAL, NULL, 0, - 45, "-", SPECIAL, "{-}", 0, - 46, ".", SPECIAL, NULL, 0, - 47, "/", SPECIAL, NULL, 0, - 58, ":", SPECIAL, NULL, 0, - 59, ";", SPECIAL, NULL, 0, - 60, "<", SPECIAL, "{\\\\lthan}", 0, - 61, "=", SPECIAL, NULL, 0, - 62, ">", SPECIAL, "{\\\\gthan}", 0, - 63, "?", SPECIAL, NULL, 0, - 64, "@", SPECIAL, NULL, 0, - 91, "[", SPECIAL, NULL, 0, - 92, "\\\\", SPECIAL, "{\\\\bslash}", 0, - 93, "]", SPECIAL, NULL, 0, - 94, "^", SPECIAL, "\\\\string^", 0, - 95, "_", SPECIAL, "{\\\\under}", 0, - 96, "`", SPECIAL, NULL, 0, - 123, "{", SPECIAL, "{\\\\lbrac}", 0, - 124, "|", SPECIAL, "{\\\\vbar}", 0, - 125, "}", SPECIAL, "{\\\\rbrac}", 0, - 126, "~", SPECIAL, "\\\\string~", 0, - 184, "inverted exclamation mark", SPECIAL, "{!`}", 0, - 185, "inverted question mark", SPECIAL, "{?`}", 0, - 168, "acute accent", SPECIAL, "\\\\'{ }", 0, - 169, "grave accent", SPECIAL, "\\\\`{ }", 0, - 170, "circumflex", SPECIAL, "\\\\^{ }", 0, - 171, "dieresis", SPECIAL, "\\\\\\\"{ }", 0, - 172, "tilde", SPECIAL, "\\\\~{ }", 0, - 127, "DEL", SPECIAL, NULL, 0, - 48, "0", NORMAL, NULL, 0, - 49, "1", NORMAL, NULL, 0, - 50, "2", NORMAL, NULL, 0, - 51, "3", NORMAL, NULL, 0, - 52, "4", NORMAL, NULL, 0, - 53, "5", NORMAL, NULL, 0, - 54, "6", NORMAL, NULL, 0, - 55, "7", NORMAL, NULL, 0, - 56, "8", NORMAL, NULL, 0, - 57, "9", NORMAL, NULL, 0, - 97, "a", NORMAL, NULL, 0, - 192, "a circumflex", NORMAL, "\\\\^a", 0, - 200, "a grave", NORMAL, "\\\\`a", 0, - 196, "a acute", NORMAL, "\\\\'a", 0, - 204, "a dieresis", NORMAL, "\\\\\\\"a", 0, - 226, "a tilde", NORMAL, "\\\\~a", 0, - 212, "a angstrom", NORMAL, "{\\\\aa}", 0, - 215, "ae ligature", NORMAL, "{\\\\ae}", 0, - 65, "A", NORMAL, NULL, 97, - 162, "A circumflex", NORMAL, "\\\\^A", 192, - 161, "A grave", NORMAL, "\\\\`A", 200, - 224, "A acute", NORMAL, "\\\\'A", 196, - 216, "A dieresis", NORMAL, "\\\\\\\"A", 204, - 225, "A tilde", NORMAL, "\\\\~A", 226, - 208, "A angstrom", NORMAL, "{\\\\AA}", 212, - 211, "AE ligature", NORMAL, "{\\\\AE}", 215, - 98, "b", NORMAL, NULL, 0, - 66, "B", NORMAL, NULL, 98, - 99, "c", NORMAL, NULL, 0, - 67, "C", NORMAL, NULL, 99, - 181, "c cedilla", NORMAL, "\\\\c{c}", 0, - 180, "C cedilla", NORMAL, "\\\\c{C}", 181, - 68, "D", NORMAL, NULL, 100, - 100, "d", NORMAL, NULL, 0, - 101, "e", NORMAL, NULL, 0, - 193, "e circumflex", NORMAL, "\\\\^e", 0, - 201, "e grave", NORMAL, "\\\\`e", 0, - 197, "e acute", NORMAL, "\\\\'e", 0, - 205, "e dieresis", NORMAL, "\\\\\\\"e", 0, - 69, "E", NORMAL, NULL, 101, - 164, "E circumflex", NORMAL, "\\\\^E", 193, - 163, "E grave", NORMAL, "\\\\`E", 201, - 220, "E acute", NORMAL, "\\\\'E", 197, - 165, "E dieresis", NORMAL, "\\\\\\\"E", 205, - 102, "f", NORMAL, NULL, 0, - 70, "F", NORMAL, NULL, 102, - 103, "g", NORMAL, NULL, 0, - 71, "G", NORMAL, NULL, 103, - 104, "h", NORMAL, NULL, 0, - 72, "H", NORMAL, NULL, 104, - 105, "i", NORMAL, NULL, 0, - 209, "i circumflex", NORMAL, "{\\\\^\\\\i}", 0, - 217, "i grave", NORMAL, "{\\\\`\\\\i}", 0, - 213, "i acute", NORMAL, "{\\\\'\\\\i}", 0, - 221, "i dieresis", NORMAL, "{\\\\\\\"\\\\i}", 0, - 73, "I", NORMAL, NULL, 105, - 166, "I circumflex", NORMAL, "\\\\^I", 209, - 230, "I grave", NORMAL, "\\\\`I", 217, - 229, "I acute", NORMAL, "\\\\'I", 213, - 167, "I dieresis", NORMAL, "\\\\\\\"I", 221, - 106, "j", NORMAL, NULL, 0, - 74, "J", NORMAL, NULL, 106, - 107, "k", NORMAL, NULL, 0, - 75, "K", NORMAL, NULL, 107, - 108, "l", NORMAL, NULL, 0, - 76, "L", NORMAL, NULL, 108, - 109, "m", NORMAL, NULL, 0, - 77, "M", NORMAL, NULL, 109, - 110, "n", NORMAL, NULL, 0, - 183, "n tilde", NORMAL, "\\\\~n", 0, - 78, "N", NORMAL, NULL, 110, - 182, "N tilde", NORMAL, "\\\\~N", 183, - 111, "o", NORMAL, NULL, 0, - 194, "o circumflex", NORMAL, "\\\\^o", 0, - 202, "o grave", NORMAL, "\\\\`o", 0, - 198, "o acute", NORMAL, "\\\\'o", 0, - 206, "o dieresis", NORMAL, "\\\\\\\"o", 0, - 234, "o tilde", NORMAL, "\\\\~o", 0, - 214, "o slash", NORMAL, "{\\\\o}", 0, - 79, "O", NORMAL, NULL, 111, - 223, "O circumflex", NORMAL, "\\\\^O", 194, - 232, "O grave", NORMAL, "\\\\`O", 202, - 231, "O acute", NORMAL, "\\\\'O", 198, - 218, "O dieresis", NORMAL, "\\\\\\\"O", 206, - 233, "O tilde", NORMAL, "\\\\~O", 234, - 210, "O slash", NORMAL, "{\\\\O}", 214, - 112, "p", NORMAL, NULL, 0, - 80, "P", NORMAL, NULL, 112, - 113, "q", NORMAL, NULL, 0, - 81, "Q", NORMAL, NULL, 113, - 114, "r", NORMAL, NULL, 0, - 82, "R", NORMAL, NULL, 114, - 115, "s", NORMAL, NULL, 0, - 236, "s caron", NORMAL, "\\\\v{s}", 0, - 222, "SS ligature", NORMAL, "{\\\\ss}", 0, - 83, "S", NORMAL, NULL, 115, - 235, "S caron", NORMAL, "\\\\v{S}", 236, - 116, "t", NORMAL, NULL, 0, - 84, "T", NORMAL, NULL, 116, - 117, "u", NORMAL, NULL, 0, - 195, "u circumflex", NORMAL, "\\\\^u", 0, - 203, "u grave", NORMAL, "\\\\`u", 0, - 199, "u acute", NORMAL, "\\\\'u", 0, - 207, "u dieresis", NORMAL, "\\\\\\\"u", 0, - 85, "U", NORMAL, NULL, 117, - 174, "U circumflex", NORMAL, "\\\\^U", 195, - 173, "U grave", NORMAL, "\\\\`U", 203, - 237, "U acute", NORMAL, "\\\\'U", 199, - 219, "U dieresis", NORMAL, "\\\\\\\"U", 207, - 118, "v", NORMAL, NULL, 0, - 86, "V", NORMAL, NULL, 118, - 119, "w", NORMAL, NULL, 0, - 87, "W", NORMAL, NULL, 119, - 120, "x", NORMAL, NULL, 0, - 88, "X", NORMAL, NULL, 120, - 121, "y", NORMAL, NULL, 0, - 178, "y acute", NORMAL, "\\\\'y", 0, - 239, "y dieresis", NORMAL, "\\\\\\\"y", 0, - 89, "Y", NORMAL, NULL, 121, - 177, "Y acute", NORMAL, "\\\\'Y", 178, - 238, "Y dieresis", NORMAL, "\\\\\\\"Y", 239, - 122, "z", NORMAL, NULL, 0, - 90, "Z", NORMAL, NULL, 0, - 176, "overbar", UNSUPP, NULL, 0, - 179, "degree", UNSUPP, NULL, 0, - 189, "Section sign", UNSUPP, NULL, 0, - 191, "Cent sign", UNSUPP, NULL, 0, - 243, "mu", UNSUPP, NULL, 0, - 244, "paragraph sign", UNSUPP, NULL, 0, - 246, "long dash", UNSUPP, NULL, 0, - 249, "Female ordinal", UNSUPP, NULL, 0, - 250, "Male ordinal", UNSUPP, NULL, 0, - 254, "Plus over minus sign", UNSUPP, NULL, 0, - 175, "Italian Lira", UNSUPP, NULL, 0, - 186, "currency sign", UNSUPP, NULL, 0, - 187, "pound sterling", UNSUPP, NULL, 0, - 188, "Yen", UNSUPP, NULL, 0, - 190, "florin", UNSUPP, NULL, 0, - 227, "Eth", UNSUPP, NULL, 0, - 228, "eth", UNSUPP, NULL, 0, - 240, "Thorn", UNSUPP, NULL, 0, - 241, "thorn", UNSUPP, NULL, 0, - 245, "fraction 3/4", UNSUPP, NULL, 0, - 247, "fraction 1/4", UNSUPP, NULL, 0, - 248, "fraction 1/2", UNSUPP, NULL, 0, - 251, "French double open quote", UNSUPP, NULL, 0, - 252, "Solid square", UNSUPP, NULL, 0, - 253, "French double close quote", UNSUPP, NULL, NULL diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/table.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/table.c deleted file mode 100644 index 8e53b06d2..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/table.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: table.c /main/3 1995/11/08 11:19:50 rswiston $ */ -/* Obsolete */ diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/tex.h b/cde/programs/dthelp/parser.ccdf/htag/helptag/tex.h deleted file mode 100644 index 3762be76b..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/tex.h +++ /dev/null @@ -1,288 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: tex.h /main/3 1995/11/08 11:20:04 rswiston $ */ -EXTERN char *special[256] -#if defined(DEFINE) -= { -/* Char Name TeX Expansion */ -/* */ -/* 0: ^@ NUL */ 0, -/* 1: ^A SOH */ 0, -/* 2: ^B STX */ 0, -/* 3: ^C ETX */ 0, -/* 4: ^D EOT */ 0, -/* 5: ^E ENQ */ 0, -/* 6: ^F ACK */ 0, -/* 7: ^G BEL */ 0, -/* 8: ^H BS */ 0, -/* 9: ^I HT */ 0, -/* 10: ^J LF */ 0, -/* 11: ^K VT */ 0, -/* 12: ^L FF */ 0, -/* 13: ^M CR */ 0, -/* 14: ^N SO */ 0, -/* 15: ^O SI */ 0, -/* 16: ^P DLE */ 0, -/* 17: ^Q DC1 */ 0, -/* 18: ^R DC2 */ 0, -/* 19: ^S DC3 */ 0, -/* 20: ^T DC4 */ 0, -/* 21: ^U NAK */ 0, -/* 22: ^V SYN */ 0, -/* 23: ^W ETB */ 0, -/* 24: ^X CAN */ 0, -/* 25: ^Y EM */ 0, -/* 26: ^Z SUB */ 0, -/* 27: ^[ ESC */ 0, -/* 28: ^\ FS */ 0, -/* 29: ^] GS */ 0, -/* 30: ^^ RS */ 0, -/* 31: ^_ US */ 0, -/* 32: SP */ 0, -/* 33: ! */ 0, -/* 34: " */ 0, -/* 35: # */ "\\#", -/* 36: $ */ "{\\dollar}", -/* 37: % */ "\\%", -/* 38: & */ "\\&", -/* 39: ' */ "{'}", -/* 40: ( */ 0, -/* 41: ) */ 0, -/* 42: * */ 0, -/* 43: + */ 0, -/* 44: , */ 0, -/* 45: - */ "{-}", -/* 46: . */ 0, -/* 47: / */ 0, -/* 48: 0 */ 0, -/* 49: 1 */ 0, -/* 50: 2 */ 0, -/* 51: 3 */ 0, -/* 52: 4 */ 0, -/* 53: 5 */ 0, -/* 54: 6 */ 0, -/* 55: 7 */ 0, -/* 56: 8 */ 0, -/* 57: 9 */ 0, -/* 58: : */ 0, -/* 59: ; */ 0, -/* 60: < */ "{\\lthan}", -/* 61: = */ 0, -/* 62: > */ "{\\gthan}", -/* 63: ? */ 0, -/* 64: @ */ 0, -/* 65: A */ 0, -/* 66: B */ 0, -/* 67: C */ 0, -/* 68: D */ 0, -/* 69: E */ 0, -/* 70: F */ 0, -/* 71: G */ 0, -/* 72: H */ 0, -/* 73: I */ 0, -/* 74: J */ 0, -/* 75: K */ 0, -/* 76: L */ 0, -/* 77: M */ 0, -/* 78: N */ 0, -/* 79: O */ 0, -/* 80: P */ 0, -/* 81: Q */ 0, -/* 82: R */ 0, -/* 83: S */ 0, -/* 84: T */ 0, -/* 85: U */ 0, -/* 86: V */ 0, -/* 87: W */ 0, -/* 88: X */ 0, -/* 89: Y */ 0, -/* 90: Z */ 0, -/* 91: [ */ 0, -/* 92: \\ */ "{\\bslash}", -/* 93: ] */ 0, -/* 94: ^ */ "\\string^", -/* 95: _ */ "{\\under}", -/* 96: ` */ "{`}", -/* 97: a */ 0, -/* 98: b */ 0, -/* 99: c */ 0, -/* 100: d */ 0, -/* 101: e */ 0, -/* 102: f */ 0, -/* 103: g */ 0, -/* 104: h */ 0, -/* 105: i */ 0, -/* 106: j */ 0, -/* 107: k */ 0, -/* 108: l */ 0, -/* 109: m */ 0, -/* 110: n */ 0, -/* 111: o */ 0, -/* 112: p */ 0, -/* 113: q */ 0, -/* 114: r */ 0, -/* 115: s */ 0, -/* 116: t */ 0, -/* 117: u */ 0, -/* 118: v */ 0, -/* 119: w */ 0, -/* 120: x */ 0, -/* 121: y */ 0, -/* 122: z */ 0, -/* 123: { */ "{\\lbrac}", -/* 124: | */ "{\\vbar}", -/* 125: } */ "{\\rbrac}", -/* 126: ~ */ "\\string~", -/* 127: DEL */ 0, -/* 128: undefined */ 0, -/* 129: undefined */ 0, -/* 130: undefined */ 0, -/* 131: undefined */ 0, -/* 132: undefined */ 0, -/* 133: undefined */ 0, -/* 134: undefined */ 0, -/* 135: undefined */ 0, -/* 136: undefined */ 0, -/* 137: undefined */ 0, -/* 138: undefined */ 0, -/* 139: undefined */ 0, -/* 140: undefined */ 0, -/* 141: undefined */ 0, -/* 142: undefined */ 0, -/* 143: undefined */ 0, -/* 144: undefined */ 0, -/* 145: undefined */ 0, -/* 146: undefined */ 0, -/* 147: undefined */ 0, -/* 148: undefined */ 0, -/* 149: undefined */ 0, -/* 150: undefined */ 0, -/* 151: undefined */ 0, -/* 152: undefined */ 0, -/* 153: undefined */ 0, -/* 154: undefined */ 0, -/* 155: undefined */ 0, -/* 156: undefined */ 0, -/* 157: undefined */ 0, -/* 158: undefined */ 0, -/* 159: undefined */ 0, -/* 160: undefined */ 0, -/* 161: A grave */ "\\`A", -/* 162: A circumflex */ "\\^A", -/* 163: E grave */ "\\`E", -/* 164: E circumflex */ "\\^E", -/* 165: E dieresis */ "\\\042E", -/* 166: I circumflex */ "\\^I", -/* 167: I dieresis */ "\\\042I", -/* 168: acute accent */ "\\'{ }", -/* 169: grave accent */ "\\`{ }", -/* 170: circumflex */ "\\^{ }", -/* 171: dieresis */ "\\\042{ }", -/* 172: tilde */ "\\~{ }", -/* 173: U grave */ "\\`U", -/* 174: U circumflex */ "\\^U", -/* 175: Italian Lira */ 0, -/* 176: overbar */ 0, -/* 177: Y acute */ "\\'Y", -/* 178: y acute */ "\\'y", -/* 179: degree */ 0, -/* 180: C cedilla */ "\\c{C}", -/* 181: c cedilla */ "\\c{c}", -/* 182: N tilde */ "\\~N", -/* 183: n tilde */ "\\~n", -/* 184: inverted exclamation mark */ "{!`}", -/* 185: inverted question mark */ "{?`}", -/* 186: currency sign */ 0, -/* 187: pound sterling */ 0, -/* 188: Yen */ 0, -/* 189: Section sign */ 0, -/* 190: florin */ 0, -/* 191: Cent sign */ 0, -/* 192: a circumflex */ "\\^a", -/* 193: e circumflex */ "\\^e", -/* 194: o circumflex */ "\\^o", -/* 195: u circumflex */ "\\^u", -/* 196: a acute */ "\\'a", -/* 197: e acute */ "\\'e", -/* 198: o acute */ "\\'o", -/* 199: u acute */ "\\'u", -/* 200: a grave */ "\\`a", -/* 201: e grave */ "\\`e", -/* 202: o grave */ "\\`o", -/* 203: u grave */ "\\`u", -/* 204: a dieresis */ "\\\042a", -/* 205: e dieresis */ "\\\042e", -/* 206: o dieresis */ "\\\042o", -/* 207: u dieresis */ "\\\042u", -/* 208: A angstrom */ "{\\AA}", -/* 209: i circumflex */ "{\\^\\i}", -/* 210: O slash */ "{\\O}", -/* 211: AE ligature */ "{\\AE}", -/* 212: a angstrom */ "{\\aa}", -/* 213: i acute */ "{\\'\\i}", -/* 214: o slash */ "{\\o}", -/* 215: ae ligature */ "{\\ae}", -/* 216: A dieresis */ "\\\042A", -/* 217: i grave */ "{\\`\\i}", -/* 218: O dieresis */ "\\\042O", -/* 219: U dieresis */ "\\\042U", -/* 220: E acute */ "\\'E", -/* 221: i dieresis */ "{\\\042\\i}", -/* 222: SS ligature */ "{\\ss}", -/* 223: O circumflex */ "\\^O", -/* 224: A acute */ "\\'A", -/* 225: A tilde */ "\\~A", -/* 226: a tilde */ "\\~a", -/* 227: Eth */ 0, -/* 228: eth */ 0, -/* 229: I acute */ "\\'I", -/* 230: I grave */ "\\`I", -/* 231: O acute */ "\\'O", -/* 232: O grave */ "\\`O", -/* 233: O tilde */ "\\~O", -/* 234: o tilde */ "\\~o", -/* 235: S caron */ "\\v{S}", -/* 236: s caron */ "\\v{s}", -/* 237: U acute */ "\\'U", -/* 238: Y dieresis */ "\\\042Y", -/* 239: y dieresis */ "\\\042y", -/* 240: Thorn */ 0, -/* 241: thorn */ 0, -/* 242: undefined */ 0, -/* 243: mu */ 0, -/* 244: paragraph sign */ 0, -/* 245: fraction 3/4 */ 0, -/* 246: long dash */ 0, -/* 247: fraction 1/4 */ 0, -/* 248: fraction 1/2 */ 0, -/* 249: Female ordinal */ 0, -/* 250: Male ordinal */ 0, -/* 251: French double open quote */ 0, -/* 252: Solid square */ 0, -/* 253: French double close quote */ 0, -/* 254: Plus over minus sign */ 0, -/* 255: undefined */ 0 -} -#endif -; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/helptag/xref.c b/cde/programs/dthelp/parser.ccdf/htag/helptag/xref.c deleted file mode 100644 index 87d409490..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/helptag/xref.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: xref.c /main/3 1995/11/08 11:20:14 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -/* HP Tag to TeX cross-reference processing */ - -#include "userinc.h" -#include "globdec.h" - -/* Chk for duplicate xref id's, called in TEST, S1, S2, S3, S4, and rsect. */ -M_WCHAR *checkid(id) -M_WCHAR *id; -{ -struct xref *xref; -char *buffer; -char *mb_id; - -if (!id) return(NULL); - -m_getline(&xrffile, &xrfline); -if (xrffile == NULL) - { - /* set to primary input */ - xrffile = inputname; - } - -xref = (struct xref*) m_lookfortrie(id, &xtree); -if (!xref) return(id); /* not in trie, so not previously defined */ - -if (!(xref->wheredef)) /* defined only in previous pass */ - return(id); - -/* else, we have a duplicate definition of id */ -m_err1("Redefinition of ID '%s'", id); -mb_id = MakeMByteString(id); -buffer = (char *) m_malloc(1 + strlen(firstused) + strlen(mb_id) + 6, - "error buffer"); -sprintf(buffer, firstused, mb_id, xref->line); -m_errline(buffer); -m_free(buffer, "error buffer"); -m_free(mb_id,"multi-byte string"); - -if (xref->file) - { - char *mb_file; - - mb_file = MakeMByteString(xref->file); - buffer = (char *) m_malloc(1 - 2 + strlen(offile) + strlen(mb_file), - "error buffer"); - sprintf(buffer, offile, mb_file); - m_errline(buffer); - m_free(buffer, "error buffer"); - m_free(mb_file,"multi-byte string"); - } -m_errline(".\n"); -return(NULL); -} - -/* Write a single cross-reference macro definition */ -void defxref(xfile, id, xref) -FILE *xfile; -M_WCHAR *id; -struct xref *xref; -{ -char *csname; -char *p; -char *buffer; - -csname = MakeMByteString(id); -if (xref->defined) - { - char *mb_text; - - mb_text = MakeMByteString(xref->textptr); - fprintf(xfile, - "\\definexref %s\\\\endxref\001%s\002\001%s", - csname, - mb_text, - xref->chapstring); - fprintf(xfile, - "\002\001%c\002\001%s\002\001%c\002%%\n", - xref->csensitive ? 'Y' : 'N', - xref->inchapter ? "\\LOCchap" : "\\LOCapp", - xref->xrefable ? 'Y' : 'N'); - m_free(mb_text,"multi-byte string"); - } -else - { - fprintf(xfile, "\\undefinedxref %s\\\\endxref\001", csname); - for (p = csname; *p ; p++) - outchar(*p, xfile); - fputs("\002%\n", xfile); - m_eprefix(); /* correctly delimit error in error file */ - buffer = (char *) m_malloc(1 - 2 + strlen(undef) + w_strlen(id), - "error buffer"); - sprintf(buffer, undef, csname); - m_errline(buffer); - m_free(buffer, "error buffer"); - if (xref->file) - { - char *mb_file; - - mb_file = MakeMByteString(xref->file); - buffer = (char *) m_malloc(1 - 2 + strlen(infile) + - strlen(mb_file), - "error buffer"); - sprintf(buffer, infile, mb_file); - m_errline(buffer); - m_free(buffer, "error buffer"); - m_free(mb_file,"multi-byte string"); - } - buffer = (char *) m_malloc(1 - 2 + strlen(online) + 10, - "error buffer"); - sprintf(buffer, online, xref->line); - m_errline(buffer); - m_free(buffer, "error buffer"); - } -m_free(csname, "csname"); -} - -/* Write cross-reference file for next time document is processed - and TeX macro file for post-processing this pass */ -void dumpxref(void) -{ -int n; -M_WCHAR id[M_NAMELEN + 1]; -M_TRIE *node[M_NAMELEN + 1]; -M_TRIE *current; -FILE *tex; - -strcpy(helpext, ".xrh"); -tex = fopen(helpbase, "w"); -fprintf(tex, "\\gobble\001%s\002%%\n", m_signon); -fputs("% Generated Cross-Reference Macros (for a particular document)\n", tex); -if (! xtree.data) return; - -n = 0; -current = xtree.data; -while (TRUE) - { - id[n] = current->symbol; - node[n] = current->next; - if (! id[n]) - { - /* Process one table entry */ - defxref(tex, id, (struct xref *) current->data); - - /* Look for the next one */ - current = current->next; - while (! current) - { - n--; - if (n < 0) - { - fclose(tex); - return; - } - current = node[n]; - } - } - else - { - current = current->data; - n++; - } - } -} - -/* Copies string to end of current cross-reference string */ -void idstring(string) -M_WCHAR *string; -{ -int length; - -length = w_strlen(string); -if (xstrlen + length + 1 > (sizeof(xrefstring) / sizeof(M_WCHAR))) - { - if (! iderr) - { - m_error( - "Internal error. Too many characters in cross-reference expansion."); - iderr = TRUE; - } - return; - } - -w_strcpy(&xrefstring[xstrlen],string); -xstrlen += length; -} - -/* Initializes cross-reference table reading in file output from previous - pass through document */ -void loadxref(void) -{ -M_WCHAR id[M_NAMELEN + 1]; -char c, d; -int nextc; -int n; -LOGICAL csensitive; -LOGICAL inchapter; -LOGICAL xrefable; -char chapnum[15]; -char string[15]; -int braces; -M_WCHAR *p, *pStart; -static M_WCHAR wbs = 0, wca, wcb, wnl, weof; - -if (! xrf) return; - -if (!wbs) - { - char mb_eof; - - mbtowc(&wbs, "\\", 1); - mbtowc(&wca, "\001", 1); /* ^A */ - mbtowc(&wcb, "\002", 1); /* ^B */ - mbtowc(&wnl, "\n", 1); - mb_eof = EOF; - mbtowc(&weof, &mb_eof, 1); - } - -while (TRUE) - { - if (fscanf(xrf, "%14s ", string) != 1) - { - fclose(xrf); - return; - } - if (! strcmp(string, "\\undefinedxref")) - { - for (nextc = mb_getwc(xrf); - (nextc != wnl) && (nextc != weof); - nextc = mb_getwc(xrf) - ); - continue; - } - for (n = 0; n <= M_NAMELEN ; n++) - { - nextc = mb_getwc(xrf); /* use mb_getwc to read multi-byte chars */ - if (nextc == weof) - { - m_error("Incomplete cross-reference file."); - fclose(xrf); - return; - } - if (nextc == wbs) break; - id[n] = nextc; - } - if (n > M_NAMELEN) - { - m_error("Error in cross-reference file."); - fclose(xrf); - return; - } - pStart = p = MakeWideCharString("\\endxref\001"); - for (; *p ; p++) - { - nextc = mb_getwc(xrf); - if (nextc != *p) - { - m_free(pStart,"wide character string"); - m_error("Error in cross-reference file."); - fclose(xrf); - return; - } - } - m_free(pStart,"wide character string"); - id[n] = M_EOS; - for (xstrlen = 0, braces = 1; - xstrlen < (sizeof(xrefstring) / sizeof(M_WCHAR)); - xstrlen++) - { - xrefstring[xstrlen] = mb_getwc(xrf); - if (xrefstring[xstrlen] == wca) braces++; - else if (xrefstring[xstrlen] == wcb) if (! --braces) break; - } - if (xstrlen >= (sizeof(xrefstring) / sizeof(M_WCHAR))) - { - m_error("Error in cross-reference file"); - fclose(xrf); - return; - } - - xrefstring[xstrlen] = M_EOS; - if ((fscanf(xrf, - "\001%14[^\002]\002\001%c\002\001%8[^\002]\002\001%c\002%%\n", - chapnum, &c, string, &d) != 4) || - (c != 'Y' && c != 'N') || (d != 'Y' && d != 'N') || - (strcmp(string, "\\LOCapp") && strcmp(string, "\\LOCchap")) - ) - { - m_error("Error in cross-reference file"); - fclose(xrf); - return; - } - csensitive = (LOGICAL) (c == 'Y'); - inchapter = (LOGICAL) (strcmp(string, "\\LOCchap") == FALSE); - xrefable = (LOGICAL) (d == 'Y'); - setid(id, - FALSE, - csensitive, - inchapter, - chapnum, - NULL, - 0, - xrefable); - } -/* fclose(xrf); /* not reachable; left in for future reference */ -} - - -/* Save a cross-reference ID and associated expansion */ -void setid(M_WCHAR *id, LOGICAL where, LOGICAL csensitive, LOGICAL inchapter, - char *chapter, M_WCHAR *xrffile, int xrfline, LOGICAL xrefable) -s{ -struct xref *old; -struct xref *xref; -char *buffer; - -if (! *id || ! *xrefstring) - { - m_err2("Erroneous cross reference of `%s' for id `%s'", - xrefstring, - id); - return; - } -xref = (struct xref *) m_malloc(sizeof(struct xref), "xref"); -if (old = (struct xref *) m_ntrtrie(id, &xtree, (M_TRIE *) xref)) - { - m_free(xref, "xref"); - xref = old; - if (xref->wheredef) - { - char *mb_id; - - mb_id = MakeMByteString(id); - m_err1("Redefinition of ID '%s'", id); - buffer = (char *) - m_malloc(1 + strlen(firstused) + w_strlen(id) + 6, - "error buffer"); - sprintf(buffer, firstused, mb_id, xref -> line); - m_errline(buffer); - m_free(buffer, "error buffer"); - m_free(mb_id,"multi-byte string"); - if (xref->file) - { - char *mb_file; - - mb_file = MakeMByteString(xref->file); - buffer = (char *) - m_malloc(1 - 2 + strlen(offile) + strlen(mb_file), - "error message"); - sprintf(buffer, offile, mb_file); - m_errline(buffer); - m_free(buffer, "error buffer"); - m_free(mb_file,"multi-byte string"); - } - m_errline(".\n"); - return; - } - if (xref->defined) - { - m_free(xref->chapstring, "xref chapter string"); - m_free(xref->textptr, "xref text pointer"); - } - } -else xref->retrieved = FALSE; - -xref->defined = TRUE; -xref->wheredef = where; -xref->csensitive = csensitive; -xref->inchapter = inchapter; -xref->chapstring = - (char *) m_malloc(strlen(chapter) + 1, "xref chapter string"); -xref->textptr = (M_WCHAR *) m_malloc(xstrlen + 1, "xref text pointer"); -strcpy(xref->chapstring, chapter); -w_strcpy(xref->textptr, xrefstring); -xref->file = xrffile; -xref->line = xrfline; -xref->xrefable = xrefable; -xstrlen = 0; -savid = NULL; -} - -/* Generate a cross-reference */ -void xrefexpand(id) -M_WCHAR *id; -{ -struct xref *xref; -struct xref *old; -#define format "\\" -char *texcode; -char *csname; - -/* ID is 0 in case of a parameter error which MARKUP will report */ -if (! id) return; - -/* Write call to generated macro in output file */ -csname = MakeMByteString(id); -texcode = (char *) m_malloc(sizeof(format) + strlen(csname), "texcode"); -sprintf(texcode, format, csname); - -if (echo) - { - mb_echohead(m_stago); - mb_echohead("XREF "); - echohead(id); - mb_echohead(m_tagc); - } - -if (savhd) - mb_shstring(texcode, - &svheadlen, - (sizeof(savehead) / sizeof(M_WCHAR)), - savehead, - "Too many characters in head or caption", - &hderr); - -if (savtc) - mb_shstring(texcode, - &svtclen, - (sizeof(savetabcap) / sizeof(M_WCHAR)), - savetabcap, - "Too many characters in table caption", - &hderr); - -if (savid) - mb_shstring(texcode, - &xstrlen, - (sizeof(xrefstring) / sizeof(M_WCHAR)), - xrefstring, - "Too many characters in corresponding cross-reference", - &iderr); - -/* Enter id in xref table if it's not already there */ -xref = (struct xref *) m_malloc(sizeof(struct xref), "xref"); -if (old = (struct xref *) m_ntrtrie(id, &xtree, (M_TRIE *) xref)) - { - /* non-NULL, we had an old one */ - m_free(xref, "xref"); - xref = old; - if (! xref->xrefable) - { - m_error("You can't cross reference to that type of tag"); - /* but put out the string anyway... */ - - /* decrement error counter to treat this as a warning */ - m_errcnt--; - } - if (xref->textptr) - { - /* we have an expansion */ - char *mb_textptr; - - mb_textptr = MakeMByteString(xref->textptr); - fprintf(outfile, - "%s", - global_linktype, - csname, - mb_textptr); - m_free(mb_textptr,"multi-byte string"); - } - else - { /* expansion */ - /* dump out a tag string as a placeholder */ - fputs(texcode, outfile); - /* not really forward, but a null string */ - have_forward_xrefs = TRUE; - /* xref->defined = FALSE; - xref->retrieved = FALSE; - xref->textptr = NULL; - xref->wheredef = FALSE;*/ - } - } -else - { /* no old xref */ - if (rebuild) - { - m_errline( - "Unresolved xrefs. Running HelpTag a second time may help.\n"); - rebuild = FALSE; /* one error message will do */ - } - have_forward_xrefs = TRUE; - xref->defined = FALSE; - xref->retrieved = FALSE; - xref->textptr = NULL; - xref->wheredef = FALSE; - - /* This is a forward ref. We assume it is xrefable */ - /* It will be set correctly if and when the ref is defined */ - xref->xrefable = TRUE; - - fputs(texcode, outfile); - } - -/* Record retrieval status if this is the first reference */ -if (! xref->retrieved && ! xref->defined) - { - m_getline(&xref->file, &xref->line); - if (xref->file == NULL) - { - /* set to primary input */ - xref->file = inputname; - } - xref->retrieved = TRUE; - } -m_free(texcode, "texcode buffer"); -m_free(csname, "csname"); -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/Imakefile b/cde/programs/dthelp/parser.ccdf/htag/parser/Imakefile deleted file mode 100644 index aab12e063..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/Imakefile +++ /dev/null @@ -1,125 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/4 1996/05/09 17:32:15 drk $ -/* parser Imakefile */ - -ARCCMD = arc u -UNARCCMD = arc x -ARCDELCMD = arc d - -HELPTAG = .. -HELPTAGSRC = $(HELPTAG)/helptag -HELPPARSERSRC = $(HELPTAG)/parser -HELPELTDEFSRC = $(HELPTAG)/eltdef -HELPDTDFILE = $(HELPTAGSRC)/hptag.dtd -HELPUTILSRC = $(HELPTAG)/util -HELPBUILDSRC = $(HELPTAG)/build -HELPUTILLIB = $(HELPTAG)/util/libutil.a - -INCLUDES = -I. -I$(HELPUTILSRC) -I$(HELPTAGSRC) -I$(HELPBUILDSRC) \ - -I$(HELPELTDEFSRC) - -SRCS = parser.c actutil.c \ - closent.c code.c cyclent.c dcurelt.c \ - end.c entity.c \ - error.c getsign.c \ - input.c level.c lookent.c \ - minim.c optstrg.c param.c parent.c \ - parutil.c pi.c \ - scan.c setpar.c start.c string.c struct.c \ - text.c -XCOMM parvalok.c parname.c ifdata.c findpar.c - -OBJS = parser.o actutil.o \ - closent.o code.o cyclent.o dcurelt.o \ - end.o entity.o \ - error.o getsign.o \ - input.o level.o lookent.o \ - minim.o optstrg.o param.o parent.o \ - parutil.o pi.o \ - scan.o setpar.o start.o string.o struct.o \ - text.o -XCOMM parvalok.o parname.o ifdata.o findpar.o - -APPLOBJECTS = \ - $(HELPTAGSRC)/custom.o \ - $(HELPTAGSRC)/default.o \ - $(HELPTAGSRC)/help.o \ - $(HELPTAGSRC)/make.o \ - $(HELPTAGSRC)/option.o \ - $(HELPTAGSRC)/out.o \ - $(HELPTAGSRC)/xref.o - -ELT_H = \ - $(HELPELTDEFSRC)/entity2.h \ - $(HELPELTDEFSRC)/globdec.h \ - $(HELPELTDEFSRC)/globdef.h \ - $(HELPELTDEFSRC)/if.h \ - $(HELPELTDEFSRC)/pval.h \ - $(HELPELTDEFSRC)/signon.h \ - $(HELPELTDEFSRC)/signonx.h - -ELT_C = \ - $(HELPELTDEFSRC)/efile.c \ - $(HELPELTDEFSRC)/entfile.c \ - $(HELPELTDEFSRC)/pfile.c \ - $(HELPELTDEFSRC)/sfile.c \ - $(HELPELTDEFSRC)/stfile.c \ - $(HELPELTDEFSRC)/tfile.c - -ELT_DEFS = $(ELT_H) $(ELT_C) - -/* Don't use shared libs for hp */ -#ifdef HPArchitecture -#if OSMajorVersion > 7 -EXTRA_LOAD_FLAGS = -Wl,-a archive -#endif -#endif - -LOCAL_LIBRARIES = $(HELPUTILLIB) -SYS_LIBRARIES = -lm - -all:: $(HELPTAGSRC)/htag - -other_dirs: - cd $(HELPELTDEFSRC); make - cd $(HELPTAGSRC); make - -NormalLibraryObjectRule() -NormalProgramTarget(parser,$(OBJS) $(APPLOBJECTS),delim.h $(LOCAL_LIBRARIES) other_dirs,$(LOCAL_LIBRARIES),) - -CPRODS = case.c context.h delim.h -CTRASH = error delim.dat - -$(HELPTAGSRC)/htag: parser - $(RM) $(HELPTAGSRC)/htag - $(CP) parser $(HELPTAGSRC)/htag - -$(CPRODS): $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.par context.dat - $(RM) $(CPRODS) $(CTRASH) - /* get application-specific delim.dat */ - $(CP) $(HELPTAGSRC)/delim.par delim.dat - $(HELPUTILSRC)/context - -$(HELPUTILSRC)/context: - cd $(HELPUTILSRC); make context - -$(APPLOBJECTS): - cd $(HELPTAGSRC); make $(APPLOBJECTS) - -$(ELT_DEFS): - cd $(HELPELTDEFSRC); make $(ELT_DEFS) - -arc package : - if exist util.arc $(CP) build.arc old.arc - $(ARCCMD) util.arc *.c *.h makefile - -unarc dearc : - $(UNARCCMD) util.arc - -clean:: - $(RM) $(CPRODS) $(CTRASH) parser *.o - -depend:: $(SRCS) - -includes:: $(CPRODS) - -DependTarget() diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/actutil.c b/cde/programs/dthelp/parser.ccdf/htag/parser/actutil.c deleted file mode 100644 index e1a2240b2..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/actutil.c +++ /dev/null @@ -1,318 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: actutil.c /main/3 1995/11/08 11:20:47 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Actutil.c contains utility procedures for processing actions specified -in the interface definition.*/ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" -#define M_IFDEF -#include "if.h" -#include "delim.h" -#include "context.h" -#include "signon.h" - -/* When an explicit or implied end-tag occurs */ -void m_endaction(m_elt) - M_ELEMENT m_elt; - { - M_ELEMENT m_action; - char buffer[2*MAXD+M_NAMELEN+1]; - - if (m_tagtrace) { - if (m_element[m_elt - 1].content != M_NONE) { - if (m_toptstat == M_OTHER) { - strcpy(buffer, "\n"); - m_trace(buffer); - } - sprintf(buffer, - "%s%s%s", - m_etago, - m_nameofelt(m_elt), - m_tagc); - m_trace(buffer); - } - m_toptstat = M_OTHER; - } - if (m_action = m_findact(m_elt, m_ecarray)) { - m_stackpar = m_stacktop; - m_endcase(m_action); - } - if (m_action = m_findact(m_elt, m_etarray)) { - m_stackpar = m_stacktop->stparam; - m_textout(&m_string[m_action - 1], FALSE, TRUE); - } - } - -/* Find appropriate action according to current stack */ -int m_findact(elt, array) - M_ELEMENT elt; - int *array; - { - int chainlen = 0; - int index; - - if (! array[elt - 1]) return(FALSE); - if (m_stacktop->element != elt) { - m_error("Program error in findact"); - m_exit(TRUE); - } - /* There is an action for this element with no context specification */ - if (m_action[array[elt - 1] - 1].data) { - chainlen = 1; - index = array[elt - 1]; - } - /* Only actions for this element have context specified */ - else { - chainlen = 0; - index = 0; - } - m_findchain(m_stacktop->oldtop, array[elt - 1], chainlen, &chainlen, - &index, FALSE); - return(index ? m_action[index - 1].data : FALSE); - } - -/* Recursive procedure called by findact() to search m_action */ -void m_findchain(M_PARSE *stackptr, int start, int chainin, int *chainout, int *index, LOGICAL wild) -{ - int node; - M_PARSE *stackp; - - for (node = m_action[start - 1].son ; node; - node = m_action[node - 1].next) { - if (m_action[node - 1].element == 1) - m_findchain(stackptr, node, chainin, chainout, index, TRUE); - else for (stackp = stackptr; - stackp->oldtop; - stackp = stackp->oldtop) { - if (stackp->element == m_action[node - 1].element - 1) { - if (m_action[node - 1].data) - if (chainin + 1 > *chainout || - (chainin + 1 == *chainout && node < *index)) { - *chainout = chainin + 1; - *index = node; - } - m_findchain(stackp->oldtop, node, chainin + 1, chainout, - index, FALSE); - } - if (! wild) break; - } - } - } - -/* Process global end string. In separate procedure to keep all references - to if.h in one source file and minimize recompilation if interface - changes. */ -void m_globes(void) -{ -M_WCHAR *wc_string; - -wc_string = MakeWideCharString(&m_string[m_ges]); -if (m_ges) m_stcaction(wc_string, FALSE, TRUE); -m_free(wc_string,"wide character string"); -} - -/* Process global start string. In separate procedure to keep all references - to if.h in one source file and minimize recompilation if interface - changes. */ -void m_globss(void) -{ -M_WCHAR *wc_string; - -wc_string = MakeWideCharString(&m_string[m_gss]); -if (m_gss) m_stcaction(wc_string, TRUE, FALSE); -m_free(wc_string,"wide character string"); -} - -/* When an explicit or implied start-tag occurs */ -void m_strtaction(m_elt) - M_ELEMENT m_elt; - { - int m_par, m_i; - M_WCHAR *m_p; - M_ELEMENT m_action; - static char newpar[] = "\n "; - static char quote[] = " = \""; - char buffer[M_NAMELEN + 1 + - (sizeof(quote) + sizeof(newpar) - 2 > MAXD ? - sizeof(quote) + sizeof(newpar) - 2 : - MAXD) - ]; - - m_start = TRUE; - m_getline(&m_stacktop->file, &m_stacktop->line); - if (m_tagtrace) { - sprintf(buffer, "%s%s", m_stago, m_nameofelt(m_elt)); - m_trace(buffer); - for (m_i = 0, m_par = m_element[m_elt - 1].parptr; - m_i < m_element[m_elt - 1].parcount; - m_i++, m_par++) - if (m_stacktop->param[m_i]) { - sprintf(buffer, "%s%s%s", - newpar, &m_pname[m_parameter[m_par - 1].paramname], quote); - m_trace(buffer); - buffer[1] = M_EOS; - for (m_p = m_stacktop->param[m_i] ; *m_p ; m_p++) - if (*m_p != '"') { - buffer[0] = *m_p; - m_trace(buffer); - } - else { - sprintf(buffer, "%s%d", m_cro, '"'); - m_trace(buffer); - buffer[1] = M_EOS; - } - buffer[0] = '"'; - m_trace(buffer); - } - if (m_element[m_elt - 1].parcount) { - buffer[0] = '\n'; - buffer[1] = M_EOS; - m_trace(buffer); - } - sprintf(buffer, "%s\n", m_tagc); - m_trace(buffer); - m_toptstat = M_TOPTSTARTTAG; - } - if (m_action = m_findact(m_elt, m_scarray)) { - m_stackpar = m_stacktop; - m_strtcase(m_action); - } - if (m_action = m_findact(m_elt, m_stcarray)) { - m_stacktop->stccase = m_action; - m_stacktop->stparam = m_stacktop; - } - if (m_action = m_findact(m_elt, m_starray)) { - m_stackpar = m_stacktop->stparam; - m_textout(&m_string[m_action - 1], TRUE, FALSE); - } - if (m_action = m_findact(m_elt, m_tcarray)) { - m_stacktop->cdcase = m_action; - m_stacktop->cdparam = m_stacktop; - } - if (m_action = m_findact(m_elt, m_pcarray)) { - m_stacktop->picase = m_action; - m_stacktop->piparam = m_stacktop; - } - } - -/* Output a start-string or end-string */ -void m_textout(char *format, LOGICAL start, LOGICAL end) -{ -M_WCHAR name[M_NAMELEN + 1]; -int i, par; -LOGICAL found; -M_WCHAR *string; -M_WCHAR *p; -M_WCHAR *q; -M_WCHAR *r; -M_WCHAR *s; -M_WCHAR *new; -int stringlen; -int changelen; -int unused; - -stringlen = strlen(format) + 1; -unused = 0; -string = (M_WCHAR *) m_malloc(stringlen, "string space"); -for (p = string ; *format ; ) - { - if (*format == M_ESCAPECHAR) - { - for (i = 0, format++ ; i < M_NAMELEN ; i++, format++) - { - mbtowc(&name[i], format, 1); - if (m_cttype(name[i]) == M_NONNAME || - (m_cttype(name[i]) != M_NMSTART && i == 0) - ) break; - } - if (! i) - { - char mb; - - mb = M_ESCAPECHAR; - mbtowc(p, &mb, 1); - p++; - /* Double escape character used to insert a single escape character - in the output string */ - if (*format == M_ESCAPECHAR) format++; - continue; - } - name[i] = M_EOS; - for (found = FALSE, i = 0, - par = m_element[m_stacktop->element - 1].parptr; - i < m_element[m_stacktop->element - 1].parcount; - i++, par++) - if (! m_wcupstrcmp(&m_pname[m_parameter[par - 1].paramname], name)) - { - q = m_stacktop->param[i]; - if (! q) - { - found = TRUE; - unused += w_strlen(name) + 1; - break; - } - changelen = w_strlen(q) - w_strlen(name) - 1 - unused; - if (changelen > 0) - { - new = (M_WCHAR *) m_malloc(stringlen + changelen, - "string space"); - for (r = string, s = new ; r < p ; ) *s++ = *r++; - m_free(string, "string space"); - string = new; - stringlen = stringlen + changelen; - p = s; - unused = 0; - } - else if (changelen < 0) unused = -changelen; - found = TRUE; - break; - } - if (! found) - { - char mb; - - mb = M_ESCAPECHAR; - mbtowc(p, &mb, 1); - p++; - q = name; - } - if (q) while (*q) *p++ = *q++; - } - else *p++ = *format++; - } -*p = M_EOS; -m_stcaction(string, start, end); -m_free(string, "string space"); -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/addinput.c b/cde/programs/dthelp/parser.ccdf/htag/parser/addinput.c deleted file mode 100644 index a6ae69dae..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/addinput.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: addinput.c /main/3 1995/11/08 11:20:57 rswiston $ */ -/* Obsolete */ diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/charconv.h b/cde/programs/dthelp/parser.ccdf/htag/parser/charconv.h deleted file mode 100644 index d72fff53e..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/charconv.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: charconv.h /main/3 1995/11/08 11:21:08 rswiston $ */ -EXTERN M_WCHAR pc8_to_r8 [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\264','\317', - '\305','\300','\314','\310','\324','\265','\301','\315','\311','\335', - '\321','\331','\330','\320','\334','\327','\323','\302','\316','\312', - '\303','\313','\357','\332','\333','\277','\273','\274','\120','\276', - '\304','\325','\306','\307','\267','\266','\371','\372','\271','\055', - '\052','\370','\367','\270','\373','\375','\374','\374','\374','\174', - '\053','\043','\053','\053','\043','\043','\174','\043','\043','\053', - '\043','\053','\053','\053','\053','\053','\055','\053','\043','\053', - '\043','\043','\043','\043','\043','\075','\043','\043','\053','\043', - '\053','\053','\043','\043','\053','\053','\043','\053','\053','\374', - '\374','\374','\374','\374','\052','\336','\052','\052','\052','\052', - '\363','\052','\052','\052','\052','\052','\052','\326','\052','\052', - '\052','\376','\052','\052','\174','\174','\057','\176','\263','\362', - '\362','\052','\052','\052','\374','\377' - } -#endif - ; - -EXTERN M_WCHAR pc8dn_to_r8 [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\264','\317', - '\305','\300','\314','\310','\324','\265','\301','\315','\311','\335', - '\321','\331','\330','\320','\334','\327','\323','\302','\316','\312', - '\303','\313','\357','\332','\333','\326','\273','\322','\114','\154', - '\304','\325','\306','\307','\267','\266','\352','\351','\271','\342', - '\341','\154','\156','\270','\052','\272','\374','\374','\374','\174', - '\053','\043','\053','\053','\043','\043','\174','\043','\043','\053', - '\043','\053','\053','\053','\053','\053','\055','\053','\043','\053', - '\043','\043','\043','\043','\043','\075','\043','\043','\053','\043', - '\053','\053','\043','\043','\053','\053','\043','\053','\053','\374', - '\374','\374','\374','\374','\052','\336','\052','\052','\052','\052', - '\363','\052','\052','\052','\052','\052','\052','\326','\052','\052', - '\052','\376','\052','\052','\174','\174','\057','\176','\263','\362', - '\362','\052','\052','\052','\374','\377' - } -#endif - ; - -EXTERN M_WCHAR r8_to_pc8 [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\200','\201', - '\202','\203','\204','\205','\206','\207','\210','\211','\212','\213', - '\214','\215','\216','\217','\220','\221','\222','\223','\224','\225', - '\226','\227','\230','\231','\232','\233','\234','\235','\236','\237', - '\040','\101','\101','\105','\105','\105','\111','\111','\047','\140', - '\136','\042','\176','\125','\125','\234','\055','\131','\171','\370', - '\200','\207','\245','\244','\255','\250','\052','\234','\235','\052', - '\237','\233','\203','\210','\223','\226','\240','\202','\242','\243', - '\205','\212','\225','\227','\204','\211','\224','\201','\217','\214', - '\117','\222','\206','\241','\355','\221','\216','\215','\231','\232', - '\220','\213','\341','\117','\101','\101','\141','\104','\144','\111', - '\111','\117','\117','\117','\157','\123','\163','\125','\131','\230', - '\052','\052','\372','\346','\052','\052','\304','\254','\253','\246', - '\247','\256','\376','\257','\361','\040' - } -#endif - ; - -EXTERN M_WCHAR r8_to_pc8dn [256] -#if defined(DEFINE) -= { - '\000','\001','\002','\003','\004','\005','\006','\007','\010','\011', - '\012','\013','\014','\015','\016','\017','\020','\021','\022','\023', - '\024','\025','\026','\027','\030','\031','\032','\033','\034','\035', - '\036','\037','\040','\041','\042','\043','\044','\045','\046','\047', - '\050','\051','\052','\053','\054','\055','\056','\057','\060','\061', - '\062','\063','\064','\065','\066','\067','\070','\071','\072','\073', - '\074','\075','\076','\077','\100','\101','\102','\103','\104','\105', - '\106','\107','\110','\111','\112','\113','\114','\115','\116','\117', - '\120','\121','\122','\123','\124','\125','\126','\127','\130','\131', - '\132','\133','\134','\135','\136','\137','\140','\141','\142','\143', - '\144','\145','\146','\147','\150','\151','\152','\153','\154','\155', - '\156','\157','\160','\161','\162','\163','\164','\165','\166','\167', - '\170','\171','\172','\173','\174','\175','\176','\177','\200','\201', - '\202','\203','\204','\205','\206','\207','\210','\211','\212','\213', - '\214','\215','\216','\217','\220','\221','\222','\223','\224','\225', - '\226','\227','\230','\231','\232','\233','\234','\235','\236','\237', - '\040','\101','\101','\105','\105','\105','\111','\111','\047','\140', - '\136','\042','\176','\125','\125','\234','\055','\131','\171','\370', - '\200','\207','\245','\244','\255','\250','\257','\234','\131','\052', - '\146','\143','\203','\210','\223','\226','\240','\202','\242','\243', - '\205','\212','\225','\227','\204','\211','\224','\201','\217','\214', - '\235','\222','\206','\241','\233','\221','\216','\215','\231','\232', - '\220','\213','\341','\117','\101','\252','\251','\104','\144','\111', - '\111','\117','\117','\247','\246','\123','\163','\125','\131','\230', - '\052','\052','\372','\346','\052','\052','\304','\052','\052','\052', - '\052','\074','\376','\076','\361','\040' - } -#endif - ; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/closent.c b/cde/programs/dthelp/parser.ccdf/htag/parser/closent.c deleted file mode 100644 index b5acd8ea4..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/closent.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: closent.c /main/3 1995/11/08 11:21:18 rswiston $ */ -/* Copyright 1988, 1989 Hewlett-Packard Co. */ - -/* Default close SYSTEM entity procedure */ - -#include "userinc.h" -#include "globdec.h" - -void m_closent(m_ptr) - void *m_ptr ; - { - fclose((FILE *) m_ptr) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/code.c b/cde/programs/dthelp/parser.ccdf/htag/parser/code.c deleted file mode 100644 index 112741182..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/code.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: code.c /main/3 1995/11/08 11:21:27 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Code.c executes code entities specified in the interface. */ - -#include "userinc.h" -#include "globdef.h" -#include - -/* Include generated file */ -#include "entfile.c" - -/* When a reference to a CODE entity is encountered */ -void m_codeent(m_ent) - int m_ent ; - { - (*m_ctable[m_ent])() ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/context.dat b/cde/programs/dthelp/parser.ccdf/htag/parser/context.dat deleted file mode 100644 index d5ae03990..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/context.dat +++ /dev/null @@ -1,681 +0,0 @@ -/* $XConsortium: context.dat /main/2 1995/07/17 10:35:59 drk $ */ -m_comment - comcon:comcon { -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. - -Context.dat defines the state transitions for program PARSER. -*/ - } - - pdecl:pdecl, - decl:decl, - mapname:mapname, - endmap:endmap, - entname:entname, - entval:entval, - dupent:dupent, - typedentval:typedentval, - typedupent:typedupent, - entend:entend {m_readcomments() ;} - ; - -m_mdo - preamble:pdecl - datacon:decl - elcon:decl - netdatacon:decl - netelcon:decl - poundcdata:decl - netcdata:decl - ; - -m_mdc - entend:preamble - perror:preamble - pdecl:preamble - endmap:start - decl:start - derror:start - ; - -m_usemap - decl:mapname - ; - -m_addmap - decl:amapname { - if (m_conform) m_mberr1("%s not provided in IS 8879", - m_addmap) ; - } - ; - -m_empty - mapname:endmap {m_setmap(1, TRUE) ;} - amapname:endmap {m_setmap(1, FALSE) ;} - ; - -m_entkw - pdecl:entname - ; - -m_entst - entval:typedentval {if (m_entity) m_entity->type = M_STARTTAG ;} - dupent:typedupent {m_eduptype(M_STARTTAG) ;} - ; - -m_entet - entval:typedentval {if (m_entity) m_entity->type = M_ENDTAG ;} - dupent:typedupent {m_eduptype(M_ENDTAG) ;} - ; - -m_entcdata - entval:typedentval {if (m_entity) m_entity->type = M_CDATAENT ;} - dupent:typedupent {m_eduptype(M_CDATAENT) ;} - ; - -m_entsdata - entval:typedentval {if (m_entity) m_entity->type = M_SDATA ;} - dupent:typedupent {m_eduptype(M_SDATA) ;} - ; - -m_entsystem - entval:typedentval {if (m_entity) m_entity->type = M_SYSTEM ;} - dupent:typedupent {m_eduptype(M_SYSTEM) ;} - ; - -m_entmd - entval:typedentval {if (m_entity) m_entity->type = M_MD ;} - dupent:typedupent {m_eduptype(M_MD) ;} - ; - -m_entpi - entval:typedentval {if (m_entity) m_entity->type = M_PI ;} - dupent:typedupent {m_eduptype(M_PI) ;} - ; - -m_stago - datacon:selement, - elcon:selement, - netdatacon:selement, - netelcon:selement, - poundcdata:selement, - netcdata:selement {m_scannet = FALSE ;} - - eelement:selement { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_etcomplete() ; - } - selement:selement { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stcomplete() ; - } - attname:selement { - m_stcomplete() ; - } - needvi:selement { - m_attvonly(m_saveatt) ; - m_stcomplete() ; - } - etagend:selement {m_etcomplete() ;} - ; - -m_etago - elcon:eelement - datacon:eelement - netelcon:eelement - netdatacon:eelement - poundcdata:eelement - netcdata:eelement - cdatael:eelement - rcdatael:eelement - netelcdata:eelement - netrcdata:eelement - - eelement:eelement { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_etcomplete() ; - } - selement:eelement { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stcomplete() ; - } - attname:eelement {m_stcomplete() ;} - needvi:eelement { - m_attvonly(m_saveatt) ; - m_stcomplete() ; - } - etagend:eelement {m_etcomplete() ;} - ; - -m_pio - datacon:procint - elcon:procint - netdatacon:procint - netelcon:procint - selement:procint { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stcomplete() ; - } - eelement:procint { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_etcomplete() ; - } - poundcdata:procint - netcdata:procint - attname:procint {m_stcomplete() ;} - needvi:procint { - m_attvonly(m_saveatt) ; - m_stcomplete() ; - } - etagend:procint {m_etcomplete() ;} - ; - -m_tagc - eelement:start { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stacktop->holdre = FALSE ; - m_etcomplete() ; - } - selement:start { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stcomplete() ; - } - attname:start {m_stcomplete() ;} - etagend:start {m_etcomplete() ;} - needvi:start { - m_attvonly(m_saveatt) ; - m_stcomplete() ; - } - ; - -m_pic - procint:start { - m_pi[m_pilen] = M_EOS ; - m_piaction(m_pi, NULL, M_NULLVAL) ; - m_pilen = 0 ; - } - pierror:start - ; - -m_vi - needvi:attval {m_findatt() ;} - ; - -m_lit - attname:litcon - attval:litcon - litcon:litcon - ; - -m_litdelim - entval:litent, - typedentval:litent, - dupent:dlitent, - typedupent:dlitent {m_entclen = 0 ;} - - litent:entend, - elitent:entend { - if (m_entity) { - m_entcontent[m_entclen] = M_EOS ; - m_entity->content = - (M_WCHAR *) m_malloc(m_entclen + 1, "entity content") ; - w_strcpy(m_entity->content, m_entcontent) ; - } - } - - dlitent:entend, - edlitent:entend { - m_entcontent[m_entclen] = M_EOS ; - if (w_strcmp(m_entity->content, m_entcontent)) - m_err1("Redefinition of entity %s ignored", m_entity->name) ; - } - ; - -m_lita - attname:litacon - attval:litacon - litacon:litacon - ; - -m_litadelim - entval:litaent, - typedentval:litaent, - dupent:dlitaent, - typedupent:dlitaent {m_entclen = 0 ;} - - litaent:entend, - elitaent:entend { - if (m_entity) { - m_entcontent[m_entclen] = M_EOS ; - m_entity->content = - (M_WCHAR *) m_malloc(m_entclen + 1, "entity content") ; - w_strcpy(m_entity->content, m_entcontent) ; - } - } - - dlitaent:entend, - edlitaent:entend { - m_entcontent[m_entclen] = M_EOS ; - if (w_strcmp(m_entity->content, m_entcontent)) - m_err1("Redefinition of entity %s ignored", m_entity->name) ; - } - ; - -m_cro - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:poundcdata - netelcon:netcdata - - rcdatael:rcdatael - netrcdata:netrcdata - ; - -m_litrs - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_litscr - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_litre - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_litecr - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_litspace - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_litcspace - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_littab - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_litctab - litcon:litcon - litacon:litacon - - poundcdata:poundcdata - netcdata:netcdata - - elcon:elcon - netelcon:netelcon - ; - -m_ero - rcdatael:rcdatael - netrcdata:netrcdata - poundcdata:poundcdata - netcdata:netcdata - datacon:datacon - elcon:elcon - netdatacon:netdatacon - netelcon:netelcon - preamble:preamble - litcon:litcon - litacon:litacon - entinlit:entinlit - ; - -m_refc - entref:entref - ; - -m_net - netdatacon:start, - netelcon:start, - netcdata:start, - netelcdata:start, - netrcdata:start {m_nullendtag() ;} - selement:start { - m_scannet = TRUE ; - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stcomplete() ; - } - attname:start { - m_scannet = TRUE ; - m_stcomplete() ; - } - needvi:start { - m_scannet = TRUE ; - m_attvonly(m_saveatt) ; - m_stcomplete() ; - } - ; - - -m_endfile - datacon:datacon - elcon:elcon - netdatacon:netdatacon - netelcon:netelcon - poundcdata:poundcdata - netcdata:netcdata - preamble:preamble { - m_startdoc() ; - if (! m_state[2].final) m_error("Empty document") ; - } - rcdatael:rcdatael - netrcdata:netrcdata - rcnewent:rcnewent - cdatael:cdatael - netelcdata:netelcdata - eelement:start { - if (! m_wholetag) - m_mberr1("Missing %s in end-tag", m_tagc) ; - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stacktop->holdre = FALSE ; - m_etcomplete() ; - } - selement:start { - if (! m_wholetag) - m_mberr1("Missing %s in start-tag", m_tagc) ; - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stcomplete() ; - } - attname:start { - if (! m_wholetag) - m_mberr1("Invalid parameter or missing %s", m_tagc) ; - m_stcomplete() ; - } - etagend:start { - if (! m_wholetag) - m_mberr1("Missing %s delimiter in end-tag", m_tagc) ; - m_etcomplete() ; - } - needvi:start { - if (! m_wholetag) - m_mberr1("Invalid parameter or missing %s", m_tagc) ; - m_attvonly(m_saveatt) ; - m_stcomplete() ; - } - attval:start { - if (! m_wholetag) - m_mberr1("Invalid parameter or missing %s", m_tagc) ; - m_err1("Expecting value for %s", - &m_pname[m_parameter[m_ppsave - 1].paramname]) ; - m_stcomplete() ; - } - ; - -m_name - mapname:endmap {m_ckmap(m_name, TRUE) ;} - amapname:endmap {m_ckmap(m_name, FALSE) ;} - entname:entval { - m_ntrent(m_name) ; - if (! m_entity) m_curcon = PERROR ; - } - selement:attname { - { - int i ; - - if (m_scanel = m_eltname()) { - for (i = 0 ; i < m_element[m_scanel - 1].parcount ; i++) - m_poccur[i] = 0 ; - } - else m_curcon = START ; - } - } - eelement:etagend { - if (m_scanel = m_eltname()) m_stacktop->holdre = FALSE ; - else - if (m_element[m_stacktop->element - 1].content == M_CDATA || - m_element[m_stacktop->element - 1].content == M_RCDATA) { - m_ckend(m_stacktop->element, FALSE) ; - m_curcon = START ; - } - else m_curcon = START ; - } - attname:needvi {if (m_validinpar(m_name)) - w_strcpy(m_saveatt, m_name) ;} - attval:attname {m_attval(m_name) ;} - needvi:needvi { - m_attvonly(m_saveatt) ; - if (m_validinpar(m_name)) - w_strcpy(m_saveatt, m_name) ; - } - ; - -m_text - litcon:litcon - litacon:litacon - entinlit:entinlit - - litent:litent {m_longent(ELITENT) ;} - litaent:litaent {m_longent(ELITAENT) ;} - dlitent:dlitent {m_longent(EDLITENT) ;} - dlitaent:dlitaent {m_longent(EDLITAENT) ;} - - elitent:elitent - elitaent:elitaent - edlitent:edlitent - edlitaent:edlitaent - - perror:perror - derror:derror - - pdecl:perror, - decl:derror {m_error("Invalid markup declaration") ;} - - rcdatael:rcdatael, - netrcdata:netrcdata, - rcnewent:rcnewent, - cdatael:cdatael, - netelcdata:netelcdata, - poundcdata:poundcdata, - netcdata:netcdata {m_textaction(m_scanval) ;} - - procint:procint { - m_pi[m_pilen++] = m_scanval ; - if (m_pilen > M_PILEN) { - m_error("Processing instruction too long") ; - m_pi[m_pilen - 1] = M_EOS ; - m_piaction(m_pi, NULL, M_NULLVAL) ; - m_curcon = PIERROR ; - m_pilen = 0 ; - } - } - - pierror:pierror - - datacon:poundcdata, - netdatacon:netcdata {m_strtcdata(m_scanval) ;} - ; - -m_blackspace - elcon:poundcdata, - netelcon:netcdata {m_strtcdata(m_scanval) ;} - - preamble:start { - m_ungetachar((int) m_scanval, M_NORMAL, TRUE) ; - m_startdoc() ; - } - - amapname:derror, - mapname:derror, - endmap:derror {m_error("Invalid usemap declaration") ;} - - typedentval:perror, - entname:perror, - entval:perror, - typedupent:perror, - dupent:perror - { - m_error("Invalid ENTITY declaration") ; - if (m_entity) - { - m_entcontent[m_entclen] = M_EOS ; - m_entity->content = - (M_WCHAR *) m_malloc(m_entclen + 1, "entity content") ; - w_strcpy(m_entity->content, m_entcontent) ; - } - } - - entend:perror - { - m_error("Unexpected characters within ENTITY declaration") ; - if (m_entity) - { - m_entcontent[m_entclen] = M_EOS ; - m_entity->content = - (M_WCHAR *) m_malloc(m_entclen + 1, "entity content") ; - w_strcpy(m_entity->content, m_entcontent) ; - } - } - - selement:poundcdata { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_strtcdata(m_scanval) ; - } - eelement:poundcdata { - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_etcomplete() ; - m_strtcdata(m_scanval) ; - } - ; - -m_literal - attname:attname {m_attvonly(m_literal) ;} - attval:attname {m_attval(m_literal) ;} - ; - -m_entityend - eelement:start { - if (! m_wholetag) - m_mberr1("Missing %s in entity containing end-tag", m_tagc) ; - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stacktop->holdre = FALSE ; - m_etcomplete() ; - } - selement:start { - if (! m_wholetag) - m_mberr1("Missing %s in entity containing start-tag", m_tagc) ; - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stcomplete() ; - } - attname:start { - if (! m_wholetag) - m_mberr1( - "Invalid parameter or missing %s in entity containing start-tag", - m_tagc) ; - m_stcomplete() ; - } - etagend:start { - if (! m_wholetag) - m_mberr1("Missing %s in entity containing end-tag", m_tagc) ; - m_etcomplete() ; - } - needvi:start { - if (! m_wholetag) - m_mberr1( - "Invalid parameter or missing %s in entity containing start-tag", - m_tagc) ; - m_attvonly(m_saveatt) ; - m_stcomplete() ; - } - attval:start { - if (! m_wholetag) - m_mberr1( - "Invalid parameter or missing %s in entity containing start-tag", - m_tagc) ; - m_err1("Expecting value for %s", - &m_pname[m_parameter[m_ppsave - 1].paramname]) ; - m_stcomplete() ; - } - ; - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/cyclent.c b/cde/programs/dthelp/parser.ccdf/htag/parser/cyclent.c deleted file mode 100644 index 7b42a3d35..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/cyclent.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: cyclent.c /main/3 1995/11/08 11:21:36 rswiston $ */ -/* - Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -/* Cyclent.c contains procedure m_cyclent(), callable by interface - designers, to cycle through all defined entities, returning information - about them */ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" -#include "entext.h" - -M_WCHAR *m_cyclent(LOGICAL init, unsigned char *type, M_WCHAR **content, unsigned char *wheredef) -{ - static M_TRIE *current ; - static M_TRIE *ancestor[M_NAMELEN + 1] ; - static length = 0 ; - static M_WCHAR name[M_NAMELEN + 1] ; - - if (init) { - current = m_enttrie->data ; - length = 0 ; - } - if (length < 0) return(NULL) ; - while (current->symbol) { - ancestor[length] = current ; - name[length++] = current->symbol ; - current = current->data ; - } - name[length] = M_EOS ; - *type = ((M_ENTITY *) current->data)->type ; - *content = ((M_ENTITY *) current->data)->content ; - *wheredef = ((M_ENTITY *) current->data)->wheredef ; - while (length >= 0) { - if (current->next) { - current = current->next ; - break ; - } - length-- ; - if (length < 0) break ; - current = ancestor[length] ; - } - return(name) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/dcurelt.c b/cde/programs/dthelp/parser.ccdf/htag/parser/dcurelt.c deleted file mode 100644 index 360ff3698..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/dcurelt.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: dcurelt.c /main/3 1995/11/08 11:21:45 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Displays current element after some error messages */ -void m_dispcurelt(file, line) -M_WCHAR *file ; -int line ; -{ -char *mb_parent; - -m_errline("Current element is ") ; -mb_parent = MakeMByteString(m_parent(0)); -m_errline(mb_parent) ; -m_free(mb_parent,"multi-byte string"); -m_errline(" begun on ") ; -m_dumpline(file, line) ; -m_errline(".\n") ; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/delfree.c b/cde/programs/dthelp/parser.ccdf/htag/parser/delfree.c deleted file mode 100644 index 6def17b9c..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/delfree.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: delfree.c /main/3 1995/11/08 11:21:55 rswiston $ */ -/* Copyright (c) 1988 Hewlett-Packard Co. */ - -/* Versions of m_free and m_malloc for debugging. */ - -/**/ -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtd.h" -#include "parser.h" - -m_free(block, msg) - char *block ; - char *msg ; - { - free(block) ; - fprintf(m_outfile, "%5u:%5u- Freed %s\n", - (unsigned int) ((unsigned long) block >> 16), - (unsigned int) block, msg) ; - } - -char *m_mallocx(size, msg) - int size ; - char *msg ; - { - char *p ; - - if (! size) return(NULL) ; - p = malloc(size) ; - if (! p) { - m_err1("Unable to allocate space for %s", msg) ; - exit(TRUE) ; - } - fprintf(m_outfile, "%5u:%5u- Allocated %s\n", - (unsigned int) ((unsigned long) p >> 16), (unsigned int) p, msg) ; - return(p) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/dmpline.c b/cde/programs/dthelp/parser.ccdf/htag/parser/dmpline.c deleted file mode 100644 index aefb93311..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/dmpline.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: dmpline.c /main/3 1995/11/08 11:22:05 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Write input file and line number for an error message */ -void m_dumpline(file, line) -M_WCHAR *file ; -int line ; -{ -char buffer[10] ; - -m_errline("Line ") ; -sprintf(buffer, "%d", line) ; -m_errline(buffer) ; -if (file) - { - char mb_file; - - m_errline(" of File ") ; - mb_file = MakeMByteString(file); - m_errline(mb_file) ; - m_free(mb_file,"multi-byte string"); - } -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/end.c b/cde/programs/dthelp/parser.ccdf/htag/parser/end.c deleted file mode 100644 index 2189be5f1..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/end.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: end.c /main/3 1995/11/08 11:22:15 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* End.c executes end-code specified in the interface. */ - -#include "userinc.h" -#include "globdec.h" - -/* Include generated file */ -#include "efile.c" - - -/* Perform the m_action-th end-code in the interface */ -void m_endcase(m_action) - int m_action ; - { - (*m_etable[m_action])() ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/entity.c b/cde/programs/dthelp/parser.ccdf/htag/parser/entity.c deleted file mode 100644 index 48757aa15..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/entity.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: entity.c /main/3 1995/11/08 11:22:25 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Entity.c contains procedures pertaining to entities */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "context.h" -#include "dtdext.h" -#include "parser.h" -#include "entext.h" - -/* Process the name in a usemap delaration */ -void m_ckmap(M_WCHAR *name, LOGICAL useoradd) -{ - int mapid ; - - if (mapid = m_packedlook(m_maptree, name)) - m_setmap(mapid + 1, useoradd) ; - else m_err1("Undefined short reference map %s", name) ; - } - -/* Check type specified in entity declaration for previously defined - entity. Testing to see if the new declaration is identical to the - original one. */ -void m_eduptype(type) - int type ; - { - if ((int) m_entity->type != type) { - m_err1("Redefinition of entity %s ignored", m_entity->name) ; - m_entity = NULL ; - m_curcon = TYPEDENTVAL ; - } - } - -/* Tests if an entity is too long */ -void m_longent(context) - int context ; - { - if (m_entclen >= M_LITLEN) { - m_curcon = context ; - m_error("Entity content too long") ; - } - else m_entcontent[m_entclen++] = m_scanval ; - } - -/* Enters an entity name into the entity name tree */ -void m_ntrent(p) - M_WCHAR *p ; - { - M_ENTITY *new ; - - new = (M_ENTITY *) m_malloc(sizeof(M_ENTITY), "entity") ; - if (m_entity = (M_ENTITY *) m_ntrtrie(p, m_enttrie, (M_TRIE *) new)) { - m_free(new, "entity") ; - if (m_entity->wheredef == M_DPARSER) { - if (m_entdupchk) { - m_err1("Redefinition of entity %s ignored", p) ; - m_entity = NULL ; - } - else m_curcon = DUPENT ; - } - else { - if (m_entity->content) { - m_err1("Warning: Redefinition of predefined entity %s", p) ; - m_entity->type = M_GENERAL ; - m_entity->content = NULL ; - } - m_entity->wheredef = M_DPARSER ; - } - return ; - } - m_entity = new ; - m_entity->type = M_GENERAL ; - m_entity->wheredef = M_DPARSER ; - m_entity->content = NULL ; - m_entity->name = (M_WCHAR *) m_malloc(w_strlen(p) + 1, "entity name") ; - w_strcpy(m_entity->name, p) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/eprefix.c b/cde/programs/dthelp/parser.ccdf/htag/parser/eprefix.c deleted file mode 100644 index e8b6ce558..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/eprefix.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: eprefix.c /main/3 1995/11/08 11:22:35 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Write error message prefix */ -void m_eprefix(void) - { - m_errline("\n*****\n") ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/errline.c b/cde/programs/dthelp/parser.ccdf/htag/parser/errline.c deleted file mode 100644 index 53a6a88b9..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/errline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: errline.c /main/3 1995/11/08 11:22:46 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Process error message text */ -void m_errline(p) -M_WCHAR *p ; -{ -char mb_p; - -mb_p = MakeMByteString(p); -fputs(mb_p, m_errfile) ; -fputs(mb_p, stderr) ; -m_free(mb_p,"multi-byte string"); -} - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/error.c b/cde/programs/dthelp/parser.ccdf/htag/parser/error.c deleted file mode 100644 index e05d6b440..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/error.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: error.c /main/3 1995/11/08 11:23:01 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Util.c contains general utilities for program PARSER */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" -#include "entext.h" - - -/* Issue error message (no arguments) */ -void m_error(text) - char *text; - { - m_startmsg(); - m_errline(text); - m_esuffix(); - } - -/* Issue error message (one argument) */ -void m_err1( - const char *text, - const M_WCHAR *arg) -{ -char *buffer, *mb_arg; - -m_startmsg(); -/* Subtract 2 characters for the %s and add an EOS*/ -mb_arg = MakeMByteString(arg); -buffer = (char *) - m_malloc(strlen(text) + strlen(mb_arg) - 2 + 1, "error message"); -sprintf(buffer, text, mb_arg); -m_errline(buffer); -m_free(buffer, "error message"); -m_free(mb_arg,"multi-byte string"); -m_esuffix(); -} - - -void m_mberr1( - const char *text, - const char *arg) - { - M_WCHAR *wc_arg; - - wc_arg = MakeWideCharString(arg); - m_err1(text, wc_arg); - m_free(wc_arg,"wide character string"); - } - -/* Issue error message (two arguments) */ -void m_err2( - const char *text, - const M_WCHAR *arg1, - const M_WCHAR *arg2) - { - char *buffer; - char *mb_arg1,*mb_arg2; - - m_startmsg(); - /* Subtract 2 characters for each of 2 %s's and add an EOS*/ - mb_arg1 = MakeMByteString(arg1); - mb_arg2 = MakeMByteString(arg2); - buffer = (char *) m_malloc( - strlen(text) + strlen(mb_arg1) + strlen(mb_arg2) - 4 + 1, - "error message"); - sprintf(buffer, text, mb_arg1, mb_arg2); - m_errline(buffer); - m_free(buffer, "error message"); - m_free(mb_arg1,"multi-byte string"); - m_free(mb_arg2,"multi-byte string"); - m_esuffix(); - } - -/* Issue error message (three arguments) */ -void m_err3( - char *text, - M_WCHAR *arg1, - M_WCHAR *arg2, - M_WCHAR *arg3) - { - char *buffer; - char *mb_arg1, *mb_arg2, *mb_arg3; - - m_startmsg(); - /* Subtract 2 characters for each of 3 %s's and add an EOS*/ - mb_arg1 = MakeMByteString(arg1); - mb_arg2 = MakeMByteString(arg2); - mb_arg3 = MakeMByteString(arg3); - buffer = (char *) m_malloc( - strlen(text) + - strlen(mb_arg1) + - strlen(mb_arg2) + - strlen(mb_arg3) - 6 + 1, - "error message"); - sprintf(buffer, text, mb_arg1, mb_arg2, mb_arg3); - m_errline(buffer); - m_free(buffer, "error message"); - m_free(mb_arg1,"multi-byte string"); - m_free(mb_arg2,"multi-byte string"); - m_free(mb_arg3,"multi-byte string"); - m_esuffix(); - } - -/* Issue error message (four arguments) */ -void m_err4( - char *text, - M_WCHAR *arg1, - M_WCHAR *arg2, - M_WCHAR *arg3, - M_WCHAR *arg4) - { - char *buffer; - char *mb_arg1, *mb_arg2,*mb_arg3,*mb_arg4; - - m_startmsg(); - /* Subtract 2 characters for each of 4 %s's and add an EOS*/ - mb_arg1 = MakeMByteString(arg1); - mb_arg2 = MakeMByteString(arg2); - mb_arg3 = MakeMByteString(arg3); - mb_arg4 = MakeMByteString(arg4); - buffer = (char *) m_malloc( - strlen(text) + - strlen(mb_arg1) + - strlen(mb_arg2) + - strlen(mb_arg3) + - strlen(mb_arg4) - 8 + 1, - "error message"); - sprintf(buffer, text, arg1, arg2, arg3, arg4); - m_errline(buffer); - m_free(buffer, "error message"); - m_free(mb_arg1,"multi-byte string"); - m_free(mb_arg2,"multi-byte string"); - m_free(mb_arg3,"multi-byte string"); - m_free(mb_arg4,"multi-byte string"); - m_esuffix(); - } - -/* Issue error message (five arguments) */ -void m_err5( - char *text, - M_WCHAR *arg1, - M_WCHAR *arg2, - M_WCHAR *arg3, - M_WCHAR *arg4, - M_WCHAR *arg5) - { - char *buffer; - char *mb_arg1, *mb_arg2, *mb_arg3, *mb_arg4, *mb_arg5; - - m_startmsg(); - /* Subtract 2 characters for each of 5 %s's and add an EOS*/ - mb_arg1 = MakeMByteString(arg1); - mb_arg2 = MakeMByteString(arg2); - mb_arg3 = MakeMByteString(arg3); - mb_arg4 = MakeMByteString(arg4); - mb_arg5 = MakeMByteString(arg5); - buffer = (char *) m_malloc( - strlen(text) + - strlen(mb_arg1) + - strlen(mb_arg2) + - strlen(mb_arg3) + - strlen(mb_arg4) + - strlen(mb_arg5) - 10 + 1, - "error message"); - sprintf(buffer, - text, - mb_arg1, - mb_arg2, - mb_arg3, - mb_arg4, - mb_arg5); - m_errline(buffer); - m_free(buffer, "error message"); - m_free(mb_arg1,"multi-byte string"); - m_free(mb_arg2,"multi-byte string"); - m_free(mb_arg3,"multi-byte string"); - m_free(mb_arg4,"multi-byte string"); - m_free(mb_arg5,"multi-byte string"); - m_esuffix(); - } - -/* Issue error message (six arguments) */ -void m_err6( - char *text, - M_WCHAR *arg1, - M_WCHAR *arg2, - M_WCHAR *arg3, - M_WCHAR *arg4, - M_WCHAR *arg5, - M_WCHAR *arg6) - { - char *buffer; - char *mb_arg1, *mb_arg2, *mb_arg3, *mb_arg4, *mb_arg5, *mb_arg6; - - m_startmsg(); - /* Subtract 2 characters for each of 6 %s's and add an EOS*/ - mb_arg1 = MakeMByteString(arg1); - mb_arg2 = MakeMByteString(arg2); - mb_arg3 = MakeMByteString(arg3); - mb_arg4 = MakeMByteString(arg4); - mb_arg5 = MakeMByteString(arg5); - mb_arg6 = MakeMByteString(arg6); - buffer = (char *) m_malloc( - strlen(text) + - strlen(mb_arg1) + - strlen(mb_arg2) + - strlen(mb_arg3) + - strlen(mb_arg4) + - strlen(mb_arg5) + - strlen(mb_arg6) - 12 + 1, - "error message"); - sprintf(buffer, - text, - mb_arg1, - mb_arg2, - mb_arg3, - mb_arg4, - mb_arg5, - mb_arg6); - m_errline(buffer); - m_free(buffer, "error message"); - m_free(mb_arg1,"multi-byte string"); - m_free(mb_arg2,"multi-byte string"); - m_free(mb_arg3,"multi-byte string"); - m_free(mb_arg4,"multi-byte string"); - m_free(mb_arg5,"multi-byte string"); - m_free(mb_arg6,"multi-byte string"); - m_esuffix(); - } - -/* Issue error message (seven arguments) */ -void m_err7( - char *text, - M_WCHAR *arg1, - M_WCHAR *arg2, - M_WCHAR *arg3, - M_WCHAR *arg4, - M_WCHAR *arg5, - M_WCHAR *arg6, - M_WCHAR *arg7) - { - char *buffer; - char *mb_arg1, *mb_arg2, *mb_arg3, *mb_arg4, *mb_arg5, *mb_arg6, *mb_arg7; - - m_startmsg(); - /* Subtract 2 characters for each of 7 %s's and add an EOS*/ - mb_arg1 = MakeMByteString(arg1); - mb_arg2 = MakeMByteString(arg2); - mb_arg3 = MakeMByteString(arg3); - mb_arg4 = MakeMByteString(arg4); - mb_arg5 = MakeMByteString(arg5); - mb_arg6 = MakeMByteString(arg6); - mb_arg7 = MakeMByteString(arg7); - buffer = (char *) m_malloc( - strlen(text) + - strlen(mb_arg1) + - strlen(mb_arg2) + - strlen(mb_arg3) + - strlen(mb_arg4) + - strlen(mb_arg5) + - strlen(mb_arg6) + - strlen(mb_arg7) - 14 + 1, - "error message"); - sprintf(buffer, - text, - mb_arg1, - mb_arg2, - mb_arg3, - mb_arg4, - mb_arg5, - mb_arg6, - mb_arg7); - m_errline(buffer); - m_free(buffer, "error message"); - m_free(mb_arg1,"multi-byte string"); - m_free(mb_arg2,"multi-byte string"); - m_free(mb_arg3,"multi-byte string"); - m_free(mb_arg4,"multi-byte string"); - m_free(mb_arg5,"multi-byte string"); - m_free(mb_arg6,"multi-byte string"); - m_free(mb_arg7,"multi-byte string"); - m_esuffix(); - } - -/* Getline.c returns the name of the current input file and the number - of the current line */ -void m_getline(file, line) - M_WCHAR **file; - int *line; - { - int i; - - if (m_sysecnt) { - for (i = m_eopencnt ; i ; i--) - if (m_opene[i - 1]->type == M_SYSTEM) break; - *file = m_opene[i - 1]->content; - } - else *file = NULL; - *line = m_line[m_sysecnt]; - } - -/* Dump last characters read from input stream to give context to - an error message */ -void m_lastchars(void) -{ -int i; -M_WCHAR buffer[2]; - -buffer[1] = M_EOS; -if (m_svlnwrap[m_sysecnt] || m_svlncnt[m_sysecnt]) -m_errline("..."); -if (m_svlnwrap[m_sysecnt]) -for (i = m_svlncnt[m_sysecnt] ; i < M_LINELENGTH ; i++) - { - char *mb_buffer; - - buffer[0] = (M_WCHAR) m_saveline[i][m_sysecnt]; - if (buffer[0] == (M_WCHAR) -1) - { - m_errline("\n"); - } - else - { - mb_buffer = MakeMByteString(buffer); - m_errline(mb_buffer); - m_free(mb_buffer,"multi-byte string"); - } - } -for (i = 0 ; i < m_svlncnt[m_sysecnt] ; i++) - { - char *mb_buffer; - buffer[0] = (M_WCHAR) m_saveline[i][m_sysecnt]; - - if (buffer[0] == (M_WCHAR) -1) - { - m_errline("\n"); - } - else - { - mb_buffer = MakeMByteString(buffer); - m_errline(mb_buffer); - m_free(mb_buffer,"multi-byte string"); - } - } -if ((m_svlncnt[m_sysecnt] && - m_saveline[m_svlncnt[m_sysecnt] - 1][m_sysecnt] != M_RE) || - (! m_svlncnt[m_sysecnt] && m_svlnwrap[m_sysecnt] && - m_saveline[M_LINELENGTH - 1][m_sysecnt] != M_RE) - ) m_errline("...\n"); -} - -/* Display information about the current element */ -void m_showcurelt(void) - { - if (m_stacktop->oldtop) - m_dispcurelt(m_stacktop->file, m_stacktop->line); - } - -/* Start an error message */ -void m_startmsg(void) - { - m_eprefix(); - m_errexit = TRUE; - } - -/* Return the name of the current input file (most recently opened, but - unclosed SYSTEM entity) */ -M_WCHAR *m_thisfile(void) - { - int i; - - if (m_sysecnt) { - for (i = m_eopencnt ; i ; i--) - if (m_opene[i - 1]->type == M_SYSTEM) - return(m_opene[i - 1]->content); - } - return(NULL); - } - -/* Return the line number in the current input file */ -int m_thisline(void) - { - return(m_line[m_sysecnt]); - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/esuffix.c b/cde/programs/dthelp/parser.ccdf/htag/parser/esuffix.c deleted file mode 100644 index d6cdc38e5..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/esuffix.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: esuffix.c /main/3 1995/11/08 11:23:13 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Write error message suffix */ -void m_esuffix(void) - { - m_errline("\n") ; - m_dumpline(m_thisfile(), m_thisline()) ; - m_errline(":\n") ; - m_lastchars() ; - if (++m_errcnt == m_errlim) { - m_error("Too many errors, processing stopped") ; - m_exit(TRUE) ; - } - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/exit.c b/cde/programs/dthelp/parser.ccdf/htag/parser/exit.c deleted file mode 100644 index d2e4d2056..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/exit.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: exit.c /main/3 1995/11/08 11:23:32 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Default version of PARSER m_exit(). Allows interface control if - internal error causes PARSER to halt. */ -void m_exit(status) - int status ; - { - exit(status) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/findpar.c b/cde/programs/dthelp/parser.ccdf/htag/parser/findpar.c deleted file mode 100644 index 57f4aa674..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/findpar.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: findpar.c /main/3 1995/11/08 11:23:46 rswiston $ */ -/* - Copyright 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Function callable by interface designers. Returns index in parameter - list of a specified parameter for an element (i.e., 1 for first parameter - specified in the DTD, 2 for second, etc.). First parameter, elt, is - the name of the element. Second parameter is the name of the parameter - or NULL. Third parameter is used only if second parameter is NULL. In - the latter case, function returns first keyword parameter, if any, for - which the specified value is a legal value and otherwise first - Returns 0 if elt is not a valid element name, if param is specified - but is not a valid parameter name, or if param is NULL and value is - not a valid value of any of elt's parameters. */ -int m_findpar( const char *elt , const char *param , const M_WCHAR *value ) -{ -M_ELEMENT eltid ; -int par ; -int i ; -M_WCHAR *wc_elt; - -wc_elt = MakeWideCharString(elt); -if (! (eltid = m_packedlook(m_entree, wc_elt))) - { - m_free(wc_elt,"wide character string"); - return(M_NULLVAL) ; - } -m_free(wc_elt,"wide character string"); - -/* A parameter name specified */ -if (param) - { - for (par = m_element[eltid - 1].parptr, i = 1 ; - - i <= m_element[eltid - 1].parcount ; - par++, i++) - if (!m_wcmbupstrcmp(&m_pname[m_parameter[par - 1].paramname], param)) - return(i) ; - return(M_NULLVAL) ; - } - -/* No parameter name specified */ - -/* First check is it a valid keyword? */ -for (par = m_element[eltid - 1].parptr, i = 1 ; - i <= m_element[eltid - 1].parcount ; - par++, i++) -if (m_parameter[par - 1].type == M_KEYWORD) -if (m_partype(par, value)) return(i) ; - -/* It wasn't a keyword. Check for valid value for some other parameter.*/ -for (par = m_element[eltid - 1].parptr, i = 1 ; -i <= m_element[eltid - 1].parcount ; -par++, i++) - { - if (m_parameter[par - 1].type == M_KEYWORD) continue ; - if (m_partype(par, value)) return(i) ; - } - -/* Not a valid value for any parameter */ -return(M_NULLVAL) ; -} - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/getc.c b/cde/programs/dthelp/parser.ccdf/htag/parser/getc.c deleted file mode 100644 index 8da864f5a..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/getc.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: getc.c /main/3 1995/11/08 11:24:02 rswiston $ */ -/* Copyright 1988, 1989 Hewlett-Packard Co. */ - -/* Default get-char procedure */ - -#include "userinc.h" -#include "globdec.h" - -int m_getc(m_ptr) - void *m_ptr ; - { - return(getc((FILE*) m_ptr)) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/getsign.c b/cde/programs/dthelp/parser.ccdf/htag/parser/getsign.c deleted file mode 100644 index 9606d6823..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/getsign.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: getsign.c /main/3 1995/11/08 11:24:15 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -/* Issue interface-generated sign-on message */ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" -#include "signonx.h" - -void m_getsignon(void) - { - m_errline(m_signon) ; - } - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/ifdata.c b/cde/programs/dthelp/parser.ccdf/htag/parser/ifdata.c deleted file mode 100644 index 1e598875c..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/ifdata.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: ifdata.c /main/3 1995/11/08 11:24:26 rswiston $ */ -/* Copyright 1988, 1989 Hewlett-Packard Co. */ - -/* Ifdata.c contains functions used by the interface to access the - single item of interface-determined data stored on the parse stack. */ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Retrieve the interface data stored with the current element's nth parent */ -void *m_getdata(n, flag) - int n ; - LOGICAL *flag ; - { - M_PARSE *stackptr ; - - for (stackptr = m_stacktop ; - stackptr->oldtop && n >= 0 ; - stackptr = stackptr->oldtop, n--) { - if (! n) { - *flag = TRUE ; - return(stackptr->ifdata) ; - } - } - *flag = FALSE ; - return(NULL) ; - } - -/* Store interface data for the current element's nth parent */ -LOGICAL m_putdata(data, n) - void *data ; - int n ; - { - M_PARSE *stackptr ; - - for (stackptr = m_stacktop ; - stackptr->oldtop && n >= 0 ; - stackptr = stackptr->oldtop, n--) { - if (! n) { - stackptr->ifdata = data ; - return(TRUE) ; - } - } - return(FALSE) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/input.c b/cde/programs/dthelp/parser.ccdf/htag/parser/input.c deleted file mode 100644 index 4a0c70559..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/input.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: input.c /main/3 1995/11/08 11:24:38 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Input.c contains procedures that deal with the interface between the - scanner and parser for PARSER */ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "delim.h" -#include "context.h" -#include "parser.h" - -/* M_etcomplete is called when a complete end-tag has been read */ -void m_etcomplete(void) - { - if (! m_scanel) { - M_WCHAR *wc_etago, *wc_tagc; - - wc_etago = MakeWideCharString(m_etago); - wc_tagc = MakeWideCharString(m_tagc); - m_err3("%s%s%s ignored: element undefined", wc_etago, m_name, wc_tagc) ; - m_free(wc_etago,"multi-byte string"); - m_free(wc_tagc,"multi-byte string"); - } - else - if (! m_ckend(m_scanel, FALSE)) { - m_err1("End tag for %s unexpected", m_nameofelt(m_scanel)) ; - m_expecting() ; - m_showcurelt() ; - if (m_element[m_stacktop->element - 1].content == M_CDATA || - m_element[m_stacktop->element - 1].content == M_RCDATA) - m_ckend(m_stacktop->element, FALSE) ; - m_frcend(m_scanel) ; - } - } - -/* M_frcend is called after a syntax error to end element VAL even - if more content for that element is expected */ -void m_frcend(val) - M_ELEMENT val ; - { - M_PARSE *stackptr ; - M_ELEMENT poppedval ; - - for (stackptr = m_stacktop ; - stackptr->oldtop && stackptr->element != val ; - stackptr = stackptr->oldtop) ; - if (! stackptr->oldtop) { - m_err1("No %s element currently opened", m_nameofelt(val)) ; - if (m_stacktop->oldtop) - if (m_element[m_stacktop->element].content == M_CDATA || - m_element[m_stacktop->element].content == M_RCDATA) - m_ckend(m_stacktop->element, FALSE) ; - return ; - } - while (TRUE) { - poppedval = m_stacktop->element ; - m_endaction(m_stacktop->element) ; - m_pop() ; - if (poppedval == val) return ; - } - } - -/* M_frcstart is called to force the start of an element when that element - cannot legally occur in the current context but does appear in the text*/ -void m_frcstart(void) - { - m_push(m_scanel, m_element[m_scanel - 1].start, m_scannet) ; - if (m_scannet) m_netlevel++ ; - m_stacktop->contextual = FALSE ; - m_stkparams() ; - if (m_element[m_scanel - 1].content == M_CDATA || - m_element[m_scanel - 1].content == M_RCDATA) { - m_stacktop->intext = TRUE ; - m_curcon = m_element[m_scanel - 1].content == M_CDATA ? - CDATAEL : RCDATAEL ; - m_stacktop->thisent = m_eopencnt ; - } - } - -/* M_holdproc processes a RE that was saved to test if it was the last - RE in an element's content */ -void m_holdproc(void) - { - if (m_stacktop->holdre) { - m_stacktop->holdre = FALSE ; - if (m_stacktop->intext) m_textaction(M_RE) ; - else { - m_strtcdata((int) M_RE) ; - if (m_curcon == NETDATACON) m_curcon = NETCDATA ; - else if (m_curcon == DATACON) m_curcon = POUNDCDATA ; - } - } - } - -/* M_stcomplete is called when a complete start tag has been recognized */ -void m_stcomplete(void) - { - if (! m_scanel) return ; - if (m_strtproc(m_scanel)) - m_stkparams() ; - else { - if (m_stacktop->holdre) m_holdproc() ; - /* M_strtproc should not return TRUE as long as #PCDATA is considered - optional, but this code should work if the standard is changed */ - if (m_strtproc(m_scanel)) m_stkparams() ; - else { - if (m_stacktop->oldtop) { - m_err2("%s not allowed at this point in %s", - m_nameofelt(m_scanel), - m_nameofelt(m_stacktop->element)) ; - m_expecting() ; - m_showcurelt() ; - } - else if (! m_start) { - M_WCHAR *wc_stago, *wc_tagc; - - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - m_err6("Expecting %s%s%s instead of %s%s%s to start document", - wc_stago, - m_nameofelt(1), - wc_tagc, - wc_stago, - m_nameofelt(m_scanel), - wc_tagc) ; - m_free(wc_stago,"multi-byte string"); - m_free(wc_tagc,"multi-byte string"); - } - m_frcstart() ; - } - } - if (m_element[m_scanel - 1].content == M_NONE) m_endtag(m_scanel) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/level.c b/cde/programs/dthelp/parser.ccdf/htag/parser/level.c deleted file mode 100644 index 2fed026a3..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/level.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: level.c /main/3 1995/11/08 11:24:58 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Procedure callable by interface designer. Returns number of occurrences - of element on parse stack */ -int m_level(elt) - M_WCHAR *elt ; - { - int i = 0 ; - M_PARSE *stackptr ; - - for (stackptr = m_stacktop ; - stackptr->oldtop ; - stackptr = stackptr->oldtop) { - if (! m_wcupstrcmp(elt, m_nameofelt(stackptr->element))) i++ ; - } - return(i) ; - } - - -int m_mblevel(elt) - char *elt ; - { - int retval; - M_WCHAR *wc_elt; - - wc_elt = MakeWideCharString(elt); - retval = m_level(wc_elt); - m_free(wc_elt,"wide character string"); - return(retval); - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/lookent.c b/cde/programs/dthelp/parser.ccdf/htag/parser/lookent.c deleted file mode 100644 index eaebd80e7..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/lookent.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: lookent.c /main/3 1995/11/08 11:25:18 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Lookent.c contains procedure m_lookent(), callable by interface - designers, to return entity type and content. Useful for entity - parameters */ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" -#include "entext.h" - -LOGICAL m_lookent(name, type, content, wheredef) - M_WCHAR *name ; - unsigned char *type ; - M_WCHAR **content ; - unsigned char *wheredef ; - { - M_ENTITY *entity ; - - if (entity = (M_ENTITY *) m_lookfortrie(name, m_enttrie)) { - *type = entity->type ; - *content = entity->content ; - *wheredef = entity->wheredef ; - return(TRUE) ; - } - else return(FALSE) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/minim.c b/cde/programs/dthelp/parser.ccdf/htag/parser/minim.c deleted file mode 100644 index 5742bc5a9..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/minim.c +++ /dev/null @@ -1,423 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: minim.c /main/3 1995/11/08 11:25:32 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Minim.c contains procedures relevant to tag minimization */ - -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" -#include "delim.h" -#include "context.h" - -/* M_expecting reports to the user the possible valid content at a particular - state in the parse of the document */ -void m_expecting(void) - { - LOGICAL expstart = TRUE ; - M_PARSE *stackptr ; - M_OPENFSA *fsastack ; - M_ANDLIST *usedand ; - M_ANDGROUP pand ; - LOGICAL required = FALSE ; - LOGICAL data = FALSE ; - - m_expcount = 0 ; - if (m_stacktop->intext) m_expline(&expstart, &data, M_NULLVAL) ; - for (stackptr = m_stacktop ; stackptr ; stackptr = stackptr->oldtop) { - if (m_explimit && m_expcount > M_EXPLIMIT) return ; - if (m_start && ! stackptr->oldtop) return ; - /* First check for possible start-tags. - Begin by testing if at start of document or not within a - CDATA or RCDATA element. */ - if (! stackptr->oldtop || - m_element[stackptr->element - 1].content == M_REGEXP) { - /* Note the following statement, which checks the type of the - element at the top of the stack, is not a repeat of the previous - one, which checks the type of an element embedded in the stack. - The second comparison prevents traversing paths from - a parent of an RCDATA or CDATA element and still allows displaying - the end-tag of the parent */ - if (! stackptr->oldtop || - m_element[m_stacktop->element - 1].content == M_REGEXP) - for (fsastack = stackptr->fsastack ; - fsastack ; - fsastack = fsastack->oldtop) { - for (pand = fsastack->andgroup ; - pand ; - pand = m_andgroup[pand - 1].next) { - for (usedand = fsastack->usedand ; - usedand ; - usedand = usedand->next) - if (usedand->group == pand) break ; - if (! usedand) - m_expexpand(&expstart, m_andgroup[pand - 1].start, &required, - &data) ; - } - if (required) return ; - m_expexpand(&expstart, fsastack->current, &required, &data) ; - if (! m_state[fsastack->current - 1].final) return ; - } - } - else if (m_element[stackptr->element - 1].content == M_CDATA || - m_element[stackptr->element - 1].content == M_RCDATA) - m_expline(&expstart, &data, M_NULLVAL) ; - if (m_explimit && m_expcount > M_EXPLIMIT) return ; - /* Now report the end-tag */ - m_exptend(&expstart, stackptr) ; - if (! m_element[stackptr->element - 1].emin) return ; - } - } - -/* Recursive procedure first called from expecting() to display - names of elements reachable from a particular node */ -void m_expexpand(expstart, node, required, data) - LOGICAL *expstart ; - M_STATE node ; - LOGICAL *required ; - LOGICAL *data ; - { - M_ARC parc ; - M_ANDGROUP pand ; - - for (parc = m_state[node - 1].first ; - parc ; - parc = m_arc[parc - 1].next) { - if (m_explimit && m_expcount > M_EXPLIMIT) return ; - if (m_arc[parc - 1].group) - for (pand = m_arc[parc - 1].group ; - pand ; - pand = m_andgroup[pand - 1].next) - m_expexpand(expstart, m_andgroup[pand - 1].start, required, data) ; - else { - if (! m_state[node - 1].final) *required = TRUE ; - m_expline(expstart, data, m_arc[parc - 1].label) ; - } - } - } - -/* M_expline writes one line for m_expecting() */ -void m_expline(expstart, data, label) - LOGICAL *expstart ; - LOGICAL *data ; - M_ELEMENT label ; - { - char buffer[M_NAMELEN + 2*MAXD + 1] ; - - if (! label && *data) return ; - if (m_excluded(label)) return ; - if (*expstart) { - sprintf(buffer, "Expecting ") ; - m_errline(buffer) ; - *expstart = FALSE ; - } - else { - sprintf(buffer, " or ") ; - m_errline(buffer) ; - } - if (m_explimit && m_expcount == M_EXPLIMIT) { - sprintf(buffer, ". . .\n") ; - m_errline(buffer) ; - } - else if (label) { - char *mb_enptr; - - mb_enptr = MakeMByteString(&m_ename[m_element[label - 1].enptr]); - sprintf(buffer, "%s%s%s\n", m_stago, mb_enptr, m_tagc) ; - m_free(mb_enptr,"multi-byte string"); - m_errline(buffer) ; - } - else { - sprintf(buffer, "data characters\n") ; - m_errline(buffer) ; - *data = TRUE ; - } - m_expcount++ ; - } - -/* M_exptend is called from m_expecting to inform the user after an - error if an end tag is permitted */ -void m_exptend(expstart, stackptr) - LOGICAL *expstart ; - M_PARSE *stackptr ; - { - char buffer[M_NAMELEN + 2*MAXD + 1] ; - - if (*expstart) { - sprintf(buffer, "Expecting ") ; - m_errline(buffer) ; - *expstart = FALSE ; - } - else { - sprintf(buffer, " or ") ; - m_errline(buffer) ; - } - if (m_explimit && m_expcount == M_EXPLIMIT) { - sprintf(buffer, ". . .\n") ; - m_errline(buffer) ; - } - else if (stackptr->neednet) { - sprintf(buffer, "%s\n", m_net) ; - m_errline(buffer) ; - } - else { - char *mb_enptr; - - mb_enptr = - MakeMByteString(&m_ename[m_element[stackptr->element - 1].enptr]); - sprintf(buffer, "%s%s%s\n", m_etago, mb_enptr, m_tagc) ; - m_free(mb_enptr,"multi-byte string"); - m_errline(buffer) ; - } - m_expcount++ ; - } - -/* M_findunique is used to test for start tag minimization. If the current - parse state permits at least one element with explicit start-tag - minimization, the left-most such element to occur in the content model - is returned. Otherwise, the contextually-required element, if any, - is returned. Finally, if the parse state permits a unique valid element, - and the flag for conformance to ISO 8879 is not set, the unique valid - element is returned by m_findunique. - - Before returning, m_findunique verifies that the element to be returned - permits start-tag minimization. If not, the value is returned only if - conformance to ISO 8879 is set. - - Actually m_findunique returns 1 greater than the index of the unique - element, 1 if character data is expected, and 0 (FALSE) if there is - no unique element. -*/ -M_ELEMENT m_findunique(from, newleft) - M_STATE from ; - int *newleft ; - { - M_ARC parc ; - M_ELEMENT cr = 0, minim = 0; - int leftmost = M_BIGINT ; - int testleft = M_BIGINT ; - int testminim ; - M_ANDGROUP pand ; - - for (parc = m_state[from - 1].first ; - parc ; - parc = m_arc[parc - 1].next) { - if (m_arc[parc - 1].group) { - if (! m_conform) - for (pand = m_arc[parc - 1].group ; - pand ; - pand = m_andgroup[pand - 1].next) { - testminim = m_findunique(m_andgroup[pand - 1].start, &testleft) ; - if (testminim && testleft < leftmost) { - minim = testminim ; - leftmost = testleft ; - } - } - } - else { - if (! m_conform) { - if (m_arc[parc - 1].minim && - m_arc[parc - 1].minim < leftmost && - ! m_excluded(m_arc[parc - 1].label)) { - /* Save the explicitly minimizable element plus its position - in the content model */ - leftmost = m_arc[parc - 1].minim ; - minim = m_arc[parc - 1].label + 1 ; - } /* End arc.minim > leftmost */ - else if (m_arc[parc - 1].optional && - parc == m_state[from - 1].first && - ! m_arc[parc - 1].next && - m_element[m_arc[parc - 1].label -1].smin && - ! m_excluded(m_arc[parc - 1].label)) - /* Save the only element that can occur */ - cr = m_arc[parc - 1].label ; - } /* End if (! m_conform) */ - /* Save the contextually-required element */ - if (! m_arc[parc - 1].optional && ! m_excluded(m_arc[parc - 1].label)) - cr = m_arc[parc - 1].label ; - } /* End if (! group) */ - } /* End for parc */ - *newleft = leftmost ; - if (minim) return(minim) ; - if (cr) return(cr + 1) ; - return(FALSE) ; - } - -/* M_nullendtag is called when a null end tag is encountered; i.e., at the - end of a short element */ -void m_nullendtag(void) - { - LOGICAL foundnet ; - - while (m_stacktop->oldtop) { - foundnet = m_stacktop->neednet ; - if (! foundnet && ! m_element[m_stacktop->element - 1].emin) { - m_err1("Missing end tag for %s", - m_nameofelt(m_stacktop->element)) ; - m_showcurelt() ; - } - if (! m_ckend(m_stacktop->element, foundnet)) { - M_WCHAR *wc_found; - - wc_found = MakeWideCharString(foundnet ? "Null" : "Implied"); - m_err2("%s end tag for %s unexpected", - wc_found, - m_nameofelt(m_stacktop->element)) ; - m_free(wc_found,"wide character string"); - m_expecting() ; - m_showcurelt() ; - m_frcend(m_stacktop->element) ; - } - if (foundnet) return ; - } - m_error("Internal error: Invalid stack in Nullendtag") ; - m_exit(TRUE) ; - } - -/* Tests to see if an end tag may have been omitted at this point in the - parse.*/ -LOGICAL m_omitend(void) - { - M_ANDGROUP pand ; - M_OPENFSA *fsastack ; - M_ANDLIST *usedand ; - - if (! m_stacktop->oldtop) return(FALSE) ; - if (m_element[m_stacktop->element - 1].content != M_REGEXP) return(TRUE) ; - for (fsastack = m_stacktop->fsastack ; - fsastack ; - fsastack = fsastack->oldtop) { - for (pand = fsastack->andgroup ; - pand ; - pand = m_andgroup[pand - 1].next) { - /* Doesn't matter if optional submodel of and-group has occurred */ - if (m_state[m_andgroup[pand - 1].start - 1].final) continue ; - for (usedand = fsastack->usedand ; - usedand ; - usedand = usedand->next) - if (usedand->group == pand) break ; - /* Required submodel of and-group has not occurred */ - if (! usedand) return(FALSE) ; - } - /* Current FSA not in final state */ - if (! m_state[fsastack->current - 1].final) return(FALSE) ; - } - *m_nextme = (M_MIN *) m_malloc(sizeof(M_MIN), "end-tag minimization") ; - (*m_nextme)->val = m_stacktop->element ; - (*m_nextme)->next = NULL ; - m_nextme = &(*m_nextme)->next ; - return(TRUE) ; - } - -/* Tests to see if a start tag may have been omitted at this point of - the parse. If so, saves the element name in the MINVAL array*/ -LOGICAL m_omitstart() - { - M_ELEMENT c = M_NULLVAL ; - - /* int par ; (used in commented-out code below) */ - M_OPENFSA *fsastack ; - M_ANDLIST *usedand ; - M_ANDGROUP pand ; - int leftmost = M_BIGINT ; - int newleft = M_BIGINT ; - M_ELEMENT newc = M_NULLVAL ; - LOGICAL required = FALSE ; - M_MIN *min ; - - /* Make sure are in an element that has a content model */ - if (m_stacktop->oldtop && - m_element[m_stacktop->element - 1].content != M_REGEXP) - return(FALSE) ; - - /* Test for unique element expected, or only allowed token is #PCDATA */ - for (fsastack = m_stacktop->fsastack ; - fsastack ; - fsastack = fsastack->oldtop) { - for (pand = fsastack->andgroup ; - pand ; - pand = m_andgroup[pand - 1].next) { - for (usedand = fsastack->usedand ; - usedand ; - usedand = usedand->next) - if (usedand->group == pand) break ; - if (! usedand) { - if (! m_state[m_andgroup[pand - 1].start - 1].final) - required = TRUE ; - newc = m_findunique(m_andgroup[pand - 1].start, &newleft) ; - if (newleft < leftmost) { - leftmost = newleft ; - c = newc ; - } - } - } - if (! required) { - newc = m_findunique(fsastack->current, &newleft) ; - if (newleft < leftmost) { - leftmost = newleft ; - c = newc ; - } - } - if (c > 1) break ; - if (fsastack == m_stacktop->fsastack && newc) { - c = newc ; - break ; - } - if (m_conform) return(FALSE) ; - if (! m_state[fsastack->current - 1].final) return(FALSE) ; - } - if (! c) return(FALSE) ; - - /* Have found a unique element. Can its start-tag be omitted? */ - c-- ; - if (m_element[c - 1].content == M_NONE) return(FALSE) ; - if (m_element[c - 1].content == M_CDATA) return(FALSE) ; - if (m_element[c - 1].content == M_RCDATA) return(FALSE) ; - - /* Following code allows start-tag to be omitted only if all required - parameters are specified: - for (par = m_element[c - 1].parptr ; par ; - par = m_parameter[par - 1].next) - if (m_parameter[par - 1].deftype == M_REQUIRED) return(FALSE) ; - */ - - /* Check for recursive sequences of omitted tags */ - for (min = m_minstart ; min ; min = min->next) - if (c == min->val) return(FALSE) ; - - m_push(c, m_element[c - 1].start, FALSE) ; - *m_nextms = (M_MIN *) m_malloc(sizeof(M_MIN), "start-tag minimization") ; - (*m_nextms)->val = m_stacktop->element ; - (*m_nextms)->next = NULL ; - m_nextms = &(*m_nextms)->next ; - return(TRUE) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/openent.c b/cde/programs/dthelp/parser.ccdf/htag/parser/openent.c deleted file mode 100644 index b93064d17..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/openent.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: openent.c /main/3 1995/11/08 11:25:50 rswiston $ */ -/* Copyright 1988, 1989 Hewlett-Packard Co. */ - -/* Default open SYSTEM entity procedure */ - -#include "userinc.h" -#include "globdec.h" - -void *m_openent(entcontent) - M_WCHAR *entcontent ; - { - return((void *) fopen(entcontent, "r")) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/openfrst.c b/cde/programs/dthelp/parser.ccdf/htag/parser/openfrst.c deleted file mode 100644 index 2e07878e1..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/openfrst.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: openfrst.c /main/3 1995/11/08 11:26:10 rswiston $ */ -/* Copyright 1988, 1989 Hewlett-Packard Co. */ - -/* Default open SYSTEM entity procedure */ - -#include "userinc.h" -#include "globdec.h" - -void *m_openfirst(void) - { - return((void *) stdin) ; - } - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/optstrg.c b/cde/programs/dthelp/parser.ccdf/htag/parser/optstrg.c deleted file mode 100644 index ddf9fa7ef..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/optstrg.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: optstrg.c /main/3 1995/11/08 11:26:29 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Get program options from a string */ -void m_optstring(p) - char *p ; - { - if (strchr(p, 'a')) m_malftrace = TRUE ; - if (strchr(p, 'c')) m_chtrace = TRUE ; - if (strchr(p, 'd')) m_cdtrace = TRUE ; - if (strchr(p, 'e')) m_entdupchk = FALSE ; - if (strchr(p, 'h')) m_heapchk = TRUE ; - if (strchr(p, 'l')) m_explimit = FALSE ; - if (strchr(p, 'm')) m_conform = TRUE ; - if (strchr(p, 's')) m_scantrace = TRUE ; - if (strchr(p, 't')) m_tagtrace = TRUE ; - if (strchr(p, 'w')) m_wholetag = TRUE ; - - if (strchr(p, 'A')) m_malftrace = TRUE ; - if (strchr(p, 'C')) m_chtrace = TRUE ; - if (strchr(p, 'D')) m_cdtrace = TRUE ; - if (strchr(p, 'E')) m_entdupchk = FALSE ; - if (strchr(p, 'H')) m_heapchk = TRUE ; - if (strchr(p, 'L')) m_explimit = FALSE ; - if (strchr(p, 'M')) m_conform = TRUE ; - if (strchr(p, 'S')) m_scantrace = TRUE ; - if (strchr(p, 'T')) m_tagtrace = TRUE ; - if (strchr(p, 'W')) m_wholetag = TRUE ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/param.c b/cde/programs/dthelp/parser.ccdf/htag/parser/param.c deleted file mode 100644 index c5250a57a..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/param.c +++ /dev/null @@ -1,351 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: param.c /main/3 1995/11/08 11:26:48 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Param.c has procedures relevant to parameters (attributes). */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "delim.h" -#include "context.h" -#include "dtdext.h" -#include "parser.h" -#include "entext.h" - -/* Process the value for the parameter whose index number was previously - saved in m_ppsave */ -void m_attval(string) - M_WCHAR *string ; - { - const M_WCHAR *p ; - - if (p = m_partype(m_ppsave, string)) { - if (m_parameter[m_ppsave - 1].type == M_KEYWORD) - m_poccur[m_psave] = (M_WCHAR *) p ; - else { - m_poccur[m_psave] = (M_WCHAR *) - m_malloc(w_strlen(p) + 1, "parameter value") ; - w_strcpy(m_poccur[m_psave], p) ; - m_parupper(m_ppsave, m_poccur[m_psave]) ; - } - m_updatedefault(m_ppsave, p) ; - } - else m_err2("\"%s\" -- error in value for parameter %s", - string, - &m_pname[m_parameter[m_ppsave - 1].paramname]) ; - } - -/* Process a string that is a parameter value not prefixed by the parameter - name and value indicator */ -LOGICAL m_attvonly(string) - M_WCHAR *string ; - { - const M_WCHAR *p ; - int par, i ; - - if (! m_scanel) { - m_error("Program error in m_attvonly") ; - m_exit(TRUE) ; - } - /* First check is it a valid keyword? */ - for (par = m_element[m_scanel - 1].parptr, i = 0 ; - i < m_element[m_scanel - 1].parcount ; - par++, i++) - if (m_parameter[par - 1].type == M_KEYWORD) - if (p = m_partype(par, string)) { - if (m_poccur[i]) - m_err2( - "Redefinition of parameter %s. Discarding old value '%s'.", - &m_pname[m_parameter[par - 1].paramname], - m_poccur[i]) ; - m_poccur[i] = (M_WCHAR *) p ; - m_updatedefault(par, p) ; - return(TRUE) ; - } - /* It wasn't a keyword. Check for valid value for some other - parameter whose value has not yet been specified. */ - for (par = m_element[m_scanel - 1].parptr, i = 0 ; - i < m_element[m_scanel - 1].parcount ; - par++, i++) - if (! m_poccur[i]) { - m_poccur[i] = (M_WCHAR *) m_partype(par, string) ; - if (m_poccur[i]) { - m_parupper(par, string) ; - m_poccur[i] = (M_WCHAR *) - m_malloc(w_strlen(string) + 1, "parameter value") ; - w_strcpy(m_poccur[i], string) ; - m_updatedefault(par, m_poccur[i]) ; - return(TRUE) ; - } - } - m_err2("%s: impossible value for any parameters of %s", - string, - m_nameofelt(m_scanel)) ; - return(FALSE) ; - } - -/* Check a name previously saved in m_saveatt to see if it is the name of - a valid parameter for the current start tag */ -void m_findatt(void) - { - int par, i ; - - if (! m_scanel) { - m_error("Program error in m_findatt") ; - m_exit(TRUE) ; - } - for (par = m_element[m_scanel - 1].parptr, i = 0 ; - i < m_element[m_scanel - 1].parcount ; - par++, i++) - if (! m_wcupstrcmp(&m_pname[m_parameter[par - 1].paramname], - m_saveatt)) { - if (m_poccur[i]) - m_err2("Redefinition of parameter %s. Discarding old value '%s'.", - &m_pname[m_parameter[par - 1].paramname], - m_poccur[i]) ; - m_psave = i ; - m_ppsave = par ; - return ; - } - m_attvonly(m_saveatt) ; - if (! m_wholetag) { - M_WCHAR *wc_tagc; - - wc_tagc = MakeWideCharString(m_tagc); - m_err3("No %s parameter for %s (possibly missing %s)", - m_saveatt, - m_nameofelt(m_scanel), - wc_tagc) ; - m_free(wc_tagc,"multi-byte string"); - } - m_undodelim(m_dlmptr[M_VI - 1], TRUE) ; - m_stcomplete() ; - m_curcon = START ; - } - -/* Free the parameter storage associated with an element on the parse stack */ -void m_freeparam(stackelt) - M_PARSE *stackelt ; - { - int i ; - int par ; - - if (stackelt->param) { - for (i = 0, par = m_element[stackelt->element - 1].parptr - 1 ; - i < m_element[stackelt->element - 1].parcount ; i++, par++) - if (m_parameter[par].type != M_KEYWORD) - if (m_parameter[par].deftype != M_NAMEDEF || - stackelt->param[i] != m_parameter[par].defval) - if (stackelt->param[i]) - m_free(stackelt->param[i], "parameter value") ; - m_free(stackelt->param, "parameter block") ; - } - } - -/* Force a parameter value to uppercase, if appropriate for its type. - Also, if list-valued attribute, remove leading and trailing spaces, - and condense white-space sequences to a single blank*/ -void m_parupper(par, string) - int par ; - M_WCHAR *string ; - { - M_WCHAR *p ; - M_WCHAR *q ; - int i ; - - switch (m_parameter[par - 1].type) { - case M_ID: - case M_IDRF: - case M_NAMEPAR: - case M_NMTOKEN: - case M_NUTOKEN: - case M_ENTATT: - for ( ; *string ; string++) - *string = m_ctupper(*string) ; - return ; - case M_IDRFS: - case M_NAMES: - case M_NMSTOKEN: - case M_NUSTOKEN: - case M_NUMS: - for (p = string; *p ; p++) - if (! m_whitespace(*p)) break ; - w_strcpy(string, p) ; - for (p = string, i = 0 ; *p ; p++, i++) - *p = m_ctupper(*p) ; - if (m_whitespace(*p)) { - *p = M_SPACE ; - for (q = p + 1 ; m_whitespace(*q); q++) ; - w_strcpy(p + 1, q) ; - } - if (i && m_whitespace(string[i - 1])) string[i - 1] = M_EOS ; - return ; - default: - for ( ; *string ; string++) - if (*string == M_RE || *string == M_TAB) *string = M_SPACE ; - return ; - } - } - -/* Set all parameters to their default values for an element included by - tag minimization */ -void m_stkdefaultparams(void) - { - int i, par = 0 ; - - m_stacktop->param = (M_WCHAR **) - m_malloc( - m_element[m_stacktop->element - 1].parcount * sizeof(M_WCHAR *), - "parameter block") ; - for (i = 0, par = m_element[m_stacktop->element - 1].parptr ; - i < m_element[m_stacktop->element - 1].parcount ; - i++, par++) - m_stkonedef(par, m_stacktop->element, m_stacktop->param, i) ; - m_strtaction(m_stacktop->element) ; - } - -/* Stack one default parameter */ -void m_stkonedef(par, scanel, poccur, i) - int par ; - M_ELEMENT scanel ; - M_WCHAR **poccur ; - int i ; - { - if (m_parameter[par - 1].deftype == M_REQUIRED || - (m_parameter[par - 1].deftype == M_CURRENT && - ! m_parameter[par - 1].defval)) - m_err2("Missing value for %s parameter of element %s", - &m_pname[m_parameter[par - 1].paramname], - m_nameofelt(scanel)) ; - poccur[i] = m_parameter[par - 1].defval ; - if (! m_parameter[par - 1].defval) return ; - if (m_parameter[par - 1].type == M_KEYWORD) return ; - - /* If parameter is an entity name, the default is usable only if - the name is that of a defined entity */ - if (m_parameter[par - 1].type == M_ENTATT) - if (! (M_ENTITY *) - m_lookfortrie(m_parameter[par - 1].defval, m_enttrie)) { - m_err1("Interface error: Default entity %s undefined", poccur[i]) ; - poccur[i] = NULL ; - return ; - } - - /* Non-null, non-keyword current default must go on stack, since - default could change in a subelement */ - if (m_parameter[par - 1].deftype != M_CURRENT && - m_parameter[par - 1].deftype != M_CHANGEDCUR) return ; - poccur[i] = (M_WCHAR *) - m_malloc(w_strlen(poccur[i]) + 1, "parameter value") ; - w_strcpy(poccur[i], m_parameter[par - 1].defval) ; - } - -/* Stack parameter values */ -void m_stkparams(void) - { - int i, par ; - - m_stacktop->param = (M_WCHAR **) - m_malloc( - m_element[m_stacktop->element - 1].parcount * sizeof(M_WCHAR *), - "parameter block") ; - for (i = 0, par = m_element[m_scanel - 1].parptr ; - i < m_element[m_scanel - 1].parcount ; - i++, par++) { - if (! m_poccur[i]) m_stkonedef(par, m_scanel, m_stacktop->param, i) ; - else m_stacktop->param[i] = m_poccur[i] ; - } - m_strtaction(m_stacktop->element) ; - } - -/* Update the default of a parameter whose default is #CURRENT */ -void m_updatedefault(const int par , const M_WCHAR *string ) - { - if (m_parameter[par - 1].deftype != M_CURRENT && - m_parameter[par - 1].deftype != M_CHANGEDCUR) return ; - - /* For keyword parameters, the string is already saved in the - keyword array; for entities, it is saved with the entity structure */ - /* In light of the above comment, why does the following if statement - not test for parameters of type entity? */ - if (m_parameter[par - 1].type == M_KEYWORD) - m_parameter[par - 1].defval = (M_WCHAR *) string ; - - /* Save value in allocated storage */ - else { - if (m_parameter[par - 1].deftype == M_CHANGEDCUR) - m_free(m_parameter[par - 1].defval, "updateable default") ; - m_parameter[par - 1].defval = (M_WCHAR *) - m_malloc(w_strlen(string) + 1, "updateable default") ; - w_strcpy(m_parameter[par - 1].defval, string) ; - } - - m_parameter[par - 1].deftype = M_CHANGEDCUR ; - } - -/* Check to see if a string that occurs after the element name in a start - tag is a valid parameter name or value; if not, assume tag is ended */ -LOGICAL m_validinpar(string) - M_WCHAR *string ; - { - int par ; - M_WCHAR *p ; - int i ; - M_WCHAR *wc_tagc; - - if (! m_scanel) { - m_error("Program error in m_validinpar") ; - m_exit(TRUE) ; - } - for (par = m_element[m_scanel - 1].parptr, i = 0 ; - i < m_element[m_scanel - 1].parcount ; - par++, i++) { - /* Check if valid name of a parameter */ - if (! m_wcupstrcmp(&m_pname[m_parameter[par - 1].paramname], string)) - return(TRUE) ; - /* Check if possible value of a keyword parameter or of a non-keyword - parameter that has not yet occurred*/ - if (m_partype(par, string) && - (m_parameter[par - 1].type == M_KEYWORD || ! m_poccur[i])) - return(TRUE) ; - } - wc_tagc = MakeWideCharString(m_tagc); - if (! m_wholetag) m_err1("Invalid parameter or missing %s", wc_tagc) ; - m_free(wc_tagc,"wide character string"); - m_stcomplete() ; - m_curcon = POUNDCDATA ; - for (p = string ; *p ; p++) ; - for (p-- ; p >= string ; p--) m_ungetachar((int) *p, M_NORMAL, TRUE) ; - return(FALSE) ; - } - -#include "paramu.c" - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/parcount.c b/cde/programs/dthelp/parser.ccdf/htag/parser/parcount.c deleted file mode 100644 index d9dccc3db..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/parcount.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: parcount.c /main/3 1995/11/08 11:27:07 rswiston $ */ -/* - Copyright 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Function callable by interface designers. Returns number of parameters - of specified element (-1 indicates error). */ -int m_parcount(elt) - M_WCHAR *elt ; - { - M_ELEMENT eltid ; - - if (! (eltid = m_packedlook(m_entree, elt))) return(-1) ; - return(m_element[eltid - 1].parcount) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/pardef.c b/cde/programs/dthelp/parser.ccdf/htag/parser/pardef.c deleted file mode 100644 index 1b5298370..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/pardef.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: pardef.c /main/3 1995/11/08 11:27:25 rswiston $ */ -/* - Copyright 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Function callable by interface designers. Returns pointer to default - value of a parameter of an element. Type is set to indicate type of - default. Error indication is type is 0 and function returns NULL. */ -M_WCHAR *m_pardefault(elt, param, type) - M_WCHAR *elt ; - M_WCHAR *param ; - unsigned char *type ; - { - M_ELEMENT eltid ; - int par ; - int i ; - - *type = M_NULLVAL ; - if (! (eltid = m_packedlook(m_entree, elt))) return(NULL) ; - - for (par = m_element[eltid - 1].parptr, i = 0 ; - i < m_element[eltid - 1].parcount ; - par++, i++) - if (! m_wcupstrcmp(&m_pname[m_parameter[par - 1].paramname], param)) { - *type = (unsigned char) m_parameter[par - 1].deftype ; - if (*type == M_REQUIRED || *type == M_NULLDEF) return(NULL) ; - return(m_parameter[par -1].defval) ; - } - - /* Can't find the parameter */ - return(NULL) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/parent.c b/cde/programs/dthelp/parser.ccdf/htag/parser/parent.c deleted file mode 100644 index e04b644fe..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/parent.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: parent.c /main/3 1995/11/08 11:27:46 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Procedure callable by interface designers. Returns pointer to name - of nth level parent of current element (0 is self, 1 is parent, 2 - is grandparent, etc.) */ -M_WCHAR *m_parent(n) - int n ; - { - M_PARSE *stackptr ; - - for (stackptr = m_stacktop ; - stackptr->oldtop && n >= 0 ; - stackptr = stackptr->oldtop, n--) { - if (! n) - return(m_nameofelt(stackptr->element)) ; - } - return(NULL) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/parname.c b/cde/programs/dthelp/parser.ccdf/htag/parser/parname.c deleted file mode 100644 index c748b97ff..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/parname.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: parname.c /main/3 1995/11/08 11:28:03 rswiston $ */ -/* - Copyright 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Function callable by interface designers. Returns name of nth parameter - of specified element (NULL indicates error). */ -M_WCHAR *m_parname(elt, n) - M_WCHAR *elt ; - int n ; - { - M_ELEMENT eltid ; - - if (! (eltid = m_packedlook(m_entree, elt))) return(NULL) ; - if (n < 1 || n > m_element[eltid - 1].parcount) return(NULL) ; - return(&m_pname[m_parameter[(n - 1) + m_element[eltid - 1].parptr - 1]. - paramname]) ; - } - -M_WCHAR *m_mbparname(elt, n) -char *elt ; -int n ; -{ -M_WCHAR *wc_elt, *retval; - -wc_elt = MakeWideCharString(elt); -retval = m_parname(wc_elt, n); -m_free(wc_elt,"wide character string"); -} - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/parser.c b/cde/programs/dthelp/parser.ccdf/htag/parser/parser.c deleted file mode 100644 index 09c7bde6f..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/parser.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: parser.c /main/3 1995/11/08 11:28:19 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Parser.c contains the main procedure for program PARSER */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "context.h" -#include "delim.h" -#include "parser.h" -#include "if.h" -#include "entext.h" - -/* Main procedure */ -void main(argc, argv) - int argc ; - char **argv ; - { - static char parserr[] = "\nM_token=%d, m_prevcon=%d, m_scanval=%d\n" ; - static char sopt[] = - "prevcon=%d,token=%d,curcon=%d,scanval='%c'(%d),line=%d,netlevel=%d\n" ; - static char name[] = "m_name = '%s'\n" ; - static char literal[] = "m_literal = '%s'\n" ; -#if defined(hpux) || defined(_AIX) || defined(sun) - char buffer[M_LITLEN + 80] ; -#else -#define max4(a,b,c,d) (a>b&&a>c&&a>d) ? a : ((b>c&&b>d) ? b : (c>d ? c : d)) - M_WCHAR buffer[max4(sizeof(parserr) + 3, - sizeof(sopt) + 6, - sizeof(name) + M_NAMELEN - 2, - sizeof(literal) + M_LITLEN - 2)] ; -#endif - - m_argc = argc ; - m_argv = argv ; - - m_strtcase(1) ; - m_globss() ; - m_setoptions() ; - m_initialize() ; - while (TRUE) { - m_token = m_scan() ; - m_prevcon = m_curcon ; - m_curcon = m_newcon(m_prevcon - 1, m_token - 1) ; - if (! m_curcon) { - if (m_token != M_ENDFILE) { - m_error("Parsing table error") ; - sprintf(buffer, parserr, m_token, m_prevcon, m_scanval) ; - m_errline(buffer) ; - } - else { - m_error("Unexpected end of document") ; - m_showcurelt() ; - } - m_done() ; - } - if ((! m_stacktop->oldtop) && - m_start && - ! m_aftereod && - m_state[m_stacktop->fsastack->current - 1].final && - (m_token != M_ENDFILE) && - (m_token != M_TEXT || ! m_whitespace((M_WCHAR) m_scanval)) - ) { - m_error("Expecting end of document") ; - m_aftereod = TRUE ; - } - if (m_scantrace) { - sprintf(buffer, sopt, - m_prevcon, m_token, m_curcon, m_scanval ? m_scanval : ' ', - m_scanval, m_line[m_sysecnt], m_netlevel) ; - m_trace(buffer) ; - if (m_token == M_NAME) { - sprintf(buffer, name, m_name) ; - m_trace(buffer) ; - } - if (m_token == M_LITERAL) { - sprintf(buffer, literal, m_literal) ; - m_trace(buffer) ; - } - } -#include "case.c" - m_adjuststate() ; - if (m_token == M_ENDFILE) break ; - } - /* At EOF */ - m_done() ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/parser.h b/cde/programs/dthelp/parser.ccdf/htag/parser/parser.h deleted file mode 100644 index 277724c27..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/parser.h +++ /dev/null @@ -1,455 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: parser.h /main/3 1995/11/08 11:28:35 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Parser.h allocates global variables for PARSER */ - -#if defined(M_PARDEF) -#define M_PAREXTERN -#define M_PARINIT(a) = a -#else -#define M_PAREXTERN extern -#define M_PARINIT(a) -#endif - -#include "common.h" - -/* Stack of open entities and line number in each external file */ -#define M_ENTLVL 16 /* Maximum number of open entities */ -M_PAREXTERN M_ENTITY *m_opene[M_ENTLVL] ; -M_PAREXTERN int m_eopencnt M_PARINIT(0) ; -M_PAREXTERN void *m_sysent[M_ENTLVL + 1] ; -#define M_FIRSTLINE 1 -M_PAREXTERN int m_line[M_ENTLVL + 1] M_PARINIT({M_FIRSTLINE}) ; -M_PAREXTERN int m_sysecnt M_PARINIT(0) ; - -/* Possible states of a line -- no SGML characters yet processed, SGML - characters processed but no data character or contextual end tag, - data character or contextual end tag (i.e., end tag of a proper - subelement) has occurred. Note that linestat is stacked with each - element. If an element contains a line that - * is neither its first nor last line - * contains data characters within an included element - the status of the line should be M_SOMETHING not M_DCORCET because the data - characters belong to the inner element rather than the outer one. - - Also note that "M_DCORCET" originally stood for "data character or contextual - end tag" when the Standard used the term "contextual element" to mean - an element allowed by a model rather than an inclusion and when - the rules for ignoring RE's referred to the occurrence of end tags of - such elements rather than the entire elements. Now the acronym can be - interpreted as "data character or contextual element". - */ -#define M_NOTHING 0 -#define M_SOMETHING 1 -#define M_DCORCET 2 - -/* Definitions for parse stack. The primary data structure of PARSER - is a stack containing one entry for each open element. Each entry - on the stack is described in an m_parse structure. Entries for - element's whose content is defined by a content model have a - pointer to a stack of open FSAs. These FSA stacks do not describe - the actual automata (which are coded in the data structures - generated by BUILD, but rather the current state in the active - automata. An element's FSA stack will have one entry for the - content model and an additional entry for each active and-group. -*/ - -typedef struct m_parse M_PARSE ; -typedef struct m_openfsa M_OPENFSA ; -typedef struct m_andlist M_ANDLIST ; - -struct m_parse { - /* Pointer to preceding entry on stack */ - M_PARSE *oldtop ; - - /* Identifier of element this entry represents */ - M_ELEMENT element ; - - /* Pointer to table of parameter pointers for this instance of this - element */ - M_WCHAR **param ; - - /* Pointer to stack of open FSAs for this element */ - M_OPENFSA *fsastack ; - - /* For RCDATA elements to indicate the nesting level - of entities when the element opened, since net and etago - delimiters are not recognized except in the same entity - as the element began. */ - int thisent ; - - /* TRUE iff the element's start-tag ended with a NET so that a NET - is expected to end the element */ - LOGICAL neednet ; - - /* Has a Record End occurred in the element's content? */ - LOGICAL firstre ; - - /* Flag that indicates whether the element is contextual, i.e., - whether it occurred because it was allowed in context by a - content model, or it was allowed by an inclusion exception or - occurred by error. (The term "contextual subelement" was used - in the Draft International Standard in the same sense as - "proper subelement" in the International Standard.) */ - LOGICAL contextual ; - - /* Whether character data is currently being processed. */ - LOGICAL intext ; - - /* Line status. Indicates whether anything has occurred after - the start-tag or most recent Record Start in this element */ - char linestat ; - - /* Flag indicating whether or not a Record End (carriage return) - has been scanned and is being held to see if there is more - content in the element. If there is, the RE will be processed - as a data character, otherwise it will be discarded. */ - LOGICAL holdre ; - - /* Pointer to the element's short reference map. The value is NULL - if there is no map. */ - int *map ; - - /* Index in actions for processing text characters encountered - in this element, and pointer to stack location where parameters - should be retrieved. */ - int cdcase ; - M_PARSE *cdparam ; - - /* Index in actions for processing processing instructions - encountered in this element, and pointer to stack location where - parameters should be retrieved. */ - int picase ; - M_PARSE *piparam ; - - /* Index in actions for processing start- and end-strings - encountered in this element, and pointer to stack location where - parameters should be retrieved. */ - int stccase ; - M_PARSE *stparam ; - - /* Pointer to name of input file in which the current element - began (NULL if primary input file). */ - M_WCHAR *file ; - - /* Line number where the current element began. */ - int line ; - - /* Interface-defined pointer stored on the stack */ - void *ifdata ; - } ; - -struct m_openfsa { - /* Pointer to preceding entry on FSA stack */ - M_OPENFSA *oldtop ; - - /* Current state in this FSA */ - M_STATE current ; - - /* Identifier of set of and-groups being processed and pointer to list of - and-groups that have occurred within this set. */ - M_ANDGROUP andgroup ; - M_ANDLIST *usedand ; - } ; - -struct m_andlist { - M_ANDGROUP group ; - M_ANDLIST *next ; - } ; - -extern M_OPENFSA m_botfsa ; - -/* Bottom marker of parse stack */ -M_PAREXTERN M_PARSE m_stackbot -#if defined(M_PARDEF) - = { - /* M_PARSE *oldtop ;*/ NULL, - /* M_ELEMENT element ;*/ M_NULLVAL, - /* M_WCHAR **param ;*/ NULL, - /* M_OPENFSA *fsastack ;*/ &m_botfsa, - /* int thisent ;*/ 0, - /* LOGICAL neednet ;*/ FALSE, - /* LOGICAL firstre ; */ FALSE, - /* LOGICAL contextual ;*/ TRUE, - /* LOGICAL intext ;*/ FALSE, - /* int linestat ;*/ M_NOTHING, - /* LOGICAL holdre ;*/ FALSE, - /* int *map ;*/ NULL, - /* int cdcase ;*/ 1, - /* M_PARSE *cdparam ;*/ &m_stackbot, - /* int picase ;*/ 1, - /* M_PARSE *piparam ;*/ &m_stackbot, - /* int stccase ;*/ 1, - /* M_PARSE *stparam ;*/ &m_stackbot, - /* M_WCHAR *file ;*/ NULL, - /* int line ;*/ M_FIRSTLINE, - /* void *ifdata ;*/ NULL, - } -#endif - ; - -M_PAREXTERN M_OPENFSA m_botfsa -#if defined(M_PARDEF) - = { - /* M_OPENFSA *oldtop ;*/ NULL, - /* M_STATE current ;*/ 1, - /* M_ANDGROUP andgroup ;*/ M_NULLVAL, - /* M_ANDGROUP *usedand ;*/ NULL, - } -#endif - ; - -/* Index of current top of parse stack */ -M_PAREXTERN M_PARSE *m_stacktop M_PARINIT(&m_stackbot) ; - -/* Pointer to stack location where parameters for current code -segment are defined. Used for inherited code segments (text-code, -pi-code, string-code) */ -M_PAREXTERN M_PARSE *m_stackpar ; - -/* Type of characters */ -typedef char M_HOLDTYPE ; - -#if defined(M_PARDEF) -#include "chartype.h" -#else -extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ; -#endif - -/* Indicates a start tag is allowed by an inclusion exception */ -#define M_NONCONTEXTUAL 2 - -/* Character used to delimit parameter names in start and end strings - entered as data to ELTDEF */ -#define M_ESCAPECHAR '@' - -/* Pointer to name of element */ -#define m_nameofelt(x) &m_ename[m_element[x - 1].enptr] - -/* Status of characters as read from input stream */ -#define M_EE 0 -#define M_NORMAL 1 -#define M_CDCHAR 2 -#define M_ENTNORMAL 3 - -/* State transition network generated by CONTEXT */ -#include "sparse.h" - -/* Maximum length of a sequence of blanks in a short reference delimiter */ -#define M_BSEQLEN 100 - -/* #defines used in recognition of short reference delimiters */ -#if defined(M_PARDEF) -#define M_HOLDSIZ M_MAXSR + M_BSEQLEN * M_MAXSEQ + 1 -#else -#define M_HOLDSIZ -#endif -#define M_REGCHAR 1 -#define M_SEQCHAR 2 -#define M_BSCHAR 3 -#define M_WSCHAR 4 -#define M_RSCHAR 5 - -/* Number of allowable tokens to display after a syntax error */ -#define M_EXPLIMIT 5 - -/* Status of T option output */ -#define M_TOPTSTARTTAG 0 -#define M_WHITESPACE 1 -#define M_OTHER 2 - -/* Maximum length of processing instruction (not in a PI entity) */ -#define M_PILEN 240 - -/* Storage for a name token just read by the scanner; and for a name read - while parsing parameters */ -M_PAREXTERN M_WCHAR m_name[M_NAMELEN + 1] ; -M_PAREXTERN M_WCHAR m_saveatt[M_NAMELEN + 1] ; - -/* M_curcon is current state of FSA that controls parser; m_prevcon is the - value of m_curcon before last character was scanned; m_token is the token - type returned by last call to scanner; and - m_scanval is index of element name just read within tag delimiters */ -M_PAREXTERN int m_curcon M_PARINIT(PREAMBLE) ; -M_PAREXTERN int m_prevcon ; -M_PAREXTERN int m_token ; -M_PAREXTERN int m_scanval ; - -/* Declarations for tentative list of omitted tags when checking for tag - MINimization */ -typedef struct m_min M_MIN ; -struct m_min { - int val ; - M_MIN *next ; - } ; -M_PAREXTERN M_MIN *m_minstart ; -M_PAREXTERN M_MIN *m_minend ; -M_PAREXTERN M_MIN **m_nextms ; -M_PAREXTERN M_MIN **m_nextme ; - -/* Count of the number of open elements expecting to be terminated with - a NET */ -M_PAREXTERN int m_netlevel M_PARINIT(0) ; - -/* Count of errors that have occurred */ -M_PAREXTERN int m_errcnt M_PARINIT(0) ; -#define M_ERRLIM 100 -M_PAREXTERN int m_errlim M_PARINIT(M_ERRLIM) ; -M_PAREXTERN int m_expcount ; -M_PAREXTERN LOGICAL m_errexit M_PARINIT(FALSE) ; - -/* Flag to indicate whether processing of the text has begun */ -M_PAREXTERN LOGICAL m_start M_PARINIT(FALSE) ; - -/* Flag indicates whether current start tag is terminated by End-tag - indicator or by tag-close delimiter (or start of another tag) */ -M_PAREXTERN LOGICAL m_scannet ; - -/* Storage for literals */ -M_PAREXTERN M_WCHAR m_literal[M_LITLEN + 1] ; - -/* Buffer for sequence of white space that has been read before it is - determined whether or not the white space is significant */ -#define M_WSPACELEN 100 -M_PAREXTERN int m_wspace[M_WSPACELEN] ; -M_PAREXTERN int m_wscount M_PARINIT(0) ; -M_PAREXTERN int m_maxws M_PARINIT(0) ; -M_PAREXTERN int m_wsused ; - -/* Temporary pointers to parameter values. Used while scanning start tag - before element is placed on parse stack.*/ -M_PAREXTERN -M_WCHAR *m_poccur[ -#if defined(M_PARDEF) -M_MAXPAR ? M_MAXPAR : 1 -#endif -] ; - -/* Index of a particular parameter within the parameter list for a given - element */ -M_PAREXTERN int m_psave ; -/* Index of a particular parameter within the list of all parameters for all - elements */ -M_PAREXTERN int m_ppsave ; - -/* Index of element of tag just scanned; may be result of short tag - minimization */ -M_PAREXTERN M_ELEMENT m_scanel ; - -/* Read-ahead buffer and number of characters currently in that buffer */ -#define M_SAVECHAR 500 -M_PAREXTERN int m_savechar[M_SAVECHAR] ; -M_PAREXTERN M_WCHAR m_savedchar[M_SAVECHAR] ; -M_PAREXTERN M_WCHAR m_oldlinestat[M_SAVECHAR] ; -M_PAREXTERN M_WCHAR m_oldatrs[M_SAVECHAR] ; -M_PAREXTERN int m_sourcefile[M_SAVECHAR] ; -M_PAREXTERN M_WCHAR m_atrs M_PARINIT(TRUE) ; -M_PAREXTERN int m_oldlsindex M_PARINIT(M_SAVECHAR - 1) ; -M_PAREXTERN int m_toundo M_PARINIT(0) ; -M_PAREXTERN int m_maxundo M_PARINIT(0) ; -#define M_LINELENGTH 80 -M_PAREXTERN int m_saveline[M_LINELENGTH][M_ENTLVL + 1] ; -M_PAREXTERN int m_svlncnt[M_ENTLVL + 1] M_PARINIT({0}) ; -M_PAREXTERN LOGICAL m_svlnwrap[M_ENTLVL + 1] M_PARINIT({FALSE}) ; - -/* Arrays used for short references */ -M_PAREXTERN int m_hold[M_HOLDSIZ] ; -M_PAREXTERN M_HOLDTYPE m_dhold[M_HOLDSIZ] ; -M_PAREXTERN int m_delim[M_HOLDSIZ] ; -M_PAREXTERN char m_srefchartype[M_HOLDSIZ] ; -M_PAREXTERN int m_current[M_HOLDSIZ] ; - -/* Options - A -- Trace of calls to m_malloc() and m_free() - B -- - C -- Trace of calls to m_getachar(), putachar() - D -- Trace of encountered data characters - E -- Don't report duplicate entity declarations - F -- - G -- - H -- M_malloc and m_free check for valid heap - I -- - J -- - K -- - L -- Don't limit number of possible tokens displayed by expecting() - M -- Determine start-tag minimization strictly according to the Standard - N -- - O -- - P -- - Q -- - R -- - S -- Scanner trace - T -- Tag trace - U -- - V -- - W -- Missing tagc not considered an error - X -- - Y -- - Z -- -*/ - -M_PAREXTERN LOGICAL m_malftrace M_PARINIT(FALSE) ; -M_PAREXTERN LOGICAL m_chtrace M_PARINIT(FALSE) ; -M_PAREXTERN LOGICAL m_cdtrace M_PARINIT(FALSE) ; -M_PAREXTERN LOGICAL m_entdupchk M_PARINIT(TRUE) ; -M_PAREXTERN LOGICAL m_heapchk M_PARINIT(FALSE) ; -M_PAREXTERN LOGICAL m_explimit M_PARINIT(TRUE) ; -M_PAREXTERN LOGICAL m_conform M_PARINIT(FALSE) ; -M_PAREXTERN LOGICAL m_scantrace M_PARINIT(FALSE) ; -M_PAREXTERN LOGICAL m_tagtrace M_PARINIT(FALSE) ; -M_PAREXTERN LOGICAL m_wholetag M_PARINIT(FALSE) ; -M_PAREXTERN int m_toptstat ; - -/* Flag that indicates when unexpected content detected after document - appears to be complete */ -M_PAREXTERN LOGICAL m_aftereod M_PARINIT(FALSE) ; - -/* Save standard C main program arguments */ -M_PAREXTERN int m_argc ; -M_PAREXTERN char **m_argv ; - -/* PARSER output file */ -M_PAREXTERN FILE *m_outfile M_PARINIT(stdout) ; -M_PAREXTERN FILE *m_errfile M_PARINIT(stdout) ; - -/* Save processing instruction */ -M_PAREXTERN M_WCHAR m_pi[M_PILEN + 1] ; -M_PAREXTERN int m_pilen M_PARINIT(0) ; - -/* Entity being defined */ -M_PAREXTERN M_ENTITY *m_entity ; -M_PAREXTERN int m_entclen ; -M_PAREXTERN M_WCHAR m_entcontent[M_LITLEN + 1] ; - -/* Largest positive integer */ -#define M_BIGINT 0x7FFF - -/* Include function prototypes */ -#include "proto.h" - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/parutil.c b/cde/programs/dthelp/parser.ccdf/htag/parser/parutil.c deleted file mode 100644 index b9f436866..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/parutil.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: parutil.c /main/3 1995/11/08 11:29:23 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Parutil.c contains utility functions for program PARSER */ - -#include -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "delim.h" -#include "context.h" -#include "parser.h" -#include "entext.h" -#include "if.h" - -#include "version.h" - -/* Adjust parsing state after each token if necessary */ -void m_adjuststate(void) - { - if (m_curcon == START) { - if (m_netlevel) { - if (m_stacktop->intext) m_curcon = NETCDATA ; - else if (m_textpermitted()) m_curcon = NETDATACON ; - else m_curcon = NETELCON ; - } - else { - if (m_stacktop->intext) m_curcon = POUNDCDATA ; - else if (m_textpermitted()) m_curcon = DATACON ; - else m_curcon = ELCON ; - } - } - else if (m_netlevel) switch(m_curcon) { - case POUNDCDATA: - m_curcon = NETCDATA ; - break ; - case CDATAEL: - if (m_stacktop->neednet) m_curcon = NETELCDATA ; - break ; - case RCDATAEL: - if (m_stacktop->neednet) m_curcon = NETRCDATA ; - break ; - default: - break ; - } - } - -/* Tests whether the element named in a tag is defined; if so, returns its - index; otherwise return FALSE */ -M_ELEMENT m_eltname(void) - { - M_ELEMENT eltid ; - - if (eltid = m_packedlook(m_entree, m_name)) return(eltid) ; - else { - m_err1("Undefined element %s", m_name) ; - return(FALSE) ; - } - } - -int get_mb_cur_max() -{ -char *l; -int i; - -l = getenv("LANG"); - -i = MB_CUR_MAX; - -return i; -} - -/* Program initialization */ -void m_initialize(void) -{ -char **mb_delims; -M_WCHAR **wc_delims; -m_signmsg(m_conform ? - "MARKUP PARSER " : - "MARKUP PARSER (with HP SGML enhancements) ") ; -m_signmsg(M_VERSION) ; -m_signmsg("\n") ; -m_signmsg("Copyright (c) 1986, 1987, 1988, 1989, 1991, 1992\n") ; -m_signmsg("Hewlett-Packard Co.\n") ; -m_getsignon() ; -if (! (m_sysent[m_sysecnt] = m_openfirst())) - { - m_error("Unable to open input file") ; - m_exit(TRUE) ; - } - -setlocale(LC_ALL, ""); -get_mb_cur_max(); - -mb_delims = mb_dlmptr; -wc_delims = m_dlmptr; - -while (*mb_delims) - { - *wc_delims++ = MakeWideCharString(*mb_delims); - mb_delims++; - } -*wc_delims = 0; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/parvalok.c b/cde/programs/dthelp/parser.ccdf/htag/parser/parvalok.c deleted file mode 100644 index 1fb0dee97..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/parvalok.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: parvalok.c /main/3 1995/11/08 11:29:47 rswiston $ */ -/* - Copyright 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Function callable by interface designers. Returns TRUE if specified value - is a legal value for the indicated parameter of the given element, - FALSE otherwise. */ -LOGICAL m_parvalok( M_WCHAR *elt , M_WCHAR *param , const M_WCHAR *value ) - { - M_ELEMENT eltid ; - int par ; - int i ; - - if (! (eltid = m_packedlook(m_entree, elt))) return(FALSE) ; - for (par = m_element[eltid - 1].parptr, i = 1 ; - i <= m_element[eltid - 1].parcount ; - par++, i++) - if (! m_wcupstrcmp(&m_pname[m_parameter[par - 1].paramname], param)) - if (m_partype(par, value)) return(TRUE) ; - else return(FALSE) ; - - /* No such parameter */ - return(FALSE) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/pi.c b/cde/programs/dthelp/parser.ccdf/htag/parser/pi.c deleted file mode 100644 index 7cb5e9a5d..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/pi.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: pi.c /main/3 1995/11/08 11:30:02 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Pi.c executes pi-code specified in the interface. */ - -#include "userinc.h" -#include "globdec.h" - -/* Include generated code */ -#include "pfile.c" - - -/* When a processing instruction or SDATA entity other than a CODE entity - occurs */ -void m_piaction(m_pi, m_entname, m_enttype) - M_WCHAR *m_pi ; - M_WCHAR *m_entname ; - int m_enttype ; - { - m_stackpar = m_stacktop->piparam ; - (*m_ptable[m_stacktop->picase])(m_pi, m_entname, m_enttype) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/procscmp.c b/cde/programs/dthelp/parser.ccdf/htag/parser/procscmp.c deleted file mode 100644 index 44b222c3e..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/procscmp.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: procscmp.c /main/3 1995/11/08 11:30:21 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Procscmp.c prefixes the interface's procs.c file with appropriate - declarations so it can be compiled. */ - -#include "userinc.h" -#include "globdec.h" - -/* Include any procedures specified by the interface designer */ -#include "procs.c" - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/proto.h b/cde/programs/dthelp/parser.ccdf/htag/parser/proto.h deleted file mode 100644 index e6d1002dc..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/proto.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: proto.h /main/3 1995/11/08 11:30:37 rswiston $ */ -int m_actgetc(void); - -void m_adjuststate(void); - -LOGICAL m_allwhite(const M_WCHAR *string); - -void m_attval(M_WCHAR *string); - -LOGICAL m_attvonly(M_WCHAR *string); - -int m_checkstart(M_ELEMENT val); - -LOGICAL m_ckend(M_ELEMENT val, LOGICAL neednet); - -void m_ckmap(M_WCHAR *name, LOGICAL useoradd); - -void m_closent(void *m_ptr); - -void m_codeent(int m_ent); - -M_PARSE *m_copystackelt(void); - -M_WCHAR *m_cyclent(LOGICAL init, unsigned char *type, M_WCHAR **content, - unsigned char *wheredef); - -void m_dispcurelt(M_WCHAR *file, int line); - -void m_done(void); - -void m_dumpline(M_WCHAR *file, int line); - -void m_eduptype(int type); - -M_ELEMENT m_eltname(void); - -void m_endaction(M_ELEMENT m_elt); - -void m_endcase(int m_action); - -void m_endtag(M_ELEMENT c); - -void m_entexpand(M_ENTITY *openent); - -void m_eprefix(void); - -void m_err1(const char *text, const M_WCHAR *arg); - -void m_err2(const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2); - -void m_err3(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3); - -void m_err4(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, M_WCHAR *arg4); - -void m_err5(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, - M_WCHAR *arg4, M_WCHAR *arg5); - -void m_err6(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, - M_WCHAR *arg4, M_WCHAR *arg5, M_WCHAR *arg6); - -void m_err7(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, - M_WCHAR *arg4, M_WCHAR *arg5, M_WCHAR *arg6, M_WCHAR *arg7); - -void m_errline(char *p); - -void m_error(char *text); - -void m_esuffix(void); - -void m_exit(int status); - -void m_etcomplete(void); - -LOGICAL m_excluded(M_ELEMENT elt); - -void m_expecting(void); - -void m_expexpand(LOGICAL *expstart, M_STATE node, LOGICAL *required, LOGICAL *data); - -void m_expline(LOGICAL *expstart, LOGICAL *data, M_ELEMENT label); - -void m_exptend(LOGICAL *expstart, M_PARSE *stackptr); - -int m_findact(M_ELEMENT elt, int *array); - -void m_findatt(void); - -void m_findchain(M_PARSE *stackptr, int start, int chainin, int *chainout, int *index, - LOGICAL wild); - -int m_findpar(const char *elt, const char *param, const M_WCHAR *value); - -M_ELEMENT m_findunique(M_STATE from, int *newleft); - -void m_frcend(M_ELEMENT val); - -void m_frcstart(void); - -void m_free(void *block, char *msg); - -void m_freeFSA(M_PARSE *stackelt); - -void m_freemin(M_MIN *min, char *msg); - -void m_freeparam(M_PARSE *stackelt); - -LOGICAL m_gendelim(int srlen, int context); - -int m_getachar(M_HOLDTYPE *dchar); - -int m_getc(void *m_ptr); - -int mb_getwc(void *m_ptr); - -void *m_getdata(int n, LOGICAL *flag); - -void m_getline(M_WCHAR **file, int *line); - -void m_getname(M_WCHAR first); - -void m_getsignon(void); - -int m_gettoken(int *c, M_HOLDTYPE *dchar, int context); - -void m_globes(void); - -void m_globss(void); - -void m_holdproc(void); - -void m_inctest(int *count, int limit, char *message); - -void m_initctype(void); - -void m_initialize(void); - -void m_lastchars(void); - -int m_level(M_WCHAR *elt); - -int m_mblevel(char *elt); - -void m_litproc(int delim); - -void m_longent(int context); - -LOGICAL m_lookent(M_WCHAR *name, unsigned char *type, M_WCHAR **content, - unsigned char *wheredef); - -void main(int argc, char **argv); - -void *m_malloc(int size, char *msg); - -void m_missingtagc(int c, M_HOLDTYPE dchar, LOGICAL start); - -LOGICAL m_nextand(M_OPENFSA *thisfsa, M_ELEMENT label); - -void m_nextdelimchar(int *n, int i, LOGICAL *linestart, LOGICAL newlinestart, LOGICAL skipblank, - unsigned char type); - -void m_ntrent(M_WCHAR *p); - -void m_nullendtag(void); - -LOGICAL m_omitend(void); - -LOGICAL m_omitstart(void); - -void m_openchk(FILE **ptr, char *name, char *mode); - -void *m_openent(M_WCHAR *entcontent); - -void *m_openfirst(void); - -void m_optstring(char *p); - -int m_packedlook(M_PTRIE *xptrie, M_WCHAR *name); - -int m_parcount(M_WCHAR *elt); - -M_WCHAR *m_pardefault(M_WCHAR *elt, M_WCHAR *param, unsigned char *type); - -M_WCHAR *m_parent(int n); - -M_WCHAR *m_parname(M_WCHAR *elt, int n); - -M_WCHAR *m_mbparname(char *elt, int n); - -const M_WCHAR *m_partype(const int par, const M_WCHAR *string); - -void m_parupper(int par, M_WCHAR *string); - -LOGICAL m_parvalok(M_WCHAR *elt, M_WCHAR *param, const M_WCHAR *value); - -void m_piaction(M_WCHAR *m_pi, M_WCHAR *m_entname, int m_enttype); - -void m_pop(void); - -void m_push(M_ELEMENT elt, M_STATE current, LOGICAL need); - -LOGICAL m_putdata(void *data, int n); - -void m_readcomments(void); - -void *m_realloc(void *ptr, int size, char *msg); - -int m_scan(void); - -void m_setmap(int map, LOGICAL useoradd); - -void m_setoptions(void); - -void m_setparam(M_WCHAR **cvar, int par); - -void m_shortref(int context); - -void m_showcurelt(void); - -void m_signmsg(char *p); - -void m_sigre(void); - -void m_startdoc(void); - -void m_startmsg(void); - -void m_stcaction(M_WCHAR *m_string, LOGICAL M_START, LOGICAL M_END); - -void m_stcomplete(void); - -void m_stkdefaultparams(void); - -void m_stkonedef(int par, M_ELEMENT scanel, M_WCHAR **poccur, int i); - -void m_stkparams(void); - -void m_strtaction(M_ELEMENT m_elt); - -void m_strtcase(int m_action); - -void m_strtcdata(int scanval); - -LOGICAL m_strtproc(M_ELEMENT scanval); - -void m_strttag(M_ELEMENT val, LOGICAL net); - -void m_textaction(M_WCHAR m_textchar); - -void m_textout(char *format, LOGICAL start, LOGICAL end); - -LOGICAL m_textpermitted(void); - -M_WCHAR *m_thisfile(void); - -int m_thisline(void); - -void m_trace(char *p); - -void m_wctrace(M_WCHAR *p); - -LOGICAL m_transition(M_ELEMENT label, LOGICAL recur); - -void m_undodelim(M_WCHAR *delim, LOGICAL flag); - -void m_ungetachar(int c, M_HOLDTYPE dchar, LOGICAL preread); - -void m_updatedefault(const int par, const M_WCHAR *string); - -int m_wcupstrcmp(const M_WCHAR *p, const M_WCHAR *q); - -int m_wcmbupstrcmp(const M_WCHAR *p, const char *q); - -int m_mbmbupstrcmp(const char *p, const char *q); - -LOGICAL m_validinpar(M_WCHAR *string); - -LOGICAL m_vldentref(void); - -LOGICAL m_whitespace(M_WCHAR c); - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/scan.c b/cde/programs/dthelp/parser.ccdf/htag/parser/scan.c deleted file mode 100644 index d6ab9060d..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/scan.c +++ /dev/null @@ -1,1139 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: scan.c /main/3 1995/11/08 11:30:56 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Scan.c is the scanner for program PARSER */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#define M_CONDEF -#include "context.h" -#define M_DELIMDEF -#include "delim.h" -#define M_DTDDEF -#include "dtd.h" -#include "arc.h" -#define M_PARDEF -#include "parser.h" -#define M_ENTDEF -#include "entity2.h" -#include "sref.h" - -/* Actually read a character from an input stream */ -int m_actgetc(void) - { - int c ; - - c = m_getc(m_sysent[m_sysecnt]) ; - m_saveline[m_svlncnt[m_sysecnt]][m_sysecnt] = c ; - if (++m_svlncnt[m_sysecnt] >= M_LINELENGTH) { - m_svlncnt[m_sysecnt] = 0 ; - m_svlnwrap[m_sysecnt] = TRUE ; - } - return(c) ; - } - -/* Expand an entity reference */ -void m_entexpand(openent) - M_ENTITY *openent ; - { - M_WCHAR *p ; - M_HOLDTYPE dchar ; - char buffer[10] ; - int i ; - - m_ungetachar(M_NULLVAL, M_EE, FALSE) ; - m_eopencnt++ ; - m_opene[m_eopencnt - 1] = openent ; - - if (m_element[m_stacktop->element - 1].content == M_RCDATA) - m_curcon = RCNEWENT ; - if (m_curcon == LITCON || m_curcon == LITACON) - m_curcon = ENTINLIT ; - if (! openent->wheredef) { - m_eopencnt-- ; - m_err1("%s: System error -- no definition for predeclared entity", - openent->name) ; - m_eopencnt++ ; - return ; - } - if (m_curcon == ENTINLIT) - if (openent->type != M_GENERAL) { - m_eopencnt-- ; - m_err1("%s: Typed entity not allowed in parameter value", - openent->name) ; - m_eopencnt++ ; - return ; - } - if (m_eopencnt > M_ENTLVL) { - m_eopencnt-- ; - m_err1("%s: Too many nested entities", openent->name) ; - m_eopencnt++ ; - return ; - } - for (i = 0 ; i < m_eopencnt - 1; i++) - if (m_opene[i] == openent) { - m_eopencnt-- ; - m_err1("Recursive call to entity %s ignored", openent->name) ; - m_eopencnt++ ; - return ; - } - - /* If SDATA or PI entity (regular or CODE) at beginning of document - instance, call m_startdoc and reset m_curcon past preamble */ - if (m_curcon == PREAMBLE && - (openent->type == M_SDATA || - openent->type == M_CODESDATA || - openent->type == M_PI || - openent->type == M_CODEPI)) { - m_startdoc() ; - m_curcon = START ; - m_adjuststate() ; - } - - /* SDATA entity */ - if (openent->type == M_SDATA || openent->type == M_CODESDATA) { - if (! m_stacktop->intext) { - if (! m_strtproc(M_NULLVAL)) { - if (m_stacktop->oldtop) - m_err1("SDATA entity not allowed at this point in %s", - m_nameofelt(m_stacktop->element)) ; - else if (! m_start) - m_error("Document may not start with SDATA entity") ; - } - m_start = TRUE ; - m_stacktop->firstre = TRUE ; - m_stacktop->intext = TRUE ; - if (m_curcon == ELCON || m_curcon == DATACON) - m_curcon = POUNDCDATA ; - else if (m_curcon == NETELCON || m_curcon == NETDATACON) - m_curcon = NETCDATA ; - } - m_stacktop->linestat = M_DCORCET ; - m_holdproc() ; - } - - /* CODE entity */ - if (openent->type == M_CODEPI || openent->type == M_CODESDATA) { - if (openent->type == M_CODEPI) - m_stacktop->linestat = M_SOMETHING ; - m_codeent(openent->codeindex) ; - return ; - } - - /* PI or SDATA, but not CODE entity */ - if (openent->type == M_PI || openent->type == M_SDATA) { - m_piaction(openent->content, openent->name, openent->type) ; - return ; - } - - /* Subordinate data file */ - if (openent->type == M_SYSTEM) { - m_sysent[m_sysecnt + 1] = m_openent(openent->content) ; - if (m_sysent[m_sysecnt + 1]) { - m_sysecnt++ ; - m_line[m_sysecnt] = 1 ; - m_svlncnt[m_sysecnt] = 0 ; - m_svlnwrap[m_sysecnt] = FALSE ; - if (m_chtrace) { - m_trace("Opening `") ; - m_wctrace(openent->content) ; - m_trace("'(") ; - sprintf(buffer, "%d", m_sysecnt) ; - m_trace(buffer) ; - m_trace(")\n") ; - } - return ; - } - m_eopencnt-- ; - m_err1("Unable to open file %s", openent->content) ; - m_eopencnt++ ; - return ; - } - - /* An entity reference has been encountered. Put the content of the - entity, including any leading or trailing delimiters into the input - stream in reverse order */ - /* Closing delimiter */ - switch (openent->type) { - case M_STARTTAG: - case M_ENDTAG: { - m_undodelim(m_dlmptr[M_TAGC - 1], FALSE) ; - break ; - } - case M_MD: { - m_undodelim(m_dlmptr[M_MDC - 1], FALSE) ; - break ; - } - default: - break ; - } - /* Content of entity -- scan for end to reverse string */ - if (openent->type == M_CDATAENT) dchar = M_CDCHAR ; - else dchar = M_ENTNORMAL ; - if (p = openent->content) - while (*p) p++; - if (p != openent->content) { - p-- ; - while (TRUE) { - m_ungetachar((int) *p, dchar, FALSE) ; - if (p == openent->content) break ; - p-- ; - } - } - /* Opening delimiter */ - switch (openent->type) { - case M_STARTTAG: { - m_undodelim(m_dlmptr[M_STAGO - 1], FALSE) ; - break ; - } - case M_ENDTAG: { - m_undodelim(m_dlmptr[M_ETAGO - 1], FALSE) ; - break ; - } - case M_MD: { - m_undodelim(m_dlmptr[M_MDO - 1], FALSE) ; - break ; - } - default: - break ; - } - } /* End m_entexpand */ - -/* An srlen-character long short-reference delimiter has been found. Verify - that it is not the prefix of a general delimiter recognized in context*/ -LOGICAL m_gendelim(srlen, context) - int srlen ; - int context ; - { - int ghold[MAXD + 1] ; - int ucase ; - int next ; - int i, n = 0, current, delim[MAXD + 1], oldchars = 0 ; - int newcharstart = 0 ; - M_HOLDTYPE dhold[MAXD + 1], dchar ; - LOGICAL linestart ; - LOGICAL found ; - - if (! (current = m_contree[context - 1])) return(FALSE) ; - linestart = TRUE ; - for (i = 0 ; i <= srlen ; i++) - if (m_srefchartype[i] != M_RSCHAR && m_srefchartype[i] != M_WSCHAR) { - linestart = FALSE ; - break ; - } - if (linestart) return(FALSE) ; - - current-- ; - while (TRUE) { - delim[n] = FALSE ; - while (oldchars <= srlen && - (m_srefchartype[oldchars] == M_RSCHAR || - m_srefchartype[oldchars] == M_WSCHAR)) - oldchars++ ; - if (oldchars <= srlen) - ucase = m_hold[oldchars++] ; - else { - if (! newcharstart) newcharstart = n ; - ghold[n] = m_getachar(&dhold[n]) ; - ucase = m_ctupper(ghold[n]) ; - if (dhold[n] != M_NORMAL && dhold[n] != M_ENTNORMAL) break ; - } - for (i = current ; - (int) m_delimtrie[i].symbol < ucase && m_delimtrie[i].more ; - i++) ; - if ((int) m_delimtrie[i].symbol == ucase) { - current = m_delimtrie[i].index ; - if (! m_delimtrie[current].symbol) - delim[n] = m_delimtrie[current].index ; - n++ ; - } - else break ; - } - - if (! newcharstart) return(FALSE) ; - while (n >= newcharstart - 1) { - found = FALSE ; - if (delim[n]) { - /* Found a delimiter. If it ends with a letter, verify - that the following character is not a letter, in order - to issue error messages in cases such as = newcharstart) { - m_ungetachar(ghold[n], dhold[n], TRUE) ; - n-- ; - } - return(TRUE) ; - } /* End if delim[n] */ - if (n >= newcharstart) m_ungetachar(ghold[n], dhold[n], TRUE) ; - n-- ; - } - - return(FALSE) ; - } - -/* Reads next input character from the current source file or from an - entity expansion */ -int m_getachar(dchar) - M_HOLDTYPE *dchar ; - { - int c ; - int i ; - char buffer[10] ; - int length; - M_WCHAR wc_ee, wc_re; - char mb_ee, mb_re; - - mb_ee = M_EE; - mb_re = M_RE; - mbtowc(&wc_ee, &mb_ee, 1); - mbtowc(&wc_re, &mb_re, 1); - if (m_toundo && m_sysecnt <= m_sourcefile[m_toundo - 1]) { - c = m_savechar[--m_toundo] ; - *dchar = m_savedchar[m_toundo] ; - if (*dchar == wc_ee) m_atrs = (M_WCHAR) c; - } - else { - c = m_actgetc() ; - *dchar = M_NORMAL ; - if (m_whitespace((M_WCHAR) c) && c != wc_re) { - /* White space, but not RE, i.e., space or tab */ - for (m_wscount = 0 ; m_wscount < M_WSPACELEN ; m_wscount++) { - m_wspace[m_wscount] = m_actgetc() ; - if (! m_whitespace((M_WCHAR) m_wspace[m_wscount]) || - m_wspace[m_wscount] == wc_re) - break ; - } - if (m_whitespace((M_WCHAR) m_wspace[m_wscount]) && - m_wspace[m_wscount] != wc_re) { - m_error("Ignoring blank or tab") ; - while (m_whitespace((M_WCHAR) m_wspace[m_wscount]) && - m_wspace[m_wscount] != wc_re) - m_wspace[m_wscount] = m_actgetc() ; - } - if (m_wscount > m_maxws) m_maxws = m_wscount ; - if (m_wspace[m_wscount] == wc_re) c = wc_re ; - else { - for (i = 0 ; i <= m_wscount ; i++) - m_ungetachar(m_wspace[m_wscount - i], M_NORMAL, FALSE) ; - } - } /* End just read a blank or tab, is it line-trailing? */ - } /* End read a character from file */ - - m_oldlsindex = (m_oldlsindex + 1) % M_SAVECHAR ; - m_oldlinestat[m_oldlsindex] = m_stacktop->linestat ; - m_oldatrs[m_oldlsindex] = m_atrs ; - if (c == wc_re && *dchar) { - if (*dchar == M_NORMAL) m_line[m_sysecnt]++ ; - m_stacktop->linestat = M_NOTHING ; - m_atrs = TRUE ; - } - else if (*dchar) m_atrs = FALSE ; - if (m_chtrace) { - if (*dchar) { - m_trace("get(") ; - length = wctomb(buffer, c); - buffer[length] = 0; - m_trace(buffer) ; - m_trace(")[") ; - sprintf(buffer, "%d", c) ; - m_trace(buffer) ; - m_trace("],") ; - sprintf(buffer, "%d", *dchar) ; - m_trace(buffer) ; - m_trace("\n") ; - } - else m_trace("get(EE)\n") ; - } - return(c) ; - } - -/* Reads a name token */ -void m_getname(M_WCHAR first) -{ - M_WCHAR *p ; - M_HOLDTYPE dchar ; - int c ; - - *(p = m_name) = first ; - while (TRUE) { - c = m_getachar(&dchar) ; - if (c == EOF) break ; - if (dchar != M_NORMAL && dchar != M_ENTNORMAL) break ; - if (m_cttype(c) == M_NONNAME) break ; - *++p = (M_WCHAR) c ; - if (p >= m_name + M_NAMELEN) { - p-- ; - m_error("Name too long") ; - while ((dchar == M_NORMAL || dchar == M_ENTNORMAL) && - c != EOF && - m_cttype(c) != M_NONNAME) - c = m_getachar(&dchar) ; - break ; - } - } - m_ungetachar(c, dchar, TRUE) ; - *++p = M_EOS ; - } - -/* Reads the next token */ -int m_gettoken(c, dchar, context) - int *c ; - M_HOLDTYPE *dchar ; - int context ; - { - int hold[MAXD + 1], next ; - int ucase ; - int i, n = 0, current, delim[MAXD + 1], nexttoken ; - M_HOLDTYPE dhold[MAXD + 1] ; - LOGICAL found ; - - switch (context) { - case DATACON: - case NETDATACON: - case POUNDCDATA: - case NETCDATA: - case ELCON: - case NETELCON: - if (m_stacktop->oldtop) m_shortref(context) ; - break ; - default: - break ; - } - if (! (current = m_contree[context - 1])) { - *c = m_getachar(dchar) ; - return(M_NULLVAL) ; - } - current-- ; - while (TRUE) { - hold[n] = m_getachar(&dhold[n]) ; - ucase = m_ctupper(hold[n]) ; - delim[n] = FALSE ; - if (dhold[n] != M_NORMAL && dhold[n] != M_ENTNORMAL) break ; - for (i = current ; - (int) m_delimtrie[i].symbol < ucase && m_delimtrie[i].more ; - i++) ; - if ((int) m_delimtrie[i].symbol == ucase) { - current = m_delimtrie[i].index ; - if (! m_delimtrie[current].symbol) - delim[n] = m_delimtrie[current].index ; - n++ ; - } - else break ; - } - - while (n >= 0) { - found = FALSE ; - if (delim[n]) { - /* Found a delimiter. If it ends with a letter, verify - that the following character is not a letter, in order - to issue error messages in cases such as = M_CHARSETLEN) { - m_error("Invalid character code") ; - m_scanval = (m_scanval - next + '0') / 10 ; - m_ungetachar(next, *dchar, TRUE) ; - if (context == ELCON || context == NETELCON) - return(M_BLACKSPACE) ; - else return(M_TEXT) ; - } - } /* End loop reading digits after M_CRO */ - } /* End M_CRO followed by digit */ - } /* End delim[n] == M_CRO */ - else if (delim[n] == M_ERO) - if (m_vldentref()) - return(m_gettoken(c, dchar, - (m_curcon == RCNEWENT || m_curcon == ENTINLIT) ? - m_curcon : context)) ; - /* Can be an M_ERO or M_CRO here only if not in context and hence - should not be treated as a delimiter */ - if (delim[n] != M_STAGO && delim[n] != M_ETAGO && - delim[n] != M_ERO && delim[n] != M_CRO) - return(delim[n]) ; - /* M_STAGO and M_ETAGO recognized only if immediately followed by - a M_NMSTART character or by an appropriate closing delimiter - (latter is a short tag) */ - if (delim[n] == M_STAGO || delim[n] == M_ETAGO) { - next = m_getachar(dchar) ; - m_ungetachar(next, *dchar, TRUE) ; - if (m_cttype(next) == M_NMSTART && - (*dchar == M_NORMAL || *dchar == M_ENTNORMAL)) - return(delim[n]) ; - nexttoken = m_gettoken(&next, dchar, - delim[n] == M_STAGO ? SELEMENT : EELEMENT) ; - if (nexttoken) { - m_undodelim(m_dlmptr[nexttoken - 1], TRUE) ; - return(delim[n]) ; - } - else m_ungetachar(next, *dchar, TRUE) ; - } /* End delim[n] is M_STAGO or M_ETAGO */ - } /* End if (delim[n]) */ - if (n) m_ungetachar(hold[n], dhold[n], TRUE) ; - n-- ; - } - - *c = *hold ; - *dchar = *dhold ; - return(M_NULLVAL) ; - } - -/* Reads a literal */ -void m_litproc(delim) - int delim ; - { - int n, i ; - M_HOLDTYPE dchar ; - int savecon = m_curcon ; - int c ; - int atentlev ; - int atdelimcon ; - char mb_re, mb_tab, mb_space, mb_null, mb_ee; - M_WCHAR wc_re, wc_tab, wc_space, wc_null, wc_ee; - - mb_re = M_RE; - mb_tab = M_TAB; - mb_space = M_SPACE; - mb_null = M_NULLVAL; - mb_ee = M_EE; - mbtowc(&wc_re, &mb_re, 1); - mbtowc(&wc_tab, &mb_tab, 1); - mbtowc(&wc_space, &mb_space, 1); - mbtowc(&wc_null, &mb_null, 1); - mbtowc(&wc_ee, &mb_ee, 1); - - m_curcon = delim == M_LIT ? LITCON : LITACON ; - atentlev = m_eopencnt ; - atdelimcon = m_curcon ; - for (i = 0 ; i < M_LITLEN + 1 ; i++) { - n = m_gettoken(&c, &dchar, m_curcon) ; - switch (n) { - case M_ENDFILE: - m_ungetachar(c, dchar, TRUE) ; - m_literal[i] = wc_null ; - m_curcon = savecon ; - return ; - case M_TEXT: - m_literal[i] = (M_WCHAR) m_scanval ; - break ; - case M_LIT: - case M_LITA: - m_literal[i] = wc_null ; - m_curcon = savecon ; - return ; - case M_LITRS: - case M_LITSCR: - break ; - case M_LITRE: - case M_LITECR: - m_literal[i] = wc_re ; - break ; - case M_LITSPACE: - case M_LITCSPACE: - m_literal[i] = wc_space ; - break ; - case M_LITTAB: - case M_LITCTAB: - m_literal[i] = wc_tab ; - break ; - case M_NULLVAL: - m_literal[i] = (M_WCHAR) c ; - if (dchar == wc_ee) { - if (m_curcon == ENTINLIT) { - m_eopencnt-- ; - i-- ; - if (m_eopencnt == atentlev) { - m_curcon = atdelimcon ; - break ; - } - } - else { - m_literal[i] = wc_null ; - m_curcon = savecon ; - m_ungetachar(wc_null, wc_ee, FALSE) ; - return ; - } - } - break ; - default: - m_error("Internal error processing literal") ; - break ; - } - } /* End for i */ - m_error("Literal too long") ; - m_literal[i] = wc_null ; - m_curcon = savecon ; - } - -/* Called when a missing tagc delimiter is detected */ -void m_missingtagc(int c, M_HOLDTYPE dchar, LOGICAL start) -{ - if (! m_wholetag) { - if (start) m_mberr1("Invalid parameter or missing %s", m_tagc); - else m_mberr1("Missing %s in end-tag", m_tagc) ; - } - m_ungetachar(c, dchar, TRUE) ; - m_curcon = START ; - m_adjuststate() ; - } - -/* Have found one character in a possible short reference delimiter. - Prepare to look for the next one */ -void m_nextdelimchar(int *n, int i, LOGICAL *linestart, LOGICAL newlinestart, - LOGICAL skipblank, unsigned char type) -{ - int k ; - char mb_re,mb_seqchar, mb_rschar; - M_WCHAR wc_re,wc_seqchar, wc_rschar; - - mb_re = M_RE; - mbtowc(&wc_re, &mb_re, 1); - mb_seqchar = M_SEQCHAR; - mbtowc(&wc_seqchar, &mb_seqchar, 1); - mb_rschar = M_RSCHAR; - mbtowc(&wc_rschar, &mb_rschar, 1); - m_current[*n + 1] = m_sreftree[i].index ; - if (! m_sreftree[m_current[*n + 1]].symbol) - m_delim[*n] = m_sreftree[m_current[*n + 1]].index ; - *linestart = newlinestart ; - m_srefchartype[*n] = type ; - if (skipblank) { - for (k = 0 ; k < M_BSEQLEN ; k++) { - m_hold[*n + 1 + k] = m_getachar(&m_dhold[*n + 1 + k]) ; - if (m_hold[*n + 1 + k] != ' ' && m_hold[*n + 1 + k] != '\t') { - m_ungetachar(m_hold[*n + 1 + k], m_dhold[*n + 1 + k], TRUE) ; - break ; - } - m_current[*n + 1 + k + 1] = m_current[*n + 1] ; - m_delim[*n + 1 + k] = m_delim[*n] ; - m_srefchartype[*n + 1 + k] = wc_seqchar ; - } - *n += k + 1 ; - } - else (*n)++ ; - m_srefchartype[*n] = wc_rschar ; - } - -/* Scans past a comment within a markup declaration */ -void m_readcomments(void) - { - int c ; - M_HOLDTYPE dchar ; - - while (! m_gettoken(&c, &dchar, COMCON)) - if (c == EOF) { - m_error("Document ended within a comment") ; - m_done() ; - } - } - -/* Scanner */ -int m_scan(void) - { - int c ; - M_HOLDTYPE dchar ; - int n ; - char buffer[10] ; - char mb_ee, mb_re, mb_space, mb_tab; - M_WCHAR wc_ee, wc_re, wc_space, wc_tab; - - mb_ee = M_EE; - mbtowc(&wc_ee, &mb_ee, 1); - mb_re = M_RE; - mbtowc(&wc_re, &mb_re, 1); - mb_space = M_SPACE; - mbtowc(&wc_space, &mb_space, 1); - mb_tab = M_TAB; - mbtowc(&wc_tab, &mb_tab, 1); - while (TRUE) { - n = m_gettoken(&c, &dchar, m_curcon) ; - if (n) { - if (n != M_ENTITYEND && m_stacktop->linestat == M_NOTHING) - m_stacktop->linestat = M_SOMETHING ; - switch (n) { - case M_LITRS: - case M_LITSCR: - m_atrs = TRUE ; - continue ; - case M_LITRE: - case M_LITECR: - m_ungetachar(wc_re, M_ENTNORMAL, FALSE) ; - continue ; - case M_LITSPACE: - case M_LITCSPACE: - m_ungetachar(wc_space, M_ENTNORMAL, FALSE) ; - continue ; - case M_LITTAB: - case M_LITCTAB: - m_ungetachar(wc_tab, M_ENTNORMAL, FALSE) ; - continue ; - case M_LIT: - case M_LITA: - m_litproc(n) ; - return(M_LITERAL) ; - default: - return(n) ; - } - } - /* Check for Entity End */ - if (dchar == wc_ee) { - m_eopencnt-- ; - if (m_element[m_stacktop->element - 1].content == M_RCDATA) { - if (m_eopencnt == m_stacktop->thisent) { - if (m_netlevel) m_curcon = NETRCDATA ; - else m_curcon = RCDATAEL ;} - else if (m_eopencnt < m_stacktop->thisent) - m_stacktop->thisent = m_eopencnt ; - } - if (m_newcon(m_curcon - 1, M_ENTITYEND - 1)) return(M_ENTITYEND) ; - continue ; - } - /* Whitespace character--check if could be data. If so, - if it's a RE, check if its significant */ - if (m_whitespace((M_WCHAR) c)) { - if (! m_newcon(m_curcon - 1, M_TEXT - 1)) continue ; - if (c != wc_re || m_curcon == PROCINT || m_curcon == LITCON || - m_curcon == LITENT || m_curcon == LITAENT) { - m_scanval = c ; - return(M_TEXT) ; - } - m_sigre() ; - continue ; - } - if (c == EOF) { - if (m_sysecnt) { - m_closent(m_sysent[m_sysecnt--]) ; - if (m_chtrace) { - m_trace("Closing to level ") ; - sprintf(buffer, "%d", m_sysecnt) ; - m_trace(buffer) ; - m_trace("\n") ; - } - continue ; - } - return(M_ENDFILE) ; - } - if ( - ((m_curcon == SELEMENT || - m_curcon == EELEMENT || - m_curcon == ENTNAME || - m_curcon == MAPNAME || - m_curcon == AMAPNAME) - && m_cttype(c) == M_NMSTART) || - ((m_curcon == ATTNAME || m_curcon == ATTVAL || - m_curcon == NEEDVI) && - m_cttype(c) != M_NONNAME) - ){ - m_getname((M_WCHAR) c) ; - return(M_NAME) ; - } - switch (m_curcon) { - case ATTVAL: - m_err1("Expecting value for %s", - &m_pname[m_parameter[m_ppsave - 1].paramname]) ; - m_stcomplete() ; - m_missingtagc(c, dchar, TRUE) ; - continue ; - case ATTNAME: - m_stcomplete() ; - m_missingtagc(c, dchar, TRUE) ; - continue ; - case NEEDVI: - m_attvonly(m_saveatt) ; - m_stcomplete() ; - m_missingtagc(c, dchar, TRUE) ; - continue ; - case ETAGEND: - if (! m_stacktop->oldtop) - m_scanel = m_arc[m_state[0].first - 1].label ; - else m_scanel = m_stacktop->element ; - m_stacktop->holdre = FALSE ; - m_etcomplete() ; - m_missingtagc(c, dchar, FALSE) ; - continue ; - default: - break ; - } - m_scanval = c ; - if (! m_newcon(m_curcon - 1, M_TEXT - 1)) return(M_BLACKSPACE) ; - return(M_TEXT) ; - } /* End while */ - } /* End scan */ - - -/* Process explicit or implied USEMAP or ADDMAP */ -void m_setmap(int map, LOGICAL useoradd) -{ - int i ; - int sref ; - - if (! m_stacktop->oldtop) { - m_error("Program error: attempt to set map for empty stack") ; - m_exit(TRUE) ; - } - - /* #EMPTY map*/ - if (map == 1) { - if (m_stacktop->map && m_stacktop->oldtop->map != m_stacktop->map) - m_free(m_stacktop->map, "short reference map") ; - /* Done, if USEMAP */ - if (useoradd) { - m_stacktop->map = NULL ; - return ; - } - /* restores map from beginning of element */ - m_stacktop->map = m_stacktop->oldtop->map ; - if (m_element[m_stacktop->element - 1].srefptr) - m_setmap(m_element[m_stacktop->element - 1].srefptr, - (LOGICAL) m_element[m_stacktop->element - 1].useoradd) ; - return ; - } - - /* Allocate and initialize a new map if needed */ - if (! m_stacktop->map || m_stacktop->map == m_stacktop->oldtop->map) { - m_stacktop->map = - (int *) m_malloc(sizeof(int) * M_SREFCNT, "short reference map") ; - for (i = 0 ; i < M_SREFCNT ; i++) - if (! useoradd && m_stacktop->oldtop->map) - m_stacktop->map[i] = m_stacktop->oldtop->map[i] ; - else m_stacktop->map[i] = M_NULLVAL ; - } - /* Clear an old map if replacing it */ - else - if (useoradd) - for (i = 0 ; i < M_SREFCNT ; i++) - m_stacktop->map[i] = M_NULLVAL ; - - /* Offset into m_map is 2, 1 for 0-based indexing, 1 for #EMPTY code */ - for (sref = m_map[map - 2] ; sref ; sref = m_sref[sref - 1].next) - m_stacktop->map[m_sref[sref - 1].sref - 1] = m_sref[sref - 1].entity ; - } - -/* Check for short reference delimiters */ -void m_shortref(context) -int context ; -{ -int n = 0 ; -int i ; -int c ; -LOGICAL linestart = m_atrs ; -char mb_ee; -M_WCHAR wc_ee; - -mb_ee = M_EE; -mbtowc(&wc_ee, &mb_ee, 1); - -/* If no short references defined, don't try to match one */ -if (sizeof(m_sreftree)/sizeof(M_PTRIE) == 1) return ; - -/* Can return if using MARKUP extensions and no map is active */ -if (! m_conform && ! m_stacktop->map) return ; - -m_current[0] = 0 ; -m_srefchartype[0] = M_RSCHAR ; -while (TRUE) - { - /* Search through short reference delimiter tree */ - while (TRUE) - { - m_delim[n] = FALSE ; - - /* Look for RS */ - if (linestart && m_srefchartype[n] >= M_RSCHAR) - { - for (i = m_current[n] ; - m_sreftree[i].more && m_sreftree[i].symbol < RS ; - i++) ; - if (m_sreftree[i].symbol == RS) - { - m_nextdelimchar(&n, i, &linestart, FALSE, FALSE, M_RSCHAR) ; - continue ; - } - } - - /* Look for white space sequence */ - if (m_srefchartype[n] >= M_WSCHAR) - { - for (i = m_current[n] ; - m_sreftree[i].more && m_sreftree[i].symbol < WSSEQ ; - i++) ; - if (m_sreftree[i].symbol == WSSEQ) - { - m_nextdelimchar(&n, i, &linestart, FALSE, TRUE, M_WSCHAR) ; - continue ; - } - } - - /* Look at next character from input stream */ - m_hold[n] = m_getachar(&m_dhold[n]) ; - if (m_dhold[n] == wc_ee || - (m_dhold[n] != M_NORMAL && m_dhold[n] != M_ENTNORMAL)) - { - m_srefchartype[n] = M_REGCHAR ; - break ; - } - - /* Look for blank sequence */ - if (m_srefchartype[n] >= M_BSCHAR && - (m_hold[n] == ' ' || m_hold[n] == '\t')) - { - for (i = m_current[n] ; - m_sreftree[i].more && m_sreftree[i].symbol < BLANKSEQ ; - i++) ; - if (m_sreftree[i].symbol == BLANKSEQ && - (m_hold[n] == ' ' || m_hold[n] == '\t')) - { - m_nextdelimchar(&n, i, &linestart, FALSE, TRUE, M_BSCHAR) ; - continue ; - } - } - - /* Look for regular character */ - c = m_ctupper(m_hold[n]) ; - if (m_cttype(c) != M_NMSTART) - { - for (i = m_current[n] ; - m_sreftree[i].more && (int) m_sreftree[i].symbol < c ; - i++) ; - if ((int) m_sreftree[i].symbol == c) - { - m_nextdelimchar(&n, i, &linestart, m_atrs, FALSE, M_REGCHAR) ; - continue ; - } - } - - m_srefchartype[n] = M_REGCHAR ; - break ; - } /* End search through sref delimiter tree */ - - while (TRUE) - { - if (m_delim[n]) - { - /* Found a delimiter. If letters were allowed in short references - would check here for runon situations such as = 0 ; i--) - if (m_srefchartype[i] < M_WSCHAR) - m_ungetachar(m_hold[i], m_dhold[i], TRUE) ; - return ; - } - linestart = TRUE ; - for (i = n ; i >= 0 ; i--) - if (m_srefchartype[i] < M_WSCHAR) - { - linestart = FALSE ; - break ; - } - if (linestart) m_atrs = FALSE ; - if (m_stacktop->map && m_stacktop->map[m_delim[n] - 1]) - { - m_entexpand( - &m_entities[m_stacktop->map[m_delim[n] - 1] - 1]) ; - return ; - } - if (m_conform) - { - for (i = n ; i >= 0 ; i--) - if (m_srefchartype[i] < M_WSCHAR) - m_ungetachar(m_hold[i], M_CDCHAR, TRUE) ; - return ; - } - } - if (m_srefchartype[n] < M_WSCHAR) - m_ungetachar(m_hold[n], m_dhold[n], TRUE) ; - if (m_srefchartype[n] > M_REGCHAR) - { - m_srefchartype[n]-- ; - break ; - } - n-- ; - if (n < 0) return ; - } - } -} - -/* Test for significant record ends. Ignore RE (\n) if - 1) It is the first RE in the content and no data character - or contextual end tag has occurred - 2) Something has occurred on the line but not a data character - or contextual end tag [linestat == M_SOMETHING] - 3) If a record end might be the last one in an element, save it -*/ -void m_sigre(void) - { - /* Check for first RE in content and no preceding content */ - if (m_start && - (! m_stacktop->firstre && m_oldlinestat[m_oldlsindex] != M_DCORCET)) { - m_stacktop->firstre = TRUE ; - return ; - } - /* Check for line containing other than data characters or contextual - subelements */ - if (m_start && m_oldlinestat[m_oldlsindex] == M_SOMETHING) return ; - /* Save the RE to see what follows */ - m_holdproc() ; - m_stacktop->holdre = TRUE ; - return ; - } /* End white space */ - -/* Returns a context-dependent delimiter string to input stream so - characters can be reread one at a time in another context */ -void m_undodelim(M_WCHAR *delim, LOGICAL flag) -{ - M_WCHAR *p ; - - for (p = delim ; *p ; p++) ; - - p-- ; - while (TRUE) { - m_ungetachar((int) *p, M_NORMAL, flag) ; - if (p == delim) return ; - p-- ; - } - } - -/* Place a character on the current input stream. The character may have - been scanned and determined not to be part of the current token or it - may be in the expansion of an entity*/ -void m_ungetachar(int c, M_HOLDTYPE dchar, LOGICAL preread) -{ - char buffer[10] ; - int length; - char mb_ee; - M_WCHAR wc_ee; - - mb_ee = M_EE; - mbtowc(&wc_ee, &mb_ee, 1); - if (m_chtrace) { - if (dchar) { - m_trace("unget(") ; - length = wctomb(buffer, c); - buffer[length] = 0; - m_trace(buffer) ; - m_trace(")[") ; - sprintf(buffer, "%d", c) ; - m_trace(buffer) ; - m_trace("],") ; - sprintf(buffer, "%d", dchar) ; - m_trace(buffer) ; - m_trace("\n") ; - } - else m_trace("unget(EE)\n") ; - } - m_inctest(&m_toundo, M_SAVECHAR, "M_SAVECHAR") ; - m_sourcefile[m_toundo - 1] = m_sysecnt ; - m_savedchar[m_toundo - 1] = dchar ; - m_savechar[m_toundo - 1] = dchar == wc_ee ? (int) m_atrs : c ; - if (preread) { - m_stacktop->linestat = m_oldlinestat[m_oldlsindex] ; - m_atrs = m_oldatrs[m_oldlsindex] ; - m_oldlsindex = (m_oldlsindex - 1 + M_SAVECHAR) % M_SAVECHAR ; - } - if (m_toundo > m_maxundo) m_maxundo = m_toundo ; - if (c == M_RE) - if (dchar == M_NORMAL) m_line[m_sysecnt]-- ; - } - -/* Have encountered an M_ERO. If the entity reference is valid, process it*/ -LOGICAL m_vldentref(void) - { - M_HOLDTYPE dchar ; - int next ; - M_ENTITY *openent ; - char mb_ee; - M_WCHAR wc_ee; - - mb_ee = M_EE; - mbtowc(&wc_ee, &mb_ee, 1); - next = m_getachar(&dchar) ; - if (next != EOF && m_cttype(next) == M_NMSTART && dchar != wc_ee) { - m_getname((M_WCHAR) next) ; - if (! m_gettoken(&next, &dchar, ENTREF)) - if (next != M_RE) m_ungetachar(next, dchar, TRUE) ; - if (openent = (M_ENTITY *) m_lookfortrie(m_name, m_enttrie)) - m_entexpand(openent) ; - else m_err1("Reference to undefined entity '%s'", m_name) ; - return(TRUE) ; - } - m_ungetachar(next, dchar, TRUE) ; - return(FALSE) ; - } - -#if defined(sparse) -#include "sparse.c" -#endif - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/setopt.c b/cde/programs/dthelp/parser.ccdf/htag/parser/setopt.c deleted file mode 100644 index 1b83c7a4e..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/setopt.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: setopt.c /main/3 1995/11/08 11:31:18 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - - -/* Set program options */ -void m_setoptions(void) - { - if (m_argc > 1) m_optstring(m_argv[1]) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/setpar.c b/cde/programs/dthelp/parser.ccdf/htag/parser/setpar.c deleted file mode 100644 index 32cdd8cd5..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/setpar.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: setpar.c /main/3 1995/11/08 11:31:36 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Setparam.c is used by interfaces where code accesses an element's - attributes */ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" - -/* Set a user-defined C variable to the corresponding parameter value */ -void m_setparam(cvar, par) - M_WCHAR **cvar ; - int par ; - { - *cvar = m_stackpar->param[par] ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/signmsg.c b/cde/programs/dthelp/parser.ccdf/htag/parser/signmsg.c deleted file mode 100644 index 6fca022dc..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/signmsg.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: signmsg.c /main/3 1995/11/08 11:31:53 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Process signon message text */ -void m_signmsg(p) -M_WCHAR *p ; -{ -char mb_p; - -mb_p = MakeMByteString(p); -m_errline(mb_p) ; -m_free(mb_p,"multi-byte string"); -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/start.c b/cde/programs/dthelp/parser.ccdf/htag/parser/start.c deleted file mode 100644 index f53199fa7..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/start.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: start.c /main/3 1995/11/08 11:32:14 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Start.c executes start-code specified in the interface. */ - -#include "userinc.h" -#include "globdec.h" - -/* Include generated file */ -#include "sfile.c" - -/* Perform the m_action-th start-code in the interface */ -void m_strtcase(m_action) - int m_action ; - { - (*m_stable[m_action])() ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/startdoc.c b/cde/programs/dthelp/parser.ccdf/htag/parser/startdoc.c deleted file mode 100644 index 8280639c4..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/startdoc.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: startdoc.c /main/3 1995/11/08 11:32:29 rswiston $ */ -/* -Copyright 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Default function called at start of document instance. Allows interface - control after all entity declarations have been processed. Not needed - in valid documents (when it is called just prior to global start-code), - but may be useful in some applications nevertheless. */ -void m_startdoc(void) - { - } - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/string.c b/cde/programs/dthelp/parser.ccdf/htag/parser/string.c deleted file mode 100644 index 95d157e42..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/string.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: string.c /main/3 1995/11/08 11:32:47 rswiston $ */ -/* Copyright 1988, 1989 Hewlett-Packard Co. */ - -/* String.c executes string-code specified in the interface. */ - -#include "userinc.h" -#include "globdec.h" - -/* Include generated code */ -#include "stfile.c" - -void m_stcaction(M_WCHAR *m_string, LOGICAL M_START, LOGICAL M_END) -{ - m_stackpar = m_stacktop->stparam ; - (*m_sttable[m_stacktop->stccase])(m_string, M_START, M_END) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/struct.c b/cde/programs/dthelp/parser.ccdf/htag/parser/struct.c deleted file mode 100644 index a7de300b7..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/struct.c +++ /dev/null @@ -1,746 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: struct.c /main/3 1995/11/08 11:33:04 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Struct.c contains functions relevant to parsing document structure for - program PARSER */ - -#include -#include -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "delim.h" -#include "context.h" -#include "parser.h" -#include "entext.h" -#include "if.h" - -/* M_checkstart tests to see if the element (or #PCDATA) indicated by VAL - is valid input. It returns TRUE, FALSE, or M_NONCONTEXTUAL respectively - if the element is allowed by content, not allowed, or allowed by an - inclusion exception. */ -int m_checkstart(val) - M_ELEMENT val ; - { - M_PARSE *stackptr ; - int except ; - - /* Check for applicable exclusions */ - if (m_excluded(val)) return(FALSE) ; - - /* Check for declared content in element currently at top of stack */ - if (m_stacktop->oldtop) { - if (m_element[m_stacktop->element - 1].content == M_ANY) return(TRUE) ; - if (m_element[m_stacktop->element - 1].content == M_CDATA || - m_element[m_stacktop->element - 1].content == M_RCDATA) - if (! val) return(TRUE) ; - else return(FALSE) ; - } - - /* Check content model */ - if (m_transition(val, TRUE)) return(TRUE) ; - - /* Check for inclusions */ - for (stackptr = m_stacktop ; - stackptr->oldtop ; - stackptr = stackptr->oldtop) - for (except = m_element[stackptr->element - 1].inptr ; - except ; - except = m_exception[except - 1].next) - if (m_exception[except - 1].element == val) return(M_NONCONTEXTUAL) ; - - /* Nothing left to try, val is not allowed */ - return(FALSE) ; - } - -/* M_ckend verifies that element VAL can be legally ended at the - current state of the parse, by an end tag or NET as indicated by NEEDNET. - If VAL is not the element at the top of the parse stack, m_ckend - checks to see if the end of VAL can validly end nested - elements as well. */ -LOGICAL m_ckend(M_ELEMENT val, LOGICAL neednet) -{ - M_PARSE *stackptr ; - M_OPENFSA *fsastack ; - M_ANDLIST *usedand ; - M_ANDGROUP pand ; - M_MIN *minend ; - M_MIN *discard ; - - m_minend = NULL ; - m_nextme = &m_minend ; - /* Go down the stack, checking that each element can end until - element val occurs */ - for (stackptr = m_stacktop ; stackptr ; stackptr = stackptr->oldtop) { - /* If the element at stackptr has a content model, make sure each - open fsa is in a final state and that all required submodels of - open and-groups have occurred */ - for (fsastack = stackptr->fsastack ; - fsastack ; - fsastack = fsastack->oldtop) { - if (! m_state[fsastack->current - 1].final) { - m_freemin(m_minend, "end-tag minimization") ; - return(FALSE) ; - } - for (pand = fsastack->andgroup ; - pand ; - pand = m_andgroup[pand - 1].next) { - /* Don't bother checking if optional submodel of an and-group - has occurred */ - if (m_state[m_andgroup[pand - 1].start - 1].final) continue ; - for (usedand = fsastack->usedand ; - usedand ; - usedand = usedand->next) - if (usedand->group == pand) break ; - if (! usedand) { - /* Didn't find a required submodel */ - m_freemin(m_minend, "end-tag minimization") ; - return(FALSE) ; - } - } /* End for pand */ - } /* End for fsastack */ - /* Have confirmed that the element indicated by stackptr can end now */ - if (stackptr->element == val) break ; - *m_nextme = (M_MIN *) m_malloc(sizeof(M_MIN), "end-tag minimization") ; - (*m_nextme)->next = NULL ; - (*m_nextme)->val = stackptr->element ; - m_nextme = &(*m_nextme)->next ; - } /* End for stackptr */ - if (! stackptr) { - m_freemin(m_minend, "end-tag minimization") ; - return(FALSE) ; - } - for (minend = m_minend ; minend ; ) { - discard = minend ; - minend = minend->next ; - m_free(discard, "end-tag minimization") ; - if (m_stacktop->neednet && ! neednet) { - M_WCHAR *wc_net; - - wc_net = MakeWideCharString(m_net); - m_err2("Expecting %s to end %s", - wc_net, - m_nameofelt(m_stacktop->element)) ; - m_free(wc_net,"wide character string"); - m_showcurelt() ; - } - if (! m_element[m_stacktop->element - 1].emin) { - m_err1("Missing end tag for %s", m_nameofelt(m_stacktop->element)) ; - m_showcurelt() ; - } - m_endtag(m_stacktop->element) ; - } - if (m_stacktop->neednet != neednet) { - M_WCHAR *wc_etago, *wc_tagc, *wc_mnet, *wc_stago, *wc_net; - - wc_etago = MakeWideCharString(m_etago); - wc_stago = MakeWideCharString(m_stago); - wc_tagc = MakeWideCharString(m_tagc); - wc_net = MakeWideCharString(m_net); - if (neednet) - m_err4("Expecting %s%s%s instead of %s", - wc_etago, - m_nameofelt(m_stacktop->element), - wc_tagc, - wc_net) ; - else - m_err4("Expecting %s to end %s%s%s", - wc_net, - wc_stago, - m_nameofelt(m_stacktop->element), - wc_tagc) ; - m_showcurelt() ; - m_free(wc_etago,"wide character string"); - m_free(wc_stago,"wide character string"); - m_free(wc_tagc,"wide character string"); - m_free(wc_net,"wide character string"); - } - m_endtag(val) ; - return(TRUE) ; - } /*end m_ckend*/ - -/* Make a copy of the stack entry at the top of the parse stack in a scratch - area */ -M_PARSE *m_copystackelt(void) - { - M_OPENFSA *oldfsa ; - M_OPENFSA **newfsa ; - M_ANDLIST *oldand ; - M_ANDLIST **newand ; - M_PARSE *copy ; - - copy = (M_PARSE *) m_malloc(sizeof(M_PARSE), "stack element") ; - memcpy((char *) copy, (char *) m_stacktop, sizeof(M_PARSE)) ; - copy->param = NULL ; - for (oldfsa = m_stacktop->fsastack, newfsa = ©->fsastack ; - oldfsa ; - oldfsa = oldfsa->oldtop, newfsa = &(*newfsa)->oldtop) { - *newfsa = (M_OPENFSA *) m_malloc(sizeof(M_OPENFSA), "FSA") ; - memcpy((char *) *newfsa, (char *) oldfsa, sizeof(M_OPENFSA)) ; - for (oldand = oldfsa->usedand, newand = &(*newfsa)->usedand ; - oldand ; - oldand = oldand->next, newand = &(*newand)->next) { - *newand = (M_ANDLIST *) m_malloc(sizeof(M_ANDLIST), "and list") ; - (*newand)->group = oldand->group ; - (*newand)->next = NULL ; - } - } - return(copy) ; - } - -/* End of document */ -void m_done(void) - { - M_ELEMENT lastelt ; - - while (m_stacktop->oldtop) { - lastelt = m_stacktop->element ; - if (! m_ckend(m_stacktop->element, FALSE)) { - m_err1("More content expected in element %s at end of document", - m_nameofelt(m_stacktop->element)) ; - m_expecting() ; - m_showcurelt() ; - m_frcend(m_stacktop->element) ; - } - else if (! m_element[lastelt - 1].emin) - m_err1("Missing end tag for %s", m_nameofelt(lastelt)) ; - } - m_endcase(1) ; - m_globes() ; - m_exit(m_errexit) ; - } - -/* Process the endtag (implied, abbreviated, or explicit) for element C*/ -void m_endtag(c) - M_ELEMENT c ; - { - m_endaction(c) ; - m_pop() ; - if (m_stacktop->intext) { - m_curcon = POUNDCDATA ; - if (m_netlevel) m_curcon = NETCDATA ; - } - } - -/* Check that the identified element is not prohibited in the current context - by an exclusion exception */ -LOGICAL m_excluded(elt) - M_ELEMENT elt ; - { - M_PARSE *stackptr ; - int except ; - - if (! elt) return(FALSE) ; - for (stackptr = m_stacktop ; - stackptr->oldtop ; - stackptr = stackptr->oldtop) - for (except = m_element[stackptr->element - 1].exptr ; - except ; - except = m_exception[except - 1].next) - if (m_exception[except - 1].element == elt) return(TRUE) ; - return(FALSE) ; - } - -/* Free the OPEN FSA substructures associated with an element on - the parse stack */ -void m_freeFSA(stackelt) - M_PARSE *stackelt ; - { - M_OPENFSA *fsastack ; - M_ANDLIST *usedand ; - - while (stackelt->fsastack) { - fsastack = stackelt->fsastack ; - if (fsastack == &m_botfsa) return ; - while (fsastack->usedand) { - usedand = fsastack->usedand ; - fsastack->usedand = usedand->next ; - m_free(usedand, "and list") ; - } - stackelt->fsastack = fsastack->oldtop ; - m_free(fsastack, "FSA") ; - } - } - -/* Free storage used for tentative chain of tag minimizations */ -void m_freemin(min, msg) - M_MIN *min ; - char *msg ; - { - M_MIN *discard ; - - for ( ; min ;) { - discard = min ; - min = min->next ; - m_free(discard, msg) ; - } - } - -/* M_nextand returns TRUE iff element label is allowed at the current point - in the current content model by starting a new submodel of the and-group - indicated by fsastack, or (if the and-group is within a seq-group) by - continuing past the and-group */ -LOGICAL m_nextand(thisfsa, label) - M_OPENFSA *thisfsa ; - M_ELEMENT label ; - { - M_ANDLIST *newgroup ; - M_ANDGROUP pand ; - M_ANDLIST *plist ; - M_OPENFSA *savefsa ; - M_OPENFSA *fsa ; - LOGICAL required = FALSE ; - LOGICAL last ; - - /* Verify currently within an and-group and in final state of this - branch */ - if (! m_state[thisfsa->current - 1].final) return(FALSE) ; - if (! thisfsa->oldtop) return(FALSE) ; - savefsa = m_stacktop->fsastack ; - - /* Check possibility of starting a new branch*/ - m_stacktop->fsastack = - (M_OPENFSA *) m_malloc(sizeof(M_OPENFSA), "FSA") ; - m_stacktop->fsastack->oldtop = thisfsa->oldtop ; - m_stacktop->fsastack->andgroup = M_NULLVAL ; - m_stacktop->fsastack->usedand = NULL ; - newgroup = (M_ANDLIST *) m_malloc(sizeof(M_ANDLIST), "and list") ; - newgroup->next = thisfsa->oldtop->usedand ; - thisfsa->oldtop->usedand = newgroup ; - for (pand = thisfsa->oldtop->andgroup ; - pand ; - pand = m_andgroup[pand - 1].next) { - for (plist = newgroup->next ; plist ; plist = plist->next) - if (pand == plist->group) break ; - if (! plist) { - newgroup->group = pand ; - m_stacktop->fsastack->current = m_andgroup[pand - 1].start ; - if (! m_state[m_stacktop->fsastack->current - 1].final) - required = TRUE ; - if (m_transition(label, FALSE)) { - for (fsa = savefsa ; TRUE ; fsa = fsa->oldtop) { - for (plist = fsa->usedand ; plist ; plist = plist->next) - m_free(plist, "and list") ; - m_free(fsa, "FSA") ; - if (fsa == thisfsa) break ; - } - return(TRUE) ; - } - } - } - - /* Couldn't start a new branch. Restore parse stack */ - thisfsa->oldtop->usedand = newgroup->next ; - m_free(newgroup, "and list") ; - m_free(m_stacktop->fsastack, "FSA") ; - m_stacktop->fsastack = savefsa ; - - /* Have all required branches occurred? */ - if (required) return(FALSE) ; - - /* Can we continue past this and-group in a containing seq-group? */ - m_stacktop->fsastack = - (M_OPENFSA *) m_malloc(sizeof(M_OPENFSA), "FSA") ; - m_stacktop->fsastack->oldtop = thisfsa->oldtop->oldtop ; - m_stacktop->fsastack->andgroup = M_NULLVAL ; - m_stacktop->fsastack->usedand = NULL ; - m_stacktop->fsastack->current = thisfsa->oldtop->current ; - if (m_transition(label, FALSE)) { - /* Free temporary FSA storage used to test transition */ - for (fsa = savefsa, last = FALSE ; TRUE ; fsa = fsa->oldtop) { - for (plist = fsa->usedand ; plist ; plist = plist->next) - m_free(plist, "and list") ; - m_free(fsa, "FSA") ; - if (last) break ; - if (fsa == thisfsa) last = TRUE ; - } - return(TRUE) ; - } - m_free(m_stacktop->fsastack, "FSA") ; - m_stacktop->fsastack = savefsa ; - - /* Can we continue in a containing and-group? */ - if (m_nextand(thisfsa->oldtop, label)) return(TRUE) ; - return(FALSE) ; - } - -/* Pops the parse stack*/ -void m_pop(void) - { - M_PARSE *stackelt ; - - if (! m_stacktop->oldtop) { - m_error("Program error: attempt to pop empty stack") ; - m_exit(TRUE) ; - } - - if (m_stacktop->map && m_stacktop->map != m_stacktop->oldtop->map) - m_free(m_stacktop->map, "short reference map") ; - m_freeparam(m_stacktop) ; - m_freeFSA(m_stacktop) ; - - if (m_stacktop->neednet) m_netlevel-- ; - stackelt = m_stacktop ; - m_stacktop = stackelt->oldtop ; - m_free(stackelt, "stack element") ; - } - -/* Pushes a new item onto the parse stack, setting its element, current, - and neednet fields as indicated by the parameters*/ -void m_push(M_ELEMENT elt, M_STATE current, LOGICAL need) -{ - M_PARSE *newstack ; - - m_aftereod = FALSE ; - newstack = (M_PARSE *) m_malloc(sizeof(M_PARSE), "stack element") ; - newstack->oldtop = m_stacktop ; - newstack->element = elt ; - newstack->param = NULL ; - if (m_element[elt - 1].content == M_REGEXP) { - newstack->fsastack = (M_OPENFSA *) m_malloc(sizeof(M_OPENFSA), "FSA") ; - newstack->fsastack->oldtop = NULL ; - newstack->fsastack->current = current ; - newstack->fsastack->andgroup = M_NULLVAL ; - newstack->fsastack->usedand = NULL ; - } - else newstack->fsastack = NULL ; - newstack->thisent = 0 ; - newstack->neednet = need ; - newstack->firstre = FALSE ; - newstack->contextual = TRUE ; - newstack->intext = FALSE ; - newstack->linestat = M_NOTHING ; - newstack->holdre = FALSE ; - newstack->map = m_stacktop->map ; - newstack->cdcase = m_stacktop->cdcase ; - newstack->picase = m_stacktop->picase ; - newstack->stccase = m_stacktop->stccase ; - newstack->cdparam = m_stacktop->cdparam ; - newstack->piparam = m_stacktop->piparam ; - newstack->stparam = m_stacktop->stparam ; - newstack->file = m_stacktop->file ; - newstack->line = m_stacktop->line ; - newstack->ifdata = NULL ; - m_stacktop = newstack ; - if (m_element[elt - 1].srefptr) - m_setmap(m_element[elt - 1].srefptr, - (LOGICAL) m_element[elt - 1].useoradd) ; - } - -/* Process first character of a segment of character data. The first - character is treated differently so that if character data is not - allowed in the current context, an error message is issued with the - first character only and not with every character. */ -void m_strtcdata(scanval) - int scanval ; - { - if (! m_strtproc(M_NULLVAL)) - if (m_whitespace((M_WCHAR) scanval)) { - m_curcon = m_prevcon ; - return ; - } - else { - if (m_stacktop->oldtop) { - m_err1("Data characters not allowed at this point in %s", - m_nameofelt(m_stacktop->element)) ; - m_expecting() ; - m_showcurelt() ; - } - else if (! m_start) { - m_error("Document may not start with data characters") ; - m_expecting() ; - } - } - m_start = TRUE ; - m_textaction((M_WCHAR) scanval) ; - m_stacktop->firstre = TRUE ; - m_stacktop->intext = TRUE ; - } - -/* M_strtproc checks that the next starttag or beginning of the next - #PCDATA segment is valid, processing omitted start and endtags as needed. - (Since m_endtag may reset the current context if the stack is popped down - to an element that was within #PCDATA, m_strtproc saves the current context - and restores it after returning from the last call to m_endtag.) -*/ -LOGICAL m_strtproc(scanval) - M_ELEMENT scanval ; - { - int check ; - M_PARSE *original ; - int savecontext ; - int savenet ; - M_PARSE *savestack ; - M_PARSE *starttagomit ; - M_MIN *min ; - M_MIN *discard ; - - /* The algorithms used here involve making a copy of the stack entry - at the top of the stack before testing for the possibility of - start-tag omission. Values of cdparam, piparam, and stparam - are not used while testing for markup minimization and therefore - are not set. However, the original entry and the copy may differ - in the accuracy of these values, so care must be taken to keep - the version in which they are correct when the stack is manipulated - for the final time */ - - /* Is scanval allowed without tag omission? */ - savestack = m_stacktop ; - original = m_stacktop ; - m_stacktop = m_copystackelt() ; - if (check = m_checkstart(scanval)) { - if (scanval && m_stacktop->holdre && check != M_NONCONTEXTUAL) { - m_freeFSA(m_stacktop) ; - m_free(m_stacktop, "stack element") ; - m_stacktop = original ; - m_holdproc() ; - return(m_strtproc(scanval)) ; - } - m_freeFSA(m_stacktop) ; - m_free(m_stacktop, "stack element") ; - m_stacktop = original ; - if (scanval && check != M_NONCONTEXTUAL) { - m_stacktop->linestat = M_DCORCET ; - m_stacktop->firstre = TRUE ; - } - m_strttag(scanval, m_scannet) ; - if (check == M_NONCONTEXTUAL) m_stacktop->contextual = FALSE ; - else if (scanval) m_stacktop->oldtop->intext = FALSE ; - return(TRUE) ; - } - - /* Check for start- and end-tag omission */ - savecontext = m_curcon ; - savenet = m_netlevel ; - m_minstart = m_minend = NULL ; - m_nextms = &m_minstart ; - m_nextme = &m_minend ; - starttagomit = m_stacktop ; - while (TRUE) { - if (m_omitstart()) { - if (check = m_checkstart(scanval)) break ; - else continue ; - } - m_freemin(m_minstart, "start-tag minimization") ; - m_minstart = NULL ; - m_nextms = &m_minstart ; - while (m_stacktop != starttagomit) m_pop() ; - m_freeFSA(m_stacktop) ; - m_free(m_stacktop, "stack element") ; - m_stacktop = original ; - if (m_omitend()) { - original = m_stacktop->oldtop ; - m_stacktop = m_stacktop->oldtop ; - m_stacktop = m_copystackelt() ; - starttagomit = m_stacktop ; - if (check = m_checkstart(scanval)) break ; - else continue ; - } - m_freemin(m_minend, "end-tag minimization") ; - m_freemin(m_minstart, "start-tag minimization") ; - m_stacktop = savestack ; - m_netlevel = savenet ; - m_curcon = savecontext ; - return(FALSE) ; - } - - /* Have determined a sequence of omitted tags. Process them */ - /* Undo all stack changes that were made tentatively, so they can - be redone with invocation of interface as appropriate */ - while (m_stacktop != starttagomit) m_pop() ; - m_freeFSA(m_stacktop) ; - m_free(m_stacktop, "stack element") ; - m_stacktop = savestack ; - m_netlevel = savenet ; - if (m_minend) m_stacktop->holdre = FALSE ; - else if (m_stacktop->holdre && check != M_NONCONTEXTUAL) { - m_freemin(m_minstart, "start-tag minimization") ; - m_holdproc() ; - if (scanval) return(m_strtproc(scanval)) ; - else return(TRUE) ; - } - for (min = m_minend ; min ;) { - if (m_stacktop->neednet) { - M_WCHAR *wc_net; - - wc_net = MakeWideCharString(m_net); - m_err2("Expecting %s to end %s", - wc_net, - m_nameofelt(m_stacktop->element)) ; - m_free(wc_net,"wide character string"); - m_showcurelt() ; - } - if (! m_element[m_stacktop->element - 1].emin) { - m_err1("Missing end tag for %s", m_nameofelt(m_stacktop->element)) ; - m_showcurelt() ; - } - m_endtag(min->val) ; - discard = min ; - min = min->next ; - m_free(discard, "end-tag minimization") ; - } - for (min = m_minstart ; min ;) { - m_checkstart(min->val) ; - m_strttag(min->val, FALSE) ; - if (! m_element[min->val - 1].smin) - m_err1("Missing start tag for %s", m_nameofelt(min->val)) ; - m_stkdefaultparams() ; - discard = min ; - min = min->next ; - m_free(discard, "start-tag minimization") ; - } - check = m_checkstart(scanval) ; - if (scanval && check != M_NONCONTEXTUAL) { - m_stacktop->linestat = M_DCORCET ; - m_stacktop->firstre = TRUE ; - } - m_strttag(scanval, m_scannet) ; - if (check == M_NONCONTEXTUAL) m_stacktop->contextual = FALSE ; - else if (scanval) m_stacktop->oldtop->intext = FALSE ; - m_curcon = savecontext ; - if (m_element[m_stacktop->element - 1].content == M_CDATA) - m_curcon = CDATAEL ; - if (m_element[m_stacktop->element - 1].content == M_RCDATA) { - m_curcon = RCDATAEL ; - m_stacktop->thisent = m_eopencnt ; - } - return(TRUE) ; - } - -/* Processes explicit or implied start tag*/ -void m_strttag(M_ELEMENT val, LOGICAL net) -{ - m_transition(val, TRUE) ; - if (val) { - m_push(val, m_element[val - 1].start, net) ; - if (net) m_netlevel++ ; - if (m_element[val - 1].content == M_CDATA || - m_element[val - 1].content == M_RCDATA) { - m_stacktop->intext = TRUE ; - m_curcon = m_element[val - 1].content == M_CDATA ? - CDATAEL : RCDATAEL ; - } - } - } - -/* Returns indication of whether or not parsed data characters are allowed - (without tag minimization) in the current context. Used to distinguish - mixed content from element content. (Assuming the definition of - mixed content is a context where #PCDATA can occur, not that the current - content model contains #PCDATA at some point. The former definition - makes more sense, is used by MARKUP, and is under consideration by the - Standards committee; the latter is the current definition in the Standard - */ -LOGICAL m_textpermitted(void) - { - M_ANDGROUP pand ; - M_OPENFSA *fsastack ; - M_ANDLIST *usedand ; - LOGICAL morebranches = FALSE ; - - if (! m_stacktop->oldtop) return(FALSE) ; - /* If element has declared content (other than EMPTY), data is allowed. - But EMPTY elements don't stay on the stack long enough to call this - function */ - if (m_element[m_stacktop->element - 1].content != M_REGEXP) return(TRUE) ; - /* If within #PCDATA, more text can be entered */ - if (m_stacktop->intext) return(TRUE) ; - /* If current state emits an arc labelled #PCDATA, text can be - entered */ - for (fsastack = m_stacktop->fsastack ; - fsastack ; - fsastack = fsastack->oldtop) { - for (pand = fsastack->andgroup ; - pand ; - pand = m_andgroup[pand - 1].next) { - for (usedand = fsastack->usedand ; - usedand ; - usedand = usedand->next) - if (usedand->group == pand) break ; - if (! usedand) { - if (m_state[m_andgroup[pand - 1].start - 1].datacontent) - return(TRUE) ; - if (! m_state[m_andgroup[pand - 1].start - 1].final) - morebranches = TRUE ; - } - } - if (morebranches) return(FALSE) ; - if (m_state[fsastack->current - 1].datacontent) return(TRUE) ; - if (! m_state[fsastack->current - 1].final) return(FALSE) ; - } - return(FALSE) ; - } /* End m_textpermitted() */ - -/* Returns TRUE iff LABEL allowed in the current state of the current - element (without expanding any minimization). May result in changes - to the stack of FSA's for this element if and-groups open or close. */ -LOGICAL m_transition(M_ELEMENT label, LOGICAL recur) -{ - M_ARC parc ; - M_OPENFSA *newfsa ; - M_ANDGROUP pand ; - - if (m_stacktop->oldtop && - m_element[m_stacktop->element - 1].content != M_REGEXP) - return(FALSE) ; - for (parc = m_state[m_stacktop->fsastack->current - 1].first ; - parc ; - parc = m_arc[parc - 1].next) { - if (m_arc[parc - 1].group) { - newfsa = (M_OPENFSA *) m_malloc(sizeof(M_OPENFSA), "FSA") ; - newfsa->oldtop = m_stacktop->fsastack ; - newfsa->andgroup = M_NULLVAL ; - newfsa->usedand = NULL ; - m_stacktop->fsastack = newfsa ; - for (pand = m_arc[parc - 1].group ; pand ; - pand = m_andgroup[pand - 1].next) { - newfsa->current = m_andgroup[pand - 1].start ; - if (m_transition(label, FALSE)) { - newfsa->oldtop->andgroup = m_arc[parc - 1].group ; - newfsa->oldtop->usedand = - (M_ANDLIST *) m_malloc(sizeof(M_ANDLIST), "and list") ; - newfsa->oldtop->usedand->group = pand ; - newfsa->oldtop->usedand->next = NULL ; - newfsa->oldtop->current = m_arc[parc - 1].to ; - return(TRUE) ; - } - } - m_stacktop->fsastack = newfsa->oldtop ; - m_free(newfsa, "FSA") ; - } - else if (label == m_arc[parc - 1].label) { - m_stacktop->fsastack->current = m_arc[parc - 1].to ; - return(TRUE) ; - } - } /* End for parc */ - if (recur && m_nextand(m_stacktop->fsastack, label)) return(TRUE) ; - return(FALSE) ; - } /* End transition */ - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/tex.h b/cde/programs/dthelp/parser.ccdf/htag/parser/tex.h deleted file mode 100644 index 54010f327..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/tex.h +++ /dev/null @@ -1,288 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: tex.h /main/3 1995/11/08 11:33:23 rswiston $ */ -EXTERN char *special[256] -#if defined(DEFINE) -= { -/* Char Name TeX Expansion */ -/* */ -/* 0: ^@ NUL */ 0, -/* 1: ^A SOH */ 0, -/* 2: ^B STX */ 0, -/* 3: ^C ETX */ 0, -/* 4: ^D EOT */ 0, -/* 5: ^E ENQ */ 0, -/* 6: ^F ACK */ 0, -/* 7: ^G BEL */ 0, -/* 8: ^H BS */ 0, -/* 9: ^I HT */ 0, -/* 10: ^J LF */ 0, -/* 11: ^K VT */ 0, -/* 12: ^L FF */ 0, -/* 13: ^M CR */ 0, -/* 14: ^N SO */ 0, -/* 15: ^O SI */ 0, -/* 16: ^P DLE */ 0, -/* 17: ^Q DC1 */ 0, -/* 18: ^R DC2 */ 0, -/* 19: ^S DC3 */ 0, -/* 20: ^T DC4 */ 0, -/* 21: ^U NAK */ 0, -/* 22: ^V SYN */ 0, -/* 23: ^W ETB */ 0, -/* 24: ^X CAN */ 0, -/* 25: ^Y EM */ 0, -/* 26: ^Z SUB */ 0, -/* 27: ^[ ESC */ 0, -/* 28: ^\ FS */ 0, -/* 29: ^] GS */ 0, -/* 30: ^^ RS */ 0, -/* 31: ^_ US */ 0, -/* 32: SP */ 0, -/* 33: ! */ 0, -/* 34: " */ 0, -/* 35: # */ "\\#", -/* 36: $ */ "{\\dollar}", -/* 37: % */ "\\%", -/* 38: & */ "\\&", -/* 39: ' */ "{'}", -/* 40: ( */ 0, -/* 41: ) */ 0, -/* 42: * */ 0, -/* 43: + */ 0, -/* 44: , */ 0, -/* 45: - */ "{-}", -/* 46: . */ 0, -/* 47: / */ 0, -/* 48: 0 */ 0, -/* 49: 1 */ 0, -/* 50: 2 */ 0, -/* 51: 3 */ 0, -/* 52: 4 */ 0, -/* 53: 5 */ 0, -/* 54: 6 */ 0, -/* 55: 7 */ 0, -/* 56: 8 */ 0, -/* 57: 9 */ 0, -/* 58: : */ 0, -/* 59: ; */ 0, -/* 60: < */ "{\\lthan}", -/* 61: = */ 0, -/* 62: > */ "{\\gthan}", -/* 63: ? */ 0, -/* 64: @ */ 0, -/* 65: A */ 0, -/* 66: B */ 0, -/* 67: C */ 0, -/* 68: D */ 0, -/* 69: E */ 0, -/* 70: F */ 0, -/* 71: G */ 0, -/* 72: H */ 0, -/* 73: I */ 0, -/* 74: J */ 0, -/* 75: K */ 0, -/* 76: L */ 0, -/* 77: M */ 0, -/* 78: N */ 0, -/* 79: O */ 0, -/* 80: P */ 0, -/* 81: Q */ 0, -/* 82: R */ 0, -/* 83: S */ 0, -/* 84: T */ 0, -/* 85: U */ 0, -/* 86: V */ 0, -/* 87: W */ 0, -/* 88: X */ 0, -/* 89: Y */ 0, -/* 90: Z */ 0, -/* 91: [ */ 0, -/* 92: \\ */ "{\\bslash}", -/* 93: ] */ 0, -/* 94: ^ */ "\\string^", -/* 95: _ */ "{\\under}", -/* 96: ` */ "{`}", -/* 97: a */ 0, -/* 98: b */ 0, -/* 99: c */ 0, -/* 100: d */ 0, -/* 101: e */ 0, -/* 102: f */ 0, -/* 103: g */ 0, -/* 104: h */ 0, -/* 105: i */ 0, -/* 106: j */ 0, -/* 107: k */ 0, -/* 108: l */ 0, -/* 109: m */ 0, -/* 110: n */ 0, -/* 111: o */ 0, -/* 112: p */ 0, -/* 113: q */ 0, -/* 114: r */ 0, -/* 115: s */ 0, -/* 116: t */ 0, -/* 117: u */ 0, -/* 118: v */ 0, -/* 119: w */ 0, -/* 120: x */ 0, -/* 121: y */ 0, -/* 122: z */ 0, -/* 123: { */ "{\\lbrac}", -/* 124: | */ "{\\vbar}", -/* 125: } */ "{\\rbrac}", -/* 126: ~ */ "\\string~", -/* 127: DEL */ 0, -/* 128: undefined */ 0, -/* 129: undefined */ 0, -/* 130: undefined */ 0, -/* 131: undefined */ 0, -/* 132: undefined */ 0, -/* 133: undefined */ 0, -/* 134: undefined */ 0, -/* 135: undefined */ 0, -/* 136: undefined */ 0, -/* 137: undefined */ 0, -/* 138: undefined */ 0, -/* 139: undefined */ 0, -/* 140: undefined */ 0, -/* 141: undefined */ 0, -/* 142: undefined */ 0, -/* 143: undefined */ 0, -/* 144: undefined */ 0, -/* 145: undefined */ 0, -/* 146: undefined */ 0, -/* 147: undefined */ 0, -/* 148: undefined */ 0, -/* 149: undefined */ 0, -/* 150: undefined */ 0, -/* 151: undefined */ 0, -/* 152: undefined */ 0, -/* 153: undefined */ 0, -/* 154: undefined */ 0, -/* 155: undefined */ 0, -/* 156: undefined */ 0, -/* 157: undefined */ 0, -/* 158: undefined */ 0, -/* 159: undefined */ 0, -/* 160: undefined */ 0, -/* 161: A grave */ "\\`A", -/* 162: A circumflex */ "\\^A", -/* 163: E grave */ "\\`E", -/* 164: E circumflex */ "\\^E", -/* 165: E dieresis */ "\\\042E", -/* 166: I circumflex */ "\\^I", -/* 167: I dieresis */ "\\\042I", -/* 168: acute accent */ "\\'{ }", -/* 169: grave accent */ "\\`{ }", -/* 170: circumflex */ "\\^{ }", -/* 171: dieresis */ "\\\042{ }", -/* 172: tilde */ "\\~{ }", -/* 173: U grave */ "\\`U", -/* 174: U circumflex */ "\\^U", -/* 175: Italian Lira */ 0, -/* 176: overbar */ 0, -/* 177: Y acute */ "\\'Y", -/* 178: y acute */ "\\'y", -/* 179: degree */ 0, -/* 180: C cedilla */ "\\c{C}", -/* 181: c cedilla */ "\\c{c}", -/* 182: N tilde */ "\\~N", -/* 183: n tilde */ "\\~n", -/* 184: inverted exclamation mark */ "{!`}", -/* 185: inverted question mark */ "{?`}", -/* 186: currency sign */ 0, -/* 187: pound sterling */ 0, -/* 188: Yen */ 0, -/* 189: Section sign */ 0, -/* 190: florin */ 0, -/* 191: Cent sign */ 0, -/* 192: a circumflex */ "\\^a", -/* 193: e circumflex */ "\\^e", -/* 194: o circumflex */ "\\^o", -/* 195: u circumflex */ "\\^u", -/* 196: a acute */ "\\'a", -/* 197: e acute */ "\\'e", -/* 198: o acute */ "\\'o", -/* 199: u acute */ "\\'u", -/* 200: a grave */ "\\`a", -/* 201: e grave */ "\\`e", -/* 202: o grave */ "\\`o", -/* 203: u grave */ "\\`u", -/* 204: a dieresis */ "\\\042a", -/* 205: e dieresis */ "\\\042e", -/* 206: o dieresis */ "\\\042o", -/* 207: u dieresis */ "\\\042u", -/* 208: A angstrom */ "{\\AA}", -/* 209: i circumflex */ "{\\^\\i}", -/* 210: O slash */ "{\\O}", -/* 211: AE ligature */ "{\\AE}", -/* 212: a angstrom */ "{\\aa}", -/* 213: i acute */ "{\\'\\i}", -/* 214: o slash */ "{\\o}", -/* 215: ae ligature */ "{\\ae}", -/* 216: A dieresis */ "\\\042A", -/* 217: i grave */ "{\\`\\i}", -/* 218: O dieresis */ "\\\042O", -/* 219: U dieresis */ "\\\042U", -/* 220: E acute */ "\\'E", -/* 221: i dieresis */ "{\\\042\\i}", -/* 222: SS ligature */ "{\\ss}", -/* 223: O circumflex */ "\\^O", -/* 224: A acute */ "\\'A", -/* 225: A tilde */ "\\~A", -/* 226: a tilde */ "\\~a", -/* 227: Eth */ 0, -/* 228: eth */ 0, -/* 229: I acute */ "\\'I", -/* 230: I grave */ "\\`I", -/* 231: O acute */ "\\'O", -/* 232: O grave */ "\\`O", -/* 233: O tilde */ "\\~O", -/* 234: o tilde */ "\\~o", -/* 235: S caron */ "\\v{S}", -/* 236: s caron */ "\\v{s}", -/* 237: U acute */ "\\'U", -/* 238: Y dieresis */ "\\\042Y", -/* 239: y dieresis */ "\\\042y", -/* 240: Thorn */ 0, -/* 241: thorn */ 0, -/* 242: undefined */ 0, -/* 243: mu */ 0, -/* 244: paragraph sign */ 0, -/* 245: fraction 3/4 */ 0, -/* 246: long dash */ 0, -/* 247: fraction 1/4 */ 0, -/* 248: fraction 1/2 */ 0, -/* 249: Female ordinal */ 0, -/* 250: Male ordinal */ 0, -/* 251: French double open quote */ 0, -/* 252: Solid square */ 0, -/* 253: French double close quote */ 0, -/* 254: Plus over minus sign */ 0, -/* 255: undefined */ 0 -} -#endif -; - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/text.c b/cde/programs/dthelp/parser.ccdf/htag/parser/text.c deleted file mode 100644 index fb39edbfb..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/text.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: text.c /main/3 1995/11/08 11:33:41 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Text.c executes text-code specified in the interface. */ - -#include "userinc.h" -#include "globdec.h" - -/* Include generated file */ -#include "tfile.c" - -/* When a text character occurs */ -void m_textaction(M_WCHAR m_textchar) -{ - char buffer[10] ; - char mb_re; - M_WCHAR wc_re; - - mb_re = M_RE; - mbtowc(&wc_re, &mb_re, 1); - - if (m_stacktop->holdre) { - m_stacktop->holdre = FALSE ; - m_textaction(wc_re) ; - } - if (m_cdtrace) { - m_trace("Text character '") ; - buffer[0] = m_textchar ; - buffer[1] = M_EOS ; - m_trace(buffer) ; - m_trace("' (") ; - sprintf(buffer, "%d", m_textchar) ; - m_trace(buffer) ; - m_trace(")\n") ; - } - if (m_tagtrace) - m_toptstat = m_textchar == M_SPACE || m_textchar == M_TAB ? - M_WHITESPACE : M_OTHER ; - if (m_textchar != wc_re) m_stacktop->linestat = M_DCORCET ; - m_stackpar = m_stacktop->cdparam ; - (*m_ttable[m_stacktop->cdcase])(m_textchar) ; - } - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/trace.c b/cde/programs/dthelp/parser.ccdf/htag/parser/trace.c deleted file mode 100644 index 1f2ffa8d3..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/trace.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: trace.c /main/3 1995/11/08 11:33:58 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "userinc.h" -#include "globdec.h" - -/* Write debugging trace information */ -void m_wctrace(p) -M_WCHAR *p ; -{ -char *mb_p; - -mb_p = MakeMByteString(p); -fputs(mb_p, m_outfile) ; -m_free(mb_p,"multi-byte string"); -} - -void m_trace(p) -char *p ; -{ -fputs(p, m_outfile); -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/parser/userinc.h b/cde/programs/dthelp/parser.ccdf/htag/parser/userinc.h deleted file mode 100644 index 41f4b9403..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/parser/userinc.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: userinc.h /main/3 1995/11/08 11:34:15 rswiston $ */ -/* Copyright 1988, 1989 Hewlett-Packard Co. */ - -/* Header files for interface code files */ - -#include -#include "basic.h" -#include "trie.h" -#include "dtdext.h" -#include "parser.h" -#include "delim.h" -#include "entext.h" -#include "signonx.h" -#include "pval.h" -#include "version.h" diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/Imakefile b/cde/programs/dthelp/parser.ccdf/htag/util/Imakefile deleted file mode 100644 index 6d91ef773..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/Imakefile +++ /dev/null @@ -1,60 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/4 1996/05/09 17:32:26 drk $ -/* Util Imakefile */ -ARCCMD = arc u -UNARCCMD = arc x -ARCDELCMD = arc d - -INCLUDES = -I. - -LIBSRCS = \ - allwhite.c inctest.c letter.c triedump.c triepdmp.c \ - trieplk.c trierset.c upcmp8.c upstrcmp.c wchar.c -CTXSRCS = \ - conutil.c error.c exit.c itoa.c lower.c malloc.c openchk.c \ - trie.c triecnt.c upper.c whitesp.c -OTHERSRCS = \ - context.c emptyfil.c fclndir.c -SRCS = $(LIBSRCS) $(CTXSRCS) $(OTHERSRCS) - - -LIBOBJS = \ - allwhite.o inctest.o letter.o triedump.o triepdmp.o \ - trieplk.o trierset.o upcmp8.o upstrcmp.o wchar.o -CTXOBJS = \ - conutil.o error.o exit.o itoa.o lower.o malloc.o openchk.o \ - trie.o triecnt.o upper.o whitesp.o -OTHEROBJS = \ - context.o fclndir.o emptyfil.o - -LOCAL_LIBRARIES = libutil.a - -/* Don't use shared libs for hp */ -#ifdef HPArchitecture -#if OSMajorVersion > 7 -EXTRA_LOAD_FLAGS = -Wl,-a archive -#endif -#endif - -all:: - -NormalLibraryObjectRule() -NormalLibraryTarget(util,$(LIBOBJS) $(CTXOBJS)) - -all:: context fclndir - -NormalProgramTarget(context,context.o,$(LOCAL_LIBRARIES),$(LOCAL_LIBRARIES),) -NormalProgramTarget(fclndir,fclndir.o,$(LOCAL_LIBRARIES),$(LOCAL_LIBRARIES),) - - -XCOMM arc generates an arc file containing all the source files -XCOMM in this directory -arc package : - if exist util.arc $(CP) util.arc old.arc - $(ARCCMD) util.arc *.c *.h makefile - -unarc dearc : - $(UNARCCMD) util.arc - -DependTarget() - -depend:: $(SRCS) diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/allwhite.c b/cde/programs/dthelp/parser.ccdf/htag/util/allwhite.c deleted file mode 100644 index d03d79d08..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/allwhite.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: allwhite.c /main/3 1995/11/08 11:35:32 rswiston $ */ -/* - Copyright 1987, 1988, 1989 Hewlett-Packard Co. -*/ -#include "basic.h" - -LOGICAL m_allwhite(const M_WCHAR *string); - -LOGICAL m_whitespace(M_WCHAR c); - -/* Test if a string contains only white space characters */ -LOGICAL m_allwhite(const M_WCHAR *string ) -{ -const M_WCHAR *p ; - -for (p = string; *p ; p++) - if (! m_whitespace(*p)) return(FALSE) ; -return(TRUE) ; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/basic.h b/cde/programs/dthelp/parser.ccdf/htag/util/basic.h deleted file mode 100644 index a372f46bb..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/basic.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: basic.h /main/3 1995/11/08 11:35:48 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ -/* Basic.h has a few very primitive #define's used by all MARKUP programs */ -#include - -/* hpux protects stdio.h from multiple includes thru stdlib.h . */ -#include - -#define TRUE 1 -#define FALSE 0 -typedef unsigned char LOGICAL; - -/* End of String marker */ -#define M_EOS '\0' - -/* Integer null value marker */ -#define M_NULLVAL 0 - -/* 8-bit data characters */ -typedef unsigned char M_CHAR8; - -/* wide characters */ -typedef wchar_t M_WCHAR; - -/* For function prototypes */ -typedef char * M_POINTER; - -char *MakeMByteString(const M_WCHAR *from); - -M_WCHAR *MakeWideCharString(const char *from); - -int w_strcmp(const M_WCHAR *string1, const M_WCHAR *string2); - -M_WCHAR *w_strcpy(M_WCHAR *string1, const M_WCHAR *string2); - -M_WCHAR *w_strncpy(M_WCHAR *string1, const M_WCHAR *string2, int max); - -int w_strlen(const M_WCHAR *string); - -M_WCHAR *w_strchr(M_WCHAR *string, const M_WCHAR chr); - -M_WCHAR *w_strstr(M_WCHAR *string1, M_WCHAR *string2); - -void *m_malloc(int size, char *msg); diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/chartype.h b/cde/programs/dthelp/parser.ccdf/htag/util/chartype.h deleted file mode 100644 index b62daa462..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/chartype.h +++ /dev/null @@ -1,290 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: chartype.h /main/3 1995/11/08 11:36:04 rswiston $ */ -/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */ -/* This table defines the subset of the HP Roman8 character set -supported by HP Tag. Characters defined in Roman8 but not supported -by HP Tag are marked "(invalid)". */ - -M_CHARTYPE m_ctarray[M_CHARSETLEN] -= { -/* Char Name Type, Upper, Lower */ -/* 0: ^@ NUL */ M_NONNAME, 0, 0, -/* 1: ^A SOH */ M_NONNAME, 1, 1, -/* 2: ^B STX */ M_NONNAME, 2, 2, -/* 3: ^C ETX */ M_NONNAME, 3, 3, -/* 4: ^D EOT */ M_NONNAME, 4, 4, -/* 5: ^E ENQ */ M_NONNAME, 5, 5, -/* 6: ^F ACK */ M_NONNAME, 6, 6, -/* 7: ^G BEL */ M_NONNAME, 7, 7, -/* 8: ^H BS */ M_NONNAME, 8, 8, -/* 9: ^I HT */ M_NONNAME, 9, 9, -/* 10: ^J LF */ M_NONNAME, 10, 10, -/* 11: ^K VT */ M_NONNAME, 11, 11, -/* 12: ^L FF */ M_NONNAME, 12, 12, -/* 13: ^M CR */ M_NONNAME, 13, 13, -/* 14: ^N SO */ M_NONNAME, 14, 14, -/* 15: ^O SI */ M_NONNAME, 15, 15, -/* 16: ^P DLE */ M_NONNAME, 16, 16, -/* 17: ^Q DC1 */ M_NONNAME, 17, 17, -/* 18: ^R DC2 */ M_NONNAME, 18, 18, -/* 19: ^S DC3 */ M_NONNAME, 19, 19, -/* 20: ^T DC4 */ M_NONNAME, 20, 20, -/* 21: ^U NAK */ M_NONNAME, 21, 21, -/* 22: ^V SYN */ M_NONNAME, 22, 22, -/* 23: ^W ETB */ M_NONNAME, 23, 23, -/* 24: ^X CAN */ M_NONNAME, 24, 24, -/* 25: ^Y EM */ M_NONNAME, 25, 25, -/* 26: ^Z SUB */ M_NONNAME, 26, 26, -/* 27: ^[ ESC */ M_NONNAME, 27, 27, -/* 28: ^\ FS */ M_NONNAME, 28, 28, -/* 29: ^] GS */ M_NONNAME, 29, 29, -/* 30: ^^ RS */ M_NONNAME, 30, 30, -/* 31: ^_ US */ M_NONNAME, 31, 31, -/* 32: SP */ M_NONNAME, 32, 32, -/* 33: ! */ M_NONNAME, 33, 33, -/* 34: " */ M_NONNAME, 34, 34, -/* 35: # */ M_NONNAME, 35, 35, -/* 36: $ */ M_NONNAME, 36, 36, -/* 37: % */ M_NONNAME, 37, 37, -/* 38: & */ M_NONNAME, 38, 38, -/* 39: ' */ M_NONNAME, 39, 39, -/* 40: ( */ M_NONNAME, 40, 40, -/* 41: ) */ M_NONNAME, 41, 41, -/* 42: * */ M_NONNAME, 42, 42, -/* 43: + */ M_NAMECHAR, 43, 43, -/* 44: , */ M_NONNAME, 44, 44, -/* 45: - */ M_NAMECHAR, 45, 45, -/* 46: . */ M_NAMECHAR, 46, 46, -/* 47: / */ M_NONNAME, 47, 47, -/* 48: 0 */ M_DIGIT, 48, 48, -/* 49: 1 */ M_DIGIT, 49, 49, -/* 50: 2 */ M_DIGIT, 50, 50, -/* 51: 3 */ M_DIGIT, 51, 51, -/* 52: 4 */ M_DIGIT, 52, 52, -/* 53: 5 */ M_DIGIT, 53, 53, -/* 54: 6 */ M_DIGIT, 54, 54, -/* 55: 7 */ M_DIGIT, 55, 55, -/* 56: 8 */ M_DIGIT, 56, 56, -/* 57: 9 */ M_DIGIT, 57, 57, -/* 58: : */ M_NONNAME, 58, 58, -/* 59: ; */ M_NONNAME, 59, 59, -/* 60: < */ M_NONNAME, 60, 60, -/* 61: = */ M_NONNAME, 61, 61, -/* 62: > */ M_NONNAME, 62, 62, -/* 63: ? */ M_NONNAME, 63, 63, -/* 64: @ */ M_NONNAME, 64, 64, -/* 65: A */ M_NMSTART, 65, 97, -/* 66: B */ M_NMSTART, 66, 98, -/* 67: C */ M_NMSTART, 67, 99, -/* 68: D */ M_NMSTART, 68, 100, -/* 69: E */ M_NMSTART, 69, 101, -/* 70: F */ M_NMSTART, 70, 102, -/* 71: G */ M_NMSTART, 71, 103, -/* 72: H */ M_NMSTART, 72, 104, -/* 73: I */ M_NMSTART, 73, 105, -/* 74: J */ M_NMSTART, 74, 106, -/* 75: K */ M_NMSTART, 75, 107, -/* 76: L */ M_NMSTART, 76, 108, -/* 77: M */ M_NMSTART, 77, 109, -/* 78: N */ M_NMSTART, 78, 110, -/* 79: O */ M_NMSTART, 79, 111, -/* 80: P */ M_NMSTART, 80, 112, -/* 81: Q */ M_NMSTART, 81, 113, -/* 82: R */ M_NMSTART, 82, 114, -/* 83: S */ M_NMSTART, 83, 115, -/* 84: T */ M_NMSTART, 84, 116, -/* 85: U */ M_NMSTART, 85, 117, -/* 86: V */ M_NMSTART, 86, 118, -/* 87: W */ M_NMSTART, 87, 119, -/* 88: X */ M_NMSTART, 88, 120, -/* 89: Y */ M_NMSTART, 89, 121, -/* 90: Z */ M_NMSTART, 90, 122, -/* 91: [ */ M_NONNAME, 91, 91, -/* 92: \\ */ M_NONNAME, 92, 92, -/* 93: ] */ M_NONNAME, 93, 93, -/* 94: ^ */ M_NONNAME, 94, 94, -/* 95: _ */ M_NONNAME, 95, 95, -/* 96: ` */ M_NONNAME, 96, 96, -/* 97: a */ M_NMSTART, 65, 97, -/* 98: b */ M_NMSTART, 66, 98, -/* 99: c */ M_NMSTART, 67, 99, -/* 100: d */ M_NMSTART, 68, 100, -/* 101: e */ M_NMSTART, 69, 101, -/* 102: f */ M_NMSTART, 70, 102, -/* 103: g */ M_NMSTART, 71, 103, -/* 104: h */ M_NMSTART, 72, 104, -/* 105: i */ M_NMSTART, 73, 105, -/* 106: j */ M_NMSTART, 74, 106, -/* 107: k */ M_NMSTART, 75, 107, -/* 108: l */ M_NMSTART, 76, 108, -/* 109: m */ M_NMSTART, 77, 109, -/* 110: n */ M_NMSTART, 78, 110, -/* 111: o */ M_NMSTART, 79, 111, -/* 112: p */ M_NMSTART, 80, 112, -/* 113: q */ M_NMSTART, 81, 113, -/* 114: r */ M_NMSTART, 82, 114, -/* 115: s */ M_NMSTART, 83, 115, -/* 116: t */ M_NMSTART, 84, 116, -/* 117: u */ M_NMSTART, 85, 117, -/* 118: v */ M_NMSTART, 86, 118, -/* 119: w */ M_NMSTART, 87, 119, -/* 120: x */ M_NMSTART, 88, 120, -/* 121: y */ M_NMSTART, 89, 121, -/* 122: z */ M_NMSTART, 90, 122, -/* 123: { */ M_NONNAME, 123, 123, -/* 124: | */ M_NONNAME, 124, 124, -/* 125: } */ M_NONNAME, 125, 125, -/* 126: ~ */ M_NONNAME, 126, 126, -/* 127: DEL */ M_NONNAME, 127, 127, -/* 128: undefined */ M_NONNAME, 128, 128, -/* 129: undefined */ M_NONNAME, 129, 129, -/* 130: undefined */ M_NONNAME, 130, 130, -/* 131: undefined */ M_NONNAME, 131, 131, -/* 132: undefined */ M_NONNAME, 132, 132, -/* 133: undefined */ M_NONNAME, 133, 133, -/* 134: undefined */ M_NONNAME, 134, 134, -/* 135: undefined */ M_NONNAME, 135, 135, -/* 136: undefined */ M_NONNAME, 136, 136, -/* 137: undefined */ M_NONNAME, 137, 137, -/* 138: undefined */ M_NONNAME, 138, 138, -/* 139: undefined */ M_NONNAME, 139, 139, -/* 140: undefined */ M_NONNAME, 140, 140, -/* 141: undefined */ M_NONNAME, 141, 141, -/* 142: undefined */ M_NONNAME, 142, 142, -/* 143: undefined */ M_NONNAME, 143, 143, -/* 144: undefined */ M_NONNAME, 144, 144, -/* 145: undefined */ M_NONNAME, 145, 145, -/* 146: undefined */ M_NONNAME, 146, 146, -/* 147: undefined */ M_NONNAME, 147, 147, -/* 148: undefined */ M_NONNAME, 148, 148, -/* 149: undefined */ M_NONNAME, 149, 149, -/* 150: undefined */ M_NONNAME, 150, 150, -/* 151: undefined */ M_NONNAME, 151, 151, -/* 152: undefined */ M_NONNAME, 152, 152, -/* 153: undefined */ M_NONNAME, 153, 153, -/* 154: undefined */ M_NONNAME, 154, 154, -/* 155: undefined */ M_NONNAME, 155, 155, -/* 156: undefined */ M_NONNAME, 156, 156, -/* 157: undefined */ M_NONNAME, 157, 157, -/* 158: undefined */ M_NONNAME, 158, 158, -/* 159: undefined */ M_NONNAME, 159, 159, -/* 160: undefined */ M_NONNAME, 160, 160, -/* 161: A grave */ M_NMSTART, 161, 200, -/* 162: A circumflex */ M_NMSTART, 162, 192, -/* 163: E grave */ M_NMSTART, 163, 201, -/* 164: E circumflex */ M_NMSTART, 164, 193, -/* 165: E dieresis */ M_NMSTART, 165, 205, -/* 166: I circumflex */ M_NMSTART, 166, 209, -/* 167: I dieresis */ M_NMSTART, 167, 221, -/* 168: acute accent */ M_NONNAME, 168, 168, -/* 169: grave accent */ M_NONNAME, 169, 169, -/* 170: circumflex */ M_NONNAME, 170, 170, -/* 171: dieresis */ M_NONNAME, 171, 171, -/* 172: tilde */ M_NONNAME, 172, 172, -/* 173: U grave */ M_NMSTART, 173, 203, -/* 174: U circumflex */ M_NMSTART, 174, 195, -/* 175: Italian Lira (invalid) */ M_NONNAME, 175, 175, -/* 176: overbar (invalid) */ M_NONNAME, 176, 176, -/* 177: Y acute */ M_NMSTART, 177, 178, -/* 178: y acute */ M_NMSTART, 177, 178, -/* 179: degree (invalid) */ M_NONNAME, 179, 179, -/* 180: C cedilla */ M_NMSTART, 180, 181, -/* 181: c cedilla */ M_NMSTART, 180, 181, -/* 182: N tilde */ M_NMSTART, 182, 183, -/* 183: n tilde */ M_NMSTART, 182, 183, -/* 184: inverted exclamation mark */ M_NONNAME, 184, 184, -/* 185: inverted question mark */ M_NONNAME, 185, 185, -/* 186: currency sign (invalid) */ M_NONNAME, 186, 186, -/* 187: pound sterling (invalid) */ M_NONNAME, 187, 187, -/* 188: Yen */ M_NONNAME, 188, 188, -/* 189: Section sign (invalid) */ M_NONNAME, 189, 189, -/* 190: florin (invalid) */ M_NONNAME, 190, 190, -/* 191: Cent sign (invalid) */ M_NONNAME, 191, 191, -/* 192: a circumflex */ M_NMSTART, 162, 192, -/* 193: e circumflex */ M_NMSTART, 164, 193, -/* 194: o circumflex */ M_NMSTART, 223, 194, -/* 195: u circumflex */ M_NMSTART, 174, 195, -/* 196: a acute */ M_NMSTART, 224, 196, -/* 197: e acute */ M_NMSTART, 220, 197, -/* 198: o acute */ M_NMSTART, 231, 198, -/* 199: u acute */ M_NMSTART, 237, 199, -/* 200: a grave */ M_NMSTART, 161, 200, -/* 201: e grave */ M_NMSTART, 163, 201, -/* 202: o grave */ M_NMSTART, 232, 202, -/* 203: u grave */ M_NMSTART, 173, 203, -/* 204: a dieresis */ M_NMSTART, 216, 204, -/* 205: e dieresis */ M_NMSTART, 165, 205, -/* 206: o dieresis */ M_NMSTART, 218, 206, -/* 207: u dieresis */ M_NMSTART, 219, 207, -/* 208: A angstrom */ M_NMSTART, 208, 212, -/* 209: i circumflex */ M_NMSTART, 166, 209, -/* 210: O slash */ M_NMSTART, 210, 214, -/* 211: AE ligature */ M_NMSTART, 211, 215, -/* 212: a angstrom */ M_NMSTART, 208, 212, -/* 213: i acute */ M_NMSTART, 229, 213, -/* 214: o slash */ M_NMSTART, 210, 214, -/* 215: ae ligature */ M_NMSTART, 211, 215, -/* 216: A dieresis */ M_NMSTART, 216, 204, -/* 217: i grave */ M_NMSTART, 230, 217, -/* 218: O dieresis */ M_NMSTART, 218, 206, -/* 219: U dieresis */ M_NMSTART, 219, 207, -/* 220: E acute */ M_NMSTART, 220, 197, -/* 221: i dieresis */ M_NMSTART, 167, 221, -/* 222: SS ligature */ M_NMSTART, 222, 222, -/* 223: O circumflex */ M_NMSTART, 223, 194, -/* 224: A acute */ M_NMSTART, 224, 196, -/* 225: A tilde */ M_NMSTART, 225, 226, -/* 226: a tilde */ M_NMSTART, 225, 226, -/* 227: Eth (invalid) */ M_NMSTART, 227, 228, -/* 228: eth (invalid) */ M_NMSTART, 227, 228, -/* 229: I acute */ M_NMSTART, 229, 213, -/* 230: I grave */ M_NMSTART, 230, 217, -/* 231: O acute */ M_NMSTART, 231, 198, -/* 232: O grave */ M_NMSTART, 232, 202, -/* 233: O tilde */ M_NMSTART, 233, 234, -/* 234: o tilde */ M_NMSTART, 233, 234, -/* 235: S caron */ M_NMSTART, 235, 236, -/* 236: s caron */ M_NMSTART, 235, 236, -/* 237: U acute */ M_NMSTART, 237, 199, -/* 238: Y dieresis */ M_NMSTART, 238, 239, -/* 239: y dieresis */ M_NMSTART, 238, 239, -/* 240: Thorn (invalid) */ M_NMSTART, 240, 241, -/* 241: thorn (invalid) */ M_NMSTART, 240, 241, -/* 242: undefined */ M_NONNAME, 242, 242, -/* 243: mu (invalid) */ M_NONNAME, 243, 243, -/* 244: paragraph sign (invalid) */ M_NONNAME, 244, 244, -/* 245: fraction 3/4 (invalid) */ M_NONNAME, 245, 245, -/* 246: long dash (invalid) */ M_NONNAME, 246, 246, -/* 247: fraction 1/4 (invalid) */ M_NONNAME, 247, 247, -/* 248: fraction 1/2 (invalid) */ M_NONNAME, 248, 248, -/* 249: Female ordinal (invalid) */ M_NONNAME, 249, 249, -/* 250: Male ordinal (invalid) */ M_NONNAME, 250, 250, -/* 251: French double open quote(invalid) */ M_NONNAME, 251, 251, -/* 252: Solid square (invalid) */ M_NONNAME, 252, 252, -/* 253: French double close quote(invalid) */ M_NONNAME, 253, 253, -/* 254: Plus over minus sign(invalid)*/ M_NONNAME, 254, 254, -/* 255: undefined */ M_NONNAME, 255, 255, -} ; - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/common.h b/cde/programs/dthelp/parser.ccdf/htag/util/common.h deleted file mode 100644 index faffb1a32..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/common.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: common.h /main/3 1995/11/08 11:36:21 rswiston $ */ -/* - Copyright (c) 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Common.h contains definitions common to programs BUILD, ELTDEF, and PARSER. -Its purpose is to insure that limits, such as the maximum length of an SGML -name, are the same for all programs. -*/ - -#define M_MARKUP - -/* White-space characters */ -#define M_RE '\n' -#define M_SPACE ' ' -#define M_TAB '\t' - -/* Maximum length of a default parameter value */ -#define M_LITLEN 240 - -/* Maximum length of an element name */ -#define M_NAMELEN 64 - -/* M_NONNAME, M_NMSTART, M_NAMECHAR, and M_DIGIT are used to indicate - which characters can appear within element names*/ -#define M_NONNAME 0 -#define M_NMSTART 1 -#define M_NAMECHAR 2 -#define M_DIGIT 3 - -/* Number of characters in the character set */ -#define M_CHARSETLEN 256 - -/* Structure for entities */ -typedef struct m_entity M_ENTITY ; -struct m_entity { - unsigned char type ; - unsigned char wheredef ; - M_WCHAR *content ; - M_WCHAR *name ; -#if defined(BUILDEXTERN) || defined(ELTEXTERN) - int index ; - M_ENTITY *next ; -#endif -#if ! defined(BUILDEXTERN) - int codeindex ; -#endif - } ; - -/* Declarations for character types */ -typedef struct { - LOGICAL type ; - /* Must be same type as EOF */ - int upper ; - int lower ; - } M_CHARTYPE ; - - -#define m_ischar(x) ((int) (x) >= 0 && (int) (x) < M_CHARSETLEN) -#define m_cttype(x) (m_ischar(x) ? m_ctarray[x].type : M_NONNAME) -#define m_ctupper(x) (m_ischar(x) ? m_ctarray[x].upper : x) -#define m_ctlower(x) (m_ischar(x) ? m_ctarray[x].lower : x) -#define m_ctdigit(x) (m_ischar(x) ? m_ctarray[x].type == M_DIGIT : FALSE) diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/cont.h b/cde/programs/dthelp/parser.ccdf/htag/util/cont.h deleted file mode 100644 index 2bdcaf8d9..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/cont.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: cont.h /main/3 1995/11/08 11:36:39 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Cont.h is the primary include file for program CONTEXT. */ - -#if defined(CONTDEF) -#define CONTEXTERN -#define CONTINIT(a) = a -#else -#define CONTEXTERN extern -#define CONTINIT(a) -#endif - -void countdown(M_TRIE *parent, int *count); - -void dumpdlmptr(void); - -void dumpnode(LOGICAL *first, FILE *file, M_TRIE *trieptr, int *count, void (*proc)); - -void dumptree(LOGICAL sparse); - -void enterdelim(int n); - -void m_error(char *text); - -void m_err1(char *text, char *arg); - -void getcode(int n); - -void getcolon(void); - -int getcontext(void); - -LOGICAL getdname(void); - -void inccon(void); - -void incdelim(void); - -void loaddelim(void); - -int m_lower(int c); - -void main(int argc, char **argv); - -void *m_malloc(int size, char *msg); - -void nextcon(LOGICAL sparse); - -void m_openchk(FILE **ptr, char *name, char *mode); - -void printval(FILE *file, M_TRIE *value); - -void prtctxt(int column, int value); - -int readchar(LOGICAL cap); - -void skiptoend(void); - -void unread(int c); - -int m_upper(int c); - -void warning(char *text); - -void warning1(char *text, char *arg); - -void warning2(char *text, char *arg1, char *arg2); - -LOGICAL m_whitespace(M_WCHAR c); - - -#define NOMORE -1 - -/* Increase by 10 percent */ -#define m_plus10p(x) (x + (x > 10 ? x / 10 : 1)) - -CONTEXTERN int NUMCON CONTINIT(100) ; -#define CNAMELEN 12 -#define DNAMELEN 12 -#define DELIMLEN 25 -CONTEXTERN int NUMDELIM CONTINIT(100) ; - -#define contype ccount <= 255 ? "unsigned char" : "int" - -CONTEXTERN LOGICAL m_heapchk CONTINIT(FALSE) ; -CONTEXTERN LOGICAL m_malftrace CONTINIT(FALSE) ; - -#define ENDIFSTRING "}\n#endif\n ;\n" -CONTEXTERN char endif[sizeof(ENDIFSTRING)] CONTINIT(ENDIFSTRING) ; - -CONTEXTERN LOGICAL casestarted ; -CONTEXTERN LOGICAL errexit CONTINIT(FALSE) ; - -CONTEXTERN FILE *delim ; -CONTEXTERN FILE *context ; -CONTEXTERN FILE *fcase, *cdat, *ddat, *m_errfile ; - -CONTEXTERN M_TRIE delimtrie ; - -CONTEXTERN M_TRIE **contree ; -CONTEXTERN int *xtransit ; -#define transit(i,j) xtransit[i * NUMDELIM + j] - -CONTEXTERN M_WCHAR **contexts ; -CONTEXTERN int ccount CONTINIT(0) ; - -CONTEXTERN M_WCHAR dname[DNAMELEN + 1] ; -CONTEXTERN M_WCHAR dstring[DELIMLEN + 1] ; -CONTEXTERN int dcount CONTINIT(0) ; - -CONTEXTERN struct dstruct { - int count ; - M_WCHAR *string ; - } *dstruct ; -CONTEXTERN LOGICAL withdelim ; -CONTEXTERN LOGICAL loading ; -CONTEXTERN int curdelim ; - -CONTEXTERN char **dlmptr ; - -CONTEXTERN LOGICAL first CONTINIT(TRUE) ; -CONTEXTERN int maxd CONTINIT(0) ; - -CONTEXTERN int m_line CONTINIT(1) ; - -CONTEXTERN int nonzero CONTINIT(0) ; diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/context.c b/cde/programs/dthelp/parser.ccdf/htag/util/context.c deleted file mode 100644 index 1f92a699b..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/context.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: context.c /main/3 1995/11/08 11:36:54 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* -Context.c contains the main procedure for program CONTEXT. - -CONTEXT builds scanning and parsing tables for a simple -state-transition recognizer. Input consists of two files, delimiter -declarations in file "delim.dat" and state tables with corresponding -actions in file "context.dat". If a parameter is present on the -command line, a sparse matrix technique is used to encode some of the -output arrays. - -Data lines in "delim.dat" contain the name of the delimiter followed -by the text of the delimiter (one or more non-white space -characters). The delimiter name must begin in the first column. -Lines with white-space in the first column are considered comments. - -Data in "context.dat" consists of free-form multi-line declarations. -Each declaration is terminated by a semi-colon. It begins with the -name of a token followed by any number of pairs of contexts (parser -states). The context pairs are separated by a colon and may -optionally be followed by some C code enclosed in braces. In each -pair, the first context is one in which the delimiter is recognized, -the second is the state that will result from an occurrence of the -delimiter in the first context. If code is specified, it is to be -executed by the parser when the delimiter occurs in the first context -of the pair. If successive pairs of contexts are separated by a -comma, code which follows is common to all the pairs. - -The tokens specified in "context.dat" can either be delimiters defined in -"delim.dat" or other tokens (e.g., number, name, end_of_file) that will -be recognized by the user-defined scanner. - -For example, suppose "delim.dat" contains the line - - grpo ( - -and "context.dat" includes - - grpo element:namegroup - content:model {openmod() ;} - excon:openex - pcon:type ; - - name namegroup:namesep {eltname() ;} - model:connector, - model2:connector - {storemod(nstring) ;} - -These declarations specify that the "grpo" delimiter is "(" and is -recognized in contexts "element", "content", "excon", and "pcon". -Procedure openmod() is called when "grpo" occurs in "content" and, -beyond the state change, no code is executed in other contexts when -"grpo" occurs. The "name" token is valid in contexts "namegroup", -"model", and "model2"; in the first, the context is set to "namesep" -and procedure eltname() is called, in the last two, the context is -set to "connector" and storemod(nstring) is called. - -The program has several output files: case.c, delim.h, context.h, and -error. Case.c contains nested switch statements to execute the code -specified with the context transitions. Delim.h contains C -declarations related to delimiters; context.h has declarations -related to contexts. Programs that include delim.h should define -M_DELIMDEF for definition form of the declarations and not define it -for the declaration form. Programs that include context.h should -define M_CONDEF analogously. - -The program numbers the delimiter names and the contexts as -encountered and outputs corresponding #define instructions with all -letters in the names forced to uppercase to delim.h and context.h. -In addition, an array named for each delimiter (with all letters -forced to lowercase) is initialized to the delimiter text. The first -declaration in the above example, for instance, would result in the -following lines written to delim.h: - - #define GRPO 1 - M_DELIMEXTERN char grpo[] M_DELIMINIT("(") ; - -These lines would be written to context.h: - - #define ELEMENT 1 - #define NAMEGROUP 2 - #define CONTENT 3 - #define MODEL 4 - #define EXCON 5 - #define OPENEX 6 - #define PCON 7 - #define TYPE 8 - #define NAMESEP 9 - #define CONNECTOR 10 - #define MODEL2 11 - -Delim.h also contains an array, m_dlmptr, which contains pointers to the -names of all the defined delimiters. In addition, delim.h contains the -declaration of a tree representation of the delimiters allowed in each -context. Internally, the program represents the delimiter strings with a -tree. The children of the root of this tree represent the set of characters -with which delimiters can start. Children of other nodes represent -characters that can follow the character of their parent. Leaf nodes -are associated with the null character, indicating the end of a -delimiter. A path from the root to a leaf thus represents a valid -delimiter. - -The form in which the tree is represented within this program is not -quite the same as the output data structure. In the latter, each -element consists of a flag called 'more' indicating whether it is the last -child of its parent; a character, called 'symbol'; and an integer, -called 'index'. All sons of a node are stored in adjacent elements -ordered in increaing value of their 'symbol' fields. 'Symbol' -contains the character associated with the node (0 if the node is a -leaf node), with the sign bit turned on if the node is the last child -of its parent. 'Index' contains the array index of the first son of -the node, if the node is not a leaf. If the node is a leaf, 'index' -is the number of the represented delimiter (i.e., 1 for "grpo" in the -above example). - -As the tree is constructed, it is not feasible to store brothers in adjacent -elements, so the internal data structure is different. It contains a 'next' -field which points to the first brother of a given node. Because the 'next' -field can be used to detect the last child of a parent, it is not necessary -to use the sign bit of 'symbol' to indicate this special case. - -Two other arrays are written to context.h. Contree[i] points to the root -of the delimiter tree for the ith context within the array tree whose -declaration is in delim.h; nextcon[i][j] indicates the state -resulting from an occurrence of delimiter j+1 in state i+1. Finally, -a #define of MAXD to the length of the longest delimiter is written to -delim.h. -*/ - -#include -#include -#include "basic.h" -#include "trie.h" - -#include "common.h" -#include "chartype.h" -#define CONTDEF 1 -#include "cont.h" - -/* Main procedure */ -int main(argc, argv) - int argc ; - char **argv ; -{ -int n ; - -m_openchk(&delim, "delim.h", "w") ; -m_openchk(&context, "context.h", "w") ; -m_openchk(&fcase, "case.c", "w") ; -m_openchk(&cdat, "context.dat", "r") ; -m_openchk(&ddat, "delim.dat", "r") ; -m_openchk(&m_errfile, "error", "w") ; -fputs(" switch(m_token) {\n", fcase) ; /* keep the "}" balanced */ - -fputs("#if defined(M_DELIMDEF)\n", delim) ; -fputs("#define M_DELIMEXTERN\n", delim) ; -fputs("#define M_DELIMINIT(a) = a\n", delim) ; -fputs("#else\n", delim) ; -fputs("#define M_DELIMEXTERN extern\n", delim) ; -fputs("#define M_DELIMINIT(a)\n", delim) ; -fputs("#endif\n\n", delim) ; - -fputs("#if defined(M_CONDEF)\n", context) ; -fputs("#define M_CONEXTERN\n", context) ; -fputs("#else\n", context) ; -fputs("#define M_CONEXTERN extern\n", context) ; -fputs("#endif\n\n", context) ; - -contree = (M_TRIE **) calloc(NUMCON, sizeof(M_TRIE *)) ; -xtransit = (int *) calloc(NUMCON * NUMDELIM, sizeof(int)) ; -contexts = (M_WCHAR **) calloc(NUMCON, sizeof(char *)) ; -dlmptr = (char**) calloc(NUMDELIM, sizeof(char*)) ; - -loaddelim() ; -while (getdname()) - { - casestarted = FALSE ; - while ((n = getcontext()) >= 0) - { - if (withdelim) enterdelim(n) ; - getcolon() ; - if (transit(n, curdelim)) - { - if (! withdelim) - { - char *mb_dname, *mb_contexts; - - mb_dname = MakeMByteString(dname); - mb_contexts = MakeMByteString(contexts[n]); - warning2( - "Duplicate assignment to token \"%s\" in context \"%s\"", - mb_dname, - mb_contexts) ; - m_free(mb_dname,"multi-byte string"); - m_free(mb_contexts,"multi-byte string"); - } - } - transit(n, curdelim) = getcontext() + 1 ; - getcode(n) ; - } - if (casestarted) - { - fprintf(fcase, " default:\n break ;\n") ; - /* keep the "{" balanced */ - fprintf(fcase, " }\n break ;\n") ; - } - } -/* keep the "{" balanced */ -fprintf(fcase, " default:\n break ;\n }\n") ; -fprintf(context, "#define MAXD %d\n", maxd) ; -dumptree((LOGICAL) (argc > 1)) ; -fprintf(stderr, "NUMCON set to %d\n", NUMCON) ; -fprintf(stderr, "NUMDELIM set to %d\n", NUMDELIM) ; -return errexit; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/conutil.c b/cde/programs/dthelp/parser.ccdf/htag/util/conutil.c deleted file mode 100644 index e30308c12..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/conutil.c +++ /dev/null @@ -1,656 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: conutil.c /main/3 1995/11/08 11:37:11 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Conutil has utility procedures for program CONTEXT. */ -#include -#include -#include -#include "basic.h" -#include "trie.h" - -#include "cont.h" - -/* Output declaration of dlmptr */ -void dumpdlmptr(void) - { - int n; - - fprintf(delim, "M_DELIMEXTERN M_WCHAR *m_dlmptr[%d];\n", dcount+1); - fprintf(delim, "M_DELIMEXTERN char *mb_dlmptr[%d]\n", dcount+1); - fprintf(delim, "#if defined(M_DELIMDEF)\n = {\n"); - for (n = 0 ; n < dcount ; n++) { - if (n) fputs(",\n", delim); - fprintf(delim, " %s", dlmptr[n]); - } - fprintf(delim, endif); - } - -/* Output the generated data structures */ -void dumptree(LOGICAL sparse) - { - int i, count = 0; - - for (i = 0 ; i < ccount ; i++) - if (contree[i]) - countdown(contree[i], &count); - fprintf(delim, - "M_DELIMEXTERN M_PTRIE m_delimtrie[%d]\n#if defined(M_DELIMDEF)\n = {\n", - count); - fprintf(context, - "M_CONEXTERN int m_contree[%d]\n#if defined(M_CONDEF)\n = {\n ", - ccount); - - count = 0; - for (i = 0 ; i < ccount ; i++) { - if (contree[i]) { - fprintf(context, "%d", count + 1); - dumpnode(&first, delim, contree[i], &count, (void *)printval); - } - else fprintf(context, "0"); - if (i < ccount - 1) fprintf(context, ",\n "); - } - fprintf(delim, endif); - fprintf(context, endif); - nextcon(sparse); - } - -/* Enter a delimiter into the delimiter tree for a particular context */ -void enterdelim(n) - int n; -{ -if (! contree[n]) - { - contree[n] = m_gettrienode(); - } - -if (m_ntrtrie(dstruct->string, - contree[n], - (void *) (unsigned long) dstruct->count)) - { - char *mb_dstring, *mb_contexts; - - mb_dstring = MakeMByteString(dstring); - mb_contexts = MakeMByteString(contexts[n]); - dcount--; - warning2("Duplicate assignment to delimiter \"%s\" in context \"%s\"", - mb_dstring, - mb_contexts); - m_free(mb_dstring,"multi-byte string"); - m_free(mb_contexts,"multi-byte string"); - } -} - -/* Read the code to be executed with a given state transition */ -void getcode(n) -int n; -{ -int c ; /* c is int instead of char for use with ungetc */ -int nested = 1; -LOGICAL comment = FALSE; -char *mb_context; -M_WCHAR wlb = 0, wcm, wnl, wsl, wst; - - -if (!wlb) - { - mbtowc(&wlb, "{", 1); /* keep the "}" balanced */ - mbtowc(&wcm, ",", 1); - mbtowc(&wnl, "\n", 1); - mbtowc(&wsl, "/", 1); - mbtowc(&wst, "*", 1); - } - -while (m_whitespace((M_WCHAR) (c = readchar(FALSE)))); -if (c != wlb && c != wcm) - { - unread(c); - return; - } - -if (! casestarted) - { - char *mb_dname; - - mb_dname = MakeMByteString(dname); - casestarted = TRUE; - fprintf(fcase, " case %s:\n", mb_dname); - fprintf(fcase, " switch (m_prevcon) {\n") ; /* balance the } */ - m_free(mb_dname,"multi-byte string"); - } - -mb_context = MakeMByteString(contexts[n]); -fprintf(fcase, " case %s:\n", mb_context); -m_free(mb_context,"multi-byte string"); - -if (c == wcm) return; - -fprintf(fcase, "/* line %d \"context.dat\" */\n", m_line); - -while (TRUE) - { - char mb_c[32]; /* arbitrarily large */ - int length; - - c = readchar(FALSE); - if (c == EOF) - { - warning("Unexpected EOF"); - exit(TRUE); - } - - length = wctomb(mb_c, c); - mb_c[length] = 0; - if (length == 1) - { - switch (mb_c[0]) - { - case '{': - if (! comment) nested++; - break; - case '}': - if (! comment) - if (! --nested) - { - fprintf(fcase,"\n break ;\n"); - return; - } - break; - case '/': - if (! comment) - { - fprintf(fcase, "/"); - c = readchar(FALSE); - if (c == wst) comment = TRUE; - length = wctomb(mb_c, c); - mb_c[length] = 0; - } - break; - case '*': - if (comment) - { - fprintf(fcase, "*"); - c = readchar(FALSE); - if (c == wsl) comment = FALSE; - length = wctomb(mb_c, c); - mb_c[length] = 0; - } - } /* End case */ - } - fprintf(fcase, "%s", mb_c); -#if 0 - if (c == wnl) - fprintf(fcase, "#line %d \"context.dat\"\n", m_line); -#endif - } /* End while */ -} /* End proc getcode() */ - -/* Read the colon separating the two states in a transition pair */ -void getcolon(void) -{ -int c ; /* c is int instead of char for use with ungetc */ -M_WCHAR wcl; -char unexp[32]; /* arbitraily large */ -int length; - -mbtowc(&wcl, ":", 1); - -while (TRUE) - { - c = readchar(FALSE); - if (! m_whitespace((M_WCHAR) c)) break; - } -if (c != wcl) - { - length = wctomb(unexp, (M_WCHAR) c); - unexp[length] = 0; - warning1("Expecting : instead of '%s'\n", unexp); - } -} - -/* Read a context name from an input line */ -int getcontext(void) -{ -M_WCHAR name[CNAMELEN + 1]; -int c ; /* c is int instead of char for use with ungetc */ -int i = 0; -M_WCHAR wsm = 0, wcl, wcm; -char *mb_name; - -if (!wsm) - { - mbtowc(&wsm, ";", 1); - mbtowc(&wcl, ":", 1); - mbtowc(&wcm, ",", 1); - } - -while (TRUE) - { - c = readchar(TRUE); - if (c == EOF) return(NOMORE); - *name = (M_WCHAR) c; - if (*name == wsm) return(NOMORE); - if (! m_whitespace(*name)) break; - } - -while (TRUE) - { - i++; - if (i >= CNAMELEN) - { - while (! m_whitespace((M_WCHAR) (c = readchar(TRUE))) - && c != wcl - && c != wcm - && c != EOF - && c != wsm); - unread(c); - break; - } - c = readchar(TRUE); - if (m_whitespace((M_WCHAR) c) || - c == wsm || - c == wcl || - c == wcm || - c == EOF) - { - unread(c); - break; - } - name[i] = (M_WCHAR) c; - } -name[i] = M_EOS; - -for (i = 0 ; i < ccount ; i++) - if (! w_strcmp(name, contexts[i])) return(i); - -inccon() ; -i = w_strlen(name) + 1; -contexts[ccount - 1] = (M_WCHAR *) m_malloc(i, "context name"); -memcpy(contexts[ccount - 1], name, i * sizeof(M_WCHAR)); - -mb_name = MakeMByteString(name); -fprintf(context, "#define %s %d\n", mb_name, ccount); -m_free(mb_name,"multi-byte string"); - -return(ccount - 1); -} - -/* Read a delimiter name from the input line */ -LOGICAL getdname(void) -{ -int c; -M_WCHAR *p; - -/* Skip leading blanks */ -while (TRUE) - { - c = readchar(TRUE); - if (c == EOF) return(FALSE); - if (! m_whitespace((M_WCHAR) c)) break; - } -for (p = dname; -! m_whitespace((M_WCHAR) c) && c != EOF; -c = readchar(TRUE)) - { - if (p - dname >= DNAMELEN) - { - while (! m_whitespace((M_WCHAR) c) && c != EOF) c = readchar(TRUE); - break; - } - *p++ = (M_WCHAR) c; - } -*p = M_EOS; -if (dstruct = (struct dstruct *) m_lookfortrie(dname, &delimtrie)) - { - withdelim = TRUE; - curdelim = dstruct->count - 1; - } -else - { - char *mb_dname; - - curdelim = dcount; - incdelim(); - withdelim = FALSE; - mb_dname = MakeMByteString(dname); - fprintf(delim, "#define %s %d\n", mb_dname, dcount); - m_free(mb_dname,"multi-byte string"); - } -return(TRUE); -} - -/* Out of context space. Increase. */ -void inccon(void) - { - M_TRIE **newtrie = NULL; - int *newtransit = NULL; - M_WCHAR **newcontexts = NULL; - int trysize; - int i, j; - - if (ccount < NUMCON) { - ccount++; - return; - } - trysize = m_plus10p(NUMCON); - newtrie = (M_TRIE **) calloc(trysize, sizeof(M_TRIE *)); - newtransit = (int *) calloc(trysize * NUMDELIM, sizeof(int)); - newcontexts = (M_WCHAR **) calloc(trysize, sizeof(M_WCHAR *)); - if (! newtrie || ! newtransit || ! newcontexts) { - trysize = NUMCON + 1; - if (newtrie) free((M_POINTER) newtrie); - if (newtransit) free((M_POINTER) newtransit); - if (newcontexts) free((M_POINTER) newcontexts); - newtrie = (M_TRIE **) calloc(trysize, sizeof(M_TRIE *)); - newtransit = (int *) calloc(trysize * NUMDELIM, sizeof(int)); - newcontexts = (M_WCHAR **) calloc(trysize, sizeof(M_WCHAR *)); - } - if (! newtrie || ! newtransit || ! newcontexts) { - m_error("Out of memory for contexts"); - exit(TRUE); - } - for (i = 0 ; i < ccount ; i++) - for (j = 0 ; j < dcount ; j++) - newtransit[i * NUMDELIM + j] = transit(i, j); - NUMCON = trysize; - free((M_POINTER) xtransit); - xtransit = newtransit; - memcpy((M_POINTER) newtrie, (M_POINTER) contree, - ccount * sizeof(M_TRIE **)); - memcpy((M_POINTER) newcontexts, (M_POINTER) contexts, - ccount * sizeof(M_WCHAR **)); - free((M_POINTER) contree); - free((M_POINTER) contexts); - contree = newtrie; - contexts = newcontexts; - ccount++; - } - -/* Increase delimiter space. */ -void incdelim(void) -{ -int *newtransit = NULL; -char **newdlm = NULL; -int trysize; -int i, j; - -if (dcount < NUMDELIM) - { - dcount++; - return; - } - -trysize = m_plus10p(NUMDELIM); -newtransit = (int *) calloc(NUMCON * trysize, sizeof(int)); -if (loading) newdlm = (char **) calloc(trysize, sizeof(M_WCHAR *)); -if (! newtransit || (loading && ! newdlm)) - { - trysize = NUMDELIM + 1; - newtransit = (int *) calloc(NUMCON * trysize, sizeof(int)); - if (loading) newdlm = (char **) calloc(trysize, sizeof(M_WCHAR *)); - } -if (! newtransit || (loading && ! newdlm)) - { - m_error("Out of memory for delimiters"); - exit(TRUE); - } -for (i = 0 ; i < ccount ; i++) -for (j = 0 ; j < dcount ; j++) -newtransit[i * trysize + j] = transit(i, j); -free((M_POINTER) xtransit); -if (loading) - { - memcpy((M_POINTER) newdlm, (M_POINTER) dlmptr, dcount * sizeof(M_TRIE **)); - free((M_POINTER) dlmptr); - dlmptr = newdlm; - } -NUMDELIM = trysize; -xtransit = newtransit; -dcount++; -} - -/* Read delimiter definitions from delim.dat */ -void loaddelim(void) -{ -int c; -M_WCHAR *p; -int i; -M_WCHAR wnl; -char *mb_dname, *mb_dstring; - -mbtowc(&wnl, "\n", 1); - -loading = TRUE; -while ((c = getc(ddat)) != EOF) - { - /* Skip leading white space */ - if (c == wnl) continue; - if (m_whitespace((M_WCHAR) c)) - { - while ((c = getc(ddat)) != wnl) - if (c == EOF) return; - continue; - } - /* Delimiter name into dname */ - for (p = dname ; ! m_whitespace((M_WCHAR) c) ; c = getc(ddat)) - { - if (c == EOF) - { - warning("Unexpected EOF"); - exit(TRUE); - } - if (p - dname >= DNAMELEN) - { - while (! m_whitespace((M_WCHAR) c) && c != EOF) c = getc(ddat); - if (c == EOF) - { - warning("Unexpected EOF"); - exit(TRUE); - } - break; - } - *p++ = m_upper(c); - } - *p = M_EOS; - /* Skip intervening white space */ - while (m_whitespace((M_WCHAR) c) && c != EOF) c = getc(ddat); - if (c == EOF) - { - warning("Unexpected EOF"); - exit(TRUE); - } - /* Delimiter string into dstring */ - for (p = dstring; - ! m_whitespace((M_WCHAR) c) && c != EOF; - c = getc(ddat)) - { - if (p - dstring >= DELIMLEN) - { - m_error("Delimiter string too long"); - exit(TRUE); - } - *p++ = c; - } - *p = M_EOS; - if (w_strlen(dstring) > maxd) maxd = w_strlen(dstring); - /* Write definitions to output file. Save data for later. */ - incdelim(); - dstruct = (struct dstruct *) - m_malloc(sizeof(struct dstruct), "delimiter structure"); - dstruct->string = (M_WCHAR *) m_malloc(w_strlen(dstring) + 1, "delimiter"); - w_strcpy(dstruct->string, dstring); - dstruct->count = dcount; - - mb_dname = MakeMByteString(dname); - fprintf(delim, "#define %s %d\n", mb_dname, dcount); - m_free(mb_dname,"multi-byte string"); - - for (i = 0 ; dname[i] ; i++) - dname[i] = m_lower(dname[i]); - mb_dname = MakeMByteString(dname); - - mb_dstring = MakeMByteString(dstring); - fprintf(delim, - "M_DELIMEXTERN char %s[%d] M_DELIMINIT(\"", - mb_dname, - strlen(mb_dstring) + 1); - - for (p = dstring ; *p ; p++) - { - char *pc; - char mb_p[32]; /* arbitrarily large */ - int length, i; - - length = wctomb(mb_p, *p); - mb_p[length] = 0; - - pc = mb_p; - while (*pc) - { - if (*pc == '"' || *pc == '\\') putc('\\', delim); - putc(*pc, delim); - pc++; - } - } - fputs("\") ;\n", delim); - - dlmptr[dcount - 1] = MakeMByteString(dname); - if (m_ntrtrie(dname, &delimtrie, dstruct)) - m_err1("Duplicate definition of %s", mb_dname); - while (c != wnl) - { - if (c == EOF) break; - c = getc(ddat); - } - m_free(mb_dname,"multi-byte string"); - m_free(mb_dstring,"multi-byte string"); - } -dumpdlmptr(); -loading = FALSE; -} - -/* Output transition matrix */ -void nextcon(LOGICAL sparse) - { - int i, j; - int firstinrow; - - if (sparse) { - for (i = 0 ; i < ccount ; i++) { - for (j = 0 ; j < dcount ; j++) - if (transit(i, j)) nonzero++; - nonzero++; - } - fprintf(delim, - "M_DELIMEXTERN struct {\n %s context ;\n %s nextcon ;\n", - contype, contype); - fprintf(delim, " } m_trnsit [%d]\n", nonzero); - - nonzero = 0; - fprintf(delim, "#if defined(M_DELIMDEF)\n = {\n"); - fprintf(context, "M_CONEXTERN int m_trnsptr[%d]\n", ccount); - fprintf(context, "#if defined(M_CONDEF)\n = {\n"); - for (i = 0 ; i < ccount ; i++) { - firstinrow = 0; - for (j = 0 ; j < dcount ; j++) { - if (! transit(i, j)) continue; - prtctxt(j, transit(i, j)); - if (! firstinrow) firstinrow = nonzero; - } - prtctxt(0, 0); - if (i > 0) fprintf(context, ",\n"); - fprintf(context, " %d", firstinrow); - } - fprintf(delim, endif); - fprintf(context, endif); - } - else { - fprintf(context, - "M_CONEXTERN %s m_nextcon[%d][%d]\n#if defined(M_CONDEF)\n = {\n", - contype, ccount, dcount); - for (i = 0 ; i < ccount ; i++) { - fprintf(context, " {\n"); - for (j = 0 ; j < dcount ; j++) { - fprintf(context, " %d", transit(i, j)); - if (j < dcount - 1) fprintf(context, ",\n"); - } - fprintf(context, "}"); - if (i < ccount - 1) fprintf(context, ","); - fprintf(context, "\n"); - } - fprintf(context, endif); - } - } - -/* If sparse matrix output option, generate a single element of transit - array */ -void prtctxt(column, value) - int column, value; - { - static LOGICAL first = TRUE; - - if (! first) fprintf(delim, ",\n"); - first = FALSE; - fprintf(delim, " %d, %d", column, value); - nonzero++; - } - - -/* Read the next input character */ -int readchar(LOGICAL cap) -{ -int c; -M_WCHAR wnl; - -mbtowc(&wnl, "\n", 1); - -c = mb_getwc(cdat); /* use mb_getwc so we read multi-byte chars */ -if (cap && c != EOF) c = m_upper(c); - -if (c == wnl) m_line++; - -return(c); -} - -/* Called by utility procedure m_error() -- has content in other programs - that use m_error() */ -void skiptoend(void) -{ -} - -/* Return a character to the input stream for re-reading */ -void unread(c) -int c; -{ -M_WCHAR wnl; - -mbtowc(&wnl, "\n", 1); - -ungetc(c, cdat); -if (c == wnl) m_line--; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/dtddef.h b/cde/programs/dthelp/parser.ccdf/htag/util/dtddef.h deleted file mode 100644 index 1b952bd2b..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/dtddef.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: dtddef.h /main/3 1995/11/08 11:37:33 rswiston $ */ -/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */ -/* Dtddef.h contains definitions relevant to document-type -definitions */ - -typedef int M_ELEMENT ; -typedef int M_ARC ; -typedef int M_STATE ; -typedef int M_ANDGROUP ; - -/* Possible element content types */ -#define M_REGEXP 0 -#define M_ANY 1 -#define M_NONE 2 -#define M_CDATA 3 -#define M_RCDATA 4 - -typedef struct{ - int enptr, start, content, inptr, exptr, parptr, parcount, srefptr ; - unsigned int smin : 1, emin : 1, useoradd : 1 ; - } M_ELTSTRUCT ; - -typedef struct { - int paramname, type, kwlist, deftype ; - M_WCHAR *defval ; - } M_PARAMETER ; -/* Possible parameter default types */ -#define M_NAMEDEF 0 -#define M_CURRENT 1 -#define M_REQUIRED 2 -#define M_NULLDEF 3 -#define M_CHANGEDCUR 4 - -/* Possible parameter types */ -#define M_KEYWORD 0 -#define M_ID 1 -#define M_IDRF 2 -#define M_IDRFS 3 -#define M_NAMEPAR 4 -#define M_NAMES 5 -#define M_NMTOKEN 6 -#define M_NMSTOKEN 7 -#define M_NUMBER 8 -#define M_NUMS 9 -#define M_NUTOKEN 10 -#define M_NUSTOKEN 11 -#define M_CDATT 12 -#define M_ENTATT 13 - -typedef struct { - int sref ; - int entity ; - int next ; - } M_SREF ; - -typedef struct { - unsigned final : 1, datacontent : 1 ; - unsigned first : 14 ; - } M_STATESTRUCT ; - -typedef struct { - M_STATE start ; - M_ANDGROUP next ; - } M_ANDSTRUCT ; - -typedef struct { - M_ELEMENT element ; - int next ; - } M_EXCEPTION ; - - -typedef struct { - unsigned label : 15; - unsigned optional : 1; - int minim ; - M_ANDGROUP group ; - M_STATE to ; - M_ARC next ; - } M_ARCSTRUCT ; - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/dtdext.h b/cde/programs/dthelp/parser.ccdf/htag/util/dtdext.h deleted file mode 100644 index c4001ef18..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/dtdext.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: dtdext.h /main/3 1995/11/08 11:37:49 rswiston $ */ -/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */ -/* Dtdext.h contains the dtd-independent external forms of - declarations relevant to document-type definitions. The - definition form of these declarations is contained in files - dtd.h and arc.h generated by BUILD. */ - - -#include "dtddef.h" - -extern M_PTRIE m_entree[] ; - -extern M_WCHAR m_ename[] ; - -extern int m_elcount ; -extern M_ELTSTRUCT m_element[] ; - -extern M_WCHAR m_keyword[] ; - -extern M_WCHAR m_defval[] ; - -extern struct { - int keyword, next ; - } m_ptype[] ; - -extern M_PARAMETER m_parameter[] ; - -extern M_WCHAR m_pname[] ; - -extern M_PTRIE m_maptree[] ; - -extern M_PTRIE m_sreftree[] ; - -extern int m_map[] ; - -extern M_SREF m_sref[] ; - -extern M_STATESTRUCT m_state[] ; - -extern M_ANDSTRUCT m_andgroup[] ; - -extern M_EXCEPTION m_exception[] ; - -extern M_ARCSTRUCT m_arc[] ; - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/emptyfil.c b/cde/programs/dthelp/parser.ccdf/htag/util/emptyfil.c deleted file mode 100644 index 90493d922..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/emptyfil.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: emptyfil.c /main/3 1995/11/08 11:38:06 rswiston $ */ -/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */ -/* Creates a file with nothing in it */ -#include -#include "basic.h" - -void main(int argc, char **argv) - { - if (argc != 2) { - fprintf(stderr, "Usage: emptyfil filename\n") ; - exit(1) ; - } - if (! fopen(argv[1], "w")) - fprintf(stderr, "Unable to open %s\n", argv[1]) ; - return 0; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/entdef.h b/cde/programs/dthelp/parser.ccdf/htag/util/entdef.h deleted file mode 100644 index 2dcf71362..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/entdef.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: entdef.h /main/3 1995/11/08 11:38:21 rswiston $ */ -/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */ -/* Entdef.h contains definitions relevant to entities */ - -#define M_GENERAL 0 -#define M_SYSTEM 1 -#define M_STARTTAG 2 -#define M_ENDTAG 3 -#define M_MD 4 -#define M_MS 5 -#define M_PI 6 -#define M_CDATAENT 7 -#define M_SDATA 8 -#define M_CODEPI 9 -#define M_CODESDATA 10 - -#define M_DBUILD 1 -#define M_DELTDEF 2 -#define M_DPARSER 3 - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/entext.h b/cde/programs/dthelp/parser.ccdf/htag/util/entext.h deleted file mode 100644 index aece9ed52..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/entext.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: entext.h /main/3 1995/11/08 11:38:43 rswiston $ */ -/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */ -/* Entext.h contains the dtd- and interface-independent external -forms of declarations relevant to entity declarations that occur in a -dtd or interface. The definition form of these declarations is -contained in files entity.h generated by BUILD and entity2.h -generated by ELTDEF */ - -#include "entdef.h" -extern M_WCHAR m_entcon[] ; - -extern M_WCHAR m_entname[] ; - -extern M_ENTITY m_entities[] ; - -extern M_TRIE m_enttrie[] ; - -#if defined(ELTEXTERN) -extern int m_entcnt ; -extern M_ENTITY *firstent ; -extern M_ENTITY *lastent ; -#endif diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/entout.c b/cde/programs/dthelp/parser.ccdf/htag/util/entout.c deleted file mode 100644 index dbd8ff38f..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/entout.c +++ /dev/null @@ -1,214 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: entout.c /main/3 1995/11/08 11:38:59 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Entout has procedures to write generated entity TRIE */ - -void entptr(M_ENTITY *data); - -char *typetype(int n); - -char *typewhere(unsigned char n); - -/* Macro names written to output file */ -char xdbuild[] = "M_DBUILD" ; -char xdeltdef[] = "M_DELTDEF" ; -char xgeneral[] = "M_GENERAL" ; -char xsystem[] = "M_SYSTEM" ; -char xstarttag[] = "M_STARTTAG" ; -char xendtag[] = "M_ENDTAG" ; -char xmd[] = "M_MD" ; -char xms[] = "M_MS" ; -char xpi[] = "M_PI" ; -char xcdataent[] = "M_CDATAENT" ; -char xsdata[] = "M_SDATA" ; -char xcodepi[] = "M_CODEPI" ; -char xcodesdata[] = "M_CODESDATA" ; -char xerror[] = "ERROR" ; - -/* Outputs entity definitions */ -#define ENTFILENAME 12 -void entout(fname) - char *fname ; - { - char efilename[ENTFILENAME] ; - int count = 1 ; - M_ENTITY *ent ; - M_WCHAR *p ; - int conindex ; - int nameindex ; - LOGICAL start ; - - strcpy(efilename, fname) ; - strcpy(&efilename[strlen(efilename)], ".h") ; - m_openchk(&entfile, efilename, "w") ; - - fprintf(entfile, "#include \"entdef.h\"\n") ; - fprintf(entfile, "#if defined(M_ENTDEF)\n") ; - fprintf(entfile, "#define M_ENTEXTERN\n") ; - fprintf(entfile, "#define M_ENTINIT(a) = a\n") ; - fprintf(entfile, "#else\n") ; - fprintf(entfile, "#define M_ENTEXTERN extern\n") ; - fprintf(entfile, "#define M_ENTINIT(a)\n") ; - fprintf(entfile, "#endif\n\n") ; - - if (m_entcnt) { - for (ent = firstent, conindex = 0, nameindex = 0 ; - ent ; ent = ent->next) { - if (ent->content) conindex += w_strlen(ent->content) + 1 ; - nameindex += w_strlen(ent->name) + 1 ; - } - fprintf(entfile, "M_ENTEXTERN M_WCHAR m_entcon[%d]\n", - conindex ? conindex : 1) ; - if (conindex) { - fputs("#if defined(M_ENTDEF)\n = {\n", entfile) ; - start = FALSE ; - for (ent = firstent ; ent ; ent = ent->next) - if (ent->content) { - if (start) fputs(",\n", entfile) ; - start = TRUE ; - for (p = ent->content ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; - fputs(" 0", entfile) ; - } - fprintf(entfile, "}\n#endif\n") ; - } - fputs(" ;\n\n", entfile) ; - - fprintf(entfile, "M_ENTEXTERN M_WCHAR m_entname[%d]\n", nameindex) ; - fputs("#if defined(M_ENTDEF)\n = {\n", entfile) ; - for (ent = firstent ; ent ; ent = ent->next) { - for (p = ent->name ; *p ; p++) - fprintf(entfile, " %d,\n", *p) ; - if (ent != lastent) fputs(" 0,\n", entfile) ; - else fputs(" 0\n", entfile) ; - } - fprintf(entfile, "}\n#endif\n ;\n\n") ; - - } - else { - fputs("M_ENTEXTERN M_WCHAR m_entcon[1] ;\n", entfile) ; - fputs("M_ENTEXTERN M_WCHAR m_entname[1] ;\n", entfile) ; - } - - fprintf(entfile, "M_ENTEXTERN M_ENTITY m_entities[%d]\n", - m_entcnt ? m_entcnt : 1) ; - if (m_entcnt) { - fprintf(entfile, "#if defined(M_ENTDEF)\n = {\n") ; - for (ent = firstent, conindex = 0, nameindex = 0 ; - ent ; ent = ent->next) { - fprintf(entfile, " %s, %s, ", - typetype(ent->type), - typewhere(ent->wheredef)) ; - if (ent->content) { - fprintf(entfile, "&m_entcon[%d]", conindex) ; - conindex += w_strlen(ent->content) + 1 ; - } - else fputs(" NULL", entfile) ; - fprintf(entfile, ", &m_entname[%d]", nameindex) ; - nameindex += w_strlen(ent->name) + 1 ; -#if defined(BUILDEXTERN) - fprintf(entfile, ", %d", ent->index) ; - if (ent != lastent) - fprintf(entfile, ", &m_entities[%d], 0", ent->index) ; - else fputs(", NULL, 0", entfile) ; -#else - fprintf(entfile, ", %d", ent->codeindex) ; -#endif - if (ent != lastent) fprintf(entfile, ", \n") ; - else fprintf(entfile, "}\n#endif\n") ; - } - } - fprintf(entfile, " ;\n\n") ; - - if (m_enttrie->data) countdown(m_enttrie, &count) ; - fprintf(entfile, - "M_ENTEXTERN M_TRIE m_enttrie[%d]\n", count) ; - if (m_enttrie->data) { - count = 0 ; - fputs("#if defined(M_ENTDEF)\n = {\n 0, NULL, &m_enttrie[1]", entfile) ; - m_dumptrie(entfile, m_enttrie->data, "m_enttrie", &count, entptr) ; - fprintf(entfile, "}\n#endif\n") ; - } - fprintf(entfile, " ;\n\n") ; -#if defined(BUILDEXTERN) - fprintf(entfile, "M_ENTEXTERN int m_entcnt M_ENTINIT(%d) ;\n", m_entcnt) ; -#endif - -#if defined(BUILDEXTERN) - if (m_entcnt) { - fputs("M_ENTEXTERN M_ENTITY *firstent M_ENTINIT(&m_entities[0]) ;\n", - entfile) ; - fprintf(entfile, - "M_ENTEXTERN M_ENTITY *lastent M_ENTINIT(&m_entities[%d]) ;\n", - m_entcnt - 1) ; - } - else { - fputs("M_ENTEXTERN M_ENTITY *firstent M_ENTINIT(NULL) ;\n", entfile) ; - fputs("M_ENTEXTERN M_ENTITY *lastent M_ENTINIT(NULL) ;\n", entfile) ; - } -#endif - - } /* End entout() */ - -/* Entptr is called by m_dumptrie to output the value stored with a - particular entity in the entity trie */ -void entptr(data) - M_ENTITY *data ; - { - fprintf(entfile, "(M_TRIE *) &m_entities[%d]", data->index - 1) ; - } - -/* Typetype returns a string indicating the type of the nth entity.*/ -char *typetype(n) - int n ; - { - switch(n) { - case M_GENERAL: return(xgeneral) ; - case M_SYSTEM: return(xsystem) ; - case M_STARTTAG: return(xstarttag) ; - case M_ENDTAG: return(xendtag) ; - case M_MD: return(xmd) ; - case M_MS: return(xms) ; - case M_PI: return(xpi) ; - case M_CDATAENT: return(xcdataent) ; - case M_SDATA: return(xsdata) ; - case M_CODEPI: return(xcodepi) ; - case M_CODESDATA: return(xcodesdata) ; - default: return(xerror) ; - } - } - -/* Typewhere returns a string indicating where the nth entity was defined.*/ -char *typewhere(unsigned char n) - { - switch(n) { - case M_DBUILD: return(xdbuild) ; - case M_DELTDEF: return(xdeltdef) ; - case FALSE: return("0") ; - } - } - - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/error.c b/cde/programs/dthelp/parser.ccdf/htag/util/error.c deleted file mode 100644 index 1fa8aba58..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/error.c +++ /dev/null @@ -1,304 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: error.c /main/3 1995/11/08 11:39:17 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Error.c contains procedures for issuing error messages and warnings in - BUILD and ELTDEF */ - -#include -#include "basic.h" - -extern FILE *m_errfile ; -extern int m_line ; -extern LOGICAL errexit ; - -void eprefix(LOGICAL flag); - -void m_errline(char *text); - -void m_error(char *text); - -void m_err1(char *text, const M_WCHAR *arg); - -void m_mberr1(char *text, const char *arg); - -void m_err2(const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2); - -void m_err3(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3); - -void m_err5(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, M_WCHAR *arg4, - M_WCHAR *arg5); - -void esuffix(void); - -void msgline(char *text); - -void msg1line(char *text, char *arg1); - -void skiptoend(void); - -void m_wctrace(M_WCHAR *text); - -void m_trace(char *text); - -void warning(char *text); - -void warning1(char *text, M_WCHAR *arg); - -void warning2(char *text, M_WCHAR *arg1, M_WCHAR *arg2); - -void warning3(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3); - -void warning4(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, M_WCHAR *arg4); - -/* Write error message prefix */ -void eprefix(LOGICAL flag) - { - if (flag) errexit = TRUE ; - fprintf(stderr, "\n**** ") ; - fprintf(m_errfile, "\n**** ") ; - } - -/* Writes part of an error message. Called from m_malloc instead of - m_err1, since PARSER's version of m_err1 calls m_malloc and recursive - calls are possible when the heap is exhausted */ -void m_errline(text) -char *text ; -{ -fputs(text, stderr) ; -fputs(text, m_errfile) ; -} - -/* Writes an error message to standard error and file "error" */ -void m_error(text) - char *text ; - { - eprefix(TRUE) ; - fprintf(stderr,"%s", text) ; - fprintf(m_errfile,"%s", text) ; - esuffix() ; - skiptoend() ; - } - -/* Writes an error message with one argument to standard error and file - "error" */ -void m_err1(char *text, const M_WCHAR *arg) -{ -char *mb_arg; - -mb_arg = MakeMByteString(arg); -eprefix(TRUE) ; -fprintf(stderr, text, mb_arg) ; -fprintf(m_errfile, text, mb_arg) ; -esuffix() ; -skiptoend() ; -m_free(mb_arg,"multi-byte string"); -} - -void m_mberr1(char *text, const char *arg) -{ -eprefix(TRUE) ; -fprintf(stderr, text, arg) ; -fprintf(m_errfile, text, arg) ; -esuffix() ; -skiptoend() ; -} - -/* Writes an error message with two arguments to standard error and file - "error" */ -void m_err2( const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2) -{ -char *mb_arg1, *mb_arg2; - -mb_arg1 = MakeMByteString(arg1); -mb_arg2 = MakeMByteString(arg2); -eprefix(TRUE) ; -fprintf(stderr, text, mb_arg1, mb_arg2) ; -fprintf(m_errfile, text, mb_arg1, mb_arg2) ; -esuffix() ; -skiptoend() ; -m_free(mb_arg1,"multi-byte string"); -m_free(mb_arg2,"multi-byte string"); -} - -/* Writes an error message with three arguments to standard error and file - "error" */ -void m_err3( char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3) -{ -char *mb_arg1, *mb_arg2, *mb_arg3; - -mb_arg1 = MakeMByteString(arg1); -mb_arg2 = MakeMByteString(arg2); -mb_arg3 = MakeMByteString(arg3); -eprefix(TRUE) ; -fprintf(stderr, text, mb_arg1, mb_arg2, mb_arg3) ; -fprintf(m_errfile, text, mb_arg1, mb_arg2, mb_arg3) ; -esuffix() ; -skiptoend() ; -m_free(mb_arg1,"multi-byte string"); -m_free(mb_arg2,"multi-byte string"); -m_free(mb_arg3,"multi-byte string"); -} - -/* Writes an error message with five arguments to standard error and file - "error" */ -void m_err5( char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, - M_WCHAR *arg4, M_WCHAR *arg5) -{ -char *mb_arg1, *mb_arg2, *mb_arg3, *mb_arg4, *mb_arg5; - -mb_arg1 = MakeMByteString(arg1); -mb_arg2 = MakeMByteString(arg2); -mb_arg3 = MakeMByteString(arg3); -mb_arg4 = MakeMByteString(arg4); -mb_arg5 = MakeMByteString(arg5); -fprintf(stderr, text, mb_arg1, mb_arg2, mb_arg3, mb_arg4, mb_arg5) ; -fprintf(m_errfile, text, mb_arg1, mb_arg2, mb_arg3, mb_arg4, mb_arg5) ; -esuffix() ; -skiptoend() ; -m_free(mb_arg1,"multi-byte string"); -m_free(mb_arg2,"multi-byte string"); -m_free(mb_arg3,"multi-byte string"); -m_free(mb_arg4,"multi-byte string"); -m_free(mb_arg5,"multi-byte string"); -} - -/* Write error message suffix */ -void esuffix(void) - { - fprintf(stderr, " (line %d) ****\n", m_line) ; - fprintf(m_errfile, " (line %d) ****\n", m_line) ; - } - -/* Print something to both stderr and m_errfile */ -void msgline(text) - char *text ; - { - fprintf(stderr, text) ; - fprintf(m_errfile, text) ; - } - -/* Print something to both stderr and m_errfile */ -void msg1line(text, arg1) - char *text, *arg1 ; - { - fprintf(stderr, text, arg1) ; - fprintf(m_errfile, text, arg1) ; - } - -/* Trace used for m_malloc trace output */ -void m_trace(text) -char *text ; -{ -m_errline(text) ; -} - -void m_wctrace(text) -M_WCHAR *text ; -{ -char *mb_text; - -mb_text = MakeMByteString(text); -m_trace(mb_text); -m_free(mb_text,"multi-byte string"); -} - -/* Writes a nonfatal error message to standard error and file "error" */ -void warning(text) - char *text ; - { - eprefix(FALSE) ; - fprintf(stderr,"%s", text) ; - fprintf(m_errfile,"%s", text) ; - esuffix() ; - } - -/* Writes a nonfatal error message with one argument to standard error - and file "error" */ -void warning1( char *text, M_WCHAR *arg) -{ -char *mb_arg; - -mb_arg = MakeMByteString(arg); -eprefix(FALSE) ; -fprintf(stderr, text, mb_arg) ; -fprintf(m_errfile, text, mb_arg) ; -esuffix() ; -m_free(mb_arg,"multi-byte string"); -} - -/* Writes a nonfatal error message with two arguments to standard error - and file "error" */ -void warning2(char *text, M_WCHAR *arg1, M_WCHAR *arg2) -{ -char *mb_arg1, *mb_arg2; - -mb_arg1 = MakeMByteString(arg1); -mb_arg2 = MakeMByteString(arg2); -eprefix(FALSE) ; -fprintf(stderr, text, mb_arg1, mb_arg2) ; -fprintf(m_errfile, text, mb_arg1, mb_arg2) ; -esuffix() ; -m_free(mb_arg1,"multi-byte string"); -m_free(mb_arg2,"multi-byte string"); -} - -/* Writes a nonfatal error message with three arguments to standard error - and file "error" */ -void warning3(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3) -{ -char *mb_arg1, *mb_arg2, *mb_arg3; - -mb_arg1 = MakeMByteString(arg1); -mb_arg2 = MakeMByteString(arg2); -mb_arg3 = MakeMByteString(arg3); -eprefix(FALSE) ; -fprintf(stderr, text, mb_arg1, mb_arg2, mb_arg3) ; -fprintf(m_errfile, text, mb_arg1, mb_arg2, mb_arg3) ; -esuffix() ; -m_free(mb_arg1,"multi-byte string"); -m_free(mb_arg2,"multi-byte string"); -m_free(mb_arg3,"multi-byte string"); -} - -/* Writes a nonfatal error message with four arguments to standard error - and file "error" */ -void warning4(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, - M_WCHAR *arg4) -{ -char *mb_arg1, *mb_arg2, *mb_arg3, *mb_arg4; - -mb_arg1 = MakeMByteString(arg1); -mb_arg2 = MakeMByteString(arg2); -mb_arg3 = MakeMByteString(arg3); -mb_arg4 = MakeMByteString(arg4); -eprefix(FALSE) ; -fprintf(stderr, text, mb_arg1, mb_arg2, mb_arg3, mb_arg4) ; -fprintf(m_errfile, text, mb_arg1, mb_arg2, mb_arg3, mb_arg4) ; -esuffix() ; -m_free(mb_arg1,"multi-byte string"); -m_free(mb_arg2,"multi-byte string"); -m_free(mb_arg3,"multi-byte string"); -m_free(mb_arg4,"multi-byte string"); -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/exit.c b/cde/programs/dthelp/parser.ccdf/htag/util/exit.c deleted file mode 100644 index 2fb2dc435..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/exit.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: exit.c /main/3 1995/11/08 11:39:33 rswiston $ */ -/* -Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include "basic.h" - -void m_exit(int status); - -/* Exit function called by utilities used in PARSER and other programs in - the MARKUP system */ -void m_exit(status) - int status ; - { - exit(status) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/fclndir.c b/cde/programs/dthelp/parser.ccdf/htag/util/fclndir.c deleted file mode 100644 index 77a4e8078..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/fclndir.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: fclndir.c /main/3 1995/11/08 11:39:49 rswiston $ */ -/* Copyright (c) 1987-1990 Hewlett-Packard Co. - -Fclndir.c compares two files, ignoring C line directives that appear -within them as well as blank lines, and leading white space. It exits -with an error code of 0 if the files are the same, 1 if they differ, and -2 if the program was called incorrectly. -*/ - -/* Feb. 11, 1991, CED: Added v2 fixes to v3 version of fclndir. - Thus, both versions now copy the source file to the target if - the files differ. -*/ - -#include -#include -#include -#include "basic.h" -#define SAME 0 -/* different defined to be 0 as of 12-1-89, because fclndir now does -the file-copy if the files are different, or if the second file -doesn't exist. (different used to be 1.) --ced */ -#define DIFFERENT 0 -#define ERROR 2 - -struct data { - int c ; - LOGICAL linestart ; - char *p ; - char *q ; - } data1, data2 ; - -char linedir[] = "#line" ; -char *p = linedir, *q = linedir + 1 ; - -void main(int argc, char **argv); - -void copyfile(char *pfile1, char *pfile2); - -int nextchar(FILE *file, struct data *data); - -void main(argc, argv) - int argc ; - char **argv ; - { - FILE *one, *two ; - int c1, c2 ; - - if (argc != 3) { - fputs("Usage: fclndir file1 (=source) file2 (=target)\n", stderr) ; - exit(ERROR) ; - } - if (! (one = fopen(argv[1], "r"))) { - fprintf(stderr, "ERROR: source file unavailable: %s\n", argv[1]) ; - exit(ERROR) ; - } - if (! (two = fopen(argv[2], "r"))) { - fprintf(stderr, "No target file %s; copying source file...\n", argv[2]) ; - /* call to copyfile entered by ced, 12-29-89. */ - copyfile(argv[1],argv[2]); - exit(DIFFERENT) ; - } - data1.linestart = data2.linestart = TRUE ; - data1.p = data2.p = linedir ; - data1.q = data2.q = linedir + 1 ; - c1 = nextchar(one, &data1) ; - c2 = nextchar(two, &data2) ; - while (c1 != EOF && c2 != EOF) { - if (c1 != c2) { - fprintf(stderr, "%s and %s are different; copying source...\n", - argv[1], argv[2]) ; -/* call to copyfile entered by ced, 12-1-89. */ - copyfile(argv[1],argv[2]); - exit(DIFFERENT) ; - } - c1 = nextchar(one, &data1) ; - c2 = nextchar(two, &data2) ; - } - if (c1 != c2) { - fprintf(stderr, "%s and %s are different; copying source...\n", - argv[1], argv[2]) ; -/* call to copyfile entered by ced, 12-1-89. */ - copyfile(argv[1],argv[2]); - exit(DIFFERENT) ; - } - fprintf(stderr, "%s and %s are the same\n", argv[1], argv[2]) ; - exit(SAME) ; - } - -/* copyfile inserted by ced, 12-1-89. */ -void copyfile(pfile1,pfile2) - char *pfile1, *pfile2; -{ - int ret; - char *pcmd; - -/* malloc space for the system command: two filenames, plus a command, - spaces, and the terminating null */ - pcmd = (char *) malloc(strlen(pfile1) + strlen(pfile2) + 8); - ret = sprintf(pcmd,"cp %s %s",pfile1,pfile2); - ret = system(pcmd); - ret = sprintf(pcmd,"touch %s",pfile2); - ret = system(pcmd); -} - -int nextchar(file, data) - FILE *file ; - struct data *data ; - { - while (data->linestart) { - data->linestart = FALSE ; - for (data->p = linedir ; *data->p; data->p++) - if ((data->c = getc(file)) != (int) *data->p) break ; - /* Found a line directive, skip remainder of line */ - if (! *data->p) { - data->c = getc(file) ; - while (data->c != '\n' && data->c != EOF) - data->c = getc(file) ; - data->linestart = TRUE ; - continue ; - } - /* Check for leading blanks */ - else if (data->p == linedir) { - while (data->c == ' ' || data->c == '\t') data->c = getc(file) ; - if (data->c == '\n') { - data->linestart = TRUE ; - continue ; - } - return(data->c) ; - } - /* Line began with a prefix of #line */ - data->q = linedir ; - } - - if (data->q < data->p) return(*data->q++) ; - else if (data->q++ != data->p) data->c = getc(file) ; - if (data->c == '\n') data->linestart = TRUE ; - return(data->c) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/inctest.c b/cde/programs/dthelp/parser.ccdf/htag/util/inctest.c deleted file mode 100644 index f2dbba3ee..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/inctest.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: inctest.c /main/3 1995/11/08 11:40:05 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include "basic.h" - -void m_err1(const char *text, const char *arg); - -void m_exit(int status); - -void m_inctest(int *count, int limit, char *message); - -/* Increment a count and test against a limit */ -void m_inctest(count, limit, message) - int *count ; - int limit ; - char *message ; - { - if (++*count <= limit) return ; - m_err1("Internal error: %s exceeded", message) ; - m_exit(TRUE) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/initct.c b/cde/programs/dthelp/parser.ccdf/htag/util/initct.c deleted file mode 100644 index 711df37ee..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/initct.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: initct.c /main/3 1995/11/08 11:40:22 rswiston $ */ -/* Copyright (c) 1987, 1988 Hewlett-Packard Co. */ -/* M_initctype initializes the array used to indicate which ASCII - characters can appear within SGML names */ - -#include "basic.h" -#include "common.h" -extern char m_chartype[M_CHARSETLEN] ; - -void m_initctype(void); - -void m_initctype(void) - { - int i ; - -/* ****************************** NOTE: ********************************** - If the set of name characters is ever modified, make appropriate changes - in ELTDEF's scanner for testing for valid C identifiers as parameter - names */ - for (i = 0 ; i < M_CHARSETLEN ; i++) m_chartype[i] = M_NONNAME ; - for (i = 'A' ; i <= 'Z' ; i++) m_chartype[i] = M_NMSTART ; - for (i = 'a' ; i <= 'z' ; i++) m_chartype[i] = M_NMSTART ; - for (i = '0' ; i <= '9' ; i++) m_chartype[i] = M_DIGIT ; - m_chartype['.'] = m_chartype['-'] = M_NAMECHAR ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/itoa.c b/cde/programs/dthelp/parser.ccdf/htag/util/itoa.c deleted file mode 100644 index 1d61bd563..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/itoa.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: itoa.c /main/3 1995/11/08 11:40:38 rswiston $ */ -/* From example in Kernighan and Ritchie, The C Programming Language, - Prentice-Hall, 1978 */ - -#include -#include "basic.h" - -char *m_itoa(int n, char *s); - -void reverse(char *s); - -char *m_itoa(n, s) /* convert n to characters in s */ -char s[]; -int n; -{ - int sign ; - char *p = s ; - - if ( (sign = n) < 0 ) /* record sign */ - n = -n; - do { /* generate digits in reverse order */ - *p++ = (char) (n % 10 + '0') ; - } while (( n/= 10) > 0); - if (sign < 0) - *p++ = '-'; - *p = '\0'; - - reverse(s); - return(s) ; -} - -void reverse(s) -char s[]; -{ - int c, i, j; - - for (i=0, j=strlen(s)-1; i < j ; i++, j--) { - c = s[i]; - s[i] = s[j]; - s[j] = (char) c; - } -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/letter.c b/cde/programs/dthelp/parser.ccdf/htag/util/letter.c deleted file mode 100644 index b83617197..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/letter.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: letter.c /main/3 1995/11/08 11:40:55 rswiston $ */ -/* Copyright 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Tests whether a character is a letter */ - -#include "basic.h" - -LOGICAL m_letter(M_WCHAR c) -{ -if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) return(TRUE) ; -return(FALSE) ; -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/lower.c b/cde/programs/dthelp/parser.ccdf/htag/util/lower.c deleted file mode 100644 index d6eaaf291..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/lower.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: lower.c /main/3 1995/11/08 11:41:12 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include "basic.h" - -/* Force a letter to lowercase */ -int m_lower(int c) - { - if (c >= 'A' && c <= 'Z') c += 'a' - 'A' ; - return(c) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/malloc.c b/cde/programs/dthelp/parser.ccdf/htag/util/malloc.c deleted file mode 100644 index 7e99cd3bc..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/malloc.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: malloc.c /main/3 1995/11/08 11:41:28 rswiston $ */ -/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */ - -/* Interfaces to free and malloc with optional debugging traces */ - -/**/ -#include -#include -#include "basic.h" - -extern LOGICAL m_heapchk ; -extern LOGICAL m_malftrace ; - -void m_errline(char *text); - -void m_exit(int status); - -void m_free(void *block, char *msg); - -void m_heapdump(void); - -void *m_malloc(int size, char *msg); - -void *m_realloc(void *ptr, int size, char *msg); - -void *m_trace(char *text); - -void *m_wctrace(M_WCHAR *text); - -void m_free(block, msg) - void *block ; - char *msg ; - { - char buffer[32] ; - - if (m_malftrace) { -#if defined(hpux) || defined(_AIX) || defined(sun) - sprintf(buffer, "%5x:%5x", - (unsigned int) ((unsigned long) block >> 16), - (unsigned int) block, msg) ; -#else - sprintf(buffer, " %9p", block, msg) ; -#endif - m_trace(buffer) ; - m_trace("- Freed ") ; - m_trace(msg) ; - m_trace("\n") ; - } - free(block) ; - } - -void *m_malloc(size, msg) - int size ; - char *msg ; - { - char buffer[32] ; - void *p ; - - size *= sizeof(M_WCHAR); - if (! size) return(NULL) ; - p = (void *) malloc(size) ; - if (! p) { - m_errline("Unable to allocate space for ") ; - m_errline(msg) ; - m_errline("\n") ; - m_exit(TRUE) ; - } - if (m_malftrace) { -#if defined(hpux) || defined(_AIX) || defined(sun) - sprintf(buffer, "%5x:%5x", - (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; -#else - sprintf(buffer, " %9p", p) ; -#endif - m_trace(buffer) ; - m_trace("- Allocated ") ; - sprintf(buffer, "%6d", size) ; - m_trace(buffer) ; - m_trace(" bytes for ") ; - m_trace(msg) ; - m_trace("\n") ; - } - return(p) ; - } - -void *m_realloc(ptr, size, msg) - void *ptr ; - int size ; - char *msg ; - { - char buffer[32] ; - void *p ; - - size *= sizeof(M_WCHAR); - if (! size) return(NULL) ; - p = (void *) realloc(ptr, size) ; - if (! p) { - m_errline("Unable to re-allocate space for ") ; - m_errline(msg) ; - m_errline("\n") ; - m_exit(TRUE) ; - } - if (m_malftrace) { -#if defined(hpux) || defined(_AIX) || defined(sun) - sprintf(buffer, "%5x:%5x", - (unsigned int) ((unsigned long) p >> 16), (unsigned int) p) ; -#else - sprintf(buffer, " %9p", p) ; -#endif - m_trace(buffer) ; - m_trace("- Re-allocated ") ; - sprintf(buffer, "%6d", size) ; - m_trace(buffer) ; - m_trace(" bytes for ") ; - m_trace(msg) ; - m_trace("\n") ; - } - return(p) ; - } - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/openchk.c b/cde/programs/dthelp/parser.ccdf/htag/util/openchk.c deleted file mode 100644 index 327b205db..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/openchk.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: openchk.c /main/3 1995/11/08 11:41:47 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" - -extern FILE *m_errfile ; - -void m_exit(int status); - -void m_openchk(FILE **ptr, char *name, char *mode); - -/* Open a file and check that the open succeeded */ -void m_openchk(FILE **ptrm, char *name, char *mode) - { - *ptr = fopen(name, mode) ; - if (*ptr) return ; - fprintf(stderr, "Unable to open %s\n", name) ; - if (m_errfile) fprintf(m_errfile, "Unable to open %s\n", name) ; - m_exit(TRUE) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/paramu.c b/cde/programs/dthelp/parser.ccdf/htag/util/paramu.c deleted file mode 100644 index 1f3c2fbb9..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/paramu.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: paramu.c /main/3 1995/11/08 11:42:02 rswiston $ */ -/* - Copyright 1986 Tandem Computers Incorporated. -This product and information is proprietary of Tandem Computers Incorporated. - Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Paramu.c contains functions for programs ELTDEF and PARSER - relevant to checking parameter values. */ - -/* Check to see if string is a valid value for parameter par. If so - return a pointer to the keyword if it's a keyword parameter and otherwise - a pointer to string. If not valid, return FALSE. */ -const M_WCHAR *m_partype(const int par , const M_WCHAR *string ) - { - LOGICAL first = TRUE ; - int kw ; - const M_WCHAR *p = string ; - int len ; - - if (m_parameter[par - 1].type == M_KEYWORD) { - for (kw = m_parameter[par - 1].kwlist ; kw ; kw = m_ptype[kw - 1].next) - if (! m_wcupstrcmp(&m_keyword[m_ptype[kw - 1].keyword], string)) - return(&m_keyword[m_ptype[kw - 1].keyword]) ; - return(FALSE) ; - } - if (m_parameter[par - 1].type == M_CDATT) return(string) ; - if (! *string) return(FALSE) ; - if (m_allwhite(string)) return(FALSE) ; - len = 0 ; - for ( ; *p ; p++) - switch (m_cttype(*p)) { - case M_NONNAME: - switch (m_parameter[par - 1].type) { - case M_ID: - case M_IDRF: - case M_NAMEPAR: - case M_NMTOKEN: - case M_NUMBER: - case M_NUTOKEN: - case M_ENTATT: - return(FALSE) ; - default: - len = 0 ; - if (! m_whitespace(*p)) return(FALSE) ; - } - first = TRUE ; - break ; - case M_NMSTART: - len++ ; - if (len > M_NAMELEN) return(FALSE) ; - if (m_parameter[par - 1].type == M_NUMBER || - m_parameter[par - 1].type == M_NUMS) return(FALSE) ; - first = FALSE ; - break ; - case M_NAMECHAR: - len++ ; - if (len > M_NAMELEN) return(FALSE) ; - switch (m_parameter[par - 1].type) { - case M_ID: - case M_IDRF: - case M_IDRFS: - case M_NAMEPAR: - case M_NAMES: - case M_ENTATT: - if (first) return(FALSE) ; - break ; - case M_NMTOKEN: - case M_NMSTOKEN: - break ; - case M_NUMBER: - case M_NUMS: - return(FALSE) ; - case M_NUTOKEN: - case M_NUSTOKEN: - if (first) return(FALSE) ; - break ; - default: - m_error("Undefined parameter type") ; - m_exit(TRUE) ; - } - break ; - case M_DIGIT: - len++ ; - if (len > M_NAMELEN) return(FALSE) ; - switch (m_parameter[par - 1].type) { - case M_ID: - case M_IDRF: - case M_IDRFS: - case M_NAMEPAR: - case M_NAMES: - case M_ENTATT: - if (first) return(FALSE) ; - break ; - case M_NUMBER: - case M_NUMS: - break ; - case M_NMTOKEN: - case M_NMSTOKEN: - case M_NUTOKEN: - case M_NUSTOKEN: - first = FALSE ; - break ; - default: - m_error("Undefined parameter type") ; - m_exit(TRUE) ; - } - break ; - default: - m_error("Undefined character type") ; - m_exit(TRUE) ; - } - if (m_parameter[par - 1].type == M_ENTATT) { - if ((M_ENTITY *) m_lookfortrie(string, m_enttrie)) - return(string) ; - else return(FALSE) ; - } - return(string) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/scanutil.c b/cde/programs/dthelp/parser.ccdf/htag/util/scanutil.c deleted file mode 100644 index d916765c2..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/scanutil.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: scanutil.c /main/3 1995/11/08 11:42:16 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Scanutil.c contains procedures used in the scanners of BUILD and ELTDEF */ - -extern FILE *ifile; - -/* Getachar returns the next character from the input stream */ -int getachar(void) -{ -int c; -M_WCHAR wc,wnl; -char mbyte[32]; /* bigger than any possible multibyte char */ -int length; - -if (toundo) wc = (M_WCHAR) savechar[--toundo]; -else - { - length = 0; - if ((c = getc(ifile)) == EOF) return(EOF); - while (1) - { - mbyte[length++] = c; - mbyte[length] = 0; - if (mblen(mbyte,length) != -1) break; /* hurray! */ - if (length == MB_CUR_MAX) - { /* reached max without a hit */ - m_error("An invalid multi-byte character was found in the input"); - c = ' '; - length = 1; - break; - } - if ((c = getc(ifile)) == EOF) - { /* huh? */ - m_error("End-of-file found in within a multi-byte character"); - return(EOF); - } - } - mbtowc(&wc,mbyte,length); - } - -mbtowc(&wnl, "\n", 1); -if (wc == wnl) m_line++; - -if (wc == 65535) - return -1; - -return((int) wc); -} - -/* Reads the next token stored in a packed trie (as defined by context.dat) */ -int gettoken(c, context) -int *c; -int context; -{ -int hold[MAXD + 1]; -int ucase; -int i, n = 0, current, delim[MAXD + 1]; - -if (! (current = m_contree[context - 1])) - { - *c = getachar(); - return(M_NULLVAL); - } -current--; -while (TRUE) - { - hold[n] = getachar(); - ucase = m_ctupper(hold[n]); - delim[n] = FALSE; - for (i = current; - (int) m_delimtrie[i].symbol < ucase && m_delimtrie[i].more; - i++); - if ((int) m_delimtrie[i].symbol == ucase) - { - current = m_delimtrie[i].index; - if (! m_delimtrie[current].symbol) - delim[n] = m_delimtrie[current].index; - n++; - } - else break; - } -while (n >= 0) - { - if (delim[n]) - { - /* Found a delimiter. If it ends with a letter, verify - that the following character is not a letter, in order - to issue error messages in cases such as M_LITLEN) - { - m_error("Literal too long"); - return(FALSE); - } - while (*p) literal[i++] = *p++; - m_free(pStart,"wide character string"); - i--; - break; - case CRO: - number = 0; - while (! (n = gettoken(&c, CHARENT))) - { - if (c <= '0' || c >= '9') - { - ungetachar(c); - break; - } - number = 10 * number + c - '0'; - if (number >= M_CHARSETLEN) - { - m_error("Invalid character code"); - return(FALSE); - } - } - literal[i] = (M_WCHAR) number; - break; - case LITRS: - case LITRSC: -#if defined(BUILDEXTERN) - if (curcon == SREF || curcon == S2REF) - literal[i] = RS; - else -#endif - i--; - break; - case LITRE: - case LITREC: - literal[i] = M_RE; - break; - case LITTAB: - case LITTABC: - literal[i] = M_TAB; - break; - case LITSPACE: - case LITCSPACE: - literal[i] = M_SPACE; - break; - default: - if (c == EOF) - { - m_error("End of File occurred within literal"); - return(FALSE); - } - literal[i] = (M_WCHAR) c; - break; - } /* End switch */ - } /* End for i */ -n = gettoken(&c, LITCON); -if (n == delim) - { - literal[M_LITLEN + 1] = M_EOS; - return(TRUE); - } -if (n) undodelim(m_dlmptr[n - 1]) ; -else ungetachar(c); -m_error("Literal too long"); -return(FALSE); -} - -/* Returns a context-dependent delimiter string to input stream so - characters can be reread one at a time in another context */ -void undodelim(delim) -M_WCHAR *delim; -{ -M_WCHAR *p; - -for (p = delim ; *p ; p++); - -p--; -while (TRUE) - { - ungetachar(*p); - if (p == delim) return; - p--; - } -} - -/* Returns a character to the input stream to read again later. Unexplained - problems occurred using standard ungetc procedure; hence - explicit declaration of buffer for read-ahead characters */ -void ungetachar(c) -int c; -{ -M_WCHAR wnl; - -if (toundo >= SAVECHAR) - { - m_error("Exceeded read-ahead buffer"); - exit(TRUE); - } -savechar[toundo++] = c; -if (toundo > maxundo) maxundo = toundo; - -mbtowc(&wnl, "\n", 1); -if (c == wnl) m_line--; -} - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/sparse.c b/cde/programs/dthelp/parser.ccdf/htag/util/sparse.c deleted file mode 100644 index f9443cace..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/sparse.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: sparse.c /main/3 1995/11/08 11:42:35 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ -/* Sparse.c has a procedure used with the tables generated by program - CONTEXT when the sparse option is used */ - -int m_sprscon(i, j) - int i, j ; - { - int k ; - - for (k = m_trnsptr[i] ; k ; k++) { - if ((int) m_trnsit[k - 1].context > j) return(0) ; - if (! m_trnsit[k - 1].context) return(0) ; - if ((int) m_trnsit[k - 1].context == j) - return(m_trnsit[k - 1].nextcon) ; - } - return(0) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/sparse.h b/cde/programs/dthelp/parser.ccdf/htag/util/sparse.h deleted file mode 100644 index 1879916fe..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/sparse.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: sparse.h /main/3 1995/11/08 11:42:50 rswiston $ */ -/* Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Sparse.h contains definitions which allow selection of the sparse - matrix output option of CONTEXT */ - -#if defined(sparse) -#define m_newcon(i, j) m_sprscon(i, j) - -int m_sprscon(int i, int j); - -#else -#define m_newcon(i, j) m_nextcon[i][j] -#endif - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/sref.h b/cde/programs/dthelp/parser.ccdf/htag/util/sref.h deleted file mode 100644 index 78dfb3fcf..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/sref.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: sref.h /main/3 1995/11/08 11:43:06 rswiston $ */ -/* Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Sref.h contains declarations for short references relevant to more than - one program */ - - -#define BLANKSEQ 'B' -#define RS 'S' -#define WSSEQ 'W' diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/strstr.c b/cde/programs/dthelp/parser.ccdf/htag/util/strstr.c deleted file mode 100644 index 00ac9d9b1..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/strstr.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: strstr.c /main/3 1995/11/08 11:43:21 rswiston $ */ -char *strstr ( s1, s2 ) -char *s1, *s2 ; { - - int x, y ; - - y = strlen ( s2 ) ; - x = strlen ( s1 ) - y ; - - if ( x < 0 ) return ( ( char * ) 0L ) ; - do { - if ( strncmp ( s1 + x, s2, y ) == 0 ) return ( s1 + x ) ; - } - while ( --x >= 0 ) ; - - return ( ( char * ) 0L ) ; - } - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/trie.c b/cde/programs/dthelp/parser.ccdf/htag/util/trie.c deleted file mode 100644 index 16ae146b7..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/trie.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: trie.c /main/3 1995/11/08 11:43:36 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Trie.c contains procedures for maintaining the tree structure - used to store element names, delimiter strings, short reference strings, - etc. */ - -#include - -#include "basic.h" -#include "common.h" -#include "trie.h" - -extern int m_line ; - -extern FILE *m_errfile ; - -extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ; - -void *m_malloc(int size, char *msg); - -void m_entercharintrie(M_TRIE **currentnode, M_WCHAR c); - -/* Enters the next character of a string into a trie */ -void m_entercharintrie(M_TRIE **currentnode, M_WCHAR c) - { - M_TRIE *newnode ; - - if (! (*currentnode)->data) { - (*currentnode)->data = m_gettrienode() ; - *currentnode = (*currentnode)->data ; - (*currentnode)->next = M_NULLVAL ; - (*currentnode)->symbol = c ; - (*currentnode)->data = M_NULLVAL ; - } /* end insert a son */ - else if ((*currentnode)->data->symbol > c) { - newnode = m_gettrienode() ; - newnode->next = (*currentnode)->data ; - (*currentnode)->data = newnode ; - *currentnode = (*currentnode)->data ; - (*currentnode)->symbol = c ; - (*currentnode)->data = M_NULLVAL ; - } /* end insert before first son */ - else { - for (*currentnode = (*currentnode)->data ; - (*currentnode)->next &&(*currentnode)->next->symbol <= c; - *currentnode = (*currentnode)->next ) ; - if ((*currentnode)->symbol != c) { - newnode = m_gettrienode() ; - newnode->next = (*currentnode)->next ; - (*currentnode)->next = newnode ; - *currentnode = (*currentnode)->next ; - (*currentnode)->symbol = c ; - (*currentnode)->data = M_NULLVAL ; - } /* end insert node in descendant list */ - } /* end check descendant list */ - } /* end entertree */ - -/* Gets a new node for a trie */ -M_TRIE *m_gettrienode(void) - { - M_TRIE *new ; - - new = (M_TRIE *) m_malloc(sizeof(M_TRIE), "trie") ; - new->symbol = 0 ; - new->next = new->data = NULL ; - return(new) ; - } /*end m_gettrienode */ - - -/* M_lookfortrie(p, xtrie) looks for string p in the specified trie, - returning its data value if found and otherwise FALSE */ -void *m_lookfortrie( const M_WCHAR *p , const M_TRIE *xtrie ) - { - M_TRIE *currentnode ; - - currentnode = xtrie->data ; - while (TRUE) { - if (! currentnode) return(NULL) ; - if (currentnode->symbol == m_ctupper(*p)) - if (! *p) return((void *) currentnode->data) ; - else { - p++ ; - currentnode = currentnode->data ; - continue ; - } - else if (currentnode->symbol < *p) { - currentnode = currentnode->next ; - continue ; - } - else return(NULL) ; - } - } - -/* Enters a string and associated data value into a trie */ -void *m_ntrtrie(M_WCHAR *p, M_TRIE *xtrie, void *dataval) - { - M_TRIE *currentnode ; - void *n ; - - if (n = m_lookfortrie(p, xtrie)) return(n) ; - currentnode = xtrie ; - for ( ; *p ; p++) - m_entercharintrie(¤tnode, m_ctupper(*p)) ; - m_entercharintrie(¤tnode, M_EOS) ; - currentnode->data = (M_TRIE *) dataval ; - return(NULL) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/trie.h b/cde/programs/dthelp/parser.ccdf/htag/util/trie.h deleted file mode 100644 index f33c9e988..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/trie.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: trie.h /main/3 1995/11/08 11:43:53 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Trie.h contains definitions relating to trees used to store - element names, delimiter strings, short reference strings, etc. */ - -/* The data structure described here is not a true trie as described - in Knuth, Vol. 3. These functions represent entries by a tree - structure in which there is one level of subnode for each letter - in an entry. In a trie, subnodes are not needed as soon as a - unique prefix has been encountered. */ - -typedef struct m_trie M_TRIE ; - -typedef struct m_ptrie M_PTRIE ; - -struct m_trie { - M_WCHAR symbol ; - M_TRIE *next ; - M_TRIE *data ; - } ; - -struct m_ptrie { - LOGICAL more ; - M_WCHAR symbol ; - int index ; - } ; - - -M_TRIE *m_gettrienode(void); - -void *m_lookfortrie(const M_WCHAR *p, const M_TRIE *xtrie); - -void *m_ntrtrie(M_WCHAR *p, M_TRIE *xtrie, void *dataval); - -void *m_resettrie(M_TRIE *xtrie, M_WCHAR *p, void *value); diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/triecnt.c b/cde/programs/dthelp/parser.ccdf/htag/util/triecnt.c deleted file mode 100644 index d19c476d4..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/triecnt.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: triecnt.c /main/3 1995/11/08 11:44:12 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Triecnt.c contains procedures for writing out a trie structure */ - -#include -#include "basic.h" -#include "trie.h" - -void countdown(M_TRIE *parent, int *count); - -void dumpnode(LOGICAL *first, FILE *file, M_TRIE *trieptr, int *count, - void (*proc)(FILE *file, void *value)); - -void printval(FILE *file, void *value); - -/* Count the descendants of a node in order to generate declarations for - the packed form of a trie*/ -void countdown(parent, count) - M_TRIE *parent ; - int *count ; - { - M_TRIE *child ; - - for (child = parent->data ; child ; child = child->next) { - (*count)++ ; - if (child->symbol) countdown(child, count) ; - } - } - -/* Output descendants of a node for the declaration of a trie, in packed - or normal format*/ -void dumpnode(first, file, trieptr, count, proc) - LOGICAL *first ; - FILE *file ; - M_TRIE *trieptr ; - int *count ; - void (*proc) (FILE *file, void *value); - { - M_TRIE *p ; - int savecount ; - - for (p = trieptr->data ; p ; p = p->next) (*count)++ ; - savecount = *count ; - - for (p = trieptr->data ; p ; p = p->next) { - /* generate a child */ - if (*first) *first = FALSE ; - else fprintf(file, ",\n") ; - fprintf(file, " ") ; - if (p->next) fprintf(file, "TRUE, ") ; - else fprintf(file, "FALSE, ") ; - fprintf(file, "%d", p->symbol) ; - if (p->symbol) fprintf(file, ", %d", *count) ; - else (*proc)(file, p->data) ; - - /* count the children of the child*/ - if (p->symbol) countdown(p, count) ; - } - - *count = savecount ; - for (p = trieptr->data ; p ; p = p->next) - if (p->symbol) dumpnode(first, file, p, count, proc) ; - } - - -/* Most common procedure passed to dumpptrie */ -void printval(file, value) - FILE *file ; - void *value ; - { - fprintf(file, ", %d", (int) value) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/triedump.c b/cde/programs/dthelp/parser.ccdf/htag/util/triedump.c deleted file mode 100644 index b34d480d4..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/triedump.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: triedump.c /main/3 1995/11/08 11:44:26 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" - -void countdown(M_TRIE *parent, int *count); - -void m_dumptrie(FILE *file, M_TRIE *xtrie, char *extname, int *count, - void (*proc)(void *value)); - -/* Write the C declaration of a trie */ -void m_dumptrie(file, xtrie, extname, count, proc) - FILE *file ; - M_TRIE *xtrie ; - char *extname ; - int *count ; - void (*proc)(void *value); - { - int firstson ; - M_TRIE *p ; - - firstson = *count + 1 ; - for (p = xtrie ; p ; p = p->next) firstson++ ; - - for (p = xtrie ; p ; p = p->next) { - (*count)++ ; - fprintf(file, ",\n %d, ", p-> symbol) ; - if (p->next) fprintf(file, "&%s[%d], ", extname, *count + 1) ; - else fputs("NULL, ", file) ; - if (p->symbol) { - fprintf(file, "&%s[%d]", extname, firstson) ; - countdown(p, &firstson) ; - } - else (*proc) (p->data) ; - } - - for (p = xtrie ; p ; p = p->next) - if (p->symbol) - m_dumptrie(file, p->data, extname, count, proc) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/triepdmp.c b/cde/programs/dthelp/parser.ccdf/htag/util/triepdmp.c deleted file mode 100644 index 8d96d9c58..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/triepdmp.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: triepdmp.c /main/3 1995/11/08 11:44:48 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "trie.h" - -void countdown(M_TRIE *parent, int *count); - -void dumpnode(LOGICAL *first, FILE *file, M_TRIE *trieptr, int *count, - void (*proc)(FILE *file, void *value)); - -void dumpptrie(M_TRIE *intname, char *extname, FILE *file, char *externdef, char *defdef, - void (*proc)(FILE *file, void *value)); - -/* Write the declaration of a packed trie to the specified files */ -void dumpptrie(intname, extname, file, externdef, defdef, proc) - M_TRIE *intname ; - char *extname ; - FILE *file ; - char *externdef ; - char *defdef ; - void (*proc) (FILE *file, void *value); - { - LOGICAL first = TRUE ; - int count = 0 ; - int treelen = 1 ; - - /* Count nodes in tree */ - countdown(intname, &treelen); - - if (treelen > 1) { - fprintf(file, "%s M_PTRIE %s[%d]\n#if defined(%s)\n = {\n", - externdef, extname, treelen - 1, defdef) ; - dumpnode(&first, file, intname, &count, proc) ; - fprintf(file, "}\n#endif\n ;\n\n") ; - } - else { - fprintf(file, "%s M_PTRIE %s[1] ;\n\n", externdef, extname) ; - } - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/trieplk.c b/cde/programs/dthelp/parser.ccdf/htag/util/trieplk.c deleted file mode 100644 index 9a36bbf44..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/trieplk.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: trieplk.c /main/3 1995/11/08 11:45:01 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Trie.c contains procedures for maintaining the tree structure - used to store element names, delimiter strings, short reference strings, - etc. */ - -#include -#include "basic.h" -#include "common.h" -#include "trie.h" - -extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ; - -int m_packedlook(M_PTRIE *xptrie, M_WCHAR *name); - -/* Look for the string NAME in the packed trie PTRIE */ -int m_packedlook(M_PTRIE *xptrie, M_WCHAR *name) -{ -int current = 0 ; -int i ; -int c ; - -for ( ; TRUE ; name++) - { - c = m_ctupper(*name) ; - for (i = current ; - (int) ((xptrie + i)->symbol) < c && (xptrie + i)->more ; - i++) ; - if ((int) ((xptrie + i)->symbol) == c) - { - if (! c) return((xptrie + i)->index) ; - current = (xptrie + i)->index ; - } - else return(FALSE) ; - } -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/trierset.c b/cde/programs/dthelp/parser.ccdf/htag/util/trierset.c deleted file mode 100644 index e662a6544..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/trierset.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: trierset.c /main/3 1995/11/08 11:45:16 rswiston $ */ -/* - Copyright 1988, 1989 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" -#include "common.h" -#include "trie.h" - -extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ; - -/* Changes the value associated with an entry in a trie. */ -void *m_resettrie(xtrie, p, value) - M_TRIE *xtrie ; - M_WCHAR *p ; - void *value ; - { - M_TRIE *currentnode ; - - currentnode = xtrie->data ; - while (TRUE) { - if (! currentnode) return(FALSE) ; - if ((int) currentnode->symbol == m_ctupper(*p)) - if (! *p) return((void *)(currentnode->data = (M_TRIE *) value)) ; - else { - p++ ; - currentnode = currentnode->data ; - continue ; - } - else if (currentnode->symbol < *p) { - currentnode = currentnode->next ; - continue ; - } - else return(NULL) ; - } - } - - diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/upcmp8.c b/cde/programs/dthelp/parser.ccdf/htag/util/upcmp8.c deleted file mode 100644 index 27627ad8c..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/upcmp8.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: upcmp8.c /main/3 1995/11/08 11:45:35 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Compare uppercase versions of two strings of eight-bit characters */ - -#include -#include "basic.h" -#include "common.h" -extern M_CHARTYPE m_ctarray[256] ; - -int m_wcupstrcmp(const M_WCHAR *p, const M_WCHAR *q); - -int m_wcmbupstrcmp(const M_WCHAR *p, const char *q); - -int m_mbmbupstrcmp(const char *p, const char *q); - -int m_wcupstrcmp(const M_WCHAR *p, const M_WCHAR *q ) - { - do { - if (m_ctupper(*p) < m_ctupper(*q)) return(-1) ; - if (m_ctupper(*p) > m_ctupper(*q)) return(1) ; - q++ ; - } while (*p++) ; - return(0) ; - } - -int m_wcmbupstrcmp(const M_WCHAR *p, const char *q) - { - M_WCHAR *wc; - int retval; - - wc = MakeWideCharString(q); - retval = m_wcupstrcmp(p, wc); - m_free(wc,"wide character string"); - return retval; - } - -int m_mbmbupstrcmp(const char *p, const char *q) - { - M_WCHAR *w_p, *w_q; - int retval; - - w_p = MakeWideCharString(p); - w_q = MakeWideCharString(q); - retval = m_wcupstrcmp(w_p, w_q); - m_free(w_p,"wide character string"); - m_free(w_q,"wide character string"); - return retval; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/upper.c b/cde/programs/dthelp/parser.ccdf/htag/util/upper.c deleted file mode 100644 index 7b1361b3c..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/upper.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: upper.c /main/3 1995/11/08 11:45:54 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Force a letter to uppercase */ - -#include "basic.h" - -int m_upper(int c) - { - if (c >= 'a' && c <= 'z') c += 'A' - 'a' ; - return(c) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/upstrcmp.c b/cde/programs/dthelp/parser.ccdf/htag/util/upstrcmp.c deleted file mode 100644 index 16d9140bc..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/upstrcmp.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: upstrcmp.c /main/3 1995/11/08 11:46:10 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -/* Compare uppercase versions of two strings */ - -#include "basic.h" - -int m_upper(int c); - -int m_upstrcmp(char *p, char *q); - -int m_upstrcmp(p, q) - char *p, *q ; - { - do { - if (m_upper((int) *p) < m_upper((int) *q)) return(-1) ; - if (m_upper((int) *p) > m_upper((int) *q++)) return(1) ; - } while (*p++) ; - return(0) ; - } diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/version.h b/cde/programs/dthelp/parser.ccdf/htag/util/version.h deleted file mode 100644 index 701520ca8..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/version.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: version.h /main/3 1995/11/08 11:46:26 rswiston $ */ -/* Copyright (c) 1987, 1988, 1989 Hewlett-Packard Co. */ - -/* Version.h defines the MARKUP System Version Number */ -#define M_VERSION "Version 2.4" diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/wchar.c b/cde/programs/dthelp/parser.ccdf/htag/util/wchar.c deleted file mode 100644 index 660281939..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/wchar.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: wchar.c /main/3 1995/11/08 11:46:43 rswiston $ */ -/* - Copyright 1992 Hewlett-Packard Co. -*/ - -#include -#include "basic.h" - - -/* compare two wide character strings */ -int w_strcmp(const M_WCHAR *string1, const M_WCHAR *string2) -{ -M_WCHAR c1, c2, null; - -if (string1 == string2) return 0; - -null = (M_WCHAR) 0; -if (!string1) string1 = &null; -if (!string2) string2 = &null; - -while (1) - { - c1 = *string1++; - c2 = *string2++; - if (c1 < c2) return -1; - if (c1 > c2) return 1; - if (!c1) return 0; - } -} - - -/* copy a wide character string */ -M_WCHAR *w_strcpy(M_WCHAR *string1, const M_WCHAR *string2) -{ -M_WCHAR *string1start; - -string1start = string1; - -while (*string1++ = *string2++); - -return string1start; -} - - -/* copy a wide character string, stopping after "max" moves */ -M_WCHAR *w_strncpy(M_WCHAR *string1, const M_WCHAR *string2, int max) -{ -M_WCHAR *string1start; - -string1start = string1; - -while ((--max >= 0) && (*string1++ = *string2++)); - -return string1start; -} - - -/* get the length of a wide character string */ -int w_strlen(const M_WCHAR *string) -{ -int length; - -length = 0; -if (string) - while (*string++) length++; - -return length; -} - - -/* find wide character "chr" in wide string "string" */ -M_WCHAR *w_strchr(M_WCHAR *string, const M_WCHAR chr) -{ -M_WCHAR *where; - -where = string; - -while (*where) - { - if (*where == chr) return where; - where++; - } - -if (!chr) - return where; -else - return NULL; -} - - -/* find wide character "chr" in wide string "string" */ -M_WCHAR *w_strstr(M_WCHAR *string1, M_WCHAR *string2) -{ -M_WCHAR *where1, *where2; - -if (!*string2) return string1; - -where1 = string1; -where2 = string2; - -while (*where1) - { - if (*where1 == *where2) - { - string1 = where1; - - while (*where1 && *where2 && (*where1 == *where2)) - { - where1++; - where2++; - } - - if (!*where2) return string1; - if (!*where1) return NULL; - - where1 = string1; - where2 = string2; - } - where1++; - } - -return NULL; -} - - -/* make a multi-byte string from a wide character string */ -char *MakeMByteString(const M_WCHAR *wc_string) -{ -char *mb_string; -int length; -M_WCHAR wc; - -/* Do a little work to compensate for m_malloc allocating sizeof(M_WCHAR) - * bytes for each increment in the size requested. -*/ -length = (w_strlen(wc_string) * MB_CUR_MAX) + 1; -length = (length + sizeof(M_WCHAR) - 1) / sizeof(M_WCHAR); -mb_string = (char *) m_malloc(length, "multi-byte string"); - -length = 0; -while (wc = *wc_string++) - { - length += wctomb(&mb_string[length], wc); - } -mb_string[length] = 0; - -return mb_string; -} - - -/* make a wide character string from a multi-byte string */ -M_WCHAR *MakeWideCharString(const char *mb_string) -{ -M_WCHAR *wc_string, *wc_stringStart; -int length, incr; -char c; - -length = strlen(mb_string); -wc_stringStart = wc_string = - (M_WCHAR *) m_malloc(length + 1, "wide character string"); - -length = 0; -while (mb_string[length]) - { - if ((incr = mbtowc(wc_string, &mb_string[length], MB_CUR_MAX)) < 0) - { - char badOne[2], buffer[32]; - - badOne[0] = mb_string[length]; - badOne[1] = 0; - sprintf(buffer, "0x%x", mb_string[length]); - m_err2("invalid multibyte character found: '%c' (%s)", badOne, buffer); - incr = 1; - } - length += incr; - wc_string++; - } -*wc_string = (M_WCHAR) 0; - -return wc_stringStart; -} - - -/* Get-wide-char procedure */ -int mb_getwc(m_ptr) -void *m_ptr; -{ -int c; -M_WCHAR wc; -char badch[2]; -char mbyte[32]; /* make this bigger than any possible multi-byte char */ -int length; - -length = 0; -if ((c = getc((FILE *) m_ptr)) == EOF) return(EOF); - -while (1) - { - mbyte[length++] = c; - mbyte[length] = 0; - if (mblen(mbyte,length) != -1) break; /* hurray! */ - if (length == MB_CUR_MAX) - { /* reached max without a hit */ - m_error("An invalid multi-byte character was found in the input"); - c = ' '; - length = 1; - break; - } - if ((c = getc((FILE *) m_ptr)) == EOF) - { /* huh? */ - m_error("End-of-file found in within a multi-byte character"); - return(EOF); - } - } -mbtowc(&wc,mbyte,length); - -return((int) wc); -} diff --git a/cde/programs/dthelp/parser.ccdf/htag/util/whitesp.c b/cde/programs/dthelp/parser.ccdf/htag/util/whitesp.c deleted file mode 100644 index 000033c3b..000000000 --- a/cde/programs/dthelp/parser.ccdf/htag/util/whitesp.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: whitesp.c /main/3 1995/11/08 11:47:00 rswiston $ */ -/* - Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co. -*/ - -#include "basic.h" - -/* Test if character c is a blank, tab, or carriage return */ -LOGICAL m_whitespace(M_WCHAR c) -{ -char mb_c[32]; /* arbitrarily large */ -int length; - -length = wctomb(mb_c, c); -if (length != 1) return FALSE; - -if (*mb_c == ' ' || *mb_c == '\t' || *mb_c == '\n') return(TRUE) ; -else return(FALSE) ; -} diff --git a/cde/programs/dthelp/parser.ccdf/misc/helpchar.ent b/cde/programs/dthelp/parser.ccdf/misc/helpchar.ent deleted file mode 100644 index a6cb154b2..000000000 --- a/cde/programs/dthelp/parser.ccdf/misc/helpchar.ent +++ /dev/null @@ -1,157 +0,0 @@ - - - - - -<0x61>"> -<0x62>"> -<0x67>"> -<0x64>"> - -<0x65>"> -<0x7A>"> -<0x68>"> -<0x71>"> -<0x4A>"> - -<0x69>"> -<0x6B>"> -<0x6C>"> -<0x6D>"> -<0x6E>"> - -<0x78>"> - -<0x70>"> -<0x76>"> -<0x72>"> - -<0x73>"> -<0x74>"> -<0x75>"> - -<0x66>"> -<0x6A>"> -<0x63>"> -<0x79>"> -<0x77>"> - - -<0x47>"> -<0x44>"> -<0x51>"> -<0x4C>"> -<0x58>"> - -<0x50>"> -<0x53>"> -<0xA1>"> -<0x46>"> -<0x59>"> - -<0x57>"> - - -<0xC0>"> -<0xA2>"> -<0x22>"> -<0x60>"> - -<0x24>"> -<0xD1>"> -<0xD8>"> -<0xD6>"> -<0xC3>"> -<0xC2>"> - -<0xA7>"> -<0xC1>"> -<0xD0>"> -<0xA8>"> -<0xB6>"> -<0xA9>"> -<0xA5>"> - -<0xAA>"> -<0xA7>"> -<0xB6>"> - - -<0xE5>"> -<0xC7>"> -<0xC7>"> -<0xD5>"> -<0xC8>"> -<0xC8>"> -<0xC4>"> -<0xC4>"> -<0xC5>"> -<0xC5>"> -<0xF2>"> -<0xDA>"> -<0xDA>"> -<0xD9>"> -<0xD9>"> -<0xD7>"> - -<0xC6>"> - -<0xE0>"> -<0xB7>"> - - - -<0xBA>"> -<0x7E>"> -<0xCC>"> -<0xC9>"> -<0xBB>"> -<0xCD>"> -<0xCA>"> -<0x40>"> -<0xCE>"> -<0xB5>"> -<0x5E>"> -<0xB9>"> -<0xCB>"> - - - -<0xAC>"> -<0xAC>"> -<0xAD>"> -<0xDC>"> -<0xDC>"> - -<0xDD>"> -<0xAE>"> -<0xAE>"> -<0xAF>"> -<0xDE>"> -<0xDE>"> -<0xDF>"> -<0xAB>"> -<0xAB>"> - -<0xDB>"> -<0xDB>"> - -<0x56>"> -<0x5C>"> -<0x60>"> -<0xA6>"> -<0xBF>"> -<0xCF>"> -<0xA1>"> -<0xA4>"> -<0xA5>"> -<0xAB>"> -<0xB2>"> -<0xB3>"> -<0xBB>"> -<0xBC>"> -<0xBD>"> -<0xBE>"> -<0xBF>"> - diff --git a/cde/programs/dthelp/parser.ccdf/misc/helpicon.ent b/cde/programs/dthelp/parser.ccdf/misc/helpicon.ent deleted file mode 100644 index 5076a47d8..000000000 --- a/cde/programs/dthelp/parser.ccdf/misc/helpicon.ent +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/cde/programs/dthelp/parser.ccdf/misc/helplang.ent b/cde/programs/dthelp/parser.ccdf/misc/helplang.ent deleted file mode 100644 index 275812fd8..000000000 --- a/cde/programs/dthelp/parser.ccdf/misc/helplang.ent +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cde/programs/dthelp/parser.ccdf/misc/helptag.opt b/cde/programs/dthelp/parser.ccdf/misc/helptag.opt deleted file mode 100644 index 8b1378917..000000000 --- a/cde/programs/dthelp/parser.ccdf/misc/helptag.opt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/cde/programs/dthelp/parser.ccdf/volumegen/Imakefile b/cde/programs/dthelp/parser.ccdf/volumegen/Imakefile deleted file mode 100644 index 85b42afe0..000000000 --- a/cde/programs/dthelp/parser.ccdf/volumegen/Imakefile +++ /dev/null @@ -1,22 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/6 1996/10/09 14:04:32 drk $ -PROGRAMS = volumegen - - INCLUDES = -I. - -#if defined(SunArchitecture) -SYS_LIBRARIES = -ldl -lgen -#endif - - -SRCS = Volumegen.c \ - Pstack.c -OBJS = Volumegen.o \ - Pstack.o - -NormalLibraryObjectRule() -ComplexProgramTarget($(PROGRAMS)) - - - - - diff --git a/cde/programs/dthelp/parser.ccdf/volumegen/Pstack.c b/cde/programs/dthelp/parser.ccdf/volumegen/Pstack.c deleted file mode 100644 index 2b4037cb2..000000000 --- a/cde/programs/dthelp/parser.ccdf/volumegen/Pstack.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: Pstack.c /main/4 1995/11/08 11:47:39 rswiston $ */ -/************************************<+>************************************* - **************************************************************************** - * - * File: PStack.c - * - * Project: Cache Creek (Rivers) Project - * Description: Utility functions for volumegen program - * Author: Brian Cripe - * Modifications by (Mike Wilson) - * Language: C - * - * (C) Copyright 1992, Hewlett-Packard, all rights reserved. - * - **************************************************************************** - ************************************<+>*************************************/ - - -#include -#include "PstackI.h" - -#define REALLOC_INCR 10 - - - - - -/***************************************************************************** - * Function: PStack PStackCreate(); - * - * Parameters: NONE. - * - * Return Value: PStack. - * - * Purpose: Generates a PStack structure and returns it to the - * caller. - * - *****************************************************************************/ -PStack PStackCreate() -{ - PStack stack; - stack = (PStack) malloc (sizeof (struct PStackRec)); - stack->count = 0; - stack->size = REALLOC_INCR; - stack->items = (void **) malloc (stack->size * sizeof (void **)); - - return (stack); -} - - - -/***************************************************************************** - * Function: PStack PStackDestroy(); - * - * Parameters: stack: - * - * Return Value: void. - * - * Purpose: Destroys a PStack structure. - * - *****************************************************************************/ -void PStackDestroy( - PStack stack) -{ - free (stack->items); - free (stack); -} - - - - - -/***************************************************************************** - * Function: PStack PStackPush(); - * - * Parameters: stack: - * ptr: - * - * Return Value: void - * - * Purpose: Pushes a PStack structure on the current stack. - * - *****************************************************************************/ -void PStackPush( - PStack stack, - void *ptr) -{ - if (stack->count == stack->size) { - stack->size += REALLOC_INCR; - stack->items = (void **) realloc (stack->items, - stack->size * sizeof (void **)); - } - - *(stack->items + stack->count) = ptr; - stack->count++; -} - - - -/***************************************************************************** - * Function: PStack *PStackPeek(); - * - * Parameters: stack: - * - * Return Value: void. - * - * Purpose: Gets a PStack. - * - *****************************************************************************/ -void *PStackPeek( - PStack stack) - -{ - if (stack->count == 0) - return (NULL); - - else - return (*(stack->items + stack->count - 1)); -} - - -/***************************************************************************** - * Function: PStack *PStackPop(); - * - * Parameters: stack: - * - * Return Value: void. - * - * Purpose: Pops the top element off the stack - * - *****************************************************************************/ -void *PStackPop( - PStack stack) -{ - if (stack->count == 0) - return (NULL); - - else { - stack->count--; - return (*(stack->items + stack->count)); - } -} - - - - - - - - - - - - - - - - - - diff --git a/cde/programs/dthelp/parser.ccdf/volumegen/PstackI.h b/cde/programs/dthelp/parser.ccdf/volumegen/PstackI.h deleted file mode 100644 index 6cd796ff1..000000000 --- a/cde/programs/dthelp/parser.ccdf/volumegen/PstackI.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: PstackI.h /main/4 1995/11/08 11:47:58 rswiston $ */ -/************************************<+>************************************* - **************************************************************************** - * - * File: PstackI.h - * - * Project: Cache Creek (Rivers) Project - * Description: Header file for Utility functions for PStack.h - * Author: Brian Cripe - * Modifications by (Mike Wilson) - * Language: C - * - * (C) Copyright 1992, Hewlett-Packard, all rights reserved. - * - **************************************************************************** - ************************************<+>*************************************/ - -struct PStackRec { - int size; - int count; - void **items; -}; - -typedef struct PStackRec *PStack; - - - - - -/***************************************************************************** - * Function: PStack PStackCreate(); - * - * Parameters: NONE. - * - * Return Value: PStack. - * - * Purpose: Generates a PStack structure and returns it to the - * caller. - * - *****************************************************************************/ -extern PStack PStackCreate(); - - -/***************************************************************************** - * Function: PStack PStackDestroy(); - * - * Parameters: stack: - * - * Return Value: void. - * - * Purpose: Destroys a PStack structure. - * - *****************************************************************************/ -extern void PStackDestroy( - PStack stack); - - -/***************************************************************************** - * Function: PStack PStackPush(); - * - * Parameters: stack: - * ptr: - * - * Return Value: void - * - * Purpose: Pushes a PStack structure on the current stack. - * - *****************************************************************************/ -extern void PStackPush( - PStack stack, - void *ptr); - - -/***************************************************************************** - * Function: PStack *PStackPeek(); - * - * Parameters: stack: - * - * Return Value: void. - * - * Purpose: Gets a PStack. - * - *****************************************************************************/ -extern void *PStackPeek( - PStack stack); - - -/***************************************************************************** - * Function: PStack *PStackPop(); - * - * Parameters: stack: - * - * Return Value: void. - * - * Purpose: Pops the top element off the stack - * - *****************************************************************************/ -extern void *PStackPop( - PStack stack); - - - - - - - - - - - - - - - - - - diff --git a/cde/programs/dthelp/parser.ccdf/volumegen/Volumegen.c b/cde/programs/dthelp/parser.ccdf/volumegen/Volumegen.c deleted file mode 100644 index 08de4809d..000000000 --- a/cde/programs/dthelp/parser.ccdf/volumegen/Volumegen.c +++ /dev/null @@ -1,764 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: Volumegen.c /main/4 1995/11/08 11:48:17 rswiston $ */ -/************************************<+>************************************* - **************************************************************************** - * - * File: Volumegen.c - * - * Project: Cache Creek (Rivers) Project - * Description: Source for the 'volumegen' portion of HelpTAG. - * Author: Brian Cripe - * Modifications by Mike Wilson - * Modifications to support non-topic IDs added by Dex Smith - * Language: C - * - * (C) Copyright 1992, Hewlett-Packard, all rights reserved. - * - **************************************************************************** - ************************************<+>*************************************/ - - -#include -#include -#include -#include -#include -#include -#include - -/* Local Includes */ -#include "PstackI.h" - -#define TRUE 1 -#define FALSE 0 - -typedef int Boolean; - -/* extern int errno; */ -/* extern int sys_nerr; */ - -static void GenTopicList ( - FILE *infile, - FILE *outfile); - -static void GenTopicHeir( - FILE *infile, - FILE *outfile); - -static void GenTopicLoc( - FILE *infile, - FILE *outfile); - -static void GenHomeLocation( - FILE *outfile); - -static void GenKeyWordList( - FILE *infile, - FILE *outfile); - -static void MergeMetaInfo( - FILE *infile, - FILE *outfile); - -static char *GetNextToken( - FILE *file, - Boolean delimIsSpace); - - - -/* Volumegen Input file suffixes */ - -#define HEIR_FILE_SUFFIX ".tpc" /* The input filename suffix used for topic */ - /* hierarchy files. */ -#define TLOC_FILE_SUFFIX ".idt" /* The input filename suffix used for topic */ - /* location files. */ - -#define IKEY_FILE_SUFFIX ".idx" /* The input filename suffix used for sorted*/ - /* keyword file. */ -#define IMETA_FILE_SUFFIX ".hmi" /* The input filename suffix used for meta */ - /* information file. */ - - - -/* Volumegen Output file suffixes */ - - -#define VOL_FILE_SUFFIX ".hv" /* The filename suffix used for volume */ - /* file generated by volumegen. */ - -#define KEY_FILE_SUFFIX ".hvk" /* The filename suffix used for keyword */ - /* file generated by volumegen. */ - - - -/***************************************************************************** - * Function: void main(); - * - * - * Purpose: Program Main line body - * - *****************************************************************************/ -void main ( - int argc, - char **argv) -{ - char *fName; - FILE *tlocFile, *heirFile, *keyFile, *metaFile; - FILE *volFile, *keyWordFile; - - setlocale(LC_ALL, ""); - - /* Make sure that an argument naming the volume was supplied. */ - if (argc < 2) { - fprintf (stderr, "usage: %s \n", *argv); - exit (1); - } - - /* Construct the name of the hierarchy file and open it. */ - fName = malloc (strlen (*(argv+1)) + strlen (HEIR_FILE_SUFFIX) + 1); - strcpy (fName, *(argv+1)); - strcat (fName, HEIR_FILE_SUFFIX); - if ((heirFile = fopen (fName, "r")) == NULL) { - fprintf (stderr, - "%s: error opening hierarchy file %s for reading\n", - *argv, fName); - perror (NULL); - exit (1); - } - - /* Construct the name of the topic location file and open it. */ - fName = malloc (strlen (*(argv+1)) + strlen (TLOC_FILE_SUFFIX) + 1); - strcpy (fName, *(argv+1)); - strcat (fName, TLOC_FILE_SUFFIX); - if ((tlocFile = fopen (fName, "r")) == NULL) { - fprintf (stderr, - "%s: error opening topic location file %s for reading\n", - *argv, fName); - perror (NULL); - exit (1); - } - - /* Construct the name of the keyword file and open it. */ - fName = malloc (strlen (*(argv+1)) + strlen (IKEY_FILE_SUFFIX) + 1); - strcpy (fName, *(argv+1)); - strcat (fName, IKEY_FILE_SUFFIX); - if ((keyFile = fopen (fName, "r")) == NULL) { - fprintf (stderr, - "%s: error opening keyword file %s for reading\n", - *argv, fName); - perror (NULL); - exit (1); - } - - - /* Construct the name of the meta information file and open it. */ - fName = malloc (strlen (*(argv+1)) + strlen (IMETA_FILE_SUFFIX) + 1); - strcpy (fName, *(argv+1)); - strcat (fName, IMETA_FILE_SUFFIX); - if ((metaFile = fopen(fName, "r")) == NULL) { - fprintf (stderr, - "%s: error opening meta file %s for reading\n", - *argv, fName); - perror (NULL); - exit (1); - } - - - /* Construct the name of the volume file (the one we are creating) - and open it. */ - fName = malloc (strlen (*(argv+1)) + strlen (VOL_FILE_SUFFIX) + 1); - strcpy (fName, *(argv+1)); - strcat (fName, VOL_FILE_SUFFIX); - if ((volFile = fopen (fName, "w")) == NULL) { - fprintf (stderr, "%s: error opening Volume file %s for writing\n", - *argv, fName); - perror (NULL); - exit (1); - } - - /* Construct the name of the keyword file (the one we are creating) - and open it. */ - fName = malloc (strlen (*(argv+1)) + strlen (KEY_FILE_SUFFIX) + 1); - strcpy (fName, *(argv+1)); - strcat (fName, KEY_FILE_SUFFIX); - if ((keyWordFile = fopen (fName, "w")) == NULL) { - fprintf (stderr, "%s: error opening Keyword file %s for writing\n", - *argv, fName); - perror (NULL); - exit (1); - } - - - /* Generate topic list and hierarchy */ - GenTopicList (heirFile, volFile); - GenTopicHeir (heirFile, volFile); - - /* Generate topic location table. */ - GenTopicLoc(tlocFile, volFile); - - - /* Generate the keyword information */ - GenKeyWordList(keyFile, keyWordFile); - - - /* Merge the Meta information */ - MergeMetaInfo(metaFile, volFile); - - /* Generate the Home Topic entry */ - GenHomeLocation(volFile); - - exit(0); -} - - -/***************************************************************************** - * Function: static void GenTopicList( - * FILE *infile, - * FILE *outfile) - * - * Parameters: infile - * outfile - * - * Return Value: Void. - * - * Purpose: Generates the topic list in the .hv file. - * - *****************************************************************************/ -static void GenTopicList ( - FILE *infile, - FILE *outfile) -{ - char *token; - - fseek (infile, 0, SEEK_SET); - - fprintf (outfile, "# Topic List\n"); - - /* The output formatting is kind of tricky as we want to end every - line with a "\", except for the last line. Therefore each time - through the loop we print the "\\\n" for the previous line and - the body of the current line. */ - fprintf (outfile, "*.topicList: "); - while ((token = GetNextToken (infile, TRUE)) != NULL) { - - if ((strcmp (token, "{") != 0) && (strcmp (token, "}") != 0)) - fprintf (outfile, "\\\n\t%s ", token); - - free (token); - } - - fprintf (outfile, "\n\n"); -} - - - -/***************************************************************************** - * Function: static void GenTopicHeir( - * FILE *infile, - * FILE *outfile) - * - * Parameters: infile - * outfile - * - * Return Value: Void. - * - * Purpose: Generates the topic hierarchy in the .hv file. - * - *****************************************************************************/ -static void GenTopicHeir( - FILE *infile, - FILE *outfile) -{ - char *token, *prevToken, *tempS; - - PStack topicStack; - - topicStack = PStackCreate(); - fseek (infile, 0, SEEK_SET); - - fprintf (outfile, "# Topic Hierarchy\n"); - prevToken = NULL; - while ((token = GetNextToken (infile, TRUE)) != NULL) { - - if (strcmp (token, "{") == 0) - PStackPush (topicStack, prevToken); - - else if (strcmp (token, "}") == 0) { - if (prevToken != NULL) - free (prevToken); - - free (PStackPop (topicStack)); - } - - else { - tempS = (char *) PStackPeek (topicStack); - if (tempS == NULL) { - tempS = ""; - } - fprintf (outfile, "*.%s.parent:\t%s\n", token, tempS); - - if (prevToken != NULL) - free (prevToken); - } - - prevToken = token; - } - PStackDestroy (topicStack); - fprintf (outfile, "\n"); -} - - - -/***************************************************************************** - * Function: static void GenTopicLoc( - * FILE *infile, - * FILE *outfile) - * - * Parameters: infile - * outfile - * - * Return Value: Void. - * - * Purpose: Generates the topic Location section in the - * .hv file. - * - *****************************************************************************/ -static void GenTopicLoc( - FILE *infile, - FILE *outfile) -{ - char *topic, *topicFile, *topicPos; - - char *trueTopicID = NULL; - char *locationIdNew = NULL; - char *idList = NULL; - - fseek (infile, 0, SEEK_SET); - - fprintf (outfile, - "# Topic Locations (file names, file positions, and non-topic IDs)\n"); - - /* Topic location files have a strict syntax where each line contains - either three tokens (the topic ID, the file containing the topic, - and the byte offset to the start of the topic), or two tokens (the - topic ID and a non-topic ID that occurs within the topic). The - first style (three tokens) is identified by the trailing ":" on the - topic ID. Similarly, the second style (two tokens) is identified by - the trailing ">" on the topic ID. If the file deviates from these - two variations of the syntax, the file is considered corrupt. */ - - while (1) { - if ((topic = GetNextToken (infile, TRUE)) == NULL) - break; - - /* If the topic ID ends with ":", then we've found a primary entry. */ - if (*(topic + strlen (topic) - 1) == ':') - { - /* Strip the ":" at the end of the topic ID */ - *(topic + strlen (topic) - 1) = '\0'; - - /* if there was a previous trueTopicID, print it out */ - if (trueTopicID != (char *)NULL && idList != (char *)NULL) - { - fprintf(outfile, "*.%s.locationIDs:\t%s\n", - trueTopicID, idList); - free (trueTopicID); - free (idList); - idList = (char *)NULL; - } - - /* Save the new true topic. */ - trueTopicID = malloc(strlen(topic) + 1); - strcpy(trueTopicID, topic); - - if ((topicFile = GetNextToken (infile, TRUE)) == NULL) - break; - - if ((topicPos = GetNextToken (infile, TRUE)) == NULL) - break; - - fprintf (outfile, "*.%s.filename:\t%s\n", topic, topicFile); - fprintf (outfile, "*.%s.filepos:\t%s\n", topic, topicPos); - - free (topicFile); - free (topicPos); - } - /* Else, if the id ends with ">", we've found a non-topic entry. */ - else if (*(topic + strlen (topic) - 1) == '>') - { - /* Get the next token, its the non-topic ID. */ - if ((locationIdNew = GetNextToken (infile, TRUE)) == NULL) - break; - - /* If the ID list hasn't been started for this topic, start it. */ - if (idList == (char *)NULL) - { - idList = malloc(strlen(locationIdNew) + 1); - strcpy(idList, locationIdNew); - } - /* Else, add the ID we've just found to the list. */ - else - { - /* append the non-topic location ID to the list */ - idList = - realloc(idList, strlen(idList) + strlen(locationIdNew) +2); - - strcat(idList, " "); - strcat(idList, locationIdNew); - } - } - else - { - /* If the token does not end with ":" or ">", we have a problem. */ - printf("The %s file is corrupt!\n", TLOC_FILE_SUFFIX); - } - free (topic); - } - - if (trueTopicID != (char *)NULL && idList != (char *)NULL) - { - fprintf(outfile, "*.%s.locationIDs:\t%s\n", - trueTopicID, idList); - free (trueTopicID); - free (idList); - } - - fprintf (outfile, "\n\n"); -} - - - - - - -/***************************************************************************** - * Function: static void GenKeyWordList( - * FILE *infile, - * FILE *outfile) - * - * Parameters: infile - * outfile - * - * Return Value: Void. - * - * Purpose: Generates the keyword list using the .idx file and - * writes the results to .hv file. - * - *****************************************************************************/ -static void GenKeyWordList( - FILE *infile, - FILE *outfile) - -{ - char *sortKey=NULL; - char *keyWordNew=NULL; - char *locationIdNew=NULL; - char *keyWordLast=NULL; - char *locationIdLast=NULL; - char *idList=NULL; - char *newList=NULL; - static char empty[] = ""; - - fseek (infile, 0, SEEK_SET); - - fprintf (outfile, "# Keyword Index\n"); - - /* idx files (e.g. keyword) have a strict syntax where each line contains - * three tokens (the sort key, the keyword, and the locationID of the - * topic in which the keyword resides). Therefore it is an error if the - * number of tokens in the file is not an integral multiple of 3. - */ - - - fprintf (outfile, "*Keywords:\t\\\n"); - - while (1) { - - /* We get the sortKey, but we don't use it */ - if ((sortKey = GetNextToken (infile, FALSE)) == NULL) - break; - - if ((keyWordNew = GetNextToken (infile, FALSE)) == NULL) - break; - - if ((locationIdNew = GetNextToken (infile, FALSE)) == NULL) - break; - - - - /* Check to see if we have the same keyword as before? */ - if (keyWordLast && (strcmp (keyWordNew, keyWordLast) == 0)) - { - - /* We have a duplicate so add it to our previous keyword list */ - idList = - realloc(idList, strlen(idList) + strlen(locationIdNew) + 2); - - /* Add the new locationId to our current list */ - strcat(idList, " "); - strcat(idList, locationIdNew); - - } - else - if (keyWordLast != NULL) - { - /* Write out the lastList keyword list */ - fprintf (outfile, "%s<\\\\>%s\\n\\\n", keyWordLast, idList); - - /* Clean up our old values */ - free(keyWordLast); - free(idList); - - /* We have a new keyword, so create a new keyword list */ - idList = malloc(strlen(locationIdNew) + 1); - strcpy(idList, locationIdNew); - keyWordLast = malloc(strlen(keyWordNew) + 1); - strcpy(keyWordLast, keyWordNew); - - } - else - { - /* This is the first time in so we special case it */ - /* Create our initial keyword list */ - idList = malloc(strlen(locationIdNew) + 1); - strcpy(idList, locationIdNew); - keyWordLast = malloc(strlen(keyWordNew) + 1); - strcpy(keyWordLast, keyWordNew); - - } - - - free (sortKey); - free (keyWordNew); - free (locationIdNew); - - } - - /* Write out the last keyword and idList */ - if (!keyWordLast) - keyWordLast = empty; - if (!idList) - idList = empty; - fprintf (outfile, "%s<\\\\>%s\\n\n", keyWordLast, idList); - - /* Clean up our old values */ - if (keyWordLast != empty) - free(keyWordLast); - if (idList != empty) - free(idList); - - fprintf (outfile, "\n\n"); - -} - - - - - -/***************************************************************************** - * Function: static char *GetAChar(FILE *file) - * - * Parameters: file from which to read a (possibly multibyte) character - * - * - * Return Value: pointer to (possibly multibyte) character - * - * Purpose: Read a (possibly multibyte) character from the file. - * Put the character byte(s) into local static storage, - * terminating the character with a null byte. - * - *****************************************************************************/ -static char *GetAChar(FILE *ifile) -{ -int c; -static char mbyte[32]; /* bigger than any possible multibyte char */ -int length; - -length = 0; -if (((c = getc(ifile)) == EOF) || (c == '\0')) - { - *mbyte = '\0'; - return mbyte; - } - -while (1) - { - mbyte[length++] = c; - mbyte[length] = '\0'; - if (mblen(mbyte,length) != -1) return mbyte; /* hurray! */ - if (length == MB_CUR_MAX) - { /* reached max without a hit */ - printf("An invalid multi-byte character was found in the input"); - mbyte[0] = ' '; - mbyte[1] = '\0'; - return mbyte; - } - if ((c = getc(ifile)) == EOF) - { /* huh? */ - printf("End-of-file found within a multi-byte character"); - mbyte[0] = '\0'; - return mbyte; - } - } -} - - - - - -/***************************************************************************** - * Function: static void MergeMetaInfo( - * FILE *infile, - * FILE *outfile) - * - * Parameters: infile - * outfile - * - * Return Value: Void. - * - * Purpose: Merges the .hmi meta information into the - * runtime volume file .hv file. - * - *****************************************************************************/ -static void MergeMetaInfo(FILE *infile, FILE *outfile) -{ - -char buff[BUFSIZ]; -char *nextC; -char *writeC, *token; - -fprintf (outfile, "# Meta Information\n"); -fseek (infile, 0, SEEK_SET); - -/* Clear out any initial white space that may be present */ -while ((*(nextC = GetAChar(infile)) != '\0') && - (mblen(nextC, MB_CUR_MAX) == 1) && - isspace(*nextC)) - ; - -/* place that initial nextC value */ -fputs(nextC, outfile); - -while (*(nextC = GetAChar(infile))) - fputs(nextC, outfile); - -fputs("\n\n", outfile); -} - - - -/***************************************************************************** - * Function: static void GenHomeLocation( - * FILE *infile, - * FILE *outfile) - * - * Parameters: infile - * outfile - * - * Return Value: Void. - * - * Purpose: Generates the topic Location section in the - * .hv file. - * - *****************************************************************************/ -static void GenHomeLocation( - FILE *outfile) -{ - char *topic, *topicFile, *topicPos; - - fprintf (outfile, "# Topic Home Locations\n"); - fprintf (outfile, "*topTopic: _HOMETOPIC\n"); - fprintf (outfile, "\n\n"); -} - - - - - - - - - -/***************************************************************************** - * Function: static char *GetNextToken(FILE *file) - * - * Parameters: WidgetClass - * - * - * Return Value: Void. - * - * Purpose: This function will return a token from the input streem. - * A boolean flag is passed in which instructs the function to - * use one of two token delimiters: " " or '\0'. - * (e.g. space or null char). - *****************************************************************************/ -static char *GetNextToken(FILE *file, Boolean delimIsSpace) -{ -char buff[BUFSIZ]; -char *nextC; -char *writeC, *token; -int length; - -while ((*(nextC = GetAChar(file)) != '\0') && - ((length = mblen(nextC, MB_CUR_MAX)) == 1) && - isspace(*nextC)) - ; - -if (*nextC == '\0') - return (NULL); - -writeC = buff; - -if (delimIsSpace) - { - do { - if (writeC < (buff + BUFSIZ - length - 1)) - { - strcpy(writeC, nextC); - writeC += length; - } - nextC = GetAChar(file); - length = mblen(nextC, MB_CUR_MAX); - } - while ((length > 1) || ((*nextC != '\0') && !isspace(*nextC))); - } -else - { - do { - if (writeC < (buff + BUFSIZ - length - 1)) - { - strcpy(writeC, nextC); - writeC += length; - } - nextC = GetAChar(file); - length = mblen(nextC, MB_CUR_MAX); - if ((length == 1) && (*nextC == '\036')) - *nextC = '\0'; - } - while ((length > 1) || (*nextC != '\0')); - } - -token = strdup(buff); -return token; -} diff --git a/cde/programs/dthelp/parser.ccdf/volumegen/admindefines b/cde/programs/dthelp/parser.ccdf/volumegen/admindefines deleted file mode 100644 index 85feb2fcb..000000000 --- a/cde/programs/dthelp/parser.ccdf/volumegen/admindefines +++ /dev/null @@ -1,11 +0,0 @@ -/**** Choose X11Release = X11R4 to link against R4 and Motif1.1 - **** remove the define to link against r5 and Motif1.2 -*****/ -#ifndef CdeVersion -#define CdeVersion 1 -#endif -#ifndef UnityVersion -#define UnityVersion 1 -#endif - -