3 * Copyright (c) 1997 Metro Link Incorporated
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
20 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * Except as contained in this notice, the name of the Metro Link shall not be
24 * used in advertising or otherwise to promote the sale, use or other dealings
25 * in this Software without prior written authorization from Metro Link.
29 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
31 * Permission is hereby granted, free of charge, to any person obtaining a
32 * copy of this software and associated documentation files (the "Software"),
33 * to deal in the Software without restriction, including without limitation
34 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35 * and/or sell copies of the Software, and to permit persons to whom the
36 * Software is furnished to do so, subject to the following conditions:
38 * The above copyright notice and this permission notice shall be included in
39 * all copies or substantial portions of the Software.
41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
44 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
45 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
47 * OTHER DEALINGS IN THE SOFTWARE.
49 * Except as contained in this notice, the name of the copyright holder(s)
50 * and author(s) shall not be used in advertising or otherwise to promote
51 * the sale, use or other dealings in this Software without prior written
52 * authorization from the copyright holder(s) and author(s).
57 * This file contains the external interfaces for the XFree86 configuration
60 #ifdef HAVE_XORG_CONFIG_H
61 #include <xorg-config.h>
64 #ifndef _xf86Parser_h_
65 #define _xf86Parser_h_
67 #include "xf86Optrec.h"
69 #define HAVE_PARSER_DECLS
75 char *file_modulepath
;
80 XF86ConfFilesRec
, *XF86ConfFilesPtr
;
82 /* Values for load_type */
83 #define XF86_LOAD_MODULE 0
84 #define XF86_LOAD_DRIVER 1
85 #define XF86_DISABLE_MODULE 2
92 XF86OptionPtr load_opt
;
96 XF86LoadRec
, *XF86LoadPtr
;
100 XF86LoadPtr mod_load_lst
;
101 XF86LoadPtr mod_disable_lst
;
104 XF86ConfModuleRec
, *XF86ConfModulePtr
;
106 #define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard"
108 #define CONF_IMPLICIT_POINTER "Implicit Core Pointer"
110 #define XF86CONF_PHSYNC 0x0001
111 #define XF86CONF_NHSYNC 0x0002
112 #define XF86CONF_PVSYNC 0x0004
113 #define XF86CONF_NVSYNC 0x0008
114 #define XF86CONF_INTERLACE 0x0010
115 #define XF86CONF_DBLSCAN 0x0020
116 #define XF86CONF_CSYNC 0x0040
117 #define XF86CONF_PCSYNC 0x0080
118 #define XF86CONF_NCSYNC 0x0100
119 #define XF86CONF_HSKEW 0x0200 /* hskew provided */
120 #define XF86CONF_BCAST 0x0400
121 #define XF86CONF_CUSTOM 0x0800 /* timing numbers customized by editor */
122 #define XF86CONF_VSCAN 0x1000
142 XF86ConfModeLineRec
, *XF86ConfModeLinePtr
;
148 XF86OptionPtr vp_option_lst
;
151 XF86ConfVideoPortRec
, *XF86ConfVideoPortPtr
;
161 XF86OptionPtr va_option_lst
;
162 XF86ConfVideoPortPtr va_port_lst
;
166 XF86ConfVideoAdaptorRec
, *XF86ConfVideoAdaptorPtr
;
168 #define CONF_MAX_HSYNC 8
169 #define CONF_MAX_VREFRESH 8
179 int red
, green
, blue
;
186 char *modes_identifier
;
187 XF86ConfModeLinePtr mon_modeline_lst
;
190 XF86ConfModesRec
, *XF86ConfModesPtr
;
196 XF86ConfModesPtr ml_modes
;
198 XF86ConfModesLinkRec
, *XF86ConfModesLinkPtr
;
203 char *mon_identifier
;
206 int mon_width
; /* in mm */
207 int mon_height
; /* in mm */
208 XF86ConfModeLinePtr mon_modeline_lst
;
210 parser_range mon_hsync
[CONF_MAX_HSYNC
];
212 parser_range mon_vrefresh
[CONF_MAX_VREFRESH
];
214 float mon_gamma_green
;
215 float mon_gamma_blue
;
216 XF86OptionPtr mon_option_lst
;
217 XF86ConfModesLinkPtr mon_modes_sect_lst
;
220 XF86ConfMonitorRec
, *XF86ConfMonitorPtr
;
222 #define CONF_MAXDACSPEEDS 4
223 #define CONF_MAXCLOCKS 128
228 char *dev_identifier
;
236 int dev_dacSpeeds
[CONF_MAXDACSPEEDS
];
238 int dev_textclockfreq
;
239 unsigned long dev_bios_base
;
240 unsigned long dev_mem_base
;
241 unsigned long dev_io_base
;
244 int dev_clock
[CONF_MAXCLOCKS
];
249 XF86OptionPtr dev_option_lst
;
252 XF86ConfDeviceRec
, *XF86ConfDevicePtr
;
259 XF86ModeRec
, *XF86ModePtr
;
271 parser_rgb disp_weight
;
272 parser_rgb disp_black
;
273 parser_rgb disp_white
;
274 XF86ModePtr disp_mode_lst
;
275 XF86OptionPtr disp_option_lst
;
278 XF86ConfDisplayRec
, *XF86ConfDisplayPtr
;
282 XF86OptionPtr flg_option_lst
;
285 XF86ConfFlagsRec
, *XF86ConfFlagsPtr
;
290 char *al_adaptor_str
;
291 XF86ConfVideoAdaptorPtr al_adaptor
;
293 XF86ConfAdaptorLinkRec
, *XF86ConfAdaptorLinkPtr
;
298 char *scrn_identifier
;
299 char *scrn_obso_driver
;
300 int scrn_defaultdepth
;
302 int scrn_defaultfbbpp
;
303 char *scrn_monitor_str
;
304 XF86ConfMonitorPtr scrn_monitor
;
305 char *scrn_device_str
;
306 XF86ConfDevicePtr scrn_device
;
307 XF86ConfAdaptorLinkPtr scrn_adaptor_lst
;
308 XF86ConfDisplayPtr scrn_display_lst
;
309 XF86OptionPtr scrn_option_lst
;
312 XF86ConfScreenRec
, *XF86ConfScreenPtr
;
317 char *inp_identifier
;
319 XF86OptionPtr inp_option_lst
;
322 XF86ConfInputRec
, *XF86ConfInputPtr
;
327 XF86ConfInputPtr iref_inputdev
;
328 char *iref_inputdev_str
;
329 XF86OptionPtr iref_option_lst
;
331 XF86ConfInputrefRec
, *XF86ConfInputrefPtr
;
333 /* Values for adj_where */
334 #define CONF_ADJ_OBSOLETE -1
335 #define CONF_ADJ_ABSOLUTE 0
336 #define CONF_ADJ_RIGHTOF 1
337 #define CONF_ADJ_LEFTOF 2
338 #define CONF_ADJ_ABOVE 3
339 #define CONF_ADJ_BELOW 4
340 #define CONF_ADJ_RELATIVE 5
346 XF86ConfScreenPtr adj_screen
;
347 char *adj_screen_str
;
348 XF86ConfScreenPtr adj_top
;
350 XF86ConfScreenPtr adj_bottom
;
351 char *adj_bottom_str
;
352 XF86ConfScreenPtr adj_left
;
354 XF86ConfScreenPtr adj_right
;
361 XF86ConfAdjacencyRec
, *XF86ConfAdjacencyPtr
;
366 char *inactive_device_str
;
367 XF86ConfDevicePtr inactive_device
;
369 XF86ConfInactiveRec
, *XF86ConfInactivePtr
;
374 char *lay_identifier
;
375 XF86ConfAdjacencyPtr lay_adjacency_lst
;
376 XF86ConfInactivePtr lay_inactive_lst
;
377 XF86ConfInputrefPtr lay_input_lst
;
378 XF86OptionPtr lay_option_lst
;
381 XF86ConfLayoutRec
, *XF86ConfLayoutPtr
;
388 XF86OptionPtr vs_option_lst
;
391 XF86ConfVendSubRec
, *XF86ConfVendSubPtr
;
396 char *vnd_identifier
;
397 XF86OptionPtr vnd_option_lst
;
398 XF86ConfVendSubPtr vnd_sub_lst
;
401 XF86ConfVendorRec
, *XF86ConfVendorPtr
;
411 XF86ConfBuffersRec
, *XF86ConfBuffersPtr
;
415 char *dri_group_name
;
418 XF86ConfBuffersPtr dri_buffers_lst
;
421 XF86ConfDRIRec
, *XF86ConfDRIPtr
;
425 XF86OptionPtr ext_option_lst
;
426 char *extensions_comment
;
428 XF86ConfExtensionsRec
, *XF86ConfExtensionsPtr
;
432 XF86ConfFilesPtr conf_files
;
433 XF86ConfModulePtr conf_modules
;
434 XF86ConfFlagsPtr conf_flags
;
435 XF86ConfVideoAdaptorPtr conf_videoadaptor_lst
;
436 XF86ConfModesPtr conf_modes_lst
;
437 XF86ConfMonitorPtr conf_monitor_lst
;
438 XF86ConfDevicePtr conf_device_lst
;
439 XF86ConfScreenPtr conf_screen_lst
;
440 XF86ConfInputPtr conf_input_lst
;
441 XF86ConfLayoutPtr conf_layout_lst
;
442 XF86ConfVendorPtr conf_vendor_lst
;
443 XF86ConfDRIPtr conf_dri
;
444 XF86ConfExtensionsPtr conf_extensions
;
447 XF86ConfigRec
, *XF86ConfigPtr
;
451 int token
; /* id of the token */
452 char *name
; /* pointer to the LOWERCASED name */
454 xf86ConfigSymTabRec
, *xf86ConfigSymTabPtr
;
457 * prototypes for public functions
459 extern const char *xf86openConfigFile (const char *, const char *,
461 extern void xf86setBuiltinConfig(const char *config
[]);
462 extern XF86ConfigPtr
xf86readConfigFile (void);
463 extern void xf86closeConfigFile (void);
464 extern void xf86freeConfig (XF86ConfigPtr p
);
465 extern int xf86writeConfigFile (const char *, XF86ConfigPtr
);
466 XF86ConfDevicePtr
xf86findDevice(const char *ident
, XF86ConfDevicePtr p
);
467 XF86ConfLayoutPtr
xf86findLayout(const char *name
, XF86ConfLayoutPtr list
);
468 XF86ConfMonitorPtr
xf86findMonitor(const char *ident
, XF86ConfMonitorPtr p
);
469 XF86ConfModesPtr
xf86findModes(const char *ident
, XF86ConfModesPtr p
);
470 XF86ConfModeLinePtr
xf86findModeLine(const char *ident
, XF86ConfModeLinePtr p
);
471 XF86ConfScreenPtr
xf86findScreen(const char *ident
, XF86ConfScreenPtr p
);
472 XF86ConfInputPtr
xf86findInput(const char *ident
, XF86ConfInputPtr p
);
473 XF86ConfInputPtr
xf86findInputByDriver(const char *driver
, XF86ConfInputPtr p
);
474 XF86ConfVideoAdaptorPtr
xf86findVideoAdaptor(const char *ident
,
475 XF86ConfVideoAdaptorPtr p
);
477 GenericListPtr
xf86addListItem(GenericListPtr head
, GenericListPtr c_new
);
478 int xf86itemNotSublist(GenericListPtr list_1
, GenericListPtr list_2
);
480 int xf86pathIsAbsolute(const char *path
);
481 int xf86pathIsSafe(const char *path
);
482 char *xf86addComment(char *cur
, char *add
);
484 #endif /* _xf86Parser_h_ */