Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Output functions.
0002 
0003 #ifndef _CL_OUTPUT_H
0004 #define _CL_OUTPUT_H
0005 
0006 #include "cln/types.h"
0007 #include "cln/floatformat.h"
0008 #include "cln/io.h"
0009 #include "cln/string.h"
0010 
0011 namespace cln {
0012 
0013 struct cl_print_rational_flags {
0014     // Base in which rational numbers are to be printed.
0015     unsigned int rational_base;
0016     // Flag whether to print radix specifiers in Common Lisp syntax for
0017     // rational numbers (#nR or #b or #o or #x prefixes, trailing dot).
0018     bool rational_readably;
0019 // Constructor.
0020     cl_print_rational_flags () :
0021         rational_base (10),
0022         rational_readably (false) {}
0023 };
0024 
0025 struct cl_print_float_flags {
0026     // Flag whether to prefer type specific exponent markers over 'E'.
0027     bool float_readably;
0028     // If !float_readably, the format which earns the 'E' exponent marker.
0029     float_format_t default_float_format;
0030 // Constructor.
0031     cl_print_float_flags () :
0032         float_readably (false),
0033         default_float_format (float_format_ffloat) {}
0034 };
0035 
0036 struct cl_print_real_flags : cl_print_rational_flags, cl_print_float_flags {};
0037 
0038 struct cl_print_complex_flags {
0039     // Flag whether to use the Common Lisp #C(realpart imagpart) syntax,
0040     bool complex_readably;
0041 // Constructor.
0042     cl_print_complex_flags () :
0043         complex_readably (false) {}
0044 };
0045 
0046 struct cl_print_number_flags : cl_print_real_flags, cl_print_complex_flags {};
0047 
0048 enum cl_print_vector_syntax_t {
0049     vsyntax_algebraic,  // [a, b, c]
0050     vsyntax_pretty,     // [a b c]
0051     vsyntax_commonlisp  // #(a b c)
0052 };
0053 
0054 struct cl_print_vector_flags {
0055     cl_print_vector_syntax_t vector_syntax;
0056 // Constructor.
0057     cl_print_vector_flags () :
0058         vector_syntax (vsyntax_pretty) {}
0059 };
0060 
0061 struct cl_print_univpoly_flags {
0062     cl_string univpoly_varname;
0063 // Constructor.
0064     cl_print_univpoly_flags () :
0065         univpoly_varname ("x") {}
0066 };
0067 
0068 struct cl_print_flags : cl_print_number_flags, cl_print_vector_flags, cl_print_univpoly_flags {};
0069 
0070 extern cl_print_flags default_print_flags;
0071 
0072 }  // namespace cln
0073 
0074 #endif /* _CL_OUTPUT_H */