summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2020-09-09 10:51:24 +0200
committerOlivier Fourdan <fourdan@gmail.com>2021-01-29 12:52:09 +0000
commit3cdac5ba07a79761652d960e0e907601f82718bc (patch)
tree459b3da7c79d56029c10fe0c02a4bf3dd25843ad
parenta81c98e42a954580ca0d43c89169dc2069c87b96 (diff)
mi: List extensions in usage message
Not all extensions can be enabled or disabled at runtime, list the extensions which can from the help message rather than on error only. v2: * Print the header message in the ListStaticExtensions() (Peter Hutterer) * Do not export ListStaticExtensions() as Xserver API Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
-rw-r--r--hw/dmx/Makefile.am1
-rw-r--r--hw/dmx/meson.build1
-rw-r--r--hw/kdrive/src/Makefile.am3
-rw-r--r--hw/kdrive/src/meson.build1
-rw-r--r--hw/vfb/Makefile.am3
-rw-r--r--hw/vfb/meson.build1
-rw-r--r--hw/xfree86/dixmods/Makefile.am4
-rw-r--r--hw/xfree86/meson.build3
-rw-r--r--hw/xnest/Makefile.am3
-rw-r--r--hw/xnest/meson.build1
-rw-r--r--hw/xquartz/Makefile.am1
-rw-r--r--hw/xquartz/meson.build1
-rw-r--r--hw/xwayland/Makefile.am3
-rw-r--r--hw/xwayland/meson.build1
-rw-r--r--hw/xwin/Makefile.am1
-rw-r--r--hw/xwin/meson.build1
-rw-r--r--mi/miinitext.c26
-rw-r--r--mi/miinitext.h83
-rw-r--r--os/utils.c3
-rw-r--r--test/meson.build1
20 files changed, 128 insertions, 14 deletions
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index eef84cb66..fac1f1060 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -65,6 +65,7 @@ Xdmx_SOURCES = dmx.c \
dmxwindow.c \
dmxwindow.h \
$(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h \
$(GLX_SRCS)
diff --git a/hw/dmx/meson.build b/hw/dmx/meson.build
index 877466eaf..d075e5c40 100644
--- a/hw/dmx/meson.build
+++ b/hw/dmx/meson.build
@@ -20,6 +20,7 @@ srcs = [
'dmxvisual.c',
'dmxwindow.c',
'../../mi/miinitext.c',
+ '../../mi/miinitext.h',
'../../Xext/panoramiX.c',
]
diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am
index 13ab6847a..b1331dae6 100644
--- a/hw/kdrive/src/Makefile.am
+++ b/hw/kdrive/src/Makefile.am
@@ -20,7 +20,8 @@ libkdrive_la_SOURCES = \
kinput.c \
kshadow.c \
$(KDRIVE_XV_SOURCES) \
- $(top_srcdir)/mi/miinitext.c
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h
if CONFIG_UDEV
libkdrive_la_LIBADD = $(top_builddir)/config/libconfig.la
diff --git a/hw/kdrive/src/meson.build b/hw/kdrive/src/meson.build
index f57040745..fbc0727e9 100644
--- a/hw/kdrive/src/meson.build
+++ b/hw/kdrive/src/meson.build
@@ -5,6 +5,7 @@ srcs_kdrive = [
'kinput.c',
'kshadow.c',
'../../../mi/miinitext.c',
+ '../../../mi/miinitext.h',
]
if build_xv
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index 70333976c..a4b45264f 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -8,7 +8,8 @@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
SRCS = InitInput.c \
InitOutput.c \
- $(top_srcdir)/mi/miinitext.c
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h
Xvfb_SOURCES = $(SRCS)
diff --git a/hw/vfb/meson.build b/hw/vfb/meson.build
index 537e96a72..7332866b3 100644
--- a/hw/vfb/meson.build
+++ b/hw/vfb/meson.build
@@ -2,6 +2,7 @@ srcs = [
'InitInput.c',
'InitOutput.c',
'../../mi/miinitext.c',
+ '../../mi/miinitext.h',
]
xvfb_server = executable(
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index f658e38c2..3d5811066 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -35,5 +35,7 @@ libshadow_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la
libshadow_la_SOURCES = shmodule.c
-libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c
+libdixmods_la_SOURCES = \
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h
libdixmods_la_CFLAGS = $(AM_CFLAGS)
diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build
index 8fed4bf63..c2b5088ba 100644
--- a/hw/xfree86/meson.build
+++ b/hw/xfree86/meson.build
@@ -40,7 +40,8 @@ subdir('ramdac')
subdir('xkb')
srcs_xorg = [
- '../../mi/miinitext.c'
+ '../../mi/miinitext.c',
+ '../../mi/miinitext.h',
]
# Extract all the objects so that all symbols get brought into the
diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am
index c77da6412..3342f9e13 100644
--- a/hw/xnest/Makefile.am
+++ b/hw/xnest/Makefile.am
@@ -41,7 +41,8 @@ SRCS = Args.c \
XNPixmap.h \
XNWindow.h \
xnest-config.h \
- $(top_srcdir)/mi/miinitext.c
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h
XNEST_LIBS = \
@XNEST_LIBS@ \
diff --git a/hw/xnest/meson.build b/hw/xnest/meson.build
index f143aff71..37ac5a691 100644
--- a/hw/xnest/meson.build
+++ b/hw/xnest/meson.build
@@ -16,6 +16,7 @@ srcs = [
'Visual.c',
'Window.c',
'../../mi/miinitext.c',
+ '../../mi/miinitext.h',
]
executable(
diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index 65061ae8a..ebd3e1bc7 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -21,6 +21,7 @@ DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup man
libXquartz_la_SOURCES = \
$(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h \
X11Application.m \
X11Controller.m \
applewm.c \
diff --git a/hw/xquartz/meson.build b/hw/xquartz/meson.build
index 25004f79c..d1c5f8a51 100644
--- a/hw/xquartz/meson.build
+++ b/hw/xquartz/meson.build
@@ -34,6 +34,7 @@ srcs_libxquartz = [
'quartzRandR.c',
'console_redirect.c',
'../../mi/miinitext.c',
+ '../../mi/miinitext.h',
]
libxquartz_defs = [
diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am
index d3dd54364..088ec5e66 100644
--- a/hw/xwayland/Makefile.am
+++ b/hw/xwayland/Makefile.am
@@ -41,7 +41,8 @@ Xwayland_SOURCES = \
xwayland-window-buffers.c \
xwayland-window-buffers.h \
$(top_srcdir)/Xi/stubs.c \
- $(top_srcdir)/mi/miinitext.c
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h
if GLAMOR
if GLX
diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build
index 74895bbec..e848daf0d 100644
--- a/hw/xwayland/meson.build
+++ b/hw/xwayland/meson.build
@@ -25,6 +25,7 @@ srcs = [
'xwayland-window-buffers.c',
'xwayland-window-buffers.h',
'../../mi/miinitext.c',
+ '../../mi/miinitext.h',
]
scanner_dep = dependency('wayland-scanner', native: true)
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 6ef89196a..75c2b2058 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -88,6 +88,7 @@ SRCS = InitInput.c \
windisplay.h \
XWin.rc \
$(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/mi/miinitext.h \
$(SRCS_CLIPBOARD) \
$(SRCS_MULTIWINDOW) \
$(SRCS_RANDR)
diff --git a/hw/xwin/meson.build b/hw/xwin/meson.build
index 62d9ba782..e9940ccc3 100644
--- a/hw/xwin/meson.build
+++ b/hw/xwin/meson.build
@@ -104,6 +104,7 @@ srcs_windows += [
'windisplay.c',
'windisplay.h',
'../../mi/miinitext.c',
+ '../../mi/miinitext.h',
]
rsrc = windows.compile_resources('XWin.rc', include_directories: include_directories('../../include/'))
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 358d485b3..8cb26d0c4 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -107,6 +107,8 @@ SOFTWARE.
#include "os.h"
#include "globals.h"
+#include "miinitext.h"
+
/* List of built-in (statically linked) extensions */
static const ExtensionModule staticExtensions[] = {
{GEExtensionInit, "Generic Event Extension", &noGEExtension},
@@ -182,6 +184,21 @@ static const ExtensionModule staticExtensions[] = {
#endif
};
+void
+ListStaticExtensions(void)
+{
+ const ExtensionModule *ext;
+ int i;
+
+ ErrorF(" Only the following extensions can be run-time enabled/disabled:\n");
+ for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) {
+ ext = &staticExtensions[i];
+ if (ext->disablePtr != NULL) {
+ ErrorF("\t%s\n", ext->name);
+ }
+ }
+}
+
Bool
EnableDisableExtension(const char *name, Bool enable)
{
@@ -227,14 +244,7 @@ EnableDisableExtensionError(const char *name, Bool enable)
if (enable == FALSE)
return;
}
- ErrorF("[mi] Only the following extensions can be run-time %s:\n",
- enable ? "enabled" : "disabled");
- for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) {
- ext = &staticExtensions[i];
- if (ext->disablePtr != NULL) {
- ErrorF("[mi] %s\n", ext->name);
- }
- }
+ ListStaticExtensions();
}
static ExtensionModule *ExtensionModuleList = NULL;
diff --git a/mi/miinitext.h b/mi/miinitext.h
new file mode 100644
index 000000000..a1ceb9aa8
--- /dev/null
+++ b/mi/miinitext.h
@@ -0,0 +1,83 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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 Open Group 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 Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+/*
+ * Copyright (c) 2000 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).
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef MIINITEXT_H
+#define MIINITEXT_H
+
+void ListStaticExtensions(void);
+
+#endif /* MIINITEXT_H */
diff --git a/os/utils.c b/os/utils.c
index c594acc2b..6cefc02ac 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -110,6 +110,8 @@ __stdcall unsigned long GetTickCount(void);
#include "picture.h"
+#include "miinitext.h"
+
Bool noTestExtensions;
#ifdef COMPOSITE
@@ -576,6 +578,7 @@ UseMsg(void)
ErrorF("-sigstop Enable SIGSTOP based startup\n");
ErrorF("+extension name Enable extension\n");
ErrorF("-extension name Disable extension\n");
+ ListStaticExtensions();
#ifdef XDMCP
XdmcpUseMsg();
#endif
diff --git a/test/meson.build b/test/meson.build
index d709dcf22..f1ab2576a 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -122,6 +122,7 @@ if build_xorg
# For now, requires xf86 ddx, could be adjusted to use another
unit_sources = [
'../mi/miinitext.c',
+ '../mi/miinitext.h',
'fixes.c',
'input.c',
'list.c',