Library to generate & parse text format protobufs in C.
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups
Data Structures | Functions
generate.c File Reference

Routines to generate text format protobufs. More...

Go to the source code of this file.

Data Structures

struct  ReturnString
 A dynamic string struct. More...


static void rs_append (ReturnString *rs, int guess, ProtobufCAllocator *allocator, const char *format,...) __attribute__((format(printf
 Append a string to the ReturnString. More...
static char * esc_str (char *src, int len, ProtobufCAllocator *allocator)
 Escape string. More...
static void protobuf_c_text_to_string_internal (ReturnString *rs, int level, ProtobufCMessage *m, const ProtobufCMessageDescriptor *d, ProtobufCAllocator *allocator)
 Internal function to back API function. More...
char * protobuf_c_text_to_string (ProtobufCMessage *m, ProtobufCAllocator *allocator)
 Convert a ProtobufCMessage to a string. More...

Detailed Description

Routines to generate text format protobufs.

This file contains the internal support functions as well as the exported functions which are used to generate text format protobufs from C protobuf data types.

Kevin Lyda
March 2014

Definition in file generate.c.

Function Documentation

static void static void rs_append ( ReturnString rs,
int  guess,
ProtobufCAllocator *  allocator,
const char *  format,

Append a string to the ReturnString.

Append the string built from format and its args to the rs string. Note that malloc_err is checked and if it's true, this function won't do anything.

[in,out]rsThe string to append to.
[in]guessA guess at the number of chars being added.
[in]allocatorallocator functions.
[in]formatPrintf-style format string.
[in]...Variable number of args for format.

Definition at line 52 of file generate.c.

References PBC_ALLOC, and PBC_FREE.

Referenced by protobuf_c_text_to_string_internal().

Here is the caller graph for this function: