heptagon/examples/extern_C
Gwenaël Delaval 0a65ffc8e2 Update of example Extern_C 2015-09-17 17:20:31 +02:00
..
README Update of example Extern_C 2015-09-17 17:20:31 +02:00
imports.ept Updated the example 2010-07-27 11:32:58 +02:00
mathext.c Update of example Extern_C 2015-09-17 17:20:31 +02:00
mathext.epi Updated the example 2010-07-27 11:32:58 +02:00
mathext.h Update of example Extern_C 2015-09-17 17:20:31 +02:00

README

This example show how to import an external function written in C in an Heptagon program.

- The .epi file contains the signature of the function in Heptagon.
- Only functions with no side effects can be safely imported.
- The imported function must have the same calling convention as generated code (inputs given by value, outputs in a f_out structure).
- The generated code will include "mathext.h", that should define the step function

To make it work:
   heptc mathext.epi
   heptc -target c imports.ept
   gcc -c -I /usr/local/lib/heptagon/c -I . mathext.c imports_c/*.c