Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001175graphvizGraph Librariespublic2007-10-07 18:432011-04-28 04:03
ReporterTobias Gruetzmacher 
Assigned Toellson 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSx86-Linux-OS Version
Summary0001175: Please wrap agwrite for SWIG
Description



It would be nice if if would be possible to save .dot files
without rendering from Perl, Ruby, Python, etc. As I see it this
just needs a SWIG wrapping for agwrite...
Additional Information

[tobias] Since I had the time:

Attached is a patch against CVS HEAD to add this functionality.

<CD>
Index: tclpkg/gv/gv.cpp
===================================================================
RCS file: /home/cvsroot/graphviz2/tclpkg/gv/gv.cpp,v
retrieving revision 1.42
diff -u -r1.42 gv.cpp
--- tclpkg/gv/gv.cpp 15 Jun 2006 15:52:56 -0000 1.42
+++ tclpkg/gv/gv.cpp 9 Oct 2007 23:17:05 -0000
@@ -871,3 +871,22 @@
 //
 // err = gvRenderData(gvc, g, format, data);
 }
+
+void write(Agraph_t *g, FILE *f)
+{
+ int err;
+
+ err = agwrite(g, f);
+}
+
+void write(Agraph_t *g, char *filename)
+{
+ FILE *f;
+ int err;
+
+ f = fopen(filename, "w");
+ if (!f)
+ return;
+ err = agwrite(g, f);
+ fclose(f);
+}
Index: tclpkg/gv/gv.i
===================================================================
RCS file: /home/cvsroot/graphviz2/tclpkg/gv/gv.i,v
retrieving revision 1.29
diff -u -r1.29 gv.i
--- tclpkg/gv/gv.i 17 Sep 2007 16:18:31 -0000 1.29
+++ tclpkg/gv/gv.i 9 Oct 2007 23:17:05 -0000
@@ -191,4 +191,9 @@
 extern void render(Agraph_t *g, char *format, char *filename);
 extern void render(Agraph_t *g, char *format, FILE *f);
 extern void render(Agraph_t *g, char *format, void **data);
+
+/*** Writing graph back to file */
+void write(Agraph_t *g, FILE *f);
+void write(Agraph_t *g, char *filename);
+
 %}

</CD>
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID1206
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENTFixed (11 Oct 2007)
VERSION     2.12 (Mon Sep 10 11:29:37 UTC 2007)
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => user695


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker