Sha256: 6acd42ac4c3153346f129a2f2881a7f77e25cc0eb657605799012e9dd94e92a6
Contents?: true
Size: 1.35 KB
Versions: 3
Compression:
Stored size: 1.35 KB
Contents
%module testlib %{ module TestLib extend FFI::Library %} #define CONST_1 0x10 #define CONST_2 0x20 typedef unsigned char byte; typedef enum e_1 { ENUM_1, ENUM_2, ENUM_3 } enum_t; union union_t { char c; float f; }; struct test_struct { int i; char c; byte b; }; struct CamelCaseStruct { int i; char c; byte b; }; typedef struct { char c; } test_struct_3; typedef void (*cb)(char*, char*); typedef void * (*cb_2)(char*, const char *); typedef CamelCaseStruct (*cb_3)(char*, CamelCaseStruct); struct test_struct_2 { struct test_struct s; CamelCaseStruct camel_case_struct; test_struct_3 s_3; enum_t e; cb func; union_t u; cb callback; void (*inline_callback)(); }; // struct with getter/setter method for strings and callbacks struct _test_struct_4 { char* string; void (*inline_callback)(); }; struct test_struct_5 { int i; union { struct { int a; int b; } nested_struct_field_1; struct { int c; int d; } nested_struct_field_2; struct { int e; int f; } nested_struct_field_3; union { long l; long long ll; } union_field; float f; } big_union_field; char c; }; int get_int(struct test_struct* s); char get_char(struct test_struct* s); int func_with_enum(enum e_1 e); int func_with_enum_2(enum_t e); byte func_with_typedef(); %{ end %}
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ffi-swig-generator-0.3.2 | spec/generator/swig/testlib.i |
ffi-swig-generator-0.3.0 | spec/generator/swig/testlib.i |
ffi-swig-generator-0.3.1 | spec/generator/swig/testlib.i |