Archive-Libarchive-XS

 view release on metacpan or  search on metacpan

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

int
_archive_set_error(archive, status, string)
    struct archive *archive
    int status
    const char *string
  CODE:
    archive_set_error(archive, status, "%s", string);
    RETVAL = ARCHIVE_OK;
  OUTPUT:
    RETVAL

#endif

=head2 archive_entry_strmode

 my $strmode = archive_entry_strmode($entry);

Returns a string representation of the archive entry's permission mode,
a la the Unix C<ls> command (example: a mode of C<0644> should come back
as C<-rw-r--r-->.

=cut

#if HAS_archive_entry_strmode

string_or_null
archive_entry_strmode(entry)
    struct archive_entry *entry

#endif

=head2 archive_read_extract_set_skip_file

 my $status = archive_read_extract_set_skip_file($archive, $dev, $ino);

Record the dev/ino of a file that will not be written.  This is
generally set to the dev/ino of the archive being read.

=cut

#if HAS_archive_read_extract_set_skip_file

int
archive_read_extract_set_skip_file(archive, dev, ino)
    struct archive *archive
    __LA_INT64_T dev
    __LA_INT64_T ino
  CODE:
    archive_read_extract_set_skip_file(archive, dev, ino);
    RETVAL = ARCHIVE_OK;
  OUTPUT:
    RETVAL

#endif

=head2 archive_read_extract

 my $status = archive_read_extract($archive, $entry, $flags);

A convenience function that wraps the corresponding archive_write_disk interfaces.  The first call to L<#archive_read_extract> creates a restore object using L<#archive_write_disk_new> and
L<#archive_write_disk_set_standard_lookup>, then transparently invokes L<#archive_write_disk_set_options>, L<#archive_write_header>, L<#archive_write_data>, and L<#archive_write_finish_entry> to
create the entry on disk and copy data into it.  The flags argument is passed unmodified to L<#archive_write_disk_set_options>.

=cut

#if HAS_archive_read_extract

int
archive_read_extract(archive, entry, flags)
    struct archive *archive
    struct archive_entry *entry
    int flags

#endif

=head2 archive_read_extract2

 my $status = archive_read_extract2($archive1, $entry, $archive2);

This is another version of archive_read_extract() that allows you to provide your own restore object.  In particular, this allows you to override the standard lookup functions using
L<#archive_write_disk_set_group_lookup>, and L<#archive_write_disk_set_user_lookup>.  Note that L<#archive_read_extract2> does not accept a flags argument; you should use
L<#archive_write_disk_set_options> to set the restore options yourself.

=cut

#if HAS_archive_read_extract2

int
archive_read_extract2(archive1, entry, archive2)
    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



( run in 0.851 second using v1.01-cache-2.11-cpan-7f9471e7e0a )