diff options
Diffstat (limited to 'pjsip/include/pjsip/print_util.h')
-rw-r--r-- | pjsip/include/pjsip/print_util.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/print_util.h b/pjsip/include/pjsip/print_util.h index d2ee3aea..f8f9eb01 100644 --- a/pjsip/include/pjsip/print_util.h +++ b/pjsip/include/pjsip/print_util.h @@ -105,6 +105,10 @@ #define copy_advance copy_advance_check #define copy_advance_pair copy_advance_pair_check +/* + * Append str1 and quoted str2 and copy to buf. + * No string is copied if str2 is empty. + */ #define copy_advance_pair_quote_cond(buf,str1,len1,str2,quotebegin,quoteend) \ do { \ if (str2.slen && *str2.ptr!=quotebegin) \ @@ -114,6 +118,19 @@ } while (0) /* + * Append str1 and quoted str2 and copy to buf. + * In case str2 is empty, str1 will be appended with empty quote. + */ +#define copy_advance_pair_quote_cond_always(buf,str1,len1,str2,quotebegin, \ + quoteend)\ + do { \ + if (!str2.slen) \ + copy_advance_pair_quote(buf,str1,len1,str2,quotebegin,quoteend); \ + else \ + copy_advance_pair_quote_cond(buf,str1,len1,str2,quotebegin,quoteend);\ + } while (0) + +/* * Internal type declarations. */ typedef void* (*pjsip_hdr_clone_fptr)(pj_pool_t *, const void*); |