]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
wrap some other bits for use in the near future.
authorMichael Jerris <mike@jerris.com>
Sat, 28 Apr 2007 19:00:57 +0000 (19:00 +0000)
committerMichael Jerris <mike@jerris.com>
Sat, 28 Apr 2007 19:00:57 +0000 (19:00 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5033 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_apr.h
src/switch_apr.c

index ccf995e495aa326d1d32034d4f0adb661bcfdb55..157b3c39e99d96a4fa89bda5264115e53e8fc82a 100644 (file)
@@ -733,6 +733,10 @@ SWITCH_DECLARE(switch_status_t) switch_file_read(switch_file_t * thefile, void *
  */
 SWITCH_DECLARE(switch_status_t) switch_file_write(switch_file_t * thefile, const void *buf, switch_size_t *nbytes);
 
+SWITCH_DECLARE(switch_status_t) switch_file_mktemp(switch_file_t **thefile, char *templ, int32_t flags, switch_memory_pool_t *pool);
+
+SWITCH_DECLARE(switch_size_t) switch_file_get_size(switch_file_t *thefile);
+
 SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename, switch_memory_pool_t *pool);
 
 /** @} */
index 076344bb3af393cb1ea7f5b5f6842d5bf07e0a17..81e75dc9689fef6419a3e2681015520d2cf13398 100644 (file)
@@ -335,6 +335,17 @@ SWITCH_DECLARE(switch_status_t) switch_file_write(switch_file_t * thefile, const
        return apr_file_write(thefile, buf, nbytes);
 }
 
+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);
+}
+
+SWITCH_DECLARE(switch_size_t) switch_file_get_size(switch_file_t *thefile)
+{
+       struct apr_finfo_t finfo;
+       return apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile) == SWITCH_STATUS_SUCCESS ? (switch_size_t)finfo.size : 0;
+}
+
 SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename, switch_memory_pool_t *pool)
 {
        int32_t wanted = APR_FINFO_TYPE;