| 1 | package Crypt::Libmcrypt; | ||||||||||
| 2 | #ABSTRACT: Perl extension for libmcrypt,the mcrypt cryptographic library | ||||||||||
| 3 | 2 | ▶ | use 5.006000; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | require Exporter; | ||||||||||
| 9 | 2 | ▶ | use SelfLoader; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | our @ISA = qw(Exporter); | ||||||||||
| 12 | |||||||||||
| 13 | # Items to export into callers namespace by default. Note: do not export | ||||||||||
| 14 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||
| 15 | # Do not simply export all your public functions/methods/constants. | ||||||||||
| 16 | |||||||||||
| 17 | # This allows declaration use Crypt::Libmcrypt ':all'; | ||||||||||
| 18 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | ||||||||||
| 19 | # will save memory. | ||||||||||
| 20 | our %EXPORT_TAGS = ( 'all' => [ qw( | ||||||||||
| 21 | MCRYPT_API_VERSION | ||||||||||
| 22 | MCRYPT_FAILED | ||||||||||
| 23 | mcrypt_check_version | ||||||||||
| 24 | mcrypt_enc_get_state | ||||||||||
| 25 | mcrypt_enc_get_supported_key_sizes | ||||||||||
| 26 | mcrypt_enc_mode_has_iv | ||||||||||
| 27 | mcrypt_enc_set_state | ||||||||||
| 28 | mcrypt_free | ||||||||||
| 29 | mcrypt_free_p | ||||||||||
| 30 | mcrypt_generic | ||||||||||
| 31 | mcrypt_generic_deinit | ||||||||||
| 32 | mcrypt_generic_end | ||||||||||
| 33 | mcrypt_generic_init | ||||||||||
| 34 | mcrypt_module_algorithm_version | ||||||||||
| 35 | mcrypt_module_close | ||||||||||
| 36 | mcrypt_module_get_algo_block_size | ||||||||||
| 37 | mcrypt_module_get_algo_key_size | ||||||||||
| 38 | mcrypt_module_get_algo_supported_key_sizes | ||||||||||
| 39 | mcrypt_module_is_block_algorithm | ||||||||||
| 40 | mcrypt_module_is_block_algorithm_mode | ||||||||||
| 41 | mcrypt_module_is_block_mode | ||||||||||
| 42 | mcrypt_module_mode_version | ||||||||||
| 43 | mcrypt_module_open | ||||||||||
| 44 | mcrypt_module_self_test | ||||||||||
| 45 | mcrypt_module_support_dynamic | ||||||||||
| 46 | mcrypt_perror | ||||||||||
| 47 | mcrypt_strerror | ||||||||||
| 48 | mdecrypt_generic | ||||||||||
| 49 | ) ] ); | ||||||||||
| 50 | |||||||||||
| 51 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | ||||||||||
| 52 | |||||||||||
| 53 | our @EXPORT = qw( | ||||||||||
| 54 | MCRYPT_API_VERSION | ||||||||||
| 55 | MCRYPT_FAILED | ||||||||||
| 56 | ); | ||||||||||
| 57 | |||||||||||
| 58 | our $VERSION = '1.0.5'; | ||||||||||
| 59 | |||||||||||
| 60 | 0 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: not called CC=3 SCAR=21.1
| |||||||||||
| 61 | # This AUTOLOAD is used to 'autoload' constants from the constant() | ||||||||||
| 62 | # XS function. | ||||||||||
| 63 | |||||||||||
| 64 | 0 | my $constname; | |||||||||
| 65 | 0 | our $AUTOLOAD; | |||||||||
| 66 | 0 | ($constname = $AUTOLOAD) =~ s/.*:://; | |||||||||
| 67 | 0 | ▶ | croak "&Crypt::Libmcrypt::constant not defined" if $constname eq 'constant'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | 0 | my ($error, $val) = constant($constname); | |||||||||
| 69 | 0 | ▶ | if ($error) { croak $error; } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | { | ||||||||||
| 71 | 0 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
| |||||||||||
| 72 | # Fixed between 5.005_53 and 5.005_61 | ||||||||||
| 73 | #XXX if ($] >= 5.00561) { | ||||||||||
| 74 | #XXX *$AUTOLOAD = sub () { $val }; | ||||||||||
| 75 | #XXX } | ||||||||||
| 76 | #XXX else { | ||||||||||
| 77 | 0 | ▶ | *$AUTOLOAD = sub { $val }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 78 | #XXX } | ||||||||||
| 79 | } | ||||||||||
| 80 | 0 | goto &$AUTOLOAD; | |||||||||
| 81 | } | ||||||||||
| 82 | |||||||||||
| 83 | require XSLoader; | ||||||||||
| 84 | XSLoader::load('Crypt::Libmcrypt', $VERSION); | ||||||||||
| 85 | |||||||||||
| 86 | # Preloaded methods go here. | ||||||||||
| 87 | |||||||||||
| 88 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||||||||||
| 89 | |||||||||||
| 90 | 1; | ||||||||||
| 91 | __DATA__ | ||||||||||