00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00039 #ifndef __NUSMV_CORE_UTILS_OSTREAM_H__
00040 #define __NUSMV_CORE_UTILS_OSTREAM_H__
00041
00042
00043 #include <stdarg.h>
00044 #include "nusmv/core/node/printers/MasterPrinter.h"
00045 #include "nusmv/core/utils/utils.h"
00046
00053 typedef struct OStream_TAG* OStream_ptr;
00054
00061 #define OSTREAM(self) \
00062 ((OStream_ptr) self)
00063
00069 #define OSTREAM_CHECK_INSTANCE(self) \
00070 (nusmv_assert(OSTREAM(self) != OSTREAM(NULL)))
00071
00072
00073
00076
00077
00078
00079
00080
00081
00090 OStream_ptr OStream_create(FILE* stream);
00091
00102 OStream_ptr OStream_create_file(const char* fname, boolean append);
00103
00113 OStream_ptr OStream_copy(OStream_ptr self);
00114
00124 void OStream_destroy(OStream_ptr self);
00125
00135 void OStream_destroy_safe(OStream_ptr self);
00136
00137
00138
00139
00148 FILE* OStream_get_stream(const OStream_ptr self);
00149
00158 void OStream_printf(const OStream_ptr self,
00159 const char* format, ...);
00160
00168 void OStream_nprintf(const OStream_ptr self,
00169 const MasterPrinter_ptr node_printer,
00170 const char* format, ...);
00171
00180 void OStream_vprintf(const OStream_ptr self,
00181 const char* format, va_list args);
00182
00190 void OStream_nvprintf(const OStream_ptr self,
00191 const MasterPrinter_ptr node_printer,
00192 const char* format, va_list args);
00193
00200 void OStream_flush(const OStream_ptr self);
00201
00208 void OStream_inc_indent_size(OStream_ptr self);
00209
00216 void OStream_dec_indent_size(OStream_ptr self);
00217
00224 int OStream_get_indent_size(const OStream_ptr self);
00225
00232 void OStream_reset_indent_size(OStream_ptr self);
00233
00240 void OStream_set_indent_size(OStream_ptr self, int n);
00241
00248 void OStream_set_split_newline(OStream_ptr self, boolean enabled);
00249
00259 void OStream_set_stream(OStream_ptr self, FILE* stream);
00260
00268 FILE* OStream_reset_stream(OStream_ptr self);
00269
00274 #endif