[RFC][PATCH 1/6] xfree86: delete the dumb xorg.conf creator (-configure option)

Tiago Vignatti tiago.vignatti at nokia.com
Tue Jul 14 10:06:38 PDT 2009


We have to move forward! So lets just forget the static way to configure the
server. We could wrap all this code with #ifdefs, don't breaking such
"functionality", but I'd prefer to just nuke the old fashioned configurator
forever, teaching the right way to who still using this.

It's amazing to see how much of hw/xfree86/parser goes together in the same
trash bin.

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
 hw/xfree86/common/Makefile.am            |    2 +-
 hw/xfree86/common/xf86.h                 |    6 -
 hw/xfree86/common/xf86Configure.c        |  875 ------------------------------
 hw/xfree86/common/xf86Globals.c          |    1 -
 hw/xfree86/common/xf86Helper.c           |   27 +-
 hw/xfree86/common/xf86Init.c             |   68 +---
 hw/xfree86/common/xf86Priv.h             |    3 -
 hw/xfree86/common/xf86sbusBus.c          |   21 -
 hw/xfree86/ddc/edid.h                    |    2 +-
 hw/xfree86/doc/man/Xorg.man.pre          |   10 -
 hw/xfree86/os-support/solaris/sun_init.c |    2 +-
 hw/xfree86/parser/DRI.c                  |   29 -
 hw/xfree86/parser/Device.c               |   68 ---
 hw/xfree86/parser/Extensions.c           |   16 -
 hw/xfree86/parser/Flags.c                |   15 -
 hw/xfree86/parser/Input.c                |   18 -
 hw/xfree86/parser/Makefile.am            |    1 -
 hw/xfree86/parser/Monitor.c              |  146 -----
 hw/xfree86/parser/Screen.c               |  101 ----
 hw/xfree86/parser/Vendor.c               |   29 -
 hw/xfree86/parser/Video.c                |   37 --
 hw/xfree86/parser/configProcs.h          |   10 -
 hw/xfree86/parser/write.c                |  218 --------
 hw/xfree86/parser/xf86Parser.h           |    1 -
 24 files changed, 6 insertions(+), 1700 deletions(-)
 delete mode 100644 hw/xfree86/common/xf86Configure.c
 delete mode 100644 hw/xfree86/parser/write.c

diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index fbd052c..0b0f582 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -32,7 +32,7 @@ xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
 BUILT_SOURCES = xf86DefModeSet.c
 
 AM_LDFLAGS = -r
-libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \
+libcommon_la_SOURCES = xf86ShowOpts.c xf86Bus.c xf86Config.c \
                       xf86Cursor.c $(DGASOURCES) xf86DPMS.c \
                       xf86Events.c xf86Globals.c xf86AutoConfig.c \
                       xf86Option.c xf86Init.c \
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index f863840..21d58e8 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -54,10 +54,8 @@
 #include "propertyst.h"
 
 /* General parameters */
-extern _X_EXPORT int xf86DoConfigure;
 extern _X_EXPORT int xf86DoShowOptions;
 extern _X_EXPORT Bool xf86DoModalias;
-extern _X_EXPORT Bool xf86DoConfigurePass1;
 extern _X_EXPORT DevPrivateKey xf86ScreenKey;
 extern _X_EXPORT DevPrivateKey xf86CreateRootWindowKey;
 extern _X_EXPORT DevPrivateKey xf86PixmapKey;
@@ -151,10 +149,6 @@ extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex);
 extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void);
 extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
 
-/* xf86Configure.c */
-extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
-				    void *busData, int chipset);
-
 /* xf86Cursor.c */
 
 extern _X_EXPORT void xf86LockZoom(ScreenPtr pScreen, int lock);
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
deleted file mode 100644
index 307e0c4..0000000
--- a/hw/xfree86/common/xf86Configure.c
+++ /dev/null
@@ -1,875 +0,0 @@
-/*
- * Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Alan Hourihane makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Author:  Alan Hourihane, alanh at fairlite.demon.co.uk
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <X11/X.h>
-#include <X11/Xmd.h>
-#include <pciaccess.h>
-#include "Pci.h"
-#include "os.h"
-#include "loaderProcs.h"
-#include "xf86.h"
-#include "xf86Config.h"
-#include "xf86_OSlib.h"
-#include "xf86Priv.h"
-#define IN_XSERVER
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-#include "vbe.h"
-#include "xf86DDC.h"
-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
-#include "xf86Bus.h"
-#include "xf86Sbus.h"
-#endif
-#include "globals.h"
-
-typedef struct _DevToConfig {
-    GDevRec GDev;
-    struct pci_device * pVideo;
-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
-    sbusDevicePtr sVideo;
-#endif
-    int iDriver;
-} DevToConfigRec, *DevToConfigPtr;
-
-static DevToConfigPtr DevToConfig = NULL;
-static int nDevToConfig = 0, CurrentDriver;
-
-xf86MonPtr ConfiguredMonitor;
-Bool xf86DoConfigurePass1 = TRUE;
-static Bool foundMouse = FALSE;
-
-#if defined(__SCO__)
-static char *DFLT_MOUSE_PROTO = "OSMouse";
-#elif defined(__UNIXWARE__)
-static char *DFLT_MOUSE_PROTO = "OSMouse";
-static char *DFLT_MOUSE_DEV = "/dev/mouse";
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-static char *DFLT_MOUSE_DEV = "/dev/sysmouse";
-static char *DFLT_MOUSE_PROTO = "auto";
-#elif defined(linux)
-static char DFLT_MOUSE_DEV[] = "/dev/input/mice";
-static char DFLT_MOUSE_PROTO[] = "auto";
-#else
-static char *DFLT_MOUSE_DEV = "/dev/mouse";
-static char *DFLT_MOUSE_PROTO = "auto";
-#endif
-
-/*
- * This is called by the driver, either through xf86Match???Instances() or
- * directly.  We allocate a GDevRec and fill it in as much as we can, letting
- * the caller fill in the rest and/or change it as it sees fit.
- */
-GDevPtr
-xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset)
-{
-    int i, j;
-    struct pci_device * pVideo = NULL;
-    Bool isPrimary = FALSE;
-
-    if (xf86DoProbe || !xf86DoConfigure || !xf86DoConfigurePass1)
-	return NULL;
-
-    /* Check for duplicates */
-    switch (bus) {
-    case BUS_PCI:
-	pVideo = (struct pci_device *) busData;
-	for (i = 0;  i < nDevToConfig;  i++)
-	    if (DevToConfig[i].pVideo &&
-		(DevToConfig[i].pVideo->domain == pVideo->domain) &&
-		(DevToConfig[i].pVideo->bus == pVideo->bus) &&
-		(DevToConfig[i].pVideo->dev == pVideo->dev) &&
-		(DevToConfig[i].pVideo->func == pVideo->func))
-		return NULL;
-	isPrimary = xf86IsPrimaryPci(pVideo);
-	break;
-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
-    case BUS_SBUS:
-	for (i = 0;  i < nDevToConfig;  i++)
-	    if (DevToConfig[i].sVideo &&
-		DevToConfig[i].sVideo->fbNum == ((sbusDevicePtr) busData)->fbNum)
-		return NULL;
-	break;
-#endif
-    default:
-	return NULL;
-    }
-
-    /* Allocate new structure occurrence */
-    i = nDevToConfig++;
-    DevToConfig =
-	xnfrealloc(DevToConfig, nDevToConfig * sizeof(DevToConfigRec));
-#if 1   /* Doesn't work when a driver detects more than one adapter */
-    if ((i > 0) && isPrimary) {
-        memmove(DevToConfig + 1,DevToConfig,
-		(nDevToConfig - 1) * sizeof(DevToConfigRec));
-	i = 0;
-    } 
-#endif
-    memset(DevToConfig + i, 0, sizeof(DevToConfigRec));
-
-#   define NewDevice DevToConfig[i]
-
-    NewDevice.GDev.chipID = NewDevice.GDev.chipRev = NewDevice.GDev.irq = -1;
-
-    NewDevice.iDriver = CurrentDriver;
-
-    /* Fill in what we know, converting the driver name to lower case */
-    NewDevice.GDev.driver = xnfalloc(strlen(driver) + 1);
-    for (j = 0;  (NewDevice.GDev.driver[j] = tolower(driver[j]));  j++);
-
-    switch (bus) {
-    case BUS_PCI: {
-	const char *VendorName;
-	const char *CardName;
-	char busnum[8];
-
-	NewDevice.pVideo = pVideo;
-
-	VendorName = pci_device_get_vendor_name( pVideo );
-	CardName = pci_device_get_device_name( pVideo );
-
-	if (!VendorName) {
-	    VendorName = xnfalloc(15);
-	    sprintf((char*)VendorName, "Unknown Vendor");
-	}
-
-	if (!CardName) {
-	    CardName = xnfalloc(14);
-	    sprintf((char*)CardName, "Unknown Board");
-	}
-
-	NewDevice.GDev.identifier =
-	    xnfalloc(strlen(VendorName) + strlen(CardName) + 2);
-	sprintf(NewDevice.GDev.identifier, "%s %s", VendorName, CardName);
-
-	NewDevice.GDev.vendor = (char *)VendorName;
-	NewDevice.GDev.board = (char *)CardName;
-
-	NewDevice.GDev.busID = xnfalloc(16);
-	xf86FormatPciBusNumber(pVideo->bus, busnum);
-	sprintf(NewDevice.GDev.busID, "PCI:%s:%d:%d",
-	    busnum, pVideo->dev, pVideo->func);
-
-	NewDevice.GDev.chipID = pVideo->device_id;
-	NewDevice.GDev.chipRev = pVideo->revision;
-
-	if (chipset < 0)
-	    chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
-	}
-	break;
-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
-    case BUS_SBUS: {
-	char *promPath = NULL;
-	NewDevice.sVideo = (sbusDevicePtr) busData;
-	NewDevice.GDev.identifier = NewDevice.sVideo->descr;
-	if (sparcPromInit() >= 0) {
-	    promPath = sparcPromNode2Pathname(&NewDevice.sVideo->node);
-	    sparcPromClose();
-	}
-	if (promPath) {
-	    NewDevice.GDev.busID = xnfalloc(strlen(promPath) + 6);
-	    sprintf(NewDevice.GDev.busID, "SBUS:%s", promPath);
-	    xfree(promPath);
-	} else {
-	    NewDevice.GDev.busID = xnfalloc(12);
-	    sprintf(NewDevice.GDev.busID, "SBUS:fb%d", NewDevice.sVideo->fbNum);
-	}
-	}
-	break;
-#endif
-    default:
-	break;
-    }
-
-    /* Get driver's available options */
-    if (xf86DriverList[CurrentDriver]->AvailableOptions)
-	NewDevice.GDev.options = (OptionInfoPtr)
-	    (*xf86DriverList[CurrentDriver]->AvailableOptions)(chipset,
-							       bus);
-
-    return &NewDevice.GDev;
-
-#   undef NewDevice
-}
-
-static XF86ConfInputPtr
-configureInputSection (void)
-{
-    XF86ConfInputPtr mouse = NULL;
-    parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
-
-    ptr->inp_identifier = "Keyboard0";
-    ptr->inp_driver = "kbd";
-    ptr->list.next = NULL;
-
-    /* Crude mechanism to auto-detect mouse (os dependent) */
-    { 
-	int fd;
-#ifdef WSCONS_SUPPORT
-	fd = open("/dev/wsmouse", 0);
-	if (fd > 0) {
-	    DFLT_MOUSE_DEV = "/dev/wsmouse";
-	    DFLT_MOUSE_PROTO = "wsmouse";
-	    close(fd);
-	} else {
-	    ErrorF("cannot open /dev/wsmouse\n");
-	}
-#endif
-
-#ifndef __SCO__
-	fd = open(DFLT_MOUSE_DEV, 0);
-	if (fd != -1) {
-	    foundMouse = TRUE;
-	    close(fd);
-	}
-#else
-	foundMouse = TRUE;
-#endif
-    }
-
-    mouse = calloc(1, sizeof(XF86ConfInputRec));
-    mouse->inp_identifier = "Mouse0";
-    mouse->inp_driver = "mouse";
-    mouse->inp_option_lst = 
-		xf86addNewOption(mouse->inp_option_lst, xstrdup("Protocol"),
-				xstrdup(DFLT_MOUSE_PROTO));
-#ifndef __SCO__
-    mouse->inp_option_lst = 
-		xf86addNewOption(mouse->inp_option_lst, xstrdup("Device"),
-				xstrdup(DFLT_MOUSE_DEV));
-#endif
-    mouse->inp_option_lst = 
-		xf86addNewOption(mouse->inp_option_lst, xstrdup("ZAxisMapping"),
-				xstrdup("4 5 6 7"));
-    ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse);
-    return ptr;
-}
-
-static XF86ConfScreenPtr
-configureScreenSection (int screennum)
-{
-    int i;
-    int depths[] = { 1, 4, 8, 15, 16, 24/*, 32*/ };
-    parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec)
-
-    ptr->scrn_identifier = malloc(18);
-    sprintf(ptr->scrn_identifier, "Screen%d", screennum);
-    ptr->scrn_monitor_str = malloc(19);
-    sprintf(ptr->scrn_monitor_str, "Monitor%d", screennum);
-    ptr->scrn_device_str = malloc(16);
-    sprintf(ptr->scrn_device_str, "Card%d", screennum);
-
-    for (i=0; i<sizeof(depths)/sizeof(depths[0]); i++)
-    {
-	XF86ConfDisplayPtr display;
-
-	display = calloc(1, sizeof(XF86ConfDisplayRec));
-	display->disp_depth = depths[i];
-	display->disp_black.red = display->disp_white.red = -1;
-	display->disp_black.green = display->disp_white.green = -1;
-	display->disp_black.blue = display->disp_white.blue = -1;
-	ptr->scrn_display_lst = (XF86ConfDisplayPtr)xf86addListItem(
-				     (glp)ptr->scrn_display_lst, (glp)display);
-    }
-
-    return ptr;
-}
-
-static const char* 
-optionTypeToSting(OptionValueType type)
-{
-    switch (type) {
-    case OPTV_NONE:
-        return "";
-    case OPTV_INTEGER:
-        return "<i>";
-    case OPTV_STRING:
-        return "<str>";
-    case OPTV_ANYSTR:
-       return "[<str>]";
-    case OPTV_REAL:
-        return "<f>";
-    case OPTV_BOOLEAN:
-        return "[<bool>]";
-    case OPTV_FREQ:
-        return "<freq>";
-    default:
-        return "";
-    }
-}
-
-static XF86ConfDevicePtr
-configureDeviceSection (int screennum)
-{
-    char identifier[16];
-    OptionInfoPtr p;
-    int i = 0;
-    parsePrologue (XF86ConfDevicePtr, XF86ConfDeviceRec)
-
-    /* Move device info to parser structure */
-    sprintf(identifier, "Card%d", screennum);
-    ptr->dev_identifier = strdup(identifier);
-/*    ptr->dev_identifier = DevToConfig[screennum].GDev.identifier;*/
-    ptr->dev_vendor = DevToConfig[screennum].GDev.vendor;
-    ptr->dev_board = DevToConfig[screennum].GDev.board;
-    ptr->dev_chipset = DevToConfig[screennum].GDev.chipset;
-    ptr->dev_busid = DevToConfig[screennum].GDev.busID;
-    ptr->dev_driver = DevToConfig[screennum].GDev.driver;
-    ptr->dev_ramdac = DevToConfig[screennum].GDev.ramdac;
-    for (i = 0;  (i < MAXDACSPEEDS) && (i < CONF_MAXDACSPEEDS);  i++)
-        ptr->dev_dacSpeeds[i] = DevToConfig[screennum].GDev.dacSpeeds[i];
-    ptr->dev_videoram = DevToConfig[screennum].GDev.videoRam;
-    ptr->dev_textclockfreq = DevToConfig[screennum].GDev.textClockFreq;
-    ptr->dev_bios_base = DevToConfig[screennum].GDev.BiosBase;
-    ptr->dev_mem_base = DevToConfig[screennum].GDev.MemBase;
-    ptr->dev_io_base = DevToConfig[screennum].GDev.IOBase;
-    ptr->dev_clockchip = DevToConfig[screennum].GDev.clockchip;
-    for (i = 0;  (i < MAXCLOCKS) && (i < DevToConfig[screennum].GDev.numclocks);  i++)
-        ptr->dev_clock[i] = DevToConfig[screennum].GDev.clock[i];
-    ptr->dev_clocks = i;
-    ptr->dev_chipid = DevToConfig[screennum].GDev.chipID;
-    ptr->dev_chiprev = DevToConfig[screennum].GDev.chipRev;
-    ptr->dev_irq = DevToConfig[screennum].GDev.irq;
-
-    /* Make sure older drivers don't segv */
-    if (DevToConfig[screennum].GDev.options) {
-    	/* Fill in the available driver options for people to use */
-	const char *descrip =
-	    "        ### Available Driver options are:-\n"
-	    "        ### Values: <i>: integer, <f>: float, "
-			"<bool>: \"True\"/\"False\",\n"
-	    "        ### <string>: \"String\", <freq>: \"<f> Hz/kHz/MHz\"\n"
-	    "        ### [arg]: arg optional\n";
-	ptr->dev_comment = xstrdup(descrip);
-	if (ptr->dev_comment) {
-    	    for (p = DevToConfig[screennum].GDev.options;
-		 p->name != NULL; p++) {
-		char *p_e;
-		const char *prefix = "        #Option     ";
-		const char *middle = " \t# ";
-		const char *suffix = "\n";
-		const char *opttype = optionTypeToSting(p->type);
-		char *optname;
-		int len = strlen(ptr->dev_comment) + strlen(prefix) +
-			  strlen(middle) + strlen(suffix) + 1;
-		
-		optname = xalloc(strlen(p->name) + 2 + 1);
-		if (!optname)
-		    break;
-		sprintf(optname, "\"%s\"", p->name);
-
-		len += max(20, strlen(optname));
-		len += strlen(opttype);
-
-		ptr->dev_comment = xrealloc(ptr->dev_comment, len);
-		if (!ptr->dev_comment)
-		    break;
-		p_e = ptr->dev_comment + strlen(ptr->dev_comment);
-		sprintf(p_e, "%s%-20s%s%s%s", prefix, optname, middle,
-			opttype, suffix);
-		xfree(optname);
-	    }
-    	}
-    }
-
-    return ptr;
-}
-
-static XF86ConfLayoutPtr
-configureLayoutSection (void)
-{
-    int scrnum = 0;
-    parsePrologue (XF86ConfLayoutPtr, XF86ConfLayoutRec)
-
-    ptr->lay_identifier = "X.org Configured";
-
-    {
-	XF86ConfInputrefPtr iptr;
-
-	iptr = malloc (sizeof (XF86ConfInputrefRec));
-	iptr->list.next = NULL;
-	iptr->iref_option_lst = NULL;
-	iptr->iref_inputdev_str = "Mouse0";
-	iptr->iref_option_lst =
-		xf86addNewOption (iptr->iref_option_lst, xstrdup("CorePointer"), NULL);
-	ptr->lay_input_lst = (XF86ConfInputrefPtr)
-		xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
-    }
-
-    {
-	XF86ConfInputrefPtr iptr;
-
-	iptr = malloc (sizeof (XF86ConfInputrefRec));
-	iptr->list.next = NULL;
-	iptr->iref_option_lst = NULL;
-	iptr->iref_inputdev_str = "Keyboard0";
-	iptr->iref_option_lst =
-		xf86addNewOption (iptr->iref_option_lst, xstrdup("CoreKeyboard"), NULL);
-	ptr->lay_input_lst = (XF86ConfInputrefPtr)
-		xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
-    }
-
-    for (scrnum = 0;  scrnum < nDevToConfig;  scrnum++) {
-	XF86ConfAdjacencyPtr aptr;
-
-	aptr = malloc (sizeof (XF86ConfAdjacencyRec));
-	aptr->list.next = NULL;
-	aptr->adj_x = 0;
-	aptr->adj_y = 0;
-	aptr->adj_scrnum = scrnum;
-	aptr->adj_screen_str = xnfalloc(18);
-	sprintf(aptr->adj_screen_str, "Screen%d", scrnum);
-	if (scrnum == 0) {
-	    aptr->adj_where = CONF_ADJ_ABSOLUTE;
-	    aptr->adj_refscreen = NULL;
-	}
-	else {
-	    aptr->adj_where = CONF_ADJ_RIGHTOF;
-	    aptr->adj_refscreen = xnfalloc(18);
-	    sprintf(aptr->adj_refscreen, "Screen%d", scrnum - 1);
-	}
-    	ptr->lay_adjacency_lst =
-	    (XF86ConfAdjacencyPtr)xf86addListItem((glp)ptr->lay_adjacency_lst,
-					      (glp)aptr);
-    }
-
-    return ptr;
-}
-
-static XF86ConfFlagsPtr
-configureFlagsSection (void)
-{
-    parsePrologue (XF86ConfFlagsPtr, XF86ConfFlagsRec)
-
-    return ptr;
-}
-
-static XF86ConfModulePtr
-configureModuleSection (void)
-{
-    char **elist, **el;
-    /* Find the list of extension & font modules. */
-    const char *esubdirs[] = {
-	"extensions",
-	"fonts",
-	NULL
-    };
-    parsePrologue (XF86ConfModulePtr, XF86ConfModuleRec)
-
-    elist = LoaderListDirs(esubdirs, NULL);
-    if (elist) {
-	for (el = elist; *el; el++) {
-	    XF86LoadPtr module;
-
-    	    module = calloc(1, sizeof(XF86LoadRec));
-    	    module->load_name = *el;
-            ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem(
-                                (glp)ptr->mod_load_lst, (glp)module);
-    	}
-	xfree(elist);
-    }
-
-    return ptr;
-}
-
-static XF86ConfFilesPtr
-configureFilesSection (void)
-{
-    parsePrologue (XF86ConfFilesPtr, XF86ConfFilesRec)
-
-   if (xf86ModulePath)
-       ptr->file_modulepath = strdup(xf86ModulePath);
-   if (defaultFontPath)
-       ptr->file_fontpath = strdup(defaultFontPath);
-   
-    return ptr;
-}
-
-static XF86ConfMonitorPtr
-configureMonitorSection (int screennum)
-{
-    parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
-
-    ptr->mon_identifier = malloc(19);
-    sprintf(ptr->mon_identifier, "Monitor%d", screennum);
-    ptr->mon_vendor = strdup("Monitor Vendor");
-    ptr->mon_modelname = strdup("Monitor Model");
-
-    return ptr;
-}
-
-static XF86ConfMonitorPtr
-configureDDCMonitorSection (int screennum)
-{
-    int i = 0;
-    int len, mon_width, mon_height;
-#define displaySizeMaxLen 80
-    char displaySize_string[displaySizeMaxLen];
-    int displaySizeLen;
-
-    parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
-
-    ptr->mon_identifier = malloc(19);
-    sprintf(ptr->mon_identifier, "Monitor%d", screennum);
-    ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name);
-    ptr->mon_modelname = malloc(12);
-    sprintf(ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id);
-
-    /* features in centimetres, we want millimetres */
-    mon_width  = 10 * ConfiguredMonitor->features.hsize ;
-    mon_height = 10 * ConfiguredMonitor->features.vsize ;
-
-#ifdef CONFIGURE_DISPLAYSIZE
-    ptr->mon_width  = mon_width;
-    ptr->mon_height = mon_height;
-#else
-    if (mon_width && mon_height) {
-      /* when values available add DisplaySize option AS A COMMENT */
-
-      displaySizeLen = snprintf(displaySize_string, displaySizeMaxLen,
-				"\t#DisplaySize\t%5d %5d\t# mm\n",
-				mon_width, mon_height);
-
-      if (displaySizeLen>0 && displaySizeLen<displaySizeMaxLen) {
-	if (ptr->mon_comment) {
-	  len = strlen(ptr->mon_comment);
-	} else {
-	  len = 0;
-	}
-	if ((ptr->mon_comment =
-	     realloc(ptr->mon_comment, len+strlen(displaySize_string)))) {
-	  strcpy(ptr->mon_comment + len, displaySize_string);
-	}
-      }
-    }
-#endif /* def CONFIGURE_DISPLAYSIZE */
-
-    for (i=0;i<4;i++) {
-	switch (ConfiguredMonitor->det_mon[i].type) {
-	    case DS_NAME:
-		ptr->mon_modelname  = realloc(ptr->mon_modelname, 
-		  strlen((char*)(ConfiguredMonitor->det_mon[i].section.name))
-		    + 1);
-		strcpy(ptr->mon_modelname,
-		       (char*)(ConfiguredMonitor->det_mon[i].section.name));
-		break;
-	    case DS_RANGES:
-		ptr->mon_hsync[ptr->mon_n_hsync].lo =
-		    ConfiguredMonitor->det_mon[i].section.ranges.min_h;
-		ptr->mon_hsync[ptr->mon_n_hsync].hi =
-		    ConfiguredMonitor->det_mon[i].section.ranges.max_h;
-		ptr->mon_n_vrefresh = 1;
-		ptr->mon_vrefresh[ptr->mon_n_hsync].lo =
-		    ConfiguredMonitor->det_mon[i].section.ranges.min_v;
-		ptr->mon_vrefresh[ptr->mon_n_hsync].hi =
-		    ConfiguredMonitor->det_mon[i].section.ranges.max_v;
-		ptr->mon_n_hsync++;
-	    default:
-		break;
-	}
-    }
-
-    if (ConfiguredMonitor->features.dpms) {
-      ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xstrdup("DPMS"), NULL);
-    }
-
-    return ptr;
-}
-
-#if !defined(PATH_MAX)
-# define PATH_MAX 1024
-#endif
-
-void
-DoConfigure(void)
-{
-    int i,j, screennum = -1;
-    char *home = NULL;
-    char filename[PATH_MAX];
-    char *addslash = "";
-    XF86ConfigPtr xf86config = NULL;
-    char **vlist, **vl;
-    int *dev2screen;
-
-    vlist = xf86DriverlistFromCompile();
-
-    if (!vlist) {
-	ErrorF("Missing output drivers.  Configuration failed.\n");
-	goto bail;
-    }
-
-    ErrorF("List of video drivers:\n");
-    for (vl = vlist; *vl; vl++)
-	ErrorF("\t%s\n", *vl);
-
-    /* Load all the drivers that were found. */
-    xf86LoadModules(vlist, NULL);
-
-    xfree(vlist);
-
-    for (i = 0; i < xf86NumDrivers; i++) {
-	xorgHWFlags flags;
-	if (!xf86DriverList[i]->driverFunc
-	    || !xf86DriverList[i]->driverFunc(NULL,
-					      GET_REQUIRED_HW_INTERFACES,
-					      &flags)
-	    || NEED_IO_ENABLED(flags)) {
-	    xorgHWAccess = TRUE;
-	    break;
-	}
-    }
-    /* Enable full I/O access */
-    if (xorgHWAccess) {
-	if(!xf86EnableIO())
-	    /* oops, we have failed */
-	    xorgHWAccess = FALSE;
-    }
-
-    /* Disable PCI devices */
-    xf86ResourceBrokerInit();
-    xf86AccessInit();
-    xf86FindPrimaryDevice();
- 
-    /* Create XF86Config file structure */
-    xf86config = calloc(1, sizeof(XF86ConfigRec));
-
-    /* Call all of the probe functions, reporting the results. */
-    for (CurrentDriver = 0;  CurrentDriver < xf86NumDrivers;  CurrentDriver++) {
-	xorgHWFlags flags;
-	Bool found_screen;
-	DriverRec * const drv = xf86DriverList[CurrentDriver];
-
-	if (!xorgHWAccess) {
-	    if (!drv->driverFunc
-		|| !drv->driverFunc( NULL, GET_REQUIRED_HW_INTERFACES, &flags )
-		|| NEED_IO_ENABLED(flags)) 
-		continue;
-	}
-	
-	found_screen = xf86CallDriverProbe( drv, TRUE );
-	if ( found_screen && drv->Identify ) {
-	    (*drv->Identify)(0);
-	}
-    }
-
-    if (nDevToConfig <= 0) {
-	ErrorF("No devices to configure.  Configuration failed.\n");
-	goto bail;
-    }
-
-    /* Add device, monitor and screen sections for detected devices */
-    for (screennum = 0;  screennum < nDevToConfig;  screennum++) {
-    	XF86ConfDevicePtr DevicePtr;
-	XF86ConfMonitorPtr MonitorPtr;
-	XF86ConfScreenPtr ScreenPtr;
-
-	DevicePtr = configureDeviceSection(screennum);
-    	xf86config->conf_device_lst = (XF86ConfDevicePtr)xf86addListItem(
-			    (glp)xf86config->conf_device_lst, (glp)DevicePtr);
-	MonitorPtr = configureMonitorSection(screennum);
-    	xf86config->conf_monitor_lst = (XF86ConfMonitorPtr)xf86addListItem(
-			    (glp)xf86config->conf_monitor_lst, (glp)MonitorPtr);
-	ScreenPtr = configureScreenSection(screennum);
-    	xf86config->conf_screen_lst = (XF86ConfScreenPtr)xf86addListItem(
-			    (glp)xf86config->conf_screen_lst, (glp)ScreenPtr);
-    }
-
-    xf86config->conf_files = configureFilesSection();
-    xf86config->conf_modules = configureModuleSection();
-    xf86config->conf_flags = configureFlagsSection();
-    xf86config->conf_videoadaptor_lst = NULL;
-    xf86config->conf_modes_lst = NULL;
-    xf86config->conf_vendor_lst = NULL;
-    xf86config->conf_dri = NULL;
-    xf86config->conf_input_lst = configureInputSection();
-    xf86config->conf_layout_lst = configureLayoutSection();
-
-    home = getenv("HOME");
-    if ((home == NULL) || (home[0] == '\0')) {
-    	home = "/";
-    } else {
-	/* Determine if trailing slash is present or needed */
-	int l = strlen(home);
-
-	if (home[l-1] != '/') {
-	    addslash = "/";
-	}
-    }
-
-    snprintf(filename, sizeof(filename), "%s%s" XF86CONFIGFILE ".new",
-	     home, addslash);
-
-    if (xf86writeConfigFile(filename, xf86config) == 0) {
-	xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n",
-		filename, strerror(errno));
-	goto bail;
-    }
-
-    xf86DoConfigurePass1 = FALSE;
-    /* Try to get DDC information filled in */
-    xf86ConfigFile = filename;
-    if (xf86HandleConfigFile(FALSE) != CONFIG_OK) {
-	goto bail;
-    }
-
-    xf86DoConfigurePass1 = FALSE;
-    
-    dev2screen = xnfcalloc(1,xf86NumDrivers*sizeof(int));
-
-    {
-	Bool *driverProbed = xnfcalloc(1,xf86NumDrivers*sizeof(Bool));
-	for (screennum = 0;  screennum < nDevToConfig;  screennum++) {
-	    int k,l,n,oldNumScreens;
-
-	    i = DevToConfig[screennum].iDriver;
-
-	    if (driverProbed[i]) continue;
-	    driverProbed[i] = TRUE;
-	    
-	    oldNumScreens = xf86NumScreens;
-
-	    xf86CallDriverProbe( xf86DriverList[i], FALSE );
-
-	    /* reorder */
-	    k = screennum > 0 ? screennum : 1;
-	    for (l = oldNumScreens; l < xf86NumScreens; l++) {
-	        /* is screen primary? */
-	        Bool primary = FALSE;
-		for (n = 0; n<xf86Screens[l]->numEntities; n++) {
-	            if (xf86IsEntityPrimary(xf86Screens[l]->entityList[n])) {
-		        dev2screen[0] = l;
-			primary = TRUE;
-			break;
-		    }
-		}
-		if (primary) continue;
-		/* not primary: assign it to next device of same driver */
-		/* 
-		 * NOTE: we assume that devices in DevToConfig 
-		 * and xf86Screens[] have the same order except
-		 * for the primary device which always comes first.
-		 */
-		for (; k < nDevToConfig; k++) {
-		    if (DevToConfig[k].iDriver == i) {
-		        dev2screen[k++] = l;
-			break;
-		    }
-		}
-	    }
-	}
-	xfree(driverProbed);
-    }
-    
-
-    if (nDevToConfig != xf86NumScreens) {
-	ErrorF("Number of created screens does not match number of detected"
-	       " devices.\n  Configuration failed.\n");
-	goto bail;
-    }
-
-    xf86PostProbe();
-    xf86EntityInit();
-
-    for (j = 0; j < xf86NumScreens; j++) {
-	xf86Screens[j]->scrnIndex = j;
-    }
-
-    xf86freeMonitorList(xf86config->conf_monitor_lst);
-    xf86config->conf_monitor_lst = NULL;
-    xf86freeScreenList(xf86config->conf_screen_lst);
-    xf86config->conf_screen_lst = NULL;
-    for (j = 0; j < xf86NumScreens; j++) {
-	XF86ConfMonitorPtr MonitorPtr;
-	XF86ConfScreenPtr ScreenPtr;
-
-	ConfiguredMonitor = NULL;
-
-	xf86EnableAccess(xf86Screens[dev2screen[j]]);
-	if ((*xf86Screens[dev2screen[j]]->PreInit)(xf86Screens[dev2screen[j]], 
-						   PROBE_DETECT) &&
-	    ConfiguredMonitor) {
-	    MonitorPtr = configureDDCMonitorSection(j);
-	} else {
-	    MonitorPtr = configureMonitorSection(j);
-	}
-	ScreenPtr = configureScreenSection(j);
-	xf86config->conf_monitor_lst = (XF86ConfMonitorPtr)xf86addListItem(
-		(glp)xf86config->conf_monitor_lst, (glp)MonitorPtr);
-	xf86config->conf_screen_lst = (XF86ConfScreenPtr)xf86addListItem(
-		(glp)xf86config->conf_screen_lst, (glp)ScreenPtr);
-    }
-
-    if (xf86writeConfigFile(filename, xf86config) == 0) {
-	xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n",
-		filename, strerror(errno));
-	goto bail;
-    }
-
-    ErrorF("\n");
-
-#ifdef __SCO__
-    ErrorF("\n"__XSERVERNAME__
-	   " is using the kernel event driver to access the mouse.\n"
-	    "If you wish to use the internal "__XSERVERNAME__
-	   " mouse drivers, please\n"
-	    "edit the file and correct the Device.\n");
-#else /* !__SCO__ */
-    if (!foundMouse) {
-	ErrorF("\n"__XSERVERNAME__" is not able to detect your mouse.\n"
-		"Edit the file and correct the Device.\n");
-    } else {
-	ErrorF("\n"__XSERVERNAME__" detected your mouse at device %s.\n"
-		"Please check your config if the mouse is still not\n"
-		"operational, as by default "__XSERVERNAME__
-	       " tries to autodetect\n"
-		"the protocol.\n",DFLT_MOUSE_DEV);
-    }
-#endif /* !__SCO__ */
-
-    if (xf86NumScreens > 1) {
-	ErrorF("\n"__XSERVERNAME__
-	       " has configured a multihead system, please check your config.\n");
-    }
-
-    ErrorF("\nYour %s file is %s\n\n", XF86CONFIGFILE ,filename);
-    ErrorF("To test the server, run 'X -config %s'\n\n", filename);
-
-bail:
-    OsCleanup(TRUE);
-    AbortDDX();
-    fflush(stderr);
-    exit(0);
-}
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 7bcbc94..c28de31 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -151,7 +151,6 @@ XF86ConfigPtr xf86configptr = NULL;
 Bool xf86Resetting = FALSE;
 Bool xf86Initialising = FALSE;
 Bool xf86DoProbe = FALSE;
-Bool xf86DoConfigure = FALSE;
 Bool xf86DoShowOptions = FALSE;
 Bool xf86DoModalias = FALSE;
 DriverPtr *xf86DriverList = NULL;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index eac819b..069eba8 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1464,8 +1464,6 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
 
     if (xf86DoProbe) return 1;
 
-    if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
-
     /*
      * This is a very important function that matches the device sections
      * as they show up in the config file with the drivers that the server
@@ -1609,7 +1607,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
      * Do this calculation and memory allocation once now to eliminate the
      * need for realloc calls inside the loop.
      */
-    if ( !xf86DoProbe && !(xf86DoConfigure && xf86DoConfigurePass1) ) {
+    if ( !xf86DoProbe ) {
 	unsigned max_entries = numDevs;
 
 	iter = pci_slot_match_iterator_create(NULL);
@@ -1672,28 +1670,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
 			instances[allocatedInstances - 1].chip = id->numChipset;
 		    }
 
-
-		    if ( xf86DoConfigure && xf86DoConfigurePass1 ) {
-			if (xf86CheckPciSlot(pPci)) {
-			    GDevPtr pGDev = 
-			      xf86AddBusDeviceToConfigure(drvp->driverName,
-							  BUS_PCI, pPci, -1);
-			    if (pGDev) {
-				/* After configure pass 1, chipID and chipRev
-				 * are treated as over-rides, so clobber them
-				 * here.
-				 */
-				pGDev->chipID = -1;
-				pGDev->chipRev = -1;
-			    }
-
-			    numFound++;
-			}
-		    }
-		    else {
 			numFound++;
-		    }
-
 		    break;
 		}
 	    }
@@ -2140,7 +2117,7 @@ xf86ServerIsInitialising(void)
 Bool
 xf86ServerIsOnlyDetecting(void)
 {
-    return xf86DoProbe || xf86DoConfigure;
+    return xf86DoProbe;
 }
 
 
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index e77ffab..2102cb4 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -92,7 +92,6 @@
 
 /* forward declarations */
 static Bool probe_devices_from_device_sections(DriverPtr drvp);
-static Bool add_matching_devices_to_configure_list(DriverPtr drvp);
 static Bool check_for_matching_devices(DriverPtr drvp);
 
 #ifdef XF86PM
@@ -508,53 +507,6 @@ probe_devices_from_device_sections(DriverPtr drvp)
     return foundScreen;
 }
 
-
-Bool
-add_matching_devices_to_configure_list(DriverPtr drvp)
-{
-    const struct pci_id_match * const devices = drvp->supported_devices;
-    int j;
-    struct pci_device *pPci;
-    struct pci_device_iterator *iter;
-    int numFound = 0;
-
-
-    iter = pci_id_match_iterator_create(NULL);
-    while ((pPci = pci_device_next(iter)) != NULL) {
-	/* Determine if this device is supported by the driver.  If it is,
-	 * add it to the list of devices to configure.
-	 */
-	for (j = 0 ; ! END_OF_MATCHES(devices[j]) ; j++) {
-	    if ( PCI_ID_COMPARE( devices[j].vendor_id, pPci->vendor_id )
-		 && PCI_ID_COMPARE( devices[j].device_id, pPci->device_id )
-		 && ((devices[j].device_class_mask & pPci->device_class)
-		     == devices[j].device_class) ) {
-		if (xf86CheckPciSlot(pPci)) {
-		    GDevPtr pGDev = xf86AddBusDeviceToConfigure(
-					drvp->driverName, BUS_PCI, pPci, -1);
-		    if (pGDev != NULL) {
-			/* After configure pass 1, chipID and chipRev are
-			 * treated as over-rides, so clobber them here.
-			 */
-			pGDev->chipID = -1;
-			pGDev->chipRev = -1;
-		    }
-
-		    numFound++;
-		}
-
-		break;
-	    }
-	}
-    }
-
-    pci_iterator_destroy(iter);
-
-
-    return (numFound != 0);
-}
-
-
 Bool
 check_for_matching_devices(DriverPtr drvp)
 {
@@ -605,10 +557,6 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
 	    assert( detect_only );
 	    foundScreen = check_for_matching_devices( drv );
 	}
-	else if ( xf86DoConfigure && xf86DoConfigurePass1 ) {
-	    assert( detect_only );
-	    foundScreen = add_matching_devices_to_configure_list( drv );
-	}
 	else {
 	    assert( ! detect_only );
 	    foundScreen = probe_devices_from_device_sections( drv );
@@ -739,7 +687,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     }
 
     /* Read and parse the config file */
-    if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias && !xf86DoShowOptions) {
+    if (!xf86DoProbe && !xf86DoModalias && !xf86DoShowOptions) {
       switch (xf86HandleConfigFile(FALSE)) {
       case CONFIG_OK:
 	break;
@@ -775,9 +723,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     if (xf86DoProbe)
 	DoProbe();
 
-    if (xf86DoConfigure)
-	DoConfigure();
-
     /* Do the PCI Access dump */
     if (xf86DoModalias)
         DoModalias();
@@ -1782,16 +1727,6 @@ ddxProcessArgument(int argc, char **argv, int i)
     xf86DoProbe = TRUE;
     return 1;
   }
-  if (!strcmp(argv[i], "-configure"))
-  {
-    if (getuid() != 0 && geteuid() == 0) {
-	ErrorF("The '-configure' option can only be used by root.\n");
-	exit(1);
-    }
-    xf86DoConfigure = TRUE;
-    xf86AllowMouseOpenFail = TRUE;
-    return 1;
-  }
   if (!strcmp(argv[i], "-modalias"))
   {
     xf86DoModalias = TRUE;
@@ -1851,7 +1786,6 @@ ddxUseMsg(void)
   {
     ErrorF("-modulepath paths      specify the module search path\n");
     ErrorF("-logfile file          specify a log file name\n");
-    ErrorF("-configure             probe for devices and write an "__XCONFIGFILE__"\n");
     ErrorF("-showopts              print available options for all installed drivers\n");
   }
   ErrorF("-modalias              output a modalias-style filter for each driver installed\n");
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index f4ed8c0..37f0f8a 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -138,9 +138,6 @@ extern _X_EXPORT Bool xf86PathIsSafe(const char *path);
 extern _X_EXPORT const DisplayModeRec xf86DefaultModes[];
 extern _X_EXPORT const int xf86NumDefaultModes;
 
-/* xf86Configure.c */
-extern _X_EXPORT void DoConfigure(void);
-
 /* xf86ShowOpts.c */
 extern _X_EXPORT void DoShowOptions(void);
 
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index 4936e75..f8b2ac1 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -414,27 +414,6 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
     if (sparcPromInit() >= 0)
 	useProm = 1;
 
-    if (xf86DoConfigure && xf86DoConfigurePass1) {
-	GDevPtr pGDev;
-	int actualcards = 0;
-	for (i = 0; i < allocatedInstances; i++) {
-	    actualcards++;
-	    pGDev = xf86AddBusDeviceToConfigure(drvp->driverName, BUS_SBUS,
-						instances[i].sbus, -1);
-	    if (pGDev) {
-		/*
-		 * XF86Match???Instances() treat chipID and chipRev as
-		 * overrides, so clobber them here.
-		 */
-		pGDev->chipID = pGDev->chipRev = -1;
-	    }
-	}
-	xfree(instances);
-	if (useProm)
-	    sparcPromClose();
-	return actualcards;
-    }
-
     DebugF("%s instances found: %d\n", driverName, allocatedInstances);
 
     for (i = 0; i < allocatedInstances; i++) {
diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
index 42ee9d1..9cf4cd7 100644
--- a/hw/xfree86/ddc/edid.h
+++ b/hw/xfree86/ddc/edid.h
@@ -553,6 +553,6 @@ typedef struct {
   Uchar *rawData;
 } xf86Monitor, *xf86MonPtr;
 
-extern _X_EXPORT xf86MonPtr ConfiguredMonitor;
+_X_EXPORT xf86MonPtr ConfiguredMonitor;
 
 #endif /* _EDID_H_ */
diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre
index e0db086..f207e9d 100644
--- a/hw/xfree86/doc/man/Xorg.man.pre
+++ b/hw/xfree86/doc/man/Xorg.man.pre
@@ -176,16 +176,6 @@ This option will work for any file when the server is run as root (i.e,
 with real-uid 0), or for files relative to a directory in the config
 search path for all other users.
 .TP 8
-.B \-configure
-When this option is specified, the
-.B __xservername__
-server loads all video driver modules, probes for available hardware,
-and writes out an initial __xconfigfile__(__filemansuffix__) file based on
-what was detected.  This option currently has some problems on some
-platforms, but in most cases it is a good way to bootstrap the
-configuration process.  This option is only available when the server
-is run as root (i.e, with real-uid 0).
-.TP 8
 .BI "\-crt /dev/tty" XX
 SCO only.  This is the same as the
 .B vt
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
index 795b0c1..f70fca9 100644
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -218,7 +218,7 @@ xf86CloseConsole(void)
 
 #if !defined(__i386__) && !defined(__i386) && !defined(__x86)
 
-    if (!xf86DoProbe && !xf86DoConfigure) {
+    if (!xf86DoProbe) {
 	int fd;
 
 	/*
diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c
index 12b8d1d..ad31e02 100644
--- a/hw/xfree86/parser/DRI.c
+++ b/hw/xfree86/parser/DRI.c
@@ -147,35 +147,6 @@ xf86parseDRISection (void)
 #undef CLEANUP
 
 void
-xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr)
-{
-    XF86ConfBuffersPtr bufs;
-    
-    if (ptr == NULL)
-	return;
-    
-    fprintf (cf, "Section \"DRI\"\n");
-    if (ptr->dri_comment)
-	fprintf (cf, "%s", ptr->dri_comment);
-    if (ptr->dri_group_name)
-	fprintf (cf, "\tGroup        \"%s\"\n", ptr->dri_group_name);
-    else if (ptr->dri_group >= 0)
-	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");
-}
-
-void
 xf86freeDRI (XF86ConfDRIPtr ptr)
 {
     if (ptr == NULL)
diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c
index 47ece07..799e250 100644
--- a/hw/xfree86/parser/Device.c
+++ b/hw/xfree86/parser/Device.c
@@ -266,74 +266,6 @@ xf86parseDeviceSection (void)
 #undef CLEANUP
 
 void
-xf86printDeviceSection (FILE * cf, XF86ConfDevicePtr ptr)
-{
-	int i;
-
-	while (ptr)
-	{
-		fprintf (cf, "Section \"Device\"\n");
-		if (ptr->dev_comment)
-			fprintf (cf, "%s", ptr->dev_comment);
-		if (ptr->dev_identifier)
-			fprintf (cf, "\tIdentifier  \"%s\"\n", ptr->dev_identifier);
-		if (ptr->dev_driver)
-			fprintf (cf, "\tDriver      \"%s\"\n", ptr->dev_driver);
-		if (ptr->dev_vendor)
-			fprintf (cf, "\tVendorName  \"%s\"\n", ptr->dev_vendor);
-		if (ptr->dev_board)
-			fprintf (cf, "\tBoardName   \"%s\"\n", ptr->dev_board);
-		if (ptr->dev_chipset)
-			fprintf (cf, "\tChipSet     \"%s\"\n", ptr->dev_chipset);
-		if (ptr->dev_card)
-			fprintf (cf, "\tCard        \"%s\"\n", ptr->dev_card);
-		if (ptr->dev_ramdac)
-			fprintf (cf, "\tRamDac      \"%s\"\n", ptr->dev_ramdac);
-		if (ptr->dev_dacSpeeds[0] > 0 ) {
-			fprintf (cf, "\tDacSpeed    ");
-			for (i = 0; i < CONF_MAXDACSPEEDS
-					&& ptr->dev_dacSpeeds[i] > 0; i++ )
-				fprintf (cf, "%g ", (double) (ptr->dev_dacSpeeds[i])/ 1000.0 );
-			fprintf (cf, "\n");
-		}
-		if (ptr->dev_videoram)
-			fprintf (cf, "\tVideoRam    %d\n", ptr->dev_videoram);
-		if (ptr->dev_bios_base)
-			fprintf (cf, "\tBiosBase    0x%lx\n", ptr->dev_bios_base);
-		if (ptr->dev_mem_base)
-			fprintf (cf, "\tMemBase     0x%lx\n", ptr->dev_mem_base);
-		if (ptr->dev_io_base)
-			fprintf (cf, "\tIOBase      0x%lx\n", ptr->dev_io_base);
-		if (ptr->dev_clockchip)
-			fprintf (cf, "\tClockChip   \"%s\"\n", ptr->dev_clockchip);
-		if (ptr->dev_chipid != -1)
-			fprintf (cf, "\tChipId      0x%x\n", ptr->dev_chipid);
-		if (ptr->dev_chiprev != -1)
-			fprintf (cf, "\tChipRev     0x%x\n", ptr->dev_chiprev);
-
-		xf86printOptionList(cf, ptr->dev_option_lst, 1);
-		if (ptr->dev_clocks > 0 ) {
-			fprintf (cf, "\tClocks      ");
-			for (i = 0; i < ptr->dev_clocks; i++ )
-				fprintf (cf, "%.1f ", (double)ptr->dev_clock[i] / 1000.0 );
-			fprintf (cf, "\n");
-		}
-		if (ptr->dev_textclockfreq) {
-			fprintf (cf, "\tTextClockFreq %.1f\n",
-					 (double)ptr->dev_textclockfreq / 1000.0);
-		}
-		if (ptr->dev_busid)
-			fprintf (cf, "\tBusID       \"%s\"\n", ptr->dev_busid);
-		if (ptr->dev_screen > 0)
-			fprintf (cf, "\tScreen      %d\n", ptr->dev_screen);
-		if (ptr->dev_irq >= 0)
-			fprintf (cf, "\tIRQ         %d\n", ptr->dev_irq);
-		fprintf (cf, "EndSection\n\n");
-		ptr = ptr->list.next;
-	}
-}
-
-void
 xf86freeDeviceList (XF86ConfDevicePtr ptr)
 {
 	XF86ConfDevicePtr prev;
diff --git a/hw/xfree86/parser/Extensions.c b/hw/xfree86/parser/Extensions.c
index 4003b52..dfc8fb7 100644
--- a/hw/xfree86/parser/Extensions.c
+++ b/hw/xfree86/parser/Extensions.c
@@ -84,22 +84,6 @@ xf86parseExtensionsSection (void)
 #undef CLEANUP
 
 void
-xf86printExtensionsSection (FILE * cf, XF86ConfExtensionsPtr ptr)
-{
-    XF86OptionPtr p;
-
-    if (ptr == NULL || ptr->ext_option_lst == NULL)
-	return;
-
-    p = ptr->ext_option_lst;
-    fprintf (cf, "Section \"Extensions\"\n");
-    if (ptr->extensions_comment)
-	fprintf (cf, "%s", ptr->extensions_comment);
-    xf86printOptionList(cf, p, 1);
-    fprintf (cf, "EndSection\n\n");
-}
-
-void
 xf86freeExtensions (XF86ConfExtensionsPtr ptr)
 {
     if (ptr == NULL)
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
index 6865d35..b3293b5 100644
--- a/hw/xfree86/parser/Flags.c
+++ b/hw/xfree86/parser/Flags.c
@@ -178,21 +178,6 @@ xf86parseFlagsSection (void)
 
 #undef CLEANUP
 
-void
-xf86printServerFlagsSection (FILE * f, XF86ConfFlagsPtr flags)
-{
-	XF86OptionPtr p;
-
-	if ((!flags) || (!flags->flg_option_lst))
-		return;
-	p = flags->flg_option_lst;
-	fprintf (f, "Section \"ServerFlags\"\n");
-	if (flags->flg_comment)
-		fprintf (f, "%s", flags->flg_comment);
-	xf86printOptionList(f, p, 1);
-	fprintf (f, "EndSection\n\n");
-}
-
 static XF86OptionPtr
 addNewOption2 (XF86OptionPtr head, char *name, char *val, int used)
 {
diff --git a/hw/xfree86/parser/Input.c b/hw/xfree86/parser/Input.c
index 4e3c04e..32bc045 100644
--- a/hw/xfree86/parser/Input.c
+++ b/hw/xfree86/parser/Input.c
@@ -132,24 +132,6 @@ xf86parseInputSection (void)
 #undef CLEANUP
 
 void
-xf86printInputSection (FILE * cf, XF86ConfInputPtr ptr)
-{
-	while (ptr)
-	{
-		fprintf (cf, "Section \"InputDevice\"\n");
-		if (ptr->inp_comment)
-			fprintf (cf, "%s", ptr->inp_comment);
-		if (ptr->inp_identifier)
-			fprintf (cf, "\tIdentifier  \"%s\"\n", ptr->inp_identifier);
-		if (ptr->inp_driver)
-			fprintf (cf, "\tDriver      \"%s\"\n", ptr->inp_driver);
-		xf86printOptionList(cf, ptr->inp_option_lst, 1);
-		fprintf (cf, "EndSection\n\n");
-		ptr = ptr->list.next;
-	}
-}
-
-void
 xf86freeInputList (XF86ConfInputPtr ptr)
 {
 	XF86ConfInputPtr prev;
diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
index c062209..fbf17c9 100644
--- a/hw/xfree86/parser/Makefile.am
+++ b/hw/xfree86/parser/Makefile.am
@@ -21,7 +21,6 @@ libxf86config_la_SOURCES = \
 	Vendor.c \
 	read.c \
 	scan.c \
-	write.c \
 	DRI.c \
 	Extensions.c
 
diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
index 50de091..6704739 100644
--- a/hw/xfree86/parser/Monitor.c
+++ b/hw/xfree86/parser/Monitor.c
@@ -662,152 +662,6 @@ xf86parseModesSection (void)
 #undef CLEANUP
 
 void
-xf86printMonitorSection (FILE * cf, XF86ConfMonitorPtr ptr)
-{
-	int i;
-	XF86ConfModeLinePtr mlptr;
-	XF86ConfModesLinkPtr mptr;
-
-	while (ptr)
-	{
-		mptr = ptr->mon_modes_sect_lst;
-		fprintf (cf, "Section \"Monitor\"\n");
-		if (ptr->mon_comment)
-			fprintf (cf, "%s", ptr->mon_comment);
-		if (ptr->mon_identifier)
-			fprintf (cf, "\tIdentifier   \"%s\"\n", ptr->mon_identifier);
-		if (ptr->mon_vendor)
-			fprintf (cf, "\tVendorName   \"%s\"\n", ptr->mon_vendor);
-		if (ptr->mon_modelname)
-			fprintf (cf, "\tModelName    \"%s\"\n", ptr->mon_modelname);
-		while (mptr) {
-			fprintf (cf, "\tUseModes     \"%s\"\n", mptr->ml_modes_str);
-			mptr = mptr->list.next;
-		}
-		if (ptr->mon_width)
-			fprintf (cf, "\tDisplaySize  %d\t%d\n",
-					 ptr->mon_width,
-					 ptr->mon_height);
-		for (i = 0; i < ptr->mon_n_hsync; i++)
-		{
-			fprintf (cf, "\tHorizSync    %2.1f - %2.1f\n",
-					 ptr->mon_hsync[i].lo,
-					 ptr->mon_hsync[i].hi);
-		}
-		for (i = 0; i < ptr->mon_n_vrefresh; i++)
-		{
-			fprintf (cf, "\tVertRefresh  %2.1f - %2.1f\n",
-					 ptr->mon_vrefresh[i].lo,
-					 ptr->mon_vrefresh[i].hi);
-		}
-		if (ptr->mon_gamma_red) {
-			if (ptr->mon_gamma_red == ptr->mon_gamma_green
-				&& ptr->mon_gamma_red == ptr->mon_gamma_blue)
-			{
-				fprintf (cf, "\tGamma        %.4g\n",
-					ptr->mon_gamma_red);
-			} else {
-				fprintf (cf, "\tGamma        %.4g %.4g %.4g\n",
-					ptr->mon_gamma_red,
-					ptr->mon_gamma_green,
-					ptr->mon_gamma_blue);
-			}
-		}
-		for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next)
-		{
-			fprintf (cf, "\tModeLine     \"%s\" %2.1f ",
-					 mlptr->ml_identifier, mlptr->ml_clock / 1000.0);
-			fprintf (cf, "%d %d %d %d %d %d %d %d",
-					 mlptr->ml_hdisplay, mlptr->ml_hsyncstart,
-					 mlptr->ml_hsyncend, mlptr->ml_htotal,
-					 mlptr->ml_vdisplay, mlptr->ml_vsyncstart,
-					 mlptr->ml_vsyncend, mlptr->ml_vtotal);
-			if (mlptr->ml_flags & XF86CONF_PHSYNC)
-				fprintf (cf, " +hsync");
-			if (mlptr->ml_flags & XF86CONF_NHSYNC)
-				fprintf (cf, " -hsync");
-			if (mlptr->ml_flags & XF86CONF_PVSYNC)
-				fprintf (cf, " +vsync");
-			if (mlptr->ml_flags & XF86CONF_NVSYNC)
-				fprintf (cf, " -vsync");
-			if (mlptr->ml_flags & XF86CONF_INTERLACE)
-				fprintf (cf, " interlace");
-			if (mlptr->ml_flags & XF86CONF_CSYNC)
-				fprintf (cf, " composite");
-			if (mlptr->ml_flags & XF86CONF_PCSYNC)
-				fprintf (cf, " +csync");
-			if (mlptr->ml_flags & XF86CONF_NCSYNC)
-				fprintf (cf, " -csync");
-			if (mlptr->ml_flags & XF86CONF_DBLSCAN)
-				fprintf (cf, " doublescan");
-			if (mlptr->ml_flags & XF86CONF_HSKEW)
-				fprintf (cf, " hskew %d", mlptr->ml_hskew);
-			if (mlptr->ml_flags & XF86CONF_BCAST)
-				fprintf (cf, " bcast");
-			fprintf (cf, "\n");
-		}
-		xf86printOptionList(cf, ptr->mon_option_lst, 1);
-		fprintf (cf, "EndSection\n\n");
-		ptr = ptr->list.next;
-	}
-}
-
-void
-xf86printModesSection (FILE * cf, XF86ConfModesPtr ptr)
-{
-	XF86ConfModeLinePtr mlptr;
-
-	while (ptr)
-	{
-		fprintf (cf, "Section \"Modes\"\n");
-		if (ptr->modes_comment)
-			fprintf (cf, "%s", ptr->modes_comment);
-		if (ptr->modes_identifier)
-			fprintf (cf, "\tIdentifier     \"%s\"\n", ptr->modes_identifier);
-		for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next)
-		{
-			fprintf (cf, "\tModeLine     \"%s\" %2.1f ",
-					 mlptr->ml_identifier, mlptr->ml_clock / 1000.0);
-			fprintf (cf, "%d %d %d %d %d %d %d %d",
-					 mlptr->ml_hdisplay, mlptr->ml_hsyncstart,
-					 mlptr->ml_hsyncend, mlptr->ml_htotal,
-					 mlptr->ml_vdisplay, mlptr->ml_vsyncstart,
-					 mlptr->ml_vsyncend, mlptr->ml_vtotal);
-			if (mlptr->ml_flags & XF86CONF_PHSYNC)
-				fprintf (cf, " +hsync");
-			if (mlptr->ml_flags & XF86CONF_NHSYNC)
-				fprintf (cf, " -hsync");
-			if (mlptr->ml_flags & XF86CONF_PVSYNC)
-				fprintf (cf, " +vsync");
-			if (mlptr->ml_flags & XF86CONF_NVSYNC)
-				fprintf (cf, " -vsync");
-			if (mlptr->ml_flags & XF86CONF_INTERLACE)
-				fprintf (cf, " interlace");
-			if (mlptr->ml_flags & XF86CONF_CSYNC)
-				fprintf (cf, " composite");
-			if (mlptr->ml_flags & XF86CONF_PCSYNC)
-				fprintf (cf, " +csync");
-			if (mlptr->ml_flags & XF86CONF_NCSYNC)
-				fprintf (cf, " -csync");
-			if (mlptr->ml_flags & XF86CONF_DBLSCAN)
-				fprintf (cf, " doublescan");
-			if (mlptr->ml_flags & XF86CONF_HSKEW)
-				fprintf (cf, " hskew %d", mlptr->ml_hskew);
-			if (mlptr->ml_flags & XF86CONF_VSCAN)
-				fprintf (cf, " vscan %d", mlptr->ml_vscan);
-			if (mlptr->ml_flags & XF86CONF_BCAST)
-				fprintf (cf, " bcast");
-			if (mlptr->ml_comment)
-				fprintf (cf, "%s", mlptr->ml_comment);
-			else
-				fprintf (cf, "\n");
-		}
-		fprintf (cf, "EndSection\n\n");
-		ptr = ptr->list.next;
-	}
-}
-
-void
 xf86freeMonitorList (XF86ConfMonitorPtr ptr)
 {
 	XF86ConfMonitorPtr prev;
diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c
index b3b004d..1df707a 100644
--- a/hw/xfree86/parser/Screen.c
+++ b/hw/xfree86/parser/Screen.c
@@ -340,107 +340,6 @@ xf86parseScreenSection (void)
 }
 
 void
-xf86printScreenSection (FILE * cf, XF86ConfScreenPtr ptr)
-{
-	XF86ConfAdaptorLinkPtr aptr;
-	XF86ConfDisplayPtr dptr;
-	XF86ModePtr mptr;
-
-	while (ptr)
-	{
-		fprintf (cf, "Section \"Screen\"\n");
-		if (ptr->scrn_comment)
-			fprintf (cf, "%s", ptr->scrn_comment);
-		if (ptr->scrn_identifier)
-			fprintf (cf, "\tIdentifier \"%s\"\n", ptr->scrn_identifier);
-		if (ptr->scrn_obso_driver)
-			fprintf (cf, "\tDriver     \"%s\"\n", ptr->scrn_obso_driver);
-		if (ptr->scrn_device_str)
-			fprintf (cf, "\tDevice     \"%s\"\n", ptr->scrn_device_str);
-		if (ptr->scrn_monitor_str)
-			fprintf (cf, "\tMonitor    \"%s\"\n", ptr->scrn_monitor_str);
-		if (ptr->scrn_defaultdepth)
-			fprintf (cf, "\tDefaultDepth     %d\n",
-					 ptr->scrn_defaultdepth);
-		if (ptr->scrn_defaultbpp)
-			fprintf (cf, "\tDefaultBPP     %d\n",
-					 ptr->scrn_defaultbpp);
-		if (ptr->scrn_defaultfbbpp)
-			fprintf (cf, "\tDefaultFbBPP     %d\n",
-					 ptr->scrn_defaultfbbpp);
-		xf86printOptionList(cf, ptr->scrn_option_lst, 1);
-		for (aptr = ptr->scrn_adaptor_lst; aptr; aptr = aptr->list.next)
-		{
-			fprintf (cf, "\tVideoAdaptor \"%s\"\n", aptr->al_adaptor_str);
-		}
-		if (ptr->scrn_virtualX && ptr->scrn_virtualY)
-			fprintf (cf, "\tVirtual     %d %d\n",
-				 ptr->scrn_virtualX,
-				 ptr->scrn_virtualY);
-		for (dptr = ptr->scrn_display_lst; dptr; dptr = dptr->list.next)
-		{
-			fprintf (cf, "\tSubSection \"Display\"\n");
-			if (dptr->disp_comment)
-				fprintf (cf, "%s", dptr->disp_comment);
-			if (dptr->disp_frameX0 >= 0 || dptr->disp_frameY0 >= 0)
-			{
-				fprintf (cf, "\t\tViewport   %d %d\n",
-						 dptr->disp_frameX0, dptr->disp_frameY0);
-			}
-			if (dptr->disp_virtualX != 0 || dptr->disp_virtualY != 0)
-			{
-				fprintf (cf, "\t\tVirtual   %d %d\n",
-						 dptr->disp_virtualX, dptr->disp_virtualY);
-			}
-			if (dptr->disp_depth)
-			{
-				fprintf (cf, "\t\tDepth     %d\n", dptr->disp_depth);
-			}
-			if (dptr->disp_bpp)
-			{
-				fprintf (cf, "\t\tFbBPP     %d\n", dptr->disp_bpp);
-			}
-			if (dptr->disp_visual)
-			{
-				fprintf (cf, "\t\tVisual    \"%s\"\n", dptr->disp_visual);
-			}
-			if (dptr->disp_weight.red != 0)
-			{
-				fprintf (cf, "\t\tWeight    %d %d %d\n",
-					 dptr->disp_weight.red, dptr->disp_weight.green, dptr->disp_weight.blue);
-			}
-			if (dptr->disp_black.red != -1)
-			{
-				fprintf (cf, "\t\tBlack     0x%04x 0x%04x 0x%04x\n",
-					  dptr->disp_black.red, dptr->disp_black.green, dptr->disp_black.blue);
-			}
-			if (dptr->disp_white.red != -1)
-			{
-				fprintf (cf, "\t\tWhite     0x%04x 0x%04x 0x%04x\n",
-					  dptr->disp_white.red, dptr->disp_white.green, dptr->disp_white.blue);
-			}
-			if (dptr->disp_mode_lst)
-			{
-				fprintf (cf, "\t\tModes   ");
-			}
-			for (mptr = dptr->disp_mode_lst; mptr; mptr = mptr->list.next)
-			{
-				fprintf (cf, " \"%s\"", mptr->mode_name);
-			}
-			if (dptr->disp_mode_lst)
-			{
-				fprintf (cf, "\n");
-			}
-			xf86printOptionList(cf, dptr->disp_option_lst, 2);
-			fprintf (cf, "\tEndSubSection\n");
-		}
-		fprintf (cf, "EndSection\n\n");
-		ptr = ptr->list.next;
-	}
-
-}
-
-void
 xf86freeScreenList (XF86ConfScreenPtr ptr)
 {
 	XF86ConfScreenPtr prev;
diff --git a/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c
index dce3f1c..891b475 100644
--- a/hw/xfree86/parser/Vendor.c
+++ b/hw/xfree86/parser/Vendor.c
@@ -186,35 +186,6 @@ xf86parseVendorSection (void)
 #undef CLEANUP
 
 void
-xf86printVendorSection (FILE * cf, XF86ConfVendorPtr ptr)
-{
-	XF86ConfVendSubPtr pptr;
-
-	while (ptr)
-	{
-		fprintf (cf, "Section \"Vendor\"\n");
-		if (ptr->vnd_comment)
-			fprintf (cf, "%s", ptr->vnd_comment);
-		if (ptr->vnd_identifier)
-			fprintf (cf, "\tIdentifier     \"%s\"\n", ptr->vnd_identifier);
-
-		xf86printOptionList(cf, ptr->vnd_option_lst, 1);
-		for (pptr = ptr->vnd_sub_lst; pptr; pptr = pptr->list.next)
-		{
-			fprintf (cf, "\tSubSection \"Vendor\"\n");
-			if (pptr->vs_comment)
-				fprintf (cf, "%s", pptr->vs_comment);
-			if (pptr->vs_identifier)
-				fprintf (cf, "\t\tIdentifier \"%s\"\n", pptr->vs_identifier);
-			xf86printOptionList(cf, pptr->vs_option_lst, 2);
-			fprintf (cf, "\tEndSubSection\n");
-		}
-		fprintf (cf, "EndSection\n\n");
-		ptr = ptr->list.next;
-	}
-}
-
-void
 xf86freeVendorList (XF86ConfVendorPtr p)
 {
 	if (p == NULL)
diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c
index beeb43e..e9f4e8f 100644
--- a/hw/xfree86/parser/Video.c
+++ b/hw/xfree86/parser/Video.c
@@ -224,43 +224,6 @@ xf86parseVideoAdaptorSection (void)
 }
 
 void
-xf86printVideoAdaptorSection (FILE * cf, XF86ConfVideoAdaptorPtr ptr)
-{
-	XF86ConfVideoPortPtr pptr;
-
-	while (ptr)
-	{
-		fprintf (cf, "Section \"VideoAdaptor\"\n");
-		if (ptr->va_comment)
-			fprintf (cf, "%s", ptr->va_comment);
-		if (ptr->va_identifier)
-			fprintf (cf, "\tIdentifier  \"%s\"\n", ptr->va_identifier);
-		if (ptr->va_vendor)
-			fprintf (cf, "\tVendorName  \"%s\"\n", ptr->va_vendor);
-		if (ptr->va_board)
-			fprintf (cf, "\tBoardName   \"%s\"\n", ptr->va_board);
-		if (ptr->va_busid)
-			fprintf (cf, "\tBusID       \"%s\"\n", ptr->va_busid);
-		if (ptr->va_driver)
-			fprintf (cf, "\tDriver      \"%s\"\n", ptr->va_driver);
-		xf86printOptionList(cf, ptr->va_option_lst, 1);
-		for (pptr = ptr->va_port_lst; pptr; pptr = pptr->list.next)
-		{
-			fprintf (cf, "\tSubSection \"VideoPort\"\n");
-			if (pptr->vp_comment)
-				fprintf (cf, "%s", pptr->vp_comment);
-			if (pptr->vp_identifier)
-				fprintf (cf, "\t\tIdentifier \"%s\"\n", pptr->vp_identifier);
-			xf86printOptionList(cf, pptr->vp_option_lst, 2);
-			fprintf (cf, "\tEndSubSection\n");
-		}
-		fprintf (cf, "EndSection\n\n");
-		ptr = ptr->list.next;
-	}
-
-}
-
-void
 xf86freeVideoAdaptorList (XF86ConfVideoAdaptorPtr ptr)
 {
 	XF86ConfVideoAdaptorPtr prev;
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
index 26ba40e..ced7c68 100644
--- a/hw/xfree86/parser/configProcs.h
+++ b/hw/xfree86/parser/configProcs.h
@@ -32,7 +32,6 @@
 
 /* Device.c */
 XF86ConfDevicePtr xf86parseDeviceSection(void);
-void xf86printDeviceSection(FILE *cf, XF86ConfDevicePtr ptr);
 void xf86freeDeviceList(XF86ConfDevicePtr ptr);
 int xf86validateDevice(XF86ConfigPtr p);
 /* Files.c */
@@ -41,11 +40,9 @@ void xf86printFileSection(FILE *cf, XF86ConfFilesPtr ptr);
 void xf86freeFiles(XF86ConfFilesPtr p);
 /* Flags.c */
 XF86ConfFlagsPtr xf86parseFlagsSection(void);
-void xf86printServerFlagsSection(FILE *f, XF86ConfFlagsPtr flags);
 void xf86freeFlags(XF86ConfFlagsPtr flags);
 /* Input.c */
 XF86ConfInputPtr xf86parseInputSection(void);
-void xf86printInputSection(FILE *f, XF86ConfInputPtr ptr);
 void xf86freeInputList(XF86ConfInputPtr ptr);
 int xf86validateInput (XF86ConfigPtr p);
 /* Layout.c */
@@ -61,8 +58,6 @@ void xf86freeModules(XF86ConfModulePtr ptr);
 /* Monitor.c */
 XF86ConfMonitorPtr xf86parseMonitorSection(void);
 XF86ConfModesPtr xf86parseModesSection(void);
-void xf86printMonitorSection(FILE *cf, XF86ConfMonitorPtr ptr);
-void xf86printModesSection(FILE *cf, XF86ConfModesPtr ptr);
 extern _X_EXPORT void xf86freeMonitorList(XF86ConfMonitorPtr ptr);
 void xf86freeModesList(XF86ConfModesPtr ptr);
 int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen);
@@ -70,7 +65,6 @@ int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen);
 XF86ConfInputPtr xf86parsePointerSection(void);
 /* Screen.c */
 XF86ConfScreenPtr xf86parseScreenSection(void);
-void xf86printScreenSection(FILE *cf, XF86ConfScreenPtr ptr);
 extern _X_EXPORT void xf86freeScreenList(XF86ConfScreenPtr ptr);
 void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr);
 void xf86freeDisplayList(XF86ConfDisplayPtr ptr);
@@ -79,11 +73,9 @@ int xf86validateScreen(XF86ConfigPtr p);
 /* Vendor.c */
 XF86ConfVendorPtr xf86parseVendorSection(void);
 void xf86freeVendorList(XF86ConfVendorPtr p);
-void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr);
 void xf86freeVendorSubList (XF86ConfVendSubPtr ptr);
 /* Video.c */
 XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void);
-void xf86printVideoAdaptorSection(FILE *cf, XF86ConfVideoAdaptorPtr ptr);
 void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr);
 /* scan.c */
 int xf86getToken(xf86ConfigSymTabRec *tab);
@@ -98,11 +90,9 @@ int xf86getStringToken(xf86ConfigSymTabRec *tab);
 /* write.c */
 /* DRI.c */
 XF86ConfDRIPtr xf86parseDRISection (void);
-void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr);
 void xf86freeDRI (XF86ConfDRIPtr ptr);
 /* Extensions.c */
 XF86ConfExtensionsPtr xf86parseExtensionsSection (void);
-void xf86printExtensionsSection (FILE * cf, XF86ConfExtensionsPtr ptr);
 void xf86freeExtensions (XF86ConfExtensionsPtr ptr);
 
 #ifdef HAVE_XORG_CONFIG_H
diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c
deleted file mode 100644
index 3b77b93..0000000
--- a/hw/xfree86/parser/write.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* 
- * Copyright (c) 1997  Metro Link Incorporated
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"), 
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * 
- * Except as contained in this notice, the name of the Metro Link shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Metro Link.
- * 
- */
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-/* View/edit this file with tab stops set to 4 */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Parser.h"
-#include "xf86tokens.h"
-#include "Configint.h"
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <errno.h>
-
-#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
-#define HAS_SAVED_IDS_AND_SETEUID
-#endif
-#if defined(WIN32)
-#define HAS_NO_UIDS
-#endif
-
-#ifdef HAS_NO_UIDS
-#define doWriteConfigFile xf86writeConfigFile
-#define Local /**/
-#else
-#define Local static
-#endif
-
-Local int
-doWriteConfigFile (const char *filename, XF86ConfigPtr cptr)
-{
-	FILE *cf;
-
-	if ((cf = fopen (filename, "w")) == NULL)
-	{
-		return 0;
-	}
-
-	if (cptr->conf_comment)
-		fprintf (cf, "%s\n", cptr->conf_comment);
-
-	xf86printLayoutSection (cf, cptr->conf_layout_lst);
-
-	if (cptr->conf_files != NULL)
-	{
-		fprintf (cf, "Section \"Files\"\n");
-		xf86printFileSection (cf, cptr->conf_files);
-		fprintf (cf, "EndSection\n\n");
-	}
-
-	if (cptr->conf_modules != NULL)
-	{
-		fprintf (cf, "Section \"Module\"\n");
-		xf86printModuleSection (cf, cptr->conf_modules);
-		fprintf (cf, "EndSection\n\n");
-	}
-
-	xf86printVendorSection (cf, cptr->conf_vendor_lst);
-
-	xf86printServerFlagsSection (cf, cptr->conf_flags);
-
-	xf86printInputSection (cf, cptr->conf_input_lst);
-
-	xf86printVideoAdaptorSection (cf, cptr->conf_videoadaptor_lst);
-
-	xf86printModesSection (cf, cptr->conf_modes_lst);
-
-	xf86printMonitorSection (cf, cptr->conf_monitor_lst);
-
-	xf86printDeviceSection (cf, cptr->conf_device_lst);
-
-	xf86printScreenSection (cf, cptr->conf_screen_lst);
-
-	xf86printDRISection (cf, cptr->conf_dri);
-
-	xf86printExtensionsSection (cf, cptr->conf_extensions);
-
-	fclose(cf);
-	return 1;
-}
-
-#ifndef HAS_NO_UIDS
-
-int
-xf86writeConfigFile (const char *filename, XF86ConfigPtr cptr)
-{
-	int ret;
-
-#if !defined(HAS_SAVED_IDS_AND_SETEUID)
-	int pid, p;
-	int status;
-	void (*csig)(int);
-#else
-	int ruid, euid;
-#endif
-
-	if (getuid() != geteuid())
-	{
-
-#if !defined(HAS_SAVED_IDS_AND_SETEUID)
-		/* Need to fork to change ruid without loosing euid */
-#ifdef SIGCHLD
-		csig = signal(SIGCHLD, SIG_DFL);
-#endif
-		switch ((pid = fork()))
-		{
-		case -1:
-			ErrorF("xf86writeConfigFile(): fork failed (%s)\n",
-					strerror(errno));
-			return 0;
-		case 0: /* child */
-			if (setuid(getuid()) == -1) 
-			    FatalError("xf86writeConfigFile(): "
-				"setuid failed(%s)\n", 
-				strerror(errno));
-			ret = doWriteConfigFile(filename, cptr);
-			exit(ret);
-			break;
-		default: /* parent */
-			do
-			{
-				p = waitpid(pid, &status, 0);
-			} while (p == -1 && errno == EINTR);
-		}
-#ifdef SIGCHLD
-		signal(SIGCHLD, csig);
-#endif
-		if (p != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0)
-			return 1;	/* success */
-		else
-			return 0;
-
-#else /* HAS_SAVED_IDS_AND_SETEUID */
-
-		ruid = getuid();
-		euid = geteuid();
-
-		if (seteuid(ruid) == -1)
-		{
-			ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n",
-					ruid, strerror(errno));
-			return 0;
-		}
-		ret = doWriteConfigFile(filename, cptr);
-
-		if (seteuid(euid) == -1)
-		{
-			ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n",
-					euid, strerror(errno));
-		}
-		return ret;
-
-#endif /* HAS_SAVED_IDS_AND_SETEUID */
-
-	}
-	else
-	{
-		return doWriteConfigFile(filename, cptr);
-	}
-}
-
-#endif /* !HAS_NO_UIDS */
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index 6030800..48ebfcd 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -462,7 +462,6 @@ extern _X_EXPORT void xf86setBuiltinConfig(const char *config[]);
 extern _X_EXPORT XF86ConfigPtr xf86readConfigFile (void);
 extern _X_EXPORT void xf86closeConfigFile (void);
 extern _X_EXPORT void xf86freeConfig (XF86ConfigPtr p);
-extern _X_EXPORT int xf86writeConfigFile (const char *, XF86ConfigPtr);
 extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p);
 extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list);
 extern _X_EXPORT XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p);
-- 
1.5.6.3



More information about the xorg-devel mailing list