rr.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _THE_RUBY_RACER_
  2. #define _THE_RUBY_RACER_
  3. #include <ruby.h>
  4. #include <v8.h>
  5. #define rr_define_method(klass, name, impl, argc) rb_define_method(klass, name, (VALUE(*)(...))impl, argc)
  6. #define rr_define_singleton_method(object, name, impl, argc) rb_define_singleton_method(object, name, (VALUE(*)(...))impl, argc)
  7. VALUE rr_define_class(const char *name, VALUE superclass = rb_cObject);
  8. VALUE rr_define_module(const char *name);
  9. VALUE rr_define_const(const char *name, VALUE value);
  10. VALUE rr_const_get(const char *name);
  11. VALUE rr_define_finalizer(VALUE object, void* finalizer, VALUE data);
  12. extern "C" VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
  13. VALUE rr_v82rb(v8::Handle<v8::Value> value);
  14. VALUE rr_v82rb(v8::Handle<v8::Boolean> value);
  15. VALUE rr_v82rb(v8::Handle<v8::Number> value);
  16. VALUE rr_v82rb(v8::Handle<v8::String> value);
  17. VALUE rr_v82rb(v8::Handle<v8::Object> value);
  18. VALUE rr_v82rb(v8::Handle<v8::Array> value);
  19. VALUE rr_v82rb(v8::Handle<v8::Function> value);
  20. VALUE rr_v82rb(v8::Handle<v8::Integer> value);
  21. VALUE rr_v82rb(v8::Handle<v8::Uint32> value);
  22. VALUE rr_v82rb(v8::Handle<v8::Int32> value);
  23. VALUE rr_v82rb(v8::Handle<v8::Message> value);
  24. VALUE rr_v82rb(v8::Handle<v8::StackTrace> value);
  25. VALUE rr_v82rb(v8::Handle<v8::StackFrame> value);
  26. VALUE rr_v82rb(bool value);
  27. VALUE rr_v82rb(double value);
  28. VALUE rr_v82rb(int64_t value);
  29. VALUE rr_v82rb(uint32_t value);
  30. VALUE rr_v82rb(int32_t value);
  31. v8::Handle<v8::Value> rr_rb2v8(VALUE value);
  32. #endif