Author: ivan
Date: Sun Sep 1 16:11:55 2024
New Revision: 1920358
URL: http://svn.apache.org/viewvc?rev=1920358&view=rev
Log:
Follow-up to 1919996: Use APU_DECLARE instead of APR_DECLARE for apr_buffer_t
API.
Modified:
apr/apr-util/branches/1.7.x/buffer/apr_buffer.c
apr/apr-util/branches/1.7.x/include/apr_buffer.h
Modified: apr/apr-util/branches/1.7.x/buffer/apr_buffer.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/buffer/apr_buffer.c?rev=1920358&r1=1920357&r2=1920358&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/buffer/apr_buffer.c (original)
+++ apr/apr-util/branches/1.7.x/buffer/apr_buffer.c Sun Sep 1 16:11:55 2024
@@ -29,7 +29,7 @@
#define APR_BUFFER_MAX (APR_SIZE_MAX/2)
-APR_DECLARE(apr_status_t) apr_buffer_mem_set(apr_buffer_t *buf,
+APU_DECLARE(apr_status_t) apr_buffer_mem_set(apr_buffer_t *buf,
void *mem, apr_size_t len)
{
@@ -44,7 +44,7 @@ APR_DECLARE(apr_status_t) apr_buffer_mem
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_buffer_mem_create(apr_buffer_t **mb,
+APU_DECLARE(apr_status_t) apr_buffer_mem_create(apr_buffer_t **mb,
apr_pool_t *pool,
void *mem, apr_size_t len)
{
@@ -71,7 +71,7 @@ APR_DECLARE(apr_status_t) apr_buffer_mem
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_buffer_str_set(apr_buffer_t *buf,
+APU_DECLARE(apr_status_t) apr_buffer_str_set(apr_buffer_t *buf,
char *str, apr_ssize_t len)
{
@@ -103,7 +103,7 @@ APR_DECLARE(apr_status_t) apr_buffer_str
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_buffer_str_create(apr_buffer_t **sb,
+APU_DECLARE(apr_status_t) apr_buffer_str_create(apr_buffer_t **sb,
apr_pool_t *pool,
char *str, apr_ssize_t len)
{
@@ -150,7 +150,7 @@ APR_DECLARE(apr_status_t) apr_buffer_str
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_buffer_null_create(apr_buffer_t **nb,
+APU_DECLARE(apr_status_t) apr_buffer_null_create(apr_buffer_t **nb,
apr_pool_t *pool)
{
apr_buffer_t *buf;
@@ -166,17 +166,17 @@ APR_DECLARE(apr_status_t) apr_buffer_nul
return APR_SUCCESS;
}
-APR_DECLARE(apr_size_t) apr_buffer_len(const apr_buffer_t *buf)
+APU_DECLARE(apr_size_t) apr_buffer_len(const apr_buffer_t *buf)
{
return buf->size;
}
-APR_DECLARE(apr_size_t) apr_buffer_allocated(const apr_buffer_t *buf)
+APU_DECLARE(apr_size_t) apr_buffer_allocated(const apr_buffer_t *buf)
{
return buf->size + buf->zero_terminated;
}
-APR_DECLARE(int) apr_buffer_is_null(const apr_buffer_t *buf)
+APU_DECLARE(int) apr_buffer_is_null(const apr_buffer_t *buf)
{
if (!buf->d.mem) {
return 1;
@@ -186,12 +186,12 @@ APR_DECLARE(int) apr_buffer_is_null(cons
}
}
-APR_DECLARE(int) apr_buffer_is_str(const apr_buffer_t *buf)
+APU_DECLARE(int) apr_buffer_is_str(const apr_buffer_t *buf)
{
return buf->zero_terminated;
}
-APR_DECLARE(char *) apr_buffer_str(const apr_buffer_t *buf)
+APU_DECLARE(char *) apr_buffer_str(const apr_buffer_t *buf)
{
if (buf->zero_terminated) {
return buf->d.str;
@@ -201,12 +201,12 @@ APR_DECLARE(char *) apr_buffer_str(const
}
}
-APR_DECLARE(char *) apr_buffer_pstrdup(apr_pool_t *pool, const apr_buffer_t *buf)
+APU_DECLARE(char *) apr_buffer_pstrdup(apr_pool_t *pool, const apr_buffer_t *buf)
{
return apr_pstrmemdup(pool, buf->d.str, buf->size);
}
-APR_DECLARE(void *) apr_buffer_mem(const apr_buffer_t *buf, apr_size_t *size)
+APU_DECLARE(void *) apr_buffer_mem(const apr_buffer_t *buf, apr_size_t *size)
{
if (size) {
size[0] = apr_buffer_len(buf);
@@ -215,7 +215,7 @@ APR_DECLARE(void *) apr_buffer_mem(const
return buf->d.mem;
}
-APR_DECLARE(void *) apr_buffer_pmemdup(apr_pool_t *pool, const apr_buffer_t *buf, apr_size_t *size)
+APU_DECLARE(void *) apr_buffer_pmemdup(apr_pool_t *pool, const apr_buffer_t *buf, apr_size_t *size)
{
apr_size_t len = apr_buffer_len(buf);
@@ -226,7 +226,7 @@ APR_DECLARE(void *) apr_buffer_pmemdup(a
return apr_pmemdup(pool, buf->d.mem, len);
}
-APR_DECLARE(apr_status_t) apr_buffer_arraydup(apr_buffer_t **out,
+APU_DECLARE(apr_status_t) apr_buffer_arraydup(apr_buffer_t **out,
const apr_buffer_t *in,
apr_buffer_alloc alloc, void *ctx,
int nelts)
@@ -265,14 +265,14 @@ APR_DECLARE(apr_status_t) apr_buffer_arr
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_buffer_dup(apr_buffer_t **out,
+APU_DECLARE(apr_status_t) apr_buffer_dup(apr_buffer_t **out,
const apr_buffer_t *in,
apr_buffer_alloc alloc, void *ctx)
{
return apr_buffer_arraydup(out, in, alloc, ctx, 1);
}
-APR_DECLARE(apr_buffer_t *) apr_buffer_cpy(apr_buffer_t *dst,
+APU_DECLARE(apr_buffer_t *) apr_buffer_cpy(apr_buffer_t *dst,
const apr_buffer_t *src,
apr_buffer_alloc alloc, void *ctx)
{
@@ -307,7 +307,7 @@ APR_DECLARE(apr_buffer_t *) apr_buffer_c
return dst;
}
-APR_DECLARE(int) apr_buffer_cmp(const apr_buffer_t *src,
+APU_DECLARE(int) apr_buffer_cmp(const apr_buffer_t *src,
const apr_buffer_t *dst)
{
if (!src || !src->d.mem) {
@@ -333,7 +333,7 @@ APR_DECLARE(int) apr_buffer_cmp(const ap
}
}
-APR_DECLARE(char *) apr_buffer_pstrncat(apr_pool_t *p, const apr_buffer_t *buf,
+APU_DECLARE(char *) apr_buffer_pstrncat(apr_pool_t *p, const apr_buffer_t *buf,
int nelts, const char *sep, int flags,
apr_size_t *nbytes)
{
Modified: apr/apr-util/branches/1.7.x/include/apr_buffer.h
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/include/apr_buffer.h?rev=1920358&r1=1920357&r2=1920358&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/include/apr_buffer.h (original)
+++ apr/apr-util/branches/1.7.x/include/apr_buffer.h Sun Sep 1 16:11:55 2024
@@ -96,7 +96,7 @@ typedef struct
* @param len The length of the memory buffer
* @return APR_SUCCESS, or APR_EINVAL if len overflows.
*/
-APR_DECLARE(apr_status_t) apr_buffer_mem_set(apr_buffer_t *buf,
+APU_DECLARE(apr_status_t) apr_buffer_mem_set(apr_buffer_t *buf,
void *mem, apr_size_t len)
__attribute__((nonnull(1)));
@@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_buffer_mem
* @return Returns APR_ENOMEM if we could not allocate enough memory,
* APR_EINVAL if len overflows, otherwise APR_SUCCESS.
*/
-APR_DECLARE(apr_status_t) apr_buffer_mem_create(apr_buffer_t **mb,
+APU_DECLARE(apr_status_t) apr_buffer_mem_create(apr_buffer_t **mb,
apr_pool_t *pool,
void *mem, apr_size_t len)
__attribute__((nonnull(1,2)));
@@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_buffer_mem
* APR_BUFFER_STRING to have the length calculated.
* @return APR_SUCCESS, or APR_EINVAL if len overflows.
*/
-APR_DECLARE(apr_status_t) apr_buffer_str_set(apr_buffer_t *buf,
+APU_DECLARE(apr_status_t) apr_buffer_str_set(apr_buffer_t *buf,
char *str, apr_ssize_t len)
__attribute__((nonnull(1)));
@@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_buffer_str
* @return Returns APR_ENOMEM if we could not allocate enough memory,
* APR_EINVAL if len overflows, otherwise APR_SUCCESS.
*/
-APR_DECLARE(apr_status_t) apr_buffer_str_create(apr_buffer_t **sb,
+APU_DECLARE(apr_status_t) apr_buffer_str_create(apr_buffer_t **sb,
apr_pool_t *pool,
char *str, apr_ssize_t len)
__attribute__((nonnull(1)));
@@ -160,7 +160,7 @@ APR_DECLARE(apr_status_t) apr_buffer_str
* @return Returns APR_ENOMEM if we could not allocate enough memory,
* otherwise APR_SUCCESS.
*/
-APR_DECLARE(apr_status_t) apr_buffer_null_create(apr_buffer_t **nb,
+APU_DECLARE(apr_status_t) apr_buffer_null_create(apr_buffer_t **nb,
apr_pool_t *pool)
__attribute__((nonnull(1)));
@@ -173,7 +173,7 @@ APR_DECLARE(apr_status_t) apr_buffer_nul
* @param buf The buffer.
* @return Returns 1 if buffer is null, otherwise 0.
*/
-APR_DECLARE(int) apr_buffer_is_null(const apr_buffer_t *buf)
+APU_DECLARE(int) apr_buffer_is_null(const apr_buffer_t *buf)
__attribute__((nonnull(1)));
@@ -185,7 +185,7 @@ APR_DECLARE(int) apr_buffer_is_null(cons
* @param buf The buffer.
* @return Returns 1 if zero terminated, otherwise 0.
*/
-APR_DECLARE(int) apr_buffer_is_str(const apr_buffer_t *buf)
+APU_DECLARE(int) apr_buffer_is_str(const apr_buffer_t *buf)
__attribute__((nonnull(1)));
@@ -205,7 +205,7 @@ APR_DECLARE(int) apr_buffer_is_str(const
* @return The zero terminated string. Returns NULL if the buffer
* contains memory.
*/
-APR_DECLARE(char *) apr_buffer_str(const apr_buffer_t *buf)
+APU_DECLARE(char *) apr_buffer_str(const apr_buffer_t *buf)
__attribute__((nonnull(1)));
@@ -222,7 +222,7 @@ APR_DECLARE(char *) apr_buffer_str(const
* @return The zero terminated string. Returns NULL if we could not
* allocate memory.
*/
-APR_DECLARE(char *) apr_buffer_pstrdup(apr_pool_t *pool, const apr_buffer_t *buf)
+APU_DECLARE(char *) apr_buffer_pstrdup(apr_pool_t *pool, const apr_buffer_t *buf)
__attribute__((nonnull(1,2)));
@@ -238,7 +238,7 @@ APR_DECLARE(char *) apr_buffer_pstrdup(a
* @param size Location to write the size to.
* @return The memory buffer.
*/
-APR_DECLARE(void *) apr_buffer_mem(const apr_buffer_t *buf, apr_size_t *size)
+APU_DECLARE(void *) apr_buffer_mem(const apr_buffer_t *buf, apr_size_t *size)
__attribute__((nonnull(1)));
@@ -252,7 +252,7 @@ APR_DECLARE(void *) apr_buffer_mem(const
* @param size Location to write the size to.
* @return The zero memory buffer.
*/
-APR_DECLARE(void *) apr_buffer_pmemdup(apr_pool_t *pool, const apr_buffer_t *buf, apr_size_t *size)
+APU_DECLARE(void *) apr_buffer_pmemdup(apr_pool_t *pool, const apr_buffer_t *buf, apr_size_t *size)
__attribute__((nonnull(1,2)));
@@ -266,7 +266,7 @@ APR_DECLARE(void *) apr_buffer_pmemdup(a
* @param buf The string/memory buffer.
* @return The size of the buffer, excluding terminating zero if present.
*/
-APR_DECLARE(apr_size_t) apr_buffer_len(const apr_buffer_t *buf)
+APU_DECLARE(apr_size_t) apr_buffer_len(const apr_buffer_t *buf)
__attribute__((nonnull(1)));
@@ -281,7 +281,7 @@ APR_DECLARE(apr_size_t) apr_buffer_len(c
* @param buf The string/memory buffer.
* @return The size of the buffer, including terminating zero if present.
*/
-APR_DECLARE(apr_size_t) apr_buffer_allocated(const apr_buffer_t *buf)
+APU_DECLARE(apr_size_t) apr_buffer_allocated(const apr_buffer_t *buf)
__attribute__((nonnull(1)));
@@ -310,7 +310,7 @@ typedef void *(*apr_buffer_alloc)(void *
* @param nelts Number of buffers to duplicate
* @return APR_ENONMEM if the alloc function returned NULL, otherwise APR_SUCCESS
*/
-APR_DECLARE(apr_status_t) apr_buffer_arraydup(apr_buffer_t **out,
+APU_DECLARE(apr_status_t) apr_buffer_arraydup(apr_buffer_t **out,
const apr_buffer_t *in,
apr_buffer_alloc alloc, void *ctx,
int nelts)
@@ -333,7 +333,7 @@ APR_DECLARE(apr_status_t) apr_buffer_arr
* @param ctx Context to pass to the callback function
* @return APR_ENONMEM if the alloc function returned NULL, otherwise APR_SUCCESS
*/
-APR_DECLARE(apr_status_t) apr_buffer_dup(apr_buffer_t **out,
+APU_DECLARE(apr_status_t) apr_buffer_dup(apr_buffer_t **out,
const apr_buffer_t *in,
apr_buffer_alloc alloc, void *ctx)
__attribute__((nonnull(1,2)));
@@ -356,7 +356,7 @@ APR_DECLARE(apr_status_t) apr_buffer_dup
* @param ctx The context for the callback
* @return Returns dst.
*/
-APR_DECLARE(apr_buffer_t *) apr_buffer_cpy(apr_buffer_t *dst,
+APU_DECLARE(apr_buffer_t *) apr_buffer_cpy(apr_buffer_t *dst,
const apr_buffer_t *src,
apr_buffer_alloc alloc, void *ctx)
__attribute__((nonnull(1)));
@@ -376,7 +376,7 @@ APR_DECLARE(apr_buffer_t *) apr_buffer_c
* @return Positive, negative, or zero, depending on whether src is greater
* than, less than, or equal to dst.
*/
-APR_DECLARE(int) apr_buffer_cmp(const apr_buffer_t *dst,
+APU_DECLARE(int) apr_buffer_cmp(const apr_buffer_t *dst,
const apr_buffer_t *src);
/**
@@ -397,7 +397,7 @@ APR_DECLARE(int) apr_buffer_cmp(const ap
* @param nbytes (output) strlen of new string (pass in NULL to omit)
* @return The new string
*/
-APR_DECLARE(char *) apr_buffer_pstrncat(apr_pool_t *p, const apr_buffer_t *buf,
+APU_DECLARE(char *) apr_buffer_pstrncat(apr_pool_t *p, const apr_buffer_t *buf,
int nelts, const char *sep, int flags,
apr_size_t *nbytes);
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.