apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1767019 - in /apr/apr/trunk: include/apr_cstr.h strings/apr_cstr.c
Date Fri, 28 Oct 2016 13:12:06 GMT
Author: ivan
Date: Fri Oct 28 13:12:06 2016
New Revision: 1767019

URL: http://svn.apache.org/viewvc?rev=1767019&view=rev
Log:
Follow-up to r1726928: Add APR_DECLARE() to apr_cstr_*() functions
declaration to fix Windows build.

Modified:
    apr/apr/trunk/include/apr_cstr.h
    apr/apr/trunk/strings/apr_cstr.c

Modified: apr/apr/trunk/include/apr_cstr.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_cstr.h?rev=1767019&r1=1767018&r2=1767019&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_cstr.h (original)
+++ apr/apr/trunk/include/apr_cstr.h Fri Oct 28 13:12:06 2016
@@ -78,10 +78,10 @@ extern "C" {
  *
  * @since New in 1.6
  */
-apr_array_header_t * apr_cstr_split(const char *input,
-                                    const char *sep_chars,
-                                    int chop_whitespace,
-                                    apr_pool_t *pool);
+APR_DECLARE(apr_array_header_t *) apr_cstr_split(const char *input,
+                                                 const char *sep_chars,
+                                                 int chop_whitespace,
+                                                 apr_pool_t *pool);
 
 /** Like apr_cstr_split(), but append to existing @a array instead of
  * creating a new one.  Allocate the copied substrings in @a pool
@@ -89,11 +89,11 @@ apr_array_header_t * apr_cstr_split(cons
  *
  * @since New in 1.6
  */
-void apr_cstr_split_append(apr_array_header_t *array,
-                           const char *input,
-                           const char *sep_chars,
-                           int chop_whitespace,
-                           apr_pool_t *pool);
+APR_DECLARE(void) apr_cstr_split_append(apr_array_header_t *array,
+                                        const char *input,
+                                        const char *sep_chars,
+                                        int chop_whitespace,
+                                        apr_pool_t *pool);
 
 
 /** Return @c TRUE iff @a str matches any of the elements of @a list, a list
@@ -101,13 +101,15 @@ void apr_cstr_split_append(apr_array_hea
  *
  * @since New in 1.6
  */
-int apr_cstr_match_glob_list(const char *str, const apr_array_header_t *list);
+APR_DECLARE(int) apr_cstr_match_glob_list(const char *str,
+                                          const apr_array_header_t *list);
 
 /** Return @c TRUE iff @a str exactly matches any of the elements of @a list.
  *
  * @since New in 1.6
  */
-int apr_cstr_match_list(const char *str, const apr_array_header_t *list);
+APR_DECLARE(int) apr_cstr_match_list(const char *str,
+                                     const apr_array_header_t *list);
 
 /**
  * Get the next token from @a *str interpreting any char from @a sep as a
@@ -120,7 +122,7 @@ int apr_cstr_match_list(const char *str,
  *
  * @since New in 1.6.
  */
-char * apr_cstr_tokenize(const char *sep, char **str);
+APR_DECLARE(char *) apr_cstr_tokenize(const char *sep, char **str);
 
 /**
  * Return the number of line breaks in @a msg, allowing any kind of newline
@@ -128,7 +130,7 @@ char * apr_cstr_tokenize(const char *sep
  *
  * @since New in 1.6.
  */
-int apr_cstr_count_newlines(const char *msg);
+APR_DECLARE(int) apr_cstr_count_newlines(const char *msg);
 
 #if 0 /* XXX: stringbuf logic is not present in APR */
 /**
@@ -139,9 +141,9 @@ int apr_cstr_count_newlines(const char *
  *
  * @since New in 1.6.
  */
-char * apr_cstr_join(const apr_array_header_t *strings,
-                     const char *separator,
-                     apr_pool_t *pool);
+APR_DECLARE(char *) apr_cstr_join(const apr_array_header_t *strings,
+                                  const char *separator,
+                                  apr_pool_t *pool);
 #endif
 
 /**
@@ -156,7 +158,7 @@ char * apr_cstr_join(const apr_array_hea
  *
  * @since New in 1.6.
  */
-int apr_cstr_casecmp(const char *str1, const char *str2);
+APR_DECLARE(int) apr_cstr_casecmp(const char *str1, const char *str2);
 
 /**
  * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2,
@@ -170,7 +172,9 @@ int apr_cstr_casecmp(const char *str1, c
  *
  * @since New in 1.6.
  */
-int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n);
+APR_DECLARE(int) apr_cstr_casecmpn(const char *str1,
+                                   const char *str2,
+                                   apr_size_t n);
 
 /**
  * Parse the C string @a str into a 64 bit number, and return it in @a *n.
@@ -191,9 +195,10 @@ int apr_cstr_casecmpn(const char *str1,
  *
  * @since New in 1.6.
  */
-apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str,
-                               apr_int64_t minval, apr_int64_t maxval,
-                               int base);
+APR_DECLARE(apr_status_t) apr_cstr_strtoi64(apr_int64_t *n, const char *str,
+                                            apr_int64_t minval,
+                                            apr_int64_t maxval,
+                                            int base);
 
 /**
  * Parse the C string @a str into a 64 bit number, and return it in @a *n.
@@ -204,7 +209,7 @@ apr_status_t apr_cstr_strtoi64(apr_int64
  *
  * @since New in 1.6.
  */
-apr_status_t apr_cstr_atoi64(apr_int64_t *n, const char *str);
+APR_DECLARE(apr_status_t) apr_cstr_atoi64(apr_int64_t *n, const char *str);
 
 /**
  * Parse the C string @a str into a 32 bit number, and return it in @a *n.
@@ -215,7 +220,7 @@ apr_status_t apr_cstr_atoi64(apr_int64_t
  *
  * @since New in 1.6.
  */
-apr_status_t apr_cstr_atoi(int *n, const char *str);
+APR_DECLARE(apr_status_t) apr_cstr_atoi(int *n, const char *str);
 
 /**
  * Parse the C string @a str into an unsigned 64 bit number, and return
@@ -239,9 +244,10 @@ apr_status_t apr_cstr_atoi(int *n, const
  *
  * @since New in 1.6.
  */
-apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str,
-                                apr_uint64_t minval, apr_uint64_t maxval,
-                                int base);
+APR_DECLARE(apr_status_t) apr_cstr_strtoui64(apr_uint64_t *n, const char *str,
+                                             apr_uint64_t minval,
+                                             apr_uint64_t maxval,
+                                             int base);
 
 /**
  * Parse the C string @a str into an unsigned 64 bit number, and return
@@ -253,7 +259,7 @@ apr_status_t apr_cstr_strtoui64(apr_uint
  *
  * @since New in 1.6.
  */
-apr_status_t apr_cstr_atoui64(apr_uint64_t *n, const char *str);
+APR_DECLARE(apr_status_t) apr_cstr_atoui64(apr_uint64_t *n, const char *str);
 
 /**
  * Parse the C string @a str into an unsigned 32 bit number, and return
@@ -265,7 +271,7 @@ apr_status_t apr_cstr_atoui64(apr_uint64
  *
  * @since New in 1.6.
  */
-apr_status_t apr_cstr_atoui(unsigned int *n, const char *str);
+APR_DECLARE(apr_status_t) apr_cstr_atoui(unsigned int *n, const char *str);
 
 /**
  * Skip the common prefix @a prefix from the C string @a str, and return
@@ -274,7 +280,8 @@ apr_status_t apr_cstr_atoui(unsigned int
  *
  * @since New in 1.6.
  */
-const char * apr_cstr_skip_prefix(const char *str, const char *prefix);
+APR_DECLARE(const char *) apr_cstr_skip_prefix(const char *str,
+                                               const char *prefix);
 
 /** @} */
 

Modified: apr/apr/trunk/strings/apr_cstr.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/strings/apr_cstr.c?rev=1767019&r1=1767018&r2=1767019&view=diff
==============================================================================
--- apr/apr/trunk/strings/apr_cstr.c (original)
+++ apr/apr/trunk/strings/apr_cstr.c Fri Oct 28 13:12:06 2016
@@ -27,11 +27,11 @@
 #include "apr_want.h"
 #include "apr_cstr.h"
 
-void apr_cstr_split_append(apr_array_header_t *array,
-                           const char *input,
-                           const char *sep_chars,
-                           int chop_whitespace,
-                           apr_pool_t *pool)
+APR_DECLARE(void) apr_cstr_split_append(apr_array_header_t *array,
+                                        const char *input,
+                                        const char *sep_chars,
+                                        int chop_whitespace,
+                                        apr_pool_t *pool)
 {
   char *pats;
   char *p;
@@ -64,10 +64,10 @@ void apr_cstr_split_append(apr_array_hea
 }
 
 
-apr_array_header_t * apr_cstr_split(const char *input,
-                                    const char *sep_chars,
-                                    int chop_whitespace,
-                                    apr_pool_t *pool)
+APR_DECLARE(apr_array_header_t *) apr_cstr_split(const char *input,
+                                                 const char *sep_chars,
+                                                 int chop_whitespace,
+                                                 apr_pool_t *pool)
 {
   apr_array_header_t *a = apr_array_make(pool, 5, sizeof(input));
   apr_cstr_split_append(a, input, sep_chars, chop_whitespace, pool);
@@ -75,8 +75,8 @@ apr_array_header_t * apr_cstr_split(cons
 }
 
 
-int apr_cstr_match_glob_list(const char *str,
-                             const apr_array_header_t *list)
+APR_DECLARE(int) apr_cstr_match_glob_list(const char *str,
+                                          const apr_array_header_t *list)
 {
   int i;
 
@@ -91,7 +91,8 @@ int apr_cstr_match_glob_list(const char
   return FALSE;
 }
 
-int apr_cstr_match_list(const char *str, const apr_array_header_t *list)
+APR_DECLARE(int) apr_cstr_match_list(const char *str,
+                                     const apr_array_header_t *list)
 {
   int i;
 
@@ -106,7 +107,7 @@ int apr_cstr_match_list(const char *str,
   return FALSE;
 }
 
-char * apr_cstr_tokenize(const char *sep, char **str)
+APR_DECLARE(char *) apr_cstr_tokenize(const char *sep, char **str)
 {
     char *token;
     char *next;
@@ -146,7 +147,7 @@ char * apr_cstr_tokenize(const char *sep
     return token;
 }
 
-int apr_cstr_count_newlines(const char *msg)
+APR_DECLARE(int) apr_cstr_count_newlines(const char *msg)
 {
   int count = 0;
   const char *p;
@@ -171,9 +172,9 @@ int apr_cstr_count_newlines(const char *
 }
 
 #if 0 /* XXX: stringbuf logic is not present in APR */
-char * apr_cstr_join(const apr_array_header_t *strings,
-                     const char *separator,
-                     apr_pool_t *pool)
+APR_DECLARE(char *) apr_cstr_join(const apr_array_header_t *strings,
+                                  const char *separator,
+                                  apr_pool_t *pool)
 {
   svn_stringbuf_t *new_str = svn_stringbuf_create_empty(pool);
   size_t sep_len = strlen(separator);
@@ -279,7 +280,7 @@ static const short ucharmap[] = {
 };
 #endif
 
-int apr_cstr_casecmp(const char *s1, const char *s2)
+APR_DECLARE(int) apr_cstr_casecmp(const char *s1, const char *s2)
 {
     const unsigned char *str1 = (const unsigned char *)s1;
     const unsigned char *str2 = (const unsigned char *)s2;
@@ -296,7 +297,8 @@ int apr_cstr_casecmp(const char *s1, con
     }
 }
 
-int apr_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n)
+APR_DECLARE(int) apr_cstr_casecmpn(const char *s1, const char *s2,
+                                   apr_size_t n)
 {
     const unsigned char *str1 = (const unsigned char *)s1;
     const unsigned char *str2 = (const unsigned char *)s2;
@@ -314,9 +316,11 @@ int apr_cstr_casecmpn(const char *s1, co
     return 0;
 }
 
-apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str,
-                                apr_uint64_t minval, apr_uint64_t maxval,
-                                int base)
+APR_DECLARE(apr_status_t) apr_cstr_strtoui64(apr_uint64_t *n,
+                                             const char *str,
+                                             apr_uint64_t minval,
+                                             apr_uint64_t maxval,
+                                             int base)
 {
   apr_int64_t val;
   char *endptr;
@@ -336,12 +340,12 @@ apr_status_t apr_cstr_strtoui64(apr_uint
   return APR_SUCCESS;
 }
 
-apr_status_t apr_cstr_atoui64(apr_uint64_t *n, const char *str)
+APR_DECLARE(apr_status_t) apr_cstr_atoui64(apr_uint64_t *n, const char *str)
 {
   return apr_cstr_strtoui64(n, str, 0, APR_UINT64_MAX, 10);
 }
 
-apr_status_t apr_cstr_atoui(unsigned int *n, const char *str)
+APR_DECLARE(apr_status_t) apr_cstr_atoui(unsigned int *n, const char *str)
 {
   apr_uint64_t val;
   apr_status_t rv = apr_cstr_strtoui64(&val, str, 0, APR_UINT32_MAX, 10);
@@ -350,9 +354,11 @@ apr_status_t apr_cstr_atoui(unsigned int
   return rv;
 }
 
-apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str,
-                               apr_int64_t minval, apr_int64_t maxval,
-                               int base)
+APR_DECLARE(apr_status_t) apr_cstr_strtoi64(apr_int64_t *n,
+                                            const char *str,
+                                            apr_int64_t minval,
+                                            apr_int64_t maxval,
+                                            int base)
 {
   apr_int64_t val;
   char *endptr;
@@ -370,12 +376,12 @@ apr_status_t apr_cstr_strtoi64(apr_int64
   return APR_SUCCESS;
 }
 
-apr_status_t apr_cstr_atoi64(apr_int64_t *n, const char *str)
+APR_DECLARE(apr_status_t) apr_cstr_atoi64(apr_int64_t *n, const char *str)
 {
   return apr_cstr_strtoi64(n, str, APR_INT64_MIN, APR_INT64_MAX, 10);
 }
 
-apr_status_t apr_cstr_atoi(int *n, const char *str)
+APR_DECLARE(apr_status_t) apr_cstr_atoi(int *n, const char *str)
 {
   apr_int64_t val;
   apr_status_t rv;
@@ -386,7 +392,7 @@ apr_status_t apr_cstr_atoi(int *n, const
   return rv;
 }
 
-const char *
+APR_DECLARE(const char *)
 apr_cstr_skip_prefix(const char *str, const char *prefix)
 {
   apr_size_t len = strlen(prefix);



Mime
View raw message