--- Convert-UUlib/UUlib.pm 2002/03/31 20:19:09 1.5 +++ Convert-UUlib/UUlib.pm 2002/03/31 21:42:35 1.6 @@ -31,12 +31,12 @@ ); @_funcs = qw( - Initialize CleanUp GetOption SetOption strerror - SetMsgCallback SetBusyCallback SetFileCallback - SetFNameFilter FNameFilter LoadFile GetFileListItem - RenameFile DecodeToTemp RemoveTemp DecodeFile - InfoFile Smerge QuickDecode EncodeMulti EncodePartial - EncodeToStream EncodeToFile E_PrepSingle E_PrepPartial + Initialize CleanUp GetOption SetOption strerror SetMsgCallback + SetBusyCallback SetFileCallback SetFNameFilter SetFileNameCallback + FNameFilter LoadFile GetFileListItem RenameFile DecodeToTemp + RemoveTemp DecodeFile InfoFile Smerge QuickDecode EncodeMulti + EncodePartial EncodeToStream EncodeToFile E_PrepSingle + E_PrepPartial straction strencoding strmsglevel ); @@ -228,8 +228,8 @@ Encoding types: - B64ENCODED BH_ENCODED PT_ENCODED - QP_ENCODED XX_ENCODED UU_ENCODED + B64ENCODED BH_ENCODED PT_ENCODED QP_ENCODED XX_ENCODED + UU_ENCODED YENC_ENCODED =head1 Exported functions @@ -301,6 +301,43 @@ int E_PrepSingle () ; int E_PrepPartial () ; +=head2 EXTENSION FUNCTIONS + +Functions found in this module but not documented in the uulib documentation: + +=over 4 + +=item SetFileNameCallback $cb + +Sets (or queries) the FileNameCallback, which is called whenever the +decoding library can't find a filename and wants to extract a filename +from the subject line of a posting. The callback will be called with +two arguments, the subject line and the current candidate for the +filename. The latter argument can be C, which means that no +filename could be found (and likely no one exists, so it is safe to also +return C in this case). If it doesn't return anything (not even +C!), then nothing happens, so this is a no-op callback: + + sub cb { + return (); + } + +If it returns C, then this indicates that no filename could be +found. In all other cases, the return value is taken to be the filename. + +This is a slightly more useful callback: + + sub cb { + return unless $_[1]; # skip "Re:"-plies et al. + my ($subject, $filename) = @_; + # if we find some *.rar, take it + return $1 if $subject =~ /(\w+\.rar)/; + # otherwise just pass what we have + return (); + } + +=back + =head1 AUTHOR Marc Lehmann , the original uulib library was written by