remove Prot.pm, sort %valid fields

This commit is contained in:
Dirk Koopman 2022-01-22 13:01:10 +00:00
parent 3292b0f8ef
commit 48f0cb90d0
7 changed files with 72 additions and 133 deletions

View File

@ -21,18 +21,18 @@ use vars qw(%bands %regions %aliases $bandsfn %valid);
$bandsfn = "$main::data/bands.pl";
%valid = (
cw => '0,CW,parraypairs',
ssb => '0,SSB,parraypairs',
data => '0,DATA,parraypairs',
sstv => '0,SSTV,parraypairs',
fstv => '0,FSTV,parraypairs',
rtty => '0,RTTY,parraypairs',
pactor => '0,PACTOR,parraypairs',
packet => '0,PACKET,parraypairs',
repeater => '0,REPEATER,parraypairs',
fax => '0,FAX,parraypairs',
beacon => '0,BEACON,parraypairs',
band => '0,BAND,parraypairs',
beacon => '0,BEACON,parraypairs',
cw => '0,CW,parraypairs',
data => '0,DATA,parraypairs',
fax => '0,FAX,parraypairs',
fstv => '0,FSTV,parraypairs',
packet => '0,PACKET,parraypairs',
pactor => '0,PACTOR,parraypairs',
repeater => '0,REPEATER,parraypairs',
rtty => '0,RTTY,parraypairs',
ssb => '0,SSB,parraypairs',
sstv => '0,SSTV,parraypairs',
);
# load the band data

View File

@ -21,28 +21,28 @@ $dbbase = "$main::root/db"; # where all the databases are kept;
%avail = (); # The hash contains a list of all the databases
%valid = (
accesst => '9,Last Accs Time,atime',
createt => '9,Create Time,atime',
lastt => '9,Last Upd Time,atime',
name => '0,Name',
db => '9,DB Tied hash',
remote => '0,Remote Database',
pre => '0,Heading txt',
post => '0,Tail txt',
chain => '0,Search these,parray',
disable => '0,Disabled?,yesno',
nf => '0,Not Found txt',
cal => '0,No Key txt',
allowread => '9,Allowed read,parray',
denyread => '9,Deny read,parray',
allowupd => '9,Allow upd,parray',
denyupd => '9,Deny upd,parray',
fwdupd => '9,Forw upd to,parray',
template => '9,Upd Templates,parray',
te => '9,End Upd txt',
tae => '9,End App txt',
atemplate => '9,App Templates,parray',
cal => '0,No Key txt',
chain => '0,Search these,parray',
createt => '9,Create Time,atime',
db => '9,DB Tied hash',
denyread => '9,Deny read,parray',
denyupd => '9,Deny upd,parray',
disable => '0,Disabled?,yesno',
fwdupd => '9,Forw upd to,parray',
help => '0,Help txt,parray',
lastt => '9,Last Upd Time,atime',
localcmd => '0,Local Command',
name => '0,Name',
nf => '0,Not Found txt',
post => '0,Tail txt',
pre => '0,Heading txt',
remote => '0,Remote Database',
tae => '9,End App txt',
te => '9,End Upd txt',
template => '9,Upd Templates,parray',
);
$lastprocesstime = time;

View File

@ -66,30 +66,30 @@ $importfn = "$msgdir/import"; # import directory
%valid = (
fromnode => '5,From Node',
tonode => '5,To Node',
to => '0,To',
from => '0,From',
t => '0,Msg Time,cldatetime',
private => '5,Private,yesno',
subject => '0,Subject',
linesreq => '0,Lines per Gob',
rrreq => '5,Read Confirm,yesno',
origin => '0,Origin',
lines => '5,Data',
stream => '9,Stream No',
count => '5,Gob Linecnt',
file => '5,File?,yesno',
gotit => '5,Got it Nodes,parray',
lines => '5,Lines,parray',
'read' => '5,Times read',
size => '0,Size',
msgno => '0,Msgno',
keep => '0,Keep this?,yesno',
lastt => '5,Last processed,cldatetime',
waitt => '5,Wait until,cldatetime',
count => '5,Gob Linecnt',
delete => '5,Awaiting Delete,yesno',
deletetime => '5,Deletion Time,cldatetime',
file => '5,File?,yesno',
from => '0,From',
fromnode => '5,From Node',
gotit => '5,Got it Nodes,parray',
keep => '0,Keep this?,yesno',
lastt => '5,Last processed,cldatetime',
lines => '5,Data',
lines => '5,Lines,parray',
linesreq => '0,Lines per Gob',
msgno => '0,Msgno',
origin => '0,Origin',
private => '5,Private,yesno',
rrreq => '5,Read Confirm,yesno',
size => '0,Size',
stream => '9,Stream No',
subject => '0,Subject',
t => '0,Msg Time,cldatetime',
to => '0,To',
tonode => '5,To Node',
waitt => '5,Wait until,cldatetime',
);
# fix up the default sendmail if available

View File

@ -511,16 +511,16 @@ sub cty_data
}
my %valid = (
city => '0,City',
cont => '0,Continent',
cq => '0,CQ',
dxcc => '0,DXCC',
itu => '0,ITU',
lat => '0,Latitude,slat',
long => '0,Longitude,slong',
dxcc => '0,DXCC',
name => '0,Name',
itu => '0,ITU',
cq => '0,CQ',
state => '0,State',
city => '0,City',
utcoff => '0,UTC offset',
cont => '0,Continent',
);
sub AUTOLOAD

View File

@ -1,61 +0,0 @@
#
# Base class for OO version of all protocol stuff
#
package Prot;
use strict;
use DXUtil;
use DXDebug;
use vars qw(%valid);
%valid = (
fromnode => '0,From Node',
tonode => '0,To Node',
vianode => '0,Via Node',
origin => '0,Original Node',
tocall => '0,To Callsign',
fromcall => '0,From Callsign',
hops => '0,No. of hops',
text => '0,Text',
datetime => '0,Date/Time,atime',
freq => '0,Frequency',
dxcall => '0,DX Callsign',
sort => '0,Sort',
hereflag => '0,Here?,yesno',
talkflag => '0,Talk mode',
bellflag => '0,Bell?',
privflag => '0,Private?,yesno',
rrflag => '0,RR Req.?,yesno',
sysopflag => '0,Sysop flag',
dxcount => '0,DX Count',
wwvcount => '0,WWV Count',
version => '0,Node Version',
nodelist => '0,Node List,parray',
);
sub new
{
my $pkg = shift;
my $sort = shift;
my $self = bless { sort => $sort }, $pkg;
return $self;
}
sub AUTOLOAD
{
no strict;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
$name =~ s/^.*:://o;
confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
goto &$AUTOLOAD;
}
1;
__END__

View File

@ -25,15 +25,15 @@ use strict;
use vars qw(%list %valid $filterdef $maxlevel);
%valid = (
parent => '0,Parent Calls,parray',
call => "0,Callsign",
flags => "0,Flags,phex",
dxcc => '0,Country Code',
itu => '0,ITU Zone',
cq => '0,CQ Zone',
state => '0,State',
city => '0,City',
cq => '0,CQ Zone',
dxcc => '0,Country Code',
flags => "0,Flags,phex",
ip => '0,IP Address',
itu => '0,ITU Zone',
parent => '0,Parent Calls,parray',
state => '0,State',
);
$filterdef = bless ([

View File

@ -20,19 +20,19 @@ use vars qw(%list %valid @ISA $max $filterdef $obscount);
%valid = (
K => '9,Seen on PC92K,yesno',
nodes => '0,Nodes,parray',
users => '0,Users,parray',
usercount => '0,User Count',
version => '0,Version',
build => '0,Build',
handle_xml => '0,Using XML,yesno',
lastmsg => '0,Last Route Msg,atime',
lastid => '0,Last Route MsgID',
do_pc9x => '0,Uses pc9x,yesno',
via_pc92 => '0,In via pc92?,yesno',
obscount => '0,Obscount',
last_PC92C => '9,Last PC92C',
PC92C_dxchan => '9,PC92C hops,phash',
build => '0,Build',
do_pc9x => '0,Uses pc9x,yesno',
handle_xml => '0,Using XML,yesno',
last_PC92C => '9,Last PC92C',
lastid => '0,Last Route MsgID',
lastmsg => '0,Last Route Msg,atime',
nodes => '0,Nodes,parray',
obscount => '0,Obscount',
usercount => '0,User Count',
users => '0,Users,parray',
version => '0,Version',
via_pc92 => '0,In via pc92?,yesno',,
);
$filterdef = $Route::filterdef;