# HG changeset patch # User tuomov # Date 978396346 -3600 # Node ID e9cad8bd8ec810647baf222b28b6f93ac0898e9b # Parent f7c7b419577e3205ba3fbfdf354c182544a406bd trunk: changeset 34 Added libtu_(v)asprintf functions. diff -r f7c7b419577e -r e9cad8bd8ec8 include/libtu/output.h --- a/include/libtu/output.h Thu Dec 28 14:40:02 2000 +0100 +++ b/include/libtu/output.h Tue Jan 02 01:45:46 2001 +0100 @@ -58,4 +58,7 @@ extern char *errmsg_err_obj(const char *obj); extern char *errmsg_err_obj_line(const char *obj, int line); +extern void libtu_asprintf(char **ret, const char *fmt, ...); +extern void libtu_vasprintf(char **ret, const char *fmt, va_list args); + #endif /* LIBTU_OUTPUT_H */ diff -r f7c7b419577e -r e9cad8bd8ec8 output.c --- a/output.c Thu Dec 28 14:40:02 2000 +0100 +++ b/output.c Tue Jan 02 01:45:46 2001 +0100 @@ -103,6 +103,18 @@ va_list args; va_start(args, p); NAME ARGS; va_end(args); +void libtu_asprintf(char **ret, const char *p, ...) +{ + CALL_V(vasprintf, (ret, p, args)); +} + + +void libtu_vasprintf(char **ret, const char *p, va_list args) +{ + vasprintf(ret, p, args); +} + + void warn(const char *p, ...) { CALL_V(warn_v, (p, args)); @@ -286,6 +298,7 @@ } return res; } + #endif /* LIBTU_NO_ERRMSG */