all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bindat docs on length of str, strz, etc types
@ 2006-12-27 22:22 Kevin Ryde
  2006-12-27 23:06 ` Kim F. Storm
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Ryde @ 2006-12-27 22:22 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-12-30  0:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-27 22:22 bindat docs on length of str, strz, etc types Kevin Ryde
2006-12-27 23:06 ` Kim F. Storm
2006-12-27 23:38   ` Kevin Ryde
2006-12-29  1:23     ` Kim F. Storm
2006-12-29 22:42       ` Kevin Ryde
2006-12-30  0:46         ` Kim F. Storm

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.