From: Michal Rokos Date: 2001-09-17T19:41:30+09:00 Subject: [ruby-talk:21282] extensions libraries Hello! I'd like to ask you for comments. I'm implementing some C lib binding to Ruby. I have to implement my class types. One way is: use Data_Wrap_Struct, ..., and struct RData add type ident to every mine struct + I can use existing functions - I have to know where ident is, but I don't know the real structure of struct XXX {...}; (=> type ident is always 1st record in structure) - I can forget to add ident to struct - can be messed up with other T_DATA 2nd way: use mine functions for *_Wrap_Struct, ..., and struct MINE { struct RBasic basic; ... void *data; unsigned long MINE_type_ident;}; + type ident allways included - not needed in user struct; - I have to rewrite all functions for creating and getting struct - I still need pretend for BUILTIN_TYPE(obj) T_RDATA (?? Really??) - if Data_*_Struct will be upgraded I have to commit changes to mine MINE_*_Struct (=> more work, possibility of incompabilities) ??? Any other way? Please, please comment! Thank you! Michal