Changeset 4161 for trunk/lisp/emacs-lisp/bindat.el
- Timestamp:
- 2006年09月09日 16時30分10秒 (2 years ago)
- Files:
-
- trunk/lisp/emacs-lisp/bindat.el (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/emacs-lisp/bindat.el
r4148 r4161 67 67 ;; The corresponding Lisp bindat specification looks like this: 68 68 ;; 69 ;; (setq header- spec69 ;; (setq header-bindat-spec 70 70 ;; '((dest-ip ip) 71 71 ;; (src-ip ip) … … 73 73 ;; (src-port u16))) 74 74 ;; 75 ;; (setq data- spec75 ;; (setq data-bindat-spec 76 76 ;; '((type u8) 77 77 ;; (opcode u8) … … 81 81 ;; (align 4))) 82 82 ;; 83 ;; (setq packet- spec84 ;; '((header struct header- spec)83 ;; (setq packet-bindat-spec 84 ;; '((header struct header-bindat-spec) 85 85 ;; (items u8) 86 86 ;; (fill 3) 87 87 ;; (item repeat (items) 88 ;; (struct data- spec))))88 ;; (struct data-bindat-spec)))) 89 89 ;; 90 90 ;; … … 121 121 ;; Binary Data Structure Specification Format 122 122 ;; ------------------------------------------ 123 124 ;; We recommend using names that end in `-bindat-spec'; such names 125 ;; are recognized automatically as "risky" variables. 123 126 124 127 ;; The data specification is formatted as follows: … … 343 346 (defun bindat-unpack (spec bindat-raw &optional bindat-idx) 344 347 "Return structured data according to SPEC for binary data in BINDAT-RAW. 345 BINDAT-RAW is a unibyte string or vector. Optional third arg BINDAT-IDX specifies346 the starting offset in BINDAT-RAW."348 BINDAT-RAW is a unibyte string or vector. 349 Optional third arg BINDAT-IDX specifies the starting offset in BINDAT-RAW." 347 350 (when (multibyte-string-p bindat-raw) 348 351 (error "String is multibyte"))
