3 * Copyright (c) 1997 Metro Link Incorporated
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
20 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * Except as contained in this notice, the name of the Metro Link shall not be
24 * used in advertising or otherwise to promote the sale, use or other dealings
25 * in this Software without prior written authorization from Metro Link.
29 /* View/edit this file with tab stops set to 4 */
31 #ifdef HAVE_XORG_CONFIG_H
32 #include <xorg-config.h>
39 #include "xf86Parser.h"
40 #include "configProcs.h"
42 #ifdef MALLOC_FUNCTIONS
57 xrealloc (void *p
, int size
)
59 return realloc (p
, size
);
64 #define CONFPATH "%A,%R,/etc/X11/%R,%P/etc/X11/%R,%E,%F,/etc/X11/%F," \
65 "%P/etc/X11/%F,%D/%X,/etc/X11/%X,/etc/%X,%P/etc/X11/%X.%H," \
66 "%P/etc/X11/%X,%P/lib/X11/%X.%H,%P/lib/X11/%X"
69 main (int argc
, char *argv
[])
79 if ((filename
= xf86openConfigFile (CONFPATH
, cmdline
, NULL
)))
81 fprintf (stderr
, "Opened %s for the config file\n", filename
);
85 fprintf (stderr
, "Unable to open config file\n");
89 if ((conf
= xf86readConfigFile ()) == NULL
)
91 fprintf (stderr
, "Problem when parsing config file\n");
95 fprintf (stderr
, "Config file parsed OK\n");
97 xf86closeConfigFile ();
100 fprintf(stderr
, "Writing config file to `%s'\n", argv
[2]);
101 xf86writeConfigFile (argv
[2], conf
);
106 /* Functions that the parser requires */
109 VErrorF(const char *f
, va_list args
)
111 vfprintf(stderr
, f
, args
);
115 ErrorF(const char *f
, ...)
120 vfprintf(stderr
, f
, args
);