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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @brief Utilities for EBCDIC conversion
21 * @defgroup APACHE_CORE_EBCDIC Utilities for EBCDIC conversion
22 * @ingroup APACHE_CORE
26 #ifndef APACHE_UTIL_EBCDIC_H
27 #define APACHE_UTIL_EBCDIC_H
34 #include "apr_xlate.h"
36 #include "util_charset.h"
38 #if APR_CHARSET_EBCDIC || defined(DOXYGEN)
41 * Setup all of the global translation handlers.
42 * @param pool The pool to allocate out of.
43 * @note On non-EBCDIC system, this function does <b>not</b> exist.
44 * So, its use should be guarded by \#if APR_CHARSET_EBCDIC.
46 apr_status_t ap_init_ebcdic(apr_pool_t *pool);
49 * Convert protocol data from the implementation character
51 * @param buffer Buffer to translate.
52 * @param len Number of bytes to translate.
53 * @note On non-EBCDIC system, this function is replaced by an
56 void ap_xlate_proto_to_ascii(char *buffer, apr_size_t len);
59 * Convert protocol data to the implementation character
61 * @param buffer Buffer to translate.
62 * @param len Number of bytes to translate.
63 * @note On non-EBCDIC system, this function is replaced by an
66 void ap_xlate_proto_from_ascii(char *buffer, apr_size_t len);
69 * Convert protocol data from the implementation character
70 * set to ASCII, then send it.
71 * @param r The current request.
72 * @param ... The strings to write, followed by a NULL pointer.
73 * @note On non-EBCDIC system, this function is replaced by a call to
76 int ap_rvputs_proto_in_ascii(request_rec *r, ...);
78 #else /* APR_CHARSET_EBCDIC */
80 #define ap_xlate_proto_to_ascii(x,y) /* NOOP */
81 #define ap_xlate_proto_from_ascii(x,y) /* NOOP */
83 #define ap_rvputs_proto_in_ascii ap_rvputs
85 #endif /* APR_CHARSET_EBCDIC */
91 #endif /* !APACHE_UTIL_EBCDIC_H */