summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2008-07-16 06:25:26 +0300
committerDaniel Stone <daniel@fooishbar.org>2008-07-16 06:25:26 +0300
commit22e64108ec63ba77779891f8df237913ef9ca731 (patch)
tree3daf745c1dd8680e4db5e7c974da3e9da7ad2844
parentb8dd07f855c555af56cbf0f69df799f424da2cca (diff)
XFree86: Remove XFree86-Misc extension
Its last remaining purpose in life has been destroyed by input properties. Au revoir: it's been fun, by which I mean awful.
-rw-r--r--configure.ac18
-rw-r--r--hw/dmx/dmx-config.h1
-rw-r--r--hw/xfree86/common/Makefile.am2
-rw-r--r--hw/xfree86/common/xf86Config.c14
-rw-r--r--hw/xfree86/common/xf86Globals.c4
-rw-r--r--hw/xfree86/common/xf86Init.c18
-rw-r--r--hw/xfree86/common/xf86MiscExt.c541
-rw-r--r--hw/xfree86/common/xf86Priv.h4
-rw-r--r--hw/xfree86/dixmods/extmod/Makefile.am5
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c9
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.h7
-rw-r--r--hw/xfree86/dixmods/extmod/xf86misc.c821
-rw-r--r--hw/xfree86/dixmods/extmod/xf86miscproc.h69
-rw-r--r--hw/xfree86/loader/dixsym.c3
-rw-r--r--hw/xfree86/loader/xf86sym.c18
-rw-r--r--hw/xfree86/os-support/misc/Makefile.am2
-rw-r--r--hw/xfree86/os-support/misc/xf86_Util.c94
-rw-r--r--hw/xwin/InitInput.c3
-rw-r--r--include/dix-config.h.in3
-rw-r--r--include/globals.h4
-rw-r--r--include/xorg-server.h.in3
-rw-r--r--mi/miinitext.c14
-rw-r--r--os/utils.c3
23 files changed, 3 insertions, 1657 deletions
diff --git a/configure.ac b/configure.ac
index 8f2a96652..a465b0121 100644
--- a/configure.ac
+++ b/configure.ac
@@ -545,7 +545,6 @@ AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extensio
AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval])
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
-AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: auto)]), [XF86MISC=$enableval], [XF86MISC=auto])
AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--disable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no])
AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no])
@@ -664,7 +663,6 @@ case $host_os in
DGA=no
DPMSExtension=no
XF86BIGFONT=no
- XF86MISC=no
XF86VIDMODE=no
fi
;;
@@ -1415,15 +1413,6 @@ if test "x$XORG" = xyes; then
AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
fi
- if test "x$XF86MISC" = xauto; then
- PKG_CHECK_MODULES(XF86MISC, xf86miscproto, [XF86MISC=yes], [XF86MISC=no])
- fi
- if test "x$XF86MISC" = xyes; then
- XORG_MODULES="$XORG_MODULES xf86miscproto"
- PKG_CHECK_MODULES(XF86MISC, xf86miscproto)
- AC_DEFINE(XF86MISC, 1, [Support XFree86 miscellaneous extensions])
- fi
-
if test "x$XF86VIDMODE" = xauto; then
PKG_CHECK_MODULES(XF86VIDMODE, xf86vidmodeproto, [XF86VIDMODE=yes], [XF86VIDMODE=no])
fi
@@ -1513,7 +1502,6 @@ AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
AM_CONDITIONAL([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = xyes])
AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
-AM_CONDITIONAL([XF86MISC], [test "x$XF86MISC" = xyes])
AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
dnl XWin DDX
@@ -1566,10 +1554,6 @@ if test "x$XWIN" = xyes; then
AC_MSG_NOTICE([Disabling XF86VidMode extension])
XF86VIDMODE=no
fi
- if test "x$XF86MISC" = xyes; then
- AC_MSG_NOTICE([Disabling XF86Misc extension])
- XF86MISC=no
- fi
if test "x$COMPOSITE" = xyes; then
AC_MSG_NOTICE([Disabling Composite extension])
COMPOSITE=no
@@ -1837,7 +1821,7 @@ AC_ARG_ENABLE(xorgcfg, AS_HELP_STRING([--enable-xorgcfg],
[XORGCFG=$enableval],[XORGCFG=no])
if test x$XORGCFG = xyes ; then
PKG_CHECK_MODULES([XORGCFG_DEP],
- [xkbui >= 1.0.2 xkbfile xxf86misc xxf86vm xaw7 xmu xt xpm xext x11])
+ [xkbui >= 1.0.2 xkbfile xxf86vm xaw7 xmu xt xpm xext x11])
XORGCFG_DEP_CFLAGS="$XORGCFG_DEP_CFLAGS"
AC_CHECK_LIB([curses],[waddstr],
[XORGCFG_DEP_LIBS="$XORGCFG_DEP_LIBS -lcurses"; CURSES=yes],
diff --git a/hw/dmx/dmx-config.h b/hw/dmx/dmx-config.h
index 4a2dfe060..715977c2c 100644
--- a/hw/dmx/dmx-config.h
+++ b/hw/dmx/dmx-config.h
@@ -80,7 +80,6 @@
#undef XIE
#undef DBE
#undef XF86VIDMODE
-#undef XF86MISC
#undef XFreeXDGA
#undef XF86DRI
#undef SCREENSAVER
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index faa6b3746..d67d595ff 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -29,7 +29,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
xf86Cursor.c xf86DGA.c xf86DPMS.c \
xf86DoProbe.c xf86Events.c \
xf86Globals.c xf86AutoConfig.c \
- xf86MiscExt.c xf86Option.c \
+ xf86Option.c \
xf86VidMode.c xf86fbman.c xf86cmap.c \
xf86Helper.c xf86PM.c xf86RAC.c xf86Xinput.c xisb.c \
xf86Mode.c xf86Build.h xorgHelper.c \
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index bea213060..4b8c9e67c 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -951,13 +951,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Info.vidModeAllowNonLocal = value;
#endif
-#ifdef XF86MISC
- if (xf86GetOptValBool(FlagOptions, FLAG_DISABLEMODINDEV, &value))
- xf86Info.miscModInDevEnabled = !value;
- if (xf86GetOptValBool(FlagOptions, FLAG_MODINDEVALLOWNONLOCAL, &value))
- xf86Info.miscModInDevAllowNonLocal = value;
-#endif
-
if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWMOUSEOPENFAIL, &value))
xf86Info.allowMouseOpenFail = value;
@@ -2616,13 +2609,6 @@ xf86HandleConfigFile(Bool autoconfig)
xf86Info.vidModeAllowNonLocal = TRUE;
#endif
-#ifdef XF86MISC
- if (xf86MiscModInDevDisabled)
- xf86Info.miscModInDevEnabled = FALSE;
- if (xf86MiscModInDevAllowNonLocal)
- xf86Info.miscModInDevAllowNonLocal = TRUE;
-#endif
-
if (xf86AllowMouseOpenFail)
xf86Info.allowMouseOpenFail = TRUE;
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 19ed4e747..c00089190 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -192,10 +192,6 @@ Bool xf86AllowMouseOpenFail = FALSE;
Bool xf86VidModeDisabled = FALSE;
Bool xf86VidModeAllowNonLocal = FALSE;
#endif
-#ifdef XF86MISC
-Bool xf86MiscModInDevDisabled = FALSE;
-Bool xf86MiscModInDevAllowNonLocal = FALSE;
-#endif
RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
_X_EXPORT Bool xf86inSuspend = FALSE;
Bool xorgHWAccess = FALSE;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 5cd5248db..258f68b87 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1518,18 +1518,6 @@ ddxProcessArgument(int argc, char **argv, int i)
return 1;
}
#endif
-#ifdef XF86MISC
- if (!strcmp(argv[i],"-disableModInDev"))
- {
- xf86MiscModInDevDisabled = TRUE;
- return 1;
- }
- if (!strcmp(argv[i],"-allowNonLocalModInDev"))
- {
- xf86MiscModInDevAllowNonLocal = TRUE;
- return 1;
- }
-#endif
if (!strcmp(argv[i],"-allowMouseOpenFail"))
{
xf86AllowMouseOpenFail = TRUE;
@@ -1818,12 +1806,6 @@ ddxUseMsg()
ErrorF("-disableVidMode disable mode adjustments with xvidtune\n");
ErrorF("-allowNonLocalXvidtune allow xvidtune to be run as a non-local client\n");
#endif
-#ifdef XF86MISC
- ErrorF("-disableModInDev disable dynamic modification of input device settings\n");
- ErrorF("-allowNonLocalModInDev allow changes to keyboard and mouse settings\n");
- ErrorF(" from non-local clients\n");
- ErrorF("-allowMouseOpenFail start server even if the mouse can't be initialized\n");
-#endif
ErrorF("-bestRefresh choose modes with the best refresh rate\n");
ErrorF("-ignoreABI make module ABI mismatches non-fatal\n");
ErrorF("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n");
diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c
deleted file mode 100644
index 9c81a6f77..000000000
--- a/hw/xfree86/common/xf86MiscExt.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
- * Copyright (c) 1999-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).
- */
-
-/*
- * This file contains the Pointer/Keyboard functions needed by the
- * XFree86-Misc extension.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#ifdef XF86MISC
-#define _XF86MISC_SERVER_
-#include <X11/extensions/xf86misc.h>
-#include "xf86miscproc.h"
-#endif
-
-#define XF86_OS_PRIVS
-#include "xf86_OSlib.h"
-
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "xf86Xinput.h"
-
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF(x"\n");
-#else
-# define DEBUG_P(x) /**/
-#endif
-
-#ifdef XF86MISC
-
-typedef struct {
- int type;
- int baudrate;
- int samplerate;
- int resolution;
- int buttons;
- Bool em3buttons;
- int em3timeout;
- Bool chordmiddle;
- int flags;
- char* device;
- pointer private;
-} mseParamsRec, *mseParamsPtr;
-
-typedef struct {
- int type;
- int rate;
- int delay;
- int serverNumLock; /* obsolete */
- pointer private;
-} kbdParamsRec, *kbdParamsPtr;
-
-/*
- Sigh...
-
- The extension should probably be changed to use protocol
- names instead of ID numbers
-*/
-static struct mouse_map {
- int mtype;
- MouseProtocolID proto;
-} m_map[] =
-{
- { MTYPE_MICROSOFT, PROT_MS },
- { MTYPE_MOUSESYS, PROT_MSC },
- { MTYPE_MMSERIES, PROT_MM },
- { MTYPE_LOGITECH, PROT_LOGI },
- { MTYPE_LOGIMAN, PROT_LOGIMAN },
- { MTYPE_MMHIT, PROT_MMHIT },
- { MTYPE_GLIDEPOINT, PROT_GLIDE },
- { MTYPE_IMSERIAL, PROT_IMSERIAL },
- { MTYPE_THINKING, PROT_THINKING },
- { MTYPE_ACECAD, PROT_ACECAD },
- { MTYPE_PS_2, PROT_PS2 },
- { MTYPE_IMPS2, PROT_IMPS2 },
- { MTYPE_EXPPS2, PROT_EXPPS2 },
- { MTYPE_THINKINGPS2, PROT_THINKPS2 },
- { MTYPE_MMANPLUSPS2, PROT_MMPS2 },
- { MTYPE_GLIDEPOINTPS2, PROT_GLIDEPS2 },
- { MTYPE_NETPS2, PROT_NETPS2 },
- { MTYPE_NETSCROLLPS2, PROT_NETSCPS2 },
- { MTYPE_BUSMOUSE, PROT_BM },
- { MTYPE_AUTOMOUSE, PROT_AUTO },
- { MTYPE_SYSMOUSE, PROT_SYSMOUSE },
- { MTYPE_UNKNOWN, PROT_UNKNOWN }
-};
-
-static int
-MapMseProtoToMisc(MouseProtocolID proto)
-{
- int i;
-
- for (i = 0; m_map[i].proto != PROT_UNKNOWN; i++)
- if (proto == m_map[i].proto)
- return m_map[i].mtype;
-
- return MTYPE_UNKNOWN;
-}
-
-static MouseProtocolID
-MapMseMiscToProto(int proto)
-{
- int i;
-
- for (i = 0; m_map[i].mtype != MTYPE_UNKNOWN; i++)
- if (proto == m_map[i].mtype)
- return m_map[i].proto;
-
- return PROT_UNKNOWN;
-}
-
-_X_EXPORT Bool
-MiscExtGetMouseSettings(pointer *mouse, char **devname)
-{
- mseParamsPtr mseptr;
-
- mseptr = MiscExtCreateStruct(MISC_POINTER);
- if (!mseptr)
- return FALSE;
-
- {
- InputInfoPtr pInfo = mseptr->private;
- MouseDevPtr pMse;
-
- *devname = xf86FindOptionValue(pInfo->options, "Device");
- pMse = pInfo->private;
-
- mseptr->type = MapMseProtoToMisc(pMse->protocolID);
- mseptr->baudrate = pMse->baudRate;
- mseptr->samplerate = pMse->sampleRate;
- mseptr->resolution = pMse->resolution;
- mseptr->buttons = pMse->buttons;
- mseptr->em3buttons = pMse->emulate3Buttons;
- mseptr->em3timeout = pMse->emulate3Timeout;
- mseptr->chordmiddle = pMse->chordMiddle;
- mseptr->flags = pMse->mouseFlags;
- }
- *mouse = mseptr;
- return TRUE;
-}
-
-_X_EXPORT int
-MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype)
-{
- mseParamsPtr mse = mouse;
-
- switch (valtype) {
- case MISC_MSE_PROTO: return mse->type;
- case MISC_MSE_BAUDRATE: return mse->baudrate;
- case MISC_MSE_SAMPLERATE: return mse->samplerate;
- case MISC_MSE_RESOLUTION: return mse->resolution;
- case MISC_MSE_BUTTONS: return mse->buttons;
- case MISC_MSE_EM3BUTTONS: return mse->em3buttons;
- case MISC_MSE_EM3TIMEOUT: return mse->em3timeout;
- case MISC_MSE_CHORDMIDDLE: return mse->chordmiddle;
- case MISC_MSE_FLAGS: return mse->flags;
- }
- return 0;
-}
-
-_X_EXPORT Bool
-MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value)
-{
- mseParamsPtr mse = mouse;
-
- switch (valtype) {
- case MISC_MSE_PROTO:
- mse->type = value;
- return TRUE;
- case MISC_MSE_BAUDRATE:
- mse->baudrate = value;
- return TRUE;
- case MISC_MSE_SAMPLERATE:
- mse->samplerate = value;
- return TRUE;
- case MISC_MSE_RESOLUTION:
- mse->resolution = value;
- return TRUE;
- case MISC_MSE_BUTTONS:
- mse->buttons = value;
- return TRUE;
- case MISC_MSE_EM3BUTTONS:
- mse->em3buttons = value;
- return TRUE;
- case MISC_MSE_EM3TIMEOUT:
- mse->em3timeout = value;
- return TRUE;
- case MISC_MSE_CHORDMIDDLE:
- mse->chordmiddle = value;
- return TRUE;
- case MISC_MSE_FLAGS:
- mse->flags = value;
- return TRUE;
- }
- return FALSE;
-}
-
-_X_EXPORT Bool
-MiscExtSetMouseDevice(pointer mouse, char* device)
-{
- mseParamsPtr mse = mouse;
- mse->device = device;
-
- return TRUE;
-}
-
-_X_EXPORT Bool
-MiscExtGetKbdSettings(pointer *kbd)
-{
- return FALSE;
-}
-
-_X_EXPORT int
-MiscExtGetKbdValue(pointer keyboard, MiscExtKbdValType valtype)
-{
- return 0;
-}
-
-_X_EXPORT Bool
-MiscExtSetKbdValue(pointer keyboard, MiscExtKbdValType valtype, int value)
-{
- return FALSE;
-}
-
-static void
-MiscExtClientStateCallback(CallbackListPtr *callbacks,
- pointer data, pointer args)
-{
- NewClientInfoRec *clientinfo = (NewClientInfoRec*)args;
-
- if (clientinfo->client == xf86Info.grabInfo.override &&
- clientinfo->client->clientState == ClientStateGone) {
- xf86Info.grabInfo.override = NULL;
- xf86Info.grabInfo.disabled = 0;
- DeleteCallback(&ClientStateCallback, MiscExtClientStateCallback, NULL);
- }
-}
-
-#define MiscExtGrabStateSuccess 0 /* No errors */
-#define MiscExtGrabStateLocked 1 /* A client already requested that
- * grabs cannot be removed/killed */
-#define MiscExtGrabStateAlready 2 /* Request for enabling/disabling
- * grab removeal/kill already done */
-_X_EXPORT int
-MiscExtSetGrabKeysState(ClientPtr client, int state)
-{
- if (xf86Info.grabInfo.override == NULL ||
- xf86Info.grabInfo.override == client) {
- if (state == 0 && xf86Info.grabInfo.disabled == 0) {
- xf86Info.grabInfo.disabled = 1;
- AddCallback(&ClientStateCallback,
- MiscExtClientStateCallback, NULL);
- xf86Info.grabInfo.override = client;
- }
- else if (state == 1 && xf86Info.grabInfo.disabled == 1) {
- xf86Info.grabInfo.disabled = 0;
- DeleteCallback(&ClientStateCallback,
- MiscExtClientStateCallback, NULL);
- xf86Info.grabInfo.override = NULL;
- }
- else
- return MiscExtGrabStateAlready;
-
- return MiscExtGrabStateSuccess;
- }
-
- return MiscExtGrabStateLocked;
-}
-
-_X_EXPORT pointer
-MiscExtCreateStruct(MiscExtStructType mse_or_kbd)
-{
- switch (mse_or_kbd) {
- case MISC_POINTER:
- {
- mseParamsPtr mseptr;
- InputInfoPtr pInfo = xf86InputDevs;
-
- while (pInfo) {
- if (pInfo->dev == inputInfo.pointer)
- break;
- pInfo = pInfo->next;
- }
- if (!pInfo)
- return NULL;
-
- mseptr = xcalloc(sizeof(mseParamsRec),1);
- if (mseptr)
- mseptr->private = pInfo;
- return mseptr;
- }
- case MISC_KEYBOARD:
- return xcalloc(sizeof(kbdParamsRec),1);
- }
- return 0;
-}
-
-_X_EXPORT void
-MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd)
-{
- switch (mse_or_kbd) {
- case MISC_POINTER:
- case MISC_KEYBOARD:
- xfree(structure);
- }
-}
-
-static Bool
-MiscExtAuthorizeDevice(InputInfoPtr pInfo, char *device)
-{
- Bool authorized = FALSE;
- char *elem;
- struct stat dev, dev_list;
- const char *olddev = xf86FindOptionValue(pInfo->options, "Device");
-
- if (stat(device,&dev))
- return FALSE;
-
- if (!S_ISCHR(dev.st_mode))
- return FALSE;
-
- if (!stat(olddev,&dev_list)) {
- if (dev_list.st_dev == dev.st_dev
- && dev_list.st_ino == dev.st_ino) {
- authorized = TRUE;
- }
- }
-
- if (!authorized) {
- char *path;
-
- if (!xf86InputDeviceList
- || (path = strdup(xf86InputDeviceList)) == NULL)
- return FALSE;
-
- elem = strtok(path,",");
-
- while (elem) {
-
- if (!stat(elem,&dev_list)) {
- if (dev_list.st_dev == dev.st_dev
- && dev_list.st_ino == dev.st_ino) {
- authorized = TRUE;
- break;
-
- }
- }
- elem = strtok(NULL,",");
- }
- xfree(path);
- }
-#if 0
- ErrorF("AUTHORIZED: %s\n",authorized?"Yes":"No");
-#endif
- return (authorized);
-}
-
-_X_EXPORT MiscExtReturn
-MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
-{
- if (mse_or_kbd == MISC_POINTER) {
- Bool protoChanged = FALSE;
- int oldflags;
- Bool reopen = FALSE;
- MouseProtocolID newProtocol;
- mseParamsPtr mse = structure;
- InputInfoPtr pInfo;
- MouseDevPtr pMse;
- pointer xf86MouseProtocolIDToName
- = LoaderSymbol("xf86MouseProtocolIDToName");
- if (!xf86MouseProtocolIDToName)
- return MISC_RET_NOMODULE;
- if (mse->type < MTYPE_MICROSOFT || mse->type > MTYPE_EXPPS2)
- return MISC_RET_BADMSEPROTO;
-
- if (mse->em3timeout < 0)
- return MISC_RET_BADVAL;
-
- if (mse->type == MTYPE_LOGIMAN
- && !(mse->baudrate == 0
- || mse->baudrate == 1200
- || mse->baudrate == 9600))
- return MISC_RET_BADBAUDRATE;
- if (mse->type == MTYPE_LOGIMAN && mse->samplerate)
- return MISC_RET_BADCOMBO;
-
- if (mse->flags & MF_REOPEN) {
- reopen = TRUE;
- mse->flags &= ~MF_REOPEN;
- }
- if (mse->type != MTYPE_PS_2
- && mse->type != MTYPE_BUSMOUSE
- && mse->type != MTYPE_IMPS2
- && mse->type != MTYPE_THINKINGPS2
- && mse->type != MTYPE_MMANPLUSPS2
- && mse->type != MTYPE_GLIDEPOINTPS2
- && mse->type != MTYPE_NETPS2
- && mse->type != MTYPE_NETSCROLLPS2
- && mse->type != MTYPE_SYSMOUSE)
- {
- if (mse->baudrate % 1200 != 0
- || (mse->baudrate != 0 && mse->baudrate < 1200)
- || mse->baudrate > 9600)
- return MISC_RET_BADBAUDRATE;
- }
- if ((mse->flags & (MF_CLEAR_DTR|MF_CLEAR_RTS))
- && (mse->type != MTYPE_MOUSESYS))
- return MISC_RET_BADFLAGS;
-
- if (mse->type != MTYPE_BUSMOUSE && mse->samplerate < 0)
- return MISC_RET_BADVAL;
-
- if (mse->resolution < 0)
- return MISC_RET_BADVAL;
- if (mse->chordmiddle)
- {
- if (mse->em3buttons || !(mse->type == MTYPE_MICROSOFT
- || mse->type == MTYPE_LOGIMAN) )
- return MISC_RET_BADCOMBO;
- }
-
- /* XXX - This still needs work */
-
- pInfo = mse->private;
- pMse = pInfo->private;
- oldflags = pMse->mouseFlags;
-
- newProtocol = MapMseMiscToProto(mse->type);
- protoChanged = pMse->protocolID != newProtocol;
- if (protoChanged
- || pMse->baudRate != mse->baudrate
- || pMse->sampleRate != mse->samplerate
- || pMse->resolution != mse->resolution
- || pMse->mouseFlags != mse->flags)
- reopen = TRUE;
-
- if (mse->device)
- reopen = TRUE;
-
- if (reopen)
- (pMse->device->deviceProc)(pMse->device, DEVICE_CLOSE);
-
- pMse->protocolID = newProtocol;
- pMse->baudRate = mse->baudrate;
- pMse->sampleRate = mse->samplerate;
- pMse->resolution = mse->resolution;
- pMse->buttons = mse->buttons;
- pMse->emulate3Buttons = mse->em3buttons;
- pMse->emulate3Timeout = mse->em3timeout;
- pMse->chordMiddle = mse->chordmiddle;
- pMse->mouseFlags = mse->flags;
-
- pMse->protocol = ((const char *(*)(MouseProtocolID))
- xf86MouseProtocolIDToName)(pMse->protocolID);
-
- if (mse->device) {
- if (MiscExtAuthorizeDevice(pInfo, mse->device)) {
- xf86ReplaceStrOption(pInfo->options, "Device", mse->device);
- } else {
- return MISC_RET_BADVAL;
- }
- }
-
- if (reopen) {
- /* Only if protocol is changed explicitely disable auto detect */
- if (protoChanged)
- pMse->autoProbe = FALSE;
- (pMse->device->deviceProc)(pMse->device, DEVICE_ON);
- }
- /* Set pInfo->options too */
-
- if ((oldflags & MF_CLEAR_DTR) != (pMse->mouseFlags & MF_CLEAR_DTR))
- xf86ReplaceBoolOption(pInfo->options, "ClearDTR",
- pMse->mouseFlags | MF_CLEAR_DTR);
- if ((oldflags & MF_CLEAR_RTS) != (pMse->mouseFlags & MF_CLEAR_RTS))
- xf86ReplaceBoolOption(pInfo->options, "ClearRTS",
- pMse->mouseFlags | MF_CLEAR_RTS);
- }
- return MISC_RET_BADVAL;
-}
-
-_X_EXPORT Bool
-MiscExtGetFilePaths(const char **configfile, const char **modulepath,
- const char **logfile)
-{
- *configfile = xf86ConfigFile;
- *modulepath = xf86ModulePath;
- *logfile = xf86LogFile;
-
- return TRUE;
-}
-
-_X_EXPORT int
-MiscExtPassMessage(int scrnIndex, const char *msgtype, const char *msgval,
- char **retstr)
-{
- ScrnInfoPtr pScr = xf86Screens[scrnIndex];
-
- /* should check this in the protocol, but xf86NumScreens isn't exported */
- if (scrnIndex >= xf86NumScreens)
- return BadValue;
-
- if (*pScr->HandleMessage == NULL)
- return BadImplementation;
- return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr);
-}
-
-#endif /* XF86MISC */
-
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 8c64a54c5..cb4bae7cd 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -51,10 +51,6 @@ extern Bool xf86AllowMouseOpenFail;
extern Bool xf86VidModeDisabled;
extern Bool xf86VidModeAllowNonLocal;
#endif
-#ifdef XF86MISC
-extern Bool xf86MiscModInDevDisabled;
-extern Bool xf86MiscModInDevAllowNonLocal;
-#endif
extern Bool xf86fpFlag;
extern Bool xf86coFlag;
extern Bool xf86sFlag;
diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am
index 47407f1df..317971db6 100644
--- a/hw/xfree86/dixmods/extmod/Makefile.am
+++ b/hw/xfree86/dixmods/extmod/Makefile.am
@@ -11,10 +11,6 @@ if XV
XV_SRCS = xvmod.c xvmodproc.h
endif
-if XF86MISC
-XF86MISC_SRCS = xf86misc.c xf86miscproc.h
-endif
-
if XF86VIDMODE
XF86VMODE_SRCS = xf86vmode.c vidmodeproc.h
endif
@@ -29,7 +25,6 @@ libextmod_la_LDFLAGS = -avoid-version
libextmod_la_SOURCES = modinit.c \
modinit.h \
$(DGA_SRCS) \
- $(XF86MISC_SRCS) \
$(XF86VMODE_SRCS) \
$(XV_SRCS)
libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index f8440f127..2f81319fa 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -119,15 +119,6 @@ static ExtensionModule extensionModules[] = {
NULL
},
#endif
-#ifdef XF86MISC
- {
- XFree86MiscExtensionInit,
- XF86MISCNAME,
- &noXFree86MiscExtension,
- NULL,
- NULL
- },
-#endif
#ifdef XFreeXDGA
{
XFree86DGAExtensionInit,
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
index 32f7ed48f..463a40008 100644
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -57,13 +57,6 @@ extern void XFree86VidModeExtensionInit(INITARGS);
#include <X11/extensions/xf86vmstr.h>
#endif
-#ifdef XF86MISC
-extern void XFree86MiscExtensionInit(INITARGS);
-#define _XF86MISC_SERVER_
-#define _XF86MISC_SAVER_COMPAT_
-#include <X11/extensions/xf86mscstr.h>
-#endif
-
#ifdef XFreeXDGA
extern void XFree86DGAExtensionInit(INITARGS);
extern void XFree86DGARegister(INITARGS);
diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c
deleted file mode 100644
index 8127afdff..000000000
--- a/hw/xfree86/dixmods/extmod/xf86misc.c
+++ /dev/null
@@ -1,821 +0,0 @@
-
-/*
- * Copyright (c) 1995, 1996 The XFree86 Project, Inc
- */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "scrnintstr.h"
-#include "inputstr.h"
-#include "servermd.h"
-#define _XF86MISC_SERVER_
-#undef _XF86MISC_SAVER_COMPAT_
-#include <X11/extensions/xf86mscstr.h>
-#include "swaprep.h"
-#include "xf86.h"
-#include <X11/Xfuncproto.h>
-#include "xf86miscproc.h"
-
-#if 0
-#include <X11/Xtrans/Xtrans.h>
-#include "../os/osdep.h"
-#include <X11/Xauth.h>
-#ifndef USL
-#ifndef Lynx
-#include <sys/socket.h>
-#else
-#include <socket.h>
-#endif
-#endif /* USL */
-#endif
-
-static int miscErrorBase;
-static DevPrivateKey MiscClientPrivateKey = &MiscClientPrivateKey;
-
-/* This holds the client's version information */
-typedef struct {
- int major;
- int minor;
-} MiscPrivRec, *MiscPrivPtr;
-
-#define M_GETPRIV(c) ((MiscPrivPtr) \
- dixLookupPrivate(&(c)->devPrivates, MiscClientPrivateKey))
-#define M_SETPRIV(c,p) \
- dixSetPrivate(&(c)->devPrivates, MiscClientPrivateKey, p)
-
-static void XF86MiscResetProc(
- ExtensionEntry* /* extEntry */
-);
-
-static void
-ClientVersion(ClientPtr client, int *major, int *minor)
-{
- MiscPrivPtr pPriv;
-
- pPriv = M_GETPRIV(client);
- if (!pPriv) {
- if (major) *major = 0;
- if (minor) *minor = 0;
- return;
- }
-
- if (major) *major = pPriv->major;
- if (minor) *minor = pPriv->minor;
-}
-
-static DISPATCH_PROC(ProcXF86MiscDispatch);
-static DISPATCH_PROC(ProcXF86MiscQueryVersion);
-static DISPATCH_PROC(ProcXF86MiscGetKbdSettings);
-static DISPATCH_PROC(ProcXF86MiscGetMouseSettings);
-static DISPATCH_PROC(ProcXF86MiscSetKbdSettings);
-static DISPATCH_PROC(ProcXF86MiscSetMouseSettings);
-static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState);
-static DISPATCH_PROC(ProcXF86MiscSetClientVersion);
-static DISPATCH_PROC(ProcXF86MiscGetFilePaths);
-static DISPATCH_PROC(ProcXF86MiscPassMessage);
-#ifdef _XF86MISC_SAVER_COMPAT_
-static DISPATCH_PROC(ProcXF86MiscGetSaver);
-static DISPATCH_PROC(ProcXF86MiscSetSaver);
-#endif
-static DISPATCH_PROC(SProcXF86MiscDispatch);
-static DISPATCH_PROC(SProcXF86MiscQueryVersion);
-static DISPATCH_PROC(SProcXF86MiscGetKbdSettings);
-static DISPATCH_PROC(SProcXF86MiscGetMouseSettings);
-static DISPATCH_PROC(SProcXF86MiscSetKbdSettings);
-static DISPATCH_PROC(SProcXF86MiscSetMouseSettings);
-static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState);
-static DISPATCH_PROC(SProcXF86MiscSetClientVersion);
-static DISPATCH_PROC(SProcXF86MiscGetFilePaths);
-static DISPATCH_PROC(SProcXF86MiscPassMessage);
-#ifdef _XF86MISC_SAVER_COMPAT_
-static DISPATCH_PROC(SProcXF86MiscGetSaver);
-static DISPATCH_PROC(SProcXF86MiscSetSaver);
-#endif
-
-#if 0
-static unsigned char XF86MiscReqCode = 0;
-#endif
-
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF x;
-#else
-# define DEBUG_P(x) do {} while (0)
-#endif
-
-#define MISCERR(x) (miscErrorBase + x)
-
-void
-XFree86MiscExtensionInit(void)
-{
- ExtensionEntry* extEntry;
-
- if (!xf86GetModInDevEnabled())
- return;
-
- if (
- (extEntry = AddExtension(XF86MISCNAME,
- XF86MiscNumberEvents,
- XF86MiscNumberErrors,
- ProcXF86MiscDispatch,
- SProcXF86MiscDispatch,
- XF86MiscResetProc,
- StandardMinorOpcode))) {
-#if 0
- XF86MiscReqCode = (unsigned char)extEntry->base;
-#endif
- miscErrorBase = extEntry->errorBase;
- }
-}
-
-/*ARGSUSED*/
-static void
-XF86MiscResetProc (extEntry)
- ExtensionEntry* extEntry;
-{
-}
-
-static int
-ProcXF86MiscQueryVersion(client)
- register ClientPtr client;
-{
- xXF86MiscQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xXF86MiscQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XF86MISC_MAJOR_VERSION;
- rep.minorVersion = XF86MISC_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xXF86MiscQueryVersionReply), (char *)&rep);
- return (client->noClientException);
-}
-
-#ifdef _XF86MISC_SAVER_COMPAT_
-/* THESE HAVE NOT BEEN CONVERTED TO THE NEW DESIGN */
-
-/*
- * This will go away, but remains for now for compatibility with older
- * clients.
- */
-static int
-ProcXF86MiscSetSaver(client)
- register ClientPtr client;
-{
- REQUEST(xXF86MiscSetSaverReq);
- ScrnInfoPtr vptr;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- vptr = (ScrnInfoPtr)
- dixLookupPrivate(&screenInfo.screens[stuff->screen]->devPrivates,
- xf86ScreenKey);
-
- REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq);
-
- if (stuff->suspendTime < 0)
- return BadValue;
- if (stuff->offTime < 0)
- return BadValue;
-
- return (client->noClientException);
-}
-
-/*
- * This will go away, but remains for now for compatibility with older
- * clients.
- */
-static int
-ProcXF86MiscGetSaver(client)
- register ClientPtr client;
-{
- REQUEST(xXF86MiscGetSaverReq);
- xXF86MiscGetSaverReply rep;
- register int n;
- ScrnInfoPtr vptr;
-
- if (stuff->screen > screenInfo.numScreens)
- return BadValue;
-
- vptr = (ScrnInfoPtr)
- dixLookupPrivate(&screenInfo.screens[stuff->screen]->devPrivates,
- xf86ScreenKey);
-
- REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.suspendTime = 0;
- rep.offTime = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.suspendTime, n);
- swapl(&rep.offTime, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetSaverReply), (char *)&rep);
- return (client->noClientException);
-}
-
-#endif /* _XF86MISC_SAVER_COMPAT_ */
-
-static int
-ProcXF86MiscGetMouseSettings(client)
- register ClientPtr client;
-{
- xXF86MiscGetMouseSettingsReply rep;
- char *devname;
- pointer mouse;
- register int n;
- int devnamelen;
-
- REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
-
- if (!MiscExtGetMouseSettings(&mouse, &devname))
- return BadValue;
-
- rep.mousetype = MiscExtGetMouseValue(mouse, MISC_MSE_PROTO);
- rep.baudrate = MiscExtGetMouseValue(mouse, MISC_MSE_BAUDRATE);
- rep.samplerate = MiscExtGetMouseValue(mouse, MISC_MSE_SAMPLERATE);
- rep.resolution = MiscExtGetMouseValue(mouse, MISC_MSE_RESOLUTION);
- rep.buttons = MiscExtGetMouseValue(mouse, MISC_MSE_BUTTONS);
- rep.emulate3buttons = MiscExtGetMouseValue(mouse, MISC_MSE_EM3BUTTONS);
- rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT);
- rep.chordmiddle = MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE);
- rep.flags = MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS);
- devnamelen = rep.devnamelen = (devname? strlen(devname): 0);
- rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) -
- sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.mousetype, n);
- swapl(&rep.baudrate, n);
- swapl(&rep.samplerate, n);
- swapl(&rep.resolution, n);
- swapl(&rep.buttons, n);
- swapl(&rep.emulate3buttons, n);
- swapl(&rep.emulate3timeout, n);
- swapl(&rep.chordmiddle, n);
- swapl(&rep.flags, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep);
- MiscExtDestroyStruct(mouse, MISC_POINTER);
-
- if (devnamelen)
- WriteToClient(client, devnamelen, devname);
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscGetKbdSettings(client)
- register ClientPtr client;
-{
- xXF86MiscGetKbdSettingsReply rep;
- pointer kbd;
- register int n;
-
- REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (!MiscExtGetKbdSettings(&kbd))
- return BadValue;
-
- rep.kbdtype = MiscExtGetKbdValue(kbd, MISC_KBD_TYPE);
- rep.rate = MiscExtGetKbdValue(kbd, MISC_KBD_RATE);
- rep.delay = MiscExtGetKbdValue(kbd, MISC_KBD_DELAY);
- rep.servnumlock = MiscExtGetKbdValue(kbd, MISC_KBD_SERVNUMLOCK);
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.kbdtype, n);
- swapl(&rep.rate, n);
- swapl(&rep.delay, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetKbdSettingsReply), (char *)&rep);
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetMouseSettings(client)
- register ClientPtr client;
-{
- MiscExtReturn ret;
- pointer mouse;
- char *devname = NULL;
- int major, minor;
-
- REQUEST(xXF86MiscSetMouseSettingsReq);
-
- REQUEST_AT_LEAST_SIZE(xXF86MiscSetMouseSettingsReq);
-
- ClientVersion(client, &major, &minor);
-
- if (xf86GetVerbosity() > 1) {
- DEBUG_P(("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n",
- (int)stuff->mousetype, (int)stuff->baudrate,
- (int)stuff->samplerate, stuff->chordmiddle));
- DEBUG_P((" em3but: %d em3tim: %d res: %d flags: %ld\n",
- stuff->emulate3buttons, (int)stuff->emulate3timeout,
- (int)stuff->resolution, (unsigned long)stuff->flags));
- }
-
- if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0)
- return BadAlloc;
-
- MiscExtSetMouseValue(mouse, MISC_MSE_PROTO, stuff->mousetype);
- MiscExtSetMouseValue(mouse, MISC_MSE_BAUDRATE, stuff->baudrate);
- MiscExtSetMouseValue(mouse, MISC_MSE_SAMPLERATE, stuff->samplerate);
- MiscExtSetMouseValue(mouse, MISC_MSE_RESOLUTION, stuff->resolution);
- MiscExtSetMouseValue(mouse, MISC_MSE_BUTTONS, stuff->buttons);
- MiscExtSetMouseValue(mouse, MISC_MSE_EM3BUTTONS, stuff->emulate3buttons);
- MiscExtSetMouseValue(mouse, MISC_MSE_EM3TIMEOUT, stuff->emulate3timeout);
- MiscExtSetMouseValue(mouse, MISC_MSE_CHORDMIDDLE, stuff->chordmiddle);
- MiscExtSetMouseValue(mouse, MISC_MSE_FLAGS, stuff->flags);
-
- if ((major > 0 || minor > 5) && stuff->devnamelen) {
- int size = sizeof(xXF86MiscSetMouseSettingsReq) + stuff->devnamelen;
- size = (size + 3) >> 2;
- if (client->req_len < size)
- return BadLength;
- if (stuff->devnamelen) {
- if (!(devname = xalloc(stuff->devnamelen)))
- return BadAlloc;
- strncpy(devname,(char*)(&stuff[1]),stuff->devnamelen);
- if (xf86GetVerbosity() > 1)
- DEBUG_P(("SetMouseSettings - device: %s\n",devname));
- MiscExtSetMouseDevice(mouse, devname);
- }
- }
-
- ret = MiscExtApply(mouse, MISC_POINTER);
-
- if (devname)
- xfree(devname);
-
- switch ((ret)) {
- case MISC_RET_SUCCESS: break;
- case MISC_RET_BADVAL: return BadValue;
- case MISC_RET_BADMSEPROTO: return MISCERR(XF86MiscBadMouseProtocol);
- case MISC_RET_BADBAUDRATE: return MISCERR(XF86MiscBadMouseBaudRate);
- case MISC_RET_BADFLAGS: return MISCERR(XF86MiscBadMouseFlags);
- case MISC_RET_BADCOMBO: return MISCERR(XF86MiscBadMouseCombo);
- case MISC_RET_NOMODULE: return MISCERR(XF86MiscNoModule);
- default:
- DEBUG_P(("Unexpected return from MiscExtApply(POINTER) = %d\n", ret));
- return BadImplementation;
- }
-
- if (xf86GetVerbosity() > 1)
- DEBUG_P(("SetMouseSettings - Succeeded\n"));
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetKbdSettings(client)
- register ClientPtr client;
-{
- MiscExtReturn ret;
- pointer kbd;
- REQUEST(xXF86MiscSetKbdSettingsReq);
-
- REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
-
- if (xf86GetVerbosity() > 1)
- DEBUG_P(("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n",
- (int)stuff->kbdtype, (int)stuff->rate,
- (int)stuff->delay, stuff->servnumlock));
-
- if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
- return BadAlloc;
-
- MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, stuff->kbdtype);
- MiscExtSetKbdValue(kbd, MISC_KBD_RATE, stuff->rate);
- MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, stuff->delay);
- MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, stuff->servnumlock);
-
- switch ((ret = MiscExtApply(kbd, MISC_KEYBOARD))) {
- case MISC_RET_SUCCESS: break;
- case MISC_RET_BADVAL: return BadValue;
- case MISC_RET_BADKBDTYPE: return MISCERR(XF86MiscBadKbdType);
- default:
- DEBUG_P(("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret));
- return BadImplementation;
- }
-
- if (xf86GetVerbosity() > 1)
- DEBUG_P(("SetKbdSettings - Succeeded\n"));
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetGrabKeysState(client)
- register ClientPtr client;
-{
- int n, status;
- xXF86MiscSetGrabKeysStateReply rep;
- REQUEST(xXF86MiscSetGrabKeysStateReq);
-
- REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
-
- if ((status = MiscExtSetGrabKeysState(client, stuff->enable)) == 0) {
- if (xf86GetVerbosity() > 1)
- DEBUG_P(("SetGrabKeysState - %s\n",
- stuff->enable ? "enabled" : "disabled"));
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.status = status;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscSetGrabKeysStateReply), (char *)&rep);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscSetClientVersion(ClientPtr client)
-{
- REQUEST(xXF86MiscSetClientVersionReq);
-
- MiscPrivPtr pPriv;
-
- REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
-
- if ((pPriv = M_GETPRIV(client)) == NULL) {
- pPriv = xalloc(sizeof(MiscPrivRec));
- if (!pPriv)
- return BadAlloc;
- M_SETPRIV(client, pPriv);
- }
- if (xf86GetVerbosity() > 1)
- DEBUG_P(("SetClientVersion: %i %i\n",stuff->major,stuff->minor));
- pPriv->major = stuff->major;
- pPriv->minor = stuff->minor;
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscGetFilePaths(client)
- register ClientPtr client;
-{
- xXF86MiscGetFilePathsReply rep;
- const char *configfile;
- const char *modulepath;
- const char *logfile;
- register int n;
- int configlen, modulelen, loglen;
-
- REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
-
- if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile))
- return BadValue;
-
- configlen = rep.configlen = (configfile? strlen(configfile): 0);
- modulelen = rep.modulelen = (modulepath? strlen(modulepath): 0);
- loglen = rep.loglen = (logfile? strlen(logfile): 0);
- rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) +
- ((rep.configlen + 3) & ~3) +
- ((rep.modulelen + 3) & ~3) +
- ((rep.loglen + 3) & ~3) ) >> 2;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.configlen, n);
- swaps(&rep.modulelen, n);
- swaps(&rep.loglen, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep);
-
- if (configlen)
- WriteToClient(client, configlen, (char *)configfile);
- if (modulelen)
- WriteToClient(client, modulelen, (char *)modulepath);
- if (loglen)
- WriteToClient(client, loglen, (char *)logfile);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscPassMessage(client)
- register ClientPtr client;
-{
- xXF86MiscPassMessageReply rep;
- char *msgtype, *msgval, *retstr;
- int retval, size;
- register int n;
- int mesglen;
-
- REQUEST(xXF86MiscPassMessageReq);
-
- REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq);
- size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2;
- size+= (stuff->typelen + 3) >> 2;
- size+= (stuff->vallen + 3) >> 2;
- if (client->req_len < size)
- return BadLength;
- if (stuff->typelen) {
- if (!(msgtype = xalloc(stuff->typelen)))
- return BadAlloc;
- strncpy(msgtype,(char*)(&stuff[1]),stuff->typelen);
- } else return BadValue;
- if (stuff->vallen) {
- if (!(msgval = xalloc(stuff->vallen))) {
- xfree(msgtype);
- return BadAlloc;
- }
- strncpy(msgval,(char*)((char*)&stuff[1] + ((stuff->typelen + 3) & ~3)),
- stuff->vallen);
- } else {
- xfree(msgtype);
- return BadValue;
- }
-
- if ((retval = MiscExtPassMessage(stuff->screen,msgtype,msgval,&retstr)) != 0) {
- xfree(msgtype);
- xfree(msgval);
- return retval;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- mesglen = rep.mesglen = (retstr? strlen(retstr): 0);
- rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) +
- ((rep.mesglen + 3) & ~3)) >> 2;
- rep.status = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.mesglen, n);
- }
- WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep);
-
- if (mesglen)
- WriteToClient(client, mesglen, (char *)retstr);
-
- xfree(msgtype);
- xfree(msgval);
-
- return (client->noClientException);
-}
-
-static int
-ProcXF86MiscDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86MiscQueryVersion:
- return ProcXF86MiscQueryVersion(client);
-#ifdef _XF86MISC_SAVER_COMPAT_
- case X_XF86MiscGetSaver:
- return ProcXF86MiscGetSaver(client);
- case X_XF86MiscSetSaver:
- return ProcXF86MiscSetSaver(client);
-#endif
- case X_XF86MiscGetMouseSettings:
- return ProcXF86MiscGetMouseSettings(client);
- case X_XF86MiscGetKbdSettings:
- return ProcXF86MiscGetKbdSettings(client);
- case X_XF86MiscSetClientVersion:
- return ProcXF86MiscSetClientVersion(client);
- case X_XF86MiscGetFilePaths:
- return ProcXF86MiscGetFilePaths(client);
- case X_XF86MiscPassMessage:
- return ProcXF86MiscPassMessage(client);
- default:
- if (!xf86GetModInDevEnabled())
- return miscErrorBase + XF86MiscModInDevDisabled;
- if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) {
- switch (stuff->data) {
- case X_XF86MiscSetMouseSettings:
- return ProcXF86MiscSetMouseSettings(client);
- case X_XF86MiscSetKbdSettings:
- return ProcXF86MiscSetKbdSettings(client);
- case X_XF86MiscSetGrabKeysState:
- return ProcXF86MiscSetGrabKeysState(client);
- default:
- return BadRequest;
- }
- } else
- return miscErrorBase + XF86MiscModInDevClientNotLocal;
- }
-}
-
-static int
-SProcXF86MiscQueryVersion(client)
- register ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcXF86MiscQueryVersion(client);
-}
-
-#ifdef _XF86MISC_SAVER_COMPAT_
-static int
-SProcXF86MiscGetSaver(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetSaverReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq);
- swaps(&stuff->screen, n);
- return ProcXF86MiscGetSaver(client);
-}
-
-static int
-SProcXF86MiscSetSaver(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetSaverReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq);
- swaps(&stuff->screen, n);
- swapl(&stuff->suspendTime, n);
- swapl(&stuff->offTime, n);
- return ProcXF86MiscSetSaver(client);
-}
-#endif /* _XF86MISC_SAVER_COMPAT_ */
-
-static int
-SProcXF86MiscGetMouseSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetMouseSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
- return ProcXF86MiscGetMouseSettings(client);
-}
-
-static int
-SProcXF86MiscGetKbdSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetKbdSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
- return ProcXF86MiscGetKbdSettings(client);
-}
-
-static int
-SProcXF86MiscSetMouseSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetMouseSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetMouseSettingsReq);
- swapl(&stuff->mousetype, n);
- swapl(&stuff->baudrate, n);
- swapl(&stuff->samplerate, n);
- swapl(&stuff->resolution, n);
- swapl(&stuff->buttons, n);
- swapl(&stuff->emulate3timeout, n);
- swapl(&stuff->flags, n);
- return ProcXF86MiscSetMouseSettings(client);
-}
-
-static int
-SProcXF86MiscSetKbdSettings(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetKbdSettingsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
- swapl(&stuff->kbdtype, n);
- swapl(&stuff->rate, n);
- swapl(&stuff->delay, n);
- return ProcXF86MiscSetKbdSettings(client);
-}
-
-static int
-SProcXF86MiscSetGrabKeysState(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscSetGrabKeysStateReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
- swaps(&stuff->enable, n);
- return ProcXF86MiscSetGrabKeysState(client);
-}
-
-static int
-SProcXF86MiscSetClientVersion(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86MiscSetClientVersionReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
- swaps(&stuff->major, n);
- swaps(&stuff->minor, n);
- return ProcXF86MiscSetClientVersion(client);
-}
-
-static int
-SProcXF86MiscGetFilePaths(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscGetFilePathsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
- return ProcXF86MiscGetFilePaths(client);
-}
-
-static int
-SProcXF86MiscPassMessage(client)
- ClientPtr client;
-{
- register int n;
- REQUEST(xXF86MiscPassMessageReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86MiscPassMessageReq);
- return ProcXF86MiscPassMessage(client);
-}
-
-static int
-SProcXF86MiscDispatch (client)
- register ClientPtr client;
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86MiscQueryVersion:
- return SProcXF86MiscQueryVersion(client);
-#ifdef _XF86MISC_SAVER_COMPAT_
- case X_XF86MiscGetSaver:
- return SProcXF86MiscGetSaver(client);
- case X_XF86MiscSetSaver:
- return SProcXF86MiscSetSaver(client);
-#endif
- case X_XF86MiscGetMouseSettings:
- return SProcXF86MiscGetMouseSettings(client);
- case X_XF86MiscGetKbdSettings:
- return SProcXF86MiscGetKbdSettings(client);
- case X_XF86MiscSetClientVersion:
- return SProcXF86MiscSetClientVersion(client);
- case X_XF86MiscGetFilePaths:
- return SProcXF86MiscGetFilePaths(client);
- case X_XF86MiscPassMessage:
- return SProcXF86MiscPassMessage(client);
- default:
- if (!xf86GetModInDevEnabled())
- return miscErrorBase + XF86MiscModInDevDisabled;
- if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) {
- switch (stuff->data) {
- case X_XF86MiscSetMouseSettings:
- return SProcXF86MiscSetMouseSettings(client);
- case X_XF86MiscSetKbdSettings:
- return SProcXF86MiscSetKbdSettings(client);
- case X_XF86MiscSetGrabKeysState:
- return SProcXF86MiscSetGrabKeysState(client);
- default:
- return BadRequest;
- }
- } else
- return miscErrorBase + XF86MiscModInDevClientNotLocal;
- }
-}
-
diff --git a/hw/xfree86/dixmods/extmod/xf86miscproc.h b/hw/xfree86/dixmods/extmod/xf86miscproc.h
deleted file mode 100644
index 93b193ca7..000000000
--- a/hw/xfree86/dixmods/extmod/xf86miscproc.h
+++ /dev/null
@@ -1,69 +0,0 @@
-
-/* Prototypes for Pointer/Keyboard functions that the DDX must provide */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _XF86MISCPROC_H_
-#define _XF86MISCPROC_H_
-
-typedef enum {
- MISC_MSE_PROTO,
- MISC_MSE_BAUDRATE,
- MISC_MSE_SAMPLERATE,
- MISC_MSE_RESOLUTION,
- MISC_MSE_BUTTONS,
- MISC_MSE_EM3BUTTONS,
- MISC_MSE_EM3TIMEOUT,
- MISC_MSE_CHORDMIDDLE,
- MISC_MSE_FLAGS
-} MiscExtMseValType;
-
-typedef enum {
- MISC_KBD_TYPE,
- MISC_KBD_RATE,
- MISC_KBD_DELAY,
- MISC_KBD_SERVNUMLOCK
-} MiscExtKbdValType;
-
-typedef enum {
- MISC_RET_SUCCESS,
- MISC_RET_BADVAL,
- MISC_RET_BADMSEPROTO,
- MISC_RET_BADBAUDRATE,
- MISC_RET_BADFLAGS,
- MISC_RET_BADCOMBO,
- MISC_RET_BADKBDTYPE,
- MISC_RET_NOMODULE
-} MiscExtReturn;
-
-typedef enum {
- MISC_POINTER,
- MISC_KEYBOARD
-} MiscExtStructType;
-
-#define MISC_MSEFLAG_CLEARDTR 1
-#define MISC_MSEFLAG_CLEARRTS 2
-#define MISC_MSEFLAG_REOPEN 128
-
-void XFree86MiscExtensionInit(void);
-
-Bool MiscExtGetMouseSettings(pointer *mouse, char **devname);
-int MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype);
-Bool MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value);
-Bool MiscExtGetKbdSettings(pointer *kbd);
-int MiscExtGetKbdValue(pointer kbd, MiscExtKbdValType valtype);
-Bool MiscExtSetKbdValue(pointer kbd, MiscExtKbdValType valtype, int value);
-int MiscExtSetGrabKeysState(ClientPtr client, int enable);
-pointer MiscExtCreateStruct(MiscExtStructType mse_or_kbd);
-void MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd);
-MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd);
-Bool MiscExtSetMouseDevice(pointer mouse, char* device);
-Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath,
- const char **logfile);
-int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval,
- char **retstr);
-
-#endif
-
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 5713ca17c..eba52ec6a 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -409,9 +409,6 @@ _X_HIDDEN void *dixLookupTab[] = {
#ifdef XF86DRI
SYMVAR(noXFree86DRIExtension)
#endif
-#ifdef XF86MISC
- SYMVAR(noXFree86MiscExtension)
-#endif
#ifdef XF86VIDMODE
SYMVAR(noXFree86VidModeExtension)
#endif
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index e5373062d..5f0a683bc 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -76,7 +76,6 @@
#include "dpmsproc.h"
#endif
#include "vidmodeproc.h"
-#include "xf86miscproc.h"
#include "loader.h"
#include "xisb.h"
#include "vbe.h"
@@ -642,23 +641,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(VidModeGetGammaRampSize)
#endif
- /* xf86MiscExt.c */
-#ifdef XF86MISC
- SYMFUNC(MiscExtGetMouseSettings)
- SYMFUNC(MiscExtGetMouseValue)
- SYMFUNC(MiscExtSetMouseValue)
- SYMFUNC(MiscExtSetMouseDevice)
- SYMFUNC(MiscExtGetKbdSettings)
- SYMFUNC(MiscExtGetKbdValue)
- SYMFUNC(MiscExtSetKbdValue)
- SYMFUNC(MiscExtSetGrabKeysState)
- SYMFUNC(MiscExtCreateStruct)
- SYMFUNC(MiscExtDestroyStruct)
- SYMFUNC(MiscExtApply)
- SYMFUNC(MiscExtGetFilePaths)
- SYMFUNC(MiscExtPassMessage)
-#endif
-
/* Misc */
SYMFUNC(GetTimeInMillis)
diff --git a/hw/xfree86/os-support/misc/Makefile.am b/hw/xfree86/os-support/misc/Makefile.am
index 65fbe92b4..ad27cfc2b 100644
--- a/hw/xfree86/os-support/misc/Makefile.am
+++ b/hw/xfree86/os-support/misc/Makefile.am
@@ -12,7 +12,7 @@ ILHACK_SRCS = xf86_IlHack.c
noinst_LTLIBRARIES = libmisc.la
-libmisc_la_SOURCES = xf86_Util.c Delay.c $(ARCH_SRCS)
+libmisc_la_SOURCES = Delay.c $(ARCH_SRCS)
#AM_LDFLAGS = -r
diff --git a/hw/xfree86/os-support/misc/xf86_Util.c b/hw/xfree86/os-support/misc/xf86_Util.c
deleted file mode 100644
index 9e690591d..000000000
--- a/hw/xfree86/os-support/misc/xf86_Util.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * 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 David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. David Wexelblat makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT 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.
- *
- */
-
-/*
- * This file is for utility functions that will be shared by other pieces
- * of the system. Putting things here ensure that all the linking order
- * dependencies are dealt with, as this library will be linked in last.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <ctype.h>
-
-/* To prevent empty source file warnings */
-int _xf86misc;
-
-#if 0
-/* For use only with gcc */
-#ifdef __GNUC__
-
-#include "os.h"
-
-char *
-debug_alloca(char *file, int line, int size)
-{
- char *ptr;
-
- ptr = Xalloc(size);
- ErrorF("Alloc: %s line %d; ptr = 0x%x, length = %d\n", file, line,
- ptr, size);
- return ptr;
-}
-
-void
-debug_dealloca(char *file, int line, char *ptr)
-{
- ErrorF("Dealloc: %s line %d; ptr = 0x%x\n", file, line, ptr);
- Xfree(ptr);
-}
-#endif
-#endif
-
-#if defined(ISC) || defined(Lynx)
-
-#include <math.h>
-
-/* Needed for apm_driver.c */
-/* These functions are modeled after the functions inside gnu's libc */
-
-static double
-copysign(double x, double y)
-{
- x = fabs(x);
- return y < 0 ? - x : x;
-}
-
-double
-RInt(double x)
-{
- double s,t;
- const double one = 1.0;
- const static double L = 4503599627370496.0E0;
-
- if (x!=x)
- return(x);
- if (copysign(x,one) >= L)
- return(x);
- s = copysign(L,x);
- t = x + s;
- return (t - s);
-}
-#endif
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index 6a850cd44..550c5a04e 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -30,9 +30,6 @@
#include <xwin-config.h>
#endif
#include "win.h"
-#ifdef XWIN_CLIPBOARD
-# include "../../Xext/xf86miscproc.h"
-#endif
#include "dixstruct.h"
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 06549183d..3b60fb1ba 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -359,9 +359,6 @@
/* Build XFree86 BigFont extension */
#undef XF86BIGFONT
-/* Support XFree86 miscellaneous extensions */
-#undef XF86MISC
-
/* Support XFree86 Video Mode extension */
#undef XF86VIDMODE
diff --git a/include/globals.h b/include/globals.h
index 0aba78ae1..9573abdee 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -129,10 +129,6 @@ extern Bool noXFree86DGAExtension;
extern Bool noXFree86DRIExtension;
#endif
-#ifdef XF86MISC
-extern Bool noXFree86MiscExtension;
-#endif
-
#ifdef XF86VIDMODE
extern Bool noXFree86VidModeExtension;
#endif
diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in
index 0fee53da8..bab9bb9d2 100644
--- a/include/xorg-server.h.in
+++ b/include/xorg-server.h.in
@@ -106,9 +106,6 @@
/* Build XFree86 BigFont extension */
#undef XF86BIGFONT
-/* Support XFree86 miscellaneous extensions */
-#undef XF86MISC
-
/* Support XFree86 Video Mode extension */
#undef XF86VIDMODE
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 31f994554..fc1ac64e6 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -66,7 +66,6 @@ SOFTWARE.
#ifdef HAVE_KDRIVE_CONFIG_H
#include <kdrive-config.h>
/* there must be a better way... */
-#undef XF86MISC
#undef XFreeXDGA
#undef XF86DRI
#undef XF86VIDMODE
@@ -74,7 +73,6 @@ SOFTWARE.
#ifdef HAVE_XGL_CONFIG_H
#include <xgl-config.h>
-#undef XF86MISC
#undef XFreeXDGA
#undef XF86DRI
#undef XF86VIDMODE
@@ -151,9 +149,6 @@ extern Bool noXFree86DGAExtension;
#ifdef XF86DRI
extern Bool noXFree86DRIExtension;
#endif
-#ifdef XF86MISC
-extern Bool noXFree86MiscExtension;
-#endif
#ifdef XF86VIDMODE
extern Bool noXFree86VidModeExtension;
#endif
@@ -274,9 +269,6 @@ extern void XFree86BigfontExtensionInit(INITARGS);
#ifdef XF86VIDMODE
extern void XFree86VidModeExtensionInit(INITARGS);
#endif
-#ifdef XF86MISC
-extern void XFree86MiscExtensionInit(INITARGS);
-#endif
#ifdef XFreeXDGA
extern void XFree86DGAExtensionInit(INITARGS);
#endif
@@ -396,9 +388,6 @@ static ExtensionToggle ExtensionToggleList[] =
#ifdef XF86DRI
{ "XFree86-DRI", &noXFree86DRIExtension },
#endif
-#ifdef XF86MISC
- { "XFree86-Misc", &noXFree86MiscExtension },
-#endif
#ifdef XF86VIDMODE
{ "XFree86-VidModeExtension", &noXFree86VidModeExtension },
#endif
@@ -525,9 +514,6 @@ InitExtensions(int argc, char *argv[])
#if defined(XF86VIDMODE)
if (!noXFree86VidModeExtension) XFree86VidModeExtensionInit();
#endif
-#if defined(XF86MISC)
- if (!noXFree86MiscExtension) XFree86MiscExtensionInit();
-#endif
#if defined(XFreeXDGA)
if (!noXFree86DGAExtension) XFree86DGAExtensionInit();
#endif
diff --git a/os/utils.c b/os/utils.c
index e885666ee..0db34a729 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -196,9 +196,6 @@ _X_EXPORT Bool noXFree86DGAExtension = FALSE;
#ifdef XF86DRI
_X_EXPORT Bool noXFree86DRIExtension = FALSE;
#endif
-#ifdef XF86MISC
-_X_EXPORT Bool noXFree86MiscExtension = FALSE;
-#endif
#ifdef XF86VIDMODE
_X_EXPORT Bool noXFree86VidModeExtension = FALSE;
#endif