summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bindat.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-09-08 11:59:33 +0000
committerRichard M. Stallman <rms@gnu.org>2006-09-08 11:59:33 +0000
commit3ac5a59d71e23392cdc31f609a9ce32e80f42dfd (patch)
treea866a51917e02559c67cae7e4adca0b5743da601 /lisp/emacs-lisp/bindat.el
parente3d47a1509af730e944e6d45b7aeb1a4c2c57d1f (diff)
downloademacs-3ac5a59d71e23392cdc31f609a9ce32e80f42dfd.tar.gz
(bindat-unpack): Doc fix.
Diffstat (limited to 'lisp/emacs-lisp/bindat.el')
-rw-r--r--lisp/emacs-lisp/bindat.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index 1b37f3f772f..792272ef88a 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -66,13 +66,13 @@
;;
;; The corresponding Lisp bindat specification looks like this:
;;
-;; (setq header-spec
+;; (setq header-bindat-spec
;; '((dest-ip ip)
;; (src-ip ip)
;; (dest-port u16)
;; (src-port u16)))
;;
-;; (setq data-spec
+;; (setq data-bindat-spec
;; '((type u8)
;; (opcode u8)
;; (length u16r) ;; little endian order
@@ -80,12 +80,12 @@
;; (data vec (length))
;; (align 4)))
;;
-;; (setq packet-spec
-;; '((header struct header-spec)
+;; (setq packet-bindat-spec
+;; '((header struct header-bindat-spec)
;; (items u8)
;; (fill 3)
;; (item repeat (items)
-;; (struct data-spec))))
+;; (struct data-bindat-spec))))
;;
;;
;; A binary data representation may look like
@@ -121,6 +121,9 @@
;; Binary Data Structure Specification Format
;; ------------------------------------------
+;; We recommend using names that end in `-bindat-spec'; such names
+;; are recognized automatically as "risky" variables.
+
;; The data specification is formatted as follows:
;; SPEC ::= ( ITEM... )
@@ -342,8 +345,8 @@
(defun bindat-unpack (spec bindat-raw &optional bindat-idx)
"Return structured data according to SPEC for binary data in BINDAT-RAW.
-BINDAT-RAW is a unibyte string or vector. Optional third arg BINDAT-IDX specifies
-the starting offset in BINDAT-RAW."
+BINDAT-RAW is a unibyte string or vector.
+Optional third arg BINDAT-IDX specifies the starting offset in BINDAT-RAW."
(when (multibyte-string-p bindat-raw)
(error "String is multibyte"))
(unless bindat-idx (setq bindat-idx 0))