… | |
… | |
29 | B64ENCODED BH_ENCODED PT_ENCODED QP_ENCODED |
29 | B64ENCODED BH_ENCODED PT_ENCODED QP_ENCODED |
30 | XX_ENCODED UU_ENCODED YENC_ENCODED |
30 | XX_ENCODED UU_ENCODED YENC_ENCODED |
31 | ); |
31 | ); |
32 | |
32 | |
33 | @_funcs = qw( |
33 | @_funcs = qw( |
34 | Initialize CleanUp GetOption SetOption strerror |
34 | Initialize CleanUp GetOption SetOption strerror SetMsgCallback |
35 | SetMsgCallback SetBusyCallback SetFileCallback |
35 | SetBusyCallback SetFileCallback SetFNameFilter SetFileNameCallback |
36 | SetFNameFilter FNameFilter LoadFile GetFileListItem |
36 | FNameFilter LoadFile GetFileListItem RenameFile DecodeToTemp |
37 | RenameFile DecodeToTemp RemoveTemp DecodeFile |
37 | RemoveTemp DecodeFile InfoFile Smerge QuickDecode EncodeMulti |
38 | InfoFile Smerge QuickDecode EncodeMulti EncodePartial |
38 | EncodePartial EncodeToStream EncodeToFile E_PrepSingle |
39 | EncodeToStream EncodeToFile E_PrepSingle E_PrepPartial |
39 | E_PrepPartial |
40 | |
40 | |
41 | straction strencoding strmsglevel |
41 | straction strencoding strmsglevel |
42 | ); |
42 | ); |
43 | |
43 | |
44 | @EXPORT = @_consts; |
44 | @EXPORT = @_consts; |
… | |
… | |
226 | RET_CANCEL RET_CONT RET_EXISTS RET_ILLVAL RET_IOERR |
226 | RET_CANCEL RET_CONT RET_EXISTS RET_ILLVAL RET_IOERR |
227 | RET_NODATA RET_NOEND RET_NOMEM RET_OK RET_UNSUP |
227 | RET_NODATA RET_NOEND RET_NOMEM RET_OK RET_UNSUP |
228 | |
228 | |
229 | Encoding types: |
229 | Encoding types: |
230 | |
230 | |
231 | B64ENCODED BH_ENCODED PT_ENCODED |
231 | B64ENCODED BH_ENCODED PT_ENCODED QP_ENCODED XX_ENCODED |
232 | QP_ENCODED XX_ENCODED UU_ENCODED |
232 | UU_ENCODED YENC_ENCODED |
233 | |
233 | |
234 | =head1 Exported functions |
234 | =head1 Exported functions |
235 | |
235 | |
236 | Initializing and cleanup (Initialize is automatically called when the |
236 | Initializing and cleanup (Initialize is automatically called when the |
237 | module is loaded and allocates quite a bit of memory. CleanUp releases |
237 | module is loaded and allocates quite a bit of memory. CleanUp releases |
… | |
… | |
299 | int EncodeToStream () ; |
299 | int EncodeToStream () ; |
300 | int EncodeToFile () ; |
300 | int EncodeToFile () ; |
301 | int E_PrepSingle () ; |
301 | int E_PrepSingle () ; |
302 | int E_PrepPartial () ; |
302 | int E_PrepPartial () ; |
303 | |
303 | |
|
|
304 | =head2 EXTENSION FUNCTIONS |
|
|
305 | |
|
|
306 | Functions found in this module but not documented in the uulib documentation: |
|
|
307 | |
|
|
308 | =over 4 |
|
|
309 | |
|
|
310 | =item SetFileNameCallback $cb |
|
|
311 | |
|
|
312 | Sets (or queries) the FileNameCallback, which is called whenever the |
|
|
313 | decoding library can't find a filename and wants to extract a filename |
|
|
314 | from the subject line of a posting. The callback will be called with |
|
|
315 | two arguments, the subject line and the current candidate for the |
|
|
316 | filename. The latter argument can be C<undef>, which means that no |
|
|
317 | filename could be found (and likely no one exists, so it is safe to also |
|
|
318 | return C<undef> in this case). If it doesn't return anything (not even |
|
|
319 | C<undef>!), then nothing happens, so this is a no-op callback: |
|
|
320 | |
|
|
321 | sub cb { |
|
|
322 | return (); |
|
|
323 | } |
|
|
324 | |
|
|
325 | If it returns C<undef>, then this indicates that no filename could be |
|
|
326 | found. In all other cases, the return value is taken to be the filename. |
|
|
327 | |
|
|
328 | This is a slightly more useful callback: |
|
|
329 | |
|
|
330 | sub cb { |
|
|
331 | return unless $_[1]; # skip "Re:"-plies et al. |
|
|
332 | my ($subject, $filename) = @_; |
|
|
333 | # if we find some *.rar, take it |
|
|
334 | return $1 if $subject =~ /(\w+\.rar)/; |
|
|
335 | # otherwise just pass what we have |
|
|
336 | return (); |
|
|
337 | } |
|
|
338 | |
|
|
339 | =back |
|
|
340 | |
304 | =head1 AUTHOR |
341 | =head1 AUTHOR |
305 | |
342 | |
306 | Marc Lehmann <pcg@goof.com>, the original uulib library was written by |
343 | Marc Lehmann <pcg@goof.com>, the original uulib library was written by |
307 | Frank Pilhofer <fp@informatik.uni-frankfurt.de>. |
344 | Frank Pilhofer <fp@informatik.uni-frankfurt.de>. |
308 | |
345 | |