[Top][All Lists]

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

bindat docs on length of str, strz, etc types

From: Kevin Ryde
Subject: bindat docs on length of str, strz, etc types
Date: Thu, 28 Dec 2006 09:22:51 +1100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

In the "Bindat Spec" node of the lisp manual, the `repeat' type has

        COUNT may be an integer, or a list of one element that names a
        previous field.

If I'm not mistaken that applies to any of the LEN arguments for str,
strz, etc too (the "Bindat Examples" have some like that).  I wonder
if the words could be in a more prominent / more general spot.

And also if I'm not mistaken a form `(eval FOO)' is allowed, for
calculating a length.  It'd be nice to describe that.

I tried it for a jpeg record, where the length field includes itself
so the data is "length-2" bytes

        ((marker u16)
         (length u16)
         (data   str (eval (- (assoc-default 'length struct) 2))))

But perhaps there's a cleaner way I missed.

reply via email to

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