diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-09-12 16:41:04 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-09-12 16:41:04 -0700 |
commit | bda3269a42877ae0a0b2b44b579cba5b13d5b1de (patch) | |
tree | 60bc46bda5615b93f59cf129bd3089f38be4ba3d /upb/bytestream.h | |
parent | 7175edb10a51e5931efd14cdb8cf62ce3463c85e (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.h | 8 |
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 ***************************************************************/ |