Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-octet-streams Reference Manual, version 1.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:52:13 2022 GMT+0.
Next: Systems, Previous: The cl-octet-streams Reference Manual, Up: The cl-octet-streams Reference Manual [Contents][Index]
#+TITLE: cl-octet-streams *cl-octet-streams* is a library implementing in-memory octet streams for Common Lisp. It was inspired by the [[https://github.com/sharplispers/trivial-octet-streams][trivial-octet-streams]] and [[https://github.com/smithzvk/cl-plumbing][cl-plumbing]] libraries. * Installation The only dependency is the [[https://common-lisp.net/project/trivial-gray-streams][trivial-gray-streams]] library. * API ** Input stream #+BEGIN_SRC lisp (make-octet-input-stream seq &optional (start 0) end) => stream #+END_SRC Return an input stream which will supply the bytes of /seq/ between /start/ and /end/ in order. #+BEGIN_SRC lisp (with-octet-input-stream (var seq &optional (start 0) end) &body body) #+END_SRC Within /body/, /var/ is bound to an octet input stream defined by /seq/, /start/ and /end/. The result of the last form of /body/ is returned. ** Output stream #+BEGIN_SRC lisp (make-octet-output-stream) => stream #+END_SRC Return an output stream which will accumulate all the bytes written to it for the benefit of the function /get-output-stream-octets/. #+BEGIN_SRC lisp (get-output-stream-octets stream) => bytes #+END_SRC Return the bytes that were written to an octet output /stream/. #+BEGIN_SRC lisp (with-octet-output-stream (var) &body body) => bytes #+END_SRC Within /body/, /var/ is bound to an octet output stream. After all the forms in /body/ have been executed, the bytes that have been written to /var/ (and that haven't been consumed by a call to /get-output-stream-octets/ within /body/) are returned. ** Pipe #+BEGIN_SRC lisp (make-octet-pipe) => stream #+END_SRC Return a stream which will supply the bytes that have been written to it in order. #+BEGIN_SRC lisp (with-octet-pipe (var) &body body) #+END_SRC Within /body/, /var/ is bound to an octet pipe. The result of the last form of /body/ is returned. ** Connected streams #+BEGIN_SRC lisp (make-connected-octet-streams) => stream1, stream2 #+END_SRC Return two streams connected to each other. The bytes written to the first stream can be read from the second, and the bytes written to the second stream can be read from the first. #+BEGIN_SRC lisp (with-connected-octet-streams (var1 var2) &body body) #+END_SRC Within /body/, /var1/ and /var2/ are bound to octet streams connected to each other. The result of the last form of /body/ is returned. ** Extra functions The following functions can be used on input streams, output streams and pipes. #+BEGIN_SRC lisp (octet-stream-length stream) => integer #+END_SRC Return the number of bytes available in /stream/. #+BEGIN_SRC lisp (octet-stream-ref stream index) => byte #+END_SRC Return the byte at /index/ in /stream/. #+BEGIN_SRC lisp (octet-stream-search stream pattern jump-table) => index or nil #+END_SRC Search /pattern/ in the bytes of /stream/ using the Boyer-Moore algorithm. The /jump-table/ must be 256 bytes long. If there is a match, return the index of the beginning of the /pattern/ in the /stream/, otherwise return ~nil~. #+BEGIN_SRC lisp (make-jump-table pattern) => array #+END_SRC Return a jump table for /pattern/ that can be used with /octet-stream-search/. * Tests The tests require the [[https://common-lisp.net/project/fiveam][fiveam]] library. #+BEGIN_SRC lisp (asdf:test-system "cl-octet-streams") #+END_SRC
Next: Modules, Previous: Introduction, Up: The cl-octet-streams Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Next: Files, Previous: Systems, Up: The cl-octet-streams Reference Manual [Contents][Index]
Modules are listed depth-first from the system components tree.
cl-octet-streams (system).
Next: Packages, Previous: Modules, Up: The cl-octet-streams Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: cl-octet-streams/src/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
cl-octet-streams (system).
Next: cl-octet-streams/src/ring-buffers.lisp, Previous: cl-octet-streams/cl-octet-streams.asd, Up: Lisp [Contents][Index]
src (module).
Next: cl-octet-streams/src/octet-streams.lisp, Previous: cl-octet-streams/src/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
src (module).
Next: cl-octet-streams/src/octet-pipes.lisp, Previous: cl-octet-streams/src/ring-buffers.lisp, Up: Lisp [Contents][Index]
ring-buffers.lisp (file).
src (module).
Next: cl-octet-streams/src/connected-octet-streams.lisp, Previous: cl-octet-streams/src/octet-streams.lisp, Up: Lisp [Contents][Index]
octet-streams.lisp (file).
src (module).
octet-pipe (class).
Previous: cl-octet-streams/src/octet-pipes.lisp, Up: Lisp [Contents][Index]
octet-pipes.lisp (file).
src (module).
Next: Definitions, Previous: Files, Up: The cl-octet-streams Reference Manual [Contents][Index]
Packages are listed by definition order.
cl-octet-streams
Next: Indexes, Previous: Packages, Up: The cl-octet-streams Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Public Interface, Up: Public Interface [Contents][Index]
Within BODY, VAR1 and VAR2 are bound to octet streams connected to each other. The result of the last form of BODY is returned.
Within BODY, VAR is bound to an octet input stream defined by SEQ, START and END. The result of the last form of BODY is returned.
Within BODY, VAR is bound to an octet output stream. After all the forms in BODY have been executed, the bytes that have been written to VAR (and that haven’t been consumed by a call to GET-OUTPUT-STREAM-OCTETS within BODY) are returned.
Within BODY, VAR is bound to an octet pipe. The result of the last form of BODY is returned.
Next: Standalone methods, Previous: Macros, Up: Public Interface [Contents][Index]
Return the bytes that were written to an octet output STREAM.
Return two streams connected to each other. The bytes written to the first stream can be read from the second, and the bytes written to the second stream can be read from the first.
Return a jump table for PATTERN that can be used with OCTET-STREAM-SEARCH.
Return an input stream which will supply the bytes of SEQ between START and END in order.
Return an output stream which will accumulate all the bytes written to it for the benefit of the function GET-OUTPUT-STREAM-OCTETS.
Return a stream which will supply the bytes that have been written to it in order.
Return the number of bytes available in STREAM.
Return the byte at INDEX in STREAM.
Search PATTERN in the bytes of STREAM using the Boyer-Moore algorithm. The JUMP-TABLE must be 256 bytes long. If there is a match, return the index of the beginning of the PATTERN in the STREAM, otherwise return NIL.
Previous: Ordinary functions, Up: Public Interface [Contents][Index]
sb-gray.
sb-gray.
sb-gray.
sb-gray.
trivial-gray-streams.
sb-gray.
trivial-gray-streams.
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Internals, Up: Internals [Contents][Index]
Next: Generic functions, Previous: Macros, Up: Internals [Contents][Index]
Next: Classes, Previous: Ordinary functions, Up: Internals [Contents][Index]
automatically generated reader method
automatically generated reader method
automatically generated writer method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
end.
automatically generated writer method
end.
automatically generated reader method
size.
automatically generated writer method
size.
automatically generated reader method
automatically generated writer method
Next: Types, Previous: Generic functions, Up: Internals [Contents][Index]
octet-streams::ring-buffer
:buffer
octet-streams::simple-octet-vector
:buffer
octet-streams::index
:size
octet-streams::index
:start
octet-streams::index
:end
common-lisp.
octet-streams::index
:count
Previous: Definitions, Up: The cl-octet-streams Reference Manual [Contents][Index]
Jump to: | (
B C F G M O P R S W |
---|
Jump to: | (
B C F G M O P R S W |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | B C E S |
---|
Jump to: | B C E S |
---|
Jump to: | C F I M O P R S T |
---|
Jump to: | C F I M O P R S T |
---|