diff options
Diffstat (limited to 'hw/xfree86/parser')
-rw-r--r-- | hw/xfree86/parser/DRI.c | 64 | ||||
-rw-r--r-- | hw/xfree86/parser/scan.c | 63 | ||||
-rw-r--r-- | hw/xfree86/parser/xf86Parser.h | 11 | ||||
-rw-r--r-- | hw/xfree86/parser/xf86tokens.h | 1 |
4 files changed, 1 insertions, 138 deletions
diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c index 12b8d1d1a..f51f6b989 100644 --- a/hw/xfree86/parser/DRI.c +++ b/hw/xfree86/parser/DRI.c @@ -41,58 +41,10 @@ static xf86ConfigSymTabRec DRITab[] = { {ENDSECTION, "endsection"}, {GROUP, "group"}, - {BUFFERS, "buffers"}, {MODE, "mode"}, {-1, ""}, }; -#define CLEANUP xf86freeBuffersList - -static void -xf86freeBuffersList (XF86ConfBuffersPtr ptr) -{ - XF86ConfBuffersPtr prev; - - while (ptr) { - TestFree (ptr->buf_flags); - TestFree (ptr->buf_comment); - prev = ptr; - ptr = ptr->list.next; - free (prev); - } -} - -static XF86ConfBuffersPtr -xf86parseBuffers (void) -{ - int token; - parsePrologue (XF86ConfBuffersPtr, XF86ConfBuffersRec) - - if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER) - Error ("Buffers count expected", NULL); - ptr->buf_count = val.num; - - if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER) - Error ("Buffers size expected", NULL); - ptr->buf_size = val.num; - - if ((token = xf86getSubToken (&(ptr->buf_comment))) == STRING) { - ptr->buf_flags = val.str; - if ((token = xf86getToken (NULL)) == COMMENT) - ptr->buf_comment = xf86addComment(ptr->buf_comment, val.str); - else - xf86unGetToken(token); - } - -#ifdef DEBUG - printf ("Buffers parsed\n"); -#endif - - return ptr; -} - -#undef CLEANUP - #define CLEANUP xf86freeDRI XF86ConfDRIPtr @@ -121,10 +73,6 @@ xf86parseDRISection (void) Error (MUST_BE_OCTAL_MSG, val.num); ptr->dri_mode = val.num; break; - case BUFFERS: - HANDLE_LIST (dri_buffers_lst, xf86parseBuffers, - XF86ConfBuffersPtr); - break; case EOF_TOKEN: Error (UNEXPECTED_EOF_MSG, NULL); break; @@ -149,8 +97,6 @@ xf86parseDRISection (void) void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr) { - XF86ConfBuffersPtr bufs; - if (ptr == NULL) return; @@ -163,15 +109,6 @@ xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr) fprintf (cf, "\tGroup %d\n", ptr->dri_group); if (ptr->dri_mode) fprintf (cf, "\tMode 0%o\n", ptr->dri_mode); - for (bufs = ptr->dri_buffers_lst; bufs; bufs = bufs->list.next) { - fprintf (cf, "\tBuffers %d %d", - bufs->buf_count, bufs->buf_size); - if (bufs->buf_flags) fprintf (cf, " \"%s\"", bufs->buf_flags); - if (bufs->buf_comment) - fprintf(cf, "%s", bufs->buf_comment); - else - fprintf (cf, "\n"); - } fprintf (cf, "EndSection\n\n"); } @@ -181,7 +118,6 @@ xf86freeDRI (XF86ConfDRIPtr ptr) if (ptr == NULL) return; - xf86freeBuffersList (ptr->dri_buffers_lst); TestFree (ptr->dri_comment); free (ptr); } diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index e609bdfd5..e4fce309f 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -115,53 +115,6 @@ static int pushToken = LOCK_TOKEN; static int eol_seen = 0; /* private state to handle comments */ LexRec val; -/* - * xf86strToUL -- - * - * A portable, but restricted, version of strtoul(). It only understands - * hex, octal, and decimal. But it's good enough for our needs. - */ -static unsigned int -xf86strToUL (char *str) -{ - int base = 10; - char *p = str; - unsigned int tot = 0; - - if (*p == '0') - { - p++; - if ((*p == 'x') || (*p == 'X')) - { - p++; - base = 16; - } - else - base = 8; - } - while (*p) - { - if ((*p >= '0') && (*p <= ((base == 8) ? '7' : '9'))) - { - tot = tot * base + (*p - '0'); - } - else if ((base == 16) && (*p >= 'a') && (*p <= 'f')) - { - tot = tot * base + 10 + (*p - 'a'); - } - else if ((base == 16) && (*p >= 'A') && (*p <= 'F')) - { - tot = tot * base + 10 + (*p - 'A'); - } - else - { - return tot; - } - p++; - } - return tot; -} - /* * xf86getNextLine -- * @@ -434,7 +387,7 @@ again: configRBuf[i++] = c; configPos--; /* GJA -- one too far */ configRBuf[i] = '\0'; - val.num = xf86strToUL (configRBuf); + val.num = strtoul (configRBuf, NULL, 0); val.realnum = atof (configRBuf); return NUMBER; } @@ -601,7 +554,6 @@ xf86pathIsSafe(const char *path) * %P projroot * %C sysconfdir * %D datadir - * %M config file format version number * %% % */ @@ -626,11 +578,6 @@ xf86pathIsSafe(const char *path) #ifndef XCONFENV #define XCONFENV "XORGCONFIG" #endif -/* xorg.conf is based on XF86Config version 4. If we ever break - compatibility of the xorg.conf syntax, we'll bump this version number. */ -#ifndef CONFIG_FILE_VERSION -#define CONFIG_FILE_VERSION 4 -#endif #define BAIL_OUT do { \ free(result); \ @@ -661,7 +608,6 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot, int i, l; static const char *env = NULL; static char *hostname = NULL; - static char majorvers[3] = ""; if (!template) return NULL; @@ -762,13 +708,6 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot, case 'D': APPEND_STR(DATADIR); break; - case 'M': - if (!majorvers[0]) { - snprintf(majorvers, sizeof(majorvers), - "%d", CONFIG_FILE_VERSION); - } - APPEND_STR(majorvers); - break; case '%': result[l++] = '%'; CHECK_LENGTH; diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index 337ad0718..9f0a602ed 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -442,20 +442,9 @@ XF86ConfVendorRec, *XF86ConfVendorPtr; typedef struct { - GenericListRec list; - int buf_count; - int buf_size; - char *buf_flags; - char *buf_comment; -} -XF86ConfBuffersRec, *XF86ConfBuffersPtr; - -typedef struct -{ char *dri_group_name; int dri_group; int dri_mode; - XF86ConfBuffersPtr dri_buffers_lst; char *dri_comment; } XF86ConfDRIRec, *XF86ConfDRIPtr; diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index c16a8f551..ec04e4c7d 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/hw/xfree86/parser/xf86tokens.h @@ -273,7 +273,6 @@ typedef enum { /* DRI Tokens */ GROUP, - BUFFERS, /* InputClass Tokens */ MATCH_PRODUCT, |