summaryrefslogtreecommitdiff
path: root/BINDINGS_README
blob: e410e42b88c73bc132edad69469d2aa2c3f7bb3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
What to expect when writing bindings.

Eolian allows to define enums structs and classes. To support all this eolian also contains a set of builtin types.

The builtin types must be somehow binded into the language of choice. (FIXME should anything between INVALID and SLICE ever be passed by ref ?)

Enums consist of fields, which have a int value. When writing bindings to a enum, you need to ensure that the correct int value is passed to the implementation using a enum

Structs can come up in 2 different kinds, opaque, and not opaque.
  A opaque struct simply defines over the address it has, it cannot be created from the bindings side, but is the result of a method call to a implementation in some sort. It is importent that this address is preserved in the binded entity, so the address will be passed to a function requiring it.
  A none opaque struct consits out of fields, each field has a name and a type. The identification of content should never go over the reference to such a struct, only over the content.

Objects do have properties and methods. if a return / field is passed by @by_ref this property is not on the type, but on the return / field API.

If this was not clear up to this point. you will need to migrate the structs / enums / parameters / objects a lot when calling from your language to C and from C back to your language. Therefore you need the possitibility to create wrappers for Eo objects after the eo object is finalized. As well as creating new structs, and create a struct object over a existing pointer.

To clarify: the builtin time is expected to be a long that destribes the time in a unix manner.