* [ANNOUNCE] OCaml Bitstring 2.0.2
@ 2010-01-09 10:08 Richard Jones
2010-01-09 10:55 ` [Caml-list] " Mehdi Dogguy
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Richard Jones @ 2010-01-09 10:08 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] [ANNOUNCE] OCaml Bitstring 2.0.2
2010-01-09 10:08 [ANNOUNCE] OCaml Bitstring 2.0.2 Richard Jones
@ 2010-01-09 10:55 ` Mehdi Dogguy
2010-01-09 11:23 ` Matthieu Dubuget
2010-01-09 19:13 ` ANN: UseOcaml.cmake script Keyan
2 siblings, 0 replies; 5+ messages in thread
From: Mehdi Dogguy @ 2010-01-09 10:55 UTC (permalink / raw)
To: Richard Jones; +Cc: caml-list
Richard Jones wrote:
>
> 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).
>
Updated in Debian as well. OCaml Bitstring 2.0.2 will be available shortly.
Regards,
--
Mehdi Dogguy مهدي الدڤي
http://www.pps.jussieu.fr/~dogguy
Tel.: (+33).1.44.27.28.38
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] [ANNOUNCE] OCaml Bitstring 2.0.2
2010-01-09 10:08 [ANNOUNCE] OCaml Bitstring 2.0.2 Richard Jones
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
2 siblings, 1 reply; 5+ messages in thread
From: Matthieu Dubuget @ 2010-01-09 11:23 UTC (permalink / raw)
To: caml-list
For those who would want to use bitstring on mingw, I had it compiled ok
with the following:
> cp byteswap.in.h byteswap.h
> sed -i -e 's/-Werror -fPIC//' Makefile.in
> sed -i -e 's/open_in/open_in_bin/' pa_bitstring.ml
> create_test_pattern.ml bitstring_objinfo.ml
> ./configure CFLAGS="-mno-cygwin"
> make
The test target is also buggy on mingw.
But the library is working ok
Salutations
Matt
^ permalink raw reply [flat|nested] 5+ messages in thread
* ANN: UseOcaml.cmake script
2010-01-09 10:08 [ANNOUNCE] OCaml Bitstring 2.0.2 Richard Jones
2010-01-09 10:55 ` [Caml-list] " Mehdi Dogguy
2010-01-09 11:23 ` Matthieu Dubuget
@ 2010-01-09 19:13 ` Keyan
2 siblings, 0 replies; 5+ messages in thread
From: Keyan @ 2010-01-09 19:13 UTC (permalink / raw)
Cc: caml-list
Hi,
i am not sure, if this is of interest here, but i give it a try. i use cmake heavily to compile my projects, so i wrote
a UseOcaml.cmake script, adapted from UseLATEX.cmake, to do the job for me. it can be found here:
http://yars.svn.sourceforge.net/viewvc/yars/branches/yars-refactoring/modules/UseOcaml.cmake?revision=509&view=markup
it is not complete yet, but it allows to easily compile ocaml-binaries in the following way:
ADD_OCAML_TARGET(
OUTPUT loc
MAIN loc.ml
SOURCES file_node.ml files.ml io.ml file_statistics.ml message_node.ml
HEADERS file_node.mli files.mli io.mli file_statistics.mli message_node.mli
LIBRARIES unix.cmxa str.cmxa extLib.cmxa
INCLUDES /opt/local/lib/ocaml/site-lib/extlib
)
one current problem is that i cannot add multiple entries to the INCLUDES.
i am happy to receive comments.
cheers,
keyan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-09 19:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-09 10:08 [ANNOUNCE] OCaml Bitstring 2.0.2 Richard Jones
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox