From 4cb45daba4b6b1c32f2f0dd7195daebe531cb335 Mon Sep 17 00:00:00 2001 From: Adam Brouwers-Harries Date: Tue, 12 Dec 2023 21:59:02 +0000 Subject: [PATCH] [doc] add note regarding C header inclusion to FFI documentation --- docs/source/ffi/ffi.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/ffi/ffi.rst b/docs/source/ffi/ffi.rst index 3ba431c47..1a68648a4 100644 --- a/docs/source/ffi/ffi.rst +++ b/docs/source/ffi/ffi.rst @@ -29,6 +29,14 @@ the library. In this document, we will assume the default Chez Scheme code generator (the examples also work with the Racket or Gambit code generator) and that the foreign language is C. +FFI declarations for C functions can also, optionally, take a C header file to +be ``#include``'d in the C code generated by the Idris2 compiler. For instance: + +.. code-block:: idris + + %foreign "C:idris2_resetRawMode, libidris2_support, idris_support.h" + idris2_resetRawMode : (1 x : %World) -> IORes () + Scheme Details ---------------