From 48f0cb90d0cfbe3037f353fc25adfc33561634fa Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Sat, 22 Jan 2022 13:01:10 +0000 Subject: [PATCH] remove Prot.pm, sort %valid fields --- perl/Bands.pm | 14 +++++------ perl/DXDb.pm | 30 +++++++++++------------ perl/DXMsg.pm | 36 +++++++++++++-------------- perl/Prefix.pm | 10 ++++---- perl/Prot.pm | 61 ---------------------------------------------- perl/Route.pm | 10 ++++---- perl/Route/Node.pm | 18 +++++++------- 7 files changed, 59 insertions(+), 120 deletions(-) delete mode 100644 perl/Prot.pm diff --git a/perl/Bands.pm b/perl/Bands.pm index 9f44c090..ac3647ea 100644 --- a/perl/Bands.pm +++ b/perl/Bands.pm @@ -21,18 +21,18 @@ use vars qw(%bands %regions %aliases $bandsfn %valid); $bandsfn = "$main::data/bands.pl"; %valid = ( + band => '0,BAND,parraypairs', + beacon => '0,BEACON,parraypairs', cw => '0,CW,parraypairs', - ssb => '0,SSB,parraypairs', data => '0,DATA,parraypairs', - sstv => '0,SSTV,parraypairs', + fax => '0,FAX,parraypairs', fstv => '0,FSTV,parraypairs', - rtty => '0,RTTY,parraypairs', - pactor => '0,PACTOR,parraypairs', packet => '0,PACKET,parraypairs', + pactor => '0,PACTOR,parraypairs', repeater => '0,REPEATER,parraypairs', - fax => '0,FAX,parraypairs', - beacon => '0,BEACON,parraypairs', - band => '0,BAND,parraypairs', + rtty => '0,RTTY,parraypairs', + ssb => '0,SSB,parraypairs', + sstv => '0,SSTV,parraypairs', ); # load the band data diff --git a/perl/DXDb.pm b/perl/DXDb.pm index 81d21928..5d96e6cf 100644 --- a/perl/DXDb.pm +++ b/perl/DXDb.pm @@ -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', + allowread => '9,Allowed read,parray', + allowupd => '9,Allow upd,parray', + atemplate => '9,App Templates,parray', + cal => '0,No Key txt', + chain => '0,Search these,parray', 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', + disable => '0,Disabled?,yesno', 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', 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; diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index e6662b59..153a2c1b 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -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', + 'read' => '5,Times read', 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', - lines => '5,Lines,parray', - 'read' => '5,Times read', - size => '0,Size', - msgno => '0,Msgno', 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', - delete => '5,Awaiting Delete,yesno', - deletetime => '5,Deletion Time,cldatetime', ); # fix up the default sendmail if available diff --git a/perl/Prefix.pm b/perl/Prefix.pm index 53424e03..086e0725 100644 --- a/perl/Prefix.pm +++ b/perl/Prefix.pm @@ -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 diff --git a/perl/Prot.pm b/perl/Prot.pm deleted file mode 100644 index 27416735..00000000 --- a/perl/Prot.pm +++ /dev/null @@ -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__ diff --git a/perl/Route.pm b/perl/Route.pm index 304b9c68..a8820ea4 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -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", + city => '0,City', + cq => '0,CQ Zone', dxcc => '0,Country Code', + flags => "0,Flags,phex", + ip => '0,IP Address', itu => '0,ITU Zone', - cq => '0,CQ Zone', + parent => '0,Parent Calls,parray', state => '0,State', - city => '0,City', - ip => '0,IP Address', ); $filterdef = bless ([ diff --git a/perl/Route/Node.pm b/perl/Route/Node.pm index e2b15416..c700c496 100644 --- a/perl/Route/Node.pm +++ b/perl/Route/Node.pm @@ -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', + PC92C_dxchan => '9,PC92C hops,phash', build => '0,Build', + do_pc9x => '0,Uses pc9x,yesno', handle_xml => '0,Using XML,yesno', - lastmsg => '0,Last Route Msg,atime', + last_PC92C => '9,Last PC92C', lastid => '0,Last Route MsgID', - do_pc9x => '0,Uses pc9x,yesno', - via_pc92 => '0,In via pc92?,yesno', + lastmsg => '0,Last Route Msg,atime', + nodes => '0,Nodes,parray', obscount => '0,Obscount', - last_PC92C => '9,Last PC92C', - PC92C_dxchan => '9,PC92C hops,phash', + usercount => '0,User Count', + users => '0,Users,parray', + version => '0,Version', + via_pc92 => '0,In via pc92?,yesno',, ); $filterdef = $Route::filterdef; -- 2.34.1