]> granicus.if.org Git - graphviz/commitdiff
remove CGRAPH conditionals from lib/*
authorJohn Ellson <ellson@research.att.com>
Wed, 16 Oct 2013 21:48:58 +0000 (17:48 -0400)
committerJohn Ellson <ellson@research.att.com>
Wed, 16 Oct 2013 21:48:58 +0000 (17:48 -0400)
59 files changed:
lib/Makefile.am
lib/cgraph/Makefile.am
lib/circogen/Makefile.am
lib/circogen/blockpath.c
lib/circogen/blocktree.c
lib/circogen/circular.c
lib/circogen/circularinit.c
lib/common/Makefile.am
lib/common/arrows.c
lib/common/emit.c
lib/common/htmltable.c
lib/common/input.c
lib/common/labels.c
lib/common/output.c
lib/common/shapes.c
lib/common/splines.c
lib/common/types.h.in
lib/common/utils.c
lib/common/utils.h
lib/common/vtxgen.c
lib/dotgen/Makefile.am
lib/dotgen/class1.c
lib/dotgen/class2.c
lib/dotgen/cluster.c
lib/dotgen/compound.c
lib/dotgen/dotinit.c
lib/dotgen/dotsplines.c
lib/dotgen/fastgr.c
lib/dotgen/mincross.c
lib/dotgen/position.c
lib/dotgen/rank.c
lib/dotgen/sameport.c
lib/dotgen2/Makefile.am
lib/fdpgen/Makefile.am
lib/fdpgen/comp.c
lib/fdpgen/fdpinit.c
lib/fdpgen/layout.c
lib/fdpgen/tlayout.c
lib/ingraphs/Makefile.am
lib/label/Makefile.am
lib/label/rectangle.c
lib/neatogen/Makefile.am
lib/neatogen/adjust.c
lib/neatogen/constraint.c
lib/neatogen/neatoinit.c
lib/neatogen/stuff.c
lib/ortho/Makefile.am
lib/ortho/structures.h
lib/osage/Makefile.am
lib/osage/osageinit.c
lib/pack/Makefile.am
lib/pack/ccomps.c
lib/patchwork/Makefile.am
lib/patchwork/patchwork.c
lib/patchwork/patchworkinit.c
lib/sfdpgen/Makefile.am
lib/sfdpgen/sfdpinit.c
lib/twopigen/Makefile.am
lib/twopigen/twopiinit.c

index 6a44bf7cf361c16d86b025d4717c738d1547f984..768dbe0598e524c3967b5cf0503acb60a98da6a7 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = cdt graph cgraph pathplan sfio vmalloc ast \
+SUBDIRS = cdt cgraph pathplan sfio vmalloc ast \
        vpsc rbtree ortho sparse patchwork expr common \
        pack xdot label gvc ingraphs topfish glcomp mingle \
        circogen dotgen dotgen2 fdpgen neatogen twopigen sfdpgen osage gvpr
index c42d947c17c706c3019e9e407271fa02147a5915..2258c912e68711604b2de12fbd12ecd47340c274 100644 (file)
@@ -10,8 +10,6 @@ AM_CPPFLAGS = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/lib/cdt
 
-# Always build cgraph, regardless of --without-cgraph, because gvpr needs it
-# if WITH_CGRAPH
 pkginclude_HEADERS = cgraph.h
 noinst_HEADERS = agxbuf.h cghdr.h malloc.h vmstub.h
 noinst_LTLIBRARIES = libcgraph_C.la
@@ -19,7 +17,6 @@ lib_LTLIBRARIES = libcgraph.la
 pkgconfig_DATA = libcgraph.pc
 man_MANS = cgraph.3
 pdf_DATA = cgraph.3.pdf
-# endif
 
 libcgraph_C_la_SOURCES = agerror.c agxbuf.c apply.c attr.c edge.c \
        flatten.c graph.c grammar.y id.c imap.c io.c mem.c node.c \
index 141f3620ffe1900603db8e97af47787354332841..e426869d9a8826139201ba7f83b1c4a149f7be13 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 pkgconfigdir = $(libdir)/pkgconfig
 
 AM_CPPFLAGS = \
@@ -17,7 +11,7 @@ AM_CPPFLAGS = \
         -I$(top_srcdir)/lib/pack \
         -I$(top_srcdir)/lib/pathplan \
         -I$(top_srcdir)/lib/sparse \
-        -I$(top_srcdir)/lib/$(GRAPH) \
+        -I$(top_srcdir)/lib/cgraph \
         -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = block.h blockpath.h blocktree.h circo.h \
index aef6dc7a65ee12e992d052d68cf6a480de63e633..b5ed8889073ec21f205fdaedf264c987749efbf0 100644 (file)
@@ -41,42 +41,24 @@ static Agraph_t *clone_graph(Agraph_t * ing, Agraph_t ** xg)
     static int id = 0;
 
     sprintf(gname, "_clone_%d", id++);
-#ifndef WITH_CGRAPH
-    clone = agsubg(ing, gname);
-#else /* WITH_CGRAPH */
     clone = agsubg(ing, gname,1);
     agbindrec(clone, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);      //node custom data
-#endif /* WITH_CGRAPH */
     sprintf(gname, "_clone_%d", id++);
-#ifndef WITH_CGRAPH
-    xclone = agopen(gname, ing->kind);
-    for (n = agfstnode(ing); n; n = agnxtnode(ing, n)) {
-       aginsert(clone, n);
-       xn = agnode(xclone, agnameof(n));
-#else /* WITH_CGRAPH */
     xclone = agopen(gname, ing->desc,NIL(Agdisc_t *));
     for (n = agfstnode(ing); n; n = agnxtnode(ing, n)) {
        agsubnode(clone,n,1);
        xn = agnode(xclone, agnameof(n),1);
         agbindrec(xn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);     //node custom data
-#endif /* WITH_CGRAPH */
        CLONE(n) = xn;
     }
 
     for (n = agfstnode(ing); n; n = agnxtnode(ing, n)) {
        xn = CLONE(n);
-#ifndef WITH_CGRAPH
-       for (e = agfstout(ing, n); e; e = agnxtout(ing, e)) {
-           aginsert(clone, e);
-           xh = CLONE(e->head);
-           xe = agedge(xclone, xn, xh);
-#else /* WITH_CGRAPH */
        for (e = agfstout(ing, n); e; e = agnxtout(ing, e)) {
            agsubedge(clone,e,1);
            xh = CLONE(aghead(e));
            xe = agedge(xclone, xn, xh, NULL, 1);
            agbindrec(xe, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //node custom data
-#endif /* WITH_CGRAPH */
            ORIGE(xe) = e;
            DEGREE(xn) += 1;
            DEGREE(xh) += 1;
@@ -167,12 +149,7 @@ static void find_pair_edges(Agraph_t * g, Agnode_t * n, Agraph_t * outg)
                    break;
                tp = neighbors_without[mark];
                hp = neighbors_without[mark + 1];
-#ifndef WITH_CGRAPH
-               agedge(g, tp, hp);
-#else /* WITH_CGRAPH */
                agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);   // edge custom data
-
-#endif /* WITH_CGRAPH */
                DEGREE(tp)++;
                DEGREE(hp)++;
                diff--;
@@ -182,13 +159,7 @@ static void find_pair_edges(Agraph_t * g, Agnode_t * n, Agraph_t * outg)
            while (diff > 0) {
                tp = neighbors_without[0];
                hp = neighbors_without[mark];
-#ifndef WITH_CGRAPH
-               agedge(g, tp, hp);
-#else /* WITH_CGRAPH */
-
                agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);   // edge custom data
-
-#endif /* WITH_CGRAPH */
                DEGREE(tp)++;
                DEGREE(hp)++;
                mark++;
@@ -200,12 +171,7 @@ static void find_pair_edges(Agraph_t * g, Agnode_t * n, Agraph_t * outg)
            tp = neighbors_with[0];
            for (mark = 0; mark < no_pair_count; mark++) {
                hp = neighbors_without[mark];
-#ifndef WITH_CGRAPH
-               agedge(g, tp, hp);
-#else /* WITH_CGRAPH */
                agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);      //node custom data
-
-#endif /* WITH_CGRAPH */
                DEGREE(tp)++;
                DEGREE(hp)++;
            }
@@ -379,11 +345,7 @@ static void dfs(Agraph_t * g, Agnode_t * n, Agraph_t * tree)
 
        if (!VISITED(neighbor)) {
            /* add the edge to the dfs tree */
-#ifndef WITH_CGRAPH
-           aginsert(tree, e);
-#else /* WITH_CGRAPH */
            agsubedge(tree,e,1);
-#endif /* WITH_CGRAPH */
            TPARENT(neighbor) = n;
            dfs(g, neighbor, tree);
        }
@@ -401,19 +363,11 @@ static Agraph_t *spanning_tree(Agraph_t * g)
     static int id = 0;
 
     sprintf(gname, "_span_%d", id++);
-#ifndef WITH_CGRAPH
-    tree = agsubg(g, gname);
-#else /* WITH_CGRAPH */
     tree = agsubg(g, gname,1);
     agbindrec(tree, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);       //node custom data
-#endif /* WITH_CGRAPH */
 
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-#ifndef WITH_CGRAPH
-       aginsert(tree, n);
-#else /* WITH_CGRAPH */
        agsubnode(tree,n,1);
-#endif /* WITH_CGRAPH */
        DISTONE(n) = 0;
        DISTTWO(n) = 0;
        UNSET_VISITED(n);
@@ -441,11 +395,7 @@ static void block_graph(Agraph_t * g, block_t * sn)
     for (n = agfstnode(subg); n; n = agnxtnode(subg, n)) {
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
            if (BLOCK(aghead(e)) == sn)
-#ifndef WITH_CGRAPH
-               aginsert(subg, e);
-#else /* WITH_CGRAPH */
                agsubedge(subg,e,1);
-#endif /* WITH_CGRAPH */
        }
     }
 }
index 72942e69473e3ded2759e61ae5bdb4249b4c3c3d..6a14338f98099d7d1122385d66883c89d5df88fe 100644 (file)
 
 static void addNode(block_t * bp, Agnode_t * n)
 {
-#ifndef WITH_CGRAPH
-    aginsert(bp->sub_graph, n);
-#else /* WITH_CGRAPH */
     agsubnode(bp->sub_graph, n,1);
-#endif /* WITH_CGRAPH */
     BLOCK(n) = bp;
 }
 
@@ -30,12 +26,8 @@ static Agraph_t *makeBlockGraph(Agraph_t * g, circ_state * state)
     Agraph_t *subg;
 
     sprintf(name, "_block_%d", state->blockCount++);
-#ifndef WITH_CGRAPH
-    subg = agsubg(g, name);
-#else /* WITH_CGRAPH */
     subg = agsubg(g, name,1);
     agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);       //node custom data
-#endif /* WITH_CGRAPH */
     return subg;
 }
 
index e311003d291dd0ea118c5e2d28ed03b26b3036a4..2d48fff6a2e0a72c2e2173586e853f58f7640d0b 100644 (file)
@@ -39,19 +39,10 @@ static void initGraphAttrs(Agraph_t * g, circ_state * state)
     if (rg != rootg) {         /* new root graph */
        state->blockCount = 0;
        rootg = rg;
-#ifndef WITH_CGRAPH
-       G_mindist = agfindattr(rootg, "mindist");
-#else /* WITH_CGRAPH */
        G_mindist = agattr(rootg,AGRAPH, "mindist", NULL);
-#endif /* WITH_CGRAPH */
        min_dist = late_double(rootg, G_mindist, MINDIST, 0.0);
-#ifndef WITH_CGRAPH
-       N_artpos = agfindattr(rootg->proto->n, "articulation_pos");
-       N_root = agfindattr(rootg->proto->n, "root");
-#else /* WITH_CGRAPH */
        N_artpos = agattr(rootg,AGNODE, "articulation_pos", NULL);
        N_root = agattr(rootg,AGNODE, "root", NULL);
-#endif /* WITH_CGRAPH */
        rootname = agget(rootg, "root");
     }
     initBlocklist(&state->bl);
@@ -81,19 +72,11 @@ createOneBlock(Agraph_t * g, circ_state * state)
     Agnode_t* n;
 
     sprintf(name, "_block_%d", state->blockCount++);
-#ifdef WITH_CGRAPH
     subg = agsubg(g, name, 1);
-#else
-    subg = agsubg(g, name);
-#endif
     bp = mkBlock(subg);
 
     for (n = agfstnode(g); n; n = agnxtnode(g,n)) {
-#ifdef WITH_CGRAPH
        agsubnode(bp->sub_graph, n, 1);
-#else
-       aginsert(bp->sub_graph, n);
-#endif
        BLOCK(n) = bp;
     }
 
index 6f295c4348e93fe058e9ae3e30f09451fa7a826d..d5d89081b1fe3001b2ed9bca9c083424aec452ab 100644 (file)
@@ -33,9 +33,7 @@
 
 static void circular_init_edge(edge_t * e)
 {
-#ifdef WITH_CGRAPH
     agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //node custom data
-#endif /* WITH_CGRAPH */
     common_init_edge(e);
 
     ED_factor(e) = late_double(e, E_weight, 1.0, 0.0);
@@ -80,12 +78,8 @@ void circo_init_graph(graph_t * g)
 static node_t *makeDerivedNode(graph_t * dg, char *name, int isNode,
                               void *orig)
 {
-#ifndef WITH_CGRAPH
-    node_t *n = agnode(dg, name);
-#else /* WITH_CGRAPH */
     node_t *n = agnode(dg, name,1);
     agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);  //node custom data
-#endif /* WITH_CGRAPH */
     ND_alg(n) = (void *) NEW(cdata);
     if (isNode) {
        ND_pos(n) = N_NEW(Ndim, double);
@@ -118,12 +112,8 @@ Agraph_t **circomps(Agraph_t * g, int *cnt)
     Agedge_t *ep;
     Agnode_t *p;
 
-#ifndef WITH_CGRAPH
-    dg = agopen("derived", AGFLAG_STRICT);
-#else /* WITH_CGRAPH */
     dg = agopen("derived", Agstrictundirected,NIL(Agdisc_t *));
     agbindrec (dg, "info", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
     GD_alg(g) = dg;  /* store derived graph for closing later */
 
     for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
@@ -138,11 +128,7 @@ Agraph_t **circomps(Agraph_t * g, int *cnt)
            dt = DNODE(agtail(e));
            dh = DNODE(aghead(e));
            if (dt != dh) {
-#ifndef WITH_CGRAPH
-               agedge(dg, dt, dh);
-#else /* WITH_CGRAPH */
                agbindrec(agedge(dg, dt, dh, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);     //node custom data
-#endif /* WITH_CGRAPH */
            }
        }
     }
@@ -162,14 +148,9 @@ Agraph_t **circomps(Agraph_t * g, int *cnt)
                /* n = DNODE(agtail(e)); by construction since agtail(e) == p */
                dh = DNODE(aghead(e));
                if (n != dh) {
-#ifndef WITH_CGRAPH
-                   ep = agedge(dg, n, dh);
-                   aginsert(sg, ep);
-#else /* WITH_CGRAPH */
                    ep = agedge(dg, n, dh, NULL, 1);
                    agbindrec(ep, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //node custom data
                    agsubedge(sg,ep,1);
-#endif /* WITH_CGRAPH */
                }
            }
        }
@@ -294,9 +275,5 @@ void circo_cleanup(graph_t * g)
     }
     free(GD_neato_nlist(g));
     if (g != agroot(g)) 
-#ifndef WITH_CGRAPH
-       memset(&(g->u), 0, sizeof(Agraphinfo_t));
-#else /* WITH_CGRAPH */
        agclean (g,AGRAPH,"Agraphinfo_t");
-#endif /* WITH_CGRAPH */
 }
index f8d19bb933305e17eaa5c3a9ebb114e941cd5aaa..9472c396403b62e84d08103cfcdefeafc681ac2f 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
        -I$(top_srcdir)/lib/gvc \
@@ -15,7 +9,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/xdot \
        -I$(top_srcdir)/lib/fdpgen \
        -I$(top_srcdir)/lib/pathplan \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt $(GD_INCLUDES) $(EXPAT_INCLUDES) $(Z_INCLUDES)
 
 if WITH_WIN32
index 7e6edd97af1a9aac04b3535ee20a480e92f3451c..ef8860ae31688a7f81b0364a943be51c340da110 100644 (file)
@@ -198,13 +198,8 @@ void arrow_flags(Agedge_t * e, int *sflag, int *eflag)
     arrowdir_t *arrowdir;
 
     *sflag = ARR_TYPE_NONE;
-#ifdef WITH_CGRAPH
     *eflag = agisdirected(agraphof(e)) ? ARR_TYPE_NORM : ARR_TYPE_NONE;
     if (E_dir && ((attr = agxget(e, E_dir)))[0]) {
-#else
-    *eflag = AG_IS_DIRECTED(e->tail->graph) ? ARR_TYPE_NORM : ARR_TYPE_NONE;
-    if (E_dir && ((attr = agxget(e, E_dir->index)))[0]) {
-#endif
        for (arrowdir = Arrowdirs; arrowdir->dir; arrowdir++) {
            if (streq(attr, arrowdir->dir)) {
                *sflag = arrowdir->sflag;
@@ -213,17 +208,10 @@ void arrow_flags(Agedge_t * e, int *sflag, int *eflag)
            }
        }
     }
-#ifdef WITH_CGRAPH
     if (E_arrowhead && (*eflag == ARR_TYPE_NORM) && ((attr = agxget(e, E_arrowhead)))[0])
        arrow_match_name(attr, eflag);
     if (E_arrowtail && (*sflag == ARR_TYPE_NORM) && ((attr = agxget(e, E_arrowtail)))[0])
        arrow_match_name(attr, sflag);
-#else
-    if (E_arrowhead && (*eflag == ARR_TYPE_NORM) && ((attr = agxget(e, E_arrowhead->index)))[0])
-       arrow_match_name(attr, eflag);
-    if (E_arrowtail && (*sflag == ARR_TYPE_NORM) && ((attr = agxget(e, E_arrowtail->index)))[0])
-       arrow_match_name(attr, sflag);
-#endif
     if (ED_conc_opp_flag(e)) {
        edge_t *f;
        int s0, e0;
index a2c672601309df7aa55533ab202dd1c53f7697a4..01f90fba4769b4e35d9307339f2e90adc0ac95a5 100644 (file)
@@ -216,13 +216,8 @@ getObjId (GVJ_t* job, void* obj, agxbuf* xb)
     }
 
     switch (agobjkind(obj)) {
-#ifndef WITH_CGRAPH
-    case AGGRAPH:
-       idnum = ((graph_t*)obj)->meta_node->id;
-#else
     case AGRAPH:
        idnum = AGSEQ(obj);
-#endif
        if (root == obj)
            pfx = "graph";
        else
@@ -1708,11 +1703,7 @@ static boolean clust_in_layer(GVJ_t *job, graph_t * sg)
 
     if (job->numLayers <= 1)
        return TRUE;
-#ifndef WITH_CGRAPH
-    pg = late_string(sg, agfindattr(sg, "layer"), "");
-#else
     pg = late_string(sg, agattr(sg, AGRAPH, "layer", 0), "");
-#endif
     if (selectedlayer(job, pg))
        return TRUE;
     if (pg[0])
@@ -2096,14 +2087,9 @@ static int multicolor (GVJ_t * job, edge_t * e, char** styles, char* colors, int
 
     rv = parseSegs (colors, num, &segs);
     if (rv > 1) {
-#ifndef WITH_CGRAPH
-       Agraph_t* g = e->tail->graph;
-       agerr (AGPREV, "in edge %s%s%s\n", agnameof(e->tail), (AG_IS_DIRECTED(g)?" -> ":" -- "), agnameof(e->head));
-#else
        Agraph_t* g = agraphof(agtail(e));
        agerr (AGPREV, "in edge %s%s%s\n", agnameof(agtail(e)), (agisdirected(g)?" -> ":" -- "), agnameof(aghead(e)));
 
-#endif
        if (rv == 2)
            return 1;
     }
@@ -2201,11 +2187,7 @@ static radfunc_t
 taperfun (edge_t* e)
 {
     char* attr;
-#ifdef WITH_CGRAPH
     if (E_dir && ((attr = agxget(e, E_dir)))[0]) {
-#else
-    if (E_dir && ((attr = agxget(e, E_dir->index)))[0]) {
-#endif
        if (streq(attr, "forward")) return forfunc;
        if (streq(attr, "back")) return revfunc;
        if (streq(attr, "both")) return bothfunc;
@@ -2488,11 +2470,7 @@ static void emit_begin_edge(GVJ_t * job, edge_t * e, char** styles)
      */
     if (styles && ED_spl(e)) gvrender_set_style(job, styles);
 
-#ifndef WITH_CGRAPH
-    if (E_penwidth && ((s=agxget(e,E_penwidth->index)) && s[0])) {
-#else
     if (E_penwidth && ((s=agxget(e,E_penwidth)) && s[0])) {
-#endif
        penwidth = late_double(e, E_penwidth, 1.0, 0.0);
        gvrender_set_penwidth(job, penwidth);
     }
@@ -3059,17 +3037,10 @@ static void init_gvc(GVC_t * gvc, graph_t * g)
     G_penwidth = agfindgraphattr(g, "penwidth");
 
     /* default font */
-#ifndef WITH_CGRAPH
-    gvc->defaultfontname = late_nnstring(g->proto->n,
-                N_fontname, DEFAULT_FONTNAME);
-    gvc->defaultfontsize = late_double(g->proto->n,
-                N_fontsize, DEFAULT_FONTSIZE, MIN_FONTSIZE);
-#else
     gvc->defaultfontname = late_nnstring(NULL,
                 N_fontname, DEFAULT_FONTNAME);
     gvc->defaultfontsize = late_double(NULL,
                 N_fontsize, DEFAULT_FONTSIZE, MIN_FONTSIZE);
-#endif
 
     /* default line style */
     gvc->defaultlinestyle = defaultlinestyle;
@@ -3497,11 +3468,7 @@ fprintf(stderr,"focus=%g,%g view=%g,%g\n",
        job->focus.x, job->focus.y, job->view.x, job->view.y);
 #endif
 
-#ifndef WITH_CGRAPH
-    s = late_string(g, agfindattr(g, "comment"), "");
-#else
     s = late_string(g, agattr(g, AGRAPH, "comment", 0), "");
-#endif
     gvrender_comment(job, s);
 
     job->layerNum = 0;
@@ -3531,11 +3498,7 @@ fprintf(stderr,"focus=%g,%g view=%g,%g\n",
 /* support for stderr_once */
 static void free_string_entry(Dict_t * dict, char *key, Dtdisc_t * disc)
 {
-#ifndef WITH_CGRAPH
-    agstrfree(key);
-#else
     free(key);
-#endif
 }
 
 static Dict_t *strings;
@@ -3556,11 +3519,7 @@ int emit_once(char *str)
     if (strings == 0)
        strings = dtopen(&stringdict, Dtoset);
     if (!dtsearch(strings, str)) {
-#ifndef WITH_CGRAPH
-       dtinsert(strings, agstrdup(str));
-#else
        dtinsert(strings, strdup(str));
-#endif
        return TRUE;
     }
     return FALSE;
index 1423f3463347ffc9208e222855c10af8ccdfa168..61d39221c0ef0ae8987a9a6229dbbd63f912f33a 100644 (file)
@@ -1381,12 +1381,8 @@ static void checkChain(graph_t * g)
     t = GD_nlist(g);
     for (h = ND_next(t); h; h = ND_next(h)) {
        if (!agfindedge(g, t, h)) {
-#ifdef WITH_CGRAPH
            e = agedge(g, t, h, NULL, 1);
            agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
-#else
-           e = agedge(g, t, h);
-#endif
            ED_minlen(e) = 0;
            elist_append(e, ND_out(t));
            elist_append(e, ND_in(h));
@@ -1408,12 +1404,8 @@ checkEdge (graph_t* g, node_t* t, node_t* h, int sz)
     if (e)
        ED_minlen(e) = MAX(ED_minlen(e), sz);
     else {
-#ifdef WITH_CGRAPH
        e = agedge(g, t, h, NULL, 1);
        agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
-#else
-       e = agedge(g, t, h);
-#endif
        ED_minlen(e) = sz;
        elist_append(e, ND_out(t));
        elist_append(e, ND_in(h));
@@ -1440,12 +1432,8 @@ void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg)
 
     lastn = NULL;
     for (i = 0; i <= tbl->cc; i++) {
-#ifdef WITH_CGRAPH
        t = agnode(colg, nToName(i), 1);
        agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
-#else
-       t = agnode(colg, nToName(i));
-#endif
        alloc_elist(tbl->rc, ND_in(t));
        alloc_elist(tbl->rc, ND_out(t));
        if (lastn) {
@@ -1457,12 +1445,8 @@ void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg)
     }
     lastn = NULL;
     for (i = 0; i <= tbl->rc; i++) {
-#ifdef WITH_CGRAPH
        t = agnode(rowg, nToName(i), 1);
        agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
-#else
-       t = agnode(rowg, nToName(i));
-#endif
        alloc_elist(tbl->cc, ND_in(t));
        alloc_elist(tbl->cc, ND_out(t));
        if (lastn) {
@@ -1541,16 +1525,11 @@ void sizeArray(htmltbl_t * tbl)
     tbl->heights = N_NEW(tbl->rc + 1, int);
     tbl->widths = N_NEW(tbl->cc + 1, int);
 
-#ifdef WITH_CGRAPH
     rowg = agopen("rowg", dir, NIL(Agdisc_t *));
     colg = agopen("colg", dir, NIL(Agdisc_t *));
     /* Only need GD_nlist */
     agbindrec(rowg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);       // graph custom data
     agbindrec(colg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);       // graph custom data
-#else
-    rowg = agopen("rowg", AGDIGRAPH);
-    colg = agopen("colg", AGDIGRAPH);
-#endif
     makeGraphs(tbl, rowg, colg);
     rank(rowg, 2, INT_MAX);
     rank(colg, 2, INT_MAX);
@@ -1888,11 +1867,7 @@ static char *nameOf(void *obj, agxbuf * xb)
 {
     Agedge_t *ep;
     switch (agobjkind(obj)) {
-#ifndef WITH_CGRAPH
-    case AGGRAPH:
-#else
     case AGRAPH:
-#endif
        agxbput(xb, agnameof(((Agraph_t *) obj)));
        break;
     case AGNODE:
@@ -2058,11 +2033,7 @@ int make_html_label(void *obj, textlabel_t * lp)
 
     env.obj = obj;
     switch (agobjkind(obj)) {
-#ifdef WITH_CGRAPH
     case AGRAPH:
-#else
-    case AGGRAPH:
-#endif
        env.g = ((Agraph_t *) obj)->root;
        break;
     case AGNODE:
index 85092f521574799891ce1367b020ab2518d6051a..68c0606aca5351a303a6168481d389df38797c65 100644 (file)
@@ -173,7 +173,6 @@ static void use_library(GVC_t *gvc, const char *name)
     gvc->common.lib = Lib;
 }
 
-#ifdef WITH_CGRAPH
 static void global_def(agxbuf* xb, char *dcl, int kind,
          attrsym_t * ((*dclfun) (Agraph_t *, int kind, char *, char *)) )
 {
@@ -190,24 +189,6 @@ static void global_def(agxbuf* xb, char *dcl, int kind,
     sym = dclfun(NULL, kind, agxbuse (xb), rhs);
     sym->fixed = 1;
 }
-#else
-static void global_def(agxbuf* xb, char *dcl,
-       attrsym_t * ((*dclfun) (Agraph_t *, char *, char *)))
-{
-    char *p;
-    char *rhs = "true";
-
-    attrsym_t *sym;
-    if ((p = strchr(dcl, '='))) {
-       agxbput_n (xb, dcl, p-dcl);
-        rhs = p+1;
-    }
-    else
-       agxbput (xb, dcl);
-    sym = dclfun(NULL, agxbuse (xb), rhs);
-    sym->fixed = 1;
-}
-#endif
 
 static int gvg_init(GVC_t *gvc, graph_t *g, char *fn, int gidx)
 {
@@ -272,9 +253,6 @@ int dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
     Verbose = gvc->common.verbose;
     CmdName = gvc->common.cmdname;
 
-#ifndef WITH_CGRAPH
-    aginit();
-#endif
     nfiles = 0;
     for (i = 1; i < argc; i++)
        if (argv[i] && argv[i][0] != '-')
@@ -288,11 +266,7 @@ int dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
            switch (c = argv[i][1]) {
            case 'G':
                if (*rest)
-#ifdef WITH_CGRAPH
                    global_def(&xb, rest, AGRAPH, agattr);
-#else
-                   global_def(&xb, rest, agraphattr);
-#endif
                else {
                    fprintf(stderr, "Missing argument for -G flag\n");
                    return (dotneato_usage(1));
@@ -300,11 +274,7 @@ int dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
                break;
            case 'N':
                if (*rest)
-#ifdef WITH_CGRAPH
                    global_def(&xb, rest, AGNODE,agattr);
-#else
-                   global_def(&xb, rest, agnodeattr);
-#endif
                else {
                    fprintf(stderr, "Missing argument for -N flag\n");
                    return (dotneato_usage(1));
@@ -312,11 +282,7 @@ int dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
                break;
            case 'E':
                if (*rest)
-#ifdef WITH_CGRAPH
                    global_def(&xb, rest, AGEDGE,agattr);
-#else
-                   global_def(&xb, rest, agedgeattr);
-#endif
                else {
                    fprintf(stderr, "Missing argument for -E flag\n");
                    return (dotneato_usage(1));
@@ -460,13 +426,8 @@ int dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
     }
 
     /* set persistent attributes here (if not already set from command line options) */
-#ifdef WITH_CGRAPH
     if (!agattr(NULL, AGNODE, "label", 0))
        agattr(NULL, AGNODE, "label", NODENAME_ESC);
-#else
-    if (!(agfindnodeattr(agprotograph(), "label")))
-       agnodeattr(NULL, "label", NODENAME_ESC);
-#endif
     return 0;
 }
 
@@ -595,11 +556,7 @@ graph_t *gvNextInputGraph(GVC_t *gvc)
 #ifdef EXPERIMENTAL_MYFGETS
        g = agread_usergets(fp, myfgets);
 #else
-#ifdef WITH_CGRAPH
        g = agread(fp,NIL(Agdisc_t*));
-#else
-       g = agread(fp);
-#endif
 #endif
        if (g) {
            gvg_init(gvc, g, fn, gidx++);
@@ -813,11 +770,7 @@ void graph_init(graph_t * g, boolean use_rankdir)
     N_fontcolor = agfindnodeattr(g, "fontcolor");
     N_label = agfindnodeattr(g, "label");
     if (!N_label)
-#ifdef WITH_CGRAPH
        N_label = agattr(g, AGNODE, "label", NODENAME_ESC);
-#else
-       N_label = agnodeattr(g, "label", NODENAME_ESC);
-#endif
     N_xlabel = agfindnodeattr(g, "xlabel");
     N_showboxes = agfindnodeattr(g, "showboxes");
     N_penwidth = agfindnodeattr(g, "penwidth");
@@ -891,13 +844,9 @@ void graph_cleanup(graph_t *g)
     free(GD_drawing(g));
     GD_drawing(g) = NULL;
     free_label(GD_label(g));
-#ifdef WITH_CGRAPH
     //FIX HERE , STILL SHALLOW
     //memset(&(g->u), 0, sizeof(Agraphinfo_t));
     agclean(g, AGRAPH,"Agraphinfo_t");
-#else
-    memset(&(g->u), 0, sizeof(Agraphinfo_t));
-#endif
 }
 
 /* charsetToStr:
index b59526726991a5475aaf079ee2ef182bfba60009..a337ebb276b68cac2aa906c96fa912dd7656dc80 100644 (file)
@@ -116,11 +116,7 @@ textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *f
         char *s;
 
     switch (agobjkind(obj)) {
-#ifndef WITH_CGRAPH
-    case AGGRAPH:
-#else
     case AGRAPH:
-#endif
         sg = (graph_t*)obj;
        g = sg->root;
        break;
@@ -148,11 +144,7 @@ textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *f
        rv->html = TRUE;
        if (make_html_label(obj, rv)) {
            switch (agobjkind(obj)) {
-#ifndef WITH_CGRAPH
-           case AGGRAPH:
-#else
            case AGRAPH:
-#endif
                agerr(AGPREV, "in label of graph %s\n",agnameof(sg));
                break;
            case AGNODE:
@@ -303,11 +295,7 @@ static char *strdup_and_subst_obj0 (char *str, void *obj, int escBackslash)
 
     /* prepare substitution strings */
     switch (agobjkind(obj)) {
-#ifndef WITH_CGRAPH
-       case AGGRAPH:
-#else
        case AGRAPH:
-#endif
            g_str = agnameof((graph_t *)obj);
            g_len = strlen(g_str);
            tl = GD_label((graph_t *)obj);
index 4ccea7aba22aac906fd5efe1dace5149705c60b3..b946f3a73929e7398bd473f183dfdf0075ac1ebf 100644 (file)
@@ -27,7 +27,6 @@ double yDir (double y)
     return YDIR(y);
 }
 
-#ifdef WITH_CGRAPH
 static int (*putstr) (void *chan, const char *str);
 
 static void agputs (const char* s, FILE* fp)
@@ -41,7 +40,6 @@ static void agputc (int c, FILE* fp)
     putstr ((void*)fp, buf);
 }
 
-#endif
 
 static void printstring(FILE * f, char *prefix, char *s)
 {
@@ -92,15 +90,9 @@ static void setYInvert(graph_t * g)
  */
 static char* canon (graph_t *g, char* s)
 {
-#ifndef WITH_CGRAPH
-    char* ns = agstrdup (s);
-    char* cs = agcanonStr (ns);
-    agstrfree (ns);
-#else
     char* ns = agstrdup (g, s);
     char* cs = agcanonStr (ns);
     agstrfree (g, ns);
-#endif
     return cs;
 }
 
@@ -129,9 +121,7 @@ void write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend)
     char *lbl;
     char* fillcolor;
 
-#ifdef WITH_CGRAPH
     putstr = g->clos->disc.io->putstr;
-#endif
 //    setup_graph(job, g);
     setYInvert(g);
     pt = GD_bb(g).UR;
@@ -145,11 +135,7 @@ void write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend)
        printstring(f, "node ", agcanonStr(agnameof(n)));
        printpoint(f, ND_coord(n));
        if (ND_label(n)->html)   /* if html, get original text */
-#ifndef WITH_CGRAPH
-           lbl = agcanonStr (agxget(n, N_label->index));
-#else
            lbl = agcanonStr (agxget(n, N_label));
-#endif
        else
            lbl = canon(agraphof(n),ND_label(n)->text);
         printdouble(f, " ", ND_width(n));
@@ -167,24 +153,12 @@ void write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend)
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
 
-#ifndef WITH_CGRAPH
-/* FIXME - there must be a proper way to get port info - these are 
- * supposed to be private to libgraph - from libgraph.h */
-#define TAILX 1
-#define HEADX 2
-
-           if (extend && e->attr) {
-               tport = e->attr[TAILX];
-               hport = e->attr[HEADX];
-           }
-#else /* WITH_CGRAPH */
            if (extend) {               //assuming these two attrs have already been created by cgraph
                if (!(tport = agget(e,"tailport")))
                    tport = "";
                if (!(hport = agget(e,"headport")))
                    hport = "";
            }
-#endif /* WITH_CGRAPH */
            else
                tport = hport = "";
            if (ED_spl(e)) {
@@ -240,11 +214,7 @@ static void rec_attach_bb(graph_t * g, Agsym_t* bbsym)
 
     sprintf(buf, "%.5g,%.5g,%.5g,%.5g", GD_bb(g).LL.x, YDIR(GD_bb(g).LL.y),
            GD_bb(g).UR.x, YDIR(GD_bb(g).UR.y));
-#ifndef WITH_CGRAPH
-    agxset(g, bbsym->index, buf);
-#else
     agxset(g, bbsym, buf);
-#endif
     if (GD_label(g) && GD_label(g)->text[0]) {
        pt = GD_label(g)->pos;
        sprintf(buf, "%.5g,%.5g", pt.x, YDIR(pt.y));
@@ -277,39 +247,6 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
     e_arrows = s_arrows = 0;
     setYInvert(g);
     agxbinit(&xb, BUFSIZ, xbuffer);
-#ifndef WITH_CGRAPH
-    safe_dcl(g, g->proto->n, "pos", "", agnodeattr);
-    safe_dcl(g, g->proto->n, "rects", "", agnodeattr);
-    N_width = safe_dcl(g, g->proto->n, "width", "", agnodeattr);
-    N_height = safe_dcl(g, g->proto->n, "height", "", agnodeattr);
-    safe_dcl(g, g->proto->e, "pos", "", agedgeattr);
-    if (GD_has_labels(g) & NODE_XLABEL)
-       safe_dcl(g, g->proto->n, "xlp", "", agnodeattr);
-    if (GD_has_labels(g) & EDGE_LABEL)
-       safe_dcl(g, g->proto->e, "lp", "", agedgeattr);
-    if (GD_has_labels(g) & EDGE_XLABEL)
-       safe_dcl(g, g->proto->e, "xlp", "", agedgeattr);
-    if (GD_has_labels(g) & HEAD_LABEL)
-       safe_dcl(g, g->proto->e, "head_lp", "", agedgeattr);
-    if (GD_has_labels(g) & TAIL_LABEL)
-       safe_dcl(g, g->proto->e, "tail_lp", "", agedgeattr);
-    if (GD_label(g)) {
-       safe_dcl(g, g, "lp", "", agraphattr);
-       safe_dcl(g, g, "lwidth", "", agraphattr);
-       safe_dcl(g, g, "lheight", "", agraphattr);
-       if (GD_label(g)->text[0]) {
-           ptf = GD_label(g)->pos;
-           sprintf(buf, "%.5g,%.5g", ptf.x, YDIR(ptf.y));
-           agset(g, "lp", buf);
-           ptf = GD_label(g)->dimen;
-           sprintf(buf, "%.2f", PS2INCH(ptf.x));
-           agset(g, "lwidth", buf);
-           sprintf(buf, "%.2f", PS2INCH(ptf.y));
-           agset(g, "lheight", buf);
-       }
-    }
-    bbsym = safe_dcl(g, g, "bb", "", agraphattr);
-#else
     safe_dcl(g, AGNODE, "pos", "");
     safe_dcl(g, AGNODE, "rects", "");
     N_width = safe_dcl(g, AGNODE, "width", "");
@@ -341,7 +278,6 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
        }
     }
     bbsym = safe_dcl(g, AGRAPH, "bb", "");
-#endif
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        if (dim3) {
            int k;
@@ -358,15 +294,9 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
            agset(n, "pos", buf);
        }
        sprintf(buf, "%.5g", PS2INCH(ND_ht(n)));
-#ifndef WITH_CGRAPH
-       agxset(n, N_height->index, buf);
-       sprintf(buf, "%.5g", PS2INCH(ND_lw(n) + ND_rw(n)));
-       agxset(n, N_width->index, buf);
-#else
        agxset(n, N_height, buf);
        sprintf(buf, "%.5g", PS2INCH(ND_lw(n) + ND_rw(n)));
        agxset(n, N_width, buf);
-#endif
        if (ND_xlabel(n) && ND_xlabel(n)->set) {
            ptf = ND_xlabel(n)->pos;
            sprintf(buf, "%.5g,%.5g", ptf.x, YDIR(ptf.y));
@@ -404,11 +334,7 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
                                YFDIR(ND_height(n) / 2.0 * sin(i / (double) sides * M_PI * 2.0)));
                    agxbput(&xb, buf);
                }
-#ifndef WITH_CGRAPH
-               agxset(n, N_vertices->index, agxbuse(&xb));
-#else /* WITH_CGRAPH */
                agxset(n, N_vertices, agxbuse(&xb));
-#endif /* WITH_CGRAPH */
            }
        }
        if (State >= GVSPLINES) {
index bb5ea0f7b5f3c5a48688cc208f224571454d2a54..b59e2b7cfff81ab7f47c59f10cddd6331fd5a49b 100644 (file)
@@ -454,11 +454,7 @@ static int stylenode(GVJ_t * job, node_t * n)
     if ((pstyle = checkStyle(n, &istyle)))
        gvrender_set_style(job, pstyle);
 
-#ifndef WITH_CGRAPH
-    if (N_penwidth && ((s = agxget(n, N_penwidth->index)) && s[0])) {
-#else
     if (N_penwidth && ((s = agxget(n, N_penwidth)) && s[0])) {
-#endif
        penwidth = late_double(n, N_penwidth, 1.0, 0.0);
        gvrender_set_penwidth(job, penwidth);
     }
index d08f39af1158a037b773a973a664cb296ae6686a..295f008dffb9b26bc12d46251c6097e3fe1640f1 100644 (file)
@@ -1415,11 +1415,7 @@ void addEdgeLabels(graph_t* g, edge_t * e, pointf rp, pointf rq)
     makePortLabels(e);
 }
 
-#ifndef WITH_CGRAPH
-#define AGXGET(o,a) agxget(o,a->index)
-#else /* WITH_CGRAPH */
 #define AGXGET(o,a) agxget(o,a)
-#endif /* WITH_CGRAPH */
 
 /* vladimir */
 /* place_portlabel:
index 9297149c6beb16a57b12e749cb3e4ba7bb8cd8e2..c1502ef6f04073e716348c693308f6defaf83c32 100644 (file)
@@ -44,7 +44,6 @@ extern "C" {
     typedef int (*qsort_cmpf) (const void *, const void *);
     typedef int (*bsearch_cmpf) (const void *, const void *);
 
-#ifdef WITH_CGRAPH
 #include <cgraph.h>
     typedef struct Agraph_s graph_t;
     typedef struct Agnode_s node_t;
@@ -52,12 +51,6 @@ extern "C" {
     typedef struct Agsym_s attrsym_t;
 #define TAIL_ID "tailport"
 #define HEAD_ID "headport"
-#else
-    typedef struct Agraph_t graph_t;
-    typedef struct Agnode_t node_t;
-    typedef struct Agedge_t edge_t;
-    typedef struct Agsym_t attrsym_t;
-#endif
 
     typedef struct htmllabel_t htmllabel_t;
 
@@ -273,9 +266,7 @@ extern "C" {
 typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 
     typedef struct Agraphinfo_t {
-#ifdef WITH_CGRAPH
        Agrec_t hdr;
-#endif
        /* to generate code */
        layout_t *drawing;
        textlabel_t *label;     /* if the cluster has a title */
@@ -307,10 +298,8 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
        node_t *nlist;
        rank_t *rank;
        graph_t *parent;        /* containing cluster (not parent subgraph) */
-#ifdef WITH_CGRAPH
        int level;              /* cluster nesting level (not node level!) */
        node_t  *minrep, *maxrep;       /* set leaders for min and max rank */
-#endif
 
        /* fast graph node list */
        nlist_t comp;
@@ -322,10 +311,8 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 
        /* various flags */
        boolean has_flat_edges;
-#ifdef WITH_CGRAPH
        boolean has_sourcerank;
        boolean has_sinkrank;
-#endif
        unsigned char   showboxes;
        fontname_kind fontnames;                /* to override mangling in SVG */
 
@@ -343,7 +330,6 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 
     } Agraphinfo_t;
 
-#ifdef WITH_CGRAPH
 #define GD_parent(g) (((Agraphinfo_t*)AGDATA(g))->parent)
 #define GD_level(g) (((Agraphinfo_t*)AGDATA(g))->level)
 #define GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing)
@@ -405,68 +391,8 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 #define GD_sum_t(g) (((Agraphinfo_t*)AGDATA(g))->sum_t)
 #define GD_t(g) (((Agraphinfo_t*)AGDATA(g))->t)
 
-#else
-
-#define GD_alg(g) (g)->u.alg
-#define GD_bb(g) (g)->u.bb
-#define GD_border(g) (g)->u.border
-#define GD_cl_cnt(g) (g)->u.cl_cnt
-#define GD_cleanup(g) (g)->u.cleanup
-#define GD_clust(g) (g)->u.clust
-#define GD_comp(g) (g)->u.comp
-#define GD_dist(g) (g)->u.dist
-#define GD_drawing(g) (g)->u.drawing
-#define GD_exact_ranksep(g) (g)->u.exact_ranksep
-#define GD_expanded(g) (g)->u.expanded
-#define GD_flags(g) (g)->u.flags
-#define GD_gui_state(g) (g)->u.gui_state
-#define GD_gvc(g) (g)->u.gvc
-#define GD_charset(g) (g)->u.charset
-#define GD_has_labels(g) (g)->u.has_labels
-#define GD_has_images(g) (g)->u.has_images
-#define GD_has_flat_edges(g) (g)->u.has_flat_edges
-#define GD_ht1(g) (g)->u.ht1
-#define GD_ht2(g) (g)->u.ht2
-#define GD_inleaf(g) (g)->u.inleaf
-#define GD_installed(g) (g)->u.installed
-#define GD_label(g) (g)->u.label
-#define GD_leader(g) (g)->u.leader
-#define GD_parent(g) (g)->u.parent
-#define GD_rankdir(g) ((g)->u.rankdir & 0x3)
-#define GD_flip(g) (GD_rankdir(g) & 1)
-#define GD_realrankdir(g) ((g)->u.rankdir >> 2)
-#define GD_realflip(g) (GD_realrankdir(g) & 1)
-#define GD_ln(g) (g)->u.ln
-#define GD_maxrank(g) (g)->u.maxrank
-#define GD_maxset(g) (g)->u.maxset
-#define GD_minrank(g) (g)->u.minrank
-#define GD_minset(g) (g)->u.minset
-#define GD_move(g) (g)->u.move
-#define GD_n_cluster(g) (g)->u.n_cluster
-#define GD_n_nodes(g) (g)->u.n_nodes
-#define GD_ndim(g) (g)->u.ndim
-#define GD_odim(g) (g)->u.odim
-#define GD_neato_nlist(g) (g)->u.neato_nlist
-#define GD_nlist(g) (g)->u.nlist
-#define GD_nodesep(g) (g)->u.nodesep
-#define GD_outleaf(g) (g)->u.outleaf
-#define GD_rank(g) (g)->u.rank
-#define GD_rankleader(g) (g)->u.rankleader
-#define GD_ranksep(g) (g)->u.ranksep
-#define GD_rn(g) (g)->u.rn
-#define GD_set_type(g) (g)->u.set_type
-#define GD_label_pos(g) (g)->u.label_pos
-#define GD_showboxes(g) (g)->u.showboxes
-#define GD_fontnames(g) (g)->u.fontnames
-#define GD_spring(g) (g)->u.spring
-#define GD_sum_t(g) (g)->u.sum_t
-#define GD_t(g) (g)->u.t
-#endif
-
     typedef struct Agnodeinfo_t {
-#ifdef WITH_CGRAPH
        Agrec_t hdr;
-#endif
        shape_desc *shape;
        void *shape_info;
        pointf coord;
@@ -488,10 +414,8 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 #ifndef NEATO_ONLY
        unsigned char showboxes;
        boolean  has_port;
-#ifdef WITH_CGRAPH
        node_t* rep;
        node_t *set;
-#endif
 
        /* fast graph */
        char node_type, mark, onstack;
@@ -521,7 +445,6 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 
     } Agnodeinfo_t;
 
-#ifdef WITH_CGRAPH
 #define ND_id(n) (((Agnodeinfo_t*)AGDATA(n))->id)
 #define ND_alg(n) (((Agnodeinfo_t*)AGDATA(n))->alg)
 #define ND_UF_parent(n) (((Agnodeinfo_t*)AGDATA(n))->UF_parent)
@@ -579,68 +502,8 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 #define ND_xsize(n) (ND_lw(n)+ND_rw(n))
 #define ND_ysize(n) (ND_ht(n))
 
-#else
-
-#define ND_UF_parent(n) (n)->u.UF_parent
-#define ND_UF_size(n) (n)->u.UF_size
-#define ND_alg(n) (n)->u.alg
-#define ND_bb(n) (n)->u.bb
-#define ND_clust(n) (n)->u.clust
-#define ND_coord(n) (n)->u.coord
-#define ND_dist(n) (n)->u.dist
-#define ND_flat_in(n) (n)->u.flat_in
-#define ND_flat_out(n) (n)->u.flat_out
-#define ND_gui_state(n) (n)->u.gui_state
-#define ND_has_port(n) (n)->u.has_port
-#define ND_heapindex(n) (n)->u.heapindex
-#define ND_height(n) (n)->u.height
-#define ND_hops(n) (n)->u.hops
-#define ND_ht(n) (n)->u.ht
-#define ND_id(n) (n)->u.id
-#define ND_in(n) (n)->u.in
-#define ND_inleaf(n) (n)->u.inleaf
-#define ND_label(n) (n)->u.label
-#define ND_xlabel(n) (n)->u.xlabel
-#define ND_lim(n) (n)->u.lim
-#define ND_low(n) (n)->u.low
-#define ND_lw(n) (n)->u.lw
-#define ND_mark(n) (n)->u.mark
-#define ND_mval(n) (n)->u.mval
-#define ND_n_cluster(n) (n)->u.n_cluster
-#define ND_next(n) (n)->u.next
-#define ND_node_type(n) (n)->u.node_type
-#define ND_onstack(n) (n)->u.onstack
-#define ND_order(n) (n)->u.order
-#define ND_other(n) (n)->u.other
-#define ND_out(n) (n)->u.out
-#define ND_outleaf(n) (n)->u.outleaf
-#define ND_par(n) (n)->u.par
-#define ND_pinned(n) (n)->u.pinned
-#define ND_pos(n) (n)->u.pos
-#define ND_prev(n) (n)->u.prev
-#define ND_priority(n) (n)->u.priority
-#define ND_rank(n) (n)->u.rank
-#define ND_ranktype(n) (n)->u.ranktype
-#define ND_rw(n) (n)->u.rw
-#define ND_save_in(n) (n)->u.save_in
-#define ND_save_out(n) (n)->u.save_out
-#define ND_shape(n) (n)->u.shape
-#define ND_shape_info(n) (n)->u.shape_info
-#define ND_showboxes(n) (n)->u.showboxes
-#define ND_state(n) (n)->u.state
-#define ND_clustnode(n) (n)->u.clustnode
-#define ND_tree_in(n) (n)->u.tree_in
-#define ND_tree_out(n) (n)->u.tree_out
-#define ND_weight_class(n) (n)->u.weight_class
-#define ND_width(n) (n)->u.width
-#define ND_xsize(n) (ND_lw(n)+ND_rw(n))
-#define ND_ysize(n) (ND_ht(n))
-#endif
-
     typedef struct Agedgeinfo_t {
-#ifdef WITH_CGRAPH
        Agrec_t hdr;
-#endif
        splines *spl;
        port tail_port, head_port;
        textlabel_t *label, *head_label, *tail_label, *xlabel;
@@ -668,7 +531,6 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 #endif
     } Agedgeinfo_t;
 
-#ifdef WITH_CGRAPH
 #define ED_alg(e) (((Agedgeinfo_t*)AGDATA(e))->alg)
 #define ED_conc_opp_flag(e) (((Agedgeinfo_t*)AGDATA(e))->conc_opp_flag)
 #define ED_count(e) (((Agedgeinfo_t*)AGDATA(e))->count)
@@ -695,36 +557,6 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 #define ED_dist(e) (((Agedgeinfo_t*)AGDATA(e))->dist)
 #define ED_weight(e) (((Agedgeinfo_t*)AGDATA(e))->weight)
 
-#else
-
-#define ED_alg(e) (e)->u.alg
-#define ED_conc_opp_flag(e) (e)->u.conc_opp_flag
-#define ED_count(e) (e)->u.count
-#define ED_cutvalue(e) (e)->u.cutvalue
-#define ED_dist(e) (e)->u.dist
-#define ED_edge_type(e) (e)->u.edge_type
-#define ED_adjacent(e) (e)->u.adjacent
-#define ED_factor(e) (e)->u.factor
-#define ED_gui_state(e) (e)->u.gui_state
-#define ED_head_label(e) (e)->u.head_label
-#define ED_head_port(e) (e)->u.head_port
-#define ED_label(e) (e)->u.label
-#define ED_xlabel(e) (e)->u.xlabel
-#define ED_label_ontop(e) (e)->u.label_ontop
-#define ED_minlen(e) (e)->u.minlen
-#define ED_path(e) (e)->u.path
-#define ED_showboxes(e) (e)->u.showboxes
-#define ED_spl(e) (e)->u.spl
-#define ED_tail_label(e) (e)->u.tail_label
-#define ED_tail_port(e) (e)->u.tail_port
-#define ED_to_orig(e) (e)->u.to_orig
-#define ED_to_virt(e) (e)->u.to_virt
-#define ED_tree_index(e) (e)->u.tree_index
-#define ED_weight(e) (e)->u.weight
-#define ED_xpenalty(e) (e)->u.xpenalty
-#endif
-
-#ifdef WITH_CGRAPH
 #include "cgraph.h"
 #define ag_xget(x,a) agxget(x,a)
 #define SET_RANKDIR(g,rd) (GD_rankdir2(g) = rd)
@@ -733,23 +565,6 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
 #define agfindgraphattr(g,a) (agattr(g,AGRAPH,a,NULL))
 #define agfindnodeattr(g,a) (agattr(g,AGNODE,a,NULL))
 #define agfindedgeattr(g,a) (agattr(g,AGEDGE,a,NULL))
-#else
-#include "graph.h"
-#define SET_RANKDIR(g,rd) ((g)->u.rankdir = (rd))
-#define ag_xget(x,a) agxget(x,(a)->index)
-#define agnameof(x) ((x)->name)
-    /* warning, agraphof doesn't work for edges */
-#define agraphof(n) ((n)->graph)
-#define agroot(g) ((g)->root)
-#define aghead(e) ((e)->head)
-#define agtail(e) ((e)->tail)
-#define agisdirected(g) ((g)->kind & AGFLAG_DIRECTED)
-#define AGSEQ(x) ((x)->id)
-#define agfindgraphattr(g,a) agfindattr((g)->root,a)
-#define agfindnodeattr(g,a) agfindattr((g)->proto->n,a)
-#define agfindedgeattr(g,a) agfindattr((g)->proto->e,a)
-#define agcanonStr(s) agcanonical(s)
-#endif
 
     typedef struct {
        int flags;
index 86bed033008790e2caf8d693b2d9fcfc93dcb0a3..5cc4ccff6303bfa672804c74ce788ba5ba7f23fe 100644 (file)
@@ -103,11 +103,7 @@ char *late_string(void *obj, attrsym_t * attr, char *def)
 {
     if (!attr || !obj)
        return def;
-#ifndef WITH_CGRAPH
-    return agxget(obj, attr->index);
-#else /* WITH_CGRAPH */
     return agxget(obj, attr);
-#endif /* WITH_CGRAPH */
 }
 
 char *late_nnstring(void *obj, attrsym_t * attr, char *def)
@@ -122,25 +118,16 @@ boolean late_bool(void *obj, attrsym_t * attr, int def)
 {
     if (attr == NULL)
        return def;
-#ifndef WITH_CGRAPH
-    return mapbool(agxget(obj, attr->index));
-#else /* WITH_CGRAPH */
 
     return mapbool(agxget(obj, attr));
-#endif /* WITH_CGRAPH */
 }
 
 /* union-find */
 node_t *UF_find(node_t * n)
 {
     while (ND_UF_parent(n) && (ND_UF_parent(n) != n)) {
-#ifndef WITH_CGRAPH
-       if (ND_UF_parent(n)->u.UF_parent)
-           ND_UF_parent(n) = ND_UF_parent(n)->u.UF_parent;
-#else /* WITH_CGRAPH */
        if (ND_UF_parent(ND_UF_parent(n)))
            ND_UF_parent(n) = ND_UF_parent(ND_UF_parent(n));
-#endif /* WITH_CGRAPH */
        n = ND_UF_parent(n);
     }
     return n;
@@ -160,11 +147,7 @@ node_t *UF_union(node_t * u, node_t * v)
        ND_UF_size(v) = 1;
     } else
        v = UF_find(v);
-#ifndef WITH_CGRAPH
-    if (u->id > v->id) {
-#else /* WITH_CGRAPH */
     if (ND_id(u) > ND_id(v)) {
-#endif /* WITH_CGRAPH */
        ND_UF_parent(u) = v;
        ND_UF_size(v) += ND_UF_size(u);
     } else {
@@ -256,11 +239,9 @@ edge_t *debug_getedge(graph_t * g, char *s0, char *s1)
     else
        return NULL;
 }
-#ifdef WITH_CGRAPH
 Agraphinfo_t* GD_info(g) { return ((Agraphinfo_t*)AGDATA(g));}
 Agnodeinfo_t* ND_info(n) { return ((Agnodeinfo_t*)AGDATA(n));}
 #endif
-#endif
 
 #if !defined(MSWIN32) && !defined(WIN32)
 #include       <pwd.h>
@@ -635,22 +616,14 @@ void common_init_node(node_t * n)
        late_double(n, N_height, DEFAULT_NODEHEIGHT, MIN_NODEHEIGHT);
     ND_shape(n) =
        bind_shape(late_nnstring(n, N_shape, DEFAULT_NODESHAPE), n);
-#ifndef WITH_CGRAPH
-    str = agxget(n, N_label->index);
-#else
     str = agxget(n, N_label);
-#endif
     fi.fontsize = late_double(n, N_fontsize, DEFAULT_FONTSIZE, MIN_FONTSIZE);
     fi.fontname = late_nnstring(n, N_fontname, DEFAULT_FONTNAME);
     fi.fontcolor = late_nnstring(n, N_fontcolor, DEFAULT_COLOR);
     ND_label(n) = make_label((void*)n, str,
                ((aghtmlstr(str) ? LT_HTML : LT_NONE) | ( (shapeOf(n) == SH_RECORD) ? LT_RECD : LT_NONE)),
                fi.fontsize, fi.fontname, fi.fontcolor);
-#ifndef WITH_CGRAPH
-    if (N_xlabel && (str = agxget(n, N_xlabel->index)) && (str[0])) {
-#else
     if (N_xlabel && (str = agxget(n, N_xlabel)) && (str[0])) {
-#endif
        ND_xlabel(n) = make_label((void*)n, str, (aghtmlstr(str) ? LT_HTML : LT_NONE),
                                fi.fontsize, fi.fontname, fi.fontcolor);
        GD_has_labels(agraphof(n)) |= NODE_XLABEL;
@@ -688,11 +661,7 @@ noClip(edge_t *e, attrsym_t* sym)
     boolean            rv = FALSE;
 
     if (sym) { /* mapbool isn't a good fit, because we want "" to mean true */
-#ifndef WITH_CGRAPH
-       str = agxget(e,sym->index);
-#else /* WITH_CGRAPH */
        str = agxget(e,sym);
-#endif /* WITH_CGRAPH */
        if (str && str[0]) rv = !mapbool(str);
        else rv = FALSE;
     }
@@ -705,14 +674,9 @@ static port
 chkPort (port (*pf)(node_t*, char*, char*), node_t* n, char* s)
 { 
     port pt;
-#ifndef WITH_CGRAPH
-    char* cp = strchr(s,':');
-
-#else /* WITH_CGRAPH */
        char* cp=NULL;
        if(s)
                cp= strchr(s,':');
-#endif /* WITH_CGRAPH */
     if (cp) {
        *cp = '\0';
        pt = pf(n, s, cp+1);
@@ -736,11 +700,7 @@ int common_init_edge(edge_t * e)
 
     fi.fontname = NULL;
     lfi.fontname = NULL;
-#ifndef WITH_CGRAPH
-    if (E_label && (str = agxget(e, E_label->index)) && (str[0])) {
-#else
     if (E_label && (str = agxget(e, E_label)) && (str[0])) {
-#endif
        r = 1;
        initFontEdgeAttr(e, &fi);
        ED_label(e) = make_label((void*)e, str, (aghtmlstr(str) ? LT_HTML : LT_NONE),
@@ -750,11 +710,7 @@ int common_init_edge(edge_t * e)
            mapbool(late_string(e, E_label_float, "false"));
     }
 
-#ifndef WITH_CGRAPH
-    if (E_xlabel && (str = agxget(e, E_xlabel->index)) && (str[0])) {
-#else
     if (E_xlabel && (str = agxget(e, E_xlabel)) && (str[0])) {
-#endif
        if (!fi.fontname)
            initFontEdgeAttr(e, &fi);
        ED_xlabel(e) = make_label((void*)e, str, (aghtmlstr(str) ? LT_HTML : LT_NONE),
@@ -764,21 +720,13 @@ int common_init_edge(edge_t * e)
 
 
     /* vladimir */
-#ifndef WITH_CGRAPH
-    if (E_headlabel && (str = agxget(e, E_headlabel->index)) && (str[0])) {
-#else
     if (E_headlabel && (str = agxget(e, E_headlabel)) && (str[0])) {
-#endif
        initFontLabelEdgeAttr(e, &fi, &lfi);
        ED_head_label(e) = make_label((void*)e, str, (aghtmlstr(str) ? LT_HTML : LT_NONE),
                                lfi.fontsize, lfi.fontname, lfi.fontcolor);
        GD_has_labels(sg) |= HEAD_LABEL;
     }
-#ifndef WITH_CGRAPH
-    if (E_taillabel && (str = agxget(e, E_taillabel->index)) && (str[0])) {
-#else
     if (E_taillabel && (str = agxget(e, E_taillabel)) && (str[0])) {
-#endif
        if (!lfi.fontname)
            initFontLabelEdgeAttr(e, &fi, &lfi);
        ED_tail_label(e) = make_label((void*)e, str, (aghtmlstr(str) ? LT_HTML : LT_NONE),
@@ -792,20 +740,16 @@ int common_init_edge(edge_t * e)
      * tailport = "abc".
      */
     str = agget(e, TAIL_ID);
-#ifdef WITH_CGRAPH
     /* libgraph always defines tailport/headport; libcgraph doesn't */
     if (!str) str = "";
-#endif
     if (str && str[0])
        ND_has_port(agtail(e)) = TRUE;
     ED_tail_port(e) = chkPort (ND_shape(agtail(e))->fns->portfn, agtail(e), str);
     if (noClip(e, E_tailclip))
        ED_tail_port(e).clip = FALSE;
     str = agget(e, HEAD_ID);
-#ifdef WITH_CGRAPH
     /* libgraph always defines tailport/headport; libcgraph doesn't */
     if (!str) str = "";
-#endif
     if (str && str[0])
        ND_has_port(aghead(e)) = TRUE;
     ED_head_port(e) = chkPort(ND_shape(aghead(e))->fns->portfn, aghead(e), str);
@@ -894,11 +838,7 @@ void compute_bb(graph_t * g)
            if (ED_spl(e) == 0)
                continue;
            for (i = 0; i < ED_spl(e)->size; i++) {
-#ifndef WITH_CGRAPH
-               for (j = 0; j < ED_spl(e)->list[i].size; j++) {
-#else
                for (j = 0; j < (((Agedgeinfo_t*)AGDATA(e))->spl)->list[i].size; j++) {
-#endif
                    ptf = ED_spl(e)->list[i].list[j];
                    EXPANDBP(bb,ptf);
                }
@@ -943,35 +883,18 @@ Agsym_t *setAttr(graph_t * g, void *obj, char *name, char *value,
 {
     if (ap == NULL) {
        switch (agobjkind(obj)) {
-#ifndef WITH_CGRAPH
-       case AGGRAPH:
-           ap = agraphattr(g, name, "");
-#else /* WITH_CGRAPH */
        case AGRAPH:
            ap = agattr(g, AGRAPH,name, "");
-#endif /* WITH_CGRAPH */
            break;
        case AGNODE:
-#ifndef WITH_CGRAPH
-           ap = agnodeattr(g, name, "");
-#else /* WITH_CGRAPH */
            ap = agattr(g,AGNODE, name, "");
-#endif /* WITH_CGRAPH */
            break;
        case AGEDGE:
-#ifndef WITH_CGRAPH
-           ap = agedgeattr(g, name, "");
-#else /* WITH_CGRAPH */
            ap = agattr(g,AGEDGE, name, "");
-#endif /* WITH_CGRAPH */
            break;
        }
     }
-#ifndef WITH_CGRAPH
-    agxset(obj, ap->index, value);
-#else /* WITH_CGRAPH */
     agxset(obj, ap, value);
-#endif /* WITH_CGRAPH */
     return ap;
 }
 
@@ -994,23 +917,14 @@ static node_t *clustNode(node_t * n, graph_t * cg, agxbuf * xb,
     agxbputc(xb, ':');
     agxbput(xb, agnameof(cg));
 
-#ifndef WITH_CGRAPH
-    cn = agnode(agroot(cg), agxbuse(xb));
-#else
     cn = agnode(agroot(cg), agxbuse(xb), 1);
     agbindrec(cn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
 
     SET_CLUST_NODE(cn);
-#ifndef WITH_CGRAPH
-    aginsert(cg, cn);
-    aginsert(clg, n);
-#else /* WITH_CGRAPH */
        agsubnode(cg,cn,1);
        //aginsert(cg, cn);
        agsubnode(clg,n,1);
        //aginsert(clg, n);
-#endif /* WITH_CGRAPH */
 
     /* set attributes */
     N_label = setAttr(agraphof(cn), cn, "label", "", N_label);
@@ -1085,12 +999,8 @@ static Dtdisc_t mapDisc = {
 static edge_t *cloneEdge(edge_t * e, node_t * ct, node_t * ch)
 {
     graph_t *g = agraphof(ct);
-#ifndef WITH_CGRAPH
-    edge_t *ce = agedge(g, ct, ch);
-#else /* WITH_CGRAPH */
     edge_t *ce = agedge(g, ct, ch,NULL,1);
     agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
     agcopyattr(e, ce);
 
     return ce;
@@ -1142,20 +1052,11 @@ static item *mapEdge(Dt_t * map, edge_t * e)
  * so we could use a simpler model in which we create a single cluster
  * node for each cluster used in a cluster edge.
  */
-#ifndef WITH_CGRAPH
-#define MAPC(n) (strncmp((n)->name,"cluster",7)?NULL:agfindsubg((n)->graph, (n)->name))
-#else /* WITH_CGRAPH */
 #define MAPC(n) (strncmp(agnameof(n),"cluster",7)?NULL:findCluster(cmap,agnameof(n)))
-#endif /* WITH_CGRAPH */
 
 
-#ifdef WITH_CGRAPH
 static void
 checkCompound(edge_t * e, graph_t * clg, agxbuf * xb, Dt_t * map, Dt_t* cmap)
-#else
-static void
-checkCompound(edge_t * e, graph_t * clg, agxbuf * xb, Dt_t * map)
-#endif
 {
     graph_t *tg;
     graph_t *hg;
@@ -1235,27 +1136,17 @@ int processClusterEdges(graph_t * g)
     graph_t *clg;
     agxbuf xb;
     Dt_t *map;
-#ifdef WITH_CGRAPH
     Dt_t *cmap = mkClustMap (g);
-#endif
     unsigned char buf[SMALLBUF];
 
     map = dtopen(&mapDisc, Dtoset);
-#ifndef WITH_CGRAPH
-    clg = agsubg(g, "__clusternodes");
-#else /* WITH_CGRAPH */
     clg = agsubg(g, "__clusternodes",1);
     agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
     agxbinit(&xb, SMALLBUF, buf);
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        if (IS_CLUST_NODE(n)) continue;
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
-#ifndef WITH_CGRAPH
-           checkCompound(e, clg, &xb, map);
-#else
            checkCompound(e, clg, &xb, map, cmap);
-#endif
        }
     }
     agxbfree(&xb);
@@ -1268,9 +1159,7 @@ int processClusterEdges(graph_t * g)
     agclose(clg);
     if (rv)
        SET_CLUST_EDGE(g);
-#ifdef WITH_CGRAPH
     dtclose(cmap);
-#endif
     return rv;
 }
 
@@ -1284,11 +1173,6 @@ int processClusterEdges(graph_t * g)
  */
 static node_t *mapN(node_t * n, graph_t * clg)
 {
-#ifndef WITH_CGRAPH
-    extern Agdict_t *agdictof(void *);
-    Agdict_t *d;
-    Agsym_t **list;
-#endif /* WITH_CGRAPH */
     node_t *nn;
     char *name;
     graph_t *g = agraphof(n);
@@ -1296,38 +1180,20 @@ static node_t *mapN(node_t * n, graph_t * clg)
 
     if (!(IS_CLUST_NODE(n)))
        return n;
-#ifndef WITH_CGRAPH
-    aginsert(clg, n);
-#else /* WITH_CGRAPH */
     agsubnode(clg, n, 1);
-#endif /* WITH_CGRAPH */
     name = strchr(agnameof(n), ':');
     assert(name);
     name++;
     if ((nn = agfindnode(g, name)))
        return nn;
-#ifndef WITH_CGRAPH
-    nn = agnode(g, name);
-#else /* WITH_CGRAPH */
     nn = agnode(g, name, 1);
     agbindrec(nn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
 
     /* Set all attributes to default */
-#ifndef WITH_CGRAPH
-    d = agdictof(n);
-    list = d->list;
-    while ((sym = *list++)) {
-       /* Can use pointer comparison because of ref strings. */
-       if (agxget(nn, sym->index) != sym->value)
-           agxset(nn, sym->index, sym->value);
-    }
-#else /* WITH_CGRAPH */
     for (sym = agnxtattr(g, AGNODE, NULL); sym;  (sym = agnxtattr(g, AGNODE, sym))) {
        if (agxget(nn, sym) != sym->defval)
            agxset(nn, sym, sym->defval);
     }
-#endif /* WITH_CGRAPH */
     return nn;
 }
 
@@ -1356,12 +1222,8 @@ void undoClusterEdges(graph_t * g)
     edge_t *e;
     graph_t *clg;
 
-#ifndef WITH_CGRAPH
-    clg = agsubg(g, "__clusternodes");
-#else /* WITH_CGRAPH */
     clg = agsubg(g, "__clusternodes",1);
        agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
            undoCompound(e, clg);
@@ -1378,17 +1240,6 @@ void undoClusterEdges(graph_t * g)
  * with given name. If one does not exist, create it with the
  * default value def.
  */ 
-#ifndef WITH_CGRAPH
-attrsym_t*
-safe_dcl(graph_t * g, void *obj, char *name, char *def,
-         attrsym_t * (*fun) (Agraph_t *, char *, char *))
-{
-    attrsym_t *a = agfindattr(obj, name);
-    if (a == NULL)
-       a = fun(g, name, def);
-    return a;
-}
-#else /* WITH_CGRAPH */
 attrsym_t*
 safe_dcl(graph_t * g, int obj_kind, char *name, char *def)
 {
@@ -1397,7 +1248,6 @@ safe_dcl(graph_t * g, int obj_kind, char *name, char *def)
        a = agattr(g,obj_kind,name,def);
     return a;
 }
-#endif /* WITH_CGRAPH */
 
 static int comp_entities(const void *e1, const void *e2) {
   return strcmp(((struct entities_s *)e1)->name, ((struct entities_s *)e2)->name);
@@ -2019,12 +1869,8 @@ void gv_cleanup_edge(edge_t * e)
     free_label(ED_xlabel(e));
     free_label(ED_head_label(e));
     free_label(ED_tail_label(e));
-#ifndef WITH_CGRAPH
-    memset(&(e->u), 0, sizeof(Agedgeinfo_t));
-#else /* WITH_CGRAPH */
        /*FIX HERE , shallow cleaning may not be enough here */
        agdelrec(e, "Agedgeinfo_t");    
-#endif /* WITH_CGRAPH */
 }
 
 void gv_cleanup_node(node_t * n)
@@ -2034,12 +1880,8 @@ void gv_cleanup_node(node_t * n)
         ND_shape(n)->fns->freefn(n);
     free_label(ND_label(n));
     free_label(ND_xlabel(n));
-#ifndef WITH_CGRAPH
-    memset(&(n->u), 0, sizeof(Agnodeinfo_t));
-#else /* WITH_CGRAPH */
        /*FIX HERE , shallow cleaning may not be enough here */
        agdelrec(n, "Agnodeinfo_t");    
-#endif /* WITH_CGRAPH */
 }
 
 void gv_nodesize(node_t * n, boolean flip)
@@ -2085,7 +1927,6 @@ double drand48(void)
     return d;
 }
 #endif
-#ifdef WITH_CGRAPH
 typedef struct {
     Dtlink_t link;
     char* name;
@@ -2155,10 +1996,7 @@ findCluster (Dt_t* map, char* name)
     else
        return NULL;
 }
-#endif
 
-#ifdef WITH_CGRAPH
 Agnodeinfo_t* ninf(Agnode_t* n) {return (Agnodeinfo_t*)AGDATA(n);}
 Agraphinfo_t* ginf(Agraph_t* g) {return (Agraphinfo_t*)AGDATA(g);}
 Agedgeinfo_t* einf(Agedge_t* e) {return (Agedgeinfo_t*)AGDATA(e);}
-#endif
index 6d6b7a3420bfdf6e96e0fadeac7d6ed6dfb39ce9..771d4fd24ba083b2fd374689ff1ed04b8aff6678 100644 (file)
@@ -56,14 +56,9 @@ extern "C" {
     extern void epsf_emit_body(GVJ_t *job, usershape_t *us);
     extern void epsf_define(GVJ_t * job);
     extern void undoClusterEdges(graph_t * g);
-#ifndef WITH_CGRAPH
-    extern attrsym_t* safe_dcl(graph_t*, void*, char*, char*,
-             attrsym_t * (*fun) (Agraph_t *, char *, char *));
-#else
     extern Dt_t* mkClustMap (Agraph_t* g);
     extern Agraph_t* findCluster (Dt_t* map, char* name);
     extern attrsym_t* safe_dcl(graph_t * g, int obj_kind, char *name, char *def);
-#endif
 
     extern int late_int(void *, Agsym_t *, int, int);
     extern double late_double(void *, Agsym_t *, double, double);
@@ -124,11 +119,9 @@ extern "C" {
     /* from psusershape.c */
     extern void cat_libfile(GVJ_t * job, const char **arglib, const char **stdlib);
 
-#ifdef WITH_CGRAPH
 Agnodeinfo_t* ninf(Agnode_t* n);
 Agraphinfo_t* ginf(Agraph_t* g);
 Agedgeinfo_t* einf(Agedge_t* e);
-#endif
     /**/
 #ifdef WIN32   
        extern void fix_fc(void);
index 0d21db8d7bff50311d67838117a61e176e85a786..1538641d34ae777773d345ed62a7a4d9a28d8c1b 100644 (file)
@@ -311,17 +311,10 @@ static void vtx_begin_node(node_t * n)
            break;
        }
     }
-#ifndef WITH_CGRAPH
-    fprintf(Output_file, "  (shape\n"
-           "    (id %d)\n"
-           "    (layer %d)\n"
-           "    (type %s)\n", AGID(n) + 1, AGID(n), p->vtxshape);
-#else
     fprintf(Output_file, "  (shape\n"
            "    (id %ld)\n"
            "    (layer %ld)\n"
            "    (type %s)\n", AGID(n) + 1, AGID(n), p->vtxshape);
-#endif
 }
 
 static void vtx_end_node(void)
@@ -331,17 +324,6 @@ static void vtx_end_node(void)
 
 static void vtx_begin_edge(edge_t * e)
 {
-#ifndef WITH_CGRAPH
-    fprintf(Output_file, "  (connection\n"
-           "    (id %d)\n"
-           "    (layer %d)\n"
-           "    (rotation 0)\n"
-           "    (textRotation 0)\n"
-           "    (locked F)\n"
-           "    (start %d)\n"
-           "    (end %d)\n",
-           AGID(e) + 1, AGID(e), AGID(agtail(e)) + 1, AGID(aghead(e)) + 1);
-#else
     fprintf(Output_file, "  (connection\n"
            "    (id %ld)\n"
            "    (layer %ld)\n"
@@ -351,7 +333,6 @@ static void vtx_begin_edge(edge_t * e)
            "    (start %ld)\n"
            "    (end %ld)\n",
            AGID(e) + 1, AGID(e), AGID(agtail(e)) + 1, AGID(aghead(e)) + 1);
-#endif
 }
 
 static void vtx_end_edge(void)
index 4c6474c5bf41ab7ede13a783b20cb12d2fd60466..d02cac8436aa70dbdc27bb7047c6c7a92b791fb5 100644 (file)
@@ -1,28 +1,17 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
        -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
         -I$(top_srcdir)/lib/gvc \
         -I$(top_srcdir)/lib/ortho \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt \
        -I$(top_srcdir)/lib/pathplan
 
-if WITH_CGRAPH
-noinst_HEADERS = dot.h dotprocs.h aspect.h
-noinst_LTLIBRARIES = libdotgen_C.la
-else
 noinst_HEADERS = dot.h dotprocs.h aspect.h
 noinst_LTLIBRARIES = libdotgen_C.la
-endif
 
 libdotgen_C_la_LDFLAGS = -no-undefined
 libdotgen_C_la_SOURCES = acyclic.c class1.c class2.c cluster.c compound.c \
index aef132733d1d474473e3c9c1c21111664039e414..721cb04e2d1632534838c85c5d0f9a54ea28cd84 100644 (file)
@@ -24,11 +24,7 @@ int nonconstraint_edge(edge_t * e)
 {
     char *constr;
 
-#ifndef WITH_CGRAPH
-    if (E_constr && (constr = agxget(e, E_constr->index))) {
-#else /* WITH_CGRAPH */
     if (E_constr && (constr = agxget(e, E_constr))) {
-#endif /* WITH_CGRAPH */
        if (constr[0] && mapbool(constr) == FALSE)
            return TRUE;
     }
index acf04f726eadc379fe1a9c403e0c73753780c273..509ddc9adc848dddc81a0abaa02e51d1f8314287 100644 (file)
@@ -278,11 +278,7 @@ void class2(graph_t * g)
            else {
                /*other_edge(e); */
                /* avoid when opp==e in undirected graph */
-#ifndef WITH_CGRAPH
-               if ((opp = agfindedge(g, aghead(e), agtail(e))) && (opp != e)) {
-#else
                if ((opp = agfindedge(g, aghead(e), agtail(e))) && (aghead(opp) != aghead(e))) {
-#endif /* WITH_CGRAPH */
                    /* shadows a forward edge */
                    if (ED_to_virt(opp) == NULL)
                        make_chain(g, agtail(opp), aghead(opp), opp);
index 2f2a30ea9324713b452f224b7d89d1c6d3d573dd..5fd08a1183f7f6e947a1319102347c7653333a0a 100644 (file)
@@ -19,18 +19,10 @@ map_interclust_node(node_t * n)
 {
     node_t *rv;
 
-#ifndef WITH_CGRAPH
-    if ((ND_clust(n) == NULL) || (ND_clust(n)->u.expanded))
-#else /* WITH_CGRAPH */
     if ((ND_clust(n) == NULL) || (  GD_expanded(ND_clust(n))) )
-#endif /* WITH_CGRAPH */
        rv = n;
     else
-#ifndef WITH_CGRAPH
-       rv = ND_clust(n)->u.rankleader[ND_rank(n)];
-#else /* WITH_CGRAPH */
        rv = GD_rankleader(ND_clust(n))[ND_rank(n)];
-#endif /* WITH_CGRAPH */
     return rv;
 }
 
@@ -40,34 +32,18 @@ make_slots(graph_t * root, int r, int pos, int d)
 {
     int i;
     node_t *v, **vlist;
-#ifndef WITH_CGRAPH
-    vlist = ND_rank(root)[r].v;
-#else /* WITH_CGRAPH */
     vlist = GD_rank(root)[r].v;
-#endif /* WITH_CGRAPH */
     if (d <= 0) {
-#ifndef WITH_CGRAPH
-       for (i = pos - d + 1; i < ND_rank(root)[r].n; i++) {
-#else /* WITH_CGRAPH */
        for (i = pos - d + 1; i < GD_rank(root)[r].n; i++) {
-#endif /* WITH_CGRAPH */
            v = vlist[i];
            ND_order(v) = i + d - 1;
            vlist[ND_order(v)] = v;
        }
-#ifndef WITH_CGRAPH
-       for (i = ND_rank(root)[r].n + d - 1; i < ND_rank(root)[r].n; i++)
-#else /* WITH_CGRAPH */
        for (i = GD_rank(root)[r].n + d - 1; i < GD_rank(root)[r].n; i++)
-#endif /* WITH_CGRAPH */
            vlist[i] = NULL;
     } else {
 /*assert(ND_rank(root)[r].n + d - 1 <= ND_rank(root)[r].an);*/
-#ifndef WITH_CGRAPH
-       for (i = ND_rank(root)[r].n - 1; i > pos; i--) {
-#else /* WITH_CGRAPH */
        for (i = GD_rank(root)[r].n - 1; i > pos; i--) {
-#endif /* WITH_CGRAPH */
            v = vlist[i];
            ND_order(v) = i + d - 1;
            vlist[ND_order(v)] = v;
@@ -75,11 +51,7 @@ make_slots(graph_t * root, int r, int pos, int d)
        for (i = pos + 1; i < pos + d; i++)
            vlist[i] = NULL;
     }
-#ifndef WITH_CGRAPH
-    ND_rank(root)[r].n += d - 1;
-#else /* WITH_CGRAPH */
     GD_rank(root)[r].n += d - 1;
-#endif /* WITH_CGRAPH */
 }
 
 static node_t* 
@@ -205,10 +177,8 @@ void interclexp(graph_t * subg)
            if (agcontains(subg, e))
                continue;
 
-#ifdef WITH_CGRAPH
-               /* canonicalize edge */
+           /* canonicalize edge */
            e = AGMKOUT(e);
-#endif
            /* short/flat multi edges */
            if (mergeable(prev, e)) {
                if (ND_rank(agtail(e)) == ND_rank(aghead(e)))
@@ -235,11 +205,6 @@ void interclexp(graph_t * subg)
                continue;
            }
 
-/* This assertion is still valid if the new ranking is not used */
-#ifndef WITH_CGRAPH
-           assert(ED_to_virt(e) != NULL);
-#endif
-
            /* forward edges */
            if (ND_rank(aghead(e)) > ND_rank(agtail(e))) {
                make_interclust_chain(g, agtail(e), aghead(e), e);
@@ -270,44 +235,23 @@ merge_ranks(graph_t * subg)
 
     root = agroot(subg);
     if (GD_minrank(subg) > 0)
-#ifndef WITH_CGRAPH
-       ND_rank(root)[GD_minrank(subg) - 1].valid = FALSE;
-#else /* WITH_CGRAPH */
        GD_rank(root)[GD_minrank(subg) - 1].valid = FALSE;
-#endif /* WITH_CGRAPH */
     for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
        d = GD_rank(subg)[r].n;
-#ifndef WITH_CGRAPH
-       ipos = pos = GD_rankleader(subg)[r]->u.order;
-#else /* WITH_CGRAPH */
        ipos = pos = ND_order(GD_rankleader(subg)[r]);
-#endif /* WITH_CGRAPH */
        make_slots(root, r, pos, d);
        for (i = 0; i < GD_rank(subg)[r].n; i++) {
-#ifndef WITH_CGRAPH
-           v = ND_rank(root)[r].v[pos] = GD_rank(subg)[r].v[i];
-#else /* WITH_CGRAPH */
            v = GD_rank(root)[r].v[pos] = GD_rank(subg)[r].v[i];
-#endif /* WITH_CGRAPH */
            ND_order(v) = pos++;
-#ifndef WITH_CGRAPH
-           v->graph = subg->root;
-#else /* WITH_CGRAPH */
        /* real nodes automatically have v->root = root graph */
            if (ND_node_type(v) == VIRTUAL)
                v->root = root;
-#endif /* WITH_CGRAPH */
            delete_fast_node(subg, v);
            fast_node(agroot(subg), v);
            GD_n_nodes(agroot(subg))++;
        }
-#ifndef WITH_CGRAPH
-       GD_rank(subg)[r].v = ND_rank(root)[r].v + ipos;
-       ND_rank(root)[r].valid = FALSE;
-#else /* WITH_CGRAPH */
        GD_rank(subg)[r].v = GD_rank(root)[r].v + ipos;
        GD_rank(root)[r].valid = FALSE;
-#endif /* WITH_CGRAPH */
     }
     if (r < GD_maxrank(root))
        GD_rank(root)[r].valid = FALSE;
@@ -384,11 +328,7 @@ void mark_clusters(graph_t * g)
            for (orig = agfstout(clust, n); orig;
                 orig = agnxtout(clust, orig)) {
                if ((e = ED_to_virt(orig))) {
-#ifndef WITH_CGRAPH
-                   while (e && (vn = e->head)->u.node_type == VIRTUAL) {
-#else /* WITH_CGRAPH */
                    while (e && ND_node_type(vn =aghead(e)) == VIRTUAL) {
-#endif /* WITH_CGRAPH */
                        ND_clust(vn) = clust;
                        e = ND_out(aghead(e)).list[0];
                        /* trouble if concentrators and clusters are mixed */
@@ -462,11 +402,7 @@ void mark_lowclusters(Agraph_t * root)
        ND_clust(n) = NULL;
        for (orig = agfstout(root, n); orig; orig = agnxtout(root, orig)) {
            if ((e = ED_to_virt(orig))) {
-#ifndef WITH_CGRAPH
-               while (e && (vn = e->head)->u.node_type == VIRTUAL) {
-#else /* WITH_CGRAPH */
                while (e && (ND_node_type(vn = aghead(e))) == VIRTUAL) {
-#endif /* WITH_CGRAPH */
                    ND_clust(vn) = NULL;
                    e = ND_out(aghead(e)).list[0];
                }
@@ -495,11 +431,7 @@ static void mark_lowcluster_basic(Agraph_t * g)
            ND_clust(n) = g;
        for (orig = agfstout(g, n); orig; orig = agnxtout(g, orig)) {
            if ((e = ED_to_virt(orig))) {
-#ifndef WITH_CGRAPH
-               while (e && (vn = e->head)->u.node_type == VIRTUAL) {
-#else /* WITH_CGRAPH */
                while (e && (ND_node_type(vn = aghead(e))) == VIRTUAL) {
-#endif /* WITH_CGRAPH */
                    if (ND_clust(vn) == NULL)
                        ND_clust(vn) = g;
                    e = ND_out(aghead(e)).list[0];
index 25d659aac5dd6f125e685ce39538c2bb94d51505..ac78cd577437e0aa13ba3e9c6d9b40f1d06e43d9 100644 (file)
@@ -93,21 +93,13 @@ static int inBoxf(pointf p, boxf * bb)
  * Returns NULL if no name is given, or subgraph of
  * that name does not exist.
  */
-#ifdef WITH_CGRAPH
 static graph_t *getCluster(graph_t * g, char *cluster_name, Dt_t* map)
-#else
-static graph_t *getCluster(graph_t * g, char *cluster_name)
-#endif
 {
     Agraph_t* sg;
 
     if (!cluster_name || (*cluster_name == '\0'))
        return NULL;
-#ifdef WITH_CGRAPH
     sg = findCluster (map, cluster_name);
-#else
-    sg = agfindsubg(g, cluster_name);
-#endif
     if (sg == NULL) {
        agerr(AGWARN, "cluster named %s not found\n", cluster_name);
     }
@@ -299,11 +291,7 @@ static int splineIntersectf(pointf * pts, boxf * bb)
  * with n control points where n >= 4 and n (mod 3) = 1.
  * If edge has arrowheads, reposition them.
  */
-#ifdef WITH_CGRAPH
 static void makeCompoundEdge(graph_t * g, edge_t * e, Dt_t* clustMap)
-#else
-static void makeCompoundEdge(graph_t * g, edge_t * e)
-#endif
 {
     graph_t *lh;               /* cluster containing head */
     graph_t *lt;               /* cluster containing tail */
@@ -320,13 +308,8 @@ static void makeCompoundEdge(graph_t * g, edge_t * e)
     int fixed;
 
     /* find head and tail target clusters, if defined */
-#ifdef WITH_CGRAPH
     lh = getCluster(g, agget(e, "lhead"), clustMap);
     lt = getCluster(g, agget(e, "ltail"), clustMap);
-#else
-    lh = getCluster(g, agget(e, "lhead"));
-    lt = getCluster(g, agget(e, "ltail"));
-#endif
     if (!lt && !lh)
        return;
     if (!ED_spl(e)) return;
@@ -504,19 +487,11 @@ void dot_compoundEdges(graph_t * g)
 {
     edge_t *e;
     node_t *n;
-#ifdef WITH_CGRAPH
     Dt_t* clustMap = mkClustMap (g);
-#endif
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
-#ifdef WITH_CGRAPH
            makeCompoundEdge(g, e, clustMap);
-#else
-           makeCompoundEdge(g, e);
-#endif
        }
     }
-#ifdef WITH_CGRAPH
     dtclose(clustMap);
-#endif
 }
index 2dc97e70190b50f3e87513128ce92567ff38e589..cd23aa31313d798f5e0953e8652cc0d7b99a3e0c 100644 (file)
@@ -16,7 +16,6 @@
 #include "dot.h"
 #include "aspect.h"
 
-#ifdef WITH_CGRAPH
 static void
 dot_init_subg(graph_t * g)
 {
@@ -28,15 +27,12 @@ dot_init_subg(graph_t * g)
        dot_init_subg(subg);
     }
 }
-#endif
 
 
 static void 
 dot_init_node(node_t * n)
 {
-#ifdef WITH_CGRAPH
     agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);  //graph custom data
-#endif /* WITH_CGRAPH */
     common_init_node(n);
     gv_nodesize(n, GD_flip(agraphof(n)));
     alloc_elist(4, ND_in(n));
@@ -51,9 +47,7 @@ static void
 dot_init_edge(edge_t * e)
 {
     char *tailgroup, *headgroup;
-#ifdef WITH_CGRAPH
     agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //graph custom data
-#endif /* WITH_CGRAPH */
     common_init_edge(e);
 
     ED_weight(e) = late_int(e, E_weight, 1, 0);
@@ -111,11 +105,7 @@ dot_cleanup_node(node_t * n)
     free_label(ND_label(n));
     if (ND_shape(n))
        ND_shape(n)->fns->freefn(n);
-#ifndef WITH_CGRAPH
-    memset(&(n->u), 0, sizeof(Agnodeinfo_t));
-#else /* WITH_CGRAPH */
     agdelrec(n, "Agnodeinfo_t");       
-#endif /* WITH_CGRAPH */
 }
 
 static void free_virtual_edge_list(node_t * n)
@@ -126,17 +116,13 @@ static void free_virtual_edge_list(node_t * n)
     for (i = ND_in(n).size - 1; i >= 0; i--) {
        e = ND_in(n).list[i];
        delete_fast_edge(e);
-#ifdef WITH_CGRAPH
        free(e->base.data);
-#endif
        free(e);
     }
     for (i = ND_out(n).size - 1; i >= 0; i--) {
        e = ND_out(n).list[i];
        delete_fast_edge(e);
-#ifdef WITH_CGRAPH
        free(e->base.data);
-#endif
        free(e);
     }
 }
@@ -151,9 +137,7 @@ static void free_virtual_node_list(node_t * vn)
        if (ND_node_type(vn) == VIRTUAL) {
            free_list(ND_out(vn));
            free_list(ND_in(vn));
-#ifdef WITH_CGRAPH
            free(vn->base.data);
-#endif
            free(vn);
        }
        vn = next_vn;
@@ -164,20 +148,10 @@ static void
 dot_cleanup_graph(graph_t * g)
 {
     int i;
-#ifndef WITH_CGRAPH
-    graph_t *clust;
-    int c;
-    for (c = 1; c <= GD_n_cluster(g); c++) {
-       clust = GD_clust(g)[c];
-       GD_parent(clust) = NULL;
-       dot_cleanup(clust);
-    }
-#else
     graph_t *subg;
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
        dot_cleanup_graph(subg);
     }
-#endif
     if (GD_clust(g)) free (GD_clust(g));
     if (GD_rankleader(g)) free (GD_rankleader(g));
 
@@ -190,13 +164,8 @@ dot_cleanup_graph(graph_t * g)
        else
            free(GD_rank(g));
     }
-#ifndef WITH_CGRAPH
-    if (g != agroot(g)) 
-       memset(&(g->u), 0, sizeof(Agraphinfo_t));
-#else /* WITH_CGRAPH */
     if (g != agroot(g)) 
        agdelrec(g,"Agraphinfo_t");
-#endif /* WITH_CGRAPH */
 }
 
 /* delete the layout (but retain the underlying graph) */
@@ -250,7 +219,6 @@ dumpRanks (graph_t * g)
 #endif
 
 
-#ifdef WITH_CGRAPH
 static void
 remove_from_rank (Agraph_t * g, Agnode_t* n)
 {
@@ -293,14 +261,9 @@ removeFill (Agraph_t * g)
     agdelsubg (g, sg);
 
 }
-#endif
 
-#ifndef WITH_CGRAPH
-#define ag_xset(x,a,v) agxset(x,a->index,v)
-#else /* WITH_CGRAPH */
 #define ag_xset(x,a,v) agxset(x,a,v)
 #define agnodeattr(g,n,v) agattr(g,AGNODE,n,v)
-#endif /* WITH_CGRAPH */
 
 static void
 attach_phase_attrs (Agraph_t * g, int maxphase)
@@ -331,10 +294,7 @@ void dot_layout(Agraph_t * g)
     setEdgeType (g, ET_SPLINE);
     asp = setAspect (g, &aspect);
 
-#ifdef WITH_CGRAPH
     dot_init_subg(g);
-#endif
-
     dot_init_node_edge(g);
 
     do {
@@ -360,10 +320,8 @@ void dot_layout(Agraph_t * g)
        }
        aspect.nPasses--;
     } while (aspect.nextIter && aspect.nPasses);
-#ifdef WITH_CGRAPH
     if (GD_flags(g) & NEW_RANK)
        removeFill (g);
-#endif
     dot_sameports(g);
     dot_splines(g);
     if (mapbool(agget(g, "compound")))
index 2beb328fe181112e9adac2ff4a9e09e3524850cc..9391513d74cd76950ea922feec9a92b5d808d591 100644 (file)
 #define AUXGRAPH  128
 #define GRAPHTYPEMASK  192     /* the OR of the above */
 
-#ifndef WITH_CGRAPH
-#define MAKEFWDEDGE(new, old) { \
-       edge_t *newp; \
-       newp = new; \
-       *newp = *old; \
-       newp->tail = old->head; \
-       newp->head = old->tail; \
-       ED_tail_port(newp) = ED_head_port(old); \
-       ED_head_port(newp) = ED_tail_port(old); \
-       ED_edge_type(newp) = VIRTUAL; \
-       ED_to_orig(newp) = old; \
-}
-#else /* WITH_CGRAPH */
 #define MAKEFWDEDGE(new, old) { \
        edge_t *newp; \
        Agedgeinfo_t *info; \
@@ -63,7 +50,6 @@
        ED_edge_type(newp) = VIRTUAL; \
        ED_to_orig(newp) = old; \
 }
-#endif /* WITH_CGRAPH */
 
 static boxf boxes[1000];
 typedef struct {
@@ -268,20 +254,14 @@ static void _dot_splines(graph_t * g, int normalize)
 {
     int i, j, k, n_nodes, n_edges, ind, cnt;
     node_t *n;
-#ifndef WITH_CGRAPH
-    edge_t fwdedgea, fwdedgeb;
-#else
     Agedgeinfo_t fwdedgeai, fwdedgebi;
     Agedgepair_t fwdedgea, fwdedgeb;
-#endif
     edge_t *e, *e0, *e1, *ea, *eb, *le0, *le1, **edges;
     path *P;
     spline_info_t sd;
     int et = EDGE_TYPE(g);
-#ifdef WITH_CGRAPH
     fwdedgea.out.base.data = (Agrec_t*)&fwdedgeai;
     fwdedgeb.out.base.data = (Agrec_t*)&fwdedgebi;
-#endif /* WITH_CGRAPH */
 
     if (et == ET_NONE) return; 
     if (et == ET_CURVED) {
@@ -408,13 +388,8 @@ static void _dot_splines(graph_t * g, int normalize)
        ea = (ED_tail_port(e0).defined
              || ED_head_port(e0).defined) ? e0 : le0;
        if (ED_tree_index(ea) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-           MAKEFWDEDGE(&fwdedgea, ea);
-           ea = &fwdedgea;
-#else
            MAKEFWDEDGE(&fwdedgea.out, ea);
            ea = &fwdedgea.out;
-#endif
        }
        for (cnt = 1; i < n_edges; cnt++, i++) {
            if (le0 != (le1 = getmainedge((e1 = edges[i]))))
@@ -423,13 +398,8 @@ static void _dot_splines(graph_t * g, int normalize)
            eb = (ED_tail_port(e1).defined
                  || ED_head_port(e1).defined) ? e1 : le1;
            if (ED_tree_index(eb) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-               MAKEFWDEDGE(&fwdedgeb, eb);
-               eb = &fwdedgeb;
-#else
                MAKEFWDEDGE(&fwdedgeb.out, eb);
                eb = &fwdedgeb.out;
-#endif
            }
            if (portcmp(ED_tail_port(ea), ED_tail_port(eb)))
                break;
@@ -494,17 +464,10 @@ finish :
        for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
            if (E_headlabel) {
                for (e = agfstin(g, n); e; e = agnxtin(g, e))
-#ifndef WITH_CGRAPH
-                   if (ED_head_label(e)) {
-                       if (place_portlabel(e, TRUE))
-                           updateBB(g, ED_head_label(e));
-                   }
-#else
                    if (ED_head_label(AGMKOUT(e))) {
                        place_portlabel(AGMKOUT(e), TRUE);
                        updateBB(g, ED_head_label(AGMKOUT(e)));
                    }
-#endif
 
            }
            if (E_taillabel) {
@@ -606,20 +569,14 @@ setflags(edge_t *e, int hint1, int hint2, int f3)
  */
 static int edgecmp(edge_t** ptr0, edge_t** ptr1)
 {
-#ifndef WITH_CGRAPH
-    edge_t fwdedgea, fwdedgeb, *e0, *e1, *ea, *eb, *le0, *le1;
-#else
     Agedgeinfo_t fwdedgeai, fwdedgebi;
     Agedgepair_t fwdedgea, fwdedgeb;
     edge_t *e0, *e1, *ea, *eb, *le0, *le1;
-#endif
     int et0, et1, v0, v1, rv;
     double t0, t1;
 
-#ifdef WITH_CGRAPH
     fwdedgea.out.base.data = (Agrec_t*)&fwdedgeai;
     fwdedgeb.out.base.data = (Agrec_t*)&fwdedgebi;
-#endif
     e0 = (edge_t *) * ptr0;
     e1 = (edge_t *) * ptr1;
     et0 = ED_tree_index(e0) & EDGETYPEMASK;
@@ -650,23 +607,13 @@ static int edgecmp(edge_t** ptr0, edge_t** ptr1)
 
     ea = (ED_tail_port(e0).defined || ED_head_port(e0).defined) ? e0 : le0;
     if (ED_tree_index(ea) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-       MAKEFWDEDGE(&fwdedgea, ea);
-       ea = &fwdedgea;
-#else
        MAKEFWDEDGE(&fwdedgea.out, ea);
        ea = &fwdedgea.out;
-#endif
     }
     eb = (ED_tail_port(e1).defined || ED_head_port(e1).defined) ? e1 : le1;
     if (ED_tree_index(eb) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-       MAKEFWDEDGE(&fwdedgeb, eb);
-       eb = &fwdedgeb;
-#else
        MAKEFWDEDGE(&fwdedgeb.out, eb);
        eb = &fwdedgeb.out;
-#endif
     }
     if ((rv = portcmp(ED_tail_port(ea), ED_tail_port(eb))))
        return rv;
@@ -775,21 +722,11 @@ setState (graph_t* auxg, attr_state_t* attr_state)
     attr_state->G_ordering = G_ordering;
 
     E_constr = NULL;
-#ifndef WITH_CGRAPH
-    E_samehead = agfindattr(auxg->proto->e, "samehead");
-    E_sametail = agfindattr(auxg->proto->e, "sametail");
-    E_weight = agfindattr(auxg->proto->e, "weight");
-#else /* WITH_CGRAPH */
     E_samehead = agattr(auxg,AGEDGE, "samehead", NULL);
     E_sametail = agattr(auxg,AGEDGE, "sametail", NULL);
     E_weight = agattr(auxg,AGEDGE, "weight", NULL);
-#endif /* WITH_CGRAPH */
     if (!E_weight)
-#ifndef WITH_CGRAPH
-       E_weight = agedgeattr (auxg, "weight", "");
-#else /* WITH_CGRAPH */
        E_weight = agattr (auxg,AGEDGE,"weight", "");
-#endif /* WITH_CGRAPH */
     E_minlen = NULL;
     E_fontcolor = NULL;
     E_fontname = agfindedgeattr(auxg, "fontname");
@@ -838,19 +775,12 @@ cloneGraph (graph_t* g, attr_state_t* attr_state)
 {
     Agsym_t* sym;
     graph_t* auxg;
-#ifndef WITH_CGRAPH
-    Agsym_t **list;
-
-    auxg = agopen ("auxg", AG_IS_DIRECTED(g)?AGDIGRAPH:AGRAPH);
-    agraphattr(auxg, "rank", "");
-#else /* WITH_CGRAPH */
     if (agisdirected(g))
        auxg = agopen ("auxg",Agdirected, NIL(Agdisc_t *));
     else
        auxg = agopen ("auxg",Agundirected, NIL(Agdisc_t *));
     agbindrec(auxg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
     agattr(auxg, AGRAPH, "rank", "");
-#endif /* WITH_CGRAPH */
     GD_drawing(auxg) = NEW(layout_t);
     GD_drawing(auxg)->quantum = GD_drawing(g)->quantum; 
     GD_drawing(auxg)->dpi = GD_drawing(g)->dpi;
@@ -863,42 +793,23 @@ cloneGraph (graph_t* g, attr_state_t* attr_state)
     GD_nodesep(auxg) = GD_nodesep(g);
     GD_ranksep(auxg) = GD_ranksep(g);
 
-#ifndef WITH_CGRAPH
-    list = g->root->univ->nodeattr->list;
-    while ((sym = *list++)) {
-       agnodeattr (auxg, sym->name, sym->value);
-#else /* WITH_CGRAPH */
        //copy node attrs to auxg
 //     list = g->root->univ->nodeattr->list;
        sym=agnxtattr(agroot(g),AGNODE,NULL); //get the first attr.
        while ((sym = agnxtattr(agroot(g),AGNODE,sym))) {
                agattr (auxg, AGNODE,sym->name, sym->defval     );
-#endif /* WITH_CGRAPH */
     }
 
-#ifndef WITH_CGRAPH
-    list = g->root->univ->edgeattr->list;
-    while ((sym = *list++)) {
-       agedgeattr (auxg, sym->name, sym->value);
-#else /* WITH_CGRAPH */
        //copy edge attributes
        sym=agnxtattr(agroot(g),AGEDGE,NULL); //get the first attr.
        while ((sym = agnxtattr(agroot(g),AGEDGE,sym))) {
        agattr (auxg, AGEDGE,sym->name, sym->defval);
-#endif /* WITH_CGRAPH */
     }
 
-#ifndef WITH_CGRAPH
-    if (!agfindattr(auxg->proto->e, "headport"))
-       agedgeattr (auxg, "headport", "");
-    if (!agfindattr(auxg->proto->e, "tailport"))
-       agedgeattr (auxg, "tailport", "");
-#else /* WITH_CGRAPH */
     if (!agattr(auxg,AGEDGE, "headport", NULL))
        agattr(auxg,AGEDGE, "headport", "");
     if (!agattr(auxg,AGEDGE, "tailport", NULL))
        agattr(auxg,AGEDGE, "tailport", "");
-#endif /* WITH_CGRAPH */
 
     setState (auxg, attr_state);
 
@@ -964,12 +875,8 @@ cleanupCloneGraph (graph_t* g, attr_state_t* attr_state)
 static node_t*
 cloneNode (graph_t* g, node_t* orign, int flipped)
 {
-#ifndef WITH_CGRAPH
-    node_t* n = agnode(g, orign->name);
-#else /* WITH_CGRAPH */
     node_t* n = agnode(g, agnameof(orign),1);
     agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
     agcopyattr (orign, n);
     if (shapeOf(orign) == SH_RECORD) {
        int lbllen = strlen(ND_label(orign)->text);
@@ -986,11 +893,7 @@ cloneNode (graph_t* g, node_t* orign, int flipped)
 static edge_t*
 cloneEdge (graph_t* g, node_t* tn, node_t* hn, edge_t* orig)
 {
-#ifndef WITH_CGRAPH
-    edge_t* e = agedge(g, tn, hn);
-#else /* WITH_CGRAPH */
     edge_t* e = agedge(g, tn, hn,NULL,1);
-#endif /* WITH_CGRAPH */
     /* for (; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig)); */
     agcopyattr (orig, e);
 /*
@@ -1096,11 +999,7 @@ makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt,
     points[pointn++] = tp;
     points[pointn++] = hp;
     points[pointn++] = hp;
-#ifndef WITH_CGRAPH
-    clip_and_install(e, e->head, points, pointn, &sinfo);
-#else /* WITH_CGRAPH */
     clip_and_install(e, aghead(e), points, pointn, &sinfo);
-#endif /* WITH_CGRAPH */
     ED_label(e)->pos.x = ctrx;
     ED_label(e)->pos.y = tp.y + (ED_label(e)->dimen.y+LBL_SPACE)/2.0;
     ED_label(e)->set = TRUE;
@@ -1160,11 +1059,7 @@ makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt,
        ED_label(e)->pos.x = ctrx;
        ED_label(e)->pos.y = ctry;
        ED_label(e)->set = TRUE;
-#ifndef WITH_CGRAPH
-       clip_and_install(e, e->head, ps, pn, &sinfo);
-#else /* WITH_CGRAPH */
        clip_and_install(e, aghead(e), ps, pn, &sinfo);
-#endif /* WITH_CGRAPH */
     }
 
     /* edges with no labels */
@@ -1213,11 +1108,7 @@ makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt,
        poly.ps = (Ppoint_t*)points;
        ps = simpleSplineRoute (tp, hp, poly, &pn, et == ET_PLINE);
        if (pn == 0) return;
-#ifndef WITH_CGRAPH
-       clip_and_install(e, e->head, ps, pn, &sinfo);
-#else /* WITH_CGRAPH */
        clip_and_install(e, aghead(e), ps, pn, &sinfo);
-#endif /* WITH_CGRAPH */
     }
    
     free (earray);
@@ -1261,11 +1152,7 @@ makeSimpleFlat (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et
            points[pointn++] = hp;
        }
        dy += stepy;
-#ifndef WITH_CGRAPH
-       clip_and_install(e, e->head, points, pointn, &sinfo);
-#else /* WITH_CGRAPH */
        clip_and_install(e, aghead(e), points, pointn, &sinfo);
-#endif /* WITH_CGRAPH */
     }
 }
 
@@ -1318,12 +1205,8 @@ make_flat_adj_edges(path* P, edge_t** edges, int ind, int cnt, edge_t* e0,
 
     attrs = NEW(attr_state_t);
     auxg = cloneGraph (g, attrs);
-#ifndef WITH_CGRAPH
-    subg = agsubg (auxg, "xxx");
-#else /* WITH_CGRAPH */
     subg = agsubg (auxg, "xxx",1);
     agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
     agset (subg, "rank", "source");
     rightx = ND_coord(hn).x;
     leftx = ND_coord(tn).x;
@@ -1349,17 +1232,9 @@ make_flat_adj_edges(path* P, edge_t** edges, int ind, int cnt, edge_t* e0,
        }
     }
     if (!hvye) {
-#ifndef WITH_CGRAPH
-       hvye = agedge (auxg, auxt, auxh);
-#else /* WITH_CGRAPH */
        hvye = agedge (auxg, auxt, auxh,NULL,1);
-#endif /* WITH_CGRAPH */
     }
-#ifndef WITH_CGRAPH
-    agxset (hvye, E_weight->index, "10000");
-#else /* WITH_CGRAPH */
     agxset (hvye, E_weight, "10000");
-#endif /* WITH_CGRAPH */
     GD_gvc(auxg) = GD_gvc(g);
     setEdgeType (auxg, et);
     dot_init_node_edge(auxg);
@@ -1546,11 +1421,7 @@ make_flat_labeled_edge(spline_info_t* sp, path* P, edge_t* e, int et)
        else ps = routepolylines(P, &pn);
        if (pn == 0) return;
     }
-#ifndef WITH_CGRAPH
-    clip_and_install(e, e->head, ps, pn, &sinfo);
-#else /* WITH_CGRAPH */
     clip_and_install(e, aghead(e), ps, pn, &sinfo);
-#endif /* WITH_CGRAPH */
 }
 
 /* make_flat_bottom_edges:
@@ -1636,13 +1507,9 @@ static void
 make_flat_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
 {
     node_t *tn, *hn;
-#ifndef WITH_CGRAPH
-    edge_t fwdedge, *e;
-#else
     Agedgeinfo_t fwdedgei;
     Agedgepair_t fwdedge;
     edge_t *e;
-#endif
     int j, i, r, isAdjacent;
     double stepx, stepy, vspace;
     int tside, hside, pn;
@@ -1650,21 +1517,14 @@ make_flat_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, i
     pathend_t tend, hend;
     graph_t* g;
 
-#ifdef WITH_CGRAPH
     fwdedge.out.base.data = (Agrec_t*)&fwdedgei;
-#endif
 
     /* Get sample edge; normalize to go from left to right */
     e = edges[ind];
     isAdjacent = ED_adjacent(e);
     if (ED_tree_index(e) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-       MAKEFWDEDGE(&fwdedge, e);
-       e = &fwdedge;
-#else
        MAKEFWDEDGE(&fwdedge.out, e);
        e = &fwdedge.out;
-#endif
     }
     for (i = 1; i < cnt; i++) {
        if (ED_adjacent(edges[ind+i])) {
@@ -1856,13 +1716,9 @@ make_regular_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt
 {
     graph_t *g;
     node_t *tn, *hn;
-#ifndef WITH_CGRAPH
-    edge_t fwdedgea, fwdedgeb, fwdedge, *e, *fe, *le, *segfirst;
-#else
     Agedgeinfo_t fwdedgeai, fwdedgebi, fwdedgei;
     Agedgepair_t fwdedgea, fwdedgeb, fwdedge;
     edge_t *e, *fe, *le, *segfirst;
-#endif /* WITH_CGRAPH */
     pointf *ps;
     pathend_t tend, hend;
     boxf b;
@@ -1873,11 +1729,9 @@ make_regular_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt
     static int numpts2;
     int pointn;
 
-#ifdef WITH_CGRAPH
     fwdedgea.out.base.data = (Agrec_t*)&fwdedgeai;
     fwdedgeb.out.base.data = (Agrec_t*)&fwdedgebi;
     fwdedge.out.base.data = (Agrec_t*)&fwdedgei;
-#endif /* WITH_CGRAPH */
 
     if (!pointfs) {
        pointfs = N_GNEW(NUMPTS, pointf);
@@ -1890,62 +1744,33 @@ make_regular_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt
     g = agraphof(agtail(e));
     hackflag = FALSE;
     if (ABS(ND_rank(agtail(e)) - ND_rank(aghead(e))) > 1) {
-#ifndef WITH_CGRAPH
-       fwdedgea = *e;
-#else /* WITH_CGRAPH */
        fwdedgeai = *(Agedgeinfo_t*)e->base.data;
        fwdedgea.out = *e;
        fwdedgea.out.base.data = (Agrec_t*)&fwdedgeai;
-#endif /* WITH_CGRAPH */
        if (ED_tree_index(e) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-           MAKEFWDEDGE(&fwdedgeb, e);
-           fwdedgea.tail = aghead(e);
-           fwdedgea.u.tail_port = ED_head_port(e);
-#else /* WITH_CGRAPH */
            MAKEFWDEDGE(&fwdedgeb.out, e);
            agtail(&fwdedgea.out) = aghead(e);
            ED_tail_port(&fwdedgea.out) = ED_head_port(e);
-#endif /* WITH_CGRAPH */
        } else {
-#ifndef WITH_CGRAPH
-           fwdedgeb = *e;
-           fwdedgea.tail = e->tail;
-#else /* WITH_CGRAPH */
            fwdedgebi = *(Agedgeinfo_t*)e->base.data;
            fwdedgeb.out = *e;
            fwdedgeb.out.base.data = (Agrec_t*)&fwdedgebi;
            agtail(&fwdedgea.out) = agtail(e);
-#endif /* WITH_CGRAPH */
        }
        le = getmainedge(e);
        while (ED_to_virt(le))
            le = ED_to_virt(le);
-#ifndef WITH_CGRAPH
-       fwdedgea.head = aghead(le);
-       fwdedgea.u.head_port.defined = FALSE;
-       fwdedgea.u.edge_type = VIRTUAL;
-       fwdedgea.u.head_port.p.x = fwdedgea.u.head_port.p.y = 0;
-       fwdedgea.u.to_orig = e;
-       e = &fwdedgea;
-#else /* WITH_CGRAPH */
        aghead(&fwdedgea.out) = aghead(le);
        ED_head_port(&fwdedgea.out).defined = FALSE;
        ED_edge_type(&fwdedgea.out) = VIRTUAL;
        ED_head_port(&fwdedgea.out).p.x = ED_head_port(&fwdedgea.out).p.y = 0;
        ED_to_orig(&fwdedgea.out) = e;
        e = &fwdedgea.out;
-#endif /* WITH_CGRAPH */
        hackflag = TRUE;
     } else {
        if (ED_tree_index(e) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-           MAKEFWDEDGE(&fwdedgea, e);
-           e = &fwdedgea;
-#else
            MAKEFWDEDGE(&fwdedgea.out, e);
            e = &fwdedgea.out;
-#endif
        }
     }
     fe = e;
@@ -2035,11 +1860,7 @@ make_regular_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt
        }
        boxes[boxn++] = rank_box(sp, g, ND_rank(tn));
        b = hend.nb = maximal_bbox(sp, hn, e, NULL);
-#ifndef WITH_CGRAPH
-       endpath(P, hackflag ? &fwdedgeb : e, REGULAREDGE, &hend, spline_merge(aghead(e)));
-#else
        endpath(P, hackflag ? &fwdedgeb.out : e, REGULAREDGE, &hend, spline_merge(aghead(e)));
-#endif
        b.UR.y = hend.boxes[hend.boxn - 1].UR.y;
        b.LL.y = hend.boxes[hend.boxn - 1].LL.y;
        b = makeregularend(b, TOP,
@@ -2069,11 +1890,7 @@ make_regular_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt
            pointfs[pointn++] = ps[i];
        }
        recover_slack(segfirst, P);
-#ifndef WITH_CGRAPH
-       hn = hackflag ? aghead(&fwdedgeb) : aghead(e);
-#else
        hn = hackflag ? aghead(&fwdedgeb.out) : aghead(e);
-#endif
     }
 
     /* make copies of the spline points, one per multi-edge */
@@ -2096,13 +1913,8 @@ make_regular_edge(spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt
     for (j = 1; j < cnt; j++) {
        e = edges[ind + j];
        if (ED_tree_index(e) & BWDEDGE) {
-#ifndef WITH_CGRAPH
-           MAKEFWDEDGE(&fwdedge, e);
-           e = &fwdedge;
-#else
            MAKEFWDEDGE(&fwdedge.out, e);
            e = &fwdedge.out;
-#endif
        }
        for (i = 1; i < pointn - 1; i++)
            pointfs[i].x += sp->Multisep;
index 03663b3601921aaff2d36c2893e0c4b97463de9f..a3a16185c139003d684492279ab9dc5a32618695 100644 (file)
@@ -163,24 +163,18 @@ edge_t *new_virtual_edge(node_t * u, node_t * v, edge_t * orig)
 {
     edge_t *e;
 
-#ifndef WITH_CGRAPH
-    e = NEW(edge_t);
-#else /* WITH_CGRAPH */
     Agedgepair_t* e2 = NEW(Agedgepair_t);
     AGTYPE(&(e2->in)) = AGINEDGE;
     AGTYPE(&(e2->out)) = AGOUTEDGE;
     e2->out.base.data = (Agrec_t*)NEW(Agedgeinfo_t);
     e = &(e2->out);
-#endif /* WITH_CGRAPH */
     agtail(e) = u;
     aghead(e) = v;
     ED_edge_type(e) = VIRTUAL;
 
     if (orig) {
        AGSEQ(e) = AGSEQ(orig);
-#ifdef WITH_CGRAPH
        AGSEQ(&(e2->in)) = AGSEQ(orig);
-#endif
        ED_count(e) = ED_count(orig);
        ED_xpenalty(e) = ED_xpenalty(orig);
        ED_weight(e) = ED_weight(orig);
@@ -248,15 +242,10 @@ node_t *virtual_node(graph_t * g)
     node_t *n;
 
     n = NEW(node_t);
-#ifndef WITH_CGRAPH
-    n->name = "virtual";
-    n->graph = g;
-#else /* WITH_CGRAPH */
 //  agnameof(n) = "virtual";
     AGTYPE(n) = AGNODE;
     n->base.data = (Agrec_t*)NEW(Agnodeinfo_t);
     n->root = g;
-#endif /* WITH_CGRAPH */
     ND_node_type(n) = VIRTUAL;
     ND_lw(n) = ND_rw(n) = 1;
     ND_ht(n) = 1;
index 1469d421c316d31db0e88df4811c27446abe3f26..f14dfd3c352fe5268007058f2b329e3aba72445e 100644 (file)
@@ -240,22 +240,9 @@ static void ordered_edges(graph_t * g)
     }
     else
     {
-#ifndef WITH_CGRAPH
-       /* search meta-graph to find subgraphs that may be ordered */
-       graph_t *mg, *subg;
-       node_t *mm, *mn;
-       edge_t *me;
-
-       mm = g->meta_node;
-       mg = mm->graph;
-       for (me = agfstout(mg, mm); me; me = agnxtout(mg, me)) {
-           mn = me->head;
-           subg = agusergraph(mn);
-#else /* WITH_CGRAPH */
        graph_t *subg;
 
        for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
-#endif /* WITH_CGRAPH */
            /* clusters are processed by separate calls to ordered_edges */
            if (!is_cluster(subg))
                ordered_edges(subg);
@@ -746,9 +733,7 @@ static void cleanup2(graph_t * g, int nc)
                for (j = 0; (e = ND_flat_out(v).list[j]); j++)
                    if (ED_edge_type(e) == FLATORDER) {
                        delete_flat_edge(e);
-#ifdef WITH_CGRAPH
                        free(e->base.data);
-#endif
                        free(e);
                        j--;
                    }
@@ -854,16 +839,11 @@ void rec_reset_vlists(graph_t * g)
 #ifdef DEBUG
            assert(GD_rank(g->root)[r].v[ND_order(u)] == u);
 #endif
-#ifndef WITH_CGRAPH
-           GD_rank(g)[r].v = ND_rank(g->root)[r].v + ND_order(u);
-#else /* WITH_CGRAPH */
            GD_rank(g)[r].v = GD_rank(agroot(g))[r].v + ND_order(u);
-#endif /* WITH_CGRAPH */
            GD_rank(g)[r].n = ND_order(w) - ND_order(u) + 1;
        }
 }
 
-#ifdef WITH_CGRAPH
 /* realFillRanks:
  * The structures in crossing minimization and positioning require
  * that clusters have some node on each rank. This function recursively
@@ -924,7 +904,6 @@ fillRanks (Agraph_t* g)
     sg = realFillRanks (g, rnks, rnks_sz, NULL);
     free (rnks);
 }
-#endif
 
 static void init_mincross(graph_t * g)
 {
@@ -942,10 +921,8 @@ static void init_mincross(graph_t * g)
     TE_list = N_NEW(size, edge_t *);
     TI_list = N_NEW(size, int);
     mincross_options(g);
-#ifdef WITH_CGRAPH
     if (GD_flags(g) & NEW_RANK)
        fillRanks (g);
-#endif
     class2(g);
     decompose(g, 1);
     allocate_ranks(g);
@@ -993,11 +970,7 @@ static void flat_search(graph_t * g, node_t * v)
 
     ND_mark(v) = TRUE;
     ND_onstack(v) = TRUE;
-#ifndef WITH_CGRAPH
-    hascl = (ND_n_cluster(g->root) > 0);
-#else /* WITH_CGRAPH */
     hascl = (GD_n_cluster(agroot(g)) > 0);
-#endif /* WITH_CGRAPH */
     if (ND_flat_out(v).list)
        for (i = 0; (e = ND_flat_out(v).list[i]); i++) {
            if (hascl
index 0a529ec6597817381fd901719e4d7f148a203250..43926e5a7fb96552c206fb8d5ed1e40c8543bd69 100644 (file)
@@ -173,15 +173,11 @@ edge_t *make_aux_edge(node_t * u, node_t * v, double len, int wt)
 {
     edge_t *e;
 
-#ifndef WITH_CGRAPH
-    e = NEW(edge_t);
-#else
     Agedgepair_t* e2 = NEW(Agedgepair_t);
     AGTYPE(&(e2->in)) = AGINEDGE;
     AGTYPE(&(e2->out)) = AGOUTEDGE;
     e2->out.base.data = (Agrec_t*)NEW(Agedgeinfo_t);
     e = &(e2->out);
-#endif /* WITH_CGRAPH */
 
     agtail(e) = u;
     aghead(e) = v;
@@ -557,9 +553,7 @@ static void remove_aux_edges(graph_t * g)
 
     for (n = GD_nlist(g); n; n = ND_next(n)) {
        for (i = 0; (e = ND_out(n).list[i]); i++) {
-#ifdef WITH_CGRAPH
            free(e->base.data);
-#endif
            free(e);
        }
        free_list(ND_out(n));
@@ -576,9 +570,7 @@ static void remove_aux_edges(graph_t * g)
                ND_next(nprev) = nnext;
            else
                GD_nlist(g) = nnext;
-#ifdef WITH_CGRAPH
            free(n->base.data);
-#endif
            free(n);
        } else
            nprev = n;
@@ -1168,11 +1160,7 @@ static void do_leaves(graph_t * g, node_t * leader)
        n = aghead(ND_out(leader).list[0]);
        j = ND_order(leader) + 1;
        for (e = agfstin(g, n); e; e = agnxtin(g, e)) {
-#ifndef WITH_CGRAPH
-           edge_t *e1 = e;
-#else
            edge_t *e1 = AGMKOUT(e);
-#endif
            if ((agtail(e1) != leader) && (UF_find(agtail(e1)) == leader)) {
                lbound = place_leaf(agtail(e1), lbound, j++);
                unmerge_oneway(e1);
index 07439cba8b7e78c5685c3d94fc296aca0bb10964..a284f789e2e0e426f2ce89e261049edcb0bbaf08 100644 (file)
@@ -29,9 +29,7 @@
 #include       "dot.h"
 
 static void dot1_rank(graph_t * g, aspect_t* asp);
-#ifdef WITH_CGRAPH
 static void dot2_rank(graph_t * g, aspect_t* asp);
-#endif
 
 static void 
 renewlist(elist * L)
@@ -66,16 +64,6 @@ cleanup1(graph_t * g)
             */
            if (f && (e == ED_to_orig(f))) {
                edge_t *e1, *f1;
-#ifndef WITH_CGRAPH
-               for (e1 = agfstout(g, n); e1; e1 = agnxtout(g, e1)) {
-                   if (e != e1) {
-                       f1 = ED_to_virt(e1);
-                       if (f1 && (f == f1)) {
-                           ED_to_virt(e1) = NULL;
-                       }
-                   }
-               }
-#else
                node_t *n1;
                for (n1 = agfstnode(g); n1; n1 = agnxtnode(g, n1)) {
                    for (e1 = agfstout(g, n1); e1; e1 = agnxtout(g, e1)) {
@@ -88,7 +76,6 @@ cleanup1(graph_t * g)
                    }
                }
                free(f->base.data);
-#endif
                free(f);
            }
            ED_to_virt(e) = NULL;
@@ -208,11 +195,7 @@ node_induce(graph_t * par, graph_t * g)
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(agroot(g), n); e; e = agnxtout(agroot(g), e)) {
            if (agcontains(g, aghead(e)))
-#ifndef WITH_CGRAPH
-               aginsert(g, e);
-#else /* WITH_CGRAPH */
                agsubedge(g,e,1);
-#endif /* WITH_CGRAPH */
        }
     }
 }
@@ -273,10 +256,6 @@ static void
 collapse_cluster(graph_t * g, graph_t * subg)
 {
     if (GD_parent(subg)) {
-#ifndef WITH_CGRAPH
-       agerr(AGWARN, "Cluster %s is multiply defined in %s and %s - this may cause problems.\n", subg->name,
-               g->name, GD_parent(subg)->name);
-#endif
        return;
     }
     GD_parent(subg) = g;
@@ -301,17 +280,7 @@ collapse_sets(graph_t *rg, graph_t *g)
     node_t *n;
 #endif
 
-#ifndef WITH_CGRAPH
-    graph_t *mg;
-    node_t *mn;
-    edge_t *me;
-    mg = g->meta_node->graph;
-    for (me = agfstout(mg, g->meta_node); me; me = agnxtout(mg, me)) {
-       mn = aghead(me);
-       subg = agusergraph(mn);
-#else /* WITH_CGRAPH */
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
-#endif /* WITH_CGRAPH */
        c = rank_set_class(subg);
        if (c) {
            if ((c == CLUSTER) && CL_type == LOCAL)
@@ -336,18 +305,7 @@ static void
 find_clusters(graph_t * g)
 {
     graph_t *subg;
-#ifndef WITH_CGRAPH
-    graph_t *mg;
-    node_t *mn;
-    edge_t *me;
-
-    mg = g->meta_node->graph;
-    for (me = agfstout(mg, g->meta_node); me; me = agnxtout(mg, me)) {
-       mn = me->head;
-       subg = agusergraph(mn);
-#else /* WITH_CGRAPH */
     for (subg = agfstsubg(agroot(g)); subg; subg = agnxtsubg(subg)) {
-#endif /* WITH_CGRAPH */
        if (GD_set_type(subg) == CLUSTER)
            collapse_cluster(g, subg);
     }
@@ -614,13 +572,11 @@ static void dot1_rank(graph_t * g, aspect_t* asp)
 
 void dot_rank(graph_t * g, aspect_t* asp)
 {
-#ifdef WITH_CGRAPH
     if (agget (g, "newrank")) {
        GD_flags(g) |= NEW_RANK;
        dot2_rank (g, asp);
     }
     else
-#endif
        dot1_rank (g, asp);
     if (Verbose)
        fprintf (stderr, "Maxrank = %d, minrank = %d\n", GD_maxrank(g), GD_minrank(g));
@@ -678,11 +634,7 @@ collapse_leaves(graph_t * g)
            continue;
        if (agfstout(g, n) == NULL) {
            if ((e = agfstin(g, n)) && (agnxtin(g, e) == NULL)) {
-#ifndef WITH_CGRAPH
-               potential_leaf(g, e, n);
-#else
                potential_leaf(g, AGMKOUT(e), n);
-#endif
                continue;
            }
        }
@@ -696,7 +648,6 @@ collapse_leaves(graph_t * g)
 }
 #endif
 
-#ifdef WITH_CGRAPH
 /* new ranking code:
  * Allows more constraints
  * Copy of level.c in dotgen2
@@ -1283,7 +1234,3 @@ void dot2_rank(graph_t * g, aspect_t* asp)
 #endif
     agclose(Xg);
 }
-
-#endif /* WITH_CGRAPH */
-/* end of new ranking code
- */
index 6b6d376d85c3b266fa33dc53309f7ed1df10bc01..f5ce02b0f5fdd543c4ae1eced780f44b357b55f0 100644 (file)
@@ -43,13 +43,8 @@ void dot_sameports(graph_t * g)
     int n_sametail;            /* number of same_t groups on current node */
     int i;
 
-#ifndef WITH_CGRAPH
-    E_samehead = agfindattr(g->proto->e, "samehead");
-    E_sametail = agfindattr(g->proto->e, "sametail");
-#else /* WITH_CGRAPH */
     E_samehead = agattr(g, AGEDGE, "samehead",(char*)0);
     E_sametail = agattr(g, AGEDGE, "sametail",(char*)0);
-#endif /* WITH_CGRAPH */
     if (!(E_samehead || E_sametail))
        return;
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
@@ -57,18 +52,10 @@ void dot_sameports(graph_t * g)
        for (e = agfstedge(g, n); e; e = agnxtedge(g, e, n)) {
            if (aghead(e) == agtail(e)) continue;  /* Don't support same* for loops */
            if (aghead(e) == n && E_samehead &&
-#ifndef WITH_CGRAPH
-               (id = agxget(e, E_samehead->index))[0])
-#else /* WITH_CGRAPH */
                (id = agxget(e, E_samehead))[0])
-#endif /* WITH_CGRAPH */
                n_samehead = sameedge(samehead, n_samehead, n, e, id);
            else if (agtail(e) == n && E_sametail &&
-#ifndef WITH_CGRAPH
-               (id = agxget(e, E_sametail->index))[0])
-#else /* WITH_CGRAPH */
                (id = agxget(e, E_sametail))[0])
-#endif /* WITH_CGRAPH */
                n_sametail = sameedge(sametail, n_sametail, n, e, id);
        }
        for (i = 0; i < n_samehead; i++) {
index b27dac2000c35d4814375908a1a7f6a9af57d626..d2e2fe3724563212242e2d0b2a66123407681b1e 100644 (file)
@@ -1,25 +1,17 @@
 # $Id$Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
        -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
         -I$(top_srcdir)/lib/gvc \
         -I$(top_srcdir)/lib/ortho \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt \
        -I$(top_srcdir)/lib/pathplan
 
-if WITH_CGRAPH
 noinst_HEADERS = dot2.h dot2procs.h groups.h minc.h
 noinst_LTLIBRARIES = libdotgen2_C.la
-endif
 
 libdotgen2_C_la_LDFLAGS = -no-undefined
 libdotgen2_C_la_SOURCES = dotinit.c level.c minc2.c ns.c groups.c minc_utils.c decomp.c
index bbdee0f09a8131ce8c21f87f813320e95180f2b3..b7d335a28489b4198b830c4fbf8dce93eec50432 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
@@ -15,7 +9,7 @@ AM_CPPFLAGS = \
         -I$(top_srcdir)/lib/pack \
         -I$(top_srcdir)/lib/pathplan \
         -I$(top_srcdir)/lib/sparse \
-        -I$(top_srcdir)/lib/$(GRAPH) \
+        -I$(top_srcdir)/lib/cgraph \
         -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = comp.h dbg.h fdp.h grid.h tlayout.h xlayout.h \
index fe904f152eab954ee589205335cf94708351d365..f16bcd7d67951bddf6f9b99578621cae263231ac 100644 (file)
@@ -36,11 +36,7 @@ static void dfs(Agraph_t * g, Agnode_t * n, Agraph_t * out, char *marks)
     Agnode_t *other;
 
     MARK(n) = 1;
-#ifndef WITH_CGRAPH
-    aginsert(out, n);
-#else /* WITH_CGRAPH */
     agsubnode(out,n,1);
-#endif /* WITH_CGRAPH */
     for (e = agfstedge(g, n); e; e = agnxtedge(g, e, n)) {
        if ((other = agtail(e)) == n)
            other = aghead(e);
@@ -71,11 +67,6 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned)
     bport_t *pp;
     graph_t **comps;
     graph_t **cp;
-#ifndef WITH_CGRAPH
-    graph_t *mg;
-    node_t *mn;
-    edge_t *me;
-#endif
     int pinflag = 0;
 
 /* fprintf (stderr, "comps of %s starting at %d \n", g->name, c_cnt); */
@@ -85,12 +76,8 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned)
     subg = 0;
     if ((pp = PORTS(g))) {
        sprintf(name, "cc%s_%d", agnameof(g), c_cnt++ + C_cnt);
-#ifndef WITH_CGRAPH
-       subg = agsubg(g, name);
-#else /* WITH_CGRAPH */
        subg = agsubg(g, name,1);
        agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
        GD_alg(subg) = (void *) NEW(gdata);
        PORTS(subg) = pp;
        NPORTS(subg) = NPORTS(g);
@@ -110,12 +97,8 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned)
            continue;
        if (!subg) {
            sprintf(name, "cc%s_%d", agnameof(g), c_cnt++ + C_cnt);
-#ifndef WITH_CGRAPH
-           subg = agsubg(g, name);
-#else /* WITH_CGRAPH */
            subg = agsubg(g, name,1);
                agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
            GD_alg(subg) = (void *) NEW(gdata);
        }
        pinflag = 1;
@@ -129,12 +112,8 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned)
        if (MARK(n))
            continue;
        sprintf(name, "cc%s+%d", agnameof(g), c_cnt++ + C_cnt);
-#ifndef WITH_CGRAPH
-       subg = agsubg(g, name);
-#else /* WITH_CGRAPH */
        subg = agsubg(g, name,1);
        agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);    //node custom data
-#endif /* WITH_CGRAPH */
        GD_alg(subg) = (void *) NEW(gdata);
        dfs(g, n, subg, marks);
        nodeInduce(subg);
@@ -148,15 +127,8 @@ graph_t **findCComp(graph_t * g, int *cnt, int *pinned)
        *pinned = pinflag;
     /* freed in layout */
     comps = cp = N_NEW(c_cnt + 1, graph_t *);
-#ifndef WITH_CGRAPH
-    mg = g->meta_node->graph;
-    for (me = agfstout(mg, g->meta_node); me; me = agnxtout(mg, me)) {
-       mn = me->head;
-       *cp++ = agusergraph(mn);
-#else /* WITH_CGRAPH */
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
        *cp++ = subg;
-#endif /* WITH_CGRAPH */
        c_cnt--;
     }
     assert(c_cnt == 0);
index 5ae2c226f90930308ab471fcb9f04352429def9e..b390fccc8b2b9c56922dc4603ccce50e79d0c727 100644 (file)
@@ -35,24 +35,12 @@ static void initialPositions(graph_t * g)
     char *p;
     char c;
 
-#ifndef WITH_CGRAPH
-    possym = agfindattr(g->proto->n, "pos");
-#else /* WITH_CGRAPH */
     possym = agattr(g,AGNODE, "pos", NULL);
-#endif /* WITH_CGRAPH */
     if (!possym)
        return;
-#ifndef WITH_CGRAPH
-    pinsym = agfindattr(g->proto->n, "pin");
-#else /* WITH_CGRAPH */
     pinsym = agattr(g,AGNODE, "pin", NULL);
-#endif /* WITH_CGRAPH */
     for (i = 0; (np = GD_neato_nlist(g)[i]); i++) {
-#ifndef WITH_CGRAPH
-       p = agxget(np, possym->index);
-#else /* WITH_CGRAPH */
        p = agxget(np, possym);
-#endif /* WITH_CGRAPH */
        if (p[0]) {
            pvec = ND_pos(np);
            c = '\0';
@@ -64,11 +52,7 @@ static void initialPositions(graph_t * g)
                }
                ND_pinned(np) = P_SET;
                if ((c == '!')
-#ifndef WITH_CGRAPH
-                   || (pinsym && mapbool(agxget(np, pinsym->index))))
-#else /* WITH_CGRAPH */
                    || (pinsym && mapbool(agxget(np, pinsym))))
-#endif /* WITH_CGRAPH */
                    ND_pinned(np) = P_PIN;
            } else
                fprintf(stderr,
@@ -82,23 +66,19 @@ static void initialPositions(graph_t * g)
  */
 static void init_edge(edge_t * e, attrsym_t * E_len)
 {
-#ifdef WITH_CGRAPH
     agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //node custom data
-#endif /* WITH_CGRAPH */
     ED_factor(e) = late_double(e, E_weight, 1.0, 0.0);
     ED_dist(e) = late_double(e, E_len, fdp_parms->K, 0.0);
 
     common_init_edge(e);
 }
 
-#ifdef WITH_CGRAPH
 static void init_node(node_t * n)
 {
     common_init_node(n);
     ND_pos(n) = N_NEW(GD_ndim(agraphof(n)), double);
     gv_nodesize(n, GD_flip(agraphof(n)));
 }
-#endif
 
 void fdp_init_node_edge(graph_t * g)
 {
@@ -109,9 +89,7 @@ void fdp_init_node_edge(graph_t * g)
     int i;
     /* ndata* alg; */
 
-#ifdef WITH_CGRAPH
     aginit(g, AGNODE, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
-#endif
     processClusterEdges(g);
 
     /* Get node count after processClusterEdges(), as this function may
@@ -122,21 +100,13 @@ void fdp_init_node_edge(graph_t * g)
     GD_neato_nlist(g) = N_NEW(nn + 1, node_t *);
 
     for (i = 0, n = agfstnode(g); n; n = agnxtnode(g, n)) {
-#ifdef WITH_CGRAPH
        init_node (n);
-#else
-       neato_init_node (n);
-#endif
        /* ND_alg(n) = alg + i; */
        GD_neato_nlist(g)[i] = n;
        ND_id(n) = i++;
     }
 
-#ifndef WITH_CGRAPH
-    E_len = agfindattr(g->proto->e, "len");
-#else /* WITH_CGRAPH */
     E_len = agattr(g,AGEDGE, "len", NULL);
-#endif /* WITH_CGRAPH */
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
            init_edge(e, E_len);
@@ -162,11 +132,7 @@ static void cleanup_subgs(graph_t * g)
     }
     free (GD_clust(g));
     if (g != agroot(g))
-#ifndef WITH_CGRAPH
-       memset(&(g->u), 0, sizeof(Agraphinfo_t));
-#else /* WITH_CGRAPH */
        agdelrec(g, "Agraphinfo_t");                            
-#endif /* WITH_CGRAPH */
 }
 
 static void fdp_cleanup_graph(graph_t * g)
index b9da8e5cc35c69bf6785ce90c8344fad099124b1..9cb03ba3489b828b3a225aa075610075dcc941e2 100644 (file)
@@ -192,12 +192,8 @@ static node_t *mkDeriveNode(graph_t * dg, char *name)
 {
     node_t *dn;
 
-#ifndef WITH_CGRAPH
-    dn = agnode(dg, name);
-#else /* WITH_CGRAPH */
     dn = agnode(dg, name,1);
     agbindrec(dn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
-#endif /* WITH_CGRAPH */
     ND_alg(dn) = (void *) NEW(dndata); /* free in freeDeriveNode */
     ND_pos(dn) = N_GNEW(GD_ndim(dg), double);
     /* fprintf (stderr, "Creating %s\n", dn->name); */
@@ -208,9 +204,7 @@ static void freeDeriveNode(node_t * n)
 {
     free(ND_alg(n));
     free(ND_pos(n));
-#ifdef WITH_CGRAPH
     agdelrec(n, "Agnodeinfo_t");
-#endif
 }
 
 static void freeGData(graph_t * g)
@@ -227,23 +221,17 @@ static void freeDerivedGraph(graph_t * g, graph_t ** cc)
 
     while ((cg = *cc++)) {
        freeGData(cg);
-#ifdef WITH_CGRAPH
        agdelrec(cg, "Agraphinfo_t");
-#endif
     }
     if (PORTS(g))
        free(PORTS(g));
     freeGData(g);
-#ifdef WITH_CGRAPH
     agdelrec(g, "Agraphinfo_t");
-#endif
     for (dn = agfstnode(g); dn; dn = dnxt) {
        dnxt = agnxtnode(g, dn);
        for (e = agfstout(g, dn); e; e = agnxtout(g, e)) {
            free (ED_to_virt(e));
-#ifdef WITH_CGRAPH
            agdelrec(e, "Agedgeinfo_t");
-#endif
        }
        freeDeriveNode(dn);
     }
@@ -370,20 +358,11 @@ static void chkPos(graph_t* g, node_t* n, layout_info* infop, boxf* bbp)
     graph_t *parent;
     attrsym_t *G_coord = infop->G_coord;
 
-#ifndef WITH_CGRAPH
-    p = agxget(g, G_coord->index);
-#else /* WITH_CGRAPH */
     p = agxget(g, G_coord);
-#endif /* WITH_CGRAPH */
     if (p[0]) {
        if (g != infop->rootg) {
-#ifndef WITH_CGRAPH
-           parent = agusergraph((agfstin(g->meta_node->graph, g->meta_node))->tail);
-           pp = agxget(parent, G_coord->index);
-#else /* WITH_CGRAPH */
            parent =agparent(g);
            pp = agxget(parent, G_coord);
-#endif /* WITH_CGRAPH */
            if ((pp == p) || !strcmp(p, pp))
                return;
        }
@@ -434,27 +413,13 @@ copyAttr (graph_t* g, graph_t* dg, char* attr)
     char*     ov_val;
     Agsym_t*  ov;
 
-#ifndef WITH_CGRAPH
-    if ((ov = agfindattr(g, attr))) {
-       ov_val = agxget(g,ov->index);
-       ov = agfindattr(dg, attr);
-#else /* WITH_CGRAPH */
     if ((ov = agattr(g,AGRAPH, attr, NULL))) {
        ov_val = agxget(g,ov);
        ov = agattr(dg,AGRAPH, attr, NULL);
-#endif /* WITH_CGRAPH */
        if (ov)
-#ifndef WITH_CGRAPH
-           agxset (dg, ov->index, ov_val);
-#else /* WITH_CGRAPH */
            agxset (dg, ov, ov_val);
-#endif /* WITH_CGRAPH */
        else
-#ifndef WITH_CGRAPH
-           agraphattr(dg, attr, ov_val);
-#else /* WITH_CGRAPH */
            agattr(dg, AGRAPH, attr, ov_val);
-#endif /* WITH_CGRAPH */
     }
 }
 
@@ -478,18 +443,10 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop)
 
     sprintf(name, "_dg_%d", infop->gid++);
     if (Verbose >= 2)
-#ifndef WITH_CGRAPH
-       fprintf(stderr, "derive graph %s of %s\n", name, g->name);
-#else /* WITH_CGRAPH */
        fprintf(stderr, "derive graph %s of %s\n", name, agnameof(g));
-#endif
 
-#ifndef WITH_CGRAPH
-    dg = agopen(name, AGRAPHSTRICT);
-#else /* WITH_CGRAPH */
     dg = agopen("derived", Agstrictdirected,NIL(Agdisc_t *));
     agbindrec(dg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
     GD_alg(dg) = (void *) NEW(gdata);  /* freed in freeDeriveGraph */
 #ifdef DEBUG
     GORIG(dg) = g;
@@ -575,18 +532,10 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop)
            if (hd == tl)
                continue;
            if (hd > tl)
-#ifndef WITH_CGRAPH
-               de = agedge(dg, tl, hd);
-#else /* WITH_CGRAPH */
                de = agedge(dg, tl, hd, NULL,1);
-#endif /* WITH_CGRAPH */
            else
-#ifndef WITH_CGRAPH
-               de = agedge(dg, hd, tl);
-#else /* WITH_CGRAPH */
                de = agedge(dg, hd, tl, NULL,1);
            agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
            ED_dist(de) = ED_dist(e);
            ED_factor(de) = ED_factor(e);
            /* fprintf (stderr, "edge %s -- %s\n", tl->name, hd->name); */
@@ -617,18 +566,10 @@ static graph_t *deriveGraph(graph_t * g, layout_info * infop)
                sz++;
                ND_id(dn) = id++;
                if (dn > m)
-#ifndef WITH_CGRAPH
-                   de = agedge(dg, m, dn);
-#else /* WITH_CGRAPH */
                    de = agedge(dg, m, dn, NULL,1);
-#endif /* WITH_CGRAPH */
                else
-#ifndef WITH_CGRAPH
-                   de = agedge(dg, dn, m);
-#else /* WITH_CGRAPH */
                    de = agedge(dg, dn, m, NULL,1);
                agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
                ED_dist(de) = ED_dist(pp->e);
                ED_factor(de) = ED_factor(pp->e);
                addEdge(de, pp->e);
@@ -1068,15 +1009,9 @@ static void setBB(graph_t * g)
  */
 void init_info(graph_t * g, layout_info * infop)
 {
-#ifndef WITH_CGRAPH
-    infop->G_coord = agfindattr(g, "coords");
-    infop->G_width = agfindattr(g, "width");
-    infop->G_height = agfindattr(g, "height");
-#else /* WITH_CGRAPH */
     infop->G_coord = agattr(g,AGRAPH, "coords", NULL);
     infop->G_width = agattr(g,AGRAPH, "width", NULL);
     infop->G_height = agattr(g, AGRAPH,"height", NULL);
-#endif /* WITH_CGRAPH */
     infop->rootg = g;
     infop->gid = 0;
     infop->pack.mode = getPackInfo(g, l_node, CL_OFFSET / 2, &(infop->pack));
@@ -1092,11 +1027,6 @@ void init_info(graph_t * g, layout_info * infop)
 static void
 mkClusters (graph_t * g, clist_t* pclist, graph_t* parent)
 {
-#ifndef WITH_CGRAPH
-    node_t*  mn;
-    edge_t*  me;
-    graph_t* mg;
-#endif /* WITH_CGRAPH */
     graph_t* subg;
     clist_t  list;
     clist_t* clist;
@@ -1107,19 +1037,11 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent)
     }
     else
        clist = pclist;
-#ifndef WITH_CGRAPH
-    mg = g->meta_node->graph;
-    for (me = agfstout(mg, g->meta_node); me; me = agnxtout(mg, me)) {
-       mn = me->head;
-       subg = agusergraph(mn);
-       if (!strncmp(subg->name, "cluster", 7)) {
-#else /* WITH_CGRAPH */
 
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg))
        {
        if (!strncmp(agnameof(subg), "cluster", 7)) {
            agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif /* WITH_CGRAPH */
            GD_alg(subg) = (void *) NEW(gdata); /* freed in cleanup_subgs */
            GD_ndim(subg) = GD_ndim(parent);
            LEVEL(subg) = LEVEL(parent) + 1;
@@ -1142,13 +1064,8 @@ void fdp_init_graph(Agraph_t * g)
 {
     setEdgeType (g, ET_LINE);
     GD_alg(g) = (void *) NEW(gdata);   /* freed in cleanup_graph */
-#ifndef WITH_CGRAPH
-    g->u.ndim = late_int(g, agfindattr(g, "dim"), 2, 2);
-    Ndim = g->u.ndim = MIN(g->u.ndim, MAXDIM);
-#else /* WITH_CGRAPH */
     GD_ndim(g) = late_int(g, agattr(g,AGRAPH, "dim", NULL), 2, 2);
     Ndim = GD_ndim(g) = MIN(GD_ndim(g), MAXDIM);
-#endif /* WITH_CGRAPH */
 
     mkClusters (g, NULL, g);
     fdp_initParams(g);
index c3da60f0692c2322268265902950de0b2f168780..ddda418cd9051243cd298a16c64d1daf3bc20bc6 100644 (file)
@@ -191,19 +191,10 @@ void fdp_initParams(graph_t * g)
     T_Cell = DFLT_Cell;
     T_C = D_C;
     T_Tfact = D_Tfact;
-#ifndef WITH_CGRAPH
-    T_maxIters = late_int(g, agfindattr(g, "maxiter"), DFLT_maxIters, 0);
-    D_K = T_K = late_double(g, agfindattr(g, "K"), DFLT_K, 0.0);
-#else /* WITH_CGRAPH */
     T_maxIters = late_int(g, agattr(g,AGRAPH, "maxiter", NULL), DFLT_maxIters, 0);
     D_K = T_K = late_double(g, agattr(g,AGRAPH, "K", NULL), DFLT_K, 0.0);
-#endif /* WITH_CGRAPH */
     if (D_T0 == -1.0) {
-#ifndef WITH_CGRAPH
-       T_T0 = late_double(g, agfindattr(g, "T0"), -1.0, 0.0);
-#else /* WITH_CGRAPH */
        T_T0 = late_double(g, agattr(g,AGRAPH, "T0", NULL), -1.0, 0.0);
-#endif /* WITH_CGRAPH */
     } else
        T_T0 = D_T0;
     T_seed = DFLT_seed;
index 958f9bcac47efe44f7e0e7789bcaeefdf727ee7f..4a6c3ce347ef39cb0409bcb9ccc2d1256a80dc63 100644 (file)
@@ -1,15 +1,9 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH 
-GRAPH = cgraph 
-else 
-GRAPH = graph 
-endif 
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
-        -I$(top_srcdir)/lib/$(GRAPH) \
+        -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt 
 
 noinst_HEADERS = ingraphs.h 
index 6c2f7b59ca7afa8bbe55917937210c990cb9d72c..87a60fdf1ddd74f7d29779a88e6b2c661fa2e1db 100644 (file)
@@ -1,16 +1,10 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
     -I$(top_srcdir) \
        -I$(top_srcdir)/lib/common \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
     -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = xlabels.h index.h node.h rectangle.h split.q.h
index f50c56e15887128f3ce0e796a281d6cea5fb81ce..c66aaef1cd9d68a1435079024fcffd918edf7e40 100644 (file)
 #include "logic.h"
 #include "arith.h"
 #include "rectangle.h"
-#ifdef WITH_CGRAPH
 #include <cgraph.h>
-#else
-typedef int Agraphinfo_t;
-typedef int Agnodeinfo_t;
-typedef int Agedgeinfo_t;
-#include <graph.h>
-#endif
 
 #define Undefined(x) ((x)->boundary[0] > (x)->boundary[NUMDIMS])
 
index 13a64631f916fcc91ebf056d3f692db26e391be5..0686a47f44282d523baf9e70cde20dc2d2aa6726 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
@@ -14,7 +8,7 @@ AM_CPPFLAGS = \
         -I$(top_srcdir)/lib/pack \
         -I$(top_srcdir)/lib/ortho \
         -I$(top_srcdir)/lib/pathplan \
-        -I$(top_srcdir)/lib/$(GRAPH) \
+        -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/sparse \
        -I$(top_srcdir)/lib/rbtree \
         -I$(top_srcdir)/lib/sfdpgen \
index eddff310a35ade11a6506fcd3f39b55c5be71073..e2d8894984d6b105a4e27e67c6eca48a050055c7 100644 (file)
@@ -744,20 +744,12 @@ SparseMatrix makeMatrix(Agraph_t* g, int dim, SparseMatrix *D)
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
            I[i] = row;
            J[i] = ND_id(aghead(e));
-#ifndef WITH_CGRAPH
-           if (!sym || (sscanf(agxget(e, sym->index), "%lf", &v) != 1))
-#else
            if (!sym || (sscanf(agxget(e, sym), "%lf", &v) != 1))
-#endif
                v = 1;
            val[i] = v;
        /* edge length */
            if (symD) {
-#ifndef WITH_CGRAPH
-               if (sscanf (agxget (e, symD->index), "%lf", &v) != 1) v = 1;
-#else
                if (sscanf (agxget (e, symD), "%lf", &v) != 1) v = 1;
-#endif
                valD[i] = v;
            }
            i++;
index ecb703cfd840c12012137edcf353574fe195066e..4ce2fc08c201d6eaed61e33c7777e93280c7517a 100644 (file)
@@ -140,12 +140,8 @@ static void mapGraphs(graph_t * g, graph_t * cg, distfn dist)
            hp = (nitem *) ND_alg(aghead(e));
            delta = dist(&tp->bb, &hp->bb);
            h = hp->cnode;
-#ifndef WITH_CGRAPH
-           ce = agedge(cg, t, h);
-#else
            ce = agedge(cg, t, h, NULL, 1);
            agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
-#endif
            ED_weight(ce) = 1;
            if (ED_minlen(ce) < delta) {
                if (ED_minlen(ce) == 0.0) {
@@ -230,21 +226,13 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list,
     node_t *n;
     edge_t *e;
     node_t *lastn = NULL;
-#ifndef WITH_CGRAPH
-    graph_t *cg = agopen("cg", AGDIGRAPHSTRICT);
-#else
     graph_t *cg = agopen("cg", Agstrictdirected, NIL(Agdisc_t *));
     agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);  // graph custom data
-#endif
 
     for (p = (nitem *) dtflatten(list); p;
         p = (nitem *) dtlink(list, (Dtlink_t *) p)) {
-#ifndef WITH_CGRAPH
-       n = agnode(cg, agnameof(p->np));        /* FIX */
-#else
        n = agnode(cg, agnameof(p->np), 1);      /* FIX */
        agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
-#endif
        ND_alg(n) = p;
        p->cnode = n;
        alloc_elist(0, ND_in(n));
@@ -263,12 +251,8 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list,
            e = NULL;
            if (intersect(p, nxp)) {
                double delta = dist(&p->bb, &nxp->bb);
-#ifndef WITH_CGRAPH
-               e = agedge(cg, p->cnode, nxp->cnode);
-#else
                e = agedge(cg, p->cnode, nxp->cnode, NULL, 1);
                agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);   // edge custom data
-#endif
                assert (delta <= 0xFFFF);
                ED_minlen(e) = delta;
                ED_weight(e) = 1;
@@ -327,12 +311,8 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list,
     double root_val;
 #endif
     node_t *lastn = NULL;
-#ifndef WITH_CGRAPH
-    graph_t *cg = agopen("cg", AGDIGRAPHSTRICT);
-#else
     graph_t *cg = agopen("cg", Agstrictdirected, NIL(Agdisc_t *));
     agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);  // graph custom data
-#endif
 
     /* count distinct nodes */
     cnt = 0;
@@ -352,12 +332,8 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list,
        if (oldval != p->val) {
            oldval = p->val;
            /* n = newNode (cg); */
-#ifndef WITH_CGRAPH
-           n = agnode(cg, agnameof(p->np));    /* FIX */
-#else
            n = agnode(cg, agnameof(p->np), 1); /* FIX */
            agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
-#endif
            ND_alg(n) = p;
            if (root) {
                ND_next(lastn) = n;
@@ -375,12 +351,8 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list,
                    alloc_elist(2 * (cnt - 1), ND_out(prev));
                else
                    alloc_elist(cnt - lcnt - 1, ND_out(prev));
-#ifndef WITH_CGRAPH
-               e = agedge(cg, prev, n);
-#else
                e = agedge(cg, prev, n, NULL, 1);
                agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);   // edge custom data
-#endif
                ED_minlen(e) = SCALE;
                ED_weight(e) = 1;
                elist_append(e, ND_out(prev));
@@ -398,19 +370,11 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list,
      * Remaining outedges are immediate right neighbors.
      * FIX: Incremental algorithm to construct trans. reduction?
      */
-#ifndef WITH_CGRAPH
-    vg = agopen("vg", AGDIGRAPHSTRICT);
-#else
     vg = agopen("vg", Agstrictdirected, NIL(Agdisc_t *));
-#endif
     for (p = (nitem *) dtflatten(list); p;
         p = (nitem *) dtlink(list, (Dtlink_t *) p)) {
-#ifndef WITH_CGRAPH
-       n = agnode(vg, agnameof(p->np));     /* FIX */
-#else
        n = agnode(vg, agnameof(p->np), 1);  /* FIX */
        agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);  //node custom data
-#endif
        p->vnode = n;
        ND_alg(n) = p;
     }
@@ -430,11 +394,7 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list,
        for (nxp = nxt; nxp;
             nxp = (nitem *) dtlink(list, (Dtlink_t *) nxp)) {
            if (intersect(p, nxp))
-#ifndef WITH_CGRAPH
-               agedge(vg, p->vnode, nxp->vnode);
-#else
                agedge(vg, p->vnode, nxp->vnode, NULL, 1);
-#endif
        }
     }
 
@@ -465,28 +425,16 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list,
        alloc_elist(1, ND_in(an));
        alloc_elist(1, ND_out(an));
 
-#ifndef WITH_CGRAPH
-       e = agedge(cg, root, an);
-#else
        e = agedge(cg, root, an, 1);
-#endif
        ED_minlen(e) = p->val - root_val;
        elist_append(e, ND_out(root));
        elist_append(e, ND_in(an));
 
-#ifndef WITH_CGRAPH
-       e = agedge(cg, an, vn);
-#else
        e = agedge(cg, an, vn, 1);
-#endif
        elist_append(e, ND_out(an));
        elist_append(e, ND_in(vn));
 
-#ifndef WITH_CGRAPH
-       e = agedge(cg, n, vn);
-#else
        e = agedge(cg, n, vn, 1);
-#endif
        elist_append(e, ND_out(n));
        elist_append(e, ND_in(vn));
     }
@@ -568,30 +516,17 @@ static void constrainY(graph_t* g, nitem* nlist, int nnodes, intersectfn ifn,
     rank(cg, 2, INT_MAX);
 #ifdef DEBUG
     {
-#ifndef WITH_CGRAPH
-       Agsym_t *mlsym = agedgeattr(cg, "minlen", "");
-       Agsym_t *rksym = agnodeattr(cg, "rank", "");
-#else
        Agsym_t *mlsym = agattr(cg, AGEDGE, "minlen", "");
        Agsym_t *rksym = agattr(cg, AGNODE, "rank", "");
-#endif
        char buf[100];
        node_t *n;
        edge_t *e;
        for (n = agfstnode(cg); n; n = agnxtnode(cg, n)) {
            sprintf(buf, "%d", ND_rank(n));
-#ifndef WITH_CGRAPH
-           agxset(n, rksym->index, buf);
-#else
            agxset(n, rksym, buf);
-#endif
            for (e = agfstedge(cg, n); e; e = agnxtedge(cg, e, n)) {
                sprintf(buf, "%d", ED_minlen(e));
-#ifndef WITH_CGRAPH
-               agxset(e, mlsym->index, buf);
-#else
                agxset(e, mlsym, buf);
-#endif
            }
        }
     }
index ff753fdb5d7cb15e1f6183996e4080746062910a..fbff4e21bef36592f072a079fa883f0c33eca99c 100644 (file)
@@ -43,9 +43,7 @@ static char *cc_pfx = "_neato_cc";
 
 void neato_init_node(node_t * n)
 {
-#ifdef WITH_CGRAPH
     agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);  //node custom data
-#endif /* WITH_CGRAPH */
     common_init_node(n);
     ND_pos(n) = N_NEW(GD_ndim(agraphof(n)), double);
     gv_nodesize(n, GD_flip(agraphof(n)));
@@ -53,13 +51,8 @@ void neato_init_node(node_t * n)
 
 static void neato_init_edge(edge_t * e)
 {
-#ifdef WITH_CGRAPH
-       agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);       //node custom data
-#endif /* WITH_CGRAPH */
+    agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //node custom data
     common_init_edge(e);
-#ifndef WITH_CGRAPH
-
-#endif /* WITH_CGRAPH */
     ED_factor(e) = late_double(e, E_weight, 1.0, 1.0);
 }
 
@@ -72,11 +65,7 @@ int user_pos(attrsym_t * posptr, attrsym_t * pinptr, node_t * np, int nG)
     if (posptr == NULL)
        return FALSE;
     pvec = ND_pos(np);
-#ifndef WITH_CGRAPH
-    p = agxget(np, posptr->index);
-#else
     p = agxget(np, posptr);
-#endif
     if (p[0]) {
        c = '\0';
        if ((Ndim >= 3) && 
@@ -89,11 +78,7 @@ int user_pos(attrsym_t * posptr, attrsym_t * pinptr, node_t * np, int nG)
            }
            if (Ndim > 3)
                jitter_d(np, nG, 3);
-#ifndef WITH_CGRAPH
-           if ((c == '!') || (pinptr && mapbool(agxget(np, pinptr->index))))
-#else
            if ((c == '!') || (pinptr && mapbool(agxget(np, pinptr))))
-#endif
                ND_pinned(np) = P_PIN;
            return TRUE;
        }
@@ -105,11 +90,7 @@ int user_pos(attrsym_t * posptr, attrsym_t * pinptr, node_t * np, int nG)
                    pvec[i] = pvec[i] / PSinputscale;
            }
            if (Ndim > 2) {
-#ifndef WITH_CGRAPH
-               if (N_z && (p = agxget(np, N_z->index)) && (sscanf(p,"%lf",&z) == 1)) { 
-#else
                if (N_z && (p = agxget(np, N_z)) && (sscanf(p,"%lf",&z) == 1)) { 
-#endif
                    if (PSinputscale > 0.0) {
                        pvec[2] = z / PSinputscale;
                    }
@@ -120,11 +101,7 @@ int user_pos(attrsym_t * posptr, attrsym_t * pinptr, node_t * np, int nG)
                else
                    jitter3d(np, nG);
            }
-#ifndef WITH_CGRAPH
-           if ((c == '!') || (pinptr && mapbool(agxget(np, pinptr->index))))
-#else
            if ((c == '!') || (pinptr && mapbool(agxget(np, pinptr))))
-#endif
                ND_pinned(np) = P_PIN;
            return TRUE;
        } else
@@ -159,11 +136,7 @@ static void neato_cleanup_graph(graph_t * g)
     if (Nop || (Pack < 0))
        free_scan_graph(g);
     if (g != agroot(g))
-#ifndef WITH_CGRAPH
-        memset(&(g->u), 0, sizeof(Agraphinfo_t));
-#else /* WITH_CGRAPH */
         agclean(g, AGRAPH , "Agraphinfo_t");
-#endif /* WITH_CGRAPH */
 }
 
 void neato_cleanup(graph_t * g)
@@ -211,12 +184,6 @@ static void set_label(void* obj, textlabel_t * l, char *name)
 #ifdef IPSEPCOLA
 static cluster_data* cluster_map(graph_t *mastergraph, graph_t *g)
 {
-#ifndef WITH_CGRAPH
-    /* search meta-graph to find clusters */
-    graph_t *mg;
-    node_t *mm, *mn;
-    edge_t *me;
-#endif
     graph_t *subg;
     node_t *n;
      /* array of arrays of node indices in each cluster */
@@ -226,15 +193,7 @@ static cluster_data* cluster_map(graph_t *mastergraph, graph_t *g)
     cluster_data *cdata = GNEW(cluster_data);
 
     cdata->ntoplevel = agnnodes(g);
-#ifndef WITH_CGRAPH
-    mm = mastergraph->meta_node;
-    mg = agraphof(mm); 
-    for (me = agfstout(mg, mm); me; me = agnxtout(mg, me)) {
-        mn = aghead(me);
-        subg = agusergraph(mn);
-#else
     for (subg = agfstsubg(mastergraph); subg; subg = agnxtsubg(subg)) {
-#endif
         if (!strncmp(agnameof(subg), "cluster", 7)) {
             nclusters++;
         }
@@ -243,14 +202,7 @@ static cluster_data* cluster_map(graph_t *mastergraph, graph_t *g)
     cdata->nclusters = nclusters;
     cs = cdata->clusters = N_GNEW(nclusters,int*);
     cn = cdata->clustersizes = N_GNEW(nclusters,int);
-#ifndef WITH_CGRAPH
-    /* fprintf(stderr,"search %d clusters...\n",nclusters); */
-    for (me = agfstout(mg, mm); me; me = agnxtout(mg, me)) {
-        mn = me->head;
-        subg = agusergraph(mn);
-#else
     for (subg = agfstsubg(mastergraph); subg; subg = agnxtsubg(subg)) {
-#endif
         /* clusters are processed by separate calls to ordered_edges */
         if (!strncmp(agnameof(subg), "cluster", 7)) {
             int *c;
@@ -316,11 +268,7 @@ static int user_spline(attrsym_t * E_pos, edge_t * e)
     int stype, etype;
     static boolean warned;
 
-#ifndef WITH_CGRAPH
-    pos = agxget(e, E_pos->index);
-#else
     pos = agxget(e, E_pos);
-#endif
     if (*pos == '\0')
        return 0;
 
@@ -350,11 +298,7 @@ static int user_spline(attrsym_t * E_pos, edge_t * e)
            gv_free_splines(e);
            if (!warned) {
                warned = 1;
-#ifndef WITH_CGRAPH
-               agerr(AGWARN, "pos attribute for edge (%s,%s) doesn't have 3n+1 points\n", e->tail->name, e->head->name);
-#else
                agerr(AGWARN, "pos attribute for edge (%s,%s) doesn't have 3n+1 points\n", agnameof(agtail(e)), agnameof(aghead(e)));
-#endif
            }
            return 0;
        }
@@ -365,11 +309,7 @@ static int user_spline(attrsym_t * E_pos, edge_t * e)
            if (i < 2) {
                if (!warned) {
                    warned = 1;
-#ifndef WITH_CGRAPH
-                   agerr(AGWARN, "syntax error in pos attribute for edge (%s,%s)\n", e->tail->name, e->head->name);
-#else
                    agerr(AGWARN, "syntax error in pos attribute for edge (%s,%s)\n", agnameof(agtail(e)), agnameof(aghead(e)));
-#endif
                }
                free(ps);
                gv_free_splines(e);
@@ -471,11 +411,7 @@ static int chkBB(Agraph_t * g, attrsym_t * G_bb, boxf* bbp)
     char *s;
     boxf bb;
 
-#ifndef WITH_CGRAPH
-    s = agxget(g, G_bb->index);
-#else
     s = agxget(g, G_bb);
-#endif
     if (sscanf(s, BS, &bb.LL.x, &bb.LL.y, &bb.UR.x, &bb.UR.y) == 4) {
        if (bb.LL.y > bb.UR.y) {
        /* If the LL.y coordinate is bigger than the UR.y coordinate,
@@ -512,35 +448,19 @@ static void nop_init_graphs(Agraph_t *, attrsym_t *, attrsym_t *);
  * of subg, using parentg as the parent graph.
  */
 static void
-#ifndef WITH_CGRAPH
-dfs(node_t * mn, Agraph_t * parentg, attrsym_t * G_lp, attrsym_t * G_bb)
-#else /* WITH_CGRAPH */
 dfs(Agraph_t * subg, Agraph_t * parentg, attrsym_t * G_lp, attrsym_t * G_bb)
-#endif /* WITH_CGRAPH */
 {
     boxf bb;
 
-#ifndef WITH_CGRAPH
-    graph_t *subg = agusergraph(mn);
-#endif
     if (!strncmp(agnameof(subg), "cluster", 7) && chkBB(subg, G_bb, &bb)) {
-#ifdef WITH_CGRAPH
        agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif
        GD_bb(subg) = bb;
        add_cluster(parentg, subg);
        nop_init_graphs(subg, G_lp, G_bb);
     } else {
-#ifndef WITH_CGRAPH
-       graph_t *mg = parentg->meta_node->graph;
-       edge_t *me;
-       for (me = agfstout(mg, mn); me; me = agnxtout(mg, me)) {
-           dfs(me->head, parentg, G_lp, G_bb);
-#else
        graph_t *sg;
        for (sg = agfstsubg(subg); sg; sg = agnxtsubg(sg)) {
            dfs(sg, parentg, G_lp, G_bb);
-#endif
        }
     }
 }
@@ -553,21 +473,12 @@ dfs(Agraph_t * subg, Agraph_t * parentg, attrsym_t * G_lp, attrsym_t * G_bb)
 static void
 nop_init_graphs(Agraph_t * g, attrsym_t * G_lp, attrsym_t * G_bb)
 {
-#ifndef WITH_CGRAPH
-    graph_t *mg;
-    edge_t *me;
-#else
     graph_t *subg;
-#endif
     char *s;
     double x, y;
 
     if (GD_label(g) && G_lp) {
-#ifndef WITH_CGRAPH
-       s = agxget(g, G_lp->index);
-#else
        s = agxget(g, G_lp);
-#endif
        if (sscanf(s, "%lf,%lf", &x, &y) == 2) {
            GD_label(g)->pos = pointfof(x, y);
            GD_label(g)->set = TRUE;
@@ -576,14 +487,8 @@ nop_init_graphs(Agraph_t * g, attrsym_t * G_lp, attrsym_t * G_bb)
 
     if (!G_bb)
        return;
-#ifndef WITH_CGRAPH
-    mg = g->meta_node->graph;
-    for (me = agfstout(mg, g->meta_node); me; me = agnxtout(mg, me)) {
-       dfs(me->head, g, G_lp, G_bb);
-#else /* WITH_CGRAPH */
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
        dfs(subg, g, G_lp, G_bb);
-#endif /* WITH_CGRAPH */
     }
 }
 
@@ -708,11 +613,7 @@ int init_nop(Agraph_t * g, int adjust)
 
     /* If G_bb not defined, define it */
     if (!G_bb)
-#ifndef WITH_CGRAPH
-       G_bb = agraphattr(g, "bb", "");
-#else /* WITH_CGRAPH */
        G_bb = agattr(g, AGRAPH, "bb", "");
-#endif /* WITH_CGRAPH */
 
     scan_graph(g);             /* mainly to set up GD_neato_nlist */
     for (i = 0; (np = GD_neato_nlist(g)[i]); i++) {
@@ -807,11 +708,7 @@ static int neatoModel(graph_t * g)
            return MODEL_SHORTPATH;
     }
     if ((c == 'm') && streq(p, "mds")) {
-#ifndef WITH_CGRAPH
-       if (agindex(g->root->proto->e, "len") >= 0)
-#else /* WITH_CGRAPH */
        if (agattr(g, AGEDGE, "len", 0))
-#endif /* WITH_CGRAPH */
            return MODEL_MDS;
        else {
            agerr(AGWARN,
@@ -959,11 +856,7 @@ static vtx_data *makeGraphData(graph_t * g, int nv, int *nedges, int mode, int m
 #ifdef DIGCOLA
     float *edists = NULL;
 #endif
-#ifndef WITH_CGRAPH
-    int haveLen;
-#else
     attrsym_t *haveLen;
-#endif
     int haveWt;
     int haveDir;
     PointMap *ps = newPM();
@@ -974,11 +867,7 @@ static vtx_data *makeGraphData(graph_t * g, int nv, int *nedges, int mode, int m
        haveLen = FALSE;
        haveWt = FALSE;
     } else {
-#ifndef WITH_CGRAPH
-       haveLen = (agindex(g->root->proto->e, "len") >= 0);
-#else /* WITH_CGRAPH */
        haveLen = agattr(g, AGEDGE, "len", 0) ;
-#endif /* WITH_CGRAPH */
        haveWt = (E_weight != 0);
     }
     if (mode == MODE_HIER || mode == MODE_IPSEP)
@@ -1337,11 +1226,8 @@ majorization(graph_t *mg, graph_t * g, int nv, int mode, int model, int dim, int
                model, (init == INIT_SELF), opts & opt_exp_flag, MaxIter, Epsilon);
        fprintf(stderr, "convert graph: ");
        start_timer();
-#ifdef WITH_CGRAPH
         fprintf(stderr, "majorization\n");
-//     fprintf(stderr, "%i\n", count_nodes(g));
-
-#endif /* WITH_CGRAPH */
+//     fprintf(stderr, "%i\n", count_nodes(g));
     }
     gp = makeGraphData(g, nv, &ne, mode, model, &nodes);
 
@@ -1560,11 +1446,7 @@ static void addZ (Agraph_t* g)
     if ((Ndim >= 3) && N_z) { 
        for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
            sprintf(buf, "%lf", POINTS_PER_INCH * (ND_pos(n)[2]));
-#ifndef WITH_CGRAPH
-           agxset(n, N_z->index, buf);
-#else /* WITH_CGRAPH */
            agxset(n, N_z, buf);
-#endif /* WITH_CGRAPH */
        }
     }
 }
@@ -1574,22 +1456,9 @@ static void
 addCluster (graph_t* g)
 {
     graph_t *subg;
-#ifndef WITH_CGRAPH
-    graph_t *mg;
-    node_t *mm, *mn;
-    edge_t *me;
-    mm = g->meta_node;
-    mg = agraphof(mm);
-    for (me = agfstout(mg, mm); me; me = agnxtout(mg, me)) {
-       mn = aghead(me);
-       subg = agusergraph(mn);
-#else
     for (subg = agfstsubg(agroot(g)); subg; subg = agnxtsubg(subg)) {
-#endif
        if (!strncmp(agnameof(subg), "cluster", 7)) {
-#ifdef WITH_CGRAPH
            agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif
            add_cluster(g, subg);
            compute_bb(subg);
        }
@@ -1680,9 +1549,7 @@ void neato_layout(Agraph_t * g)
            for (i = 0; i < n_cc; i++) {
                gc = cc[i];
                free_scan_graph(gc);
-#ifdef WITH_CGRAPH
                agdelrec (gc, "Agraphinfo_t"); 
-#endif
                agdelete(g, gc);
            }
            free (cc);
index 7277da4965219b12257031a50f9f22b7188c4c6f..b5b5a95f94078e3ad2ede4c0f2a80dc71b5577cb 100644 (file)
@@ -109,19 +109,11 @@ static void free_3array(double ***rv)
  * Return 1 if attribute not defined
  * Return 2 if attribute string bad
  */
-#ifdef WITH_CGRAPH
 static int lenattr(edge_t* e, Agsym_t* index, double* val)
-#else
-static int lenattr(edge_t* e, int index, double* val)
-#endif
 {
     char* s;
 
-#ifdef WITH_CGRAPH
     if (index == NULL)
-#else
-    if (index < 0)
-#endif
        return 1;
 
     s = agxget(e, index);
@@ -201,11 +193,7 @@ static node_t *prune(graph_t * G, node_t * np, node_t * next)
     return next;
 }
 
-#ifdef WITH_CGRAPH
 static double setEdgeLen(graph_t * G, node_t * np, Agsym_t* lenx, double dfltlen)
-#else
-static double setEdgeLen(graph_t * G, node_t * np, int lenx, double dfltlen)
-#endif
 {
     edge_t *ep;
     double total_len = 0.0;
@@ -236,11 +224,7 @@ int scan_graph_mode(graph_t * G, int mode)
     node_t *np, *xp, *other;
     double total_len = 0.0;
     double dfltlen = 1.0;
-#ifdef WITH_CGRAPH
     Agsym_t* lenx;
-#else
-    int lenx;
-#endif /* WITH_CGRAPH */
 
     if (Verbose)
        fprintf(stderr, "Scanning graph %s, %d nodes\n", agnameof(G),
@@ -264,11 +248,7 @@ int scan_graph_mode(graph_t * G, int mode)
     nV = agnnodes(G);
     nE = agnedges(G);
 
-#ifdef WITH_CGRAPH
     lenx = agattr(G, AGEDGE, "len", 0);
-#else
-    lenx = agindex(G->root->proto->e, "len");
-#endif
     if (mode == MODE_KK) {
        Epsilon = .0001 * nV;
        getdouble(G, "epsilon", &Epsilon);
index dc5a52e46bcf01afbc7afef9a4664508f5189e14..9c837904c80edba36ff954c27eec6c6a82840b31 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$Revision: 
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
@@ -14,7 +8,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/neatogen \
        -I$(top_srcdir)/lib/pack \
        -I$(top_srcdir)/lib/pathplan \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt
 
 if WITH_ORTHO
index b0a3d13ddc009ccb437c1c7d1d369ad1e1a3f6f1..3df5ebb1fa35437c2e09dcca1417b00dffc5f600 100644 (file)
 #define STRUCTURES_H
 
 #include "types.h"
-#ifdef WITH_CGRAPH
 #include "cgraph.h"
-#else
-#include "graph.h"
-#endif
 #include "rawgraph.h"
 
 typedef struct {
index 6c89904334c858605d3865d6417fe8a2c5f6b614..7fd5c3fc06b45a2d0cc208e6a064ec4fbab48290 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
@@ -16,7 +10,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/pack \
        -I$(top_srcdir)/lib/pathplan \
        -I$(top_srcdir)/lib/sparse \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = osage.h
index de4d6ecd4c24fefc7887669848715bff343cf932..9b770a9be25a49d4f3b15e531aa7b6ff3b5511b1 100644 (file)
@@ -73,9 +73,7 @@ static void cluster_init_graph(graph_t * g)
     }
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
-#ifdef WITH_CGRAPH
            agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);   //edge custom data
-#endif /* WITH_CGRAPH */
            common_init_edge(e);
        }
     }
@@ -128,13 +126,8 @@ layout (Agraph_t* g, int depth)
 
         /* add user sort values if necessary */
     if ((pinfo.mode == l_array) && (pinfo.flags & PK_USER_VALS)) {
-#ifdef WITH_CGRAPH
        cattr = agattr(root, AGRAPH, "sortv", 0);
        vattr = agattr(root, AGNODE, "sortv", 0);
-#else
-       cattr = agfindattr(root, "sortv");
-       vattr = agfindattr(root->proto->n, "sortv");
-#endif
        if (cattr || vattr)
            pinfo.vals = N_NEW(total, unsigned char);
        else
@@ -329,11 +322,6 @@ reposition (Agraph_t* g, int depth)
 static void
 mkClusters (Agraph_t* g, clist_t* pclist, Agraph_t* parent)
 {
-#ifndef WITH_CGRAPH
-    node_t*  mn;
-    edge_t*  me;
-    graph_t* mg;
-#endif
     graph_t* subg;
     clist_t  list;
     clist_t* clist;
@@ -345,7 +333,6 @@ mkClusters (Agraph_t* g, clist_t* pclist, Agraph_t* parent)
     else
         clist = pclist;
 
-#ifdef WITH_CGRAPH
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
         if (!strncmp(agnameof(subg), "cluster", 7)) {
            agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
@@ -357,21 +344,6 @@ mkClusters (Agraph_t* g, clist_t* pclist, Agraph_t* parent)
             mkClusters(subg, clist, parent);
         }
     }
-#else
-    mg = g->meta_node->graph;
-    for (me = agfstout(mg, g->meta_node); me; me = agnxtout(mg, me)) {
-        mn = me->head;
-        subg = agusergraph(mn);
-        if (!strncmp(agnameof(subg), "cluster", 7)) {
-           do_graph_label (subg);
-            addCluster(clist, subg);
-            mkClusters(subg, NULL, subg);
-        }
-        else {
-            mkClusters(subg, clist, parent);
-        }
-    }
-#endif
     if (pclist == NULL) {
         GD_n_cluster(g) = list.cnt;
         if (list.cnt)
index d4bbf54dcab2b56999447d51337b3941b7e896dd..8caa7cc6cf7299c62a69fed93991a70921c432cc 100644 (file)
@@ -4,18 +4,12 @@
 pdfdir = $(pkgdatadir)/doc/pdf
 #pkgconfigdir = $(libdir)/pkgconfig
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
        -I$(top_srcdir)/lib/gvc \
        -I$(top_srcdir)/lib/neatogen \
        -I$(top_srcdir)/lib/pathplan \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt
 
 if WITH_WIN32
index 6ee56e99efb882fe10fdfa14568cf806dfed7773..979d0b8b0fa8e95e2889d0e779179aba6c3b6d33 100644 (file)
@@ -158,11 +158,7 @@ static int isLegal(char *p)
  */
 static void insertFn(Agnode_t * n, void *state)
 {
-#ifndef WITH_CGRAPH
-    aginsert((Agraph_t *) state, n);
-#else /* WITH_CGRAPH */
     agsubnode((Agraph_t *) state,n,1);
-#endif /* WITH_CGRAPH */
 }
 
 /* pccomps:
@@ -223,12 +219,8 @@ Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, boolean * pinned)
            continue;
        if (!out) {
            sprintf(name + len, "%d", c_cnt);
-#ifndef WITH_CGRAPH
-           out = agsubg(g, name);
-#else /* WITH_CGRAPH */
            out = agsubg(g, name,1);
            agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
-#endif /* WITH_CGRAPH */
            ccs[c_cnt] = out;
            c_cnt++;
            pin = TRUE;
@@ -241,12 +233,8 @@ Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, boolean * pinned)
        if (MARKED(n))
            continue;
        sprintf(name + len, "%d", c_cnt);
-#ifndef WITH_CGRAPH
-       out = agsubg(g, name);
-#else /* WITH_CGRAPH */
        out = agsubg(g, name,1);
        agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);     //node custom data
-#endif /* WITH_CGRAPH */
        dfs(g, n, insertFn, out, &stk);
        if (c_cnt == bnd) {
            bnd *= 2;
@@ -331,12 +319,8 @@ Agraph_t **ccomps(Agraph_t * g, int *ncc, char *pfx)
        if (MARKED(n))
            continue;
        sprintf(name + len, "%d", c_cnt);
-#ifndef WITH_CGRAPH
-       out = agsubg(g, name);
-#else /* WITH_CGRAPH */
        out = agsubg(g, name,1);
        agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);     //node custom data
-#endif /* WITH_CGRAPH */
        dfs(g, n, insertFn, out, &stk);
        if (c_cnt == bnd) {
            bnd *= 2;
@@ -409,11 +393,7 @@ int nodeInduce(Agraph_t * g)
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        for (e = agfstout(root, n); e; e = agnxtout(root, e)) {
            if (agcontains(g, aghead(e))) {     /* test will always be true */
-#ifndef WITH_CGRAPH
-               aginsert(g, e); /* for connected component  */
-#else /* WITH_CGRAPH */
                agsubedge(g,e,1);
-#endif /* WITH_CGRAPH */
                e_cnt++;
            }
        }
index b936eda673743c814a5e2ae2647187dd6cd9db4e..717f30b5878ada5f24732074f71b5c9fd2e9c621 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
@@ -16,7 +10,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/pack \
        -I$(top_srcdir)/lib/pathplan \
        -I$(top_srcdir)/lib/sparse \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = patchwork.h tree_map.h
index 67888838ae9d764d7d54078e395d5018adc2ad0a..9de4b2901324da5fbd8ce38948edf07b47e01a7f 100644 (file)
@@ -208,18 +208,10 @@ static void finishNode(node_t * n)
 {
     char buf [40];
     if (N_fontsize) {
-#ifndef WITH_CGRAPH
-       char* str = agxget(n, N_fontsize->index);
-#else
        char* str = agxget(n, N_fontsize);
-#endif
        if (*str == '\0') {
            sprintf (buf, "%.03f", ND_ht(n)*0.7); 
-#ifndef WITH_CGRAPH
-           agxset(n, N_fontsize->index, buf);
-#else /* WITH_CGRAPH */
            agxset(n, N_fontsize, buf);
-#endif /* WITH_CGRAPH */
        }
     }
     common_init_node (n);
index 4191c259a1fe2b48fff6b242baffada3fa95e85f..3e49161f3911bffdeb67716b17f5a88f3a3fc778 100644 (file)
@@ -63,11 +63,6 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent)
     graph_t* subg;
     clist_t  list;
     clist_t* clist;
-#ifndef WITH_CGRAPH
-    node_t*  mn;
-    edge_t*  me;
-    graph_t* mg;
-#endif
 
     if (pclist == NULL) {
         clist = &list;
@@ -76,18 +71,9 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent)
     else
         clist = pclist;
 
-#ifndef WITH_CGRAPH
-    mg = g->meta_node->graph;
-    for (me = agfstout(mg, g->meta_node); me; me = agnxtout(mg, me)) {
-        mn = aghead(me);
-        subg = agusergraph(mn);
-#else /* WITH_CGRAPH */
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
-#endif /* WITH_CGRAPH */
         if (!strncmp(agnameof(subg), "cluster", 7)) {
-#ifdef WITH_CGRAPH
            agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
-#endif
 #ifdef FDP_GEN
             GD_alg(subg) = (void *) NEW(gdata); /* freed in cleanup_subgs */
             GD_ndim(subg) = GD_ndim(parent);
@@ -129,9 +115,7 @@ static void patchwork_init_node_edge(graph_t * g)
 
     GD_neato_nlist(g) = N_NEW(agnnodes(g) + 1, node_t *);
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-#ifdef WITH_CGRAPH
        agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);  // node custom data
-#endif /* WITH_CGRAPH */
        ND_alg(n) = alg + i;
        GD_neato_nlist(g)[i++] = n;
        patchwork_init_node(n);
@@ -144,11 +128,7 @@ static void patchwork_init_node_edge(graph_t * g)
 
 static void patchwork_init_graph(graph_t * g)
 {
-#ifndef WITH_CGRAPH
-    N_shape = agnodeattr(g, "shape", "box");
-#else
     N_shape = agattr(g, AGNODE, "shape","box");
-#endif
     setEdgeType (g, ET_LINE);
     /* GD_ndim(g) = late_int(g,agfindattr(g,"dim"),2,2); */
     Ndim = GD_ndim(g) = 2;     /* The algorithm only makes sense in 2D */
@@ -175,11 +155,7 @@ static void patchwork_cleanup_graph(graph_t * g)
 {
     free(GD_neato_nlist(g));
     if (g != agroot(g))
-#ifndef WITH_CGRAPH
-        memset(&(g->u), 0, sizeof(Agraphinfo_t));
-#else /* WITH_CGRAPH */
         agclean(g, AGRAPH , "Agraphinfo_t");
-#endif /* WITH_CGRAPH */
 }
 
 void patchwork_cleanup(graph_t * g)
index a0983e288bf8d8a9235cf3a2e198193cd61ddab5..5e3144070490650167921f0b28cbf416e96e8883 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
@@ -16,7 +10,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/rbtree \
        -I$(top_srcdir)/lib/pack \
        -I$(top_srcdir)/lib/pathplan \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = sfdpinternal.h spring_electrical.h \
index e022e9d15d6d9d3a0617f387f822ebcac1868508..370a934ba48808d5e70a123e815af7a6a84f3de3 100644 (file)
@@ -35,9 +35,7 @@
 
 static void sfdp_init_edge(edge_t * e)
 {
-#ifdef WITH_CGRAPH
     agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //node custom data
-#endif /* WITH_CGRAPH */
     common_init_edge(e);
 }
 
@@ -183,11 +181,7 @@ late_mode (graph_t* g, Agsym_t* sym, int dflt)
     int rv;
 
     if (!sym) return dflt;
-#ifdef WITH_CGRAPH
     s = agxget (g, sym);
-#else
-    s = agxget (g, sym->index);
-#endif
     if (isdigit(*s)) {
        if ((v = atoi (s)) <= METHOD_UNIFORM_STRESS)
            rv = v;
@@ -222,11 +216,7 @@ late_smooth (graph_t* g, Agsym_t* sym, int dflt)
     int rv;
 
     if (!sym) return dflt;
-#ifdef WITH_CGRAPH
     s = agxget (g, sym);
-#else
-    s = agxget (g, sym->index);
-#endif
     if (isdigit(*s)) {
 #if (HAVE_GTS || HAVE_TRIANGLE)
        if ((v = atoi (s)) <= SMOOTHING_RNG)
@@ -272,11 +262,7 @@ late_quadtree_scheme (graph_t* g, Agsym_t* sym, int dflt)
     int rv;
 
     if (!sym) return dflt;
-#ifdef WITH_CGRAPH
     s = agxget (g, sym);
-#else
-    s = agxget (g, sym->index);
-#endif
     if (isdigit(*s)) {
       if ((v = atoi (s)) <= QUAD_TREE_FAST && v >= QUAD_TREE_NONE){
        rv = v;
index 741a46210863a9e8a8e2897da0a8ded79e0369ef..fe141f8198ecc3032307f01a2688462c41b234ca 100644 (file)
@@ -1,12 +1,6 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
-if WITH_CGRAPH
-GRAPH = cgraph
-else
-GRAPH = graph
-endif
-
 AM_CPPFLAGS = \
         -I$(top_srcdir) \
         -I$(top_srcdir)/lib/common \
@@ -15,7 +9,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/pack \
        -I$(top_srcdir)/lib/pathplan \
        -I$(top_srcdir)/lib/sparse \
-       -I$(top_srcdir)/lib/$(GRAPH) \
+       -I$(top_srcdir)/lib/cgraph \
        -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = circle.h
index 7145a9b4ba46af536e4313fb4645ae4fba8424f5..ab09874a8f9bbeb81b1592b52d5536a53d6eefc1 100644 (file)
@@ -24,9 +24,7 @@
 
 static void twopi_init_edge(edge_t * e)
 {
-#ifdef WITH_CGRAPH
     agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);  //edge custom data
-#endif /* WITH_CGRAPH */
     common_init_edge(e);
     ED_factor(e) = late_double(e, E_weight, 1.0, 0.0);
 }
@@ -174,11 +172,7 @@ static void twopi_cleanup_graph(graph_t * g)
 {
     free(GD_neato_nlist(g));
     if (g != agroot(g))
-#ifndef WITH_CGRAPH
-       memset(&(g->u), 0, sizeof(Agraphinfo_t));
-#else /* WITH_CGRAPH */
        agclean(g,AGRAPH,"Agraphinfo_t");
-#endif /* WITH_CGRAPH */
 }
 
 /* twopi_cleanup: