(submit/xf86-parser v2) xfree86: parser: rename STRING for fixing name conflict

Resolve name conflict with Sun's <sys/kbd.h> by renaming STRING enum
value to XF86_TOKEN_STRING.

This way, don't need the special #undef hack anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-03-13 20:34:56 +01:00
parent 1201a6ed88
commit 1068d6031e
17 changed files with 91 additions and 91 deletions

View File

@ -58,7 +58,7 @@ xf86parseDRISection(void)
while ((token = xf86getToken(DRITab)) != ENDSECTION) {
switch (token) {
case GROUP:
if ((token = xf86getSubToken(&(ptr->dri_comment))) == STRING)
if ((token = xf86getSubToken(&(ptr->dri_comment))) == XF86_TOKEN_STRING)
ptr->dri_group_name = xf86_lex_val.str;
else if (token == NUMBER)
ptr->dri_group = xf86_lex_val.num;

View File

@ -110,7 +110,7 @@ xf86parseDeviceSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -118,32 +118,32 @@ xf86parseDeviceSection(void)
has_ident = TRUE;
break;
case VENDOR:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Vendor");
ptr->dev_vendor = xf86_lex_val.str;
break;
case BOARD:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Board");
ptr->dev_board = xf86_lex_val.str;
break;
case CHIPSET:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Chipset");
ptr->dev_chipset = xf86_lex_val.str;
break;
case CARD:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Card");
ptr->dev_card = xf86_lex_val.str;
break;
case DRIVER:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Driver");
ptr->dev_driver = xf86_lex_val.str;
break;
case RAMDAC:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Ramdac");
ptr->dev_ramdac = xf86_lex_val.str;
break;
@ -187,7 +187,7 @@ xf86parseDeviceSection(void)
ptr->dev_io_base = xf86_lex_val.num;
break;
case CLOCKCHIP:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "ClockChip");
ptr->dev_clockchip = xf86_lex_val.str;
break;
@ -213,7 +213,7 @@ xf86parseDeviceSection(void)
xf86unGetToken(token);
break;
case MATCHSEAT:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchSeat");
ptr->match_seat = xf86_lex_val.str;
break;
@ -221,7 +221,7 @@ xf86parseDeviceSection(void)
ptr->dev_option_lst = xf86parseOption(ptr->dev_option_lst);
break;
case BUSID:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)
if (xf86getSubToken(&(ptr->dev_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "BusID");
ptr->dev_busid = xf86_lex_val.str;
break;

View File

@ -93,7 +93,7 @@ xf86parseFilesSection(void)
xf86_lex_val.str = NULL;
break;
case FONTPATH:
if (xf86getSubToken(&(ptr->file_comment)) != STRING)
if (xf86getSubToken(&(ptr->file_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "FontPath");
j = FALSE;
str = xf86_lex_val.str;
@ -116,7 +116,7 @@ xf86parseFilesSection(void)
free(xf86_lex_val.str);
break;
case MODULEPATH:
if (xf86getSubToken(&(ptr->file_comment)) != STRING)
if (xf86getSubToken(&(ptr->file_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "ModulePath");
l = FALSE;
str = xf86_lex_val.str;
@ -141,12 +141,12 @@ xf86parseFilesSection(void)
free(xf86_lex_val.str);
break;
case LOGFILEPATH:
if (xf86getSubToken(&(ptr->file_comment)) != STRING)
if (xf86getSubToken(&(ptr->file_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "LogFile");
ptr->file_logfile = xf86_lex_val.str;
break;
case XKBDIR:
if (xf86getSubToken(&(ptr->file_xkbdir)) != STRING)
if (xf86getSubToken(&(ptr->file_xkbdir)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "XkbDir");
ptr->file_xkbdir = xf86_lex_val.str;
break;

View File

@ -132,7 +132,7 @@ xf86parseFlagsSection(void)
if (hasvalue) {
tokentype = xf86getSubToken(&(ptr->flg_comment));
if (strvalue) {
if (tokentype != STRING)
if (tokentype != XF86_TOKEN_STRING)
Error(QUOTE_MSG, tmp);
valstr = xf86_lex_val.str;
}
@ -428,14 +428,14 @@ xf86parseOption(XF86OptionPtr head)
char *name, *comment = NULL;
int token;
if ((token = xf86getSubToken(&comment)) != STRING) {
if ((token = xf86getSubToken(&comment)) != XF86_TOKEN_STRING) {
xf86parseError(BAD_OPTION_MSG);
free(comment);
return head;
}
name = xf86_lex_val.str;
if ((token = xf86getSubToken(&comment)) == STRING) {
if ((token = xf86getSubToken(&comment)) == XF86_TOKEN_STRING) {
option = xf86newOption(name, xf86_lex_val.str);
option->opt_comment = comment;
if ((token = xf86getToken(NULL)) == COMMENT) {

View File

@ -88,7 +88,7 @@ xf86parseInputSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->inp_comment)) != STRING)
if (xf86getSubToken(&(ptr->inp_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -96,7 +96,7 @@ xf86parseInputSection(void)
has_ident = TRUE;
break;
case DRIVER:
if (xf86getSubToken(&(ptr->inp_comment)) != STRING)
if (xf86getSubToken(&(ptr->inp_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Driver");
if (strcmp(xf86_lex_val.str, "keyboard") == 0) {
ptr->inp_driver = strdup("kbd");

View File

@ -195,7 +195,7 @@ xf86parseInputClassSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -203,7 +203,7 @@ xf86parseInputClassSection(void)
has_ident = TRUE;
break;
case DRIVER:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Driver");
if (strcmp(xf86_lex_val.str, "keyboard") == 0) {
ptr->driver = strdup("kbd");
@ -219,7 +219,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_PRODUCT:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchProduct");
add_group_entry(&ptr->match_product,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP),
@ -230,7 +230,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_VENDOR:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchVendor");
add_group_entry(&ptr->match_vendor,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP),
@ -241,7 +241,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_DEVICE_PATH:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchDevicePath");
add_group_entry(&ptr->match_device,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP),
@ -252,7 +252,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_OS:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchOS");
add_group_entry(&ptr->match_os, xstrtokenize(xf86_lex_val.str,
TOKEN_SEP),
@ -263,7 +263,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_PNPID:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchPnPID");
add_group_entry(&ptr->match_pnpid,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP),
@ -274,7 +274,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_USBID:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchUSBID");
add_group_entry(&ptr->match_usbid,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP),
@ -285,7 +285,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_DRIVER:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchDriver");
add_group_entry(&ptr->match_driver,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP),
@ -296,7 +296,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_TAG:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchTag");
add_group_entry(&ptr->match_tag, xstrtokenize(xf86_lex_val.str,
TOKEN_SEP),
@ -307,7 +307,7 @@ xf86parseInputClassSection(void)
matchtype = MATCH_NEGATED;
/* fallthrough */
case MATCH_LAYOUT:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchLayout");
add_group_entry(&ptr->match_layout,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP),
@ -315,7 +315,7 @@ xf86parseInputClassSection(void)
free(xf86_lex_val.str);
break;
case MATCH_IS_KEYBOARD:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchIsKeyboard");
ptr->is_keyboard.set = xf86getBoolValue(&ptr->is_keyboard.val,
xf86_lex_val.str);
@ -324,7 +324,7 @@ xf86parseInputClassSection(void)
Error(BOOL_MSG, "MatchIsKeyboard");
break;
case MATCH_IS_POINTER:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchIsPointer");
ptr->is_pointer.set = xf86getBoolValue(&ptr->is_pointer.val,
xf86_lex_val.str);
@ -333,7 +333,7 @@ xf86parseInputClassSection(void)
Error(BOOL_MSG, "MatchIsPointer");
break;
case MATCH_IS_JOYSTICK:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchIsJoystick");
ptr->is_joystick.set = xf86getBoolValue(&ptr->is_joystick.val,
xf86_lex_val.str);
@ -342,7 +342,7 @@ xf86parseInputClassSection(void)
Error(BOOL_MSG, "MatchIsJoystick");
break;
case MATCH_IS_TABLET:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchIsTablet");
ptr->is_tablet.set = xf86getBoolValue(&ptr->is_tablet.val, xf86_lex_val.str);
free(xf86_lex_val.str);
@ -350,7 +350,7 @@ xf86parseInputClassSection(void)
Error(BOOL_MSG, "MatchIsTablet");
break;
case MATCH_IS_TABLET_PAD:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchIsTabletPad");
ptr->is_tablet_pad.set = xf86getBoolValue(&ptr->is_tablet_pad.val, xf86_lex_val.str);
free(xf86_lex_val.str);
@ -358,7 +358,7 @@ xf86parseInputClassSection(void)
Error(BOOL_MSG, "MatchIsTabletPad");
break;
case MATCH_IS_TOUCHPAD:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchIsTouchpad");
ptr->is_touchpad.set = xf86getBoolValue(&ptr->is_touchpad.val,
xf86_lex_val.str);
@ -367,7 +367,7 @@ xf86parseInputClassSection(void)
Error(BOOL_MSG, "MatchIsTouchpad");
break;
case MATCH_IS_TOUCHSCREEN:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchIsTouchscreen");
ptr->is_touchscreen.set = xf86getBoolValue(&ptr->is_touchscreen.val,
xf86_lex_val.str);

View File

@ -105,7 +105,7 @@ xf86parseLayoutSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->lay_comment)) != STRING)
if (xf86getSubToken(&(ptr->lay_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -113,7 +113,7 @@ xf86parseLayoutSection(void)
has_ident = TRUE;
break;
case MATCHSEAT:
if (xf86getSubToken(&(ptr->lay_comment)) != STRING)
if (xf86getSubToken(&(ptr->lay_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchSeat");
ptr->match_seat = xf86_lex_val.str;
break;
@ -123,7 +123,7 @@ xf86parseLayoutSection(void)
iptr = calloc(1, sizeof(XF86ConfInactiveRec));
iptr->list.next = NULL;
if (xf86getSubToken(&(ptr->lay_comment)) != STRING) {
if (xf86getSubToken(&(ptr->lay_comment)) != XF86_TOKEN_STRING) {
free(iptr);
Error(INACTIVE_MSG);
}
@ -149,7 +149,7 @@ xf86parseLayoutSection(void)
else
xf86unGetToken(token);
token = xf86getSubToken(&(ptr->lay_comment));
if (token != STRING) {
if (token != XF86_TOKEN_STRING) {
free(aptr);
Error(SCREEN_MSG);
}
@ -183,7 +183,7 @@ xf86parseLayoutSection(void)
default:
xf86unGetToken(token);
token = xf86getSubToken(&(ptr->lay_comment));
if (token == STRING)
if (token == XF86_TOKEN_STRING)
aptr->adj_where = CONF_ADJ_OBSOLETE;
else
aptr->adj_where = CONF_ADJ_ABSOLUTE;
@ -216,7 +216,7 @@ xf86parseLayoutSection(void)
case CONF_ADJ_BELOW:
case CONF_ADJ_RELATIVE:
token = xf86getSubToken(&(ptr->lay_comment));
if (token != STRING) {
if (token != XF86_TOKEN_STRING) {
free(aptr);
Error(INVALID_SCR_MSG);
}
@ -241,21 +241,21 @@ xf86parseLayoutSection(void)
aptr->adj_top_str = xf86_lex_val.str;
/* bottom */
if (xf86getSubToken(&(ptr->lay_comment)) != STRING) {
if (xf86getSubToken(&(ptr->lay_comment)) != XF86_TOKEN_STRING) {
free(aptr);
Error(SCREEN_MSG);
}
aptr->adj_bottom_str = xf86_lex_val.str;
/* left */
if (xf86getSubToken(&(ptr->lay_comment)) != STRING) {
if (xf86getSubToken(&(ptr->lay_comment)) != XF86_TOKEN_STRING) {
free(aptr);
Error(SCREEN_MSG);
}
aptr->adj_left_str = xf86_lex_val.str;
/* right */
if (xf86getSubToken(&(ptr->lay_comment)) != STRING) {
if (xf86getSubToken(&(ptr->lay_comment)) != XF86_TOKEN_STRING) {
free(aptr);
Error(SCREEN_MSG);
}
@ -273,12 +273,12 @@ xf86parseLayoutSection(void)
iptr = calloc(1, sizeof(XF86ConfInputrefRec));
iptr->list.next = NULL;
iptr->iref_option_lst = NULL;
if (xf86getSubToken(&(ptr->lay_comment)) != STRING) {
if (xf86getSubToken(&(ptr->lay_comment)) != XF86_TOKEN_STRING) {
free(iptr);
Error(INPUTDEV_MSG);
}
iptr->iref_inputdev_str = xf86_lex_val.str;
while ((token = xf86getSubToken(&(ptr->lay_comment))) == STRING) {
while ((token = xf86getSubToken(&(ptr->lay_comment))) == XF86_TOKEN_STRING) {
iptr->iref_option_lst =
xf86addNewOption(iptr->iref_option_lst, xf86_lex_val.str, NULL);
}

View File

@ -132,28 +132,28 @@ xf86parseModuleSection(void)
xf86_lex_val.str = NULL;
break;
case LOAD:
if (xf86getSubToken(&(ptr->mod_comment)) != STRING)
if (xf86getSubToken(&(ptr->mod_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Load");
ptr->mod_load_lst =
xf86addNewLoadDirective(ptr->mod_load_lst, xf86_lex_val.str,
XF86_LOAD_MODULE, NULL);
break;
case DISABLE:
if (xf86getSubToken(&(ptr->mod_comment)) != STRING)
if (xf86getSubToken(&(ptr->mod_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Disable");
ptr->mod_disable_lst =
xf86addNewLoadDirective(ptr->mod_disable_lst, xf86_lex_val.str,
XF86_DISABLE_MODULE, NULL);
break;
case LOAD_DRIVER:
if (xf86getSubToken(&(ptr->mod_comment)) != STRING)
if (xf86getSubToken(&(ptr->mod_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "LoadDriver");
ptr->mod_load_lst =
xf86addNewLoadDirective(ptr->mod_load_lst, xf86_lex_val.str,
XF86_LOAD_DRIVER, NULL);
break;
case SUBSECTION:
if (xf86getSubToken(&(ptr->mod_comment)) != STRING)
if (xf86getSubToken(&(ptr->mod_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "SubSection");
ptr->mod_load_lst =
xf86parseModuleSubSection(ptr->mod_load_lst, xf86_lex_val.str);

View File

@ -137,7 +137,7 @@ xf86parseModeLine(void)
parsePrologue(XF86ConfModeLinePtr, XF86ConfModeLineRec)
/* Identifier */
if (xf86getSubToken(&(ptr->ml_comment)) != STRING)
if (xf86getSubToken(&(ptr->ml_comment)) != XF86_TOKEN_STRING)
Error("ModeLine identifier expected");
ptr->ml_identifier = xf86_lex_val.str;
@ -262,7 +262,7 @@ xf86parseVerboseMode(void)
parsePrologue(XF86ConfModeLinePtr, XF86ConfModeLineRec)
if (xf86getSubToken(&(ptr->ml_comment)) != STRING)
if (xf86getSubToken(&(ptr->ml_comment)) != XF86_TOKEN_STRING)
Error("Mode name expected");
ptr->ml_identifier = xf86_lex_val.str;
while ((token = xf86getToken(ModeTab)) != ENDMODE) {
@ -324,9 +324,9 @@ xf86parseVerboseMode(void)
break;
case FLAGS:
token = xf86getSubToken(&(ptr->ml_comment));
if (token != STRING)
if (token != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Flags");
while (token == STRING) {
while (token == XF86_TOKEN_STRING) {
token2 = xf86getStringToken(TimingTab);
switch (token2) {
case TT_INTERLACE:
@ -419,7 +419,7 @@ xf86parseMonitorSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->mon_comment)) != STRING)
if (xf86getSubToken(&(ptr->mon_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -427,12 +427,12 @@ xf86parseMonitorSection(void)
has_ident = TRUE;
break;
case VENDOR:
if (xf86getSubToken(&(ptr->mon_comment)) != STRING)
if (xf86getSubToken(&(ptr->mon_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Vendor");
ptr->mon_vendor = xf86_lex_val.str;
break;
case MODEL:
if (xf86getSubToken(&(ptr->mon_comment)) != STRING)
if (xf86getSubToken(&(ptr->mon_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "ModelName");
ptr->mon_modelname = xf86_lex_val.str;
break;
@ -554,7 +554,7 @@ xf86parseMonitorSection(void)
{
XF86ConfModesLinkPtr mptr;
if ((token = xf86getSubToken(&(ptr->mon_comment))) != STRING)
if ((token = xf86getSubToken(&(ptr->mon_comment))) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "UseModes");
/* add to the end of the list of modes sections
@ -607,7 +607,7 @@ xf86parseModesSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->modes_comment)) != STRING)
if (xf86getSubToken(&(ptr->modes_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");

View File

@ -106,7 +106,7 @@ xf86parseOutputClassSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -114,13 +114,13 @@ xf86parseOutputClassSection(void)
has_ident = TRUE;
break;
case DRIVER:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Driver");
else
ptr->driver = xf86_lex_val.str;
break;
case MODULEPATH:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "ModulePath");
if (ptr->modulepath) {
char *path;
@ -136,7 +136,7 @@ xf86parseOutputClassSection(void)
ptr->option_lst = xf86parseOption(ptr->option_lst);
break;
case MATCH_DRIVER:
if (xf86getSubToken(&(ptr->comment)) != STRING)
if (xf86getSubToken(&(ptr->comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchDriver");
add_group_entry(&ptr->match_driver,
xstrtokenize(xf86_lex_val.str, TOKEN_SEP));

View File

@ -108,13 +108,13 @@ xf86parsePointerSection(void)
xf86_lex_val.str = NULL;
break;
case PROTOCOL:
if (xf86getSubToken(&(ptr->inp_comment)) != STRING)
if (xf86getSubToken(&(ptr->inp_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Protocol");
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
strdup("Protocol"), xf86_lex_val.str);
break;
case PDEVICE:
if (xf86getSubToken(&(ptr->inp_comment)) != STRING)
if (xf86getSubToken(&(ptr->inp_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Device");
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
strdup("Device"), xf86_lex_val.str);

View File

@ -149,7 +149,7 @@ xf86parseDisplaySubSection(void)
ptr->disp_bpp = xf86_lex_val.num;
break;
case VISUAL:
if (xf86getSubToken(&(ptr->disp_comment)) != STRING)
if (xf86getSubToken(&(ptr->disp_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Display");
ptr->disp_visual = xf86_lex_val.str;
break;
@ -192,7 +192,7 @@ xf86parseDisplaySubSection(void)
while ((token =
xf86getSubTokenWithTab(&(ptr->disp_comment),
DisplayTab)) == STRING) {
DisplayTab)) == XF86_TOKEN_STRING) {
mptr = calloc(1, sizeof(XF86ModeRec));
mptr->mode_name = xf86_lex_val.str;
mptr->list.next = NULL;
@ -262,7 +262,7 @@ xf86parseScreenSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
ptr->scrn_identifier = xf86_lex_val.str;
if (has_ident || has_driver)
@ -270,12 +270,12 @@ xf86parseScreenSection(void)
has_ident = TRUE;
break;
case MATCHSEAT:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "MatchSeat");
ptr->match_seat = xf86_lex_val.str;
break;
case OBSDRIVER:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Driver");
ptr->scrn_obso_driver = xf86_lex_val.str;
if (has_ident || has_driver)
@ -298,19 +298,19 @@ xf86parseScreenSection(void)
ptr->scrn_defaultfbbpp = xf86_lex_val.num;
break;
case MDEVICE:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Device");
ptr->scrn_device_str = xf86_lex_val.str;
break;
case GDEVICE:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "GPUDevice");
if (ptr->num_gpu_devices == CONF_MAXGPUDEVICES)
Error(GPU_DEVICE_TOO_MANY, CONF_MAXGPUDEVICES);
ptr->scrn_gpu_device_str[ptr->num_gpu_devices++] = xf86_lex_val.str;
break;
case MONITOR:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Monitor");
ptr->scrn_monitor_str = xf86_lex_val.str;
break;
@ -318,7 +318,7 @@ xf86parseScreenSection(void)
{
XF86ConfAdaptorLinkPtr aptr;
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "VideoAdaptor");
/* Don't allow duplicates */
@ -348,7 +348,7 @@ xf86parseScreenSection(void)
ptr->scrn_option_lst = xf86parseOption(ptr->scrn_option_lst);
break;
case SUBSECTION:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
if (xf86getSubToken(&(ptr->scrn_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "SubSection");
{
free(xf86_lex_val.str);

View File

@ -157,7 +157,7 @@ xf86parseVendorSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->vnd_comment)) != STRING)
if (xf86getSubToken(&(ptr->vnd_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -168,7 +168,7 @@ xf86parseVendorSection(void)
ptr->vnd_option_lst = xf86parseOption(ptr->vnd_option_lst);
break;
case SUBSECTION:
if (xf86getSubToken(&(ptr->vnd_comment)) != STRING)
if (xf86getSubToken(&(ptr->vnd_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "SubSection");
{
HANDLE_LIST(vnd_sub_lst, xf86parseVendorSubSection,

View File

@ -101,7 +101,7 @@ xf86parseVideoPortSubSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->vp_comment)) != STRING)
if (xf86getSubToken(&(ptr->vp_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
if (has_ident == TRUE)
Error(MULTIPLE_MSG, "Identifier");
@ -160,7 +160,7 @@ xf86parseVideoAdaptorSection(void)
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->va_comment)) != STRING)
if (xf86getSubToken(&(ptr->va_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Identifier");
ptr->va_identifier = xf86_lex_val.str;
if (has_ident == TRUE)
@ -168,22 +168,22 @@ xf86parseVideoAdaptorSection(void)
has_ident = TRUE;
break;
case VENDOR:
if (xf86getSubToken(&(ptr->va_comment)) != STRING)
if (xf86getSubToken(&(ptr->va_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Vendor");
ptr->va_vendor = xf86_lex_val.str;
break;
case BOARD:
if (xf86getSubToken(&(ptr->va_comment)) != STRING)
if (xf86getSubToken(&(ptr->va_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Board");
ptr->va_board = xf86_lex_val.str;
break;
case BUSID:
if (xf86getSubToken(&(ptr->va_comment)) != STRING)
if (xf86getSubToken(&(ptr->va_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "BusID");
ptr->va_busid = xf86_lex_val.str;
break;
case DRIVER:
if (xf86getSubToken(&(ptr->va_comment)) != STRING)
if (xf86getSubToken(&(ptr->va_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "Driver");
ptr->va_driver = xf86_lex_val.str;
break;
@ -191,7 +191,7 @@ xf86parseVideoAdaptorSection(void)
ptr->va_option_lst = xf86parseOption(ptr->va_option_lst);
break;
case SUBSECTION:
if (xf86getSubToken(&(ptr->va_comment)) != STRING)
if (xf86getSubToken(&(ptr->va_comment)) != XF86_TOKEN_STRING)
Error(QUOTE_MSG, "SubSection");
{
HANDLE_LIST(va_port_lst, xf86parseVideoPortSubSection,

View File

@ -104,7 +104,7 @@ xf86readConfigFile(void)
xf86_lex_val.str = NULL;
break;
case SECTION:
if (xf86getSubToken(&(ptr->conf_comment)) != STRING) {
if (xf86getSubToken(&(ptr->conf_comment)) != XF86_TOKEN_STRING) {
xf86parseError(QUOTE_MSG, "Section");
CLEANUP(ptr);
return NULL;

View File

@ -394,7 +394,7 @@ xf86getToken(const xf86ConfigSymTabRec * tab)
configRBuf[i] = '\0';
xf86_lex_val.str = malloc(strlen(configRBuf) + 1);
strcpy(xf86_lex_val.str, configRBuf); /* private copy ! */
return STRING;
return XF86_TOKEN_STRING;
}
/*
@ -427,7 +427,7 @@ xf86getToken(const xf86ConfigSymTabRec * tab)
if (temp == COMMA || temp == DASH)
return temp;
if (temp == NUMBER || temp == STRING)
if (temp == NUMBER || temp == XF86_TOKEN_STRING)
return temp;
}

View File

@ -76,7 +76,7 @@ typedef enum {
/* value type tokens */
NUMBER = 1,
STRING,
XF86_TOKEN_STRING,
/* Tokens that can appear in many sections */
SECTION,