[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02022] rb_global_entry

From: ts <decoux@...>
Date: 2000-03-19 11:10:34 UTC
List: ruby-talk #2022

 I need to access ruby_errinfo and initially I've written (ruby_errinfo is
 not in ruby.h)

[...]
 extern VALUE ruby_errinfo;
[...]

 Finally I use rb_global_entry() but its definition is also not in ruby.h.
Is there another way to access this variable ?

 I want to do something like this :

aestivum% cat toto.c
#include <ruby.h>

static struct global_entry *errinfo;
static VALUE toto_eCatch;
static VALUE titi() { rb_raise(toto_eCatch, "ESSAI"); }
static VALUE t_catch() { return rb_gvar_get(errinfo); }

static VALUE
toto()
{
    VALUE c = rb_rescue(titi, 0, t_catch, 0);
    if (rb_obj_is_kind_of(c, toto_eCatch))
        rb_warn("OK kind_of");
    return Qtrue;
}

Init_toto()
{
    toto_eCatch = rb_define_class("TotoCatch", rb_eStandardError);
    errinfo = (struct global_entry *)rb_global_entry(rb_intern("$!"));
    toto();
}
aestivum% 


Guy Decoux

In This Thread

Prev Next