xref: /llvm-project/flang/runtime/edit-input.h (revision bafbae238aa1948aa511c734a613a95d89a72546)
1 //===-- runtime/edit-input.h ------------------------------------*- 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 #ifndef FORTRAN_RUNTIME_EDIT_INPUT_H_
10 #define FORTRAN_RUNTIME_EDIT_INPUT_H_
11 
12 #include "format.h"
13 #include "io-stmt.h"
14 #include "flang/Decimal/decimal.h"
15 
16 namespace Fortran::runtime::io {
17 
18 bool EditIntegerInput(IoStatementState &, const DataEdit &, void *, int kind);
19 
20 template <int KIND>
21 bool EditRealInput(IoStatementState &, const DataEdit &, void *);
22 
23 bool EditLogicalInput(IoStatementState &, const DataEdit &, bool &);
24 
25 template <typename CHAR>
26 bool EditCharacterInput(
27     IoStatementState &, const DataEdit &, CHAR *, std::size_t);
28 
29 extern template bool EditRealInput<2>(
30     IoStatementState &, const DataEdit &, void *);
31 extern template bool EditRealInput<3>(
32     IoStatementState &, const DataEdit &, void *);
33 extern template bool EditRealInput<4>(
34     IoStatementState &, const DataEdit &, void *);
35 extern template bool EditRealInput<8>(
36     IoStatementState &, const DataEdit &, void *);
37 extern template bool EditRealInput<10>(
38     IoStatementState &, const DataEdit &, void *);
39 // TODO: double/double
40 extern template bool EditRealInput<16>(
41     IoStatementState &, const DataEdit &, void *);
42 
43 extern template bool EditCharacterInput(
44     IoStatementState &, const DataEdit &, char *, std::size_t);
45 extern template bool EditCharacterInput(
46     IoStatementState &, const DataEdit &, char16_t *, std::size_t);
47 extern template bool EditCharacterInput(
48     IoStatementState &, const DataEdit &, char32_t *, std::size_t);
49 
50 } // namespace Fortran::runtime::io
51 #endif // FORTRAN_RUNTIME_EDIT_INPUT_H_
52