X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fflim.git;a=blobdiff_plain;f=md5.el;h=cde5f852fa99cda76aec9e6080485ccea281681d;hp=55c658b569e325d83f7bd471b84d5ef4b51dd0ea;hb=refs%2Fheads%2Fflim-1_14-rfc2231-encoder;hpb=cfbeb2aa70dd2506c32ce4a2e1d232731a93701d diff --git a/md5.el b/md5.el index 55c658b..cde5f85 100644 --- a/md5.el +++ b/md5.el @@ -1,6 +1,6 @@ ;;; md5.el --- MD5 Message Digest Algorithm. -;; Copyright (C) 1999 Shuhei KOBAYASHI +;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. ;; Author: Shuhei KOBAYASHI ;; Keywords: MD5, RFC 1321 @@ -19,12 +19,12 @@ ;; 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: -;; Examples from RFC 1321. +;; Test cases from RFC 1321. ;; ;; (md5 "") ;; => d41d8cd98f00b204e9800998ecf8427e @@ -49,19 +49,31 @@ ;;; Code: +(defvar md5-dl-module + (cond + ((and (fboundp 'md5) + (subrp (symbol-function 'md5))) + nil) + ((fboundp 'dynamic-link) + ;; Should we take care of `dynamic-link-path'? + (let ((path (expand-file-name "md5.so" exec-directory))) + (if (file-exists-p path) + path + nil))) + (t + nil))) + (cond ((and (fboundp 'md5) (subrp (symbol-function 'md5))) - ;; recent XEmacs has `md5' as a built-in function. - ;; (and 'md5 is already provided.) + ;; do nothing. ) - ((and (fboundp 'dynamic-link) - (file-exists-p (expand-file-name "md5.so" exec-directory))) - ;; Emacs with DL patch. + ((and (stringp md5-dl-module) + (file-exists-p md5-dl-module)) (require 'md5-dl)) (t (require 'md5-el))) (provide 'md5) -;;; md5.el ends here. +;;; md5.el ends here