]> granicus.if.org Git - graphviz/commitdiff
cgraph
authorellson <devnull@localhost>
Thu, 23 Oct 2008 22:12:58 +0000 (22:12 +0000)
committerellson <devnull@localhost>
Thu, 23 Oct 2008 22:12:58 +0000 (22:12 +0000)
lib/gvc/gvplugin.c

index 47d253cb262d8afdc64dfdffeccc915fb25835ad..c44c8f5d40356b4d3b033bbb69bf09fac7885db2 100644 (file)
@@ -466,18 +466,23 @@ Agraph_t * gvplugin_graph(GVC_t * gvc)
     char bufa[100], *buf1, *buf2, bufb[100], *p, *q;
     int api, found;
 
+#ifndef WITH_CGRAPH
     aginit();
     /* set persistent attributes here */
-    agnodeattr(NULL, "label", NODENAME_ESC);
     agraphattr(NULL, "label", "");
     agraphattr(NULL, "rankdir", "");
     agraphattr(NULL, "rank", "");
     agraphattr(NULL, "ranksep", "");
+    agnodeattr(NULL, "label", NODENAME_ESC);
 
-#ifndef WITH_CGRAPH
     g = agopen("G", AGDIGRAPH);
 #else
-    g = agopen("G", Agdirected, NULL);
+    g = agopen("G", Agdirected, NIL(Agdisc_t *));
+    agattr(g, AGRAPH, "label", "");
+    agattr(g, AGRAPH, "rankdir", "");
+    agattr(g, AGRAPH, "rank", "");
+    agattr(g, AGRAPH, "ranksep", "");
+    agattr(g, AGNODE, "label", NODENAME_ESC);
 #endif
 
     a = agfindgraphattr(g, "rankdir");
@@ -600,7 +605,11 @@ Agraph_t * gvplugin_graph(GVC_t * gvc)
                }
            }
            if (!found)
-               agdelete(ssg->meta_node->graph, ssg->meta_node);
+#ifndef WITH_CGRAPH
+               agdelete(ssg->meta_node->graph, ssg->meta_node);
+#else
+               agdelete(g, ssg);
+#endif
        }
     }