43
43
#define NV_PARSER_TYPE_COLOR_ATTRIBUTE (1<<17)
44
44
#define NV_PARSER_TYPE_NO_CONFIG_WRITE (1<<18)
45
45
#define NV_PARSER_TYPE_GUI_ATTRIBUTE (1<<19)
46
#define NV_PARSER_TYPE_XVIDEO_ATTRIBUTE (1<<20)
47
#define NV_PARSER_TYPE_PACKED_ATTRIBUTE (1<<21)
48
#define NV_PARSER_TYPE_VALUE_IS_DISPLAY (1<<22)
49
#define NV_PARSER_TYPE_NO_QUERY_ALL (1<<23)
50
#define NV_PARSER_TYPE_NO_ZERO_VALUE (1<<24)
51
#define NV_PARSER_TYPE_100Hz (1<<25)
52
#define NV_PARSER_TYPE_STRING_ATTRIBUTE (1<<26)
53
#define NV_PARSER_TYPE_ASSIGN_ALL_DISPLAYS (1<<27)
54
#define NV_PARSER_TYPE_VALUE_IS_SWITCH_DISPLAY (1<<28)
55
#define NV_PARSER_TYPE_1000Hz (1<<29)
56
#define NV_PARSER_TYPE_SDI (1<<30)
57
#define NV_PARSER_TYPE_SDI_CSC (1<<31)
46
#define NV_PARSER_TYPE_PACKED_ATTRIBUTE (1<<20)
47
#define NV_PARSER_TYPE_VALUE_IS_DISPLAY (1<<21)
48
#define NV_PARSER_TYPE_NO_QUERY_ALL (1<<22)
49
#define NV_PARSER_TYPE_NO_ZERO_VALUE (1<<23)
50
#define NV_PARSER_TYPE_100Hz (1<<24)
51
#define NV_PARSER_TYPE_STRING_ATTRIBUTE (1<<25)
52
#define NV_PARSER_TYPE_ASSIGN_ALL_DISPLAYS (1<<26)
53
#define NV_PARSER_TYPE_VALUE_IS_SWITCH_DISPLAY (1<<27)
54
#define NV_PARSER_TYPE_1000Hz (1<<28)
55
#define NV_PARSER_TYPE_SDI (1<<29)
56
#define NV_PARSER_TYPE_SDI_CSC (1<<30)
57
#define NV_PARSER_TYPE_VALUE_IS_DISPLAY_ID (1<<31)
59
59
#define NV_PARSER_ASSIGNMENT 0
60
60
#define NV_PARSER_QUERY 1
84
84
#define NV_PARSER_STATUS_TARGET_SPEC_NO_TARGET_ID 13
85
85
#define NV_PARSER_STATUS_TARGET_SPEC_BAD_TARGET_ID 14
86
86
#define NV_PARSER_STATUS_TARGET_SPEC_TRAILING_GARBAGE 15
87
#define NV_PARSER_STATUS_TARGET_SPEC_NO_TARGETS 16
90
90
* define useful types
115
115
typedef struct _ParsedAttribute {
118
char *target_specification;
120
* The target_type and target_id here are mostly set by the GUI to store
121
* target-specific information, as well as the cmd line for handling the
122
* case where an X screen is specified as part of the display (e.g.
123
* "localhost:0.1"). Note that if the target_specification is specified,
124
* the target_type and target_id are ignored when resolving to the list of
125
* targets that should be operated on.
120
129
char *target_name;
128
137
uint32 display_device_mask;
130
139
struct _ParsedAttribute *next;
141
* Upon being resolved, the ParsedAttribute's target_type and target_id,
142
* and/or target_specification get converted into a list of targets to
143
* which the attribute should be processed.
145
struct _CtrlHandleTargetNode *targets;
131
146
} ParsedAttribute;
136
151
* Attribute table; defined in parse.c
139
extern AttributeTableEntry attributeTable[];
154
extern const AttributeTableEntry attributeTable[];
143
* Indices into CtrlHandles->targets[] array; stored in
144
* TargetTypeEntry.target_index.
158
* Indices into both targetTypeTable[] and CtrlHandles->targets[] array; stored
159
* in TargetTypeEntry.target_index.
147
162
#define X_SCREEN_TARGET 0
191
206
* TargetType table; defined in parse.c
194
extern TargetTypeEntry targetTypeTable[];
209
extern const TargetTypeEntry targetTypeTable[];
210
extern const int targetTypeTableLen;
213
* accessor functions for getting target type info based on NV-CONTROL
214
* attribute type or by a name.
216
const TargetTypeEntry *nv_get_target_type_entry_by_nvctrl(int nvctrl);
217
const TargetTypeEntry *nv_get_target_type_entry_by_name(const char *name);
196
220
/* nv_get_sdi_csc_matrxi() - Returns an array of floats that specifies
197
* all the color, offset and scale values for specifing one of the
221
* all the color, offset and scale values for specifying one of the
198
222
* Standard CSC. 's' is a string that names the matrix values to return.
199
223
* The values are placed in the float buffer like so:
216
240
* the default X server is used. If no X screen is specified, then
217
241
* all X screens on the X server are used.
219
* {screen}/ may be specified by itself (ie: without the
243
* {screen}/ may be specified by itself (i.e.: without the
220
244
* "{host}:{display}." part).
222
246
* Additionally, instead of specifying a screen, a target
240
264
* The query parameter controls whether the attribute string is parsed
241
265
* for setting or querying. If query == NV_PARSER_SET, then the
242
* attribute string will be interpretted as described above. If query
266
* attribute string will be interpreted as described above. If query
243
267
* == NV_PARSER_QUERY, the "={value}" portion of the string should be
279
303
char *replace_characters(const char *o, const char c, const char r);
282
* diaplay_mask/display_name conversions: the NV-CONTROL X extension
306
* display_mask/display_name conversions: the NV-CONTROL X extension
283
307
* identifies a display device by a bit in a display device mask. The
284
308
* below functions translate between a display mask, and a string
285
309
* describing the display devices.
307
331
char *display_device_mask_to_display_device_name(const uint32);
308
uint32 display_device_name_to_display_device_mask(const char *);
310
uint32 expand_display_device_mask_wildcards(const uint32, const uint32);
333
uint32 expand_display_device_mask_wildcards(const uint32);
312
335
ParsedAttribute *nv_parsed_attribute_init(void);
326
349
/* General parsing functions */
351
int nv_parse_numerical(const char *start, const char *end, int *val);
328
352
const char *parse_skip_whitespace(const char *str);
329
353
void parse_chop_whitespace(char *str);
330
354
const char *parse_skip_integer(const char *str);