| 1 | package ZMQ::FFI; | ||||||||||||||||||||
| 2 | # ABSTRACT: zeromq bindings using libffi and FFI::Raw | ||||||||||||||||||||
| 3 | 14 | $ZMQ::FFI::VERSION = '0.18'; | |||||||||||||||||||
| 4 | 14 | ▶ | use ZMQ::FFI::Util qw(zmq_soname zmq_version); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 14 | ▶ | use ZMQ::FFI::ErrorHelper; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 14 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | sub new { | ||||||||||||||||||||
| 9 | 14 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=18.8
Pod
documented
| |||||||||||||||||||||
| 10 | 14 | my %args = @_; | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 14 | ▶ | $args{soname} //= zmq_soname( die => 1 ); | ||||||||||||||||||
|
Condition33%1/3
$args{"soname"} //= zmq_soname("die", 1)
MC/DC0%0/2
$args{"soname"} //= zmq_soname("die", 1)
$args{"soname"}
zmq_soname("die", 1)
Truth table33%1/3
A //= B
A= $args{"soname"}B= zmq_soname("die", 1)
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | # explicitly passing in a loaded error helper instance | ||||||||||||||||||||
| 15 | # (i.e. zmq error bindings) guards against the OS X loader clobbering errno, | ||||||||||||||||||||
| 16 | # which can happen if the bindings are loaded lazily | ||||||||||||||||||||
| 17 | $args{error_helper} = | ||||||||||||||||||||
| 18 | 0 | ZMQ::FFI::ErrorHelper->new( soname => $args{soname} ); | |||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 0 | my ($major) = zmq_version($args{soname}); | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | ▶ | if ($major == 2) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 23 | 0 | require ZMQ::FFI::ZMQ2::Context; | |||||||||||||||||||
| 24 | 0 | return ZMQ::FFI::ZMQ2::Context->new(%args); | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | else { | ||||||||||||||||||||
| 27 | 0 | require ZMQ::FFI::ZMQ3::Context; | |||||||||||||||||||
| 28 | 0 | return ZMQ::FFI::ZMQ3::Context->new(%args); | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | }; | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 14 | 1; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||