summaryrefslogtreecommitdiff
path: root/dix/extension.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-06-16 15:44:42 -0400
committerAdam Jackson <ajax@redhat.com>2017-06-20 16:37:24 -0400
commitf44e0af4daaad5b18d79f2076bc98d6e79f638af (patch)
tree886c688b9ae0a0869020cca11df120ff4da788fc /dix/extension.c
parent88e807d4fa90165868929190f601beef18252f57 (diff)
dix: Remove extension aliases
This appears to be essentially unused. The only known client-side library for the SELinux extension is xcb, which does not look for the name "Flask". The "SGI-GLX" alias for GLX appears to be a bit of superstition at this point, NVIDIA's driver does not expose it and Mesa does not check for it. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix/extension.c')
-rw-r--r--dix/extension.c47
1 files changed, 4 insertions, 43 deletions
diff --git a/dix/extension.c b/dix/extension.c
index e81f673b2..b4c1c5f16 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -95,8 +95,6 @@ AddExtension(const char *name, int NumEvents, int NumErrors,
return NULL;
}
ext->name = strdup(name);
- ext->num_aliases = 0;
- ext->aliases = (const char **) NULL;
if (!ext->name) {
dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION);
free(ext);
@@ -144,42 +142,15 @@ AddExtension(const char *name, int NumEvents, int NumErrors,
return ext;
}
-Bool
-AddExtensionAlias(const char *alias, ExtensionEntry * ext)
-{
- char *name;
- const char **aliases;
-
- if (!ext)
- return FALSE;
- aliases = reallocarray(ext->aliases, ext->num_aliases + 1, sizeof(char *));
- if (!aliases)
- return FALSE;
- ext->aliases = aliases;
- name = strdup(alias);
- if (!name)
- return FALSE;
- ext->aliases[ext->num_aliases] = name;
- ext->num_aliases++;
- return TRUE;
-}
-
static int
FindExtension(const char *extname, int len)
{
- int i, j;
+ int i;
for (i = 0; i < NumExtensions; i++) {
if ((strlen(extensions[i]->name) == len) &&
!strncmp(extname, extensions[i]->name, len))
break;
- for (j = extensions[i]->num_aliases; --j >= 0;) {
- if ((strlen(extensions[i]->aliases[j]) == len) &&
- !strncmp(extname, extensions[i]->aliases[j], len))
- break;
- }
- if (j >= 0)
- break;
}
return ((i == NumExtensions) ? -1 : i);
}
@@ -223,16 +194,13 @@ StandardMinorOpcode(ClientPtr client)
void
CloseDownExtensions(void)
{
- int i, j;
+ int i;
for (i = NumExtensions - 1; i >= 0; i--) {
if (extensions[i]->CloseDown)
extensions[i]->CloseDown(extensions[i]);
NumExtensions = i;
free((void *) extensions[i]->name);
- for (j = extensions[i]->num_aliases; --j >= 0;)
- free((void *) extensions[i]->aliases[j]);
- free(extensions[i]->aliases);
dixFreePrivates(extensions[i]->devPrivates, PRIVATE_EXTENSION);
free(extensions[i]);
}
@@ -294,7 +262,7 @@ ProcListExtensions(ClientPtr client)
buffer = NULL;
if (NumExtensions) {
- int i, j;
+ int i;
for (i = 0; i < NumExtensions; i++) {
/* call callbacks to find out whether to show extension */
@@ -302,9 +270,7 @@ ProcListExtensions(ClientPtr client)
continue;
total_length += strlen(extensions[i]->name) + 1;
- reply.nExtensions += 1 + extensions[i]->num_aliases;
- for (j = extensions[i]->num_aliases; --j >= 0;)
- total_length += strlen(extensions[i]->aliases[j]) + 1;
+ reply.nExtensions += 1;
}
reply.length = bytes_to_int32(total_length);
buffer = bufptr = malloc(total_length);
@@ -319,11 +285,6 @@ ProcListExtensions(ClientPtr client)
*bufptr++ = len = strlen(extensions[i]->name);
memmove(bufptr, extensions[i]->name, len);
bufptr += len;
- for (j = extensions[i]->num_aliases; --j >= 0;) {
- *bufptr++ = len = strlen(extensions[i]->aliases[j]);
- memmove(bufptr, extensions[i]->aliases[j], len);
- bufptr += len;
- }
}
}
WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply);