On Fri, Jul 29, 2016 at 1:00 PM, Eric Covener <[email protected]> wrote:
>
> Sounds reasonable, given as you proposed it doesn't implicitly get
> used in any existing portability stuff. But hard to get excited about
> pushing it down if we end up adding it in three places.
>
Thinking of something this simple...
Index: include/apr_lib.h
===================================================================
--- include/apr_lib.h (revision 1754406)
+++ include/apr_lib.h (working copy)
@@ -217,6 +217,14 @@
#else
#define apr_isascii(c) (((c) & ~0x7f)==0)
#endif
+#if APR_CHARSET_EBCDIC
+APR_DECLARE(int) apr_isascii_equiv_fn(int c);
+#define apr_isascii_equiv(c) (apr_isascii_equiv_fn(((unsigned char)(c))))
+#elif defined(isascii)
+#define apr_isascii_equiv(c) (isascii(((unsigned char)(c))))
+#else
+#define apr_isascii_equiv(c) (((c) & ~0x7f)==0)
+#endif
/** @see isprint */
#define apr_isprint(c) (isprint(((unsigned char)(c))))
/** @see ispunct */
Index: strings/apr_cstr.c
===================================================================
--- strings/apr_cstr.c (revision 1754406)
+++ strings/apr_cstr.c (working copy)
@@ -279,6 +279,12 @@
};
#endif
+#if APR_CHARSET_EBCDIC
+int apr_isascii_equiv_fn(int c) {
+ return ((ucharmap[(unsigned char)c] & ~0x7f) == 0);
+}
+#endif
+
int apr_cstr_casecmp(const char *s1, const char *s2)
{
const unsigned char *str1 = (const unsigned char *)s1;
And as you say... annoying that it ends up replicated a few times,
but that is what it is until httpd 2.next/3.next.