* Purpose: Initializes our global variables to valid starting values.
*
****************************************************************************/
-static void GlobalInit()
+static void GlobalInit(void)
{
#include "entdef.h"
/* Main procedure */
-int main(argc, argv)
-int argc ;
-char **argv ;
+int main(int argc, char **argv)
{
int m_prevcon ;
/* 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;
#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 ;
/*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 ;
/*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 ;
}
/* 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 ;
}
/* Copyintolist copies one list of states into another */
-void copyintolist(from, to)
- STATELIST *from, **to ;
+void copyintolist(STATELIST *from, STATELIST **to)
{
STATELIST **new, *old ;
}
/* Dellist deletes a list of states */
-void dellist(list)
- STATELIST **list ;
+void dellist(STATELIST **list)
{
STATELIST *p, *q ;
}
/* 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 ;
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 ;
}
/* 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 ;
}
/* 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 ;
/* 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;
/* 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) {
/* 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 ;
/* 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 ;
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 ;
/* 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 ;
/* 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 ;
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 ;
/* 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) ;
}
/* 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) ;
/* 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)
/* 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) ;
}
/* 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] ;
}
/* 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) ;
}
/* 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) ;
}
/* 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 ;
}
/* 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) ;
#include "sref.h"
/* Reads a name */
-LOGICAL getname(first)
- int first;
+LOGICAL getname(int first)
{
M_WCHAR *p;
int c;
/* 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;
/* 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;
}
/* 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;
}
/* Release storage used for the tree representation of a rule */
-void freetree(treep)
- TREE *treep ;
+void freetree(TREE *treep)
{
TREE *child, *discard ;
#include "entity.h"
/* Main program */
-int main(argc, argv)
- int argc ;
- char **argv ;
+int main(int argc, char **argv)
{
int m_token ;
#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;
/* 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));
/* 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;
}
/* Output #define's for parameter values */
-void outpval(p)
-M_TRIE *p;
+void outpval(M_TRIE *p)
{
M_WCHAR *q;
}
/* 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;
}
/* 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];
#include "delim.h"
/* Reads a name token */
-void getname(first)
-int first;
+void getname(int first)
{
M_WCHAR *p, wus;
int c, cttype;
#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;
}
/* Process error message text */
-void m_errline(p)
-char *p;
+void m_errline(char *p)
{
char c;
}
/* Exit procedure */
-void m_exit(status)
-int status;
+void m_exit(int status)
{
if (filefound)
{
}
/* Get-char procedure */
-int m_getc(m_ptr)
-void *m_ptr;
+int m_getc(void *m_ptr)
{
int c;
M_WCHAR wc;
}
/* Open SYSTEM entity procedure */
-void *m_openent(entcontent)
-M_WCHAR *entcontent;
+void *m_openent(M_WCHAR *entcontent)
{
FILE *open;
char *filename;
}
/* 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) */
/* 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;
/* 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;
}
/* 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;
/* This procedure starts a CHAPTER */
-void chapstart(id)
-M_WCHAR *id;
+void chapstart(M_WCHAR *id)
{
M_WCHAR *p, *q, *wc;
int i;
} /* 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],
/* 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];
/* Start a rsect */
-void rsectstart(id)
-M_WCHAR *id;
+void rsectstart(M_WCHAR *id)
{
savid = checkid(id);
iderr = 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;
/* 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";
}
-void EndList()
+void EndList(void)
{
LIST *curlist ;
CONTCHAIN *chain, *xchain ;
* fashion.
*/
static char *
-GetStdLocale()
+GetStdLocale(void)
{
static char buffer[256];
static char *cString = "C";
* versions of the language and charset.
*/
void
-SetDefaultLocale()
+SetDefaultLocale(void)
{
unsigned char type,wheredef;
M_WCHAR *elementName;
return(newstring);
}
-int NextId()
+int NextId(void)
{
static id = 0;
return ++id;
}
-char *GetLanguage()
+char *GetLanguage(void)
{
static char *pLang = NULL;
return pLang;
}
-char *GetCharset()
+char *GetCharset(void)
{
static char *pCharset = NULL;
}
-void IncludeToss()
+void IncludeToss(void)
{
char pathbuf[BIGBUF];
char *try = pathbuf;
* 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;
needFData = TRUE;
}
-void PopForm()
+void PopForm(void)
{
if (inBlock)
{
--formStackTop;
}
-void PopForm2()
+void PopForm2(void)
{
if (inBlock)
{
* 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))
{
}
}
-void EmitSavedAnchors()
+void EmitSavedAnchors(void)
{
char buffer[BIGBUF];
}
}
-void CloseVirpage()
+void CloseVirpage(void)
{
if (parTextId)
{
/* 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;
}
/* call echohead with a literal string */
-void mb_echohead(p)
-char *p;
+void mb_echohead(char *p)
{
M_WCHAR *wc;
* 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);
/* 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);
/* 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;
}
-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;
}
/* 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;
}
-void mb_strcode(string, outfile)
-char *string;
-FILE *outfile;
+void mb_strcode(char *string, FILE *outfile)
{
M_WCHAR *wc;
}
/* 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;
}
/* Copies string to end of buffer where saving table caption */
-void svtcstring(string)
-M_WCHAR *string;
+void svtcstring(M_WCHAR *string)
{
int length;
}
/* 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;
#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;
}
/* 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;
}
/* Copies string to end of current cross-reference string */
-void idstring(string)
-M_WCHAR *string;
+void idstring(M_WCHAR *string)
{
int length;
}
/* Generate a cross-reference */
-void xrefexpand(id)
-M_WCHAR *id;
+void xrefexpand(M_WCHAR *id)
{
struct xref *xref;
struct xref *old;
#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];
}
/* 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;
}
/* 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;
#include "userinc.h"
#include "globdec.h"
-void m_closent(m_ptr)
- void *m_ptr ;
+void m_closent(void *m_ptr)
{
fclose((FILE *) m_ptr) ;
}
#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])() ;
}
#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;
/* 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])() ;
}
/* 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) ;
}
/* 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 ;
}
/* 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 ;
/* Issue error message (no arguments) */
-void m_error(text)
- char *text;
+void m_error(char *text)
{
m_startmsg();
m_errline(text);
/* 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;
/* 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 ;
/* 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 ;
}
-int m_mblevel(elt)
- char *elt ;
+int m_mblevel(char *elt)
{
int retval;
M_WCHAR *wc_elt;
#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 ;
/* 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 ;
}
/* 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] ;
/* 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] ;
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;
/* 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 ;
#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 ;
/* 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 ;
/* 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 ;
}
/* 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 ;
/* 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 ;
}
/* 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 &&
/* 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 ;
/* 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 ;
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;
}
}
-int get_mb_cur_max()
+int get_mb_cur_max(void)
{
char *l;
int i;
/* 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) ;
}
/* Expand an entity reference */
-void m_entexpand(openent)
- M_ENTITY *openent ;
+void m_entexpand(M_ENTITY *openent)
{
M_WCHAR *p ;
M_HOLDTYPE dchar ;
/* 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 ;
/* 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 ;
}
/* 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 ;
}
/* Reads a literal */
-void m_litproc(delim)
- int delim ;
+void m_litproc(int delim)
{
int n, i ;
M_HOLDTYPE dchar ;
}
/* Check for short reference delimiters */
-void m_shortref(context)
-int context ;
+void m_shortref(int context)
{
int n = 0 ;
int i ;
#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] ;
}
#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])() ;
}
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 ;
}
/* 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() ;
/* 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 ;
/* 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 ;
}
/* 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 ;
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 ;
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)) {
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 ;
#include "cont.h"
/* Main procedure */
-int main(argc, argv)
- int argc ;
- char **argv ;
+int main(int argc, char **argv)
{
int n ;
}
/* Enter a delimiter into the delimiter tree for a particular context */
-void enterdelim(n)
- int n;
+void enterdelim(int n)
{
if (! contree[n])
{
}
/* 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;
/* 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;
}
/* Return a character to the input stream for re-reading */
-void unread(c)
-int c;
+void unread(int c)
{
M_WCHAR wnl;
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") ;
/* Outputs entity definitions */
#define ENTFILENAME 12
-void entout(fname)
- char *fname ;
+void entout(char *fname)
{
char efilename[ENTFILENAME] ;
int count = 1 ;
/* 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) ;
/* 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) ;
}
/* 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;
}
/* 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) ;
/* 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) ;
}
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 ;
}
/* copyfile inserted by ced, 12-1-89. */
-void copyfile(pfile1,pfile2)
- char *pfile1, *pfile2;
+void copyfile(char *pfile1, char *pfile2)
{
int ret;
char *pcmd;
free(pcmd);
}
-int nextchar(file, data)
- FILE *file ;
- struct data *data ;
+int nextchar(FILE *file, struct data *data)
{
while (data->linestart) {
data->linestart = FALSE ;
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) ;
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 ;
return(s) ;
}
-void reverse(s)
-char s[];
+void reverse(char s[])
{
int c, i, j;
/* 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) ;
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] ;
}
}
-void *m_malloc(size, msg)
- int size ;
- char *msg ;
+void *m_malloc(int size, char *msg)
{
char buffer[32] ;
void *p ;
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 ;
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 ;
}
/* 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;
}
/* 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 */
/* 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;
/* 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;
/* 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 ;
* 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 ;
}
/* 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 ;
/* 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 ;
/* 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 ;
/* 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) ;
}
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 ;
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 ;
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 ;
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 ;
/* Get-wide-char procedure */
-int mb_getwc(m_ptr)
-void *m_ptr;
+int mb_getwc(void *m_ptr)
{
int c;
M_WCHAR wc;
#include "entdef.h"
/* Main procedure */
-int main(argc, argv)
-int argc ;
-char **argv ;
+int main(int argc, char **argv)
{
int m_prevcon ;
/* 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;
#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 ;
/*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 ;
/*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 ;
}
/* 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 ;
}
/* Copyintolist copies one list of states into another */
-void copyintolist(from, to)
- STATELIST *from, **to ;
+void copyintolist(STATELIST *from, STATELIST **to)
{
STATELIST **new, *old ;
}
/* Dellist deletes a list of states */
-void dellist(list)
- STATELIST **list ;
+void dellist(STATELIST **list)
{
STATELIST *p, *q ;
}
/* 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 ;
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 ;
}
/* 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 ;
}
/* 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 ;
/* 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;
/* 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) {
/* 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 ;
/* 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 ;
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 ;
/* 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 ;
/* 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 ;
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 ;
/* 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) ;
}
/* 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) ;
/* 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)
/* 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) ;
}
/* 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] ;
}
/* 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) ;
}
/* 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) ;
}
/* 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 ;
}
/* 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) ;
#include "sref.h"
/* Reads a name */
-LOGICAL getname(first)
- int first;
+LOGICAL getname(int first)
{
M_WCHAR *p;
int c;
/* 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;
/* 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;
}
/* 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;
}
/* Release storage used for the tree representation of a rule */
-void freetree(treep)
- TREE *treep ;
+void freetree(TREE *treep)
{
TREE *child, *discard ;
#include "entity.h"
/* Main program */
-int main(argc, argv)
- int argc ;
- char **argv ;
+int main(int argc, char **argv)
{
int m_token ;
#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;
/* 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));
/* 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;
}
/* Output #define's for parameter values */
-void outpval(p)
-M_TRIE *p;
+void outpval(M_TRIE *p)
{
M_WCHAR *q;
}
/* 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;
}
/* 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];
#include "delim.h"
/* Reads a name token */
-void getname(first)
-int first;
+void getname(int first)
{
M_WCHAR *p, wus;
int c, cttype;
#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;
}
/* Process error message text */
-void m_errline(p)
-char *p;
+void m_errline(char *p)
{
char c;
}
/* Exit procedure */
-void m_exit(status)
-int status;
+void m_exit(int status)
{
if (filefound)
{
}
/* Get-char procedure */
-int m_getc(m_ptr)
-void *m_ptr;
+int m_getc(void *m_ptr)
{
int c;
M_WCHAR wc;
}
/* Open SYSTEM entity procedure */
-void *m_openent(entcontent)
-M_WCHAR *entcontent;
+void *m_openent(M_WCHAR *entcontent)
{
FILE *open;
char *filename;
}
/* 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) */
/* 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;
/* 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;
}
/* 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;
/* This procedure starts a CHAPTER */
-void chapstart(id)
-M_WCHAR *id;
+void chapstart(M_WCHAR *id)
{
M_WCHAR *p, *q, *wc;
int i;
} /* 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],
/* 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];
/* Start a rsect */
-void rsectstart(id)
-M_WCHAR *id;
+void rsectstart(M_WCHAR *id)
{
savid = checkid(id);
iderr = 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;
/* 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";
}
-void EndList()
+void EndList(void)
{
LIST *curlist ;
CONTCHAIN *chain, *xchain ;
* versions of the language and charset.
*/
void
-SetDefaultLocale()
+SetDefaultLocale(void)
{
unsigned char type,wheredef;
M_WCHAR *elementName;
return(newstring);
}
-int NextId()
+int NextId(void)
{
static id = 0;
return ++id;
}
-char *GetLanguage()
+char *GetLanguage(void)
{
static char *pLang = NULL;
return pLang;
}
-char *GetCharset()
+char *GetCharset(void)
{
static char *pCharset = NULL;
* 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;
needFData = TRUE;
}
-void PopForm()
+void PopForm(void)
{
if (inBlock)
{
--formStackTop;
}
-void PopForm2()
+void PopForm2(void)
{
if (inBlock)
{
* 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))
{
}
}
-void EmitSavedAnchors()
+void EmitSavedAnchors(void)
{
char buffer[BIGBUF];
}
}
-void CloseVirpage()
+void CloseVirpage(void)
{
if (parTextId)
{
/* 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;
}
/* call echohead with a literal string */
-void mb_echohead(p)
-char *p;
+void mb_echohead(char *p)
{
M_WCHAR *wc;
* 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);
/* 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);
/* 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;
}
-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;
}
/* 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;
}
-void mb_strcode(string, outfile)
-char *string;
-FILE *outfile;
+void mb_strcode(char *string, FILE *outfile)
{
M_WCHAR *wc;
}
/* 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;
}
/* Copies string to end of buffer where saving table caption */
-void svtcstring(string)
-M_WCHAR *string;
+void svtcstring(M_WCHAR *string)
{
int length;
}
/* 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;
#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 ;
#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;
}
/* 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;
}
/* Copies string to end of current cross-reference string */
-void idstring(string)
-M_WCHAR *string;
+void idstring(M_WCHAR *string)
{
int length;
}
/* Generate a cross-reference */
-void xrefexpand(id)
-M_WCHAR *id;
+void xrefexpand(M_WCHAR *id)
{
struct xref *xref;
struct xref *old;
#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];
}
/* 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;
}
/* 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;
#include "userinc.h"
#include "globdec.h"
-void m_closent(m_ptr)
- void *m_ptr ;
+void m_closent(void *m_ptr)
{
fclose((FILE *) m_ptr) ;
}
#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])() ;
}
#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;
/* 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])() ;
}
/* 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) ;
}
/* 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 ;
}
/* 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 ;
/* Issue error message (no arguments) */
-void m_error(text)
- char *text;
+void m_error(char *text)
{
m_startmsg();
m_errline(text);
/* 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;
/* 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 ;
/* 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 ;
}
-int m_mblevel(elt)
- char *elt ;
+int m_mblevel(char *elt)
{
int retval;
M_WCHAR *wc_elt;
#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 ;
/* 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 ;
}
/* 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] ;
/* 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] ;
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;
/* 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 ;
#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 ;
/* 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 ;
/* 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 ;
}
/* 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 ;
/* 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 ;
}
/* 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 &&
/* 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 ;
/* 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 ;
#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[] =
}
}
-int get_mb_cur_max()
+int get_mb_cur_max(void)
{
char *l;
int i;
/* 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) ;
}
/* Expand an entity reference */
-void m_entexpand(openent)
- M_ENTITY *openent ;
+void m_entexpand(M_ENTITY *openent)
{
M_WCHAR *p ;
M_HOLDTYPE dchar ;
/* 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 ;
/* 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 ;
}
/* 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 ;
}
/* Reads a literal */
-void m_litproc(delim)
- int delim ;
+void m_litproc(int delim)
{
int n, i ;
M_HOLDTYPE dchar ;
}
/* Check for short reference delimiters */
-void m_shortref(context)
-int context ;
+void m_shortref(int context)
{
int n = 0 ;
int i ;
#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] ;
}
#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])() ;
}
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 ;
}
/* 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() ;
/* 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 ;
/* 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 ;
}
/* 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 ;
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 ;
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)) {
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 ;
#include "cont.h"
/* Main procedure */
-int main(argc, argv)
- int argc ;
- char **argv ;
+int main(int argc, char **argv)
{
int n ;
}
/* Enter a delimiter into the delimiter tree for a particular context */
-void enterdelim(n)
- int n;
+void enterdelim(int n)
{
if (! contree[n])
{
}
/* 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;
/* 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;
}
/* Return a character to the input stream for re-reading */
-void unread(c)
-int c;
+void unread(int c)
{
M_WCHAR wnl;
/* Outputs entity definitions */
#define ENTFILENAME 12
-void entout(fname)
- char *fname ;
+void entout(char *fname)
{
char efilename[ENTFILENAME] ;
int count = 1 ;
/* 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) ;
/* 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) ;
}
/* 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;
}
/* 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) ;
/* 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) ;
}
int nextchar(FILE *file, struct data *data);
-int main(argc, argv)
- int argc ;
- char **argv ;
+int main(int argc, char **argv)
{
FILE *one, *two ;
int c1, c2 ;
}
/* copyfile inserted by ced, 12-1-89. */
-void copyfile(pfile1,pfile2)
- char *pfile1, *pfile2;
+void copyfile(char *pfile1, char *pfile2)
{
int ret;
char *pcmd;
free(pcmd);
}
-int nextchar(file, data)
- FILE *file ;
- struct data *data ;
+int nextchar(FILE *file, struct data *data)
{
while (data->linestart) {
data->linestart = FALSE ;
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) ;
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 ;
return(s) ;
}
-void reverse(s)
-char s[];
+void reverse(char s[])
{
int c, i, j;
/* 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) ;
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] ;
free(block) ;
}
-void *m_malloc(size, msg)
- int size ;
- char *msg ;
+void *m_malloc(int size, char *msg)
{
char buffer[32] ;
void *p ;
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 ;
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 ;
}
/* 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;
}
/* 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 */
/* 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;
/* 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;
/* 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 ;
}
/* 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 ;
/* 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 ;
/* 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 ;
/* 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) ;
}
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 ;
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 ;
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 ;
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 ;
/* Get-wide-char procedure */
-int mb_getwc(m_ptr)
-void *m_ptr;
+int mb_getwc(void *m_ptr)
{
int c;
M_WCHAR wc;
#include "entdef.h"
/* Main procedure */
-int main(argc, argv)
-int argc ;
-char **argv ;
+int main(int argc, char **argv)
{
int m_prevcon ;
/* 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;
#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 ;
/*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 ;
/*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 ;
}
/* 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 ;
}
/* Copyintolist copies one list of states into another */
-void copyintolist(from, to)
- STATELIST *from, **to ;
+void copyintolist(STATELIST *from, STATELIST **to)
{
STATELIST **new, *old ;
}
/* Dellist deletes a list of states */
-void dellist(list)
- STATELIST **list ;
+void dellist(STATELIST **list)
{
STATELIST *p, *q ;
}
/* 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 ;
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 ;
}
/* 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 ;
}
/* 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 ;
/* 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;
/* 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) {
/* 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 ;
/* 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 ;
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 ;
/* 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 ;
/* 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 ;
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 ;
/* 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) ;
}
/* 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) ;
/* 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)
/* 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) ;
}
/* 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] ;
}
/* 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) ;
}
/* 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) ;
}
/* 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 ;
}
/* 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) ;
#include "sref.h"
/* Reads a name */
-LOGICAL getname(first)
- int first;
+LOGICAL getname(int first)
{
M_WCHAR *p;
int c;
/* 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;
/* 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;
}
/* 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;
}
/* Release storage used for the tree representation of a rule */
-void freetree(treep)
- TREE *treep ;
+void freetree(TREE *treep)
{
TREE *child, *discard ;
#include "entity.h"
/* Main program */
-int main(argc, argv)
- int argc ;
- char **argv ;
+int main(int argc, char **argv)
{
int m_token ;
#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;
/* 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));
/* 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;
}
/* Output #define's for parameter values */
-void outpval(p)
-M_TRIE *p;
+void outpval(M_TRIE *p)
{
M_WCHAR *q;
}
/* 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;
}
/* 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];
#include "delim.h"
/* Reads a name token */
-void getname(first)
-int first;
+void getname(int first)
{
M_WCHAR *p, wus;
int c, cttype;
#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;
}
/* Process error message text */
-void m_errline(p)
-char *p;
+void m_errline(char *p)
{
char c;
}
/* Exit procedure */
-void m_exit(status)
-int status;
+void m_exit(int status)
{
if (status)
}
/* Get-char procedure */
-int m_getc(m_ptr)
-void *m_ptr;
+int m_getc(void *m_ptr)
{
int c;
M_WCHAR wc;
}
/* Open SYSTEM entity procedure */
-void *m_openent(entcontent)
-M_WCHAR *entcontent;
+void *m_openent(M_WCHAR *entcontent)
{
FILE *open;
char *filename;
}
/* Set program options */
-void m_setoptions()
+void m_setoptions(void)
{
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;
}
/* All entity declarations have been processed. */
-void m_startdoc()
+void m_startdoc(void)
{
}
/* Write debugging trace information */
-void m_trace(p)
-char *p;
+void m_trace(char *p)
{
}
-void m_wctrace(p)
-M_WCHAR *p;
+void m_wctrace(M_WCHAR *p)
{
char *mb_p;
static int currentElementStackSize = 0;
static int currentElementStackTop = -1;
-void PushCurrentElement()
+void PushCurrentElement(void)
{
currentElementStackTop++;
if (currentElementStackSize == 0)
}
-void PopCurrentElement()
+void PopCurrentElement(void)
{
pCurrentElement = currentElementStack[currentElementStackTop];
if (currentElementStackTop < 0)
}
-static ElementPtr PopThisElement()
+static ElementPtr PopThisElement(void)
{
ElementPtr pThisElement;
/* decompress an SDL file */
-static void DecompressSDL()
+static void DecompressSDL(void)
{
int outFd, zFd;
FILE *inFile;
/* A routine to emit a help message and exit */
-static void Help()
+static void Help(void)
{
printf("The available options to %s are 'c', 'd', 'h', 'o' and 't'.\n\n",
progName);
/* A routine to emit a usage message and exit */
-static void Usage()
+static void Usage(void)
{
fprintf(stderr,
"Usage: %s [-cdhot] <inFileName> [<outFileName>]\n",
* A routine to pre-build all the input, output and intermediate file
* names that we'll need.
*/
-static void MakeFileNames()
+static void MakeFileNames(void)
{
int argCount;
int length, c;
/*
* A routine to build the index from the .idx file (if any).
*/
-void BuildIndex()
+void BuildIndex(void)
{
char buffer[BUFSIZ+1], *pFrom, *pTo, *pRestart, thisChar;
int length, size;
}
-static void HandleSNB()
+static void HandleSNB(void)
{
int oldOffset, newOffset;
FILE *snbFile;
/* calculate the size of the TOSS if only the used elements are
* emitted
*/
-static int RestrictedTossSize()
+static int RestrictedTossSize(void)
{
char buffer[32];
ElementPtr pThis;
/* iterate over the LOIDS computing the offsets as we remove the old
* LOIDS and INDEX and replace them with the new
*/
-void IterateLoids()
+void IterateLoids(void)
{
int replacing, length, incr, tmp;
int loidsSize;
* the amount of padding needed in between the vstruct and the first
* virpage to make everything work
*/
-static void CompressVstruct()
+static void CompressVstruct(void)
{
#define COMPRESS_PAD_LENGTH 10
char buffer[BUFSIZ], zTemp[4];
/* insert the new loids and index then close the output file */
-static void IncorporateVstructElements()
+static void IncorporateVstructElements(void)
{
char buffer[BUFSIZ];
int length, delta;
* file and its name is "TOSSFILE", change its content to be the
* current file name base plus ".tss".
*/
-void UpdateTossFileName()
+void UpdateTossFileName(void)
{
unsigned char type;
unsigned char wheredef;
/* a routine to do all the things we want to do before actually
* parsing the SDL document.
*/
-void OpenDocument()
+void OpenDocument(void)
{
MakeFileNames();
m_errfile = FopenFile(errFileName, O_WRONLY|O_APPEND, xxx);
/* a routine to do all those things we want to do after parsing the
* document such as doing the fixups in the vstruct
*/
-void CloseDocument()
+void CloseDocument(void)
{
FcloseFile(outFile, tempFileName, xxx);
BuildIndex();
#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];
}
/* 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;
}
/* 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;
#include "userinc.h"
#include "globdec.h"
-void m_closent(m_ptr)
- void *m_ptr ;
+void m_closent(void *m_ptr)
{
fclose((FILE *) m_ptr) ;
}
#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])() ;
}
#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;
/* 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])() ;
}
/* 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) ;
}
/* 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 ;
}
/* 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 ;
/* Issue error message (no arguments) */
-void m_error(text)
- char *text;
+void m_error(char *text)
{
m_startmsg();
m_errline(text);
/* 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;
/* 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 ;
/* 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 ;
}
-int m_mblevel(elt)
- char *elt ;
+int m_mblevel(char *elt)
{
int retval;
M_WCHAR *wc_elt;
#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 ;
/* 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 ;
}
/* 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] ;
/* 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] ;
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;
/* 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 ;
m_nextms = &(*m_nextms)->next ;
return(TRUE) ;
}
-
#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 ;
/* 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 ;
/* 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 ;
}
/* 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 ;
/* 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 ;
}
/* 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 &&
/* 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 ;
/* 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 ;
#include "entext.h"
/* Main procedure */
-void main(argc, argv)
- int argc ;
- char **argv ;
+void main(int argc, char **argv)
{
static char parserr[] = "\nM_token=%d, m_prevcon=%d, m_scanval=%d\n" ;
static char sopt[] =
}
}
-int get_mb_cur_max()
+int get_mb_cur_max(void)
{
char *l;
int i;
/* 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) ;
}
/* Expand an entity reference */
-void m_entexpand(openent)
- M_ENTITY *openent ;
+void m_entexpand(M_ENTITY *openent)
{
M_WCHAR *p ;
M_HOLDTYPE dchar ;
/* 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 ;
/* 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 ;
}
/* 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 ;
}
/* Reads a literal */
-void m_litproc(delim)
- int delim ;
+void m_litproc(int delim)
{
int n, i ;
M_HOLDTYPE dchar ;
}
/* Check for short reference delimiters */
-void m_shortref(context)
-int context ;
+void m_shortref(int context)
{
int n = 0 ;
int i ;
#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] ;
}
#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])() ;
}
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 ;
}
/* 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() ;
/* 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 ;
/* 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 ;
}
/* 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 ;
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 ;
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)) {
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 ;
#include "cont.h"
/* Main procedure */
-int main(argc, argv)
- int argc ;
- char **argv ;
+int main(int argc, char **argv)
{
int n ;
}
/* Enter a delimiter into the delimiter tree for a particular context */
-void enterdelim(n)
- int n;
+void enterdelim(int n)
{
if (! contree[n])
{
}
/* 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;
/* 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;
}
/* Return a character to the input stream for re-reading */
-void unread(c)
-int c;
+void unread(int c)
{
M_WCHAR wnl;
/* Outputs entity definitions */
#define ENTFILENAME 12
-void entout(fname)
- char *fname ;
+void entout(char *fname)
{
char efilename[ENTFILENAME] ;
int count = 1 ;
/* 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) ;
/* 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) ;
}
/* 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;
}
/* 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) ;
/* 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) ;
}
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 ;
}
/* copyfile inserted by ced, 12-1-89. */
-void copyfile(pfile1,pfile2)
- char *pfile1, *pfile2;
+void copyfile(char *pfile1, char *pfile2)
{
int ret;
char *pcmd;
free(pcmd);
}
-int nextchar(file, data)
- FILE *file ;
- struct data *data ;
+int nextchar(FILE *file, struct data *data)
{
while (data->linestart) {
data->linestart = FALSE ;
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) ;
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 ;
return(s) ;
}
-void reverse(s)
-char s[];
+void reverse(char s[])
{
int c, i, j;
/* 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) ;
free(block) ;
}
-void *m_malloc(size, msg)
- int size ;
- char *msg ;
+void *m_malloc(int size, char *msg)
{
char buffer[32] ;
void *p ;
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 ;
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 ;
}
/* 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;
}
/* 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 */
/* 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;
/* 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;
/* 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 ;
}
/* 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 ;
/* 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 ;
/* 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 ;
/* 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) ;
}
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 ;
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 ;
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 ;
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 ;
int m_upper(int c);
-int m_upper(c)
- int c ;
+int m_upper(int c)
{
if (c >= 'a' && c <= 'z') c += 'A' - 'a' ;
return(c) ;
int m_upstrcmp(char *p, char *q);
-int m_upstrcmp(p, q)
- char *p, *q ;
+int m_upstrcmp(char *p, char *q)
{
do {
if (m_upper((int) *p) < m_upper((int) *q)) return(-1) ;
/* Get-wide-char procedure */
-int mb_getwc(m_ptr)
-void *m_ptr;
+int mb_getwc(void *m_ptr)
{
int c;
M_WCHAR wc;