Tue, 02 Jan 2001 01:45:46 +0100
trunk: changeset 34
Added libtu_(v)asprintf functions.
include/libtu/output.h | file | annotate | diff | comparison | revisions | |
output.c | file | annotate | diff | comparison | revisions |
--- 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 */
--- 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 */