This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommon.c
51 lines (44 loc) · 1.81 KB
/
common.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* @author Lonely <[email protected]>
* @copyright (c) 2017 ShanLiu <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
#include "zend.h"
#include "php.h"
#include "zend_API.h"
#include "common.h"
void simhash_update_property_bool(zval * z_object,const char *name, size_t name_length, zend_long val){
#if PHP_VERSION_ID < 80000
zend_update_property_bool(Z_OBJCE_P(z_object), z_object,name,name_length,val);
#else
zend_update_property_bool(Z_OBJCE_P(z_object), Z_OBJ_P(z_object),name,name_length,val);
#endif
}
void simhash_update_property_str(zval * z_object,const char *name, size_t name_length, zend_string *val){
#if PHP_VERSION_ID < 80000
zend_update_property_str(Z_OBJCE_P(z_object), z_object,name,name_length,val);
#else
zend_update_property_str(Z_OBJCE_P(z_object), Z_OBJ_P(z_object),name,name_length,val);
#endif
}
void simhash_update_property(zval * z_object,const char *name, size_t name_length, zval * val){
#if PHP_VERSION_ID < 80000
zend_update_property(Z_OBJCE_P(z_object), z_object,name,name_length,val);
#else
zend_update_property(Z_OBJCE_P(z_object), Z_OBJ_P(z_object),name,name_length,val);
#endif
}
void simhash_update_property_long(zval * z_object,const char *name, size_t name_length, zend_long val){
#if PHP_VERSION_ID < 80000
zend_update_property_long(Z_OBJCE_P(z_object), z_object, name,name_length, val);
#else
zend_update_property_long(Z_OBJCE_P(z_object), Z_OBJ_P(z_object),name,name_length,val);
#endif
}
zval * simhash_read_property(zval * z_object,const char *name, size_t name_length, zend_bool silent){
#if PHP_VERSION_ID < 80000
return zend_read_property(Z_OBJCE_P(z_object), z_object, name,name_length, silent, NULL);
#else
return zend_read_property(Z_OBJCE_P(z_object), Z_OBJ_P(z_object), name,name_length, silent, NULL);
#endif
}