summaryrefslogtreecommitdiff
path: root/src/upb_string.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-06-27 13:19:25 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-06-27 13:19:25 -0700
commit229fcf7119b06385eb6440e54916f871b8bbc323 (patch)
tree73f81c4516bb242ea841158a92c2dd65251394e5 /src/upb_string.h
parent6bf58a7328fb5241e2f66ef39c60e4483acfb19d (diff)
upb_def compiles again, though with lots of #if 0.
Diffstat (limited to 'src/upb_string.h')
-rw-r--r--src/upb_string.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/upb_string.h b/src/upb_string.h
index 7b9f8db..5e5d6bc 100644
--- a/src/upb_string.h
+++ b/src/upb_string.h
@@ -98,6 +98,12 @@ void upb_string_substr(upb_string *str, upb_string *target_str,
void upb_string_attach(upb_string *str, char *ptr, upb_strlen_t len);
void upb_string_detach(upb_string *str);
+// Allows using upb_strings in printf, ie:
+// upb_strptr str = UPB_STRLIT("Hello, World!\n");
+// printf("String is: " UPB_STRFMT, UPB_STRARG(str)); */
+#define UPB_STRARG(str) upb_strlen(str), upb_string_getrobuf(str)
+#define UPB_STRFMT "%.*s"
+
/* upb_string library functions ***********************************************/
// Named like their <string.h> counterparts, these are all safe against buffer
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback