Go to the documentation of this file.
32 #include <Zend/zend_exceptions.h>
91 #define STACK_ENV_STACKBYTES 4096
128 "google/protobuf/wrappers.proto");
131 #define DEREF(msg, ofs, type) *(type*)(((uint8_t *)msg) + ofs)
135 size_t* hd_ofs = (
size_t*)malloc(
sizeof(
size_t));
148 const char*
ptr,
size_t len,
224 const size_t *ofs = hd;
229 #define DEFINE_APPEND_HANDLER(type, ctype) \
230 static bool append##type##_handler(void* closure, const void* hd, \
232 zval* array = (zval*)closure; \
234 RepeatedField* intern = UNBOX(RepeatedField, array); \
235 repeated_field_push_native(intern, &val); \
269 #if PHP_MAJOR_VERSION < 7
275 zend_string*
str = zend_string_init(
frame->sink.ptr,
frame->sink.len, 1);
286 #define DEFINE_SINGULAR_HANDLER(type, ctype) \
287 static bool type##_handler(void* closure, const void* hd, \
289 MessageHeader* msg = (MessageHeader*)closure; \
290 const size_t *ofs = hd; \
291 DEREF(message_data(msg), *ofs, ctype) = val; \
303 #undef DEFINE_SINGULAR_HANDLER
305 #if PHP_MAJOR_VERSION < 7
307 SEPARATE_ZVAL_IF_NOT_REF(value_ptr);
308 if (Z_TYPE_PP(value_ptr) == IS_STRING &&
309 !IS_INTERNED(Z_STRVAL_PP(value_ptr))) {
310 FREE(Z_STRVAL_PP(value_ptr));
312 ZVAL_EMPTY_STRING(*value_ptr);
313 return (
void*)(*value_ptr);
317 if (Z_TYPE_P(value_ptr) == IS_STRING) {
318 zend_string_release(Z_STR_P(value_ptr));
320 ZVAL_EMPTY_STRING(value_ptr);
324 #if PHP_MAJOR_VERSION < 7
326 SEPARATE_ZVAL_IF_NOT_REF(value_ptr);
327 if (Z_TYPE_PP(value_ptr) == IS_STRING &&
328 !IS_INTERNED(Z_STRVAL_PP(value_ptr))) {
329 FREE(Z_STRVAL_PP(value_ptr));
331 ZVAL_EMPTY_STRING(*value_ptr);
332 return (
void*)(*value_ptr);
335 SEPARATE_ZVAL_IF_NOT_REF(value_ptr);
336 if (Z_TYPE_PP(value_ptr) == IS_STRING &&
337 !IS_INTERNED(Z_STRVAL_PP(value_ptr))) {
338 FREE(Z_STRVAL_PP(value_ptr));
340 ZVAL_EMPTY_STRING(*value_ptr);
341 ZVAL_STRINGL(*value_ptr,
str,
len, 1);
345 if (Z_TYPE_P(value_ptr) == IS_STRING) {
346 zend_string_release(Z_STR_P(value_ptr));
348 ZVAL_EMPTY_STRING(value_ptr);
352 if (Z_TYPE_P(value_ptr) == IS_STRING) {
353 zend_string_release(Z_STR_P(value_ptr));
355 ZVAL_NEW_STR(value_ptr, zend_string_init(
str,
len, 0));
376 const size_t *ofs = hd;
389 const char*
str,
size_t len,
404 zend_class_entry* subklass = subdesc->
klass;
407 #if PHP_MAJOR_VERSION < 7
410 ZVAL_OBJ(val, subklass->create_object(subklass TSRMLS_CC));
414 zend_object*
obj = subklass->create_object(subklass TSRMLS_CC);
430 zend_class_entry* subklass = subdesc->
klass;
436 #if PHP_MAJOR_VERSION < 7
438 ZVAL_OBJ(&val, subklass->create_object(subklass TSRMLS_CC));
445 zend_object*
obj = subklass->create_object(subklass TSRMLS_CC);
492 #if PHP_MAJOR_VERSION < 7
495 zval** holder =
ALLOC(zval*);
496 *(zval***)memory = holder;
502 *(zval**)memory = cache;
508 #if PHP_MAJOR_VERSION < 7
509 zval** holder =
ALLOC(zval*);
514 *(zval***)memory = holder;
516 *(zval**)memory = cache;
517 ZVAL_NULL(*(zval**)memory);
531 #if PHP_MAJOR_VERSION < 7
532 zval** holder = *(zval***)memory;
533 zval_ptr_dtor(holder);
549 #if PHP_MAJOR_VERSION < 7
550 zval* key_php = **(zval***)
from;
552 zval* key_php = *(zval**)
from;
554 *keyval = Z_STRVAL_P(key_php);
555 *
length = Z_STRLEN_P(key_php);
573 #if PHP_MAJOR_VERSION < 7
577 *(zval**)
to = **(zval***)
from;
578 Z_ADDREF_PP((zval**)
to);
584 *(zend_string**)
to = Z_STR_P(*(zval**)
from);
585 zend_string_addref(*(zend_string**)
to);
627 const char* keyval = NULL;
673 #define DEFINE_ONEOF_HANDLER(type, ctype) \
674 static bool oneof##type##_handler(void* closure, const void* hd, \
676 const oneof_handlerdata_t* oneofdata = hd; \
677 MessageHeader* msg = (MessageHeader*)closure; \
678 DEREF(message_data(closure), oneofdata->case_ofs, uint32_t) = \
679 oneofdata->oneof_case_num; \
680 DEREF(message_data(closure), oneofdata->ofs, ctype) = val; \
692 #undef DEFINE_ONEOF_HANDLER
698 if (old_case_num == 0) {
704 bool need_clean =
false;
721 #if PHP_MAJOR_VERSION < 7
722 SEPARATE_ZVAL_IF_NOT_REF(
757 oneofdata->oneof_case_num;
792 zend_class_entry* subklass = subdesc->
klass;
802 #if PHP_MAJOR_VERSION < 7
804 ZVAL_OBJ(&val, subklass->create_object(subklass TSRMLS_CC));
809 zend_object*
obj = subklass->create_object(subklass TSRMLS_CC);
834 #define SET_HANDLER(utype, ltype) \
836 upb_handlers_set##ltype(h, f, append##ltype##_handler, NULL); \
871 #define SET_HANDLER(utype, ltype) \
873 upb_handlerattr attr = UPB_HANDLERATTR_INIT; \
874 attr.handler_data = newhandlerdata(h, offset); \
875 upb_handlers_set##ltype(h, f, ltype##_handler, &attr); \
918 attr.handler_data = hd;
931 attr.handler_data = hd;
947 size_t oneof_case_offset,
948 int property_cache_offset) {
952 property_cache_offset,
m,
f);
956 #define SET_HANDLER(utype, ltype) \
958 upb_handlers_set##ltype(h, f, oneof##ltype##_handler, &attr); \
993 if (unknown == NULL) {
1022 if (
desc->layout == NULL) {
1037 size_t oneof_case_offset =
1039 int property_cache_index =
1042 oneof_case_offset, property_cache_index);
1072 int depth,
bool is_json TSRMLS_DC);
1075 bool open_msg TSRMLS_DC);
1086 bool force_default);
1092 int depth,
bool is_json TSRMLS_DC);
1097 int depth,
bool is_json TSRMLS_DC);
1099 int depth,
bool is_json TSRMLS_DC);
1111 bool is_json TSRMLS_DC) {
1115 #define T(upbtypeconst, upbtype, ctype, default_value) \
1116 case upbtypeconst: { \
1117 ctype value = DEREF(memory, 0, ctype); \
1118 if (is_json || value != default_value) { \
1119 upb_selector_t sel = getsel(f, upb_handlers_getprimitivehandlertype(f)); \
1120 upb_sink_put##upbtype(sink, sel, value); \
1139 #if PHP_MAJOR_VERSION < 7
1159 #if PHP_MAJOR_VERSION < 7
1160 return Z_STRVAL_PP((zval**)memory);
1162 return ZSTR_VAL(*(zend_string**)memory);
1174 #if PHP_MAJOR_VERSION < 7
1175 return Z_STRLEN_PP((zval**)memory);
1177 return ZSTR_LEN(*(zend_string**)memory);
1185 int depth,
bool is_json TSRMLS_DC) {
1195 if (
size == 0)
return;
1214 entry_sink, is_json TSRMLS_CC);
1220 value_field,
depth + 1, entry_sink, is_json TSRMLS_CC);
1230 int depth,
bool is_json TSRMLS_DC) {
1245 zval* type_url_php_str;
1254 if (Z_STRLEN_P(type_url_php_str) > 0) {
1255 putstr(type_url_php_str, type_field,
sink,
false);
1259 const char* type_url_str = Z_STRVAL_P(type_url_php_str);
1260 size_t type_url_len = Z_STRLEN_P(type_url_php_str);
1261 if (type_url_len <= 20 ||
1262 strncmp(type_url_str,
"type.googleapis.com/", 20) != 0) {
1263 zend_error(E_ERROR,
"Invalid type url: %s", type_url_str);
1272 if (payload_type == NULL) {
1273 zend_error(E_ERROR,
"Unknown type: %s", type_url_str);
1280 zval* value_php_str;
1281 const char* value_str;
1287 value_str = Z_STRVAL_P(value_php_str);
1288 value_len = Z_STRLEN_P(value_php_str);
1290 if (value_len > 0) {
1293 zend_class_entry* payload_klass = payload_desc->
klass;
1299 ZVAL_OBJ(&val, payload_klass->create_object(payload_klass TSRMLS_CC));
1317 is_wellknown TSRMLS_CC);
1344 size = zend_hash_num_elements(ht);
1386 bool open_msg TSRMLS_DC) {
1416 "Maximum recursion depth exceeded during encoding.");
1448 if (
array != NULL) {
1455 Z_STRLEN_P(
str) > 0) {
1465 #define T(upbtypeconst, upbtype, ctype, default_value) \
1466 case upbtypeconst: { \
1467 ctype value = DEREF(message_data(msg), offset, ctype); \
1468 if (containing_oneof || \
1469 (is_json && is_wrapper_msg(desc->msgdef)) || \
1470 value != default_value) { \
1471 upb_sink_put##upbtype(sink, sel, value); \
1488 zend_error(E_ERROR,
"Internal error.");
1496 if (unknown != NULL) {
1509 if (ZVAL_IS_NULL(
str))
return;
1517 if (Z_STRLEN_P(
str) > 0 || force_default) {
1523 zend_error(E_USER_ERROR,
"Given string is not UTF8 encoded.");
1527 Z_STRLEN_P(
str), NULL);
1537 if (
len == 0 && !force_default)
return;
1543 zend_error(E_USER_ERROR,
"Given string is not UTF8 encoded.");
1553 int depth,
bool is_json TSRMLS_DC) {
1554 if (Z_TYPE_P(submsg_php) == IS_NULL)
return;
1568 putrawmsg(submsg, subdesc, subsink,
depth + 1, is_json,
true TSRMLS_CC);
1573 int depth,
bool is_json TSRMLS_DC) {
1582 size = zend_hash_num_elements(ht);
1583 if (
size == 0)
return;
1594 #define T(upbtypeconst, upbtype, ctype) \
1595 case upbtypeconst: \
1596 upb_sink_put##upbtype(subsink, sel, *((ctype*)memory)); \
1610 #if PHP_MAJOR_VERSION < 7
1611 const char* rawstr = Z_STRVAL_P(*(zval**)memory);
1612 int len = Z_STRLEN_P(*(zval**)memory);
1614 const char* rawstr = ZSTR_VAL(*(zend_string**)memory);
1615 int len = ZSTR_LEN(*(zend_string**)memory);
1622 #if PHP_MAJOR_VERSION < 7
1646 if (preserve_proto_fieldnames) {
1648 desc->pool->json_serialize_handler_preserve_cache,
desc->msgdef);
1712 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &
data, &data_len) ==
1724 zend_bool preserve_proto_fieldnames =
false;
1725 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"|b",
1726 &preserve_proto_fieldnames) == FAILURE) {
1758 zend_bool ignore_json_unknown =
false;
1760 if (zend_parse_parameters(
1761 ZEND_NUM_ARGS() TSRMLS_CC,
"s|b", &
data, &data_len,
1762 &ignore_json_unknown) ==
1794 if (unknown != NULL) {
1834 if (map_php == NULL)
continue;
1837 for (
map_begin(map_php, &map_it TSRMLS_CC);
1841 #if PHP_MAJOR_VERSION < 7
1855 if (array_php == NULL)
continue;
1860 size = zend_hash_num_elements(ht);
1861 if (
size == 0)
continue;
1865 #if PHP_MAJOR_VERSION < 7
1877 if (Z_TYPE_P(submsg_php) == IS_NULL)
continue;
static bool is_wrapper_msg(const upb_msgdef *msg)
static void putjsonlistvalue(MessageHeader *msg, const Descriptor *desc, upb_sink sink, int depth TSRMLS_DC)
static void add_handlers_for_mapfield(upb_handlers *h, const upb_fielddef *fielddef, size_t offset, Descriptor *desc)
bool upb_handlers_setendstr(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, const upb_handlerattr *attr)
const upb_filedef * upb_msgdef_file(const upb_msgdef *m)
UPB_INLINE size_t upb_sink_putstring(upb_sink s, upb_selector_t sel, const char *buf, size_t n, const upb_bufhandle *handle)
UPB_INLINE bool upb_sink_startmsg(upb_sink s)
void custom_data_init(const zend_class_entry *ce, MessageHeader *intern PHP_PROTO_TSRMLS_DC)
OPENSSL_EXPORT const ASN1_OBJECT * obj
upb_sink upb_json_printer_input(upb_json_printer *p)
static void putmap(zval *map, const upb_fielddef *f, upb_sink sink, int depth, bool is_json TSRMLS_DC)
upb_label_t upb_fielddef_label(const upb_fielddef *f)
void upb_status_clear(upb_status *status)
void upb_msg_field_next(upb_msg_field_iter *iter)
map_parse_frame_data_t * data
static const upb_pbdecodermethod * msgdef_decodermethod(Descriptor *desc)
return memset(p, 0, total)
void stringsink_uninit_opaque(void *sink)
static int raw_value_len(void *memory, int len, const upb_fielddef *f)
#define DEFINE_SINGULAR_HANDLER(type, ctype)
upb_fieldtype_t value_field_type
static bool str_end_handler(void *closure, const void *hd)
static bool oneofstr_end_handler(void *closure, const void *hd)
static const void * newoneofhandlerdata(upb_handlers *h, uint32_t ofs, uint32_t case_ofs, int property_ofs, const upb_msgdef *m, const upb_fielddef *f)
bool upb_fielddef_issubmsg(const upb_fielddef *f)
const upb_fielddef * map_field_key(const upb_fielddef *field)
upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f)
static void putrawstr(const char *str, int len, const upb_fielddef *f, upb_sink sink, bool force_default)
static void * str_handler(void *closure, const void *hd, size_t size_hint)
void merge_from_string(const char *data, int data_len, Descriptor *desc, MessageHeader *msg)
static void discard_unknown_fields(MessageHeader *msg)
#define DEREF(msg, ofs, type)
static void putjsonstruct(MessageHeader *msg, const Descriptor *desc, upb_sink sink, int depth TSRMLS_DC)
void upb_arena_free(upb_arena *a)
#define CACHED_PTR_TO_ZVAL_PTR(VALUE)
static void stackenv_init(stackenv *se, const char *errmsg)
static const upb_handlers * msgdef_json_serialize_handlers(Descriptor *desc, bool preserve_proto_fieldnames)
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern array
bool upb_handlers_setstring(upb_handlers *h, const upb_fielddef *f, upb_string_handlerfunc *func, const upb_handlerattr *attr)
static void putarray(zval *array, const upb_fielddef *f, upb_sink sink, int depth, bool is_json TSRMLS_DC)
@ UPB_WELLKNOWN_UNSPECIFIED
const upb_msgdef * msgdef
bool upb_handlers_setstartsubmsg(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, const upb_handlerattr *attr)
upb_fielddef * upb_msg_iter_field(const upb_msg_field_iter *iter)
void add_handlers_for_message(const void *closure, upb_handlers *h)
size_t stringsink_string(void *_sink, const void *hd, const char *ptr, size_t len, const upb_bufhandle *handle)
bool upb_byteshandler_setstartstr(upb_byteshandler *h, upb_startstr_handlerfunc *func, void *d)
#define ENCODE_MAX_NESTING
#define DEFINE_ONEOF_HANDLER(type, ctype)
upb_pbdecoder * upb_pbdecoder_create(upb_arena *a, const upb_pbdecodermethod *m, upb_sink sink, upb_status *status)
bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink sink)
#define PHP_PROTO_TSRMLS_CC
static void add_handlers_for_repeated_field(upb_handlers *h, const upb_fielddef *f, size_t offset)
static void * empty_php_string2(zval **value_ptr)
static const upb_handlers * msgdef_pb_serialize_handlers(Descriptor *desc)
void * repeated_field_index_native(RepeatedField *intern, int index TSRMLS_DC)
#define NATIVE_SLOT_MAX_SIZE
#define ZVAL_OBJ(zval_ptr, call_create)
bool upb_fielddef_isprimitive(const upb_fielddef *f)
UPB_INLINE bool upb_sink_startseq(upb_sink s, upb_selector_t sel, upb_sink *sub)
upb_value map_iter_value(MapIter *iter, int *len)
bool upb_handlers_setunknown(upb_handlers *h, upb_unknown_handlerfunc *func, const upb_handlerattr *attr)
static void putrawmsg(MessageHeader *msg, const Descriptor *desc, upb_sink sink, int depth, bool is_json, bool open_msg TSRMLS_DC)
static bool endmap_handler(void *closure, const void *hd, upb_status *s)
#define T(upbtypeconst, upbtype, ctype, default_value)
const upb_handlers * handlers
PHP_PROTO_HASHTABLE_VALUE get_def_obj(const void *def)
const upb_msgdef * upb_fielddef_msgsubdef(const upb_fielddef *f)
const upb_handlers * upb_handlercache_get(upb_handlercache *c, const upb_msgdef *md)
const upb_msgdef * upb_symtab_lookupmsg2(const upb_symtab *s, const char *sym, size_t len)
UPB_INLINE void upb_bytessink_reset(upb_bytessink *s, const upb_byteshandler *h, void *closure)
static void * empty_php_string(zval **value_ptr)
const upb_handlers * get_fill_handlers(Descriptor *desc)
bool map_done(MapIter *iter)
bool upb_msg_field_done(const upb_msg_field_iter *iter)
bool upb_handlers_getselector(const upb_fielddef *f, upb_handlertype_t type, upb_selector_t *s)
#define DEFINE_APPEND_HANDLER(type, ctype)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static bool appendstr_end_handler(void *closure, const void *hd)
static const void * newhandlerdata(upb_handlers *h, uint32_t ofs)
UPB_INLINE bool upb_sink_endsubmsg(upb_sink s, upb_selector_t sel)
encodeunknown_handlerfunc handler
const char * upb_filedef_name(const upb_filedef *f)
static void * startmapentry_handler(void *closure, const void *hd)
const char * upb_status_errmsg(const upb_status *status)
#define PHP_PROTO_UNUSED(var)
static void put_optional_value(const void *memory, int len, const upb_fielddef *f, int depth, upb_sink sink, bool is_json TSRMLS_DC)
upb_fieldtype_t key_field_type
void serialize_to_string(zval *val, zval *return_value TSRMLS_DC)
upb_bytessink upb_pbdecoder_input(upb_pbdecoder *d)
#define SET_HANDLER(utype, ltype)
static bool add_unknown_handler(void *closure, const void *hd, const char *buf, size_t size)
unsigned __int64 uint64_t
uint32_t upb_fielddef_number(const upb_fielddef *f)
UPB_INLINE bool upb_sink_endmsg(upb_sink s, upb_status *status)
bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *func)
bool upb_fielddef_isstring(const upb_fielddef *f)
static void new_php_string(zval **value_ptr, const char *str, size_t len)
UPB_INLINE upb_arena * upb_arena_new(void)
#define STACK_ENV_STACKBYTES
InternalDescriptorPool * generated_pool
const upb_pbdecodermethod * upb_pbcodecache_get(upb_pbcodecache *c, const upb_msgdef *md)
static void map_slot_value(upb_fieldtype_t type, const void *from, upb_value *v)
static void * startseq_handler(void *closure, const void *hd)
const upb_fielddef * map_field_value(const upb_fielddef *field)
const upb_msgdef * upb_fielddef_containingtype(const upb_fielddef *f)
size_t(* encodeunknown_handlerfunc)(void *_sink, const void *hd, const char *ptr, size_t len, const upb_bufhandle *handle)
static void putjsonany(MessageHeader *msg, const Descriptor *desc, upb_sink sink, int depth TSRMLS_DC)
const upb_fielddef * upb_msgdef_itof(const upb_msgdef *m, uint32_t i)
bool upb_ok(const upb_status *status)
static const void * newunknownfieldshandlerdata(upb_handlers *h)
@ UPB_HANDLER_STARTSUBMSG
static void * appendsubmsg_handler(void *closure, const void *hd)
static void add_handlers_for_singular_field(upb_handlers *h, const upb_fielddef *f, size_t offset)
void * message_data(MessageHeader *msg)
void stringsink_uninit(stringsink *sink)
static const upb_json_parsermethod * msgdef_jsonparsermethod(Descriptor *desc)
uint32_t upb_fielddef_index(const upb_fielddef *f)
upb_sink upb_pb_encoder_input(upb_pb_encoder *e)
static void putrawsubmsg(MessageHeader *submsg, const upb_fielddef *f, upb_sink sink, int depth, bool is_json TSRMLS_DC)
PHP_PROTO_HASHTABLE_VALUE get_ce_obj(const void *ce)
static void map_slot_init(void *memory, upb_fieldtype_t type, zval *cache)
OPENSSL_EXPORT X509_ATTRIBUTE * attr
bool is_structurally_valid_utf8(const char *buf, int len)
void * upb_value_memory(upb_value *v)
UPB_INLINE bool upb_sink_endstr(upb_sink s, upb_selector_t sel)
static void add_handlers_for_oneof_field(upb_handlers *h, const upb_msgdef *m, const upb_fielddef *f, size_t offset, size_t oneof_case_offset, int property_cache_offset)
UPB_INLINE bool upb_sink_putunknown(upb_sink s, const char *buf, size_t n)
void map_begin(zval *map_php, MapIter *iter TSRMLS_DC)
PHP_METHOD(Message, serializeToString)
UPB_INLINE bool upb_sink_startstr(upb_sink s, upb_selector_t sel, size_t size_hint, upb_sink *sub)
#define PHP_PROTO_HASH_OF(array)
#define ALLOC(class_name)
void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m)
upb_strtable_uninit & intern
void map_next(MapIter *iter)
const upb_fielddef * map_entry_value(const upb_msgdef *msgdef)
UPB_INLINE void upb_byteshandler_init(upb_byteshandler *handler)
php_proto_zval_ptr_dtor(intern->array)
UniquePtr< SSL_SESSION > ret
upb_json_printer * upb_json_printer_create(upb_arena *a, const upb_handlers *h, upb_bytessink output)
const upb_msgdef * msgdef
static void map_slot_key(upb_fieldtype_t type, const void *from, const char **keyval, size_t *length)
#define UPB_HANDLERATTR_INIT
size_t native_slot_size(upb_fieldtype_t type)
static void map_slot_uninit(void *memory, upb_fieldtype_t type)
void native_slot_init(upb_fieldtype_t type, void *memory, CACHED_VALUE *cache)
upb_bytessink upb_json_parser_input(upb_json_parser *p)
#define OBJ_PROP(OBJECT, OFFSET)
UPB_INLINE void upb_sink_reset(upb_sink *s, const upb_handlers *h, void *c)
static void frame(frame_handler *handler, unsigned char *payload, size_t payload_length, size_t write_length)
static void putmsg(zval *msg, const Descriptor *desc, upb_sink sink, int depth, bool is_json TSRMLS_DC)
static void stackenv_uninit(stackenv *se)
upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m)
void stringsink_init(stringsink *sink)
upb_pb_encoder * upb_pb_encoder_create(upb_arena *arena, const upb_handlers *h, upb_bytessink output)
#define PHP_PROTO_ZVAL_STRINGL(zval_ptr, s, len, copy)
#define PHP_PROTO_WRAP_OBJECT_START(name)
const upb_oneofdef * upb_fielddef_containingoneof(const upb_fielddef *f)
#define PHP_PROTO_RETVAL_STRINGL(s, len, copy)
UPB_INLINE bool upb_sink_endseq(upb_sink s, upb_selector_t sel)
bool upb_msgdef_mapentry(const upb_msgdef *m)
bool upb_handlers_setendmsg(upb_handlers *h, upb_endmsg_handlerfunc *func, const upb_handlerattr *attr)
static const void * newsubmsghandlerdata(upb_handlers *h, uint32_t ofs, const upb_fielddef *f)
static void * stringsink_start(void *_sink, const void *hd, size_t size_hint)
#define UNBOX_HASHTABLE_VALUE(class_name, val)
#define PHP_PROTO_WRAP_OBJECT_END
const upb_msgdef * upb_handlers_msgdef(const upb_handlers *h)
const upb_fielddef * map_entry_key(const upb_msgdef *msgdef)
static size_t stringdata_handler(void *closure, const void *hd, const char *str, size_t len, const upb_bufhandle *handle)
static void add_handlers_for_mapentry(const upb_msgdef *msgdef, upb_handlers *h, Descriptor *desc)
bool upb_handlers_setstartseq(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, const upb_handlerattr *attr)
void repeated_field_push_native(RepeatedField *intern, void *value)
static void putsubmsg(zval *submsg, const upb_fielddef *f, upb_sink sink, int depth, bool is_json TSRMLS_DC)
static map_handlerdata_t * new_map_handlerdata(size_t ofs, const upb_msgdef *mapentry_def, Descriptor *desc)
bool map_index_set(Map *intern, const char *keyval, int length, upb_value v)
const upb_fielddef * fielddef
bool upb_fielddef_isseq(const upb_fielddef *f)
const char * php_error_template
upb_json_parser * upb_json_parser_create(upb_arena *arena, const upb_json_parsermethod *method, const upb_symtab *symtab, upb_sink output, upb_status *status, bool ignore_json_unknown)
static const char * raw_value(void *memory, const upb_fielddef *f)
bool upb_handlers_setstartstr(upb_handlers *h, const upb_fielddef *f, upb_startstr_handlerfunc *func, const upb_handlerattr *attr)
#define PHP_PROTO_ASSERT(expr)
static void * oneofbytes_handler(void *closure, const void *hd, size_t size_hint)
static void * appendstr_handler(void *closure, const void *hd, size_t size_hint)
const upb_msgdef * parent_md
static upb_selector_t getsel(const upb_fielddef *f, upb_handlertype_t type)
static void oneof_cleanup(MessageHeader *msg, const oneof_handlerdata_t *oneofdata)
const upb_json_parsermethod * upb_json_codecache_get(upb_json_codecache *c, const upb_msgdef *md)
const char * map_iter_key(MapIter *iter, int *len)
PHP_PROTO_WRAP_OBJECT_END MessageLayout * create_layout(const upb_msgdef *msgdef)
bool is_map_field(const upb_fielddef *field)
const upb_handlers * upb_pbdecodermethod_desthandlers(const upb_pbdecodermethod *m)
UPB_INLINE size_t upb_strtable_count(const upb_strtable *t)
static void putstr(zval *str, const upb_fielddef *f, upb_sink sink, bool force_default)
#define UNBOX(class_name, val)
@ UPB_WELLKNOWN_LISTVALUE
upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f)
UPB_INLINE bool upb_sink_startsubmsg(upb_sink s, upb_selector_t sel, upb_sink *sub)
static void * submsg_handler(void *closure, const void *hd)
static void * oneofsubmsg_handler(void *closure, const void *hd)
static void * oneofstr_handler(void *closure, const void *hd, size_t size_hint)
bool upb_byteshandler_setstring(upb_byteshandler *h, upb_string_handlerfunc *func, void *d)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:15