Make nnwarchive work with agent.
[gnus] / lisp / uudecode.el
1 ;;; uudecode.el -- elisp native uudecode
2 ;; Copyright (c) 1998 by Shenghuo Zhu <zsh@cs.rochester.edu>
3
4 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
5 ;; $Revision: 5.6 $
6 ;; Keywords: uudecode
7
8 ;; This file is not part of GNU Emacs, but the same permissions
9 ;; apply.
10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Commentary:
27
28 ;;     Lots of codes are stolen from mm-decode.el, gnus-uu.el and
29 ;;     base64.el
30
31 ;;; Code:
32
33 (if (not (fboundp 'char-int))
34     (fset 'char-int 'identity))
35
36 (defvar uudecode-decoder-program "uudecode"
37   "*Non-nil value should be a string that names a uu decoder.
38 The program should expect to read uu data on its standard
39 input and write the converted data to its standard output.")
40
41 (defvar uudecode-decoder-switches nil
42   "*List of command line flags passed to the command named by uudecode-decoder-program.")
43
44 (defconst uudecode-alphabet "\040-\140")
45
46 (defconst uudecode-begin-line "^begin[ \t]+[0-7][0-7][0-7][ \t]+\\(.*\\)$")
47 (defconst uudecode-end-line "^end[ \t]*$")
48
49 (defconst uudecode-body-line
50   (let ((i 61) (str "^M"))
51     (while (> (setq i (1- i)) 0)
52       (setq str (concat str "[^a-z]")))
53     (concat str ".?$")))
54
55 (defvar uudecode-temporary-file-directory
56   (cond ((fboundp 'temp-directory) (temp-directory))
57         ((boundp 'temporary-file-directory) temporary-file-directory)
58         ("/tmp")))
59