Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-pack Reference Manual, version 1.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Thu Mar 11 12:24:38 2021 GMT+0.
• Introduction | What cl-pack is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
cl-pack supplies Perl/PHP/Ruby/Python compatible pack()
and unpack()
functions to allow easy use of (binary format) protocols and files with the above mentioned languages and C. cl-pack was released by Dan Ballard dan@mindstab.net under the BSD-3-Clause license.
The purpose of cl-pack is to take native Lisp data like numbers, floats, and strings and encode it in a safe binary format in string that can then be written to a file or exchanged with another program while unpack can extract data from binary formats and protocols.
cl-pack has nearly full support for all features offered by Perl's pack. It boasts full support for most data types and formating rules from numbers and string to formating rules and grouping and templates. cl-pack also supports endian safe floats as outlined by ruby. cl-pack is supports ASDF so as to make it easy to integrate into your existing system.
cl-pack is available in QuickLisp
CL-USER> (ql:quickload "cl-pack")
CL-PACK> (pack "VgA*c*" #x41424344 161.99 " a string " 69 70 71)
;; => "DCBAC!ýq a string EFG"
CL-PACK> (unpack "B8H2Ng" "ABCDEFC!ýq")
;; => "01000001"
;; => "42"
;; => 1128547654
;; => 161.99
Documentation is currently a bit sparse, but is contained in cl-pack.lisp. Additionally, a good overview of pack and unpack functions can be seen at http://perldoc.perl.org/functions/pack.html.
Nearly every feature except a few esoteric ones are supported, check the documentation inside cl-pack.lisp if in doubt and if a feature you need isn't currently supported feel free to contact me and I'll see if I can add it.
Note I think the this release is about as feature complete as I feel I need to get at the moment so I'm pushing it out.
Cavets cl-pack was developed on an x86 running Ubuntu with SBCL. It should be endian safe where required and conform to host CPU endianness where required but I haven't been able to test on anything but x86. I would hope that it would work with most Lisps out there. Please feel free to get a hold of me if you have issues that need fixing
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-pack system |
Dan Ballard <dan@mindstab.net>
BSD-3-Clause
Perl compatible binary pack() and unpack() library
1.0.1
ieee-floats
cl-pack.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-pack.asd file | ||
• The cl-pack/package.lisp file | ||
• The cl-pack/cl-pack.lisp file |
Next: The cl-pack/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-pack.asd
cl-pack (system)
Next: The cl-pack/cl-pack․lisp file, Previous: The cl-pack․asd file, Up: Lisp files [Contents][Index]
Previous: The cl-pack/package․lisp file, Up: Lisp files [Contents][Index]
cl-pack (system)
cl-pack.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-pack-system package | ||
• The cl-pack package |
Next: The cl-pack package, Previous: Packages, Up: Packages [Contents][Index]
cl-pack.asd
Previous: The cl-pack-system package, Up: Packages [Contents][Index]
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
cl-pack.lisp (file)
cl-pack.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal macros | ||
• Internal functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
cl-pack.lisp (file)
cl-pack.lisp (file)
cl-pack.lisp (file)
macro for building string type bodies for case statements in pack() or unpack()
cl-pack.lisp (file)
create a subseq of form that skips the current syntax object
cl-pack.lisp (file)
Macro to define the pack function for an int
cl-pack.lisp (file)
macro for building string type bodies for case statements in pack()
cl-pack.lisp (file)
cl-pack.lisp (file)
Macro to define the unpack function for a signed int
cl-pack.lisp (file)
macro to define a normal uint that with the ! modifier is a signed int
cl-pack.lisp (file)
macro for building string type bodies for case statements in unpack()
cl-pack.lisp (file)
Macro to define the unpack function for an unsigned int
cl-pack.lisp (file)
Previous: Internal macros, Up: Internal definitions [Contents][Index]
Turn a 2 hex digit string into a number unpacked by mapper
cl-pack.lisp (file)
turns a string of 8 or less bits into a byte
byte-form specifies the packing order of bits into the byte, deaulting to decending order
cl-pack.lisp (file)
Take a BER number as a binary string and returns a number
cl-pack.lisp (file)
function to encode a BER number into a binary byte string
cl-pack.lisp (file)
cl-pack.lisp (file)
pack a bit string into a byte string, decending order by default
cl-pack.lisp (file)
turn a string of bytes into an extended string of bits unpacked by unpack-fn
cl-pack.lisp (file)
Turn a byte into a string of 2 hex characters
cl-pack.lisp (file)
cl-pack.lisp (file)
turns a byte into a string of bits
cl-pack.lisp (file)
convert a byte to a bit string, lowest bit first
cl-pack.lisp (file)
bytes: Some binary data in lisp number form that ldb can access bytes-to-list pulls out 8bit bytes from bytes and turns them into their corresponding characters and returns the list of them
cl-pack.lisp (file)
puts length bytes from bytes into a string
cl-pack.lisp (file)
puts length bytes from bytes into a reversed string
cl-pack.lisp (file)
cl-pack.lisp (file)
cl-pack.lisp (file)
turn a string of hex digits into a string of packed bytes, unpacking 2 hex digits at a time by mapper
cl-pack.lisp (file)
turn a character of 0-9 or a-f or A-F into a hex digit of 0-15
cl-pack.lisp (file)
Turn a string of bytes into a string of hex digits
cl-pack.lisp (file)
Get the next char from a string of null if offset is past end of string
cl-pack.lisp (file)
returns a char that is the first char of str
cl-pack.lisp (file)
cl-pack.lisp (file)
cl-pack.lisp (file)
returns the rest of str
cl-pack.lisp (file)
cl-pack.lisp (file)
cl-pack.lisp (file)
cl-pack.lisp (file)
takes length bytes from string and returns an int
cl-pack.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | 2
8
B C D E F G H I M N P S T U |
---|
Jump to: | 2
8
B C D E F G H I M N P S T U |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Jump to: | C P S |
---|