rts-enquiries.c
1 //! @file rts-enquiries.c
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-2023 J. Marcel van der Veer [algol68g@xs4all.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 //! Environment enquiries.
25
26 #include "a68g.h"
27 #include "a68g-genie.h"
28 #include "a68g-prelude.h"
29 #include "a68g-physics.h"
30 #include "a68g-numbers.h"
31 #include "a68g-mp.h"
32
33 A68_ENV_INT (genie_int_lengths, 3);
34 A68_ENV_INT (genie_int_shorths, 1);
35 A68_ENV_INT (genie_real_lengths, 3);
36 A68_ENV_INT (genie_real_shorths, 1);
37 A68_ENV_INT (genie_complex_lengths, 3);
38 A68_ENV_INT (genie_complex_shorths, 1);
39 #if (A68_LEVEL >= 3)
40 A68_ENV_INT (genie_bits_lengths, 2);
41 #else
42 A68_ENV_INT (genie_bits_lengths, 3);
43 #endif
44 A68_ENV_INT (genie_bits_shorths, 1);
45 A68_ENV_INT (genie_bytes_lengths, 2);
46 A68_ENV_INT (genie_bytes_shorths, 1);
47 A68_ENV_INT (genie_int_width, INT_WIDTH);
48 A68_ENV_INT (genie_long_int_width, LONG_INT_WIDTH);
49 A68_ENV_INT (genie_long_mp_int_width, LONG_LONG_INT_WIDTH);
50 A68_ENV_INT (genie_real_width, REAL_WIDTH);
51 A68_ENV_INT (genie_long_real_width, LONG_REAL_WIDTH);
52 A68_ENV_INT (genie_long_mp_real_width, LONG_LONG_REAL_WIDTH);
53 A68_ENV_INT (genie_exp_width, EXP_WIDTH);
54 A68_ENV_INT (genie_long_exp_width, LONG_EXP_WIDTH);
55 A68_ENV_INT (genie_long_mp_exp_width, LONG_LONG_EXP_WIDTH);
56 A68_ENV_INT (genie_bits_width, BITS_WIDTH);
57 #if (A68_LEVEL >= 3)
58 A68_ENV_INT (genie_long_bits_width, LONG_BITS_WIDTH);
59 #else
60 A68_ENV_INT (genie_long_bits_width, get_mp_bits_width (M_LONG_BITS));
61 A68_ENV_INT (genie_long_mp_bits_width, get_mp_bits_width (M_LONG_LONG_BITS));
62 #endif
63 A68_ENV_INT (genie_bytes_width, BYTES_WIDTH);
64 A68_ENV_INT (genie_long_bytes_width, LONG_BYTES_WIDTH);
65 A68_ENV_INT (genie_max_abs_char, UCHAR_MAX);
66 A68_ENV_INT (genie_max_int, A68_MAX_INT);
67 A68_ENV_INT (genie_mp_radix, MP_RADIX);
68 A68_ENV_INT (genie_stack_pointer, A68_SP);
69 A68_ENV_INT (genie_system_stack_size, A68 (stack_size));
70 A68_ENV_REAL (genie_cputime, seconds () - A68 (cputime_0));
71 A68_ENV_REAL (genie_max_real, REAL_MAX);
72 A68_ENV_REAL (genie_min_real, REAL_MIN);
73 A68_ENV_REAL (genie_pi, CONST_PI);
74 A68_ENV_REAL (genie_small_real, REAL_EPSILON);