/*
 *	Copyright (C) 1986 by the Student Information Processing Board
 */

#ifndef ACL_H_INCLUDED
#define ACL_H_INCLUDED 1

typedef struct dsc_acl_entry {
	char *principal;	/* The principal */
	char *modes;		/* The allowed modes */
} dsc_acl_entry;

typedef struct dsc_acl {
	int acl_length;
	dsc_acl_entry *acl_entries; /* Members of list (gets realloc'ed) */
} dsc_acl;

bool dsc_acl_check (dsc_acl *, const char *, const char *);
dsc_acl *acl_read (int);
bool acl_write (int, dsc_acl *);
int acl_add_access (dsc_acl *, const char *, const char *);
int acl_replace_access (dsc_acl *, const char *, const char *);
bool acl_delete_access (dsc_acl *, const char *);
dsc_acl *acl_create (void);
dsc_acl *acl_copy (dsc_acl *);
const char *acl_get_access (dsc_acl *, const char *);
int acl_destroy (dsc_acl *);
bool acl_is_subset (const char *, const char *);
char *acl_intersection (const char *, const char *);
char *acl_union (const char *, const char *);
char *acl_subtract (const char *, const char *);
char *acl_canon (const char *, const char *, int *);

#endif
