diff --git a/src/treedraw.c b/src/treedraw.c index 732251582df3541ad22b0025eaabff380dd52f0c..a723992a9849f7b0a97af05b0b76072e2f5be2b9 100644 --- a/src/treedraw.c +++ b/src/treedraw.c @@ -15,7 +15,6 @@ **/ #include "libhqr.h" -#include "queue.h" #include <assert.h> #include <stdlib.h> #include <string.h> @@ -33,17 +32,20 @@ void libhqr_writeheader(){ - if(fprintf(tree.xml, "<?xml version=\"1.0\" standalone=\"no\"?>\n") < 0) return; - if(fprintf(tree.xml, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n ") < 0) return; - if(fprintf(tree.xml, "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">") <0) return; + FILE *tree = fopen("../tree.xml", "w+"); + if(fprintf(tree, "<?xml version=\"1.0\" standalone=\"no\"?>\n") < 0) return; + if(fprintf(tree, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n ") < 0) return; + if(fprintf(tree, "<svg width=\"2000\" height=\"2000\" version=\"1.1\" \n xmlns=\"http://www.w3.org/2000/svg\">") <0) return; } void libhqr_writecss(); void libhqr_drawTT(int x, int y, int k){ - if(fprintf(tree.xml,"<rect x=\"50\" y=\"50\" width=\"50\" height=\"50\" fill=\"red\" />") < 0 ) return; + FILE *tree = fopen("../tree.xml","w+"); + if(fprintf(tree,"<rect x=\"50\" y=\"50\" width=\"50\" height=\"50\" fill=\"red\" />") < 0 ) return; } void libhqr_drawline(int x1, int y1, int x2, int y2){ - if(fprintf(tree.xml,"<line x1=\"20\" y1=\"80\" x2=\"130\" y2=\"200\" />") < 0 ) return; + FILE *tree = fopen("../tree.xml","w+"); + if(fprintf(tree,"<line x1=\"20\" y1=\"80\" x2=\"130\" y2=\"200\" />") < 0 ) return; }