method
create

v2_1_10 -
Show latest stable
-
0 notes -
Class: CStructBuilder
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
create(klass, types, members)
private
Construct a new class given a C:
-
class klass (CUnion, CStruct, or other that provide an #entity_class)
-
types (DL:TYPE_INT, DL::TYPE_SIZE_T, etc., see the C types constants)
-
corresponding members
DL::Importer#struct and DL::Importer#union wrap this functionality in an easy-to-use manner.
Example:
require 'dl/struct' require 'dl/cparser' include DL::CParser types, members = parse_struct_signature(['int i','char c']) MyStruct = DL::CStructBuilder.create(CUnion, types, members) obj = MyStruct.allocate