0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-14 07:18:40 +00:00
phpv8/v8js_v8object_class.h

73 lines
2.1 KiB
C
Raw Normal View History

/*
+----------------------------------------------------------------------+
2017-03-11 11:33:49 +00:00
| PHP Version 7 |
+----------------------------------------------------------------------+
| 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
/* {{{ Object container */
struct v8js_v8object {
v8::Persistent<v8::Value> v8obj;
int flags;
struct v8js_ctx *ctx;
HashTable *properties;
2015-08-29 14:47:37 +00:00
zend_object std;
};
/* }}} */
extern zend_class_entry *php_ce_v8object;
extern zend_class_entry *php_ce_v8function;
/* Create PHP V8 object */
2017-03-11 12:35:21 +00:00
void v8js_v8object_create(zval *, v8::Local<v8::Value>, int, v8::Isolate *);
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));
}
2015-08-29 14:47:37 +00:00
#define Z_V8JS_V8OBJECT_OBJ_P(zv) v8js_v8object_fetch_object(Z_OBJ_P(zv));
2021-06-03 01:33:51 +00:00
#define Z_V8JS_V8OBJECT_OBJ(zv) v8js_v8object_fetch_object(zv);
/* {{{ Generator container */
struct v8js_v8generator {
zval value;
bool primed;
bool done;
struct v8js_v8object v8obj;
};
/* }}} */
extern zend_class_entry *php_ce_v8generator;
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));
PHP_MINIT_FUNCTION(v8js_v8object_class);
#endif /* V8JS_V8OBJECT_CLASS_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/