Apache HTTPD
util_ebcdic.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "ap_config.h"
18
19#if APR_CHARSET_EBCDIC
20
21#include "apr_strings.h"
22#include "httpd.h"
23#include "http_log.h"
24#include "http_core.h"
25#include "util_ebcdic.h"
26
27/* we know core's module_index is 0 */
28#undef APLOG_MODULE_INDEX
29#define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
30
32{
33 apr_status_t rv;
34
36 if (rv) {
38 "apr_xlate_open() failed");
39 return rv;
40 }
41
43 if (rv) {
45 "apr_xlate_open() failed");
46 return rv;
47 }
48
50 if (rv) {
52 "apr_MD5InitEBCDIC() failed");
53 return rv;
54 }
55
57 if (rv) {
59 "apr_base64init_ebcdic() failed");
60 return rv;
61 }
62
64 if (rv) {
66 "apr_SHA1InitEBCDIC() failed");
67 return rv;
68 }
69
70 return APR_SUCCESS;
71}
72
74{
76
80}
81
83{
85
89}
90
92{
93 va_list va;
94 const char *s;
95 char *ascii_s;
97 apr_size_t written = 0;
98
99 va_start(va, r);
100 while (1) {
101 s = va_arg(va, const char *);
102 if (s == NULL)
103 break;
104 len = strlen(s);
107 if (ap_rputs(ascii_s, r) < 0) {
108 va_end(va);
109 return -1;
110 }
111 written += len;
112 }
113 va_end(va);
114
115 return written;
116}
117#endif /* APR_CHARSET_EBCDIC */
Symbol export macros and hook functions.
const char apr_size_t len
Definition ap_regex.h:187
APR Strings library.
request_rec * r
#define ap_xlate_proto_to_ascii(x, y)
Definition util_ebcdic.h:80
#define ap_xlate_proto_from_ascii(x, y)
Definition util_ebcdic.h:81
#define ap_rvputs_proto_in_ascii
Definition util_ebcdic.h:83
#define APLOGNO(n)
Definition http_log.h:117
#define APLOG_ERR
Definition http_log.h:67
#define ap_log_error
Definition http_log.h:370
#define APLOG_MARK
Definition http_log.h:283
static APR_INLINE int ap_rputs(const char *str, request_rec *r)
apr_brigade_flush void va_list va
const char apr_size_t * inbytes_left
Definition apr_xlate.h:119
#define APR_DEFAULT_CHARSET
Definition apr_xlate.h:78
const char apr_size_t char apr_size_t * outbytes_left
Definition apr_xlate.h:121
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
char * buffer
const char * s
Definition apr_strings.h:95
CORE HTTP Daemon.
Apache Logging library.
HTTP Daemon routines.
return NULL
Definition mod_so.c:359
A structure that represents the current request.
Definition httpd.h:845
apr_pool_t * pool
Definition httpd.h:847
Utilities for EBCDIC conversion.