2 * Copyright 2004 Red Hat Inc., Raleigh, North Carolina.
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation on the rights to use, copy, modify, merge,
10 * publish, distribute, sublicense, and/or sell copies of the Software,
11 * and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * Kevin E. Martin <kem@redhat.com>
34 #ifdef HAVE_XORG_CONFIG_H
35 #include <xorg-config.h>
38 #include "xf86Parser.h"
39 #include "xf86tokens.h"
40 #include "Configint.h"
44 static xf86ConfigSymTabRec ExtensionsTab
[] = {
45 {ENDSECTION
, "endsection"},
50 #define CLEANUP xf86freeExtensions
53 xf86parseExtensionsSection(void)
57 parsePrologue(XF86ConfExtensionsPtr
, XF86ConfExtensionsRec
);
59 while ((token
= xf86getToken(ExtensionsTab
)) != ENDSECTION
) {
62 ptr
->ext_option_lst
= xf86parseOption(ptr
->ext_option_lst
);
65 Error(UNEXPECTED_EOF_MSG
);
68 ptr
->extensions_comment
=
69 xf86addComment(ptr
->extensions_comment
, val
.str
);
72 Error(INVALID_KEYWORD_MSG
, xf86tokenString());
78 ErrorF("Extensions section parsed\n");
87 xf86printExtensionsSection(FILE * cf
, XF86ConfExtensionsPtr ptr
)
91 if (ptr
== NULL
|| ptr
->ext_option_lst
== NULL
)
94 p
= ptr
->ext_option_lst
;
95 fprintf(cf
, "Section \"Extensions\"\n");
96 if (ptr
->extensions_comment
)
97 fprintf(cf
, "%s", ptr
->extensions_comment
);
98 xf86printOptionList(cf
, p
, 1);
99 fprintf(cf
, "EndSection\n\n");
103 xf86freeExtensions(XF86ConfExtensionsPtr ptr
)
108 xf86optionListFree(ptr
->ext_option_lst
);
109 TestFree(ptr
->extensions_comment
);