summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2007-02-17 21:07:11 +0000
committerKim F. Storm <storm@cua.dk>2007-02-17 21:07:11 +0000
commit500cbe57f6398d80e0e8fb571e888039ffa87e16 (patch)
treea64e47bbbd9378930618484409afe002757f6f19
parent4ebb03e66b8e198df1d65d2fe8f599454aa65a3e (diff)
downloademacs-500cbe57f6398d80e0e8fb571e888039ffa87e16.tar.gz
(Bindat Spec): Vector types can have optional element type.
(Bindat Examples): Fix example. Add vector with element type.
-rw-r--r--lispref/processes.texi13
1 files changed, 9 insertions, 4 deletions
diff --git a/lispref/processes.texi b/lispref/processes.texi
index d914fd7f669..8eaed87c701 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -2146,8 +2146,11 @@ String of length @var{len}.
@item strz @var{len}
Zero-terminated string, in a fixed-size field with length @var{len}.
-@item vec @var{len}
-Vector of @var{len} bytes.
+@item vec @var{len} [@var{type}]
+Vector of @var{len} elements of type @var{type}, or bytes if not
+@var{type} is specified.
+The @var{type} is any of the simple types above, or another vector
+specified as a list @code{(vec @var{len} [@var{type}])}.
@item ip
Four-byte vector representing an Internet address. For example:
@@ -2429,13 +2432,14 @@ struct header @{
struct data @{
unsigned char type;
unsigned char opcode;
- unsigned long length; /* In little endian order */
+ unsigned long length; /* In network byte order */
unsigned char id[8]; /* null-terminated string */
unsigned char data[/* (length + 3) & ~3 */];
@};
struct packet @{
struct header header;
+ unsigned short counters[4]; /* In little endian order */
unsigned char items;
unsigned char filler[3];
struct data item[/* items */];
@@ -2455,13 +2459,14 @@ The corresponding data layout specification:
(setq data-spec
'((type u8)
(opcode u8)
- (length u16r) ;; little endian order
+ (length u32) ;; network byte order
(id strz 8)
(data vec (length))
(align 4)))
(setq packet-spec
'((header struct header-spec)
+ (counters vec 4 u16r) ;; little endian order
(items u8)
(fill 3)
(item repeat (items)