line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
31
|
|
|
31
|
|
11898
|
use base qw(Exporter); |
|
31
|
|
|
|
|
35
|
|
|
31
|
|
|
|
|
8003
|
|
24
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
my $libmemcached_funcs = require "Memcached/libmemcached/func_hash.pl"; |
32
|
|
|
|
|
|
|
die "Memcached/libmemcached/func_hash.pl failed sanity check" |
33
|
|
|
|
|
|
|
unless ref $libmemcached_funcs eq 'HASH' |
34
|
|
|
|
|
|
|
and keys %$libmemcached_funcs > 20; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# extra functions provided by Memcached::libmemcached |
37
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
our @libmemcached_funcs = do { |
54
|
|
|
|
|
|
|
my %funcs = ( |
55
|
|
|
|
|
|
|
%$libmemcached_funcs, |
56
|
|
|
|
|
|
|
%libmemcached_extra_functions, |
57
|
|
|
|
|
|
|
%libmemcached_unimplemented_functions |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
grep { $funcs{$_} } sort keys %funcs; |
60
|
|
|
|
|
|
|
}; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# load hash of libmemcached functions created by Makefile.PL |
64
|
|
|
|
|
|
|
my $libmemcached_consts = require "Memcached/libmemcached/const_hash.pl"; |
65
|
|
|
|
|
|
|
die "Memcached/libmemcached/const_hash.pl failed sanity check" |
66
|
|
|
|
|
|
|
unless ref $libmemcached_consts eq 'HASH' |
67
|
|
|
|
|
|
|
and keys %$libmemcached_consts > 20; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
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
|
32
|
|
|
32
|
1
|
621
|
sub libmemcached_functions { @libmemcached_funcs } |
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
|
31
|
|
|
31
|
1
|
825
|
sub libmemcached_constants { @libmemcached_consts } |
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
|
|
|
|
|
|
|
sub libmemcached_tags { |
103
|
31
|
|
|
31
|
1
|
32
|
my %tags; |
104
|
4402
|
|
|
|
|
5070
|
push @{ $tags{ $libmemcached_consts->{$_} } }, $_ |
105
|
31
|
|
|
|
|
331
|
for keys %$libmemcached_consts; |
106
|
|
|
|
|
|
|
#use Data::Dumper; warn Dumper(\%tags); |
107
|
31
|
|
|
|
|
266
|
return %tags; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |