ALPM

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

-*- org -*-

:     _    _     ____  __  __    ____ _                                 
:    / \  | |   |  _ \|  \/  |  / ___| |__   __ _ _ __   __ _  ___  ___ 
:   / _ \ | |   | |_) | |\/| | | |   | '_ \ / _` | '_ \ / _` |/ _ \/ __|
:  / ___ \| |___|  __/| |  | | | |___| | | | (_| | | | | (_| |  __/\__ \
: /_/   \_\_____|_|   |_|  |_|  \____|_| |_|\__,_|_| |_|\__, |\___||___/
:                                                       |___/           

* Release 3.06
- Add assumeinstalled option accessors/setters

* Release 3.05
- Add missing get_root and get_dbpath methods to ALPM.
- Assign proper DB class to DB object returned by a package's DB accessor.
- Fix $arch and $repo parsing in mirror list.

Fixes by Andrew Gregory. Thank you!

* Release 3.04

Changes  view on Meta::CPAN


** Bugfix for find_satisfier and find_dbs_satisfier.

These two functions were causing crashes because of my misuse of a macro
that was screwing up the perl stack.

Reported by Radu Andries. Thank you!

* Release 3.01

** set_pkg_reason moved to ALPM::DB::Local and renamed set_install_reason.

The ALPM object method was relocated to the ALPM::DB::Local class and I have
renamed it to set_install_reason. This was prompted by the libalpm function
name change from alpm_db_set_pkgreason to alpm_pkg_set_reason.

** New ALPM::Package accessors.

 - origin
 - validation
 - signature

** New "desc" field in depends hashref.

If a dependency is optional, it contains a "desc" entry in the hash

Changes  view on Meta::CPAN

    replace the old sync, pkgfile, remove, and sync_from_db
    methods.

    The new methods take package objects as arguments. The old
    methods took package names as arguments. This reflects the same
    libalpm changes.

** ALPM method aliases removed
   For some reason I made aliases everytime I changed a function name.
   I don't think anyone uses this module anyways so I just yanked out
   a bunch of old method aliases I had setup. The following are
   removed from the ALPM class, just use their alternate names.

   |----------------+--------------|
   | Removed Method | "New" Method |
   |----------------+--------------|
   | register_db    | register     |
   | transaction    | trans        |
   | action         | trans        |
   | databases      | dbs          |
   | repodb         | db           |

Changes  view on Meta::CPAN

2010-11-21  Justin Davis  <juster@cpan.org>

	* lib/ALPM/Package.pm (attribs): Fix attribs to return a list and
	not an array reference.

2010-06-22  Justin Davis  <juster@cpan.org>

	* lib/ALPM.pm (transaction): Removed type parameter from
	transaction method.

	* ALPM.xs: Renamed ALPM::DB method set_server to add_url.

2010-05-29  Justin Davis  <juster@cpan.org>

	* RELEASE (0.08): Uploaded to CPAN.

	* typemap (find_group): Fix a bug with group type conversion.
	This caused ALPM::DB::find_group() to croak instead of (properly)
	returning undef when given a group name that didn't exist.
	Reported by Andre Schmidt. Thanks!

2010-05-24  Justin Davis  <juster@cpan.org>

	* ALPM.xs (ALPM::Package): Renamed compute_requiredby method to
	requiredby.

2010-05-02  Justin Davis  <juster@cpan.org>

	* t/04-FakeRepos.t: Add support for .pkg.tar.xz package files.

	* lib/ALPM/LoadConfig.pm: Add support for UseDelta setting in
	pacman.conf.

2010-01-25  Justin Davis  <jrcd83@gmail.com>

	* t/04-FakeRepos.t (create_repos): Fixed problems with test
	04-FakeRepos where packages would fail to build.  Changed
	generated test packages to arch "any" so we don't have to check
	our arch.

	* Makefile.PL: "make clean" will now delete the test repository

Changes  view on Meta::CPAN

	directory (t/root) automatically.


2010-01-04  Justin Davis  <jrcd83@gmail.com>

	* 0.5 (RELEASE)

	* lib/ALPM/LoadConfig.pm (_make_parser): Tweaked regex to accept empty values.
	Removed error when an unknown field name is given.

	* lib/ALPM.pm: Added ability to set usedelta option, which was missing.

	* Makefile.PL: Added repository URL to the META.yml.

	* t/07-TiedOptions.t: Hides the warning for the last test using $SIG{__WARN__}.

	* t/04-FakeRepos.t (create_repos): Fixed a bug where I must use
	the --asroot option when running makepkg inside makepkg, because
	of fakeroot.

2009-10-29  Justin Davis  <jrcd83@gmail.com>

Changes  view on Meta::CPAN

	* ALPM.xs: s/alpm_pkg_get_/alpm_pkg_/;

	* lib/ALPM/DB.pm: Renamed get_pkg_cache() to packages().

	* lib/ALPM.pm: Changed methods local_db to localdb, get_sync_dbs
	to syncdbs, get_repo_db to repodb, and added search.

	- Updated to version 3.30 of pacman.  The upgrade changes
	many constants and functions.
	- I have declared war on the get_ named methods.  It seems silly
	to have all these get_ methods when there is no set_ method for
	anything except ALPM options (whose prefix I will keep).

2005-08-05  Justin Davis  <jrcd83@gmail.com>
	0.03
        - Added transaction support with ALPM::Transaction.
	- Implemented callback options to ALPM and also transaction
        callbacks using the transaction() method.
        - Created tied hash interface to ALPM options just for fun.

2009-07-15  Justin Davis  <jrcd83@gmail.com>

alpm_xs.h  view on Meta::CPAN

extern const char * log_lvl_warning;
extern const char * log_lvl_debug;
extern const char * log_lvl_function;
extern const char * log_lvl_unknown;

/* CALLBACKS ****************************************************************/

#define DEF_SET_CALLBACK( CBTYPE )                                  \
    if ( ! SvOK(callback) && cb_ ## CBTYPE ## _sub != NULL ) {      \
        SvREFCNT_dec( cb_ ## CBTYPE ## _sub );                      \
        alpm_option_set_ ## CBTYPE ## cb( NULL );                   \
        cb_ ## CBTYPE ## _sub = NULL;                               \
    }                                                               \
    else {                                                          \
        if ( !SvROK(callback)                                       \
             || SvTYPE( SvRV(callback) ) != SVt_PVCV ) {            \
            croak( "value for %scb option must be a code reference", \
                   #CBTYPE );                                       \
        }                                                           \
        if ( cb_ ## CBTYPE ## _sub ) {                              \
            sv_setsv( cb_ ## CBTYPE ## _sub, callback );            \
        }                                                           \
        else {                                                      \
            cb_ ## CBTYPE ## _sub = newSVsv(callback);              \
            alpm_option_set_ ## CBTYPE ## cb                        \
                ( cb_ ## CBTYPE ## _wrapper );                      \
        }                                                           \
    }

#define DEF_GET_CALLBACK( CBTYPE )                          \
    RETVAL = ( cb_ ## CBTYPE ## _sub == NULL                \
               ? &PL_sv_undef : cb_ ## CBTYPE ## _sub );

void cb_log_wrapper ( alpm_loglevel_t level, const char * format, va_list args );
void cb_dl_wrapper ( const char *filename, off_t xfered, off_t total );

alpm_xs.h  view on Meta::CPAN

   * cb_trans_[CB_NAME]_wrapper is the name of the C wrapper function which
     calls the perl sub stored in the global variable:
   * cb_trans_[CB_NAME]_sub.
*/
#define UPDATE_TRANS_CALLBACK( CB_NAME )                                \
    if ( SvOK( CB_NAME ## _sub ) ) {                                    \
        if ( SvTYPE( SvRV( CB_NAME ## _sub ) ) != SVt_PVCV ) {          \
            croak( "Callback arguments must be code references" );      \
        }                                                               \
        if ( cb_trans_ ## CB_NAME ## _sub ) {                           \
            sv_setsv( cb_trans_ ## CB_NAME ## _sub, CB_NAME ## _sub );   \
        }                                                               \
        else {                                                          \
            cb_trans_ ## CB_NAME ## _sub = newSVsv( CB_NAME ## _sub );  \
        }                                                               \
        CB_NAME ## _func = cb_trans_ ## CB_NAME ## _wrapper;            \
    }                                                                   \
    else if ( cb_trans_ ## CB_NAME ## _sub != NULL ) {                  \
        /* If no event callback was provided for this new transaction,  \
           and an event callback is active, then remove the old callback. */ \
        SvREFCNT_dec( cb_trans_ ## CB_NAME ## _sub );                   \

cb.c  view on Meta::CPAN

	case ALPM_LOG_ERROR: str = "error"; break;
	case ALPM_LOG_WARNING: str = "warning"; break;
	case ALPM_LOG_DEBUG: str = "debug"; break;
	case ALPM_LOG_FUNCTION: str = "function"; break;
	default: str = "unknown"; break;
	}

	ENTER;
	SAVETMPS;

	/* We can't use sv_vsetpvfn because it doesn't like j's: %jd or %ji, etc... */
	svlvl = sv_2mortal(newSVpv(str, 0));
	vsnprintf(buf, 255, fmt, args);
	svmsg = sv_2mortal(newSVpv(buf, 0));
	
	PUSHMARK(SP);
	XPUSHs(svlvl);
	XPUSHs(svmsg);
	PUTBACK;

	call_sv(logcb_ref, G_DISCARD);

cb.h  view on Meta::CPAN

#ifndef _ALPMXS_CB
#define _ALPMXS_CB

#define DEFSETCB(TYPE, HND, ARG)\
	if(!SvOK(ARG) && TYPE##cb_ref){\
		SvREFCNT_dec(TYPE##cb_ref);\
		alpm_option_set_##TYPE##cb(HND, NULL);\
		TYPE##cb_ref = NULL;\
	}else{\
		if(!SvROK(ARG) || SvTYPE(SvRV(ARG)) != SVt_PVCV){\
			croak("value for " #TYPE "cb option must be a code reference");\
		}else if(TYPE##cb_ref){\
			sv_setsv(TYPE##cb_ref, ARG);\
		}else{\
			TYPE##cb_ref = newSVsv(ARG);\
			alpm_option_set_##TYPE##cb(HND, c2p_##TYPE##cb);\
		}\
	}

extern SV * logcb_ref, * dlcb_ref, * totaldlcb_ref, * fetchcb_ref;

void c2p_logcb(alpm_loglevel_t, const char *, va_list);
void c2p_dlcb(const char *, off_t, off_t);
int c2p_fetchcb(const char *, const char *, int);
void c2p_totaldlcb(off_t);

lib/ALPM.pod  view on Meta::CPAN

ALPM - readonly access to pacman's libalpm.

=head1 VERSION

3.06

This version of ALPM is compatible with pacman 4.

=head1 SYNOPSIS

  ## We can start by setting options all by ourselves.
  use ALPM;
  my $alpm = ALPM->new('/', '/var/lib/db'); # root and dbpath
  $alpm->set_cachedirs('/var/cache/pacman/pkg');
  $alpm->set_logfile('/var/log/pacman.log');
  
  ## Or use ALPM::Conf, a handy module for pacman.conf parsing.
  use ALPM::Conf qw(/etc/pacman.conf);
  ## ALPM::Conf loads an object into "our" package variable.
  our $alpm;
  
  ## Querying databases & packages
  my $localdb = $alpm->localdb;
  my $pkg = $localdb->find('perl') or die 'wtfbbq';
  printf "%s %s %s %d\n", $pkg->name, $pkg->version,

lib/ALPM.pod  view on Meta::CPAN

=over 4

=item C<$NAME>

The name to use for the database (e.g. core, extra, community.)

=item C<$SIGLEVEL> I<(Optional>)

The signature level to use for the database, including the database file and each
package file downloaded from the database mirror. If none is specified, then the
signature level is set to C<'default'> which is equivalent to the signature level set with
the I<set_defsiglvl> method.

=item C<$DB>

On success, an L<ALPM::DB::Sync> object.

=item C<undef>

On failure. Check L</strerror>.

=back

lib/ALPM.pod  view on Meta::CPAN

  1 | undef = $OBJ->unregister_all()

Unregisters all sync databases. If you try to use previously registered
L<ALPM::DB::Sync> objects, they will probable cause a segfault...

Returns 1 on success or undef on error. Check L</strerror> on error.

=head1 ALPM OPTIONS

ALPM has a number of options corresponding to the
C<alpm_option_get_...> and C<alpm_option_set...> C functions in the
library.  Options which take multiple values (hint: they have a plural
name) accept multiple arguments in the corresponding methods.
Similarly the same options return a list.

=head2 Read-write options

=over

=item B<logfile> - path to the pacman logfile

lib/ALPM.pod  view on Meta::CPAN


=item B<gpgdir> - path to gpg stuff

=item B<cachedirs>* - paths containing package caches

=item B<noupgrades>* - a list of package names to not upgrade

=item B<noextracts>* - a list of package names to not extract

=item B<assumeinstalled>* - a list of dependencies to assume are satisfied.
The setter methods take either a dependency hash or a string representing
a dependency.  The accessor returns a list of dependency hash references.

=item B<ignorepkgs>* - a list of package names to ignore for upgrade

=item B<ignoregroups>* - a list of groups to ignore for upgrade

=item B<usesyslog> - if true, log to the system log as well

=item B<deltaratio> - accepts a decimal from 0 to 1

=item B<checkspace> - check for available diskspace

=item B<defsiglvl> - the default signature level. See L</Signature Level>.
This name was shortened from I<alpm_option_set_default_signature_level>.
You're welcome.

=back

=head2 Read-only options

=over

=item B<root> - path to the installation root

=item B<dbpath> - path to the database

=item B<lockfile> - path to the lockfile

=back

  * = the option is set with (and gets you) a list

=head2 Callback options

Callbacks can only be set to code references.

=head3 logcb - Generic logging

The log level and message are passed to the provided code ref as
arguments.

=over 4

=item 1. level

lib/ALPM.pod  view on Meta::CPAN

=back

=head1 DATA TYPES

Several libalpm data types have been converted into hash references. The
alternative is to turn them into full-blown objects, which seems pointless
considering the only methods are data accessors.

=head2 Dependency

Dependencies specify constraints on a set of packages. Only certain packages
satisfy a dependency. These can be used in places other than dependencies,
such as conflicts. Dependencies have the following keys:

=over 4

=item name

The name of a package.

=item version

lib/ALPM.pod  view on Meta::CPAN

A hashref that is identical to a dependency. See L</Dependency>.

=back

=head2 Signature Level

Signature levels describe the level of security which is required for packages files
and by databases files. Different degrees of signature checking can be used for
either type of file. The signature checking is performed after the file is downloaded
in order to verify the original packager. B<When gpg is not available an invalid argument
error will be raised from libalpm if you try to set the siglevel.>

A "siglvl" can either be the string C<"default"> or a hash reference. A value of C<"default">
can be used when registering a database to instruct libalpm to use the default siglevel
that is set by I<set_defsiglvl>. A siglvl hashref must contain a C<"pkg"> key
and a C<"db"> key. Other keys are ignored.

Possible hash values include:

=over 4

=item C<"never">

No signature verification is performed.

lib/ALPM.pod  view on Meta::CPAN


Signatures are required.

=back

The string C<"trustall">, preceded by a space, can be added to C<"optional"> or
C<"required"> options to specify that signatures from anyone are to be trusted.

Here are some example siglevels:

  $alpm->set_defsiglvl({ 'pkg' => 'never', 'db' => 'never' });
  $alpm->set_defsiglvl({ 'pkg' => 'optional', 'db' => 'required trustall' });
  $alpm->set_defsiglvl({ 'pkg' => 'required', 'db' => 'optional' });

=head1 ERRORS

In previous version of this module, errors were thrown automatically. Since then,
errors are no longer stored in a global variable (like UNIX's errno) but are instead
stored inside of the libalpm handle structure. In order to preserve the old functionality
I will have to either store a copy of the ALPM object inside every other object or use
the internal C representation which I'm technically not supposed to know.

Whatever. I'm too lazy for either of those. What this means for you is you really really
should check for errors yourself. If a method call returns undef you should follow it
up with an "or die". Something like this:

  $db->force_update or die $alpm->strerror;

This is annoying but not unlike most other perl error checking. If you find yourself
calling methods on an undefined value then an error most likely occurred.

But wait there's more! Errors are actually thrown when getting/setting options and
an error condition occurs.

=head1 SEE ALSO

=over

=item * L<ALPM::Conf>, L<ALPM::DB>, L<ALPM::Package>, L<ALPM::Transaction>

=item * L<http://projects.archlinux.org/pacman.git/> - git repository for pacman/libalpm

lib/ALPM/Conf.pm  view on Meta::CPAN

	'Architecture' => 'arch',
);

sub _confhooks
{
	my($optsref, $sectref) = @_;
	my %hooks;
	while(my($fld, $opt) = each %CFGOPTS){
		$hooks{$fld} = sub { 
			my $val = shift;
			die qq{$fld can only be set in the [options] section\n}
				unless($$sectref eq 'options');
			$optsref->{$opt} = $val;
		};
	 }
	return %hooks;
}

sub _nullhooks
{
	map { ($_ => \&_null) } @_

lib/ALPM/Conf.pm  view on Meta::CPAN


	# The order databases are added must be preserved as must the order of URLs.
	for my $db (@$dbs){
		return $db if($db->{'name'} eq $name);
	}
	my $new = { 'name' => $name };
	push @$dbs, $new;
	return $new;
}

sub _setsiglvl
{
	my($dbs, $sect, $siglvl) = @_;
	my $db = _getdb($dbs, $sect);
	$db->{'siglvl'} = $siglvl;
	return;
}

sub _parse_siglvl
{
	my($str) = @_;

lib/ALPM/Conf.pm  view on Meta::CPAN

	# Check for a blank SigLevel
	unless(defined $opt){
		die "SigLevel was empty\n";
	}
	return $opt;
}

sub _addmirror
{
	my($dbs, $url, $sect) = @_;
	die "Section has not previously been declared, cannot set URL\n" unless($sect);

	my $db = _getdb($dbs, $sect);
	push @{$db->{'mirrors'}}, $url;
	return;
}


sub _setopt
{
	my($alpm, $opt, $valstr) = @_;
	no strict 'refs';
	my $meth = *{"ALPM::set_$opt"}{'CODE'};
	die "The ALPM::set_$opt method is missing" unless($meth);

	my @val = ($opt =~ /s$/ ? map { split } $valstr : $valstr);
	return $meth->($alpm, @val);
}

sub _setarch
{
	my($opts) = @_;
	if(!$opts->{'arch'} || $opts->{'arch'} eq 'auto'){
		chomp ($opts->{'arch'} = `uname -m`);
	}
}

sub _expurls
{
	my($urls, $arch, $repo) = @_;

lib/ALPM/Conf.pm  view on Meta::CPAN

	unless($root){
		$root = '/';
		unless($dbpath){
			$dbpath = "$root/var/lib/pacman";
			$dbpath =~ tr{/}{/}s;
		}
	}

	my $alpm = ALPM->new($root, $dbpath);

	_setarch($opts);
	while(my ($opt, $val) = each %$opts){
		# The SetOption type in typemap croaks on error, no need to check.
		_setopt($alpm, $opt, $val);
	}

	my $usesl = grep { /signatures/ } $alpm->caps;
	for my $db (@$dbs){
		my($r, $sl, $mirs) = @{$db}{'name', 'siglvl', 'mirrors'};
		next if(!@$mirs);

		_expurls($mirs, $opts->{'arch'}, $r);
		$sl = 'default' if(!$usesl);
		my $x = $alpm->register($r, $sl)

lib/ALPM/Conf.pm  view on Meta::CPAN

			die "Cannot have an Include directive in the [options] section\n"
				if($currsect eq 'options');

			# An include directive spawns its own little parser...
			_parse(shift, _mlisthooks(\@dbs, \$currsect));
		},
		'SigLevel' => sub {
			if($currsect eq 'options'){
				$defsiglvl = _parse_siglvl(shift);
			}else{
				_setsiglvl(\@dbs, $currsect, _parse_siglvl(shift));
			}
		},
		($self->{'cfields'} ? %{$self->{'cfields'}} : ()),
	);

	my %hooks = (
		'field' => \%fldhooks,
		'section' => sub { $currsect = shift; }
	);

lib/ALPM/Conf.pod  view on Meta::CPAN

	# This is handy for the command line or shell scripts.
	% perl -MALPM::Conf=/etc/pacman.conf -e '
	for $p ($alpm->localdb->pkgs){
		print $p->name, " ", $p->version, "\n";
	}
	'

=head1 DESCRIPTION

This class is used to parse the pacman.conf files which are used by ArchLinux's
pacman for config files.  The configuration fields are used to set ALPM options.
A new I<ALPM> object instance is created with corresponding options set.

=head1 CONSTRUCTOR

=head2 new

	$OBJ = ALPM::Conf->new($CONF_PATH);

=over 4

=item C<$CONF_PATH>

lib/ALPM/DB/Local.pod  view on Meta::CPAN

=pod

=head1 NAME

ALPM::DB::Local - Machine-local package database.

=head1 SYNOPSIS

  $db = $alpm->localdb;
  $pkg = $db->find('perl');
  $db->set_install_reason($pkg, 'implicit') or die $alpm->strerror;

=head1 OBJECT METHODS

This is a subclass of I<ALPM::DB> and inherits all of its methods.

=head2 set_install_reason

  $SUCCESS = $DB->set_install_reason($PKG, $REASON);

The installation reason records whether the package was installed
explicitly or implicitly. Packages installed as requested on the command
line are installed explicitly. Packages installed as dependencies are
installed implicitly. You can override the reason here.

=over 4

=item C<$PKG>

lib/ALPM/DB/Sync.pod  view on Meta::CPAN

=head1 NAME

ALPM::DB::Sync - Synchronized remote databases.

=head1 OBJECT METHODS

=head2 servers

  $SUCCESS = $DB->add_server($URL)
  $SUCCESS = $DB->remove_server($URL)
  $SUCCESS = $DB->set_servers(@URLS)
  @URLS = $DB->get_servers()

A plethora of accessors and mutators for the repo URLs of databases.

=over 4

=item C<$URL>

The base url where database files are publicly available.

lib/ALPM/Package.pod  view on Meta::CPAN

=head1 DESCRIPTION

This class is a wrapper for all of the C<alpm_pkg_...> C library functions
of libalpm.  You retrieve the package from the database and you can then
access its information.

=head1 ACCESSORS

The accessors are named almost exactly the same as the C<alpm_pkg_get...>
functions. I have removed the get_ prefix on the accessors.  This is
because you can't really I<set> anything so you should know it's a get
anyways.

=over

=item * filename

=item * name

=item * version

ppport.h  view on Meta::CPAN

automagially add a dot between the original filename and the
suffix. If you want the dot, you have to include it in the option
argument.

If neither C<--patch> or C<--copy> are given, the default is to
simply print the diffs for each file. This requires either
C<Text::Diff> or a C<diff> program to be installed.

=head2 --diff=I<program>

Manually set the diff program and options to use. The default
is to use C<Text::Diff>, when installed, and output unified
context diffs.

=head2 --compat-version=I<version>

Tell F<ppport.h> to check for compatibility with the given
Perl version. The default is to check for compatibility with Perl
version 5.003. You can use this option to reduce the output
of F<ppport.h> if you intend to be backward compatible only
down to a certain Perl version.

ppport.h  view on Meta::CPAN

    newSVpvn_flags()          NEED_newSVpvn_flags          NEED_newSVpvn_flags_GLOBAL
    newSVpvn_share()          NEED_newSVpvn_share          NEED_newSVpvn_share_GLOBAL
    pv_display()              NEED_pv_display              NEED_pv_display_GLOBAL
    pv_escape()               NEED_pv_escape               NEED_pv_escape_GLOBAL
    pv_pretty()               NEED_pv_pretty               NEED_pv_pretty_GLOBAL
    sv_2pv_flags()            NEED_sv_2pv_flags            NEED_sv_2pv_flags_GLOBAL
    sv_2pvbyte()              NEED_sv_2pvbyte              NEED_sv_2pvbyte_GLOBAL
    sv_catpvf_mg()            NEED_sv_catpvf_mg            NEED_sv_catpvf_mg_GLOBAL
    sv_catpvf_mg_nocontext()  NEED_sv_catpvf_mg_nocontext  NEED_sv_catpvf_mg_nocontext_GLOBAL
    sv_pvn_force_flags()      NEED_sv_pvn_force_flags      NEED_sv_pvn_force_flags_GLOBAL
    sv_setpvf_mg()            NEED_sv_setpvf_mg            NEED_sv_setpvf_mg_GLOBAL
    sv_setpvf_mg_nocontext()  NEED_sv_setpvf_mg_nocontext  NEED_sv_setpvf_mg_nocontext_GLOBAL
    vload_module()            NEED_vload_module            NEED_vload_module_GLOBAL
    vnewSVpvf()               NEED_vnewSVpvf               NEED_vnewSVpvf_GLOBAL
    warner()                  NEED_warner                  NEED_warner_GLOBAL

To avoid namespace conflicts, you can change the namespace of the
explicitly exported functions / variables using the C<DPPP_NAMESPACE>
macro. Just C<#define> the macro before including C<ppport.h>:

    #define DPPP_NAMESPACE MyOwnNamespace_
    #include "ppport.h"

ppport.h  view on Meta::CPAN

                      (index($4, 'n') >= 0 ? ( nothxarg => 1  ) : ()),
                    } )
                : die "invalid spec: $_" } qw(
AvFILLp|5.004050||p
AvFILL|||
CLASS|||n
CPERLscope|5.005000||p
CX_CURPAD_SAVE|||
CX_CURPAD_SV|||
CopFILEAV|5.006000||p
CopFILEGV_set|5.006000||p
CopFILEGV|5.006000||p
CopFILESV|5.006000||p
CopFILE_set|5.006000||p
CopFILE|5.006000||p
CopSTASHPV_set|5.006000||p
CopSTASHPV|5.006000||p
CopSTASH_eq|5.006000||p
CopSTASH_set|5.006000||p
CopSTASH|5.006000||p
CopyD|5.009002||p
Copy|||
CvPADLIST|||
CvSTASH|||
CvWEAKOUTSIDE|||
DEFSV_set|5.011000||p
DEFSV|5.004050||p
END_EXTERN_C|5.005000||p
ENTER|||
ERRSV|5.004050||p
EXTEND|||
EXTERN_C|5.005000||p
F0convert|||n
FREETMPS|||
GIMME_V||5.004000|n
GIMME|||n

ppport.h  view on Meta::CPAN

G_VOID||5.004000|
GetVars|||
GvSV|||
Gv_AMupdate|||
HEf_SVKEY||5.004000|
HeHASH||5.004000|
HeKEY||5.004000|
HeKLEN||5.004000|
HePV||5.004000|
HeSVKEY_force||5.004000|
HeSVKEY_set||5.004000|
HeSVKEY||5.004000|
HeUTF8||5.011000|
HeVAL||5.004000|
HvNAME|||
INT2PTR|5.006000||p
IN_LOCALE_COMPILETIME|5.007002||p
IN_LOCALE_RUNTIME|5.007002||p
IN_LOCALE|5.007002||p
IN_PERL_COMPILETIME|5.008001||p
IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p

ppport.h  view on Meta::CPAN

Newx|5.009003||p
Nullav|||
Nullch|||
Nullcv|||
Nullhv|||
Nullsv|||
ORIGMARK|||
PAD_BASE_SV|||
PAD_CLONE_VARS|||
PAD_COMPNAME_FLAGS|||
PAD_COMPNAME_GEN_set|||
PAD_COMPNAME_GEN|||
PAD_COMPNAME_OURSTASH|||
PAD_COMPNAME_PV|||
PAD_COMPNAME_TYPE|||
PAD_DUP|||
PAD_RESTORE_LOCAL|||
PAD_SAVE_LOCAL|||
PAD_SAVE_SETNULLPAD|||
PAD_SETSV|||
PAD_SET_CUR_NOSAVE|||

ppport.h  view on Meta::CPAN

PerlIO_error||5.007003|
PerlIO_fileno||5.007003|
PerlIO_fill||5.007003|
PerlIO_flush||5.007003|
PerlIO_get_base||5.007003|
PerlIO_get_bufsiz||5.007003|
PerlIO_get_cnt||5.007003|
PerlIO_get_ptr||5.007003|
PerlIO_read||5.007003|
PerlIO_seek||5.007003|
PerlIO_set_cnt||5.007003|
PerlIO_set_ptrcnt||5.007003|
PerlIO_setlinebuf||5.007003|
PerlIO_stderr||5.007003|
PerlIO_stdin||5.007003|
PerlIO_stdout||5.007003|
PerlIO_tell||5.007003|
PerlIO_unread||5.007003|
PerlIO_write||5.007003|
Perl_signbit||5.009005|n
PoisonFree|5.009004||p
PoisonNew|5.009004||p
PoisonWith|5.009004||p

ppport.h  view on Meta::CPAN

SVt_PVAV|||
SVt_PVCV|||
SVt_PVHV|||
SVt_PVMG|||
SVt_PV|||
Safefree|||
Slab_Alloc|||
Slab_Free|||
Slab_to_rw|||
StructCopy|||
SvCUR_set|||
SvCUR|||
SvEND|||
SvGAMAGIC||5.006001|
SvGETMAGIC|5.004050||p
SvGROW|||
SvIOK_UV||5.006000|
SvIOK_notUV||5.006000|
SvIOK_off|||
SvIOK_only_UV||5.006000|
SvIOK_only|||
SvIOK_on|||
SvIOKp|||
SvIOK|||
SvIVX|||
SvIV_nomg|5.009001||p
SvIV_set|||
SvIVx|||
SvIV|||
SvIsCOW_shared_hash||5.008003|
SvIsCOW||5.008003|
SvLEN_set|||
SvLEN|||
SvLOCK||5.007003|
SvMAGIC_set|5.009003||p
SvNIOK_off|||
SvNIOKp|||
SvNIOK|||
SvNOK_off|||
SvNOK_only|||
SvNOK_on|||
SvNOKp|||
SvNOK|||
SvNVX|||
SvNV_set|||
SvNVx|||
SvNV|||
SvOK|||
SvOOK_offset||5.011000|
SvOOK|||
SvPOK_off|||
SvPOK_only_UTF8||5.006000|
SvPOK_only|||
SvPOK_on|||
SvPOKp|||
SvPOK|||
SvPVX_const|5.009003||p
SvPVX_mutable|5.009003||p
SvPVX|||

ppport.h  view on Meta::CPAN

SvPV_force_nomg_nolen|5.009003||p
SvPV_force_nomg|5.007002||p
SvPV_force|||p
SvPV_mutable|5.009003||p
SvPV_nolen_const|5.009003||p
SvPV_nolen|5.006000||p
SvPV_nomg_const_nolen|5.009003||p
SvPV_nomg_const|5.009003||p
SvPV_nomg|5.007002||p
SvPV_renew|5.009003||p
SvPV_set|||
SvPVbyte_force||5.009002|
SvPVbyte_nolen||5.006000|
SvPVbytex_force||5.006000|
SvPVbytex||5.006000|
SvPVbyte|5.006000||p
SvPVutf8_force||5.006000|
SvPVutf8_nolen||5.006000|
SvPVutf8x_force||5.006000|
SvPVutf8x||5.006000|
SvPVutf8||5.006000|

ppport.h  view on Meta::CPAN

SvREFCNT_inc_simple_void_NN|5.009004||p
SvREFCNT_inc_simple_void|5.009004||p
SvREFCNT_inc_simple|5.009004||p
SvREFCNT_inc_void_NN|5.009004||p
SvREFCNT_inc_void|5.009004||p
SvREFCNT_inc|||p
SvREFCNT|||
SvROK_off|||
SvROK_on|||
SvROK|||
SvRV_set|5.009003||p
SvRV|||
SvRXOK||5.009005|
SvRX||5.009005|
SvSETMAGIC|||
SvSHARED_HASH|5.009003||p
SvSHARE||5.007003|
SvSTASH_set|5.009003||p
SvSTASH|||
SvSetMagicSV_nosteal||5.004000|
SvSetMagicSV||5.004000|
SvSetSV_nosteal||5.004000|
SvSetSV|||
SvTAINTED_off||5.004000|
SvTAINTED_on||5.004000|
SvTAINTED||5.004000|
SvTAINT|||
SvTRUE|||
SvTYPE|||
SvUNLOCK||5.007003|
SvUOK|5.007001|5.006000|p
SvUPGRADE|||
SvUTF8_off||5.006000|
SvUTF8_on||5.006000|
SvUTF8||5.006000|
SvUVXx|5.004000||p
SvUVX|5.004000||p
SvUV_nomg|5.009001||p
SvUV_set|5.009003||p
SvUVx|5.004000||p
SvUV|5.004000||p
SvVOK||5.008001|
SvVSTRING_mg|5.009004||p
THIS|||n
UNDERBAR|5.009002||p
UTF8_MAXBYTES|5.009002||p
UVSIZE|5.006000||p
UVTYPE|5.006000||p
UVXf|5.007001||p

ppport.h  view on Meta::CPAN

do_sysseek|||
do_tell|||
do_trans_complex_utf8|||
do_trans_complex|||
do_trans_count_utf8|||
do_trans_count|||
do_trans_simple_utf8|||
do_trans_simple|||
do_trans|||
do_vecget|||
do_vecset|||
do_vop|||
docatch|||
doeval|||
dofile|||
dofindlabel|||
doform|||
doing_taint||5.008001|n
dooneliner|||
doopen_pm|||
doparseform|||

ppport.h  view on Meta::CPAN

filter_del|||
filter_gets|||
filter_read|||
find_and_forget_pmops|||
find_array_subscript|||
find_beginning|||
find_byclass|||
find_hash_subscript|||
find_in_my_stash|||
find_runcv||5.008001|
find_rundefsvoffset||5.009002|
find_script|||
find_uninit_var|||
first_symbol|||n
fold_constants|||
forbid_setid|||
force_ident|||
force_list|||
force_next|||
force_version|||
force_word|||
forget_pmop|||
form_nocontext|||vn
form||5.004000|v
fp_dup|||
fprintf_nocontext|||vn

ppport.h  view on Meta::CPAN

gv_fetchpvn_flags||5.009002|
gv_fetchpv|||
gv_fetchsv||5.009002|
gv_fullname3||5.004000|
gv_fullname4||5.006001|
gv_fullname|||
gv_get_super_pkg|||
gv_handler||5.007001|
gv_init_sv|||
gv_init|||
gv_name_set||5.009004|
gv_stashpvn|5.004000||p
gv_stashpvs||5.009003|
gv_stashpv|||
gv_stashsv|||
he_dup|||
hek_dup|||
hfreeentries|||
hsplit|||
hv_assert||5.011000|
hv_auxinit|||n

ppport.h  view on Meta::CPAN

hv_clear_placeholders||5.009001|
hv_clear|||
hv_common_key_len||5.010000|
hv_common||5.010000|
hv_copy_hints_hv|||
hv_delayfree_ent||5.004000|
hv_delete_common|||
hv_delete_ent||5.004000|
hv_delete|||
hv_eiter_p||5.009003|
hv_eiter_set||5.009003|
hv_exists_ent||5.004000|
hv_exists|||
hv_fetch_ent||5.004000|
hv_fetchs|5.009003||p
hv_fetch|||
hv_free_ent||5.004000|
hv_iterinit|||
hv_iterkeysv||5.004000|
hv_iterkey|||
hv_iternext_flags||5.008000|
hv_iternextsv|||
hv_iternext|||
hv_iterval|||
hv_kill_backrefs|||
hv_ksplit||5.004000|
hv_magic_check|||n
hv_magic|||
hv_name_set||5.009003|
hv_notallowed|||
hv_placeholders_get||5.009003|
hv_placeholders_p||5.009003|
hv_placeholders_set||5.009003|
hv_riter_p||5.009003|
hv_riter_set||5.009003|
hv_scalar||5.009001|
hv_store_ent||5.004000|
hv_store_flags||5.008000|
hv_stores|5.009004||p
hv_store|||
hv_undef|||
ibcmp_locale||5.004000|
ibcmp_utf8||5.007003|
ibcmp|||
incline|||

ppport.h  view on Meta::CPAN

magic_getuvar|||
magic_getvec|||
magic_get|||
magic_killbackrefs|||
magic_len|||
magic_methcall|||
magic_methpack|||
magic_nextpack|||
magic_regdata_cnt|||
magic_regdatum_get|||
magic_regdatum_set|||
magic_scalarpack|||
magic_set_all_env|||
magic_setamagic|||
magic_setarylen|||
magic_setcollxfrm|||
magic_setdbline|||
magic_setdefelem|||
magic_setenv|||
magic_sethint|||
magic_setisa|||
magic_setmglob|||
magic_setnkeys|||
magic_setpack|||
magic_setpos|||
magic_setregexp|||
magic_setsig|||
magic_setsubstr|||
magic_settaint|||
magic_setutf8|||
magic_setuvar|||
magic_setvec|||
magic_set|||
magic_sizepack|||
magic_wipepack|||
make_matcher|||
make_trie_failtable|||
make_trie|||
malloc_good_size|||n
malloced_size|||n
malloc||5.007002|n
markstack_grow|||
matcher_matches_sv|||

ppport.h  view on Meta::CPAN

mfree||5.007002|n
mg_clear|||
mg_copy|||
mg_dup|||
mg_find|||
mg_free|||
mg_get|||
mg_length||5.005000|
mg_localize|||
mg_magical|||
mg_set|||
mg_size||5.005000|
mini_mktime||5.007002|
missingterm|||
mode_from_discipline|||
modkids|||
mod|||
more_bodies|||
more_sv|||
moreswitches|||
mro_get_from_name||5.011000|
mro_get_linear_isa_dfs|||
mro_get_linear_isa||5.009005|
mro_get_private_data||5.011000|
mro_isa_changed_in|||
mro_meta_dup|||
mro_meta_init|||
mro_method_changed_in||5.009005|
mro_register||5.011000|
mro_set_mro||5.011000|
mro_set_private_data||5.011000|
mul128|||
mulexp10|||n
my_atof2||5.007002|
my_atof||5.006000|
my_attrs|||
my_bcopy|||n
my_betoh16|||n
my_betoh32|||n
my_betoh64|||n
my_betohi|||n

ppport.h  view on Meta::CPAN

my_htonl|||
my_kid|||
my_letoh16|||n
my_letoh32|||n
my_letoh64|||n
my_letohi|||n
my_letohl|||n
my_letohs|||n
my_lstat|||
my_memcmp||5.004000|n
my_memset|||n
my_ntohl|||
my_pclose||5.004000|
my_popen_list||5.007001|
my_popen||5.004000|
my_setenv|||
my_snprintf|5.009004||pvn
my_socketpair||5.007003|n
my_sprintf|5.009003||pvn
my_stat|||
my_strftime||5.007002|
my_strlcat|5.009004||pn
my_strlcpy|5.009004||pn
my_swabn|||n
my_swap|||
my_unexec|||

ppport.h  view on Meta::CPAN

pad_check_dup|||
pad_compname_type|||
pad_findlex|||
pad_findmy|||
pad_fixup_inner_anons|||
pad_free|||
pad_leavemy|||
pad_new|||
pad_peg|||n
pad_push|||
pad_reset|||
pad_setsv|||
pad_sv||5.011000|
pad_swipe|||
pad_tidy|||
pad_undef|||
parse_body|||
parse_unicode_opts|||
parser_dup|||
parser_free|||
path_is_absolute|||n
peep|||

ppport.h  view on Meta::CPAN

save_op|||
save_padsv_and_mortalize||5.011000|
save_pptr|||
save_pushi32ptr|||
save_pushptri32ptr|||
save_pushptrptr|||
save_pushptr||5.011000|
save_re_context||5.006000|
save_scalar_at|||
save_scalar|||
save_set_svflags||5.009000|
save_shared_pvref||5.007003|
save_sptr|||
save_svref|||
save_vptr||5.006000|
savepvn|||
savepvs||5.009003|
savepv|||
savesharedpvn||5.009005|
savesharedpv||5.007003|
savestack_grow_cnt||5.008001|

ppport.h  view on Meta::CPAN

scan_version||5.009001|
scan_vstring||5.009005|
scan_word|||
scope|||
screaminstr||5.005000|
search_const|||
seed||5.008001|
sequence_num|||
sequence_tail|||
sequence|||
set_context||5.006000|n
set_numeric_local||5.006000|
set_numeric_radix||5.006000|
set_numeric_standard||5.006000|
setdefout|||
share_hek_flags|||
share_hek||5.004000|
si_dup|||
sighandler|||n
simplify_sort|||
skipspace0|||
skipspace1|||
skipspace2|||
skipspace|||
softref2xv|||

ppport.h  view on Meta::CPAN

sv_pvn||5.005000|
sv_pvutf8n_force||5.006000|
sv_pvutf8n||5.006000|
sv_pvutf8||5.006000|
sv_pv||5.006000|
sv_recode_to_utf8||5.007003|
sv_reftype|||
sv_release_COW|||
sv_replace|||
sv_report_used|||
sv_reset|||
sv_rvweaken||5.006000|
sv_setiv_mg|5.004050||p
sv_setiv|||
sv_setnv_mg|5.006000||p
sv_setnv|||
sv_setpv_mg|5.004050||p
sv_setpvf_mg_nocontext|||pvn
sv_setpvf_mg|5.006000|5.004000|pv
sv_setpvf_nocontext|||vn
sv_setpvf||5.004000|v
sv_setpviv_mg||5.008001|
sv_setpviv||5.008001|
sv_setpvn_mg|5.004050||p
sv_setpvn|||
sv_setpvs|5.009004||p
sv_setpv|||
sv_setref_iv|||
sv_setref_nv|||
sv_setref_pvn|||
sv_setref_pv|||
sv_setref_uv||5.007001|
sv_setsv_cow|||
sv_setsv_flags||5.007002|
sv_setsv_mg|5.004050||p
sv_setsv_nomg|5.007002||p
sv_setsv|||
sv_setuv_mg|5.004050||p
sv_setuv|5.004000||p
sv_tainted||5.004000|
sv_taint||5.004000|
sv_true||5.005000|
sv_unglob|||
sv_uni_display||5.007003|
sv_unmagic|||
sv_unref_flags||5.007001|
sv_unref|||
sv_untaint||5.004000|
sv_upgrade|||

ppport.h  view on Meta::CPAN

sv_utf8_downgrade||5.006000|
sv_utf8_encode||5.006000|
sv_utf8_upgrade_flags_grow||5.011000|
sv_utf8_upgrade_flags||5.007002|
sv_utf8_upgrade_nomg||5.007002|
sv_utf8_upgrade||5.007001|
sv_uv|5.005000||p
sv_vcatpvf_mg|5.006000|5.004000|p
sv_vcatpvfn||5.004000|
sv_vcatpvf|5.006000|5.004000|p
sv_vsetpvf_mg|5.006000|5.004000|p
sv_vsetpvfn||5.004000|
sv_vsetpvf|5.006000|5.004000|p
sv_xmlpeek|||
svtype|||
swallow_bom|||
swap_match_buff|||
swash_fetch||5.007002|
swash_get|||
swash_init||5.006000|
sys_init3||5.010000|n
sys_init||5.010000|n
sys_intern_clear|||

ppport.h  view on Meta::CPAN

#    define IVSIZE 4 /* A bold guess, but the best we can make. */
#  endif
#endif
#ifndef UVTYPE
#  define UVTYPE                         unsigned IVTYPE
#endif

#ifndef UVSIZE
#  define UVSIZE                         IVSIZE
#endif
#ifndef sv_setuv
#  define sv_setuv(sv, uv)               \
               STMT_START {                         \
                 UV TeMpUv = uv;                    \
                 if (TeMpUv <= IV_MAX)              \
                   sv_setiv(sv, TeMpUv);            \
                 else                               \
                   sv_setnv(sv, (double)TeMpUv);    \
               } STMT_END
#endif
#ifndef newSVuv
#  define newSVuv(uv)                    ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
#endif
#ifndef sv_2uv
#  define sv_2uv(sv)                     ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
#endif

#ifndef SvUVX

ppport.h  view on Meta::CPAN

#  define SvUOK(sv) SvIOK_UV(sv)
#endif
#ifndef XST_mUV
#  define XST_mUV(i,v)                   (ST(i) = sv_2mortal(newSVuv(v))  )
#endif

#ifndef XSRETURN_UV
#  define XSRETURN_UV(v)                 STMT_START { XST_mUV(0,v);  XSRETURN(1); } STMT_END
#endif
#ifndef PUSHu
#  define PUSHu(u)                       STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG;  } STMT_END
#endif

#ifndef XPUSHu
#  define XPUSHu(u)                      STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
#endif

#ifdef HAS_MEMCMP
#ifndef memNE
#  define memNE(s1,s2,l)                 (memcmp(s1,s2,l))
#endif

#ifndef memEQ
#  define memEQ(s1,s2,l)                 (!memcmp(s1,s2,l))
#endif

ppport.h  view on Meta::CPAN

#  define ZeroD(d,n,t)                   memzero((char*)(d), (n) * sizeof(t))
#endif

#else
#ifndef ZeroD
#  define ZeroD(d,n,t)                   ((void)memzero((char*)(d), (n) * sizeof(t)), d)
#endif

#endif
#ifndef PoisonWith
#  define PoisonWith(d,n,t,b)            (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
#endif

#ifndef PoisonNew
#  define PoisonNew(d,n,t)               PoisonWith(d,n,t,0xAB)
#endif

#ifndef PoisonFree
#  define PoisonFree(d,n,t)              PoisonWith(d,n,t,0xEF)
#endif

ppport.h  view on Meta::CPAN


/* DEFSV appears first in 5.004_56 */
#ifndef DEFSV
#  define DEFSV                          GvSV(PL_defgv)
#endif

#ifndef SAVE_DEFSV
#  define SAVE_DEFSV                     SAVESPTR(GvSV(PL_defgv))
#endif

#ifndef DEFSV_set
#  define DEFSV_set(sv)                  (DEFSV = (sv))
#endif

/* Older perls (<=5.003) lack AvFILLp */
#ifndef AvFILLp
#  define AvFILLp                        AvFILL
#endif
#ifndef ERRSV
#  define ERRSV                          get_sv("@",FALSE)
#endif

ppport.h  view on Meta::CPAN

#endif
#ifndef mPUSHs
#  define mPUSHs(s)                      PUSHs(sv_2mortal(s))
#endif

#ifndef PUSHmortal
#  define PUSHmortal                     PUSHs(sv_newmortal())
#endif

#ifndef mPUSHp
#  define mPUSHp(p,l)                    sv_setpvn(PUSHmortal, (p), (l))
#endif

#ifndef mPUSHn
#  define mPUSHn(n)                      sv_setnv(PUSHmortal, (NV)(n))
#endif

#ifndef mPUSHi
#  define mPUSHi(i)                      sv_setiv(PUSHmortal, (IV)(i))
#endif

#ifndef mPUSHu
#  define mPUSHu(u)                      sv_setuv(PUSHmortal, (UV)(u))
#endif
#ifndef mXPUSHs
#  define mXPUSHs(s)                     XPUSHs(sv_2mortal(s))
#endif

#ifndef XPUSHmortal
#  define XPUSHmortal                    XPUSHs(sv_newmortal())
#endif

#ifndef mXPUSHp
#  define mXPUSHp(p,l)                   STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
#endif

#ifndef mXPUSHn
#  define mXPUSHn(n)                     STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
#endif

#ifndef mXPUSHi
#  define mXPUSHi(i)                     STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
#endif

#ifndef mXPUSHu
#  define mXPUSHu(u)                     STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
#endif

/* Replace: 1 */
#ifndef call_sv
#  define call_sv                        perl_call_sv
#endif

#ifndef call_pv
#  define call_pv                        perl_call_pv
#endif

ppport.h  view on Meta::CPAN

	my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))

/* Creates and zeroes the per-interpreter data.
 * (We allocate my_cxtp in a Perl SV so that it will be released when
 * the interpreter goes away.) */
#define MY_CXT_INIT \
	dMY_CXT_SV;							\
	/* newSV() allocates one more than needed */			\
	my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
	Zero(my_cxtp, 1, my_cxt_t);					\
	sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))

/* This macro must be used to access members of the my_cxt_t structure.
 * e.g. MYCXT.some_data */
#define MY_CXT		(*my_cxtp)

/* Judicious use of these macros can reduce the number of times dMY_CXT
 * is used.  Use is similar to pTHX, aTHX etc. */
#define pMY_CXT		my_cxt_t *my_cxtp
#define pMY_CXT_	pMY_CXT,
#define _pMY_CXT	,pMY_CXT

ppport.h  view on Meta::CPAN

#define _aMY_CXT	,aMY_CXT

#endif /* START_MY_CXT */

#ifndef MY_CXT_CLONE
/* Clones the per-interpreter data. */
#define MY_CXT_CLONE \
	dMY_CXT_SV;							\
	my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
	Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
	sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
#endif

#else /* single interpreter */

#ifndef START_MY_CXT

#define START_MY_CXT	static my_cxt_t my_cxt;
#define dMY_CXT_SV	dNOOP
#define dMY_CXT		dNOOP
#define MY_CXT_INIT	NOOP

ppport.h  view on Meta::CPAN

#endif

#ifndef SvPV_nomg_const
#  define SvPV_nomg_const(sv, lp)        SvPV_flags_const(sv, lp, 0)
#endif

#ifndef SvPV_nomg_const_nolen
#  define SvPV_nomg_const_nolen(sv)      SvPV_flags_const_nolen(sv, 0)
#endif
#ifndef SvPV_renew
#  define SvPV_renew(sv,n)               STMT_START { SvLEN_set(sv, n); \
                 SvPV_set((sv), (char *) saferealloc(          \
                       (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
               } STMT_END
#endif
#ifndef SvMAGIC_set
#  define SvMAGIC_set(sv, val)           \
                STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
                (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
#endif

#if (PERL_BCDVERSION < 0x5009003)
#ifndef SvPVX_const
#  define SvPVX_const(sv)                ((const char*) (0 + SvPVX(sv)))
#endif

#ifndef SvPVX_mutable
#  define SvPVX_mutable(sv)              (0 + SvPVX(sv))
#endif
#ifndef SvRV_set
#  define SvRV_set(sv, val)              \
                STMT_START { assert(SvTYPE(sv) >=  SVt_RV); \
                (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
#endif

#else
#ifndef SvPVX_const
#  define SvPVX_const(sv)                ((const char*)((sv)->sv_u.svu_pv))
#endif

#ifndef SvPVX_mutable
#  define SvPVX_mutable(sv)              ((sv)->sv_u.svu_pv)
#endif
#ifndef SvRV_set
#  define SvRV_set(sv, val)              \
                STMT_START { assert(SvTYPE(sv) >=  SVt_RV); \
                ((sv)->sv_u.svu_rv = (val)); } STMT_END
#endif

#endif
#ifndef SvSTASH_set
#  define SvSTASH_set(sv, val)           \
                STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
                (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
#endif

#if (PERL_BCDVERSION < 0x5004000)
#ifndef SvUV_set
#  define SvUV_set(sv, val)              \
                STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
                (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
#endif

#else
#ifndef SvUV_set
#  define SvUV_set(sv, val)              \
                STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
                (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
#endif

#endif

#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
#if defined(NEED_vnewSVpvf)
static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
static

ppport.h  view on Meta::CPAN

#endif
#define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
#define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)

#if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)

SV *
DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
{
  register SV *sv = newSV(0);
  sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
  return sv;
}

#endif
#endif

#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
#  define sv_vcatpvf(sv, pat, args)  sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
#endif

#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
#  define sv_vsetpvf(sv, pat, args)  sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
#endif

#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
#if defined(NEED_sv_catpvf_mg)
static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
static
#else
extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
#endif

ppport.h  view on Meta::CPAN

#endif

#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
#  define sv_vcatpvf_mg(sv, pat, args)                                     \
   STMT_START {                                                            \
     sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
     SvSETMAGIC(sv);                                                       \
   } STMT_END
#endif

#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
#if defined(NEED_sv_setpvf_mg)
static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
static
#else
extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
#endif

#define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)

#if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)

void
DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
{
  va_list args;
  va_start(args, pat);
  sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  SvSETMAGIC(sv);
  va_end(args);
}

#endif
#endif

#ifdef PERL_IMPLICIT_CONTEXT
#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
#if defined(NEED_sv_setpvf_mg_nocontext)
static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
static
#else
extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
#endif

#define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
#define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)

#if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)

void
DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
{
  dTHX;
  va_list args;
  va_start(args, pat);
  sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  SvSETMAGIC(sv);
  va_end(args);
}

#endif
#endif
#endif

/* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
#ifndef sv_setpvf_mg
#  ifdef PERL_IMPLICIT_CONTEXT
#    define sv_setpvf_mg   Perl_sv_setpvf_mg_nocontext
#  else
#    define sv_setpvf_mg   Perl_sv_setpvf_mg
#  endif
#endif

#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
#  define sv_vsetpvf_mg(sv, pat, args)                                     \
   STMT_START {                                                            \
     sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
     SvSETMAGIC(sv);                                                       \
   } STMT_END
#endif

#ifndef newSVpvn_share

#if defined(NEED_newSVpvn_share)
static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
static
#else

ppport.h  view on Meta::CPAN

#endif

#ifndef newSVpvs_flags
#  define newSVpvs_flags(str, flags)     newSVpvn_flags(str "", sizeof(str) - 1, flags)
#endif

#ifndef sv_catpvs
#  define sv_catpvs(sv, str)             sv_catpvn(sv, str "", sizeof(str) - 1)
#endif

#ifndef sv_setpvs
#  define sv_setpvs(sv, str)             sv_setpvn(sv, str "", sizeof(str) - 1)
#endif

#ifndef hv_fetchs
#  define hv_fetchs(hv, key, lval)       hv_fetch(hv, key "", sizeof(key) - 1, lval)
#endif

#ifndef hv_stores
#  define hv_stores(hv, key, val)        hv_store(hv, key "", sizeof(key) - 1, val, 0)
#endif
#ifndef SvGETMAGIC

ppport.h  view on Meta::CPAN


/* That's the best we can do... */
#ifndef sv_catpvn_nomg
#  define sv_catpvn_nomg                 sv_catpvn
#endif

#ifndef sv_catsv_nomg
#  define sv_catsv_nomg                  sv_catsv
#endif

#ifndef sv_setsv_nomg
#  define sv_setsv_nomg                  sv_setsv
#endif

#ifndef sv_pvn_nomg
#  define sv_pvn_nomg                    sv_pvn
#endif

#ifndef SvIV_nomg
#  define SvIV_nomg                      SvIV
#endif

ppport.h  view on Meta::CPAN


#ifndef sv_catsv_mg
#  define sv_catsv_mg(dsv, ssv)         \
   STMT_START {                         \
     SV *TeMpSv = dsv;                  \
     sv_catsv(TeMpSv,ssv);              \
     SvSETMAGIC(TeMpSv);                \
   } STMT_END
#endif

#ifndef sv_setiv_mg
#  define sv_setiv_mg(sv, i)            \
   STMT_START {                         \
     SV *TeMpSv = sv;                   \
     sv_setiv(TeMpSv,i);                \
     SvSETMAGIC(TeMpSv);                \
   } STMT_END
#endif

#ifndef sv_setnv_mg
#  define sv_setnv_mg(sv, num)          \
   STMT_START {                         \
     SV *TeMpSv = sv;                   \
     sv_setnv(TeMpSv,num);              \
     SvSETMAGIC(TeMpSv);                \
   } STMT_END
#endif

#ifndef sv_setpv_mg
#  define sv_setpv_mg(sv, ptr)          \
   STMT_START {                         \
     SV *TeMpSv = sv;                   \
     sv_setpv(TeMpSv,ptr);              \
     SvSETMAGIC(TeMpSv);                \
   } STMT_END
#endif

#ifndef sv_setpvn_mg
#  define sv_setpvn_mg(sv, ptr, len)    \
   STMT_START {                         \
     SV *TeMpSv = sv;                   \
     sv_setpvn(TeMpSv,ptr,len);         \
     SvSETMAGIC(TeMpSv);                \
   } STMT_END
#endif

#ifndef sv_setsv_mg
#  define sv_setsv_mg(dsv, ssv)         \
   STMT_START {                         \
     SV *TeMpSv = dsv;                  \
     sv_setsv(TeMpSv,ssv);              \
     SvSETMAGIC(TeMpSv);                \
   } STMT_END
#endif

#ifndef sv_setuv_mg
#  define sv_setuv_mg(sv, i)            \
   STMT_START {                         \
     SV *TeMpSv = sv;                   \
     sv_setuv(TeMpSv,i);                \
     SvSETMAGIC(TeMpSv);                \
   } STMT_END
#endif

#ifndef sv_usepvn_mg
#  define sv_usepvn_mg(sv, ptr, len)    \
   STMT_START {                         \
     SV *TeMpSv = sv;                   \
     sv_usepvn(TeMpSv,ptr,len);         \
     SvSETMAGIC(TeMpSv);                \

ppport.h  view on Meta::CPAN


#ifdef USE_ITHREADS
#ifndef CopFILE
#  define CopFILE(c)                     ((c)->cop_file)
#endif

#ifndef CopFILEGV
#  define CopFILEGV(c)                   (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
#endif

#ifndef CopFILE_set
#  define CopFILE_set(c,pv)              ((c)->cop_file = savepv(pv))
#endif

#ifndef CopFILESV
#  define CopFILESV(c)                   (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
#endif

#ifndef CopFILEAV
#  define CopFILEAV(c)                   (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
#endif

#ifndef CopSTASHPV
#  define CopSTASHPV(c)                  ((c)->cop_stashpv)
#endif

#ifndef CopSTASHPV_set
#  define CopSTASHPV_set(c,pv)           ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
#endif

#ifndef CopSTASH
#  define CopSTASH(c)                    (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
#endif

#ifndef CopSTASH_set
#  define CopSTASH_set(c,hv)             CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
#endif

#ifndef CopSTASH_eq
#  define CopSTASH_eq(c,hv)              ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
					|| (CopSTASHPV(c) && HvNAME(hv) \
					&& strEQ(CopSTASHPV(c), HvNAME(hv)))))
#endif

#else
#ifndef CopFILEGV
#  define CopFILEGV(c)                   ((c)->cop_filegv)
#endif

#ifndef CopFILEGV_set
#  define CopFILEGV_set(c,gv)            ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
#endif

#ifndef CopFILE_set
#  define CopFILE_set(c,pv)              CopFILEGV_set((c), gv_fetchfile(pv))
#endif

#ifndef CopFILESV
#  define CopFILESV(c)                   (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
#endif

#ifndef CopFILEAV
#  define CopFILEAV(c)                   (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
#endif

#ifndef CopFILE
#  define CopFILE(c)                     (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
#endif

#ifndef CopSTASH
#  define CopSTASH(c)                    ((c)->cop_stash)
#endif

#ifndef CopSTASH_set
#  define CopSTASH_set(c,hv)             ((c)->cop_stash = (hv))
#endif

#ifndef CopSTASHPV
#  define CopSTASHPV(c)                  (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
#endif

#ifndef CopSTASHPV_set
#  define CopSTASHPV_set(c,pv)           CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
#endif

#ifndef CopSTASH_eq
#  define CopSTASH_eq(c,hv)              (CopSTASH(c) == (hv))
#endif

#endif /* USE_ITHREADS */
#ifndef IN_PERL_COMPILETIME
#  define IN_PERL_COMPILETIME            (PL_curcop == &PL_compiling)
#endif

ppport.h  view on Meta::CPAN

                                        value = value * 10 + digit;
                                        if (++s < send)
                                          digit = *s - '0';
                                        else
                                          break;
                                      }
                                      if (digit >= 0 && digit <= 9
                                          && (s < send)) {
                                        /* value overflowed.
                                           skip the remaining digits, don't
                                           worry about setting *valuep.  */
                                        do {
                                          s++;
                                        } while (s < send && isDIGIT(*s));
                                        numtype |=
                                          IS_NUMBER_GREATER_THAN_UV_MAX;
                                        goto skip_value;
                                      }
                                    }
                                  }
				}

ppport.h  view on Meta::CPAN


#ifdef NO_XSLOCKS
#  ifdef dJMPENV
#    define dXCPT             dJMPENV; int rEtV = 0
#    define XCPT_TRY_START    JMPENV_PUSH(rEtV); if (rEtV == 0)
#    define XCPT_TRY_END      JMPENV_POP;
#    define XCPT_CATCH        if (rEtV != 0)
#    define XCPT_RETHROW      JMPENV_JUMP(rEtV)
#  else
#    define dXCPT             Sigjmp_buf oldTOP; int rEtV = 0
#    define XCPT_TRY_START    Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
#    define XCPT_TRY_END      Copy(oldTOP, top_env, 1, Sigjmp_buf);
#    define XCPT_CATCH        if (rEtV != 0)
#    define XCPT_RETHROW      Siglongjmp(top_env, rEtV)
#  endif
#endif

#if !defined(my_strlcat)
#if defined(NEED_my_strlcat)
static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
static

ppport.h  view on Meta::CPAN

    STRLEN chsize = 0;
    STRLEN readsize = 1;
#if defined(is_utf8_string) && defined(utf8_to_uvchr)
    bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
#endif
    const char *pv  = str;
    const char * const end = pv + count;
    octbuf[0] = esc;

    if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
	sv_setpvs(dsv, "");

#if defined(is_utf8_string) && defined(utf8_to_uvchr)
    if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
        isuni = 1;
#endif

    for (; pv < end && (!max || wrote < max) ; pv += readsize) {
        const UV u =
#if defined(is_utf8_string) && defined(utf8_to_uvchr)
		     isuni ? utf8_to_uvchr((U8*)pv, &readsize) :

ppport.h  view on Meta::CPAN


char *
DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
  const STRLEN max, char const * const start_color, char const * const end_color,
  const U32 flags)
{
    const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
    STRLEN escaped;

    if (!(flags & PERL_PV_PRETTY_NOCLEAR))
	sv_setpvs(dsv, "");

    if (dq == '"')
        sv_catpvs(dsv, "\"");
    else if (flags & PERL_PV_PRETTY_LTGT)
        sv_catpvs(dsv, "<");

    if (start_color != NULL)
        sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));

    pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);

t/00-ALPM.t  view on Meta::CPAN

#!/usr/bin/perl
##
# Initialize ALPM then set and check a few options.
# Checks add/remove on what we can.
# Then create the test repositories.

use Test::More;

BEGIN { use_ok('ALPM') };

## I could not hack this into the Makefile so we initialize
## test repositories here so the modules required are
## only needed when running the tests.

t/00-ALPM.t  view on Meta::CPAN

	my $name = shift;
	my $m = *{"ALPM::$name"}{CODE} or die "missing $name method";
	my @ret = eval { $m->($alpm, @_) };
	if($@){ die "method call to $name failed: $@" }
	return (wantarray ? @ret : $ret[0]);
}

for $k (sort keys %opts){
	$v = $opts{$k};
	@v = (ref $v ? @$v : $v);
	ok meth("set_$k", @v), "set_$k successful";

	@x = meth("get_$k");
	is $#x, $#v, "get_$k returns same size list as set_$k";
	for $i (0 .. $#v){
		is $x[$i], $v[$i], "get_$k has same value as set_$k args";
	}

	next unless($k =~ s/s$//);
	is meth("remove_$k", $v[0]), 1, "remove_$k reported success";
	@w = meth("get_${k}s");
	ok @w == (@v - 1), "$v[0] removed from ${k}s";
}

# TODO: Test SigLevels more in a later test.
is_deeply $alpm->get_defsiglvl, { 'pkg' => 'never', 'db' => 'never' };

if(grep { /signatures/ } @caps){
	$siglvl = { 'pkg' => 'optional', 'db' => 'required' };
	ok $alpm->set_defsiglvl($siglvl);
	is_deeply $alpm->get_defsiglvl, $siglvl;

	$siglvl = { 'pkg' => 'never', 'db' => 'optional trustall' };
	ok $alpm->set_defsiglvl($siglvl);
	is_deeply $alpm->get_defsiglvl, $siglvl;
}else{
	$siglvl = { 'pkg' => 'never', 'db' => 'required' };
	eval { $alpm->set_defsiglvl($siglvl); };
	if($@ =~ /^ALPM Error: wrong or NULL argument passed/){
		pass q{can set siglevel to "never" without GPGME};
	}else{
		fail 'should not be able to set complicated siglevel without GPGME';
	}
}

ok not eval { $alpm->set_defsiglvl('default') };

done_testing;

t/02-DB.t  view on Meta::CPAN

use Test::More;

use ALPM::Conf 't/test.conf';
ok $alpm;

sub checkpkgs
{
	my $db = shift;
	my $dbname = $db->name;
	my %set = map { ($_ => 1) } @_;
	for my $p ($db->pkgs){
		my $n = $p->name;
		unless(exists $set{$n}){
			fail "unexpected $n package exists in $dbname";
			return;
		}
		delete $set{$n};
	}
	if(keys %set){
		fail "missing packages in $dbname: " . join q{ }, keys %set;
	}else{
		pass "all expected packages exist in $dbname";
	}
}

sub checkdb
{
	my $dbname = shift;
	my $db = $alpm->db($dbname);
	is $db->name, $dbname, 'dbname matches db() arg';

t/02-DB.t  view on Meta::CPAN


## Make sure DBs are synced.
$_->update or die $alpm->strerror for($alpm->syncdbs);

checkdb('simpletest', qw/foo bar/);
checkdb('upgradetest', qw/foo replacebaz/);

## Check that register siglevel defaults to 'default' when not provided.
$db = $alpm->register('empty') or die 'register failed';

## Due to libalpm trickery, if the db's siglevel is set to default, then the siglevel
## that is retrieved is a copy of the handle's default siglevel.
$siglvl = $alpm->get_defsiglvl;
is_deeply $db->siglvl, $siglvl;

done_testing;

t/05-Callbacks.t  view on Meta::CPAN

use Test::More;
use ALPM::Conf 't/test.conf';

ok !defined $alpm->get_logcb;
$cb = sub { print "LOG: @_" };
die 'internal error' unless(ref($cb) eq 'CODE');
$alpm->set_logcb($cb);

$tmp = $alpm->get_logcb($cb);
is ref($tmp), 'CODE';
ok $tmp eq $cb;

$alpm->set_logcb(undef);
ok !defined $alpm->get_logcb;

done_testing;

typemap  view on Meta::CPAN

		$arg = newSViv($var);
	}

I_NEG_IS_ERROR
	$arg = ($var == 0 ? &PL_sv_yes : &PL_sv_no);

T_ALPM_HANDLE
	if($var == NULL){
		croak(\"error: ALPM handle is NULL\");
	}else{
		sv_setref_pv($arg, \"ALPM\", (void *)$var);
	}

T_ALPM_DB
	if($var == NULL){
		$arg = &PL_sv_undef;
	}else{
		$arg = c2p_db($var);
	}

T_ALPM_LOCALDB

typemap  view on Meta::CPAN

	if($var == NULL){
		$arg = &PL_sv_undef;
	}else{
		$arg = c2p_pkg($var);
	}

T_ALPM_PACKAGEFREE
	if($var == NULL){
		$arg = &PL_sv_undef;
	}else{
		sv_setref_pv($arg, \"ALPM::PackageFree\", (void *)$var);
	}

T_ALPM_FILELIST
	$arg = c2p_filelist($var);

T_SIGLEVEL
	$arg = c2p_siglevel($var);

T_ORIGIN
	$arg = c2p_pkgfrom($var);

types.c  view on Meta::CPAN

	pstr = SvPV(sv, len);
	cstr = calloc(len + 1, sizeof(char));
	memcpy(cstr, pstr, len);
	return cstr;
}

SV*
c2p_pkg(void *p)
{
	SV *rv = newSV(0);
	return sv_setref_pv(rv, "ALPM::Package", p);
}

ALPM_Package
p2c_pkg(SV *pkgobj)
{
	return INT2PTR(ALPM_Package, SvIV((SV*)SvRV(pkgobj)));
}

ALPM_DB
p2c_db(SV *db)
{
	return INT2PTR(ALPM_DB, SvIV((SV*)SvRV(db)));
}

SV*
c2p_localdb(void *db)
{
	SV *rv = newSV(0);
	sv_setref_pv(rv, "ALPM::DB::Local", db);
	return rv;
}

SV*
c2p_syncdb(void *db)
{
	SV *rv = newSV(0);
	sv_setref_pv(rv, "ALPM::DB::Sync", db);
	return rv;
}

SV*
c2p_db(void *db)
{
    if(strcmp(alpm_db_get_name(db), "local") == 0) {
        return c2p_localdb(db);
    } else {
        return c2p_syncdb(db);

types.c  view on Meta::CPAN


Here is the form of the package and database bitmask. Remember the
database flags are shifted to the left by 10 places.

BIT	DESCRIPTION
1	Signature checking is enabled for packages or databases respectively.
2	Signature checking is optional, used only when available.
3	MARGINAL_OK?
4	UNKNOWN_OK?

A setting of TrustAll in pacman.conf enables MARGINAL_OK and UNKNOWN_OK.
These two flags are not enabled separately from one another.

ALPM_SIG_USE_DEFAULT is the default value when set_default_siglevel is never
called but I have no idea what that could mean when this is the value of the default.
This seems to be a circular argument with no end.

*/

#define MASK_ENABLE 1
#define MASK_OPT 3
#define MASK_TRUSTALL 12
#define MASK_ALL 15
#define OFFSET_DB 10

xs/DB.xs  view on Meta::CPAN

	LIST2STACK(fnd, c2p_pkg);
	alpm_list_free(L);

#-----------------------------
# PUBLIC LOCAL DATABASE METHODS
#-----------------------------

MODULE = ALPM   PACKAGE = ALPM::DB::Local

negative_is_error
set_install_reason(self, pkg, rsn)
	ALPM_LocalDB self
	ALPM_Package pkg
	alpm_pkgreason_t rsn
 CODE:
	RETVAL = alpm_pkg_set_reason(pkg, rsn);
 OUTPUT:
	RETVAL

#-----------------------------
# PUBLIC SYNC DATABASE METHODS
#-----------------------------

MODULE = ALPM   PACKAGE = ALPM::DB::Sync

int

xs/DB.xs  view on Meta::CPAN


void alpm_db_get_servers(self)
	ALPM_SyncDB self
 PREINIT:
	alpm_list_t *srvs;
 PPCODE:
	srvs = alpm_db_get_servers(self);
	LIST2STACK(srvs, c2p_str);

negative_is_error
alpm_db_set_servers(self, ...)
	ALPM_SyncDB self
 PREINIT:
	alpm_list_t *L;
	int i;
 CODE:
	i = 1;
	STACK2LIST(i, L, p2c_str);
	RETVAL = alpm_db_set_servers(self, L);
 OUTPUT:
	RETVAL

MODULE = ALPM	PACKAGE = ALPM::DB::Sync	PREFIX = alpm_db_get_

int
alpm_db_get_valid(db)
	ALPM_SyncDB db

xs/Options.xs  view on Meta::CPAN

SV*
get_totaldlcb(...)
 CODE:
	RETVAL = (totaldlcb_ref ? newSVsv(totaldlcb_ref) : &PL_sv_undef);
 OUTPUT:
	RETVAL

MODULE = ALPM	PACKAGE = ALPM	PREFIX = alpm_option_

void
alpm_option_set_logcb(self, cb)
	ALPM_Handle self
	SV * cb
 CODE:
	DEFSETCB(log, self, cb)

void
alpm_option_set_dlcb(self, cb)
	ALPM_Handle self
	SV * cb
 CODE:
	DEFSETCB(dl, self, cb)

void
alpm_option_set_fetchcb(self, cb)
	ALPM_Handle self
	SV * cb
 CODE:
	DEFSETCB(fetch, self, cb)

void
alpm_option_set_totaldlcb(self, cb)
	ALPM_Handle self
	SV * cb
 CODE:
	DEFSETCB(totaldl, self, cb)

## REGULAR OPTIONS

StringOption
option_string_get(self)
	ALPM_Handle self
 INTERFACE:
	alpm_option_get_logfile
	alpm_option_get_lockfile
	alpm_option_get_arch
	alpm_option_get_gpgdir
	alpm_option_get_root
	alpm_option_get_dbpath

SetOption
option_string_set(self, string)
	ALPM_Handle self
	const char * string
 INTERFACE:
	alpm_option_set_logfile
	alpm_option_set_arch
	alpm_option_set_gpgdir

# String List Options

void
alpm_option_get_cachedirs(self)
	ALPM_Handle self
 PREINIT:
	alpm_list_t *lst;
 PPCODE:
	lst = alpm_option_get_cachedirs(self);

xs/Options.xs  view on Meta::CPAN

	ALPM_Handle self
	const char *add_string
 INTERFACE:
	alpm_option_add_noupgrade
	alpm_option_add_noextract
	alpm_option_add_ignorepkg
	alpm_option_add_ignoregroup
	alpm_option_add_cachedir

SetOption
alpm_option_set_cachedirs(self, ...)
	ALPM_Handle self
 PREINIT:
	alpm_list_t *lst;
	int i;
 CODE:
	i = 1;
	STACK2LIST(i, lst, p2c_str);
	RETVAL = alpm_option_set_cachedirs(self, lst);
	ZAPLIST(lst, free);
 OUTPUT:
	RETVAL

SetOption
alpm_option_set_noupgrades(self, ...)
	ALPM_Handle self
 PREINIT:
	alpm_list_t *lst;
	int i;
 CODE:
	i = 1;
	STACK2LIST(i, lst, p2c_str);
	RETVAL = alpm_option_set_noupgrades(self, lst);
	ZAPLIST(lst, free);
 OUTPUT:
	RETVAL

SetOption
alpm_option_set_noextracts(self, ...)
	ALPM_Handle self
 PREINIT:
	alpm_list_t *lst;
	int i;
 CODE:
	i = 1;
	STACK2LIST(i, lst, p2c_str);
	RETVAL = alpm_option_set_noextracts(self, lst);
	ZAPLIST(lst, free);
 OUTPUT:
	RETVAL

SetOption
alpm_option_set_ignorepkgs(self, ...)
	ALPM_Handle self
 PREINIT:
	alpm_list_t *lst;
	int i;
 CODE:
	i = 1;
	STACK2LIST(i, lst, p2c_str);
	RETVAL = alpm_option_set_ignorepkgs(self, lst);
	ZAPLIST(lst, free);
 OUTPUT:
	RETVAL

SetOption
alpm_option_set_ignoregroups(self, ...)
	ALPM_Handle self
 PREINIT:
	alpm_list_t *lst;
	int i;
 CODE:
	i = 1;
	STACK2LIST(i, lst, p2c_str);
	RETVAL = alpm_option_set_ignoregroups(self, lst);
	ZAPLIST(lst, free);
 OUTPUT:
	RETVAL

# Use IntOption to return the number of items removed (0 or 1).

IntOption
option_stringlist_remove(self, badstring)
	ALPM_Handle self
	const char * badstring

xs/Options.xs  view on Meta::CPAN

	alpm_option_remove_ignoregroup

IntOption
option_int_get(self)
	ALPM_Handle self
INTERFACE:
	alpm_option_get_usesyslog
	alpm_option_get_checkspace

SetOption
option_int_set(self, new_int)
	ALPM_Handle self
	int new_int
INTERFACE:
	alpm_option_set_usesyslog
	alpm_option_set_checkspace

double
alpm_option_get_deltaratio(self)
	ALPM_Handle self

SetOption
alpm_option_set_deltaratio(self, ratio)
	ALPM_Handle self
	double ratio

SetOption
alpm_option_add_assumeinstalled(self, dep)
	 ALPM_Handle self
	 ALPM_Depend dep

SetOption
alpm_option_remove_assumeinstalled(self, dep)

xs/Options.xs  view on Meta::CPAN

void
alpm_option_get_assumeinstalled(self)
	 ALPM_Handle self
 PREINIT:
	 alpm_list_t *l;
 PPCODE:
	 l = alpm_option_get_assumeinstalled(self);
	 LIST2STACK(l, c2p_depend);

SetOption
alpm_option_set_assumeinstalled(self, ...)
	ALPM_Handle self
 PREINIT:
	alpm_list_t *lst = NULL;
	int i = 1;
 CODE:
	STACK2LIST(i, lst, p2c_depend);
	RETVAL = alpm_option_set_assumeinstalled(self, lst);
 OUTPUT:
	RETVAL

MODULE = ALPM	PACKAGE = ALPM	PREFIX = alpm_option_

# Why have get_localdb when there is no set_localdb? s/get_//;

ALPM_LocalDB
localdb(self)
	ALPM_Handle self
 CODE:
	RETVAL = alpm_get_localdb(self);
 OUTPUT:
	RETVAL

# Ditto.

xs/Options.xs  view on Meta::CPAN


ALPM_SigLevel
get_defsiglvl(self)
	ALPM_Handle self
 CODE:
	RETVAL = alpm_option_get_default_siglevel(self);
 OUTPUT:
	RETVAL

SetOption
set_defsiglvl(self, siglvl)
	ALPM_Handle self
	SV* siglvl
 CODE:
	if(strcmp(SvPV_nolen(siglvl), "default") == 0){
		croak("Default signature level cannot itself be set to default. You hear the sound of one hand clapping");
	}else{
		RETVAL = alpm_option_set_default_siglevel(self, p2c_siglevel(siglvl));
	}
 OUTPUT:
	RETVAL

# EOF

xs/Package.xs  view on Meta::CPAN

	alpm_pkg_get_arch

time_t
package_get_time(package)
	ALPM_Package package
INTERFACE:
	alpm_pkg_get_builddate
	alpm_pkg_get_installdate

off_t
package_get_offset(package)
	ALPM_Package package
INTERFACE:
	alpm_pkg_get_size
	alpm_pkg_get_isize

alpm_pkgreason_t
alpm_pkg_get_reason(pkg)
	ALPM_Package pkg

StringList



( run in 0.990 second using v1.01-cache-2.11-cpan-49f99fa48dc )