gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 01/02: fs: Normalise names.


From: gnunet
Subject: [gnunet-scheme] 01/02: fs: Normalise names.
Date: Tue, 20 Dec 2022 14:40:28 +0100

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 40a17ea4232c433d519a0fb495a263d5b0e255aa
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Tue Dec 20 14:33:29 2022 +0100

    fs: Normalise names.
    
    * gnu/gnunet/fs/uri.scm: Various renames.
    * gnu/gnunet/fs/network.scm: Adust appropriately.
    * gnu/gnunet/fs/quickcheck.scm: Likewise.
    * tests/file-sharing.scm: Likewise.
---
 gnu/gnunet/fs/network.scm    |  8 ++++----
 gnu/gnunet/fs/quickcheck.scm |  7 +++++--
 gnu/gnunet/fs/uri.scm        | 21 ++++++++++++---------
 tests/file-sharing.scm       |  8 ++++----
 4 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/gnu/gnunet/fs/network.scm b/gnu/gnunet/fs/network.scm
index 65648a8..97a66ab 100644
--- a/gnu/gnunet/fs/network.scm
+++ b/gnu/gnunet/fs/network.scm
@@ -29,8 +29,8 @@
          (only (gnu gnunet fs struct)
                /content-hash-key /:msg:fs:request-loc-signature)
          (only (gnu gnunet fs uri)
-               chk-key ;; TODO rename
-               chk-query
+               content-hash-key-key ;; TODO rename
+               content-hash-key-query
                make-content-hash-key/share)
          (only (gnu gnunet hashcode)
                hashcode:512->slice)
@@ -63,10 +63,10 @@ expiring at @var{expiration-time} (TODO type), for 
@var{purpose}
       (set%!* '(purpose) purpose)
       (set%!* '(expiration-time) expiration-time)
       (slice-copy!
-       (hashcode:512->slice (chk-key content-hash-key))
+       (hashcode:512->slice (content-hash-key-key content-hash-key))
        (select* '(content-hash-key key)))
       (slice-copy!
-       (hashcode:512->slice (chk-query content-hash-key))
+       (hashcode:512->slice (content-hash-key-query content-hash-key))
        (select* '(content-hash-key query)))
       (set%!* '(file-length) file-length)
       s)
diff --git a/gnu/gnunet/fs/quickcheck.scm b/gnu/gnunet/fs/quickcheck.scm
index c7e1b4d..9fa622d 100644
--- a/gnu/gnunet/fs/quickcheck.scm
+++ b/gnu/gnunet/fs/quickcheck.scm
@@ -21,12 +21,15 @@
   (import (only (rnrs base) begin define)
          (only (quickcheck arbitrary) $record $natural)
          (only (gnu gnunet fs uri)
-               make-chk chk-key chk-query
+               make-content-hash-key content-hash-key-key
+               content-hash-key-query
                make-chk-uri chk-uri-file-length chk-uri-chk)
          (only (gnu gnunet hashcode quickcheck) $hashcode:512))
   (begin
     (define $content-hash-key
-      ($record make-chk (chk-key $hashcode:512) (chk-query $hashcode:512)))
+      ($record make-content-hash-key
+              (content-hash-key-key $hashcode:512)
+              (content-hash-key-query $hashcode:512)))
 
     ;; Can produce some impossible chk URIs, e.g. multiple
     ;; chk URIs for length=0.
diff --git a/gnu/gnunet/fs/uri.scm b/gnu/gnunet/fs/uri.scm
index 978bd42..ce3b5dd 100644
--- a/gnu/gnunet/fs/uri.scm
+++ b/gnu/gnunet/fs/uri.scm
@@ -79,7 +79,8 @@
 ;; module in the gnunetutil library and discussed there.
 
 (library (gnu gnunet fs uri (1 1))
-  (export chk? make-chk make-content-hash-key/share chk-key chk-query
+  (export content-hash-key? make-content-hash-key make-content-hash-key/share
+         content-hash-key-key content-hash-key-query
           chk-uri? make-chk-uri chk-uri-file-length chk-uri-chk
          chk-uri-parse)
   (import (rnrs base)
@@ -99,15 +100,16 @@
   #;(define DBLOCK_SIZE (* 32 1024))
 
   ;; Content hash key
-  (define-record-type (<content-hash-key> %make-content-hash-key chk?)
+  (define-record-type (<content-hash-key> %make-content-hash-key
+                                         content-hash-key?)
     (fields ;; Hash of the original content, used for encryption.
             ;; Of type <hashcode:512>.
-            (immutable key chk-key)
+            (immutable key content-hash-key-key)
             ;; Hash of the encrypted content, used for querying.
             ;; Of type <hashcode:512>
-            (immutable query chk-query)))
+            (immutable query content-hash-key-query)))
 
-  (define (make-chk key query)
+  (define (make-content-hash-key key query)
     "Construct a <content-hash-key>"
     (assert (hashcode:512? key))
     (assert (hashcode:512? query))
@@ -117,9 +119,10 @@
     "Construct a <content-hash-key> corresponding to the
 @code{/content-hash-key} @var{slice}.  @var{slice} may not be modified
 while the content hash key is in use."
-    (make-chk (make-hashcode:512/share (select /content-hash-key '(key) slice))
-             (make-hashcode:512/share
-              (select /content-hash-key '(query) slice))))
+    (make-content-hash-key
+     (make-hashcode:512/share (select /content-hash-key '(key) slice))
+     (make-hashcode:512/share
+      (select /content-hash-key '(query) slice))))
 
   ;; Information needed to retrieve a file (content-hash-key
   ;; plus file size)
@@ -140,7 +143,7 @@ while the content hash key is in use."
                 (integer? file-length)))
     (assert (and (<= 0 file-length)
                 (< file-length file-length-limit)))
-    (assert (chk? chk))
+    (assert (content-hash-key? chk))
     (%make-chk-uri file-length chk))
 
   ;; TODO: location URIs, ksk URIs?
diff --git a/tests/file-sharing.scm b/tests/file-sharing.scm
index b3cdbf0..0f9947c 100644
--- a/tests/file-sharing.scm
+++ b/tests/file-sharing.scm
@@ -32,10 +32,10 @@
 (define (normalise list)
   (pk list)
   (map (match-lambda
-       ((? chk? #;content-hash-key? k)
-        (make-chk
-         (copy-hashcode:512 (chk-key k))
-         (copy-hashcode:512 (chk-query k))))
+       ((? content-hash-key? k)
+        (make-content-hash-key
+         (copy-hashcode:512 (content-hash-key-key k))
+         (copy-hashcode:512 (content-hash-key-query k))))
        (foo foo))
        list))
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]