static inline void lich_set_config() { rb_global_variable(&lichconfig); rb_define_readonly_variable("$LICHCONFIG", &lichconfig); lichconfig = rb_hash_new(); // rb_eException = rb_eval_string("Exception"); // rb_cRuntimeError = rb_define_class("RuntimeError", rb_eException); rb_gv_set("$version", rb_str_new2(LICH_VERSION)); rb_hash_aset(lichconfig, rb_str_new2("version"), rb_str_new2(LICH_VERSION)); #ifdef __MINGW32__ rb_hash_aset(lichconfig, rb_str_new2("OS"), rb_str_new2("Windows")); #else rb_hash_aset(lichconfig, rb_str_new2("OS"), rb_str_new2("Linux")); #endif }
static VALUE sb_define_readonly_variable(VALUE self, VALUE var_name, VALUE val) { g_ro_var = val; rb_define_readonly_variable(StringValuePtr(var_name), &g_ro_var); return Qnil; }