-
Notifications
You must be signed in to change notification settings - Fork 1
XML File Format
- Structure elements: <lib>
- Object description elements: <struct>, <object>, <def>
- Function elements: <function>, <method>, <ctor>, <dtor>, <ref>, <unref>
- Attributes and properties elements: <prop>, <field>
- Misc elements: <constant>
The lib element defines an Ender Library. That is, the C library you want to describe.
Content: <struct>, <object>, <constant>, <def>, <function>, <method>
Attributes:
-
name: The name of the library, so for a libenesim.so, use just
enesim -
version: The version of the library, for a libenesim-1.so, use
1 -
case: What case was the library using. Possible values are:
underscorefor symbols likefoo_bar_get,camelcasefor symbols likefooBarGet, andpascalfor symbols likeFooBarGet
Example:
<?xml version="1.0" standalone="yes"?>
<lib name="foo" version="0" case="underscore"/>The above XML will use the library libenesim-0.so.
The object element defines an Ender Object.
Content: <prop>, <function>, <method>, <ctor>, <dtor>, <ref>, <unref>
Attributes:
Example:
The struct element defines an Ender Struct.
Content: <field>, <function>, <method>
Attributes:
Example:
The struct element defines an Ender Def.
Content:
Attributes:
Example:
The method element defines an Ender Function that works for a particular instance of a <struct>, <object> or <def>
Attributes: Example:
The function element defines an Ender Function.
Attributes:
Example:
Content:
Attributes:
Example:
Content:
Attributes:
Example:
Content:
Attributes:
Example:
Content:
Attributes:
Example:
Content:
Attributes:
Example:
Content:
Attributes:
Example:
Content:
Attributes:
Example:
<?xml version="1.0" standalone="yes"?>
<lib name="foo" version="0" case="underscore">
<!-- Define the struct -->
<struct name="foo.s1">
<!-- Now the fields -->
<field name="i" type="i32"/>
<field name="s" type="string"/>
<!-- A method always receives the struct/object as its first argument -->
<method name="has_i">
<return type="i32" transfer="full"/>
</mthod>
</struct>
</lib>