caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: caml-list@inria.fr
Subject: ANNOUNCE: Bitmatch 1.9 released
Date: Fri, 13 Jun 2008 17:30:56 +0100	[thread overview]
Message-ID: <20080613163056.GA32681@annexia.org> (raw)

This is a preview/testing release:

  http://code.google.com/p/bitmatch/

The major change is the introduction of persistent patterns.  This
allows you to write importer tools, so you can import bitstring
descriptions from your own languages or other sources.

  http://et.redhat.com/~rjones/bitmatch/html/Bitmatch_persistent.html

I'm working on a C language importer, which will be able to import C
structures, unions, enums and constants (eg. out of header files).
This will be based on bitmatch & CIL, and there's an early prototype
included in the 1.9 release.

The syntax for this is simple and lightweight.  For example, to
implement the equivalent of the 'df' command (showing free blocks on a
filesystem) you could do something like this:

  (* bitmatch-import-c ext3.c > ext3.bmpp *)
  open bitmatch "ext3.bmpp"

  let () =
    let fd = Unix.openfile "/dev/sda1" in
    let bits = Bitmatch.bitstring_of_file_descr_max fd 4096 in

    bitmatch bits with
    | { :ext3_super_block } ->
        printf "free blocks = %ld\n" s_free_blocks_count
    | { _ } ->
        printf "/dev/sda1 is not an ext3 filesystem\n"

Rich.

-- 
Richard Jones
Red Hat


                 reply	other threads:[~2008-06-13 16:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080613163056.GA32681@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;
as well as URLs for NNTP newsgroup(s).