Sha256: 1ab8ac11a69e13d1e3e44292ba56b03df8309af47abdff93071539de8ff221be

Contents?: true

Size: 1.31 KB

Versions: 7

Compression:

Stored size: 1.31 KB

Contents

#ifndef JOHNSON_SPIDERMONKEY_RUBY_LAND_PROXY_H
#define JOHNSON_SPIDERMONKEY_RUBY_LAND_PROXY_H

#include "spidermonkey.h"
#include "runtime.h"

#ifdef LEAK_ROOT_NAMES
#define LEAKY_ROOT_NAME(static_string, dynamic_detail) \
  ({\
    const char * const _leaky_root__detail = (dynamic_detail);\
    char * _leaky_root__leaked = malloc(strlen(static_string) + strlen(_leaky_root__detail) + 2);\
    strcpy(_leaky_root__leaked, static_string);\
    _leaky_root__leaked[strlen(static_string)] = ':';\
    strcpy(_leaky_root__leaked + strlen(static_string) + 1, _leaky_root__detail);\
    _leaky_root__leaked;\
  })
#else
#define LEAKY_ROOT_NAME(static_string, dynamic_detail) (static_string)
#endif

DECLARE_RUBY_WRAPPER(make_ruby_land_proxy, JohnsonRuntime* runtime; jsval value; const char const* root_name)

DECLARE_RUBY_WRAPPER(rb_string_value, VALUE v)
DECLARE_RUBY_WRAPPER(rb_string_value_cstr, VALUE v)

typedef struct {
  void* key;
  JohnsonRuntime* runtime;
  VALUE self;
} RubyLandProxy;

bool ruby_value_is_proxy(VALUE maybe_proxy);
bool ruby_value_is_script_proxy(VALUE maybe_proxy);
JSBool unwrap_ruby_land_proxy(JohnsonRuntime* runtime, VALUE proxy, jsval* retval);
VALUE make_ruby_land_proxy(JohnsonRuntime* runtime, jsval value, const char const* root_name);
void init_Johnson_SpiderMonkey_Proxy(VALUE spidermonkey);

#endif

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
johnson-2.0.0.pre1 ext/spidermonkey/ruby_land_proxy.h
johnson-2.0.0.pre0 ext/spidermonkey/ruby_land_proxy.h
johnson-1.2.0 ext/spidermonkey/ruby_land_proxy.h
smparkes-johnson-1.1.2.6 ext/spidermonkey/ruby_land_proxy.h
smparkes-johnson-1.1.2.5 ext/spidermonkey/ruby_land_proxy.h
smparkes-johnson-1.1.2.4 ext/spidermonkey/ruby_land_proxy.h
smparkes-johnson-1.1.2.3 ext/spidermonkey/ruby_land_proxy.h