summaryrefslogtreecommitdiff
path: root/upb/msg.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2018-12-10 10:18:48 -0800
committerJoshua Haberman <jhaberman@gmail.com>2018-12-10 10:18:48 -0800
commit336402b4d7251d37239d2f7ff8259174525baa38 (patch)
treec3ed0af3e6bbd58b35fc370794c5d7732aea5bab /upb/msg.h
parentbfa3c015bb8de950d0e6b0076be89df4bc37fba7 (diff)
WIP, core library compiles now.
Diffstat (limited to 'upb/msg.h')
-rw-r--r--upb/msg.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/upb/msg.h b/upb/msg.h
index 3f0aa0b..f707795 100644
--- a/upb/msg.h
+++ b/upb/msg.h
@@ -22,6 +22,7 @@
#define UPB_MSG_H_
#include <stdint.h>
+#include <string.h>
#include "upb/upb.h"
#ifdef __cplusplus
@@ -86,6 +87,14 @@ UPB_INLINE upb_stringview upb_stringview_make(const char *data, size_t size) {
return ret;
}
+UPB_INLINE upb_stringview upb_stringview_makez(const char *data) {
+ return upb_stringview_make(data, strlen(data));
+}
+
+UPB_INLINE bool upb_stringview_eql(upb_stringview a, upb_stringview b) {
+ return a.size == b.size && memcmp(a.data, b.data, a.size) == 0;
+}
+
#define UPB_STRINGVIEW_INIT(ptr, len) {ptr, len}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback