]> granicus.if.org Git - apache/commitdiff
Switch to the APR-provided APR_CHARSET_EBCDIC feature test macro.
authorJeff Trawick <trawick@apache.org>
Wed, 20 Dec 2000 16:44:01 +0000 (16:44 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 20 Dec 2000 16:44:01 +0000 (16:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87460 13f79535-47bb-0310-9956-ffa450edef68

19 files changed:
acinclude.m4
configure.in
include/ap_config.h
include/httpd.h
include/util_ebcdic.h
modules/experimental/mod_charset_lite.c
modules/filters/mod_include.h
modules/proxy/mod_proxy.h
modules/proxy/proxy_ftp.c
modules/proxy/proxy_util.c
os/bs2000/ebcdic.c
os/tpf/ebcdic.c
server/main.c
server/util.c
server/util_ebcdic.c
server/util_md5.c
server/util_script.c
support/htdigest.c
support/htpasswd.c

index 8ef8eb4e3aff1f198ea1bbdcdfdfa29f35983b77..33ab72f68dc470c5463702fce1e62b4fa8792027 100644 (file)
@@ -203,24 +203,6 @@ AC_DEFUN(APACHE_CHECK_SIGWAIT_ONE_ARG,[
   fi
 ])
 
-AC_DEFUN(APACHE_EBCDIC,[
-  AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
-  AC_TRY_RUN( [
-int main(void) { 
-  return (unsigned char)'A' != (unsigned char)0xC1; 
-} 
-],[
-  ac_cv_ebcdic="yes"
-],[
-  ac_cv_ebcdic="no"
-],[
-  ac_cv_ebcdic="no"
-])])
-  if test "$ac_cv_ebcdic" = "yes"; then
-    AC_DEFINE(AP_CHARSET_EBCDIC,, [Define if system uses EBCDIC])
-  fi
-])
-
 dnl APACHE_MODPATH_INIT(modpath)
 AC_DEFUN(APACHE_MODPATH_INIT,[
   current_dir=$1
index f9410ee084d62631e2bc1ac0d2d4be4ba75aeedc..896868a69db7b023d4065139e1de46625e65fe07 100644 (file)
@@ -110,8 +110,6 @@ AC_CHECK_LIB(nsl, gethostname)
 AC_CHECK_LIB(socket, socket)
 AC_CHECK_LIB(resolv, sethostent)
 
-APACHE_EBCDIC
-
 AC_ARG_WITH(optim,[  --with-optim="FLAGS"      compiler optimisation flags],
         [OPTIM="$withval"])
 
index 5c458ba070bb351124def5008e891fb83316131d..f3d79c58fa28a5051629bcc57bab6add14d9fcac 100644 (file)
@@ -243,7 +243,7 @@ AP_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(AP,ret,name,args_decl,args_use,decline)
 #define AP_HAVE_RELIABLE_PIPED_LOGS TRUE
 #endif
 
-#if defined(AP_CHARSET_EBCDIC) && !defined(APACHE_XLATE)
+#if APR_CHARSET_EBCDIC && !defined(APACHE_XLATE)
 #define APACHE_XLATE
 #endif
 
index 46ed224ddf9409c655c2ef681e131c125a6b3e04..6b4a3791ada2be02c67d069ecf46d8f64442667f 100644 (file)
@@ -517,11 +517,11 @@ struct ap_method_list_t {
 #define DIR_MAGIC_TYPE "httpd/unix-directory"
 
 /* Just in case your linefeed isn't the one the other end is expecting. */
-#ifndef AP_CHARSET_EBCDIC
+#if !APR_CHARSET_EBCDIC
 #define LF 10
 #define CR 13
 #define CRLF "\015\012"
-#else /* AP_CHARSET_EBCDIC */
+#else /* APR_CHARSET_EBCDIC */
 /* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
  * in the buff package (bread/bputs/bwrite).  Everywhere else, we use
  * "native EBCDIC" CR and NL characters. These are therefore
@@ -531,7 +531,7 @@ struct ap_method_list_t {
 #define CR '\r'
 #define LF '\n'
 #define CRLF "\r\n"
-#endif /* AP_CHARSET_EBCDIC */                                   
+#endif /* APR_CHARSET_EBCDIC */                                   
 
 /* Possible values for request_rec.read_body (set by handling module):
  *    REQUEST_NO_BODY          Send 413 error if message has any body
index 149784069fa2c5f7a843b764dd3ce929b14f8981..4f2117d313c959237c062edd4e5e8ff91e05fc03 100644 (file)
@@ -72,7 +72,7 @@ extern "C" {
  * @package Utilities for EBCDIC conversion
  */
 
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
 
 /**
  * Setup all of the global translation handlers
@@ -100,11 +100,11 @@ void ap_xlate_proto_from_ascii(char *buffer, apr_size_t len);
 }
 #endif
 
-#else   /* AP_CHARSET_EBCDIC */
+#else   /* APR_CHARSET_EBCDIC */
 
 #define ap_xlate_proto_to_ascii(x,y)          /* NOOP */
 #define ap_xlate_proto_from_ascii(x,y)        /* NOOP */
 
-#endif  /* AP_CHARSET_EBCDIC */
+#endif  /* APR_CHARSET_EBCDIC */
     
 #endif  /* !APACHE_UTIL_EBCDIC_H */
index 999704463bdade53e69182e4f03b997eb7238883..89032bae0212dae54f4f3c7fca28fd4b2b766358 100644 (file)
@@ -291,7 +291,7 @@ static int find_code_page(request_rec *r)
  */
              
     if (strncasecmp(mime_type, "text/", 5) &&
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
         /* On an EBCDIC machine, be willing to translate mod_autoindex-
          * generated output.  Otherwise, it doesn't look too cool.
          *
index 8777cf73bd4b87cb7e65a7448ef93a5152b2b6a0..a537afb684bdd87fe940e61fc19d118a719fa8e7 100644 (file)
 #define SIZEFMT_BYTES 0
 #define SIZEFMT_KMG 1
 #define TMP_BUF_SIZE 1024
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
 #define RAW_ASCII_CHAR(ch)  apr_xlate_conv_byte(ap_hdrs_from_ascii, (unsigned char)ch)
-#else /*AP_CHARSET_EBCDIC*/
+#else /*APR_CHARSET_EBCDIC*/
 #define RAW_ASCII_CHAR(ch)  (ch)
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
 
 module AP_MODULE_DECLARE_DATA includes_module;
 
index afc6e9c44bf8db501be165dd367a4cafe8a29eee..0b2a89c080b83116ff3ba295f7f105302f1077da 100644 (file)
@@ -142,11 +142,11 @@ enum enctype {
 #define HDR_APP (0)            /* append header, for proxy_add_header() */
 #define HDR_REP (1)            /* replace header, for proxy_add_header() */
 
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
 #define CRLF   "\r\n"
-#else /*AP_CHARSET_EBCDIC*/
+#else /*APR_CHARSET_EBCDIC*/
 #define CRLF   "\015\012"
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
 
 #define        DEFAULT_FTP_DATA_PORT   20
 #define        DEFAULT_FTP_PORT        21
index 2bf43ed18547946d14a3e1ecb3fd7c0b3f947f65..c02eea742319967d7a28488d608289fbbbb980b6 100644 (file)
@@ -110,11 +110,11 @@ static int ftp_check_string(const char *x)
            ch = ap_proxy_hex2c(&x[i + 1]);
            i += 2;
        }
-#ifndef AP_CHARSET_EBCDIC
+#if !APR_CHARSET_EBCDIC
         if (ch == '\015' || ch == '\012' || (ch & 0x80))
-#else /*AP_CHARSET_EBCDIC*/
+#else /*APR_CHARSET_EBCDIC*/
         if (ch == '\r' || ch == '\n' || (os_toascii[ch] & 0x80))
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
         return 0;
     }
     return 1;
@@ -602,9 +602,9 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el *c, char *url)
     ap_bpush_socket(f, sock);
 /* shouldn't we implement telnet control options here? */
 
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     ap_bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 1);
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
 
 /* possible results: */
     /* 120 Service ready in nnn minutes. */
index af097f853a35aa2665618b32c274124cded57411..ccab2712a766677a841ac716f102fa76f5a97e48 100644 (file)
@@ -78,7 +78,7 @@ int ap_proxy_hex2c(const char *x)
 {
     int i, ch;
 
-#ifndef AP_CHARSET_EBCDIC
+#if !APR_CHARSET_EBCDIC
     ch = x[0];
     if (apr_isdigit(ch))
        i = ch - '0';
@@ -96,14 +96,14 @@ int ap_proxy_hex2c(const char *x)
     else
        i += ch - ('a' - 10);
     return i;
-#else /*AP_CHARSET_EBCDIC*/
+#else /*APR_CHARSET_EBCDIC*/
     return (1 == sscanf(x, "%2x", &i)) ? os_toebcdic[i&0xFF] : 0;
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
 }
 
 void ap_proxy_c2hex(int ch, char *x)
 {
-#ifndef AP_CHARSET_EBCDIC
+#if !APR_CHARSET_EBCDIC
     int i;
 
     x[0] = '%';
@@ -118,14 +118,14 @@ void ap_proxy_c2hex(int ch, char *x)
        x[2] = ('A' - 10) + i;
     else
        x[2] = '0' + i;
-#else /*AP_CHARSET_EBCDIC*/
+#else /*APR_CHARSET_EBCDIC*/
     static const char ntoa[] = { "0123456789ABCDEF" };
     ch &= 0xFF;
     x[0] = '%';
     x[1] = ntoa[(os_toascii[ch]>>4)&0x0F];
     x[2] = ntoa[os_toascii[ch]&0x0F];
     x[3] = '\0';
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
 }
 
 /*
@@ -480,7 +480,7 @@ long int ap_proxy_send_fb(proxy_completion *completion, BUFF *f, request_rec *r,
     if (c) ap_cache_el_data(c, &cachefp);
 
 #if 0
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     /* The cache copy is ASCII, not EBCDIC, even for text/html) */
     ap_bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0);
     if (c != NULL && c->fp != NULL)
index 879b35050d1f078408ef59c8d6a2428a3b5d6093..1e118bd114357d9fa76751b87a09813ef634f2e4 100644 (file)
@@ -56,8 +56,8 @@
  * University of Illinois, Urbana-Champaign.
  */
 
-#ifdef AP_CHARSET_EBCDIC
 #include "ap_config.h"
+#if APR_CHARSET_EBCDIC
 #include "ebcdic.h"
 /*
           Initial Port for  Apache-1.3 by <Martin.Kraemer@Mch.SNI.De>
@@ -249,4 +249,4 @@ ascii2ebcdic(unsigned char *dest, const unsigned char *srce, size_t count)
                *dest++ = os_toebcdic[*srce++];
        }
 }
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
index 0d44053a8a747c17f401389c58d53b9a76336999..c07aec1505e31306b30cd4ce6c4353a446607458 100644 (file)
@@ -56,8 +56,8 @@
  * University of Illinois, Urbana-Champaign.
  */
 
-#ifdef AP_CHARSET_EBCDIC
 #include "ap_config.h"
+#if APR_CHARSET_EBCDIC
 #include "ebcdic.h"
 /*
 This code does basic character mapping for IBM's TPF operating system.
@@ -217,5 +217,5 @@ ascii2ebcdic(void *dest, const void *srce, size_t count)
                 *udest++ = os_toebcdic[*usrce++];
     }
 }
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
  
index e0bc3b6d0e4c17d4b90975f2e02f6f0577a4c71b..3126402ff1dd2acbfe478dc01487dd6008e4ad87 100644 (file)
@@ -156,8 +156,8 @@ static void show_compile_settings(void)
        printf(" -D PIPE_BUF=%ld\n",(long)PIPE_BUF);
 #endif
 #endif
-#ifdef AP_CHARSET_EBCDIC
-    printf(" -D AP_CHARSET_EBCDIC\n");
+#if APR_CHARSET_EBCDIC
+    printf(" -D APR_CHARSET_EBCDIC\n");
 #endif
 #ifdef APACHE_XLATE
     printf(" -D APACHE_XLATE\n");
@@ -308,7 +308,7 @@ int main(int argc, const char * const argv[])
     pconf = process->pconf;
     ap_server_argv0 = process->short_name;
 
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     if (ap_init_ebcdic(pglobal) != APR_SUCCESS) {
         destroy_and_exit_process(process, 1);
     }
index 6947b35f79388a51e87c42d629d5c83b55d9761f..16bedc588b8ca79010654e0121d88e56b9330db6 100644 (file)
@@ -1495,11 +1495,11 @@ static char x2c(const char *what)
 {
     register char digit;
 
-#ifndef AP_CHARSET_EBCDIC
+#if !APR_CHARSET_EBCDIC
     digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
     digit *= 16;
     digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0'));
-#else /*AP_CHARSET_EBCDIC*/
+#else /*APR_CHARSET_EBCDIC*/
     char xstr[5];
     xstr[0]='0';
     xstr[1]='x';
@@ -1507,7 +1507,7 @@ static char x2c(const char *what)
     xstr[3]=what[1];
     xstr[4]='\0';
     digit = apr_xlate_conv_byte(ap_hdrs_from_ascii, 0xFF & strtol(xstr, NULL, 16));
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
     return (digit);
 }
 
@@ -1583,9 +1583,9 @@ static const char c2x_table[] = "0123456789abcdef";
 
 static apr_inline unsigned char *c2x(unsigned what, unsigned char *where)
 {
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     what = apr_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what);
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
     *where++ = '%';
     *where++ = c2x_table[what >> 4];
     *where++ = c2x_table[what & 0xf];
index 0089b4e88b8987fa28e00dd230d506f851b244bf..c83719e64e3eb84966284c0cf31cfef5c8e98e09 100644 (file)
@@ -58,7 +58,7 @@
 
 #include "ap_config.h"
 
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
 
 #include "apr_strings.h"
 #include "httpd.h"
@@ -141,4 +141,4 @@ void ap_xlate_proto_from_ascii(char *buffer, apr_size_t len)
                           buffer, &outbytes_left);
 }
 
-#endif /* AP_CHARSET_EBCDIC */
+#endif /* APR_CHARSET_EBCDIC */
index 211997d255d87a88b4bb36d3bc3e2945e96cb217..c6b130cd18d938c9d38697aaddbf12f47d337f6d 100644 (file)
@@ -105,7 +105,7 @@ AP_DECLARE(char *) ap_md5_binary(apr_pool_t *p, const unsigned char *buf, int le
      */
 
     apr_MD5Init(&my_md5);
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     apr_MD5SetXlate(&my_md5, ap_hdrs_to_ascii);
 #endif
     apr_MD5Update(&my_md5, buf, (unsigned int)length);
index 2ad5a54f5443f23bca9f86ab6b3353611d0104e2..69ad9cbbf55be1b006546b86557f9a47536f7762 100644 (file)
@@ -462,7 +462,7 @@ AP_DECLARE(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
 
        /* if we see a bogus header don't ignore it. Shout and scream */
 
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
            /* Chances are that we received an ASCII header text instead of
             * the expected EBCDIC header lines. Try to auto-detect:
             */
@@ -487,7 +487,7 @@ AP_DECLARE(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
                                       w, &inbytes_left, w, &outbytes_left);
            }
        }
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
        if (!(l = strchr(w, ':'))) {
            char malformed[(sizeof MALFORMED_MESSAGE) + 1
                           + MALFORMED_HEADER_LENGTH_TO_SHOW];
index 9ed7dbacf8d0f5ec88998a7f91c617f2dcd49ec6..e5f2384da0a3d49ee60050670c8acdbdb88f33f1 100644 (file)
 #include <conio.h>
 #endif
 
-#if 'A' == 0xC1
-#define AP_CHARSET_EBCDIC
-#endif
-
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
 #define LF '\n'
 #define CR '\r'
 #else
 #define LF 10
 #define CR 13
-#endif /* AP_CHARSET_EBCDIC */
+#endif /* APR_CHARSET_EBCDIC */
 
 #define MAX_STRING_LEN 256
 
 char *tn;
 apr_pool_t *cntxt;
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
 apr_xlate_t *to_ascii;
 #endif
 
@@ -192,7 +188,7 @@ static void add_password(char *user, char *realm, apr_file_t *f)
     sprintf(string, "%s:%s:%s", user, realm, pw);
 
     apr_MD5Init(&context);
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     apr_MD5SetXlate(&context, to_ascii);
 #endif
     apr_MD5Update(&context, (unsigned char *) string, strlen(string));
@@ -241,7 +237,7 @@ int main(int argc, char *argv[])
     atexit(apr_terminate); 
     apr_create_pool(&cntxt, NULL);
 
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     rv = apr_xlate_open(&to_ascii, "ISO8859-1", APR_DEFAULT_CHARSET, cntxt);
     if (rv) {
         fprintf(stderr, "apr_xlate_open(): %s (%d)\n",
index 4ef063f950c5f854de2c4388d31b329ae0f5d7a8..832ae4b85219406d9f47ee7651d85efc5b37064d 100644 (file)
 #define unlink _unlink
 #endif
 
-#ifndef AP_CHARSET_EBCDIC
+#if !APR_CHARSET_EBCDIC
 #define LF 10
 #define CR 13
-#else /*AP_CHARSET_EBCDIC*/
+#else /*APR_CHARSET_EBCDIC*/
 #define LF '\n'
 #define CR '\r'
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
 
 #define MAX_STRING_LEN 256
 #define ALG_PLAIN 0
@@ -384,7 +384,7 @@ int main(int argc, char *argv[])
     int noninteractive = 0;
     int i;
     int args_left = 2;
-#ifdef AP_CHARSET_EBCDIC
+#if APR_CHARSET_EBCDIC
     apr_pool_t *pool;
     apr_status_t rv;
     apr_xlate_t *to_ascii;
@@ -408,7 +408,7 @@ int main(int argc, char *argv[])
         fprintf(stderr, "apr_MD5InitEBCDIC()->%d\n", rv);
         exit(1);
     }
-#endif /*AP_CHARSET_EBCDIC*/
+#endif /*APR_CHARSET_EBCDIC*/
 
     tempfilename = NULL;
     signal(SIGINT, (void (*)(int)) interrupted);