Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:08:31

0001 // Input functions.
0002 
0003 #ifndef _CL_INPUT_H
0004 #define _CL_INPUT_H
0005 
0006 #include "cln/types.h"
0007 #include "cln/floatformat.h"
0008 #include "cln/io.h"
0009 
0010 namespace cln {
0011 
0012 struct cl_read_float_flags {
0013     // The float format used when reading floats with exponent marker 'E'.
0014     float_format_t default_float_format;
0015     // The float format used when reading floats with exponent marker 'L'.
0016     float_format_t default_lfloat_format;
0017     // Flag whether floats specified with more digits than corresponding
0018     // to the exponent marker they contain, but without _nnn suffix, will
0019     // get a precision corresponding to their number of significant digits.
0020     bool mantissa_dependent_float_format;
0021 };
0022 
0023 // Specifies the possible results of a read operation.
0024 enum cl_read_syntax_t {
0025     syntax_integer = 1 << 0,                // -> cl_I
0026     syntax_ratio = 1 << 1,                  // -> cl_RA
0027     syntax_rational = syntax_integer | syntax_ratio,    // -> cl_RA
0028     syntax_sfloat = 1 << 2,                 // -> cl_SF
0029     syntax_ffloat = 1 << 3,                 // -> cl_FF
0030     syntax_dfloat = 1 << 4,                 // -> cl_DF
0031     syntax_lfloat = 1 << 5,                 // -> cl_LF
0032     syntax_float = syntax_sfloat | syntax_ffloat | syntax_dfloat | syntax_lfloat,
0033                                 // -> cl_F
0034     syntax_real = syntax_rational | syntax_float,       // -> cl_R
0035     syntax_complex = 1 << 6,                // -> cl_N
0036     syntax_number = syntax_real | syntax_complex,       // -> cl_N
0037     syntax_maybe_bad = 1 << 7               // avoid errors
0038 };
0039 
0040 // Specifies the syntax to be applied to a read operation.
0041 enum cl_read_lsyntax_t {
0042         // Standard algebraic notation.
0043     lsyntax_standard = 0,
0044         // Extended algebraic notation: x+yi
0045     lsyntax_algebraic = 1 << 0,
0046         // Common Lisp notation: #b, #o, #x, #r, #c
0047     lsyntax_commonlisp = 1 << 1,
0048         // All of them.
0049     lsyntax_all = lsyntax_algebraic | lsyntax_commonlisp
0050 };
0051 
0052 struct cl_read_flags {
0053     cl_read_syntax_t syntax;
0054     cl_read_lsyntax_t lsyntax;
0055     unsigned int rational_base;
0056     cl_read_float_flags float_flags;
0057 };
0058 
0059 }  // namespace cln
0060 
0061 #endif /* _CL_INPUT_H */