File indexing completed on 2026-05-19 08:08:31
0001
0002
0003 #ifndef _CL_IO_H
0004 #define _CL_IO_H
0005
0006 #include "cln/types.h"
0007 #include "cln/modules.h"
0008
0009
0010
0011 #ifdef floor
0012 #undef floor
0013 #include <iostream>
0014 #define floor cln_floor
0015 #else
0016 #include <iostream>
0017 #endif
0018
0019 namespace cln {
0020
0021
0022 typedef std::istream& cl_istream;
0023 typedef std::ostream& cl_ostream;
0024 extern std::ostream* cl_debugout_stream;
0025 #define cl_debugout (*cl_debugout_stream)
0026
0027
0028
0029 inline void fprintchar (std::ostream& stream, char c)
0030 {
0031 stream.put(c);
0032 }
0033
0034 inline void fprint (std::ostream& stream, const char * string)
0035 {
0036 stream << string;
0037 }
0038
0039
0040 extern void fprintdecimal (std::ostream& stream, unsigned int x);
0041 extern void fprintdecimal (std::ostream& stream, int x);
0042
0043 extern void fprintdecimal (std::ostream& stream, unsigned long x);
0044 extern void fprintdecimal (std::ostream& stream, long x);
0045
0046 extern void fprintdecimal (std::ostream& stream, unsigned long long x);
0047 extern void fprintdecimal (std::ostream& stream, long long x);
0048
0049 extern void fprinthexadecimal (std::ostream& stream, unsigned int x);
0050 extern void fprinthexadecimal (std::ostream& stream, int x);
0051
0052 extern void fprinthexadecimal (std::ostream& stream, unsigned long x);
0053 extern void fprinthexadecimal (std::ostream& stream, long x);
0054
0055 extern void fprinthexadecimal (std::ostream& stream, unsigned long long x);
0056 extern void fprinthexadecimal (std::ostream& stream, long long x);
0057
0058
0059 struct cl_print_flags;
0060 struct cl_print_number_flags;
0061 struct cl_print_real_flags;
0062 struct cl_print_rational_flags;
0063 struct cl_print_float_flags;
0064
0065 class cl_prin_globals_init_helper
0066 {
0067 static int count;
0068 public:
0069 cl_prin_globals_init_helper();
0070 ~cl_prin_globals_init_helper();
0071 };
0072 static cl_prin_globals_init_helper cl_prin_globals_init_helper_instance;
0073
0074
0075
0076 #define CL_DEFINE_PRINT_OPERATOR(_class_) \
0077 inline std::ostream& operator<< (std::ostream& stream, const _class_& x) \
0078 { \
0079 fprint(stream,x); \
0080 return stream; \
0081 }
0082
0083 }
0084
0085 #endif