libsigrok is a shared library written in C, which provides the basic hardware access drivers for logic analyzers, as well as input/output file format support.
Getting the code
$ git clone git://sigrok.org/libsigrok
You can also browse the source code via gitweb.
Building from source