Path: blob/master/Utilities/cmlibarchive/libarchive/archive_acl_private.h
3153 views
/*-1* Copyright (c) 2003-2010 Tim Kientzle2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR14* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES15* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.16* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,17* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT18* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,19* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY20* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT21* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF22* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.23*/2425#ifndef ARCHIVE_ACL_PRIVATE_H_INCLUDED26#define ARCHIVE_ACL_PRIVATE_H_INCLUDED2728#ifndef __LIBARCHIVE_BUILD29#error This header is only to be used internally to libarchive.30#endif3132#include "archive_string.h"3334struct archive_acl_entry {35struct archive_acl_entry *next;36int type; /* E.g., access or default */37int tag; /* E.g., user/group/other/mask */38int permset; /* r/w/x bits */39int id; /* uid/gid for user/group */40struct archive_mstring name; /* uname/gname */41};4243struct archive_acl {44mode_t mode;45struct archive_acl_entry *acl_head;46struct archive_acl_entry *acl_p;47int acl_state; /* See acl_next for details. */48wchar_t *acl_text_w;49char *acl_text;50int acl_types;51};5253void archive_acl_clear(struct archive_acl *);54void archive_acl_copy(struct archive_acl *, struct archive_acl *);55int archive_acl_count(struct archive_acl *, int);56int archive_acl_types(struct archive_acl *);57int archive_acl_reset(struct archive_acl *, int);58int archive_acl_next(struct archive *, struct archive_acl *, int,59int *, int *, int *, int *, const char **);6061int archive_acl_add_entry(struct archive_acl *, int, int, int, int, const char *);62int archive_acl_add_entry_w_len(struct archive_acl *,63int, int, int, int, const wchar_t *, size_t);64int archive_acl_add_entry_len(struct archive_acl *,65int, int, int, int, const char *, size_t);6667wchar_t *archive_acl_to_text_w(struct archive_acl *, ssize_t *, int,68struct archive *);69char *archive_acl_to_text_l(struct archive_acl *, ssize_t *, int,70struct archive_string_conv *);7172/*73* ACL text parser.74*/75int archive_acl_from_text_w(struct archive_acl *, const wchar_t * /* wtext */,76int /* type */);77int archive_acl_from_text_l(struct archive_acl *, const char * /* text */,78int /* type */, struct archive_string_conv *);79int archive_acl_from_text_nl(struct archive_acl *, const char * /* text */,80size_t /* size of text */, int /* type */, struct archive_string_conv *);8182#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */838485