Sha256: 517c743a24420aea2f3f8eb77707e1f302e3bcc0f7bc72f49ad5341403d500f3

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

#include <julia.h>
#include <ruby.h>

VALUE rbjl_mJulia;

static VALUE
rbjl_julia_s_init(VALUE mod, VALUE home)
{
    SafeStringValue(home);
    jl_init(NIL_P(home) ? NULL : StringValueCStr(home));
    return mod;
}

static VALUE
rbjl_julia_s_eval_string(VALUE mod, VALUE str)
{
    SafeStringValue(str);
    jl_eval_string(StringValueCStr(str));

    return mod;
}

void
Init_julia(void)
{
    rbjl_mJulia = rb_define_module("Julia");

    rb_define_module_function(rbjl_mJulia, "init", rbjl_julia_s_init, 1);
    rb_define_module_function(rbjl_mJulia, "eval_string", rbjl_julia_s_eval_string, 1);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
julia-0.1.0 ext/julia/julia.c