ogma-core-1.10.0: Ogma: Helper tool to interoperate between Copilot and other languages.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Command.CStructs2Copilot

Description

Generate Copilot struct definitions and instances from structs defined in a C header file.

Working with Copilot structs requires three definitions: the datatype, a `Struct` instance, and a `Typed` instance.

This module converts the C structs into `CStruct`s, and then converts those `CStruct`s into Copilot (i.e., Haskell) data type declarations and instance declarations. The result is then printed to a file. This module makes use of Language.Trans.CStructs2Copilot, which does most of the work.

Synopsis

- cstructs2Copilot :: FilePath -> IO (Result ErrorCode)
- type ErrorCode = Int

# Documentation

cstructs2Copilot Source #

Arguments

:: FilePath | Path to a readable, valid C header file containing struct definitions.
-> IO (Result ErrorCode) |

Generate Copilot struct definitions and instances from structs defined in a C header file.

type ErrorCode = Int Source #

Encoding of reasons why the command can fail.

The error code used is 1 for user error.