Tizen 2.0 Release
[framework/base/acl.git] / setfacl / parse.h
1 /*
2   File: parse.h
3   (Linux Access Control List Management)
4
5   Copyright (C) 1999 by Andreas Gruenbacher
6   <a.gruenbacher@computer.org>
7         
8   This program is free software; you can redistribute it and/or
9   modify it under the terms of the GNU Lesser General Public
10   License as published by the Free Software Foundation; either
11   version 2.1 of the License, or (at your option) any later version.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16   Lesser General Public License for more details.
17
18   You should have received a copy of the GNU Lesser General Public
19   License along with this library; if not, write to the Free Software
20   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
23 #ifndef __PARSE_H
24 #define __PARSE_H
25
26
27 #include <stdlib.h>
28 #include <sys/types.h>
29 #include "sequence.h"
30
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36
37 /* parse options */
38
39 #define SEQ_PARSE_WITH_PERM     (0x0001)
40 #define SEQ_PARSE_NO_PERM       (0x0002)
41 #define SEQ_PARSE_ANY_PERM      (0x0001|0x0002)
42
43 #define SEQ_PARSE_MULTI         (0x0010)
44 #define SEQ_PARSE_DEFAULT       (0x0020)        /* "default:" = default acl */
45
46 #define SEQ_PROMOTE_ACL         (0x0040)        /* promote from acl
47                                                    to default acl */
48
49 cmd_t
50 parse_acl_cmd(
51         const char **text_p,
52         int seq_cmd,
53         int parse_mode);
54 int
55 parse_acl_seq(
56         seq_t seq,
57         const char *text_p,
58         int *which,
59         int seq_cmd,
60         int parse_mode);
61 int
62 read_acl_comments(
63         FILE *file,
64         int *line,
65         char **path_p,
66         uid_t *uid_p,
67         gid_t *gid_p,
68         mode_t *flags);
69 int
70 read_acl_seq(
71         FILE *file,
72         seq_t seq,
73         int seq_cmd,
74         int parse_mode,
75         int *line,
76         int *which);
77
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83
84 #endif  /* __PARSE_H */
85