mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dthelp: Convert all K&R function definitions to ANSI (C90) standard
This commit is contained in:
parent
f89139dd84
commit
5aa1fed48b
172 changed files with 547 additions and 1308 deletions
|
@ -170,7 +170,7 @@ static void ExpandVolume(
|
|||
* Purpose: Initializes our global variables to valid starting values.
|
||||
*
|
||||
****************************************************************************/
|
||||
static void GlobalInit()
|
||||
static void GlobalInit(void)
|
||||
|
||||
{
|
||||
|
||||
|
|
|
@ -38,9 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "entdef.h"
|
||||
|
||||
/* Main procedure */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int m_prevcon ;
|
||||
|
||||
|
|
|
@ -38,9 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
/* Verify that <PARAM>, <MIN> or <USEMAP> has not previously occurred in
|
||||
this rule */
|
||||
void found(flag, delim)
|
||||
LOGICAL *flag;
|
||||
char *delim;
|
||||
void found(LOGICAL *flag, char *delim)
|
||||
{
|
||||
M_WCHAR wcbuff[129];
|
||||
ssize_t length;
|
||||
|
|
|
@ -34,8 +34,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "build.h"
|
||||
|
||||
/* Enters an element name into the element name tree */
|
||||
ELTSTRUCT *ntrelt(p)
|
||||
M_WCHAR *p ;
|
||||
ELTSTRUCT *ntrelt(M_WCHAR *p)
|
||||
{
|
||||
ELTSTRUCT *new ;
|
||||
ELTSTRUCT *old ;
|
||||
|
|
|
@ -58,11 +58,8 @@ int addarc(STATE *from, STATE *to, ELTSTRUCT *label, ANDGROUP *and, LOGICAL opti
|
|||
|
||||
/*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 ;
|
||||
void checkand(ANDGROUP *andstart, ANDGROUP *andptr, STATE *start,
|
||||
TREE *root, ELTSTRUCT **errelt)
|
||||
{
|
||||
ARC *parc ;
|
||||
ANDGROUP *pand ;
|
||||
|
@ -86,12 +83,8 @@ void checkand(andstart, andptr, start, root, 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 checkdfsa(STATE *from, ELTSTRUCT *label, ANDGROUP *and, int id,
|
||||
ELTSTRUCT **errelt)
|
||||
{
|
||||
int c ;
|
||||
ARC *parc ;
|
||||
|
@ -116,10 +109,7 @@ int checkdfsa(from, label, and, id, errelt)
|
|||
}
|
||||
|
||||
/* Check use of repeated models with and groups */
|
||||
int checkrepeat(from, and, errelt)
|
||||
STATE *from ;
|
||||
ANDGROUP *and ;
|
||||
ELTSTRUCT **errelt ;
|
||||
int checkrepeat(STATE *from, ANDGROUP *and, ELTSTRUCT **errelt)
|
||||
{
|
||||
ARC *parc ;
|
||||
int c ;
|
||||
|
@ -142,8 +132,7 @@ int checkrepeat(from, and, errelt)
|
|||
}
|
||||
|
||||
/* Copyintolist copies one list of states into another */
|
||||
void copyintolist(from, to)
|
||||
STATELIST *from, **to ;
|
||||
void copyintolist(STATELIST *from, STATELIST **to)
|
||||
{
|
||||
STATELIST **new, *old ;
|
||||
|
||||
|
@ -161,8 +150,7 @@ void copyintolist(from, to)
|
|||
}
|
||||
|
||||
/* Dellist deletes a list of states */
|
||||
void dellist(list)
|
||||
STATELIST **list ;
|
||||
void dellist(STATELIST **list)
|
||||
{
|
||||
STATELIST *p, *q ;
|
||||
|
||||
|
@ -220,10 +208,7 @@ STATE *getstate(void)
|
|||
}
|
||||
|
||||
/* Makeand processes a submodel whose connector is & */
|
||||
void makeand(canbenull, root, optional)
|
||||
LOGICAL *canbenull ;
|
||||
TREE *root ;
|
||||
int optional ;
|
||||
void makeand(LOGICAL *canbenull, TREE *root, int optional)
|
||||
{
|
||||
TREE *child ;
|
||||
STATELIST *start, *final ;
|
||||
|
@ -308,9 +293,7 @@ void makeand(canbenull, root, optional)
|
|||
allfinal is passed from model to submodel; information in newfinal
|
||||
goes from submodel to model.
|
||||
*/
|
||||
LOGICAL makefsa(root, optional)
|
||||
TREE *root ;
|
||||
int optional ;
|
||||
LOGICAL makefsa(TREE *root, int optional)
|
||||
{
|
||||
LOGICAL canbenull ;
|
||||
|
||||
|
@ -344,9 +327,7 @@ LOGICAL makefsa(root, optional)
|
|||
}
|
||||
|
||||
/* Makeor processes a submodel whose connector is | */
|
||||
void makeor(canbenull, root)
|
||||
LOGICAL *canbenull ;
|
||||
TREE *root ;
|
||||
void makeor(LOGICAL *canbenull, TREE *root)
|
||||
{
|
||||
TREE *child ;
|
||||
STATELIST *final ;
|
||||
|
@ -368,10 +349,7 @@ void makeor(canbenull, root)
|
|||
}
|
||||
|
||||
/* Makeseq processes a submodel whose connector is , */
|
||||
void makeseq(canbenull, root, optional)
|
||||
LOGICAL *canbenull ;
|
||||
TREE *root ;
|
||||
int optional ;
|
||||
void makeseq(LOGICAL *canbenull, TREE *root, int optional)
|
||||
{
|
||||
LOGICAL branchnull ;
|
||||
STATELIST *keepfinal = NULL, *final ;
|
||||
|
@ -409,10 +387,7 @@ void makeseq(canbenull, root, optional)
|
|||
|
||||
/* Nondeterm issues a diagnostic when a nondeterministic model is
|
||||
encountered */
|
||||
void nondeterm(root, c, eltp)
|
||||
TREE *root ;
|
||||
int c ;
|
||||
ELTSTRUCT *eltp ;
|
||||
void nondeterm(TREE *root, int c, ELTSTRUCT *eltp)
|
||||
{
|
||||
M_WCHAR *wtemp;
|
||||
|
||||
|
@ -443,8 +418,7 @@ void nondeterm(root, c, eltp)
|
|||
|
||||
/* 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 ;
|
||||
LOGICAL notinlist(STATELIST *item, STATELIST *list)
|
||||
{
|
||||
for ( ; list ; list = list->next)
|
||||
if (list->value == item->value) {
|
||||
|
@ -456,8 +430,7 @@ LOGICAL notinlist(item, list)
|
|||
|
||||
/* 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 ;
|
||||
LOGICAL permitspcd(ARC *a)
|
||||
{
|
||||
ANDGROUP *pand ;
|
||||
ARC *b ;
|
||||
|
@ -507,8 +480,7 @@ void push(void)
|
|||
|
||||
/* Regenerate is used in error processing to print the portion of a grammar
|
||||
rule preceding an error */
|
||||
LOGICAL regenerate(start, stop)
|
||||
TREE *start, *stop ;
|
||||
LOGICAL regenerate(TREE *start, TREE *stop)
|
||||
{
|
||||
TREE *child ;
|
||||
|
||||
|
@ -554,8 +526,7 @@ return(FALSE) ;
|
|||
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 ;
|
||||
void repeat(TREE *root)
|
||||
{
|
||||
STATELIST *final ;
|
||||
ARC *a ;
|
||||
|
@ -606,9 +577,7 @@ void repeat(root)
|
|||
|
||||
/* Used during processing of occurrence indicators in content models such
|
||||
as (a+)+ to prohibit duplicate arcs */
|
||||
LOGICAL samelabelarc(a, s)
|
||||
ARC *a ;
|
||||
STATE *s ;
|
||||
LOGICAL samelabelarc(ARC *a, STATE *s)
|
||||
{
|
||||
ARC *b ;
|
||||
|
||||
|
@ -666,11 +635,8 @@ void savestartarcs(void)
|
|||
|
||||
/* 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 ;
|
||||
void simplebranch(TREE *root, ELTSTRUCT *value, ANDGROUP *group,
|
||||
int optional)
|
||||
{
|
||||
STATE *new = NULL ;
|
||||
STATELIST *index ;
|
||||
|
@ -718,9 +684,7 @@ void simplebranch(root, value, group, optional)
|
|||
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 ;
|
||||
STATE *startfsa(TREE *root, LOGICAL *canbenull)
|
||||
{
|
||||
STATELIST *item ;
|
||||
STATE *first ;
|
||||
|
|
|
@ -69,8 +69,7 @@ char mrequired[] = "M_REQUIRED" ;
|
|||
|
||||
/* Deftype returns a string indicating the default type of the nth parameter.
|
||||
*/
|
||||
char *deftype(n)
|
||||
int n ;
|
||||
char *deftype(int n)
|
||||
{
|
||||
switch (n) {
|
||||
case NAME: return(mnamedef) ;
|
||||
|
@ -101,9 +100,7 @@ void done(void)
|
|||
}
|
||||
|
||||
/* Prints data value of an entry in the element name tree */
|
||||
void dumpentnode(file, value)
|
||||
FILE *file ;
|
||||
M_TRIE *value ;
|
||||
void dumpentnode(FILE *file, M_TRIE *value)
|
||||
{
|
||||
|
||||
fprintf(file, ", %d", ((ELTSTRUCT *) value)->eltno) ;
|
||||
|
@ -111,9 +108,7 @@ void dumpentnode(file, value)
|
|||
|
||||
/* 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 ;
|
||||
void dumpmapnode(FILE *file, M_TRIE *value)
|
||||
{
|
||||
fprintf(file, ", %d", ((MAP *) value)->map) ;
|
||||
if (! ((MAP *) value)->defined)
|
||||
|
@ -123,9 +118,7 @@ void dumpmapnode(file, value)
|
|||
|
||||
|
||||
/* Prints data value of an entry in the trie of short reference delimiters */
|
||||
void dumpsrefnode(file, value)
|
||||
FILE *file ;
|
||||
M_TRIE *value ;
|
||||
void dumpsrefnode(FILE *file, M_TRIE *value)
|
||||
{
|
||||
fprintf(file, ", %d", ((SREFSTRUCT *) value)->srefcnt) ;
|
||||
}
|
||||
|
@ -133,8 +126,7 @@ void dumpsrefnode(file, value)
|
|||
|
||||
/* Controls printing of element blocks in alphabetical order to the
|
||||
template file */
|
||||
void eltblocks(tempfile)
|
||||
FILE *tempfile ;
|
||||
void eltblocks(FILE *tempfile)
|
||||
{
|
||||
int n ;
|
||||
M_TRIE *node[M_NAMELEN + 1] ;
|
||||
|
@ -223,8 +215,7 @@ void eltreeout(void)
|
|||
}
|
||||
|
||||
/* Enttype returns a string indicating the type of an entity */
|
||||
char *enttype(n)
|
||||
int n ;
|
||||
char *enttype(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case M_GENERAL: return(mgeneral) ;
|
||||
|
@ -452,8 +443,7 @@ 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 ;
|
||||
char *partype(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case GRPO: return(mkeyword) ;
|
||||
|
@ -546,9 +536,7 @@ void srefout(void)
|
|||
}
|
||||
|
||||
/* Output one element block in a template */
|
||||
void tempelt(eltp, tempfile)
|
||||
ELTSTRUCT *eltp ;
|
||||
FILE *tempfile ;
|
||||
void tempelt(ELTSTRUCT *eltp, FILE *tempfile)
|
||||
{
|
||||
PARAMETER *paramp ;
|
||||
PTYPE *ptypep ;
|
||||
|
@ -654,8 +642,7 @@ void template(void)
|
|||
}
|
||||
|
||||
/* Typecon returns a string indicating the content type of the nth element.*/
|
||||
char *typecon(n)
|
||||
int n ;
|
||||
char *typecon(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case GRPO: return(mregexp) ;
|
||||
|
|
|
@ -38,8 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "sref.h"
|
||||
|
||||
/* Reads a name */
|
||||
LOGICAL getname(first)
|
||||
int first;
|
||||
LOGICAL getname(int first)
|
||||
{
|
||||
M_WCHAR *p;
|
||||
int c;
|
||||
|
|
|
@ -36,8 +36,7 @@ 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;
|
||||
void adddefent(M_WCHAR *mapname)
|
||||
{
|
||||
M_WCHAR *p;
|
||||
int n;
|
||||
|
@ -75,8 +74,7 @@ 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;
|
||||
LOGICAL addent(M_WCHAR *name)
|
||||
{
|
||||
M_ENTITY *new;
|
||||
|
||||
|
@ -128,16 +126,14 @@ return(TRUE);
|
|||
}
|
||||
|
||||
/* Add a named entity to a short reference map */
|
||||
void addndent(p)
|
||||
M_WCHAR *p;
|
||||
void addndent(M_WCHAR *p)
|
||||
{
|
||||
addent(p);
|
||||
thissref->entidx = entity->index;
|
||||
}
|
||||
|
||||
/* Add a short reference delimiter */
|
||||
void addsref(p)
|
||||
M_WCHAR *p;
|
||||
void addsref(M_WCHAR *p)
|
||||
{
|
||||
SREFSTRUCT *delim;
|
||||
SREFSTRUCT *prevsr;
|
||||
|
|
|
@ -44,8 +44,7 @@ void endmodel(void)
|
|||
}
|
||||
|
||||
/* Release storage used for the tree representation of a rule */
|
||||
void freetree(treep)
|
||||
TREE *treep ;
|
||||
void freetree(TREE *treep)
|
||||
{
|
||||
TREE *child, *discard ;
|
||||
|
||||
|
|
|
@ -46,9 +46,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "entity.h"
|
||||
|
||||
/* Main program */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int m_token ;
|
||||
|
||||
|
|
|
@ -46,9 +46,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "version.h"
|
||||
|
||||
/* Output indicated action pointer array to if.h */
|
||||
void actptrout(array, name)
|
||||
ACTION **array;
|
||||
char *name;
|
||||
void actptrout(ACTION **array, char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -267,8 +265,7 @@ void endstring(void)
|
|||
|
||||
/* Set the type of an entity and check if different than declaration in
|
||||
BUILD */
|
||||
void enttype(type)
|
||||
int type;
|
||||
void enttype(int type)
|
||||
{
|
||||
if ((entity->type == M_PI && type == M_CODEPI) ||
|
||||
(entity->type == M_SDATA && type == M_CODESDATA));
|
||||
|
@ -294,8 +291,7 @@ void freechain(void)
|
|||
|
||||
/* Returns pointer to data field in action node for current chain of
|
||||
elements */
|
||||
int *getaction(array)
|
||||
ACTION **array;
|
||||
int *getaction(ACTION **array)
|
||||
{
|
||||
ACTION *start, *node;
|
||||
CHAIN *chainp;
|
||||
|
@ -431,8 +427,7 @@ void outstring(void)
|
|||
}
|
||||
|
||||
/* Output #define's for parameter values */
|
||||
void outpval(p)
|
||||
M_TRIE *p;
|
||||
void outpval(M_TRIE *p)
|
||||
{
|
||||
M_WCHAR *q;
|
||||
|
||||
|
@ -530,14 +525,8 @@ void skiptoend(void)
|
|||
}
|
||||
|
||||
/* 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;
|
||||
void startcode(int caseno, LOGICAL *flag, FILE *file, char *prefix,
|
||||
char *proto, char *formal, char *formtype)
|
||||
{
|
||||
CVARSTRUCT *cvarp;
|
||||
|
||||
|
@ -631,8 +620,7 @@ void storepname(void)
|
|||
}
|
||||
|
||||
/* Called when a possible parameter value to be defined is encountered */
|
||||
void value(p)
|
||||
M_WCHAR *p;
|
||||
void value(M_WCHAR *p)
|
||||
{
|
||||
char buffer[5];
|
||||
|
||||
|
|
|
@ -43,8 +43,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "delim.h"
|
||||
|
||||
/* Reads a name token */
|
||||
void getname(first)
|
||||
int first;
|
||||
void getname(int first)
|
||||
{
|
||||
M_WCHAR *p, wus;
|
||||
int c, cttype;
|
||||
|
|
|
@ -33,9 +33,7 @@ Copyright (c) 1988, 1989 Hewlett-Packard Co.
|
|||
#include <stdlib.h>
|
||||
|
||||
/* Write input file and line number for an error message */
|
||||
void m_dumpline(file, line)
|
||||
M_WCHAR *file;
|
||||
int line;
|
||||
void m_dumpline(M_WCHAR *file, int line)
|
||||
{
|
||||
char buffer[10];
|
||||
char *mbyte;
|
||||
|
@ -71,8 +69,7 @@ m_errline(",\n");
|
|||
}
|
||||
|
||||
/* Process error message text */
|
||||
void m_errline(p)
|
||||
char *p;
|
||||
void m_errline(char *p)
|
||||
{
|
||||
char c;
|
||||
|
||||
|
@ -96,8 +93,7 @@ if (++m_errcnt == m_errlim)
|
|||
}
|
||||
|
||||
/* Exit procedure */
|
||||
void m_exit(status)
|
||||
int status;
|
||||
void m_exit(int status)
|
||||
{
|
||||
if (filefound)
|
||||
{
|
||||
|
@ -138,8 +134,7 @@ exit(0);
|
|||
}
|
||||
|
||||
/* Get-char procedure */
|
||||
int m_getc(m_ptr)
|
||||
void *m_ptr;
|
||||
int m_getc(void *m_ptr)
|
||||
{
|
||||
int c;
|
||||
M_WCHAR wc;
|
||||
|
@ -193,8 +188,7 @@ return((int) wc);
|
|||
}
|
||||
|
||||
/* Open SYSTEM entity procedure */
|
||||
void *m_openent(entcontent)
|
||||
M_WCHAR *entcontent;
|
||||
void *m_openent(M_WCHAR *entcontent)
|
||||
{
|
||||
FILE *open;
|
||||
char *filename;
|
||||
|
@ -272,7 +266,7 @@ return((void *) first);
|
|||
}
|
||||
|
||||
/* Set program options */
|
||||
void m_setoptions()
|
||||
void m_setoptions(void)
|
||||
{
|
||||
/* F option used for FILELIST (checking done in basename, which is
|
||||
called before this function is called) */
|
||||
|
@ -298,8 +292,7 @@ void m_setoptions()
|
|||
|
||||
/* Process signon message text, stripping out MARKUP version number, so
|
||||
only one version number will appear */
|
||||
void m_signmsg(p)
|
||||
char *p;
|
||||
void m_signmsg(char *p)
|
||||
{
|
||||
char *q;
|
||||
char *pCopy;
|
||||
|
@ -317,7 +310,7 @@ void m_signmsg(p)
|
|||
|
||||
/* All entity declarations have been processed. Can now check if .TEX
|
||||
file uptodate and open appropriate output file */
|
||||
void m_startdoc()
|
||||
void m_startdoc(void)
|
||||
{
|
||||
LOGICAL init = TRUE;
|
||||
unsigned char type;
|
||||
|
@ -358,16 +351,14 @@ else
|
|||
}
|
||||
|
||||
/* Write debugging trace information */
|
||||
void m_trace(p)
|
||||
char *p;
|
||||
void m_trace(char *p)
|
||||
{
|
||||
if (tracetostd) fputs(p, stdout);
|
||||
else fputs(p, m_outfile);
|
||||
}
|
||||
|
||||
|
||||
void m_wctrace(p)
|
||||
M_WCHAR *p;
|
||||
void m_wctrace(M_WCHAR *p)
|
||||
{
|
||||
char *mb_p;
|
||||
|
||||
|
|
|
@ -250,8 +250,7 @@ else
|
|||
|
||||
|
||||
/* This procedure starts a CHAPTER */
|
||||
void chapstart(id)
|
||||
M_WCHAR *id;
|
||||
void chapstart(M_WCHAR *id)
|
||||
{
|
||||
M_WCHAR *p, *q, *wc;
|
||||
int i;
|
||||
|
@ -499,9 +498,7 @@ return ( 0 );
|
|||
} /* end mb_getqualified */
|
||||
|
||||
|
||||
int getqualified (qualname, unqualname)
|
||||
M_WCHAR *qualname;
|
||||
M_WCHAR *unqualname;
|
||||
int getqualified (M_WCHAR *qualname, M_WCHAR *unqualname)
|
||||
{
|
||||
int retval;
|
||||
char mb_qualname[FNAMELEN],
|
||||
|
@ -521,13 +518,9 @@ return retval;
|
|||
|
||||
/* handle the common link and graphic code for <p> and <image> */
|
||||
void
|
||||
handle_link_and_graphic(parent,
|
||||
gentity,
|
||||
gposition,
|
||||
ghyperlink,
|
||||
glinktype,
|
||||
gdescription)
|
||||
M_WCHAR *parent, *gentity, *gposition, *ghyperlink, *glinktype, *gdescription;
|
||||
handle_link_and_graphic(M_WCHAR *parent, M_WCHAR *gentity,
|
||||
M_WCHAR *gposition, M_WCHAR *ghyperlink,
|
||||
M_WCHAR *glinktype, M_WCHAR *gdescription)
|
||||
{
|
||||
unsigned char etype, wheredef;
|
||||
char *mb_content, *ssi, id[32];
|
||||
|
@ -921,8 +914,7 @@ if (item_id)
|
|||
|
||||
|
||||
/* Start a rsect */
|
||||
void rsectstart(id)
|
||||
M_WCHAR *id;
|
||||
void rsectstart(M_WCHAR *id)
|
||||
{
|
||||
savid = checkid(id);
|
||||
iderr = FALSE;
|
||||
|
@ -942,8 +934,7 @@ rsectseq = FALSE;
|
|||
|
||||
|
||||
/* Follow search path to find a file, returning qualified name */
|
||||
M_WCHAR *searchforfile(file)
|
||||
M_WCHAR *file;
|
||||
M_WCHAR *searchforfile(M_WCHAR *file)
|
||||
{
|
||||
M_WCHAR *filename;
|
||||
SEARCH *searchp;
|
||||
|
@ -1064,9 +1055,7 @@ if (wc_id)
|
|||
|
||||
|
||||
/* Start a labeled list */
|
||||
void StartLabList(spacing, longlabel)
|
||||
M_WCHAR *spacing;
|
||||
M_WCHAR *longlabel;
|
||||
void StartLabList(M_WCHAR *spacing, M_WCHAR *longlabel)
|
||||
{
|
||||
char *mb_spacing;
|
||||
static char def_spacing[] = "LOOSE";
|
||||
|
@ -1249,7 +1238,7 @@ lastlist = nextlist;
|
|||
}
|
||||
|
||||
|
||||
void EndList()
|
||||
void EndList(void)
|
||||
{
|
||||
LIST *curlist ;
|
||||
CONTCHAIN *chain, *xchain ;
|
||||
|
@ -1589,7 +1578,7 @@ _DtLcxCloseDb(&myDb);
|
|||
* fashion.
|
||||
*/
|
||||
static char *
|
||||
GetStdLocale()
|
||||
GetStdLocale(void)
|
||||
{
|
||||
static char buffer[256];
|
||||
static char *cString = "C";
|
||||
|
@ -1669,7 +1658,7 @@ return buffer;
|
|||
* versions of the language and charset.
|
||||
*/
|
||||
void
|
||||
SetDefaultLocale()
|
||||
SetDefaultLocale(void)
|
||||
{
|
||||
unsigned char type,wheredef;
|
||||
M_WCHAR *elementName;
|
||||
|
@ -2186,14 +2175,14 @@ while (*wcp)
|
|||
return(newstring);
|
||||
}
|
||||
|
||||
int NextId()
|
||||
int NextId(void)
|
||||
{
|
||||
static id = 0;
|
||||
|
||||
return ++id;
|
||||
}
|
||||
|
||||
char *GetLanguage()
|
||||
char *GetLanguage(void)
|
||||
{
|
||||
static char *pLang = NULL;
|
||||
|
||||
|
@ -2205,7 +2194,7 @@ if (!pLang)
|
|||
return pLang;
|
||||
}
|
||||
|
||||
char *GetCharset()
|
||||
char *GetCharset(void)
|
||||
{
|
||||
static char *pCharset = NULL;
|
||||
|
||||
|
@ -2632,7 +2621,7 @@ else
|
|||
}
|
||||
|
||||
|
||||
void IncludeToss()
|
||||
void IncludeToss(void)
|
||||
{
|
||||
char pathbuf[BIGBUF];
|
||||
char *try = pathbuf;
|
||||
|
@ -2768,7 +2757,7 @@ return(name) ;
|
|||
* content is modified to be <SPC NAME="[......]"> so that it may be
|
||||
* emitted into the SDL output.
|
||||
*/
|
||||
void ModifyEntities()
|
||||
void ModifyEntities(void)
|
||||
{
|
||||
unsigned char type;
|
||||
unsigned char wheredef;
|
||||
|
@ -2931,7 +2920,7 @@ fputs(">\n", outfile);
|
|||
needFData = TRUE;
|
||||
}
|
||||
|
||||
void PopForm()
|
||||
void PopForm(void)
|
||||
{
|
||||
if (inBlock)
|
||||
{
|
||||
|
@ -2947,7 +2936,7 @@ mb_free(&(formStackTop->rowVec));
|
|||
--formStackTop;
|
||||
}
|
||||
|
||||
void PopForm2()
|
||||
void PopForm2(void)
|
||||
{
|
||||
if (inBlock)
|
||||
{
|
||||
|
@ -2968,7 +2957,7 @@ mb_free(&(formStackTop->rowVec));
|
|||
* is pushed but the source doesn't go to text either because the text
|
||||
* is explicitly optional or due to the fact that text can be null.
|
||||
*/
|
||||
void PopFormMaybe()
|
||||
void PopFormMaybe(void)
|
||||
{
|
||||
if ((formStackTop >= formStackBase) && (formStackTop->vecLen == 1))
|
||||
{
|
||||
|
@ -2977,7 +2966,7 @@ if ((formStackTop >= formStackBase) && (formStackTop->vecLen == 1))
|
|||
}
|
||||
}
|
||||
|
||||
void EmitSavedAnchors()
|
||||
void EmitSavedAnchors(void)
|
||||
{
|
||||
char buffer[BIGBUF];
|
||||
|
||||
|
@ -2992,7 +2981,7 @@ if (parTextId)
|
|||
}
|
||||
}
|
||||
|
||||
void CloseVirpage()
|
||||
void CloseVirpage(void)
|
||||
{
|
||||
if (parTextId)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
|
||||
/* Echo part of a head to the screen to indicate how much of the document
|
||||
has been processed */
|
||||
void echohead(p)
|
||||
M_WCHAR *p;
|
||||
void echohead(M_WCHAR *p)
|
||||
{
|
||||
char *mb_p,*mb_string;
|
||||
|
||||
|
@ -54,8 +53,7 @@ m_free(mb_string,"multi-byte string");
|
|||
}
|
||||
|
||||
/* call echohead with a literal string */
|
||||
void mb_echohead(p)
|
||||
char *p;
|
||||
void mb_echohead(char *p)
|
||||
{
|
||||
M_WCHAR *wc;
|
||||
|
||||
|
@ -104,7 +102,7 @@ echo = savhd = FALSE;
|
|||
* location is placed in the snb file and the <snb> elements are
|
||||
* emitted there too.
|
||||
*/
|
||||
void chksnb()
|
||||
void chksnb(void)
|
||||
{
|
||||
fputs("</HEAD>\n", outfile);
|
||||
snbstart = ftell(outfile);
|
||||
|
@ -276,10 +274,7 @@ else
|
|||
|
||||
|
||||
/* Called for processing instruction */
|
||||
void outpi(enttype, pi, entname)
|
||||
int enttype;
|
||||
M_WCHAR *pi;
|
||||
M_WCHAR *entname;
|
||||
void outpi(int enttype, M_WCHAR *pi, M_WCHAR *entname)
|
||||
{
|
||||
strcode(pi, outfile);
|
||||
|
||||
|
@ -392,13 +387,8 @@ 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;
|
||||
void shstring(M_WCHAR *addstring, int *len, int max,
|
||||
M_WCHAR *storestring, char *msg, LOGICAL *errflg)
|
||||
{
|
||||
int addlength;
|
||||
|
||||
|
@ -419,13 +409,8 @@ else
|
|||
}
|
||||
|
||||
|
||||
void mb_shstring(addstring, len, max, storestring, msg, errflg)
|
||||
char *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)
|
||||
{
|
||||
M_WCHAR *wc_addstring;
|
||||
|
||||
|
@ -435,9 +420,7 @@ 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;
|
||||
void strcode(M_WCHAR *string, FILE *outfile)
|
||||
{
|
||||
char exbuff[32]; /* arbitrarily large */
|
||||
int bufflen;
|
||||
|
@ -492,9 +475,7 @@ if (savex)
|
|||
}
|
||||
|
||||
|
||||
void mb_strcode(string, outfile)
|
||||
char *string;
|
||||
FILE *outfile;
|
||||
void mb_strcode(char *string, FILE *outfile)
|
||||
{
|
||||
M_WCHAR *wc;
|
||||
|
||||
|
@ -504,8 +485,7 @@ 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;
|
||||
void svhdstring(M_WCHAR *string)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
@ -524,8 +504,7 @@ svheadlen += length;
|
|||
}
|
||||
|
||||
/* Copies string to end of buffer where saving table caption */
|
||||
void svtcstring(string)
|
||||
M_WCHAR *string;
|
||||
void svtcstring(M_WCHAR *string)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
@ -605,10 +584,7 @@ else
|
|||
}
|
||||
|
||||
/* 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;
|
||||
void termpi(int m_enttype, M_WCHAR *m_pi, M_WCHAR *m_entname)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
|
|
@ -31,8 +31,7 @@ Copyright 1988, 1989 Hewlett-Packard Co.
|
|||
#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;
|
||||
M_WCHAR *checkid(M_WCHAR *id)
|
||||
{
|
||||
struct xref *xref;
|
||||
char *buffer;
|
||||
|
@ -80,10 +79,7 @@ return(NULL);
|
|||
}
|
||||
|
||||
/* Write a single cross-reference macro definition */
|
||||
static void defxref(xfile, id, xref)
|
||||
FILE *xfile;
|
||||
M_WCHAR *id;
|
||||
struct xref *xref;
|
||||
static void defxref(FILE *xfile, M_WCHAR *id, struct xref *xref)
|
||||
{
|
||||
char *csname;
|
||||
char *p;
|
||||
|
@ -191,8 +187,7 @@ while (TRUE)
|
|||
}
|
||||
|
||||
/* Copies string to end of current cross-reference string */
|
||||
void idstring(string)
|
||||
M_WCHAR *string;
|
||||
void idstring(M_WCHAR *string)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
@ -409,8 +404,7 @@ savid = NULL;
|
|||
}
|
||||
|
||||
/* Generate a cross-reference */
|
||||
void xrefexpand(id)
|
||||
M_WCHAR *id;
|
||||
void xrefexpand(M_WCHAR *id)
|
||||
{
|
||||
struct xref *xref;
|
||||
struct xref *old;
|
||||
|
|
|
@ -44,8 +44,7 @@ in the interface definition.*/
|
|||
#include "signon.h"
|
||||
|
||||
/* When an explicit or implied end-tag occurs */
|
||||
void m_endaction(m_elt)
|
||||
M_ELEMENT m_elt;
|
||||
void m_endaction(M_ELEMENT m_elt)
|
||||
{
|
||||
M_ELEMENT m_action;
|
||||
char buffer[2*MAXD+M_NAMELEN+1];
|
||||
|
@ -76,9 +75,7 @@ void m_endaction(m_elt)
|
|||
}
|
||||
|
||||
/* Find appropriate action according to current stack */
|
||||
int m_findact(elt, array)
|
||||
M_ELEMENT elt;
|
||||
int *array;
|
||||
int m_findact(M_ELEMENT elt, int *array)
|
||||
{
|
||||
int chainlen = 0;
|
||||
int index;
|
||||
|
@ -156,8 +153,7 @@ m_free(wc_string,"wide character string");
|
|||
}
|
||||
|
||||
/* When an explicit or implied start-tag occurs */
|
||||
void m_strtaction(m_elt)
|
||||
M_ELEMENT m_elt;
|
||||
void m_strtaction(M_ELEMENT m_elt)
|
||||
{
|
||||
int m_par, m_i;
|
||||
M_WCHAR *m_p;
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
#include "userinc.h"
|
||||
#include "globdec.h"
|
||||
|
||||
void m_closent(m_ptr)
|
||||
void *m_ptr ;
|
||||
void m_closent(void *m_ptr)
|
||||
{
|
||||
fclose((FILE *) m_ptr) ;
|
||||
}
|
||||
|
|
|
@ -37,8 +37,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "entfile.c"
|
||||
|
||||
/* When a reference to a CODE entity is encountered */
|
||||
void m_codeent(m_ent)
|
||||
int m_ent ;
|
||||
void m_codeent(int m_ent)
|
||||
{
|
||||
(*m_ctable[m_ent])() ;
|
||||
}
|
||||
|
|
|
@ -29,9 +29,7 @@ Copyright 1988, 1989 Hewlett-Packard Co.
|
|||
#include "globdec.h"
|
||||
|
||||
/* Displays current element after some error messages */
|
||||
void m_dispcurelt(file, line)
|
||||
M_WCHAR *file ;
|
||||
int line ;
|
||||
void m_dispcurelt(M_WCHAR *file, int line)
|
||||
{
|
||||
char *mb_parent;
|
||||
|
||||
|
|
|
@ -39,8 +39,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
|
||||
/* Perform the m_action-th end-code in the interface */
|
||||
void m_endcase(m_action)
|
||||
int m_action ;
|
||||
void m_endcase(int m_action)
|
||||
{
|
||||
(*m_etable[m_action])() ;
|
||||
}
|
||||
|
|
|
@ -52,8 +52,7 @@ void m_ckmap(M_WCHAR *name, LOGICAL useoradd)
|
|||
/* 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 ;
|
||||
void m_eduptype(int type)
|
||||
{
|
||||
if ((int) m_entity->type != type) {
|
||||
m_err1("Redefinition of entity %s ignored", m_entity->name) ;
|
||||
|
@ -63,8 +62,7 @@ void m_eduptype(type)
|
|||
}
|
||||
|
||||
/* Tests if an entity is too long */
|
||||
void m_longent(context)
|
||||
int context ;
|
||||
void m_longent(int context)
|
||||
{
|
||||
if (m_entclen >= M_LITLEN) {
|
||||
m_curcon = context ;
|
||||
|
@ -74,8 +72,7 @@ void m_longent(context)
|
|||
}
|
||||
|
||||
/* Enters an entity name into the entity name tree */
|
||||
void m_ntrent(p)
|
||||
M_WCHAR *p ;
|
||||
void m_ntrent(M_WCHAR *p)
|
||||
{
|
||||
M_ENTITY *new ;
|
||||
|
||||
|
|
|
@ -40,8 +40,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
|
||||
/* Issue error message (no arguments) */
|
||||
void m_error(text)
|
||||
char *text;
|
||||
void m_error(char *text)
|
||||
{
|
||||
m_startmsg();
|
||||
m_errline(text);
|
||||
|
@ -314,9 +313,7 @@ void m_err7(
|
|||
|
||||
/* 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;
|
||||
void m_getline(M_WCHAR **file, int *line)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -64,8 +64,7 @@ void m_etcomplete(void)
|
|||
|
||||
/* 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 ;
|
||||
void m_frcend(M_ELEMENT val)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
M_ELEMENT poppedval ;
|
||||
|
|
|
@ -33,8 +33,7 @@
|
|||
|
||||
/* Procedure callable by interface designer. Returns number of occurrences
|
||||
of element on parse stack */
|
||||
int m_level(elt)
|
||||
M_WCHAR *elt ;
|
||||
int m_level(M_WCHAR *elt)
|
||||
{
|
||||
int i = 0 ;
|
||||
M_PARSE *stackptr ;
|
||||
|
@ -48,8 +47,7 @@ int m_level(elt)
|
|||
}
|
||||
|
||||
|
||||
int m_mblevel(elt)
|
||||
char *elt ;
|
||||
int m_mblevel(char *elt)
|
||||
{
|
||||
int retval;
|
||||
M_WCHAR *wc_elt;
|
||||
|
|
|
@ -38,11 +38,8 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#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 ;
|
||||
LOGICAL m_lookent(M_WCHAR *name, unsigned char *type,
|
||||
M_WCHAR **content, unsigned char *wheredef)
|
||||
{
|
||||
M_ENTITY *entity ;
|
||||
|
||||
|
|
|
@ -99,11 +99,8 @@ void m_expecting(void)
|
|||
|
||||
/* 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 ;
|
||||
void m_expexpand(LOGICAL *expstart, M_STATE node, LOGICAL *required,
|
||||
LOGICAL *data)
|
||||
{
|
||||
M_ARC parc ;
|
||||
M_ANDGROUP pand ;
|
||||
|
@ -125,10 +122,7 @@ void m_expexpand(expstart, node, required, data)
|
|||
}
|
||||
|
||||
/* M_expline writes one line for m_expecting() */
|
||||
void m_expline(expstart, data, label)
|
||||
LOGICAL *expstart ;
|
||||
LOGICAL *data ;
|
||||
M_ELEMENT label ;
|
||||
void m_expline(LOGICAL *expstart, LOGICAL *data, M_ELEMENT label)
|
||||
{
|
||||
char buffer[M_NAMELEN + 2*MAXD + 1] ;
|
||||
|
||||
|
@ -165,9 +159,7 @@ void m_expline(expstart, data, label)
|
|||
|
||||
/* 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 ;
|
||||
void m_exptend(LOGICAL *expstart, M_PARSE *stackptr)
|
||||
{
|
||||
char buffer[M_NAMELEN + 2*MAXD + 1] ;
|
||||
|
||||
|
@ -216,9 +208,7 @@ void m_exptend(expstart, stackptr)
|
|||
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_ELEMENT m_findunique(M_STATE from, int *newleft)
|
||||
{
|
||||
M_ARC parc ;
|
||||
M_ELEMENT cr = 0, minim = 0;
|
||||
|
@ -339,7 +329,7 @@ LOGICAL m_omitend(void)
|
|||
|
||||
/* 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()
|
||||
LOGICAL m_omitstart(void)
|
||||
{
|
||||
M_ELEMENT c = M_NULLVAL ;
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ Copyright 1988, 1989 Hewlett-Packard Co.
|
|||
#include "parser.h"
|
||||
|
||||
/* Get program options from a string */
|
||||
void m_optstring(p)
|
||||
char *p ;
|
||||
void m_optstring(char *p)
|
||||
{
|
||||
if (strchr(p, 'a')) m_malftrace = TRUE ;
|
||||
if (strchr(p, 'c')) m_chtrace = TRUE ;
|
||||
|
|
|
@ -42,8 +42,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
/* Process the value for the parameter whose index number was previously
|
||||
saved in m_ppsave */
|
||||
void m_attval(string)
|
||||
M_WCHAR *string ;
|
||||
void m_attval(M_WCHAR *string)
|
||||
{
|
||||
const M_WCHAR *p ;
|
||||
|
||||
|
@ -65,8 +64,7 @@ void m_attval(string)
|
|||
|
||||
/* Process a string that is a parameter value not prefixed by the parameter
|
||||
name and value indicator */
|
||||
LOGICAL m_attvonly(string)
|
||||
M_WCHAR *string ;
|
||||
LOGICAL m_attvonly(M_WCHAR *string)
|
||||
{
|
||||
const M_WCHAR *p ;
|
||||
int par, i ;
|
||||
|
@ -152,8 +150,7 @@ void m_findatt(void)
|
|||
}
|
||||
|
||||
/* Free the parameter storage associated with an element on the parse stack */
|
||||
void m_freeparam(stackelt)
|
||||
M_PARSE *stackelt ;
|
||||
void m_freeparam(M_PARSE *stackelt)
|
||||
{
|
||||
int i ;
|
||||
int par ;
|
||||
|
@ -173,9 +170,7 @@ void m_freeparam(stackelt)
|
|||
/* 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 ;
|
||||
void m_parupper(int par, M_WCHAR *string)
|
||||
{
|
||||
M_WCHAR *p ;
|
||||
M_WCHAR *q ;
|
||||
|
@ -233,11 +228,7 @@ void m_stkdefaultparams(void)
|
|||
}
|
||||
|
||||
/* Stack one default parameter */
|
||||
void m_stkonedef(par, scanel, poccur, i)
|
||||
int par ;
|
||||
M_ELEMENT scanel ;
|
||||
M_WCHAR **poccur ;
|
||||
int i ;
|
||||
void m_stkonedef(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 &&
|
||||
|
@ -313,8 +304,7 @@ void m_updatedefault(const int par , const M_WCHAR *string )
|
|||
|
||||
/* 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 ;
|
||||
LOGICAL m_validinpar(M_WCHAR *string)
|
||||
{
|
||||
int par ;
|
||||
M_WCHAR *p ;
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
/* 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_WCHAR *m_parent(int n)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
|
||||
|
|
|
@ -38,9 +38,7 @@
|
|||
static void scanloop(LOGICAL prolog);
|
||||
|
||||
/* Main procedure */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
M_WCHAR *wc_userdef;
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ M_ELEMENT m_eltname(void)
|
|||
}
|
||||
}
|
||||
|
||||
int get_mb_cur_max()
|
||||
int get_mb_cur_max(void)
|
||||
{
|
||||
char *l;
|
||||
int i;
|
||||
|
|
|
@ -38,10 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
/* When a processing instruction or SDATA entity other than a CODE entity
|
||||
occurs */
|
||||
void m_piaction(m_pi, m_entname, m_enttype)
|
||||
M_WCHAR *m_pi ;
|
||||
M_WCHAR *m_entname ;
|
||||
int m_enttype ;
|
||||
void m_piaction(M_WCHAR *m_pi, M_WCHAR *m_entname, int m_enttype)
|
||||
{
|
||||
m_stackpar = m_stacktop->piparam ;
|
||||
(*m_ptable[m_stacktop->picase])(m_pi, m_entname, m_enttype) ;
|
||||
|
|
|
@ -62,8 +62,7 @@ int m_actgetc(void)
|
|||
}
|
||||
|
||||
/* Expand an entity reference */
|
||||
void m_entexpand(openent)
|
||||
M_ENTITY *openent ;
|
||||
void m_entexpand(M_ENTITY *openent)
|
||||
{
|
||||
M_WCHAR *p ;
|
||||
M_HOLDTYPE dchar ;
|
||||
|
@ -231,9 +230,7 @@ void m_entexpand(openent)
|
|||
|
||||
/* An srlen-character long short-reference delimiter has been found. Verify
|
||||
that it is not the prefix of a general delimiter recognized in context*/
|
||||
LOGICAL m_gendelim(srlen, context)
|
||||
int srlen ;
|
||||
int context ;
|
||||
LOGICAL m_gendelim(int srlen, int context)
|
||||
{
|
||||
int ghold[MAXD + 1] ;
|
||||
int ucase ;
|
||||
|
@ -321,8 +318,7 @@ LOGICAL m_gendelim(srlen, context)
|
|||
|
||||
/* Reads next input character from the current source file or from an
|
||||
entity expansion */
|
||||
int m_getachar(dchar)
|
||||
M_HOLDTYPE *dchar ;
|
||||
int m_getachar(M_HOLDTYPE *dchar)
|
||||
{
|
||||
int c ;
|
||||
int i ;
|
||||
|
@ -424,10 +420,7 @@ void m_getname(M_WCHAR first)
|
|||
}
|
||||
|
||||
/* Reads the next token */
|
||||
int m_gettoken(c, dchar, context)
|
||||
int *c ;
|
||||
M_HOLDTYPE *dchar ;
|
||||
int context ;
|
||||
int m_gettoken(int *c, M_HOLDTYPE *dchar, int context)
|
||||
{
|
||||
int hold[MAXD + 1], next ;
|
||||
int ucase ;
|
||||
|
@ -551,8 +544,7 @@ int m_gettoken(c, dchar, context)
|
|||
}
|
||||
|
||||
/* Reads a literal */
|
||||
void m_litproc(delim)
|
||||
int delim ;
|
||||
void m_litproc(int delim)
|
||||
{
|
||||
int n, i ;
|
||||
M_HOLDTYPE dchar ;
|
||||
|
@ -896,8 +888,7 @@ void m_setmap(int map, LOGICAL useoradd)
|
|||
}
|
||||
|
||||
/* Check for short reference delimiters */
|
||||
void m_shortref(context)
|
||||
int context ;
|
||||
void m_shortref(int context)
|
||||
{
|
||||
int n = 0 ;
|
||||
int i ;
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
#include "parser.h"
|
||||
|
||||
/* Set a user-defined C variable to the corresponding parameter value */
|
||||
void m_setparam(cvar, par)
|
||||
M_WCHAR **cvar ;
|
||||
int par ;
|
||||
void m_setparam(M_WCHAR **cvar, int par)
|
||||
{
|
||||
*cvar = m_stackpar->param[par] ;
|
||||
}
|
||||
|
|
|
@ -36,8 +36,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "sfile.c"
|
||||
|
||||
/* Perform the m_action-th start-code in the interface */
|
||||
void m_strtcase(m_action)
|
||||
int m_action ;
|
||||
void m_strtcase(int m_action)
|
||||
{
|
||||
(*m_stable[m_action])() ;
|
||||
}
|
||||
|
|
|
@ -46,8 +46,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
is valid input. It returns TRUE, FALSE, or M_NONCONTEXTUAL respectively
|
||||
if the element is allowed by content, not allowed, or allowed by an
|
||||
inclusion exception. */
|
||||
int m_checkstart(val)
|
||||
M_ELEMENT val ;
|
||||
int m_checkstart(M_ELEMENT val)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
int except ;
|
||||
|
@ -238,8 +237,7 @@ void m_done(void)
|
|||
}
|
||||
|
||||
/* Process the endtag (implied, abbreviated, or explicit) for element C*/
|
||||
void m_endtag(c)
|
||||
M_ELEMENT c ;
|
||||
void m_endtag(M_ELEMENT c)
|
||||
{
|
||||
m_endaction(c) ;
|
||||
m_pop() ;
|
||||
|
@ -251,8 +249,7 @@ void m_endtag(c)
|
|||
|
||||
/* Check that the identified element is not prohibited in the current context
|
||||
by an exclusion exception */
|
||||
LOGICAL m_excluded(elt)
|
||||
M_ELEMENT elt ;
|
||||
LOGICAL m_excluded(M_ELEMENT elt)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
int except ;
|
||||
|
@ -270,8 +267,7 @@ LOGICAL m_excluded(elt)
|
|||
|
||||
/* Free the OPEN FSA substructures associated with an element on
|
||||
the parse stack */
|
||||
void m_freeFSA(stackelt)
|
||||
M_PARSE *stackelt ;
|
||||
void m_freeFSA(M_PARSE *stackelt)
|
||||
{
|
||||
M_OPENFSA *fsastack ;
|
||||
M_ANDLIST *usedand ;
|
||||
|
@ -290,9 +286,7 @@ void m_freeFSA(stackelt)
|
|||
}
|
||||
|
||||
/* Free storage used for tentative chain of tag minimizations */
|
||||
void m_freemin(min, msg)
|
||||
M_MIN *min ;
|
||||
char *msg ;
|
||||
void m_freemin(M_MIN *min, char *msg)
|
||||
{
|
||||
M_MIN *discard ;
|
||||
|
||||
|
@ -307,9 +301,7 @@ void m_freemin(min, msg)
|
|||
in the current content model by starting a new submodel of the and-group
|
||||
indicated by fsastack, or (if the and-group is within a seq-group) by
|
||||
continuing past the and-group */
|
||||
LOGICAL m_nextand(thisfsa, label)
|
||||
M_OPENFSA *thisfsa ;
|
||||
M_ELEMENT label ;
|
||||
LOGICAL m_nextand(M_OPENFSA *thisfsa, M_ELEMENT label)
|
||||
{
|
||||
M_ANDLIST *newgroup ;
|
||||
M_ANDGROUP pand ;
|
||||
|
@ -461,8 +453,7 @@ void m_push(M_ELEMENT elt, M_STATE current, LOGICAL need)
|
|||
character is treated differently so that if character data is not
|
||||
allowed in the current context, an error message is issued with the
|
||||
first character only and not with every character. */
|
||||
void m_strtcdata(scanval)
|
||||
int scanval ;
|
||||
void m_strtcdata(int scanval)
|
||||
{
|
||||
if (! m_strtproc(M_NULLVAL))
|
||||
if (m_whitespace((M_WCHAR) scanval)) {
|
||||
|
@ -493,8 +484,7 @@ void m_strtcdata(scanval)
|
|||
to an element that was within #PCDATA, m_strtproc saves the current context
|
||||
and restores it after returning from the last call to m_endtag.)
|
||||
*/
|
||||
LOGICAL m_strtproc(scanval)
|
||||
M_ELEMENT scanval ;
|
||||
LOGICAL m_strtproc(M_ELEMENT scanval)
|
||||
{
|
||||
int check ;
|
||||
M_PARSE *original ;
|
||||
|
|
|
@ -166,9 +166,7 @@ delim.h.
|
|||
#include "cont.h"
|
||||
|
||||
/* Main procedure */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int n ;
|
||||
|
||||
|
|
|
@ -81,8 +81,7 @@ void dumptree(LOGICAL sparse)
|
|||
}
|
||||
|
||||
/* Enter a delimiter into the delimiter tree for a particular context */
|
||||
void enterdelim(n)
|
||||
int n;
|
||||
void enterdelim(int n)
|
||||
{
|
||||
if (! contree[n])
|
||||
{
|
||||
|
@ -107,8 +106,7 @@ if (m_ntrtrie(dstruct->string,
|
|||
}
|
||||
|
||||
/* Read the code to be executed with a given state transition */
|
||||
void getcode(n)
|
||||
int n;
|
||||
void getcode(int n)
|
||||
{
|
||||
int c ; /* c is int instead of char for use with ungetc */
|
||||
int nested = 1;
|
||||
|
@ -620,8 +618,7 @@ void nextcon(LOGICAL sparse)
|
|||
|
||||
/* If sparse matrix output option, generate a single element of transit
|
||||
array */
|
||||
void prtctxt(column, value)
|
||||
int column, value;
|
||||
void prtctxt(int column, int value)
|
||||
{
|
||||
static LOGICAL first = TRUE;
|
||||
|
||||
|
@ -656,8 +653,7 @@ void skiptoend(void)
|
|||
}
|
||||
|
||||
/* Return a character to the input stream for re-reading */
|
||||
void unread(c)
|
||||
int c;
|
||||
void unread(int c)
|
||||
{
|
||||
M_WCHAR wnl;
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@
|
|||
|
||||
void main(int argc, char **argv);
|
||||
|
||||
void main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
void main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: emptyfil filename\n") ;
|
||||
|
|
|
@ -49,8 +49,7 @@ char xerror[] = "ERROR" ;
|
|||
|
||||
/* Outputs entity definitions */
|
||||
#define ENTFILENAME 12
|
||||
void entout(fname)
|
||||
char *fname ;
|
||||
void entout(char *fname)
|
||||
{
|
||||
char efilename[ENTFILENAME] ;
|
||||
int count = 1 ;
|
||||
|
@ -173,15 +172,13 @@ void entout(fname)
|
|||
|
||||
/* Entptr is called by m_dumptrie to output the value stored with a
|
||||
particular entity in the entity trie */
|
||||
void entptr(data)
|
||||
M_ENTITY *data ;
|
||||
void entptr(M_ENTITY *data)
|
||||
{
|
||||
fprintf(entfile, "(M_TRIE *) &m_entities[%d]", data->index - 1) ;
|
||||
}
|
||||
|
||||
/* Typetype returns a string indicating the type of the nth entity.*/
|
||||
char *typetype(n)
|
||||
int n ;
|
||||
char *typetype(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case M_GENERAL: return(xgeneral) ;
|
||||
|
|
|
@ -83,16 +83,14 @@ void eprefix(LOGICAL flag)
|
|||
/* Writes part of an error message. Called from m_malloc instead of
|
||||
m_err1, since PARSER's version of m_err1 calls m_malloc and recursive
|
||||
calls are possible when the heap is exhausted */
|
||||
void m_errline(text)
|
||||
char *text ;
|
||||
void m_errline(char *text)
|
||||
{
|
||||
fputs(text, stderr) ;
|
||||
fputs(text, m_errfile) ;
|
||||
}
|
||||
|
||||
/* Writes an error message to standard error and file "error" */
|
||||
void m_error(text)
|
||||
char *text ;
|
||||
void m_error(char *text)
|
||||
{
|
||||
eprefix(TRUE) ;
|
||||
fprintf(stderr,"%s", text) ;
|
||||
|
@ -192,30 +190,26 @@ void esuffix(void)
|
|||
}
|
||||
|
||||
/* Print something to both stderr and m_errfile */
|
||||
void msgline(text)
|
||||
char *text ;
|
||||
void msgline(char *text)
|
||||
{
|
||||
fprintf(stderr, "%s", text) ;
|
||||
fprintf(m_errfile, "%s", text) ;
|
||||
}
|
||||
|
||||
/* Print something to both stderr and m_errfile */
|
||||
void msg1line(text, arg1)
|
||||
char *text, *arg1 ;
|
||||
void msg1line(char *text, char *arg1)
|
||||
{
|
||||
fprintf(stderr, text, arg1) ;
|
||||
fprintf(m_errfile, text, arg1) ;
|
||||
}
|
||||
|
||||
/* Trace used for m_malloc trace output */
|
||||
void m_trace(text)
|
||||
char *text ;
|
||||
void m_trace(char *text)
|
||||
{
|
||||
m_errline(text) ;
|
||||
}
|
||||
|
||||
void m_wctrace(text)
|
||||
M_WCHAR *text ;
|
||||
void m_wctrace(M_WCHAR *text)
|
||||
{
|
||||
char *mb_text;
|
||||
|
||||
|
@ -225,8 +219,7 @@ m_free(mb_text,"multi-byte string");
|
|||
}
|
||||
|
||||
/* Writes a nonfatal error message to standard error and file "error" */
|
||||
void warning(text)
|
||||
char *text ;
|
||||
void warning(char *text)
|
||||
{
|
||||
eprefix(FALSE) ;
|
||||
fprintf(stderr,"%s", text) ;
|
||||
|
|
|
@ -31,8 +31,7 @@ void m_exit(int status);
|
|||
|
||||
/* Exit function called by utilities used in PARSER and other programs in
|
||||
the MARKUP system */
|
||||
void m_exit(status)
|
||||
int status ;
|
||||
void m_exit(int status)
|
||||
{
|
||||
exit(status) ;
|
||||
}
|
||||
|
|
|
@ -61,9 +61,7 @@ void copyfile(char *pfile1, char *pfile2);
|
|||
|
||||
int nextchar(FILE *file, struct data *data);
|
||||
|
||||
void main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
void main(int argc, char **argv)
|
||||
{
|
||||
FILE *one, *two ;
|
||||
int c1, c2 ;
|
||||
|
@ -110,8 +108,7 @@ void main(argc, argv)
|
|||
}
|
||||
|
||||
/* copyfile inserted by ced, 12-1-89. */
|
||||
void copyfile(pfile1,pfile2)
|
||||
char *pfile1, *pfile2;
|
||||
void copyfile(char *pfile1, char *pfile2)
|
||||
{
|
||||
int ret;
|
||||
char *pcmd;
|
||||
|
@ -128,9 +125,7 @@ void copyfile(pfile1,pfile2)
|
|||
free(pcmd);
|
||||
}
|
||||
|
||||
int nextchar(file, data)
|
||||
FILE *file ;
|
||||
struct data *data ;
|
||||
int nextchar(FILE *file, struct data *data)
|
||||
{
|
||||
while (data->linestart) {
|
||||
data->linestart = FALSE ;
|
||||
|
|
|
@ -34,10 +34,7 @@ void m_exit(int status);
|
|||
void m_inctest(int *count, int limit, char *message);
|
||||
|
||||
/* Increment a count and test against a limit */
|
||||
void m_inctest(count, limit, message)
|
||||
int *count ;
|
||||
int limit ;
|
||||
char *message ;
|
||||
void m_inctest(int *count, int limit, char *message)
|
||||
{
|
||||
if (++*count <= limit) return ;
|
||||
m_err1("Internal error: %s exceeded", message) ;
|
||||
|
|
|
@ -31,9 +31,7 @@ char *m_itoa(int n, char *s);
|
|||
|
||||
void reverse(char *s);
|
||||
|
||||
char *m_itoa(n, s) /* convert n to characters in s */
|
||||
char s[];
|
||||
int n;
|
||||
char *m_itoa(int n, char *s) /* convert n to characters in s */
|
||||
{
|
||||
int sign ;
|
||||
char *p = s ;
|
||||
|
@ -51,8 +49,7 @@ int n;
|
|||
return(s) ;
|
||||
}
|
||||
|
||||
void reverse(s)
|
||||
char s[];
|
||||
void reverse(char s[])
|
||||
{
|
||||
int c, i, j;
|
||||
|
||||
|
|
|
@ -32,8 +32,7 @@ int m_lower(int c);
|
|||
|
||||
|
||||
/* Force a letter to lowercase */
|
||||
int m_lower(c)
|
||||
int c ;
|
||||
int m_lower(int c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z') c += 'a' - 'A' ;
|
||||
return(c) ;
|
||||
|
|
|
@ -49,9 +49,7 @@ void *m_trace(char *text);
|
|||
|
||||
void *m_wctrace(M_WCHAR *text);
|
||||
|
||||
void m_free(block, msg)
|
||||
void *block ;
|
||||
char *msg ;
|
||||
void m_free(void *block, char *msg)
|
||||
{
|
||||
char buffer[32] ;
|
||||
|
||||
|
@ -71,9 +69,7 @@ void m_free(block, msg)
|
|||
}
|
||||
}
|
||||
|
||||
void *m_malloc(size, msg)
|
||||
int size ;
|
||||
char *msg ;
|
||||
void *m_malloc(int size, char *msg)
|
||||
{
|
||||
char buffer[32] ;
|
||||
void *p ;
|
||||
|
@ -105,10 +101,7 @@ void *m_malloc(size, msg)
|
|||
return(p) ;
|
||||
}
|
||||
|
||||
void *m_realloc(ptr, size, msg)
|
||||
void *ptr ;
|
||||
int size ;
|
||||
char *msg ;
|
||||
void *m_realloc(void *ptr, int size, char *msg)
|
||||
{
|
||||
char buffer[32] ;
|
||||
void *p ;
|
||||
|
|
|
@ -35,9 +35,7 @@ void m_exit(int status);
|
|||
void m_openchk(FILE **ptr, char *name, char *mode);
|
||||
|
||||
/* Open a file and check that the open succeeded */
|
||||
void m_openchk(ptr, name, mode)
|
||||
FILE **ptr ;
|
||||
char *name, *mode ;
|
||||
void m_openchk(FILE **ptr, char *name, char *mode)
|
||||
{
|
||||
*ptr = fopen(name, mode) ;
|
||||
if (*ptr) return ;
|
||||
|
|
|
@ -72,9 +72,7 @@ return((int) wc);
|
|||
}
|
||||
|
||||
/* Reads the next token stored in a packed trie (as defined by context.dat) */
|
||||
int gettoken(c, context)
|
||||
int *c;
|
||||
int context;
|
||||
int gettoken(int *c, int context)
|
||||
{
|
||||
int hold[MAXD + 1];
|
||||
int ucase;
|
||||
|
@ -123,8 +121,7 @@ return(M_NULLVAL);
|
|||
}
|
||||
|
||||
/* Reads a literal (called after the opening quotation mark is read) */
|
||||
LOGICAL litproc(delim)
|
||||
int delim;
|
||||
LOGICAL litproc(int delim)
|
||||
{
|
||||
int n, i, number;
|
||||
M_WCHAR *p, *pStart; /* bigger than wide versions of lit or lita */
|
||||
|
@ -215,8 +212,7 @@ return(FALSE);
|
|||
|
||||
/* Returns a context-dependent delimiter string to input stream so
|
||||
characters can be reread one at a time in another context */
|
||||
void undodelim(delim)
|
||||
M_WCHAR *delim;
|
||||
void undodelim(M_WCHAR *delim)
|
||||
{
|
||||
M_WCHAR *p;
|
||||
|
||||
|
@ -234,8 +230,7 @@ while (TRUE)
|
|||
/* Returns a character to the input stream to read again later. Unexplained
|
||||
problems occurred using standard ungetc procedure; hence
|
||||
explicit declaration of buffer for read-ahead characters */
|
||||
void ungetachar(c)
|
||||
int c;
|
||||
void ungetachar(int c)
|
||||
{
|
||||
M_WCHAR wnl;
|
||||
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
/* Sparse.c has a procedure used with the tables generated by program
|
||||
CONTEXT when the sparse option is used */
|
||||
|
||||
int m_sprscon(i, j)
|
||||
int i, j ;
|
||||
int m_sprscon(int i, int j)
|
||||
{
|
||||
int k ;
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/* $XConsortium: strstr.c /main/3 1995/11/08 09:54:55 rswiston $ */
|
||||
char *strstr ( s1, s2 )
|
||||
char *s1, *s2 ; {
|
||||
char *strstr (char *s1, char *s2)
|
||||
{
|
||||
|
||||
int x, y ;
|
||||
|
||||
|
|
|
@ -117,10 +117,7 @@ void *m_lookfortrie( const M_WCHAR *p , const M_TRIE *xtrie )
|
|||
}
|
||||
|
||||
/* Enters a string and associated data value into a trie */
|
||||
void *m_ntrtrie(p, xtrie, dataval)
|
||||
M_WCHAR *p ;
|
||||
M_TRIE *xtrie ;
|
||||
void *dataval ;
|
||||
void *m_ntrtrie(M_WCHAR *p, M_TRIE *xtrie, void *dataval)
|
||||
{
|
||||
M_TRIE *currentnode ;
|
||||
void *n ;
|
||||
|
|
|
@ -40,9 +40,7 @@ void printval(FILE *file, void *value);
|
|||
|
||||
/* Count the descendants of a node in order to generate declarations for
|
||||
the packed form of a trie*/
|
||||
void countdown(parent, count)
|
||||
M_TRIE *parent ;
|
||||
int *count ;
|
||||
void countdown(M_TRIE *parent, int *count)
|
||||
{
|
||||
M_TRIE *child ;
|
||||
|
||||
|
@ -54,12 +52,8 @@ void countdown(parent, count)
|
|||
|
||||
/* Output descendants of a node for the declaration of a trie, in packed
|
||||
or normal format*/
|
||||
void dumpnode(first, file, trieptr, count, proc)
|
||||
LOGICAL *first ;
|
||||
FILE *file ;
|
||||
M_TRIE *trieptr ;
|
||||
int *count ;
|
||||
void (*proc) (FILE *file, void *value);
|
||||
void dumpnode(LOGICAL *first, FILE *file, M_TRIE *trieptr, int *count,
|
||||
void (*proc) (FILE *file, void *value))
|
||||
{
|
||||
M_TRIE *p ;
|
||||
int savecount ;
|
||||
|
@ -89,9 +83,7 @@ void dumpnode(first, file, trieptr, count, proc)
|
|||
|
||||
|
||||
/* Most common procedure passed to dumpptrie */
|
||||
void printval(file, value)
|
||||
FILE *file ;
|
||||
void *value ;
|
||||
void printval(FILE *file, void *value)
|
||||
{
|
||||
fprintf(file, ", %ld", (long) value) ;
|
||||
}
|
||||
|
|
|
@ -34,12 +34,8 @@ void countdown(M_TRIE *parent, int *count);
|
|||
void m_dumptrie(FILE *file, M_TRIE *xtrie, char *extname, int *count, void (*proc)(void *value));
|
||||
|
||||
/* Write the C declaration of a trie */
|
||||
void m_dumptrie(file, xtrie, extname, count, proc)
|
||||
FILE *file ;
|
||||
M_TRIE *xtrie ;
|
||||
char *extname ;
|
||||
int *count ;
|
||||
void (*proc)(void *value);
|
||||
void m_dumptrie(FILE *file, M_TRIE *xtrie, char *extname, int *count,
|
||||
void (*proc)(void *value))
|
||||
{
|
||||
int firstson ;
|
||||
M_TRIE *p ;
|
||||
|
|
|
@ -38,13 +38,9 @@ void dumpptrie(M_TRIE *intname, char *extname, FILE *file, char *externdef, char
|
|||
void (*proc)(FILE *file, void *value));
|
||||
|
||||
/* Write the declaration of a packed trie to the specified files */
|
||||
void dumpptrie(intname, extname, file, externdef, defdef, proc)
|
||||
M_TRIE *intname ;
|
||||
char *extname ;
|
||||
FILE *file ;
|
||||
char *externdef ;
|
||||
char *defdef ;
|
||||
void (*proc) (FILE *file, void *value) ;
|
||||
void dumpptrie(M_TRIE *intname, char *extname, FILE *file,
|
||||
char *externdef, char *defdef,
|
||||
void (*proc) (FILE *file, void *value))
|
||||
{
|
||||
LOGICAL first = TRUE ;
|
||||
int count = 0 ;
|
||||
|
|
|
@ -39,9 +39,7 @@ extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ;
|
|||
int m_packedlook(M_PTRIE *xptrie, M_WCHAR *name);
|
||||
|
||||
/* Look for the string NAME in the packed trie PTRIE */
|
||||
int m_packedlook(xptrie, name)
|
||||
M_PTRIE *xptrie ;
|
||||
M_WCHAR *name ;
|
||||
int m_packedlook(M_PTRIE *xptrie, M_WCHAR *name)
|
||||
{
|
||||
int current = 0 ;
|
||||
int i ;
|
||||
|
|
|
@ -33,10 +33,7 @@
|
|||
extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ;
|
||||
|
||||
/* Changes the value associated with an entry in a trie. */
|
||||
void *m_resettrie(xtrie, p, value)
|
||||
M_TRIE *xtrie ;
|
||||
M_WCHAR *p ;
|
||||
void *value ;
|
||||
void *m_resettrie(M_TRIE *xtrie, M_WCHAR *p, void *value)
|
||||
{
|
||||
M_TRIE *currentnode ;
|
||||
|
||||
|
|
|
@ -214,8 +214,7 @@ return wc_stringStart;
|
|||
|
||||
|
||||
/* Get-wide-char procedure */
|
||||
int mb_getwc(m_ptr)
|
||||
void *m_ptr;
|
||||
int mb_getwc(void *m_ptr)
|
||||
{
|
||||
int c;
|
||||
M_WCHAR wc;
|
||||
|
|
|
@ -38,9 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "entdef.h"
|
||||
|
||||
/* Main procedure */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int m_prevcon ;
|
||||
|
||||
|
|
|
@ -38,9 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
/* Verify that <PARAM>, <MIN> or <USEMAP> has not previously occurred in
|
||||
this rule */
|
||||
void found(flag, delim)
|
||||
LOGICAL *flag;
|
||||
char *delim;
|
||||
void found(LOGICAL *flag, char *delim)
|
||||
{
|
||||
M_WCHAR wcbuff[129];
|
||||
ssize_t length;
|
||||
|
|
|
@ -34,8 +34,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "build.h"
|
||||
|
||||
/* Enters an element name into the element name tree */
|
||||
ELTSTRUCT *ntrelt(p)
|
||||
M_WCHAR *p ;
|
||||
ELTSTRUCT *ntrelt(M_WCHAR *p)
|
||||
{
|
||||
ELTSTRUCT *new ;
|
||||
ELTSTRUCT *old ;
|
||||
|
|
|
@ -58,11 +58,7 @@ int addarc(STATE *from, STATE *to, ELTSTRUCT *label, ANDGROUP *and, LOGICAL opti
|
|||
|
||||
/*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 ;
|
||||
void checkand(ANDGROUP *andstart, ANDGROUP *andptr, STATE *start, TREE *root, ELTSTRUCT **errelt)
|
||||
{
|
||||
ARC *parc ;
|
||||
ANDGROUP *pand ;
|
||||
|
@ -86,12 +82,7 @@ void checkand(andstart, andptr, start, root, 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 checkdfsa(STATE *from, ELTSTRUCT *label, ANDGROUP *and, int id, ELTSTRUCT **errelt)
|
||||
{
|
||||
int c ;
|
||||
ARC *parc ;
|
||||
|
@ -116,10 +107,7 @@ int checkdfsa(from, label, and, id, errelt)
|
|||
}
|
||||
|
||||
/* Check use of repeated models with and groups */
|
||||
int checkrepeat(from, and, errelt)
|
||||
STATE *from ;
|
||||
ANDGROUP *and ;
|
||||
ELTSTRUCT **errelt ;
|
||||
int checkrepeat(STATE *from, ANDGROUP *and, ELTSTRUCT **errelt)
|
||||
{
|
||||
ARC *parc ;
|
||||
int c ;
|
||||
|
@ -142,8 +130,7 @@ int checkrepeat(from, and, errelt)
|
|||
}
|
||||
|
||||
/* Copyintolist copies one list of states into another */
|
||||
void copyintolist(from, to)
|
||||
STATELIST *from, **to ;
|
||||
void copyintolist(STATELIST *from, STATELIST **to)
|
||||
{
|
||||
STATELIST **new, *old ;
|
||||
|
||||
|
@ -161,8 +148,7 @@ void copyintolist(from, to)
|
|||
}
|
||||
|
||||
/* Dellist deletes a list of states */
|
||||
void dellist(list)
|
||||
STATELIST **list ;
|
||||
void dellist(STATELIST **list)
|
||||
{
|
||||
STATELIST *p, *q ;
|
||||
|
||||
|
@ -220,10 +206,7 @@ STATE *getstate(void)
|
|||
}
|
||||
|
||||
/* Makeand processes a submodel whose connector is & */
|
||||
void makeand(canbenull, root, optional)
|
||||
LOGICAL *canbenull ;
|
||||
TREE *root ;
|
||||
int optional ;
|
||||
void makeand(LOGICAL *canbenull, TREE *root, int optional)
|
||||
{
|
||||
TREE *child ;
|
||||
STATELIST *start, *final ;
|
||||
|
@ -308,9 +291,7 @@ void makeand(canbenull, root, optional)
|
|||
allfinal is passed from model to submodel; information in newfinal
|
||||
goes from submodel to model.
|
||||
*/
|
||||
LOGICAL makefsa(root, optional)
|
||||
TREE *root ;
|
||||
int optional ;
|
||||
LOGICAL makefsa(TREE *root, int optional)
|
||||
{
|
||||
LOGICAL canbenull ;
|
||||
|
||||
|
@ -344,9 +325,7 @@ LOGICAL makefsa(root, optional)
|
|||
}
|
||||
|
||||
/* Makeor processes a submodel whose connector is | */
|
||||
void makeor(canbenull, root)
|
||||
LOGICAL *canbenull ;
|
||||
TREE *root ;
|
||||
void makeor(LOGICAL *canbenull, TREE *root)
|
||||
{
|
||||
TREE *child ;
|
||||
STATELIST *final ;
|
||||
|
@ -368,10 +347,7 @@ void makeor(canbenull, root)
|
|||
}
|
||||
|
||||
/* Makeseq processes a submodel whose connector is , */
|
||||
void makeseq(canbenull, root, optional)
|
||||
LOGICAL *canbenull ;
|
||||
TREE *root ;
|
||||
int optional ;
|
||||
void makeseq(LOGICAL *canbenull, TREE *root, int optional)
|
||||
{
|
||||
LOGICAL branchnull ;
|
||||
STATELIST *keepfinal = NULL, *final ;
|
||||
|
@ -409,10 +385,7 @@ void makeseq(canbenull, root, optional)
|
|||
|
||||
/* Nondeterm issues a diagnostic when a nondeterministic model is
|
||||
encountered */
|
||||
void nondeterm(root, c, eltp)
|
||||
TREE *root ;
|
||||
int c ;
|
||||
ELTSTRUCT *eltp ;
|
||||
void nondeterm(TREE *root, int c, ELTSTRUCT *eltp)
|
||||
{
|
||||
M_WCHAR *wtemp;
|
||||
|
||||
|
@ -443,8 +416,7 @@ void nondeterm(root, c, eltp)
|
|||
|
||||
/* 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 ;
|
||||
LOGICAL notinlist(STATELIST *item, STATELIST *list)
|
||||
{
|
||||
for ( ; list ; list = list->next)
|
||||
if (list->value == item->value) {
|
||||
|
@ -456,8 +428,7 @@ LOGICAL notinlist(item, list)
|
|||
|
||||
/* 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 ;
|
||||
LOGICAL permitspcd(ARC *a)
|
||||
{
|
||||
ANDGROUP *pand ;
|
||||
ARC *b ;
|
||||
|
@ -507,8 +478,7 @@ void push(void)
|
|||
|
||||
/* Regenerate is used in error processing to print the portion of a grammar
|
||||
rule preceding an error */
|
||||
LOGICAL regenerate(start, stop)
|
||||
TREE *start, *stop ;
|
||||
LOGICAL regenerate(TREE *start, TREE *stop)
|
||||
{
|
||||
TREE *child ;
|
||||
|
||||
|
@ -554,8 +524,7 @@ return(FALSE) ;
|
|||
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 ;
|
||||
void repeat(TREE *root)
|
||||
{
|
||||
STATELIST *final ;
|
||||
ARC *a ;
|
||||
|
@ -606,9 +575,7 @@ void repeat(root)
|
|||
|
||||
/* Used during processing of occurrence indicators in content models such
|
||||
as (a+)+ to prohibit duplicate arcs */
|
||||
LOGICAL samelabelarc(a, s)
|
||||
ARC *a ;
|
||||
STATE *s ;
|
||||
LOGICAL samelabelarc(ARC *a, STATE *s)
|
||||
{
|
||||
ARC *b ;
|
||||
|
||||
|
@ -666,11 +633,7 @@ void savestartarcs(void)
|
|||
|
||||
/* 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 ;
|
||||
void simplebranch(TREE *root, ELTSTRUCT *value, ANDGROUP *group, int optional)
|
||||
{
|
||||
STATE *new = NULL ;
|
||||
STATELIST *index ;
|
||||
|
@ -718,9 +681,7 @@ void simplebranch(root, value, group, optional)
|
|||
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 ;
|
||||
STATE *startfsa(TREE *root, LOGICAL *canbenull)
|
||||
{
|
||||
STATELIST *item ;
|
||||
STATE *first ;
|
||||
|
|
|
@ -69,8 +69,7 @@ char mrequired[] = "M_REQUIRED" ;
|
|||
|
||||
/* Deftype returns a string indicating the default type of the nth parameter.
|
||||
*/
|
||||
char *deftype(n)
|
||||
int n ;
|
||||
char *deftype(int n)
|
||||
{
|
||||
switch (n) {
|
||||
case NAME: return(mnamedef) ;
|
||||
|
@ -101,9 +100,7 @@ void done(void)
|
|||
}
|
||||
|
||||
/* Prints data value of an entry in the element name tree */
|
||||
void dumpentnode(file, value)
|
||||
FILE *file ;
|
||||
M_TRIE *value ;
|
||||
void dumpentnode(FILE *file, M_TRIE *value)
|
||||
{
|
||||
|
||||
fprintf(file, ", %d", ((ELTSTRUCT *) value)->eltno) ;
|
||||
|
@ -111,9 +108,7 @@ void dumpentnode(file, value)
|
|||
|
||||
/* 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 ;
|
||||
void dumpmapnode(FILE *file, M_TRIE *value)
|
||||
{
|
||||
fprintf(file, ", %d", ((MAP *) value)->map) ;
|
||||
if (! ((MAP *) value)->defined)
|
||||
|
@ -123,9 +118,7 @@ void dumpmapnode(file, value)
|
|||
|
||||
|
||||
/* Prints data value of an entry in the trie of short reference delimiters */
|
||||
void dumpsrefnode(file, value)
|
||||
FILE *file ;
|
||||
M_TRIE *value ;
|
||||
void dumpsrefnode(FILE *file, M_TRIE *value)
|
||||
{
|
||||
fprintf(file, ", %d", ((SREFSTRUCT *) value)->srefcnt) ;
|
||||
}
|
||||
|
@ -133,8 +126,7 @@ void dumpsrefnode(file, value)
|
|||
|
||||
/* Controls printing of element blocks in alphabetical order to the
|
||||
template file */
|
||||
void eltblocks(tempfile)
|
||||
FILE *tempfile ;
|
||||
void eltblocks(FILE *tempfile)
|
||||
{
|
||||
int n ;
|
||||
M_TRIE *node[M_NAMELEN + 1] ;
|
||||
|
@ -223,8 +215,7 @@ void eltreeout(void)
|
|||
}
|
||||
|
||||
/* Enttype returns a string indicating the type of an entity */
|
||||
char *enttype(n)
|
||||
int n ;
|
||||
char *enttype(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case M_GENERAL: return(mgeneral) ;
|
||||
|
@ -452,8 +443,7 @@ 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 ;
|
||||
char *partype(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case GRPO: return(mkeyword) ;
|
||||
|
@ -545,9 +535,7 @@ void srefout(void)
|
|||
}
|
||||
|
||||
/* Output one element block in a template */
|
||||
void tempelt(eltp, tempfile)
|
||||
ELTSTRUCT *eltp ;
|
||||
FILE *tempfile ;
|
||||
void tempelt(ELTSTRUCT *eltp, FILE *tempfile)
|
||||
{
|
||||
PARAMETER *paramp ;
|
||||
PTYPE *ptypep ;
|
||||
|
@ -653,8 +641,7 @@ void template(void)
|
|||
}
|
||||
|
||||
/* Typecon returns a string indicating the content type of the nth element.*/
|
||||
char *typecon(n)
|
||||
int n ;
|
||||
char *typecon(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case GRPO: return(mregexp) ;
|
||||
|
|
|
@ -38,8 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "sref.h"
|
||||
|
||||
/* Reads a name */
|
||||
LOGICAL getname(first)
|
||||
int first;
|
||||
LOGICAL getname(int first)
|
||||
{
|
||||
M_WCHAR *p;
|
||||
int c;
|
||||
|
|
|
@ -36,8 +36,7 @@ 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;
|
||||
void adddefent(M_WCHAR *mapname)
|
||||
{
|
||||
M_WCHAR *p;
|
||||
int n;
|
||||
|
@ -75,8 +74,7 @@ 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;
|
||||
LOGICAL addent(M_WCHAR *name)
|
||||
{
|
||||
M_ENTITY *new;
|
||||
|
||||
|
@ -128,16 +126,14 @@ return(TRUE);
|
|||
}
|
||||
|
||||
/* Add a named entity to a short reference map */
|
||||
void addndent(p)
|
||||
M_WCHAR *p;
|
||||
void addndent(M_WCHAR *p)
|
||||
{
|
||||
addent(p);
|
||||
thissref->entidx = entity->index;
|
||||
}
|
||||
|
||||
/* Add a short reference delimiter */
|
||||
void addsref(p)
|
||||
M_WCHAR *p;
|
||||
void addsref(M_WCHAR *p)
|
||||
{
|
||||
SREFSTRUCT *delim;
|
||||
SREFSTRUCT *prevsr;
|
||||
|
|
|
@ -44,8 +44,7 @@ void endmodel(void)
|
|||
}
|
||||
|
||||
/* Release storage used for the tree representation of a rule */
|
||||
void freetree(treep)
|
||||
TREE *treep ;
|
||||
void freetree(TREE *treep)
|
||||
{
|
||||
TREE *child, *discard ;
|
||||
|
||||
|
|
|
@ -46,9 +46,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "entity.h"
|
||||
|
||||
/* Main program */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int m_token ;
|
||||
|
||||
|
|
|
@ -46,9 +46,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "version.h"
|
||||
|
||||
/* Output indicated action pointer array to if.h */
|
||||
void actptrout(array, name)
|
||||
ACTION **array;
|
||||
char *name;
|
||||
void actptrout(ACTION **array, char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -267,8 +265,7 @@ void endstring(void)
|
|||
|
||||
/* Set the type of an entity and check if different than declaration in
|
||||
BUILD */
|
||||
void enttype(type)
|
||||
int type;
|
||||
void enttype(int type)
|
||||
{
|
||||
if ((entity->type == M_PI && type == M_CODEPI) ||
|
||||
(entity->type == M_SDATA && type == M_CODESDATA));
|
||||
|
@ -294,8 +291,7 @@ void freechain(void)
|
|||
|
||||
/* Returns pointer to data field in action node for current chain of
|
||||
elements */
|
||||
int *getaction(array)
|
||||
ACTION **array;
|
||||
int *getaction(ACTION **array)
|
||||
{
|
||||
ACTION *start, *node;
|
||||
CHAIN *chainp;
|
||||
|
@ -431,8 +427,7 @@ void outstring(void)
|
|||
}
|
||||
|
||||
/* Output #define's for parameter values */
|
||||
void outpval(p)
|
||||
M_TRIE *p;
|
||||
void outpval(M_TRIE *p)
|
||||
{
|
||||
M_WCHAR *q;
|
||||
|
||||
|
@ -530,14 +525,8 @@ void skiptoend(void)
|
|||
}
|
||||
|
||||
/* 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;
|
||||
void startcode(int caseno, LOGICAL *flag, FILE *file, char *prefix,
|
||||
char *proto, char *formal, char *formtype)
|
||||
{
|
||||
CVARSTRUCT *cvarp;
|
||||
|
||||
|
@ -631,8 +620,7 @@ void storepname(void)
|
|||
}
|
||||
|
||||
/* Called when a possible parameter value to be defined is encountered */
|
||||
void value(p)
|
||||
M_WCHAR *p;
|
||||
void value(M_WCHAR *p)
|
||||
{
|
||||
char buffer[5];
|
||||
|
||||
|
|
|
@ -43,8 +43,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "delim.h"
|
||||
|
||||
/* Reads a name token */
|
||||
void getname(first)
|
||||
int first;
|
||||
void getname(int first)
|
||||
{
|
||||
M_WCHAR *p, wus;
|
||||
int c, cttype;
|
||||
|
|
|
@ -33,9 +33,7 @@ Copyright (c) 1988, 1989 Hewlett-Packard Co.
|
|||
#include <stdlib.h>
|
||||
|
||||
/* Write input file and line number for an error message */
|
||||
void m_dumpline(file, line)
|
||||
M_WCHAR *file;
|
||||
int line;
|
||||
void m_dumpline(M_WCHAR *file, int line)
|
||||
{
|
||||
char buffer[10];
|
||||
char *mbyte;
|
||||
|
@ -71,8 +69,7 @@ m_errline(",\n");
|
|||
}
|
||||
|
||||
/* Process error message text */
|
||||
void m_errline(p)
|
||||
char *p;
|
||||
void m_errline(char *p)
|
||||
{
|
||||
char c;
|
||||
|
||||
|
@ -96,8 +93,7 @@ if (++m_errcnt == m_errlim)
|
|||
}
|
||||
|
||||
/* Exit procedure */
|
||||
void m_exit(status)
|
||||
int status;
|
||||
void m_exit(int status)
|
||||
{
|
||||
if (filefound)
|
||||
{
|
||||
|
@ -134,8 +130,7 @@ exit(0);
|
|||
}
|
||||
|
||||
/* Get-char procedure */
|
||||
int m_getc(m_ptr)
|
||||
void *m_ptr;
|
||||
int m_getc(void *m_ptr)
|
||||
{
|
||||
int c;
|
||||
M_WCHAR wc;
|
||||
|
@ -189,8 +184,7 @@ return((int) wc);
|
|||
}
|
||||
|
||||
/* Open SYSTEM entity procedure */
|
||||
void *m_openent(entcontent)
|
||||
M_WCHAR *entcontent;
|
||||
void *m_openent(M_WCHAR *entcontent)
|
||||
{
|
||||
FILE *open;
|
||||
char *filename;
|
||||
|
@ -270,7 +264,7 @@ return((void *) first);
|
|||
}
|
||||
|
||||
/* Set program options */
|
||||
void m_setoptions()
|
||||
void m_setoptions(void)
|
||||
{
|
||||
/* F option used for FILELIST (checking done in basename, which is
|
||||
called before this function is called) */
|
||||
|
@ -284,8 +278,7 @@ if (m_argc > 2)
|
|||
|
||||
/* Process signon message text, stripping out MARKUP version number, so
|
||||
only one version number will appear */
|
||||
void m_signmsg(p)
|
||||
char *p;
|
||||
void m_signmsg(char *p)
|
||||
{
|
||||
char *q;
|
||||
char *pCopy;
|
||||
|
@ -305,7 +298,7 @@ void m_signmsg(p)
|
|||
|
||||
/* All entity declarations have been processed. Can now check if .TEX
|
||||
file uptodate and open appropriate output file */
|
||||
void m_startdoc()
|
||||
void m_startdoc(void)
|
||||
{
|
||||
LOGICAL init = TRUE;
|
||||
unsigned char type;
|
||||
|
@ -345,16 +338,14 @@ else
|
|||
}
|
||||
|
||||
/* Write debugging trace information */
|
||||
void m_trace(p)
|
||||
char *p;
|
||||
void m_trace(char *p)
|
||||
{
|
||||
if (tracetostd) fputs(p, stdout);
|
||||
else fputs(p, m_outfile);
|
||||
}
|
||||
|
||||
|
||||
void m_wctrace(p)
|
||||
M_WCHAR *p;
|
||||
void m_wctrace(M_WCHAR *p)
|
||||
{
|
||||
char *mb_p;
|
||||
|
||||
|
|
|
@ -250,8 +250,7 @@ else
|
|||
|
||||
|
||||
/* This procedure starts a CHAPTER */
|
||||
void chapstart(id)
|
||||
M_WCHAR *id;
|
||||
void chapstart(M_WCHAR *id)
|
||||
{
|
||||
M_WCHAR *p, *q, *wc;
|
||||
int i;
|
||||
|
@ -498,9 +497,7 @@ return ( 0 );
|
|||
} /* end mb_getqualified */
|
||||
|
||||
|
||||
int getqualified (qualname, unqualname)
|
||||
M_WCHAR *qualname;
|
||||
M_WCHAR *unqualname;
|
||||
int getqualified(M_WCHAR *qualname, M_WCHAR *unqualname)
|
||||
{
|
||||
int retval;
|
||||
char mb_qualname[FNAMELEN],
|
||||
|
@ -520,13 +517,9 @@ return retval;
|
|||
|
||||
/* handle the common link and graphic code for <p> and <image> */
|
||||
void
|
||||
handle_link_and_graphic(parent,
|
||||
gentity,
|
||||
gposition,
|
||||
ghyperlink,
|
||||
glinktype,
|
||||
gdescription)
|
||||
M_WCHAR *parent, *gentity, *gposition, *ghyperlink, *glinktype, *gdescription;
|
||||
handle_link_and_graphic(M_WCHAR *parent, M_WCHAR *gentity,
|
||||
M_WCHAR *gposition, M_WCHAR *ghyperlink,
|
||||
M_WCHAR *glinktype, M_WCHAR *gdescription)
|
||||
{
|
||||
unsigned char etype, wheredef;
|
||||
char *mb_content, *ssi, id[32];
|
||||
|
@ -912,8 +905,7 @@ if (item_id)
|
|||
|
||||
|
||||
/* Start a rsect */
|
||||
void rsectstart(id)
|
||||
M_WCHAR *id;
|
||||
void rsectstart(M_WCHAR *id)
|
||||
{
|
||||
savid = checkid(id);
|
||||
iderr = FALSE;
|
||||
|
@ -933,8 +925,7 @@ rsectseq = FALSE;
|
|||
|
||||
|
||||
/* Follow search path to find a file, returning qualified name */
|
||||
M_WCHAR *searchforfile(file)
|
||||
M_WCHAR *file;
|
||||
M_WCHAR *searchforfile(M_WCHAR *file)
|
||||
{
|
||||
M_WCHAR *filename;
|
||||
SEARCH *searchp;
|
||||
|
@ -1055,9 +1046,7 @@ if (wc_id)
|
|||
|
||||
|
||||
/* Start a labeled list */
|
||||
void StartLabList(spacing, longlabel)
|
||||
M_WCHAR *spacing;
|
||||
M_WCHAR *longlabel;
|
||||
void StartLabList(M_WCHAR *spacing, M_WCHAR *longlabel)
|
||||
{
|
||||
char *mb_spacing;
|
||||
static char def_spacing[] = "LOOSE";
|
||||
|
@ -1240,7 +1229,7 @@ lastlist = nextlist;
|
|||
}
|
||||
|
||||
|
||||
void EndList()
|
||||
void EndList(void)
|
||||
{
|
||||
LIST *curlist ;
|
||||
CONTCHAIN *chain, *xchain ;
|
||||
|
@ -1658,7 +1647,7 @@ return buffer;
|
|||
* versions of the language and charset.
|
||||
*/
|
||||
void
|
||||
SetDefaultLocale()
|
||||
SetDefaultLocale(void)
|
||||
{
|
||||
unsigned char type,wheredef;
|
||||
M_WCHAR *elementName;
|
||||
|
@ -2173,14 +2162,14 @@ while (*wcp)
|
|||
return(newstring);
|
||||
}
|
||||
|
||||
int NextId()
|
||||
int NextId(void)
|
||||
{
|
||||
static id = 0;
|
||||
|
||||
return ++id;
|
||||
}
|
||||
|
||||
char *GetLanguage()
|
||||
char *GetLanguage(void)
|
||||
{
|
||||
static char *pLang = NULL;
|
||||
|
||||
|
@ -2192,7 +2181,7 @@ if (!pLang)
|
|||
return pLang;
|
||||
}
|
||||
|
||||
char *GetCharset()
|
||||
char *GetCharset(void)
|
||||
{
|
||||
static char *pCharset = NULL;
|
||||
|
||||
|
@ -2755,7 +2744,7 @@ return(name) ;
|
|||
* content is modified to be <SPC NAME="[......]"> so that it may be
|
||||
* emitted into the SDL output.
|
||||
*/
|
||||
void ModifyEntities()
|
||||
void ModifyEntities(void)
|
||||
{
|
||||
unsigned char type;
|
||||
unsigned char wheredef;
|
||||
|
@ -2918,7 +2907,7 @@ fputs(">\n", outfile);
|
|||
needFData = TRUE;
|
||||
}
|
||||
|
||||
void PopForm()
|
||||
void PopForm(void)
|
||||
{
|
||||
if (inBlock)
|
||||
{
|
||||
|
@ -2934,7 +2923,7 @@ mb_free(&(formStackTop->rowVec));
|
|||
--formStackTop;
|
||||
}
|
||||
|
||||
void PopForm2()
|
||||
void PopForm2(void)
|
||||
{
|
||||
if (inBlock)
|
||||
{
|
||||
|
@ -2955,7 +2944,7 @@ mb_free(&(formStackTop->rowVec));
|
|||
* is pushed but the source doesn't go to text either because the text
|
||||
* is explicitly optional or due to the fact that text can be null.
|
||||
*/
|
||||
void PopFormMaybe()
|
||||
void PopFormMaybe(void)
|
||||
{
|
||||
if ((formStackTop >= formStackBase) && (formStackTop->vecLen == 1))
|
||||
{
|
||||
|
@ -2964,7 +2953,7 @@ if ((formStackTop >= formStackBase) && (formStackTop->vecLen == 1))
|
|||
}
|
||||
}
|
||||
|
||||
void EmitSavedAnchors()
|
||||
void EmitSavedAnchors(void)
|
||||
{
|
||||
char buffer[BIGBUF];
|
||||
|
||||
|
@ -2979,7 +2968,7 @@ if (parTextId)
|
|||
}
|
||||
}
|
||||
|
||||
void CloseVirpage()
|
||||
void CloseVirpage(void)
|
||||
{
|
||||
if (parTextId)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
|
||||
/* Echo part of a head to the screen to indicate how much of the document
|
||||
has been processed */
|
||||
void echohead(p)
|
||||
M_WCHAR *p;
|
||||
void echohead(M_WCHAR *p)
|
||||
{
|
||||
char *mb_p,*mb_string;
|
||||
|
||||
|
@ -54,8 +53,7 @@ m_free(mb_string,"multi-byte string");
|
|||
}
|
||||
|
||||
/* call echohead with a literal string */
|
||||
void mb_echohead(p)
|
||||
char *p;
|
||||
void mb_echohead(char *p)
|
||||
{
|
||||
M_WCHAR *wc;
|
||||
|
||||
|
@ -104,7 +102,7 @@ echo = savhd = FALSE;
|
|||
* location is placed in the snb file and the <snb> elements are
|
||||
* emitted there too.
|
||||
*/
|
||||
void chksnb()
|
||||
void chksnb(void)
|
||||
{
|
||||
fputs("</HEAD>\n", outfile);
|
||||
snbstart = ftell(outfile);
|
||||
|
@ -276,10 +274,7 @@ else
|
|||
|
||||
|
||||
/* Called for processing instruction */
|
||||
void outpi(enttype, pi, entname)
|
||||
int enttype;
|
||||
M_WCHAR *pi;
|
||||
M_WCHAR *entname;
|
||||
void outpi(int enttype, M_WCHAR *pi, M_WCHAR *entname)
|
||||
{
|
||||
strcode(pi, outfile);
|
||||
|
||||
|
@ -392,13 +387,8 @@ 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;
|
||||
void shstring(M_WCHAR *addstring, int *len, int max,
|
||||
M_WCHAR *storestring, char *msg, LOGICAL *errflg)
|
||||
{
|
||||
int addlength;
|
||||
|
||||
|
@ -419,13 +409,8 @@ else
|
|||
}
|
||||
|
||||
|
||||
void mb_shstring(addstring, len, max, storestring, msg, errflg)
|
||||
char *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)
|
||||
{
|
||||
M_WCHAR *wc_addstring;
|
||||
|
||||
|
@ -435,9 +420,7 @@ 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;
|
||||
void strcode(M_WCHAR *string, FILE *outfile)
|
||||
{
|
||||
char exbuff[32]; /* arbitrarily large */
|
||||
int bufflen;
|
||||
|
@ -492,9 +475,7 @@ if (savex)
|
|||
}
|
||||
|
||||
|
||||
void mb_strcode(string, outfile)
|
||||
char *string;
|
||||
FILE *outfile;
|
||||
void mb_strcode(char *string, FILE *outfile)
|
||||
{
|
||||
M_WCHAR *wc;
|
||||
|
||||
|
@ -504,8 +485,7 @@ 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;
|
||||
void svhdstring(M_WCHAR *string)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
@ -524,8 +504,7 @@ svheadlen += length;
|
|||
}
|
||||
|
||||
/* Copies string to end of buffer where saving table caption */
|
||||
void svtcstring(string)
|
||||
M_WCHAR *string;
|
||||
void svtcstring(M_WCHAR *string)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
@ -605,10 +584,7 @@ else
|
|||
}
|
||||
|
||||
/* 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;
|
||||
void termpi(int m_enttype, M_WCHAR *m_pi, M_WCHAR *m_entname)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
|
|
@ -138,9 +138,7 @@ struct {
|
|||
#define NO8BITCHARS 256
|
||||
int invert[NO8BITCHARS], emptycell;
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i, both = FALSE, spec = FALSE, coll = FALSE, error = FALSE ;
|
||||
|
||||
|
|
|
@ -31,8 +31,7 @@ Copyright 1988, 1989 Hewlett-Packard Co.
|
|||
#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;
|
||||
M_WCHAR *checkid(M_WCHAR *id)
|
||||
{
|
||||
struct xref *xref;
|
||||
char *buffer;
|
||||
|
@ -80,10 +79,7 @@ return(NULL);
|
|||
}
|
||||
|
||||
/* Write a single cross-reference macro definition */
|
||||
static void defxref(xfile, id, xref)
|
||||
FILE *xfile;
|
||||
M_WCHAR *id;
|
||||
struct xref *xref;
|
||||
static void defxref(FILE *xfile, M_WCHAR *id, struct xref *xref)
|
||||
{
|
||||
char *csname;
|
||||
char *p;
|
||||
|
@ -196,8 +192,7 @@ while (TRUE)
|
|||
}
|
||||
|
||||
/* Copies string to end of current cross-reference string */
|
||||
void idstring(string)
|
||||
M_WCHAR *string;
|
||||
void idstring(M_WCHAR *string)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
@ -414,8 +409,7 @@ savid = NULL;
|
|||
}
|
||||
|
||||
/* Generate a cross-reference */
|
||||
void xrefexpand(id)
|
||||
M_WCHAR *id;
|
||||
void xrefexpand(M_WCHAR *id)
|
||||
{
|
||||
struct xref *xref;
|
||||
struct xref *old;
|
||||
|
|
|
@ -44,8 +44,7 @@ in the interface definition.*/
|
|||
#include "signon.h"
|
||||
|
||||
/* When an explicit or implied end-tag occurs */
|
||||
void m_endaction(m_elt)
|
||||
M_ELEMENT m_elt;
|
||||
void m_endaction(M_ELEMENT m_elt)
|
||||
{
|
||||
M_ELEMENT m_action;
|
||||
char buffer[2*MAXD+M_NAMELEN+1];
|
||||
|
@ -76,9 +75,7 @@ void m_endaction(m_elt)
|
|||
}
|
||||
|
||||
/* Find appropriate action according to current stack */
|
||||
int m_findact(elt, array)
|
||||
M_ELEMENT elt;
|
||||
int *array;
|
||||
int m_findact(M_ELEMENT elt, int *array)
|
||||
{
|
||||
int chainlen = 0;
|
||||
int index;
|
||||
|
@ -156,8 +153,7 @@ m_free(wc_string,"wide character string");
|
|||
}
|
||||
|
||||
/* When an explicit or implied start-tag occurs */
|
||||
void m_strtaction(m_elt)
|
||||
M_ELEMENT m_elt;
|
||||
void m_strtaction(M_ELEMENT m_elt)
|
||||
{
|
||||
int m_par, m_i;
|
||||
M_WCHAR *m_p;
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
#include "userinc.h"
|
||||
#include "globdec.h"
|
||||
|
||||
void m_closent(m_ptr)
|
||||
void *m_ptr ;
|
||||
void m_closent(void *m_ptr)
|
||||
{
|
||||
fclose((FILE *) m_ptr) ;
|
||||
}
|
||||
|
|
|
@ -37,8 +37,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "entfile.c"
|
||||
|
||||
/* When a reference to a CODE entity is encountered */
|
||||
void m_codeent(m_ent)
|
||||
int m_ent ;
|
||||
void m_codeent(int m_ent)
|
||||
{
|
||||
(*m_ctable[m_ent])() ;
|
||||
}
|
||||
|
|
|
@ -29,9 +29,7 @@ Copyright 1988, 1989 Hewlett-Packard Co.
|
|||
#include "globdec.h"
|
||||
|
||||
/* Displays current element after some error messages */
|
||||
void m_dispcurelt(file, line)
|
||||
M_WCHAR *file ;
|
||||
int line ;
|
||||
void m_dispcurelt(M_WCHAR *file, int line)
|
||||
{
|
||||
char *mb_parent;
|
||||
|
||||
|
|
|
@ -37,8 +37,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
|
||||
/* Perform the m_action-th end-code in the interface */
|
||||
void m_endcase(m_action)
|
||||
int m_action ;
|
||||
void m_endcase(int m_action)
|
||||
{
|
||||
(*m_etable[m_action])() ;
|
||||
}
|
||||
|
|
|
@ -52,8 +52,7 @@ void m_ckmap(M_WCHAR *name, LOGICAL useoradd)
|
|||
/* 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 ;
|
||||
void m_eduptype(int type)
|
||||
{
|
||||
if ((int) m_entity->type != type) {
|
||||
m_err1("Redefinition of entity %s ignored", m_entity->name) ;
|
||||
|
@ -63,8 +62,7 @@ void m_eduptype(type)
|
|||
}
|
||||
|
||||
/* Tests if an entity is too long */
|
||||
void m_longent(context)
|
||||
int context ;
|
||||
void m_longent(int context)
|
||||
{
|
||||
if (m_entclen >= M_LITLEN) {
|
||||
m_curcon = context ;
|
||||
|
@ -74,8 +72,7 @@ void m_longent(context)
|
|||
}
|
||||
|
||||
/* Enters an entity name into the entity name tree */
|
||||
void m_ntrent(p)
|
||||
M_WCHAR *p ;
|
||||
void m_ntrent(M_WCHAR *p)
|
||||
{
|
||||
M_ENTITY *new ;
|
||||
|
||||
|
|
|
@ -40,8 +40,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
|
||||
/* Issue error message (no arguments) */
|
||||
void m_error(text)
|
||||
char *text;
|
||||
void m_error(char *text)
|
||||
{
|
||||
m_startmsg();
|
||||
m_errline(text);
|
||||
|
@ -316,9 +315,7 @@ void m_err7(
|
|||
|
||||
/* 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;
|
||||
void m_getline(M_WCHAR **file, int *line)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -64,8 +64,7 @@ void m_etcomplete(void)
|
|||
|
||||
/* 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 ;
|
||||
void m_frcend(M_ELEMENT val)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
M_ELEMENT poppedval ;
|
||||
|
|
|
@ -33,8 +33,7 @@
|
|||
|
||||
/* Procedure callable by interface designer. Returns number of occurrences
|
||||
of element on parse stack */
|
||||
int m_level(elt)
|
||||
M_WCHAR *elt ;
|
||||
int m_level(M_WCHAR *elt)
|
||||
{
|
||||
int i = 0 ;
|
||||
M_PARSE *stackptr ;
|
||||
|
@ -48,8 +47,7 @@ int m_level(elt)
|
|||
}
|
||||
|
||||
|
||||
int m_mblevel(elt)
|
||||
char *elt ;
|
||||
int m_mblevel(char *elt)
|
||||
{
|
||||
int retval;
|
||||
M_WCHAR *wc_elt;
|
||||
|
|
|
@ -38,11 +38,8 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#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 ;
|
||||
LOGICAL m_lookent(M_WCHAR *name, unsigned char *type, M_WCHAR **content,
|
||||
unsigned char *wheredef)
|
||||
{
|
||||
M_ENTITY *entity ;
|
||||
|
||||
|
|
|
@ -99,11 +99,7 @@ void m_expecting(void)
|
|||
|
||||
/* 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 ;
|
||||
void m_expexpand(LOGICAL *expstart, M_STATE node, LOGICAL *required, LOGICAL *data)
|
||||
{
|
||||
M_ARC parc ;
|
||||
M_ANDGROUP pand ;
|
||||
|
@ -125,10 +121,7 @@ void m_expexpand(expstart, node, required, data)
|
|||
}
|
||||
|
||||
/* M_expline writes one line for m_expecting() */
|
||||
void m_expline(expstart, data, label)
|
||||
LOGICAL *expstart ;
|
||||
LOGICAL *data ;
|
||||
M_ELEMENT label ;
|
||||
void m_expline(LOGICAL *expstart, LOGICAL *data, M_ELEMENT label)
|
||||
{
|
||||
char buffer[M_NAMELEN + 2*MAXD + 1] ;
|
||||
|
||||
|
@ -165,9 +158,7 @@ void m_expline(expstart, data, label)
|
|||
|
||||
/* 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 ;
|
||||
void m_exptend(LOGICAL *expstart, M_PARSE *stackptr)
|
||||
{
|
||||
char buffer[M_NAMELEN + 2*MAXD + 1] ;
|
||||
|
||||
|
@ -216,9 +207,7 @@ void m_exptend(expstart, stackptr)
|
|||
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_ELEMENT m_findunique(M_STATE from, int *newleft)
|
||||
{
|
||||
M_ARC parc ;
|
||||
M_ELEMENT cr = 0, minim = 0;
|
||||
|
@ -339,7 +328,7 @@ LOGICAL m_omitend(void)
|
|||
|
||||
/* 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()
|
||||
LOGICAL m_omitstart(void)
|
||||
{
|
||||
M_ELEMENT c = M_NULLVAL ;
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ Copyright 1988, 1989 Hewlett-Packard Co.
|
|||
#include "parser.h"
|
||||
|
||||
/* Get program options from a string */
|
||||
void m_optstring(p)
|
||||
char *p ;
|
||||
void m_optstring(char *p)
|
||||
{
|
||||
if (strchr(p, 'a')) m_malftrace = TRUE ;
|
||||
if (strchr(p, 'c')) m_chtrace = TRUE ;
|
||||
|
|
|
@ -42,8 +42,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
/* Process the value for the parameter whose index number was previously
|
||||
saved in m_ppsave */
|
||||
void m_attval(string)
|
||||
M_WCHAR *string ;
|
||||
void m_attval(M_WCHAR *string)
|
||||
{
|
||||
const M_WCHAR *p ;
|
||||
|
||||
|
@ -65,8 +64,7 @@ void m_attval(string)
|
|||
|
||||
/* Process a string that is a parameter value not prefixed by the parameter
|
||||
name and value indicator */
|
||||
LOGICAL m_attvonly(string)
|
||||
M_WCHAR *string ;
|
||||
LOGICAL m_attvonly(M_WCHAR *string)
|
||||
{
|
||||
const M_WCHAR *p ;
|
||||
int par, i ;
|
||||
|
@ -152,8 +150,7 @@ void m_findatt(void)
|
|||
}
|
||||
|
||||
/* Free the parameter storage associated with an element on the parse stack */
|
||||
void m_freeparam(stackelt)
|
||||
M_PARSE *stackelt ;
|
||||
void m_freeparam(M_PARSE *stackelt)
|
||||
{
|
||||
int i ;
|
||||
int par ;
|
||||
|
@ -173,9 +170,7 @@ void m_freeparam(stackelt)
|
|||
/* 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 ;
|
||||
void m_parupper(int par, M_WCHAR *string)
|
||||
{
|
||||
M_WCHAR *p ;
|
||||
M_WCHAR *q ;
|
||||
|
@ -233,11 +228,7 @@ void m_stkdefaultparams(void)
|
|||
}
|
||||
|
||||
/* Stack one default parameter */
|
||||
void m_stkonedef(par, scanel, poccur, i)
|
||||
int par ;
|
||||
M_ELEMENT scanel ;
|
||||
M_WCHAR **poccur ;
|
||||
int i ;
|
||||
void m_stkonedef(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 &&
|
||||
|
@ -313,8 +304,7 @@ void m_updatedefault(const int par , const M_WCHAR *string )
|
|||
|
||||
/* 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 ;
|
||||
LOGICAL m_validinpar(M_WCHAR *string)
|
||||
{
|
||||
int par ;
|
||||
M_WCHAR *p ;
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
/* 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_WCHAR *m_parent(int n)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
|
||||
|
|
|
@ -36,9 +36,7 @@
|
|||
#include "entext.h"
|
||||
|
||||
/* Main procedure */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static char parserr[] = "\nM_token=%d, m_prevcon=%d, m_scanval=%d\n" ;
|
||||
static char sopt[] =
|
||||
|
|
|
@ -87,7 +87,7 @@ M_ELEMENT m_eltname(void)
|
|||
}
|
||||
}
|
||||
|
||||
int get_mb_cur_max()
|
||||
int get_mb_cur_max(void)
|
||||
{
|
||||
char *l;
|
||||
int i;
|
||||
|
|
|
@ -38,10 +38,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
|
||||
/* When a processing instruction or SDATA entity other than a CODE entity
|
||||
occurs */
|
||||
void m_piaction(m_pi, m_entname, m_enttype)
|
||||
M_WCHAR *m_pi ;
|
||||
M_WCHAR *m_entname ;
|
||||
int m_enttype ;
|
||||
void m_piaction(M_WCHAR *m_pi, M_WCHAR *m_entname, int m_enttype)
|
||||
{
|
||||
m_stackpar = m_stacktop->piparam ;
|
||||
(*m_ptable[m_stacktop->picase])(m_pi, m_entname, m_enttype) ;
|
||||
|
|
|
@ -62,8 +62,7 @@ int m_actgetc(void)
|
|||
}
|
||||
|
||||
/* Expand an entity reference */
|
||||
void m_entexpand(openent)
|
||||
M_ENTITY *openent ;
|
||||
void m_entexpand(M_ENTITY *openent)
|
||||
{
|
||||
M_WCHAR *p ;
|
||||
M_HOLDTYPE dchar ;
|
||||
|
@ -231,9 +230,7 @@ void m_entexpand(openent)
|
|||
|
||||
/* An srlen-character long short-reference delimiter has been found. Verify
|
||||
that it is not the prefix of a general delimiter recognized in context*/
|
||||
LOGICAL m_gendelim(srlen, context)
|
||||
int srlen ;
|
||||
int context ;
|
||||
LOGICAL m_gendelim(int srlen, int context)
|
||||
{
|
||||
int ghold[MAXD + 1] ;
|
||||
int ucase ;
|
||||
|
@ -321,8 +318,7 @@ LOGICAL m_gendelim(srlen, context)
|
|||
|
||||
/* Reads next input character from the current source file or from an
|
||||
entity expansion */
|
||||
int m_getachar(dchar)
|
||||
M_HOLDTYPE *dchar ;
|
||||
int m_getachar(M_HOLDTYPE *dchar)
|
||||
{
|
||||
int c ;
|
||||
int i ;
|
||||
|
@ -424,10 +420,7 @@ void m_getname(M_WCHAR first)
|
|||
}
|
||||
|
||||
/* Reads the next token */
|
||||
int m_gettoken(c, dchar, context)
|
||||
int *c ;
|
||||
M_HOLDTYPE *dchar ;
|
||||
int context ;
|
||||
int m_gettoken(int *c, M_HOLDTYPE *dchar, int context)
|
||||
{
|
||||
int hold[MAXD + 1], next ;
|
||||
int ucase ;
|
||||
|
@ -551,8 +544,7 @@ int m_gettoken(c, dchar, context)
|
|||
}
|
||||
|
||||
/* Reads a literal */
|
||||
void m_litproc(delim)
|
||||
int delim ;
|
||||
void m_litproc(int delim)
|
||||
{
|
||||
int n, i ;
|
||||
M_HOLDTYPE dchar ;
|
||||
|
@ -883,8 +875,7 @@ void m_setmap(int map, LOGICAL useoradd)
|
|||
}
|
||||
|
||||
/* Check for short reference delimiters */
|
||||
void m_shortref(context)
|
||||
int context ;
|
||||
void m_shortref(int context)
|
||||
{
|
||||
int n = 0 ;
|
||||
int i ;
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
#include "parser.h"
|
||||
|
||||
/* Set a user-defined C variable to the corresponding parameter value */
|
||||
void m_setparam(cvar, par)
|
||||
M_WCHAR **cvar ;
|
||||
int par ;
|
||||
void m_setparam(M_WCHAR **cvar, int par)
|
||||
{
|
||||
*cvar = m_stackpar->param[par] ;
|
||||
}
|
||||
|
|
|
@ -36,8 +36,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
#include "sfile.c"
|
||||
|
||||
/* Perform the m_action-th start-code in the interface */
|
||||
void m_strtcase(m_action)
|
||||
int m_action ;
|
||||
void m_strtcase(int m_action)
|
||||
{
|
||||
(*m_stable[m_action])() ;
|
||||
}
|
||||
|
|
|
@ -46,8 +46,7 @@ This product and information is proprietary of Tandem Computers Incorporated.
|
|||
is valid input. It returns TRUE, FALSE, or M_NONCONTEXTUAL respectively
|
||||
if the element is allowed by content, not allowed, or allowed by an
|
||||
inclusion exception. */
|
||||
int m_checkstart(val)
|
||||
M_ELEMENT val ;
|
||||
int m_checkstart(M_ELEMENT val)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
int except ;
|
||||
|
@ -238,8 +237,7 @@ void m_done(void)
|
|||
}
|
||||
|
||||
/* Process the endtag (implied, abbreviated, or explicit) for element C*/
|
||||
void m_endtag(c)
|
||||
M_ELEMENT c ;
|
||||
void m_endtag(M_ELEMENT c)
|
||||
{
|
||||
m_endaction(c) ;
|
||||
m_pop() ;
|
||||
|
@ -251,8 +249,7 @@ void m_endtag(c)
|
|||
|
||||
/* Check that the identified element is not prohibited in the current context
|
||||
by an exclusion exception */
|
||||
LOGICAL m_excluded(elt)
|
||||
M_ELEMENT elt ;
|
||||
LOGICAL m_excluded(M_ELEMENT elt)
|
||||
{
|
||||
M_PARSE *stackptr ;
|
||||
int except ;
|
||||
|
@ -270,8 +267,7 @@ LOGICAL m_excluded(elt)
|
|||
|
||||
/* Free the OPEN FSA substructures associated with an element on
|
||||
the parse stack */
|
||||
void m_freeFSA(stackelt)
|
||||
M_PARSE *stackelt ;
|
||||
void m_freeFSA(M_PARSE *stackelt)
|
||||
{
|
||||
M_OPENFSA *fsastack ;
|
||||
M_ANDLIST *usedand ;
|
||||
|
@ -290,9 +286,7 @@ void m_freeFSA(stackelt)
|
|||
}
|
||||
|
||||
/* Free storage used for tentative chain of tag minimizations */
|
||||
void m_freemin(min, msg)
|
||||
M_MIN *min ;
|
||||
char *msg ;
|
||||
void m_freemin(M_MIN *min, char *msg)
|
||||
{
|
||||
M_MIN *discard ;
|
||||
|
||||
|
@ -307,9 +301,7 @@ void m_freemin(min, msg)
|
|||
in the current content model by starting a new submodel of the and-group
|
||||
indicated by fsastack, or (if the and-group is within a seq-group) by
|
||||
continuing past the and-group */
|
||||
LOGICAL m_nextand(thisfsa, label)
|
||||
M_OPENFSA *thisfsa ;
|
||||
M_ELEMENT label ;
|
||||
LOGICAL m_nextand(M_OPENFSA *thisfsa, M_ELEMENT label)
|
||||
{
|
||||
M_ANDLIST *newgroup ;
|
||||
M_ANDGROUP pand ;
|
||||
|
@ -461,8 +453,7 @@ void m_push(M_ELEMENT elt, M_STATE current, LOGICAL need)
|
|||
character is treated differently so that if character data is not
|
||||
allowed in the current context, an error message is issued with the
|
||||
first character only and not with every character. */
|
||||
void m_strtcdata(scanval)
|
||||
int scanval ;
|
||||
void m_strtcdata(int scanval)
|
||||
{
|
||||
if (! m_strtproc(M_NULLVAL))
|
||||
if (m_whitespace((M_WCHAR) scanval)) {
|
||||
|
@ -493,8 +484,7 @@ void m_strtcdata(scanval)
|
|||
to an element that was within #PCDATA, m_strtproc saves the current context
|
||||
and restores it after returning from the last call to m_endtag.)
|
||||
*/
|
||||
LOGICAL m_strtproc(scanval)
|
||||
M_ELEMENT scanval ;
|
||||
LOGICAL m_strtproc(M_ELEMENT scanval)
|
||||
{
|
||||
int check ;
|
||||
M_PARSE *original ;
|
||||
|
|
|
@ -167,9 +167,7 @@ delim.h.
|
|||
#include "cont.h"
|
||||
|
||||
/* Main procedure */
|
||||
int main(argc, argv)
|
||||
int argc ;
|
||||
char **argv ;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int n ;
|
||||
|
||||
|
|
|
@ -81,8 +81,7 @@ void dumptree(LOGICAL sparse)
|
|||
}
|
||||
|
||||
/* Enter a delimiter into the delimiter tree for a particular context */
|
||||
void enterdelim(n)
|
||||
int n;
|
||||
void enterdelim(int n)
|
||||
{
|
||||
if (! contree[n])
|
||||
{
|
||||
|
@ -107,8 +106,7 @@ if (m_ntrtrie(dstruct->string,
|
|||
}
|
||||
|
||||
/* Read the code to be executed with a given state transition */
|
||||
void getcode(n)
|
||||
int n;
|
||||
void getcode(int n)
|
||||
{
|
||||
int c ; /* c is int instead of char for use with ungetc */
|
||||
int nested = 1;
|
||||
|
@ -616,8 +614,7 @@ void nextcon(LOGICAL sparse)
|
|||
|
||||
/* If sparse matrix output option, generate a single element of transit
|
||||
array */
|
||||
void prtctxt(column, value)
|
||||
int column, value;
|
||||
void prtctxt(int column, int value)
|
||||
{
|
||||
static LOGICAL first = TRUE;
|
||||
|
||||
|
@ -652,8 +649,7 @@ void skiptoend(void)
|
|||
}
|
||||
|
||||
/* Return a character to the input stream for re-reading */
|
||||
void unread(c)
|
||||
int c;
|
||||
void unread(int c)
|
||||
{
|
||||
M_WCHAR wnl;
|
||||
|
||||
|
|
|
@ -49,8 +49,7 @@ char xerror[] = "ERROR" ;
|
|||
|
||||
/* Outputs entity definitions */
|
||||
#define ENTFILENAME 12
|
||||
void entout(fname)
|
||||
char *fname ;
|
||||
void entout(char *fname)
|
||||
{
|
||||
char efilename[ENTFILENAME] ;
|
||||
int count = 1 ;
|
||||
|
@ -173,15 +172,13 @@ void entout(fname)
|
|||
|
||||
/* Entptr is called by m_dumptrie to output the value stored with a
|
||||
particular entity in the entity trie */
|
||||
void entptr(data)
|
||||
M_ENTITY *data ;
|
||||
void entptr(M_ENTITY *data)
|
||||
{
|
||||
fprintf(entfile, "(M_TRIE *) &m_entities[%d]", data->index - 1) ;
|
||||
}
|
||||
|
||||
/* Typetype returns a string indicating the type of the nth entity.*/
|
||||
char *typetype(n)
|
||||
int n ;
|
||||
char *typetype(int n)
|
||||
{
|
||||
switch(n) {
|
||||
case M_GENERAL: return(xgeneral) ;
|
||||
|
|
|
@ -83,16 +83,14 @@ void eprefix(LOGICAL flag)
|
|||
/* Writes part of an error message. Called from m_malloc instead of
|
||||
m_err1, since PARSER's version of m_err1 calls m_malloc and recursive
|
||||
calls are possible when the heap is exhausted */
|
||||
void m_errline(text)
|
||||
char *text ;
|
||||
void m_errline(char *text)
|
||||
{
|
||||
fputs(text, stderr) ;
|
||||
fputs(text, m_errfile) ;
|
||||
}
|
||||
|
||||
/* Writes an error message to standard error and file "error" */
|
||||
void m_error(text)
|
||||
char *text ;
|
||||
void m_error(char *text)
|
||||
{
|
||||
eprefix(TRUE) ;
|
||||
fprintf(stderr,"%s", text) ;
|
||||
|
@ -192,30 +190,26 @@ void esuffix(void)
|
|||
}
|
||||
|
||||
/* Print something to both stderr and m_errfile */
|
||||
void msgline(text)
|
||||
char *text ;
|
||||
void msgline(char *text)
|
||||
{
|
||||
fprintf(stderr, "%s", text) ;
|
||||
fprintf(m_errfile, "%s", text) ;
|
||||
}
|
||||
|
||||
/* Print something to both stderr and m_errfile */
|
||||
void msg1line(text, arg1)
|
||||
char *text, *arg1 ;
|
||||
void msg1line(char *text, char *arg1)
|
||||
{
|
||||
fprintf(stderr, text, arg1) ;
|
||||
fprintf(m_errfile, text, arg1) ;
|
||||
}
|
||||
|
||||
/* Trace used for m_malloc trace output */
|
||||
void m_trace(text)
|
||||
char *text ;
|
||||
void m_trace(char *text)
|
||||
{
|
||||
m_errline(text) ;
|
||||
}
|
||||
|
||||
void m_wctrace(text)
|
||||
M_WCHAR *text ;
|
||||
void m_wctrace(M_WCHAR *text)
|
||||
{
|
||||
char *mb_text;
|
||||
|
||||
|
@ -225,8 +219,7 @@ m_free(mb_text,"multi-byte string");
|
|||
}
|
||||
|
||||
/* Writes a nonfatal error message to standard error and file "error" */
|
||||
void warning(text)
|
||||
char *text ;
|
||||
void warning(char *text)
|
||||
{
|
||||
eprefix(FALSE) ;
|
||||
fprintf(stderr,"%s", text) ;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue