]> www.ginac.de Git - cln.git/blob - include/cl_output.h
- Added lots of @cindex to produce an index.
[cln.git] / include / cl_output.h
1 // Output functions.
2
3 #ifndef _CL_OUTPUT_H
4 #define _CL_OUTPUT_H
5
6 #include "cl_types.h"
7 #include "cl_floatformat.h"
8 #include "cl_io.h"
9 #include "cl_string.h"
10
11 struct cl_print_rational_flags {
12         // Base in which rational numbers are to be printed.
13         unsigned int rational_base;
14         // Flag whether to print radix specifiers in Common Lisp syntax for
15         // rational numbers (#nR or #b or #o or #x prefixes, trailing dot).
16         cl_boolean rational_readably;
17 // Constructor.
18         cl_print_rational_flags () :
19                 rational_base (10),
20                 rational_readably (cl_false) {}
21 };
22
23 struct cl_print_float_flags {
24         // Flag whether to prefer type specific exponent markers over 'E'.
25         cl_boolean float_readably;
26         // If !float_readably, the format which earns the 'E' exponent marker.
27         cl_float_format_t default_float_format;
28 // Constructor.
29         cl_print_float_flags () :
30                 float_readably (cl_false),
31                 default_float_format (cl_float_format_ffloat) {}
32 };
33
34 struct cl_print_real_flags : cl_print_rational_flags, cl_print_float_flags {};
35
36 struct cl_print_complex_flags {
37         // Flag whether to use the Common Lisp #C(realpart imagpart) syntax,
38         cl_boolean complex_readably;
39 // Constructor.
40         cl_print_complex_flags () :
41                 complex_readably (cl_false) {}
42 };
43
44 struct cl_print_number_flags : cl_print_real_flags, cl_print_complex_flags {};
45
46 enum cl_print_vector_syntax_t {
47         vsyntax_algebraic,      // [a, b, c]
48         vsyntax_pretty,         // [a b c]
49         vsyntax_commonlisp      // #(a b c)
50 };
51
52 struct cl_print_vector_flags {
53         cl_print_vector_syntax_t vector_syntax;
54 // Constructor.
55         cl_print_vector_flags () :
56                 vector_syntax (vsyntax_pretty) {}
57 };
58
59 struct cl_print_univpoly_flags {
60         cl_string univpoly_varname;
61 // Constructor.
62         cl_print_univpoly_flags () :
63                 univpoly_varname ("x") {}
64 };
65
66 struct cl_print_flags : cl_print_number_flags, cl_print_vector_flags, cl_print_univpoly_flags {};
67
68 extern cl_print_flags cl_default_print_flags;
69
70 #endif /* _CL_OUTPUT_H */