Yvon Thoraval
8/8/2006 10:56:00 PM
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);
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);
}
and i want the arg "alias_path" to be "global" to all of the methods
of this class, what to do for that ???
best,
Yvon