c2hs

C->Haskell FFI tool that gives some cross-language type safety https://github.com/haskell/c2hs

Version on this page:0.28.2
LTS Haskell 9.18:0.28.2
Stackage Nightly 2017-12-10:0.28.3
Latest on Hackage:0.28.3
GPL-2 licensed by Manuel M T Chakravarty
Maintained by chak@cse.unsw.edu.au, duncan@community.haskell.org, ian@skybluetrades.net, aditya.siram@gmail.com

Module documentation for 0.28.2

There are no documented modules for this package.

Compiler Toolkit - Light -*-text-*-
========================

Contents:

README.CTKlight -- This file
LICENSE.LIB -- GNU Library General Public License (LGPL)
BaseVersion.hs -- Version, copyright, and disclaimer
Config.hs -- Configuration module
Common.hs -- Basic definitions, such as representation of positions
DLists.hs -- Difference lists - provide O(1) append
Errors.hs -- Types and functions for error handling
FNameOps.hs -- Common operations on file names
FiniteMaps.hs -- Finite maps based on 2-3 trees
GetOpt.hs -- Sven Panne's Haskell version of the GNU getopt library
Lexers.hs -- Self-optimising lexer combinators
Parsers.hs -- Self-optimising parser combinators
Pretty.hs -- Pretty printing combinators (the interface is essentially
a superset of SimonPJ's pretty printing library)
Sets.hs -- Sets as an instance of the above mentioned finite maps
Utils.hs -- Utility routines

The Compiler Toolkit Light (CTKlight) is a subset of the Compiler Toolkit
(CTK) - an infrastructure for writing compilers in Haskell. CTKlight
essentially provides support for implementing syntactical analysis without the
more heavy-weight state management (like compiler switches, global error pool,
and exceptions), identifier and attribute management, and various other
utilities included in the full CTK. Both packages can be obtained from

http://www.cse.unsw.edu.au/~chak/ctk/


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- BUILDING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

In contrast to full CTK, CTKlight is simply a set of Haskell modules without
any complicated makefile structure. The code is Haskell 98 compliant with the
exception that `Parser.hs' makes use of existentially quantified type
variables - unfortunately, I do not believe that the same method of
self-optimisation would work without existential types.

The modules are tested with

* GHC 4.02 and upwards (use `-fglasgow-exts' to compile `Parsers.hs') and
* Hugs98 (use `-98' when using `Parsers.hs').

If you want autoconf, a ready-made makefile structure, and much more
additional library functionality, then use full CTK.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COPYLEFT -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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

This library 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 Library General Public License for more
details.

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

Note: In essence this means that you can use this library in any program
whether it is free or proprietary. However, if you modify or extend the
library itself, you are bound to distribute these modifications or
extensions according to the terms and conditions of the LGPL. For
details consult the license itself, which is located in the file
`LICENSE.LIB'.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- CREDITS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Author & Maintainer: Manuel M. T. Chakravarty <chak@cse.unsw.edu.au>

Thanks to Simon L. Peyton Jones <simonpj@microsoft.com> and Roman Lechtchinsky
<wolfro@cs.tu-berlin.de> for their helpful suggestions that improved the
design and implementation of the `Lexers' module.

Changes

0.28.3
- Switch to language-c 0.7.1 [#192]
0.28.2
- Switch to language-c 0.6 [#176]
0.28.1
- Switch to language-c 0.5 [#157]
- Fix class hook problem with imports [#155]

0.27.1
- Alternate specification for sizes in "+" parameters [#140]
- Fix regression to do with incomplete structure types [#152]
- Fix pattern match error [PR #153] (deech)

0.26.2
- Missing import bug [#151]
- Parameter count checking for {#fun ...#} [#149]
- Error message for "incomplete types" [#141]

0.26.1
- Better error messages [PR #139] (Noam Lewis)
- Fix for OS X block syntax [#138] (Anthony Cowley)
- Minimal support for va_list [PR #137] (Andy Adams-Moran)
- Reorganise treatment of standard library imports used by C2HS
[#136] (https://github.com/haskell/c2hs/blob/master/import-handling.md)
- C structure tag/typedef confusion bug (caused problems for flock on
OS X) [#134]
- C typedefs to void pointers [#133]
- Bool wrappers for unnamed parameters in C function definitions
[#131]
- Incorrect wrapping of some pure C functions [#130]

0.25.2
- Test fixes to work with GHC 7.10.1

0.25.1
- Marshalling for C bool values [#128]

0.24.1
- Revert bad fix for bool handling [#127]
- Wrapper generation for bare structure arguments [#117] plus custom
setup script to support Cabal builds on versions of Cabal without
explicit support for extra C sources generated by preprocessors
(@RyanGIScott)
- Arrays in structuress bug [#123]
- Test fixes for Windows

0.23.1
- Typedef and default marshalling hooks [#20, #25, #48]
- Test fixes for 32-bit platforms (J├╝rgen Keck: @j-keck)
- Multi-character constants for OS X [#15]
- Better support for binding to variadic functions [#102]

0.22.1
- First (not very good) implementation of support for variadic
functions [#102]
- Default marshallers for Char types [#98]
- Improve sizeof computations [#9, #10]

0.21.1
- Parametrized pointer types in pointer hooks [#36]
- Special "+" parameters for efficient foreign pointer marshalling [#46]
- Add default marshallers for C types [#83]
- Fix treatment of arrays within structs [#115]
- Add ability to omit given enum values [#116]
- Regression suite tidy-ups


0.20.1
- Get CUDA Travis tests working again (hopefully...)
- Modify approach for defining C2HS_MIN_VERSION macro to work with
NVIDIA's nvcc CUDA compiler [#111]
- Fix problem with parser for {#enum ...#} renamings [#113]


0.19.1
- Add {#const ...#} hook for accessing #defined constants [#65]
- Persist enumeration definitions across modules [#103]
- Add nocode keyword for enumeration definitions [#70]
- Bump version for language-c to fix OS X problems [#82, #85] (thanks to
Anthony Cowley and Benedikt Huber for help with this)
- Add finalizer support to foreign pointer definitions [#73]
- Comment parsing cleanups (Sivert Berg: @sivertb)


0.18.2
- Add C2HS_MIN_VERSION(major,minor,revision) preprocessor macro
- Suppress regression suite build (and associated dependency
installation) for non-Travis cases
- Fix Cabal file to include previously missing tests


0.18.1
- Numerous improvements to Enum handling [#78] (Philipp Balzarek:
@Philonous)
- Handle Haddock comments within C2HS hook definitions [#62] (@tangboyun)
- Better error messages for missing files (Zejun Wu: @watashi)
- Write CHS dump files to output directory (Zejun Wu: @watashi)
- Handle C calling conventions within function pointer declarations [#88]
(Michael Steele: @mikesteele81)
- Fix FreeBSD libssh2 problem [#87] (Cindy Wang: @CindyLinz)
- Better error messages for hook syntax errors (Ryan Scott: @RyanGIScott)
- Fixes for GHC 7.9 [#100] (@int-index)
- Fix test suite to use C2HS from dist directory [#81]
- Allow free intermixing of command line options and input files [#86]
- Treat CLang "block" syntax and other "non-GNU" issues differently:
always undefine __BLOCKS__ CPP symbol to avoid problems with blocks;
add nonGNU directive to trigger undefine of GNU-specific pre-processor
symbols [#77]
- Handle indented CPP directives correctly [#80]
- Handle #sizeof and #alignof on non-typedef's structures [#95]
- Fix #get and #set hooks to access newtyped pointers [#96]
- Fix round-trip problem for interface files caused by changes in
language-c [#87]
- Treat "with" specially so that it can appear both as a marshaller
identifier in an input parameter definition and as a keyword in enum
definitions [#93]
- Temporarily disable CUDA regression suite examples (CUDA install
problems on Travis)


0.17.2
- Fix more regressions from 0.16.6 (affected packages included
gnome-keyring, hsndfile and cuda)
- Add regression suite tests to reduce chances of future regressions


0.17.1

- Fix regressions from 0.16.6 (caused by fix for issue #45)
- Version number bump (should have been done in the last release)


0.16.6

- Trivial integer casts in enum defines supporting typedefs [Anton Dessiatov]
- Allow forward definition of enums (issue #23)
- Binding of C enums with aliases (issue #38)
- Default marshallers for enum and pointer hooks (issue #31)
- Remove dependencies on C2HS module from marshalling code (issue #37)
- Problem with MacOS blocks notation (issue #29)
- Include directive on first line produces invalid Haskell (issue #16)
- Add command-line switch to suppress GNU preprocessor symbols (issue #60)
- Fix size and alignment computation of bitfields [Facundo Dominguez]
- Allow prefixes to be replaced, not just removed (issue #19)
- Allow reference to structure tags from accessors (issue #54)
For access paths for {#get#}, {#set#}, etc., one can now specify
that structure tags are to be searched preferentially by saying,
for example, {#get struct _point->y#} instead of {#get _point->y#}.
The latter case will search for typedef names first and only then
structure tags.
- Support for anonymous enums (issue #43)
- with... unwrapper type declarations for pointer hooks (issue #44)
- {#fun...#} indentation for use in where clauses (issue #45)
- incorrect method names from terminal class in superclass
instances (issue #21)
- "offsetof" directive (issue #22)
- --include flag cannot handle windows paths (issue #30)
Now uses System.FilePath splitSearchPath function, which should be
platform-agnostic.
- Void functions produce "defined but not used" warning (issue #47)
Handle fun hooks with a void result using ">>" instead of ">>=".
- Add CPP undefine flags for Gnu compiler defines (issue #51)
- Cabal test suite


0.16.5

- Migration to GitHub; documentation changes.


CHANGES ABOVE THIS POINT ARE FOR VERSIONS AFTER THE MOVE OF THE REPOSITORY
TO GITHUB. FOR EARLIER CHANGES SEE ChangeLog.old.
comments powered byDisqus