summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-05-13 10:33:39 -0700
committerKeith Packard <keithp@keithp.com>2010-05-13 14:16:32 -0700
commitf2a0c324e37c9fa3eb9087adbf963addb7f21d88 (patch)
treef3b600791c72e47c47001a65e246ef002b26dd25
parentc9e7ca4404803fe44d4684e0bb2ca2ee10fd4bb3 (diff)
Remove devPrivates init and delete callback lists.
XSELinux was the only consumer of these interfaces and it no longer needs them. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
-rw-r--r--dix/privates.c40
-rw-r--r--include/privates.h28
2 files changed, 1 insertions, 67 deletions
diff --git a/dix/privates.c b/dix/privates.c
index 27694cbeb..4a8a186dc 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -47,8 +47,6 @@ struct _Private {
typedef struct _PrivateDesc {
DevPrivateKey key;
unsigned size;
- CallbackListPtr initfuncs;
- CallbackListPtr deletefuncs;
} PrivateDescRec;
#define PRIV_MAX 256
@@ -102,7 +100,6 @@ pointer *
dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
{
PrivateDescRec *item = findItem(key);
- PrivateCallbackRec calldata;
PrivateRec *ptr;
pointer value;
int oldsize, newsize;
@@ -144,10 +141,6 @@ dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
ptr->value = value;
}
- calldata.key = key;
- calldata.value = &ptr->value;
- CallCallbacks(&item->initfuncs, &calldata);
-
return &ptr->value;
}
@@ -202,16 +195,10 @@ void
dixFreePrivates(PrivateRec *privates)
{
int i;
- PrivateCallbackRec calldata;
if (privates)
for (i = 1; i < privates->state; i++)
if (privates[i].state) {
- /* call the delete callbacks */
- calldata.key = items[i].key;
- calldata.value = &privates[i].value;
- CallCallbacks(&items[i].deletefuncs, &calldata);
-
/* free pre-allocated memory */
if (items[i].size)
free(privates[i].value);
@@ -220,31 +207,6 @@ dixFreePrivates(PrivateRec *privates)
free(privates);
}
-/*
- * Callback registration
- */
-int
-dixRegisterPrivateInitFunc(const DevPrivateKey key,
- CallbackProcPtr callback, pointer data)
-{
- PrivateDescRec *item = findItem(key);
- if (!item)
- return FALSE;
-
- return AddCallback(&item->initfuncs, callback, data);
-}
-
-int
-dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
- CallbackProcPtr callback, pointer data)
-{
- PrivateDescRec *item = findItem(key);
- if (!item)
- return FALSE;
-
- return AddCallback(&item->deletefuncs, callback, data);
-}
-
/* Table of devPrivates offsets */
static const int offsetDefaults[] = {
-1, /* RT_NONE */
@@ -304,8 +266,6 @@ dixResetPrivates(void)
for (i = 1; i < nextPriv; i++) {
*items[i].key = 0;
items[i].size = 0;
- DeleteCallbackList(&items[i].initfuncs);
- DeleteCallbackList(&items[i].deletefuncs);
}
nextPriv = 1;
diff --git a/include/privates.h b/include/privates.h
index e6f788de1..7850dea6d 100644
--- a/include/privates.h
+++ b/include/privates.h
@@ -94,33 +94,7 @@ extern _X_EXPORT int
dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val);
/*
- * Register callbacks to be called on private allocation/freeing.
- * The calldata argument to the callbacks is a PrivateCallbackPtr.
- */
-typedef struct _PrivateCallback {
- DevPrivateKey key; /* private registration key */
- pointer *value; /* address of private pointer */
-} PrivateCallbackRec;
-
-/*
- * Register a function to be called when dixAllocPrivate successfully associates
- * 'key' with a new PrivateRec.
- */
-extern _X_EXPORT int
-dixRegisterPrivateInitFunc(const DevPrivateKey key,
- CallbackProcPtr callback, pointer userdata);
-
-/*
- * Register a function to be called when dixFreePrivates unassociates 'key' with
- * a PrivateRec.
- */
-extern _X_EXPORT int
-dixRegisterPrivateDeleteFunc(const DevPrivateKey key,
- CallbackProcPtr callback, pointer userdata);
-
-/*
- * Unassociates all keys from 'privates', calls the callbacks registered with
- * dixRegisterPrivateDeleteFunc, and frees all private data automatically
+ * Unassociates all keys from 'privates' and frees all private data automatically
* allocated via dixRequestPrivate.
*/
extern _X_EXPORT void