array.c
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #include <ext/spl/spl_iterators.h>
32 #include <Zend/zend_API.h>
33 #include <Zend/zend_interfaces.h>
34 
35 #include "protobuf.h"
36 
37 ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetGet, 0, 0, 1)
38  ZEND_ARG_INFO(0, index)
39 ZEND_END_ARG_INFO()
40 
41 ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetSet, 0, 0, 2)
42  ZEND_ARG_INFO(0, index)
43  ZEND_ARG_INFO(0, newval)
44 ZEND_END_ARG_INFO()
45 
46 ZEND_BEGIN_ARG_INFO(arginfo_void, 0)
47 ZEND_END_ARG_INFO()
48 
49 static zend_function_entry repeated_field_methods[] = {
50  PHP_ME(RepeatedField, __construct, NULL, ZEND_ACC_PUBLIC)
51  PHP_ME(RepeatedField, append, NULL, ZEND_ACC_PUBLIC)
52  PHP_ME(RepeatedField, offsetExists, arginfo_offsetGet, ZEND_ACC_PUBLIC)
53  PHP_ME(RepeatedField, offsetGet, arginfo_offsetGet, ZEND_ACC_PUBLIC)
54  PHP_ME(RepeatedField, offsetSet, arginfo_offsetSet, ZEND_ACC_PUBLIC)
55  PHP_ME(RepeatedField, offsetUnset, arginfo_offsetGet, ZEND_ACC_PUBLIC)
56  PHP_ME(RepeatedField, count, arginfo_void, ZEND_ACC_PUBLIC)
57  PHP_ME(RepeatedField, getIterator, arginfo_void, ZEND_ACC_PUBLIC)
58  ZEND_FE_END
59 };
60 
61 static zend_function_entry repeated_field_iter_methods[] = {
62  PHP_ME(RepeatedFieldIter, rewind, arginfo_void, ZEND_ACC_PUBLIC)
63  PHP_ME(RepeatedFieldIter, current, arginfo_void, ZEND_ACC_PUBLIC)
64  PHP_ME(RepeatedFieldIter, key, arginfo_void, ZEND_ACC_PUBLIC)
65  PHP_ME(RepeatedFieldIter, next, arginfo_void, ZEND_ACC_PUBLIC)
66  PHP_ME(RepeatedFieldIter, valid, arginfo_void, ZEND_ACC_PUBLIC)
67  ZEND_FE_END
68 };
69 
70 // Forward declare static functions.
71 
73  uint size ZEND_FILE_LINE_DC);
74 static void repeated_field_write_dimension(zval *object, zval *offset,
75  zval *value TSRMLS_DC);
76 static int repeated_field_has_dimension(zval *object, zval *offset TSRMLS_DC);
77 static HashTable *repeated_field_get_gc(zval *object, CACHED_VALUE **table,
78  int *n TSRMLS_DC);
79 #if PHP_MAJOR_VERSION < 7
80 static zend_object_value repeated_field_create(zend_class_entry *ce TSRMLS_DC);
81 static zend_object_value repeated_field_iter_create(zend_class_entry *ce TSRMLS_DC);
82 #else
83 static zend_object *repeated_field_create(zend_class_entry *ce TSRMLS_DC);
84 static zend_object *repeated_field_iter_create(zend_class_entry *ce TSRMLS_DC);
85 #endif
86 
87 // -----------------------------------------------------------------------------
88 // RepeatedField creation/desctruction
89 // -----------------------------------------------------------------------------
90 
91 zend_class_entry* repeated_field_type;
92 zend_class_entry* repeated_field_iter_type;
93 zend_object_handlers* repeated_field_handlers;
94 zend_object_handlers* repeated_field_iter_handlers;
95 
96 // Define object free method.
98 #if PHP_MAJOR_VERSION < 7
100 #else
102 #endif
104 
107 
108 // Define object create method.
110 #if PHP_MAJOR_VERSION < 7
111 intern->array = NULL;
112 #endif
113 intern->type = 0;
114 intern->msg_ce = NULL;
116 
117 // Init class entry.
118 PHP_PROTO_INIT_CLASS_START("Google\\Protobuf\\Internal\\RepeatedField",
120 zend_class_implements(repeated_field_type TSRMLS_CC, 3, spl_ce_ArrayAccess,
121  zend_ce_aggregate, spl_ce_Countable);
125 
126 // Define array element free function.
127 #if PHP_MAJOR_VERSION < 7
128 static inline void php_proto_array_string_release(void *value) {
129  zval_ptr_dtor(value);
130 }
131 
132 static inline void php_proto_array_object_release(void *value) {
133  zval_ptr_dtor(value);
134 }
135 static inline void php_proto_array_default_release(void *value) {
136 }
137 #else
138 static inline void php_proto_array_string_release(zval *value) {
139  void* ptr = Z_PTR_P(value);
140  zend_string* object = *(zend_string**)ptr;
141  zend_string_release(object);
142  efree(ptr);
143 }
144 static inline void php_proto_array_object_release(zval *value) {
145  zval_ptr_dtor(value);
146 }
147 static void php_proto_array_default_release(zval* value) {
148  void* ptr = Z_PTR_P(value);
149  efree(ptr);
150 }
151 #endif
152 
154  uint size ZEND_FILE_LINE_DC) {
156 
157  switch (type) {
158  case UPB_TYPE_STRING:
159  case UPB_TYPE_BYTES:
160  zend_hash_init(Z_ARRVAL_P(array), size, NULL,
161  php_proto_array_string_release, 0);
162  break;
163  case UPB_TYPE_MESSAGE:
164  zend_hash_init(Z_ARRVAL_P(array), size, NULL,
166  break;
167  default:
168  zend_hash_init(Z_ARRVAL_P(array), size, NULL,
170  }
171  return SUCCESS;
172 }
173 
174 // -----------------------------------------------------------------------------
175 // RepeatedField Handlers
176 // -----------------------------------------------------------------------------
177 
178 static void repeated_field_write_dimension(zval *object, zval *offset,
179  zval *value TSRMLS_DC) {
180  uint64_t index;
181 
183  HashTable *ht = PHP_PROTO_HASH_OF(intern->array);
184  int size = native_slot_size(intern->type);
185 
186  unsigned char memory[NATIVE_SLOT_MAX_SIZE];
187  memset(memory, 0, NATIVE_SLOT_MAX_SIZE);
188 
189  if (!native_slot_set_by_array(intern->type, intern->msg_ce, memory,
190  value TSRMLS_CC)) {
191  return;
192  }
193 
194  if (!offset || Z_TYPE_P(offset) == IS_NULL) {
195  index = zend_hash_num_elements(PHP_PROTO_HASH_OF(intern->array));
196  } else {
198  if (!zend_hash_index_exists(ht, index)) {
199  zend_error(E_USER_ERROR, "Element at %llu doesn't exist.\n",
200  (long long unsigned int)index);
201  return;
202  }
203  } else {
204  return;
205  }
206  }
207 
208  if (intern->type == UPB_TYPE_MESSAGE) {
209  php_proto_zend_hash_index_update_zval(ht, index, *(zval**)memory);
210  } else {
212  }
213 }
214 
215 #if PHP_MAJOR_VERSION < 7
216 static HashTable *repeated_field_get_gc(zval *object, zval ***table,
217  int *n TSRMLS_DC) {
218 #else
219 static HashTable *repeated_field_get_gc(zval *object, zval **table, int *n) {
220 #endif
221  *table = NULL;
222  *n = 0;
224  return PHP_PROTO_HASH_OF(intern->array);
225 }
226 
227 // -----------------------------------------------------------------------------
228 // C RepeatedField Utilities
229 // -----------------------------------------------------------------------------
230 
232  HashTable *ht = PHP_PROTO_HASH_OF(intern->array);
233  void *value;
234 
235  if (intern->type == UPB_TYPE_MESSAGE) {
236  if (php_proto_zend_hash_index_find_zval(ht, index, (void **)&value) ==
237  FAILURE) {
238  zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index);
239  return NULL;
240  }
241  } else {
242  if (php_proto_zend_hash_index_find_mem(ht, index, (void **)&value) ==
243  FAILURE) {
244  zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index);
245  return NULL;
246  }
247  }
248 
249  return value;
250 }
251 
253  HashTable *ht = PHP_PROTO_HASH_OF(intern->array);
254  int size = native_slot_size(intern->type);
255  if (intern->type == UPB_TYPE_MESSAGE) {
257  } else {
259  }
260 }
261 
263  zend_class_entry *ce, const upb_fielddef *field,
266  const zend_class_entry *msg_ce = field_type_class(field PHP_PROTO_TSRMLS_CC);
269 }
270 
272  zend_class_entry *ce, upb_fieldtype_t type, const zend_class_entry *msg_ce,
276 
279  intern->type = type;
280  intern->msg_ce = msg_ce;
281 #if PHP_MAJOR_VERSION < 7
282  MAKE_STD_ZVAL(intern->array);
283  repeated_field_array_init(intern->array, intern->type, 0 ZEND_FILE_LINE_CC);
284 #else
285  repeated_field_array_init(&intern->array, intern->type, 0 ZEND_FILE_LINE_CC);
286 #endif
287 
288  // TODO(teboring): Link class entry for message and enum
289 }
290 
291 
292 // -----------------------------------------------------------------------------
293 // PHP RepeatedField Methods
294 // -----------------------------------------------------------------------------
295 
301 PHP_METHOD(RepeatedField, __construct) {
302  long type;
303  zend_class_entry* klass = NULL;
304 
305  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|C", &type, &klass) ==
306  FAILURE) {
307  return;
308  }
309 
310  RepeatedField *intern = UNBOX(RepeatedField, getThis());
311  intern->type = to_fieldtype(type);
312  intern->msg_ce = klass;
313 
314 #if PHP_MAJOR_VERSION < 7
315  MAKE_STD_ZVAL(intern->array);
316  repeated_field_array_init(intern->array, intern->type, 0 ZEND_FILE_LINE_CC);
317 #else
318  repeated_field_array_init(&intern->array, intern->type, 0 ZEND_FILE_LINE_CC);
319 #endif
320 
321  if (intern->type == UPB_TYPE_MESSAGE && klass == NULL) {
322  zend_error(E_USER_ERROR, "Message type must have concrete class.");
323  return;
324  }
325 
326  // TODO(teboring): Consider enum.
327 }
328 
334  zval *value;
335 
336  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) ==
337  FAILURE) {
338  return;
339  }
340  repeated_field_write_dimension(getThis(), NULL, value TSRMLS_CC);
341 }
342 
348 PHP_METHOD(RepeatedField, offsetExists) {
349  long index;
350 
351  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) ==
352  FAILURE) {
353  return;
354  }
355 
356  RepeatedField *intern = UNBOX(RepeatedField, getThis());
357 
358  RETURN_BOOL(index >= 0 &&
359  index < zend_hash_num_elements(PHP_PROTO_HASH_OF(intern->array)));
360 }
361 
371  long index;
372  void *memory;
373 
374  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) ==
375  FAILURE) {
376  return;
377  }
378 
379  RepeatedField *intern = UNBOX(RepeatedField, getThis());
380  HashTable *table = PHP_PROTO_HASH_OF(intern->array);
381 
382  if (intern->type == UPB_TYPE_MESSAGE) {
383  if (php_proto_zend_hash_index_find_zval(table, index, (void **)&memory) ==
384  FAILURE) {
385  zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index);
386  return;
387  }
388  } else {
389  if (php_proto_zend_hash_index_find_mem(table, index, (void **)&memory) ==
390  FAILURE) {
391  zend_error(E_USER_ERROR, "Element at %ld doesn't exist.\n", index);
392  return;
393  }
394  }
395  native_slot_get_by_array(intern->type, memory,
396  ZVAL_PTR_TO_CACHED_PTR(return_value) TSRMLS_CC);
397 }
398 
409  zval *index, *value;
410  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &index, &value) ==
411  FAILURE) {
412  return;
413  }
414  repeated_field_write_dimension(getThis(), index, value TSRMLS_CC);
415 }
416 
424 PHP_METHOD(RepeatedField, offsetUnset) {
425  long index;
426  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) ==
427  FAILURE) {
428  return;
429  }
430 
431  RepeatedField *intern = UNBOX(RepeatedField, getThis());
432 
433  // Only the element at the end of the array can be removed.
434  if (index == -1 ||
435  index != (zend_hash_num_elements(PHP_PROTO_HASH_OF(intern->array)) - 1)) {
436  zend_error(E_USER_ERROR, "Cannot remove element at %ld.\n", index);
437  return;
438  }
439 
440  zend_hash_index_del(PHP_PROTO_HASH_OF(intern->array), index);
441 }
442 
449  RepeatedField *intern = UNBOX(RepeatedField, getThis());
450 
451  if (zend_parse_parameters_none() == FAILURE) {
452  return;
453  }
454 
455  RETURN_LONG(zend_hash_num_elements(PHP_PROTO_HASH_OF(intern->array)));
456 }
457 
463 PHP_METHOD(RepeatedField, getIterator) {
466 
467  RepeatedField *intern = UNBOX(RepeatedField, getThis());
468  RepeatedFieldIter *iter = UNBOX(RepeatedFieldIter, return_value);
469  iter->repeated_field = intern;
470  iter->position = 0;
471 }
472 
473 // -----------------------------------------------------------------------------
474 // RepeatedFieldIter creation/desctruction
475 // -----------------------------------------------------------------------------
476 
477 // Define object free method.
480 
483 
484 // Define object create method.
489 
490 // Init class entry.
491 PHP_PROTO_INIT_CLASS_START("Google\\Protobuf\\Internal\\RepeatedFieldIter",
492  RepeatedFieldIter, repeated_field_iter)
493 zend_class_implements(repeated_field_iter_type TSRMLS_CC, 1, zend_ce_iterator);
495 
496 // -----------------------------------------------------------------------------
497 // PHP RepeatedFieldIter Methods
498 // -----------------------------------------------------------------------------
499 
500 PHP_METHOD(RepeatedFieldIter, rewind) {
502  intern->position = 0;
503 }
504 
507  RepeatedField *repeated_field = intern->repeated_field;
508 
509  long index;
510  void *memory;
511 
512  HashTable *table = PHP_PROTO_HASH_OF(repeated_field->array);
513 
514  if (repeated_field->type == UPB_TYPE_MESSAGE) {
516  (void **)&memory) == FAILURE) {
517  zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index);
518  return;
519  }
520  } else {
522  (void **)&memory) == FAILURE) {
523  zend_error(E_USER_ERROR, "Element at %d doesn't exist.\n", index);
524  return;
525  }
526  }
528  ZVAL_PTR_TO_CACHED_PTR(return_value) TSRMLS_CC);
529 }
530 
533  RETURN_LONG(intern->position);
534 }
535 
538  ++intern->position;
539 }
540 
543  RETURN_BOOL(zend_hash_num_elements(PHP_PROTO_HASH_OF(
544  intern->repeated_field->array)) > intern->position);
545 }
table
upb_strtable table
Definition: php/ext/google/protobuf/protobuf.h:1065
to_fieldtype
upb_fieldtype_t to_fieldtype(upb_descriptortype_t type)
Definition: def.c:375
PHP_PROTO_TSRMLS_DC
#define PHP_PROTO_TSRMLS_DC
Definition: php/ext/google/protobuf/protobuf.h:64
PHP_PROTO_TSRMLS_CC
#define PHP_PROTO_TSRMLS_CC
Definition: php/ext/google/protobuf/protobuf.h:65
CACHED_PTR_TO_ZVAL_PTR
#define CACHED_PTR_TO_ZVAL_PTR(VALUE)
Definition: php/ext/google/protobuf/protobuf.h:194
type
intern type
Definition: array.c:113
NULL
NULL
Definition: test_security_zap.cpp:405
repeated_field_methods
static zend_function_entry repeated_field_methods[]
Definition: array.c:49
PHP_PROTO_INIT_CLASS_END
#define PHP_PROTO_INIT_CLASS_END
Definition: php/ext/google/protobuf/protobuf.h:168
php_proto_array_object_release
static void php_proto_array_object_release(void *value)
Definition: array.c:132
PHP_PROTO_ALLOC_ARRAY
#define PHP_PROTO_ALLOC_ARRAY(zval_ptr)
Definition: php/ext/google/protobuf/protobuf.h:225
protobuf_convert_to_uint64
bool protobuf_convert_to_uint64(zval *from, uint64_t *to)
repeated_field_create_with_field
void repeated_field_create_with_field(zend_class_entry *ce, const upb_fielddef *field, CACHED_VALUE *repeated_field PHP_PROTO_TSRMLS_DC)
Definition: array.c:262
CACHED_VALUE
#define CACHED_VALUE
Definition: php/ext/google/protobuf/protobuf.h:192
PHP_PROTO_OBJECT_DTOR_START
#define PHP_PROTO_OBJECT_DTOR_START(classname, lowername)
Definition: php/ext/google/protobuf/protobuf.h:189
php_proto_zend_hash_next_index_insert_zval
#define php_proto_zend_hash_next_index_insert_zval(ht, pData)
Definition: php/ext/google/protobuf/protobuf.h:117
php_proto_zend_hash_index_find_mem
#define php_proto_zend_hash_index_find_mem(ht, h, pDest)
Definition: php/ext/google/protobuf/protobuf.h:108
native_slot_size
size_t native_slot_size(upb_fieldtype_t type)
Definition: php/ext/google/protobuf/storage.c:43
php_proto_zend_hash_index_update_mem
#define php_proto_zend_hash_index_update_mem(ht, h, pData, nDataSize, pDest)
Definition: php/ext/google/protobuf/protobuf.h:95
php_proto_zend_hash_index_update_zval
#define php_proto_zend_hash_index_update_zval(ht, h, pData)
Definition: php/ext/google/protobuf/protobuf.h:86
UNBOX
#define UNBOX(class_name, val)
Definition: php/ext/google/protobuf/protobuf.h:233
repeated_field_get_gc
static HashTable * repeated_field_get_gc(zval *object, CACHED_VALUE **table, int *n TSRMLS_DC)
repeated_field_iter_handlers
zend_object_handlers * repeated_field_iter_handlers
Definition: array.c:94
repeated_field
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern repeated_field
Definition: array.c:486
PHP_PROTO_OBJECT_DTOR_END
#define PHP_PROTO_OBJECT_DTOR_END
Definition: php/ext/google/protobuf/protobuf.h:190
offset
GLintptr offset
Definition: glcorearb.h:2944
field_type_class
const zend_class_entry * field_type_class(const upb_fielddef *field PHP_PROTO_TSRMLS_DC)
Definition: php/ext/google/protobuf/storage.c:552
PHP_PROTO_HASH_OF
#define PHP_PROTO_HASH_OF(array)
Definition: php/ext/google/protobuf/protobuf.h:84
UPB_TYPE_STRING
@ UPB_TYPE_STRING
Definition: php/ext/google/protobuf/upb.h:419
php_proto_zval_ptr_dtor
php_proto_zval_ptr_dtor(intern->array)
upb_fielddef
Definition: php/ext/google/protobuf/upb.c:1118
repeated_field_has_dimension
static int repeated_field_has_dimension(zval *object, zval *offset TSRMLS_DC)
CACHED_TO_ZVAL_PTR
#define CACHED_TO_ZVAL_PTR(VALUE)
Definition: php/ext/google/protobuf/protobuf.h:193
PHP_PROTO_OBJECT_CREATE_START
#define PHP_PROTO_OBJECT_CREATE_START(NAME, LOWWERNAME)
Definition: php/ext/google/protobuf/protobuf.h:171
position
intern position
Definition: array.c:487
UPB_TYPE_MESSAGE
@ UPB_TYPE_MESSAGE
Definition: php/ext/google/protobuf/upb.h:421
field
const FieldDescriptor * field
Definition: parser_unittest.cc:2694
google::protobuf::uint
unsigned int uint
Definition: protobuf/src/google/protobuf/stubs/port.h:135
key
const SETUP_TEARDOWN_TESTCONTEXT char * key
Definition: test_wss_transport.cpp:10
PHP_PROTO_OBJECT_FREE_END
#define PHP_PROTO_OBJECT_FREE_END
Definition: php/ext/google/protobuf/protobuf.h:184
n
GLdouble n
Definition: glcorearb.h:4153
repeated_field_type
zend_class_entry * repeated_field_type
Definition: array.c:91
protobuf.h
repeated_field_create
static zend_object_value repeated_field_create(zend_class_entry *ce TSRMLS_DC)
upb_fielddef_type
upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f)
Definition: php/ext/google/protobuf/upb.c:1505
type
GLenum type
Definition: glcorearb.h:2695
repeated_field_iter_methods
static zend_function_entry repeated_field_iter_methods[]
Definition: array.c:61
msg_ce
intern msg_ce
Definition: array.c:114
repeated_field_iter_create
static zend_object_value repeated_field_iter_create(zend_class_entry *ce TSRMLS_DC)
repeated_field_index_native
void * repeated_field_index_native(RepeatedField *intern, int index TSRMLS_DC)
Definition: array.c:231
PHP_METHOD
PHP_METHOD(RepeatedField, __construct)
Definition: array.c:301
repeated_field_push_native
void repeated_field_push_native(RepeatedField *intern, void *value)
Definition: array.c:252
append
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
NATIVE_SLOT_MAX_SIZE
#define NATIVE_SLOT_MAX_SIZE
Definition: php/ext/google/protobuf/protobuf.h:1021
size
GLsizeiptr size
Definition: glcorearb.h:2943
native_slot_set_by_array
bool native_slot_set_by_array(upb_fieldtype_t type, const zend_class_entry *klass, void *memory, zval *value TSRMLS_DC)
Definition: php/ext/google/protobuf/storage.c:161
PHP_PROTO_OBJECT_CREATE_END
#define PHP_PROTO_OBJECT_CREATE_END(NAME, LOWWERNAME)
Definition: php/ext/google/protobuf/protobuf.h:177
CREATE_OBJ_ON_ALLOCATED_ZVAL_PTR
#define CREATE_OBJ_ON_ALLOCATED_ZVAL_PTR(zval_ptr, class_type)
Definition: php/ext/google/protobuf/protobuf.h:199
UPB_TYPE_BYTES
@ UPB_TYPE_BYTES
Definition: php/ext/google/protobuf/upb.h:420
RepeatedFieldIter
struct RepeatedFieldIter RepeatedFieldIter
Definition: php/ext/google/protobuf/protobuf.h:657
repeated_field_create_with_type
void repeated_field_create_with_type(zend_class_entry *ce, upb_fieldtype_t type, const zend_class_entry *msg_ce, CACHED_VALUE *repeated_field PHP_PROTO_TSRMLS_DC)
Definition: array.c:271
native_slot_get_by_array
void native_slot_get_by_array(upb_fieldtype_t type, const void *memory, CACHED_VALUE *cache TSRMLS_DC)
Definition: php/ext/google/protobuf/storage.c:388
php_proto_array_default_release
static void php_proto_array_default_release(void *value)
Definition: array.c:135
next
static size_t next(const upb_table *t, size_t i)
Definition: php/ext/google/protobuf/upb.c:4889
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
intern
upb_strtable_uninit & intern
Definition: php/ext/google/protobuf/map.c:222
php_proto_zend_hash_index_find_zval
#define php_proto_zend_hash_index_find_zval(ht, h, pDest)
Definition: php/ext/google/protobuf/protobuf.h:102
ZVAL_PTR_TO_CACHED_PTR
#define ZVAL_PTR_TO_CACHED_PTR(VALUE)
Definition: php/ext/google/protobuf/protobuf.h:195
count
GLint GLsizei count
Definition: glcorearb.h:2830
repeated_field_iter_type
zend_class_entry * repeated_field_iter_type
Definition: array.c:92
index
GLuint index
Definition: glcorearb.h:3055
PHP_PROTO_INIT_CLASS_START
PHP_PROTO_INIT_CLASS_START("Google\\Protobuf\\Internal\\RepeatedField", RepeatedField, repeated_field)
Definition: array.c:118
klass
zend_class_entry * klass
Definition: php/ext/google/protobuf/protobuf.h:801
repeated_field_handlers
zend_object_handlers * repeated_field_handlers
Definition: array.c:93
repeated_field_write_dimension
static void repeated_field_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
Definition: array.c:178
upb_fieldtype_t
upb_fieldtype_t
Definition: php/ext/google/protobuf/upb.h:410
PHP_PROTO_OBJECT_FREE_START
#define PHP_PROTO_OBJECT_FREE_START(classname, lowername)
Definition: php/ext/google/protobuf/protobuf.h:181
array
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern array
Definition: array.c:111
repeated_field_array_init
static int repeated_field_array_init(zval *array, upb_fieldtype_t type, uint size ZEND_FILE_LINE_DC)
Definition: array.c:153
php_proto_zend_hash_next_index_insert_mem
#define php_proto_zend_hash_next_index_insert_mem(ht, pData, nDataSize, pDest)
Definition: php/ext/google/protobuf/protobuf.h:120
RepeatedField
Definition: ruby/ext/google/protobuf_c/protobuf.h:395


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:48