diff options
Diffstat (limited to 'dpip/dpip.h')
-rw-r--r-- | dpip/dpip.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/dpip/dpip.h b/dpip/dpip.h index ddc66ed4..74ca9dd5 100644 --- a/dpip/dpip.h +++ b/dpip/dpip.h @@ -57,8 +57,8 @@ char *a_Dpip_build_cmd(const char *format, ...); * (dpip character escaping is removed here) * Return value: the attribute value, or NULL if not present or malformed. */ -char *a_Dpip_get_attr(char *tag, const char *attrname); -char *a_Dpip_get_attr_l(char *tag, size_t tagsize, const char *attrname); +char *a_Dpip_get_attr(const char *tag, const char *attrname); +char *a_Dpip_get_attr_l(const char *tag, size_t tagsize, const char *attrname); int a_Dpip_check_auth(const char *auth); @@ -72,6 +72,13 @@ char *a_Dpip_dsh_read_token(Dsh *dsh); void a_Dpip_dsh_close(Dsh *dsh); void a_Dpip_dsh_free(Dsh *dsh); +#define a_Dpip_dsh_printf(sh, flush, ...) \ + D_STMT_START { \ + Dstr *dstr = dStr_sized_new(128); \ + dStr_sprintf(dstr, __VA_ARGS__); \ + a_Dpip_dsh_write(sh, flush, dstr->str, dstr->len); \ + dStr_free(dstr, 1); \ + } D_STMT_END #ifdef __cplusplus } |