2014-12-12 22:59:28 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| PHP Version 5 |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Copyright (c) 1997-2013 The PHP Group |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| http://www.opensource.org/licenses/mit-license.php MIT License |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Author: Jani Taskinen <jani.taskinen@iki.fi> |
|
|
|
|
| Author: Patrick Reilly <preilly@php.net> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef V8JS_V8OBJECT_CLASS_H
|
|
|
|
#define V8JS_V8OBJECT_CLASS_H
|
|
|
|
|
2014-12-12 23:43:19 +00:00
|
|
|
/* {{{ Object container */
|
|
|
|
struct v8js_v8object {
|
|
|
|
v8::Persistent<v8::Value> v8obj;
|
|
|
|
int flags;
|
2014-12-13 00:15:29 +00:00
|
|
|
struct v8js_ctx *ctx;
|
2014-12-12 23:43:19 +00:00
|
|
|
HashTable *properties;
|
2015-08-29 14:47:37 +00:00
|
|
|
zend_object std;
|
2014-12-12 23:43:19 +00:00
|
|
|
};
|
|
|
|
/* }}} */
|
|
|
|
|
2014-12-12 23:28:09 +00:00
|
|
|
extern zend_class_entry *php_ce_v8object;
|
|
|
|
extern zend_class_entry *php_ce_v8function;
|
2014-12-12 22:59:28 +00:00
|
|
|
|
2014-12-13 00:21:02 +00:00
|
|
|
/* Create PHP V8 object */
|
|
|
|
void v8js_v8object_create(zval *, v8::Handle<v8::Value>, int, v8::Isolate * TSRMLS_DC);
|
|
|
|
|
2015-08-29 14:47:37 +00:00
|
|
|
static inline v8js_v8object *v8js_v8object_fetch_object(zend_object *obj) {
|
|
|
|
return (v8js_v8object *)((char *)obj - XtOffsetOf(struct v8js_v8object, std));
|
|
|
|
}
|
2016-01-07 20:35:44 +00:00
|
|
|
|
2015-08-29 14:47:37 +00:00
|
|
|
#define Z_V8JS_V8OBJECT_OBJ_P(zv) v8js_v8object_fetch_object(Z_OBJ_P(zv));
|
|
|
|
|
2016-01-07 23:12:06 +00:00
|
|
|
|
|
|
|
/* {{{ Generator container */
|
|
|
|
struct v8js_v8generator {
|
|
|
|
zval value;
|
|
|
|
bool primed;
|
|
|
|
bool done;
|
|
|
|
struct v8js_v8object v8obj;
|
|
|
|
};
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
extern zend_class_entry *php_ce_v8generator;
|
|
|
|
|
|
|
|
|
2016-01-07 20:35:44 +00:00
|
|
|
static inline v8js_v8generator *v8js_v8generator_fetch_object(zend_object *obj) {
|
|
|
|
return (v8js_v8generator *)((char *)obj - XtOffsetOf(struct v8js_v8generator, v8obj.std));
|
|
|
|
}
|
|
|
|
|
|
|
|
#define Z_V8JS_V8GENERATOR_OBJ_P(zv) v8js_v8generator_fetch_object(Z_OBJ_P(zv));
|
|
|
|
|
2016-01-07 23:12:06 +00:00
|
|
|
|
2016-01-07 20:35:44 +00:00
|
|
|
|
2014-12-12 22:59:28 +00:00
|
|
|
PHP_MINIT_FUNCTION(v8js_v8object_class);
|
|
|
|
|
|
|
|
#endif /* V8JS_V8OBJECT_CLASS_H */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
2016-07-02 20:41:01 +00:00
|
|
|
* indent-tabs-mode: t
|
2014-12-12 22:59:28 +00:00
|
|
|
* End:
|
|
|
|
* vim600: noet sw=4 ts=4 fdm=marker
|
|
|
|
* vim<600: noet sw=4 ts=4
|
|
|
|
*/
|