[#290] — Florian Frank <flori@...>
Hi all,
5 messages
2002/08/03
[#297] GC longjmp macros — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/05
[#308] Q: OSSL in std. distr? — Michal Rokos <m.rokos@...>
Hi,
4 messages
2002/08/08
[#326] Implications of a #force_free method in Object? — Matthew Bloch <mattbee@...>
Hello;
8 messages
2002/08/19
[#328] Int vs Long — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/21
[#337] Int vs Long (2nd part) — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/22
[#340] Int vs Long #3 — Michal Rokos <m.rokos@...>
Hi,
9 messages
2002/08/22
[#344] Re: [Cleanup] Int vs Long #3
— nobu.nokada@...
2002/08/22
Hi,
[#348] Re: [Cleanup] Int vs Long #3
— Michal Rokos <m.rokos@...>
2002/08/23
Hello,
[#353] File (struct stat handling) — Michal Rokos <m.rokos@...>
Hello,
6 messages
2002/08/23
[#358] node.h for eval.c — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/23
[#372] rb_class_path — Michal Rokos <m.rokos@...>
Hello,
7 messages
2002/08/27
[#382] Port match to new dup, clone framework — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/28
[#393] in dln.c — Michal Rokos <m.rokos@...>
Hi,
14 messages
2002/08/30
[#398] Re: [MemLeak] in dln.c
— nobu.nokada@...
2002/08/31
Hi,
[#403] Re: [MemLeak] in dln.c
— Michal Rokos <m.rokos@...>
2002/09/02
Hello,
Re: C and Ruby...
From:
nobu.nokada@...
Date:
2002-08-11 22:19:48 UTC
List:
ruby-core #319
Hi,
At Mon, 12 Aug 2002 02:09:55 +0900,
Kostas Katsamakas wrote:
> How can i add an instance variable in a ruby class object?
rb_ivar_set(obj, rb_intern("@foo"), Qtrue);
or
rb_iv_set(obj, "@foo", Qtrue);
> For example i would like to add an instance variable that would hold a
> pointer to
> a C structure and would also like to be able to retrieve its value in C.
Ruby object's instance variable MUST be a ruby's VALUE, not a
pointer.
> I have also created a class instance by calling:
> VALUE obj = rb_string_eval("A.new");
> How can i call its methods from C?
rb_funcall(obj, rb_intern("method"), n, arg1, arg2, ...)
> If anyone could help me somehow i would be gratefull.
> I have searched but couldn't find documentation on these matters.
See README.EXT.
--
Nobu Nakada