VirtualBox

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

最後變更 在這個檔案從37801是 25078,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: exported and set eol-style on new headers

  • 屬性 svn:eol-style 設為 native
檔案大小: 13.2 KB
 
1/* $XFree86$ */
2/*
3 * Copyright 2002 Red Hat Inc., Durham, North Carolina.
4 *
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation on the rights to use, copy, modify, merge,
11 * publish, distribute, sublicense, and/or sell copies of the Software,
12 * and to permit persons to whom the Software is furnished to do so,
13 * subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial
17 * portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
23 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * SOFTWARE.
27 */
28
29/*
30 * Authors:
31 * Rickard E. (Rik) Faith <[email protected]>
32 *
33 */
34
35/** \file
36 * Interface to DMX configuration file parser. \see dmxparse.c */
37
38#ifndef _DMXPARSE_H_
39#define _DMXPARSE_H_
40
41#include <stdio.h> /* For FILE */
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
136 /* Raw configuration informaiton */
137 DMXConfigTokenPtr start;
138 DMXConfigPairPtr wallDim;
139 DMXConfigPairPtr displayDim;
140 DMXConfigStringPtr nameList;
141 DMXConfigTokenPtr end;
142} DMXConfigWall, *DMXConfigWallPtr;
143
144/** Stores parsed option information. */
145typedef struct _DMXConfigOption {
146 /* Summary information */
147 char *string;
148
149 /* Raw configuration informaiton */
150 DMXConfigTokenPtr start;
151 DMXConfigStringPtr option;
152 DMXConfigTokenPtr end;
153} DMXConfigOption, *DMXConfigOptionPtr;
154
155/** Stores parsed param information. */
156typedef struct _DMXConfigParam {
157 int argc;
158 const char **argv;
159
160 DMXConfigTokenPtr start;
161 DMXConfigTokenPtr open;
162 DMXConfigStringPtr param;
163 DMXConfigTokenPtr close;
164 DMXConfigTokenPtr end; /* Either open/close OR end */
165 struct _DMXConfigParam *next;
166} DMXConfigParam, *DMXConfigParamPtr;
167
168/** Stores options under an entry (subentry). */
169typedef struct _DMXConfigSub {
170 DMXConfigType type;
171 DMXConfigCommentPtr comment;
172 DMXConfigDisplayPtr display;
173 DMXConfigWallPtr wall;
174 DMXConfigOptionPtr option;
175 DMXConfigParamPtr param;
176 struct _DMXConfigSub *next;
177} DMXConfigSub, *DMXConfigSubPtr;
178
179/** Stores parsed virtual information. */
180typedef struct _DMXConfigVirtual {
181 /* Summary information */
182 const char *name;
183 int width, height;
184
185 /* Raw configuration information */
186 DMXConfigTokenPtr start;
187 DMXConfigStringPtr vname;
188 DMXConfigPairPtr dim;
189 DMXConfigTokenPtr open;
190 DMXConfigSubPtr subentry;
191 DMXConfigTokenPtr close;
192} DMXConfigVirtual, *DMXConfigVirtualPtr;
193
194/** Heads entry storage. */
195typedef struct _DMXConfigEntry {
196 DMXConfigType type;
197 DMXConfigCommentPtr comment;
198 DMXConfigVirtualPtr virtual;
199 struct _DMXConfigEntry *next;
200} DMXConfigEntry, *DMXConfigEntryPtr;
201
202extern DMXConfigEntryPtr dmxConfigEntry;
203
204extern int yylex(void);
205extern int yydebug;
206extern void yyerror(const char *message);
207
208extern void dmxConfigLog(const char *format, ...);
209extern void *dmxConfigAlloc(unsigned long bytes);
210extern void *dmxConfigRealloc(void *orig,
211 unsigned long orig_bytes,
212 unsigned long bytes);
213extern const char *dmxConfigCopyString(const char *string,
214 int length);
215extern void dmxConfigFree(void *area);
216extern DMXConfigTokenPtr dmxConfigCreateToken(int token, int line,
217 const char *comment);
218extern void dmxConfigFreeToken(DMXConfigTokenPtr p);
219extern DMXConfigStringPtr dmxConfigCreateString(int token, int line,
220 const char *comment,
221 const char *string);
222extern void dmxConfigFreeString(DMXConfigStringPtr p);
223extern DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line,
224 const char *comment,
225 int number);
226extern void dmxConfigFreeNumber(DMXConfigNumberPtr p);
227extern DMXConfigPairPtr dmxConfigCreatePair(int token, int line,
228 const char *comment,
229 int x, int y,
230 int xsign, int ysign);
231extern void dmxConfigFreePair(DMXConfigPairPtr p);
232extern DMXConfigCommentPtr dmxConfigCreateComment(int token, int line,
233 const char *comment);
234extern void dmxConfigFreeComment(DMXConfigCommentPtr p);
235extern DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim,
236 DMXConfigPairPtr pOffset);
237extern void dmxConfigFreePartDim(DMXConfigPartDimPtr p);
238extern DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn,
239 DMXConfigPartDimPtr pRoot);
240extern void dmxConfigFreeFullDim(DMXConfigFullDimPtr p);
241extern DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart,
242 DMXConfigStringPtr pName,
243 DMXConfigFullDimPtr pDim,
244 DMXConfigPairPtr pOrigin,
245 DMXConfigTokenPtr pEnd);
246extern void dmxConfigFreeDisplay(DMXConfigDisplayPtr p);
247extern DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart,
248 DMXConfigPairPtr pWallDim,
249 DMXConfigPairPtr pDisplayDim,
250 DMXConfigStringPtr pNameList,
251 DMXConfigTokenPtr pEnd);
252extern void dmxConfigFreeWall(DMXConfigWallPtr p);
253extern DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart,
254 DMXConfigStringPtr pOption,
255 DMXConfigTokenPtr pEnd);
256extern void dmxConfigFreeOption(DMXConfigOptionPtr p);
257extern DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart,
258 DMXConfigTokenPtr pOpen,
259 DMXConfigStringPtr pParam,
260 DMXConfigTokenPtr pClose,
261 DMXConfigTokenPtr pEnd);
262extern void dmxConfigFreeParam(DMXConfigParamPtr p);
263extern const char **dmxConfigLookupParam(DMXConfigParamPtr p,
264 const char *key,
265 int *argc);
266extern DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type,
267 DMXConfigCommentPtr comment,
268 DMXConfigDisplayPtr display,
269 DMXConfigWallPtr wall,
270 DMXConfigOptionPtr option,
271 DMXConfigParamPtr param);
272extern void dmxConfigFreeSub(DMXConfigSubPtr sub);
273extern DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment);
274extern DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display);
275extern DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall);
276extern DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option);
277extern DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param);
278extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head,
279 DMXConfigSubPtr sub);
280extern DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart,
281 DMXConfigStringPtr pName,
282 DMXConfigPairPtr pDim,
283 DMXConfigTokenPtr pOpen,
284 DMXConfigSubPtr pSubentry,
285 DMXConfigTokenPtr pClose);
286extern void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual);
287extern DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type,
288 DMXConfigCommentPtr comment,
289 DMXConfigVirtualPtr virtual);
290extern void dmxConfigFreeEntry(DMXConfigEntryPtr entry);
291extern DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head,
292 DMXConfigType type,
293 DMXConfigCommentPtr comment,
294 DMXConfigVirtualPtr virtual);
295extern DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment);
296extern DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual);
297
298#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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