]> granicus.if.org Git - graphviz/commitdiff
change from "writefilename" to "render" so that it can be overloaded with
authorellson <devnull@localhost>
Tue, 18 Oct 2005 18:51:29 +0000 (18:51 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 18:51:29 +0000 (18:51 +0000)
FILE* and char** versons.

.gitignore
tclpkg/gv/gv.cpp
tclpkg/gv/gv.i
tclpkg/gv/test.cs
tclpkg/gv/test.java
tclpkg/gv/test.php
tclpkg/gv/test.pl
tclpkg/gv/test.py
tclpkg/gv/test.rb
tclpkg/gv/test.tcl

index 15129250a8b8bc8937deb554216b003be814b5a4..8fcef1679b98675207e0c182387fbeae5adc93ab 100644 (file)
@@ -59,6 +59,7 @@ dot.demo/demo
 dot.demo/dot
 dot.demo/simple
 doxygen/*
+graphviz-*/*
 graphviz-*.tar.gz
 graphviz.spec
 lib/agraph/grammar.c
@@ -120,6 +121,7 @@ tclpkg/gv/SWIGTYPE_p_Agedge_t.java
 tclpkg/gv/SWIGTYPE_p_Agnode_t.java
 tclpkg/gv/SWIGTYPE_p_Agraph_t.java
 tclpkg/gv/SWIGTYPE_p_Agsym_t.java
+tclpkg/gv/SWIGTYPE_p_FILE.java
 tclpkg/gv/gv.java
 tclpkg/gv/gv.php
 tclpkg/gv/gv.pm
index ea397a8e6b750644b60562f00b544aaff86ac0e0..0e4bcc7031e94f79afc51f1eb8695213bf6899b8 100644 (file)
@@ -734,9 +734,16 @@ void layout(Agraph_t *g, char *engine)
     err = gvLayout(gvc, g, engine);
 }
 
-void writegraph(Agraph_t *g, char *filename, char *format)
+void render(Agraph_t *g, char *format, char *filename)
 {
     int err;
 
     err = gvRenderFilename(gvc, g, format, filename);
 }
+
+void render(Agraph_t *g, char *format, FILE *f)
+{
+    int err;
+
+    err = gvRender(gvc, g, format, f);
+}
index 44460502da613c69eb91876aa89bd923a1c310d6..200742fef7d7ba78ef0bab74200c8f34ae560633 100644 (file)
@@ -107,4 +107,5 @@ extern void rm(Agedge_t *e);
 
 extern void layout(Agraph_t *g, char *engine);
 
-extern void writegraph(Agraph_t *g, char *filename, char *format);
+extern void render(Agraph_t *g, char *format, char *filename);
+extern void render(Agraph_t *g, char *format, FILE *f);
index f8254e00936525217010794d2e994c67f8ba92e9..35a4ac94cb4702078430493aa48d5898a42853d0 100644 (file)
@@ -31,7 +31,7 @@ public class test {
 
        g = gv.readgraph("hello.dot");
        gv.layout(g,"dot");
-       gv.writegraph(g,"hello.png","png");
+       gv.render(g,"png", "hello.png");
        gv.rm(g);
     }
 }
index 0cfcc3a959a8fe7353d829ccb069e829b9793ba4..cfe6b194486466c5738fe8e50aae4bd2dc4e6c5c 100644 (file)
@@ -33,7 +33,7 @@ public class test {
 
        g = gv.readgraph("hello.dot");
        gv.layout(g,"dot");
-       gv.writegraph(g,"hello.png","png");
+       gv.render(g,"png","hello.png");
        gv.rm(g);
     }
 }
index 07a67af85f9fa916b8066ed538db3b93b180383b..ff8670c91363051fed28faa495fa8ef3d0586854 100644 (file)
@@ -26,5 +26,5 @@ $g = Gv::digraph "G";
 #
 #$g = gv::readgraph "hello.dot";
 #gv::layout($g, "dot");
-#gv::writegraph($g, "hello.png", "png");
+#gv::render($g, "png", "hello.png");
 #gv::rm $g;
index 7828212721933a9cc7a157d25acd9668c070ab67..b0d175e816503916d7139768201aba49af3f4583 100644 (file)
@@ -24,5 +24,5 @@ gv::rm $g;
 
 $g = gv::readgraph "hello.dot";
 gv::layout($g, "dot");
-gv::writegraph($g, "hello.png", "png");
+gv::render($g, "png", "hello.png");
 gv::rm $g;
index 03f64bdf1cbf5d0d5983c0a76d3081e1c1a0b132..e1532652afd0bb3c11e69aa5cd6d775480268895 100644 (file)
@@ -24,5 +24,5 @@ gv.rm(g)
 
 g = gv.readgraph("hello.dot")
 gv.layout(g, "dot")
-gv.writegraph(g, "hello.png", "png")
+gv.render(g, "png", "hello.png")
 gv.rm(g)
index 7685d359884d281b83dfddc89e88ee405766b9b3..14e22ecef5ee7a84162cc0d16c22ff88da87a1b6 100644 (file)
@@ -24,5 +24,5 @@ Gv.rm(g)
 
 g = Gv.readgraph("hello.dot")
 Gv.layout(g, "dot")
-Gv.writegraph(g, "hello.png", "png")
+Gv.render(g, "png", "hello.png")
 Gv.rm(g)
index 59a38be9f0dcbca79e98cf4930626e170738ef56..b1a14180ef162db9122ecfe242c8a1730b6a02f8 100644 (file)
@@ -30,5 +30,14 @@ for {set n [gv::firstnode $g]} {[gv::ok $n]} {set n [gv::nextnode $g $n]} {
         puts "    [gv::nameof $a] [gv::set $n $a]"
     }
 }
+for {set n [gv::firstnode $g]} {[gv::ok $n]} {set n [gv::nextnode $g $n]} {
+    for {set e [gv::firstout $n]} {[gv::ok $e]} {set e [gv::nextout $n $e]} {
+       puts "[gv::nameof $n] -> [gv::nameof [gv::headof $e]]"
+       for {set a [gv::firstattr $e]} {[gv::ok $a]} {set a [gv::nextattr $e $a]} {
+           puts "    [gv::nameof $a] [gv::set $e $a]"
+       }
+    }
+}
+
 gv::layout $g dot
-gv::writegraph $g hello.png png
+gv::render $g png hello.png