--- /dev/null
+;;;
+;;; mel-g.el: Gzip64 encoder/decoder for GNU Emacs
+;;;
+;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
+;;; Copyright (C) 1996 Shuhei KOBAYASHI
+;;;
+;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
+;;; Created: 1995/10/25
+;;; Version:
+;;; $Id: mel-g.el,v 1.1 1996/03/11 17:01:45 shuhei Exp $
+;;; Keywords: MIME, base64, gzip
+;;;
+;;; This file is not part of MEL (MIME Encoding Library) yet.
+;;;
+;;; This program is free software; you can redistribute it and/or
+;;; modify it under the terms of the GNU General Public License as
+;;; published by the Free Software Foundation; either version 2, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with This program. If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
+
+;;; @ variables
+;;;
+
+(defvar gzip64-external-encoder '("sh" "-c" "gzip -c | mmencode")
+ "*list of gzip64 encoder program name and its arguments.")
+
+(defvar gzip64-external-decoder '("sh" "-c" "mmencode -u | gzip -dc")
+ "*list of gzip64 decoder program name and its arguments.")
+
+
+;;; @ external encoder
+;;;
+
+(cond ((boundp 'MULE)
+ (define-program-coding-system
+ nil (car gzip64-external-encoder) *noconv*)
+ (define-program-coding-system
+ nil (car gzip64-external-decoder) *noconv*)
+ )
+ ((boundp 'NEMACS)
+ (define-program-kanji-code
+ nil (car gzip64-external-encoder) 0)
+ (define-program-kanji-code
+ nil (car gzip64-external-decoder) 0)
+ ))
+
+(defun gzip64-external-encode-region (beg end)
+ (interactive "*r")
+ (save-excursion
+ (let (selective-display ; Disable ^M to nl translation.
+ mc-flag ; for Mule
+ kanji-flag) ; for NEmacs
+ (apply (function call-process-region)
+ beg end (car gzip64-external-encoder)
+ t t nil (cdr gzip64-external-encoder))
+ )))
+
+(defun gzip64-external-decode-region (beg end)
+ (interactive "*r")
+ (save-excursion
+ (let ((selective-display nil) ; Disable ^M to nl translation.
+ (mc-flag nil) ; for Mule
+ (kanji-flag nil)) ; for NEmacs
+ (apply (function call-process-region)
+ beg end (car gzip64-external-decoder)
+ t t nil (cdr gzip64-external-decoder))
+ )))
+
+(defalias 'gzip64-encode-region 'gzip64-external-encode-region)
+(defalias 'gzip64-decode-region 'gzip64-external-decode-region)
+
+
+;;; @ end
+;;;
+
+(provide 'mel-g)
+
+;;; mel-g.el ends here.
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1995/6/25
;;; Version:
-;;; $Id: mel-q.el,v 3.1 1996/01/09 18:28:53 morioka Exp $
+;;; $Id: mel-q.el,v 3.2 1996/03/11 14:29:31 morioka Exp $
;;; Keywords: MIME, Quoted-Printable
;;;
;;; This file is part of MEL (MIME Encoding Library).
;;;
;;; Code:
-
;;; @ constants
;;;
;;; @ Quoted-Printable (Q-encode) encoder/decoder
;;;
+(defun byte-to-hex-string (num)
+ (concat (char-to-string (elt quoted-printable-hex-chars (ash num -4)))
+ (char-to-string (elt quoted-printable-hex-chars (logand num 15)))
+ ))
+
(defun quoted-printable-quote-char (chr)
(concat "="
(char-to-string (elt quoted-printable-hex-chars (ash chr -4)))
;;;
(provide 'mel-q)
+
+;;; mel-q.el ends here
;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; modified by Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1995/6/25
;;; Version:
-;;; $Id: mel.el,v 3.3 1996/01/09 18:31:08 morioka Exp $
-;;; Keywords: MIME, Quoted-Printable
+;;; $Id: mel.el,v 3.5 1996/03/13 16:05:41 morioka Exp $
+;;; Keywords: MIME, Base64, Quoted-Printable, uuencode, gzip64
;;;
;;; This file is part of MEL (MIME Encoding Library).
;;;
(autoload 'uuencode-encode-region "mel-u" nil t)
(autoload 'uuencode-decode-region "mel-u" nil t)
+(autoload 'gzip64-encode-region "mel-g" nil t)
+(autoload 'gzip64-decode-region "mel-g" nil t)
+
(defvar mime-encoding-method-alist
'(("base64" . base64-encode-region)
("quoted-printable" . quoted-printable-encode-region)
("x-uue" . uuencode-encode-region)
+ ("x-gzip64" . gzip64-encode-region)
("7bit")
("8bit")
("binary")
'(("base64" . base64-decode-region)
("quoted-printable" . quoted-printable-decode-region)
("x-uue" . uuencode-decode-region)
+ ("x-gzip64" . gzip64-decode-region)
))
;;;
(provide 'mel)
+
+;;; mel.el ends here.