honor flags again
[opensuse:hal-resmgr.git] / file.h
1 #ifndef RESMGR_FILE_H
2 #define RESMGR_FILE_H
3
4 typedef struct {
5         uid_t saved_uid;
6         gid_t saved_gid;
7         unsigned short saved_mode;
8         unsigned short flags;
9         char name[];
10 } res_file_t;
11
12 enum {
13         DEV_FLAGS_RO            = 0x01,
14         DEV_FLAGS_NOFACL        = 0x02,
15         // private
16         DEV_FLAGS_NOACCES       = 0x20,
17         DEV_FLAGS_NEW           = 0x40,
18         DEV_FLAGS_OWNER         = 0x80,
19 };
20
21 res_file_t* res_file_new(const char* name, const char** flags);
22 void res_file_free(res_file_t* dev);
23 int res_file_grant(res_file_t *dev, uid_t uid);
24 int res_file_revoke(res_file_t *dev, uid_t uid);
25 int res_file_create(res_file_t *dev);
26 int res_file_destroy(res_file_t *dev);
27
28 #endif