TESTS = check-scm
-install-data-hook uninstall-data-hook:
+install-data-hook:
+ echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
+ | $(MIT_SCHEME_EXE) --batch-mode
+
+uninstall-hook:
echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
| $(MIT_SCHEME_EXE) --batch-mode
-The blowfish wrapper.
+The BLOWFISH option.
This is a drop-in replacement for the bfish microcode module and
runtime/blowfish.scm. It is not part of the core build and can be
|#
-;;;; Test the Blowfish wrapper.
+;;;; Test the BLOWFISH option.
(if (not (blowfish-available?))
- (warn "blowfish wrapper not found")
+ (error "BLOWFISH plugin not found")
(let ((sample "Some text to encrypt and decrypt."))
(call-with-binary-output-file "test"
(lambda (output)
(parent ())
;; You'll have to import these from (global-definitions blowfish/).
;; They are currently bound in () by exports from (runtime blowfish).
- #;(export #f
+ (export (blowfish global)
blowfish-available?
blowfish-cbc
blowfish-cfb64
blowfish-set-key
compute-blowfish-init-vector
read-blowfish-file-header
- write-blowfish-file-header))
\ No newline at end of file
+ write-blowfish-file-header))
+
+(define-package (blowfish global)
+ ;; Just to get cref to analyze whether all exports are defined.
+ )
\ No newline at end of file
|#
-;;;; Blowfish wrapper
+;;;; The BLOWFISH option.
;;; package: (blowfish)
(declare (usual-integrations))
operator)))
(define (blowfish-available?)
- (let ((path (ignore-errors (lambda ()
- (system-library-pathname "blowfish-shim.so")))))
- (and (pathname? path)
- (file-loadable? path))))
+ (plugin-available? "blowfish"))
(define (blowfish-encrypt-port input output key init-vector encrypt?)
;; Assumes that INPUT is in blocking mode.
#| -*-Scheme-*- |#
-;;;; Test the Blowfish wrapper.
+;;;; Test the BLOWFISH option.
(load "make")
(with-system-library-directories
#| -*-Scheme-*- |#
-;;;; Compile the Blowfish wrapper.
+;;;; Compile the BLOWFISH option.
(load-option 'CREF)
(load-option 'FFI)
TESTS = check-scm
-install-data-hook uninstall-data-hook:
+install-data-hook:
+ echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
+ | $(MIT_SCHEME_EXE) --batch-mode
+
+uninstall-hook:
echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
| $(MIT_SCHEME_EXE) --batch-mode
-The GDBM wrapper.
+The GDBM option.
This is a drop-in replacement for the gdbm microcode module and
runtime/gdbm.scm. It is not part of the core build and can be built
#| -*-Scheme-*- |#
-;;;; Test the GDBM wrapper.
+;;;; Test the GDBM option.
(load "make")
(with-system-library-directories
#| -*-Scheme-*- |#
-;;;; Compile the GDBM wrapper.
+;;;; Compile the GDBM option.
(load-option 'CREF)
(load-option 'FFI)
|#
-;;;; Test the GDBM wrapper.
+;;;; Test the GDBM option.
(if (not (gdbm-available?))
- (warn "gdbm wrapper not found")
+ (error "GDBM plugin not found")
(let ((filename.db "gdbm-check.db"))
(ignore-errors (lambda () (delete-file filename.db)))
(let ((dbf (gdbm-open filename.db 0 GDBM_WRCREAT #o660)))
(initialization (initialize-package!))
;; You'll have to import these from (global-definitions gdbm/).
;; They are currently bound in () by exports from (runtime gdbm).
- #;(export #f
+ (export (gdbm global)
gdbm-available?
gdbm-close
gdbm-delete
gdbm-version
gdbm_cachesize
gdbm_fast
- gdbm_fastmode
+ ;;gdbm_fastmode obsolete
gdbm_insert
gdbm_newdb
gdbm_reader
gdbm_replace
gdbm_wrcreat
- gdbm_writer))
\ No newline at end of file
+ gdbm_writer))
+
+(define-package (gdbm global)
+ ;; Just to get cref to analyze whether all exports are defined.
+ )
\ No newline at end of file
|#
-;;;; GDBM wrapper
+;;;; The GDBM option.
;;; package: (gdbm)
(declare (usual-integrations))
(C-include "gdbm")
(define (gdbm-available?)
- (let ((path (ignore-errors (lambda ()
- (system-library-pathname "gdbm-shim.so")))))
- (and (pathname? path)
- (file-loadable? path))))
+ (plugin-available? "gdbm"))
;; Parameters to gdbm_open for READERS, WRITERS, and WRITERS who can
;; create the database.
TESTS = check-scm
-install-data-hook uninstall-data-hook:
+install-data-hook:
+ echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
+ | $(MIT_SCHEME_EXE) --batch-mode
+
+uninstall-hook:
echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
| $(MIT_SCHEME_EXE) --batch-mode
-The mcrypt wrapper.
+The MCRYPT option.
This is a drop-in replacement for the mcrypt microcode module and the
mcrypt-* procedures in runtime/crypto.scm. It is not part of the core
#| -*-Scheme-*- |#
-;;;; Test the mcrypt wrapper.
+;;;; Test the MCRYPT option.
(load "make")
(with-system-library-directories
#| -*-Scheme-*- |#
-;;;; Compile the mcrypt wrapper.
+;;;; Compile the MCRYPT option.
(load-option 'CREF)
(load-option 'FFI)
|#
-;;;; Test the mcrypt wrapper.
+;;;; Test the MCRYPT option.
(define (random-string length)
(list->string (make-initialized-list length
(ascii->char (random 256))))))
(if (not (mcrypt-available?))
- (warn "mcrypt plugin not found")
+ (error "MCRYPT plugin not found")
(begin
(if (not (member "tripledes" (mcrypt-algorithm-names)))
(error "No tripledes."))
(global-definitions runtime/)
-(define-package (mcrypt global)
- ;; Just to get cref to analyze whether all exports are defined.
- )
-
(define-package (mcrypt)
(files "mcrypt")
(parent ())
mcrypt-mode-names
mcrypt-open-module
mcrypt-self-test
- mcrypt-supported-key-sizes))
\ No newline at end of file
+ mcrypt-supported-key-sizes))
+
+(define-package (mcrypt global)
+ ;; Just to get cref to analyze whether all exports are defined.
+ )
\ No newline at end of file
|#
-;;;; mcrypt wrapper
+;;;; The MCRYPT option.
;;; package: (mcrypt)
(declare (usual-integrations))
;;; multithreaded application... with dynamic module loading support".
;;; It is assumed this is the case for MIT Scheme.
;;;
-;;; This wrapper uses an OS mutex to implement lock and unlock
+;;; This plugin uses an OS mutex to implement lock and unlock
;;; functions passed to mcrypt_mutex_register, and locks and unlocks
;;; it during mcrypt_module_open. The Scheme mcrypt-context object,
;;; representing an MCRYPT "thread", should be used by one Scheme
;;; mcrypt_list_algorithms and
;;; mcrypt_list_modes.
;;;
-;;; This wrapper ensures that MCRYPTs and size/name lists returned by
+;;; This plugin ensures that MCRYPTs and size/name lists returned by
;;; the library do not "leak" by putting cleanup thunks on a weak
;;; alist that is periodically scanned for objects that were GCed and
;;; not freed.
(define mcrypt-mode-names-vector)
(define (mcrypt-available?)
- (let ((path (ignore-errors (lambda ()
- (system-library-pathname "mcrypt-shim.so")))))
- (and (pathname? path)
- (file-loadable? path))))
+ (plugin-available? "mcrypt"))
(define (init!)
(if (not mcrypt-initialized?)
TESTS = check-scm
-install-data-hook uninstall-data-hook:
+install-data-hook:
+ echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
+ | $(MIT_SCHEME_EXE) --batch-mode
+
+uninstall-hook:
echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
| $(MIT_SCHEME_EXE) --batch-mode
-The md5 wrapper.
+The MD5 option.
This is a drop-in replacement for the md5 microcode module and the
md5-* procedures in runtime/crypto.scm. It is not part of the core
#| -*-Scheme-*- |#
-;;;; Test the MD5 wrapper.
+;;;; Test the MD5 option.
(load "make")
(with-system-library-directories
#| -*-Scheme-*- |#
-;;;; Compile the MD5 wrapper.
+;;;; Compile the MD5 option.
(load-option 'CREF)
(load-option 'FFI)
|#
-;;;; Test the MD5 wrapper.
+;;;; Test the MD5 option.
(if (not (md5-available?))
- (warn "md5 wrapper not found")
+ (error "MD5 plugin not found")
(let ((sample "Some text to hash."))
(let ((hash (md5-sum->hexadecimal (md5-string sample))))
(if (not (string=? hash "c8e89c4cbf3abf9aa758d691cbe4b784"))
(parent ())
;; You'll have to import these from (global-definitions md5/). They
;; are currently bound in () by exports from (runtime crypto).
- #;(export #f
+ (export (md5 global)
md5-available?
md5-file
md5-string
md5-substring
md5-sum->hexadecimal
- md5-sum->number))
\ No newline at end of file
+ md5-sum->number))
+
+(define-package (md5 global)
+ ;; Just to get cref to analyze whether all exports are defined.
+ )
\ No newline at end of file
|#
-;;;; MD5 wrapper
+;;;; The MD5 option.
;;; package: (md5)
(declare (usual-integrations))
\f
(C-include "md5")
-(define-integrable (mhash-available?) #f)
+(define (mhash-available?)
+ (plugin-available? "mhash"))
(define (%md5-init)
;; Create and return an MD5 digest context.
(%md5-available?)))
(define (%md5-available?)
- (let ((path (ignore-errors (lambda ()
- (system-library-pathname "md5-shim.so")))))
- (and (pathname? path)
- (file-loadable? path))))
+ (plugin-available? "md5"))
(define (md5-file filename)
(cond ((mhash-available?)
TESTS = check-scm
-install-data-hook uninstall-data-hook:
+install-data-hook:
+ echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
+ | $(MIT_SCHEME_EXE) --batch-mode
+
+uninstall-hook:
echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
| $(MIT_SCHEME_EXE) --batch-mode
-The mhash wrapper.
+The MHASH option.
This is a drop-in replacement for the mhash microcode module and the
mhash-* procedures in runtime/crypto.scm. It is not part of the core
#| -*-Scheme-*- |#
-;;;; Test the mhash wrapper.
+;;;; Test the MHASH option.
(load "make")
(with-system-library-directories
#| -*-Scheme-*- |#
-;;;; Compile the mhash wrapper.
+;;;; Compile the MHASH option.
(load-option 'CREF)
(load-option 'FFI)
|#
-;;;; Test the mhash wrapper.
+;;;; Test the MHASH option.
(if (not (mhash-available?))
- (warn "mhash wrapper not found")
+ (error "MHASH plugin not found")
(let ((sample "Some text to hash."))
(let ((hash (mhash-sum->hexadecimal (mhash-string 'MD5 sample))))
(if (not (string=? hash "c8e89c4cbf3abf9aa758d691cbe4b784"))
(initialization (initialize-package!))
;; You'll have to import these from (global-definitions mhash/).
;; They are currently bound in () by exports from (runtime crypto).
- #;(export #f
+ (export (mhash global)
make-mhash-keygen-type
mhash-available?
mhash-context?
mhash-sum->hexadecimal
mhash-sum->number
mhash-type-names
- mhash-update))
\ No newline at end of file
+ mhash-update))
+
+(define-package (mhash global)
+ ;; Just to get cref to analyze whether all exports are defined.
+ )
\ No newline at end of file
|#
-;;;; mhash wrapper
+;;;; The MHASH option.
;;; package: (mhash)
(declare (usual-integrations))
v)))))
\f
(define (mhash-available?)
- (let ((path (ignore-errors (lambda ()
- (system-library-pathname "mhash-shim.so")))))
- (and (pathname? path)
- (file-loadable? path)
- (begin
- (if (not mhash-initialized?)
- (begin
- (set! mhash-algorithm-names
- (make-names-vector
- (lambda () (C-call "mhash_count"))
- (lambda (hashid)
- (let* ((alien (make-alien-to-free
- '(* char)
- (lambda (alien)
- (C-call "mhash_get_hash_name"
- alien hashid))))
- (str (c-peek-cstring alien)))
- (free alien)
- str))))
- (set! mhash-keygen-names
- (make-names-vector
- (lambda () (C-call "mhash_keygen_count"))
- (lambda (keygenid)
- (let* ((alien (make-alien-to-free
- '(* char)
- (lambda (alien)
- (C-call "mhash_get_keygen_name"
- alien keygenid))))
- (str (c-peek-cstring alien)))
- (free alien)
- str))))
- (set! mhash-initialized? #t)))
- #t))))
+ (and (plugin-available? "mhash")
+ (begin
+ (initialize-mhash-variables!)
+ #t)))
+
+(define (initialize-mhash-variables!)
+ (if (not mhash-initialized?)
+ (begin
+ (set! mhash-algorithm-names
+ (make-names-vector
+ (lambda () (C-call "mhash_count"))
+ (lambda (hashid)
+ (let* ((alien (make-alien-to-free
+ '(* char)
+ (lambda (alien)
+ (C-call "mhash_get_hash_name"
+ alien hashid))))
+ (str (c-peek-cstring alien)))
+ (free alien)
+ str))))
+ (set! mhash-keygen-names
+ (make-names-vector
+ (lambda () (C-call "mhash_keygen_count"))
+ (lambda (keygenid)
+ (let* ((alien (make-alien-to-free
+ '(* char)
+ (lambda (alien)
+ (C-call "mhash_get_keygen_name"
+ alien keygenid))))
+ (str (c-peek-cstring alien)))
+ (free alien)
+ str))))
+ (set! mhash-initialized? #t))))
(define (reset-mhash-variables!)
(set! mhash-initialized? #f)