Sha256: 874a2971857b4985338605c5df0d3a35a8a60cbe3ab8b4f2d95c2e2143f9b1e6

Contents?: true

Size: 630 Bytes

Versions: 4

Compression:

Stored size: 630 Bytes

Contents

#include <ruby.h>

extern void* open_interpreter(void) {

  return (void*) 0;

}

extern void close_interpreter(void* rb) {


}

extern void load_script_from_file(void* rb, const char* filename) {



}

extern VALUE execute_script_line(void* rb, const char* text) {

  int status;
  VALUE result = rb_eval_string_protect(text, &status);

  if(status) {

    VALUE exception = rb_errinfo();
    VALUE exception_str = rb_inspect(exception);

    //! TODO: Are there any internal methods to print this prettier?

    printf("%s\n", rb_string_value_cstr(&exception_str));

  }

  return result;

}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
polycrystal-0.1.3 ext/polycrystal/script_helper.c
polycrystal-0.1.2 ext/polycrystal/script_helper.c
polycrystal-0.1.1 ext/polycrystal/script_helper.c
polycrystal-0.1.0-x86_64-darwin-21 ext/polycrystal/script_helper.c