view release on metacpan or search on metacpan
$openMind= 1<<25;
{
my $think= "thoughts";
my $mind= \$think;
my( $p2, $rc, $f )=
unpack "LLL", unpack "P12", pack "L", $mind;
my $state= unpack "C", pack "V", $f;
my $nv= eval { length pack "F", 1.0 } || 8;
my $pad= $nv - 4;
if( $state == 4 ) {
$openMind >>= 4;
view all matches for this distribution
view release on metacpan or search on metacpan
src/Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp view on Meta::CPAN
data.resize(dataSize);
in.rawTileData (dx, dy, lx, ly, &data[0], dataSize);
}
Int64 sampleCountTableSize = *(Int64 *)(&data[0] + 16);
Int64 pixelDataSize = *(Int64 *)(&data[0] + 24);
Int64 unpackedPixelDataSize = *(Int64 *)(&data[0] + 32);
char * sampleCountTable = &data[0]+40;
char * pixelData = sampleCountTable + sampleCountTableSize;
writeTileData (_data, dx, dy, lx, ly, pixelData, pixelDataSize,unpackedPixelDataSize,sampleCountTable,sampleCountTableSize);
if(_data->lineOrder==RANDOM_Y)
{
if(i<numAllTiles-1)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Ping.pm view on Meta::CPAN
$type = unpack 'c', $icmp_msg;
if ($type == $ICMP_ECHOREPLY) {
($type, $identifier, $sequence, $data) =
(unpack $ICMP_PING, $icmp_msg)[0, 3, 4, 5];
}
elsif ($type == $ICMP_DEST_UNREACH || $type == $ICMP_TIME_EXCEEDED) {
($identifier, $sequence) = unpack('nn', substr($chunk, 52));
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
t/08_supporting_sw.t view on Meta::CPAN
dist_version => '0.01',
quiet => 1,
);
is( -s 't/data/Foo.tar.gz', -s 'archive/Foo.tar.gz' );
is( -s 'unpack/Foo/Build.PL', 551 );
is( -s 'unpack/Foo/cgi-bin/foo/foo.conf', 20 );
}
view all matches for this distribution
view release on metacpan or search on metacpan
kritika.fatpack view on Meta::CPAN
$fatpacked{"JSON/backportPP/Compat5005.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'JSON_BACKPORTPP_COMPAT5005';
package JSON::backportPP5005;use 5.005;use strict;my@properties;$JSON::PP5005::VERSION='0.05';BEGIN {sub utf8::is_utf8 {0}sub utf8::upgrade {}sub utf8::downgrade {1}sub utf8::encode {}sub utf8::decode {}*JSON::PP::JSON_PP_encode_ascii=\&_encode_asc...
JSON_BACKPORTPP_COMPAT5005
$fatpacked{"JSON/backportPP/Compat5006.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'JSON_BACKPORTPP_COMPAT5006';
package JSON::backportPP56;use 5.006;use strict;my@properties;$JSON::PP56::VERSION='0.05';BEGIN {sub utf8::is_utf8 {my$len=length $_[0];{use bytes;return$len!=length $_[0]}}sub utf8::upgrade {}sub utf8::downgrade ($;$) {return 1 unless (utf8::is_ut...
(
[\x00-\x7F]
|[\xC2-\xDF][\x80-\xBF]
|[\xE0][\xA0-\xBF][\x80-\xBF]
|[\xE1-\xEC][\x80-\xBF][\x80-\xBF]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Oozie/XML.pm view on Meta::CPAN
return +( XML::Compile::Util::unpack_type( $type ) )[LAST_ELEM];
}
sub is_foreign_prefix {
my ($self, $prefix) = @_;
my ($ns, $localname) = XML::Compile::Util::unpack_type($XML_NAMESPACE{$self->prefix});
my $nsobj = ( $XML_SCHEMA->namespaces->namespace($ns) )[XML_NS_FIRST_POS];
my %elements =
map { lc $_ => 1 }
map { (XML::Compile::Util::unpack_type($_))[XML_UNPACK_LOCALNAME_POS] }
$nsobj->elements, $nsobj->types;
return not exists $elements{$prefix};
}
sub xml {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Tar/File.pm view on Meta::CPAN
my %entry = map {
my ($s,$v)=($tmpl->[++$i],$tmpl->[++$i]); # cdrake
($_)=($_=~/^([^\0]*)/) unless($s eq 'size'); # cdrake
$s=> $v ? oct $_ : $_ # cdrake
# $tmpl->[++$i] => $tmpl->[++$i] ? oct $_ : $_ # removed by cdrake - mucks up binary sizes >8gb
} unpack( UNPACK, $chunk ); # cdrake
# } map { /^([^\0]*)/ } unpack( UNPACK, $chunk ); # old - replaced now by cdrake
if(substr($entry{'size'}, 0, 1) eq "\x80") { # binary size extension for files >8gigs (> octal 77777777777777) # cdrake
my @sz=unpack("aCSNN",$entry{'size'}); $entry{'size'}=$sz[4]+(2**32)*$sz[3]+$sz[2]*(2**64); # Use the low 80 bits (should use the upper 15 as well, but as at year 2011, that seems unlikely to ever be needed - the numbers are just too big...) # ...
} else { # cdrake
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Unrar.pm view on Meta::CPAN
my $handle = $RAR_functions{RAROpenArchiveEx}->Call($RAROpenArchiveDataEx_struct);
my ( $CmtBuf1, $CmtSize, $CmtState, $flagsEX ) =
(unpack( 'pLLLP'.COMMENTS_BUFFER_SIZE.'LLLLL32', $RAROpenArchiveDataEx_struct ))[4,6,7,8];
#is it really a RAR file? maybe it is a ZIP disguised as a RAR
if ($handle == 0) {
return (undef,undef,ERAR_WRONG_FORMAT);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Zip/Archive.pm view on Meta::CPAN
$bytesRead = $fh->read($locator, ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_LENGTH);
if ($bytesRead != ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_LENGTH) {
return _ioError("reading zip64 EOCD locator");
}
(undef, $zip64EOCDPosition, undef) =
unpack(ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_FORMAT, $locator);
if ($zip64EOCDPosition >
($zip64EOCDLocatorPosition - ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_LENGTH - SIGNATURE_LENGTH)) {
# No need to seek to EOCD since we're already there
last NOZIP64;
}
view all matches for this distribution
view release on metacpan or search on metacpan
sub get_outbuf_ptr {
my $dsp = shift;
my $cinfo = pack CINFO_TMPL;
ioctl($dsp, SNDCTL_DSP_GETOPTR, $cinfo) or return undef;
return unpack CINFO_TMPL, $cinfo;
}
sub get_inbuf_ptr {
my $dsp = shift;
my $cinfo = pack CINFO_TMPL;
ioctl($dsp, SNDCTL_DSP_GETIPTR, $cinfo) or return undef;
return unpack CINFO_TMPL, $cinfo;
}
sub get_outbuf_info {
my $dsp = shift;
my $binfo = pack BINFO_TMPL;
ioctl($dsp, SNDCTL_DSP_GETOSPACE, $binfo) or return undef;
return unpack BINFO_TMPL, $binfo;
}
sub get_inbuf_info {
my $dsp = shift;
my $binfo = pack BINFO_TMPL;
ioctl($dsp, SNDCTL_DSP_GETISPACE, $binfo) or return undef;
return unpack BINFO_TMPL, $binfo;
}
# Some constants may not be defined, don't define their subs either
BEGIN {
if (defined &SOUND_MIXER_INFO) {
*get_mixer_info = sub {
my $mixer = shift;
my $minfo = pack MINFO_TMPL;
ioctl($mixer, SOUND_MIXER_INFO(), $minfo) or return undef;
return unpack MINFO_TMPL, $minfo;
};
push @EXPORT_OK, 'get_mixer_info';
push @{$EXPORT_TAGS{funcs}}, 'get_mixer_info';
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Audio/SndFile.pm view on Meta::CPAN
"double". Values will be converted if necessary.
Returns the number of samples / frames read. $buffer will be shrunk
or grown accordingly.
my @values = $sndfile->unpack_TYPE($num);
my @values = $sndfile->unpackf_TYPE($num);
Same as read_TYPE and readf_TYPE, but returns the values as a list of
scalars.
=head2 Write audio data
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BSON/PP.pm view on Meta::CPAN
my @array = ();
my %hash = ();
tie( %hash, 'Tie::IxHash' ) if $opt->{ordered};
my ($type, $key, $value);
while ($bson) {
( $type, $key, $bson ) = unpack( BSON_TYPE_NAME.BSON_REMAINING, $bson );
utf8::decode($key);
# Check type and truncation
my $min_size = $FIELD_SIZES{$type};
if ( !defined $min_size ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Baseball/Sabermetrics/League/CPB2.pm view on Meta::CPAN
$teams->{$name} = $t;
}
while (read FILE, $bin, 256) {
die if length $bin != 256;
my $p = $c->unpack('Player', $bin);
next if $p->{team} > 5; # XXX unregistered player
$p->{name} = decode "big5", pack 'C[6]', @{$p->{name}};
$p->{name} =~ s/ //g;
$p->{name} = encode "utf8", $p->{name};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/ScenarioR/Serializers.pm view on Meta::CPAN
## no critic
package Bencher::ScenarioR::Serializers;
our $VERSION = 0.161; # VERSION
our $results = [[200,"OK",[{_name=>"p_tags=yaml, serialize participant=YAML::Dump",_succinct_name=>"Y:D yaml, serialize",errors=>6.9e-07,p_tags=>"yaml, serialize",participant=>"YAML::Dump",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>435.363636363...
1;
# ABSTRACT: Benchmark Perl data serialization modules
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/C/DynaLib.pm view on Meta::CPAN
my ($index, $coderef);
my ($codeptr, $ret_type, $arg_type, @arg_type, $func);
my $i;
for ($index = 0; $index <= $#{$Config}; $index++) {
($codeptr, $ret_type, $arg_type, $func)
= unpack(CONFIG_TEMPLATE, $Config->[$index]);
last unless $codeptr;
}
if ($index > $#{$Config}) {
carp "Limit of ", scalar(@$Config), " callbacks exceeded";
return undef;
view all matches for this distribution
view release on metacpan or search on metacpan
perl p5httpd
Note that these examples do not require CGI::ExtDirect to be installed
so you can try them beforehand. That said, CGI::ExtDirect depends on
RPC::ExtDirect being available in `@INC' so if you don't want to install
either module, unpack RPC::ExtDirect and CGI::ExtDirect tarballs to the
same directory and use `$PERL5LIB' to point to RPC::ExtDirect location:
cd examples
PERL5LIB=../../RPC-ExtDirect-3.xx/lib perl p5httpd
view all matches for this distribution
view release on metacpan or search on metacpan
t/unpacked/Acme-Buffy/buffy
t/unpacked/Acme-Buffy/Changes
t/unpacked/Acme-Buffy/demo_buffy.pl
t/unpacked/Acme-Buffy/demo_simple.pl
t/unpacked/Acme-Buffy/lib/Acme/Buffy.pm
t/unpacked/Acme-Buffy/Makefile.PL
t/unpacked/Acme-Buffy/MANIFEST
t/unpacked/Acme-Buffy/README
t/unpacked/Acme-Buffy/t/buffy.t
t/unpacked/Acme-Colour/Build.PL
t/unpacked/Acme-Colour/CHANGES
t/unpacked/Acme-Colour/lib/Acme/Colour.pm
t/unpacked/Acme-Colour/Makefile.PL
t/unpacked/Acme-Colour/MANIFEST
t/unpacked/Acme-Colour/META.yml
t/unpacked/Acme-Colour/README
t/unpacked/Acme-Colour/test.pl
t/unpacked/GraphViz/Changes
view all matches for this distribution
view release on metacpan or search on metacpan
share/plotly.js/plotly.min.js view on Meta::CPAN
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=ne...
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
view all matches for this distribution
view release on metacpan or search on metacpan
7zip/CPP/7zip/Archive/7z/7zDecode.cpp view on Meta::CPAN
coderIndex++;
UInt32 numInStreams = (UInt32)coderInfo.NumInStreams;
UInt32 numOutStreams = (UInt32)coderInfo.NumOutStreams;
CRecordVector<const UInt64 *> packSizesPointers;
CRecordVector<const UInt64 *> unpackSizesPointers;
packSizesPointers.Reserve(numInStreams);
unpackSizesPointers.Reserve(numOutStreams);
UInt32 j;
for (j = 0; j < numOutStreams; j++, unpackStreamIndex++)
unpackSizesPointers.Add(&folderInfo.UnpackSizes[unpackStreamIndex]);
for (j = 0; j < numInStreams; j++, packStreamIndex++)
{
int bindPairIndex = folderInfo.FindBindPairForInStream(packStreamIndex);
if (bindPairIndex >= 0)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Convert/Binary/C.pm view on Meta::CPAN
sub unpack_ptr {
my($self, $type, $ptr) = @_;
$ptr or return '<NULL>';
my $size = $self->sizeof($type);
$self->unpack($type, unpack("P$size", pack('Q', $ptr)));
}
As you can see, the hook is rather simple. First, it receives the
arguments mentioned above. It performs a quick check if the pointer
is C<NULL> and shouldn't be processed any further. Next, it determines
view all matches for this distribution
view release on metacpan or search on metacpan
t/softhsm.t view on Meta::CPAN
diag 'CKS_RW_USER_FUNCTIONS' if $sessionInfo->{state} & CKS_RW_USER_FUNCTIONS;
diag 'CKS_RW_SO_FUNCTIONS' if $sessionInfo->{state} & CKS_RW_SO_FUNCTIONS;
is rv_to_str($f->C_Login($session, CKU_USER, '1234')), 'CKR_OK', 'C_Login';
#diag unpack('H*',pack('L',CKO_PUBLIC_KEY));
#diag unpack('H*',pack('C*',0x01, 0x00, 0x01));
my $public_key_template = [
[ CKA_CLASS , pack('Q',CKO_PUBLIC_KEY) ],
[ CKA_KEY_TYPE, pack('Q',CKK_RSA) ],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/OpenToken.pm view on Meta::CPAN
sub _unpack {
my ($self, $token_str) = @_;
use bytes;
my ($otk, $ver, $cipher, $hmac, $iv, $key, $payload)
= unpack(TOKEN_PACK, $token_str);
unless ($otk eq 'OTK') {
croak "invalid literal identifier in OTK; '$otk'";
}
unless ($ver == 1) {
croak "unsupported OTK version; '$ver'";
view all matches for this distribution
view release on metacpan or search on metacpan
t/Crypt-Present.t view on Meta::CPAN
my $plaintext = $known->{PLAIN};
my $crypttext = $cipher->encrypt( $plaintext );
my $plaintext2 = $cipher->decrypt( $crypttext );
my $KEY_Hex = unpack('H*',$known->{KEY});
my $PLAIN_Hex = unpack('H*',$plaintext);
my $CRYPT_Hex = unpack('H*',$known->{CRYPT});
ok $plaintext eq $plaintext2, "KEY $KEY_Hex: decrypt( encrypt( $PLAIN_Hex} ) ) is ".unpack('H*',$plaintext2);
ok $known->{CRYPT} eq $crypttext, "KEY $KEY_Hex: $PLAIN_Hex should -> $CRYPT_Hex and not ".unpack('H*',$crypttext);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBM/Deep/Engine/File.pm view on Meta::CPAN
+ $self->byte_size
+ $self->byte_size
+ ($self->trans_id - 1) * ( $self->byte_size + $STALE_SIZE );
my $data_loc = $self->storage->read_at( $read_loc, $self->byte_size );
$data_loc = unpack( $StP{$self->byte_size}, $data_loc );
$self->storage->print_at( $read_loc, pack( $StP{$self->byte_size}, 0 ) );
if ( $data_loc > 1 ) {
$self->load_sector( $data_loc )->free;
}
view all matches for this distribution