v8js_v8object_class.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2013 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | http://www.opensource.org/licenses/mit-license.php MIT License |
  8. +----------------------------------------------------------------------+
  9. | Author: Jani Taskinen <[email protected]> |
  10. | Author: Patrick Reilly <[email protected]> |
  11. +----------------------------------------------------------------------+
  12. */
  13. #ifndef V8JS_V8OBJECT_CLASS_H
  14. #define V8JS_V8OBJECT_CLASS_H
  15. /* {{{ Object container */
  16. struct v8js_v8object {
  17. v8::Persistent<v8::Value> v8obj;
  18. int flags;
  19. struct v8js_ctx *ctx;
  20. HashTable *properties;
  21. zend_object std;
  22. };
  23. /* }}} */
  24. extern zend_class_entry *php_ce_v8object;
  25. extern zend_class_entry *php_ce_v8function;
  26. /* Create PHP V8 object */
  27. void v8js_v8object_create(zval *, v8::Local<v8::Value>, int, v8::Isolate *);
  28. static inline v8js_v8object *v8js_v8object_fetch_object(zend_object *obj) {
  29. return (v8js_v8object *)((char *)obj - XtOffsetOf(struct v8js_v8object, std));
  30. }
  31. #define Z_V8JS_V8OBJECT_OBJ_P(zv) v8js_v8object_fetch_object(Z_OBJ_P(zv));
  32. #define Z_V8JS_V8OBJECT_OBJ(zv) v8js_v8object_fetch_object(zv);
  33. /* {{{ Generator container */
  34. struct v8js_v8generator {
  35. zval value;
  36. bool primed;
  37. bool done;
  38. struct v8js_v8object v8obj;
  39. };
  40. /* }}} */
  41. extern zend_class_entry *php_ce_v8generator;
  42. static inline v8js_v8generator *v8js_v8generator_fetch_object(zend_object *obj) {
  43. return (v8js_v8generator *)((char *)obj - XtOffsetOf(struct v8js_v8generator, v8obj.std));
  44. }
  45. #define Z_V8JS_V8GENERATOR_OBJ_P(zv) v8js_v8generator_fetch_object(Z_OBJ_P(zv));
  46. PHP_MINIT_FUNCTION(v8js_v8object_class);
  47. #endif /* V8JS_V8OBJECT_CLASS_H */
  48. /*
  49. * Local variables:
  50. * tab-width: 4
  51. * c-basic-offset: 4
  52. * indent-tabs-mode: t
  53. * End:
  54. * vim600: noet sw=4 ts=4 fdm=marker
  55. * vim<600: noet sw=4 ts=4
  56. */