From 6a1f3a66939308668ab8dce0d195afec16e02af9 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 14 Jul 2011 23:15:00 -0700 Subject: Major refactoring: upb_string is gone in favor of upb_strref. --- src/upb_glue.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/upb_glue.h') diff --git a/src/upb_glue.h b/src/upb_glue.h index 27611cd..0448c2f 100644 --- a/src/upb_glue.h +++ b/src/upb_glue.h @@ -27,6 +27,7 @@ #define UPB_GLUE_H #include +#include "upb.h" #ifdef __cplusplus extern "C" { @@ -36,20 +37,23 @@ extern "C" { // Clients should use the regular, typedef'd names (eg. upb_string). struct _upb_msg; struct _upb_msgdef; -struct _upb_status; -struct _upb_string; struct _upb_symtab; // Decodes the given string, which must be in protobuf binary format, to the // given upb_msg with msgdef "md", storing the status of the operation in "s". -void upb_strtomsg(struct _upb_string *str, void *msg, - struct _upb_msgdef *md, struct _upb_status *s); +void upb_strtomsg(const char *str, size_t len, void *msg, + struct _upb_msgdef *md, upb_status *s); -void upb_msgtotext(struct _upb_string *str, void *msg, - struct _upb_msgdef *md, bool single_line); +//void upb_msgtotext(struct _upb_string *str, void *msg, +// struct _upb_msgdef *md, bool single_line); -void upb_read_descriptor(struct _upb_symtab *symtab, struct _upb_string *str, - struct _upb_status *status); +void upb_read_descriptor(struct _upb_symtab *symtab, const char *str, size_t len, + upb_status *status); + +void upb_read_descriptorfile(struct _upb_symtab *symtab, const char *fname, + upb_status *status); + +char *upb_readfile(const char *filename, size_t *len); #ifdef __cplusplus } /* extern "C" */ -- cgit v1.2.3