enum {P_WRITE = 1,P_WRITE_PROPERTIES=2,P_WRITE_CONTENT=4,P_WRITE_ACL=8,P_UNLOCK=16,P_READ=32,P_READ_ACL=64,P_READ_CURRENT_USER_PRIVILEGE_SET=128,P_BIND=256,P_UNBIND=512,P_ALLPRIV=0xffff};
typedef struct {char *name; int value; } Apriv;
#ifdef IS_PROP

Apriv privs[]={
	"write",P_WRITE
	,"write-properties",P_WRITE_PROPERTIES
	,"write-content",P_WRITE_CONTENT
	,"write-acl",P_WRITE_ACL
	,"unlock",P_UNLOCK
	,"read",P_READ
	,"read-acl",P_READ_ACL
	,"read-current-user-privilege-set",P_READ_CURRENT_USER_PRIVILEGE_SET
	,"bind",P_BIND
	,"unbind",P_UNBIND
	,"all",P_ALLPRIV
	,NULL,0
};
#else
extern Apriv privs[];
#endif


typedef struct PROP {
	char *var;
	char *val;
	char *ns; // name space...
	struct PROP *next;
} Prop;
Prop *prop_load(char *fname);
int prop_save(char *fname, Prop *plist);
int prop_add(Prop **p, char *name, char *value, char *ns);
int prop_free(Prop **x);
int prop_remove(Prop **x, char *name, char *ns);


typedef struct ACLX {
	char *user;
	char *inherited;
	int invert;
	int isgrant;
	int isdeny; 
	int isprotected;
	int priv; // binary value of privs to add or subtract...
	int isinherit;
	struct ACLX *next;
} Ace;

// Wont allow undef as is different symbol?? (osx xcode build)
#define acl_free system_acl_free

Dstr *acl_load_text(char *obj); // freed by calling function...;
int acl_write_object(char *object, Ace *list);
int acl_free(Ace **list);
Ace *acl_load(char *fname);
char *acl_findname(int p);
char *acl_fname(char *fname, char *object);
