rights.h (1288B)
1 /* Copyright 1998-1999, Brian J. Swetland. All rights reserved. 2 ** Distributed under the terms of the OpenBLT License 3 */ 4 5 #ifndef _RIGHTS_H_ 6 #define _RIGHTS_H_ 7 8 #include "resource.h" 9 10 #define RIGHT_PERM_READ 0x0001 /* allow 'read' access to something */ 11 #define RIGHT_PERM_WRITE 0x0002 /* allow 'write' access to something */ 12 #define RIGHT_PERM_DESTROY 0x0004 /* allow the something to be destroyed */ 13 #define RIGHT_PERM_ATTACH 0x0008 /* allows other rights to be attached */ 14 #define RIGHT_PERM_GRANT 0x0010 /* this right may be granted to another */ 15 /* thread by a thread that is not the owner */ 16 #define RIGHT_MODE_INHERIT 0x0020 /* automatically granted to child */ 17 #define RIGHT_MODE_DISSOLVE 0x0040 /* When the owner thread terminates, */ 18 /* the right is destroyed */ 19 20 int right_create(uint32 rsrc_id, uint32 flags); 21 int right_destroy(uint32 right_id); 22 int right_revoke(uint32 right_id, uint32 thread_id); 23 int right_grant(uint32 right_id, uint32 thread_id); 24 25 struct __right_t 26 { 27 resource_t rsrc; 28 29 resource_t *attached; 30 uint32 flags; 31 uint32 refcount; 32 struct __tnode_t *holders; 33 }; 34 35 36 37 #endif