aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-10 01:04:44 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-02-10 01:04:44 +0100
commit3b7bb66d7e7f3655571cb2bbdd47eaa8fc2833b1 (patch)
tree34cc109d2c4c315c418fc351f4193f4f61374995
parentAdd formatting macros. (diff)
downloadcalp-3b7bb66d7e7f3655571cb2bbdd47eaa8fc2833b1.tar.gz
calp-3b7bb66d7e7f3655571cb2bbdd47eaa8fc2833b1.tar.xz
Add attr_helper to graph output.
-rw-r--r--graphs.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/graphs.c b/graphs.c
index f1c8ed75..bcadd787 100644
--- a/graphs.c
+++ b/graphs.c
@@ -17,6 +17,29 @@ int create_graph_trie (vcomponent* ev, char* filename) {
return 0;
}
+int attr_helper(TRIE_NODE(content_line)* root, FILE* f) {
+
+ if (root->value != NULL) {
+ if (! EMPTY(LLIST(strbuf))(&root->value->params)) {
+ printf("%s\n", root->value->key.mem);
+ fprintf(f, "subgraph \"cluster_param_%p\"{\n color=blue;\n", root);
+ FOR(LLIST(strbuf), link, &root->value->params) {
+ fprintf(f, "\"%p\" [label=\"%s\"];", link, link->value->mem);
+ fprintf(f, "\"%p\" -> \"%p\";\n", root, link);
+ }
+ fputs("}", f);
+ }
+ }
+
+ TRIE_NODE(content_line)* child = root->child;
+ while (child != NULL) {
+ attr_helper(root->child, f);
+ child = child->next;
+ }
+
+ return 0;
+}
+
int helper_vcomponent (vcomponent* root, FILE* f) {
fprintf(f, "subgraph \"cluster_root\" { label=File; \"%p\" [label=%s] }\n", root, root->type);
@@ -34,10 +57,14 @@ int helper_vcomponent (vcomponent* root, FILE* f) {
fprintf(f, "subgraph \"cluster_%c_%p\" {\ncolor=red; \n",
n->c, root);
TRIE_DOT_HELP(content_line) ( n, f );
+
+
fputs("}", f);
n = n->next;
}
fputs("}", f);
+
+ attr_helper(trie->root, f);
}
vcomponent* child;