(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:
parent
d18ffe08ac
commit
b28944c970
|
@ -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;
|
||||
|
|
|
@ -108,7 +108,7 @@ xf86parseDeviceSection(void)
|
|||
ptr->dev_comment = xf86addComment(ptr->dev_comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -116,32 +116,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;
|
||||
|
@ -185,7 +185,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;
|
||||
|
@ -211,7 +211,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;
|
||||
|
@ -219,7 +219,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;
|
||||
|
|
|
@ -91,7 +91,7 @@ xf86parseFilesSection(void)
|
|||
ptr->file_comment = xf86addComment(ptr->file_comment, xf86_lex_val.str);
|
||||
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;
|
||||
|
@ -114,7 +114,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;
|
||||
|
@ -139,12 +139,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;
|
||||
|
|
|
@ -130,7 +130,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;
|
||||
}
|
||||
|
@ -426,14 +426,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)
|
||||
|
|
|
@ -86,7 +86,7 @@ xf86parseInputSection(void)
|
|||
ptr->inp_comment = xf86addComment(ptr->inp_comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -94,7 +94,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");
|
||||
|
|
|
@ -193,7 +193,7 @@ xf86parseInputClassSection(void)
|
|||
ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -201,7 +201,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");
|
||||
|
@ -217,7 +217,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),
|
||||
|
@ -228,7 +228,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),
|
||||
|
@ -239,7 +239,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),
|
||||
|
@ -250,7 +250,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),
|
||||
|
@ -261,7 +261,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),
|
||||
|
@ -272,7 +272,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),
|
||||
|
@ -283,7 +283,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),
|
||||
|
@ -294,7 +294,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),
|
||||
|
@ -305,7 +305,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),
|
||||
|
@ -313,7 +313,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);
|
||||
|
@ -322,7 +322,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);
|
||||
|
@ -331,7 +331,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);
|
||||
|
@ -340,7 +340,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);
|
||||
|
@ -348,7 +348,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);
|
||||
|
@ -356,7 +356,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);
|
||||
|
@ -365,7 +365,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);
|
||||
|
|
|
@ -103,7 +103,7 @@ xf86parseLayoutSection(void)
|
|||
ptr->lay_comment = xf86addComment(ptr->lay_comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -111,7 +111,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;
|
||||
|
@ -121,7 +121,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);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ xf86parseLayoutSection(void)
|
|||
else
|
||||
xf86unGetToken(token);
|
||||
token = xf86getSubToken(&(ptr->lay_comment));
|
||||
if (token != STRING) {
|
||||
if (token != XF86_TOKEN_STRING) {
|
||||
free(aptr);
|
||||
Error(SCREEN_MSG);
|
||||
}
|
||||
|
@ -181,7 +181,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;
|
||||
|
@ -214,7 +214,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);
|
||||
}
|
||||
|
@ -239,21 +239,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);
|
||||
}
|
||||
|
@ -271,12 +271,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);
|
||||
}
|
||||
|
|
|
@ -128,28 +128,28 @@ xf86parseModuleSection(void)
|
|||
ptr->mod_comment = xf86addComment(ptr->mod_comment, xf86_lex_val.str);
|
||||
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);
|
||||
|
|
|
@ -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) {
|
||||
|
@ -322,9 +322,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:
|
||||
|
@ -415,7 +415,7 @@ xf86parseMonitorSection(void)
|
|||
ptr->mon_comment = xf86addComment(ptr->mon_comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -423,12 +423,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;
|
||||
|
@ -550,7 +550,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
|
||||
|
@ -601,7 +601,7 @@ xf86parseModesSection(void)
|
|||
ptr->modes_comment = xf86addComment(ptr->modes_comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
|
|
@ -104,7 +104,7 @@ xf86parseOutputClassSection(void)
|
|||
ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -112,13 +112,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;
|
||||
|
@ -134,7 +134,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));
|
||||
|
|
|
@ -106,13 +106,13 @@ xf86parsePointerSection(void)
|
|||
ptr->inp_comment = xf86addComment(ptr->inp_comment, xf86_lex_val.str);
|
||||
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);
|
||||
|
|
|
@ -147,7 +147,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;
|
||||
|
@ -190,7 +190,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;
|
||||
|
@ -258,7 +258,7 @@ xf86parseScreenSection(void)
|
|||
ptr->scrn_comment = xf86addComment(ptr->scrn_comment, xf86_lex_val.str);
|
||||
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)
|
||||
|
@ -266,12 +266,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)
|
||||
|
@ -294,19 +294,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;
|
||||
|
@ -314,7 +314,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 */
|
||||
|
@ -344,7 +344,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);
|
||||
|
|
|
@ -153,7 +153,7 @@ xf86parseVendorSection(void)
|
|||
ptr->vnd_comment = xf86addComment(ptr->vnd_comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -164,7 +164,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,
|
||||
|
|
|
@ -99,7 +99,7 @@ xf86parseVideoPortSubSection(void)
|
|||
ptr->vp_comment = xf86addComment(ptr->vp_comment, xf86_lex_val.str);
|
||||
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");
|
||||
|
@ -156,7 +156,7 @@ xf86parseVideoAdaptorSection(void)
|
|||
ptr->va_comment = xf86addComment(ptr->va_comment, xf86_lex_val.str);
|
||||
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)
|
||||
|
@ -164,22 +164,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;
|
||||
|
@ -187,7 +187,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,
|
||||
|
|
|
@ -102,7 +102,7 @@ xf86readConfigFile(void)
|
|||
ptr->conf_comment = xf86addComment(ptr->conf_comment, xf86_lex_val.str);
|
||||
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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ typedef enum {
|
|||
|
||||
/* value type tokens */
|
||||
NUMBER = 1,
|
||||
STRING,
|
||||
XF86_TOKEN_STRING,
|
||||
|
||||
/* Tokens that can appear in many sections */
|
||||
SECTION,
|
||||
|
|
Loading…
Reference in New Issue