X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FVariable%2FMagic.pm;h=11a26a8511362af310831fe5f72ec10008860e3e;hb=6f35a291f0c453d34b617ee9eb03d2a68c410614;hp=ff6ec4ab8717dc892ea811cbcde288d40ea8b240;hpb=0f6f5717615db7019992273892a3360bfcc5ca7f;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index ff6ec4a..11a26a8 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -13,11 +13,15 @@ Variable::Magic - Associate user-defined magic to variables from Perl. =head1 VERSION -Version 0.06 +Version 0.07_02 =cut -our $VERSION = '0.06'; +use vars qw/$VERSION/; + +BEGIN { + $VERSION = '0.07_02'; +} =head1 SYNOPSIS @@ -96,13 +100,27 @@ The maximum integer used as a signature for user-defined magic. SIG_NBR = SIG_MAX - SIG_MIN + 1 +=head2 C + +True iff the 'copy' magic is available. + +=head2 C + +True iff the 'dup' magic is available. + +=head2 C + +True iff the 'local' magic is available. + =head1 FUNCTIONS =cut use XSLoader; -XSLoader::load __PACKAGE__, $VERSION; +BEGIN { + XSLoader::load __PACKAGE__, $VERSION; +} =head2 C @@ -136,7 +154,8 @@ Code references to corresponding magic callbacks. You don't have to specify all sub wizard { croak 'Wrong number of arguments for wizard()' if @_ % 2; my %opts = @_; - return _wizard(map { $opts{$_} } qw/sig get set len clear free data/); + my $sig = $opts{sig}; + return _wizard($sig, map { $opts{$_} } qw/data get set len clear free copy dup local fetch store exists delete/); } =head2 C @@ -196,7 +215,7 @@ use base qw/Exporter/; our @EXPORT = (); our %EXPORT_TAGS = ( 'funcs' => [ qw/wizard gensig getsig cast getdata dispell/ ], - 'consts' => [ qw/SIG_MIN SIG_MAX SIG_NBR/ ] + 'consts' => [ qw/SIG_MIN SIG_MAX SIG_NBR MGf_COPY MGf_DUP MGf_LOCAL/ ] ); our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{'all'} = \@EXPORT_OK;