From 992a03be55faf83d794b9ec5e8c4ca7e78c08a9b Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 9 Jun 2010 15:55:02 -0700 Subject: More decoder work, first attempts at compiling it. --- src/upb_srcsink.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/upb_srcsink.h') diff --git a/src/upb_srcsink.h b/src/upb_srcsink.h index 3a57cc8..4a3d1e3 100644 --- a/src/upb_srcsink.h +++ b/src/upb_srcsink.h @@ -28,6 +28,9 @@ extern "C" { // TODO: decide how to handle unknown fields. +struct upb_src; +typedef struct upb_src upb_src; + // Retrieves the fielddef for the next field in the stream. Returns NULL on // error or end-of-stream. upb_fielddef *upb_src_getdef(upb_src *src); @@ -53,6 +56,9 @@ upb_status *upb_src_status(upb_src *src); /* upb_sink *******************************************************************/ +struct upb_sink; +typedef struct upb_sink upb_sink; + // Puts the given fielddef into the stream. bool upb_sink_putdef(upb_sink *sink, upb_fielddef *def); @@ -70,6 +76,9 @@ upb_status *upb_sink_status(upb_sink *sink); /* upb_bytesrc ****************************************************************/ +struct upb_bytesrc; +typedef struct upb_bytesrc upb_bytesrc; + // Returns the next string in the stream. NULL is returned on error or eof. // The string must be at least "minlen" bytes long unless the stream is eof. // @@ -89,6 +98,9 @@ upb_status *upb_bytesrc_status(upb_src *src); /* upb_bytesink ***************************************************************/ +struct upb_bytesink; +typedef struct upb_bytesink upb_bytesink; + // Puts the given string. Returns the number of bytes that were actually, // consumed, which may be fewer than were in the string, or <0 on error. int32_t upb_bytesink_put(upb_bytesink *sink, upb_string *str); @@ -137,14 +149,14 @@ typedef struct { // "Base Class" definitions; components that implement these interfaces should // contain one of these structures. -typedef struct { +struct upb_src { upb_src_vtable *vtbl; upb_status status; bool eof; #ifndef NDEBUG int state; // For debug-mode checking of API usage. #endif -} upb_src; +}; INLINE void upb_sink_init(upb_src *s, upb_src_vtable *vtbl) { s->vtbl = vtbl; -- cgit v1.2.3