dot, pt++
This commit is contained in:
parent
807e1a2bc4
commit
eea1be7031
16
include/sl.h
16
include/sl.h
|
@ -1467,7 +1467,7 @@
|
||||||
__SKIP_NEXT_ENTRIES_T2B(field, node) \
|
__SKIP_NEXT_ENTRIES_T2B(field, node) \
|
||||||
{ \
|
{ \
|
||||||
next = (node->field.sle.next[lvl] == slist->slh_tail) ? NULL : node->field.sle.next[lvl]; \
|
next = (node->field.sle.next[lvl] == slist->slh_tail) ? NULL : node->field.sle.next[lvl]; \
|
||||||
width = __skip_dot_width_##decl(slist, next, lvl); \
|
width = __skip_dot_width_##decl(slist, (next == NULL ? node : next), lvl); \
|
||||||
fprintf(os, " { <w%zu> %zu | <f%zu> ", lvl, width, lvl); \
|
fprintf(os, " { <w%zu> %zu | <f%zu> ", lvl, width, lvl); \
|
||||||
if (next) \
|
if (next) \
|
||||||
fprintf(os, "%p } |", (void *)next); \
|
fprintf(os, "%p } |", (void *)next); \
|
||||||
|
@ -1477,7 +1477,7 @@
|
||||||
} \
|
} \
|
||||||
if (fn) { \
|
if (fn) { \
|
||||||
fn(node, buf); \
|
fn(node, buf); \
|
||||||
fprintf(os, " <f0> \u219F %zu // %s \"\n", node->field.sle.height, buf); \
|
fprintf(os, " <f0> \u219F %zu \u226B %s \"\n", node->field.sle.height, buf); \
|
||||||
} else { \
|
} else { \
|
||||||
fprintf(os, " <f0> \u219F %zu \"\n", node->field.sle.height); \
|
fprintf(os, " <f0> \u219F %zu \"\n", node->field.sle.height); \
|
||||||
} \
|
} \
|
||||||
|
@ -1542,7 +1542,7 @@
|
||||||
int prefix##skip_dot_##decl(FILE *os, decl##_t *slist, size_t nsg, skip_sprintf_node_##decl##_t fn) \
|
int prefix##skip_dot_##decl(FILE *os, decl##_t *slist, size_t nsg, skip_sprintf_node_##decl##_t fn) \
|
||||||
{ \
|
{ \
|
||||||
int letitgo = 0; \
|
int letitgo = 0; \
|
||||||
size_t width, i; \
|
size_t width = 0, i; \
|
||||||
decl##_node_t *node, *next; \
|
decl##_node_t *node, *next; \
|
||||||
\
|
\
|
||||||
if (slist == NULL || fn == NULL) \
|
if (slist == NULL || fn == NULL) \
|
||||||
|
@ -1573,7 +1573,10 @@
|
||||||
__SKIP_NEXT_ENTRIES_T2B(field, node) \
|
__SKIP_NEXT_ENTRIES_T2B(field, node) \
|
||||||
{ \
|
{ \
|
||||||
next = (node->field.sle.next[lvl] == slist->slh_tail) ? NULL : node->field.sle.next[lvl]; \
|
next = (node->field.sle.next[lvl] == slist->slh_tail) ? NULL : node->field.sle.next[lvl]; \
|
||||||
width = __skip_dot_width_##decl(slist, next, lvl); \
|
if (next) \
|
||||||
|
width = __skip_dot_width_##decl(slist, (next == NULL ? node : next), lvl); \
|
||||||
|
else \
|
||||||
|
width = __skip_dot_width_##decl(slist, node, lvl); \
|
||||||
fprintf(os, "{ %zu | <f%zu> ", width, lvl); \
|
fprintf(os, "{ %zu | <f%zu> ", width, lvl); \
|
||||||
if (next) \
|
if (next) \
|
||||||
fprintf(os, "%p }", (void *)next); \
|
fprintf(os, "%p }", (void *)next); \
|
||||||
|
@ -1619,13 +1622,12 @@
|
||||||
fflush(os); \
|
fflush(os); \
|
||||||
\
|
\
|
||||||
/* The tail, sentinal node */ \
|
/* The tail, sentinal node */ \
|
||||||
node = slist->slh_head; \
|
|
||||||
if (letitgo) { \
|
if (letitgo) { \
|
||||||
__skip_dot_write_node_##decl(os, nsg, NULL); \
|
__skip_dot_write_node_##decl(os, nsg, NULL); \
|
||||||
fprintf(os, " [label = \""); \
|
fprintf(os, " [label = \""); \
|
||||||
node = slist->slh_tail; \
|
node = slist->slh_tail; \
|
||||||
/* __SKIP_NEXT_ENTRIES_T2B(field, node) */ \
|
size_t th = slist->slh_head->field.sle.height == slist->max ? slist->max : slist->slh_head->field.sle.height + 1; \
|
||||||
for (size_t lvl = slist->level; lvl != (size_t)-1; lvl--) { \
|
for (size_t lvl = th; lvl != (size_t)-1; lvl--) { \
|
||||||
next = (node->field.sle.next[lvl] == slist->slh_tail) ? NULL : node->field.sle.next[lvl]; \
|
next = (node->field.sle.next[lvl] == slist->slh_tail) ? NULL : node->field.sle.next[lvl]; \
|
||||||
fprintf(os, "<w%zu> NULL", lvl); \
|
fprintf(os, "<w%zu> NULL", lvl); \
|
||||||
__SKIP_IS_LAST_ENTRY_T2B() continue; \
|
__SKIP_IS_LAST_ENTRY_T2B() continue; \
|
||||||
|
|
Loading…
Reference in a new issue