From 15dfbbe9f70bfa602d61eae6cd54ace412c452de Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 1 Jun 2007 15:17:30 +0000 Subject: [PATCH] add switch_file_printf to the api git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5239 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_apr.h | 1 + src/switch_apr.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/include/switch_apr.h b/src/include/switch_apr.h index b82929affc..0e020812bb 100644 --- a/src/include/switch_apr.h +++ b/src/include/switch_apr.h @@ -732,6 +732,7 @@ SWITCH_DECLARE(switch_status_t) switch_file_read(switch_file_t * thefile, void * * be returned. APR_EINTR is never returned. */ SWITCH_DECLARE(switch_status_t) switch_file_write(switch_file_t * thefile, const void *buf, switch_size_t *nbytes); +SWITCH_DECLARE(int) switch_file_printf(switch_file_t *thefile, const char *format, ...); SWITCH_DECLARE(switch_status_t) switch_file_mktemp(switch_file_t **thefile, char *templ, int32_t flags, switch_memory_pool_t *pool); diff --git a/src/switch_apr.c b/src/switch_apr.c index 19962375dd..864ccccda3 100644 --- a/src/switch_apr.c +++ b/src/switch_apr.c @@ -335,6 +335,15 @@ SWITCH_DECLARE(switch_status_t) switch_file_write(switch_file_t * thefile, const return apr_file_write(thefile, buf, nbytes); } +SWITCH_DECLARE(int) switch_file_printf(switch_file_t *thefile, const char *format, ...) +{ + va_list ap; + int ret; + ret = apr_file_printf(thefile, format, ap); + va_end(ap); + return ret; +} + SWITCH_DECLARE(switch_status_t) switch_file_mktemp(switch_file_t **thefile, char *templ, int32_t flags, switch_memory_pool_t *pool) { return apr_file_mktemp(thefile, templ, flags, pool);