aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/ext/google/protobuf/protobuf.h
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-10-11 14:44:03 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-10-11 14:44:03 -0700
commitde15e73d5862e8ac618bc7be90594adacbaa1ec6 (patch)
tree9d1f71f76902010963e0dc28db266de22b82646d /php/ext/google/protobuf/protobuf.h
parentc4083bb3d1231f8a94f2f000434e38528bdff64a (diff)
parentbd798dfc81443cb95ff3b6e0b787c92031b113e5 (diff)
Merge remote-tracking branch 'origin/3.4.x' into master
Diffstat (limited to 'php/ext/google/protobuf/protobuf.h')
-rw-r--r--php/ext/google/protobuf/protobuf.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h
index c8a360d8..cb098747 100644
--- a/php/ext/google/protobuf/protobuf.h
+++ b/php/ext/google/protobuf/protobuf.h
@@ -37,7 +37,7 @@
#include "upb.h"
#define PHP_PROTOBUF_EXTNAME "protobuf"
-#define PHP_PROTOBUF_VERSION "3.4.0"
+#define PHP_PROTOBUF_VERSION "3.4.1"
#define MAX_LENGTH_OF_INT64 20
#define SIZEOF_INT64 8
@@ -80,6 +80,9 @@
#define php_proto_zend_hash_update_zval(ht, key, key_len, value) \
zend_hash_update(ht, key, key_len, value, sizeof(void*), NULL)
+#define php_proto_zend_hash_update(ht, key, key_len) \
+ zend_hash_update(ht, key, key_len, 0, 0, NULL)
+
#define php_proto_zend_hash_index_update_mem(ht, h, pData, nDataSize, pDest) \
zend_hash_index_update(ht, h, pData, nDataSize, pDest)
@@ -90,6 +93,9 @@
#define php_proto_zend_hash_index_find_zval(ht, h, pDest) \
zend_hash_index_find(ht, h, pDest)
+#define php_proto_zend_hash_find(ht, key, key_len, pDest) \
+ zend_hash_find(ht, key, key_len, pDest)
+
#define php_proto_zend_hash_index_find_mem(ht, h, pDest) \
zend_hash_index_find(ht, h, pDest)
@@ -270,6 +276,15 @@ static inline int php_proto_zend_hash_index_update_zval(HashTable* ht, ulong h,
return result != NULL ? SUCCESS : FAILURE;
}
+static inline int php_proto_zend_hash_update(HashTable* ht, const char* key,
+ size_t key_len) {
+ void* result = NULL;
+ zval temp;
+ ZVAL_LONG(&temp, 0);
+ result = zend_hash_str_update(ht, key, key_len, &temp);
+ return result != NULL ? SUCCESS : FAILURE;
+}
+
static inline int php_proto_zend_hash_index_update_mem(HashTable* ht, ulong h,
void* pData, uint nDataSize,
void** pDest) {
@@ -303,6 +318,13 @@ static inline int php_proto_zend_hash_index_find_zval(const HashTable* ht,
return result != NULL ? SUCCESS : FAILURE;
}
+static inline int php_proto_zend_hash_find(const HashTable* ht, const char* key,
+ size_t key_len, void** pDest) {
+ void* result = NULL;
+ result = zend_hash_str_find(ht, key, key_len);
+ return result != NULL ? SUCCESS : FAILURE;
+}
+
static inline int php_proto_zend_hash_index_find_mem(const HashTable* ht,
ulong h, void** pDest) {
void* result = NULL;
@@ -1413,4 +1435,8 @@ static inline zval* php_proto_message_read_property(
#endif
}
+// Reserved name
+bool is_reserved_name(const char* name);
+bool is_valid_constant_name(const char* name);
+
#endif // __GOOGLE_PROTOBUF_PHP_PROTOBUF_H__