Go to the documentation of this file.
32 #include <Zend/zend_exceptions.h>
48 size_t new_size = sink->
size;
53 while (sink->
len +
len > new_size) {
57 if (new_size != sink->
size) {
58 sink->
ptr = realloc(sink->
ptr, new_size);
59 sink->
size = new_size;
90 #define STACK_ENV_STACKBYTES 4096
127 "google/protobuf/wrappers.proto");
130 #define DEREF(msg, ofs, type) *(type*)(((uint8_t *)msg) + ofs)
134 size_t* hd_ofs = (
size_t*)malloc(
sizeof(
size_t));
146 const char* ptr,
size_t len,
219 const size_t *ofs = hd;
224 #define DEFINE_APPEND_HANDLER(type, ctype) \
225 static bool append##type##_handler(void* closure, const void* hd, \
227 zval* array = (zval*)closure; \
229 RepeatedField* intern = UNBOX(RepeatedField, array); \
230 repeated_field_push_native(intern, &val); \
263 #if PHP_MAJOR_VERSION < 7
280 #define DEFINE_SINGULAR_HANDLER(type, ctype) \
281 static bool type##_handler(void* closure, const void* hd, \
283 MessageHeader* msg = (MessageHeader*)closure; \
284 const size_t *ofs = hd; \
285 DEREF(message_data(msg), *ofs, ctype) = val; \
297 #undef DEFINE_SINGULAR_HANDLER
299 #if PHP_MAJOR_VERSION < 7
301 SEPARATE_ZVAL_IF_NOT_REF(value_ptr);
302 if (Z_TYPE_PP(value_ptr) == IS_STRING &&
303 !IS_INTERNED(Z_STRVAL_PP(value_ptr))) {
304 FREE(Z_STRVAL_PP(value_ptr));
306 ZVAL_EMPTY_STRING(*value_ptr);
307 return (
void*)(*value_ptr);
311 if (Z_TYPE_P(value_ptr) == IS_STRING) {
312 zend_string_release(Z_STR_P(value_ptr));
314 ZVAL_EMPTY_STRING(value_ptr);
318 #if PHP_MAJOR_VERSION < 7
320 SEPARATE_ZVAL_IF_NOT_REF(value_ptr);
321 if (Z_TYPE_PP(value_ptr) == IS_STRING &&
322 !IS_INTERNED(Z_STRVAL_PP(value_ptr))) {
323 FREE(Z_STRVAL_PP(value_ptr));
325 ZVAL_EMPTY_STRING(*value_ptr);
326 return (
void*)(*value_ptr);
329 SEPARATE_ZVAL_IF_NOT_REF(value_ptr);
330 if (Z_TYPE_PP(value_ptr) == IS_STRING &&
331 !IS_INTERNED(Z_STRVAL_PP(value_ptr))) {
332 FREE(Z_STRVAL_PP(value_ptr));
334 ZVAL_EMPTY_STRING(*value_ptr);
335 ZVAL_STRINGL(*value_ptr,
str,
len, 1);
339 if (Z_TYPE_P(value_ptr) == IS_STRING) {
340 zend_string_release(Z_STR_P(value_ptr));
342 ZVAL_EMPTY_STRING(value_ptr);
346 if (Z_TYPE_P(value_ptr) == IS_STRING) {
347 zend_string_release(Z_STR_P(value_ptr));
349 ZVAL_NEW_STR(value_ptr, zend_string_init(
str,
len, 0));
369 const size_t *ofs = hd;
382 const char*
str,
size_t len,
390 zval*
array = (zval*)closure;
397 zend_class_entry* subklass = subdesc->
klass;
400 #if PHP_MAJOR_VERSION < 7
403 ZVAL_OBJ(
val, subklass->create_object(subklass TSRMLS_CC));
407 zend_object*
obj = subklass->create_object(subklass TSRMLS_CC);
423 zend_class_entry* subklass = subdesc->
klass;
429 #if PHP_MAJOR_VERSION < 7
431 ZVAL_OBJ(&
val, subklass->create_object(subklass TSRMLS_CC));
438 zend_object*
obj = subklass->create_object(subklass TSRMLS_CC);
485 #if PHP_MAJOR_VERSION < 7
488 zval** holder =
ALLOC(zval*);
489 *(zval***)memory = holder;
495 *(zval**)memory = cache;
501 #if PHP_MAJOR_VERSION < 7
502 zval** holder =
ALLOC(zval*);
507 *(zval***)memory = holder;
509 *(zval**)memory = cache;
510 ZVAL_NULL(*(zval**)memory);
524 #if PHP_MAJOR_VERSION < 7
525 zval** holder = *(zval***)memory;
526 zval_ptr_dtor(holder);
542 #if PHP_MAJOR_VERSION < 7
543 zval* key_php = **(zval***)from;
545 zval* key_php = *(zval**)from;
547 *keyval = Z_STRVAL_P(key_php);
548 *
length = Z_STRLEN_P(key_php);
566 #if PHP_MAJOR_VERSION < 7
570 *(zval**)to = **(zval***)from;
571 Z_ADDREF_PP((zval**)to);
577 *(zend_string**)to = Z_STR_P(*(zval**)from);
578 zend_string_addref(*(zend_string**)to);
581 *(zend_object**)to =
Z_OBJ_P(*(zval**)from);
587 memcpy(to, from,
len);
620 const char* keyval =
NULL;
656 assert(key_field !=
NULL);
659 assert(value_field !=
NULL);
666 #define DEFINE_ONEOF_HANDLER(type, ctype) \
667 static bool oneof##type##_handler(void* closure, const void* hd, \
669 const oneof_handlerdata_t* oneofdata = hd; \
670 MessageHeader* msg = (MessageHeader*)closure; \
671 DEREF(message_data(closure), oneofdata->case_ofs, uint32_t) = \
672 oneofdata->oneof_case_num; \
673 DEREF(message_data(closure), oneofdata->ofs, ctype) = val; \
685 #undef DEFINE_ONEOF_HANDLER
689 uint32_t old_case_num =
691 if (old_case_num == 0) {
697 bool need_clean =
false;
714 #if PHP_MAJOR_VERSION < 7
715 SEPARATE_ZVAL_IF_NOT_REF(
750 oneofdata->oneof_case_num;
752 OBJ_PROP(&msg->std, oneofdata->property_ofs);
784 zend_class_entry* subklass = subdesc->
klass;
794 #if PHP_MAJOR_VERSION < 7
796 ZVAL_OBJ(&
val, subklass->create_object(subklass TSRMLS_CC));
801 zend_object*
obj = subklass->create_object(subklass TSRMLS_CC);
826 #define SET_HANDLER(utype, ltype) \
828 upb_handlers_set##ltype(h, f, append##ltype##_handler, NULL); \
863 #define SET_HANDLER(utype, ltype) \
865 upb_handlerattr attr = UPB_HANDLERATTR_INIT; \
866 attr.handler_data = newhandlerdata(h, offset); \
867 upb_handlers_set##ltype(h, f, ltype##_handler, &attr); \
939 size_t oneof_case_offset,
940 int property_cache_offset) {
944 property_cache_offset,
m,
f);
948 #define SET_HANDLER(utype, ltype) \
950 upb_handlers_set##ltype(h, f, oneof##ltype##_handler, &attr); \
985 if (unknown ==
NULL) {
1029 size_t oneof_case_offset =
1031 int property_cache_index =
1034 oneof_case_offset, property_cache_index);
1064 int depth,
bool is_json TSRMLS_DC);
1067 bool open_msg TSRMLS_DC);
1078 bool force_default);
1081 upb_sink sink,
bool force_default);
1084 int depth,
bool is_json TSRMLS_DC);
1089 int depth,
bool is_json TSRMLS_DC);
1091 int depth,
bool is_json TSRMLS_DC);
1103 bool is_json TSRMLS_DC) {
1107 #define T(upbtypeconst, upbtype, ctype, default_value) \
1108 case upbtypeconst: { \
1109 ctype value = DEREF(memory, 0, ctype); \
1110 if (is_json || value != default_value) { \
1111 upb_selector_t sel = getsel(f, upb_handlers_getprimitivehandlertype(f)); \
1112 upb_sink_put##upbtype(sink, sel, value); \
1131 #if PHP_MAJOR_VERSION < 7
1151 #if PHP_MAJOR_VERSION < 7
1152 return Z_STRVAL_PP((zval**)memory);
1154 return ZSTR_VAL(*(zend_string**)memory);
1166 #if PHP_MAJOR_VERSION < 7
1167 return Z_STRLEN_PP((zval**)memory);
1169 return ZSTR_LEN(*(zend_string**)memory);
1177 int depth,
bool is_json TSRMLS_DC) {
1187 if (
size == 0)
return;
1206 entry_sink, is_json TSRMLS_CC);
1212 value_field,
depth + 1, entry_sink, is_json TSRMLS_CC);
1222 int depth,
bool is_json TSRMLS_DC) {
1236 uint32_t type_url_offset;
1237 zval* type_url_php_str;
1246 if (Z_STRLEN_P(type_url_php_str) > 0) {
1247 putstr(type_url_php_str, type_field, sink,
false);
1251 const char* type_url_str = Z_STRVAL_P(type_url_php_str);
1252 size_t type_url_len = Z_STRLEN_P(type_url_php_str);
1253 if (type_url_len <= 20 ||
1254 strncmp(type_url_str,
"type.googleapis.com/", 20) != 0) {
1255 zend_error(E_ERROR,
"Invalid type url: %s", type_url_str);
1264 if (payload_type ==
NULL) {
1265 zend_error(E_ERROR,
"Unknown type: %s", type_url_str);
1271 uint32_t value_offset;
1272 zval* value_php_str;
1273 const char* value_str;
1279 value_str = Z_STRVAL_P(value_php_str);
1280 value_len = Z_STRLEN_P(value_php_str);
1282 if (value_len > 0) {
1285 zend_class_entry* payload_klass = payload_desc->
klass;
1291 ZVAL_OBJ(&
val, payload_klass->create_object(payload_klass TSRMLS_CC));
1309 is_wellknown TSRMLS_CC);
1336 size = zend_hash_num_elements(ht);
1378 bool open_msg TSRMLS_DC) {
1408 "Maximum recursion depth exceeded during encoding.");
1415 bool containing_oneof =
false;
1418 uint32_t oneof_case_offset =
1428 containing_oneof =
true;
1447 Z_STRLEN_P(
str) > 0) {
1453 f, sink,
depth, is_json TSRMLS_CC);
1457 #define T(upbtypeconst, upbtype, ctype, default_value) \
1458 case upbtypeconst: { \
1459 ctype value = DEREF(message_data(msg), offset, ctype); \
1460 if (containing_oneof || \
1461 (is_json && is_wrapper_msg(desc->msgdef)) || \
1462 value != default_value) { \
1463 upb_sink_put##upbtype(sink, sel, value); \
1480 zend_error(E_ERROR,
"Internal error.");
1488 if (unknown !=
NULL) {
1498 upb_sink sink,
bool force_default) {
1501 if (ZVAL_IS_NULL(
str))
return;
1503 assert(Z_TYPE_P(
str) == IS_STRING);
1509 if (Z_STRLEN_P(
str) > 0 || force_default) {
1515 zend_error(E_USER_ERROR,
"Given string is not UTF8 encoded.");
1526 upb_sink sink,
bool force_default) {
1529 if (
len == 0 && !force_default)
return;
1535 zend_error(E_USER_ERROR,
"Given string is not UTF8 encoded.");
1545 int depth,
bool is_json TSRMLS_DC) {
1546 if (Z_TYPE_P(submsg_php) == IS_NULL)
return;
1560 putrawmsg(submsg, subdesc, subsink,
depth + 1, is_json,
true TSRMLS_CC);
1565 int depth,
bool is_json TSRMLS_DC) {
1574 size = zend_hash_num_elements(ht);
1575 if (
size == 0)
return;
1586 #define T(upbtypeconst, upbtype, ctype) \
1587 case upbtypeconst: \
1588 upb_sink_put##upbtype(subsink, sel, *((ctype*)memory)); \
1602 #if PHP_MAJOR_VERSION < 7
1603 const char* rawstr = Z_STRVAL_P(*(zval**)memory);
1604 int len = Z_STRLEN_P(*(zval**)memory);
1606 const char* rawstr = ZSTR_VAL(*(zend_string**)memory);
1607 int len = ZSTR_LEN(*(zend_string**)memory);
1614 #if PHP_MAJOR_VERSION < 7
1638 if (preserve_proto_fieldnames) {
1640 desc->pool->json_serialize_handler_preserve_cache,
desc->msgdef);
1704 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &
data, &data_len) ==
1716 zend_bool preserve_proto_fieldnames =
false;
1717 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"|b",
1718 &preserve_proto_fieldnames) == FAILURE) {
1752 if (zend_parse_parameters(
1753 ZEND_NUM_ARGS() TSRMLS_CC,
"s|b", &
data, &data_len,
1786 if (unknown !=
NULL) {
1800 bool containing_oneof =
false;
1803 uint32_t oneof_case_offset =
1813 containing_oneof =
true;
1826 if (map_php ==
NULL)
continue;
1829 for (
map_begin(map_php, &map_it TSRMLS_CC);
1833 #if PHP_MAJOR_VERSION < 7
1847 if (array_php ==
NULL)
continue;
1852 size = zend_hash_num_elements(ht);
1853 if (
size == 0)
continue;
1857 #if PHP_MAJOR_VERSION < 7
1869 if (Z_TYPE_P(submsg_php) == IS_NULL)
continue;
static bool is_wrapper_msg(const upb_msgdef *msg)
upb_bytessink upb_pbdecoder_input(upb_pbdecoder *d)
static void putjsonlistvalue(MessageHeader *msg, const Descriptor *desc, upb_sink sink, int depth TSRMLS_DC)
upb_sink upb_pb_encoder_input(upb_pb_encoder *e)
static void add_handlers_for_mapfield(upb_handlers *h, const upb_fielddef *fielddef, size_t offset, Descriptor *desc)
const upb_msgdef * msgdef
void * upb_value_memory(upb_value *v)
#define UNBOX_HASHTABLE_VALUE(class_name, val)
char key_storage[NATIVE_SLOT_MAX_SIZE]
bool upb_handlers_getselector(const upb_fielddef *f, upb_handlertype_t type, upb_selector_t *s)
static void putmap(zval *map, const upb_fielddef *f, upb_sink sink, int depth, bool is_json TSRMLS_DC)
void upb_status_clear(upb_status *status)
bool upb_handlers_setunknown(upb_handlers *h, upb_unknown_handlerfunc *func, const upb_handlerattr *attr)
#define PHP_PROTO_TSRMLS_CC
void custom_data_init(const zend_class_entry *ce, MessageHeader *intern PHP_PROTO_TSRMLS_DC)
@ UPB_HANDLER_STARTSUBMSG
#define CACHED_PTR_TO_ZVAL_PTR(VALUE)
static const upb_pbdecodermethod * msgdef_decodermethod(Descriptor *desc)
void stringsink_uninit_opaque(void *sink)
UPB_INLINE upb_arena * upb_arena_new()
static int raw_value_len(void *memory, int len, const upb_fielddef *f)
bool upb_msgdef_mapentry(const upb_msgdef *m)
#define DEFINE_SINGULAR_HANDLER(type, ctype)
upb_pb_encoder * upb_pb_encoder_create(upb_arena *arena, const upb_handlers *h, upb_bytessink output)
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)
const upb_fielddef * fielddef
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)
const char * map_iter_key(MapIter *iter, int *len)
upb_bytessink upb_json_parser_input(upb_json_parser *p)
GLenum GLuint GLenum GLsizei length
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 native_slot_init(upb_fieldtype_t type, void *memory, CACHED_VALUE *cache)
void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m)
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)
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)
void * message_data(MessageHeader *msg)
const upb_filedef * upb_msgdef_file(const upb_msgdef *m)
bool upb_handlers_setstartseq(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, const upb_handlerattr *attr)
static void stackenv_init(stackenv *se, const char *errmsg)
bool map_index_set(Map *intern, const char *keyval, int length, upb_value v)
bool upb_fielddef_issubmsg(const upb_fielddef *f)
static const upb_handlers * msgdef_json_serialize_handlers(Descriptor *desc, bool preserve_proto_fieldnames)
bool upb_handlers_setendstr(upb_handlers *h, const upb_fielddef *f, upb_endfield_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)
const upb_msgdef * upb_symtab_lookupmsg2(const upb_symtab *s, const char *sym, size_t len)
upb_json_printer * upb_json_printer_create(upb_arena *a, const upb_handlers *h, upb_bytessink output)
const upb_json_parsermethod * upb_json_codecache_get(upb_json_codecache *c, const upb_msgdef *md)
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 is_map_field(const upb_fielddef *field)
const upb_fielddef * map_entry_key(const upb_msgdef *msgdef)
#define DEFINE_ONEOF_HANDLER(type, ctype)
UPB_INLINE size_t upb_sink_putstring(upb_sink s, upb_selector_t sel, const char *buf, size_t n, const upb_bufhandle *handle)
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)
static char encoder[85+1]
upb_value map_iter_value(MapIter *iter, int *len)
bool upb_fielddef_isprimitive(const upb_fielddef *f)
bool map_done(MapIter *iter)
upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f)
const upb_fielddef * map_field_value(const upb_fielddef *field)
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
size_t native_slot_size(upb_fieldtype_t type)
const upb_msgdef * upb_handlers_msgdef(const upb_handlers *h)
static void * empty_php_string(zval **value_ptr)
bool upb_fielddef_isstring(const upb_fielddef *f)
const upb_handlers * get_fill_handlers(Descriptor *desc)
#define ALLOC(class_name)
bool upb_handlers_setstartstr(upb_handlers *h, const upb_fielddef *f, upb_startstr_handlerfunc *func, const upb_handlerattr *attr)
UPB_INLINE bool upb_sink_startstr(upb_sink s, upb_selector_t sel, size_t size_hint, upb_sink *sub)
bool upb_fielddef_isseq(const upb_fielddef *f)
#define UNBOX(class_name, val)
#define DEFINE_APPEND_HANDLER(type, ctype)
static bool appendstr_end_handler(void *closure, const void *hd)
static const void * newhandlerdata(upb_handlers *h, uint32_t ofs)
GLsizei GLsizei GLuint * obj
encodeunknown_handlerfunc handler
UPB_INLINE bool upb_sink_putunknown(upb_sink s, const char *buf, size_t n)
UPB_INLINE bool upb_sink_endseq(upb_sink s, upb_selector_t sel)
static void * startmapentry_handler(void *closure, const void *hd)
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_INLINE bool upb_sink_startmsg(upb_sink s)
InternalDescriptorPool * generated_pool
const upb_msgdef * msgdef
bool upb_byteshandler_setstartstr(upb_byteshandler *h, upb_startstr_handlerfunc *func, void *d)
#define SET_HANDLER(utype, ltype)
#define PHP_PROTO_WRAP_OBJECT_START(name)
static bool add_unknown_handler(void *closure, const void *hd, const char *buf, size_t size)
const upb_oneofdef * upb_fielddef_containingoneof(const upb_fielddef *f)
#define PHP_PROTO_HASH_OF(array)
const upb_fielddef * map_entry_value(const upb_msgdef *msgdef)
void upb_arena_free(upb_arena *a)
#define PHP_PROTO_ZVAL_STRINGL(zval_ptr, s, len, copy)
static void new_php_string(zval **value_ptr, const char *str, size_t len)
@ UPB_WELLKNOWN_UNSPECIFIED
UPB_INLINE void upb_byteshandler_init(upb_byteshandler *handler)
#define PHP_PROTO_RETVAL_STRINGL(s, len, copy)
#define STACK_ENV_STACKBYTES
UPB_INLINE bool upb_sink_startseq(upb_sink s, upb_selector_t sel, upb_sink *sub)
const char * upb_filedef_name(const upb_filedef *f)
char value_storage[NATIVE_SLOT_MAX_SIZE]
php_proto_zval_ptr_dtor(intern->array)
#define UPB_HANDLERATTR_INIT
static void map_slot_value(upb_fieldtype_t type, const void *from, upb_value *v)
static void * startseq_handler(void *closure, const void *hd)
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)
#define OBJ_PROP(OBJECT, OFFSET)
GLenum GLuint GLenum GLsizei const GLchar * buf
const SETUP_TEARDOWN_TESTCONTEXT char * key
static const void * newunknownfieldshandlerdata(upb_handlers *h)
GLint GLint GLsizei GLsizei GLsizei depth
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)
UPB_INLINE bool upb_sink_endstr(upb_sink s, upb_selector_t sel)
static uint8_t decoder[96]
void stringsink_uninit(stringsink *sink)
const upb_json_parsermethod const upb_symtab upb_sink bool ignore_json_unknown
UPB_INLINE bool upb_sink_endsubmsg(upb_sink s, upb_selector_t sel)
static const upb_json_parsermethod * msgdef_jsonparsermethod(Descriptor *desc)
bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *func)
UPB_INLINE void upb_sink_reset(upb_sink *s, const upb_handlers *h, void *c)
upb_fielddef * upb_msg_iter_field(const upb_msg_field_iter *iter)
upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f)
static void putrawsubmsg(MessageHeader *submsg, const upb_fielddef *f, upb_sink sink, int depth, bool is_json TSRMLS_DC)
void map_next(MapIter *iter)
upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m)
const upb_fielddef * map_field_key(const upb_fielddef *field)
bool upb_handlers_setstartsubmsg(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, const upb_handlerattr *attr)
static void map_slot_init(void *memory, upb_fieldtype_t type, zval *cache)
bool is_structurally_valid_utf8(const char *buf, int len)
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_pbdecoder * upb_pbdecoder_create(upb_arena *a, const upb_pbdecodermethod *m, upb_sink sink, upb_status *status)
#define ZVAL_OBJ(zval_ptr, call_create)
void * repeated_field_index_native(RepeatedField *intern, int index TSRMLS_DC)
const upb_msgdef * upb_fielddef_msgsubdef(const upb_fielddef *f)
PHP_METHOD(Message, serializeToString)
PHP_PROTO_WRAP_OBJECT_END MessageLayout * create_layout(const upb_msgdef *msgdef)
void upb_msg_field_next(upb_msg_field_iter *iter)
UPB_INLINE void upb_bytessink_reset(upb_bytessink *s, const upb_byteshandler *h, void *closure)
UPB_INLINE bool upb_sink_startsubmsg(upb_sink s, upb_selector_t sel, upb_sink *sub)
@ UPB_WELLKNOWN_LISTVALUE
void repeated_field_push_native(RepeatedField *intern, void *value)
PHP_PROTO_HASHTABLE_VALUE get_def_obj(const void *def)
#define PHP_PROTO_WRAP_OBJECT_END
void map_begin(zval *map_php, MapIter *iter TSRMLS_DC)
#define NATIVE_SLOT_MAX_SIZE
bool upb_byteshandler_setstring(upb_byteshandler *h, upb_string_handlerfunc *func, void *d)
bool upb_msg_field_done(const upb_msg_field_iter *iter)
static void map_slot_key(upb_fieldtype_t type, const void *from, const char **keyval, size_t *length)
const upb_fielddef * upb_msgdef_itof(const upb_msgdef *m, uint32_t i)
static void map_slot_uninit(void *memory, upb_fieldtype_t type)
const upb_json_parsermethod * m
#define ENCODE_MAX_NESTING
static void putmsg(zval *msg, const Descriptor *desc, upb_sink sink, int depth, bool is_json TSRMLS_DC)
static void stackenv_uninit(stackenv *se)
uint32_t upb_fielddef_number(const upb_fielddef *f)
upb_label_t upb_fielddef_label(const upb_fielddef *f)
void stringsink_init(stringsink *sink)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
const upb_handlers * upb_pbdecodermethod_desthandlers(const upb_pbdecodermethod *m)
upb_sink upb_json_printer_input(upb_json_printer *p)
PHP_PROTO_HASHTABLE_VALUE get_ce_obj(const void *ce)
const char * upb_status_errmsg(const upb_status *status)
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)
GLsizei const GLfloat * value
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)
upb_strtable_uninit & intern
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)
const upb_handlers * upb_handlercache_get(upb_handlercache *c, const upb_msgdef *md)
const upb_msgdef * upb_fielddef_containingtype(const upb_fielddef *f)
const char * php_error_template
static const char * raw_value(void *memory, const upb_fielddef *f)
UPB_INLINE size_t upb_strtable_count(const upb_strtable *t)
const upb_pbdecodermethod * upb_pbcodecache_get(upb_pbcodecache *c, const upb_msgdef *md)
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)
bool upb_ok(const upb_status *status)
const upb_msgdef * parent_md
static upb_selector_t getsel(const upb_fielddef *f, upb_handlertype_t type)
const void * handler_data
static void oneof_cleanup(MessageHeader *msg, const oneof_handlerdata_t *oneofdata)
uint32_t upb_fielddef_index(const upb_fielddef *f)
bool upb_handlers_setendmsg(upb_handlers *h, upb_endmsg_handlerfunc *func, const upb_handlerattr *attr)
static void putstr(zval *str, const upb_fielddef *f, upb_sink sink, bool force_default)
const Descriptor::ReservedRange const EnumValueDescriptor method
GLfloat GLfloat GLfloat GLfloat h
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern array
static void * submsg_handler(void *closure, const void *hd)
static void * oneofsubmsg_handler(void *closure, const void *hd)
bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink sink)
static void * oneofstr_handler(void *closure, const void *hd, size_t size_hint)
UPB_INLINE bool upb_sink_endmsg(upb_sink s, upb_status *status)
bool upb_handlers_setstring(upb_handlers *h, const upb_fielddef *f, upb_string_handlerfunc *func, const upb_handlerattr *attr)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:51