4 #if defined(WITH_RUBYEMBED)
12 #undef PACKAGE_TARNAME
13 #undef PACKAGE_VERSION
15 #undef PACKAGE_BUGREPORT
17 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
19 #pragma GCC diagnostic warning "-Wstrict-prototypes"
23 #define _RPMRUBY_INTERNAL 1
43 #if defined(WITH_RUBYEMBED)
72 if (_rpmrubyPool == NULL) {
81 #if defined(WITH_RUBYEMBED)
84 static const char * rpmrubyInitStringIO =
"\
86 $stdout = StringIO.new($result, \"w+\")\n\
101 static const char *_av[] = {
"rpmruby", NULL };
112 #if defined(WITH_RUBYEMBED)
115 ruby_init_loadpath();
117 ruby_script((
char *)av[0]);
118 rb_gv_set(
"$result", rb_str_new2(
""));
119 (void)
rpmrubyRun(ruby, rpmrubyInitStringIO, NULL);
131 fprintf(stderr,
"==> %s(%p,%s,%p)\n", __FUNCTION__, ruby, str, resultp);
136 #if defined(WITH_RUBYEMBED)
139 ruby->state = rb_eval_string_protect(str, &state);
146 *resultp = RSTRING_PTR(rb_gv_get(
"$result"));
rpmruby _rpmrubyI
Current (global) interpreter instance.
static rpmruby rpmrubyI(void)
static rpmruby rpmrubyGetPool(rpmioPool pool)
Returns the current rpmio pool responsible for Ruby interpreter instances.
rpmruby rpmrubyNew(char **av, uint32_t flags)
Creates and initializes a Ruby interpreter.
rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
Get unused item from pool, or alloc a new item.
int _rpmruby_debug
Triggers printing of debugging information.
rpmruby rpmrubyLink(rpmruby ruby)
References a Ruby interpreter instance.
rpmioPool _rpmrubyPool
The pool of Ruby interpreter instances.
Embedded Ruby interpreter.
const char const bson int mongo_write_concern int flags
struct rpmruby_s * rpmruby
enum rpmRC_e rpmRC
RPM return codes.
rpmioPool rpmioNewPool(const char *name, size_t size, int limit, int flags, char *(*dbg)(void *item), void(*init)(void *item), void(*fini)(void *item))
Create a memory pool.
static void rpmrubyFini(void *_ruby)
Finalizes a Ruby interpreter instance/pool item.
rpmRC rpmrubyRun(rpmruby ruby, const char *str, const char **resultp)
Evaluates Ruby code stored in a string.