-;; mel-dl
-(defvar base64-dl-module
- (and (fboundp 'dynamic-link)
- (let ((path (expand-file-name "base64.so" exec-directory)))
- (and (file-exists-p path)
- path))))
-
-(when base64-dl-module
- (autoload 'base64-dl-encode-string "mel-dl"
- "Encode STRING to base64, and return the result.")
- (autoload 'base64-dl-decode-string "mel-dl"
- "Decode STRING which is encoded in base64, and return the result.")
- (autoload 'base64-dl-encode-region "mel-dl"
- "Encode current region by base64." t)
- (autoload 'base64-dl-decode-region "mel-dl"
- "Decode current region by base64." t))
-
-;; mel-b
-(autoload 'base64-internal-encode-string "mel-b"
- "Encode STRING to base64, and return the result.")
-(autoload 'base64-internal-decode-string "mel-b"
- "Decode STRING which is encoded in base64, and return the result.")
-(autoload 'base64-internal-encode-region "mel-b"
- "Encode current region by base64." t)
-(autoload 'base64-internal-decode-region "mel-b"
- "Decode current region by base64." t)
-(autoload 'base64-internal-insert-encoded-file "mel-b"
- "Encode contents of file to base64, and insert the result." t)
-(autoload 'base64-internal-write-decoded-region "mel-b"
- "Decode and write current region encoded by base64 into FILENAME." t)
-
-(autoload 'base64-external-encode-string "mel-b"
- "Encode STRING to base64, and return the result.")
-(autoload 'base64-external-decode-string "mel-b"
- "Decode STRING which is encoded in base64, and return the result.")
-(autoload 'base64-external-encode-region "mel-b"
- "Encode current region by base64." t)
-(autoload 'base64-external-decode-region "mel-b"
- "Decode current region by base64." t)
-(autoload 'base64-external-insert-encoded-file "mel-b"
- "Encode contents of file to base64, and insert the result." t)
-(autoload 'base64-external-write-decoded-region "mel-b"
- "Decode and write current region encoded by base64 into FILENAME." t)
-
-;; for encoded-word
-(autoload 'base64-internal-encoded-length "mel-b")
-
-;; mel-q
-(autoload 'quoted-printable-internal-encode-string "mel-q"
- "Encode STRING to quoted-printable, and return the result.")
-(autoload 'quoted-printable-internal-decode-string "mel-q"
- "Decode STRING which is encoded in quoted-printable, and return the result.")
-(autoload 'quoted-printable-internal-encode-region "mel-q"
- "Encode current region by Quoted-Printable." t)
-(autoload 'quoted-printable-internal-decode-region "mel-q"
- "Decode current region by Quoted-Printable." t)
-
-(autoload 'quoted-printable-external-encode-string "mel-q"
- "Encode STRING to quoted-printable, and return the result.")
-(autoload 'quoted-printable-external-decode-string "mel-q"
- "Decode STRING which is encoded in quoted-printable, and return the result.")
-(autoload 'quoted-printable-external-encode-region "mel-q"
- "Encode current region by Quoted-Printable." t)
-(autoload 'quoted-printable-external-decode-region "mel-q"
- "Decode current region by Quoted-Printable." t)
-
-(autoload 'quoted-printable-external-insert-encoded-file "mel-q"
- "Encode contents of file to quoted-printable, and insert the result." t)
-(autoload 'quoted-printable-external-write-decoded-region "mel-q"
- "Decode and write current region encoded by quoted-printable into FILENAME."
- t)
-
-;; for encoded-word
-(autoload 'q-encoding-internal-encode-string "mel-q"
- "Encode STRING to Q-encoding of encoded-word, and return the result.")
-(autoload 'q-encoding-internal-decode-string "mel-q"
- "Decode STRING which is encoded in Q-encoding and return the result.")
-(autoload 'q-encoding-internal-encoded-length "mel-q")
-
-;; mel-u
-(autoload 'uuencode-external-encode-region "mel-u"
- "Encode current region by unofficial uuencode format." t)
-(autoload 'uuencode-external-decode-region "mel-u"
- "Decode current region by unofficial uuencode format." t)
-(autoload 'uuencode-external-insert-encoded-file "mel-u"
- "Insert file encoded by unofficial uuencode format." t)
-(autoload 'uuencode-external-write-decoded-region "mel-u"
- "Decode and write current region encoded by uuencode into FILENAME." t)
-
-;; mel-g
-(autoload 'gzip64-external-encode-region "mel-g"
- "Encode current region by unofficial x-gzip64 format." t)
-(autoload 'gzip64-external-decode-region "mel-g"
- "Decode current region by unofficial x-gzip64 format." t)
-(autoload 'gzip64-external-insert-encoded-file "mel-g"
- "Insert file encoded by unofficial gzip64 format." t)
-(autoload 'gzip64-external-write-decoded-region "mel-g"
- "Decode and write current region encoded by gzip64 into FILENAME." t)
-
-;; mel-ccl
-(when (fboundp 'make-ccl-coding-system)
- (unless (and (boundp 'ccl-encoder-eof-block-is-broken)
- ccl-encoder-eof-block-is-broken)
- (autoload 'base64-ccl-encode-string "mel-ccl"
- "Encode STRING with base64 encoding.")
- (autoload 'base64-ccl-encode-region "mel-ccl"
- "Encode region from START to END with base64 encoding." t)
- (autoload 'base64-ccl-insert-encoded-file "mel-ccl"
- "Encode contents of file FILENAME to base64, and insert the result." t))
-
- (autoload 'base64-ccl-decode-string "mel-ccl"
- "Decode base64 encoded STRING")
- (autoload 'base64-ccl-decode-region "mel-ccl"
- "Decode base64 encoded STRING" t)
- (autoload 'base64-ccl-write-decoded-region "mel-ccl"
- "Decode the region from START to END and write out to FILENAME." t)
-
- (unless (and (boundp 'ccl-encoder-eof-block-is-broken)
- ccl-encoder-eof-block-is-broken)
- (autoload 'quoted-printable-ccl-encode-string "mel-ccl"
- "Encode STRING with quoted-printable encoding.")
- (autoload 'quoted-printable-ccl-encode-region "mel-ccl"
- "Encode the region from START to END with quoted-printable
- encoding." t)
- (autoload 'quoted-printable-ccl-insert-encoded-file "mel-ccl"
- "Encode contents of the file named as FILENAME, and insert it." t))
-
- (autoload 'quoted-printable-ccl-decode-string "mel-ccl"
- "Decode quoted-printable encoded STRING.")
- (autoload 'quoted-printable-ccl-decode-region "mel-ccl"
- "Decode the region from START to END with quoted-printable
- encoding.")
- (autoload 'quoted-printable-ccl-write-decoded-region "mel-ccl"
- "Decode quoted-printable encoded current region and write out to FILENAME." t)
-
- (autoload 'q-encoding-ccl-encode-string "mel-ccl"
- "Encode STRING to Q-encoding of encoded-word, and return the result.
- MODE allows `text', `comment', `phrase' or nil. Default value is
- `phrase'.")
- (autoload 'q-encoding-ccl-decode-string "mel-ccl"
- "Decode Q encoded STRING and return the result.")
-)
-
-;;; @ entrance functions.
-;;;
-
-(cond
- ((fboundp 'base64-dl-encode-string)
- (defalias 'base64-encode-string 'base64-dl-encode-string))
- ((fboundp 'base64-ccl-encode-string)
- (defalias 'base64-encode-string 'base64-ccl-encode-string))
- (t
- (defalias 'base64-encode-string 'base64-internal-encode-string)))
-
-(defun base64-internal-external-decode-string (string)
- "Decode STRING which is encoded in base64, and return the result.
-This function calls internal base64 decoder if size of STRING is
-smaller than `base64-internal-decoding-limit', otherwise it calls
-external base64 decoder specified by `base64-external-decoder'. In
-this case, you must install the program (maybe mmencode included in
-metamail or XEmacs package)."
- (interactive "r")
- (if (and base64-internal-decoding-limit
- (> (length string) base64-internal-decoding-limit))
- (base64-external-decode-string string)
- (base64-internal-decode-string string)))
-
-(cond
- ((fboundp 'base64-dl-decode-string)
- (defalias 'base64-decode-string 'base64-dl-decode-string))
- ((fboundp 'base64-ccl-decode-string)
- (defalias 'base64-decode-string 'base64-ccl-decode-string))
- (t
- (defalias 'base64-decode-string 'base64-internal-external-decode-string)))
-
-(defun base64-internal-external-encode-region (start end)
- "Encode current region by base64.
-START and END are buffer positions.
-This function calls internal base64 encoder if size of region is
-smaller than `base64-internal-encoding-limit', otherwise it calls
-external base64 encoder specified by `base64-external-encoder'. In
-this case, you must install the program (maybe mmencode included in
-metamail or XEmacs package)."
- (interactive "r")
- (if (and base64-internal-encoding-limit
- (> (- end start) base64-internal-encoding-limit))
- (base64-external-encode-region start end)
- (base64-internal-encode-region start end)))
-
-(cond
- ((fboundp 'base64-dl-encode-region)
- (defalias 'base64-encode-region 'base64-dl-encode-region)) ; no fold
- ((fboundp 'base64-ccl-encode-region)
- (defalias 'base64-encode-region 'base64-ccl-encode-region)) ; no fold
- (t
- (defalias 'base64-encode-region 'base64-internal-external-encode-region))) ; LF fold
-
-(defun base64-internal-external-decode-region (start end)
- "Decode current region by base64.
-START and END are buffer positions.
-This function calls internal base64 decoder if size of region is
-smaller than `base64-internal-decoding-limit', otherwise it calls
-external base64 decoder specified by `base64-external-decoder'. In
-this case, you must install the program (maybe mmencode included in
-metamail or XEmacs package)."
- (interactive "r")
- (if (and base64-internal-decoding-limit
- (> (- end start) base64-internal-decoding-limit))
- (base64-external-decode-region start end)
- (base64-internal-decode-region start end)))
-
-(cond
- ((fboundp 'base64-dl-decode-region)
- (defalias 'base64-decode-region 'base64-dl-decode-region))
- ((fboundp 'base64-ccl-decode-region)
- (defalias 'base64-decode-region 'base64-ccl-decode-region))
- (t
- (defalias 'base64-decode-region 'base64-internal-external-decode-region)))
-
-(defun base64-internal-external-insert-encoded-file (filename)
- "Encode contents of file FILENAME to base64, and insert the result.