summaryrefslogtreecommitdiff
path: root/record
diff options
context:
space:
mode:
Diffstat (limited to 'record')
-rw-r--r--record/record.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/record/record.c b/record/record.c
index f580f643e..2ca37822b 100644
--- a/record/record.c
+++ b/record/record.c
@@ -43,6 +43,7 @@ and Jim Haggerty of Metheus.
#include <X11/extensions/recordstr.h>
#include "set.h"
#include "swaprep.h"
+#include "registry.h"
#include <stdio.h>
#include <assert.h>
@@ -164,13 +165,13 @@ typedef struct {
ProcFunctionPtr recordVector[256];
} RecordClientPrivateRec, *RecordClientPrivatePtr;
-static int RecordClientPrivateIndex;
+static DevPrivateKey RecordClientPrivateKey = &RecordClientPrivateKey;
/* RecordClientPrivatePtr RecordClientPrivate(ClientPtr)
* gets the client private of the given client. Syntactic sugar.
*/
#define RecordClientPrivate(_pClient) (RecordClientPrivatePtr) \
- ((_pClient)->devPrivates[RecordClientPrivateIndex].ptr)
+ dixLookupPrivate(&(_pClient)->devPrivates, RecordClientPrivateKey)
/***************************************************************************/
@@ -982,8 +983,8 @@ RecordInstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
memcpy(pClientPriv->recordVector, pClient->requestVector,
sizeof (pClientPriv->recordVector));
pClientPriv->originalVector = pClient->requestVector;
- pClient->devPrivates[RecordClientPrivateIndex].ptr =
- (pointer)pClientPriv;
+ dixSetPrivate(&pClient->devPrivates,
+ RecordClientPrivateKey, pClientPriv);
pClient->requestVector = pClientPriv->recordVector;
}
while ((pIter = RecordIterateSet(pRCAP->pRequestMajorOpSet,
@@ -1096,7 +1097,8 @@ RecordUninstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
if (!otherRCAPwantsProcVector)
{ /* nobody needs it, so free it */
pClient->requestVector = pClientPriv->originalVector;
- pClient->devPrivates[RecordClientPrivateIndex].ptr = NULL;
+ dixSetPrivate(&pClient->devPrivates,
+ RecordClientPrivateKey, NULL);
xfree(pClientPriv);
}
} /* end if this RCAP specifies any requests */
@@ -2948,10 +2950,6 @@ RecordExtensionInit(void)
if (!RTContext)
return;
- RecordClientPrivateIndex = AllocateClientPrivateIndex();
- if (!AllocateClientPrivate(RecordClientPrivateIndex, 0))
- return;
-
ppAllContexts = NULL;
numContexts = numEnabledContexts = numEnabledRCAPs = 0;
@@ -2968,5 +2966,24 @@ RecordExtensionInit(void)
}
RecordErrorBase = extentry->errorBase;
+ RegisterRequestName(extentry->base, X_RecordQueryVersion,
+ RECORD_NAME ":QueryVersion");
+ RegisterRequestName(extentry->base, X_RecordCreateContext,
+ RECORD_NAME ":CreateContext");
+ RegisterRequestName(extentry->base, X_RecordRegisterClients,
+ RECORD_NAME ":RegisterClients");
+ RegisterRequestName(extentry->base, X_RecordUnregisterClients,
+ RECORD_NAME ":UnregisterClients");
+ RegisterRequestName(extentry->base, X_RecordGetContext,
+ RECORD_NAME ":GetContext");
+ RegisterRequestName(extentry->base, X_RecordEnableContext,
+ RECORD_NAME ":EnableContext");
+ RegisterRequestName(extentry->base, X_RecordDisableContext,
+ RECORD_NAME ":DisableContext");
+ RegisterRequestName(extentry->base, X_RecordFreeContext,
+ RECORD_NAME ":FreeContext");
+
+ RegisterErrorName(RecordErrorBase + XRecordBadContext,
+ RECORD_NAME ":BadContext");
} /* RecordExtensionInit */