summaryrefslogtreecommitdiff
path: root/tools/parse.h
blob: 2549753f826db69099ffd84ac3da48ac3acc04d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
  File: parse.h
  (Linux Access Control List Management)

  Copyright (C) 1999 by Andreas Gruenbacher
  <a.gruenbacher@computer.org>
 	
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef __PARSE_H
#define __PARSE_H


#include <stdlib.h>
#include <sys/types.h>
#include "sequence.h"


#ifdef __cplusplus
extern "C" {
#endif


/* parse options */

#define SEQ_PARSE_WITH_PERM	(0x0001)
#define SEQ_PARSE_NO_PERM	(0x0002)
#define SEQ_PARSE_ANY_PERM	(0x0001|0x0002)

#define SEQ_PARSE_MULTI		(0x0010)
#define SEQ_PARSE_DEFAULT	(0x0020)	/* "default:" = default acl */

#define SEQ_PROMOTE_ACL		(0x0040)	/* promote from acl
                                                   to default acl */

cmd_t
parse_acl_cmd(
	const char **text_p,
	int seq_cmd,
	int parse_mode);
int
parse_acl_seq(
	seq_t seq,
	const char *text_p,
	int *which,
	int seq_cmd,
	int parse_mode);
int
read_acl_comments(
	FILE *file,
	int *lineno,
	char **path_p,
	uid_t *uid_p,
	gid_t *gid_p,
	mode_t *flags);
int
read_acl_seq(
	FILE *file,
	seq_t seq,
	int seq_cmd,
	int parse_mode,
	int *lineno,
	int *which);


#ifdef __cplusplus
}
#endif


#endif  /* __PARSE_H */