sha1-el.el if the running emacs has builtin message digest functions.
* md5-dl.el, sha1-dl.el: Don't bind `dynamic-link' and `dynamic-call'.
* md5.el (md5-dl-module): Moved from md5-dl.el.
* sha1.el: Don't bind `sha1-string'.
sasl sasl-cram sasl-digest
smtp qmtp smtpmail))
-(setq flim-version-specific-modules '(mailcap))
-
(setq hmac-modules '(hex-util
- hmac-def
- md5 md5-el md5-dl
- sha1 sha1-el sha1-dl
+ hmac-def md5 sha1
hmac-md5 hmac-sha1))
-(setq flim-modules (nconc hmac-modules flim-modules))
+(setq flim-version-specific-modules '(mailcap))
(if (and (fboundp 'base64-encode-string)
(subrp (symbol-function 'base64-encode-string)))
(unless-broken ccl-usable
(setq flim-modules (cons 'mel-b-ccl (cons 'mel-q-ccl flim-modules))))
+(if (and (fboundp 'md5)
+ (subrp (symbol-function 'md5)))
+ nil
+ (if (fboundp 'dynamic-link)
+ (setq hmac-modules (cons 'md5-dl hmac-modules))
+ (setq hmac-modules (cons 'md5-el hmac-modules))))
+
+(if (fboundp 'dynamic-link)
+ (setq hmac-modules (cons 'sha1-dl hmac-modules))
+ (setq hmac-modules (cons 'sha1-el hmac-modules)))
+
+(setq flim-modules (nconc hmac-modules flim-modules))
+
;;; FLIM-ELS ends here
;;; Code:
-(eval-when-compile
- (defun-maybe md5-string (a))
- (defun-maybe dynamic-link (a))
- (defun-maybe dynamic-call (a b)))
-
-(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)))))
+(provide 'md5-dl)
+(eval-when-compile (require 'md5)) ; md5-dl-module.
(defvar md5-dl-handle
(and (stringp md5-dl-module)
(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.
(set-buffer object)
(md5-region (or beg (point-min)) (or end (point-max))))))
-(provide 'md5-dl)
-
-;;; md5-dl.el ends here.
+;;; md5-dl.el ends here
;;; Code:
+(defvar md5-dl-module
+ (if (and (fboundp 'md5)
+ (subrp (symbol-function 'md5)))
+ nil
+ (if (fboundp 'dynamic-link)
+ (let ((path (expand-file-name "md5.so" exec-directory)))
+ (and (file-exists-p path)
+ path)))))
+
(cond
- ((and (fboundp 'md5)
- (subrp (symbol-function 'md5)))
- ;; recent XEmacs has `md5' as a built-in function.
- ;; (and 'md5 is already provided.)
- )
- ((and (fboundp 'dynamic-link)
- (file-exists-p (expand-file-name "md5.so" exec-directory)))
+ (md5-dl-module
;; Emacs with DL patch.
(require 'md5-dl))
(t
;;; Code:
(provide 'sha1-dl) ; beware of circular dependency.
-(eval-when-compile
- (require 'sha1) ; sha1-dl-module.
- (defun-maybe dynamic-link (a))
- (defun-maybe dynamic-call (a b)))
+(eval-when-compile (require 'sha1)) ; sha1-dl-module.
(defvar sha1-dl-handle
(and (stringp sha1-dl-module)
(require 'hex-util)
-(eval-when-compile
- (defun-maybe sha1-string (a)))
-
(defvar sha1-dl-module
(if (and (fboundp 'sha1-string)
(subrp (symbol-function 'sha1-string)))