Idris2Doc : System.FFI

System.FFI

Additional FFI help for more interesting C types

Definitions

dataStruct : String->List (String, Type) ->Type
  A struct with a name and a list of key-value pairs of field names and their
types.

Totality: total
Visibility: export
dataFieldType : String->Type->List (String, Type) ->Type
  A proof that the field exists as an entry in the list of field names and
their types.

Totality: total
Visibility: public export
Constructors:
First : FieldTypent ((n, t) ::ts)
Later : FieldTypentts->FieldTypent (f::ts)
getField : Structsnfs-> (n : String) ->FieldTypentyfs=>ty
  Retrieve the value of the specified field in the given `Struct`.

@ s the `Struct` to retrieve the value from
@ n the name of the field in the `Struct`.

Totality: total
Visibility: public export
setField : Structsnfs-> (n : String) ->FieldTypentyfs=>ty->IO ()
  Set the value of the specified field in the given `Struct`.

@ s the `Struct` in which the field exists
@ n the name of the field to set
@ val the value to set the field to

Totality: total
Visibility: public export
malloc : HasIOio=>Int->ioAnyPtr
  Allocate memory with libc `malloc`.

@ size the number of bytes to allocate

Totality: total
Visibility: export
free : HasIOio=>AnyPtr->io ()
  Release memory with libc `free`.

Totality: total
Visibility: export