From 1fd1232450a215a37915e3657964f2dad7ce72d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 3 Feb 2019 13:27:20 +0100 Subject: Add graphviz output for TRIE's. Add simple output in dot format for trie structures. Along with a slightly updated main which handles a few more command line arguments. Also updated makefile to generate pdf's from dot files and dot-files from parse. --- graphs.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 graphs.c (limited to 'graphs.c') diff --git a/graphs.c b/graphs.c new file mode 100644 index 00000000..931b181b --- /dev/null +++ b/graphs.c @@ -0,0 +1,17 @@ +#include "graphs.h" + +#include + +int create_graph (vevent* ev, char* filename) { + FILE* f = fopen(filename, "w"); + + fputs("digraph {\n rankdir=LR;", f); + TRIE_DOT(content_line)(&ev->clines, f); + fputs("}", f); + + fclose(f); + + printf("Wrote '%s' to '%s'\n", ev->filename, filename); + + return 0; +} -- cgit v1.2.3