X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fflim.git;a=blobdiff_plain;f=md5-dl.el;h=7006d43ce527ae66cae395cee3173dd6342beac5;hp=72078c5bfa8649e99dda2820da8080f796c9691d;hb=HEAD;hpb=cfbeb2aa70dd2506c32ce4a2e1d232731a93701d diff --git a/md5-dl.el b/md5-dl.el index 72078c5..7006d43 100644 --- a/md5-dl.el +++ b/md5-dl.el @@ -1,6 +1,6 @@ ;;; md5-dl.el --- MD5 Message Digest Algorithm using DL module. -;; Copyright (C) 1999 Shuhei KOBAYASHI +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. ;; Author: Shuhei KOBAYASHI ;; Keywords: MD5, RFC 1321 @@ -19,41 +19,26 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; 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. @@ -67,4 +52,4 @@ hash of a portion of OBJECT." (provide 'md5-dl) -;;; md5-dl.el ends here. +;;; md5-dl.el ends here