From: Eric Hodel Date: 2006-08-09T08:23:41+09:00 Subject: Re: FOUND was (Re: Init_xxx(with arg ??) in C for ruby ext ???) On Aug 8, 2006, at 3:55 PM, Yvon Thoraval wrote: > Le 9 ao�t 06 � 00:21, Eric Hodel a �crit : > >> On Aug 8, 2006, at 12:13 PM, Eric Hodel wrote: >> > [snip] >> Oops. >> >> rb_define_method(rb_cMyClass, "initialize", cd_initialize, 1); > > > ok thanks, i get it, now i've an init like that : > > VALUE method_raliasfile_init(VALUE self, char * alias_path) > { > rb_iv_set(self, "@alias_path", *alias_path); > return self; > } > > declared in : > > void Init_raliasfile() { > cRAliasFile = rb_define_class("RAliasFile", rb_cObject); > rb_define_singleton_method(cRAliasFile, "new", > method_raliasfile_new, 1); ^^^ remove this line ^^^ You don't need to define new. > rb_define_method(RAliasFile, "initialize", > method_raliasfile_init, 1); > rb_define_method(RAliasFile, "alias_path", > method_alias_path, 0); > rb_define_method(RAliasFile, "orig_path", method_orig_path, > 0); > rb_define_method(RAliasFile, "is_alias_file", > method_is_alias_file, 0); > rb_define_method(RAliasFile, "is_alias_broken", > method_is_alias_broken, 0); > rb_define_method(RAliasFile, "is_folder", method_is_folder, > 0); > rb_define_method(RAliasFile, "is_data_file", > method_is_data_file, 0); > } -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com