X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=sha1.el;h=a9e5e9db5cfb8bc6cbc0150c83fd9c4cd65f215c;hb=ff41f7cd1ae5e524dca38ed33dff85f5e71c04e1;hp=0e3b7ac5afdf3b1f97e861a4c2d8745ae4e4e32e;hpb=85bf0cd47a81947bf45ca834d071e902632109f3;p=elisp%2Fflim.git diff --git a/sha1.el b/sha1.el index 0e3b7ac..a9e5e9d 100644 --- a/sha1.el +++ b/sha1.el @@ -3,8 +3,6 @@ ;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. ;; Author: Shuhei KOBAYASHI -;; Kenichi OKADA -;; Maintainer: Kenichi OKADA ;; Keywords: SHA1, FIPS 180-1 ;; This file is part of FLIM (Faithful Library about Internet Message). @@ -40,39 +38,27 @@ ;;; Code: -(require 'hex-util) - -(eval-when-compile - (or (fboundp 'sha1-string) - (defun sha1-string (a)))) - (defvar sha1-dl-module - (if (and (fboundp 'sha1-string) - (subrp (symbol-function 'sha1-string))) - nil - (if (fboundp 'dynamic-link) - (let ((path (expand-file-name "sha1.so" exec-directory))) - (and (file-exists-p path) - path))))) + (cond + ((and (fboundp 'sha1) + (subrp (symbol-function 'sha1))) + nil) + ((fboundp 'dynamic-link) + ;; Should we take care of `dynamic-link-path'? + (let ((path (expand-file-name "sha1.so" exec-directory))) + (if (file-exists-p path) + path + nil))) + (t + nil))) (cond - (sha1-dl-module - ;; Emacs with DL patch. + ((and (stringp sha1-dl-module) + (file-exists-p sha1-dl-module)) (require 'sha1-dl)) (t (require 'sha1-el))) -;; compatibility for another sha1.el by Keiichi Suzuki. -(defun sha1-encode (string) - (decode-hex-string - (sha1-string string))) -(defun sha1-encode-binary (string) - (decode-hex-string - (sha1-string string))) - -(make-obsolete 'sha1-encode "It's old API.") -(make-obsolete 'sha1-encode-binary "It's old API.") - (provide 'sha1) ;;; sha1.el ends here