Restore definitions lost in the merge.
authorMatt Birkholz <matt@birchwood-abbey.net>
Fri, 22 Jun 2018 22:37:48 +0000 (15:37 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 22 Jun 2018 22:37:48 +0000 (15:37 -0700)
Include blowfish-test.scm but do not use it.  It needs define-test.

src/blowfish/Makefile.am
src/blowfish/blowfish-check.scm [new file with mode: 0644]
src/blowfish/blowfish-check.sh
src/blowfish/blowfish.pkg
src/blowfish/blowfish.scm
src/edwin/decls.scm
src/edwin/sources.sh
src/x11-screen/x11-screen.pkg
src/x11/x11.pkg

index 693f920a294925ca54531db5579a66f1b0c30262..4b998498ae69778cb0461310d8a5ffa4f7192366 100644 (file)
@@ -92,7 +92,7 @@ ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
 TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
 
 EXTRA_DIST += $(all_sources) $(cdecls) compile.sh compile.scm blowfish.pkg
-EXTRA_DIST += blowfish-test.scm blowfish-check.sh
+EXTRA_DIST += blowfish-test.scm blowfish-check.scm blowfish-check.sh
 EXTRA_DIST += make.scm optiondb.scm tags-fix.sh debian
 
 install-data-hook:
diff --git a/src/blowfish/blowfish-check.scm b/src/blowfish/blowfish-check.scm
new file mode 100644 (file)
index 0000000..4737722
--- /dev/null
@@ -0,0 +1,46 @@
+#| -*-Scheme-*-
+
+Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
+    2017, 2018 Massachusetts Institute of Technology
+
+This file is part of MIT/GNU Scheme.
+
+MIT/GNU Scheme is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+MIT/GNU Scheme is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with MIT/GNU Scheme; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+USA.
+
+|#
+
+;;;; Test the BLOWFISH option.
+
+(let ((sample (string->utf8 "Some text to encrypt and decrypt.")))
+  (call-with-binary-output-file "test"
+    (lambda (output)
+      (blowfish-encrypt-port (open-input-bytevector sample)
+                            output
+                            (string->utf8 "secret")
+                            (write-blowfish-file-header output)
+                            #t)))
+  (let ((read-back
+        (call-with-binary-input-file "test"
+          (lambda (input)
+            (call-with-output-bytevector
+             (lambda (output)
+               (blowfish-encrypt-port input output (string->utf8 "secret")
+                                      (read-blowfish-file-header input)
+                                      #f)))))))
+    (if (not (bytevector=? sample read-back))
+       (error "sample did not decrypt correctly"))))
\ No newline at end of file
index 9d40981ceb1a6f7dd2aa9e8d2f50e531f4d3b65d..edf275a274f43fab04741b95afc2085af5bbdd58 100755 (executable)
@@ -5,5 +5,5 @@
 set -e
 ${MIT_SCHEME_EXE} --prepend-library . <<\EOF
 (load-option 'BLOWFISH)
-(load "blowfish-test" (->environment '(blowfish)))
+(load "blowfish-check" (->environment '(blowfish)))
 EOF
index c204202330ab8a5d068cdf3fc2d084be5197bc44..23879068afcb4b0538bb9d468824599739c5614d 100644 (file)
@@ -30,6 +30,8 @@ USA.
   (files "blowfish")
   (parent ())
   (export ()
+         import-blowfish)
+  (export (blowfish global)
          blowfish-cbc
          blowfish-cfb64
          blowfish-ecb
@@ -39,4 +41,8 @@ USA.
          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
index 74480fe8aad4bf4dd3023334ff6b2bd5eb88dfaf..55dcc3b4af8e1f53b4444cde85d00430a6019ffd 100644 (file)
@@ -29,6 +29,23 @@ USA.
 
 (declare (usual-integrations))
 \f
+(define (import-blowfish)
+  (let ((target-environment (nearest-repl/environment))
+       (source-environment (->environment '(blowfish))))
+    (for-each (lambda (name)
+               (link-variables target-environment name
+                               source-environment name))
+             '(blowfish-cbc
+               blowfish-cfb64
+               blowfish-ecb
+               blowfish-encrypt-port
+               blowfish-file?
+               blowfish-ofb64
+               blowfish-set-key
+               compute-blowfish-init-vector
+               read-blowfish-file-header
+               write-blowfish-file-header))))
+
 (C-include "blowfish")
 
 (define (blowfish-set-key bytes)
index 2b5e725945ed586220d50e7faec72c889c5bbb1b..6f9183c60aca17e40d54239c90ac1648d4517d1b 100644 (file)
@@ -97,7 +97,8 @@ USA.
              "termcap"
              "utils"
              "win32"
-             "xform"))
+             "xform"
+             "xterm"))
   (sf-edwin "tterm" "termcap")
   (let ((includes '("struct" "comman" "modes" "buffer" "edtstr")))
     (let loop ((files includes) (includes '()))
index 1c04f18057db92f537b0f096d59b0ed43be49163..20f982b6a0c459de814d6e5949e84a93747ff783 100755 (executable)
@@ -54,7 +54,7 @@ ${MIT_SCHEME_EXE} --batch-mode -- $1 <<\EOF
       "txtprp" "undo" "unix" "utils" "utlwin" "vc" "vc-bzr" "vc-cvs"
       "vc-git" "vc-rcs" "vc-svn" "verilog" "vhdl" "webster" "win32"
       "win32com" "wincom" "window" "winout" "world-monitor"
-      "xform"))
+      "xform" "xterm"))
 
   (define (my-write . strings)
     (for-each write-string strings))
index 2a5e2188b278ccc5b54b3c68f87de98bc655ada5..672312a03e969f9497e4896b92716fa86439d788 100644 (file)
@@ -129,7 +129,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 (define-package (edwin x11-keys)
   (files "x11-key")
-  (parent (edwin)))
+  (parent (edwin))
+  (export (edwin screen x11-screen)
+         x-make-special-key))
 
 (define-package (edwin x11-commands)
   (files "x11-command")
index 2b7008e6e228d5559bfd4943b189230ebd4d7239..1c60559513ec34b069878f67d0a5d54bc1322e4a 100644 (file)
@@ -29,7 +29,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 (define-package (x11)
   (files "x11")
-  (parent ()))
+  (parent ())
+  (export ()
+         import-x11))
 
 (define-package (x11 base)
   (files "x11-base")
@@ -38,12 +40,11 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
          cp1-ref
          ustring-cp-size
          ustring?)
-  (export ()
-         x-close-all-displays)
   (export (x11)
          ->cstring
          x-visual-deallocate
          x-close-display
+         x-close-all-displays
          x-window-set-input-hint
          x-window-set-name
          x-window-set-icon-name
@@ -180,7 +181,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 (define-package (x11 device)
   (files "x11-device")
   (parent (x11))
-  (export ()
+  (export (x11)
          create-x-colormap
          create-x-image
          x-character-bounds/ascent