for (h = ND_next(t); h; h = ND_next(h)) {
#ifdef WITH_CGRAPH
if (!agedge(g, t, h, (char *)NULL, FALSE)) {
+ e = agedge(g, t, h,NULL,1);
#else
if (!agfindedge(g, t, h)) {
-#endif
e = agedge(g, t, h);
+#endif
ED_minlen(e) = 0;
elist_append(e, ND_out(t));
elist_append(e, ND_in(h));
lastn = NULL;
for (i = 0; i <= tbl->cc; i++) {
+#ifdef WITH_CGRAPH
+ t = agnode(colg, nToName(i),1);
+#else
t = agnode(colg, nToName(i));
+#endif
alloc_elist(tbl->rc, ND_in(t));
alloc_elist(tbl->rc, ND_out(t));
if (lastn) {
}
lastn = NULL;
for (i = 0; i <= tbl->rc; i++) {
+#ifdef WITH_CGRAPH
+ t = agnode(rowg, nToName(i),1);
+#else
t = agnode(rowg, nToName(i));
+#endif
alloc_elist(tbl->cc, ND_in(t));
alloc_elist(tbl->cc, ND_out(t));
if (lastn) {
for (cells = tbl->u.n.cells; *cells; cells++) {
int x, y, c, r;
cp = *cells;
+#ifdef WITH_CGRAPH
+ t = agnode(colg, nToName(cp->col),0);
+ h = agnode(colg, nToName(cp->col + cp->cspan),0);
+ e = agedge(colg, t, h,NULL,1);
+#else
t = agfindnode(colg, nToName(cp->col));
h = agfindnode(colg, nToName(cp->col + cp->cspan));
e = agedge(colg, t, h);
+#endif
x = 0;
for (c = 0; c < cp->cspan; c++)
x += minc[cp->col + c];
elist_append(e, ND_out(t));
elist_append(e, ND_in(h));
+#ifdef WITH_CGRAPH
+ t = agnode(rowg, nToName(cp->row),0);
+ h = agnode(rowg, nToName(cp->row + cp->rspan),0);
+ e = agedge(rowg, t, h,NULL,1);
+#else
t = agfindnode(rowg, nToName(cp->row));
h = agfindnode(rowg, nToName(cp->row + cp->rspan));
e = agedge(rowg, t, h);
+#endif
y = 0;
for (r = 0; r < cp->rspan; r++)
y += minr[cp->row + r];
tbl->heights = N_NEW(tbl->rc + 1, int);
tbl->widths = N_NEW(tbl->cc + 1, int);
+#ifdef WITH_CGRAPH
+ rowg = agopen("rowg", Agdirected,NIL(Agdisc_t *));
+ colg = agopen("colg", Agdirected,NIL(Agdisc_t *));
+#else
rowg = agopen("rowg", AGDIGRAPH);
colg = agopen("colg", AGDIGRAPH);
+#endif
makeGraphs(tbl, rowg, colg);
rank(rowg, 2, INT_MAX);
rank(colg, 2, INT_MAX);
static char *nameOf(void *obj, agxbuf * xb)
{
Agedge_t *ep;
+#ifdef WITH_CGRAPH
+ switch (agobjkind(obj)) {
+ case AGRAPH:
+ agxbput(xb, agnameof(((Agraph_t *) obj)));
+ break;
+ case AGNODE:
+ agxbput(xb, agnameof(((Agnode_t *) obj)));
+ break;
+ case AGEDGE:
+ ep = (Agedge_t *) obj;
+ agxbput(xb, agnameof(agtail(ep)));
+ agxbput(xb, agnameof(aghead(ep)));
+ if (agisdirected(agraphof(ep)))
+ agxbput(xb, "->");
+ else
+ agxbput(xb, "--");
+ break;
+ }
+#else
switch (agobjkind(obj)) {
case AGGRAPH:
agxbput(xb, ((Agraph_t *) obj)->name);
ep = (Agedge_t *) obj;
agxbput(xb, ep->tail->name);
agxbput(xb, ep->head->name);
-#ifdef WITH_CGRAPH
- if (agisdirected(agraphof(ep)))
-#else
if (AG_IS_DIRECTED(ep->tail->graph))
-#endif
agxbput(xb, "->");
else
agxbput(xb, "--");
break;
}
+#endif
return agxbuse(xb);
}
char *s;
env.obj = obj;
+#ifdef WITH_CGRAPH
+ switch (agobjkind(obj)) {
+ case AGRAPH:
+ env.g = ((Agraph_t *) obj)->root;
+ break;
+ case AGNODE:
+ env.g = agraphof(((Agnode_t *) obj));
+ break;
+ case AGEDGE:
+ env.g = agraphof(aghead (((Agedge_t *) obj)));
+ break;
+ }
+#else
switch (agobjkind(obj)) {
case AGGRAPH:
env.g = ((Agraph_t *) obj)->root;
env.g = ((Agedge_t *) obj)->head->graph;
break;
}
+#endif
g = env.g->root;
env.finfo.size = lp->fontsize;
#include "render.h"
#include "htmltable.h"
+#ifdef WITH_CGRAPH
+#define SET_RANKDIR(g,rd) (GD_rankdir2(g) = rd)
+#else
+#define SET_RANKDIR(g,rd) ((g)->u.rankdir = (rd))
+#endif
+
static char *usageFmt =
"Usage: %s [-Vv?] [-(GNE)name=val] [-(KTlso)<val>] <dot files>\n";
gvc->common.lib = Lib;
}
-void global_def(const char *dcl,
- attrsym_t * ((*dclfun) (Agraph_t *, char *, char *)))
+#ifdef WITH_CGRAPH
+static void global_def(const char *dcl,int kind,
+ attrsym_t * ((*dclfun) (Agraph_t *, int kind, char *, char *)) )
+{
+ char *p;
+ const char *rhs = "true";
+
+ attrsym_t *sym;
+ if ((p = strchr(dcl, '='))) {
+ *p++ = '\0';
+ rhs = p;
+ }
+ sym = dclfun(NULL, kind, dcl, rhs);
+ sym->fixed = 1;
+}
+#else
+static void global_def(const char *dcl,
+ attrsym_t * ((*dclfun) (Agraph_t *, char *, char *)))
{
char *p;
const char *rhs = "true";
sym = dclfun(NULL, dcl, rhs);
sym->fixed = 1;
}
+#endif
static void gvg_init(GVC_t *gvc, graph_t *g, char *fn, int gidx)
{
Verbose = gvc->common.verbose;
CmdName = gvc->common.cmdname;
+#ifdef WITH_CGRAPH
+#else
aginit();
+#endif
nfiles = 0;
for (i = 1; i < argc; i++)
if (argv[i] && argv[i][0] != '-')
switch (c = argv[i][1]) {
case 'G':
if (*rest)
+#ifdef WITH_CGRAPH
+ global_def(rest,AGRAPH,agattr);
+#else
global_def(rest, agraphattr);
+#endif
else {
fprintf(stderr, "Missing argument for -G flag\n");
dotneato_usage(1);
break;
case 'N':
if (*rest)
+#ifdef WITH_CGRAPH
+ global_def(rest, AGNODE,agattr);
+#else
global_def(rest, agnodeattr);
+#endif
else {
fprintf(stderr, "Missing argument for -N flag\n");
dotneato_usage(1);
break;
case 'E':
if (*rest)
+#ifdef WITH_CGRAPH
+ global_def(rest, AGEDGE,agattr);
+#else
global_def(rest, agedgeattr);
+#endif
else {
fprintf(stderr, "Missing argument for -E flag\n");
dotneato_usage(1);
}
/* set persistent attributes here (if not already set from command line options) */
+#ifdef WITH_CGRAPH
+#else
if (!(agfindattr(agprotograph()->proto->n, "label")))
agnodeattr(NULL, "label", NODENAME_ESC);
+#endif
}
/* getdoubles2ptf:
agsetfile(fn ? fn : "<stdin>");
#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++);
int enc;
char* p;
+#ifdef WITH_CGRAPH
+ p = late_nnstring(g,agattr(g,AGRAPH,"charset",(char*)0),"utf-8");
+#else
p = late_nnstring(g,agfindattr(g,"charset"),"utf-8");
+#endif
if (!strcasecmp(p,"latin-1")
|| !strcasecmp(p,"latin1")
|| !strcasecmp(p,"l1")
GD_charset(g) = findCharset (g);
+#ifdef WITH_CGRAPH
+ GD_drawing(g)->quantum =
+ late_double(g, agattr(g, AGRAPH, "quantum",(char*)0), 0.0, 0.0);
+#else
GD_drawing(g)->quantum =
late_double(g, agfindattr(g, "quantum"), 0.0, 0.0);
+#endif
/* setting rankdir=LR is only defined in dot,
* but having it set causes shape code and others to use it.
else
SET_RANKDIR (g, (rankdir << 2));
- xf = late_double(g, agfindattr(g, "nodesep"), DEFAULT_NODESEP,
- MIN_NODESEP);
+#ifdef WITH_CGRAPH
+ xf = late_double(g, agattr(g, AGRAPH, "nodesep",(char*)0),
+ DEFAULT_NODESEP, MIN_NODESEP);
+#else
+ xf = late_double(g, agfindattr(g, "nodesep"),
+ DEFAULT_NODESEP, MIN_NODESEP);
+#endif
GD_nodesep(g) = POINTS(xf);
+#ifdef WITH_CGRAPH
+ p = late_string(g, agattr(g, AGRAPH, "ranksep", (char*)0), NULL);
+#else
p = late_string(g, agfindattr(g, "ranksep"), NULL);
+#endif
if (p) {
if (sscanf(p, "%lf", &xf) == 0)
xf = DEFAULT_RANKSEP;
xf = DEFAULT_RANKSEP;
GD_ranksep(g) = POINTS(xf);
+#ifdef WITH_CGRAPH
+ GD_showboxes(g) = late_int(g, agattr(g,AGRAPH, "showboxes",(char*)0), 0, 0);
+ p = late_string(g, agattr(g, AGRAPH,"fontnames",(char*)0), NULL);
+#else
GD_showboxes(g) = late_int(g, agfindattr(g, "showboxes"), 0, 0);
p = late_string(g, agfindattr(g, "fontnames"), NULL);
+#endif
GD_fontnames(g) = maptoken(p, fontnamenames, fontnamecodes);
setRatio(g);
Initial_dist = MYHUGE;
/* initialize nodes */
+#ifdef WITH_CGRAPH
+ N_height = agattr(g, AGNODE,"height",(char*)0);
+ N_width = agattr(g, AGNODE, "width",(char*)0);
+ N_shape = agattr(g, AGNODE, "shape",(char*)0);
+ N_color = agattr(g, AGNODE, "color",(char*)0);
+ N_fillcolor = agattr(g, AGNODE, "fillcolor",(char*)0);
+ N_style = agattr(g, AGNODE, "style",(char*)0);
+ N_fontsize = agattr(g, AGNODE, "fontsize",(char*)0);
+ N_fontname = agattr(g, AGNODE, "fontname",(char*)0);
+ N_fontcolor = agattr(g, AGNODE, "fontcolor",(char*)0);
+ N_label = agattr(g, AGNODE, "label",(char*)0);
+ N_showboxes = agattr(g, AGNODE, "showboxes",(char*)0);
+ N_penwidth = agattr(g, AGNODE, "penwidth",(char*)0);
+ /* attribs for polygon shapes */
+ N_sides = agattr(g, AGNODE, "sides",(char*)0);
+ N_peripheries = agattr(g, AGNODE, "peripheries",(char*)0);
+ N_skew = agattr(g, AGNODE, "skew",(char*)0);
+ N_orientation = agattr(g, AGNODE, "orientation",(char*)0);
+ N_distortion = agattr(g, AGNODE, "distortion",(char*)0);
+ N_fixed = agattr(g, AGNODE, "fixedsize",(char*)0);
+ N_imagescale = agattr(g, AGNODE, "imagescale",(char*)0);
+ N_nojustify = agattr(g, AGNODE, "nojustify",(char*)0);
+ N_layer = agattr(g, AGNODE, "layer",(char*)0);
+ N_group = agattr(g, AGNODE, "group",(char*)0);
+ N_comment = agattr(g, AGNODE, "comment",(char*)0);
+ N_vertices = agattr(g, AGNODE, "vertices",(char*)0);
+ N_z = agattr(g, AGNODE, "z",(char*)0);
+#else
N_height = agfindattr(g->proto->n, "height");
N_width = agfindattr(g->proto->n, "width");
N_shape = agfindattr(g->proto->n, "shape");
N_comment = agfindattr(g->proto->n, "comment");
N_vertices = agfindattr(g->proto->n, "vertices");
N_z = agfindattr(g->proto->n, "z");
+#endif
/* initialize edges */
+#ifdef WITH_CGRAPH
+ E_weight = agattr(g, AGEDGE, "weight",(char*)0);
+ E_color = agattr(g, AGEDGE, "color",(char*)0);
+ E_fontsize = agattr(g, AGEDGE, "fontsize",(char*)0);
+ E_fontname = agattr(g, AGEDGE, "fontname",(char*)0);
+ E_fontcolor = agattr(g, AGEDGE, "fontcolor",(char*)0);
+ E_label = agattr(g, AGEDGE, "label",(char*)0);
+ E_label_float = agattr(g, AGEDGE, "labelfloat",(char*)0);
+ /* vladimir */
+ E_dir = agattr(g, AGEDGE, "dir",(char*)0);
+ E_arrowhead = agattr(g, AGEDGE, "arrowhead",(char*)0);
+ E_arrowtail = agattr(g, AGEDGE, "arrowtail",(char*)0);
+ E_headlabel = agattr(g, AGEDGE, "headlabel",(char*)0);
+ E_taillabel = agattr(g, AGEDGE, "taillabel",(char*)0);
+ E_labelfontsize = agattr(g, AGEDGE, "labelfontsize",(char*)0);
+ E_labelfontname = agattr(g, AGEDGE, "labelfontname",(char*)0);
+ E_labelfontcolor = agattr(g, AGEDGE, "labelfontcolor",(char*)0);
+ E_labeldistance = agattr(g, AGEDGE, "labeldistance",(char*)0);
+ E_labelangle = agattr(g, AGEDGE, "labelangle",(char*)0);
+ /* end vladimir */
+ E_minlen = agattr(g, AGEDGE, "minlen",(char*)0);
+ E_showboxes = agattr(g, AGEDGE, "showboxes",(char*)0);
+ E_style = agattr(g, AGEDGE, "style",(char*)0);
+ E_decorate = agattr(g, AGEDGE, "decorate",(char*)0);
+ E_arrowsz = agattr(g, AGEDGE, "arrowsize",(char*)0);
+ E_constr = agattr(g, AGEDGE, "constraint",(char*)0);
+ E_layer = agattr(g, AGEDGE, "layer",(char*)0);
+ E_comment = agattr(g, AGEDGE, "comment",(char*)0);
+ E_tailclip = agattr(g, AGEDGE, "tailclip",(char*)0);
+ E_headclip = agattr(g, AGEDGE, "headclip",(char*)0);
+ E_penwidth = agattr(g, AGEDGE, "penwidth",(char*)0);
+#else
E_weight = agfindattr(g->proto->e, "weight");
E_color = agfindattr(g->proto->e, "color");
E_fontsize = agfindattr(g->proto->e, "fontsize");
E_tailclip = agfindattr(g->proto->e, "tailclip");
E_headclip = agfindattr(g->proto->e, "headclip");
E_penwidth = agfindattr(g->proto->e, "penwidth");
+#endif
}
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:
pointf dimen;
GD_has_labels(sg->root) |= GRAPH_LABEL;
+
+#ifdef WITH_CGRAPH
+ GD_label(sg) = make_label(agroot(sg), str, (aghtmlstr(str) ? LT_HTML : LT_NONE),
+ late_double(sg, agattr(sg,AGRAPH,"fontsize",(char*)0),
+ DEFAULT_FONTSIZE, MIN_FONTSIZE),
+ late_nnstring(sg, agattr(sg,AGRAPH, "fontname",(char*)0),
+ DEFAULT_FONTNAME),
+ late_nnstring(sg, agattr(sg,AGRAPH, "fontcolor",(char*)0),
+ DEFAULT_COLOR));
+#else
GD_label(sg) = make_label((void*)sg, str, (aghtmlstr(str) ? LT_HTML : LT_NONE),
- late_double(sg, agfindattr(sg, "fontsize"), DEFAULT_FONTSIZE, MIN_FONTSIZE),
- late_nnstring(sg, agfindattr(sg, "fontname"), DEFAULT_FONTNAME),
- late_nnstring(sg, agfindattr(sg, "fontcolor"), DEFAULT_COLOR));
+ late_double(sg, agfindattr(sg, "fontsize"),
+ DEFAULT_FONTSIZE, MIN_FONTSIZE),
+ late_nnstring(sg, agfindattr(sg, "fontname"),
+ DEFAULT_FONTNAME),
+ late_nnstring(sg, agfindattr(sg, "fontcolor"),
+ DEFAULT_COLOR));
+#endif
/* set label position */
pos = agget(sg, "labelloc");
+#ifdef WITH_CGRAPH
+ if (sg != agroot(sg)) {
+#else
if (sg != sg->root) {
+#endif
if (pos && (pos[0] == 'b'))
pos_flag = LABEL_AT_BOTTOM;
else
}
GD_label_pos(sg) = pos_flag;
- if (sg == sg->root)
+#ifdef WITH_CGRAPH
+ if (sg == agroot(sg))
+#else
+ if (sg == sg->root) {
+#endif
return;
/* Set border information for cluster labels to allow space
*/
dimen = GD_label(sg)->dimen;
PAD(dimen);
+#ifdef WITH_CGRAPH
+ if (!GD_flip(agroot(sg))) {
+#else
if (!GD_flip(sg->root)) {
+#endif
if (GD_label_pos(sg) & LABEL_AT_TOP)
pos_ix = TOP_IX;
else
#include "gvcext.h"
#include "pathgeom.h"
#include "textpara.h"
+#ifdef WITH_CGRAPH
+#include "cgraph.h"
+#else
+#include "graph.h"
+#endif
#ifdef __cplusplus
extern "C" {
typedef struct Agnode_s node_t;
typedef struct Agedge_s edge_t;
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;
} Agraphinfo_t;
+#ifdef WITH_CGRAPH
+#define GD_u(g)(((Agraphinfo_t*)AGDATA(g)))
+#define GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing)
+#define GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb)
+#define GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc)
+#define GD_cleanup(g) (((Agraphinfo_t*)AGDATA(g))->cleanup)
+#define GD_dist(g) (((Agraphinfo_t*)AGDATA(g))->dist)
+#define GD_alg(g) (((Agraphinfo_t*)AGDATA(g))->alg)
+#define GD_border(g) (((Agraphinfo_t*)AGDATA(g))->border)
+#define GD_cl_cnt(g) (((Agraphinfo_t*)AGDATA(g))->cl_nt)
+#define GD_clust(g) (((Agraphinfo_t*)AGDATA(g))->clust)
+#define GD_cluster_was_collapsed(g) (((Agraphinfo_t*)AGDATA(g))->cluster_was_collapsed)
+#define GD_comp(g) (((Agraphinfo_t*)AGDATA(g))->comp)
+#define GD_exact_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->exact_ranksep)
+#define GD_expanded(g) (((Agraphinfo_t*)AGDATA(g))->expanded)
+#define GD_flags(g) (((Agraphinfo_t*)AGDATA(g))->flags)
+#define GD_gui_state(g) (((Agraphinfo_t*)AGDATA(g))->gui_state)
+#define GD_charset(g) (((Agraphinfo_t*)AGDATA(g))->charset)
+#define GD_has_labels(g) (((Agraphinfo_t*)AGDATA(g))->has_labels)
+#define GD_has_images(g) (((Agraphinfo_t*)AGDATA(g))->has_images)
+#define GD_has_flat_edges(g) (((Agraphinfo_t*)AGDATA(g))->has_flat_edges)
+#define GD_ht1(g) (((Agraphinfo_t*)AGDATA(g))->ht1)
+#define GD_ht2(g) (((Agraphinfo_t*)AGDATA(g))->ht2)
+#define GD_inleaf(g) (((Agraphinfo_t*)AGDATA(g))->inleaf)
+#define GD_installed(g) (((Agraphinfo_t*)AGDATA(g))->installed)
+#define GD_label(g) (((Agraphinfo_t*)AGDATA(g))->label)
+#define GD_leader(g) (((Agraphinfo_t*)AGDATA(g))->leader)
+#define GD_rankdir2(g) (((Agraphinfo_t*)AGDATA(g))->rankdir)
+#define GD_rankdir(g) (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3)
+#define GD_flip(g) (GD_rankdir(g) & 1)
+#define GD_realrankdir(g) ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2)
+#define GD_realflip(g) (GD_realrankdir(g) & 1)
+#define GD_ln(g) (((Agraphinfo_t*)AGDATA(g))->ln)
+#define GD_maxrank(g) (((Agraphinfo_t*)AGDATA(g))->maxrank)
+#define GD_maxset(g) (((Agraphinfo_t*)AGDATA(g))->maxset)
+#define GD_minrank(g) (((Agraphinfo_t*)AGDATA(g))->minrank)
+#define GD_minset(g) (((Agraphinfo_t*)AGDATA(g))->minset)
+#define GD_move(g) (((Agraphinfo_t*)AGDATA(g))->move)
+#define GD_n_cluster(g) (((Agraphinfo_t*)AGDATA(g))->n_cluster)
+#define GD_n_nodes(g) (((Agraphinfo_t*)AGDATA(g))->n_nodes)
+#define GD_ndim(g) (((Agraphinfo_t*)AGDATA(g))->ndim)
+#define GD_odim(g) (((Agraphinfo_t*)AGDATA(g))->odim)
+#define GD_neato_nlist(g) (((Agraphinfo_t*)AGDATA(g))->neato_nlist)
+#define GD_nlist(g) (((Agraphinfo_t*)AGDATA(g))->nlist)
+#define GD_nodesep(g) (((Agraphinfo_t*)AGDATA(g))->nodesep)
+#define GD_outleaf(g) (((Agraphinfo_t*)AGDATA(g))->outleaf)
+#define GD_rank(g) (((Agraphinfo_t*)AGDATA(g))->rank)
+#define GD_rankleader(g) (((Agraphinfo_t*)AGDATA(g))->rankleader)
+#define GD_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->ranksep)
+#define GD_rn(g) (((Agraphinfo_t*)AGDATA(g))->rn)
+#define GD_set_type(g) (((Agraphinfo_t*)AGDATA(g))->set_type)
+#define GD_label_pos(g) (((Agraphinfo_t*)AGDATA(g))->label_pos)
+#define GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes)
+#define GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames)
+#define GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring)
+
+#else
+
#define GD_alg(g) (g)->u.alg
#define GD_bb(g) (g)->u.bb
#define GD_border(g) (g)->u.border
#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 {
shape_desc *shape;
} 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)
+#define ND_UF_size(n) (((Agnodeinfo_t*)AGDATA(n))->UF_size)
+#define ND_bb(n) (((Agnodeinfo_t*)AGDATA(n))->bb)
+#define ND_clust(n) (((Agnodeinfo_t*)AGDATA(n))->clust)
+#define ND_coord_i(n) (((Agnodeinfo_t*)AGDATA(n))->coord)
+#define ND_dist(n) (((Agnodeinfo_t*)AGDATA(n))->dist)
+#define ND_flat_in(n) (((Agnodeinfo_t*)AGDATA(n))->flat_in)
+#define ND_flat_out(n) (((Agnodeinfo_t*)AGDATA(n))->flat_out)
+#define ND_gui_state(n) (((Agnodeinfo_t*)AGDATA(n))->gui_state)
+#define ND_has_port(n) (((Agnodeinfo_t*)AGDATA(n))->has_port)
+#define ND_heapindex(n) (((Agnodeinfo_t*)AGDATA(n))->heapindex)
+#define ND_height(n) (((Agnodeinfo_t*)AGDATA(n))->height)
+#define ND_hops(n) (((Agnodeinfo_t*)AGDATA(n))->hops)
+#define ND_ht_i(n) (((Agnodeinfo_t*)AGDATA(n))->ht)
+#define ND_in(n) (((Agnodeinfo_t*)AGDATA(n))->in)
+#define ND_inleaf(n) (((Agnodeinfo_t*)AGDATA(n))->inleaf)
+#define ND_label(n) (((Agnodeinfo_t*)AGDATA(n))->label)
+#define ND_lim(n) (((Agnodeinfo_t*)AGDATA(n))->lim)
+#define ND_low(n) (((Agnodeinfo_t*)AGDATA(n))->low)
+#define ND_lw_i(n) (((Agnodeinfo_t*)AGDATA(n))->lw)
+#define ND_mark(n) (((Agnodeinfo_t*)AGDATA(n))->mark)
+#define ND_mval(n) (((Agnodeinfo_t*)AGDATA(n))->mval)
+#define ND_n_cluster(n) (((Agnodeinfo_t*)AGDATA(n))->n_cluster)
+#define ND_next(n) (((Agnodeinfo_t*)AGDATA(n))->next)
+#define ND_node_type(n) (((Agnodeinfo_t*)AGDATA(n))->node_type)
+#define ND_onstack(n) (((Agnodeinfo_t*)AGDATA(n))->onstack)
+#define ND_order(n) (((Agnodeinfo_t*)AGDATA(n))->order)
+#define ND_other(n) (((Agnodeinfo_t*)AGDATA(n))->other)
+#define ND_out(n) (((Agnodeinfo_t*)AGDATA(n))->out)
+#define ND_outleaf(n) (((Agnodeinfo_t*)AGDATA(n))->outleaf)
+#define ND_par(n) (((Agnodeinfo_t*)AGDATA(n))->par)
+#define ND_pinned(n) (((Agnodeinfo_t*)AGDATA(n))->pinned)
+#define ND_pos(n) (((Agnodeinfo_t*)AGDATA(n))->pos)
+#define ND_prev(n) (((Agnodeinfo_t*)AGDATA(n))->prev)
+#define ND_priority(n) (((Agnodeinfo_t*)AGDATA(n))->priority)
+#define ND_rank(n) (((Agnodeinfo_t*)AGDATA(n))->rank)
+#define ND_ranktype(n) (((Agnodeinfo_t*)AGDATA(n))->ranktype)
+#define ND_rw_i(n) (((Agnodeinfo_t*)AGDATA(n))->rw)
+#define ND_save_in(n) (((Agnodeinfo_t*)AGDATA(n))->save_in)
+#define ND_save_out(n) (((Agnodeinfo_t*)AGDATA(n))->save_out)
+#define ND_shape(n) (((Agnodeinfo_t*)AGDATA(n))->shape)
+#define ND_shape_info(n) (((Agnodeinfo_t*)AGDATA(n))->shape_info)
+#define ND_showboxes(n) (((Agnodeinfo_t*)AGDATA(n))->showboxes)
+#define ND_state(n) (((Agnodeinfo_t*)AGDATA(n))->state)
+#define ND_clustnode(n) (((Agnodeinfo_t*)AGDATA(n))->clustnode)
+#define ND_tree_in(n) (((Agnodeinfo_t*)AGDATA(n))->tree_in)
+#define ND_tree_out(n) (((Agnodeinfo_t*)AGDATA(n))->tree_out)
+#define ND_weight_class(n) (((Agnodeinfo_t*)AGDATA(n))->weight_class)
+#define ND_width(n) (((Agnodeinfo_t*)AGDATA(n))->width)
+#define ND_xsize(n) (((Agnodeinfo_t*)AGDATA(n))->xsize)
+#define ND_ysize(n) (((Agnodeinfo_t*)AGDATA(n))->ysize)
+
+#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_width(n) (n)->u.width
#define ND_xsize(n) (n)->u.xsize
#define ND_ysize(n) (n)->u.ysize
+#endif
typedef struct Agedgeinfo_t {
splines *spl;
unsigned short minlen;
edge_t *to_virt;
#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)
+#define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue)
+#define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type)
+#define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent)
+#define ED_factor(e) (((Agedgeinfo_t*)AGDATA(e))->factor)
+#define ED_gui_state(e) (((Agedgeinfo_t*)AGDATA(e))->gui_state)
+#define ED_head_label(e) (((Agedgeinfo_t*)AGDATA(e))->head_label)
+#define ED_head_port(e) (((Agedgeinfo_t*)AGDATA(e))->head_port)
+#define ED_label(e) (((Agedgeinfo_t*)AGDATA(e))->label)
+#define ED_label_ontop(e) (((Agedgeinfo_t*)AGDATA(e))->label_ontop)
+#define ED_minlen(e) (((Agedgeinfo_t*)AGDATA(e))->minlen)
+#define ED_path(e) (((Agedgeinfo_t*)AGDATA(e))->path)
+#define ED_showboxes(e) (((Agedgeinfo_t*)AGDATA(e))->showboxes)
+#define ED_spl(e) (((Agedgeinfo_t*)AGDATA(e))->spl)
+#define ED_tail_label(e) (((Agedgeinfo_t*)AGDATA(e))->tail_label)
+#define ED_tail_port(e) (((Agedgeinfo_t*)AGDATA(e))->tail_port)
+#define ED_to_orig(e) (((Agedgeinfo_t*)AGDATA(e))->to_orig)
+#define ED_to_virt(e) (((Agedgeinfo_t*)AGDATA(e))->to_virt)
+#define ED_tree_index(e) (((Agedgeinfo_t*)AGDATA(e))->tree_index)
+#define ED_xpenalty(e) (((Agedgeinfo_t*)AGDATA(e))->xpenalty)
+#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_tree_index(e) (e)->u.tree_index
#define ED_weight(e) (e)->u.weight
#define ED_xpenalty(e) (e)->u.xpenalty
-
-#ifdef WITH_CGRAPH
-#include "cgraph.h"
-#else
-#include "graph.h"
#endif
typedef struct {