aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorThien-Thi Nguyen2006-05-25 09:01:43 +0000
committerThien-Thi Nguyen2006-05-25 09:01:43 +0000
commita2ff8a4801f7e127b57fa91e8ac19a2f5738e2cb (patch)
tree2ca88900478b3e5582e4c08605b61aca10c32730 /lispref
parent5299552dcadb2c140cd37f64b325323c19634c3f (diff)
downloademacs-a2ff8a4801f7e127b57fa91e8ac19a2f5738e2cb.tar.gz
emacs-a2ff8a4801f7e127b57fa91e8ac19a2f5738e2cb.zip
(Bindat Functions): Say "unibyte string"
explicitly for `bindat-unpack' and `bindat-pack' descriptions. (Bindat Examples): Don't call `string-make-unibyte' in example.
Diffstat (limited to 'lispref')
-rw-r--r--lispref/processes.texi32
1 files changed, 14 insertions, 18 deletions
diff --git a/lispref/processes.texi b/lispref/processes.texi
index 9eb733236a9..501c4a65c57 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -2245,7 +2245,8 @@ specification, @code{raw-data} to a byte array, and @var{struct} to an
2245alist representing unpacked field data. 2245alist representing unpacked field data.
2246 2246
2247@defun bindat-unpack spec raw-data &optional pos 2247@defun bindat-unpack spec raw-data &optional pos
2248This function unpacks data from the byte array @code{raw-data} 2248This function unpacks data from the unibyte string or byte
2249array @code{raw-data}
2249according to @var{spec}. Normally this starts unpacking at the 2250according to @var{spec}. Normally this starts unpacking at the
2250beginning of the byte array, but if @var{pos} is non-@code{nil}, it 2251beginning of the byte array, but if @var{pos} is non-@code{nil}, it
2251specifies a zero-based starting position to use instead. 2252specifies a zero-based starting position to use instead.
@@ -2277,13 +2278,9 @@ to @var{spec}.
2277This function returns a byte array packed according to @var{spec} from 2278This function returns a byte array packed according to @var{spec} from
2278the data in the alist @var{struct}. Normally it creates and fills a 2279the data in the alist @var{struct}. Normally it creates and fills a
2279new byte array starting at the beginning. However, if @var{raw-data} 2280new byte array starting at the beginning. However, if @var{raw-data}
2280is non-@code{nil}, it specifies a pre-allocated string or vector to 2281is non-@code{nil}, it specifies a pre-allocated unibyte string or vector to
2281pack into. If @var{pos} is non-@code{nil}, it specifies the starting 2282pack into. If @var{pos} is non-@code{nil}, it specifies the starting
2282offset for packing into @code{raw-data}. 2283offset for packing into @code{raw-data}.
2283
2284@c ??? Isn't this a bug? Shouldn't it always be unibyte?
2285Note: The result is a multibyte string; use @code{string-make-unibyte}
2286on it to make it unibyte if necessary.
2287@end defun 2284@end defun
2288 2285
2289@defun bindat-ip-to-string ip 2286@defun bindat-ip-to-string ip
@@ -2367,18 +2364,17 @@ COOKIES, indicates the border between entries."
2367 (with-temp-buffer 2364 (with-temp-buffer
2368 (set-buffer-multibyte nil) 2365 (set-buffer-multibyte nil)
2369 (insert 2366 (insert
2370 (string-make-unibyte 2367 (bindat-pack
2371 (bindat-pack 2368 fcookie-index-spec
2372 fcookie-index-spec 2369 `((:version . 2)
2373 `((:version . 2) 2370 (:count . ,count)
2374 (:count . ,count) 2371 (:longest . ,max)
2375 (:longest . ,max) 2372 (:shortest . ,min)
2376 (:shortest . ,min) 2373 (:flags . 0)
2377 (:flags . 0) 2374 (:delim . ,delim)
2378 (:delim . ,delim) 2375 (:offset . ,(mapcar (lambda (o)
2379 (:offset . ,(mapcar (lambda (o) 2376 (list (cons :foo o)))
2380 (list (cons :foo o))) 2377 (nreverse offsets))))))
2381 (nreverse offsets)))))))
2382 (let ((coding-system-for-write 'raw-text-unix)) 2378 (let ((coding-system-for-write 'raw-text-unix))
2383 (write-file (or index (concat cookies ".dat"))))))) 2379 (write-file (or index (concat cookies ".dat")))))))
2384@end lisp 2380@end lisp