util_ebcdic.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. * @file util_ebcdic.h
  18. * @brief Utilities for EBCDIC conversion
  19. *
  20. * @defgroup APACHE_CORE_EBCDIC Utilities for EBCDIC conversion
  21. * @ingroup APACHE_CORE
  22. * @{
  23. */
  24. #ifndef APACHE_UTIL_EBCDIC_H
  25. #define APACHE_UTIL_EBCDIC_H
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include "apr_xlate.h"
  30. #include "httpd.h"
  31. #include "util_charset.h"
  32. #if APR_CHARSET_EBCDIC || defined(DOXYGEN)
  33. /**
  34. * Setup all of the global translation handlers.
  35. * @param pool The pool to allocate out of.
  36. * @note On non-EBCDIC system, this function does <b>not</b> exist.
  37. * So, its use should be guarded by \#if APR_CHARSET_EBCDIC.
  38. */
  39. apr_status_t ap_init_ebcdic(apr_pool_t *pool);
  40. /**
  41. * Convert protocol data from the implementation character
  42. * set to ASCII.
  43. * @param buffer Buffer to translate.
  44. * @param len Number of bytes to translate.
  45. * @note On non-EBCDIC system, this function is replaced by an
  46. * empty macro.
  47. */
  48. void ap_xlate_proto_to_ascii(char *buffer, apr_size_t len);
  49. /**
  50. * Convert protocol data to the implementation character
  51. * set from ASCII.
  52. * @param buffer Buffer to translate.
  53. * @param len Number of bytes to translate.
  54. * @note On non-EBCDIC system, this function is replaced by an
  55. * empty macro.
  56. */
  57. void ap_xlate_proto_from_ascii(char *buffer, apr_size_t len);
  58. /**
  59. * Convert protocol data from the implementation character
  60. * set to ASCII, then send it.
  61. * @param r The current request.
  62. * @param ... The strings to write, followed by a NULL pointer.
  63. * @note On non-EBCDIC system, this function is replaced by a call to
  64. * #ap_rvputs.
  65. */
  66. int ap_rvputs_proto_in_ascii(request_rec *r, ...);
  67. #else /* APR_CHARSET_EBCDIC */
  68. #define ap_xlate_proto_to_ascii(x,y) /* NOOP */
  69. #define ap_xlate_proto_from_ascii(x,y) /* NOOP */
  70. #define ap_rvputs_proto_in_ascii ap_rvputs
  71. #endif /* APR_CHARSET_EBCDIC */
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* !APACHE_UTIL_EBCDIC_H */
  76. /** @} */