The c2hs package

[Tags:gpl, program, test]

C->Haskell assists in the development of Haskell bindings to C libraries. It extracts interface information from C header files and generates Haskell code with foreign imports and marshaling. Unlike writing foreign imports by hand (or using hsc2hs), this ensures that C functions are imported with the correct Haskell types.


[Skip to Readme]

Properties

Versions 0.15.0, 0.15.1, 0.16.0, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.1, 0.17.2, 0.18.1, 0.18.2, 0.19.1, 0.20.1, 0.21.1, 0.22.1, 0.23.1, 0.24.1, 0.25.1, 0.25.2, 0.26.1, 0.26.2, 0.27.1, 0.28.1
Change log ChangeLog
Dependencies array, base (>=2 && <4.8), containers, directory, filepath, language-c (>=0.4.2 && <0.5), pretty, process [details]
License GPL-2
Copyright Copyright (c) 1999-2007 Manuel M T Chakravarty 2005-2013 Duncan Coutts 2008 Benedikt Huber
Author Manuel M T Chakravarty
Maintainer chak@cse.unsw.edu.au, duncan@community.haskell.org, ian@skybluetrades.net
Stability Stable
Category Development
Home page https://github.com/haskell/c2hs
Bug tracker https://github.com/haskell/c2hs/issues
Source repository head: git clone git://github.com/haskell/c2hs.git
Uploaded Wed Mar 12 21:09:06 UTC 2014 by IanRoss
Updated Sun Nov 8 10:16:56 UTC 2015 by HerbertValerioRiedel to revision 1
Distributions Arch:0.28.1, Debian:0.27.1, FreeBSD:0.26.1, LTSHaskell:0.28.1, NixOS:0.28.1, Stackage:0.28.1, Tumbleweed:0.28.1
Downloads 16961 total (55 in the last 30 days)
Votes
0 []
Status Docs not available [build log]
Last success reported on 2015-05-24 [all 6 reports]

Flags

NameDescriptionDefaultType
base3EnabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for c2hs

Readme for c2hs-0.16.6

`c2hs` is a interfacing tool that eases Haskell access to C libraries.
The tool gets information about the C data type definitions and
function signatures by analysing the C header files of the library.
It uses this information to compute the missing details in the
template of a Haskell module &mdash; called the binding file &mdash;
that implements a Haskell binding to the C library.  Hooks embedded in
the binding file signal where, which, and how C objects are accessed
from Haskell.  The Haskell code in the binding file determines Haskell
types signatures and marshaling details.

Further information is on the
[wiki](https://github.com/haskell/c2hs/wiki/Home).  Also see the
[user guide](https://github.com/haskell/c2hs/wiki/User-Guide) (also
available in the `doc` directory of the repository).


## Installing

See the file `INSTALL`.


## Copyleft

This system is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.

This system is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this system; if not, write to the Free Software Foundation,
Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

> **NOTE HOWEVER**, all code included into generated bindings is under
> a BSD-style license that does not place any restrictions on the
> license of the inteface produced with `c2hs` (ie, closed proprietary
> licenses are possible, too).  In other words, I do not care what you
> use `c2hs` for or to whom you are giving `c2hs` or any interfaces
> generated with `c2hs`, only if you modify or improve `c2hs` itself,
> you have to contribute your changes back to the community.
> Nevertheless, I will of course be particularly delighted if you
> choose to make your work freely available.


## Credits

See the file `AUTHORS`.