protobuf-c-text
Library to generate & parse text format protobufs in C.
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups
protobuf-c-text.h
1 #ifndef PROTOBUF_C_TEXT_H
2 #define PROTOBUF_C_TEXT_H
3 
4 /*
5  * \file
6  * Library header file.
7  * This is the header file for the text format protobuf routines.
8  * It contains declarations of all functions and data types exported by
9  * the library.
10  *
11  * \author Kevin Lyda <kevin@ie.suberic.net>
12  * \date March 2014
13  *
14  */
15 
103 #include <stdio.h> /* for the FILE * data type. */
104 #include <protobuf-c/protobuf-c.h>
105 
122 typedef struct _ProtobufCTextError {
123  int *error;
124  char *error_txt;
125  int complete;
132 
152 extern char *protobuf_c_text_to_string(ProtobufCMessage *m,
153  ProtobufCAllocator *allocator);
154 
177 extern ProtobufCMessage *protobuf_c_text_from_string(
178  const ProtobufCMessageDescriptor *descriptor,
179  char *msg,
180  ProtobufCTextError *result,
181  ProtobufCAllocator *allocator);
182 
205 extern ProtobufCMessage *protobuf_c_text_from_file(
206  const ProtobufCMessageDescriptor *descriptor,
207  FILE *msg_file,
208  ProtobufCTextError *result,
209  ProtobufCAllocator *allocator);
210  /* End of API group. */
212 
213 #endif /* PROTOBUF_C_TEXT_H */
char * protobuf_c_text_to_string(ProtobufCMessage *m, ProtobufCAllocator *allocator)
Convert a ProtobufCMessage to a string.
Definition: generate.c:498
int complete
Reports whether the message is complete (if supported):
Structure for reporting API errors.
int * error
Error code.
ProtobufCMessage * protobuf_c_text_from_string(const ProtobufCMessageDescriptor *descriptor, char *msg, ProtobufCTextError *result, ProtobufCAllocator *allocator)
Import a text format protobuf from a string into a ProtobufCMessage.
Definition: parse.re:1245
char * error_txt
String with error message.
ProtobufCMessage * protobuf_c_text_from_file(const ProtobufCMessageDescriptor *descriptor, FILE *msg_file, ProtobufCTextError *result, ProtobufCAllocator *allocator)
Import a text format protobuf from a FILE into a ProtobufCMessage.
Definition: parse.re:1233