Macros | Functions
php/ext/google/protobuf/storage.c File Reference
#include <stdint.h>
#include <protobuf.h>
#include <Zend/zend.h>
#include "utf8.h"
Include dependency graph for php/ext/google/protobuf/storage.c:

Go to the source code of this file.

Macros

#define CASE(upb_type)
 
#define CASE(upb_type, c_type)
 
#define CASE(upb_type, php_type)
 
#define CASE(upb_type, php_type, c_type)
 
#define CASE_TYPE(upb_type, c_type)
 
#define CASE_TYPE(upb_type, c_type)
 
#define CASE_TYPE(upb_type, type, c_type, php_type)
 
#define DEREF(memory, type)   *(type*)(memory)
 

Functions

static size_t align_up_to (size_t offset, size_t granularity)
 
MessageLayoutcreate_layout (const upb_msgdef *msgdef)
 
const zend_class_entry * field_type_class (const upb_fielddef *field PHP_PROTO_TSRMLS_DC)
 
void free_layout (MessageLayout *layout)
 
bool is_map_field (const upb_fielddef *field)
 
zval * layout_get (MessageLayout *layout, const void *storage, const upb_fielddef *field, CACHED_VALUE *cache TSRMLS_DC)
 
const char * layout_get_oneof_case (MessageLayout *layout, const void *storage, const upb_oneofdef *oneof TSRMLS_DC)
 
void layout_init (MessageLayout *layout, void *storage, zend_object *object PHP_PROTO_TSRMLS_DC)
 
void layout_merge (MessageLayout *layout, MessageHeader *from, MessageHeader *to PHP_PROTO_TSRMLS_DC)
 
void layout_set (MessageLayout *layout, MessageHeader *header, const upb_fielddef *field, zval *val TSRMLS_DC)
 
const upb_fielddefmap_entry_key (const upb_msgdef *msgdef)
 
const upb_msgdefmap_entry_msgdef (const upb_fielddef *field)
 
const upb_fielddefmap_entry_value (const upb_msgdef *msgdef)
 
const upb_fielddefmap_field_key (const upb_fielddef *field)
 
const upb_fielddefmap_field_value (const upb_fielddef *field)
 
void native_slot_get (upb_fieldtype_t type, const void *memory, CACHED_VALUE *cache TSRMLS_DC)
 
void native_slot_get_by_array (upb_fieldtype_t type, const void *memory, CACHED_VALUE *cache TSRMLS_DC)
 
void native_slot_get_by_map_key (upb_fieldtype_t type, const void *memory, int length, CACHED_VALUE *cache TSRMLS_DC)
 
void native_slot_get_by_map_value (upb_fieldtype_t type, const void *memory, CACHED_VALUE *cache TSRMLS_DC)
 
void native_slot_get_default (upb_fieldtype_t type, CACHED_VALUE *cache TSRMLS_DC)
 
void native_slot_init (upb_fieldtype_t type, void *memory, CACHED_VALUE *cache)
 
static bool native_slot_is_default (upb_fieldtype_t type, const void *memory)
 
static void native_slot_merge (const upb_fielddef *field, const void *from_memory, void *to_memory PHP_PROTO_TSRMLS_DC)
 
static void native_slot_merge_by_array (const upb_fielddef *field, const void *from_memory, void *to_memory PHP_PROTO_TSRMLS_DC)
 
bool native_slot_set (upb_fieldtype_t type, const zend_class_entry *klass, void *memory, zval *value PHP_PROTO_TSRMLS_DC)
 
bool native_slot_set_by_array (upb_fieldtype_t type, const zend_class_entry *klass, void *memory, zval *value TSRMLS_DC)
 
bool native_slot_set_by_map (upb_fieldtype_t type, const zend_class_entry *klass, void *memory, zval *value TSRMLS_DC)
 
size_t native_slot_size (upb_fieldtype_t type)
 
void * slot_memory (MessageLayout *layout, const void *storage, const upb_fielddef *field)
 
uint32_tslot_oneof_case (MessageLayout *layout, const void *storage, const upb_fielddef *field)
 
static int slot_property_cache (MessageLayout *layout, const void *storage, const upb_fielddef *field)
 
const upb_msgdeftryget_map_entry_msgdef (const upb_fielddef *field)
 
static void * value_memory (const upb_fielddef *field, void *memory)
 

Macro Definition Documentation

◆ CASE [1/4]

#define CASE (   upb_type)
Value:
case UPB_TYPE_##upb_type: { \
PHP_PROTO_SEPARATE_ZVAL_IF_NOT_REF(cache); \
ZVAL_LONG(CACHED_PTR_TO_ZVAL_PTR(cache), 0); \
return; \
}

◆ CASE [2/4]

#define CASE (   upb_type,
  c_type 
)
Value:
case UPB_TYPE_##upb_type: { \
PHP_PROTO_SEPARATE_ZVAL_IF_NOT_REF(cache); \
ZVAL_LONG(CACHED_PTR_TO_ZVAL_PTR(cache), DEREF(memory, c_type)); \
return; \
}

◆ CASE [3/4]

#define CASE (   upb_type,
  php_type 
)
Value:
case UPB_TYPE_##upb_type: \
PHP_PROTO_SEPARATE_ZVAL_IF_NOT_REF(cache); \
ZVAL_##php_type(CACHED_PTR_TO_ZVAL_PTR(cache), 0); \
return;

◆ CASE [4/4]

#define CASE (   upb_type,
  php_type,
  c_type 
)
Value:
case UPB_TYPE_##upb_type: \
PHP_PROTO_SEPARATE_ZVAL_IF_NOT_REF(cache); \
ZVAL_##php_type(CACHED_PTR_TO_ZVAL_PTR(cache), DEREF(memory, c_type)); \
return;

◆ CASE_TYPE [1/3]

#define CASE_TYPE (   upb_type,
  c_type 
)
Value:
case UPB_TYPE_##upb_type: { \
return DEREF(memory, c_type) == 0; \
}

◆ CASE_TYPE [2/3]

#define CASE_TYPE (   upb_type,
  c_type 
)
Value:
case UPB_TYPE_##upb_type: { \
DEREF(to_memory, c_type) = DEREF(from_memory, c_type); \
break; \
}

◆ CASE_TYPE [3/3]

#define CASE_TYPE (   upb_type,
  type,
  c_type,
  php_type 
)
Value:
case UPB_TYPE_##upb_type: { \
c_type type##_value; \
if (protobuf_convert_to_##type(value, &type##_value)) { \
DEREF(memory, c_type) = type##_value; \
} \
break; \
}

◆ DEREF

#define DEREF (   memory,
  type 
)    *(type*)(memory)

Definition at line 41 of file php/ext/google/protobuf/storage.c.

Function Documentation

◆ align_up_to()

static size_t align_up_to ( size_t  offset,
size_t  granularity 
)
static

Definition at line 570 of file php/ext/google/protobuf/storage.c.

◆ create_layout()

MessageLayout* create_layout ( const upb_msgdef msgdef)

Definition at line 591 of file php/ext/google/protobuf/storage.c.

◆ field_type_class()

const zend_class_entry* field_type_class ( const upb_fielddef *field  PHP_PROTO_TSRMLS_DC)

Definition at line 552 of file php/ext/google/protobuf/storage.c.

◆ free_layout()

void free_layout ( MessageLayout layout)

Definition at line 750 of file php/ext/google/protobuf/storage.c.

◆ is_map_field()

bool is_map_field ( const upb_fielddef field)

Definition at line 526 of file php/ext/google/protobuf/storage.c.

◆ layout_get()

zval* layout_get ( MessageLayout layout,
const void *  storage,
const upb_fielddef field,
CACHED_VALUE *cache  TSRMLS_DC 
)

Definition at line 812 of file php/ext/google/protobuf/storage.c.

◆ layout_get_oneof_case()

const char* layout_get_oneof_case ( MessageLayout layout,
const void *  storage,
const upb_oneofdef *oneof  TSRMLS_DC 
)

Definition at line 1137 of file php/ext/google/protobuf/storage.c.

◆ layout_init()

void layout_init ( MessageLayout layout,
void *  storage,
zend_object *object  PHP_PROTO_TSRMLS_DC 
)

Definition at line 755 of file php/ext/google/protobuf/storage.c.

◆ layout_merge()

void layout_merge ( MessageLayout layout,
MessageHeader from,
MessageHeader *to  PHP_PROTO_TSRMLS_DC 
)

Definition at line 1022 of file php/ext/google/protobuf/storage.c.

◆ layout_set()

void layout_set ( MessageLayout layout,
MessageHeader header,
const upb_fielddef field,
zval *val  TSRMLS_DC 
)

Definition at line 834 of file php/ext/google/protobuf/storage.c.

◆ map_entry_key()

const upb_fielddef* map_entry_key ( const upb_msgdef msgdef)

Definition at line 540 of file php/ext/google/protobuf/storage.c.

◆ map_entry_msgdef()

const upb_msgdef* map_entry_msgdef ( const upb_fielddef field)

Definition at line 520 of file php/ext/google/protobuf/storage.c.

◆ map_entry_value()

const upb_fielddef* map_entry_value ( const upb_msgdef msgdef)

Definition at line 546 of file php/ext/google/protobuf/storage.c.

◆ map_field_key()

const upb_fielddef* map_field_key ( const upb_fielddef field)

Definition at line 530 of file php/ext/google/protobuf/storage.c.

◆ map_field_value()

const upb_fielddef* map_field_value ( const upb_fielddef field)

Definition at line 535 of file php/ext/google/protobuf/storage.c.

◆ native_slot_get()

void native_slot_get ( upb_fieldtype_t  type,
const void *  memory,
CACHED_VALUE *cache  TSRMLS_DC 
)

Definition at line 311 of file php/ext/google/protobuf/storage.c.

◆ native_slot_get_by_array()

void native_slot_get_by_array ( upb_fieldtype_t  type,
const void *  memory,
CACHED_VALUE *cache  TSRMLS_DC 
)

Definition at line 388 of file php/ext/google/protobuf/storage.c.

◆ native_slot_get_by_map_key()

void native_slot_get_by_map_key ( upb_fieldtype_t  type,
const void *  memory,
int  length,
CACHED_VALUE *cache  TSRMLS_DC 
)

Definition at line 420 of file php/ext/google/protobuf/storage.c.

◆ native_slot_get_by_map_value()

void native_slot_get_by_map_value ( upb_fieldtype_t  type,
const void *  memory,
CACHED_VALUE *cache  TSRMLS_DC 
)

Definition at line 433 of file php/ext/google/protobuf/storage.c.

◆ native_slot_get_default()

void native_slot_get_default ( upb_fieldtype_t  type,
CACHED_VALUE *cache  TSRMLS_DC 
)

Definition at line 453 of file php/ext/google/protobuf/storage.c.

◆ native_slot_init()

void native_slot_init ( upb_fieldtype_t  type,
void *  memory,
CACHED_VALUE cache 
)

Definition at line 276 of file php/ext/google/protobuf/storage.c.

◆ native_slot_is_default()

static bool native_slot_is_default ( upb_fieldtype_t  type,
const void *  memory 
)
static

Definition at line 60 of file php/ext/google/protobuf/storage.c.

◆ native_slot_merge()

static void native_slot_merge ( const upb_fielddef field,
const void *  from_memory,
void *to_memory  PHP_PROTO_TSRMLS_DC 
)
static

Definition at line 923 of file php/ext/google/protobuf/storage.c.

◆ native_slot_merge_by_array()

static void native_slot_merge_by_array ( const upb_fielddef field,
const void *  from_memory,
void *to_memory  PHP_PROTO_TSRMLS_DC 
)
static

Definition at line 980 of file php/ext/google/protobuf/storage.c.

◆ native_slot_set()

bool native_slot_set ( upb_fieldtype_t  type,
const zend_class_entry *  klass,
void *  memory,
zval *value  PHP_PROTO_TSRMLS_DC 
)

Definition at line 87 of file php/ext/google/protobuf/storage.c.

◆ 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 at line 161 of file php/ext/google/protobuf/storage.c.

◆ native_slot_set_by_map()

bool native_slot_set_by_map ( upb_fieldtype_t  type,
const zend_class_entry *  klass,
void *  memory,
zval *value  TSRMLS_DC 
)

Definition at line 219 of file php/ext/google/protobuf/storage.c.

◆ native_slot_size()

size_t native_slot_size ( upb_fieldtype_t  type)

Definition at line 43 of file php/ext/google/protobuf/storage.c.

◆ slot_memory()

void* slot_memory ( MessageLayout layout,
const void *  storage,
const upb_fielddef field 
)

Definition at line 586 of file php/ext/google/protobuf/storage.c.

◆ slot_oneof_case()

uint32_t* slot_oneof_case ( MessageLayout layout,
const void *  storage,
const upb_fielddef field 
)

Definition at line 575 of file php/ext/google/protobuf/storage.c.

◆ slot_property_cache()

static int slot_property_cache ( MessageLayout layout,
const void *  storage,
const upb_fielddef field 
)
static

Definition at line 581 of file php/ext/google/protobuf/storage.c.

◆ tryget_map_entry_msgdef()

const upb_msgdef* tryget_map_entry_msgdef ( const upb_fielddef field)

Definition at line 510 of file php/ext/google/protobuf/storage.c.

◆ value_memory()

static void* value_memory ( const upb_fielddef field,
void *  memory 
)
static

Definition at line 798 of file php/ext/google/protobuf/storage.c.

CACHED_PTR_TO_ZVAL_PTR
#define CACHED_PTR_TO_ZVAL_PTR(VALUE)
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:203
DEREF
#define DEREF(memory, type)
Definition: php/ext/google/protobuf/storage.c:41
value
const char * value
Definition: hpack_parser_table.cc:165
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:32