1 //===- AutoConvert.h - Auto conversion between ASCII/EBCDIC -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains functions used for auto conversion between
10 // ASCII/EBCDIC codepages specific to z/OS.
11 //
12 //===----------------------------------------------------------------------===//i
13 
14 #ifndef LLVM_SUPPORT_AUTOCONVERT_H
15 #define LLVM_SUPPORT_AUTOCONVERT_H
16 
17 #ifdef __MVS__
18 #define CCSID_IBM_1047 1047
19 #define CCSID_UTF_8 1208
20 #include <system_error>
21 
22 namespace llvm {
23 
24 /// \brief Disable the z/OS enhanced ASCII auto-conversion for the file
25 /// descriptor.
26 std::error_code disableAutoConversion(int FD);
27 
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 
33 /// \brief Set the tag information for a file descriptor.
34 std::error_code setFileTag(int FD, int CCSID, bool Text);
35 
36 } // namespace llvm
37 
38 #endif // __MVS__
39 
40 #endif // LLVM_SUPPORT_AUTOCONVERT_H
41