Sha256: 4436bdf3536583a1f2c585bd197cb7e9bb2970ffc7938b772f0c7fbbb298642e

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

#ifndef RUBY_JSONNET_RUBY_JSONNET_H_
#define RUBY_JSONNET_RUBY_JSONNET_H_

#include <ruby/ruby.h>
#include <ruby/encoding.h>

extern const rb_data_type_t jsonnet_vm_type;

struct native_callback_ctx {
    VALUE callback;
    long arity;
    VALUE vm;
};

struct jsonnet_vm_wrap {
    struct JsonnetVm *vm;

    VALUE import_callback;
    struct {
	long len;
	struct native_callback_ctx **contexts;
    } native_callbacks;
};

void rubyjsonnet_init_vm(VALUE mod);
void rubyjsonnet_init_callbacks(VALUE cVM);
void rubyjsonnet_init_helpers(VALUE mod);

struct jsonnet_vm_wrap *rubyjsonnet_obj_to_vm(VALUE vm);

VALUE rubyjsonnet_json_to_obj(struct JsonnetVm *vm, const struct JsonnetJsonValue *value);
struct JsonnetJsonValue *rubyjsonnet_obj_to_json(struct JsonnetVm *vm, VALUE obj, int *success);

rb_encoding *rubyjsonnet_assert_asciicompat(VALUE str);
char *rubyjsonnet_str_to_cstr(struct JsonnetVm *vm, VALUE str);
char *rubyjsonnet_str_to_ptr(struct JsonnetVm *vm, VALUE str, size_t *buflen);
VALUE rubyjsonnet_format_exception(VALUE exc);
int rubyjsonnet_jump_tag(const char *exc_mesg);

#endif /* RUBY_JSONNET_RUBY_JSONNET_H_ */

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jsonnet-0.6.0 ext/jsonnet/ruby_jsonnet.h