summaryrefslogtreecommitdiff
path: root/upb/bytestream.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-09-12 16:41:04 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-09-12 16:41:04 -0700
commitbda3269a42877ae0a0b2b44b579cba5b13d5b1de (patch)
tree60bc46bda5615b93f59cf129bd3089f38be4ba3d /upb/bytestream.h
parent7175edb10a51e5931efd14cdb8cf62ce3463c85e (diff)
Fleshed out fielddef default functionality.
Fixes unit test submitted by Hunter Morris (thanks!).
Diffstat (limited to 'upb/bytestream.h')
-rw-r--r--upb/bytestream.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/upb/bytestream.h b/upb/bytestream.h
index 96d840c..6ec1ba6 100644
--- a/upb/bytestream.h
+++ b/upb/bytestream.h
@@ -160,6 +160,14 @@ INLINE void upb_strref_read(const struct _upb_strref *r, char *buf) {
}
}
+// Dynamically allocates a upb_strref object whose contents are the given
+// string. The given string data is copied into the strref, which makes these
+// functions unsuitable for tight loops (in those cases a strref should be made
+// to point to existing string data).
+upb_strref *upb_strref_new(const char *str);
+upb_strref *upb_strref_newl(const void *str, size_t len);
+void upb_strref_free(upb_strref *ref);
+
/* upb_bytesink ***************************************************************/
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback