Archive-Libarchive-XS

 view release on metacpan or  search on metacpan

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN


 my $status = archive_read_disk_set_uname_lookup($archive, $data, $lookup_callback, $cleanup_callback);

Register a callback for the lookup of UID from user names.  In order to deregister call
C<archive_read_disk_setugname_lookup> with both callback functions set to C<undef>.

See L<Archive::Libarchive::XS::Callback> for calling conventions for the lookup and cleanup callbacks.

=cut

#if HAS_archive_read_disk_set_uname_lookup

int
archive_read_disk_set_uname_lookup(archive, data, lookup_callback, cleanup_callback)
    struct archive *archive
    SV *data
    SV *lookup_callback
    SV *cleanup_callback
  CODE:
    if(SvOK(cleanup_callback) || SvOK(lookup_callback))
      RETVAL = archive_read_disk_set_uname_lookup(archive, new_lookup_callback(data,lookup_callback,cleanup_callback), &mylookup_read_lookup, &mylookup_cleanup);
    else
      RETVAL = archive_read_disk_set_uname_lookup(archive, NULL, NULL, NULL);
  OUTPUT:
    RETVAL


#endif

=head2 archive_write_disk_set_user_lookup

 my $status = archive_write_disk_set_user_lookup($archive, $data, $lookup_callback, $cleanup_callback);

Register a callback for the lookup of user names from user id numbers.  In order to deregister
call C<archive_write_disk_set_user_lookup> with both callback functions set to C<undef>.

See L<Archive::Libarchive::XS::Callback> for calling conventions for the lookup and cleanup callbacks.

=cut

#if HAS_archive_write_disk_set_user_lookup

int
archive_write_disk_set_user_lookup(archive, data, lookup_callback, cleanup_callback)
    struct archive *archive
    SV *data
    SV *lookup_callback
    SV *cleanup_callback
  CODE:
    if(SvOK(cleanup_callback) || SvOK(lookup_callback))
      RETVAL = archive_write_disk_set_user_lookup(archive, new_lookup_callback(data,lookup_callback,cleanup_callback), &mylookup_write_lookup, &mylookup_cleanup);
    else
      RETVAL = archive_write_disk_set_user_lookup(archive, NULL, NULL, NULL);
  OUTPUT:
    RETVAL

#endif

=head2 archive_entry_stat

 my($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime) = archive_entry_stat($entry);

Converts the various fields stored in the archive entry to the format used by L<stat|perlfunc#stat>.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

=head2 archive_entry_set_stat

 my $status = archive_entry_stat($entry, $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime);

Converts the various fields in the format used by L<stat|perlfunc#stat> to the fields store in the archive entry.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

=head2 archive_entry_copy_stat

 my $status = archive_entry_stat($entry, $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $atime, $mtime, $ctime);

Converts the various fields in the format used by L<stat|perlfunc#stat> to the fields store in the archive entry.

The fields C<$blksize>, C<$blocks> supported by L<stat|perlfunc#stat>, are not supported by this function.

This is an alias for L<#archive_entry_set_stat>.

=head2 archive_read_open_fh

 my $status = archive_read_open_fh($archive, $fh, $block_size);

Like L<#archive_read_open_filename>, except that it accepts a file handle and block
size rather than a filename.  Note that the file handle will not be automatically
closed at end-of-archive.

If not specified, a block size of 10240 will be used.

There is no corresponding archive_read_open_fh in the C version of libarchive.
This is provided in the place of C<archive_read_open_FILE> and C<archive_read_open_fd>,
which are not in the Perl bindings for libarchive.

=head2 archive_write_open_fh

 my $status = archive_write_open_fh($archive, $fh);

A convenience form of archive_write_open() that accepts a file descriptor.  Note
that the file handle will not be automatically closed.

There is no corresponding archive_read_write_fh in the C version of libarchive.
This is provided in the place of C<archive_write_open_FILE> and C<archive_write_open_fd>,
which are not in the Perl bindings for libarchive.

=head2 archive_write_open_memory

 my $status = archive_write_open_memory($archive, \\$scalar);

A convenience form of L<#archive_write_open> that accepts a reference to a scalar that will receive the archive.

=head2 archive_read_new

 my $archive = archive_read_new();

Allocates and initializes a archive object suitable for reading from an archive.
Returns an opaque archive which may be a perl style object, or a C pointer
(depending on the implementation), either way, it can be passed into
any of the read functions documented here with an C<$archive> argument.

=cut

struct archive *
archive_read_new();

=head2 archive_read_close

 my $status = archive_read_close($archive);

Complete the archive and invoke the close callback.

=cut

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN


#endif

=head2 archive_write_get_bytes_in_last_block

 my $count = archive_write_get_bytes_per_block($archive);

Retrieve the currently-set value for last block size.  A value of -1
here indicates that the library should use default values.

=cut

#if HAS_archive_write_get_bytes_in_last_block

int
archive_write_get_bytes_in_last_block(archive)
    struct archive *archive

#endif

=head2 archive_write_fail

 my $status = archive_write_fail($archive);

Marks the archive as FATAL so that a subsequent C<free> operation
won't try to C<close> cleanly.  Provides a fast abort capability
when the client discovers that things have gone wrong.

=cut

#if HAS_archive_write_fail

int
archive_write_fail(archive)
    struct archive *archive

#endif

=head2 archive_write_disk_uid

 my $int64 = archive_write_disk_uid($archive, $string, $int64);

Undocumented libarchive function.

=cut

#if HAS_archive_write_disk_uid

__LA_INT64_T
_archive_write_disk_uid(archive, a2, a3)
    struct archive *archive
    const char *a2
    __LA_INT64_T a3
  CODE:
    RETVAL = archive_write_disk_uid(archive, a2, a3);
  OUTPUT:
    RETVAL

#endif

=head2 archive_write_disk_gid

 my $int64 = archive_write_disk_gid($archive, $string, $int64);

Undocumented libarchive function.

=cut

#if HAS_archive_write_disk_gid

__LA_INT64_T
_archive_write_disk_gid(archive, a2, a3)
    struct archive *archive
    const char *a2
    __LA_INT64_T a3
  CODE:
    RETVAL = archive_write_disk_gid(archive, a2, a3);
  OUTPUT:
    RETVAL

#endif

=head2 archive_write_disk_set_skip_file

 my $status = archive_write_disk_set_skip_file($archive, $device, $inode);

Records the device and inode numbers of a file that should not be
overwritten.  This is typically used to ensure that an extraction
process does not overwrite the archive from which objects are being
read.  This capability is technically unnecessary but can be a
significant performance optimization in practice.

=cut

#if HAS_archive_write_disk_set_skip_file

int
archive_write_disk_set_skip_file(archive, device, inode)
    struct archive *archive
    __LA_INT64_T device
    __LA_INT64_T inode

#endif

=head2 archive_seek_data

 my $count_or_status = archive_seek_data($archive, $offset, $whence);

Seek within the body of an entry.  Similar to C<lseek>.

=cut

#if HAS_archive_seek_data

__LA_INT64_T
archive_seek_data(archive, offset, whence)
    struct archive *archive
    __LA_INT64_T offset
    int whence

#endif

=head2 archive_read_set_format_option

 my $status = archive_read_set_format_option($archive, $module, $option, $value);

Specifies an option that will be passed to currently-registered format
readers.

If option and value are both C<undef>, these functions will do nothing
and C<ARCHIVE_OK> will be returned.  If option is C<undef> but value is
not, these functions will do nothing and C<ARCHIVE_FAILED> will be
returned.

If module is not C<undef>, option and value will be provided to the filter
or reader named module.  The return value will be that of the module.
If there is no such module, C<ARCHIVE_FAILED> will be returned.

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

=cut

#if HAS_archive_entry_devminor

dev_t
archive_entry_devminor(entry)
    struct archive_entry *entry

#endif

=head2 archive_entry_fflags_text($entry)

 my $string = archive_entry_fflags_text($entry);

Returns the file flags property as a string.

=cut

#if HAS_archive_entry_fflags_text

const char *
_archive_entry_fflags_text(entry)
    struct archive_entry *entry
  CODE:
    RETVAL = archive_entry_fflags_text(entry);
  OUTPUT:
    RETVAL

#endif

=head2 archive_entry_copy_fflags_text

 my $status = archive_entry_copy_fflags_text($entry, $string);

Sets the fflags_text property for the archive entry object.

This is an alias for L<#archive_entry_set_fflags_text>.

=head2 archive_entry_set_fflags_text

 my $status = archive_entry_set_fflags_text($entry, $string);

Sets the fflags_text property for the archive entry object.

=cut

#if HAS_archive_entry_copy_fflags_text

int
_archive_entry_set_fflags_text(entry, string)
    struct archive_entry *entry
    string_or_null string
  CODE:
    archive_entry_copy_fflags_text(entry, string);
    RETVAL = ARCHIVE_OK;
  OUTPUT:
    RETVAL

#endif

=head2 archive_entry_gid

 my $gid = archive_entry_gid($entry);

Returns the group id property for the archive entry.

=cut

#if HAS_archive_entry_gid

__LA_INT64_T
archive_entry_gid(entry)
    struct archive_entry *entry

#endif

=head2 archive_entry_set_gid

 my $status = archive_entry_set_gid($gid).

Sets the group id property for the archive entry.

=cut

#if HAS_archive_entry_set_gid

int
archive_entry_set_gid(entry, gid)
    struct archive_entry *entry
    __LA_INT64_T gid
  CODE:
    archive_entry_set_gid(entry, gid);
    RETVAL = ARCHIVE_OK;
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_descend

 my $status = archive_read_disk_descend($archive);

Request that current entry be visited.  If you invoke it on every
directory, you'll get a physical traversal.  This is ignored if the
current entry isn't a directory or a link to a directory.  So, if
you invoke this on every returned path, you'll get a full logical
traversal.

=cut

#if HAS_archive_read_disk_descend

int
archive_read_disk_descend(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_can_descend

 my $bool = archive_read_disk_can_descend($archive);

Undocumented libarchive function.

=cut

#if HAS_archive_read_disk_can_descend

int
archive_read_disk_can_descend(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_current_filesystem

 my $status = archive_read_disk_current_filesystem($archive);

Undocumented libarchive function.

=cut

#if HAS_archive_read_disk_current_filesystem

int
archive_read_disk_current_filesystem(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_current_filesystem_is_synthetic

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

archive_read_disk_current_filesystem_is_synthetic(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_current_filesystem_is_remote

 my $status = archive_read_disk_current_filesystem_is_remote($archive);

Undocumented libarchive function.

=cut

#if HAS_archive_read_disk_current_filesystem_is_remote

int
archive_read_disk_current_filesystem_is_remote(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_set_atime_restored

 my $status = archive_read_disk_set_atime_restored($archive);

Request that the access time of the entry visited by traversal be restored.

=cut

#if HAS_archive_read_disk_set_atime_restored

int
archive_read_disk_set_atime_restored(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_open

 my $status = archive_read_disk_open($archive, $string)

Allocates and initializes an archive object suitable for reading objects from disk.

=cut

#if HAS_archive_read_disk_open

int
_archive_read_disk_open(archive, name)
    struct archive *archive
    const char *name
  CODE:
    RETVAL = archive_read_disk_open(archive, name);
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_gname

 my $string = archive_read_disk_gname($archive, $gid);

Returns a group name given a gid value.  By default always
returns C<undef>.

=cut

#if HAS_archive_read_disk_gname

string_or_null
_archive_read_disk_gname(archive, gid)
    struct archive *archive
    __LA_INT64_T gid
  CODE:
    RETVAL = archive_read_disk_gname(archive, gid);
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_uname

 my $string = archive_read_disk_uname($archive, $gid);

Returns a user name given a uid value.  By default always
returns C<undef>.

=cut

#if HAS_archive_read_disk_uname

string_or_null
_archive_read_disk_uname(archive, gid)
    struct archive *archive
    __LA_INT64_T gid
  CODE:
    RETVAL = archive_read_disk_uname(archive, gid);
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_disk_new

 my $archive = archive_read_disk_new();

Allocates and initializes an archive object suitable for reading object information
from disk.

=cut

#if HAS_archive_read_disk_new

struct archive *
archive_read_disk_new()

#endif

=head2 archive_read_disk_set_behavior

 my $status = archive_read_disk_set_behavior($archive, $flags);

Undocumented libarchive function.

=cut

#if HAS_archive_read_disk_set_behavior

int
archive_read_disk_set_behavior(archive, flags)
    struct archive *archive
    int flags

#endif

=head2 archive_read_disk_set_standard_lookup

 my $status = archive_read_disk_set_standard_lookup($archive);

This convenience function installs a standard set of user and group name lookup functions.
These functions use C<getpwuid> and C<getgrgid> to convert ids to names, defaulting to C<undef>.
if the names cannot be looked up.  These functions also implement a simple memory cache to
reduce the number of calls to C<getpwuid> and C<getgrgid>.

=cut

#if HAS_archive_read_disk_set_standard_lookup

int
archive_read_disk_set_standard_lookup(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_set_symlink_hybrid

 my $status = archive_read_disk_set_symlink_hybrid($archive);

This sets the mode used for handling symbolic links.  The "hybrid" mode currently
behaves identically to the "logical" mode.

=cut

#if HAS_archive_read_disk_set_symlink_hybrid

int
archive_read_disk_set_symlink_hybrid(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_set_symlink_logical

 my $status = archive_read_disk_set_symlink_logical($archive);

This sets the mode used for handling symbolic links.  The "logical" mode follows
all symbolic links.

=cut

#if HAS_archive_read_disk_set_symlink_logical

int
archive_read_disk_set_symlink_logical(archive)
    struct archive *archive

#endif

=head2 archive_read_disk_set_symlink_physical

 my $status = archive_read_disk_set_symlink_physical($archive);

This sets the mode used for handling symbolic links.  The "physical" mode does not
follow any symbolic links.

=cut

#if HAS_archive_read_disk_set_symlink_physical

int
archive_read_disk_set_symlink_physical(archive)
    struct archive *archive

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN


#endif

=head2 archive_match_excluded

 my $bool = archive_match_excluded($archive, $entry);

Test if archive_entry is excluded. This is a convenience function. This is the
same as calling all L<#archive_match_path_excluded>, L<#archive_match_time_excluded>
and L<#archive_match_owner_excluded>.

=cut

#if HAS_archive_match_excluded

int
archive_match_excluded(archive, entry)
    struct archive *archive
    struct archive_entry *entry

#endif

=head2 archive_match_path_excluded

 my $bool = archive_match_path_excluded($archive, $entry);

Test if pathname is excluded.

=cut

#if HAS_archive_match_path_excluded

int
archive_match_path_excluded(archive, entry)
    struct archive *archive
    struct archive_entry *entry

#endif

=head2 archive_match_time_excluded

 my $bool = archive_match_time_excluded($archive, $entry);

Test if a file is excluded by its time stamp.

=cut

#if HAS_archive_match_time_excluded

int
archive_match_time_excluded(archive, entry)
    struct archive *archive
    struct archive_entry *entry

#endif

=head2 archive_match_owner_excluded

 my $bool = archive_match_owner_excluded($archive, $entry);

Test if a file is excluded by its uid, gid, user name or group name.

=cut

#if HAS_archive_match_owner_excluded

int
archive_match_owner_excluded(archive, entry)
    struct archive *archive
    struct archive_entry *entry

#endif

=head2 archive_perl_codeset

 my $string = archive_perl_codeset();

Returns the name of the "codeset" (character encoding, example: "UTF-8" for
UTF-8 or "ANSI_X3.4-1968" for ASCII) of the currently configured locale.

=cut

#if HAS_archive_perl_codeset

string_or_null
archive_perl_codeset()

#endif

=head2 archive_perl_utf8_mode

 my $bool = archive_perl_utf8_mode();

Returns true if the internal "codeset" used by libarchive is UTF-8.

=cut

#if HAS_archive_perl_utf8_mode

int
archive_perl_utf8_mode()

#endif

=head2 archive_entry_acl

 my $acl = archive_entry_acl($entry);

Return an opaque ACL object.

There's not yet anything you can actually do with this...

=cut

#if HAS_archive_entry_acl

struct archive_acl *
archive_entry_acl(entry)
    struct archive_entry *entry

#endif

lib/Archive/Libarchive/XS.xs  view on Meta::CPAN

    struct archive *archive1
    struct archive_entry *entry
    struct archive *archive2

#endif

=head2 archive_read_disk_entry_from_file

 my $status = archive_read_disk_entry_from_file($archive, $entry, $fh, undef);
 my $status = archive_read_disk_entry_from_file($archive, $entry, $fh, \\@stat);
 my $status = archive_read_disk_entry_from_file($archive, $entry, undef, \\@stat);

Populates a struct archive_entry object with information about a particular file.  The archive_entry object must have already been created with L<#archive_entry_new> and at least one of the
source path or path fields must already be set.  (If both are set, the source path will be used.)

Information is read from disk using the path name from the struct archive_entry object.  If a file handle ($fh) is provided, some information will be obtained using that file handle, on
platforms that support the appropriate system calls.

Note: The C API supports passing in a stat structure for some performance benefits.  Currently this is unsupported in the Perl version, and you must pass undef in as the forth argument,
for possible future compatibility.

Where necessary, user and group ids are converted to user and group names using the currently registered lookup functions above.  This affects the file ownership fields and ACL values in the
struct archive_entry object.

=cut

#if HAS_archive_read_disk_entry_from_file

int
_archive_read_disk_entry_from_file(archive, entry, fd, stat)
    struct archive *archive
    struct archive_entry *entry
    int fd
    SV *stat
  CODE:
    if(SvOK(stat))
      croak("stat field currently not supported");
    RETVAL = archive_read_disk_entry_from_file(archive, entry, fd, NULL);
  OUTPUT:
    RETVAL

#endif

=head2 archive_match_include_uid

 my $status = archive_match_include_uid($archive, $uid);

The match object $archive should match entries with the given $uid

=cut

#if HAS_archive_match_include_uid

int
archive_match_include_uid(archive, uid)
    struct archive *archive
    __LA_INT64_T uid

#endif

=head2 archive_match_include_gid

 my $status = archive_match_include_gid($archive, $gid);

The match object $archive should match entries with the given $gid

=cut

#if HAS_archive_match_include_gid

int
archive_match_include_gid(archive, gid)
    struct archive *archive
    __LA_INT64_T gid

#endif

=head2 archive_match_include_uname

 my $status = archive_match_include_uname($archive, $uname);

The match object $archive should match entries with the given user name

=cut

#if HAS_archive_match_include_uname

int
_archive_match_include_uname(archive, uname)
    struct archive *archive
    string_or_null uname
  CODE:
    RETVAL = archive_match_include_uname(archive, uname);
  OUTPUT:
    RETVAL

#endif

=head2 archive_match_include_gname

 my $status = archive_match_include_gname($archive, $gname);

The match object $archive should match entries with the given group name

=cut

#if HAS_archive_match_include_gname

int
_archive_match_include_gname(archive, gname)
    struct archive *archive
    string_or_null gname
  CODE:
    RETVAL = archive_match_include_gname(archive, gname);
  OUTPUT:
    RETVAL

#endif

=head2 archive_entry_copy_sourcepath

 my $status = archive_entry_set_sourcepath($entry, $sourcepath);

Sets the sourcepath property for the archive entry object.

This is an alias for archive_entry_set_sourcepath.

=head2 archive_entry_set_sourcepath

 my $status = archive_entry_set_sourcepath($entry, $sourcepath);

Sets the sourcepath property for the archive entry object.

=cut



( run in 0.651 second using v1.01-cache-2.11-cpan-ff9377addf4 )