2 * Copyright (c) 1997 Matthieu Herrb
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Matthieu Herrb not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission. Matthieu Herrb makes no
11 * representations about the suitability of this software for any purpose.
12 * It is provided "as is" without express or implied warranty.
14 * MATTHIEU HERRB DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL MATTHIEU HERRB BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
23 #ifdef HAVE_XORG_CONFIG_H
24 #include <xorg-config.h>
27 #include "xf86Module.h"
30 #include <X11/Xproto.h>
35 static MODULESETUPPROTO(extmodSetup);
38 * Array describing extensions to be initialized
40 static ExtensionModule extensionModules[] = {
44 SELINUX_EXTENSION_NAME,
52 ScreenSaverExtensionInit,
54 &noScreenSaverExtension,
61 XFree86VidModeExtensionInit,
63 &noXFree86VidModeExtension,
70 XFree86DGAExtensionInit,
72 &noXFree86DGAExtension,
111 { /* DON'T delete this entry ! */
120 static XF86ModuleVersionInfo VersRec =
126 XORG_VERSION_CURRENT,
129 ABI_EXTENSION_VERSION,
135 * Data for the loader
137 _X_EXPORT XF86ModuleData extmodModuleData = { &VersRec, extmodSetup, NULL };
140 extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin)
144 /* XXX the option stuff here is largely a sample/test case */
146 for (i = 0; extensionModules[i].name != NULL; i++) {
149 s = (char *)malloc(strlen(extensionModules[i].name) + 5);
153 strcat(s, extensionModules[i].name);
154 o = xf86FindOption(opts, s);
157 xf86MarkOptionUsed(o);
164 if (! strcmp(SELINUX_EXTENSION_NAME, extensionModules[i].name)) {
166 selinuxEnforcingState = SELINUX_MODE_DEFAULT;
168 if ((o = xf86FindOption(opts, "SELinux mode disabled"))) {
169 xf86MarkOptionUsed(o);
170 selinuxEnforcingState = SELINUX_MODE_DISABLED;
172 if ((o = xf86FindOption(opts, "SELinux mode permissive"))) {
173 xf86MarkOptionUsed(o);
174 selinuxEnforcingState = SELINUX_MODE_PERMISSIVE;
176 if ((o = xf86FindOption(opts, "SELinux mode enforcing"))) {
177 xf86MarkOptionUsed(o);
178 selinuxEnforcingState = SELINUX_MODE_ENFORCING;
183 LoadExtension(&extensionModules[i], FALSE);
185 /* Need a non-NULL return */