]> granicus.if.org Git - graphviz/commitdiff
Removing all existing usage of USE_CGRAPH
authorellson <devnull@localhost>
Thu, 7 Aug 2008 17:17:47 +0000 (17:17 +0000)
committerellson <devnull@localhost>
Thu, 7 Aug 2008 17:17:47 +0000 (17:17 +0000)
    cgraph is now in full production in all these files

configure.ac still contains the --with-cgraph option in case Arif wants to use it.

cmd/tools/unflatten.c
contrib/prune/Makefile.am
contrib/prune/prune.c

index e9c76d5e01834decc3510a4afecd928cdba8eb80..0385d0662587e2ade2d451e8ecfaa313f785c172 100644 (file)
 #include    <stdlib.h>
 #include    <string.h>
 #ifdef HAVE_UNISTD_H
-#include       <unistd.h>
+#include <unistd.h>
 #endif
-#ifdef USE_CGRAPH
 #include    "cgraph.h"
 #define degreeOf(n,I,O) (agdegree(n->root, n, I, O)) 
-#else
-#include    "agraph.h"
-#define degreeOf(n,I,O) (agdegree(n, I, O)) 
-#endif
 #include    "ingraphs.h"
 
 #ifdef HAVE_GETOPT_H
@@ -87,21 +82,13 @@ static void transform(Agraph_t * g)
     m_ix = bindedgeattr(g, "minlen");
     s_ix = bindedgeattr(g, "style");
 
-#ifdef USE_CGRAPH
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-#else
-    for (n = agfstnode(g); n; n = agnxtnode(n)) {
-#endif
        d = degreeOf(n, TRUE, TRUE);
        if (d == 0) {
            if (ChainLimit < 1)
                continue;
            if (ChainNode) {
-#ifdef USE_CGRAPH
                e = agedge(g, ChainNode, n, "", TRUE);
-#else
-               e = agedge(ChainNode, n, "", TRUE);
-#endif
                agxset(e, s_ix, "invis");
                ChainSize++;
                if (ChainSize < ChainLimit)
@@ -116,11 +103,7 @@ static void transform(Agraph_t * g)
            if (MaxMinlen < 1)
                continue;
            cnt = 0;
-#ifdef USE_CGRAPH
            for (e = agfstin(g, n); e; e = agnxtin(g, e)) {
-#else
-           for (e = agfstin(n); e; e = agnxtin(e)) {
-#endif
                if (isleaf(agtail(e))) {
                    str = agxget(e, m_ix);
                    if (str[0] == 0) {
@@ -131,11 +114,7 @@ static void transform(Agraph_t * g)
            }
 
            cnt = 0;
-#ifdef USE_CGRAPH
            for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
-#else
-           for (e = agfstout(n); e; e = agnxtout(e)) {
-#endif
                if (isleaf(e->node) || (Do_fans && ischainnode(e->node))) {
                    str = agxget(e, m_ix);
                    if (str[0] == 0)
index eb828dfd7ee1d35f6fa97f503362cdb21606c593..63b191f12dae41199c26d474a23ccc0d3a9fe7f1 100644 (file)
@@ -3,7 +3,6 @@
 
 pdfdir = $(pkgdatadir)/doc/pdf
 
-AM_CFLAGS = -DUSE_CGRAPH
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/ingraphs \
index 652ae863ae39244871cef5d48f706e6eb09e4ba8..276afe7dbf7ab42a87259aff7e70b4f7d6042f49 100644 (file)
 #include "compat_getopt.h"
 #endif
 
-#ifdef USE_CGRAPH
 #include "cgraph.h"
-#else
-#include "agraph.h"
-#endif
 #include "ingraphs.h"
-
 #include "generic_list.h"
 
 /* structure to hold an attribute specified on the commandline */
@@ -176,7 +171,6 @@ int main(int argc, char **argv)
            } else {
                MARK(node);     /* Avoid cycles */
                /* Iterate over all outgoing edges */
-#ifdef USE_CGRAPH
                for (edge = agfstout(graph, node); edge; edge = nexte) {
                    nexte = agnxtout(graph, edge);
                    if (aghead(edge) != node) { /* non-loop edges */
@@ -187,18 +181,6 @@ int main(int argc, char **argv)
                        agdelete(graph, edge);
                    }
                }
-#else
-               for (edge = agfstout(node); edge; edge = nexte) {
-                   nexte = agnxtout(edge);
-                   if (aghead(edge) != node) { /* non-loop edges */
-                       if (verbose == 1)
-                           fprintf(stderr, "Processing descendant: %s\n",
-                                   agnameof(aghead(edge)));
-                       remove_child(graph, aghead(edge));
-                       agdelete(graph, edge);
-                   }
-               }
-#endif
                UNMARK(node);   /* Unmark so that it can be removed in later passes */
 
                /* Change attribute (e.g. border style) to show that node has been pruneed */
@@ -236,19 +218,13 @@ void remove_child(Agraph_t * graph, Agnode_t * node)
     MARK(node);
 
     /* Skip nodes with more than one parent */
-#ifdef USE_CGRAPH
     edge = agfstin(graph, node);
     if (edge && (agnxtin(graph, edge) != NULL)) {
-#else
-    edge = agfstin(node);
-    if (edge && (agnxtin(edge) != NULL)) {
-#endif
        UNMARK(node);
        return;
     }
 
     /* recursively remove children */
-#ifdef USE_CGRAPH
     for (edge = agfstout(graph, node); edge; edge = nexte) {
        nexte = agnxtout(graph, edge);
        if (aghead(edge) != node) {
@@ -261,20 +237,6 @@ void remove_child(Agraph_t * graph, Agnode_t * node)
     }
 
     agdelnode(graph, node);
-#else
-    for (edge = agfstout(node); edge; edge = nexte) {
-       nexte = agnxtout(edge);
-       if (aghead(edge) != node) {
-           if (verbose)
-               fprintf(stderr, "Processing descendant: %s\n",
-                       agnameof(aghead(edge)));
-           remove_child(graph, aghead(edge));
-           agdeledge(edge);
-       }
-    }
-
-    agdelnode(node);
-#endif
     return;
 }