Auto-generate files after cl/590420044

pull/15064/head
Protobuf Team Bot 1 year ago
parent 3d597c265a
commit 95d7dc07f6
  1. 19
      php/ext/google/protobuf/php-upb.c
  2. 34
      php/ext/google/protobuf/php-upb.h
  3. 19
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 34
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -5928,6 +5928,25 @@ void upb_Arena_DecRefFor(upb_Arena* arena, const void* owner) {
}
#include <stddef.h>
#include <stdint.h>
// Must be last.
const upb_Message_Extension* upb_Message_FindExtensionByNumber(
const upb_Message* msg, uint32_t field_number) {
size_t count = 0;
const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &count);
while (count--) {
if (upb_MiniTableExtension_Number(ext->ext) == field_number) return ext;
ext++;
}
return NULL;
}
#include <string.h>

@ -1625,6 +1625,8 @@ bool upb_MiniTable_NextOneofField(const upb_MiniTable* m,
// Must be last.
typedef struct upb_Message_Extension upb_Message_Extension;
#ifdef __cplusplus
extern "C" {
#endif
@ -1747,14 +1749,14 @@ UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
// This is rather wasteful for scalars (in the extreme case of bool,
// it wastes 15 bytes). We accept this because we expect messages to be
// the most common extension type.
typedef struct {
struct upb_Message_Extension {
const upb_MiniTableExtension* ext;
union {
upb_StringView str;
void* ptr;
char scalar_data[8];
} data;
} upb_Message_Extension;
};
#ifdef __cplusplus
extern "C" {
@ -12383,6 +12385,34 @@ UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr,
#endif // UPB_PORT_ATOMIC_H_
#ifndef UPB_MESSAGE_COMPAT_H_
#define UPB_MESSAGE_COMPAT_H_
#include <stdint.h>
// Must be last.
// upb does not support mixing minitables from different sources but these
// functions are still used by some existing users so for now we make them
// available here. This may or may not change in the future so do not add
// them to new code.
#ifdef __cplusplus
extern "C" {
#endif
// Returns the extension with the given field number, or NULL on failure.
const upb_Message_Extension* upb_Message_FindExtensionByNumber(
const upb_Message* msg, uint32_t field_number);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* UPB_MESSAGE_COMPAT_H_ */
#ifndef UPB_MESSAGE_COPY_H_
#define UPB_MESSAGE_COPY_H_

@ -5442,6 +5442,25 @@ void upb_Arena_DecRefFor(upb_Arena* arena, const void* owner) {
}
#include <stddef.h>
#include <stdint.h>
// Must be last.
const upb_Message_Extension* upb_Message_FindExtensionByNumber(
const upb_Message* msg, uint32_t field_number) {
size_t count = 0;
const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &count);
while (count--) {
if (upb_MiniTableExtension_Number(ext->ext) == field_number) return ext;
ext++;
}
return NULL;
}
#include <string.h>

@ -1627,6 +1627,8 @@ bool upb_MiniTable_NextOneofField(const upb_MiniTable* m,
// Must be last.
typedef struct upb_Message_Extension upb_Message_Extension;
#ifdef __cplusplus
extern "C" {
#endif
@ -1749,14 +1751,14 @@ UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
// This is rather wasteful for scalars (in the extreme case of bool,
// it wastes 15 bytes). We accept this because we expect messages to be
// the most common extension type.
typedef struct {
struct upb_Message_Extension {
const upb_MiniTableExtension* ext;
union {
upb_StringView str;
void* ptr;
char scalar_data[8];
} data;
} upb_Message_Extension;
};
#ifdef __cplusplus
extern "C" {
@ -12155,6 +12157,34 @@ UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr,
#endif // UPB_PORT_ATOMIC_H_
#ifndef UPB_MESSAGE_COMPAT_H_
#define UPB_MESSAGE_COMPAT_H_
#include <stdint.h>
// Must be last.
// upb does not support mixing minitables from different sources but these
// functions are still used by some existing users so for now we make them
// available here. This may or may not change in the future so do not add
// them to new code.
#ifdef __cplusplus
extern "C" {
#endif
// Returns the extension with the given field number, or NULL on failure.
const upb_Message_Extension* upb_Message_FindExtensionByNumber(
const upb_Message* msg, uint32_t field_number);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* UPB_MESSAGE_COMPAT_H_ */
#ifndef UPB_MESSAGE_COPY_H_
#define UPB_MESSAGE_COPY_H_

Loading…
Cancel
Save