ogma-core-1.7.0: Ogma: Helper tool to interoperate between Copilot and other languages.
Safe HaskellNone
LanguageHaskell2010

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 CStructs, and then converts those CStructs 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

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.