[#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,
Embeding Ruby in C++ code.
From:
Kostas Katsamakas <kmak@...>
Date:
2002-08-10 19:50:54 UTC
List:
ruby-core #316
I have written the following code:
#include <ruby.h>
VALUE do_something(VALUE str)
{
printf("executing function: do_something\n");
char *s = RSTRING(str)->ptr;
printf("argument: %s\n", s);
return rb_tainted_str_new2("OK");
}
int main(int argc, char* argv[])
{
//Way 1
ruby_init();
//Here i register my global function
rb_define_global_function("do_something", (VALUE
(*)(...))&do_something, 1);
rb_eval_string("do_something \"hi!\"\n");
return 0;
}
The command gets evaluated ok but something seems to be wrong with the
argument i get in the
do_something function. If i use the TYPE(str) macro i get as a result 2
which equals T_OBJECT
instead of T_STRING as i expected. What am i doing wrong?
Thank you in advance
Kostas