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 Library General Public 10 License as published by the Free Software Foundation; either 11 version 2 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 Library General Public License for more details. 17 18 You should have received a copy of the GNU Library 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 33extern "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_WITH_RELATIVE (0x0004) 44#define SEQ_PARSE_NO_RELATIVE (0x0008) 45#define SEQ_PARSE_ANY_RELATIVE (0x0004|0x0008) 46 47#define SEQ_PARSE_MULTI (0x0010) 48#define SEQ_PARSE_DEFAULT (0x0020) /* "default:" = default acl */ 49 50#define SEQ_PROMOTE_ACL (0x0040) /* promote from acl 51 to default acl */ 52 53cmd_t 54parse_acl_cmd( 55 const char **text_p, 56 int seq_cmd, 57 int parse_mode); 58int 59parse_acl_seq( 60 seq_t seq, 61 const char *text_p, 62 int *which, 63 int seq_cmd, 64 int parse_mode); 65int 66read_acl_comments( 67 FILE *file, 68 int *line, 69 char **path_p, 70 uid_t *uid_p, 71 gid_t *gid_p); 72int 73read_acl_seq( 74 FILE *file, 75 seq_t seq, 76 int seq_cmd, 77 int parse_mode, 78 int *line, 79 int *which); 80 81 82#ifdef __cplusplus 83} 84#endif 85 86 87#endif /* __PARSE_H */ 88 89