Archive-Raw

 view release on metacpan or  search on metacpan

Raw.xs  view on Meta::CPAN

		croak ("%s error: %s (%d)", #method, archive_error_string (ar), e);


MODULE = Archive::Raw               PACKAGE = Archive::Raw

int
libarchive_version()
	CODE:
		RETVAL = archive_version_number();

	OUTPUT: RETVAL

INCLUDE: const-xs-constants.inc

INCLUDE: xs/DiskWriter.xs
INCLUDE: xs/Entry.xs
INCLUDE: xs/Match.xs
INCLUDE: xs/Reader.xs

ppport.h  view on Meta::CPAN

PTR2ul|5.007001||p
PTRV|5.006000||p
PUSHMARK|||
PUSH_MULTICALL||5.024000|
PUSHi|||
PUSHmortal|5.009002||p
PUSHn|||
PUSHp|||
PUSHs|||
PUSHu|5.004000||p
PUTBACK|||
PadARRAY||5.024000|
PadMAX||5.024000|
PadlistARRAY||5.024000|
PadlistMAX||5.024000|
PadlistNAMESARRAY||5.024000|
PadlistNAMESMAX||5.024000|
PadlistNAMES||5.024000|
PadlistREFCNT||5.017004|
PadnameIsOUR|||
PadnameIsSTATE|||

ppport.h  view on Meta::CPAN

{
    dSP;
    SV* sv = newSVpv(p, 0);

    PUSHMARK(sp);
    eval_sv(sv, G_SCALAR);
    SvREFCNT_dec(sv);

    SPAGAIN;
    sv = POPs;
    PUTBACK;

    if (croak_on_error && SvTRUEx(ERRSV))
        croak_sv(ERRSV);

    return sv;
}

#endif
#endif

typemap  view on Meta::CPAN

DiskWriter                        T_ARCHIVE_REF
Entry                             T_ARCHIVE_REF
Match                             T_ARCHIVE_REF
Reader                            T_ARCHIVE_REF

OUTPUT
T_ARCHIVE_REF
	ARCHIVE_NEW_OBJ ($arg, \"Archive::Raw::${(my $ntt = $ntype) =~ s/_/::/g;\$ntt}\", (void *) $var);

INPUT
T_ARCHIVE_REF
	$var = ARCHIVE_SV_TO_PTR (${(my $ntt = $ntype) =~ s/_/::/g;\$ntt}, $arg);

xs/DiskWriter.xs  view on Meta::CPAN

		Newxz (self, 1, archive_raw_diskwriter);
		self->ar = archive_write_disk_new();
		archive_write_disk_set_options (self->ar, flags);
		archive_write_disk_set_standard_lookup (self->ar);

		if (self->ar == NULL)
			croak ("archive_write_disk_new() failed");

		RETVAL = self;

	OUTPUT: RETVAL

void
write (self, entry)
	DiskWriter self
	Entry entry

	PREINIT:
		int rc;

	CODE:

xs/Entry.xs  view on Meta::CPAN

unsigned int
filetype (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_filetype (self->e, SvUV (ST (1)));

		RETVAL = archive_entry_filetype (self->e);

	OUTPUT: RETVAL

const char *
pathname (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_pathname (self->e, SvPV_nolen (ST (1)));

		RETVAL = archive_entry_pathname (self->e);

	OUTPUT: RETVAL

void
is_data_encrypted (self)
	Entry self

	PPCODE:
#if ARCHIVE_VERSION_NUMBER >= 3002000
		if (archive_entry_is_data_encrypted (self->e))
			XSRETURN_YES;
#else

xs/Entry.xs  view on Meta::CPAN

		if (items > 1)
		{
			if (SvOK (ST (1)))
				archive_entry_set_size (self->e, SvIV (ST (1)));
			else
				archive_entry_unset_size (self->e);
		}

		RETVAL = archive_entry_size (self->e);

	OUTPUT: RETVAL

double
ctime (self, ...)
	Entry self

	PREINIT:
		AV *result;

	CODE:
		if (items > 1)

xs/Entry.xs  view on Meta::CPAN

				archive_entry_set_ctime (self->e, SvUV (ST (1)), items > 2 ? SvIV (ST (2)) : 0);
			else
				archive_entry_unset_ctime (self->e);
		}

		double res = archive_entry_ctime (self->e);
		res += archive_entry_ctime_nsec (self->e)/1000000000UL;

		RETVAL = res;

	OUTPUT: RETVAL

double
mtime (self, ...)
	Entry self

	PREINIT:
		AV *result;

	CODE:
		if (items > 1)

xs/Entry.xs  view on Meta::CPAN

				archive_entry_set_mtime (self->e, SvUV (ST (1)), items > 2 ? SvIV (ST (2)) : 0);
			else
				archive_entry_unset_mtime (self->e);
		}

		double res = archive_entry_mtime (self->e);
		res += archive_entry_mtime_nsec (self->e)/1000000000UL;

		RETVAL = res;

	OUTPUT: RETVAL

const char *
uname (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_uname (self->e, SvPV_nolen (ST (1)));

		RETVAL = archive_entry_uname (self->e);

	OUTPUT: RETVAL

const char *
gname (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_gname (self->e, SvPV_nolen (ST (1)));

		RETVAL = archive_entry_gname (self->e);

	OUTPUT: RETVAL

SV *
uid (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_uid (self->e, SvUV (ST (1)));

		RETVAL = newSVuv (archive_entry_uid (self->e));

	OUTPUT: RETVAL

SV *
gid (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_gid (self->e, SvUV (ST (1)));

		RETVAL = newSVuv (archive_entry_gid (self->e));

	OUTPUT: RETVAL

SV *
mode (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_mode (self->e, SvUV (ST (1)));

		RETVAL = newSVuv (archive_entry_mode (self->e));

	OUTPUT: RETVAL

const char *
strmode (self)
	Entry self

	CODE:
		RETVAL = archive_entry_strmode (self->e);

	OUTPUT: RETVAL

const char *
symlink (self, ...)
	Entry self

	CODE:
		if (items > 1)
			archive_entry_set_symlink (self->e, SvPV_nolen (ST (1)));

		RETVAL = archive_entry_symlink (self->e);

	OUTPUT: RETVAL

int
symlink_type (self, ...)
	Entry self

	CODE:
#if ARCHIVE_VERSION_NUMBER >= 3004000
		if (items > 1)
			archive_entry_set_symlink_type (self->e, SvIV (ST (1)));
		RETVAL = archive_entry_symlink_type (self->e);
#else
		croak ("this feature requires libarchive 3.4+");
#endif

	OUTPUT: RETVAL

void
DESTROY (self)
	Entry self

	CODE:
		archive_entry_free (self->e);
		Safefree (self);

xs/Match.xs  view on Meta::CPAN

		archive_raw_match *self;

	CODE:
		Newxz (self, 1, archive_raw_match);
		self->m = archive_match_new();
		if (self->m == NULL)
			croak ("archive_match_new() failed");

		RETVAL = self;

	OUTPUT: RETVAL

void
excluded (self, entry)
	Match self
	Entry entry

	PPCODE:
		if (archive_match_excluded (self->m, entry->e))
			XSRETURN_YES;

xs/Reader.xs  view on Meta::CPAN

		Newxz (self, 1, archive_raw_reader);
		self->ar = archive_read_new();
		if (self->ar == NULL)
			croak ("archive_read_new() failed");

		archive_read_support_format_all (self->ar);
		archive_read_support_filter_all (self->ar);

		RETVAL = self;

	OUTPUT: RETVAL

void
open_filename (self, filename)
	Reader self
	const char *filename

	PREINIT:
		int rc;

	CODE:

xs/Reader.xs  view on Meta::CPAN

		if (rc == ARCHIVE_EOF)
			XSRETURN_UNDEF;
		archive_check_error (rc, self->ar, archive_read_next_header);

		Newxz (entry, 1, archive_raw_entry);
		entry->e = archive_entry_clone (e);
		entry->reader = self; // TODO: This should be reference counted

		RETVAL = entry;

	OUTPUT: RETVAL

int
has_encrypted_entries (self)
	Reader self

	CODE:
#if ARCHIVE_VERSION_NUMBER >= 3002000
		RETVAL = archive_read_has_encrypted_entries (self->ar);
#else
		croak ("this feature requires libarchive 3.2+");
#endif

	OUTPUT: RETVAL

int
format_capabilities (self)
	Reader self

	CODE:
#if ARCHIVE_VERSION_NUMBER >= 3002000
		RETVAL = archive_read_format_capabilities (self->ar);
#else
		croak ("this feature requires libarchive 3.2+");
#endif

	OUTPUT: RETVAL

void
add_passphrase (self, phrase)
	Reader self
	const char *phrase

	PREINIT:
		int rc;

	CODE:

xs/Reader.xs  view on Meta::CPAN

		croak ("this feature requires libarchive 3.2+");
#endif

int
file_count (self)
	Reader self

	CODE:
		RETVAL = archive_file_count (self->ar);

	OUTPUT: RETVAL

int
format (self)
	Reader self

	CODE:
		RETVAL = archive_format (self->ar);

	OUTPUT: RETVAL

const char *
format_name (self)
	Reader self

	CODE:
		RETVAL = archive_format_name (self->ar);

	OUTPUT: RETVAL

void
close (self)
	Reader self

	PPCODE:
		if (self->reading)
		{
			archive_read_close (self->ar);
			self->reading = 0;



( run in 0.422 second using v1.01-cache-2.11-cpan-4e96b696675 )