AutoConvert.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- AutoConvert.h - Auto conversion between ASCII/EBCDIC -----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file contains functions used for auto conversion between
  15. // ASCII/EBCDIC codepages specific to z/OS.
  16. //
  17. //===----------------------------------------------------------------------===//i
  18. #ifndef LLVM_SUPPORT_AUTOCONVERT_H
  19. #define LLVM_SUPPORT_AUTOCONVERT_H
  20. #ifdef __MVS__
  21. #define CCSID_IBM_1047 1047
  22. #define CCSID_UTF_8 1208
  23. #include <system_error>
  24. namespace llvm {
  25. /// \brief Disable the z/OS enhanced ASCII auto-conversion for the file
  26. /// descriptor.
  27. std::error_code disableAutoConversion(int FD);
  28. /// \brief Query the z/OS enhanced ASCII auto-conversion status of a file
  29. /// descriptor and force the conversion if the file is not tagged with a
  30. /// codepage.
  31. std::error_code enableAutoConversion(int FD);
  32. /// \brief Set the tag information for a file descriptor.
  33. std::error_code setFileTag(int FD, int CCSID, bool Text);
  34. } // namespace llvm
  35. #endif // __MVS__
  36. #endif // LLVM_SUPPORT_AUTOCONVERT_H
  37. #ifdef __GNUC__
  38. #pragma GCC diagnostic pop
  39. #endif