summaryrefslogtreecommitdiffstats
path: root/tests/minimalbinding/typesystem_minimal.xml
blob: d4f673d2de21c04824c649378b62eaca07fd9a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?xml version="1.0"?>
<typesystem package="minimal">
    <primitive-type name="bool"/>
    <primitive-type name="int"/>

    <primitive-type name="MinBool" target-lang-api-name="PyBool" default-constructor="MinBool(false)">
        <include file-name="minbool.h" location="global"/>
        <conversion-rule file="minbool_conversions.h">
            <native-to-target>
            return PyBool_FromLong(%in.value());
            </native-to-target>
            <target-to-native>
                <add-conversion type="PyBool" check="PyBool_Check(%in)">
                %out = %OUTTYPE(%in == Py_True);
                </add-conversion>
            </target-to-native>
        </conversion-rule>
    </primitive-type>

    <container-type name="std::list" type="list">
        <conversion-rule file="list_conversions.h"/>
        <include file-name="list" location="global"/>
    </container-type>

    <object-type name="Obj"/>
    <value-type name="Val">
        <enum-type name="ValEnum"/>
    </value-type>
    <value-type name="ListUser"/>
    <value-type name="MinBoolUser"/>
</typesystem>