;;; Code:
-(eval-when-compile
- (defun-maybe md5-string (a))
- (defun-maybe dynamic-link (a))
- (defun-maybe dynamic-call (a b)))
+(provide 'md5-dl) ; beware of circular dependency.
+(eval-when-compile (require 'md5)) ; md5-dl-module.
-(defvar md5-dl-module
- (if (and (fboundp 'md5-string)
- (subrp (symbol-function 'md5-string)))
- nil
- (if (fboundp 'dynamic-link)
- (let ((path (expand-file-name "md5.so" exec-directory)))
- (and (file-exists-p path)
- path)))))
-
-(defvar md5-dl-handle
- (and (stringp md5-dl-module)
- (file-exists-p md5-dl-module)
- (dynamic-link md5-dl-module)))
+;;; This file is loaded (from "md5.el") only when md5-dl-module is exists.
+(defvar md5-dl-handle (dynamic-link md5-dl-module))
;;; md5-dl-module provides `md5-string'.
(dynamic-call "emacs_md5_init" md5-dl-handle)
(defun md5-region (beg end)
- (interactive "r")
(md5-string (buffer-substring-no-properties beg end)))
-;;; Note that XEmacs built-in version takes two more args: CODING and NOERROR.
-;;;###autoload
+;;; Note that v21 `md5' takes two more args: CODING and NOERROR.
(defun md5 (object &optional beg end)
"Return the MD5 (a secure message digest algorithm) of an object.
OBJECT is either a string or a buffer.