You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2009/12/18 05:24:50 UTC
svn commit: r892127 - in /apr/apr/trunk: ./ file_io/unix/ file_io/win32/
include/arch/ include/arch/netware/ include/arch/win32/ memory/unix/
Author: wrowe
Date: Fri Dec 18 04:24:50 2009
New Revision: 892127
URL: http://svn.apache.org/viewvc?rev=892127&view=rev
Log:
Nothing interesting existed in apr_common_private.h, this would
have just as well been an include/arch/unix/apr_arch_common.h but
is entirely unnecessary.
The right solution is dozens of lines less code and confusion,
simply drive apr_filepath_list_split|merge from filepath_util.c
brought in from the unix/ directory, across all platforms.
One 'temporary' cast was in use by apr_pools.c, the other was
entirely unused.
Removed:
apr/apr/trunk/include/arch/apr_private_common.h
Modified:
apr/apr/trunk/configure.in
apr/apr/trunk/file_io/unix/filepath.c
apr/apr/trunk/file_io/unix/filepath_util.c
apr/apr/trunk/file_io/win32/filepath.c
apr/apr/trunk/include/arch/netware/apr_private.h
apr/apr/trunk/include/arch/win32/apr_private.h
apr/apr/trunk/memory/unix/apr_pools.c
Modified: apr/apr/trunk/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=892127&r1=892126&r2=892127&view=diff
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Fri Dec 18 04:24:50 2009
@@ -49,10 +49,6 @@
#define BEOS_BONE 1
#endif
-/*
- * Include common private declarations.
- */
-#include "../apr_private_common.h"
#endif /* APR_PRIVATE_H */
])
Modified: apr/apr/trunk/file_io/unix/filepath.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/filepath.c?rev=892127&r1=892126&r2=892127&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/filepath.c (original)
+++ apr/apr/trunk/file_io/unix/filepath.c Fri Dec 18 04:24:50 2009
@@ -289,20 +289,6 @@
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
- const char *liststr,
- apr_pool_t *p)
-{
- return apr_filepath_list_split_impl(pathelts, liststr, ':', p);
-}
-
-APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
- apr_array_header_t *pathelts,
- apr_pool_t *p)
-{
- return apr_filepath_list_merge_impl(liststr, pathelts, ':', p);
-}
-
APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p)
{
#if defined(DARWIN)
Modified: apr/apr/trunk/file_io/unix/filepath_util.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/filepath_util.c?rev=892127&r1=892126&r2=892127&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/filepath_util.c (original)
+++ apr/apr/trunk/file_io/unix/filepath_util.c Fri Dec 18 04:24:50 2009
@@ -26,30 +26,35 @@
#include "apr_private.h"
-apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts,
- const char *liststr,
- char separator,
- apr_pool_t *p)
+#if defined(WIN32) || defined(OS2) || defined(NETWARE)
+#define PATH_SEPARATOR ';'
+#define PATH_SEPARATOR_STRING ";"
+#else
+#define PATH_SEPARATOR ':'
+#define PATH_SEPARATOR_STRING ":"
+#endif
+
+APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
+ const char *liststr,
+ apr_pool_t *p)
{
char *path, *part, *ptr;
- char separator_string[2] = { '\0', '\0' };
apr_array_header_t *elts;
int nelts;
- separator_string[0] = separator;
/* Count the number of path elements. We know there'll be at least
one even if path is an empty string. */
path = apr_pstrdup(p, liststr);
for (nelts = 0, ptr = path; ptr != NULL; ++nelts)
{
- ptr = strchr(ptr, separator);
+ ptr = strchr(ptr, PATH_SEPARATOR);
if (ptr)
++ptr;
}
/* Split the path into the array. */
elts = apr_array_make(p, nelts, sizeof(char*));
- while ((part = apr_strtok(path, separator_string, &ptr)) != NULL)
+ while ((part = apr_strtok(path, PATH_SEPARATOR_STR, &ptr)) != NULL)
{
if (*part == '\0') /* Ignore empty path components. */
continue;
@@ -63,10 +68,9 @@
}
-apr_status_t apr_filepath_list_merge_impl(char **liststr,
- apr_array_header_t *pathelts,
- char separator,
- apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
+ apr_array_header_t *pathelts,
+ apr_pool_t *p)
{
apr_size_t path_size = 0;
char *path;
@@ -102,7 +106,7 @@
continue;
if (i > 0)
- *path++ = separator;
+ *path++ = PATH_SEPARATOR;
memcpy(path, part, part_size);
path += part_size;
}
Modified: apr/apr/trunk/file_io/win32/filepath.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/filepath.c?rev=892127&r1=892126&r2=892127&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/filepath.c (original)
+++ apr/apr/trunk/file_io/win32/filepath.c Fri Dec 18 04:24:50 2009
@@ -955,21 +955,6 @@
}
-APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
- const char *liststr,
- apr_pool_t *p)
-{
- return apr_filepath_list_split_impl(pathelts, liststr, ';', p);
-}
-
-APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
- apr_array_header_t *pathelts,
- apr_pool_t *p)
-{
- return apr_filepath_list_merge_impl(liststr, pathelts, ';', p);
-}
-
-
APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p)
{
#if APR_HAS_UNICODE_FS
Modified: apr/apr/trunk/include/arch/netware/apr_private.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/netware/apr_private.h?rev=892127&r1=892126&r2=892127&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/netware/apr_private.h (original)
+++ apr/apr/trunk/include/arch/netware/apr_private.h Fri Dec 18 04:24:50 2009
@@ -193,10 +193,5 @@
/* used to check DWORD overflow for 64bit compiles */
#define APR_DWORD_MAX 0xFFFFFFFFUL
-/*
- * Include common private declarations.
- */
-#include "../apr_private_common.h"
-
#endif /*APR_PRIVATE_H*/
#endif /*NETWARE*/
Modified: apr/apr/trunk/include/arch/win32/apr_private.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/win32/apr_private.h?rev=892127&r1=892126&r2=892127&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/win32/apr_private.h (original)
+++ apr/apr/trunk/include/arch/win32/apr_private.h Fri Dec 18 04:24:50 2009
@@ -164,10 +164,5 @@
/* used to check for DWORD overflow in 64bit compiles */
#define APR_DWORD_MAX 0xFFFFFFFFUL
-/*
- * Include common private declarations.
- */
-#include "../apr_private_common.h"
-
#endif /*APR_PRIVATE_H*/
#endif /*WIN32*/
Modified: apr/apr/trunk/memory/unix/apr_pools.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memory/unix/apr_pools.c?rev=892127&r1=892126&r2=892127&view=diff
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c (original)
+++ apr/apr/trunk/memory/unix/apr_pools.c Fri Dec 18 04:24:50 2009
@@ -39,6 +39,8 @@
#include <unistd.h> /* for getpid */
#endif
+/* XXX Temporary Cast */
+#define APR_UINT32_TRUNC_CAST apr_uint32_t
/*
* Magic numbers