From: Richard Jones <rich@annexia.org>
To: caml-list@inria.fr
Subject: [ANNOUNCE] OCaml Bitstring 2.0.2
Date: Sat, 9 Jan 2010 10:08:12 +0000 [thread overview]
Message-ID: <20100109100812.GA26610@annexia.org> (raw)
Bitstring is a syntax extension which adds Erlang-style bit matching
and construction to OCaml programs. You can use this to efficiently
and safely parse communication protocols and binary file formats.
Bitstring handles integers, booleans, strings, sub-bitstrings, big-,
little- and native-endianness, signed and unsigned types,
variable-width fields, fields whose width depends on values in
previous fields, fields with arbitrary bit alignment, forward offsets,
when-clauses, checked expressions, security against buffer overflows
and DoS, and lots more.
Example:
let bits = Bitstring.bitstring_of_file "image.gif" in
bitmatch bits with
| { ("GIF87a"|"GIF89a") : 6*8 : string; (* GIF magic. *)
width : 16 : littleendian;
height : 16 : littleendian } ->
printf "%s: GIF image is %d x %d pixels" filename width height
| { _ } ->
eprintf "%s: Not a GIF image\n" filename
The latest version is 2.0.2 which fixes a number of compilation
problems related to OCaml 3.11, and incorporates some unofficial
patches which were floating around. (Note that bitstring 2.0.0 is
known to be broken on Debian).
Home page:
http://code.google.com/p/bitstring/
API documentation:
http://people.redhat.com/~rjones/bitstring/html/Bitstring.html
Rich.
--
Richard Jones
Red Hat
next reply other threads:[~2010-01-09 10:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-09 10:08 Richard Jones [this message]
2010-01-09 10:55 ` [Caml-list] " Mehdi Dogguy
2010-01-09 11:23 ` Matthieu Dubuget
2010-01-09 11:33 ` Matthieu Dubuget
2010-01-09 19:13 ` ANN: UseOcaml.cmake script Keyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100109100812.GA26610@annexia.org \
--to=rich@annexia.org \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox