C types | CStruct types |
---|---|
char | char | int8 |
short | int16 |
int | int32 |
long | int32 |
unsigned char | uchar | uint8 |
unsigned short | uint16 |
unsigned int | uint32 |
unsigned long | uint32 |
float | float |
double | double |
C/C++ | Ruby |
---|---|
struct Point {
int x; int y; }; |
class Point < CStruct
int32:x int32:y end |
C/C++ | Ruby |
---|---|
struct T {
int element[8]; }; |
class T < CStruct
int32:elements,[8] end |
C/C++ | Ruby |
---|---|
struct Point {
int x; int y; }; struct Line { Point begin_point; Point end_point; }; |
class Point < CStruct
int32:x int32:y end class Line < CStruct Point:begin_point Point:end_point end |
C/C++ | Ruby |
---|---|
struct A {
struct Inner { int v1; int v2; }; Inner inner; }; |
class A < CStruct
class Inner < CStruct int32 :v1 int32 :v2 end Inner :inner end |
C/C++ | Ruby |
---|---|
struct U {
union NumericType { int x; int y; }; NumericType value; }; |
class U < CStruct
union:value do int32:x int32:y end end |
C/C++ | Ruby |
---|---|
struct Window {
int style; struct{ int x; int y; }position; }; |
class Window < CStruct
int32:style struct :position do int32:x int32:y end end |
C/C++ | Ruby |
---|---|
struct U {
union{ int x; int y; } value; }; |
class U < CStruct
union:value do int32:x int32:y end end |
C++ | Ruby |
---|---|
namespace NS1{
struct A { int handle; }; namespace NS2 { struct B { A a; }; } struct C { A a; NS2::B b; }; } |
module NS1
class A < CStruct uint32:handle end module NS2 class B < CStruct A:a end end class C < CStruct A :a NS2_B :b end end |
require 'win32struct'