From: ellson Date: Tue, 21 Oct 2008 19:48:31 +0000 (+0000) Subject: dotgen -> cgraph X-Git-Tag: LAST_LIBGRAPH~32^2~3054 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb4a414bb85a35c02740c91a4f224c16fa798733;p=graphviz dotgen -> cgraph --- diff --git a/lib/dotgen/conc.c b/lib/dotgen/conc.c index 8160e4bde..daa9a26fe 100644 --- a/lib/dotgen/conc.c +++ b/lib/dotgen/conc.c @@ -35,8 +35,8 @@ static boolean samedir(edge_t * e, edge_t * f) return FALSE; if (ED_conc_opp_flag(f0)) return FALSE; - return ((ND_rank(f0->tail) - ND_rank(f0->head)) - * (ND_rank(e0->tail) - ND_rank(e0->head)) > 0); + return ((ND_rank(agtail(f0)) - ND_rank(aghead(f0))) + * (ND_rank(agtail(e0)) - ND_rank(aghead(e0))) > 0); } static boolean downcandidate(node_t * v) @@ -50,7 +50,7 @@ static boolean bothdowncandidates(node_t * u, node_t * v) edge_t *e, *f; e = ND_in(u).list[0]; f = ND_in(v).list[0]; - if (downcandidate(v) && (e->tail == f->tail)) { + if (downcandidate(v) && (agtail(e) == agtail(f))) { return samedir(e, f) && (portcmp(ED_tail_port(e), ED_tail_port(f)) == 0); } @@ -68,7 +68,7 @@ static boolean bothupcandidates(node_t * u, node_t * v) edge_t *e, *f; e = ND_out(u).list[0]; f = ND_out(v).list[0]; - if (upcandidate(v) && (e->head == f->head)) { + if (upcandidate(v) && (aghead(e) == aghead(f))) { return samedir(e, f) && (portcmp(ED_head_port(e), ED_head_port(f)) == 0); } @@ -88,10 +88,10 @@ static void mergevirtual(graph_t * g, int r, int lpos, int rpos, int dir) if (dir == DOWN) { while ((e = ND_out(right).list[0])) { for (k = 0; (f = ND_out(left).list[k]); k++) - if (f->head == e->head) + if (aghead(f) == aghead(e)) break; if (f == NULL) - f = virtual_edge(left, e->head, e); + f = virtual_edge(left, aghead(e), e); while ((e0 = ND_in(right).list[0])) { merge_oneway(e0, f); /*ED_weight(f) += ED_weight(e0); */ @@ -102,10 +102,10 @@ static void mergevirtual(graph_t * g, int r, int lpos, int rpos, int dir) } else { while ((e = ND_in(right).list[0])) { for (k = 0; (f = ND_in(left).list[k]); k++) - if (f->tail == e->tail) + if (agtail(f) == agtail(e)) break; if (f == NULL) - f = virtual_edge(e->tail, left, e); + f = virtual_edge(agtail(e), left, e); while ((e0 = ND_out(right).list[0])) { merge_oneway(e0, f); delete_fast_edge(e0); @@ -151,19 +151,19 @@ static void rebuild_vlists(graph_t * g) infuse(g, n); for (e = agfstout(g, n); e; e = agnxtout(g, e)) { for (rep = e; ED_to_virt(rep); rep = ED_to_virt(rep)); - while (ND_rank(rep->head) < ND_rank(e->head)) { - infuse(g, rep->head); - rep = ND_out(rep->head).list[0]; + while (ND_rank(aghead(rep)) < ND_rank(aghead(e))) { + infuse(g, aghead(rep)); + rep = ND_out(aghead(rep)).list[0]; } } } for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { lead = GD_rankleader(g)[r]; - if (ND_rank(g->root)[r].v[ND_order(lead)] != lead) + if (GD_rank(agroot(g))[r].v[ND_order(lead)] != lead) abort(); GD_rank(g)[r].v = - ND_rank(g->root)[r].v + GD_rankleader(g)[r]->u.order; + GD_rank(agroot(g))[r].v + ND_order((GD_rankleader(g)[r])); maxi = -1; for (i = 0; i < GD_rank(g)[r].n; i++) { if ((n = GD_rank(g)[r].v[i]) == NULL) @@ -177,13 +177,13 @@ static void rebuild_vlists(graph_t * g) edge_t *e; for (e = ND_in(n).list[0]; e && ED_to_orig(e); e = ED_to_orig(e)); - if (e && (agcontains(g, e->tail)) - && agcontains(g, e->head)) + if (e && (agcontains(g, agtail(e))) + && agcontains(g, aghead(e))) maxi = i; } } if (maxi == -1) - agerr(AGWARN, "degenerate concentrated rank %s,%d\n", g->name, + agerr(AGWARN, "degenerate concentrated rank %s,%d\n", agnameof(g), r); GD_rank(g)[r].n = maxi + 1; } diff --git a/lib/dotgen/decomp.c b/lib/dotgen/decomp.c index 34eeb3f82..5fc5c066f 100644 --- a/lib/dotgen/decomp.c +++ b/lib/dotgen/decomp.c @@ -79,8 +79,8 @@ search_component(graph_t * g, node_t * n) for (c = 0; c <= 3; c++) { if (vec[c].list) for (i = 0; (e = vec[c].list[i]); i++) { - if ((other = e->head) == n) - other = e->tail; + if ((other = aghead(e)) == n) + other = agtail(e); if ((ND_mark(other) != Cmark) && (other == UF_find(other))) search_component(g, other); }