1 #ifndef __GOOGLE_PROTOBUF_PHP_PROTOBUF_H__ 2 #define __GOOGLE_PROTOBUF_PHP_PROTOBUF_H__ 8 #define PHP_PROTOBUF_EXTNAME "protobuf" 9 #define PHP_PROTOBUF_VERSION "0.01" 46 ZEND_DECLARE_MODULE_GLOBALS(
protobuf)
49 #define PROTOBUF_G(v) TSRMG(protobuf_globals_id, zend_protobuf_globals*, v) 51 #define PROTOBUF_G(v) (protobuf_globals.v) 105 #define NATIVE_SLOT_MAX_SIZE sizeof(uint64_t) 109 #define MAP_KEY_FIELD 1 110 #define MAP_VALUE_FIELD 2 115 #define ONEOF_CASE_NONE 0 131 #define MESSAGE_FIELD_NO_CASE ((size_t)-1) 150 const void* memory TSRMLS_DC);
198 zend_class_entry* ce TSRMLS_DC);
208 zval* php_descriptor TSRMLS_DC);
225 #define Z_ARRVAL_SIZE_P(zval_p) zend_hash_num_elements(Z_ARRVAL_P(zval_p)) 226 #define Z_ARRVAL_BEGIN_P(zval_p) Z_ARRVAL_P(zval_p)->pListHead 227 #define Z_BUCKET_NEXT_PP(bucket_pp) *bucket_pp = (*bucket_pp)->pListNext 229 #define DEFINE_PHP_OBJECT(class_name, class_name_lower, name) \ 232 MAKE_STD_ZVAL(name); \ 233 object_init_ex(name, class_name_lower##_type); \ 236 #define DEFINE_PHP_WRAPPER(class_name, class_name_lower, name, intern) \ 238 MAKE_STD_ZVAL(name); \ 239 object_init_ex(name, class_name_lower##_type); \ 241 .handle = zend_objects_store_put( \ 242 intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, \ 243 class_name_lower##_free, NULL TSRMLS_CC); 245 #define DEFINE_PHP_ZVAL(name) \ 248 MAKE_STD_ZVAL(name); \ 251 #define DEFINE_PHP_STRING(name, value) \ 254 MAKE_STD_ZVAL(name); \ 255 ZVAL_STRING(name, value, 1); \ 262 #define CHECK_UPB(code, msg) \ 264 upb_status status = UPB_STATUS_INIT; \ 266 check_upb_status(&status, msg); \ 271 #define ALLOC(class_name) (class_name*) emalloc(sizeof(class_name)) 272 #define ALLOC_N(class_name, n) (class_name*) emalloc(sizeof(class_name) * n) 273 #define FREE(object) efree(object) 276 #define CHECK_TYPE(field, type) \ 277 if (Z_TYPE_P(field) != type) { \ 278 zend_error(E_ERROR, "Unexpected type"); \ 281 #endif // __GOOGLE_PROTOBUF_PHP_PROTOBUF_H__ upb_fieldtype_t
Definition: upb.h:1435
MessageField * fields
Definition: protobuf.h:140
const upb_handlers * pb_serialize_handlers
Definition: protobuf.h:77
DescriptorPool * generated_pool
Definition: protobuf.h:41
short encode(IlbcEncoder *iLBCenc_inst, int16_t *encoded_data, int16_t *data)
Definition: iLBC_testprogram.c:42
const upb_msgdef * msgdef
Definition: protobuf.h:139
MessageLayout * layout
Definition: protobuf.h:73
zval * native_slot_get(upb_fieldtype_t type, const void *memory TSRMLS_DC)
Definition: storage.c:63
const FieldDescriptor * field
Definition: parser_unittest.cc:2279
void free_layout(MessageLayout *layout)
Definition: storage.c:386
zval * pool
Definition: protobuf.h:165
void descriptor_name_set(Descriptor *desc, const char *name)
DescriptorPool * php_to_descriptor_pool(zval *value TSRMLS_DC)
Definition: protobuf.h:90
zend_object_value message_builder_context_create(zend_class_entry *ce TSRMLS_DC)
const upb_fielddef * map_field_key(const upb_fielddef *field)
Definition: storage.c:369
zend_object_value descriptor_create(zend_class_entry *ce TSRMLS_DC)
zend_object_value descriptor_pool_create(zend_class_entry *ce TSRMLS_DC)
zval * descriptor
Definition: protobuf.h:164
zend_class_entry * builder_type
zend_object_handlers * message_handlers
Definition: protobuf.h:42
Definition: protobuf.h:174
const upb_enumdef * enumdef
Definition: protobuf.h:97
Message
Definition: peerconnection_unittest.cc:105
void layout_init(MessageLayout *layout, void *storage)
Definition: storage.c:457
void message_builder_context_init_c_instance(MessageBuilderContext *intern TSRMLS_DC)
zend_class_entry * descriptor_type
upb_symtab * symtab
Definition: protobuf.h:66
zend_object std
Definition: protobuf.h:96
#define desc
Definition: extension_set.h:320
MessageLayout * create_layout(const upb_msgdef *msgdef)
Definition: storage.c:293
void descriptor_free_c(Descriptor *object TSRMLS_DC)
size_t case_offset
Definition: protobuf.h:135
Definition: protobuf.h:85
size_t offset
Definition: protobuf.h:134
void descriptor_pool_init_c_instance(DescriptorPool *pool TSRMLS_DC)
Definition: def.c:112
zend_object std
Definition: protobuf.h:163
EGLAttrib * value
Definition: eglext.h:120
zend_object std
Definition: protobuf.h:65
zend_object std
Definition: protobuf.h:169
Definition: protobuf.h:64
EGLImageKHR EGLint * name
Definition: eglext.h:851
zend_object std
Definition: protobuf.h:86
Definition: __init__.py:1
PHP_MINIT_FUNCTION(protobuf)
Definition: protobuf.c:85
zval * get_def_obj(const void *def)
Definition: protobuf.c:23
const upb_fielddef * map_field_value(const upb_fielddef *field)
Definition: storage.c:374
Definition: protobuf.h:133
const zend_class_entry * build_class_from_descriptor(zval *php_descriptor TSRMLS_DC)
Definition: message.c:240
PHP_FUNCTION(get_generated_pool)
void descriptor_pool_free_c(DescriptorPool *object TSRMLS_DC)
EGLenum type
Definition: eglext.h:63
void descriptor_free(void *object TSRMLS_DC)
void message_builder_context_free_c(MessageBuilderContext *object TSRMLS_DC)
PHP_METHOD(DescriptorPool, addMessage)
Definition: def.c:126
size_t size
Definition: protobuf.h:141
void check_upb_status(const upb_status *status, const char *msg)
Definition: def.c:7
Definition: protobuf.h:138
void add_def_obj(const void *def, zval *value)
Definition: protobuf.c:14
const upb_oneofdef * oneofdef
Definition: protobuf.h:92
Definition: protobuf.h:168
Descriptor * php_to_descriptor(zval *value TSRMLS_DC)
void descriptor_pool_free(void *object TSRMLS_DC)
MessageBuilderContext * php_to_message_builder_context(zval *value TSRMLS_DC)
zend_object std
Definition: protobuf.h:71
void message_builder_context_free(void *object TSRMLS_DC)
HashTable * pending_list
Definition: protobuf.h:67
HashTable upb_def_to_php_obj_map
Definition: protobuf.h:43
const upb_msgdef * msgdef
Definition: protobuf.h:72
bool is_map_field(const upb_fielddef *field)
Definition: storage.c:280
const upb_fielddef * map_entry_key(const upb_msgdef *msgdef)
Definition: storage.c:379
const upb_fielddef * fielddef
Definition: protobuf.h:87
zend_object std
Definition: protobuf.h:91
size_t native_slot_size(upb_fieldtype_t type)
Definition: storage.c:19
const upb_fielddef * map_entry_value(const upb_msgdef *msgdef)
Definition: storage.c:385
zval * layout_get(MessageLayout *layout, const void *storage, const upb_fielddef *field TSRMLS_DC)
Definition: storage.c:515
zend_class_entry * message_builder_context_type
Definition: protobuf.h:70
void descriptor_init_c_instance(Descriptor *intern TSRMLS_DC)
Definition: protobuf.h:95
zend_object std
Definition: protobuf.h:175
Definition: protobuf.h:162