Classes | Macros | Typedefs | Enumerations | Functions | Variables
upb/upb/upb.h File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "upb/port_def.inc"
#include "upb/port_undef.inc"
Include dependency graph for upb/upb/upb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _upb_ArenaHead
 
struct  upb_alloc
 
struct  upb_Status
 
struct  upb_StringView
 

Macros

#define _kUpb_Status_MaxMessage   127
 
#define kUpb_Map_Begin   ((size_t)-1)
 
#define UPB_STRINGVIEW_ARGS(view)   (int)(view).size, (view).data
 
#define UPB_STRINGVIEW_FORMAT   "%.*s"
 
#define UPB_STRINGVIEW_INIT(ptr, len)   { ptr, len }
 

Typedefs

typedef struct upb_alloc upb_alloc
 
typedef void * upb_alloc_func(upb_alloc *alloc, void *ptr, size_t oldsize, size_t size)
 
typedef struct upb_Arena upb_Arena
 
typedef void upb_CleanupFunc(void *ud)
 

Enumerations

enum  upb_CType {
  kUpb_CType_Bool = 1, kUpb_CType_Float = 2, kUpb_CType_Int32 = 3, kUpb_CType_UInt32 = 4,
  kUpb_CType_Enum = 5, kUpb_CType_Message = 6, kUpb_CType_Double = 7, kUpb_CType_Int64 = 8,
  kUpb_CType_UInt64 = 9, kUpb_CType_String = 10, kUpb_CType_Bytes = 11
}
 
enum  upb_FieldType {
  kUpb_FieldType_Double = 1, kUpb_FieldType_Float = 2, kUpb_FieldType_Int64 = 3, kUpb_FieldType_UInt64 = 4,
  kUpb_FieldType_Int32 = 5, kUpb_FieldType_Fixed64 = 6, kUpb_FieldType_Fixed32 = 7, kUpb_FieldType_Bool = 8,
  kUpb_FieldType_String = 9, kUpb_FieldType_Group = 10, kUpb_FieldType_Message = 11, kUpb_FieldType_Bytes = 12,
  kUpb_FieldType_UInt32 = 13, kUpb_FieldType_Enum = 14, kUpb_FieldType_SFixed32 = 15, kUpb_FieldType_SFixed64 = 16,
  kUpb_FieldType_SInt32 = 17, kUpb_FieldType_SInt64 = 18
}
 
enum  upb_Label { kUpb_Label_Optional = 1, kUpb_Label_Required = 2, kUpb_Label_Repeated = 3 }
 
enum  upb_WireType {
  kUpb_WireType_Varint = 0, kUpb_WireType_64Bit = 1, kUpb_WireType_Delimited = 2, kUpb_WireType_StartGroup = 3,
  kUpb_WireType_EndGroup = 4, kUpb_WireType_32Bit = 5
}
 

Functions

UPB_INLINE void * _upb_Arena_FastMalloc (upb_Arena *a, size_t size)
 
void * _upb_Arena_SlowMalloc (upb_Arena *a, size_t size)
 
UPB_INLINE size_t _upb_ArenaHas (upb_Arena *a)
 
UPB_INLINE uint32_t _upb_BigEndian_Swap32 (uint32_t val)
 
UPB_INLINE uint64_t _upb_BigEndian_Swap64 (uint64_t val)
 
UPB_INLINE bool _upb_IsLittleEndian (void)
 
UPB_INLINE int _upb_Log2Ceiling (int x)
 
UPB_INLINE int _upb_Log2CeilingSize (int x)
 
bool upb_Arena_AddCleanup (upb_Arena *a, void *ud, upb_CleanupFunc *func)
 
UPB_INLINE upb_allocupb_Arena_Alloc (upb_Arena *a)
 
void upb_Arena_Free (upb_Arena *a)
 
bool upb_Arena_Fuse (upb_Arena *a, upb_Arena *b)
 
upb_Arenaupb_Arena_Init (void *mem, size_t n, upb_alloc *alloc)
 
UPB_INLINE void * upb_Arena_Malloc (upb_Arena *a, size_t size)
 
UPB_INLINE upb_Arenaupb_Arena_New (void)
 
UPB_INLINE void * upb_Arena_Realloc (upb_Arena *a, void *ptr, size_t oldsize, size_t size)
 
UPB_INLINE void upb_Arena_ShrinkLast (upb_Arena *a, void *ptr, size_t oldsize, size_t size)
 
UPB_INLINE void upb_free (upb_alloc *alloc, void *ptr)
 
UPB_INLINE void upb_gfree (void *ptr)
 
UPB_INLINE void * upb_gmalloc (size_t size)
 
UPB_INLINE void * upb_grealloc (void *ptr, size_t oldsize, size_t size)
 
UPB_INLINE void * upb_malloc (upb_alloc *alloc, size_t size)
 
UPB_INLINE void * upb_realloc (upb_alloc *alloc, void *ptr, size_t oldsize, size_t size)
 
void upb_Status_Clear (upb_Status *status)
 
const char * upb_Status_ErrorMessage (const upb_Status *status)
 
bool upb_Status_IsOk (const upb_Status *status)
 
void upb_Status_SetErrorFormat (upb_Status *status, const char *fmt,...) UPB_PRINTF(2
 
void upb_Status_SetErrorMessage (upb_Status *status, const char *msg)
 
void void void upb_Status_VAppendErrorFormat (upb_Status *status, const char *fmt, va_list args) UPB_PRINTF(2
 
void void upb_Status_VSetErrorFormat (upb_Status *status, const char *fmt, va_list args) UPB_PRINTF(2
 
UPB_INLINE upb_StringView upb_StringView_FromDataAndSize (const char *data, size_t size)
 
UPB_INLINE upb_StringView upb_StringView_FromString (const char *data)
 
UPB_INLINE bool upb_StringView_IsEqual (upb_StringView a, upb_StringView b)
 

Variables

upb_alloc upb_alloc_global
 

Macro Definition Documentation

◆ _kUpb_Status_MaxMessage

#define _kUpb_Status_MaxMessage   127

Definition at line 50 of file upb/upb/upb.h.

◆ kUpb_Map_Begin

#define kUpb_Map_Begin   ((size_t)-1)

Definition at line 329 of file upb/upb/upb.h.

◆ UPB_STRINGVIEW_ARGS

#define UPB_STRINGVIEW_ARGS (   view)    (int)(view).size, (view).data

Definition at line 97 of file upb/upb/upb.h.

◆ UPB_STRINGVIEW_FORMAT

#define UPB_STRINGVIEW_FORMAT   "%.*s"

Definition at line 96 of file upb/upb/upb.h.

◆ UPB_STRINGVIEW_INIT

#define UPB_STRINGVIEW_INIT (   ptr,
  len 
)    { ptr, len }

Definition at line 93 of file upb/upb/upb.h.

Typedef Documentation

◆ upb_alloc

typedef struct upb_alloc upb_alloc

Definition at line 108 of file upb/upb/upb.h.

◆ upb_alloc_func

typedef void* upb_alloc_func(upb_alloc *alloc, void *ptr, size_t oldsize, size_t size)

Definition at line 113 of file upb/upb/upb.h.

◆ upb_Arena

typedef struct upb_Arena upb_Arena

Definition at line 172 of file upb/upb/upb.h.

◆ upb_CleanupFunc

typedef void upb_CleanupFunc(void *ud)

Definition at line 169 of file upb/upb/upb.h.

Enumeration Type Documentation

◆ upb_CType

enum upb_CType
Enumerator
kUpb_CType_Bool 
kUpb_CType_Float 
kUpb_CType_Int32 
kUpb_CType_UInt32 
kUpb_CType_Enum 
kUpb_CType_Message 
kUpb_CType_Double 
kUpb_CType_Int64 
kUpb_CType_UInt64 
kUpb_CType_String 
kUpb_CType_Bytes 

Definition at line 286 of file upb/upb/upb.h.

◆ upb_FieldType

Enumerator
kUpb_FieldType_Double 
kUpb_FieldType_Float 
kUpb_FieldType_Int64 
kUpb_FieldType_UInt64 
kUpb_FieldType_Int32 
kUpb_FieldType_Fixed64 
kUpb_FieldType_Fixed32 
kUpb_FieldType_Bool 
kUpb_FieldType_String 
kUpb_FieldType_Group 
kUpb_FieldType_Message 
kUpb_FieldType_Bytes 
kUpb_FieldType_UInt32 
kUpb_FieldType_Enum 
kUpb_FieldType_SFixed32 
kUpb_FieldType_SFixed64 
kUpb_FieldType_SInt32 
kUpb_FieldType_SInt64 

Definition at line 308 of file upb/upb/upb.h.

◆ upb_Label

enum upb_Label
Enumerator
kUpb_Label_Optional 
kUpb_Label_Required 
kUpb_Label_Repeated 

Definition at line 301 of file upb/upb/upb.h.

◆ upb_WireType

Enumerator
kUpb_WireType_Varint 
kUpb_WireType_64Bit 
kUpb_WireType_Delimited 
kUpb_WireType_StartGroup 
kUpb_WireType_EndGroup 
kUpb_WireType_32Bit 

Definition at line 274 of file upb/upb/upb.h.

Function Documentation

◆ _upb_Arena_FastMalloc()

UPB_INLINE void* _upb_Arena_FastMalloc ( upb_Arena a,
size_t  size 
)

Definition at line 199 of file upb/upb/upb.h.

◆ _upb_Arena_SlowMalloc()

void* _upb_Arena_SlowMalloc ( upb_Arena a,
size_t  size 
)

Definition at line 176 of file upb/upb/upb.c.

◆ _upb_ArenaHas()

UPB_INLINE size_t _upb_ArenaHas ( upb_Arena a)

Definition at line 194 of file upb/upb/upb.h.

◆ _upb_BigEndian_Swap32()

UPB_INLINE uint32_t _upb_BigEndian_Swap32 ( uint32_t  val)

Definition at line 336 of file upb/upb/upb.h.

◆ _upb_BigEndian_Swap64()

UPB_INLINE uint64_t _upb_BigEndian_Swap64 ( uint64_t  val)

Definition at line 345 of file upb/upb/upb.h.

◆ _upb_IsLittleEndian()

UPB_INLINE bool _upb_IsLittleEndian ( void  )

Definition at line 331 of file upb/upb/upb.h.

◆ _upb_Log2Ceiling()

UPB_INLINE int _upb_Log2Ceiling ( int  x)

Definition at line 354 of file upb/upb/upb.h.

◆ _upb_Log2CeilingSize()

UPB_INLINE int _upb_Log2CeilingSize ( int  x)

Definition at line 365 of file upb/upb/upb.h.

◆ upb_Arena_AddCleanup()

bool upb_Arena_AddCleanup ( upb_Arena a,
void *  ud,
upb_CleanupFunc func 
)

Definition at line 278 of file upb/upb/upb.c.

◆ upb_Arena_Alloc()

UPB_INLINE upb_alloc* upb_Arena_Alloc ( upb_Arena a)

Definition at line 192 of file upb/upb/upb.h.

◆ upb_Arena_Free()

void upb_Arena_Free ( upb_Arena a)

Definition at line 273 of file upb/upb/upb.c.

◆ upb_Arena_Fuse()

bool upb_Arena_Fuse ( upb_Arena a,
upb_Arena b 
)

Definition at line 299 of file upb/upb/upb.c.

◆ upb_Arena_Init()

upb_Arena* upb_Arena_Init ( void *  mem,
size_t  n,
upb_alloc alloc 
)

Definition at line 216 of file upb/upb/upb.c.

◆ upb_Arena_Malloc()

UPB_INLINE void* upb_Arena_Malloc ( upb_Arena a,
size_t  size 
)

Definition at line 222 of file upb/upb/upb.h.

◆ upb_Arena_New()

UPB_INLINE upb_Arena* upb_Arena_New ( void  )

Definition at line 267 of file upb/upb/upb.h.

◆ upb_Arena_Realloc()

UPB_INLINE void* upb_Arena_Realloc ( upb_Arena a,
void *  ptr,
size_t  oldsize,
size_t  size 
)

Definition at line 246 of file upb/upb/upb.h.

◆ upb_Arena_ShrinkLast()

UPB_INLINE void upb_Arena_ShrinkLast ( upb_Arena a,
void *  ptr,
size_t  oldsize,
size_t  size 
)

Definition at line 236 of file upb/upb/upb.h.

◆ upb_free()

UPB_INLINE void upb_free ( upb_alloc alloc,
void *  ptr 
)

Definition at line 131 of file upb/upb/upb.h.

◆ upb_gfree()

UPB_INLINE void upb_gfree ( void *  ptr)

Definition at line 153 of file upb/upb/upb.h.

◆ upb_gmalloc()

UPB_INLINE void* upb_gmalloc ( size_t  size)

Definition at line 145 of file upb/upb/upb.h.

◆ upb_grealloc()

UPB_INLINE void* upb_grealloc ( void *  ptr,
size_t  oldsize,
size_t  size 
)

Definition at line 149 of file upb/upb/upb.h.

◆ upb_malloc()

UPB_INLINE void* upb_malloc ( upb_alloc alloc,
size_t  size 
)

Definition at line 120 of file upb/upb/upb.h.

◆ upb_realloc()

UPB_INLINE void* upb_realloc ( upb_alloc alloc,
void *  ptr,
size_t  oldsize,
size_t  size 
)

Definition at line 125 of file upb/upb/upb.h.

◆ upb_Status_Clear()

void upb_Status_Clear ( upb_Status status)

Definition at line 44 of file upb/upb/upb.c.

◆ upb_Status_ErrorMessage()

const char* upb_Status_ErrorMessage ( const upb_Status status)

Definition at line 52 of file upb/upb/upb.c.

◆ upb_Status_IsOk()

bool upb_Status_IsOk ( const upb_Status status)

Definition at line 50 of file upb/upb/upb.c.

◆ upb_Status_SetErrorFormat()

void upb_Status_SetErrorFormat ( upb_Status status,
const char *  fmt,
  ... 
)

◆ upb_Status_SetErrorMessage()

void upb_Status_SetErrorMessage ( upb_Status status,
const char *  msg 
)

Definition at line 56 of file upb/upb/upb.c.

◆ upb_Status_VAppendErrorFormat()

void void void upb_Status_VAppendErrorFormat ( upb_Status status,
const char *  fmt,
va_list  args 
)

◆ upb_Status_VSetErrorFormat()

void void upb_Status_VSetErrorFormat ( upb_Status status,
const char *  fmt,
va_list  args 
)

◆ upb_StringView_FromDataAndSize()

UPB_INLINE upb_StringView upb_StringView_FromDataAndSize ( const char *  data,
size_t  size 
)

Definition at line 77 of file upb/upb/upb.h.

◆ upb_StringView_FromString()

UPB_INLINE upb_StringView upb_StringView_FromString ( const char *  data)

Definition at line 85 of file upb/upb/upb.h.

◆ upb_StringView_IsEqual()

UPB_INLINE bool upb_StringView_IsEqual ( upb_StringView  a,
upb_StringView  b 
)

Definition at line 89 of file upb/upb/upb.h.

Variable Documentation

◆ upb_alloc_global

upb_alloc upb_alloc_global


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