git-svn-id: https://protobuf-c.googlecode.com/svn/trunk@249 00440858-1255-0410-a3e6-75ea37f81c3a

This commit is contained in:
lahiker42 2010-09-03 21:21:08 +00:00
parent 6c49e55c61
commit e9cfa2dd98

View File

@ -2,7 +2,9 @@
typedef struct _ProtobufC_ParseResult ProtobufC_ParseResult;
struct _ProtobufC_ParseResult
{
...
const char *message;
const char *filename;
unsigned line_no;
};
struct _ProtobufC_ParserPackage
@ -10,6 +12,8 @@ struct _ProtobufC_ParserPackage
char *name;
unsigned n_messages;
ProtobufCMessageDescriptor *message_descriptors;
unsigned n_enums;
ProtobufCEnumDescriptor *enum_descriptors;
};
ProtobufC_Parser *protobuf_c_parser_new (void);
@ -31,3 +35,22 @@ ProtobufC_ParserPackage *
const char *package_name,
ProtobufC_ParseResult *error);
void protobuf_c_parser_free (ProtobufC_Parser *parser);
typedef enum
{
PROTOBUF_C_CODEGEN_MODE_H,
PROTOBUF_C_CODEGEN_MODE_C
} ProtobufC_CodegenMode;
struct _ProtobufC_CodegenInfo
{
const char *package_name;
ProtobufC_CodegenMode mode;
const char *output_filename;
};
#define PROTOBUF_C_CODEGEN_INFO_INIT { NULL, PROTOBUF_C_CODEGEN_MODE_H, NULL }
protobuf_c_boolean protobuf_c_parser_codegen(ProtobufC_Parser *parser,
ProtobufC_CodegenInfo *codegen);