| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
Looks like the 'in the next commit' of the previous commit can't be
done yet.
* gnu/gnunet/utils/records.scm
(process)[copy*]: Resolve TODO about apparent bug: ignore the docstring.
|
|
|
|
|
|
|
|
|
|
|
| |
Oops another bug ...
The constructor now sometimes expects keyword arguments!
* gnu/gnunet/utils/records.scm
(process)[keywordify]: New procedure.
(process)[copy*]: Use it, and add a TODO about apparent bug.
(process)[constructor/copy*]: Use it.
|
|
|
|
|
|
| |
* gnu/gnunet/utils/records.scm
(process)[constructor-keyword-arguments*/different]: Change '(i
. value)' to '(i value)'.
|
|
|
|
|
|
|
|
| |
Oops committed too early ...
* gnu/gnunet/utils/records.scm
(process)[constructor-keyword-arguments*/different]: Convert syntax
into a datum before using 'keyword?'.
|
|
|
|
|
|
|
| |
Oops committed too early ...
* gnu/gnunet/utils/records.scm
(process)[constructor-keyword-arguments*/different]: Don't splice it.
|
|
|
|
|
|
|
|
|
| |
This will be used by the DHT code in the next commit.
* gnu/gnunet/utils/records.scm
(constructor-keyword-arguments*): New variable, used in generated
syntax.
(constructor-keyword-arguments*/different): Likewise.
|
|
|
|
| |
* gnu/gnunet/utils/records.scm (process): Implement it.
|
|
|
|
| |
* gnu/gnunet/utils/records.scm (preprocess): Support more cases.
|
|
|
|
|
|
|
|
| |
Previously, ony a single value was returned, while two were needed.
* gnu/gnunet/utils/records.scm (copy*, copy-docstring):
Set the docstring to #false if 'copy' is unset and
constructor/copy is set.
|
|
|
|
|
|
|
| |
Addressed a tests/distributed-hash-table.scm test failure.
* gnu/gnunet/util/records.scm (process)[fields*]{predicate}: Remove
'slice-readable?' check.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This simplifies many record definitions and is less prone to errors
-- if there is an error in the generation code, it will likely
impact multiple record types, so tests for one record type also
partially test other record types.
It also reduces the amount of code to be written -- reducing
boilerplate, in other words.
* gnu/gnunet/utils/records.scm: New module.
* Makefile.am (modules): Add it.
* gnu/gnunet/cadet/client.scm: Use it.
* gnu/gnunet/hashcode.scm: Likewise.
* gnu/gnunet/fs/uri.scm: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/scheme-gnunet.tm: Update copyright line.
* doc/bytevector-slices.scm (slice-contents-equal?): Document new
procedure.
* NEWS: Mention new procedure.
* gnu/gnunet/utils/bv-slice.scm (slice-contents-equal?):
New procedure.
* tests/bv-slice.scm
("first argument of slice-contents-equal? must be readable"):
("second argument of slice-contents-equal? must be readable"):
("slice-contents-equal? is reflexive")
("slice-contents-equal? is reflexive (read-only)")
("slice-contents-equal? #true backed by same bytevector but different offset")
("slice-contents-equal? #false backed by same bytevector but different offset")
("slice-contents-equal? #false backed by same bytevector but different length")
("slice-contents-equal? #false, same offset and length")
("copies are slice-contents-equal?")
("copies are slice-contents-equal? (read-only)")
("copies are slice-contents-equal? (one offset)"): New tests.
(make-a-bv): Helper procedure for tests.
|
|
|
|
|
|
|
|
|
| |
(Untested)
* gnu/gnunet/utils/bv-slice.scm ($arbitrary-lift): Remove.
($sized-bytevector,$sized-bytevector-slice/read-write)
($sized-bytevector-slice/read-only): Replace $arbitrary-lift with
$record.
|
|
|
|
|
|
|
|
|
| |
* tests/cadet.scm ($sized-bytevector,
$sized-bytevector-slice/read-write,
$sized-bytevector-slice/read-only): Move to ...
* gnu/gnunet/utils/bv-slice-quickcheck.scm: ... new module.
* Makefile.am (modules): Register new module.
* doc/bytevecto-slices.tm (Quickcheck integration): Document in new section.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm (slice-copy/bytevector):
New procedure.
* doc/bytevector-slice.tm
(slice-copy/read-write,slice-copy/read-only,slice-copy/bytevector):
New documentation.
* tests/bv-slice.scm
("return value of slice-copy/bytevector independent of original")
("source of slice-copy/bytevector must be readable"):
New tests.
|
|
|
|
|
|
|
|
| |
Documentation, tests and uses will come later.
* gnu/gnunet/utils/bv-slice.scm (make-bv-slicer): New procedure.
(bv-slice/read-write): Use it.
(bv-slice/read-only,bv-slice/write-only): New procedures.
|
| |
|
|
|
|
| |
* gnu/gnunet/utils/hat-lets.scm: Add phasing, and check for _ differently.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm (slice-independent?): New procedure.
* tests/bv-slice.scm (slice-independent?): Remove.
("empty slices are independent")
("empty slices are independent, even if using the same bytevector")
("empty slices are independent, even when using offsets (1)")
("empty slices are independent, even when using offsets (2)")
("empty slices are independent, even if eq?")
("slice-independent? is irreflexive (assuming non-empty) and ignores capabilities (1)")
("slice-independent? is irreflexive (assuming non-empty) and ignores capabilities (2)")
("empty slice is independent, even if inside the other slice")
("non-overlapping ranges are independent")
("overlapping ranges are dependent"): New tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm
(slice-copy/read-write,slice-copy/read-only): New procedures.
* gnu/gnunet/dht/client.scm
(slice-copy): Remove.
(copy-datum,copy-query,copy-search-result): Use new procedures.
* tests/bv-slice.scm (slice-independent?): New procedure.
("source of slice-copy/read-write must be readable")
("even if the length is zero")
("return value of slice-copy/read-write is read-write")
("return value of slice-copy/read-write is read-write, even if length is zero")
("return value of slice-copy/read-write independent of original")
("return value of slice-copy/read-write is fresh even if length is zero")
("slice-copy/read-write returns something with the same contents (1)")
("slice-copy/read-write returns something with the same contents (2)")
("source of slice-copy/read-only must be readable")
("even if the size is zero")
("return value of slice-copy/read-only is read-only")
("return value of slice-copy/read-only is read-only, even if length is zero")
("return value of slice-copy/read-only independent of original")
("return value of slice-copy/read-only is fresh even if length is zero (1)")
("return value of slice-copy/read-only is fresh even if length is zero (2)")
("slice-copy/read-only returns something with the same contents (1)")
("slice-copy/read-only returns something with the same
contents (2)"): New tests.
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/cut-syntax.scm: New module.
* Makefile.am: Add it.
* gnu/gnunet/dht/client.scm: Use it.
* tests/mq.scm: Likewise.
* tests/network-size.scm: Likewise.
|
| |
|
|
|
|
| |
AGPL3.0-or-later is bogus, AGPL-3.0-or-later is correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes error messages a little more useful.
* gnu/gnunet/utils/bv-slice.scm
(wrap-rnrs-ref): Replace 'ok?' by 'verify'.
(slice-u8-ref,slice-u16-ref,slice-u32-ref,slice-u64-ref)
(slice-s8-ref,slice-s16-ref,slice-s32-ref,slice-s64-ref)
(slice-u8-set!,slice-u16-set!,slice-u32-set!,slice-u64-set!)
(slice-s8-set!,slice-s16-set!,slice-s32-set!,slice-s64-set!)
(slice-ieee-double-ref,slice-ieee-double-set!): Adjust calls to
'wrap-rnrs-ref'.
* NEWS (Features): Document new behaviour.
Fixes: <https://notabug.org/maximed/scheme-gnunet/issues/22>
|
|
|
|
|
|
| |
It will be used by the DHT code.
* gnu/gnunet/utils/hat-let.scm (let^)[^!]: New case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm
(make-verify-slice-cap,verify-slice-readable,verify-slice-writable):
New procedures.
(slice-zero!,slice-copy!): Use them.
* gnu/gnunet/dht/client.scm (validate-key): Use
'verify-slice-readable' for nicer exceptions.
(%max-message-size,%max-datum-value-length): New variables.
(&overly-large-datum): New condition.
(make-datum): Throw new condition when appropriate.
(canonical-block-type): Detect non-exact integers.
* tests/distributed-hash-table.scm
(test-missing-caps,test-overly-large-datum,datum-key-test,datum-value-test):
New macros for tests.
(make-a-datum,test-datum-overly-large): New procedures for tests.
("datum?", "not a datum", "datum-key", "datum-key, read-only is
sufficient", "datum key must be readable", "datum-value, length 0",
"datum-value, maximal length", "datum-value", "datum-value, too
large (1, numeric type)", "datum-value, too large (2, numeric
type)", "datum-value, too large (1, symbolic type)", "datum-key,
symbolic type (1)", "datum-key, symbolic type (2)", "datum-key,
known numeric type (1)", "datum-key, known numeric type (2)",
"datum-key, unknown numeric type", "datum-type, out-of-bounds",
"datum-type, wrong enumeration", "datum-type, wrong type (1)",
"datum-type, wrong type (2)"): New tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is not truly necessary but it makes error messages in tests
a little neater.
* gnu/gnunet/utils/bv-slice.scm
(&missing-capabilities): New condition.
(verify-slice-cap): New procedure.
(make-select-capabilities): Use new procedure.
(slice-zero!, slice-copy!): Likewise.
* tests/bv-slice.scm
(test-missing-caps): New macro.
("destination of slice-copy! must be writable")
("source of slice-copy! must be readable"): Also check the
exception.
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm (print-slice): When not readable,
only print the length and not the actual bytes.
* tests/bv-slice.scm
("slice to string, read-write", "slice to string, read-only")
("slice to string, write-only"): Test print-slice.
|
|\ |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm
(slice-s8-ref,slice-s16-ref,slice-s32-ref,slice-s64-ref)
(slice-s8-set!,slice-s16-set!,slice-s32-set!,slice-s64-set!):
New procedures.
* tests/bv-slice.scm
(some-numbers): New procedure.
(sizes/u,sizes/s): New variables.
("slice-uN-ref/set! rount-trips"): New tests.
("slice-sN-ref/set! rount-trips"): New tests.
("two's complement is used"): New test.
|
|
|
|
|
| |
* gnu/gnunet/utils/hat-let.scm
(let^): Recognise (dotted) variable lists with <--.
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm
(slice-ieee-double-ref, slice-ieee-double-set!): New variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will be used in the generic message queue implementation.
* gnu/gnunet/utils/tokeniser.scm
(add-from-port!): New procedure.
* tests/tokeniser.scm
(no-return/done-eof, no-return/premature-eof): New procedures for
tests.
("eof detected", "eof detected (complete data)")
("premature eof detected")
("add-from-port! and partial messages (split at header)")
("kaput tokeniser and add-from-port!"): New tests for new procedure.
|
|
|
|
|
| |
* gnu/gnunet/utils/tokeniser.scm: Add some explanation
I forgot.
|
|\
| |
| |
| | |
The 'hat-let' fix wil be used.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The syntax for procedure bindings needs to match
before the syntax for generic bindings.
* gnu/gnunet/utils/hat-let.scm (let^): Move the
code for inline procedure definitions a little
upwards.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile.am
(modules): Add new module (gnu gnunet utils tokeniser).
(SCM_TESTS): Add new test tests/tokeniser.scm.
* README.org (Message queues): Describe new module.
* gnu/gnunet/util/struct.scm (/:message-header): Note that
the new module depends on the exact layout.
* gnu/gnunet/utils/tokeniser.scm
(make-tokeniser, tokeniser?, <tokeniser>): New record type.
(&interrupted-tokeniser-volation)
make-interrupted-tokeniser-violation)
interrupted-tokeniser-violation?): New condition type.
(&kaput-tokeniser-error, make-tokeniser-error,
kaput-tokeniser-error?): New condition type.
(add-bytevector!): New procedure.
* tests/tokeniser.scm
(fluffed-bytevector, no-return/overly-small, no-return/done)
(no-handle/message, merge-bytevectors, catch-errors): New procedures
for tests.
(choose-message, choose-many-message, positions->ranges)
(choose-split-positions): New QuickCheck generators for tests.
($messages-and-ranges): New QuickCheck arbitrary for tests.
("[prop] complete messages are passed through")
("message fragmented on header/data boundary reassembled")
("message fragmented in size field and after message header, some data")
("[prop] all fragmented & multiple messages received")
("overly small message error (complete header)")
("overly small message error (header split in size field)")
("huge message, split early")
("re-entrancy from message handler is detected (complete message)")
("tokeniser becomes kaput, split after size field")
("tokeniser becomes kaput, split inside size field"): New tests.
(huge-bv): New variable.
* tests/utils.scm (calls-in-tail-position?): New buggy procedure for
tests.
|
|
|
|
|
| |
* gnu/gnunet/utils/hat-let.scm: Don't state GNUnet e.V. has
copyright, as that would be incorrect.
|
|
|
|
|
| |
* gnu/gnunet/utils/hat-let.scm
(let^): Do not refer to the identifier '_' from (rnrs base).
|
|
|
|
|
|
|
|
|
|
|
| |
The old <- accepts a thunk expression instead of a raw
expression, which is a historical mistake.
* gnu/gnunet/utils/hat-let.scm
(let^)[<-]: Deprecate.
(let^)[<--]: Define a variant that accepts expressions
to evaluate instead.
(Mini changelog): Bump the version number.
|
|
|
|
|
|
|
|
|
|
|
|
| |
(gnu extractor enum) is not suitable as it assumes the enumeration
values are the same on all target platforms.
* gnu/gnunet/utils/platform-enum.scm
(that-platform?): Define syntax for writing platform-specific code.
(define-platform-enumeration): Define syntax for defining
platform-specific C-style enumerations compactly.
* Makefile.am (modules): Compile the new module.
* README.org (modules): Note this module exists.
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm
(print-slice): Define a procedure for printing slices to a port
and use it as the record printer for slices.
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/bv-slice.scm (slice-slice):
Add the requested additional offset to the original
offset when two arguments are passed. Previously,
the original offset was ignored.
|
|
|
|
|
|
|
|
|
|
|
|
| |
These will be used for the ancillary message parsing code,
which will be used to generate more detailed network error
messages than what can be interferenced from the errno.
* tests/bv-slice.scm: New test file, testing slice-copy!
and slice-zero!
* gnu/gnunet/utils/bv-slice.scm (slice-zero!, slice-copy!):
New procedures. Also comment the module more.
* Makefile.am (SCM_TESTS): Register tests/bv-slice.scm.
|
|
|
|
|
|
|
|
|
| |
* gnu/gnunet/utils/netstruct.scm
(define-unsigned-N-bytes): pass the index to slice-ref and
slice-set!, and use slice-ref and slice-set! instead of
slice-u8-ref and slice-u8-set!
(u32/big, u32/little, u64/big, u64/little): use correct slice-ref
procedure.
|
| |
|
| |
|
| |
|