2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: eltdef.h /main/3 1995/11/08 10:44:51 rswiston $ */
25 Copyright 1986 Tandem Computers Incorporated.
26 This product and information is proprietary of Tandem Computers Incorporated.
27 Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.
30 /* Eltdef.h is the include file for allocating global variables in ELTDEF */
34 #define ELTINIT(a) = a
36 #define ELTEXTERN extern
42 /* Error recovery status */
49 /* State transition network generated by CONTEXT */
52 /* Indicates whether, and if so where, each character can appear in
57 extern M_CHARTYPE m_ctarray[M_CHARSETLEN] ;
60 /* Scanned name or literal */
61 ELTEXTERN M_WCHAR name[M_NAMELEN + 1] ;
62 ELTEXTERN M_WCHAR literal[M_LITLEN + 1] ;
64 /* Associates a C variable with a particular parameter */
65 typedef struct cvarstruct CVARSTRUCT ;
71 ELTEXTERN CVARSTRUCT *cvarlist ;
72 /* Current and previous context (state) of transition system
74 ELTEXTERN int curcon ELTINIT(START) ;
75 ELTEXTERN int m_prevcon ;
77 /* Character read-ahead buffer */
78 ELTEXTERN int toundo ELTINIT(0) ;
79 ELTEXTERN int maxundo ELTINIT(0) ;
81 ELTEXTERN int savechar[SAVECHAR] ;
83 /* Chain of elements named in pseudo-tag */
84 typedef struct chain CHAIN ;
89 ELTEXTERN CHAIN *firstchain ELTINIT(NULL) ;
90 ELTEXTERN CHAIN **nextchain ELTINIT(&firstchain) ;
92 /* Text character returned from scanner */
93 ELTEXTERN M_WCHAR textchar ;
95 /* Identifying index of element currently being processed */
96 ELTEXTERN M_ELEMENT openelt ELTINIT(M_NULLVAL) ;
99 ELTEXTERN FILE *globdec, *globdef, *string,
100 *pfile, *tfile, *sfile, *efile, *entfile, *ifile, *stfile, *ifh, *pvalh ;
102 /* Flags indicating whether currently in the middle of processing
104 ELTEXTERN LOGICAL intext ELTINIT(FALSE),
105 inent ELTINIT(FALSE),
109 instc ELTINIT(FALSE),
110 instring ELTINIT(FALSE) ;
112 /* Location of global start-string and end-string, if any */
113 ELTEXTERN int gss ELTINIT(0),
116 /* Flags indicating whether default code setments are to be used */
117 ELTEXTERN LOGICAL finitext ELTINIT(TRUE),
118 finipi ELTINIT(TRUE),
119 finistc ELTINIT(TRUE) ;
121 /* Whether have finished the sign-on message */
122 ELTEXTERN LOGICAL signonend ELTINIT(FALSE) ;
124 /* Whether errors have occurred */
125 ELTEXTERN LOGICAL errexit ELTINIT(FALSE) ;
127 /* Number of characters currently written to stext.h and etext.h */
128 ELTEXTERN int stringcnt ELTINIT(1) ;
130 /* Number of actions so far written to code files */
131 ELTEXTERN int sactions ELTINIT(1),
135 stactions ELTINIT(1) ;
137 /* Pool of ponters for associating a chain of elements with an action string
139 typedef struct action ACTION ;
148 ELTEXTERN int actlen ELTINIT(0) ;
149 ELTEXTERN ACTION *firstact ELTINIT(NULL) ;
150 ELTEXTERN ACTION **nextact ELTINIT(&firstact) ;
152 /* Number of elements defined in the document type */
153 #if defined(M_DTDDEF)
154 #define ELCOUNT sizeof(m_element)/sizeof(m_element[0])
159 /* Action arrays, indexed by the element in which they occur. Each element
160 is a linked list for actions qualified by the context in which they
162 ELTEXTERN ACTION *starray[ELCOUNT],
170 /* Store the sign-on message */
172 ELTEXTERN char signonmsg[SOCHAR] ;
173 ELTEXTERN int sochar ELTINIT(0) ;
175 /* Indicates which elements have been processed at a particular time */
176 ELTEXTERN LOGICAL processed[ELCOUNT] ;
178 /* Flags to indicate whether data has yet been written to various files */
179 ELTEXTERN LOGICAL stringstart ELTINIT(TRUE) ;
181 /* Flag indicating whether a carriage return was the last character of
182 the signon message */
183 ELTEXTERN LOGICAL socr ELTINIT(FALSE) ;
185 /* Number of current input line */
186 ELTEXTERN int m_line ELTINIT(1) ;
188 /* Pointer to file error for error messages */
189 ELTEXTERN FILE *m_errfile ;
191 /* Name of interface file */
193 ELTEXTERN char iffile[IFLEN] ;
195 /* Pointer to current entity */
196 ELTEXTERN M_ENTITY *entity ;
198 /* Count of code entities defined */
199 ELTEXTERN int codeent ELTINIT(0) ;
201 /* Content of entity being defined */
202 ELTEXTERN int entclen ;
203 ELTEXTERN M_WCHAR entcontent[M_LITLEN + 1] ;
205 /* Error recovery status */
206 ELTEXTERN int restart ELTINIT(RENTITY) ;
208 /* Strings to write to generated files */
209 #define pproto "M_WCHAR *m_pi, M_WCHAR *m_entname, int m_enttype"
210 #define pformal "m_pi, m_entname, m_enttype"
211 #define pftype " M_WCHAR *m_pi ;\n M_WCHAR *m_entname ;\n int m_enttype ;"
212 #define tproto "M_WCHAR m_textchar"
213 #define tformal "m_textchar"
214 #define tftype " M_WCHAR m_textchar ;\n"
215 #define stproto "M_WCHAR *m_string, LOGICAL M_START, LOGICAL M_END"
216 #define stformal "m_string, M_START, M_END"
217 #define stft " M_WCHAR *m_string ;\n LOGICAL M_START ;\n LOGICAL M_END ;\n"
218 #define nopar "M_NOPAR"
220 /* Structures for generating defines for parameter values */
221 ELTEXTERN M_TRIE parval ;
227 ELTEXTERN PARVAL *pval ;
229 /* Function prototypes */
232 /* Flag to open fewer files for convenience of debugging with
234 ELTEXTERN LOGICAL debug ELTINIT(FALSE) ;
235 /* Scanner trace for debugging */
236 ELTEXTERN LOGICAL scantrace ELTINIT(FALSE) ;
237 /* Test validity of heap in calls to malloc/free */
238 ELTEXTERN LOGICAL m_heapchk ELTINIT(FALSE) ;
239 /* Trace calls to malloc/free */
240 ELTEXTERN LOGICAL m_malftrace ELTINIT(FALSE) ;