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