apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: Which of y'all are working on un-APR-izing gen_test_char, and how will the rest of us know if it is stalled and needs help?
Date Tue, 05 Nov 2013 21:51:11 GMT
On 05 Nov 2013, at 11:04 PM, Jeff Trawick <trawick@gmail.com> wrote:

> TIA! (ping)
> 
> If nobody in the gen_test_char-with-traditional-Windows-build sub-thread knows what I'm
talking about, please let me know.  Maybe I am confused about the planned work.

(Am on holiday and travelling, so have limited time, but this was reasonably straightforward)

This patch removes the APR specific stuff (and therefore the chicken-and-egg problem) and
Works for Me(™) on MacOSX 10.8. Is this good enough to work on Windows and other platforms
(Linux, etc)?

Index: tools/gen_test_char.c
===================================================================
--- tools/gen_test_char.c	(revision 1536348)
+++ tools/gen_test_char.c	(working copy)
@@ -14,33 +14,14 @@
  * limitations under the License.
  */
 
-#ifdef CROSS_COMPILE
-
-#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
-#define apr_isalpha(c) (isalpha(((unsigned char)(c))))
-#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
-#define apr_isprint(c) (isprint(((unsigned char)(c))))
-#include <ctype.h>
-#define APR_HAVE_STDIO_H 1
-#define APR_HAVE_STRING_H 1
-
-#else
-
-#include "apr.h"
-#include "apr_lib.h"
-
-#endif
-
 #if defined(WIN32) || defined(OS2)
 #define NEED_ENHANCED_ESCAPES
 #endif
 
-#if APR_HAVE_STDIO_H
 #include <stdio.h>
-#endif
-#if APR_HAVE_STRING_H
 #include <string.h>
-#endif
+#include <stdio.h>
+#include <ctype.h>
 
 /* A bunch of functions in util.c scan strings looking for certain characters.
  * To make that more efficient we encode a lookup table.
@@ -100,15 +81,15 @@
         }
 #endif
 
-        if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) {
+        if (!isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) {
             flags |= T_ESCAPE_PATH_SEGMENT;
         }
 
-        if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) {
+        if (!isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) {
             flags |= T_OS_ESCAPE_PATH;
         }
 
-        if (!apr_isalnum(c) && !strchr(".-*_ ", c)) {
+        if (!isalnum(c) && !strchr(".-*_ ", c)) {
             flags |= T_ESCAPE_URLENCODED;
         }
 
@@ -117,7 +98,7 @@
          * backslashes (because we use backslash for escaping)
          * and 8-bit chars with the high bit set
          */
-        if (c && (!apr_isprint(c) || c == '"' || c == '\\' || apr_iscntrl(c))) {
+        if (c && (!isprint(c) || c == '"' || c == '\\' || iscntrl(c))) {
             flags |= T_ESCAPE_ECHO;
         }
 

Regards,
Graham
--


Mime
View raw message