From 229fcf7119b06385eb6440e54916f871b8bbc323 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 27 Jun 2010 13:19:25 -0700 Subject: upb_def compiles again, though with lots of #if 0. --- src/upb_string.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/upb_string.h') 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 counterparts, these are all safe against buffer -- cgit v1.2.3