Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64 User : User ( 0) PHP Version : 7.4.6 Disable Function : NONE Directory : C:/xampp/perl/vendor/lib/DBM/Deep/Sector/File/ |
package DBM::Deep::Sector::File::Null; use 5.008_004; use strict; use warnings FATAL => 'all'; use base qw( DBM::Deep::Sector::File::Data ); my $STALE_SIZE = 2; # Please refer to the pack() documentation for further information my %StP = ( 1 => 'C', # Unsigned char value (no order needed as it's just one byte) 2 => 'n', # Unsigned short in "network" (big-endian) order 4 => 'N', # Unsigned long in "network" (big-endian) order 8 => 'Q', # Usigned quad (no order specified, presumably machine-dependent) ); sub type { $_[0]{engine}->SIG_NULL } sub data_length { 0 } sub data { return } sub _init { my $self = shift; my $engine = $self->engine; unless ( $self->offset ) { my $leftover = $self->size - $self->base_size - 1 * $engine->byte_size - 1; $self->{offset} = $engine->_request_data_sector( $self->size ); $engine->storage->print_at( $self->offset, $self->type ); # Sector type # Skip staleness counter $engine->storage->print_at( $self->offset + $self->base_size, pack( $StP{$engine->byte_size}, 0 ), # Chain loc pack( $StP{1}, $self->data_length ), # Data length chr(0) x $leftover, # Zero-fill the rest ); return; } } 1; __END__