Go to the documentation of this file.
42 return PyLong_FromLongLong(val.
int64_val);
46 return PyLong_FromUnsignedLongLong(val.
uint64_val);
52 return PyBool_FromLong(val.
bool_val);
72 PyErr_Format(PyExc_SystemError,
73 "Getting a value from a field of unknown type %d",
83 if (!
obj)
return false;
86 *val = PyLong_AsLongLong(
obj);
88 if (PyErr_Occurred()) {
89 assert(PyErr_ExceptionMatches(PyExc_OverflowError));
91 PyErr_Format(PyExc_ValueError,
"Value out of range: %S",
obj);
101 obj = PyNumber_Index(
obj);
102 if (!
obj)
return false;
103 *val = PyLong_AsUnsignedLongLong(
obj);
105 if (PyErr_Occurred()) {
106 assert(PyErr_ExceptionMatches(PyExc_OverflowError));
108 PyErr_Format(PyExc_ValueError,
"Value out of range: %S",
obj);
118 if (i64 < INT32_MIN || i64 >
INT32_MAX) {
119 PyErr_Format(PyExc_ValueError,
"Value out of range: %S",
obj);
130 PyErr_Format(PyExc_ValueError,
"Value out of range: %S",
obj);
155 if (PyUnicode_Check(
obj)) {
157 const char*
name = PyUnicode_AsUTF8AndSize(
obj, &
size);
161 PyErr_Format(PyExc_ValueError,
"unknown enum label \"%s\"",
name);
171 PyErr_Format(PyExc_ValueError,
"invalid enumerator %d", (
int)i32);
194 return !PyErr_Occurred();
197 return !PyErr_Occurred();
200 return !PyErr_Occurred();
204 if (PyBytes_AsStringAndSize(
obj, &
ptr, &
size) < 0)
return false;
212 if (PyBytes_Check(
obj)) {
213 unicode =
obj = PyUnicode_FromEncodedObject(
obj,
"utf-8", NULL);
214 if (!
obj)
return false;
217 if (PyErr_Occurred()) {
226 PyErr_Format(PyExc_ValueError,
"Message objects may not be assigned",
230 PyErr_Format(PyExc_SystemError,
231 "Getting a value from a field of unknown type %d",
248 return val1.bool_val ==
val2.bool_val;
252 return val1.int32_val ==
val2.int32_val;
255 return val1.int64_val ==
val2.int64_val;
257 return val1.float_val ==
val2.float_val;
259 return val1.double_val ==
val2.double_val;
262 return val1.str_val.size ==
val2.str_val.size &&
263 memcmp(
val1.str_val.data,
val2.str_val.data,
val1.str_val.size) ==
276 if (map1 == map2)
return true;
280 if (size1 != size2)
return false;
281 if (size1 == 0)
return true;
311 if (arr1 == arr2)
return true;
315 if (n1 != n2)
return false;
318 size_t half = n1 / 2;
323 for (
size_t i = 0;
i <
half;
i++) {
338 if (msg1 == msg2)
return true;
387 size_t usize1, usize2;
OPENSSL_EXPORT const ASN1_OBJECT * obj
size_t upb_Message_ExtensionCount(const upb_Message *msg)
upb_MessageValue upb_MapIterator_Key(const upb_Map *map, size_t iter)
static bool PyUpb_GetUint64(PyObject *obj, uint64_t *val)
const upb_EnumValueDef * upb_EnumDef_FindValueByNameWithSize(const upb_EnumDef *def, const char *name, size_t len)
size_t upb_Map_Size(const upb_Map *map)
bool PyUpb_ValueEq(upb_MessageValue val1, upb_MessageValue val2, const upb_FieldDef *f)
PyObject * PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef *f, PyObject *arena)
const char * upb_Message_GetUnknown(const upb_Message *msg, size_t *len)
upb_MessageValue upb_Array_Get(const upb_Array *arr, size_t i)
const upb_FileDef * upb_EnumDef_File(const upb_EnumDef *e)
@ kUpb_UnknownCompareResult_Equal
upb_Syntax upb_FileDef_Syntax(const upb_FileDef *f)
grpc_core::ScopedArenaPtr arena
bool PyUpb_Array_IsEqual(const upb_Array *arr1, const upb_Array *arr2, const upb_FieldDef *f)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
#define kUpb_Message_Begin
bool upb_FieldDef_IsMap(const upb_FieldDef *f)
static bool PyUpb_PyToUpbEnum(PyObject *obj, const upb_EnumDef *e, upb_MessageValue *val)
bool upb_MapIterator_Next(const upb_Map *map, size_t *iter)
bool upb_EnumDef_CheckNumber(const upb_EnumDef *e, int32_t num)
UPB_INLINE void * upb_Arena_Malloc(upb_Arena *a, size_t size)
static upb_MessageValue PyUpb_MaybeCopyString(const char *ptr, size_t size, upb_Arena *arena)
bool PyUpb_Map_IsEqual(const upb_Map *map1, const upb_Map *map2, const upb_FieldDef *f)
const upb_DefPool * upb_FileDef_Pool(const upb_FileDef *f)
static bool PyUpb_GetUint32(PyObject *obj, uint32_t *val)
unsigned __int64 uint64_t
bool upb_FieldDef_IsExtension(const upb_FieldDef *f)
bool upb_Message_Next(const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, const upb_FieldDef **out_f, upb_MessageValue *out_val, size_t *iter)
const upb_Message * msg_val
static bool PyUpb_ArrayElem_IsEqual(const upb_Array *arr1, const upb_Array *arr2, size_t i, const upb_FieldDef *f)
upb_CType upb_FieldDef_CType(const upb_FieldDef *f)
const upb_MessageDef * upb_FieldDef_MessageSubDef(const upb_FieldDef *f)
const upb_EnumDef * upb_FieldDef_EnumSubDef(const upb_FieldDef *f)
size_t upb_Array_Size(const upb_Array *arr)
static bool PyUpb_GetInt64(PyObject *obj, int64_t *val)
static bool PyUpb_GetInt32(PyObject *obj, int32_t *val)
upb_MessageValue upb_Message_Get(const upb_Message *msg, const upb_FieldDef *f)
bool upb_FieldDef_IsRepeated(const upb_FieldDef *f)
UniquePtr< SSL_SESSION > ret
PyObject * PyUpb_CMessage_Get(upb_Message *u_msg, const upb_MessageDef *m, PyObject *arena)
const upb_FileDef * upb_MessageDef_File(const upb_MessageDef *m)
bool upb_Map_Get(const upb_Map *map, upb_MessageValue key, upb_MessageValue *val)
upb_UnknownCompareResult upb_Message_UnknownFieldsAreEqual(const char *buf1, size_t size1, const char *buf2, size_t size2, int max_depth)
const upb_FieldDef * upb_MessageDef_Field(const upb_MessageDef *m, int i)
upb_MessageValue upb_MapIterator_Value(const upb_Map *map, size_t iter)
int32_t upb_EnumValueDef_Number(const upb_EnumValueDef *ev)
bool PyUpb_PyToUpb(PyObject *obj, const upb_FieldDef *f, upb_MessageValue *val, upb_Arena *arena)
bool PyUpb_Message_IsEqual(const upb_Message *msg1, const upb_Message *msg2, const upb_MessageDef *m)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:55