Distributed Multihead X  1.16.4
dmxparse.h
Go to the documentation of this file.
1 /*
2  * Copyright 2002 Red Hat Inc., Durham, North Carolina.
3  *
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation on the rights to use, copy, modify, merge,
10  * publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the
15  * next paragraph) shall be included in all copies or substantial
16  * portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  */
27 
28 /*
29  * Authors:
30  * Rickard E. (Rik) Faith <faith@redhat.com>
31  *
32  */
33 
37 #ifndef _DMXPARSE_H_
38 #define _DMXPARSE_H_
39 
40 #include <stdio.h> /* For FILE */
41 
43 typedef struct _DMXConfigToken {
44  int token;
45  int line;
46  const char *comment;
48 
50 typedef struct _DMXConfigString {
51  int token;
52  int line;
53  const char *comment;
54  const char *string;
57 
59 typedef struct _DMXConfigNumber {
60  int token;
61  int line;
62  const char *comment;
63  int number;
65 
67 typedef struct _DMXConfigPair {
68  int token;
69  int line;
70  const char *comment;
71  int x;
72  int y;
73  int xsign;
74  int ysign;
76 
78 typedef struct _DMXConfigComment {
79  int token;
80  int line;
81  const char *comment;
83 
84 typedef enum {
92 
94 typedef struct _DMXConfigPartDim {
95  DMXConfigPairPtr dim;
96  DMXConfigPairPtr offset;
98 
100 typedef struct _DMXConfigFullDim {
101  DMXConfigPartDimPtr scrn;
102  DMXConfigPartDimPtr root;
104 
106 typedef struct _DMXConfigDisplay {
107  /* Summary information */
108  const char *name;
109  /* Screen Window Geometry */
111  int scrnX, scrnY;
113  /* Root Window Geometry */
115  int rootX, rootY;
117  /* Origin in global space */
119 
120  /* Raw configuration information */
121  DMXConfigTokenPtr start;
122  DMXConfigStringPtr dname;
123  DMXConfigFullDimPtr dim;
124  DMXConfigPairPtr origin;
125  DMXConfigTokenPtr end;
127 
129 typedef struct _DMXConfigWall {
130  /* Summary information */
131  int width, height; /* dimensions of displays */
132  int xwall, ywall; /* dimensions of wall, in tiles */
133 
134  /* Raw configuration informaiton */
135  DMXConfigTokenPtr start;
136  DMXConfigPairPtr wallDim;
137  DMXConfigPairPtr displayDim;
138  DMXConfigStringPtr nameList;
139  DMXConfigTokenPtr end;
141 
143 typedef struct _DMXConfigOption {
144  /* Summary information */
145  char *string;
146 
147  /* Raw configuration informaiton */
148  DMXConfigTokenPtr start;
149  DMXConfigStringPtr option;
150  DMXConfigTokenPtr end;
152 
154 typedef struct _DMXConfigParam {
155  int argc;
156  const char **argv;
157 
158  DMXConfigTokenPtr start;
159  DMXConfigTokenPtr open;
160  DMXConfigStringPtr param;
161  DMXConfigTokenPtr close;
162  DMXConfigTokenPtr end; /* Either open/close OR end */
165 
167 typedef struct _DMXConfigSub {
169  DMXConfigCommentPtr comment;
170  DMXConfigDisplayPtr display;
171  DMXConfigWallPtr wall;
172  DMXConfigOptionPtr option;
173  DMXConfigParamPtr param;
176 
178 typedef struct _DMXConfigVirtual {
179  /* Summary information */
180  const char *name;
181  int width, height;
182 
183  /* Raw configuration information */
184  DMXConfigTokenPtr start;
185  DMXConfigStringPtr vname;
186  DMXConfigPairPtr dim;
187  DMXConfigTokenPtr open;
188  DMXConfigSubPtr subentry;
189  DMXConfigTokenPtr close;
191 
193 typedef struct _DMXConfigEntry {
195  DMXConfigCommentPtr comment;
196  DMXConfigVirtualPtr virtual;
199 
200 extern DMXConfigEntryPtr dmxConfigEntry;
201 
202 extern int yylex(void);
203 extern int yydebug;
204 extern void yyerror(const char *message);
205 
206 extern void dmxConfigLog(const char *format, ...);
207 extern void *dmxConfigAlloc(unsigned long bytes);
208 extern void *dmxConfigRealloc(void *orig,
209  unsigned long orig_bytes, unsigned long bytes);
210 extern const char *dmxConfigCopyString(const char *string, int length);
211 extern void dmxConfigFree(void *area);
212 extern DMXConfigTokenPtr dmxConfigCreateToken(int token, int line,
213  const char *comment);
214 extern void dmxConfigFreeToken(DMXConfigTokenPtr p);
215 extern DMXConfigStringPtr dmxConfigCreateString(int token, int line,
216  const char *comment,
217  const char *string);
218 extern void dmxConfigFreeString(DMXConfigStringPtr p);
219 extern DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line,
220  const char *comment,
221  int number);
222 extern void dmxConfigFreeNumber(DMXConfigNumberPtr p);
223 extern DMXConfigPairPtr dmxConfigCreatePair(int token, int line,
224  const char *comment,
225  int x, int y, int xsign, int ysign);
226 extern void dmxConfigFreePair(DMXConfigPairPtr p);
227 extern DMXConfigCommentPtr dmxConfigCreateComment(int token, int line,
228  const char *comment);
229 extern void dmxConfigFreeComment(DMXConfigCommentPtr p);
230 extern DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim,
231  DMXConfigPairPtr pOffset);
232 extern void dmxConfigFreePartDim(DMXConfigPartDimPtr p);
233 extern DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn,
234  DMXConfigPartDimPtr pRoot);
235 extern void dmxConfigFreeFullDim(DMXConfigFullDimPtr p);
236 extern DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart,
237  DMXConfigStringPtr pName,
238  DMXConfigFullDimPtr pDim,
239  DMXConfigPairPtr pOrigin,
240  DMXConfigTokenPtr pEnd);
241 extern void dmxConfigFreeDisplay(DMXConfigDisplayPtr p);
242 extern DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart,
243  DMXConfigPairPtr pWallDim,
244  DMXConfigPairPtr pDisplayDim,
245  DMXConfigStringPtr pNameList,
246  DMXConfigTokenPtr pEnd);
247 extern void dmxConfigFreeWall(DMXConfigWallPtr p);
248 extern DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart,
249  DMXConfigStringPtr pOption,
250  DMXConfigTokenPtr pEnd);
251 extern void dmxConfigFreeOption(DMXConfigOptionPtr p);
252 extern DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart,
253  DMXConfigTokenPtr pOpen,
254  DMXConfigStringPtr pParam,
255  DMXConfigTokenPtr pClose,
256  DMXConfigTokenPtr pEnd);
257 extern void dmxConfigFreeParam(DMXConfigParamPtr p);
258 extern const char **dmxConfigLookupParam(DMXConfigParamPtr p,
259  const char *key, int *argc);
260 extern DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type,
261  DMXConfigCommentPtr comment,
262  DMXConfigDisplayPtr display,
263  DMXConfigWallPtr wall,
264  DMXConfigOptionPtr option,
265  DMXConfigParamPtr param);
266 extern void dmxConfigFreeSub(DMXConfigSubPtr sub);
267 extern DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment);
268 extern DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display);
269 extern DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall);
270 extern DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option);
271 extern DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param);
272 extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head,
273  DMXConfigSubPtr sub);
274 extern DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart,
275  DMXConfigStringPtr pName,
276  DMXConfigPairPtr pDim,
277  DMXConfigTokenPtr pOpen,
278  DMXConfigSubPtr pSubentry,
279  DMXConfigTokenPtr pClose);
280 extern void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual);
281 extern DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type,
282  DMXConfigCommentPtr comment,
283  DMXConfigVirtualPtr virtual);
284 extern void dmxConfigFreeEntry(DMXConfigEntryPtr entry);
285 extern DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head,
287  DMXConfigCommentPtr comment,
288  DMXConfigVirtualPtr virtual);
289 extern DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment);
290 extern DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual);
291 
292 #endif
struct _DMXConfigComment DMXConfigComment
int xwall
Definition: dmxparse.h:132
Definition: dmxparse.h:106
int rootXOrigin
Definition: dmxparse.h:118
int width
Definition: dmxparse.h:181
void dmxConfigFreeWall(DMXConfigWallPtr p)
Definition: dmxparse.c:353
DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type, DMXConfigCommentPtr comment, DMXConfigDisplayPtr display, DMXConfigWallPtr wall, DMXConfigOptionPtr option, DMXConfigParamPtr param)
Definition: dmxparse.c:478
void dmxConfigFreeParam(DMXConfigParamPtr p)
Definition: dmxparse.c:459
Definition: dmxparse.h:100
struct _DMXConfigToken DMXConfigToken
Definition: dmxparse.h:59
DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim, DMXConfigPairPtr pOffset)
Definition: dmxparse.c:227
int line
Definition: dmxparse.h:80
int scrnYSign
Definition: dmxparse.h:112
struct _DMXConfigParam * DMXConfigParamPtr
DMXConfigTokenPtr start
Definition: dmxparse.h:148
DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head, DMXConfigType type, DMXConfigCommentPtr comment, DMXConfigVirtualPtr virtual)
Definition: dmxparse.c:662
DMXConfigParamPtr param
Definition: dmxparse.h:173
DMXConfigStringPtr dname
Definition: dmxparse.h:122
DMXConfigPairPtr origin
Definition: dmxparse.h:124
Definition: dmxparse.h:87
int number
Definition: dmxparse.h:63
DMXConfigPartDimPtr root
Definition: dmxparse.h:102
struct _DMXConfigPartDim DMXConfigPartDim
DMXConfigPartDimPtr scrn
Definition: dmxparse.h:101
int ywall
Definition: dmxparse.h:132
Definition: dmxparse.h:94
Definition: dmxparse.h:167
DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart, DMXConfigStringPtr pOption, DMXConfigTokenPtr pEnd)
Definition: dmxparse.c:366
int token
Definition: dmxparse.h:68
Definition: dmxparse.h:86
DMXConfigSubPtr subentry
Definition: dmxparse.h:188
int token
Definition: dmxparse.h:51
DMXConfigCommentPtr comment
Definition: dmxparse.h:195
void dmxConfigFreeToken(DMXConfigTokenPtr p)
Definition: dmxparse.c:124
struct _DMXConfigParam * next
Definition: dmxparse.h:163
struct _DMXConfigFullDim * DMXConfigFullDimPtr
void dmxConfigFreeNumber(DMXConfigNumberPtr p)
Definition: dmxparse.c:173
DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type, DMXConfigCommentPtr comment, DMXConfigVirtualPtr virtual)
Definition: dmxparse.c:620
int rootYOrigin
Definition: dmxparse.h:118
DMXConfigStringPtr dmxConfigCreateString(int token, int line, const char *comment, const char *string)
Definition: dmxparse.c:133
int scrnX
Definition: dmxparse.h:111
Definition: dmxparse.h:193
DMXConfigStringPtr param
Definition: dmxparse.h:160
int line
Definition: dmxparse.h:45
void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual)
Definition: dmxparse.c:608
DMXConfigType
Definition: dmxparse.h:84
struct _DMXConfigDisplay DMXConfigDisplay
int line
Definition: dmxparse.h:61
Definition: dmxparse.h:90
void dmxConfigLog(const char *format,...)
Definition: dmxparse.c:56
DMXConfigStringPtr option
Definition: dmxparse.h:149
DMXConfigTokenPtr open
Definition: dmxparse.h:187
const char * string
Definition: dmxparse.h:54
struct _DMXConfigPartDim * DMXConfigPartDimPtr
void dmxConfigFreeComment(DMXConfigCommentPtr p)
Definition: dmxparse.c:218
struct _DMXConfigEntry * DMXConfigEntryPtr
DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display)
Definition: dmxparse.c:548
const char ** dmxConfigLookupParam(DMXConfigParamPtr p, const char *key, int *argc)
Definition: dmxparse.c:413
void dmxConfigFreePair(DMXConfigPairPtr p)
Definition: dmxparse.c:198
DMXConfigPairPtr dim
Definition: dmxparse.h:186
DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head, DMXConfigSubPtr sub)
Definition: dmxparse.c:573
int line
Definition: dmxparse.h:52
DMXConfigCommentPtr dmxConfigCreateComment(int token, int line, const char *comment)
Definition: dmxparse.c:207
DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart, DMXConfigStringPtr pName, DMXConfigPairPtr pDim, DMXConfigTokenPtr pOpen, DMXConfigSubPtr pSubentry, DMXConfigTokenPtr pClose)
Definition: dmxparse.c:585
struct _DMXConfigWall DMXConfigWall
struct _DMXConfigVirtual DMXConfigVirtual
const char * comment
Definition: dmxparse.h:46
DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option)
Definition: dmxparse.c:561
int rootHeight
Definition: dmxparse.h:114
DMXConfigTokenPtr start
Definition: dmxparse.h:158
DMXConfigTokenPtr start
Definition: dmxparse.h:135
const char * comment
Definition: dmxparse.h:53
const char * comment
Definition: dmxparse.h:81
DMXConfigPairPtr dmxConfigCreatePair(int token, int line, const char *comment, int x, int y, int xsign, int ysign)
Definition: dmxparse.c:182
struct _DMXConfigToken * DMXConfigTokenPtr
DMXConfigWallPtr wall
Definition: dmxparse.h:171
struct _DMXConfigPair DMXConfigPair
const char * comment
Definition: dmxparse.h:62
int token
Definition: dmxparse.h:60
DMXConfigType type
Definition: dmxparse.h:194
void dmxConfigFreePartDim(DMXConfigPartDimPtr p)
Definition: dmxparse.c:237
Definition: dmxparse.h:67
struct _DMXConfigFullDim DMXConfigFullDim
void dmxConfigFreeString(DMXConfigStringPtr p)
Definition: dmxparse.c:146
void dmxConfigFreeDisplay(DMXConfigDisplayPtr p)
Definition: dmxparse.c:319
DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param)
Definition: dmxparse.c:567
DMXConfigCommentPtr comment
Definition: dmxparse.h:169
Definition: dmxparse.h:50
struct _DMXConfigVirtual * DMXConfigVirtualPtr
Definition: dmxparse.h:89
DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line, const char *comment, int number)
Definition: dmxparse.c:161
const char * name
Definition: dmxparse.h:108
int rootXSign
Definition: dmxparse.h:116
int token
Definition: dmxparse.h:79
void dmxConfigFreeEntry(DMXConfigEntryPtr entry)
Definition: dmxparse.c:641
DMXConfigTokenPtr end
Definition: dmxparse.h:125
DMXConfigDisplayPtr display
Definition: dmxparse.h:170
struct _DMXConfigNumber * DMXConfigNumberPtr
int height
Definition: dmxparse.h:131
void dmxConfigFreeFullDim(DMXConfigFullDimPtr p)
Definition: dmxparse.c:257
const char * dmxConfigCopyString(const char *string, int length)
Definition: dmxparse.c:93
DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart, DMXConfigPairPtr pWallDim, DMXConfigPairPtr pDisplayDim, DMXConfigStringPtr pNameList, DMXConfigTokenPtr pEnd)
Definition: dmxparse.c:331
int width
Definition: dmxparse.h:131
DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall)
Definition: dmxparse.c:555
Definition: dmxparse.h:154
const char ** argv
Definition: dmxparse.h:156
struct _DMXConfigSub * DMXConfigSubPtr
int token
Definition: dmxparse.h:44
struct _DMXConfigString DMXConfigString
void dmxConfigFree(void *area)
Definition: dmxparse.c:107
DMXConfigPairPtr wallDim
Definition: dmxparse.h:136
DMXConfigTokenPtr close
Definition: dmxparse.h:189
struct _DMXConfigOption DMXConfigOption
struct _DMXConfigWall * DMXConfigWallPtr
int yylex(void)
DMXConfigFullDimPtr dim
Definition: dmxparse.h:123
int scrnXSign
Definition: dmxparse.h:112
DMXConfigType type
Definition: dmxparse.h:168
DMXConfigTokenPtr end
Definition: dmxparse.h:150
int argc
Definition: dmxparse.h:155
int xsign
Definition: dmxparse.h:73
Definition: dmxparse.h:88
struct _DMXConfigSub DMXConfigSub
DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment)
Definition: dmxparse.c:541
Definition: dmxparse.h:129
void dmxConfigFreeOption(DMXConfigOptionPtr p)
Definition: dmxparse.c:401
DMXConfigTokenPtr open
Definition: dmxparse.h:159
char * string
Definition: dmxparse.h:145
struct _DMXConfigNumber DMXConfigNumber
DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart, DMXConfigStringPtr pName, DMXConfigFullDimPtr pDim, DMXConfigPairPtr pOrigin, DMXConfigTokenPtr pEnd)
Definition: dmxparse.c:267
const char * name
Definition: dmxparse.h:180
int y
Definition: dmxparse.h:72
DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart, DMXConfigTokenPtr pOpen, DMXConfigStringPtr pParam, DMXConfigTokenPtr pClose, DMXConfigTokenPtr pEnd)
Definition: dmxparse.c:428
DMXConfigPairPtr dim
Definition: dmxparse.h:95
struct _DMXConfigEntry * next
Definition: dmxparse.h:197
DMXConfigEntryPtr dmxConfigEntry
Definition: dmxconfig.c:75
struct _DMXConfigEntry DMXConfigEntry
DMXConfigOptionPtr option
Definition: dmxparse.h:172
DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment)
Definition: dmxparse.c:679
int rootWidth
Definition: dmxparse.h:114
DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn, DMXConfigPartDimPtr pRoot)
Definition: dmxparse.c:247
DMXConfigTokenPtr dmxConfigCreateToken(int token, int line, const char *comment)
Definition: dmxparse.c:113
DMXConfigTokenPtr end
Definition: dmxparse.h:139
Definition: dmxparse.h:43
DMXConfigStringPtr vname
Definition: dmxparse.h:185
void yyerror(const char *message)
void * dmxConfigAlloc(unsigned long bytes)
Definition: dmxparse.c:68
int yydebug
struct _DMXConfigParam DMXConfigParam
DMXConfigPairPtr displayDim
Definition: dmxparse.h:137
int rootYSign
Definition: dmxparse.h:116
int height
Definition: dmxparse.h:181
int ysign
Definition: dmxparse.h:74
DMXConfigTokenPtr start
Definition: dmxparse.h:121
Definition: dmxparse.h:178
Definition: dmxparse.h:85
struct _DMXConfigPair * DMXConfigPairPtr
struct _DMXConfigString * next
Definition: dmxparse.h:55
void dmxConfigFreeSub(DMXConfigSubPtr sub)
Definition: dmxparse.c:511
const char * comment
Definition: dmxparse.h:70
struct _DMXConfigSub * next
Definition: dmxparse.h:174
struct _DMXConfigDisplay * DMXConfigDisplayPtr
int rootX
Definition: dmxparse.h:115
int scrnY
Definition: dmxparse.h:111
DMXConfigTokenPtr end
Definition: dmxparse.h:162
struct _DMXConfigOption * DMXConfigOptionPtr
DMXConfigTokenPtr close
Definition: dmxparse.h:161
Definition: dmxparse.h:143
DMXConfigPairPtr offset
Definition: dmxparse.h:96
int line
Definition: dmxparse.h:69
struct _DMXConfigString * DMXConfigStringPtr
int scrnWidth
Definition: dmxparse.h:110
DMXConfigTokenPtr start
Definition: dmxparse.h:184
DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual)
Definition: dmxparse.c:685
int rootY
Definition: dmxparse.h:115
struct _DMXConfigComment * DMXConfigCommentPtr
Definition: dmxparse.h:78
int x
Definition: dmxparse.h:71
int scrnHeight
Definition: dmxparse.h:110
void * dmxConfigRealloc(void *orig, unsigned long orig_bytes, unsigned long bytes)
Definition: dmxparse.c:80
char * display
DMXConfigStringPtr nameList
Definition: dmxparse.h:138

Generated on Tue Aug 18 2015 01:27:31 for Distributed Multihead X by doxygen 1.8.8