util_ebcdic.h revision ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dc
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd/* Copyright 2000-2004 Apache Software Foundation
1f728f035fca81594193e198b40bfa732b1c02ebtrawick *
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * Licensed under the Apache License, Version 2.0 (the "License");
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * you may not use this file except in compliance with the License.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * You may obtain a copy of the License at
1f728f035fca81594193e198b40bfa732b1c02ebtrawick *
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * http://www.apache.org/licenses/LICENSE-2.0
1f728f035fca81594193e198b40bfa732b1c02ebtrawick *
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * Unless required by applicable law or agreed to in writing, software
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * distributed under the License is distributed on an "AS IS" BASIS,
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * See the License for the specific language governing permissions and
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * limitations under the License.
1f728f035fca81594193e198b40bfa732b1c02ebtrawick */
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
1f728f035fca81594193e198b40bfa732b1c02ebtrawick#ifndef APACHE_UTIL_EBCDIC_H
1f728f035fca81594193e198b40bfa732b1c02ebtrawick#define APACHE_UTIL_EBCDIC_H
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
1f728f035fca81594193e198b40bfa732b1c02ebtrawick#ifdef __cplusplus
1f728f035fca81594193e198b40bfa732b1c02ebtrawickextern "C" {
1f728f035fca81594193e198b40bfa732b1c02ebtrawick#endif
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
1f728f035fca81594193e198b40bfa732b1c02ebtrawick#include "apr_xlate.h"
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb#include "httpd.h"
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick#include "util_charset.h"
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb/**
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb * @package Utilities for EBCDIC conversion
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb */
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawick#if APR_CHARSET_EBCDIC
886cd69ebf69e990dbc365be87ff8ea7cd681904rbb
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb/**
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb * Setup all of the global translation handlers
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb * @param pool pool to allocate out of
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb */
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbbapr_status_t ap_init_ebcdic(apr_pool_t *pool);
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick/**
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * Convert protocol data from the implementation character
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * set to ASCII.
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * @param buffer buffer to translate
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * @param len number of bytes to translate
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick */
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickvoid ap_xlate_proto_to_ascii(char *buffer, apr_size_t len);
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick/**
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * Convert protocol data to the implementation character
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * set from ASCII.
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * @param buffer buffer to translate
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick * @param len number of bytes to translate
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick */
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickvoid ap_xlate_proto_from_ascii(char *buffer, apr_size_t len);
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick
8d290205047d88e37555019fe9a26f1c5ece7023gregames/**
8d290205047d88e37555019fe9a26f1c5ece7023gregames * Convert protocol data from the implementation charater
8d290205047d88e37555019fe9a26f1c5ece7023gregames * set to ASCII, then send it.
8d290205047d88e37555019fe9a26f1c5ece7023gregames * @param r the current request
8d290205047d88e37555019fe9a26f1c5ece7023gregames * @param ... the strings to write, followed by a NULL pointer
8d290205047d88e37555019fe9a26f1c5ece7023gregames */
8d290205047d88e37555019fe9a26f1c5ece7023gregamesint ap_rvputs_proto_in_ascii(request_rec *r, ...);
8d290205047d88e37555019fe9a26f1c5ece7023gregames
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawick#else /* APR_CHARSET_EBCDIC */
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick#define ap_xlate_proto_to_ascii(x,y) /* NOOP */
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick#define ap_xlate_proto_from_ascii(x,y) /* NOOP */
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick
8d290205047d88e37555019fe9a26f1c5ece7023gregames#define ap_rvputs_proto_in_ascii ap_rvputs
8d290205047d88e37555019fe9a26f1c5ece7023gregames
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawick#endif /* APR_CHARSET_EBCDIC */
12d7cc79eeb598697b4c9046991035d91fac2476nd
12d7cc79eeb598697b4c9046991035d91fac2476nd#ifdef __cplusplus
12d7cc79eeb598697b4c9046991035d91fac2476nd}
12d7cc79eeb598697b4c9046991035d91fac2476nd#endif
12d7cc79eeb598697b4c9046991035d91fac2476nd
1f728f035fca81594193e198b40bfa732b1c02ebtrawick#endif /* !APACHE_UTIL_EBCDIC_H */