a68g-conversion.h
1 //! @file a68g-conversion.h
2 //! @author J. Marcel van der Veer
3
4 //! @section Copyright
5 //!
6 //! This file is part of Algol68G - an Algol 68 compiler-interpreter.
7 //! Copyright 2001-2026 J. Marcel van der Veer [algol68g@algol68genie.nl].
8
9 //! @section License
10 //!
11 //! This program is free software; you can redistribute it and/or modify it
12 //! under the terms of the GNU General Public License as published by the
13 //! Free Software Foundation; either version 3 of the License, or
14 //! (at your option) any later version.
15 //!
16 //! This program is distributed in the hope that it will be useful, but
17 //! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 //! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 //! more details. You should have received a copy of the GNU General Public
20 //! License along with this program. If not, see [http://www.gnu.org/licenses/].
21
22 //! @section Synopsis
23 //!
24 //! Mode conversion related definitions.
25
26 #if !defined (__A68G_CONVERSION_H__)
27 #define __A68G_CONVERSION_H__
28
29 BOOL_T convert_radix (NODE_T *, UNSIGNED_T, int, int);
30 BOOL_T genie_string_to_value_internal (NODE_T *, MOID_T *, char *, BYTE_T *);
31 INT_T mp_to_int (NODE_T *, MP_T *, int);
32 MP_T *int_to_mp (NODE_T *, MP_T *, INT_T, int);
33 MP_T *real_to_mp (NODE_T *, MP_T *, REAL_T, int);
34 MP_T *string_to_mp (NODE_T *, MP_T *, char *, int);
35 MP_T *ten_up_mp (NODE_T *, MP_T *, int, int);
36 MP_T *unt_to_mp (NODE_T *, MP_T *, UNSIGNED_T, int);
37 REAL_T mp_to_real (NODE_T *, MP_T *, int);
38 REAL_T string_to_real (NODE_T *p, char *);
39 REAL_T ten_up (int);
40 UNSIGNED_T bits_to_int (NODE_T *, char *);
41
42 #if (A68G_LEVEL <= 2)
43 BOOL_T convert_radix_mp (NODE_T *, MP_T *, int, int, MOID_T *, MP_T *, MP_T *);
44 #endif
45
46 #if (A68G_LEVEL >= 3)
47 BOOL_T convert_radix_double (NODE_T *, DOUBLE_NUM_T, int, int);
48 BOOL_T string_to_double_int (NODE_T *, A68G_LONG_INT *, char *);
49 DOUBLE_NUM_T string_to_double_bits (NODE_T *, char *);
50 DOUBLE_NUM_T double_int_to_double (NODE_T *, DOUBLE_NUM_T);
51 DOUBLE_NUM_T mp_to_double_int (NODE_T *, MP_T *, int);
52 DOUBLE_T mp_to_double (NODE_T *, MP_T *, int);
53 DOUBLE_T string_to_double (NODE_T *, char *);
54 DOUBLE_T ten_up_double (int);
55 MP_T *double_int_to_mp (NODE_T *, MP_T *, DOUBLE_NUM_T, int);
56 MP_T *double_to_mp (NODE_T *, MP_T *, DOUBLE_T, int);
57 DOUBLE_NUM_T double_to_double_int (NODE_T *, DOUBLE_NUM_T);
58 #endif
59
60 #endif
© J.M. van der Veer • jmvdveer@algol68genie.nl