1 ;;; uudecode.el -- elisp native uudecode
2 ;; Copyright (c) 1998 by Shenghuo Zhu <zsh@cs.rochester.edu>
4 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
8 ;; This file is not part of GNU Emacs, but the same permissions
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)
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.
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.
28 ;; Lots of codes are stolen from mm-decode.el, gnus-uu.el and
33 (if (not (fboundp 'char-int))
34 (fset 'char-int 'identity))
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.")
41 (defvar uudecode-decoder-switches nil
42 "*List of command line flags passed to the command named by uudecode-decoder-program.")
44 (defconst uudecode-alphabet "\040-\140")
46 (defconst uudecode-begin-line "^begin[ \t]+[0-7][0-7][0-7][ \t]+\\(.*\\)$")
47 (defconst uudecode-end-line "^end[ \t]*$")
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]")))
55 (defvar uudecode-temporary-file-directory
56 (cond ((fboundp 'temp-directory) (temp-directory))
57 ((boundp 'temporary-file-directory) temporary-file-directory)