blib/lib/Memcached/libmemcached/API.pm

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 4 / 4 Podpod 100% 3 / 3 totaltotal 76.7% 33 / 43 CC 2 SCAR 3.4
CC
2
Cov
81%
libmemcached_tags
2.0
BEGIN
1.0
libmemcached_functions
1.0
CRAP 1.4
« blib/lib/Memcached/libmemcached.pm ↑ Summary libmemcached.xs »
1 package Memcached::libmemcached::API;
2  
3 =head1 NAME
4  
5 Memcached::libmemcached::API - Private volitile module
6  
7 =head1 SYNOPSIS
8  
9 use Memcached::libmemcached::API;
10  
11 @function_names = libmemcached_functions();
12 @constant_names = libmemcached_constants();
13 @EXPORT_TAGS = libmemcached_tags();
14  
15 =head1 DESCRIPTION
16  
17 This module should be considered private. It may change or be removed in future.
18  
19 =head1 FUNCTIONS
20  
21 =cut
22  
23 32 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
24 32 our @EXPORT = qw(
25 libmemcached_functions
26 libmemcached_constants
27 libmemcached_tags
28 );
29  
30 # load hash of libmemcached functions created by Makefile.PL
31 32 my $libmemcached_funcs = require "Memcached/libmemcached/func_hash.pl";
32 32 ▶die "Memcached/libmemcached/func_hash.pl failed sanity check"
Branch: 1 branch
BranchTrueFalseTotal
unless ref $libmemcached_funcs eq "HASH" and keys %$libmemcached_funcs > 20 0 32 32
Condition33%1/3
ref $libmemcached_funcs eq "HASH" and keys %$libmemcached_funcs > 20
!ll&&!rl&&r
0032
MC/DC0%0/2
ref $libmemcached_funcs eq "HASH" and keys %$libmemcached_funcs > 20
ref $libmemcached_funcs eq "HASH" keys %$libmemcached_funcs > 20
Truth table33%1/3
A and B
A= ref $libmemcached_funcs eq "HASH"B= keys %$libmemcached_funcs > 20
ABresult
0X0
100
111
33 unless ref $libmemcached_funcs eq 'HASH'
34 and keys %$libmemcached_funcs > 20;
35  
36 # extra functions provided by Memcached::libmemcached
37 32 my %libmemcached_extra_functions = (
38 memcached_errstr => 1,
39 memcached_mget_into_hashref => 1,
40 memcached_set_callback_coderefs => 1,
41 );
42  
43 # functions we don't provide an API for
44 32 my %libmemcached_unimplemented_functions = (
45 # memcached_server_st
46 memcached_server_push => 0,
47 memcached_servers_parse => 0,
48 memcached_server_list_append => 0,
49 memcached_server_list_free => 0,
50 );
51  
52 # build complete list of implemented functions
53 32 our @libmemcached_funcs = do {
54 32 my %funcs = (
55 %$libmemcached_funcs,
56 %libmemcached_extra_functions,
57 %libmemcached_unimplemented_functions
58 );
59 32 grep { $funcs{$_} } sort keys %funcs;
60 };
61  
62  
63 # load hash of libmemcached functions created by Makefile.PL
64 32 my $libmemcached_consts = require "Memcached/libmemcached/const_hash.pl";
65 32 ▶die "Memcached/libmemcached/const_hash.pl failed sanity check"
Branch: 1 branch
BranchTrueFalseTotal
unless ref $libmemcached_consts eq "HASH" and keys %$libmemcached_consts > 20 0 32 32
Condition33%1/3
ref $libmemcached_consts eq "HASH" and keys %$libmemcached_consts > 20
!ll&&!rl&&r
0032
MC/DC0%0/2
ref $libmemcached_consts eq "HASH" and keys %$libmemcached_consts > 20
ref $libmemcached_consts eq "HASH" keys %$libmemcached_consts > 20
Truth table33%1/3
A and B
A= ref $libmemcached_consts eq "HASH"B= keys %$libmemcached_consts > 20
ABresult
0X0
100
111
66 unless ref $libmemcached_consts eq 'HASH'
67 and keys %$libmemcached_consts > 20;
68  
69 32 our @libmemcached_consts = sort keys %$libmemcached_consts;
70  
71  
72 =head2 libmemcached_functions
73  
74 @names = libmemcached_functions();
75  
76 Returns a list of all the public functions in the libmemcached library.
77  
78 =cut
79  
80 33 ▶sub libmemcached_functions { @libmemcached_funcs }
Subroutine libmemcached_functions: called CC=1 SCAR=0.0
Pod documented
81  
82  
83 =head2 libmemcached_constants
84  
85 @names = libmemcached_constants();
86  
87 Returns a list of all the constants in the libmemcached library.
88  
89 =cut
90  
91 32 ▶sub libmemcached_constants { @libmemcached_consts }
Subroutine libmemcached_constants: called CC=1 SCAR=0.0
Pod documented
92  
93  
94 =head2 libmemcached_tags
95  
96 @tags = libmemcached_tags();
97  
98 Returns a hash list of pairs of tag name and array references suitable for setting %EXPORT_TAGS.
99  
100 =cut
101  
102 32 ▶sub libmemcached_tags {
Subroutine libmemcached_tags: called CC=2 SCAR=6.9
Pod documented
103 32 my %tags;
104 4544 push @{ $tags{ $libmemcached_consts->{$_} } }, $_
105 32 for keys %$libmemcached_consts;
106 #use Data::Dumper; warn Dumper(\%tags);
107 32 return %tags;
108 }
109  
110 32 1;
« blib/lib/Memcached/libmemcached.pm ↑ Summary libmemcached.xs »