summaryrefslogtreecommitdiff
path: root/include/apr_strings.h
diff options
context:
space:
mode:
authorBen Laurie <ben@apache.org>2001-02-11 16:18:09 +0000
committerBen Laurie <ben@apache.org>2001-02-11 16:18:09 +0000
commit49e8a536e5f5af9c0f2f2d02656c26374c3ba04f (patch)
tree58299d1aa745186550c78ff2e04e83e9805e08e0 /include/apr_strings.h
parenta2aab3b34f29db185103f409097b9e058feb071e (diff)
downloadapr-49e8a536e5f5af9c0f2f2d02656c26374c3ba04f.tar.gz
Add memdup function.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61214 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_strings.h')
-rw-r--r--include/apr_strings.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/apr_strings.h b/include/apr_strings.h
index c7aa5bbd4..e2be2078f 100644
--- a/include/apr_strings.h
+++ b/include/apr_strings.h
@@ -120,7 +120,7 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b);
/**
* duplicate a string into memory allocated out of a pool
* @param p The pool to allocate out of
- * @param s The string to allocate
+ * @param s The string to duplicate
* @return The new string
* @deffunc char *apr_pstrdup(apr_pool_t *p, const char *s)
*/
@@ -130,7 +130,7 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
* duplicate the first n characters of a string into memory allocated
* out of a pool; the new string will be '\0'-terminated
* @param p The pool to allocate out of
- * @param s The string to allocate
+ * @param s The string to duplicate
* @param n The number of characters to duplicate
* @return The new string
* @deffunc char *apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n)
@@ -138,6 +138,16 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n);
/**
+ * Duplicate a block of memory.
+ *
+ * @param p The pool to allocate from
+ * @param m The memory to duplicate
+ * @param n The number of bytes to duplicate
+ * @return The new block of memory
+ */
+APR_DECLARE(void *) apr_memdup(apr_pool_t *p, const void *m, apr_size_t n);
+
+/**
* Concatenate multiple strings, allocating memory out a pool
* @param p The pool to allocate out of
* @param ... The strings to concatenate. The final string must be NULL