Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Generic Ruby Embedding API
/**
* VM supplies rb_ctx and rb_obj definitions here
*/
#include "vm_specific.h"
extern "C" {
/**
* Create a embedded ruby context
*/
rb_ctx rb_create_ctx();
/**
* Requires a ruby file (like require 'file' in ruby)
*
* Returns true if it executed without exception, false if there was an error.
* Finding out what went wrong will be defined later.
*/
int rb_require_file(rb_ctx ctx, const char * file);
/**
* Evaulate a ruby file
*
* Returns true if it executed without exception, false if there was an error.
* Finding out what went wrong will be defined later.
*/
int rb_eval_file(rb_ctx ctx, const char * file);
/**
* Evaluate a ruby string
*
* Returns true if it executed without exception, false if there was an error.
* Finding out what went wrong will be defined later.
*/
int rb_eval(rb_ctx ctx, const char * code);
/**
* Send a message to an object
*
* Send +msg+ to object +recv+ with arguments specified by +argc+ and the
* variadic parameters that follow. All arguments *must* be of type rb_obj.
*/
rb_obj rb_send(rb_ctx ctx, rb_obj recv, const char* msg, int argc, ...);
/**
* Clean up a context
*/
void rb_close_ctx(rb_ctx ctx);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.