ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/example-decoder
(Generate patch)

Comparing Convert-UUlib/example-decoder (file contents):
Revision 1.2 by root, Tue Jun 12 03:20:44 2001 UTC vs.
Revision 1.4 by root, Sun Mar 31 22:03:56 2002 UTC

28 28
29SetMsgCallback (sub { 29SetMsgCallback (sub {
30 my($msg,$level)=@_; 30 my($msg,$level)=@_;
31 print uc(strmsglevel($_[1])),": $msg\n"; 31 print uc(strmsglevel($_[1])),": $msg\n";
32}); 32});
33
34SetFileNameCallback sub {
35 return unless $_[1]; # skip "Re:"-plies et al.
36 local _$ = $_[0];
37
38 # the following rules are rather effective on some newsgroups,
39 # like alt.binaries.games.anime, where non-mime, uuencoded data
40 # is very common
41
42 # if we find some *.rar, take it
43 return $1 if /(\S+\.(?:[rstuvwxyz]\d\d|rar))\s/i;
44
45 # - filename.par (04/55)
46 return $1 if /- "?(\S+\.\S+?)"? (:yenc )?\(\d+\/\d+\)/i;
47
48 # otherwise just pass what we have
49 return ();
50};
51
33 52
34for(<uusrc/*>) { 53for(<uusrc/*>) {
35 my($retval,$count)=LoadFile ($_,$_,1); 54 my($retval,$count)=LoadFile ($_,$_,1);
36 print "file($_), status(",strerror($retval),") parts($count)\n"; 55 print "file($_), status(",strerror($retval),") parts($count)\n";
37} 56}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines