aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/storage.c
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2017-07-13 11:21:03 -0700
committerGitHub <noreply@github.com>2017-07-13 11:21:03 -0700
commit3a0382e9076bdbb7c764080c92f3c2324d852be7 (patch)
tree61c1b903d5db55e23c2c60ec1b0829d1fcf06453 /php/ext/google/protobuf/storage.c
parentd3bbf1c8a98fe01c115f525c516e575d87c11a47 (diff)
downloadprotobuf-3a0382e9076bdbb7c764080c92f3c2324d852be7.tar.gz
protobuf-3a0382e9076bdbb7c764080c92f3c2324d852be7.tar.bz2
protobuf-3a0382e9076bdbb7c764080c92f3c2324d852be7.zip
Add map iterator for c extension (#3350)
Diffstat (limited to 'php/ext/google/protobuf/storage.c')
-rw-r--r--php/ext/google/protobuf/storage.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/storage.c b/php/ext/google/protobuf/storage.c
index 6318f88c..29a3db86 100644
--- a/php/ext/google/protobuf/storage.c
+++ b/php/ext/google/protobuf/storage.c
@@ -355,6 +355,19 @@ void native_slot_get_by_array(upb_fieldtype_t type, const void* memory,
}
}
+void native_slot_get_by_map_key(upb_fieldtype_t type, const void* memory,
+ int length, CACHED_VALUE* cache TSRMLS_DC) {
+ switch (type) {
+ case UPB_TYPE_STRING:
+ case UPB_TYPE_BYTES: {
+ PHP_PROTO_ZVAL_STRINGL(CACHED_PTR_TO_ZVAL_PTR(cache), memory, length, 1);
+ return;
+ }
+ default:
+ native_slot_get(type, memory, cache TSRMLS_CC);
+ }
+}
+
void native_slot_get_default(upb_fieldtype_t type,
CACHED_VALUE* cache TSRMLS_DC) {
switch (type) {