dthelp: merge duplicate headers
This commit is contained in:
240
cde/programs/dthelp/parser/include/eltdef/eltdef.h
Normal file
240
cde/programs/dthelp/parser/include/eltdef/eltdef.h
Normal file
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
* CDE - Common Desktop Environment
|
||||
*
|
||||
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
|
||||
*
|
||||
* These libraries and programs are free software; you can
|
||||
* redistribute them and/or modify them under the terms of the GNU
|
||||
* Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* These libraries and programs are distributed in the hope that
|
||||
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with these libraries and programs; if not, write
|
||||
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
||||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/* $XConsortium: eltdef.h /main/3 1995/11/08 10:44:51 rswiston $ */
|
||||
/*
|
||||
Copyright 1986 Tandem Computers Incorporated.
|
||||
This product and information is proprietary of Tandem Computers Incorporated.
|
||||
Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.
|
||||
*/
|
||||
|
||||
/* Eltdef.h is the include file for allocating global variables in ELTDEF */
|
||||
|
||||
#if defined(ELTDEF)
|
||||
#define ELTEXTERN
|
||||
#define ELTINIT(a) = a
|
||||
#else
|
||||
#define ELTEXTERN extern
|
||||
#define ELTINIT(a)
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/* Error recovery status */
|
||||
#define RENTITY 0
|
||||
#define RSIGNON 1
|
||||
#define RGLOBDEC 2
|
||||
#define RGLOBDEF 3
|
||||
#define RELEMENT 4
|
||||
|
||||
/* State transition network generated by CONTEXT */
|
||||
#include "sparse.h"
|
||||
|
||||
/* Indicates whether, and if so where, each character can appear in
|
||||
a name */
|
||||
#if defined(ELTDEF)
|
||||
#include "chartype.h"
|
||||
#else
|
||||
extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ;
|
||||
#endif
|
||||
|
||||
/* Scanned name or literal */
|
||||
ELTEXTERN M_WCHAR name[M_NAMELEN + 1] ;
|
||||
ELTEXTERN M_WCHAR literal[M_LITLEN + 1] ;
|
||||
|
||||
/* Associates a C variable with a particular parameter */
|
||||
typedef struct cvarstruct CVARSTRUCT ;
|
||||
struct cvarstruct {
|
||||
int param ;
|
||||
M_WCHAR *cvarptr ;
|
||||
CVARSTRUCT *next ;
|
||||
} ;
|
||||
ELTEXTERN CVARSTRUCT *cvarlist ;
|
||||
/* Current and previous context (state) of transition system
|
||||
controlling ELTDEF */
|
||||
ELTEXTERN int curcon ELTINIT(START) ;
|
||||
ELTEXTERN int m_prevcon ;
|
||||
|
||||
/* Character read-ahead buffer */
|
||||
ELTEXTERN int toundo ELTINIT(0) ;
|
||||
ELTEXTERN int maxundo ELTINIT(0) ;
|
||||
#define SAVECHAR 50
|
||||
ELTEXTERN int savechar[SAVECHAR] ;
|
||||
|
||||
/* Chain of elements named in pseudo-tag */
|
||||
typedef struct chain CHAIN ;
|
||||
struct chain {
|
||||
M_ELEMENT elt ;
|
||||
CHAIN *next ;
|
||||
} ;
|
||||
ELTEXTERN CHAIN *firstchain ELTINIT(NULL) ;
|
||||
ELTEXTERN CHAIN **nextchain ELTINIT(&firstchain) ;
|
||||
|
||||
/* Text character returned from scanner */
|
||||
ELTEXTERN M_WCHAR textchar ;
|
||||
|
||||
/* Identifying index of element currently being processed */
|
||||
ELTEXTERN M_ELEMENT openelt ELTINIT(M_NULLVAL) ;
|
||||
|
||||
/* Output files */
|
||||
ELTEXTERN FILE *globdec, *globdef, *string,
|
||||
*pfile, *tfile, *sfile, *efile, *entfile, *ifile, *stfile, *ifh, *pvalh ;
|
||||
|
||||
/* Flags indicating whether currently in the middle of processing
|
||||
an action */
|
||||
ELTEXTERN LOGICAL intext ELTINIT(FALSE),
|
||||
inent ELTINIT(FALSE),
|
||||
inpc ELTINIT(FALSE),
|
||||
insc ELTINIT(FALSE),
|
||||
inec ELTINIT(FALSE),
|
||||
instc ELTINIT(FALSE),
|
||||
instring ELTINIT(FALSE) ;
|
||||
|
||||
/* Location of global start-string and end-string, if any */
|
||||
ELTEXTERN int gss ELTINIT(0),
|
||||
ges ELTINIT(0) ;
|
||||
|
||||
/* Flags indicating whether default code setments are to be used */
|
||||
ELTEXTERN LOGICAL finitext ELTINIT(TRUE),
|
||||
finipi ELTINIT(TRUE),
|
||||
finistc ELTINIT(TRUE) ;
|
||||
|
||||
/* Whether have finished the sign-on message */
|
||||
ELTEXTERN LOGICAL signonend ELTINIT(FALSE) ;
|
||||
|
||||
/* Whether errors have occurred */
|
||||
ELTEXTERN LOGICAL errexit ELTINIT(FALSE) ;
|
||||
|
||||
/* Number of characters currently written to stext.h and etext.h */
|
||||
ELTEXTERN int stringcnt ELTINIT(1) ;
|
||||
|
||||
/* Number of actions so far written to code files */
|
||||
ELTEXTERN int sactions ELTINIT(1),
|
||||
eactions ELTINIT(1),
|
||||
tactions ELTINIT(1),
|
||||
pactions ELTINIT(1),
|
||||
stactions ELTINIT(1) ;
|
||||
|
||||
/* Pool of ponters for associating a chain of elements with an action string
|
||||
or code */
|
||||
typedef struct action ACTION ;
|
||||
struct action {
|
||||
int data ;
|
||||
M_ELEMENT element ;
|
||||
int count ;
|
||||
ACTION *son ;
|
||||
ACTION *next ;
|
||||
ACTION *nextact ;
|
||||
} ;
|
||||
ELTEXTERN int actlen ELTINIT(0) ;
|
||||
ELTEXTERN ACTION *firstact ELTINIT(NULL) ;
|
||||
ELTEXTERN ACTION **nextact ELTINIT(&firstact) ;
|
||||
|
||||
/* Number of elements defined in the document type */
|
||||
#if defined(M_DTDDEF)
|
||||
#define ELCOUNT sizeof(m_element)/sizeof(m_element[0])
|
||||
#else
|
||||
#define ELCOUNT
|
||||
#endif
|
||||
|
||||
/* Action arrays, indexed by the element in which they occur. Each element
|
||||
is a linked list for actions qualified by the context in which they
|
||||
occur. */
|
||||
ELTEXTERN ACTION *starray[ELCOUNT],
|
||||
*etarray[ELCOUNT],
|
||||
*scarray[ELCOUNT],
|
||||
*ecarray[ELCOUNT],
|
||||
*tcarray[ELCOUNT],
|
||||
*pcarray[ELCOUNT],
|
||||
*stcarray[ELCOUNT] ;
|
||||
|
||||
/* Store the sign-on message */
|
||||
#define SOCHAR 512
|
||||
ELTEXTERN char signonmsg[SOCHAR] ;
|
||||
ELTEXTERN int sochar ELTINIT(0) ;
|
||||
|
||||
/* Indicates which elements have been processed at a particular time */
|
||||
ELTEXTERN LOGICAL processed[ELCOUNT] ;
|
||||
|
||||
/* Flags to indicate whether data has yet been written to various files */
|
||||
ELTEXTERN LOGICAL stringstart ELTINIT(TRUE) ;
|
||||
|
||||
/* Flag indicating whether a carriage return was the last character of
|
||||
the signon message */
|
||||
ELTEXTERN LOGICAL socr ELTINIT(FALSE) ;
|
||||
|
||||
/* Number of current input line */
|
||||
ELTEXTERN int m_line ELTINIT(1) ;
|
||||
|
||||
/* Pointer to file error for error messages */
|
||||
ELTEXTERN FILE *m_errfile ;
|
||||
|
||||
/* Name of interface file */
|
||||
#define IFLEN 512
|
||||
ELTEXTERN char iffile[IFLEN] ;
|
||||
|
||||
/* Pointer to current entity */
|
||||
ELTEXTERN M_ENTITY *entity ;
|
||||
|
||||
/* Count of code entities defined */
|
||||
ELTEXTERN int codeent ELTINIT(0) ;
|
||||
|
||||
/* Content of entity being defined */
|
||||
ELTEXTERN int entclen ;
|
||||
ELTEXTERN M_WCHAR entcontent[M_LITLEN + 1] ;
|
||||
|
||||
/* Error recovery status */
|
||||
ELTEXTERN int restart ELTINIT(RENTITY) ;
|
||||
|
||||
/* Strings to write to generated files */
|
||||
#define pproto "M_WCHAR *m_pi, M_WCHAR *m_entname, int m_enttype"
|
||||
#define pformal "m_pi, m_entname, m_enttype"
|
||||
#define pftype " M_WCHAR *m_pi ;\n M_WCHAR *m_entname ;\n int m_enttype ;"
|
||||
#define tproto "M_WCHAR m_textchar"
|
||||
#define tformal "m_textchar"
|
||||
#define tftype " M_WCHAR m_textchar ;\n"
|
||||
#define stproto "M_WCHAR *m_string, LOGICAL M_START, LOGICAL M_END"
|
||||
#define stformal "m_string, M_START, M_END"
|
||||
#define stft " M_WCHAR *m_string ;\n LOGICAL M_START ;\n LOGICAL M_END ;\n"
|
||||
|
||||
/* Structures for generating defines for parameter values */
|
||||
ELTEXTERN M_TRIE parval ;
|
||||
typedef struct {
|
||||
M_WCHAR *cname ;
|
||||
M_WCHAR *value ;
|
||||
int line ;
|
||||
} PARVAL ;
|
||||
ELTEXTERN PARVAL *pval ;
|
||||
|
||||
/* Function prototypes */
|
||||
#include "proto.h"
|
||||
|
||||
/* Flag to open fewer files for convenience of debugging with
|
||||
CodeView */
|
||||
ELTEXTERN LOGICAL debug ELTINIT(FALSE) ;
|
||||
/* Scanner trace for debugging */
|
||||
ELTEXTERN LOGICAL scantrace ELTINIT(FALSE) ;
|
||||
/* Test validity of heap in calls to malloc/free */
|
||||
ELTEXTERN LOGICAL m_heapchk ELTINIT(FALSE) ;
|
||||
/* Trace calls to malloc/free */
|
||||
ELTEXTERN LOGICAL m_malftrace ELTINIT(FALSE) ;
|
||||
|
||||
141
cde/programs/dthelp/parser/include/eltdef/proto.h
Normal file
141
cde/programs/dthelp/parser/include/eltdef/proto.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* CDE - Common Desktop Environment
|
||||
*
|
||||
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
|
||||
*
|
||||
* These libraries and programs are free software; you can
|
||||
* redistribute them and/or modify them under the terms of the GNU
|
||||
* Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* These libraries and programs are distributed in the hope that
|
||||
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with these libraries and programs; if not, write
|
||||
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
||||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/* $XConsortium: proto.h /main/3 1995/11/08 10:45:25 rswiston $ */
|
||||
/*
|
||||
Copyright (c) 1988, 1989 Hewlett-Packard Co.
|
||||
*/
|
||||
|
||||
/* Proto.h contains function prototypes for program ELTDEF. */
|
||||
|
||||
|
||||
void actptrout(ACTION **array, char *name);
|
||||
|
||||
void addent(void);
|
||||
|
||||
LOGICAL m_allwhite(const M_WCHAR *string);
|
||||
|
||||
void closeiffile(LOGICAL flag, FILE *file, int count, char *table, char *proto);
|
||||
|
||||
void countdown(M_TRIE *parent, int *count);
|
||||
|
||||
void cvalue(void);
|
||||
|
||||
|
||||
void done(void);
|
||||
|
||||
void m_dumptrie(FILE *file,
|
||||
M_TRIE *xtrie,
|
||||
char *extname,
|
||||
int *count,
|
||||
void (*proc)(M_ENTITY *));
|
||||
|
||||
void endcode(LOGICAL flag, FILE *file);
|
||||
|
||||
void endini(void);
|
||||
|
||||
void endsignon(void);
|
||||
|
||||
void endstring(void);
|
||||
|
||||
void entout(char *fname);
|
||||
|
||||
void enttype(int type);
|
||||
|
||||
void m_error(char *text);
|
||||
|
||||
void m_err1(const char *text, const M_WCHAR *arg);
|
||||
|
||||
void m_mberr1(char *text, const char *arg);
|
||||
|
||||
void m_err2(const char *text, const M_WCHAR *arg1, const M_WCHAR *arg2);
|
||||
|
||||
void m_err3(char *text, M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3);
|
||||
|
||||
void m_err5(char *text,
|
||||
M_WCHAR *arg1, M_WCHAR *arg2, M_WCHAR *arg3, M_WCHAR *arg4, M_WCHAR *arg5);
|
||||
|
||||
void m_exit(int status);
|
||||
|
||||
void m_free(void *block, char *msg);
|
||||
|
||||
void freechain(void);
|
||||
|
||||
int getachar(void);
|
||||
|
||||
int *getaction(ACTION **array);
|
||||
|
||||
ACTION *getactstruct(void);
|
||||
|
||||
void getname(int first);
|
||||
|
||||
int gettoken(int *c, int context);
|
||||
|
||||
void initialize(void);
|
||||
|
||||
LOGICAL m_letter(M_WCHAR c);
|
||||
|
||||
LOGICAL litproc(int delim);
|
||||
|
||||
void *m_malloc(int size, char *msg);
|
||||
|
||||
void m_openchk(FILE **ptr, char *name, char *mode);
|
||||
|
||||
void outpval(M_TRIE *p);
|
||||
|
||||
void outstring(void);
|
||||
|
||||
int m_packedlook(M_PTRIE *xptrie, M_WCHAR *name);
|
||||
|
||||
const M_WCHAR *m_partype(const int par, const M_WCHAR *string);
|
||||
|
||||
int scan(void);
|
||||
|
||||
void skiptoend(void);
|
||||
|
||||
void startcode(int caseno, LOGICAL *flag, FILE *file, char *prefix, char *proto,
|
||||
char *formal, char *formtype);
|
||||
|
||||
void startelement(void);
|
||||
|
||||
void storecvar(void);
|
||||
|
||||
void storepname(void);
|
||||
|
||||
void undodelim(M_WCHAR *delim);
|
||||
|
||||
void ungetachar(int c);
|
||||
|
||||
int m_wcupstrcmp(const M_WCHAR *p, const M_WCHAR *q);
|
||||
|
||||
int m_wcmbupstrcmp(const M_WCHAR *p, const char *q);
|
||||
|
||||
int m_mbmbupstrcmp(const char *p, const char *q);
|
||||
|
||||
void value(M_WCHAR *p);
|
||||
|
||||
void warning(char *text);
|
||||
|
||||
void warning1(char *text, M_WCHAR *arg);
|
||||
|
||||
LOGICAL m_whitespace(M_WCHAR c);
|
||||
|
||||
Reference in New Issue
Block a user