1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dthelp/parser.ccdf: delete never used module

This commit is contained in:
Jon Trulson 2021-07-03 18:34:31 -06:00
parent 369b3e89d9
commit df0392fc25
168 changed files with 0 additions and 35604 deletions

View file

@ -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))

View file

@ -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.

View file

@ -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.. ",
" ....................... ",
" ",
" ",
" "};

View file

@ -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........ ",
" .................... ",
" .................. ",
" .............. ",
" ........ ",
" ",
" "};

View file

@ -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 "};

View file

@ -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)

View file

@ -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 <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/stat.h>
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 <help volume base name>\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;
}

View file

@ -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.. ",
" ....................... ",
" ",
" ",
" "};

View file

@ -1,327 +0,0 @@
<!-- $XConsortium: helpchar.ent /main/2 1996/11/19 15:59:54 drk $ -->
<!--Entities for Standard Greek Characters
Lowercase-->
<!entity alpha SDATA "<CHARACTERSET symbol><0x61></CHARACTERSET>">
<!entity beta SDATA "<CHARACTERSET symbol><0x62></CHARACTERSET>">
<!entity gamma SDATA "<CHARACTERSET symbol><0x67></CHARACTERSET>">
<!entity delta SDATA "<CHARACTERSET symbol><0x64></CHARACTERSET>">
<!--<!entity epsilon SDATA "$\epsilon$">-->
<!entity varepsilon SDATA "<CHARACTERSET symbol><0x65></CHARACTERSET>">
<!entity zeta SDATA "<CHARACTERSET symbol><0x7A></CHARACTERSET>">
<!entity eta SDATA "<CHARACTERSET symbol><0x68></CHARACTERSET>">
<!entity theta SDATA "<CHARACTERSET symbol><0x71></CHARACTERSET>">
<!entity vartheta SDATA "<CHARACTERSET symbol><0x4A></CHARACTERSET>">
<!entity iota SDATA "<CHARACTERSET symbol><0x69></CHARACTERSET>">
<!entity kappa SDATA "<CHARACTERSET symbol><0x6B></CHARACTERSET>">
<!entity lambda SDATA "<CHARACTERSET symbol><0x6C></CHARACTERSET>">
<!entity mu SDATA "<CHARACTERSET symbol><0x6D></CHARACTERSET>">
<!entity nu SDATA "<CHARACTERSET symbol><0x6E></CHARACTERSET>">
<!entity xi SDATA "<CHARACTERSET symbol><0x78></CHARACTERSET>">
<!entity pi SDATA "<CHARACTERSET symbol><0x70></CHARACTERSET>">
<!entity varpi SDATA "<CHARACTERSET symbol><0x76></CHARACTERSET>">
<!entity rho SDATA "<CHARACTERSET symbol><0x72></CHARACTERSET>">
<!--<!entity varrho SDATA "$\varrho$">-->
<!entity sigma SDATA "<CHARACTERSET symbol><0x73></CHARACTERSET>">
<!--<!entity varsigma SDATA "$\varsigma$">-->
<!entity tau SDATA "<CHARACTERSET symbol><0x74></CHARACTERSET>">
<!entity upsilon SDATA "<CHARACTERSET symbol><0x75></CHARACTERSET>">
<!entity phi SDATA "<CHARACTERSET symbol><0x66></CHARACTERSET>">
<!entity varphi SDATA "<CHARACTERSET symbol><0x6A></CHARACTERSET>">
<!entity chi SDATA "<CHARACTERSET symbol><0x63></CHARACTERSET>">
<!entity psi SDATA "<CHARACTERSET symbol><0x79></CHARACTERSET>">
<!entity omega SDATA "<CHARACTERSET symbol><0x77></CHARACTERSET>">
<!--Entities for Standard Greek Characters
Uppercase-->
<!entity Ugamma SDATA "<CHARACTERSET symbol><0x47></CHARACTERSET>">
<!entity Udelta SDATA "<CHARACTERSET symbol><0x44></CHARACTERSET>">
<!entity Utheta SDATA "<CHARACTERSET symbol><0x51></CHARACTERSET>">
<!entity Ulambda SDATA "<CHARACTERSET symbol><0x4C></CHARACTERSET>">
<!entity Uxi SDATA "<CHARACTERSET symbol><0x58></CHARACTERSET>">
<!entity Upi SDATA "<CHARACTERSET symbol><0x50></CHARACTERSET>">
<!entity Usigma SDATA "<CHARACTERSET symbol><0x53></CHARACTERSET>">
<!entity Uupsilon SDATA "<CHARACTERSET symbol><0xA1></CHARACTERSET>">
<!entity Uphi SDATA "<CHARACTERSET symbol><0x46></CHARACTERSET>">
<!entity Upsi SDATA "<CHARACTERSET symbol><0x59></CHARACTERSET>">
<!entity Uomega SDATA "<CHARACTERSET symbol><0x57></CHARACTERSET>">
<!--Entities for Calligraphic Letters-->
<!--<!entity CA SDATA "$\cal A$">-->
<!--<!entity CB SDATA "$\cal B$">-->
<!--<!entity CC SDATA "$\cal C$">-->
<!--<!entity CD SDATA "$\cal D$">-->
<!--<!entity CE SDATA "$\cal E$">-->
<!--<!entity CF SDATA "$\cal F$">-->
<!--<!entity CG SDATA "$\cal G$">-->
<!--<!entity CH SDATA "$\cal H$">-->
<!--<!entity CI SDATA "$\cal I$">-->
<!--<!entity CJ SDATA "$\cal J$">-->
<!--<!entity CK SDATA "$\cal K$">-->
<!--<!entity CL SDATA "$\cal L$">-->
<!--<!entity CM SDATA "$\cal M$">-->
<!--<!entity CN SDATA "$\cal N$">-->
<!--<!entity CO SDATA "$\cal O$">-->
<!--<!entity CP SDATA "$\cal P$">-->
<!--<!entity CQ SDATA "$\cal Q$">-->
<!--<!entity CR SDATA "$\cal R$">-->
<!--<!entity CS SDATA "$\cal S$">-->
<!--<!entity CT SDATA "$\cal T$">-->
<!--<!entity CU SDATA "$\cal U$">-->
<!--<!entity CV SDATA "$\cal V$">-->
<!--<!entity CW SDATA "$\cal W$">-->
<!--<!entity CX SDATA "$\cal X$">-->
<!--<!entity CY SDATA "$\cal Y$">-->
<!--<!entity CZ SDATA "$\cal Z$">-->
<!--Entities for Miscellaneous Symbols-->
<!entity aleph SDATA "<CHARACTERSET symbol><0xC0></CHARACTERSET>">
<!--<!entity prime SDATA "$\prime$">-->
<!entity forall SDATA "<CHARACTERSET symbol><0x22></CHARACTERSET>">
<!--<!entity hbar SDATA "$\hbar$">-->
<!--<!entity emptyset SDATA "$\emptyset$">-->
<!entity exists SDATA "<CHARACTERSET symbol><0x24></CHARACTERSET>">
<!--<!entity imath SDATA "$\imath$">-->
<!entity nabla SDATA "<CHARACTERSET symbol><0xD1></CHARACTERSET>">
<!entity neg SDATA "<CHARACTERSET symbol><0xD8></CHARACTERSET>">
<!--<!entity jmath SDATA "$\jmath$">-->
<!entity surd SDATA "<CHARACTERSET symbol><0xD6></CHARACTERSET>">
<!--<!entity flat SDATA "$\flat$">-->
<!--<!entity ell SDATA "$\ell$">-->
<!--<!entity top SDATA "$\top$">-->
<!--<!entity natural SDATA "$\natural$">-->
<!entity wp SDATA "<CHARACTERSET symbol><0xC3></CHARACTERSET>">
<!--<!entity bot SDATA "$\bot$">-->
<!--<!entity sharp SDATA "$\sharp$">-->
<!entity Re SDATA "<CHARACTERSET symbol><0xC2></CHARACTERSET>">
<!--<!entity vbar SDATA "$\|$">-->
<!entity clubsuit SDATA "<CHARACTERSET symbol><0xA7></CHARACTERSET>">
<!entity im SDATA "<CHARACTERSET symbol><0xC1></CHARACTERSET>">
<!entity angle SDATA "<CHARACTERSET symbol><0xD0></CHARACTERSET>">
<!entity diamondsuit SDATA "<CHARACTERSET symbol><0xA8></CHARACTERSET>">
<!entity partial SDATA "<CHARACTERSET symbol><0xB6></CHARACTERSET>">
<!--<!entity triangle SDATA "$\triangle$">-->
<!entity heartsuit SDATA "<CHARACTERSET symbol><0xA9></CHARACTERSET>">
<!entity infty SDATA "<CHARACTERSET symbol><0xA5></CHARACTERSET>">
<!--<!entity backslash SDATA "$\backslash$">-->
<!entity spadesuit SDATA "<CHARACTERSET symbol><0xAA></CHARACTERSET>">
<!entity S SDATA "<CHARACTERSET iso8859-1><0xA7></CHARACTERSET>">
<!entity P SDATA "<CHARACTERSET iso8859-1><0xB6></CHARACTERSET>">
<!--Entities for Large Operators-->
<!entity sum SDATA "<CHARACTERSET symbol><0xE5></CHARACTERSET>">
<!--<!entity bigcap SDATA "$\bigcap$">-->
<!--<!entity bigodot SDATA "$\bigodot$">-->
<!entity prod SDATA "<CHARACTERSET symbol><0xD5></CHARACTERSET>">
<!--<!entity bigcup SDATA "$\bigcup$">-->
<!--<!entity bigotimes SDATA "$\bigotimes$">-->
<!--<!entity coprod SDATA "$\coprod$">-->
<!--<!entity bigsqcup SDATA "$\bigsqcup$">-->
<!--<!entity bigoplus SDATA "$\bigoplus$">-->
<!--<!entity int SDATA "$\int$">-->
<!--<!entity bigvee SDATA "$\bigvee$">-->
<!--<!entity biguplus SDATA "$\biguplus$">-->
<!--<!entity oint SDATA "$\oint$">-->
<!--<!entity bigwedge SDATA "$\bigwedge$">-->
<!--Entities for Binary Operators-->
<!entity cap SDATA "<CHARACTERSET symbol><0xC7></CHARACTERSET>">
<!entity vee SDATA "<CHARACTERSET symbol><0xDA></CHARACTERSET>">
<!--<!entity mp SDATA "$\mp$">-->
<!entity cup SDATA "<CHARACTERSET symbol><0xC8></CHARACTERSET>">
<!entity wedge SDATA "<CHARACTERSET symbol><0xD9></CHARACTERSET>">
<!--<!entity setminus SDATA "$\setminus$">-->
<!--<!entity uplus SDATA "$\uplus$">-->
<!entity oplus SDATA "<CHARACTERSET symbol><0xC5></CHARACTERSET>">
<!entity cdot SDATA "<CHARACTERSET symbol><0xD7></CHARACTERSET>">
<!--<!entity sqcap SDATA "$\sqcap$">-->
<!--<!entity ominus SDATA "$\ominus$">-->
<!--<!entity sqcup SDATA "$\sqcup$">-->
<!entity otimes SDATA "<CHARACTERSET symbol><0xC4></CHARACTERSET>">
<!--<!entity ast SDATA "$\ast$">-->
<!--<!entity triangleleft SDATA "$\triangleleft$">-->
<!entity oslash SDATA "<CHARACTERSET symbol><0xC6></CHARACTERSET>">
<!--<!entity star SDATA "$\star$">-->
<!--<!entity triangleright SDATA "$\triangleright$">-->
<!--<!entity odot SDATA "$\odot$">-->
<!entity diamond SDATA "<CHARACTERSET symbol><0xE0></CHARACTERSET>">
<!--<!entity wr SDATA "$\wr$">-->
<!--<!entity dagger SDATA "$\dagger$">-->
<!--<!entity circ SDATA "$\circ$">-->
<!--<!entity bigcirc SDATA "$\bigcirc$">-->
<!--<!entity ddagger SDATA "$\ddagger$">-->
<!entity bullet SDATA "<CHARACTERSET symbol><0xB7></CHARACTERSET>">
<!--<!entity bigtriangleup SDATA "$\bigtriangleup$">-->
<!--<!entity amalg SDATA "$\amalg$">-->
<!--<!entity bigtriangledown SDATA "$\bigtriangledown$">-->
<!--Entities for Relations-->
<!entity equiv SDATA "<CHARACTERSET symbol><0xBA></CHARACTERSET>">
<!--<!entity prec SDATA "$\prec$">-->
<!--<!entity succ SDATA "$\succ$">-->
<!--<!entity sim SDATA "$\sim$">-->
<!--<!entity preceq SDATA "$\preceq$">-->
<!--<!entity succeq SDATA "$\succeq$">-->
<!--<!entity simeq SDATA "$\simeq$">-->
<!--<!entity ll SDATA "$\ll$">-->
<!--<!entity gg SDATA "$\gg$">-->
<!--<!entity asymp SDATA "$\asymp$">-->
<!entity subset SDATA "<CHARACTERSET symbol><0xCC></CHARACTERSET>">
<!entity supset SDATA "<CHARACTERSET symbol><0xC9></CHARACTERSET>">
<!entity approx SDATA "<CHARACTERSET symbol><0xBB></CHARACTERSET>">
<!entity subseteq SDATA "<CHARACTERSET symbol><0xCD></CHARACTERSET>">
<!entity supseteq SDATA "<CHARACTERSET symbol><0xCA></CHARACTERSET>">
<!entity cong SDATA "<CHARACTERSET symbol><0x40></CHARACTERSET>">
<!--<!entity sqsubseteq SDATA "$\sqsubseteq$">-->
<!--<!entity sqsupseteq SDATA "$\sqsupseteq$">-->
<!--<!entity bowtie SDATA "$\bowtie$">-->
<!entity in SDATA "<CHARACTERSET symbol><0xCE></CHARACTERSET>">
<!--<!entity ni SDATA "$\ni$">-->
<!entity propto SDATA "<CHARACTERSET symbol><0xB5></CHARACTERSET>">
<!--<!entity vdash SDATA "$\vdash$">-->
<!--<!entity dashv SDATA "$\dashv$">-->
<!--<!entity models SDATA "$\models$">-->
<!--<!entity smile SDATA "$\smile$">-->
<!--<!entity mid SDATA "$\mid$">-->
<!--<!entity doteq SDATA "$\doteq$">-->
<!--<!entity frown SDATA "$\frown$">-->
<!--<!entity parallel SDATA "$\parallel$">-->
<!entity perp SDATA "<CHARACTERSET symbol><0x5E></CHARACTERSET>">
<!--Entities for Negative Relations-->
<!--<!entity not-l SDATA "$\not<$">-->
<!--<!entity not-g SDATA "$\not>$">-->
<!entity not-eq SDATA "<CHARACTERSET symbol><0xB9></CHARACTERSET>">
<!--<!entity not-leq SDATA "$\not\leq$">-->
<!--<!entity not-geq SDATA "$\not\geq$">-->
<!--<!entity not-equiv SDATA "$\not\equiv$">-->
<!--<!entity not-prec SDATA "$\not\prec$">-->
<!--<!entity not-succ SDATA "$\not\succ$">-->
<!--<!entity not-sim SDATA "$\not\sim$">-->
<!--<!entity not-preceq SDATA "$\not\preceq$">-->
<!--<!entity not-succeq SDATA "$\not\succeq$">-->
<!--<!entity not-simeq SDATA "$\not\simeq$">-->
<!--<!entity not-subset SDATA "<CHARACTERSET symbol><0xCB></CHARACTERSET>">-->
<!--<!entity not-supset SDATA "$\not\supset$">-->
<!--<!entity not-approx SDATA "$\not\approx$">-->
<!--<!entity not-subseteq SDATA "$\not\subseteq$">-->
<!--<!entity not-supseteq SDATA "$\not\supseteq$">-->
<!--<!entity not-cong SDATA "$\not\cong$">-->
<!--<!entity not-sqsubseteq SDATA "$\not\sqsubseteq$">-->
<!--<!entity not-sqsupseteq SDATA "$\not\sqsupseteq$">-->
<!--<!entity not-asymp SDATA "$\not\asymp$">-->
<!--Entities for Arrows-->
<!entity leftarrow SDATA "<CHARACTERSET symbol><0xAC></CHARACTERSET>">
<!--<!entity longleftarrow SDATA "$\longleftarrow$">-->
<!entity uparrow SDATA "<CHARACTERSET symbol><0xAD></CHARACTERSET>">
<!entity bigleftarrow SDATA "<CHARACTERSET symbol><0xDC></CHARACTERSET>">
<!--<!entity biglongleftarrow SDATA "$\Longleftarrow$">-->
<!entity biguparrow SDATA "<CHARACTERSET symbol><0xDD></CHARACTERSET>">
<!entity rightarrow SDATA "<CHARACTERSET symbol><0xAE></CHARACTERSET>">
<!--<!entity longrightarrow SDATA "$\longrightarrow$">-->
<!entity downarrow SDATA "<CHARACTERSET symbol><0xAF></CHARACTERSET>">
<!entity bigrightarrow SDATA "<CHARACTERSET symbol><0xDE></CHARACTERSET>">
<!--<!entity biglongrightarrow SDATA "$\Longrightarrow$">-->
<!entity bigdownarrow SDATA "<CHARACTERSET symbol><0xDF></CHARACTERSET>">
<!entity leftrightarrow SDATA "<CHARACTERSET symbol><0xAB></CHARACTERSET>">
<!--<!entity longleftrightarrow SDATA "$\longleftrightarrow$">-->
<!--<!entity updownarrow SDATA "$\updownarrow$">-->
<!entity bigleftrightarrow SDATA "<CHARACTERSET symbol><0xDB></CHARACTERSET>">
<!--<!entity biglongleftrightarrow SDATA "$\Longleftrightarrow$">-->
<!--<!entity bigupdownarrow SDATA "$\Updownarrow$">-->
<!--<!entity mapsto SDATA "$\mapsto$">-->
<!--<!entity longmapsto SDATA "$\longmapsto$">-->
<!--<!entity nearrow SDATA "$\nearrow$">-->
<!--<!entity hookleftarrow SDATA "$\hookleftarrow$">-->
<!--<!entity hookrightarrow SDATA "$\hookrightarrow$">-->
<!--<!entity searrow SDATA "$\searrow$">-->
<!--<!entity leftharpoonup SDATA "$\leftharpoonup$">-->
<!--<!entity rightharpoonup SDATA "$\rightharpoonup$">-->
<!--<!entity swarrow SDATA "$\swarrow$">-->
<!--<!entity leftharpoondown SDATA "$\leftharpoondown$">-->
<!--<!entity rightharpoondown SDATA "$\rightharpoondown$">-->
<!--<!entity nwarrow SDATA "$\nwarrow$">-->
<!--<!entity rightleftharpoons SDATA "$\rightleftharpoons$">-->
<!------------------------------------>
<!-- End of texchar.ent equivalents -->
<!------------------------------------>
<!entity tsigma SDATA "<CHARACTERSET symbol><0x56></CHARACTERSET>">
<!entity therefore SDATA "<CHARACTERSET symbol><0x5C></CHARACTERSET>">
<!entity overline SDATA "<CHARACTERSET symbol><0x60></CHARACTERSET>">
<!entity function SDATA "<CHARACTERSET symbol><0xA6></CHARACTERSET>">
<!entity cr SDATA "<CHARACTERSET symbol><0xBF></CHARACTERSET>">
<!entity not-in SDATA "<CHARACTERSET symbol><0xCF></CHARACTERSET>">
<!entity invert-exclamation SDATA "<CHARACTERSET iso8859-1><0xA1></CHARACTERSET>">
<!entity currency SDATA "<CHARACTERSET iso8859-1><0xA4></CHARACTERSET>">
<!entity yen SDATA "<CHARACTERSET iso8859-1><0xA5></CHARACTERSET>">
<!entity openanglequote SDATA "<CHARACTERSET iso8859-1><0xAB></CHARACTERSET>">
<!entity squared SDATA "<CHARACTERSET iso8859-1><0xB2></CHARACTERSET>">
<!entity cubed SDATA "<CHARACTERSET iso8859-1><0xB3></CHARACTERSET>">
<!entity closeanglequote SDATA "<CHARACTERSET iso8859-1><0xBB></CHARACTERSET>">
<!entity one-fourth SDATA "<CHARACTERSET iso8859-1><0xBC></CHARACTERSET>">
<!entity one-half SDATA "<CHARACTERSET iso8859-1><0xBD></CHARACTERSET>">
<!entity three-fourths SDATA "<CHARACTERSET iso8859-1><0xBE></CHARACTERSET>">
<!entity invert-question SDATA "<CHARACTERSET iso8859-1><0xBF></CHARACTERSET>">

View file

@ -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] <filename>"
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 <charset> <filename>."
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] <filename>"
echo ""
echo "... where the options are:"
echo ""
echo " -memo Includes writer's memos entered with <memo>."
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 <charset> Sets the default characterset to <charset>."
echo ""
echo "_________________________________________"
echo "To remove all files generated by HelpTag:"
echo ""
echo " helptag -clean <filename>"
echo ""
echo "_________________________________"
echo "To list all of the file entities:"
echo ""
echo " helptag -files <filename>"
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 <class>.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."

View file

@ -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"

View file

@ -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........ ",
" .................... ",
" .................. ",
" .............. ",
" ........ ",
" ",
" "};

View file

@ -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 "};

View file

@ -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))

View file

@ -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)

View file

@ -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 <string.h>
#include <stdlib.h>
#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;
}

View file

@ -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 <stdio.h>
#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 <PARAM>, <USEMAP>, or <MIN> 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);

View file

@ -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 <stdlib.h>
#include "context.h"
#include "build.h"
#include "delim.h"
#include "version.h"
/* Verify that <PARAM>, <MIN> or <USEMAP> 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() ;
}

View file

@ -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, "<USEMAP> or <ADDMAP>") ;}
;
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, "<USEMAP> or <ADDMAP>");
}
}
;
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
;

View file

@ -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 <string.h>
#include <stdlib.h>
#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) ;
}

View file

@ -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 ;
}

View file

@ -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 <stdlib.h>
#include "build.h"
#include "context.h"
#include "delim.h"
/* Addarc adds an arc from FSA state <from> to state <to> 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) ;
}

View file

@ -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 <string.h>
#include <stdlib.h>
#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<ELEMENT %s>\n", eltp->enptr) ;
if (eltp->parptr)
{
fputs(" /*\n", tempfile) ;
fputs(" <PARAM>\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(" /*<STRING-CODE>*/\n", tempfile) ;
fputs(" <START-CODE>\n", tempfile) ;
fputs(" <START-STRING><\\START-STRING>\n", tempfile) ;
fputs(" /*<TEXT-CODE>*/\n", tempfile) ;
fputs(" /*<PI-CODE>*/\n", tempfile) ;
fputs(" <END-CODE>\n", tempfile) ;
fputs(" <END-STRING><\\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, "<!ENTITY %s %s \"\">\n",
ent->name,
enttype(ent->type)
) ;
}
}
if (undefent) fputs("*/\n", tempfile) ;
fputs("<SIGN-ON>\n", tempfile) ;
fputs("<GLOBAL-DEFINE>\n<GLOBAL-DECLARE>\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"

View file

@ -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 <stdlib.h>
#include <string.h>
#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) ;
}
}

View file

@ -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);

View file

@ -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 <string.h>
#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

View file

@ -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 <string.h>
#include <stdlib.h>
#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;
}

View file

@ -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 <stdlib.h>
#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) ;
}

View file

@ -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()

View file

@ -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) ; */
}
;

View file

@ -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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#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() ;
}

View file

@ -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) ;

View file

@ -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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#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 <time.h>
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 <sochar ; i++)
fprintf(sgfile, " %d,\n", signonmsg[i]);
if (sochar) fputs(" 10,\n", sgfile);
for (p = signon1 ; *p ; p++)
fprintf(sgfile, " %d,\n", *p);
for (p = iffile ; *p ; p++)
fprintf(sgfile, " %d,\n", *p);
for (p = signon2 ; *p ; p++)
fprintf(sgfile, " %d,\n", *p);
for (p = timeofday ; *p ; p++)
fprintf(sgfile, " %d,\n", *p);
fputs(" 0} ;\n", sgfile);
fclose(sgfile);
}
/* Closes a start-string or end-string */
void endstring(void)
{
if (instring) {
if (stringstart) stringstart = FALSE;
else fprintf(string, ",\n");
stringcnt++;
instring = FALSE;
fprintf(string, " 0");
}
/* If called after ENDFILE, ensure at least one character in output file*/
else if (stringstart) fprintf(string, " 0");
}
/* Set the type of an entity and check if different than declaration in
BUILD */
void enttype(type)
int type;
{
if ((entity->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"

View file

@ -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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#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"

View file

@ -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);

View file

@ -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 <stdio.h>
#include <string.h>
#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

View file

@ -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

View file

@ -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 */

View file

@ -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
;

View file

@ -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 */

View file

@ -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 <stdlib.h>
/* 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 "<!--Index" */
if (first)
{
testindexfile(first);
fseek(first, 0L, SEEK_SET);
filefound = TRUE;
}
return((void *) first);
}
/* Set program options */
void m_setoptions()
{
/* F option used for FILELIST (checking done in basename, which is
called before this function is called) */
if (m_argc > 2) {
m_optstring(m_argv[2]);
if (strchr(m_argv[2], 'o')) tracetostd = TRUE;
if (strchr(m_argv[2], 'O')) tracetostd = TRUE;
if (strchr(m_argv[2], 'x')) showmem = TRUE;
if (strchr(m_argv[2], 'X')) showmem = TRUE;
/* Option "p" tells the search path to look at paths one level
higher when relative pathes are specified.
The following two lines of code should be here, but they are moved
to global START-CODE of tex.if. For some reason, global START-CODE
is executed before this procedure is called (parser.c), but we need
to have the order reversed. Moving this procedure to a spot earlier
is risky, since we don't know full reasons of why things are in a
particular order. This way, we minimize the damage:
if (strchr(m_argv[2], 'p')) parentsrch = TRUE;
if (strchr(m_argv[2], 'P')) parentsrch = TRUE;
*/
}
}
/* Process signon message text, stripping out MARKUP version number, so
only one version number will appear */
void m_signmsg(p)
char *p;
{
char *q;
char *pCopy;
if (q = strstr(p, VERSION)) {
pCopy = strdup(p);
q = strstr(pCopy, VERSION);
*q = M_EOS;
m_errline(pCopy);
free(pCopy);
return;
}
m_errline(p);
}
/* All entity declarations have been processed. Can now check if .TEX
file uptodate and open appropriate output file */
void m_startdoc()
{
LOGICAL init = TRUE;
unsigned char type;
M_WCHAR *content;
unsigned char wheredef;
M_WCHAR *name;
M_WCHAR *qfile;
char *mbyte;
/* set locale */
SetDefaultLocale();
if (! filelist)
{
texinit();
}
else
{ /* list files that make up document */
while (name = m_cyclent(init, &type, &content, &wheredef))
{
init = FALSE;
qfile = NULL;
if (type == M_SYSTEM)
qfile = searchforfile(content);
if (qfile)
{
mbyte = MakeMByteString(qfile);
puts(mbyte);
m_free(qfile, "figure filename");
m_free(mbyte, "multi-byte string");
}
else if (type == M_SYSTEM)
m_err2("Can't find file %s (declared in entity %s)", content, name);
}
if (idxpath) puts(idxpath);
exit(m_errexit);
}
if (showmem) showmemavail(); /* markup's X option, (causes an exit) */
}
/* Write debugging trace information */
void m_trace(p)
char *p;
{
if (tracetostd) fputs(p, stdout);
else fputs(p, m_outfile);
}
void m_wctrace(p)
M_WCHAR *p;
{
char *mb_p;
mb_p = MakeMByteString(p);
m_trace(mb_p);
m_free(mb_p,"multi-byte string");
}

View file

@ -1,138 +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: default.c /main/3 1995/11/08 11:15:45 rswiston $ */
/*
Copyright 1988, 1989, 1992 Hewlett-Packard Co.
*/
/* HP Tag to TeX default processing */
#include "userinc.h"
#include "globdec.h"
int vextextsize(const M_WCHAR *keyword)
{
if (!keyword) return NORMAL;
if (! m_wcmbupstrcmp(keyword, QNORMAL)) return NORMAL;
else if (! m_wcmbupstrcmp(keyword, QSMALLER)) return SMALLER;
else if (! m_wcmbupstrcmp(keyword, QSMALLEST)) return SMALLEST;
m_err1("Unexpected value for ex/vex textsize parameter: %s", keyword);
return NORMAL;
}
int vgloss(const M_WCHAR *keyword)
{
if (!keyword) return GLOSS;
if (! m_wcmbupstrcmp(keyword, QGLOSS)) return GLOSS;
else if (! m_wcmbupstrcmp(keyword, QNOGLOSS)) return NOGLOSS;
m_err1("Unexpected value for gloss parameter: %s", keyword);
return GLOSS;
}
int vcenter(const M_WCHAR *keyword)
{
if (!keyword) return CENTER;
if (! m_wcmbupstrcmp(keyword, QLEFT)) return LEFT;
else if (! m_wcmbupstrcmp(keyword, QCENTER)) return CENTER;
else if (! m_wcmbupstrcmp(keyword, QRIGHT)) return RIGHT;
m_err1("Unexpected value for center parameter: %s", keyword);
return CENTER;
}
int vnumber(const M_WCHAR *keyword)
{
if (!keyword) return NONUMBER;
if (! m_wcmbupstrcmp(keyword, QNUMBER)) return NUMBER;
else if (! m_wcmbupstrcmp(keyword, QNONUMBER)) return NONUMBER;
m_err1("Unexpected value for number parameter: %s", keyword);
return NONUMBER;
}
LOGICAL vstack(const M_WCHAR *keyword)
{
if (!keyword) return FALSE;
if (! m_wcmbupstrcmp(keyword, QSIDE)) return FALSE;
else if (! m_wcmbupstrcmp(keyword, QSTACK)) return TRUE;
m_err1("Unexpected value for number parameter: %s", keyword);
return FALSE;
}
int vordertype(const M_WCHAR *keyword)
{
if (!keyword) return ARABIC;
if (! m_wcmbupstrcmp(keyword, QUALPHA)) return UALPHA;
else if (! m_wcmbupstrcmp(keyword, QLALPHA)) return LALPHA;
else if (! m_wcmbupstrcmp(keyword, QARABIC)) return ARABIC;
else if (! m_wcmbupstrcmp(keyword, QUROMAN)) return UROMAN;
else if (! m_wcmbupstrcmp(keyword, QLROMAN)) return LROMAN;
m_err1("Unexpected list order type: %s", keyword);
return ARABIC;
}
int vrsectpage(const M_WCHAR *keyword)
{
if (!keyword) return NEWPAGE;
if (! m_wcmbupstrcmp(keyword, QNEWPAGE)) return NEWPAGE;
else if (! m_wcmbupstrcmp(keyword, QSAMEPAGE)) return SAMEPAGE;
m_err1("Unexpected value for rsectpage parameter: %s", keyword);
return NEWPAGE;
}
int vspacing(const M_WCHAR *keyword)
{
if (!keyword) return LOOSE;
if (! m_wcmbupstrcmp(keyword, QTIGHT)) return TIGHT;
else if (! m_wcmbupstrcmp(keyword, QLOOSE)) return LOOSE;
m_err1("Unexpected value for spacing parameter: %s", keyword);
return LOOSE;
}
int vtype(const M_WCHAR *keyword)
{
if (!keyword) return BULLET;
if (! m_wcmbupstrcmp(keyword, QORDER)) return ORDER;
else if (! m_wcmbupstrcmp(keyword, QBULLET)) return BULLET;
else if (! m_wcmbupstrcmp(keyword, QPLAIN)) return PLAIN;
else if (! m_wcmbupstrcmp(keyword, QMILSPEC)) return ORDER;
else if (! m_wcmbupstrcmp(keyword, QCHECK)) return CHECK;
m_err1("Unexpected list type: %s", keyword);
return BULLET;
}

View file

@ -1,73 +0,0 @@
Copyright 1988, 1989 Hewlett-Packard Co.
Delimiter definitions for BUILD.
comment --
produces ->
except <EXCEPT>
paropen <!PARAM
param <PARAM>
shortref <!SHORTREF
usemap <USEMAP
addmap <ADDMAP
empty #EMPTY
entstart <!ENTITY
tagc >
ero &
entsystem FILE
entst STARTTAG
entet ENDTAG
entmd MD
entpi PI
entsdata SDATA
min <MIN>
grpo (
grpc )
emi !
incl +
excl -
psep ,
rend ;
opt ?
plus +
rep *
seq ,
or |
and &
vi =
entlit "
lit "
entlita '
lita '
rnicdata #PCDATA
connor |
connseq ,
connand &
current #CURRENT
required #REQUIRED
nulldef #IMPLIED
any ANY
none EMPTY
rcdata RCDATA
cdata CDATA
cro &#
litrs &#RS
litrsc &#RS;
litre &#RE
litrec &#RE;
littab &#TAB
littabc &#TAB;
litspace &#SPACE
litcspace &#SPACE;
refc ;
id ID
idref IDREF
idrefs IDREFS
nametype NAME
names NAMES
nmtoken NAMETOKEN
nmtokens NAMETOKENS
number NUMBER
numbers NUMBERS
nutoken NUMBERTOKEN
nutokens NUMBERTOKENS
entatt ENTITY

View file

@ -1,58 +0,0 @@
Copyright 1988, 1989 Hewlett-Packard Co.
Delimiter definitions for ELTDEF.
startcomment /*
endcomment */
entstart <!ENTITY
entsystem FILE
entst STARTTAG
entet ENDTAG
entmd MD
entpi PI
entsdata SDATA
entcdata CDATA
typecode CODE
endofcode <\CODE>
entlit "
entlita '
lit "
lita '
cro &#
litrs &#RS
litrsc &#RS;
litre &#RE
litrec &#RE;
littab &#TAB
littabc &#TAB;
litspace &#SPACE
litcspace &#SPACE;
refc ;
signon <SIGN-ON>
gdef <GLOBAL-DEFINE>
gdec <GLOBAL-DECLARE>
elt <ELEMENT
tagc >
sep ,
grpo (
grpc )
param <PARAM>
vi =
rend ;
inisstring <START-STRING>
sss <START-STRING
iniestring <END-STRING>
ess <\START-STRING>
ses <END-STRING
ees <\END-STRING>
inistart <START-CODE>
scode <START-CODE
iniend <END-CODE>
ecode <END-CODE
initext <TEXT-CODE>
tcode <TEXT-CODE
initpi <PI-CODE>
pcode <PI-CODE
inistring <STRING-CODE>
stcode <STRING-CODE
wildcard *

View file

@ -1,39 +0,0 @@
Copyright 1988, 1989 Hewlett-Packard Co.
Delimiter definitions for PARSER.
m_comment --
m_mdo <!
m_mdc >
m_usemap USEMAP
m_addmap ADDMAP
m_empty #EMPTY
m_entkw ENTITY
m_entst STARTTAG
m_entet ENDTAG
m_entcdata CDATA
m_entsdata SDATA
m_entsystem FILE
m_entmd MD
m_entpi PI
m_stago <
m_etago <\
m_pio <?
m_tagc >
m_pic >
m_vi =
m_lit "
m_litdelim "
m_lita '
m_litadelim '
m_cro &#
m_litrs &#RS
m_litscr &#RS;
m_litre &#RE
m_litecr &#RE;
m_litspace &#SPACE
m_litcspace &#SPACE;
m_littab &#TAB
m_litctab &#TAB;
m_ero &
m_refc ;
m_net |

View file

@ -1,29 +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: figure.c /main/3 1995/11/08 11:15:56 rswiston $ */
/*
Copyright 1988, 1989 Hewlett-Packard Co.
*/
/* Figure.c contains HP Tag to TeX figure processing */
/* Obsolete */

View file

@ -1,447 +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: fproto.h /main/3 1995/11/08 11:16:08 rswiston $ */
/* Copyright (c) 1988, 1989, 1990 Hewlett-Packard Co. */
/* Function prototypes for HP Tag/TeX translator */
void appstart(M_WCHAR *id, M_WCHAR *letter);
void assert_hometopic_exists(void);
void badgraphic(int filestat);
void basename(void);
void calcdisp (M_WCHAR *file, M_WCHAR *startrow, M_WCHAR *endrow,
M_WCHAR *clip, M_WCHAR *margin);
void callndbeg (void);
void callndend (void);
/* used by ccompspec(), cmenlspec(), and cwmenlspec() */
char *ccharspec(M_WCHAR textchar);
void ccmpiooutchar (M_WCHAR textchar);
void ccompesoutchar (M_WCHAR textchar, FILE *outfile);
void ccompexoutchar (M_WCHAR textchar, FILE *outfile);
void ccompoutchar (M_WCHAR textchar, FILE *outfile);
/* special computer expansions for dot matrix(computer) in calculator style */
char *ccompspec(M_WCHAR textchar);
void chapstart(M_WCHAR *id, M_WCHAR *number, char type[]);
M_WCHAR *checkdimen(M_WCHAR *val, M_WCHAR *paramname, M_WCHAR *elt);
M_WCHAR *mb_checkdimen(M_WCHAR *val, char *paramname, char *elt);
M_WCHAR *checkent(M_WCHAR *entcontent);
void checkgloss(void);
M_WCHAR *checkid(M_WCHAR *id);
void checkmsghead (void);
M_WCHAR *checkreal (M_WCHAR *val, M_WCHAR *paramname, LOGICAL msgout, M_WCHAR *elt);
LOGICAL chkplottype(M_WCHAR *val, int *p1x, int *p1y, int *p2x, int *p2y, LOGICAL prnt );
void cmloutchar (M_WCHAR textchar, FILE *outfile);
/* special menu lable character expansions */
char *cmenlspec(M_WCHAR textchar);
void cspotend(M_WCHAR *file, int graphics, M_WCHAR *xwidth, M_WCHAR *xheight);
void cspotstart(M_WCHAR *file, int graphics, M_WCHAR *xwidth, M_WCHAR *xheight);
void csubtc (M_WCHAR textchar, FILE *outfile, M_WCHAR *parent);
void csuptc (M_WCHAR textchar, FILE *outfile, M_WCHAR *parent);
/* special white menu label character expansions */
char *cwmenlspec(M_WCHAR textchar);
void cwmloutchar(M_WCHAR textchar, FILE *outfile);
void defxref(FILE *xfile, M_WCHAR *id, struct xref *xref);
int do_esc_seq(void);
void dumpxref(void);
void echohead(M_WCHAR *p);
void mb_echohead(char *p);
void endhead(void);
void endhelpnode(void);
void esoutchar(M_WCHAR textchar);
void exoutchar(M_WCHAR textchar);
void exvexend(M_WCHAR *textsize);
void exvexstart(M_WCHAR *type, M_WCHAR *textsize, char *listinfo);
void figend (M_WCHAR *id);
int figext (M_WCHAR *fname);
int figlist (char *fnin);
void figraster(M_WCHAR *file, M_WCHAR *magnify,
M_WCHAR *width, M_WCHAR *depth, M_WCHAR *hadjust, M_WCHAR *vadjust,
M_WCHAR *mirror, M_WCHAR *margin, M_WCHAR *clip,
M_WCHAR *penwidth,M_WCHAR *plottype, M_WCHAR *callout, M_WCHAR *textsize);
void figstart(M_WCHAR *number, M_WCHAR *tonumber, M_WCHAR *id, M_WCHAR *file,
M_WCHAR *type, M_WCHAR *oldtype,
M_WCHAR *xmagnify,M_WCHAR *xwidth, M_WCHAR *xdepth, M_WCHAR *xhadjust,
M_WCHAR *xvadjust,M_WCHAR *border, M_WCHAR *video, M_WCHAR *strip,
M_WCHAR *mirror, M_WCHAR *margin, M_WCHAR *clip,
M_WCHAR *penwidth,M_WCHAR *snap, M_WCHAR *autoscale, M_WCHAR *plottype,
M_WCHAR *callout, M_WCHAR *textsize);
void figvector(M_WCHAR *file, M_WCHAR *magnify,
M_WCHAR *width, M_WCHAR *depth, M_WCHAR *hadjust, M_WCHAR *vadjust,
M_WCHAR *mirror, M_WCHAR *margin, M_WCHAR *clip,
M_WCHAR *penwidth, M_WCHAR *autoscale, M_WCHAR *plottype, M_WCHAR *callout,
M_WCHAR *textsize);
unsigned get2b(FILE *fh);
unsigned long get4b(FILE *fh);
unsigned long getPCLdims (char *fn);
int getqualified (M_WCHAR *qualname, M_WCHAR *unqualname);
int mb_getqualified (char *qualname, char *unqualname);
void handle_link_and_graphic(M_WCHAR *parent, M_WCHAR *gentity, M_WCHAR *gposition, M_WCHAR *ghyperlink,
M_WCHAR *glinktype, M_WCHAR *gdescription);
void keyesoutchar (M_WCHAR textchar);
void idstring(M_WCHAR *string);
void indexchar(M_WCHAR textchar);
void item(M_WCHAR *id);
char *m_itoa(int n, char *s);
void itoletter(int n, char start, char *dest, int length);
LOGICAL m_letter(M_WCHAR c);
void loadxref(void);
int m_lower(int c);
char *makecsname(M_WCHAR *id);
void manustart(M_WCHAR *language, M_WCHAR *idxvol, M_WCHAR *status);
void notimp(char *eltname, char *option);
M_WCHAR *okdimen (M_WCHAR *val);
void onlygraphic(char *param, M_WCHAR *magnify, M_WCHAR *video, M_WCHAR *mirror,
M_WCHAR *margin, M_WCHAR *clip, M_WCHAR *penwidth, M_WCHAR *autoscale,
M_WCHAR *plottype, M_WCHAR *hadjust, M_WCHAR *vadjust);
void open_new_helpfile(void);
void notallow(char *param1, char *param2);
void options(LOGICAL filelenonly);
void outcall(M_WCHAR textchar, FILE *outfile);
void outchar(M_WCHAR textchar, FILE *outfile);
void outpi(int enttype, M_WCHAR *pi, M_WCHAR *entname);
void parspace(void);
LOGICAL pushndok(LOGICAL val);
LOGICAL popndok(void);
void prfigborder(int val);
void prfigclip(M_WCHAR figmargin [NFIGSIDES] [M_NAMELEN+1]);
void prfigheight(char *val);
void prfigmagnify(char *val);
void prfigmargin(M_WCHAR figmargin [NFIGSIDES] [M_NAMELEN+1]);
void prfigpenwds(long penwdarray[MAXPENS]);
void prfigwidth(char *val);
LOGICAL print_vectors(FILE * hOutFile, PTWTXT **Points, int *maxcalltxt, FILE *hCalFile, int CalNo);
void prplottype(int p1x, int p1y, int p2x, int p2y);
float readcoord(FILE *fh);
float readinches(FILE *fh);
void realoutchar(M_WCHAR textchar, FILE *outfile);
void rsectstart(M_WCHAR *id, M_WCHAR *pagebreak);
void rseqend(void);
void rshnewclear(void);
M_WCHAR *searchforfile(M_WCHAR *file);
void setid(M_WCHAR *id,
LOGICAL where,
LOGICAL csensitive,
LOGICAL inchapter,
char *chapter,
M_WCHAR *xrffile,
int xrfline,
LOGICAL xrefable);
void setopt(char *string, LOGICAL filelenonly);
LOGICAL setvalopt(int thisopt, char *string, LOGICAL filelenonly);
void shchar(M_WCHAR textchar,
int *len,
int max,
M_WCHAR *string,
void (*proc)(M_WCHAR *string),
char *msg,
LOGICAL *errflg);
void mb_shchar(char textchar,
int *len,
int max,
M_WCHAR *string,
void (*proc)(M_WCHAR *string),
char *msg,
LOGICAL *errflg);
void shstring(M_WCHAR *addstring,
int *len,
int max,
M_WCHAR *storestring,
char *msg,
LOGICAL *errflg);
void mb_shstring(char *addstring,
int *len,
int max,
M_WCHAR *storestring,
char *msg,
LOGICAL *errflg);
void starthelpnode(M_WCHAR *id,
LOGICAL suppress_topic_map);
void mb_starthelpnode(char *id,
LOGICAL suppress_topic_map);
void startlablist(M_WCHAR *longlabel, M_WCHAR *width, M_WCHAR *spacing);
void startlist(M_WCHAR *type, M_WCHAR *order, M_WCHAR *spacing, M_WCHAR *cont);
void strcode(M_WCHAR *string, FILE *outfile);
void mb_strcode(char *string, FILE *outfile);
#if defined(hpux) || defined(__aix) || defined(sun)
char *strstr(const char *s1, const char *s2);
#endif
void svhdstring(M_WCHAR *string);
void svtcstring(M_WCHAR *string);
void taboutre(void);
void termchar(M_WCHAR textchar);
void termpi(int m_enttype, M_WCHAR *m_pi, M_WCHAR *m_entname);
void testindexfile(FILE *first);
void texinit(void);
void unimp(M_WCHAR *eltname);
void mb_unimp(char *eltname);
int m_upstrcmp(char *p, char *q);
int vextextsize(const M_WCHAR *keyword);
int vgloss(const M_WCHAR *keyword);
int vcenter(const M_WCHAR *keyword);
int vnumber(const M_WCHAR *keyword);
int vordertype(const M_WCHAR *keyword);
int vrsectpage(const M_WCHAR *keyword);
int vspacing(const M_WCHAR *keyword);
int vtype(const M_WCHAR *keyword);
void xrefexpand(M_WCHAR *id);
void rtrim(char *s);
double usertopt(M_WCHAR *s);
double mb_usertopt(char *s);
long usertosp(char *s);
void whereneedused(void);
void t_addnotes(M_WCHAR *tnoteid);
void t_prntnotes(void);
LOGICAL t_want_a_Q(int span_count);
void t_xrefnotes(M_WCHAR *tnoteid);
int t_getnum(char *s);
void t_insertcellmarkup(void);
void t_newpage(void);
void t_startcolh(void);
void t_start_tabhead_colh(void);
void t_nextcell(void);
void t_checkcaption(void);
void t_preamble(void);
void t_getstyle(void);
void t_dospan(LOGICAL in_colh);
void t_startcell(M_WCHAR *span, M_WCHAR *vspan, char *msg);
void t_endcell(M_WCHAR *span, M_WCHAR *vspan);
void t_startrow(void);
void t_endrow(M_WCHAR *taglevone);
void sizetofloat(int column, char *s);
void t_tabstart(M_WCHAR *style, M_WCHAR *id, M_WCHAR *number, M_WCHAR *box, M_WCHAR *rule,
M_WCHAR *vrule, M_WCHAR *hrule, M_WCHAR *vcount, M_WCHAR *hcount,
M_WCHAR *spacing, M_WCHAR *width, M_WCHAR *position,
M_WCHAR *tonumber, M_WCHAR *divide, M_WCHAR *textsize);
void t_tablebody(void);
void t_sendout_rowrule(void);
void showmemavail(void);
int m_upper(int c);
char *GetDefaultHeaderString(char *elementName,
unsigned char desiredType,
char *defaultString);
void SetDefaultLocale(void);
char *MakeMByteString(const M_WCHAR *from);
M_WCHAR *MakeWideCharString(const char *from);
void paragraph(M_WCHAR *indent,
M_WCHAR *id,
M_WCHAR *gentity,
M_WCHAR *gposition,
M_WCHAR *ghyperlink,
M_WCHAR *glinktype,
M_WCHAR *gdescription,
char *listinfo);
void figure(M_WCHAR *number,
M_WCHAR *tonumber,
M_WCHAR *id,
M_WCHAR *file,
M_WCHAR *figpos,
M_WCHAR *cappos,
M_WCHAR *oldtype,
M_WCHAR *xwidth,
M_WCHAR *xdepth,
M_WCHAR *xhadjust,
M_WCHAR *xvadjust,
M_WCHAR *border,
M_WCHAR *type,
M_WCHAR *xmagnify,
M_WCHAR *video,
M_WCHAR *strip,
M_WCHAR *mirror,
M_WCHAR *margin,
M_WCHAR *clip,
M_WCHAR *penwidth,
M_WCHAR *snap,
M_WCHAR *autoscale,
M_WCHAR *plottype,
M_WCHAR *callout,
M_WCHAR *textsize,
M_WCHAR *ghyperlink,
M_WCHAR *glinktype,
M_WCHAR *gdescription,
char *listinfo);
void endterm(M_WCHAR *base,
M_WCHAR *gloss,
int linktype);
M_WCHAR wc_toupper(M_WCHAR wc);

View file

@ -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
*/
/* $TOG: global.h /main/4 1998/04/06 13:17:04 mgreess $ */
/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */
/* Global definitions for HP Tag/TeX translator */
/* When changing this file, check "grphpar.h" for conflicts */
#if defined(DEFINE)
#define EXTERN
#define INIT(a) = a
#else
#define EXTERN extern
#define INIT(a)
#endif
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#include <locale.h>
#endif
#define MAXHEADLINES 3
#define FNAMELEN 513
#define BIGBUF 1024
/* substitute for m_ctupper; we don't cast x into (int), thereby
avoiding any problems of high order bit. This is in response
to "Entity no allowed in ART" messages by cupertino. However,
this more of a loose deduction, and really needs confirmation. */
#define ctupper(x) (m_ctarray[x].upper)
/* Must be in same order as values in optkey, adjust NUMOPTIONS if changed*/
#define DRAFT 1
#define FINAL 2
#define MEMO 3
#define NOMEMO 4
#define SEARCHKEY 5
#define CLEARSEARCH 6
#define LONGFILES 7
#define LONGFILE 8
#define LONG 9
#define SHORTFILES 10
#define SHORTFILE 11
#define SHORT 12
#define CHARSET 13
#define ONERROR 14
#if defined(FUTURE_FEATURE)
#define GRAPHICS 15
#define NOGRAPHICS 16
#define REV 17
#define NOREV 18
#endif /* FUTURE_FEATURE */
#define NUMOPTIONS 14
EXTERN int optval INIT(M_NULLVAL) ;
EXTERN char *optkey[NUMOPTIONS]
#if defined(DEFINE)
= {
"draft",
"final",
"memo",
"nomemo",
"search",
"clearsearch",
"longfiles",
"longfile",
"long",
"shortfiles",
"shortfile",
"short",
"charset",
"onerror",
#if defined(FUTURE_FEATURE)
"graphics",
"nographics",
"rev",
"norev",
#endif /* FUTURE_FEATURE */
}
#endif
;
/* Processing options */
EXTERN LOGICAL final INIT(FALSE) ;
EXTERN LOGICAL memo INIT(FALSE) ;
EXTERN int rebuild INIT(FALSE) ;
EXTERN LOGICAL stoponerror INIT(TRUE) ;
#if defined(FUTURE_FEATURE)
EXTERN LOGICAL prntrevs INIT(FALSE) ;
#endif /* FUTURE_FEATURE */
/* variables for index sorting and tagging in the scripts */
/* we create a child directory for processing the index, so as not
to clobber any files with the same base name. However, this will
affect search paths that are relative; those that are relative
need to have parent level prepended. This is done only when
"parentsrch" is set to TRUE; done only when we process indexes. */
EXTERN LOGICAL parentsrch INIT(FALSE) ;
EXTERN char *idxfile INIT(NULL) ; /* index file name only */
EXTERN char *idxpath INIT(NULL) ; /* index file name w/path */
EXTERN char *idxbase INIT(NULL) ; /* index base name only */
/* TeX counter for chapter number */
#define FRONTCOUNT 0
#define APPCOUNT 1000
#define TOCCOUNT 2000
#define MSGCOUNT 3000
#define BIBCOUNT 4000
#define GLOSSCOUNT 5000
#define INDEXCOUNT 6000
/* flag for TeX output while in HelpTag parser */
EXTERN LOGICAL texoutput INIT(FALSE);
/* Flag for filelist vs. Tag to TeX translator */
EXTERN LOGICAL filelist INIT(FALSE) ;
/* NOTE: If driver is redimensioned, a change is needed in texinit() */
EXTERN char driver[20]
#if defined(hpux)
INIT("HPUX")
#endif
#if defined(_AIX)
INIT("AIX")
#endif
#if defined(__linux__)
INIT("LINUX")
#endif
#if defined(sun)
INIT("SUN")
#endif
;
EXTERN M_WCHAR *helpcharset INIT(NULL);
/* Working directory, input directory, installation directory,
and search paths */
EXTERN LOGICAL defaultext ;
EXTERN M_WCHAR *inputname; /* pointer to name of main input file */
EXTERN char *base ;
EXTERN char *baseext ;
EXTERN char *nodirbase ;
EXTERN char *work INIT("") ;
EXTERN char *indir INIT(NULL) ;
EXTERN char *install INIT(NULL) ;
typedef struct search SEARCH ;
struct search {
char *directory ;
SEARCH *next ;
} ;
EXTERN SEARCH *path INIT(NULL) ;
EXTERN SEARCH **endpath INIT(&path) ;
EXTERN char dirsep
#if defined(hpux) || defined(_AIX) || defined(sun)
INIT('/')
#else
****define directory separator here****
#endif
;
#if defined(hpux) || defined(_AIX) || defined(sun)
#define CSEP '/'
#define SSEP "/"
#else
****define directory separator here****
#endif
/* Location in .TEX file of two \wlog messages */
EXTERN long wlog ;
/* True if have encountered idx or idxsyn */
EXTERN LOGICAL have_index INIT(FALSE) ;
EXTERN long idxupdate INIT(0L) ; /* file/seek pointer for make facility */
/* True within a sequence of rsect's */
EXTERN LOGICAL rsectseq INIT(FALSE) ;
/* True if SAMEPAGE for this rsect sequence */
EXTERN LOGICAL rsectsame ;
/* True if have encountered <NEWPAGE> in a SAMEPAGE <RSECT>*/
EXTERN LOGICAL rsectholdnew ;
/* True in an rsect that has an abbreviated head */
EXTERN LOGICAL didabbrev ;
/* True if this manual has a glossary */
EXTERN LOGICAL glossary INIT(FALSE) ;
/* True while processing a note if a head was encountered */
EXTERN LOGICAL notehead ;
/* String emitted at start of note, caution or warning */
EXTERN char ncwStart[] INIT("<PARAGRAPH %s after 0 left 5 first 5 right 0>\n\
<TYPE serif><WEIGHT bold>");
/* String emitted at end of note, caution or warning */
EXTERN char ncwEnd[] INIT("%s</WEIGHT></TYPE></PARAGRAPH>\n\
<PARAGRAPH before 0 after 0 left 5 right 0>\n");
/* String emitted if a graphic is present for note, caution or warning */
EXTERN char ncwGraphic[] INIT("<LABEL><GRAPHIC file %s></LABEL>\n");
/* String emitted to position note, caution or warning in a tight list */
EXTERN char *ncwTightList INIT("");
/* File address for "Generated TeX file complete" message */
EXTERN long texcomplete ;
/* File pointer for cross-reference file */
EXTERN FILE *xrf ;
/* global link type pointer, used in xref to match latest link type */
EXTERN int global_linktype INIT (0);
/* pointers to image parameters for use in imagetext */
EXTERN M_WCHAR *indentp;
EXTERN M_WCHAR *imagegentityp;
EXTERN M_WCHAR *imagegpositionp;
EXTERN M_WCHAR *imageghyperlinkp;
EXTERN M_WCHAR *imageglinktypep;
EXTERN M_WCHAR *imagegdescription;
/* indent for p, image, ex, vex, based on plain list */
#define LISTFIRSTINDENT 2
#define LISTITEMINDENT 2
#define LEFTINDENT (LISTFIRSTINDENT + LISTITEMINDENT)
#define ORDEREDLISTFIRSTINDENT 1
#define ORDEREDLISTITEMINDENT 3
#define ORDEREDLEFTINDENT (ORDEREDLISTFIRSTINDENT + ORDEREDLISTITEMINDENT)
/* File offset after preamble, and before \bye. Used to determine
whether content found in the document */
EXTERN long postpreamble INIT(0L) ;
EXTERN long prebye INIT(0L) ;
EXTERN LOGICAL filefound INIT(FALSE) ;
/* Chapter or appendix number */
EXTERN int part INIT(0) ;
EXTERN int chapter INIT(0) ;
EXTERN int chapinc INIT(0) ;
EXTERN char chapstring[15] INIT("0") ;
#define NODEID_LENGTH 204
/* name of current node */
EXTERN M_WCHAR nodeid[NODEID_LENGTH+1];
/* Node number for autogenerated node id */
EXTERN int autonodenumber INIT(1);
EXTERN char nodestring[15] INIT("0");
/* Node level variables */
EXTERN int lastnodelevel INIT(0);
EXTERN int thisnodelevel INIT(0);
/* Offset of node from beginning of file */
EXTERN long int nodeoffset INIT(0);
EXTERN M_WCHAR *savehelpfilename INIT(NULL);
/* is this the first node of a .ht file? */
EXTERN LOGICAL firstnode INIT(TRUE);
/* flag for omitting first newline in topic map file */
EXTERN LOGICAL isfirsttopicmap INIT(TRUE);
EXTERN LOGICAL nohometopic INIT(TRUE);
EXTERN long topicoffset INIT(0L);
EXTERN int htfileno INIT(1);
/* The first tag in the front section should trigger the node */
EXTERN LOGICAL have_a_frontnode INIT(FALSE);
EXTERN char *helpbase INIT(NULL);
EXTERN char *helpext;
/* small buffer for scratch work */
EXTERN char helptmpbuf[2] INIT("0");
/* Should we use these BASENAME_LIMIT on the size of file names? */
LOGICAL usingshortnames INIT(FALSE);
/* Limit on how long the basename can be for a .ht file */
#define BASENAME_LIMIT 6
/* limit on how many additional character are allowed before the ext */
/* (How many chapter numbers foo``12''.ht */
#define PRE_EXTENSION_LIMIT 2
EXTERN FILE *indexfp;
EXTERN FILE *docregfp;
EXTERN FILE *idtablefp;
EXTERN FILE *topicmapfp;
/* Whether have processed anything in chapter or appendix */
EXTERN LOGICAL chapst INIT(FALSE) ;
/* Whether have just started a fourth-level section */
EXTERN LOGICAL st4 INIT(FALSE) ;
/* TRUE for chapter, FALSE for appendix */
EXTERN LOGICAL inchapter INIT(TRUE) ;
/* Figure number within this chapter or appendix */
EXTERN int figno ;
/* Options on a particular figure */
EXTERN int ftype, fborder, ftonumber, fvideo, fstrip, fsnap, fautoscale,
fmaxlistrows ;
/* Table number within this chapter or appendix */
EXTERN int tableno ;
/* footnote number */
EXTERN int footnoteno INIT(0);
/* True while processing abbrev head for page footer */
EXTERN LOGICAL fabbrev INIT(FALSE) ;
EXTERN LOGICAL abbrev INIT(FALSE) ;
EXTERN FILE *outfile ;
/* re-directing output to nothing, eg. used for unimplemented tags */
EXTERN FILE *nullfile ;
/* save the old outfile when redirecting data to nullfile */
EXTERN FILE *CDROMsaveoutfile ;
/* save the old outfile when redirecting header/footer data to nullfile */
EXTERN FILE *HFsaveoutfile;
/* True if a figure or table has a caption */
EXTERN LOGICAL figcaption ;
EXTERN LOGICAL tabcaption ;
EXTERN LOGICAL had_an_otherfront_head INIT(FALSE);
/* For softkeys */
EXTERN int sklines, skchars ;
/* contains current m_textchar, used to see if we need to issue an italic
correction. Issue italic correction everywhere except after commas
and periods. */
EXTERN M_WCHAR cur_char INIT(' ') ;
/* Special characters */
#define O_BR '{'
#define C_BR '}'
#define ESCAPE 27
/* Error _DtMessage section */
EXTERN LOGICAL emsghead INIT(FALSE) ;
/* emsghead has three possible values:
DEFHEAD : use default error message title
USERHEAD : user specified
FALSE : do not process head (assume define is not equal to
DEFHEAD or USERHEAD)
*/
#define DEFHEAD 2
#define USERHEAD 3
/* Figure stuff */
#define FIGDEFWH "3in"
#define MAXNORMROWS 55
#define MAXSMALROWS 75
#define MAXTINYROWS 100
#define MAXPENS 8 /* when changing, check prfigpenwidths() ! */
#define MAXPENWIDTH 1864680 /* approx 1cm in scaled points */
EXTERN LOGICAL fignote ;
EXTERN int fignotePtr, in_graphic, nlines, blank_middle ;
EXTERN unsigned long ncolumns, max_columns, res_index, xx, ri ;
EXTERN LOGICAL file_ent ;
EXTERN M_WCHAR *f_content ;
EXTERN M_WCHAR f_contqual[FNAMELEN] ;
EXTERN M_WCHAR *f_file ;
/* callouts -- entfile and lineno */
EXTERN M_WCHAR *figinpath ;
EXTERN int figline INIT(0) ;
/* -- callouts -- */
#define BYTE unsigned char
#define NEWPT 0
#define NEWGROUP 1
#define NEWLINE 2
#define NEWCALLOUT 3
typedef struct tagFPOINT {
float x,y;
} FPOINT ;
typedef struct tagPwT {
FPOINT coord;
char ew[2],
ns[2],
lcr[2];
} PTWTXT ;
#define AN_desc 3
#define AN_nsew 60
#define AN_text 12
#define AN_isbros 16
#define AN_hasbros 32
#define AN_sf1 64
#define AN_sf2 128
#define SH_desc 0
#define SH_nsew 2
#define SH_text 2
#define SH_isbros 4
#define SH_hasbros 5
#define SH_sf1 6
#define SH_sf2 7
#define UNPK(c,an,sh) ((c&an)>>sh)
EXTERN FILE *calfile ;
EXTERN int maxct;
EXTERN LOGICAL okcallout ;
/* -- end callout -- */
EXTERN FILE *pclfile ;
#define VERSION "Version"
EXTERN char *version INIT(NULL) ;
EXTERN char texdone[] INIT("TeX run completed successfully.") ;
/* Code for standard library function "access" */
#define READABLE 04
/* Allowable units on dimensions */
#define SPperPT 65536.0
#define PTperIN 72.27
#define CMperIN 2.54
#define MMperIN 25.4
#define PTperPC 12.0
EXTERN char *dimarray[5]
#if defined(DEFINE)
= { "in",
"cm",
"mm",
"pc",
"pt" }
#endif
;
/* misc */
EXTERN LOGICAL unleaded INIT(FALSE) ;
EXTERN int newhline INIT(0) ;
EXTERN int synelcnt INIT(0);
/* Cross-Reference Declarations */
/* do we have foreward references? */
EXTERN LOGICAL have_forward_xrefs INIT(FALSE);
EXTERN M_WCHAR *xrffile ; /* Save file and line number for error messages */
EXTERN int xrfline INIT(0) ; /* --used to store into structure "xref" */
EXTERN M_TRIE xtree ;
struct xref {
M_WCHAR *textptr ; /* Pointer to expansion of xref */
LOGICAL defined ; /* Whether the xref has been defined */
LOGICAL wheredef ; /* Whether defined in this pass or a previous one */
LOGICAL retrieved ; /* Whether the value has been used */
LOGICAL csensitive ; /* Whether the value is chapter sensitive */
LOGICAL xrefable; /* can this be xref'd to legally? */
char *chapstring ; /* Number of chapter or appendix where it occurs */
LOGICAL inchapter ; /* Whether in chapter or appendix */
M_WCHAR *file ; /* File and line # where first referred to or */
int line ; /* first defined for error reports */
} ;
/* Value of one particular cross-reference */
EXTERN M_WCHAR xrefstring[400] ;
EXTERN int xstrlen INIT(0) ;
/* Pointer to the id */
EXTERN M_WCHAR *savid ;
EXTERN LOGICAL iderr ;
EXTERN char *imageId INIT(NULL); /* "image" id saved for "imagetext" */
/* Save head for page header in rsect and table of contents string*/
EXTERN M_WCHAR savehead[400] ;
EXTERN M_WCHAR savetabcap[400] ;
EXTERN int svheadlen ;
EXTERN int svtclen ;
EXTERN LOGICAL savhd ;
EXTERN LOGICAL savtc ;
EXTERN LOGICAL hderr ;
EXTERN LOGICAL echo ;
EXTERN LOGICAL tooutput INIT(TRUE) ;
/* Glossary Declarations */
EXTERN M_TRIE gtree ;
#define MAXTERM 200
EXTERN M_WCHAR term[MAXTERM + 1] ;
EXTERN M_WCHAR *termp ;
EXTERN LOGICAL wsterm ;
#define ENTERTERM 1
#define DEFINETERM 2
EXTERN int exlineno ;
EXTERN LOGICAL tonumexlines ;
/* Saved document title */
EXTERN M_WCHAR *savedtitle;
/* tell whether .hmi should have generic info put into it */
EXTERN LOGICAL hadtitle INIT(FALSE);
EXTERN LOGICAL hadabstract INIT(FALSE);
/* emit an empty abstract title if no head specified */
EXTERN LOGICAL needabstracthead INIT(FALSE);
/* Numeric codes corresponding to keyword parameter values */
#define FIXED 1
#define FLOAT 2
#define SIDE 1
#define STACK 2
#define COMPUTER 1
#define DISPLAY 2
/* Note that the definition of BOX was chosen so that the border
parameter on both figure and table could use it, even though these
parameters do not share all possible values */
#define BOX 1
#define TOP 2
#define BOTTOM 3
#define NOBORDER 4
#define SCREEN 5
#define NOBOX 2
#define ART 1
#define PCL 2
#define TIFF 3
#define LISTING 4
#define TEXT 5
#define HPGL 7
/* IMPORTANT: "FIG..." values should not be */
/* changed (eg. see proc "checkmargin") */
#define FIGTOP 0
#define FIGRIGHT 1
#define FIGBOTTOM 2
#define FIGLEFT 3
#define NFIGSIDES 4
#define WRAP 1
#define NOWRAP 2
/* text size macros */
#define NORMAL 1
#define SMALLER 2
#define SMALLEST 3
#define NUMBER 1
#define NONUMBER 2
#define LEFT 1
#define INDENT 2
#define CENTER 3
#define RIGHT 4
#define TIGHT 1
#define LOOSE 2
#define NORULE 1
#define HEADRULE 2
#define GRID 3
#define ORDER 0
#define BULLET 1
#define PLAIN 2
#define MILSPEC 3
#define LABEL 4
#define CHECK 5
#define UROMAN 0
#define UALPHA 1
#define ARABIC 2
#define LALPHA 3
#define LROMAN 4
#define DOTPUNCT 0
#define PARENPUNCT 1
#define NEWPAGE 0
#define SAMEPAGE 1
#define GLOSS 1
#define NOGLOSS 2
#define INVERSE 1
#define NOINVERSE 2
#define STRIP 1
#define NOSTRIP 2
#define DPENWDVAL 1
#define SNAP 1
#define NOSNAP 2
#define AUTOSCALE 1
#define NOAUTOSCALE 2
/* the values for these elements are significant...they are used to set
* TeX register values which are later tested by macros
*/
#define COMMAND 1
#define KEYS2 2
/* the values for these elements are significant...they are used to set
* TeX register values which are later tested by macros
*/
#define TWO 2
#define FOUR 4
#define EIGHT 8
#define OTHER 0
/* values for ctable tracking */
EXTERN int ctbltype;
EXTERN int ctbldisplines;
EXTERN int ctblgraphics;
/* Declarations for lists */
#define MAXLISTLEV 8
/* FIRST => first paragraph in list item. The one following the label.
FOLLOW => immediately after a figure, note, caution, warning, ex or vex
INSIDE => at least one previous paragraph
*/
enum ParagraphListLocation {FIRST, FOLLOW, INSIDE};
EXTERN LOGICAL lablistindented[MAXLISTLEV];
EXTERN int list INIT(0) ;
typedef struct contchain CONTCHAIN ;
struct contchain {
long where ;
CONTCHAIN *next ;
} ;
typedef struct list LIST ;
struct list {
int type ;
int order ;
int count ;
int space ;
unsigned char punct ;
unsigned char started ;
unsigned char where ;
LIST *lastlist ;
CONTCHAIN *chain ;
} ;
EXTERN LIST outlist
#if defined(DEFINE)
= {0, 0, 0, 0, DOTPUNCT, FALSE, FIRST, NULL, NULL}
#endif
;
EXTERN LIST *lastlist INIT(&outlist) ;
EXTERN int bulcount INIT(0) ;
/* Volume name for index */
EXTERN M_WCHAR volume[M_NAMELEN + 1] ;
/* save area for index processing */
EXTERN M_WCHAR idxsav[400] ;
/* Sort form of an index term */
EXTERN M_WCHAR sort[400] ;
/* Sort form of an index sub term */
EXTERN M_WCHAR subsort[400] ;
/* print form of index term */
EXTERN M_WCHAR print[400] ;
/* print form of index sub term */
EXTERN M_WCHAR subprint[400] ;
EXTERN int idxsavlen ;
EXTERN LOGICAL didsort ;
EXTERN LOGICAL didsubsort ;
/* Strings for constructing error messages */
EXTERN char firstused[] INIT("'%s' first used in line %d") ;
EXTERN char undef[] INIT("Undefined cross-reference %s (") ;
EXTERN char infile[] INIT("file %s, ") ;
EXTERN char online[] INIT("line %d)\n") ;
EXTERN char offile[] INIT(" of file: %s") ;
/* Whitemenu supported only in calculator, issue message only once */
EXTERN LOGICAL wmenu_err INIT(FALSE) ;
/* Repeated code at start of each text block */
#define STARTSTUFF {}
/* Pop the stack of font changes */
#define POPFONT
/* For index entries */
#define IDXSTRT1 {}
#define IDXSTRT2 {}
#define IDXSTRT IDXSTRT1 IDXSTRT2
#define IDXEND1 {}
#define IDXEND2 {}
#define IDXEND3 {}
#define IDXEND IDXEND1 IDXEND2 IDXEND3
/* Absorb consecutive <CR>'s, because TeX gets confused by them */
EXTERN LOGICAL multi_cr_flag INIT(FALSE);
/* flag for leaders within <LIST PLAIN> only */
EXTERN LOGICAL leaderok INIT(FALSE) ;
/* Direct debugging trace output to stdout or outfile */
EXTERN LOGICAL tracetostd INIT(FALSE) ;
/* show memory available */
EXTERN LOGICAL showmem INIT(FALSE);
/* Function prototypes */
#include "fproto.h"
/* Declarations for handling special characters */
#include "roman8.h"
/* Declarations for handling special characters for calculators*/
EXTERN char ccoutbuf[128] ;
/* Character conversion tables */
#include "charconv.h"

View file

@ -1,29 +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: grphpar.c /main/3 1995/11/08 11:16:39 rswiston $ */
/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */
/* HP Tag/TeX figure aspect ratio calculations */
#define GRAPHDEF
/* Obsolete */

View file

@ -1,28 +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: grphpar.h /main/3 1995/11/08 11:16:52 rswiston $ */
/* Copyright (c) 1988, 1989 Hewlett-Packard Co. */
/* Variable definitions for HP Tag/TeX for figures and graphics */
/* when adding, check "global.h" for conflicts */
/* Obsolete */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -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 <sys/types.h>
#include <sys/stat.h>
#endif
#include <math.h>
#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 */

View file

@ -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 */

View file

@ -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 <stdlib.h>
#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);
}
}

View file

@ -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);
}
}
}
}

View file

@ -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
;

View file

@ -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 <stdio.h>
#include <stdlib.h>
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;
}

View file

@ -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

View file

@ -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 */

View file

@ -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
;

View file

@ -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 "\\<xref %s>"
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,
"<LINK %d \"%s\">%s</LINK>",
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");
}

View file

@ -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()

View file

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#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");
}

View file

@ -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 */

View file

@ -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
;

View file

@ -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) ;
}

View file

@ -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 <time.h>
/* 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])() ;
}

View file

@ -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() ;
}
;

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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") ;
}

View file

@ -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 <stdlib.h>
#include <stdio.h>
#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) ;
}

View file

@ -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");
}
}

View file

@ -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])() ;
}

View file

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#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) ;
}

View file

@ -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") ;
}

View file

@ -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");
}

View file

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#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]);
}

View file

@ -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) ;
}
}

View file

@ -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) ;
}

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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)) ;
}

View file

@ -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 <stdio.h>
#include "basic.h"
#include "trie.h"
#include "dtdext.h"
#include "parser.h"
#include "signonx.h"
void m_getsignon(void)
{
m_errline(m_signon) ;
}

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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 <stdio.h>
#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);
}

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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 <stdio.h>
#include <string.h>
#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) ;
}

View file

@ -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")) ;
}

View file

@ -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) ;
}

View file

@ -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 <stdio.h>
#include <string.h>
#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 ;
}

View file

@ -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 <string.h>
#include <stdio.h>
#include <stdlib.h>
#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"

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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 <stdio.h>
#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) ;
}

View file

@ -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 <stdio.h>
#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");
}

View file

@ -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 <string.h>
#include <stdio.h>
#include <stdlib.h>
#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() ;
}

View file

@ -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"

View file

@ -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 <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#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;
}

Some files were not shown because too many files have changed in this diff Show more