binary-structures
binary-structures copied to clipboard
A library for reading, writing, and representing structures from binary storage
didn't go back and fix coding conventions yet, and not documented (aside from tests), but seems useful so far? Not completely sure about which accessors it should generate though, currently...
Not sure exactly what I'm looking for here, so more just a place to dump use cases as they come up than a specific feature request. (feel free to close...
lots of formats encode sizes of things into the file, so would be nice to be able to specify size of a structure in terms of `SLOT` within the `define-io-structure`...
See https://github.com/Shinmera/binary-structures/blob/main/protocol.lisp#L717 The issue is that padding and alignment are merged into one and not retained as separate fields, so the runtime has no idea how to untangle them and...
```lisp (define-io-structure aa (b (vector uint8 3))) (let ((a (coerce '(1 2 3) '(simple-array (unsigned-byte 8) 1)))) (read-aa a)) ``` fails with ``` Value of (SB-KERNEL:ALLOCATE-VECTOR 157 SB-C::%LENGTH SB-C::NWORDS) in...
I have some structures that specify lengths of some fields are padded to end at a multiple of 4 bytes, so it might be nice to be able to specify...
```lisp (define-io-structure a (a (vector (unsigned-byte 8)))) ``` or ```lisp (define-io-structure a (a string)) ``` error during compilation with ``` No io-type with name * ``` (and code for `string`s...