#ifndef TOMATO_H #define TOMATO_H #include #include #include using namespace v8; /* for 1.8.7 compatibility */ #ifndef DBL2NUM #define DBL2NUM(n) rb_float_new(n) #endif typedef VALUE (ruby_method_vararg)(...); typedef VALUE (ruby_method_1)(VALUE); typedef struct { Persistent context; VALUE rb_instance; } V8Tomato; // Extracts a C string from a V8 Utf8Value. #define ToCString(value) (*value ? *value : "") /* in tomato.cpp */ extern VALUE cTomato; extern VALUE cTomatoError; extern VALUE rb_cTime; /* in object_chain.cpp */ extern Handle find_or_create_object_chain(V8Tomato *tomato, VALUE chain); extern VALUE fTomato_bind_class(VALUE self, VALUE klass, VALUE chain); /* in conversions_to_rb.cpp */ extern VALUE ruby_value_of(V8Tomato *tomato, Handle result); extern Handle inspect_js(V8Tomato *tomato, Handle obj); /* in conversions_to_js.cpp */ extern Handle js_value_of(V8Tomato *tomato, VALUE value); extern Handle inspect_rb(VALUE value); /* in errors.cpp */ extern void raise_error(TryCatch *try_catch); extern Local js_error_from(VALUE ruby_error); extern void err_init(void); /* in v8.cpp */ extern VALUE execute(V8Tomato *tomato, Handle source, Handle name); /* in binding_methods.cpp */ extern VALUE fTomato_bind_method(int argc, VALUE *argv, VALUE self); #endif//TOMATO_H