VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/xf86Opt.h

Last change on this file was 69098, checked in by vboxsync, 7 years ago

Clean up XFree86 driver header files.
bugref:3810: X11 Guest Additions maintenance
Over the years we have cleaned up the layout in the tree of the X.Org
header files we use to build drivers. The XFree86 ones were still in their
original, rather sub-optimal layout. This change fixes that.

  • Property svn:eol-style set to native
File size: 3.2 KB
Line 
1/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.12 2001/05/04 19:05:30 dawes Exp $ */
2
3/* Option handling things that ModuleSetup procs can use */
4
5#ifndef _XF86_OPT_H_
6#define _XF86_OPT_H_
7
8typedef struct {
9 double freq;
10 int units;
11} OptFrequency;
12
13typedef union {
14 unsigned long num;
15 char * str;
16 double realnum;
17 Bool bool;
18 OptFrequency freq;
19} ValueUnion;
20
21typedef enum {
22 OPTV_NONE = 0,
23 OPTV_INTEGER,
24 OPTV_STRING, /* a non-empty string */
25 OPTV_ANYSTR, /* Any string, including an empty one */
26 OPTV_REAL,
27 OPTV_BOOLEAN,
28 OPTV_FREQ
29} OptionValueType;
30
31typedef enum {
32 OPTUNITS_HZ = 1,
33 OPTUNITS_KHZ,
34 OPTUNITS_MHZ
35} OptFreqUnits;
36
37typedef struct {
38 int token;
39 const char* name;
40 OptionValueType type;
41 ValueUnion value;
42 Bool found;
43} OptionInfoRec, *OptionInfoPtr;
44
45int xf86SetIntOption(pointer optlist, const char *name, int deflt);
46double xf86SetRealOption(pointer optlist, const char *name, double deflt);
47char *xf86SetStrOption(pointer optlist, const char *name, char *deflt);
48int xf86SetBoolOption(pointer list, const char *name, int deflt );
49pointer xf86AddNewOption(pointer head, char *name, char *val );
50pointer xf86NewOption(char *name, char *value );
51pointer xf86NextOption(pointer list );
52pointer xf86OptionListCreate(const char **options, int count, int used);
53pointer xf86OptionListMerge(pointer head, pointer tail);
54void xf86OptionListFree(pointer opt);
55char *xf86OptionName(pointer opt);
56char *xf86OptionValue(pointer opt);
57void xf86OptionListReport(pointer parm);
58pointer xf86FindOption(pointer options, const char *name);
59char *xf86FindOptionValue(pointer options, const char *name);
60void xf86MarkOptionUsed(pointer option);
61void xf86MarkOptionUsedByName(pointer options, const char *name);
62Bool xf86CheckIfOptionUsed(pointer option);
63Bool xf86CheckIfOptionUsedByName(pointer options, const char *name);
64void xf86ShowUnusedOptions(int scrnIndex, pointer options);
65void xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo);
66OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
67const char *xf86TokenToOptName(const OptionInfoRec *table, int token);
68Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
69char *xf86GetOptValString(const OptionInfoRec *table, int token);
70Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
71Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
72Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
73Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
74 OptFreqUnits expectedUnits, double *value);
75Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
76Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
77int xf86NameCmp(const char *s1, const char *s2);
78char *xf86NormalizeName(const char *s);
79pointer xf86ReplaceIntOption(pointer optlist, char *name, int val);
80pointer xf86ReplaceBoolOption(pointer optlist, char *name, Bool val);
81pointer xf86ReplaceStrOption(pointer optlist, char *name, char* val);
82#endif
Note: See TracBrowser for help on using the repository browser.

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