[PATCH 2/3] dix: more lookup function consolidation, macro removal

Keith Packard keithp at keithp.com
Tue Jan 30 16:12:50 PST 2007


On Tue, 2007-01-30 at 17:49 -0500, Eamon Walsh wrote:

>  From a user perspective, it seems intuitive to me: pass whatever type 
> or class you're interested in.  Maybe the distinction could be made 
> clear in the comments and documentation, such as the following which 
> would be in the Xserver-spec document?

My only concern is that there's no check that you pass only classes to
the class lookup function and types to the type lookup function (not
that the old code had any checks either). Of course, as class and type
have the same signature, we couldn't have a compile-time check anyway.

Upon reflection, perhaps your solution is better than what we've got
now; no type checking, and mistakenly calling the wrong function would
yield very bad results as it would use the class-match function whether
you passed a type or class.

> The final two parameters are used for security and auditing purposes.  
> The client parameter should refer to the client on whose behalf the 
> lookup operation is being performed.  Typically, this is the client that 
> sent the protocol request being processed by the calling code.  If there 
> is no such client and the lookup is being performed on behalf of the 
> server itself, pass serverClient.  The access_mode parameter should be 
> set to one of the access type constants defined in resource.h: 
> DixReadAccess for read access to the resource, DixWriteAccess for write 
> access, and so forth.  These constants can be bitwise-or'ed together.

Oh, I did discover that there isn't any backward compatibility kludge in
the header files to permit old code to be compiled using the old
functions. I assume this was a conscious choice, and just wanted to
agree with it in case people come asking for such a thing later on.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20070130/f44c66e9/attachment.pgp>


More information about the xorg mailing list