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

Go to the source code of this file.

Classes

struct  pb_ostream_t
 

Macros

#define PB_ENCODE_DELIMITED   0x02U
 
#define PB_ENCODE_NULLTERMINATED   0x04U
 
#define pb_encode_delimited(s, f, d)
 
#define pb_encode_nullterminated(s, f, d)
 
#define PB_OSTREAM_SIZING   {0,0,0,0,0}
 

Functions

bool pb_encode (pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct)
 
bool pb_encode_ex (pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct, unsigned int flags)
 
bool pb_get_encoded_size (size_t *size, const pb_msgdesc_t *fields, const void *src_struct)
 
pb_ostream_t pb_ostream_from_buffer (pb_byte_t *buf, size_t bufsize)
 
bool pb_write (pb_ostream_t *stream, const pb_byte_t *buf, size_t count)
 
bool pb_encode_tag_for_field (pb_ostream_t *stream, const pb_field_iter_t *field)
 
bool pb_encode_tag (pb_ostream_t *stream, pb_wire_type_t wiretype, uint32_t field_number)
 
bool pb_encode_varint (pb_ostream_t *stream, uint64_t value)
 
bool pb_encode_svarint (pb_ostream_t *stream, int64_t value)
 
bool pb_encode_string (pb_ostream_t *stream, const pb_byte_t *buffer, size_t size)
 
bool pb_encode_fixed32 (pb_ostream_t *stream, const void *value)
 
bool pb_encode_fixed64 (pb_ostream_t *stream, const void *value)
 
bool pb_encode_submessage (pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct)
 

Macro Definition Documentation

◆ PB_ENCODE_DELIMITED

#define PB_ENCODE_DELIMITED   0x02U

Definition at line 81 of file pb_encode.h.

◆ PB_ENCODE_NULLTERMINATED

#define PB_ENCODE_NULLTERMINATED   0x04U

Definition at line 82 of file pb_encode.h.

◆ pb_encode_delimited

#define pb_encode_delimited ( s,
f,
d )
Value:
bool pb_encode_ex(pb_ostream_t *stream, const pb_msgdesc_t *fields, const void *src_struct, unsigned int flags)
Definition pb_encode.c:536
#define PB_ENCODE_DELIMITED
Definition pb_encode.h:81

Definition at line 86 of file pb_encode.h.

◆ pb_encode_nullterminated

#define pb_encode_nullterminated ( s,
f,
d )
Value:
#define PB_ENCODE_NULLTERMINATED
Definition pb_encode.h:82

Definition at line 87 of file pb_encode.h.

◆ PB_OSTREAM_SIZING

#define PB_OSTREAM_SIZING   {0,0,0,0,0}

Definition at line 116 of file pb_encode.h.

Function Documentation

◆ pb_encode()

bool pb_encode ( pb_ostream_t * stream,
const pb_msgdesc_t * fields,
const void * src_struct )

◆ pb_encode_ex()

bool pb_encode_ex ( pb_ostream_t * stream,
const pb_msgdesc_t * fields,
const void * src_struct,
unsigned int flags )

Definition at line 536 of file pb_encode.c.

+ Here is the call graph for this function:

◆ pb_get_encoded_size()

bool pb_get_encoded_size ( size_t * size,
const pb_msgdesc_t * fields,
const void * src_struct )

Definition at line 557 of file pb_encode.c.

Referenced by main(), rpc_do_pb_call(), and rpc_write_result_pb().

+ Here is the call graph for this function:

◆ pb_ostream_from_buffer()

pb_ostream_t pb_ostream_from_buffer ( pb_byte_t * buf,
size_t bufsize )

◆ pb_write()

bool pb_write ( pb_ostream_t * stream,
const pb_byte_t * buf,
size_t count )

◆ pb_encode_tag_for_field()

◆ pb_encode_tag()

bool pb_encode_tag ( pb_ostream_t * stream,
pb_wire_type_t wiretype,
uint32_t field_number )

◆ pb_encode_varint()

◆ pb_encode_svarint()

bool pb_encode_svarint ( pb_ostream_t * stream,
int64_t value )

Definition at line 625 of file pb_encode.c.

Referenced by main(), pb_enc_varint(), write_repeated_svarint(), and write_svarint().

+ Here is the call graph for this function:

◆ pb_encode_string()

bool pb_encode_string ( pb_ostream_t * stream,
const pb_byte_t * buffer,
size_t size )

◆ pb_encode_fixed32()

bool pb_encode_fixed32 ( pb_ostream_t * stream,
const void * value )

Definition at line 637 of file pb_encode.c.

Referenced by encode_fixed32(), pb_enc_fixed(), rand_fill_protobuf(), write_farray2(), write_fixed32(), and write_repeated_fixed32().

+ Here is the call graph for this function:

◆ pb_encode_fixed64()

bool pb_encode_fixed64 ( pb_ostream_t * stream,
const void * value )

Definition at line 654 of file pb_encode.c.

Referenced by encode_fixed64(), pb_enc_fixed(), rand_fill_protobuf(), write_double(), write_fixed64(), write_repeated_double(), and write_repeated_fixed64().

+ Here is the call graph for this function:

◆ pb_encode_submessage()

bool pb_encode_submessage ( pb_ostream_t * stream,
const pb_msgdesc_t * fields,
const void * src_struct )