aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/registry.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-01 20:12:35 +0200
committermarha <marha@users.sourceforge.net>2014-10-01 20:12:35 +0200
commit19b4b68b35a047a83bd291ee8debac1adb0e946c (patch)
treed4d4520622ecf73fa0d076dc0bf517a1189b7d9f /xorg-server/dix/registry.c
parent4e080e0165d18887e2a0fccd7f30cf20fd04b178 (diff)
parent438af0c7d4bf60b408b259c88205ff2193195466 (diff)
downloadvcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.gz
vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.bz2
vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/main/macros.h xorg-server/dix/registry.c xorg-server/hw/kdrive/ephyr/ephyrinit.c xorg-server/hw/xwin/Makefile.am xorg-server/hw/xwin/glx/.gitignore xorg-server/hw/xwin/glx/gen_gl_wrappers.py xorg-server/hw/xwin/glx/indirect.c xorg-server/hw/xwin/glx/winpriv.c xorg-server/hw/xwin/winclipboardthread.c xorg-server/hw/xwin/windisplay.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winprefs.c
Diffstat (limited to 'xorg-server/dix/registry.c')
-rwxr-xr-x[-rw-r--r--]xorg-server/dix/registry.c98
1 files changed, 61 insertions, 37 deletions
diff --git a/xorg-server/dix/registry.c b/xorg-server/dix/registry.c
index ce741c28e..aaccfbd09 100644..100755
--- a/xorg-server/dix/registry.c
+++ b/xorg-server/dix/registry.c
@@ -21,8 +21,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <dix-config.h>
#endif
-#ifdef XREGISTRY
-
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -32,6 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "registry.h"
#define BASE_SIZE 16
+
+#ifdef X_REGISTRY_REQUEST
#define CORE "X11"
#define FILENAME SERVER_MISC_CONFIG_PATH "/protocol.txt"
@@ -43,9 +43,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static FILE *fh;
static char ***requests, **events, **errors;
+static unsigned nmajor, *nminor, nevent, nerror;
+#endif
+
+#ifdef X_REGISTRY_RESOURCE
static const char **resources;
-static unsigned nmajor, *nminor, nevent, nerror, nresource;
+static unsigned nresource;
+#endif
+#if defined(X_REGISTRY_RESOURCE) || defined(X_REGISTRY_REQUEST)
/*
* File parsing routines
*/
@@ -73,7 +79,12 @@ double_size(void *p, unsigned n, unsigned size)
memset(*ptr + s, 0, f - s);
return TRUE;
}
+#endif
+#ifdef X_REGISTRY_REQUEST
+/*
+ * Request/event/error registry functions
+ */
static void
RegisterRequestName(unsigned major, unsigned minor, char *name)
{
@@ -198,28 +209,6 @@ RegisterExtensionNames(ExtensionEntry * extEntry)
}
}
-/*
- * Registration functions
- */
-
-void
-RegisterResourceName(RESTYPE resource, const char *name)
-{
- resource &= TypeMask;
-
- while (resource >= nresource) {
- if (!double_size((void*)&resources, nresource, sizeof(char *)))
- return;
- nresource = nresource ? nresource * 2 : BASE_SIZE;
- }
-
- resources[resource] = name;
-}
-
-/*
- * Lookup functions
- */
-
const char *
LookupRequestName(int major, int minor)
{
@@ -270,6 +259,26 @@ LookupErrorName(int error)
return errors[error] ? errors[error] : XREGISTRY_UNKNOWN;
}
+#endif /* X_REGISTRY_REQUEST */
+
+#ifdef X_REGISTRY_RESOURCE
+/*
+ * Resource registry functions
+ */
+
+void
+RegisterResourceName(RESTYPE resource, const char *name)
+{
+ resource &= TypeMask;
+
+ while (resource >= nresource) {
+ if (!double_size((void*)&resources, nresource, sizeof(char *)))
+ return;
+ nresource = nresource ? nresource * 2 : BASE_SIZE;
+ }
+
+ resources[resource] = name;
+}
const char *
LookupResourceName(RESTYPE resource)
@@ -280,10 +289,12 @@ LookupResourceName(RESTYPE resource)
return resources[resource] ? resources[resource] : XREGISTRY_UNKNOWN;
}
+#endif /* X_REGISTRY_RESOURCE */
void
dixFreeRegistry(void)
{
+#ifdef X_REGISTRY_REQUEST
/* Free all memory */
while (nmajor--) {
while (nminor[nmajor])
@@ -300,21 +311,30 @@ dixFreeRegistry(void)
while (nerror--)
free(errors[nerror]);
free(errors);
-
- free((void*)resources);
-
requests = NULL;
nminor = NULL;
events = NULL;
errors = NULL;
- resources = NULL;
+ nmajor = nevent = nerror = 0;
+#endif
- nmajor = nevent = nerror = nresource = 0;
+#ifdef X_REGISTRY_RESOURCE
+ free((void*)resources);
+
+ resources = NULL;
+ nresource = 0;
+#endif
+}
+void
+dixCloseRegistry(void)
+{
+#ifdef X_REGISTRY_REQUEST
if (fh) {
fclose(fh);
fh = NULL;
}
+#endif
}
/*
@@ -323,16 +343,26 @@ dixFreeRegistry(void)
void
dixResetRegistry(void)
{
+#ifdef X_REGISTRY_REQUEST
ExtensionEntry extEntry;
+#endif
dixFreeRegistry();
+#ifdef X_REGISTRY_REQUEST
/* Open the protocol file */
fh = fopen(FILENAME, "r");
if (!fh)
LogMessage(X_WARNING,
"Failed to open protocol names file " FILENAME "\n");
+ /* Add the core protocol */
+ memset(&extEntry, 0, sizeof(extEntry));
+ extEntry.name = CORE;
+ RegisterExtensionNames(&extEntry);
+#endif
+
+#ifdef X_REGISTRY_RESOURCE
/* Add built-in resources */
RegisterResourceName(RT_NONE, "NONE");
RegisterResourceName(RT_WINDOW, "WINDOW");
@@ -344,11 +374,5 @@ dixResetRegistry(void)
RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB");
-
- /* Add the core protocol */
- memset(&extEntry, 0, sizeof(extEntry));
- extEntry.name = CORE;
- RegisterExtensionNames(&extEntry);
+#endif
}
-
-#endif /* XREGISTRY */