summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-01-23 18:59:31 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-01-23 18:59:31 -0800
commitfe659c8c93c464fcbcfb5739935a2e4341d01fd4 (patch)
tree5d372942884fcb00da8f29ee9a446f264f15ea3c /core
parent58a70b55c62cfefcbe7a55a2fd41ee6b87c7256f (diff)
Getting closer to a decoder that could actually compile and work.
Diffstat (limited to 'core')
-rw-r--r--core/upb_stream.h7
-rw-r--r--core/upb_string.h6
2 files changed, 11 insertions, 2 deletions
diff --git a/core/upb_stream.h b/core/upb_stream.h
index 54fd930..bf312a8 100644
--- a/core/upb_stream.h
+++ b/core/upb_stream.h
@@ -40,8 +40,11 @@ typedef enum {
UPB_CONTINUE,
// Stop processing for now; check status for details. If no status was set,
- // a generic error will be returned. If the error is resumable, processing
- // will resume by delivering this callback again.
+ // a generic error will be returned. If the error is resumable, it is not
+ // (yet) defined where processing will resume -- waiting for real-world
+ // examples of resumable decoders and resume-requiring clients. upb_src
+ // implementations that are not capable of resuming will override the return
+ // status to be non-resumable if a resumable status was set by the handlers.
UPB_BREAK,
// Skips to the end of the current submessage (or if we are at the top
diff --git a/core/upb_string.h b/core/upb_string.h
index 04c0ae9..1a7e06b 100644
--- a/core/upb_string.h
+++ b/core/upb_string.h
@@ -134,6 +134,12 @@ INLINE upb_strlen_t upb_string_len(upb_string *str) { return str->len; }
INLINE const char *upb_string_getrobuf(upb_string *str) { return str->ptr; }
INLINE void upb_string_endread(upb_string *str) { (void)str; }
+// Convenience method for getting the end of the string. Calls
+// upb_string_getrobuf() so inherits the caveats of calling that function.
+INLINE const char *upb_string_getbufend(upb_string *str) {
+ return upb_string_getrobuf(str) + upb_string_len(str);
+}
+
// Attempts to recycle the string "str" so it may be reused and have different
// data written to it. After the function returns, "str" points to a writable
// string, which is either the original string if it had no other references
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback