Skip to content

Instantly share code, notes, and snippets.

@remogatto
Created February 6, 2009 15:19
Show Gist options
  • Save remogatto/59438 to your computer and use it in GitHub Desktop.
Save remogatto/59438 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
@indent = ' ' * 2
@typedefs = {}
doc = Nokogiri::XML(File.open(ARGV[0]))
def get_symname(node)
node.xpath("attributelist/attribute[@name='sym_name']").first['value']
end
def get_name(node)
node.xpath("attributelist/attribute[@name='name']").first['value']
end
def get_type(node)
node.xpath("attributelist/attribute[@name='type']").first['value']
end
def get_value(node)
node.xpath("attributelist/attribute[@name='value']").first['value']
end
def get_verbatim(node)
node.xpath("attributelist/attribute[@name='code']").first['value']
end
def get_func_args(node)
parmlist = node.xpath("attributelist/parmlist/parm")
end
def is_function_decl?(node)
node.xpath("attributelist/attribute[@name='kind']").first['value'] == 'function'
end
def is_typedef_decl?(node)
node.xpath("attributelist/attribute[@name='kind']").first['value'] == 'typedef'
end
def is_insert_runtime?(node)
section = node.xpath("attributelist/attribute[@name='section']")
section.first['value'] == 'runtime' if section.first
end
def puts_constant(name, value)
puts @indent + "#{name} = #{value}"
end
def to_ffi_type(type)
return 'pointer' if type[/^p\./]
return @typedefs[type] if @typedefs.has_key?(type)
type
end
def puts_function(name, params_node, r_value)
params = []
params_node.each do |v|
params << to_ffi_type(get_type(v))
end
params.collect! {|p| ":#{p}"}
puts @indent + "attach_function :#{name}, [ #{params.join(', ')} ], :#{to_ffi_type(r_value)}"
end
def puts_verbatim(node)
puts @indent + get_verbatim(node)
end
doc.traverse do |node|
if node.name == 'constant'
puts_constant(get_symname(node), get_value(node))
elsif node.name == 'cdecl' and is_function_decl?(node)
puts_function(get_symname(node), get_func_args(node), get_type(node))
elsif node.name == 'cdecl' and is_typedef_decl?(node)
@typedefs[get_symname(node)] = get_type(node)
elsif node.name == 'insert' and not is_insert_runtime?(node)
puts_verbatim(node)
end
end
%module libtest
%{
module LibTest
extend FFI::Library
%}
#define CONST_1 0x10
#define CONST_2 0x20
#define CONST_3 0.1f
typedef int i32;
struct test_struct {
int i;
float f;
};
i32 test_func_1(char c, int i);
void test_func_2(void *ptr);
%{
end
%}
module LibTest
extend FFI::Library
CONST_1 = 0x10
CONST_2 = 0x20
CONST_3 = 0.1
attach_function :test_func_1, [ :char, :int ], :int
attach_function :test_func_2, [ :pointer ], :void
end
<?xml version="1.0" ?>
<top id="1" addr="b7dfd948" >
<attributelist id="2" addr="b7dfd948" >
<attribute name="outfile" value="libtest_wrap.xml" id="3" addr="b7e06ab8" />
<attribute name="name" value="libtest" id="4" addr="b7e06ab8" />
<attribute name="module" value="libtest" id="5" addr="b7e05a48" />
<attribute name="classes" value="b7e06148" id="6" addr="b7e06148" />
<attribute name="infile" value="libtest.i" id="7" addr="b7e06ab8" />
<attribute name="outfile_h" value="libtest_wrap.h" id="8" addr="b7e06ab8" />
</attributelist >
<include id="9" addr="b7e04868" >
<attributelist id="10" addr="b7e04868" >
<attribute name="name" value="/usr/share/swig1.3//swig.swg" id="11" addr="b7e06ab8" />
</attributelist >
<include id="12" addr="b7e04988" >
<attributelist id="13" addr="b7e04988" >
<attribute name="name" value="/usr/share/swig1.3//swigwarnings.swg" id="14" addr="b7e06ab8" />
</attributelist >
<include id="15" addr="b7e049c8" >
<attributelist id="16" addr="b7e049c8" >
<attribute name="name" value="/usr/share/swig1.3//swigwarn.swg" id="17" addr="b7e06ab8" />
</attributelist >
</include >
</include >
<typemap id="18" addr="b7e04b38" >
<attributelist id="19" addr="b7e04b38" >
<attribute name="code" value="free($1);" id="20" addr="b7e06ab8" />
<attribute name="method" value="newfree" id="21" addr="b7e06ab8" />
</attributelist >
<typemapitem id="22" addr="b7e04aa8" >
<attributelist id="23" addr="b7e04aa8" >
<parmlist id="24" addr="b7e04ac8" >
<parm id="25">
<attributelist id="26" addr="b7e04ac8" >
<attribute name="type" value="p.char" id="27" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="28" addr="b7e04c48" >
<attributelist id="29" addr="b7e04c48" >
<attribute name="code" value="{&#10; if ($1) free((char *)$1);&#10; if ($input) {&#10; $1 = ($1_type) malloc(strlen((const char *)$input)+1);&#10; strcpy((char *)$1, (const char *)$input);&#10; } else {&#10; $1 = 0;&#10; }&#10;}" id="30" addr="b7e06ab8" />
<attribute name="method" value="memberin" id="31" addr="b7e06ab8" />
</attributelist >
<typemapitem id="32" addr="b7e04be8" >
<attributelist id="33" addr="b7e04be8" >
<parmlist id="34" addr="b7e04c08" >
<parm id="35">
<attributelist id="36" addr="b7e04c08" >
<attribute name="type" value="p.char" id="37" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="38" addr="b7e04d78" >
<attributelist id="39" addr="b7e04d78" >
<kwargs id="40" addr="b7e04c78" >
<attributelist id="41" addr="b7e04c78" >
<attribute name="name" value="warning" id="42" addr="b7e06ab8" />
<attribute name="value" value="451:Setting a const char * variable may leak memory." id="43" addr="b7e06ab8" />
</attributelist >
<kwargssitem id="44" addr="b7e04c88" >
<attributelist id="45" addr="b7e04c88" >
</attributelist >
</kwargssitem >
<kwargssitem id="46" addr="b7e04ca8" >
<attributelist id="47" addr="b7e04ca8" >
</attributelist >
</kwargssitem >
</kwargs >
<attribute name="code" value="{&#10; if ($input) {&#10; $1 = ($1_type) malloc(strlen((const char *)$input)+1);&#10; strcpy((char *)$1, (const char *)$input);&#10; } else {&#10; $1 = 0;&#10; }&#10;}" id="48" addr="b7e06ab8" />
<attribute name="method" value="memberin" id="49" addr="b7e06ab8" />
</attributelist >
<typemapitem id="50" addr="b7e04d18" >
<attributelist id="51" addr="b7e04d18" >
<parmlist id="52" addr="b7e04d38" >
<parm id="53">
<attributelist id="54" addr="b7e04d38" >
<attribute name="type" value="p.q(const).char" id="55" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="56" addr="b7e04e68" >
<attributelist id="57" addr="b7e04e68" >
<attribute name="code" value="{&#10; if ($1) free((char *)$1);&#10; if ($input) {&#10; $1 = ($1_type) malloc(strlen((const char *)$input)+1);&#10; strcpy((char *)$1, (const char *)$input);&#10; } else {&#10; $1 = 0;&#10; }&#10;}" id="58" addr="b7e06ab8" />
<attribute name="method" value="globalin" id="59" addr="b7e06ab8" />
</attributelist >
<typemapitem id="60" addr="b7e04e08" >
<attributelist id="61" addr="b7e04e08" >
<parmlist id="62" addr="b7e04e28" >
<parm id="63">
<attributelist id="64" addr="b7e04e28" >
<attribute name="type" value="p.char" id="65" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="66" addr="b7e04f88" >
<attributelist id="67" addr="b7e04f88" >
<kwargs id="68" addr="b7e04e98" >
<attributelist id="69" addr="b7e04e98" >
<attribute name="name" value="warning" id="70" addr="b7e06ab8" />
<attribute name="value" value="451:Setting a const char * variable may leak memory." id="71" addr="b7e06ab8" />
</attributelist >
<kwargssitem id="72" addr="b7e04ea8" >
<attributelist id="73" addr="b7e04ea8" >
</attributelist >
</kwargssitem >
<kwargssitem id="74" addr="b7e04eb8" >
<attributelist id="75" addr="b7e04eb8" >
</attributelist >
</kwargssitem >
</kwargs >
<attribute name="code" value="{&#10; if ($input) {&#10; $1 = ($1_type) malloc(strlen((const char *)$input)+1);&#10; strcpy((char *)$1, (const char *)$input);&#10; } else {&#10; $1 = 0;&#10; }&#10;}" id="76" addr="b7e06ab8" />
<attribute name="method" value="globalin" id="77" addr="b7e06ab8" />
</attributelist >
<typemapitem id="78" addr="b7e04f28" >
<attributelist id="79" addr="b7e04f28" >
<parmlist id="80" addr="b7e04f48" >
<parm id="81">
<attributelist id="82" addr="b7e04f48" >
<attribute name="type" value="p.q(const).char" id="83" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="84" addr="b7e05098" >
<attributelist id="85" addr="b7e05098" >
<attribute name="code" value="{&#10; if ($input) strncpy((char *)$1, (const char *)$input, $1_dim0);&#10; else $1[0] = 0;&#10;}" id="86" addr="b7e06ab8" />
<attribute name="method" value="memberin" id="87" addr="b7e06ab8" />
</attributelist >
<typemapitem id="88" addr="b7e05038" >
<attributelist id="89" addr="b7e05038" >
<parmlist id="90" addr="b7e05058" >
<parm id="91">
<attributelist id="92" addr="b7e05058" >
<attribute name="type" value="a(ANY).char" id="93" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="94" addr="b7e05198" >
<attributelist id="95" addr="b7e05198" >
<attribute name="code" value="{&#10; if ($input) strncpy((char *)$1, (const char *)$input, $1_dim0);&#10; else $1[0] = 0;&#10;}" id="96" addr="b7e06ab8" />
<attribute name="method" value="globalin" id="97" addr="b7e06ab8" />
</attributelist >
<typemapitem id="98" addr="b7e05138" >
<attributelist id="99" addr="b7e05138" >
<parmlist id="100" addr="b7e05158" >
<parm id="101">
<attributelist id="102" addr="b7e05158" >
<attribute name="type" value="a(ANY).char" id="103" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="104" addr="b7e05278" >
<attributelist id="105" addr="b7e05278" >
<attribute name="code" value="{&#10; if ($input) strcpy((char *)$1, (const char *)$input);&#10; else $1[0] = 0;&#10;}" id="106" addr="b7e06ab8" />
<attribute name="method" value="memberin" id="107" addr="b7e06ab8" />
</attributelist >
<typemapitem id="108" addr="b7e05218" >
<attributelist id="109" addr="b7e05218" >
<parmlist id="110" addr="b7e05238" >
<parm id="111">
<attributelist id="112" addr="b7e05238" >
<attribute name="type" value="a().char" id="113" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="114" addr="b7e05358" >
<attributelist id="115" addr="b7e05358" >
<attribute name="code" value="{&#10; if ($input) strcpy((char *)$1, (const char *)$input);&#10; else $1[0] = 0;&#10;}" id="116" addr="b7e06ab8" />
<attribute name="method" value="globalin" id="117" addr="b7e06ab8" />
</attributelist >
<typemapitem id="118" addr="b7e052f8" >
<attributelist id="119" addr="b7e052f8" >
<parmlist id="120" addr="b7e05318" >
<parm id="121">
<attributelist id="122" addr="b7e05318" >
<attribute name="type" value="a().char" id="123" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="124" addr="b7e05458" >
<attributelist id="125" addr="b7e05458" >
<attribute name="code" value="{&#10; size_t ii;&#10; $1_basetype *b = ($1_basetype *) $1;&#10; for (ii = 0; ii &lt; (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);&#10;}" id="126" addr="b7e06ab8" />
<attribute name="method" value="memberin" id="127" addr="b7e06ab8" />
</attributelist >
<typemapitem id="128" addr="b7e053f8" >
<attributelist id="129" addr="b7e053f8" >
<parmlist id="130" addr="b7e05418" >
<parm id="131">
<attributelist id="132" addr="b7e05418" >
<attribute name="type" value="a(ANY).SWIGTYPE" id="133" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="134" addr="b7e05558" >
<attributelist id="135" addr="b7e05558" >
<attribute name="code" value="{&#10; size_t ii;&#10; $1_basetype *b = ($1_basetype *) $1;&#10; for (ii = 0; ii &lt; (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);&#10;}" id="136" addr="b7e06ab8" />
<attribute name="method" value="globalin" id="137" addr="b7e06ab8" />
</attributelist >
<typemapitem id="138" addr="b7e054f8" >
<attributelist id="139" addr="b7e054f8" >
<parmlist id="140" addr="b7e05518" >
<parm id="141">
<attributelist id="142" addr="b7e05518" >
<attribute name="type" value="a(ANY).SWIGTYPE" id="143" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="144" addr="b7e05678" >
<attributelist id="145" addr="b7e05678" >
<attribute name="code" value="{&#10; $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input);&#10; $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1);&#10; size_t ii = 0;&#10; for (; ii &lt; $dim0; ++ii) {&#10; $basetype *ip = inp[ii];&#10; $basetype *dp = dest[ii];&#10; size_t jj = 0;&#10; for (; jj &lt; $dim1; ++jj) dp[jj] = ip[jj];&#10; }&#10;}" id="146" addr="b7e06ab8" />
<attribute name="method" value="memberin" id="147" addr="b7e06ab8" />
</attributelist >
<typemapitem id="148" addr="b7e055e8" >
<attributelist id="149" addr="b7e055e8" >
<parmlist id="150" addr="b7e05638" >
<parm id="151">
<attributelist id="152" addr="b7e05638" >
<attribute name="type" value="a(ANY).a(ANY).SWIGTYPE" id="153" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="154" addr="b7e05798" >
<attributelist id="155" addr="b7e05798" >
<attribute name="code" value="{&#10; $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input);&#10; $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1);&#10; size_t ii = 0;&#10; for (; ii &lt; $dim0; ++ii) {&#10; $basetype *ip = inp[ii];&#10; $basetype *dp = dest[ii];&#10; size_t jj = 0;&#10; for (; jj &lt; $dim1; ++jj) dp[jj] = ip[jj];&#10; }&#10;}" id="156" addr="b7e06ab8" />
<attribute name="method" value="globalin" id="157" addr="b7e06ab8" />
</attributelist >
<typemapitem id="158" addr="b7e05708" >
<attributelist id="159" addr="b7e05708" >
<parmlist id="160" addr="b7e05758" >
<parm id="161">
<attributelist id="162" addr="b7e05758" >
<attribute name="type" value="a(ANY).a(ANY).SWIGTYPE" id="163" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<typemap id="164" addr="b7e05998" >
<attributelist id="165" addr="b7e05998" >
<kwargs id="166" addr="b7e057d8" >
<attributelist id="167" addr="b7e057d8" >
<attribute name="name" value="numinputs" id="168" addr="b7e06ab8" />
<attribute name="value" value="0" id="169" addr="b7e06ab8" />
</attributelist >
<kwargssitem id="170" addr="b7e057e8" >
<attributelist id="171" addr="b7e057e8" >
</attributelist >
</kwargssitem >
<kwargssitem id="172" addr="b7e057f8" >
<attributelist id="173" addr="b7e057f8" >
</attributelist >
</kwargssitem >
</kwargs >
<attribute name="code" value="" id="174" addr="b7e06ab8" />
<attribute name="method" value="in" id="175" addr="b7e06ab8" />
</attributelist >
<typemapitem id="176" addr="b7e05878" >
<attributelist id="177" addr="b7e05878" >
<parmlist id="178" addr="b7e05898" >
<parm id="179">
<attributelist id="180" addr="b7e05898" >
<attribute name="name" value="VARARGS_SENTINEL" id="181" addr="b7e06ab8" />
<attribute name="type" value="p.SWIGTYPE" id="182" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
<typemapitem id="183" addr="b7e05928" >
<attributelist id="184" addr="b7e05928" >
<parmlist id="185" addr="b7e05948" >
<parm id="186">
<attributelist id="187" addr="b7e05948" >
<attribute name="name" value="VARARGS_SENTINEL" id="188" addr="b7e06ab8" />
<attribute name="type" value="SWIGTYPE" id="189" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
</attributelist >
</typemapitem >
</typemap >
<insert id="190" addr="b7e059d8" >
<attributelist id="191" addr="b7e059d8" >
<attribute name="code" value="/* -----------------------------------------------------------------------------&#10; * This section contains generic SWIG labels for method/variable&#10; * declarations/attributes, and other compiler dependent labels.&#10; * ----------------------------------------------------------------------------- */&#10;&#10;/* template workaround for compilers that cannot correctly implement the C++ standard */&#10;#ifndef SWIGTEMPLATEDISAMBIGUATOR&#10;# if defined(__SUNPRO_CC) &amp;&amp; (__SUNPRO_CC &lt;= 0x560)&#10;# define SWIGTEMPLATEDISAMBIGUATOR template&#10;# elif defined(__HP_aCC)&#10;/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */&#10;/* If we find a maximum version that requires this, the test would be __HP_aCC &lt;= 35500 for A.03.55 */&#10;# define SWIGTEMPLATEDISAMBIGUATOR template&#10;# else&#10;# define SWIGTEMPLATEDISAMBIGUATOR&#10;# endif&#10;#endif&#10;&#10;/* inline attribute */&#10;#ifndef SWIGINLINE&#10;# if defined(__cplusplus) || (defined(__GNUC__) &amp;&amp; !defined(__STRICT_ANSI__))&#10;# define SWIGINLINE inline&#10;# else&#10;# define SWIGINLINE&#10;# endif&#10;#endif&#10;&#10;/* attribute recognised by some compilers to avoid 'unused' warnings */&#10;#ifndef SWIGUNUSED&#10;# if defined(__GNUC__)&#10;# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 &amp;&amp; __GNUC_MINOR__ >= 4))&#10;# define SWIGUNUSED __attribute__ ((__unused__)) &#10;# else&#10;# define SWIGUNUSED&#10;# endif&#10;# elif defined(__ICC)&#10;# define SWIGUNUSED __attribute__ ((__unused__)) &#10;# else&#10;# define SWIGUNUSED &#10;# endif&#10;#endif&#10;&#10;#ifndef SWIGUNUSEDPARM&#10;# ifdef __cplusplus&#10;# define SWIGUNUSEDPARM(p)&#10;# else&#10;# define SWIGUNUSEDPARM(p) p SWIGUNUSED &#10;# endif&#10;#endif&#10;&#10;/* internal SWIG method */&#10;#ifndef SWIGINTERN&#10;# define SWIGINTERN static SWIGUNUSED&#10;#endif&#10;&#10;/* internal inline SWIG method */&#10;#ifndef SWIGINTERNINLINE&#10;# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE&#10;#endif&#10;&#10;/* exporting methods */&#10;#if (__GNUC__ >= 4) || (__GNUC__ == 3 &amp;&amp; __GNUC_MINOR__ >= 4)&#10;# ifndef GCC_HASCLASSVISIBILITY&#10;# define GCC_HASCLASSVISIBILITY&#10;# endif&#10;#endif&#10;&#10;#ifndef SWIGEXPORT&#10;# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)&#10;# if defined(STATIC_LINKED)&#10;# define SWIGEXPORT&#10;# else&#10;# define SWIGEXPORT __declspec(dllexport)&#10;# endif&#10;# else&#10;# if defined(__GNUC__) &amp;&amp; defined(GCC_HASCLASSVISIBILITY)&#10;# define SWIGEXPORT __attribute__ ((visibility(&quot;default&quot;)))&#10;# else&#10;# define SWIGEXPORT&#10;# endif&#10;# endif&#10;#endif&#10;&#10;/* calling conventions for Windows */&#10;#ifndef SWIGSTDCALL&#10;# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)&#10;# define SWIGSTDCALL __stdcall&#10;# else&#10;# define SWIGSTDCALL&#10;# endif &#10;#endif&#10;&#10;/* Deal with Microsoft's attempt at deprecating C standard runtime functions */&#10;#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) &amp;&amp; defined(_MSC_VER) &amp;&amp; !defined(_CRT_SECURE_NO_DEPRECATE)&#10;# define _CRT_SECURE_NO_DEPRECATE&#10;#endif&#10;&#10;/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */&#10;#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) &amp;&amp; defined(_MSC_VER) &amp;&amp; !defined(_SCL_SECURE_NO_DEPRECATE)&#10;# define _SCL_SECURE_NO_DEPRECATE&#10;#endif&#10;&#10;" id="192" addr="b7e06ab8" />
<attribute name="section" value="runtime" id="193" addr="b7e06ab8" />
</attributelist >
</insert >
</include >
<include id="194" addr="b7e05a68" >
<attributelist id="195" addr="b7e05a68" >
<attribute name="name" value="libtest.i" id="196" addr="b7e06ab8" />
<attribute name="module" value="" id="197" addr="b7e05a98" />
</attributelist >
<module id="198" addr="b7e05a48" >
<attributelist id="199" addr="b7e05a48" >
<attribute name="name" value="libtest" id="200" addr="b7e06ab8" />
</attributelist >
</module >
<insert id="201" addr="b7e05ab8" >
<attributelist id="202" addr="b7e05ab8" >
<attribute name="code" value="&#10;module LibTest&#10; extend FFI::Library&#10;&#10;" id="203" addr="b7e06ab8" />
</attributelist >
</insert >
<constant id="204" addr="b7e05af8" >
<attributelist id="205" addr="b7e05af8" >
<attribute name="sym_name" value="CONST_1" id="206" addr="b7e06ab8" />
<attribute name="name" value="CONST_1" id="207" addr="b7e06ab8" />
<attribute name="feature_immutable" value="1" id="208" addr="b7e06ab8" />
<attribute name="value" value="0x10" id="209" addr="b7e06ab8" />
<attribute name="storage" value="%constant" id="210" addr="b7e06ab8" />
<attribute name="type" value="int" id="211" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7dfd3a8" id="212" addr="b7dfd3a8" />
<attribute name="sym_overname" value="__SWIG_0" id="213" addr="b7e06ab8" />
</attributelist >
</constant >
<constant id="214" addr="b7e05c18" >
<attributelist id="215" addr="b7e05c18" >
<attribute name="sym_name" value="CONST_2" id="216" addr="b7e06ab8" />
<attribute name="name" value="CONST_2" id="217" addr="b7e06ab8" />
<attribute name="feature_immutable" value="1" id="218" addr="b7e06ab8" />
<attribute name="value" value="0x20" id="219" addr="b7e06ab8" />
<attribute name="storage" value="%constant" id="220" addr="b7e06ab8" />
<attribute name="type" value="int" id="221" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7dfd3a8" id="222" addr="b7dfd3a8" />
<attribute name="sym_overname" value="__SWIG_0" id="223" addr="b7e06ab8" />
</attributelist >
</constant >
<constant id="224" addr="b7e05ca8" >
<attributelist id="225" addr="b7e05ca8" >
<attribute name="sym_name" value="CONST_3" id="226" addr="b7e06ab8" />
<attribute name="name" value="CONST_3" id="227" addr="b7e06ab8" />
<attribute name="feature_immutable" value="1" id="228" addr="b7e06ab8" />
<attribute name="value" value="0.1" id="229" addr="b7e06ab8" />
<attribute name="storage" value="%constant" id="230" addr="b7e06ab8" />
<attribute name="type" value="double" id="231" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7dfd3a8" id="232" addr="b7dfd3a8" />
<attribute name="sym_overname" value="__SWIG_0" id="233" addr="b7e06ab8" />
</attributelist >
</constant >
<cdecl id="234" addr="b7e05d68" >
<attributelist id="235" addr="b7e05d68" >
<attribute name="sym_name" value="i32" id="236" addr="b7e06ab8" />
<attribute name="name" value="i32" id="237" addr="b7e06ab8" />
<attribute name="decl" value="" id="238" addr="b7e06ab8" />
<attribute name="storage" value="typedef" id="239" addr="b7e06ab8" />
<attribute name="kind" value="typedef" id="240" addr="b7e06ab8" />
<attribute name="type" value="int" id="241" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7dfd3a8" id="242" addr="b7dfd3a8" />
<attribute name="sym_overname" value="__SWIG_0" id="243" addr="b7e06ab8" />
</attributelist >
</cdecl >
<class id="244" addr="b7e05e38" >
<attributelist id="245" addr="b7e05e38" >
<attribute name="name" value="test_struct" id="246" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7dfd3a8" id="247" addr="b7dfd3a8" />
<attribute name="symtab" value="b7e05eb8" id="248" addr="b7e05eb8" />
<attribute name="allows_typedef" value="1" id="249" addr="b7e06ab8" />
<attribute name="typepass_visit" value="1" id="250" addr="b7e06ab8" />
<attribute name="allocate_visit" value="1" id="251" addr="b7e06ab8" />
<attribute name="kind" value="struct" id="252" addr="b7e06ab8" />
<attribute name="sym_name" value="test_struct" id="253" addr="b7e06ab8" />
<attribute name="allocate_default_constructor" value="1" id="254" addr="b7e06ab8" />
<attribute name="allocate_default_destructor" value="1" id="255" addr="b7e06ab8" />
<attribute name="allocate_copy_constructor" value="1" id="256" addr="b7e06ab8" />
<attribute name="module" value="libtest" id="257" addr="b7e05a48" />
<attribute name="sym_overname" value="__SWIG_0" id="258" addr="b7e06ab8" />
<typescope id="259" addr="b7e066a8" >
<attributelist id="260" addr="b7e066a8" >
<attribute name="name" value="test_struct" id="261" addr="b7e06ab8" />
<typetab id="262" addr="b7e066b8" >
<attributelist id="263" addr="b7e066b8" >
</attributelist >
</typetab >
<attribute name="parent" value="b7dfd428" id="264" addr="b7dfd428" />
<attribute name="qname" value="test_struct" id="265" addr="b7e06ab8" />
<attribute name="symtab" value="b7e05eb8" id="266" addr="b7e05eb8" />
</attributelist >
<typescopesitem id="267" addr="b7e06678" >
<attributelist id="268" addr="b7e06678" >
</attributelist >
</typescopesitem >
<typescopesitem id="269" addr="b7e066b8" >
<attributelist id="270" addr="b7e066b8" >
</attributelist >
</typescopesitem >
<typescopesitem id="271" addr="b7dfd428" >
<attributelist id="272" addr="b7dfd428" >
<attribute name="name" value="" id="273" addr="b7e06ab8" />
<typetab id="274" addr="b7dfd458" >
<attributelist id="275" addr="b7dfd458" >
<attribute name="i32" value="int" id="276" addr="b7e06ab8" />
<attribute name="struct test_struct" value="struct test_struct" id="277" addr="b7e06ab8" />
</attributelist >
<typetabsitem id="278" addr="b7e065b8" >
<attributelist id="279" addr="b7e065b8" >
</attributelist >
</typetabsitem >
<typetabsitem id="280" addr="b7e06638" >
<attributelist id="281" addr="b7e06638" >
</attributelist >
</typetabsitem >
</typetab >
</attributelist >
</typescopesitem >
<typescopesitem id="282" addr="b7e066c8" >
<attributelist id="283" addr="b7e066c8" >
</attributelist >
</typescopesitem >
<typescopesitem id="284" addr="b7e05eb8" >
<attributelist id="285" addr="b7e05eb8" >
<attribute name="name" value="test_struct" id="286" addr="b7e06ab8" />
<attribute name="csymtab" value="b7e05ed8" id="287" addr="b7e05ed8" />
<attribute name="symtab" value="b7e05ea8" id="288" addr="b7e05ea8" />
</attributelist >
</typescopesitem >
</typescope >
</attributelist >
<cdecl id="289" addr="b7e05f58" >
<attributelist id="290" addr="b7e05f58" >
<attribute name="ismember" value="1" id="291" addr="b7e06ab8" />
<attribute name="sym_name" value="i" id="292" addr="b7e06ab8" />
<attribute name="name" value="i" id="293" addr="b7e06ab8" />
<attribute name="decl" value="" id="294" addr="b7e06ab8" />
<attribute name="access" value="public" id="295" addr="b7e06ab8" />
<attribute name="kind" value="variable" id="296" addr="b7e06ab8" />
<attribute name="type" value="int" id="297" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7e05eb8" id="298" addr="b7e05eb8" />
<attribute name="sym_overname" value="__SWIG_0" id="299" addr="b7e06ab8" />
</attributelist >
</cdecl >
<cdecl id="300" addr="b7e06098" >
<attributelist id="301" addr="b7e06098" >
<attribute name="ismember" value="1" id="302" addr="b7e06ab8" />
<attribute name="sym_name" value="f" id="303" addr="b7e06ab8" />
<attribute name="name" value="f" id="304" addr="b7e06ab8" />
<attribute name="decl" value="" id="305" addr="b7e06ab8" />
<attribute name="access" value="public" id="306" addr="b7e06ab8" />
<attribute name="kind" value="variable" id="307" addr="b7e06ab8" />
<attribute name="type" value="float" id="308" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7e05eb8" id="309" addr="b7e05eb8" />
<attribute name="sym_overname" value="__SWIG_0" id="310" addr="b7e06ab8" />
</attributelist >
</cdecl >
</class >
<cdecl id="311" addr="b7e062f8" >
<attributelist id="312" addr="b7e062f8" >
<attribute name="sym_name" value="test_func_1" id="313" addr="b7e06ab8" />
<attribute name="name" value="test_func_1" id="314" addr="b7e06ab8" />
<attribute name="decl" value="f(char,int)." id="315" addr="b7e06ab8" />
<parmlist id="316" addr="b7e06218" >
<parm id="317">
<attributelist id="318" addr="b7e06218" >
<attribute name="name" value="c" id="319" addr="b7e06ab8" />
<attribute name="type" value="char" id="320" addr="b7e06ab8" />
<attribute name="compactdefargs" value="1" id="321" addr="b7e06ab8" />
</attributelist >
</parm >
<parm id="322">
<attributelist id="323" addr="b7e062a8" >
<attribute name="name" value="i" id="324" addr="b7e06ab8" />
<attribute name="type" value="int" id="325" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
<attribute name="kind" value="function" id="326" addr="b7e06ab8" />
<attribute name="type" value="i32" id="327" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7dfd3a8" id="328" addr="b7dfd3a8" />
<attribute name="sym_overname" value="__SWIG_0" id="329" addr="b7e06ab8" />
</attributelist >
</cdecl >
<cdecl id="330" addr="b7e06438" >
<attributelist id="331" addr="b7e06438" >
<attribute name="sym_name" value="test_func_2" id="332" addr="b7e06ab8" />
<attribute name="name" value="test_func_2" id="333" addr="b7e06ab8" />
<attribute name="decl" value="f(p.void)." id="334" addr="b7e06ab8" />
<parmlist id="335" addr="b7e063e8" >
<parm id="336">
<attributelist id="337" addr="b7e063e8" >
<attribute name="name" value="ptr" id="338" addr="b7e06ab8" />
<attribute name="type" value="p.void" id="339" addr="b7e06ab8" />
<attribute name="compactdefargs" value="1" id="340" addr="b7e06ab8" />
</attributelist >
</parm >
</parmlist >
<attribute name="kind" value="function" id="341" addr="b7e06ab8" />
<attribute name="type" value="void" id="342" addr="b7e06ab8" />
<attribute name="sym_symtab" value="b7dfd3a8" id="343" addr="b7dfd3a8" />
<attribute name="sym_overname" value="__SWIG_0" id="344" addr="b7e06ab8" />
</attributelist >
</cdecl >
<insert id="345" addr="b7e064b8" >
<attributelist id="346" addr="b7e064b8" >
<attribute name="code" value="&#10;end&#10;" id="347" addr="b7e06ab8" />
</attributelist >
</insert >
</include >
</top >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment