c2hs: C->Haskell FFI tool that gives some cross-language type safety

[ development, gpl, program ] [ Propose Tags ] [ Report a vulnerability ]

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 hsch2s), this ensures that C functions are imported with the correct Haskell types.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
base3Enabled

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

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 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, 0.28.2, 0.28.3, 0.28.4, 0.28.5, 0.28.6, 0.28.7, 0.28.8 (info)
Dependencies array (<0.5), base (>=2 && <4.6), containers (<0.5), directory (<1.2), filepath (<1.4), language-c (>=0.3.1.1 && <0.4.0), pretty (<1.2), process (<1.2) [details]
Tested with ghc ==6.10.4, ghc ==6.12.1
License GPL-2.0-only
Copyright Copyright (c) 1999-2007 Manuel M T Chakravarty 2005-2008 Duncan Coutts 2008 Benedikt Huber
Author Manuel M T Chakravarty
Maintainer chak@cse.unsw.edu.au, duncan@haskell.org
Revised Revision 1 made by HerbertValerioRiedel at 2017-01-15T20:46:58Z
Category Development
Home page http://www.cse.unsw.edu.au/~chak/haskell/c2hs/
Bug tracker http://hackage.haskell.org/trac/c2hs/
Source repo head: darcs get http://code.haskell.org/c2hs/
Uploaded by DuncanCoutts at 2010-04-22T17:19:41Z
Distributions Arch:0.28.8, Debian:0.28.8, Fedora:0.28.8, FreeBSD:0.26.1, LTSHaskell:0.28.8, NixOS:0.28.8, Stackage:0.28.8, openSUSE:0.28.8
Reverse Dependencies 1 direct, 0 indirect [details]
Executables c2hs
Downloads 64012 total (210 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-30 [all 8 reports]

Readme for c2hs-0.16.2

[back to package description]
               C->Haskell - Haskell Interface Generator              -*-text-*-
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C->Haskell 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---called the binding file---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 at

  http://www.cse.unsw.edu.au/~chak/haskell/c2hs/

Also see the tutorial in `doc/c2hs/'.


Contents:

  AUTHORS       -- Author information
  COPYING       -- GNU General Public License (GPL)
  INSTALL       -- Help on installing this package
  README        -- This file
  Setup.hs      -- Cabal build script
  TODO          -- Open problems, bugs, and ideas for future extensions
  c2hs.cabal    -- Cabal package specification
  doc           -- Documentation
  src           -- Source code
  src/C2HS      -- Main program sources
  src/Main.hs   -- Compilation driver
  tests         -- Small test cases


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 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 C->Haskell (ie, closed proprietary licenses are
      possible, too).  In other words, I do not care what you use C->Haskell
      for or to whom you are giving C->Haskell or any interfaces generated with
      C->Haskell, only if you modify or improve C->Haskell 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'.