summaryrefslogtreecommitdiff
path: root/upb/bytestream.h
diff options
context:
space:
mode:
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