aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2007-02-17 22:00:17 +0000
committerKim F. Storm2007-02-17 22:00:17 +0000
commit57bb3c252c00a56168f0b848d53f2cd7b8d16a9b (patch)
treedc8e210a1a397d38940e03fb275cadb7d0618751
parent59098cd6500346a4afbd6337196f7a0829b0a0f9 (diff)
downloademacs-57bb3c252c00a56168f0b848d53f2cd7b8d16a9b.tar.gz
emacs-57bb3c252c00a56168f0b848d53f2cd7b8d16a9b.zip
More fixes to bindat example.
-rw-r--r--lispref/processes.texi16
1 files changed, 9 insertions, 7 deletions
diff --git a/lispref/processes.texi b/lispref/processes.texi
index 8eaed87c701..2bf545bc9f1 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -2432,14 +2432,14 @@ struct header @{
2432struct data @{ 2432struct data @{
2433 unsigned char type; 2433 unsigned char type;
2434 unsigned char opcode; 2434 unsigned char opcode;
2435 unsigned long length; /* In network byte order */ 2435 unsigned short length; /* In network byte order */
2436 unsigned char id[8]; /* null-terminated string */ 2436 unsigned char id[8]; /* null-terminated string */
2437 unsigned char data[/* (length + 3) & ~3 */]; 2437 unsigned char data[/* (length + 3) & ~3 */];
2438@}; 2438@};
2439 2439
2440struct packet @{ 2440struct packet @{
2441 struct header header; 2441 struct header header;
2442 unsigned short counters[4]; /* In little endian order */ 2442 unsigned long counters[2]; /* In little endian order */
2443 unsigned char items; 2443 unsigned char items;
2444 unsigned char filler[3]; 2444 unsigned char filler[3];
2445 struct data item[/* items */]; 2445 struct data item[/* items */];
@@ -2459,14 +2459,14 @@ The corresponding data layout specification:
2459(setq data-spec 2459(setq data-spec
2460 '((type u8) 2460 '((type u8)
2461 (opcode u8) 2461 (opcode u8)
2462 (length u32) ;; network byte order 2462 (length u16) ;; network byte order
2463 (id strz 8) 2463 (id strz 8)
2464 (data vec (length)) 2464 (data vec (length))
2465 (align 4))) 2465 (align 4)))
2466 2466
2467(setq packet-spec 2467(setq packet-spec
2468 '((header struct header-spec) 2468 '((header struct header-spec)
2469 (counters vec 4 u16r) ;; little endian order 2469 (counters vec 2 u32r) ;; little endian order
2470 (items u8) 2470 (items u8)
2471 (fill 3) 2471 (fill 3)
2472 (item repeat (items) 2472 (item repeat (items)
@@ -2477,9 +2477,10 @@ A binary data representation:
2477 2477
2478@lisp 2478@lisp
2479(setq binary-data 2479(setq binary-data
2480 [ 192 168 1 100 192 168 1 101 01 28 21 32 2 0 0 0 2480 [ 192 168 1 100 192 168 1 101 01 28 21 32
2481 2 3 5 0 ?A ?B ?C ?D ?E ?F 0 0 1 2 3 4 5 0 0 0 2481 160 134 1 0 5 1 0 0 2 0 0 0
2482 1 4 7 0 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ]) 2482 2 3 0 5 ?A ?B ?C ?D ?E ?F 0 0 1 2 3 4 5 0 0 0
2483 1 4 0 7 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ])
2483@end lisp 2484@end lisp
2484 2485
2485The corresponding decoded structure: 2486The corresponding decoded structure:
@@ -2492,6 +2493,7 @@ The corresponding decoded structure:
2492 (src-ip . [192 168 1 101]) 2493 (src-ip . [192 168 1 101])
2493 (dest-port . 284) 2494 (dest-port . 284)
2494 (src-port . 5408)) 2495 (src-port . 5408))
2496 (counters . [100000 261])
2495 (items . 2) 2497 (items . 2)
2496 (item ((data . [1 2 3 4 5]) 2498 (item ((data . [1 2 3 4 5])
2497 (id . "ABCDEF") 2499 (id . "ABCDEF")