diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-08-28 09:28:25 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-08-28 09:28:25 -0400 |
commit | 4017d3190234e189a0bbd33193a148d4d3c7556b (patch) | |
tree | 2ab228113d410386afde50c893f137d95974b8f3 /hw/xprint/attributes.c | |
parent | 85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff) |
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.
Diffstat (limited to 'hw/xprint/attributes.c')
-rw-r--r-- | hw/xprint/attributes.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/hw/xprint/attributes.c b/hw/xprint/attributes.c index d8ee5adf8..9756e281d 100644 --- a/hw/xprint/attributes.c +++ b/hw/xprint/attributes.c @@ -124,7 +124,7 @@ SysAttrs systemAttributes; * attrCtxtPrivIndex hold the attribute store's context private index. * This index is allocated at the time the attribute store is initialized. */ -static int attrCtxtPrivIndex; +static DevPrivateKey attrCtxtPrivKey = &attrCtxtPrivKey; /* * The ContextAttrs structure descibes the context private space reserved @@ -521,8 +521,7 @@ XpBuildAttributeStore( { if(attrList != (PrAttrPtr)NULL) FreeAttrList(); - attrCtxtPrivIndex = XpAllocateContextPrivateIndex(); - XpAllocateContextPrivate(attrCtxtPrivIndex, sizeof(ContextAttrs)); + dixRequestPrivate(attrCtxtPrivKey, sizeof(ContextAttrs)); BuildSystemAttributes(); attrGeneration = serverGeneration; @@ -592,7 +591,8 @@ XpInitAttributes(XpContextPtr pContext) PrAttrPtr pPrAttr = attrList; /* Initialize all the pointers to NULL */ - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; + pCtxtAttrs = (ContextAttrPtr)dixLookupPrivate(&pContext->devPrivates, + attrCtxtPrivKey); (void)memset((void *)pCtxtAttrs, 0, (size_t) sizeof(ContextAttrs)); for(pPrAttr = attrList; pPrAttr != (PrAttrPtr)NULL; pPrAttr = pPrAttr->next) @@ -612,8 +612,8 @@ XpDestroyAttributes( { ContextAttrPtr pCtxtAttrs; - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; - + pCtxtAttrs = (ContextAttrPtr)dixLookupPrivate(&pContext->devPrivates, + attrCtxtPrivKey); if(pCtxtAttrs->printerAttrs != (XrmDatabase)NULL) XrmDestroyDatabase(pCtxtAttrs->printerAttrs); if(pCtxtAttrs->docAttrs != (XrmDatabase)NULL) @@ -661,7 +661,8 @@ XpGetOneAttribute( } else { - pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; + pCtxtAttrs=(ContextAttrPtr)dixLookupPrivate(&pContext->devPrivates, + attrCtxtPrivKey); switch(class) { case XPPrinterAttr: @@ -714,7 +715,8 @@ XpPutOneAttribute( XrmBinding bindings[1]; XrmQuark quarks[2]; - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; + pCtxtAttrs = (ContextAttrPtr)dixLookupPrivate(&pContext->devPrivates, + attrCtxtPrivKey); switch(class) { case XPPrinterAttr: @@ -900,7 +902,8 @@ XpGetAttributes( db = systemAttributes.server; else { - pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; + pCtxtAttrs=(ContextAttrPtr)dixLookupPrivate(&pContext->devPrivates, + attrCtxtPrivKey); switch(class) { case XPServerAttr: @@ -952,7 +955,8 @@ XpAugmentAttributes( db = XrmGetStringDatabase(attributes); if(db == (XrmDatabase)NULL) return BadAlloc; - pCtxtAttrs = (ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; + pCtxtAttrs = (ContextAttrPtr)dixLookupPrivate(&pContext->devPrivates, + attrCtxtPrivKey); switch(class) { case XPPrinterAttr: @@ -988,7 +992,8 @@ XpSetAttributes( db = XrmGetStringDatabase(attributes); if(db == (XrmDatabase)NULL) return BadAlloc; - pCtxtAttrs=(ContextAttrPtr)pContext->devPrivates[attrCtxtPrivIndex].ptr; + pCtxtAttrs=(ContextAttrPtr)dixLookupPrivate(&pContext->devPrivates, + attrCtxtPrivKey); switch(class) { case XPPrinterAttr: |