/usr/share/perl5/auto/PDF/Reuse/crossrefObj.al is in libpdf-reuse-perl 0.35-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | # NOTE: Derived from blib/lib/PDF/Reuse.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package PDF::Reuse;
#line 4230 "blib/lib/PDF/Reuse.pm (autosplit into blib/lib/auto/PDF/Reuse/crossrefObj.al)"
sub crossrefObj
{ my ($nr, $xref) = @_;
my ($buf, %param, $len, $tempRoot);
my $from = $xref;
sysseek INFIL, $xref, 0;
sysread INFIL, $buf, 400;
my $str;
if ($buf =~ m'^(.+>>\s*)stream'os)
{ $str = $1;
$from = length($str) + 7;
if (substr($buf, $from, 1) eq "\n")
{ $from++;
}
$from += $xref;
}
for (split('/',$str))
{ if ($_ =~ m'^(\w+)(.*)'o)
{ $param{$1} = $2 || ' ';
}
}
if ((exists $param{'Root'}) && ($param{'Root'} =~ m'^\s*(\d+)'o))
{ $tempRoot = $1;
}
my @keys = ($param{'W'} =~ m'(\d+)'og);
my $keyLength = 0;
for (@keys)
{ $keyLength += $_;
}
my $recLength = $keyLength + 1;
my $upTo = 1 + $keys[0] + $keys[1];
if ((exists $param{'Length'}) && ($param{'Length'} =~ m'(\d+)'o))
{ $len = $1;
sysseek INFIL, $from, 0;
sysread INFIL, $buf, $len;
my $x = inflateInit()
|| die "Cannot create an inflation stream\n" ;
my ($output, $status) = $x->inflate(\$buf) ;
die "inflation failed\n"
unless $status == 1;
my $i = 0;
my @last = (0, 0, 0, 0, 0, 0, 0);
my @word = ('0', '0', '0', '0', '0', '0', '0');
my $recTyp;
my @intervall = ($param{'Index'} =~ m'(\d+)\D'osg);
my $m = 0;
my $currObj = $intervall[$m];
$m++;
my $max = $currObj + $intervall[$m];
for (unpack ("C*", $output))
{ if (($_ != 0) && ($i > 0) && ($i < $upTo))
{ my $tal = $_ + $last[$i] ;
if ($tal > 255)
{$tal -= 256;
}
$last[$i] = $tal;
$word[$i] = sprintf("%x", $tal);
if (length($word[$i]) == 1)
{ $word[$i] = '0' . $word[$i];
}
}
$i++;
if ($i == $recLength)
{ $i = 0;
my $j = 0;
my $offsObj; # offset or object
if ($keys[0] == 0)
{ $recTyp = 1;
$j = 1;
}
else
{ $recTyp = $word[1];
$j = 2;
}
my $k = 0;
while ($k < $keys[1])
{ $offsObj .= $word[$j];
$k++;
$j++;
}
if ($recTyp == 1)
{ if (! (exists $oldObject{$currObj}))
{ $oldObject{$currObj} = hex($offsObj); }
else
{ $nr++;
$oldObject{'xref' . "$nr"} = hex($offsObj);
}
}
elsif ($recTyp == 2)
{ if (! (exists $oldObject{$currObj}))
{ $oldObject{$currObj} = 0;
}
$embedded{$currObj} = hex($offsObj);
}
if ($currObj < $max)
{ $currObj++;
}
else
{ $m++;
$currObj = $intervall[$m];
$m++;
$max = $currObj + $intervall[$m];
}
}
}
}
return ($param{'Prev'}, $tempRoot, $nr);
}
# end of PDF::Reuse::crossrefObj
1;
|