MOS Source Code
Loading...
Searching...
No Matches
pb_decode.c File Reference
#include "pb.h"
#include "pb_decode.h"
#include "pb_common.h"
+ Include dependency graph for pb_decode.c:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pb_fields_seen_t
 

Macros

#define checkreturn
 
#define pb_int64_t   int64_t
 
#define pb_uint64_t   uint64_t
 

Functions

static bool buf_read (pb_istream_t *stream, pb_byte_t *buf, size_t count)
 
static bool pb_decode_varint32_eof (pb_istream_t *stream, uint32_t *dest, bool *eof)
 
static bool read_raw_value (pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size)
 
static bool decode_basic_field (pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field)
 
static bool decode_static_field (pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field)
 
static bool decode_pointer_field (pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field)
 
static bool decode_callback_field (pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field)
 
static bool decode_field (pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field)
 
static bool default_extension_decoder (pb_istream_t *stream, pb_extension_t *extension, uint32_t tag, pb_wire_type_t wire_type)
 
static bool decode_extension (pb_istream_t *stream, uint32_t tag, pb_wire_type_t wire_type, pb_extension_t *extension)
 
static bool pb_field_set_to_default (pb_field_iter_t *field)
 
static bool pb_message_set_to_defaults (pb_field_iter_t *iter)
 
static bool pb_dec_bool (pb_istream_t *stream, const pb_field_iter_t *field)
 
static bool pb_dec_varint (pb_istream_t *stream, const pb_field_iter_t *field)
 
static bool pb_dec_bytes (pb_istream_t *stream, const pb_field_iter_t *field)
 
static bool pb_dec_string (pb_istream_t *stream, const pb_field_iter_t *field)
 
static bool pb_dec_submessage (pb_istream_t *stream, const pb_field_iter_t *field)
 
static bool pb_dec_fixed_length_bytes (pb_istream_t *stream, const pb_field_iter_t *field)
 
static bool pb_skip_varint (pb_istream_t *stream)
 
static bool pb_skip_string (pb_istream_t *stream)
 
bool pb_read (pb_istream_t *stream, pb_byte_t *buf, size_t count)
 
static bool pb_readbyte (pb_istream_t *stream, pb_byte_t *buf)
 
pb_istream_t pb_istream_from_buffer (const pb_byte_t *buf, size_t msglen)
 
bool pb_decode_varint32 (pb_istream_t *stream, uint32_t *dest)
 
bool pb_decode_varint (pb_istream_t *stream, uint64_t *dest)
 
bool pb_decode_tag (pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof)
 
bool pb_skip_field (pb_istream_t *stream, pb_wire_type_t wire_type)
 
bool pb_make_string_substream (pb_istream_t *stream, pb_istream_t *substream)
 
bool pb_close_string_substream (pb_istream_t *stream, pb_istream_t *substream)
 
static bool pb_decode_inner (pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct, unsigned int flags)
 
bool pb_decode_ex (pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct, unsigned int flags)
 
bool pb_decode (pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct)
 
void pb_release (const pb_msgdesc_t *fields, void *dest_struct)
 
bool pb_decode_bool (pb_istream_t *stream, bool *dest)
 
bool pb_decode_svarint (pb_istream_t *stream, int64_t *dest)
 
bool pb_decode_fixed32 (pb_istream_t *stream, void *dest)
 
bool pb_decode_fixed64 (pb_istream_t *stream, void *dest)
 

Macro Definition Documentation

◆ checkreturn

#define checkreturn

Definition at line 14 of file pb_decode.c.

◆ pb_int64_t

#define pb_int64_t   int64_t

Definition at line 57 of file pb_decode.c.

Referenced by pb_dec_varint(), and pb_decode_svarint().

◆ pb_uint64_t

#define pb_uint64_t   uint64_t

Definition at line 58 of file pb_decode.c.

Referenced by pb_dec_varint(), and pb_decode_svarint().

Function Documentation

◆ buf_read()

static bool buf_read ( pb_istream_t * stream,
pb_byte_t * buf,
size_t count )
static

Definition at line 69 of file pb_decode.c.

Referenced by pb_istream_from_buffer(), and pb_read().

+ Here is the call graph for this function:

◆ pb_decode_varint32_eof()

static bool pb_decode_varint32_eof ( pb_istream_t * stream,
uint32_t * dest,
bool * eof )
static

Definition at line 171 of file pb_decode.c.

Referenced by pb_decode_tag(), and pb_decode_varint32().

+ Here is the call graph for this function:

◆ read_raw_value()

static bool read_raw_value ( pb_istream_t * stream,
pb_wire_type_t wire_type,
pb_byte_t * buf,
size_t * size )
static

Definition at line 323 of file pb_decode.c.

Referenced by decode_callback_field().

+ Here is the call graph for this function:

◆ decode_basic_field()

static bool decode_basic_field ( pb_istream_t * stream,
pb_wire_type_t wire_type,
pb_field_iter_t * field )
static

Definition at line 396 of file pb_decode.c.

Referenced by decode_pointer_field(), and decode_static_field().

+ Here is the call graph for this function:

◆ decode_static_field()

static bool decode_static_field ( pb_istream_t * stream,
pb_wire_type_t wire_type,
pb_field_iter_t * field )
static

Definition at line 467 of file pb_decode.c.

Referenced by decode_field().

+ Here is the call graph for this function:

◆ decode_pointer_field()

static bool decode_pointer_field ( pb_istream_t * stream,
pb_wire_type_t wire_type,
pb_field_iter_t * field )
static

Definition at line 624 of file pb_decode.c.

Referenced by decode_field().

+ Here is the call graph for this function:

◆ decode_callback_field()

static bool decode_callback_field ( pb_istream_t * stream,
pb_wire_type_t wire_type,
pb_field_iter_t * field )
static

Definition at line 752 of file pb_decode.c.

Referenced by decode_field().

+ Here is the call graph for this function:

◆ decode_field()

static bool decode_field ( pb_istream_t * stream,
pb_wire_type_t wire_type,
pb_field_iter_t * field )
static

Definition at line 798 of file pb_decode.c.

Referenced by default_extension_decoder(), pb_decode_inner(), and pb_message_set_to_defaults().

+ Here is the call graph for this function:

◆ default_extension_decoder()

static bool default_extension_decoder ( pb_istream_t * stream,
pb_extension_t * extension,
uint32_t tag,
pb_wire_type_t wire_type )
static

Definition at line 829 of file pb_decode.c.

Referenced by decode_extension().

+ Here is the call graph for this function:

◆ decode_extension()

static bool decode_extension ( pb_istream_t * stream,
uint32_t tag,
pb_wire_type_t wire_type,
pb_extension_t * extension )
static

Definition at line 846 of file pb_decode.c.

Referenced by pb_decode_inner().

+ Here is the call graph for this function:

◆ pb_field_set_to_default()

static bool pb_field_set_to_default ( pb_field_iter_t * field)
static

Definition at line 869 of file pb_decode.c.

Referenced by pb_message_set_to_defaults().

+ Here is the call graph for this function:

◆ pb_message_set_to_defaults()

static bool pb_message_set_to_defaults ( pb_field_iter_t * iter)
static

Definition at line 951 of file pb_decode.c.

Referenced by decode_static_field(), pb_decode_inner(), and pb_field_set_to_default().

+ Here is the call graph for this function:

◆ pb_dec_bool()

static bool pb_dec_bool ( pb_istream_t * stream,
const pb_field_iter_t * field )
static

Definition at line 1420 of file pb_decode.c.

Referenced by decode_basic_field().

+ Here is the call graph for this function:

◆ pb_dec_varint()

static bool pb_dec_varint ( pb_istream_t * stream,
const pb_field_iter_t * field )
static

Definition at line 1425 of file pb_decode.c.

Referenced by decode_basic_field(), and main().

+ Here is the call graph for this function:

◆ pb_dec_bytes()

static bool pb_dec_bytes ( pb_istream_t * stream,
const pb_field_iter_t * field )
static

Definition at line 1497 of file pb_decode.c.

Referenced by decode_basic_field(), and main().

+ Here is the call graph for this function:

◆ pb_dec_string()

static bool pb_dec_string ( pb_istream_t * stream,
const pb_field_iter_t * field )
static

Definition at line 1537 of file pb_decode.c.

Referenced by decode_basic_field(), and main().

+ Here is the call graph for this function:

◆ pb_dec_submessage()

static bool pb_dec_submessage ( pb_istream_t * stream,
const pb_field_iter_t * field )
static

Definition at line 1587 of file pb_decode.c.

Referenced by decode_basic_field().

+ Here is the call graph for this function:

◆ pb_dec_fixed_length_bytes()

static bool pb_dec_fixed_length_bytes ( pb_istream_t * stream,
const pb_field_iter_t * field )
static

Definition at line 1639 of file pb_decode.c.

Referenced by decode_basic_field().

+ Here is the call graph for this function:

◆ pb_skip_varint()

bool pb_skip_varint ( pb_istream_t * stream)
static

Definition at line 266 of file pb_decode.c.

Referenced by main(), and pb_skip_field().

+ Here is the call graph for this function:

◆ pb_skip_string()

bool pb_skip_string ( pb_istream_t * stream)
static

Definition at line 277 of file pb_decode.c.

Referenced by main(), and pb_skip_field().

+ Here is the call graph for this function:

◆ pb_read()

◆ pb_readbyte()

static bool pb_readbyte ( pb_istream_t * stream,
pb_byte_t * buf )
static

Definition at line 125 of file pb_decode.c.

Referenced by pb_decode_varint(), and pb_decode_varint32_eof().

◆ pb_istream_from_buffer()

pb_istream_t pb_istream_from_buffer ( const pb_byte_t * buf,
size_t msglen )

◆ pb_decode_varint32()

bool pb_decode_varint32 ( pb_istream_t * stream,
uint32_t * dest )

Definition at line 237 of file pb_decode.c.

Referenced by main(), pb_dec_bytes(), pb_dec_fixed_length_bytes(), pb_dec_string(), pb_decode_bool(), pb_make_string_substream(), pb_skip_string(), and read_array().

+ Here is the call graph for this function:

◆ pb_decode_varint()

bool pb_decode_varint ( pb_istream_t * stream,
uint64_t * dest )

Definition at line 243 of file pb_decode.c.

Referenced by main(), pb_dec_varint(), pb_decode_svarint(), print_int32(), raw_decode(), read_repeated_varint(), and read_varint().

+ Here is the call graph for this function:

◆ pb_decode_tag()

bool pb_decode_tag ( pb_istream_t * stream,
pb_wire_type_t * wire_type,
uint32_t * tag,
bool * eof )

Definition at line 291 of file pb_decode.c.

Referenced by decode_unionmessage_type(), pb_decode_inner(), pb_message_set_to_defaults(), and raw_decode().

+ Here is the call graph for this function:

◆ pb_skip_field()

bool pb_skip_field ( pb_istream_t * stream,
pb_wire_type_t wire_type )

Definition at line 308 of file pb_decode.c.

Referenced by decode_callback_field(), decode_unionmessage_type(), and pb_decode_inner().

+ Here is the call graph for this function:

◆ pb_make_string_substream()

bool pb_make_string_substream ( pb_istream_t * stream,
pb_istream_t * substream )

Definition at line 362 of file pb_decode.c.

Referenced by decode_callback_field(), decode_pointer_field(), decode_static_field(), decode_unionmessage_contents(), pb_dec_submessage(), pb_decode_ex(), and raw_decode().

+ Here is the call graph for this function:

◆ pb_close_string_substream()

bool pb_close_string_substream ( pb_istream_t * stream,
pb_istream_t * substream )

Definition at line 377 of file pb_decode.c.

Referenced by decode_callback_field(), decode_pointer_field(), decode_static_field(), decode_unionmessage_contents(), pb_dec_submessage(), pb_decode_ex(), and raw_decode().

+ Here is the call graph for this function:

◆ pb_decode_inner()

static bool pb_decode_inner ( pb_istream_t * stream,
const pb_msgdesc_t * fields,
void * dest_struct,
unsigned int flags )
static

Definition at line 990 of file pb_decode.c.

Referenced by pb_dec_submessage(), pb_decode(), and pb_decode_ex().

+ Here is the call graph for this function:

◆ pb_decode_ex()

bool pb_decode_ex ( pb_istream_t * stream,
const pb_msgdesc_t * fields,
void * dest_struct,
unsigned int flags )

Definition at line 1154 of file pb_decode.c.

Referenced by do_decode(), and main().

+ Here is the call graph for this function:

◆ pb_decode()

◆ pb_release()

◆ pb_decode_bool()

bool pb_decode_bool ( pb_istream_t * stream,
bool * dest )

Definition at line 1346 of file pb_decode.c.

Referenced by pb_dec_bool().

+ Here is the call graph for this function:

◆ pb_decode_svarint()

bool pb_decode_svarint ( pb_istream_t * stream,
int64_t * dest )

Definition at line 1356 of file pb_decode.c.

Referenced by pb_dec_varint(), read_repeated_svarint(), and read_svarint().

+ Here is the call graph for this function:

◆ pb_decode_fixed32()

bool pb_decode_fixed32 ( pb_istream_t * stream,
void * dest )

Definition at line 1370 of file pb_decode.c.

Referenced by decode_basic_field(), main(), print_fixed32(), raw_decode(), read_fixed32(), and read_repeated_fixed32().

+ Here is the call graph for this function:

◆ pb_decode_fixed64()

bool pb_decode_fixed64 ( pb_istream_t * stream,
void * dest )

Definition at line 1393 of file pb_decode.c.

Referenced by decode_basic_field(), main(), print_fixed64(), raw_decode(), read_double(), read_fixed64(), read_repeated_double(), and read_repeated_fixed64().

+ Here is the call graph for this function: