From 4017d3190234e189a0bbd33193a148d4d3c7556b Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 28 Aug 2007 09:28:25 -0400 Subject: devPrivates rework: since API is already broken, switch everything over to new system. Need to update documentation and address some remaining vestiges of old system such as CursorRec structure, fb "offman" structure, and FontRec privates. --- record/record.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'record') diff --git a/record/record.c b/record/record.c index 0ed8f84c2..2e65e677b 100644 --- a/record/record.c +++ b/record/record.c @@ -164,13 +164,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 +982,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 +1096,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 +2949,6 @@ RecordExtensionInit(void) if (!RTContext) return; - RecordClientPrivateIndex = AllocateClientPrivateIndex(); - if (!AllocateClientPrivate(RecordClientPrivateIndex, 0)) - return; - ppAllContexts = NULL; numContexts = numEnabledContexts = numEnabledRCAPs = 0; -- cgit v1.2.3 From ea09c9acc8f0d5577f54c864ff88b7f03d93b2f4 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Mon, 15 Oct 2007 18:25:12 -0400 Subject: registry: Register Record extension protocol names. --- record/record.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'record') diff --git a/record/record.c b/record/record.c index 2e65e677b..5772baf46 100644 --- a/record/record.c +++ b/record/record.c @@ -43,6 +43,7 @@ and Jim Haggerty of Metheus. #include #include "set.h" #include "swaprep.h" +#include "registry.h" #include #include @@ -2965,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 */ -- cgit v1.2.3 From e585a2ddb495b50a53e15cccc368ca0858fc9d23 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 20 Nov 2007 17:55:47 -0500 Subject: Revert "registry: Register Record extension protocol names." This reverts commit ea09c9acc8f0d5577f54c864ff88b7f03d93b2f4. Moving all the names into dix/registry.c --- record/record.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'record') diff --git a/record/record.c b/record/record.c index 2ca37822b..debe3c472 100644 --- a/record/record.c +++ b/record/record.c @@ -43,7 +43,6 @@ and Jim Haggerty of Metheus. #include #include "set.h" #include "swaprep.h" -#include "registry.h" #include #include @@ -2966,24 +2965,5 @@ 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 */ -- cgit v1.2.3