]> www.ginac.de Git - cln.git/blob - include/cl_input.h
Make @exec_prefix@ usable in shell scripts.
[cln.git] / include / cl_input.h
1 // Input functions.
2
3 #ifndef _CL_INPUT_H
4 #define _CL_INPUT_H
5
6 #include "cl_types.h"
7 #include "cl_floatformat.h"
8 #include "cl_io.h"
9
10 struct cl_read_float_flags {
11         // The float format used when reading floats with exponent marker 'E'.
12         cl_float_format_t default_float_format;
13         // The float format used when reading floats with exponent marker 'L'.
14         cl_float_format_t default_lfloat_format;
15         // Flag whether floats specified with more digits than corresponding
16         // to the exponent marker they contain, but without _nnn suffix, will
17         // get a precision corresponding to their number of significant digits.
18         cl_boolean mantissa_dependent_float_format;
19 };
20
21 // Specifies the possible results of a read operation.
22 enum cl_read_syntax_t {
23         syntax_integer = 1 << 0,                                // -> cl_I
24         syntax_ratio = 1 << 1,                                  // -> cl_RA
25         syntax_rational = syntax_integer | syntax_ratio,        // -> cl_RA
26         syntax_sfloat = 1 << 2,                                 // -> cl_SF
27         syntax_ffloat = 1 << 3,                                 // -> cl_FF
28         syntax_dfloat = 1 << 4,                                 // -> cl_DF
29         syntax_lfloat = 1 << 5,                                 // -> cl_LF
30         syntax_float = syntax_sfloat | syntax_ffloat | syntax_dfloat | syntax_lfloat,
31                                                                 // -> cl_F
32         syntax_real = syntax_rational | syntax_float,           // -> cl_R
33         syntax_complex = 1 << 6,                                // -> cl_N
34         syntax_number = syntax_real | syntax_complex,           // -> cl_N
35         syntax_maybe_bad = 1 << 7                               // avoid errors
36 };
37
38 // Specifies the syntax to be applied to a read operation.
39 enum cl_read_lsyntax_t {
40                 // Standard algebraic notation.
41         lsyntax_standard = 0,
42                 // Extended algebraic notation: x+yi
43         lsyntax_algebraic = 1 << 0,
44                 // Common Lisp notation: #b, #o, #x, #r, #c
45         lsyntax_commonlisp = 1 << 1,
46                 // All of them.
47         lsyntax_all = lsyntax_algebraic | lsyntax_commonlisp
48 };
49
50 struct cl_read_flags {
51         cl_read_syntax_t syntax;
52         cl_read_lsyntax_t lsyntax;
53         unsigned int rational_base;
54         cl_read_float_flags float_flags;
55 };
56
57 #endif /* _CL_INPUT_H */