Auto-generate files after cl/688585300

pull/18940/head
Protobuf Team Bot 4 months ago
parent c5236bc28e
commit a836ee1277
  1. 106
      php/ext/google/protobuf/php-upb.h
  2. 106
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -4084,6 +4084,84 @@ UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
return upb_Array_MutableDataPtr(arr);
}
UPB_API_INLINE bool upb_Message_GetExtensionBool(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
bool default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Bool);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_1Byte);
bool ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE double upb_Message_GetExtensionDouble(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
double default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Double);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_8Byte);
double ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE float upb_Message_GetExtensionFloat(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
float default_val) {
float ret;
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Float);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_4Byte);
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE int32_t upb_Message_GetExtensionInt32(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
int32_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int32 ||
upb_MiniTableExtension_CType(e) == kUpb_CType_Enum);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_4Byte);
int32_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE int64_t upb_Message_GetExtensionInt64(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
int64_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int64);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_8Byte);
int64_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE uint32_t upb_Message_GetExtensionUInt32(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
uint32_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt32);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_4Byte);
uint32_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
uint64_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt64);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_8Byte);
uint64_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
@ -4438,6 +4516,34 @@ UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
const upb_MiniTableField* f,
uint64_t value);
// Extension Getters ///////////////////////////////////////////////////////////
// TODO: b/374976899 - Add support for non scalars
UPB_API_INLINE bool upb_Message_GetExtensionBool(
const upb_Message* msg, const upb_MiniTableExtension* f, bool default_val);
UPB_API_INLINE double upb_Message_GetExtensionDouble(
const upb_Message* msg, const upb_MiniTableExtension* f,
double default_val);
UPB_API_INLINE float upb_Message_GetExtensionFloat(
const upb_Message* msg, const upb_MiniTableExtension* f, float default_val);
UPB_API_INLINE int32_t upb_Message_GetExtensionInt32(
const upb_Message* msg, const upb_MiniTableExtension* f,
int32_t default_val);
UPB_API_INLINE int64_t upb_Message_GetExtensionInt64(
const upb_Message* msg, const upb_MiniTableExtension* f,
int64_t default_val);
UPB_API_INLINE uint32_t upb_Message_GetExtensionUInt32(
const upb_Message* msg, const upb_MiniTableExtension* f,
uint32_t default_val);
UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64(
const upb_Message* msg, const upb_MiniTableExtension* f,
uint64_t default_val);
// Extension Setters ///////////////////////////////////////////////////////////
UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg,

@ -4086,6 +4086,84 @@ UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
return upb_Array_MutableDataPtr(arr);
}
UPB_API_INLINE bool upb_Message_GetExtensionBool(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
bool default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Bool);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_1Byte);
bool ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE double upb_Message_GetExtensionDouble(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
double default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Double);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_8Byte);
double ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE float upb_Message_GetExtensionFloat(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
float default_val) {
float ret;
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Float);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_4Byte);
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE int32_t upb_Message_GetExtensionInt32(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
int32_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int32 ||
upb_MiniTableExtension_CType(e) == kUpb_CType_Enum);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_4Byte);
int32_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE int64_t upb_Message_GetExtensionInt64(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
int64_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int64);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_8Byte);
int64_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE uint32_t upb_Message_GetExtensionUInt32(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
uint32_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt32);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_4Byte);
uint32_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64(
const struct upb_Message* msg, const upb_MiniTableExtension* e,
uint64_t default_val) {
UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt64);
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
kUpb_FieldRep_8Byte);
uint64_t ret;
_upb_Message_GetExtensionField(msg, e, &default_val, &ret);
return ret;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
@ -4440,6 +4518,34 @@ UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
const upb_MiniTableField* f,
uint64_t value);
// Extension Getters ///////////////////////////////////////////////////////////
// TODO: b/374976899 - Add support for non scalars
UPB_API_INLINE bool upb_Message_GetExtensionBool(
const upb_Message* msg, const upb_MiniTableExtension* f, bool default_val);
UPB_API_INLINE double upb_Message_GetExtensionDouble(
const upb_Message* msg, const upb_MiniTableExtension* f,
double default_val);
UPB_API_INLINE float upb_Message_GetExtensionFloat(
const upb_Message* msg, const upb_MiniTableExtension* f, float default_val);
UPB_API_INLINE int32_t upb_Message_GetExtensionInt32(
const upb_Message* msg, const upb_MiniTableExtension* f,
int32_t default_val);
UPB_API_INLINE int64_t upb_Message_GetExtensionInt64(
const upb_Message* msg, const upb_MiniTableExtension* f,
int64_t default_val);
UPB_API_INLINE uint32_t upb_Message_GetExtensionUInt32(
const upb_Message* msg, const upb_MiniTableExtension* f,
uint32_t default_val);
UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64(
const upb_Message* msg, const upb_MiniTableExtension* f,
uint64_t default_val);
// Extension Setters ///////////////////////////////////////////////////////////
UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg,

Loading…
Cancel
Save