]> granicus.if.org Git - graphviz/commitdiff
Initial version of Cgraph created.
authornorth <devnull@localhost>
Thu, 25 Oct 2007 20:27:57 +0000 (20:27 +0000)
committernorth <devnull@localhost>
Thu, 25 Oct 2007 20:27:57 +0000 (20:27 +0000)
lib/cgraph/main3.c [new file with mode: 0644]

diff --git a/lib/cgraph/main3.c b/lib/cgraph/main3.c
new file mode 100644 (file)
index 0000000..df325ad
--- /dev/null
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <cgraph.h>
+#include "bla.h"
+
+int main(int argc, char **argv)
+{
+    Agraph_t *g;
+    Agnode_t *n;
+       Agnodref_t *nref;
+       Agedge_t *e;
+       Agedgeref_t *eref;
+
+       g = agread(stdin,0);
+       for (nref = FIRSTNREF(g); nref; nref = NEXTNREF(rep)) {
+               n = NODEOF(nref);
+               fprintf(stderr,"%s\n",agnameof(n));
+               for (eref = FIRSTOUTREF(g,nref); eref; eref = NEXTEREF(eref)) {
+                       e = EDGEOF(nref,eref);
+                       fprintf(stderr,"\t %s ", agnameof(agtail(e)));
+                       fprintf(stderr,"-> %s\n", agnameof(aghead(e)));
+               }
+       }
+    exit 1;
+}