public
Description: ruby lang (www.ruby-lang.org) svn mirror
Homepage: http://svn.ruby-lang.org/repos/ruby/
Clone URL: git://github.com/juretta/ruby.git
naruse (author)
Thu Jul 24 12:14:47 -0700 2008
commit  392d9eca822341c59864a4475f9bb785aed80ce4
tree    895d8397ed595de66912ed7f3382494a14a0b530
parent  8355df5d968862ba992fef1454cc178f160fa3ab
ruby / goruby.c
100644 25 lines (21 sloc) 0.499 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
void Init_golf(void);
#define ruby_run_node goruby_run_node
#include "main.c"
#undef ruby_run_node
 
RUBY_EXTERN int ruby_run_node(void*);
RUBY_EXTERN void ruby_init_ext(const char *name, void (*init)(void));
 
static VALUE
init_golf(VALUE arg)
{
    ruby_init_ext("golf", Init_golf);
    return arg;
}
 
int
goruby_run_node(void *arg)
{
    int state;
    if (NIL_P(rb_protect(init_golf, Qtrue, &state))) {
  return state == EXIT_SUCCESS ? EXIT_FAILURE : state;
    }
    return ruby_run_node(arg);
}