/usr/share/perl5/Net/SNPP/HylaFAX.pm is in libnet-snpp-perl 1.17-3.
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 | package Net::SNPP::HylaFAX;
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
use Net::SNPP;
use Carp;
$VERSION = do { my @r=(q$Revision: 1.1 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
@ISA = qw(Exporter Net::SNPP);
@EXPORT = @Net::SNPP::EXPORT;
@EXPORT_OK = qw(NOTIFY_NONE NOTIFY_DONE NOTIFY_REQUEUE MODEM_DEVICE MODEM_CLASS);
%EXPORT_TAGS = (
NOTIFY => [qw(NOTIFY_NONE NOTIFY_DONE NOTIFY_REQUEUE)],
MODEM => [qw(MODEM_DEVICE MODEM_CLASS)],
);
sub NOTIFY_NONE () { 1 }
sub NOTIFY_DONE () { 2 }
sub NOTIFY_REQUEUE () { 4 }
sub MODEM_CLASS () { 1 }
sub MODEM_DEVICE () { 2 }
sub jqueue
{
@_ == 2 or croak 'usage: $snpp->jqueue( BOOLEAN )';
my $snpp = shift;
my $arg = $_[0] ? "YES" : "NO";
$snpp->_SITE('JQUEUE', $arg)->response() == CMD_OK;
}
sub from_user
{
@_ == 2 or croak 'usage: $snpp->from_user( MAIL_ADDRESS )';
my $snpp = shift;
($snpp->_SITE('FROMUSER',@_)->response == CMD_OK)
? ($snpp->message =~ /"([^"]+)"/)[0]
: undef;
}
my %modem = ( DEVICE => MODEM_DEVICE, CLASS => MODEM_CLASS);
sub modem
{
@_ == 2 or croak 'usage: $snpp->modem( [MODEM_DEVICE|MODEM_CLASS] )';
my $snpp = shift;
my $modem = shift;
my $arg = $modem == MODEM_DEVICE
? "DEVICE"
: $modem == MODEM_CLASS
? "CLASS"
: croak 'Unknown modem type';
my $ret = ($snpp->_SITE('MODEM',$arg)->response == CMD_OK)
? ($snpp->message =~ /"([^"]+)"/)[0]
: undef;
if(defined $ret)
{
$ret = uc $ret;
$ret = $modem{$ret} || croak "Unknown modem type '$ret'";
}
$ret;
}
my $i = 0;
my %notify = map { $_ => (1 << $i++) } qw(NONE DONE REQUEUE);
sub notify
{
@_ == 2 or croak 'usage: $snpp->notify( NOTIFY_LEVEL )';
my $snpp = shift;
my $arg = shift;
my @arg = ();
croak 'Bad notify argument'
if $arg < 1 || $arg == 3 || $arg == 5 || $arg > 6;
push(@arg,"NONE") if $arg & 1;
push(@arg,"DONE") if $arg & 2;
push(@arg,"REQUEUE") if $arg & 4;
my $str = ($snpp->_SITE('NOTIFY',join("+",@arg))->response == CMD_OK)
? ($snpp->message =~ /"([^"]+)"/)[0]
: undef;
my $val = undef;
if($str)
{
$val = 0;
map { $val |= $notify{$_} } split(/\+/, $str)
}
$val;
}
sub notify_addr
{
my $snpp = shift;
($snpp->_SITE('MAILADDR',@_)->response == CMD_OK)
? ($snpp->message =~ /"([^"]+)"/)[0]
: undef;
}
1;
|