VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.18.0/dmxparse.h@ 78293

Last change on this file since 78293 was 58634, checked in by vboxsync, 9 years ago

Additions/x11: added header files for building X.Org video driver against X.Org Server 1.18.

  • Property svn:eol-style set to native
File size: 11.4 KB
Line 
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 <[email protected]>
31 *
32 */
33
34/** \file
35 * Interface to DMX configuration file parser. \see dmxparse.c */
36
37#ifndef _DMXPARSE_H_
38#define _DMXPARSE_H_
39
40#include <stdio.h> /* For FILE */
41#include <X11/Xfuncproto.h> /* For _X_ATTRIBUTE_PRINTF */
42
43/** Stores tokens not stored in other structures (e.g., keywords and ;) */
44typedef struct _DMXConfigToken {
45 int token;
46 int line;
47 const char *comment;
48} DMXConfigToken, *DMXConfigTokenPtr;
49
50/** Stores parsed strings. */
51typedef struct _DMXConfigString {
52 int token;
53 int line;
54 const char *comment;
55 const char *string;
56 struct _DMXConfigString *next;
57} DMXConfigString, *DMXConfigStringPtr;
58
59/** Stores parsed numbers. */
60typedef struct _DMXConfigNumber {
61 int token;
62 int line;
63 const char *comment;
64 int number;
65} DMXConfigNumber, *DMXConfigNumberPtr;
66
67/** Stores parsed pairs (e.g., x y) */
68typedef struct _DMXConfigPair {
69 int token;
70 int line;
71 const char *comment;
72 int x;
73 int y;
74 int xsign;
75 int ysign;
76} DMXConfigPair, *DMXConfigPairPtr;
77
78/** Stores parsed comments not stored with a token. */
79typedef struct _DMXConfigComment {
80 int token;
81 int line;
82 const char *comment;
83} DMXConfigComment, *DMXConfigCommentPtr;
84
85typedef enum {
86 dmxConfigComment,
87 dmxConfigVirtual,
88 dmxConfigDisplay,
89 dmxConfigWall,
90 dmxConfigOption,
91 dmxConfigParam
92} DMXConfigType;
93
94/** Stores a geometry specification. */
95typedef struct _DMXConfigPartDim {
96 DMXConfigPairPtr dim;
97 DMXConfigPairPtr offset;
98} DMXConfigPartDim, *DMXConfigPartDimPtr;
99
100/** Stores a pair of geometry specifications. */
101typedef struct _DMXConfigFullDim {
102 DMXConfigPartDimPtr scrn;
103 DMXConfigPartDimPtr root;
104} DMXConfigFullDim, *DMXConfigFullDimPtr;
105
106/** Stores parsed display information. */
107typedef struct _DMXConfigDisplay {
108 /* Summary information */
109 const char *name;
110 /* Screen Window Geometry */
111 int scrnWidth, scrnHeight;
112 int scrnX, scrnY;
113 int scrnXSign, scrnYSign;
114 /* Root Window Geometry */
115 int rootWidth, rootHeight;
116 int rootX, rootY;
117 int rootXSign, rootYSign;
118 /* Origin in global space */
119 int rootXOrigin, rootYOrigin;
120
121 /* Raw configuration information */
122 DMXConfigTokenPtr start;
123 DMXConfigStringPtr dname;
124 DMXConfigFullDimPtr dim;
125 DMXConfigPairPtr origin;
126 DMXConfigTokenPtr end;
127} DMXConfigDisplay, *DMXConfigDisplayPtr;
128
129/** Stores parsed wall information. */
130typedef struct _DMXConfigWall {
131 /* Summary information */
132 int width, height; /* dimensions of displays */
133 int xwall, ywall; /* dimensions of wall, in tiles */
134
135 /* Raw configuration informaiton */
136 DMXConfigTokenPtr start;
137 DMXConfigPairPtr wallDim;
138 DMXConfigPairPtr displayDim;
139 DMXConfigStringPtr nameList;
140 DMXConfigTokenPtr end;
141} DMXConfigWall, *DMXConfigWallPtr;
142
143/** Stores parsed option information. */
144typedef struct _DMXConfigOption {
145 /* Summary information */
146 char *string;
147
148 /* Raw configuration informaiton */
149 DMXConfigTokenPtr start;
150 DMXConfigStringPtr option;
151 DMXConfigTokenPtr end;
152} DMXConfigOption, *DMXConfigOptionPtr;
153
154/** Stores parsed param information. */
155typedef struct _DMXConfigParam {
156 int argc;
157 const char **argv;
158
159 DMXConfigTokenPtr start;
160 DMXConfigTokenPtr open;
161 DMXConfigStringPtr param;
162 DMXConfigTokenPtr close;
163 DMXConfigTokenPtr end; /* Either open/close OR end */
164 struct _DMXConfigParam *next;
165} DMXConfigParam, *DMXConfigParamPtr;
166
167/** Stores options under an entry (subentry). */
168typedef struct _DMXConfigSub {
169 DMXConfigType type;
170 DMXConfigCommentPtr comment;
171 DMXConfigDisplayPtr display;
172 DMXConfigWallPtr wall;
173 DMXConfigOptionPtr option;
174 DMXConfigParamPtr param;
175 struct _DMXConfigSub *next;
176} DMXConfigSub, *DMXConfigSubPtr;
177
178/** Stores parsed virtual information. */
179typedef struct _DMXConfigVirtual {
180 /* Summary information */
181 const char *name;
182 int width, height;
183
184 /* Raw configuration information */
185 DMXConfigTokenPtr start;
186 DMXConfigStringPtr vname;
187 DMXConfigPairPtr dim;
188 DMXConfigTokenPtr open;
189 DMXConfigSubPtr subentry;
190 DMXConfigTokenPtr close;
191} DMXConfigVirtual, *DMXConfigVirtualPtr;
192
193/** Heads entry storage. */
194typedef struct _DMXConfigEntry {
195 DMXConfigType type;
196 DMXConfigCommentPtr comment;
197 DMXConfigVirtualPtr virtual;
198 struct _DMXConfigEntry *next;
199} DMXConfigEntry, *DMXConfigEntryPtr;
200
201extern DMXConfigEntryPtr dmxConfigEntry;
202
203extern int yylex(void);
204extern int yydebug;
205extern void yyerror(const char *message);
206
207extern void dmxConfigLog(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,0);
208extern void *dmxConfigAlloc(unsigned long bytes);
209extern void *dmxConfigRealloc(void *orig,
210 unsigned long orig_bytes, unsigned long bytes);
211extern const char *dmxConfigCopyString(const char *string, int length);
212extern void dmxConfigFree(void *area);
213extern DMXConfigTokenPtr dmxConfigCreateToken(int token, int line,
214 const char *comment);
215extern void dmxConfigFreeToken(DMXConfigTokenPtr p);
216extern DMXConfigStringPtr dmxConfigCreateString(int token, int line,
217 const char *comment,
218 const char *string);
219extern void dmxConfigFreeString(DMXConfigStringPtr p);
220extern DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line,
221 const char *comment,
222 int number);
223extern void dmxConfigFreeNumber(DMXConfigNumberPtr p);
224extern DMXConfigPairPtr dmxConfigCreatePair(int token, int line,
225 const char *comment,
226 int x, int y, int xsign, int ysign);
227extern void dmxConfigFreePair(DMXConfigPairPtr p);
228extern DMXConfigCommentPtr dmxConfigCreateComment(int token, int line,
229 const char *comment);
230extern void dmxConfigFreeComment(DMXConfigCommentPtr p);
231extern DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim,
232 DMXConfigPairPtr pOffset);
233extern void dmxConfigFreePartDim(DMXConfigPartDimPtr p);
234extern DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn,
235 DMXConfigPartDimPtr pRoot);
236extern void dmxConfigFreeFullDim(DMXConfigFullDimPtr p);
237extern DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart,
238 DMXConfigStringPtr pName,
239 DMXConfigFullDimPtr pDim,
240 DMXConfigPairPtr pOrigin,
241 DMXConfigTokenPtr pEnd);
242extern void dmxConfigFreeDisplay(DMXConfigDisplayPtr p);
243extern DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart,
244 DMXConfigPairPtr pWallDim,
245 DMXConfigPairPtr pDisplayDim,
246 DMXConfigStringPtr pNameList,
247 DMXConfigTokenPtr pEnd);
248extern void dmxConfigFreeWall(DMXConfigWallPtr p);
249extern DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart,
250 DMXConfigStringPtr pOption,
251 DMXConfigTokenPtr pEnd);
252extern void dmxConfigFreeOption(DMXConfigOptionPtr p);
253extern DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart,
254 DMXConfigTokenPtr pOpen,
255 DMXConfigStringPtr pParam,
256 DMXConfigTokenPtr pClose,
257 DMXConfigTokenPtr pEnd);
258extern void dmxConfigFreeParam(DMXConfigParamPtr p);
259extern const char **dmxConfigLookupParam(DMXConfigParamPtr p,
260 const char *key, int *argc);
261extern DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type,
262 DMXConfigCommentPtr comment,
263 DMXConfigDisplayPtr display,
264 DMXConfigWallPtr wall,
265 DMXConfigOptionPtr option,
266 DMXConfigParamPtr param);
267extern void dmxConfigFreeSub(DMXConfigSubPtr sub);
268extern DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment);
269extern DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display);
270extern DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall);
271extern DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option);
272extern DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param);
273extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head,
274 DMXConfigSubPtr sub);
275extern DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart,
276 DMXConfigStringPtr pName,
277 DMXConfigPairPtr pDim,
278 DMXConfigTokenPtr pOpen,
279 DMXConfigSubPtr pSubentry,
280 DMXConfigTokenPtr pClose);
281extern void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual);
282extern DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type,
283 DMXConfigCommentPtr comment,
284 DMXConfigVirtualPtr virtual);
285extern void dmxConfigFreeEntry(DMXConfigEntryPtr entry);
286extern DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head,
287 DMXConfigType type,
288 DMXConfigCommentPtr comment,
289 DMXConfigVirtualPtr virtual);
290extern DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment);
291extern DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual);
292
293#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette