Classes | Enumerations | Functions
json_decode.c File Reference
#include "upb/json_decode.h"
#include <errno.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>
#include "upb/encode.h"
#include "upb/reflection.h"
#include "upb/port_def.inc"
Include dependency graph for json_decode.c:

Go to the source code of this file.

Classes

struct  jsondec
 

Enumerations

enum  {
  JD_OBJECT, JD_ARRAY, JD_STRING, JD_NUMBER,
  JD_TRUE, JD_FALSE, JD_NULL
}
 

Functions

static void jsondec_any (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_anyfield (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_array (jsondec *d, upb_Message *msg, const upb_FieldDef *f)
 
static void jsondec_arrend (jsondec *d)
 
static bool jsondec_arrnext (jsondec *d)
 
static void jsondec_arrstart (jsondec *d)
 
static size_t jsondec_base64 (jsondec *d, upb_StringView str)
 
static unsigned int jsondec_base64_tablelookup (const char ch)
 
static upb_MessageValue jsondec_bool (jsondec *d, const upb_FieldDef *f)
 
static const char * jsondec_buftoint64 (jsondec *d, const char *ptr, const char *end, int64_t *val)
 
static const char * jsondec_buftouint64 (jsondec *d, const char *ptr, const char *end, uint64_t *val)
 
static uint32_t jsondec_codepoint (jsondec *d)
 
static upb_MessageValue jsondec_double (jsondec *d, const upb_FieldDef *f)
 
static void jsondec_duration (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_entrysep (jsondec *d)
 
static upb_MessageValue jsondec_enum (jsondec *d, const upb_FieldDef *f)
 
int jsondec_epochdays (int y, int m, int d)
 
static UPB_NORETURN void jsondec_err (jsondec *d, const char *msg)
 
static UPB_NORETURN void jsondec_errf (jsondec *d, const char *fmt,...)
 
static char jsondec_escape (jsondec *d)
 
static void jsondec_false (jsondec *d)
 
static void jsondec_field (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_fieldmask (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static upb_MessageValue jsondec_int (jsondec *d, const upb_FieldDef *f)
 
static bool jsondec_isnullvalue (const upb_FieldDef *f)
 
static bool jsondec_isvalue (const upb_FieldDef *f)
 
static void jsondec_listvalue (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_map (jsondec *d, upb_Message *msg, const upb_FieldDef *f)
 
static upb_StringView jsondec_mask (jsondec *d, const char *buf, const char *end)
 
static upb_MessageValue jsondec_msg (jsondec *d, const upb_FieldDef *f)
 
static int jsondec_nanos (jsondec *d, const char **ptr, const char *end)
 
static void jsondec_null (jsondec *d)
 
static double jsondec_number (jsondec *d)
 
static void jsondec_object (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_objend (jsondec *d)
 
static bool jsondec_objnext (jsondec *d)
 
static void jsondec_objstart (jsondec *d)
 
static void jsondec_parselit (jsondec *d, const char *lit)
 
static char * jsondec_partialbase64 (jsondec *d, const char *ptr, const char *end, char *out)
 
static int jsondec_peek (jsondec *d)
 
static void jsondec_push (jsondec *d)
 
static int jsondec_rawpeek (jsondec *d)
 
static void jsondec_resize (jsondec *d, char **buf, char **end, char **buf_end)
 
static bool jsondec_seqnext (jsondec *d, char end_ch)
 
static void jsondec_skipdigits (jsondec *d)
 
static void jsondec_skipval (jsondec *d)
 
static void jsondec_skipws (jsondec *d)
 
static bool jsondec_streql (upb_StringView str, const char *lit)
 
static upb_MessageValue jsondec_strfield (jsondec *d, const upb_FieldDef *f)
 
static upb_StringView jsondec_string (jsondec *d)
 
static int64_t jsondec_strtoint64 (jsondec *d, upb_StringView str)
 
static uint64_t jsondec_strtouint64 (jsondec *d, upb_StringView str)
 
static void jsondec_struct (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_timestamp (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_tomsg (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_true (jsondec *d)
 
static bool jsondec_tryparsech (jsondec *d, char ch)
 
static bool jsondec_tryskipdigits (jsondec *d)
 
static int jsondec_tsdigits (jsondec *d, const char **ptr, size_t digits, const char *after)
 
static const upb_MessageDefjsondec_typeurl (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static upb_MessageValue jsondec_uint (jsondec *d, const upb_FieldDef *f)
 
static size_t jsondec_unicode (jsondec *d, char *out)
 
static int64_t jsondec_unixtime (int y, int m, int d, int h, int min, int s)
 
static upb_MessageValue jsondec_value (jsondec *d, const upb_FieldDef *f)
 
static void jsondec_wellknown (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_wellknownvalue (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_wrapper (jsondec *d, upb_Message *msg, const upb_MessageDef *m)
 
static void jsondec_wsch (jsondec *d, char ch)
 
bool upb_JsonDecode (const char *buf, size_t size, upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *symtab, int options, upb_Arena *arena, upb_Status *status)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
JD_OBJECT 
JD_ARRAY 
JD_STRING 
JD_NUMBER 
JD_TRUE 
JD_FALSE 
JD_NULL 

Definition at line 59 of file json_decode.c.

Function Documentation

◆ jsondec_any()

static void jsondec_any ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1376 of file json_decode.c.

◆ jsondec_anyfield()

static void jsondec_anyfield ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1328 of file json_decode.c.

◆ jsondec_array()

static void jsondec_array ( jsondec d,
upb_Message msg,
const upb_FieldDef f 
)
static

Definition at line 883 of file json_decode.c.

◆ jsondec_arrend()

static void jsondec_arrend ( jsondec d)
static

Definition at line 221 of file json_decode.c.

◆ jsondec_arrnext()

static bool jsondec_arrnext ( jsondec d)
static

Definition at line 226 of file json_decode.c.

◆ jsondec_arrstart()

static void jsondec_arrstart ( jsondec d)
static

Definition at line 216 of file json_decode.c.

◆ jsondec_base64()

static size_t jsondec_base64 ( jsondec d,
upb_StringView  str 
)
static

Definition at line 595 of file json_decode.c.

◆ jsondec_base64_tablelookup()

static unsigned int jsondec_base64_tablelookup ( const char  ch)
static

Definition at line 522 of file json_decode.c.

◆ jsondec_bool()

static upb_MessageValue jsondec_bool ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 849 of file json_decode.c.

◆ jsondec_buftoint64()

static const char* jsondec_buftoint64 ( jsondec d,
const char *  ptr,
const char *  end,
int64_t val 
)
static

Definition at line 657 of file json_decode.c.

◆ jsondec_buftouint64()

static const char* jsondec_buftouint64 ( jsondec d,
const char *  ptr,
const char *  end,
uint64_t val 
)
static

Definition at line 639 of file json_decode.c.

◆ jsondec_codepoint()

static uint32_t jsondec_codepoint ( jsondec d)
static

Definition at line 351 of file json_decode.c.

◆ jsondec_double()

static upb_MessageValue jsondec_double ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 770 of file json_decode.c.

◆ jsondec_duration()

static void jsondec_duration ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1149 of file json_decode.c.

◆ jsondec_entrysep()

static void jsondec_entrysep ( jsondec d)
static

Definition at line 149 of file json_decode.c.

◆ jsondec_enum()

static upb_MessageValue jsondec_enum ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 815 of file json_decode.c.

◆ jsondec_epochdays()

int jsondec_epochdays ( int  y,
int  m,
int  d 
)

Definition at line 1070 of file json_decode.c.

◆ jsondec_err()

static UPB_NORETURN void jsondec_err ( jsondec d,
const char *  msg 
)
static

Definition at line 87 of file json_decode.c.

◆ jsondec_errf()

static UPB_NORETURN void jsondec_errf ( jsondec d,
const char *  fmt,
  ... 
)
static

Definition at line 94 of file json_decode.c.

◆ jsondec_escape()

static char jsondec_escape ( jsondec d)
static

Definition at line 328 of file json_decode.c.

◆ jsondec_false()

static void jsondec_false ( jsondec d)
static

Definition at line 146 of file json_decode.c.

◆ jsondec_field()

static void jsondec_field ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 930 of file json_decode.c.

◆ jsondec_fieldmask()

static void jsondec_fieldmask ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1305 of file json_decode.c.

◆ jsondec_int()

static upb_MessageValue jsondec_int ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 697 of file json_decode.c.

◆ jsondec_isnullvalue()

static bool jsondec_isnullvalue ( const upb_FieldDef f)
static

Definition at line 74 of file json_decode.c.

◆ jsondec_isvalue()

static bool jsondec_isvalue ( const upb_FieldDef f)
static

Definition at line 80 of file json_decode.c.

◆ jsondec_listvalue()

static void jsondec_listvalue ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1179 of file json_decode.c.

◆ jsondec_map()

static void jsondec_map ( jsondec d,
upb_Message msg,
const upb_FieldDef f 
)
static

Definition at line 894 of file json_decode.c.

◆ jsondec_mask()

static upb_StringView jsondec_mask ( jsondec d,
const char *  buf,
const char *  end 
)
static

Definition at line 1272 of file json_decode.c.

◆ jsondec_msg()

static upb_MessageValue jsondec_msg ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 920 of file json_decode.c.

◆ jsondec_nanos()

static int jsondec_nanos ( jsondec d,
const char **  ptr,
const char *  end 
)
static

Definition at line 1049 of file json_decode.c.

◆ jsondec_null()

static void jsondec_null ( jsondec d)
static

Definition at line 147 of file json_decode.c.

◆ jsondec_number()

static double jsondec_number ( jsondec d)
static

Definition at line 267 of file json_decode.c.

◆ jsondec_object()

static void jsondec_object ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 993 of file json_decode.c.

◆ jsondec_objend()

static void jsondec_objend ( jsondec d)
static

Definition at line 233 of file json_decode.c.

◆ jsondec_objnext()

static bool jsondec_objnext ( jsondec d)
static

Definition at line 238 of file json_decode.c.

◆ jsondec_objstart()

static void jsondec_objstart ( jsondec d)
static

Definition at line 228 of file json_decode.c.

◆ jsondec_parselit()

static void jsondec_parselit ( jsondec d,
const char *  lit 
)
static

Definition at line 129 of file json_decode.c.

◆ jsondec_partialbase64()

static char* jsondec_partialbase64 ( jsondec d,
const char *  ptr,
const char *  end,
char *  out 
)
static

Definition at line 567 of file json_decode.c.

◆ jsondec_peek()

static int jsondec_peek ( jsondec d)
static

Definition at line 195 of file json_decode.c.

◆ jsondec_push()

static void jsondec_push ( jsondec d)
static

Definition at line 200 of file json_decode.c.

◆ jsondec_rawpeek()

static int jsondec_rawpeek ( jsondec d)
static

Definition at line 154 of file json_decode.c.

◆ jsondec_resize()

static void jsondec_resize ( jsondec d,
char **  buf,
char **  end,
char **  buf_end 
)
static

Definition at line 420 of file json_decode.c.

◆ jsondec_seqnext()

static bool jsondec_seqnext ( jsondec d,
char  end_ch 
)
static

Definition at line 207 of file json_decode.c.

◆ jsondec_skipdigits()

static void jsondec_skipdigits ( jsondec d)
static

Definition at line 261 of file json_decode.c.

◆ jsondec_skipval()

static void jsondec_skipval ( jsondec d)
static

Definition at line 484 of file json_decode.c.

◆ jsondec_skipws()

static void jsondec_skipws ( jsondec d)
static

Definition at line 104 of file json_decode.c.

◆ jsondec_streql()

static bool jsondec_streql ( upb_StringView  str,
const char *  lit 
)
static

Definition at line 70 of file json_decode.c.

◆ jsondec_strfield()

static upb_MessageValue jsondec_strfield ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 806 of file json_decode.c.

◆ jsondec_string()

static upb_StringView jsondec_string ( jsondec d)
static

Definition at line 432 of file json_decode.c.

◆ jsondec_strtoint64()

static int64_t jsondec_strtoint64 ( jsondec d,
upb_StringView  str 
)
static

Definition at line 685 of file json_decode.c.

◆ jsondec_strtouint64()

static uint64_t jsondec_strtouint64 ( jsondec d,
upb_StringView  str 
)
static

Definition at line 676 of file json_decode.c.

◆ jsondec_struct()

static void jsondec_struct ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1196 of file json_decode.c.

◆ jsondec_timestamp()

static void jsondec_timestamp ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1085 of file json_decode.c.

◆ jsondec_tomsg()

static void jsondec_tomsg ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 911 of file json_decode.c.

◆ jsondec_true()

static void jsondec_true ( jsondec d)
static

Definition at line 145 of file json_decode.c.

◆ jsondec_tryparsech()

static bool jsondec_tryparsech ( jsondec d,
char  ch 
)
static

Definition at line 123 of file json_decode.c.

◆ jsondec_tryskipdigits()

static bool jsondec_tryskipdigits ( jsondec d)
static

Definition at line 248 of file json_decode.c.

◆ jsondec_tsdigits()

static int jsondec_tsdigits ( jsondec d,
const char **  ptr,
size_t  digits,
const char *  after 
)
static

Definition at line 1029 of file json_decode.c.

◆ jsondec_typeurl()

static const upb_MessageDef* jsondec_typeurl ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1346 of file json_decode.c.

◆ jsondec_uint()

static upb_MessageValue jsondec_uint ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 734 of file json_decode.c.

◆ jsondec_unicode()

static size_t jsondec_unicode ( jsondec d,
char *  out 
)
static

Definition at line 378 of file json_decode.c.

◆ jsondec_unixtime()

static int64_t jsondec_unixtime ( int  y,
int  m,
int  d,
int  h,
int  min,
int  s 
)
static

Definition at line 1081 of file json_decode.c.

◆ jsondec_value()

static upb_MessageValue jsondec_value ( jsondec d,
const upb_FieldDef f 
)
static

Definition at line 1002 of file json_decode.c.

◆ jsondec_wellknown()

static void jsondec_wellknown ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1446 of file json_decode.c.

◆ jsondec_wellknownvalue()

static void jsondec_wellknownvalue ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1217 of file json_decode.c.

◆ jsondec_wrapper()

static void jsondec_wrapper ( jsondec d,
upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 1439 of file json_decode.c.

◆ jsondec_wsch()

static void jsondec_wsch ( jsondec d,
char  ch 
)
static

Definition at line 138 of file json_decode.c.

◆ upb_JsonDecode()

bool upb_JsonDecode ( const char *  buf,
size_t  size,
upb_Message msg,
const upb_MessageDef m,
const upb_DefPool symtab,
int  options,
upb_Arena arena,
upb_Status status 
)

Definition at line 1486 of file json_decode.c.



grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:02:16