diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-06-27 13:19:25 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-06-27 13:19:25 -0700 |
commit | 229fcf7119b06385eb6440e54916f871b8bbc323 (patch) | |
tree | 73f81c4516bb242ea841158a92c2dd65251394e5 /src/upb_string.h | |
parent | 6bf58a7328fb5241e2f66ef39c60e4483acfb19d (diff) |
upb_def compiles again, though with lots of #if 0.
Diffstat (limited to 'src/upb_string.h')
-rw-r--r-- | src/upb_string.h | 6 |
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 |