| 1 | package Alien::libwebsockets; | ||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 2 | ▶ | use parent 'Alien::Base'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 2 | our $VERSION = '0.04'; | |||||||||||||
| 7 | |||||||||||||||
| 8 | sub has_extensions { | ||||||||||||||
| 9 | 1 | ▶ | my ($class) = @_; | ||||||||||||
|
Subroutine
has_extensions: called CC=9 SCAR=23.3
Pod
documented
| |||||||||||||||
| 10 | 1 | my @libs = $class->dynamic_libs; | |||||||||||||
| 11 | 1 | ▶ | return 0 unless @libs; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 12 | |||||||||||||||
| 13 | 1 | ▶ | my @nm_cmd = $^O eq 'darwin' ? ('nm', '-gU') | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 14 | : $^O =~ /^(?:freebsd|openbsd|netbsd|dragonfly)$/ ? ('nm', '-g') | ||||||||||||||
| 15 | : ('nm', '-D'); | ||||||||||||||
| 16 | |||||||||||||||
| 17 | 1 | foreach my $lib (@libs) { | |||||||||||||
| 18 | 1 | my $found = 0; | |||||||||||||
| 19 | 1 | ▶ | if (open my $fh, '-|', @nm_cmd, $lib) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 20 | 1 | ▶ | while (<$fh>) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 21 | 482 | ▶ | if (/lws_extension_callback_pm_deflate/) { $found = 1; last } | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 22 | } | ||||||||||||||
| 23 | 1 | close $fh; | |||||||||||||
| 24 | } | ||||||||||||||
| 25 | 1 | ▶ | return 1 if $found; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 26 | } | ||||||||||||||
| 27 | |||||||||||||||
| 28 | 0 | return 0; | |||||||||||||
| 29 | } | ||||||||||||||
| 30 | |||||||||||||||
| 31 | 2 | 1; | |||||||||||||
| 32 | |||||||||||||||
| 33 | __END__ | ||||||||||||||