当前位置: 首页>>代码示例>>C++>>正文


C++ ruby_init函数代码示例

本文整理汇总了C++中ruby_init函数的典型用法代码示例。如果您正苦于以下问题:C++ ruby_init函数的具体用法?C++ ruby_init怎么用?C++ ruby_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ruby_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: proxenet_ruby_initialize_vm

int proxenet_ruby_initialize_vm(plugin_t* plugin)
{
	interpreter_t *interpreter;

	interpreter = plugin->interpreter;

	/* checks */
	if (interpreter->ready)
		return 0;

#ifdef DEBUG
	xlog(LOG_DEBUG, "Initializing Ruby VM version %s\n", _RUBY_VERSION_);
#endif

	/* init vm */
	ruby_init();

	interpreter->vm = (void*) rb_mKernel;

        ruby_script(PROGNAME);

	ruby_init_loadpath();

	interpreter->ready = true;

	return 0;
}
开发者ID:thorgul,项目名称:proxenet,代码行数:27,代码来源:plugin-ruby.c

示例2: main

int
main(int argc, char **argv)
{
    int nRes = 0;
#ifdef RUBY_DEBUG_ENV
    ruby_set_debug_option(getenv("RUBY_DEBUG"));
#endif
#ifdef HAVE_LOCALE_H
    setlocale(LC_CTYPE, "");
#endif

//    MessageBox(0,"","",MB_OK);
    ruby_sysinit(&argc, &argv);
    {
	RUBY_INIT_STACK;
	ruby_init();
    Init_strscan();
	Init_sqlite3_api();
    Init_SyncEngine();
    Init_System();
    //Init_prelude();

    rb_define_global_function("__rho_compile", __rho_compile, 1);

	nRes = ruby_run_node(ruby_options(argc, argv));

    }

    return nRes;
}
开发者ID:jayliu,项目名称:rhodes,代码行数:30,代码来源:main.c

示例3: init_rb

static bool init_rb(rb_internal_t*rb)
{
    if(rb_reference_count==0) {
        ruby_init();
    }
    rb_reference_count++;
}
开发者ID:JackieXie168,项目名称:mrscake,代码行数:7,代码来源:language_rb.c

示例4: main

int
main(int argc, char **argv, char **envp)
{
#ifdef HAVE_LOCALE_H
    setlocale(LC_CTYPE, "");
#endif

    ruby_is_miniruby = argc > 0 && strstr(argv[0], "miniruby") != NULL;

    try {
	ruby_sysinit(&argc, &argv);
	ruby_init();
	void *node = ruby_options(argc, argv);
	rb_vm_init_compiler();
	if (ruby_aot_compile) {
	    rb_vm_aot_compile((NODE *)node);
	    rb_exit(0);
	}
	else {	
	    rb_exit(ruby_run_node(node));
	}
    }
    catch (...) {
	rb_vm_print_current_exception();
	rb_exit(1);
    }
}
开发者ID:ferrous26,项目名称:MacRuby,代码行数:27,代码来源:main.cpp

示例5: initrb_start

int initrb_start(int argc, char **argv, initrb_boot_fn_t boot) {
    int ret = 0;

    {
        /* Initialize the stack */
        RUBY_INIT_STACK;

        /* Initialize the interpreter */
        ruby_init();

        /* Initialize the loadpath */
        ruby_init_loadpath();

        /* We're initrb */
        ruby_script("initrb");

        /* Set the argv */
        ruby_set_argv(argc, argv);

        /* Boot statics */
        initrb_boot_statics();

        /* Run */
        ret = boot(argc, argv);

        /* Finalize the interpreter */
        ruby_finalize();
    }

    return ret;
}
开发者ID:numinit,项目名称:initrb,代码行数:31,代码来源:initrb.c

示例6: main

int main(int argc, char *argv[])
{
	int ret;
	const char *script = argv[1];

	if (script == NULL) {
		script = 
			//"alphadraw.rb";
			"alpha.rb";
			//"aadraw.rb";
			//"test_fib.rb";
	}

	ruby_debug = Qtrue;
	ruby_verbose = Qtrue;

	ruby_init();
	ruby_init_loadpath();
	ruby_script(script);
	rb_load_file(script);
	ret = ruby_cleanup(ruby_exec());

	//exit(ret);
	return(ret);
}
开发者ID:weimingtom,项目名称:eriri_lua,代码行数:25,代码来源:main.c

示例7: main

int main(int argc,char *argv[])
{
  ruby_init();
  ruby_options(argc,argv);
  ruby_run();
  return 0;
}
开发者ID:godrin,项目名称:pkg_install,代码行数:7,代码来源:rubymain.c

示例8: eruta_ruby_init

int eruta_ruby_init() {
  VALUE options = Qnil, sublet = Qnil;

  void Init_prelude(void);

  RUBY_INIT_STACK;
  ruby_init();
  ruby_init_loadpath();
  ruby_script("eruta");

#ifdef HAVE_RB_ENC_SET_DEFAULT_INTERNAL
  {
    VALUE encoding = Qnil;

    /* FIXME: Fix for ruby 1.9.2p429 borrowed from ruby? */
    (void)rb_filesystem_encoding();

    /* Set encoding */
    encoding = rb_enc_from_encoding(rb_locale_encoding());
    rb_enc_set_default_external(encoding);
  }
#endif /* HAVE_RB_ENC_SET_DEFAULT_INTERNAL */

  /* FIXME: Fake ruby_init_gems(Qtrue) */
  rb_define_module("Gem");
  Init_prelude();
  
  
  /* Bypassing garbage collection. Why? */
  /* shelter = rb_ary_new();
  rb_gc_register_address(&shelter);
  */
  
}
开发者ID:beoran,项目名称:eruta,代码行数:34,代码来源:eruta.c

示例9: shoes_init

shoes_code
shoes_init(SHOES_INIT_ARGS)
{
#ifdef SHOES_GTK
  gtk_init(NULL, NULL);
#endif
#ifdef SHOES_WIN32
  INITCOMMONCONTROLSEX InitCtrlEx;
  InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
  InitCtrlEx.dwICC = ICC_PROGRESS_CLASS;
  InitCommonControlsEx(&InitCtrlEx);
#else
  signal(SIGINT,  shoes_sigint);
  signal(SIGQUIT, shoes_sigint);
#endif
  ruby_init();
  shoes_ruby_init();
  shoes_world = shoes_world_alloc();
#ifdef SHOES_QUARTZ
  shoes_app_quartz_install();
  shoes_slot_quartz_register();
  if (PasteboardCreate(kPasteboardClipboard, &shoes_world->os.clip) != noErr) {
    INFO("Apple Pasteboard create failed.\n");
  }
#endif
#ifdef SHOES_WIN32
  shoes_world->os.instance = inst;
  shoes_world->os.style = style;
  shoes_classex_init();
#endif
  return SHOES_OK;
}
开发者ID:danorine,项目名称:shoes,代码行数:32,代码来源:world.c

示例10: main

int
main (
  int argc,
  char * * argv ) {
    ruby_init();
    rb_eval_string("print 'Hello World\n'");
    return (0);
}
开发者ID:knaka,项目名称:src,代码行数:8,代码来源:libruby_test.c

示例11: InitializeInterpreter

void InitializeInterpreter()
{
    ruby_init();
    VALUE load_path = rb_gv_get("$LOAD_PATH");
    rb_ary_push(load_path, rb_str_new2("."));
    Init_armagetronad();
    ruby_script("Armagetron Advanced");
}
开发者ID:KnIfER,项目名称:armagetron,代码行数:8,代码来源:tRuby.cpp

示例12: rh_thread_proc

DWORD WINAPI rh_thread_proc(LPVOID lpParam)
{
  DWORD dwWaitResult;
  int must_exit = 0;

#ifdef DEBUG_THREADS
  rh_log("RubyHoldem thread %d starting\n", GetCurrentThreadId());
#endif

  ruby_init();
  rh_safe_call("rh_load_init_script", (rh_function)rh_init_module, Qnil);
  
  while (!must_exit)
  {
#ifdef DEBUG_THREADS
    rh_log("RubyHoldem thread %d waiting for event...\n", GetCurrentThreadId());
#endif

    dwWaitResult = WaitForSingleObject(rh_event_job, INFINITE);
  
    switch (dwWaitResult) 
    {
      // Event object was signaled
      case WAIT_OBJECT_0: 
#ifdef DEBUG_THREADS
        rh_log("Event occured in RubyHoldem thread %d\n", GetCurrentThreadId());
#endif
        switch(rh_event_type)
        {
          case RH_EXIT:
#ifdef DEBUG_THREADS
            rh_log("Event is RH_EXIT\n");
#endif
            must_exit = 1;
            break;
          case RH_PROCESS_MESSAGE:
#ifdef DEBUG_THREADS
            rh_log("Event is RH_PROCESS_MESSAGE\n");
#endif
            rh_process_message();
            break;
        }
        break;

      // An error occurred
      default:
        rh_log("RubyHoldem thread: Wait error (%d)\n", GetLastError());
        return 0; 
    }
    rh_job_done();
  }
  ruby_finalize();
#ifdef DEBUG_THREADS
  rh_log("RubyHoldem thread %d finished\n", GetCurrentThreadId());
#endif

  return 1;
}
开发者ID:time,项目名称:rubyholdem,代码行数:58,代码来源:rubyholdem.cpp

示例13: main

int main( void )  {
  
  ruby_init();

  rb_Rargs_define_spec();
  rb_Rargs_parse_spec();
  rb_Rargs_macro_spec();

}
开发者ID:RidiculousPower,项目名称:Rargs,代码行数:9,代码来源:main_spec.c

示例14: main

int main(int argc, char **argv)
{
  ruby_sysinit(&argc, &argv);
  {
    RUBY_INIT_STACK;
    ruby_init();
    return ruby_run_node(ruby_options(argc, argv));
  }
}
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:9,代码来源:ruby.cpp

示例15: boot_vm

void boot_vm() {
  _argc = 0;
  _argv = &gorby;
  ruby_sysinit(&_argc, &_argv);
  {
    RUBY_INIT_STACK;
    ruby_init();
  }
}
开发者ID:burke,项目名称:gorby,代码行数:9,代码来源:gorby.c


注:本文中的ruby_init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。