20 #define INDENT_PER_LEVEL 2
21 #define NEXT_INDENT (indent+INDENT_PER_LEVEL)
26 #define pprop(tag) do { if (prop&PROP_##tag) { fputc(sep, OUT); sep = '|'; fputs(#tag, OUT); } } while(0)
36 pprop(CURSOR_ALLOWED);
38 pprop(CONSENSUS_RELEVANT);
39 pprop(ALIGNMENT_DATA);
46 #define plev(tag) do { if (level&LEV_##tag) { fputc(sep, OUT); sep = '|'; fputs(#tag, OUT); } } while(0)
57 plev(SEQUENCE_STRING);
71 static bool at_start_of_line =
true;
73 if (at_start_of_line)
while (indent-->0)
fputc(
' ', OUT);
75 inline void print_indented_nocr(
size_t indent,
const char *text) {
78 at_start_of_line =
false;
80 inline void print_indented(
size_t indent,
const char *text) {
81 print_indented_nocr(indent, text);
83 at_start_of_line =
true;
86 inline void CR() {
fputc(
'\n', OUT); }
88 inline void openDump(
size_t indent,
const char *className,
void *thisPtr,
bool allow_zero_this =
false) {
89 print_indented_nocr(indent, className);
92 fprintf(OUT,
"((%s *)%p)\n", className, thisPtr);
93 at_start_of_line =
true;
96 if (!allow_zero_this) {
97 fputs(
"this=zero-pointer!\n", OUT);
98 at_start_of_line =
true;
102 inline void closeDump(
size_t indent) {
103 print_indented(indent,
"}");
107 static void dumpProperties(
size_t indent,
const char *varname,
ED4_properties prop) {
110 printProperties(prop);
114 static void dumpLevel(
size_t indent,
const char *varname,
ED4_level level) {
124 void ED4_base::dump_base(
size_t indent)
const {
125 openDump(indent,
"ED4_Base", (
void*)
this);
127 spec.dump(NEXT_INDENT);
130 dumpProperties(NEXT_INDENT,
"dynamic_prop",
dynamic_prop);
138 void ED4_container::dump_container(
size_t indent)
const {
139 openDump(indent,
"ED4_container", (
void*)
this);
141 member(i)->dump(NEXT_INDENT);
149 void ED4_manager::dump_base(
size_t indent)
const {
150 openDump(indent,
"ED4_manager", (
void*)
this);
151 ED4_base::dump_base(NEXT_INDENT);
152 dump_container(NEXT_INDENT);
157 const char *spec_type =
"<invalid>";
162 case ED4_SP_NONE: spec_type =
"None (invalid!)";
break;
167 void ED4_species_manager::dump(
size_t indent)
const {
168 openDump(indent,
"ED4_species_manager", (
void*)
this);
169 ED4_base::dump_base(NEXT_INDENT);
170 print_indented(NEXT_INDENT,
GBS_global_string(
"type = %s", readable_ED4_species_type(type)));
171 dump_container(NEXT_INDENT);
176 #define STANDARD_BASE_DUMP_CODE(mytype) do { \
177 openDump(indent, #mytype, (void*)this); \
178 mytype::dump_my_base(NEXT_INDENT); \
182 #define STANDARD_LEAF_DUMP_CODE(mytype) do { \
183 openDump(indent, #mytype, (void*)this); \
184 mytype::dump_my_base(NEXT_INDENT); \
189 #define STANDARD_DUMP_BASE(self) void self::dump_base(size_t indent) const { STANDARD_BASE_DUMP_CODE(self); }
190 #define STANDARD_DUMP_LEAF(self) void self::dump(size_t indent) const { STANDARD_LEAF_DUMP_CODE(self); }
192 #define STANDARD_DUMP_MID(self) STANDARD_DUMP_BASE(self); STANDARD_DUMP_LEAF(self)
203 STANDARD_DUMP_LEAF(ED4_columnStat_terminal);
208 STANDARD_DUMP_LEAF(ED4_main_manager);
214 STANDARD_DUMP_LEAF(ED4_pure_text_terminal);
216 STANDARD_DUMP_LEAF(ED4_sequence_info_terminal);
218 STANDARD_DUMP_LEAF(ED4_spacer_terminal);
219 STANDARD_DUMP_LEAF(ED4_species_name_terminal);
220 STANDARD_DUMP_LEAF(ED4_tree_terminal);
221 STANDARD_DUMP_LEAF(ED4_flag_header_terminal);
222 STANDARD_DUMP_LEAF(ED4_flag_terminal);
227 void ED4_objspec::dump(
size_t indent)
const {
228 openDump(indent,
"ED4_objspec", (
void*)
this);
229 dumpProperties(NEXT_INDENT,
"static_prop",
static_prop);
230 dumpLevel(NEXT_INDENT,
"level", level);
232 dumpLevel(NEXT_INDENT,
"used_children", used_children);
234 dumpLevel(NEXT_INDENT,
"allowed_descendants", allowed_descendants);
235 dumpLevel(NEXT_INDENT,
"possible_descendants", possible_descendants);
242 void ED4_extension::dump(
size_t indent)
const {
243 openDump(indent,
"ED4_extension", (
void*)
this);
251 void ED4_update_info::dump(
size_t indent)
const {
252 openDump(indent,
"ED4_update_info", (
void*)
this);
ED4_base * member(ED4_index i) const
ED4_properties static_prop
const char * GBS_global_string(const char *templat,...)
ED4_level restriction_level
ED4_index members() const
unsigned int clear_at_refresh
unsigned int linked_to_folding_line
unsigned int refresh_horizontal_scrolling
unsigned int update_requested
unsigned int delete_requested
fputs(TRACE_PREFIX, stderr)
ED4_level allowed_children
void print_indent(int indent)
ED4_properties dynamic_prop
unsigned int linked_to_scrolled_rectangle