archive_read_disk_private.h revision 315432
1228753Smm/*- 2228753Smm * Copyright (c) 2003-2009 Tim Kientzle 3228753Smm * All rights reserved. 4228753Smm * 5228753Smm * Redistribution and use in source and binary forms, with or without 6228753Smm * modification, are permitted provided that the following conditions 7228753Smm * are met: 8228753Smm * 1. Redistributions of source code must retain the above copyright 9228753Smm * notice, this list of conditions and the following disclaimer 10228753Smm * in this position and unchanged. 11228753Smm * 2. Redistributions in binary form must reproduce the above copyright 12228753Smm * notice, this list of conditions and the following disclaimer in the 13228753Smm * documentation and/or other materials provided with the distribution. 14228753Smm * 15228753Smm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 16228753Smm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17228753Smm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18228753Smm * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 19228753Smm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20228753Smm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21228753Smm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22228753Smm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23228753Smm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24228753Smm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25228753Smm * 26228763Smm * $FreeBSD: stable/11/contrib/libarchive/libarchive/archive_read_disk_private.h 315432 2017-03-16 23:07:35Z mm $ 27228753Smm */ 28228753Smm 29228753Smm#ifndef __LIBARCHIVE_BUILD 30228753Smm#error This header is only to be used internally to libarchive. 31228753Smm#endif 32228753Smm 33228753Smm#ifndef ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED 34228753Smm#define ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED 35228753Smm 36232153Smmstruct tree; 37238856Smmstruct archive_entry; 38232153Smm 39228753Smmstruct archive_read_disk { 40228753Smm struct archive archive; 41228753Smm 42299529Smm /* Reused by archive_read_next_header() */ 43299529Smm struct archive_entry *entry; 44299529Smm 45228753Smm /* 46228753Smm * Symlink mode is one of 'L'ogical, 'P'hysical, or 'H'ybrid, 47228753Smm * following an old BSD convention. 'L' follows all symlinks, 48228753Smm * 'P' follows none, 'H' follows symlinks only for the first 49228753Smm * item. 50228753Smm */ 51228753Smm char symlink_mode; 52228753Smm 53228753Smm /* 54228753Smm * Since symlink interaction changes, we need to track whether 55228753Smm * we're following symlinks for the current item. 'L' mode above 56228753Smm * sets this true, 'P' sets it false, 'H' changes it as we traverse. 57228753Smm */ 58228753Smm char follow_symlinks; /* Either 'L' or 'P'. */ 59228753Smm 60232153Smm /* Directory traversals. */ 61232153Smm struct tree *tree; 62238856Smm int (*open_on_current_dir)(struct tree*, const char *, int); 63238856Smm int (*tree_current_dir_fd)(struct tree*); 64238856Smm int (*tree_enter_working_dir)(struct tree*); 65232153Smm 66315432Smm /* Bitfield with ARCHIVE_READDISK_* tunables */ 67315432Smm int flags; 68232153Smm 69232153Smm const char * (*lookup_gname)(void *private, int64_t gid); 70228753Smm void (*cleanup_gname)(void *private); 71228753Smm void *lookup_gname_data; 72232153Smm const char * (*lookup_uname)(void *private, int64_t uid); 73228753Smm void (*cleanup_uname)(void *private); 74228753Smm void *lookup_uname_data; 75238856Smm 76238856Smm int (*metadata_filter_func)(struct archive *, void *, 77238856Smm struct archive_entry *); 78238856Smm void *metadata_filter_data; 79238856Smm 80238856Smm /* ARCHIVE_MATCH object. */ 81238856Smm struct archive *matching; 82238856Smm /* Callback function, this will be invoked when ARCHIVE_MATCH 83238856Smm * archive_match_*_excluded_ae return true. */ 84238856Smm void (*excluded_cb_func)(struct archive *, void *, 85238856Smm struct archive_entry *); 86238856Smm void *excluded_cb_data; 87228753Smm}; 88228753Smm 89228753Smm#endif 90