summaryrefslogtreecommitdiff
path: root/include/apr_strings.h
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2001-07-25 21:32:45 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2001-07-25 21:32:45 +0000
commit21a801c3253aa22655479acea6af52eb890ab9bf (patch)
treef9430fdcf2be24ab5fe302147c75ece2de13bd96 /include/apr_strings.h
parent5e3964baaf2f377aaebc8377d809677a58ae3628 (diff)
downloadapr-21a801c3253aa22655479acea6af52eb890ab9bf.tar.gz
Replace the very limited-use ap_send_size with apr_strfsize(), which
works within a fixed buffer. I'm open to using the old ap_send_size() text formatting, but this result is one character shorter in size and equally readable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62023 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_strings.h')
-rw-r--r--include/apr_strings.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/apr_strings.h b/include/apr_strings.h
index c313c71f2..11969a7ec 100644
--- a/include/apr_strings.h
+++ b/include/apr_strings.h
@@ -307,6 +307,17 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n);
*/
APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n);
+/**
+ * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t,
+ * as bytes, K, M, T, etc, to a four character compacted human readable string.
+ * @param size The size to format
+ * @param buf The 5 byte text buffer (counting the trailing null)
+ * @return The buf passed to apr_strfsize()
+ * @deffunc char *apr_strfsize(apr_off_t size, char *buf)
+ * @tip All negative sizes report ' - ', apr_strfsize only formats positive values.
+ */
+APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf);
+
#ifdef __cplusplus
}
#endif