package LibArchive; use 5.008008; use strict; use warnings; use Carp; require Exporter; use AutoLoader; our @ISA = qw(Exporter); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. # This allows declaration use LibArchive ':all'; # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. our %EXPORT_TAGS = ( 'all' => [ qw( AE_IFBLK AE_IFCHR AE_IFDIR AE_IFIFO AE_IFLNK AE_IFMT AE_IFREG ARCHIVE_API_FEATURE ARCHIVE_API_VERSION ARCHIVE_BYTES_PER_RECORD ARCHIVE_COMPRESSION_BZIP2 ARCHIVE_COMPRESSION_COMPRESS ARCHIVE_COMPRESSION_GZIP ARCHIVE_COMPRESSION_NONE ARCHIVE_COMPRESSION_PROGRAM ARCHIVE_DEFAULT_BYTES_PER_BLOCK ARCHIVE_EOF ARCHIVE_EXTRACT_ACL ARCHIVE_EXTRACT_FFLAGS ARCHIVE_EXTRACT_NO_AUTODIR ARCHIVE_EXTRACT_NO_OVERWRITE ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER ARCHIVE_EXTRACT_OWNER ARCHIVE_EXTRACT_PERM ARCHIVE_EXTRACT_SECURE_NODOTDOT ARCHIVE_EXTRACT_SECURE_SYMLINKS ARCHIVE_EXTRACT_TIME ARCHIVE_EXTRACT_UNLINK ARCHIVE_EXTRACT_XATTR ARCHIVE_FAILED ARCHIVE_FATAL ARCHIVE_FORMAT_AR ARCHIVE_FORMAT_AR_BSD ARCHIVE_FORMAT_AR_GNU ARCHIVE_FORMAT_BASE_MASK ARCHIVE_FORMAT_CPIO ARCHIVE_FORMAT_CPIO_BIN_BE ARCHIVE_FORMAT_CPIO_BIN_LE ARCHIVE_FORMAT_CPIO_POSIX ARCHIVE_FORMAT_CPIO_SVR4_CRC ARCHIVE_FORMAT_CPIO_SVR4_NOCRC ARCHIVE_FORMAT_EMPTY ARCHIVE_FORMAT_ISO9660 ARCHIVE_FORMAT_ISO9660_ROCKRIDGE ARCHIVE_FORMAT_SHAR ARCHIVE_FORMAT_SHAR_BASE ARCHIVE_FORMAT_SHAR_DUMP ARCHIVE_FORMAT_TAR ARCHIVE_FORMAT_TAR_GNUTAR ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE ARCHIVE_FORMAT_TAR_PAX_RESTRICTED ARCHIVE_FORMAT_TAR_USTAR ARCHIVE_FORMAT_ZIP ARCHIVE_OK ARCHIVE_RETRY ARCHIVE_VERSION_STAMP ARCHIVE_WARN ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( AE_IFBLK AE_IFCHR AE_IFDIR AE_IFIFO AE_IFLNK AE_IFMT AE_IFREG ARCHIVE_API_FEATURE ARCHIVE_API_VERSION ARCHIVE_BYTES_PER_RECORD ARCHIVE_COMPRESSION_BZIP2 ARCHIVE_COMPRESSION_COMPRESS ARCHIVE_COMPRESSION_GZIP ARCHIVE_COMPRESSION_NONE ARCHIVE_COMPRESSION_PROGRAM ARCHIVE_DEFAULT_BYTES_PER_BLOCK ARCHIVE_EOF ARCHIVE_EXTRACT_ACL ARCHIVE_EXTRACT_FFLAGS ARCHIVE_EXTRACT_NO_AUTODIR ARCHIVE_EXTRACT_NO_OVERWRITE ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER ARCHIVE_EXTRACT_OWNER ARCHIVE_EXTRACT_PERM ARCHIVE_EXTRACT_SECURE_NODOTDOT ARCHIVE_EXTRACT_SECURE_SYMLINKS ARCHIVE_EXTRACT_TIME ARCHIVE_EXTRACT_UNLINK ARCHIVE_EXTRACT_XATTR ARCHIVE_FAILED ARCHIVE_FATAL ARCHIVE_FORMAT_AR ARCHIVE_FORMAT_AR_BSD ARCHIVE_FORMAT_AR_GNU ARCHIVE_FORMAT_BASE_MASK ARCHIVE_FORMAT_CPIO ARCHIVE_FORMAT_CPIO_BIN_BE ARCHIVE_FORMAT_CPIO_BIN_LE ARCHIVE_FORMAT_CPIO_POSIX ARCHIVE_FORMAT_CPIO_SVR4_CRC ARCHIVE_FORMAT_CPIO_SVR4_NOCRC ARCHIVE_FORMAT_EMPTY ARCHIVE_FORMAT_ISO9660 ARCHIVE_FORMAT_ISO9660_ROCKRIDGE ARCHIVE_FORMAT_SHAR ARCHIVE_FORMAT_SHAR_BASE ARCHIVE_FORMAT_SHAR_DUMP ARCHIVE_FORMAT_TAR ARCHIVE_FORMAT_TAR_GNUTAR ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE ARCHIVE_FORMAT_TAR_PAX_RESTRICTED ARCHIVE_FORMAT_TAR_USTAR ARCHIVE_FORMAT_ZIP ARCHIVE_OK ARCHIVE_RETRY ARCHIVE_VERSION_STAMP ARCHIVE_WARN ); our $VERSION = '2.2.4'; sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() # XS function. my $constname; our $AUTOLOAD; ($constname = $AUTOLOAD) =~ s/.*:://; croak "&LibArchive::constant not defined" if $constname eq 'constant'; my ($error, $val) = constant($constname); if ($error) { croak $error; } { no strict 'refs'; *$AUTOLOAD = sub { $val }; } goto &$AUTOLOAD; } require XSLoader; XSLoader::load('LibArchive', $VERSION); # Preloaded methods go here. # Autoload methods go after =cut, and are processed by the autosplit program. 1; __END__ # Below is stub documentation for your module. You'd better edit it! =head1 NAME LibArchive - Perl extension to access libarchive functions =head1 SYNOPSIS use LibArchive; =head1 DESCRIPTION We currently support only a limited interface for reading archives. =head2 EXPORT None by default. =head2 Exportable constants AE_IFBLK AE_IFCHR AE_IFDIR AE_IFIFO AE_IFLNK AE_IFMT AE_IFREG ARCHIVE_API_FEATURE ARCHIVE_API_VERSION ARCHIVE_BYTES_PER_RECORD ARCHIVE_COMPRESSION_BZIP2 ARCHIVE_COMPRESSION_COMPRESS ARCHIVE_COMPRESSION_GZIP ARCHIVE_COMPRESSION_NONE ARCHIVE_COMPRESSION_PROGRAM ARCHIVE_DEFAULT_BYTES_PER_BLOCK ARCHIVE_EOF ARCHIVE_EXTRACT_ACL ARCHIVE_EXTRACT_FFLAGS ARCHIVE_EXTRACT_NO_AUTODIR ARCHIVE_EXTRACT_NO_OVERWRITE ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER ARCHIVE_EXTRACT_OWNER ARCHIVE_EXTRACT_PERM ARCHIVE_EXTRACT_SECURE_NODOTDOT ARCHIVE_EXTRACT_SECURE_SYMLINKS ARCHIVE_EXTRACT_TIME ARCHIVE_EXTRACT_UNLINK ARCHIVE_EXTRACT_XATTR ARCHIVE_FAILED ARCHIVE_FATAL ARCHIVE_FORMAT_AR ARCHIVE_FORMAT_AR_BSD ARCHIVE_FORMAT_AR_GNU ARCHIVE_FORMAT_BASE_MASK ARCHIVE_FORMAT_CPIO ARCHIVE_FORMAT_CPIO_BIN_BE ARCHIVE_FORMAT_CPIO_BIN_LE ARCHIVE_FORMAT_CPIO_POSIX ARCHIVE_FORMAT_CPIO_SVR4_CRC ARCHIVE_FORMAT_CPIO_SVR4_NOCRC ARCHIVE_FORMAT_EMPTY ARCHIVE_FORMAT_ISO9660 ARCHIVE_FORMAT_ISO9660_ROCKRIDGE ARCHIVE_FORMAT_SHAR ARCHIVE_FORMAT_SHAR_BASE ARCHIVE_FORMAT_SHAR_DUMP ARCHIVE_FORMAT_TAR ARCHIVE_FORMAT_TAR_GNUTAR ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE ARCHIVE_FORMAT_TAR_PAX_RESTRICTED ARCHIVE_FORMAT_TAR_USTAR ARCHIVE_FORMAT_ZIP ARCHIVE_OK ARCHIVE_RETRY ARCHIVE_VERSION_STAMP ARCHIVE_WARN =head2 Exportable functions int archive_api_feature(void) int archive_api_version(void) void archive_clear_error(struct archive *) int archive_compression(struct archive *) const char *archive_compression_name(struct archive *) void archive_copy_error(struct archive *dest, struct archive *src) int archive_errno(struct archive *) const char *archive_error_string(struct archive *) int archive_format(struct archive *) int archive_read_close(struct archive *) ssize_t archive_read_data(struct archive *, void *, size_t) int archive_read_data_skip(struct archive *) int archive_read_finish(struct archive *) struct archive *archive_read_new(void) int archive_read_next_header(struct archive *, struct archive_entry **) int archive_read_open(struct archive *, void *_client_data, archive_open_callback *, archive_read_callback *, archive_close_callback *) int archive_read_open_FILE(struct archive *, FILE *_file) int archive_read_open_fd(struct archive *, int _fd, size_t _block_size) int archive_read_open_file(struct archive *, const char *_filename, size_t _block_size) int archive_read_open_filename(struct archive *, const char *_filename, size_t _block_size) int archive_read_support_compression_all(struct archive *) int archive_read_support_compression_bzip2(struct archive *) int archive_read_support_compression_compress(struct archive *) int archive_read_support_compression_gzip(struct archive *) int archive_read_support_compression_none(struct archive *) int archive_read_support_compression_program(struct archive *, const char *command) int archive_read_support_format_all(struct archive *) int archive_read_support_format_ar(struct archive *) int archive_read_support_format_cpio(struct archive *) int archive_read_support_format_empty(struct archive *) int archive_read_support_format_gnutar(struct archive *) int archive_read_support_format_iso9660(struct archive *) int archive_read_support_format_tar(struct archive *) int archive_read_support_format_zip(struct archive *) const char * archive_version(void) int archive_version_stamp(void) time_t archive_entry_atime(struct archive_entry *) long archive_entry_atime_nsec(struct archive_entry *) time_t archive_entry_ctime(struct archive_entry *) long archive_entry_ctime_nsec(struct archive_entry *) mode_t archive_entry_mode(struct archive_entry *) const char * archive_entry_gname(struct archive_entry *) const char * archive_entry_hardlink(struct archive_entry *) time_t archive_entry_mtime(struct archive_entry *) long archive_entry_mtime_nsec(struct archive_entry *) unsigned int archive_entry_nlink(struct archive_entry *) const char * archive_entry_pathname(struct archive_entry *) long archive_entry_size(struct archive_entry *) const char * archive_entry_symlink(struct archive_entry *) const char * archive_entry_uname(struct archive_entry *) =head1 SEE ALSO man libarchive =head1 AUTHOR perl bindings: Proxmox Support Team, Esupport@proxmox.comE libarchive: Tim Kientzle =head1 COPYRIGHT AND LICENSE Copyright (C) 2007 by Dietmar Maurer This library (perl bindings) is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. The librachive code has the following Copyright Copyright (c) 2003-2006 Tim Kientzle All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer in this position and unchanged. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =cut