#include <common/globals.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
for (j = 0; j < NUMNODES; j++) {
snprintf(name, sizeof(name), "%d", j);
node[j] = agnode(g, name, 1);
- agbindrec(node[j], "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
+ agbindrec(node[j], "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
}
/* Connect nodes */
for (j = 0; j < NUMNODES; j++) {
for (k = j + 1; k < NUMNODES; k++) {
e = agedge(g, node[j], node[k], NULL, 1);
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //edge custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //edge custom data
}
}
sg = agsubg (g, "cluster1", 1);
}
k = insertPM (pm, i, j, -1);
assert (k >= 0);
- agbindrec (e, "info", sizeof(etoi_t), TRUE);
+ agbindrec (e, "info", sizeof(etoi_t), true);
ED_idx(e) = k;
}
}
#include "gui.h"
#include "menucallbacks.h"
#include <stddef.h>
+#include <stdbool.h>
#include <string.h>
#include "glcompui.h"
#include "gltemplate.h"
static void
graphRecord (Agraph_t* g)
{
- agbindrec(g, "graphRec", sizeof(graphRec), 1);
+ agbindrec(g, "graphRec", sizeof(graphRec), true);
GG_nodelabelcolor(g) = agattr (g, AGRAPH, "nodelabelcolor", 0);
GG_edgelabelcolor(g) = agattr (g, AGRAPH, "edgelabelcolor", 0);
*/
#include "config.h"
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
stp->nComp++;
sg = agsubg(g, blockName(agnameof(g), stp->nComp), 1);
- agbindrec(sg, "info", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(sg, "info", sizeof(Agraphinfo_t), true);
NEXTBLK(sg) = stp->blks;
stp->blks = sg;
return sg;
#include "config.h"
#include <ctype.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <cgraph/cgraph.h>
for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
if (!strncmp(agnameof(subg), "cluster", 7)) {
dn = agnode(dg, agnameof(subg), 1);
- agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), true);
ND_ptr(dn) = (Agobj_t*)subg;
for (n = agfstnode(subg); n; n = agnxtnode(subg, n)) {
if (ND_ptr(n)) {
if (ND_dn(n))
continue;
dn = agnode(dg, agnameof(n), 1);
- agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec (dn, "nodeinfo", sizeof(Agnodeinfo_t), true);
ND_ptr(dn) = (Agobj_t*)n;
ND_ptr(n) = (Agobj_t*)dn;
}
#include "config.h"
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void
emitNode (Agraph_t* G, Agnode_t* n, FILE* outFile)
{
- agbindrec(n, "nodeinfo", sizeof(Local_Agnodeinfo_t), TRUE);
+ agbindrec(n, "nodeinfo", sizeof(Local_Agnodeinfo_t), true);
fprintf(outFile, " node [\n id %" PRIu64 "\n name \"%s\"\n", id,
agnameof(n));
ID(n) = id++;
/* clone subgraphs */
for (subg = agfstsubg (g); subg; subg = agnxtsubg (subg)) {
nsubg = agsubg(ng, xName(gnames, agnameof(subg)), 1);
- agbindrec (nsubg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec (nsubg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
cloneSubg(subg, nsubg, G_bb, gnames);
/* if subgraphs are clusters, point to the new
* one so we can find it later.
nt = NEWNODE(agtail(e));
nh = NEWNODE(aghead(e));
ne = agedge(ng, nt, nh, NULL, 1);
- agbindrec (ne, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec (ne, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
cloneEdge(e, ne);
MARK(e);
}
doWarn = false;
}
np = agnode(root, xName(nnames, agnameof(n)), 1);
- agbindrec (np, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec (np, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true);
ND_alg(n) = np;
cloneNode(n, np);
}
/* wrap the clone of g in a subgraph of root */
subg = agsubg(root, xName(gnames, agnameof(g)), 1);
- agbindrec (subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec (subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
cloneSubg(g, subg, G_bb, gnames);
}
dtclose(gnames);
#define STANDALONE
#include <cgraph/cgraph.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
for (i = 0; i < A->m; i++) {
sprintf(buf, "%d", i);
n = agnode(g, buf, 1);
- agbindrec(n, "nodeinfo", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec(n, "nodeinfo", sizeof(Agnodeinfo_t), true);
ND_id(n) = i;
arr[i] = n;
}
#include "config.h"
#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
Agraph_t *G = agraphof(n);;
snprintf(name, sizeof(name), "cluster_%u", st->Comp++);
subg = agsubg(G, name, TRUE);
- agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), true);
setrep(subg, agnode(map, name, TRUE));
do {
t = pop(sp);
Agraph_t *G = agraphof(n);;
snprintf(name, sizeof(name), "cluster_%d", (st->Comp)++);
subg = agsubg(G, name, TRUE);
- agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "scc_graph", sizeof(Agraphinfo_t), true);
setrep(subg, agnode(map, name, TRUE));
do {
t = pop(sp);
#include <cgraph/cghdr.h>
#include <cgraph/unreachable.h>
#include <stddef.h>
+#include <stdbool.h>
/*
* dynamic attributes
Agraph_t *par;
Agdatadict_t *parent_dd, *dd;
- dd = agbindrec(g, DataDictName, sizeof(Agdatadict_t), FALSE);
+ dd = agbindrec(g, DataDictName, sizeof(Agdatadict_t), false);
dd->dict.n = agdtopen(g, &AgDataDictDisc, Dttree);
dd->dict.e = agdtopen(g, &AgDataDictDisc, Dttree);
dd->dict.g = agdtopen(g, &AgDataDictDisc, Dttree);
Agsym_t *sym;
Dict_t *datadict;
- rec = agbindrec(obj, AgDataRecName, sizeof(Agattr_t), FALSE);
+ rec = agbindrec(obj, AgDataRecName, sizeof(Agattr_t), false);
datadict = agdictof(context, AGTYPE(obj));
assert(datadict);
if (rec->dict == NULL) {
#include <cgraph/cghdr.h>
#include <stddef.h>
+#include <stdbool.h>
/*
* provides "compound nodes" on top of base Libgraph.
static save_stack_t *save_stack_of(Agedge_t * e, Agnode_t * node_being_saved)
{
int i;
- Agcmpedge_t *edgerec = agbindrec(e, Descriptor_id, sizeof(*edgerec), FALSE);
+ Agcmpedge_t *edgerec = agbindrec(e, Descriptor_id, sizeof(*edgerec), false);
if (node_being_saved == AGHEAD(e))
i = IN_STACK;
else
if (agsubnode(sub, n, FALSE))
return FAILURE; /* avoid cycles */
- noderec = agbindrec(n, Descriptor_id, sizeof(*noderec), FALSE);
- graphrec = agbindrec(sub, Descriptor_id, sizeof(*graphrec), FALSE);
+ noderec = agbindrec(n, Descriptor_id, sizeof(*noderec), false);
+ graphrec = agbindrec(sub, Descriptor_id, sizeof(*graphrec), false);
if (noderec->subg || graphrec->node)
return FAILURE;
noderec->subg = sub;
if ((g != subg) && (n = agsubnode(g, (Agnode_t *) node, FALSE))) {
dtdelete(g->n_dict, n);
- graphrec = agbindrec(g, Descriptor_id, sizeof(*graphrec), FALSE);
+ graphrec = agbindrec(g, Descriptor_id, sizeof(*graphrec), false);
if ((d = graphrec->hidden_node_set) == NULL) {
/* use name disc. to permit search for hidden node by name */
d = graphrec->hidden_node_set = agdtopen(g, &Ag_node_name_disc, Dttree);
#include <cgraph/cghdr.h>
#include <stddef.h>
+#include <stdbool.h>
static Agtag_t Tag; /* to silence warnings about initialization */
installedge(g, out);
if (g->desc.has_attrs) {
- (void) agbindrec(out, AgDataRecName, sizeof(Agattr_t), FALSE);
+ (void)agbindrec(out, AgDataRecName, sizeof(Agattr_t), false);
agedgeattr_init(g, out);
}
agmethod_init(g, out);
#include <cgraph/cghdr.h>
#include <stddef.h>
+#include <stdbool.h>
Agnode_t *agfindnode_by_id(Agraph_t * g, IDTYPE id)
{
AGSEQ(n) = seq;
n->root = agroot(g);
if (agroot(g)->desc.has_attrs)
- (void) agbindrec(n, AgDataRecName, sizeof(Agattr_t), FALSE);
+ (void)agbindrec(n, AgDataRecName, sizeof(Agattr_t), false);
/* nodeattr_init and method_init will be called later, from the
* subgraph where the node was actually created, but first it has
* to be installed in all the (sub)graphs up to root. */
#include <cgraph/cghdr.h>
#include <cgraph/unreachable.h>
#include <stddef.h>
+#include <stdbool.h>
static char DRName[] = "_AG_pending";
Dict_t *dict;
pending_cb_t *handle;
- pending = agbindrec(g, DRName, sizeof(pendingset_t), FALSE);
+ pending = agbindrec(g, DRName, sizeof(pendingset_t), false);
switch (kind) {
case CB_INITIALIZE:
pendingset_t *pending;
if (NOT(g->clos->callbacks_enabled)) {
g->clos->callbacks_enabled = TRUE;
- pending = agbindrec(g, DRName, sizeof(pendingset_t), FALSE);
+ pending = agbindrec(g, DRName, sizeof(pendingset_t), false);
/* this destroys objects in the opposite of their order of creation */
cb(pending->ins.g, CB_INITIALIZE);
cb(pending->ins.n, CB_INITIALIZE);
#include <circogen/edgelist.h>
#include <circogen/deglist.h>
#include <stddef.h>
+#include <stdbool.h>
/* The code below lays out a single block on a circle.
*/
snprintf(gname, sizeof(gname), "_clone_%d", id++);
clone = agsubg(ing, gname,1);
- agbindrec(clone, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
+ agbindrec(clone, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data
snprintf(gname, sizeof(gname), "_clone_%d", id++);
xclone = agopen(gname, ing->desc,NULL);
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
+ agbindrec(xn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
CLONE(n) = xn;
}
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
+ agbindrec(xe, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
ORIGE(xe) = e;
DEGREE(xn) += 1;
DEGREE(xh) += 1;
break;
tp = neighbors_without[mark];
hp = neighbors_without[mark + 1];
- agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data
+ agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data
DEGREE(tp)++;
DEGREE(hp)++;
diff--;
while (diff > 0) {
tp = neighbors_without[0];
hp = neighbors_without[mark];
- agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data
+ agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data
DEGREE(tp)++;
DEGREE(hp)++;
mark++;
tp = neighbors_with[0];
for (mark = 0; mark < no_pair_count; mark++) {
hp = neighbors_without[mark];
- agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
+ agbindrec(agedge(g, tp, hp, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
DEGREE(tp)++;
DEGREE(hp)++;
}
snprintf(gname, sizeof(gname), "_span_%d", id++);
tree = agsubg(g, gname,1);
- agbindrec(tree, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
+ agbindrec(tree, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
agsubnode(tree,n,1);
#include <circogen/blocktree.h>
+#include <stdbool.h>
static void addNode(block_t * bp, Agnode_t * n)
{
snprintf(name, sizeof(name), "_block_%d", state->blockCount++);
subg = agsubg(g, name,1);
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data
return subg;
}
#include <pack/pack.h>
#include <neatogen/neatoprocs.h>
#include <stddef.h>
+#include <stdbool.h>
#include <string.h>
static void circular_init_edge(edge_t * e)
{
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
common_init_edge(e);
ED_factor(e) = late_double(e, E_weight, 1.0, 0.0);
void *orig)
{
node_t *n = agnode(dg, name,1);
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
ND_alg(n) = NEW(cdata);
if (isNode) {
ND_pos(n) = N_NEW(Ndim, double);
Agnode_t *p;
dg = agopen("derived", Agstrictundirected,NULL);
- agbindrec (dg, "info", sizeof(Agraphinfo_t), TRUE);
+ agbindrec (dg, "info", sizeof(Agraphinfo_t), true);
GD_alg(g) = dg; /* store derived graph for closing later */
for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
dt = DNODE(agtail(e));
dh = DNODE(aghead(e));
if (dt != dh) {
- agbindrec(agedge(dg, dt, dh, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
+ agbindrec(agedge(dg, dt, dh, NULL, 1), "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
}
}
}
dh = DNODE(aghead(e));
if (n != dh) {
ep = agedge(dg, n, dh, NULL, 1);
- agbindrec(ep, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
+ agbindrec(ep, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
agsubedge(sg,ep,1);
}
}
for (h = ND_next(t); h; h = ND_next(h)) {
if (!agfindedge(g, t, h)) {
e = agedge(g, t, h, NULL, 1);
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
ED_minlen(e) = 0;
elist_append(e, ND_out(t));
elist_append(e, ND_in(h));
ED_minlen(e) = MAX(ED_minlen(e), sz);
else {
e = agedge(g, t, h, NULL, 1);
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
ED_minlen(e) = sz;
elist_append(e, ND_out(t));
elist_append(e, ND_in(h));
lastn = NULL;
for (i = 0; i <= tbl->cc; i++) {
t = agnode(colg, nToName(i), 1);
- agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true);
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++) {
t = agnode(rowg, nToName(i), 1);
- agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec(t, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true);
alloc_elist(tbl->cc, ND_in(t));
alloc_elist(tbl->cc, ND_out(t));
if (lastn) {
rowg = agopen("rowg", dir, NULL);
colg = agopen("colg", dir, NULL);
/* 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
+ agbindrec(rowg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data
+ agbindrec(colg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data
makeGraphs(tbl, rowg, colg);
rank(rowg, 2, INT_MAX);
rank(colg, 2, INT_MAX);
agxbprint(xb, "__%d:%s", idx++, agnameof(cg));
cn = agnode(agroot(cg), agxbuse(xb), 1);
- agbindrec(cn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec(cn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true);
SET_CLUST_NODE(cn);
agsubnode(cg,cn,1);
{
graph_t *g = agraphof(ct);
edge_t *ce = agedge(g, ct, ch,NULL,1);
- agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
agcopyattr(e, ce);
ED_compound(ce) = TRUE;
map = dtopen(&mapDisc, Dtoset);
clg = agsubg(g, "__clusternodes",1);
- agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
agxbinit(&xb, SMALLBUF, buf);
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
if (IS_CLUST_NODE(n)) continue;
agclose(clg);
if (num_cl_edges) {
cl_edge_t* cl_info;
- cl_info = agbindrec(g, CL_EDGE_TAG, sizeof(cl_edge_t), FALSE);
+ cl_info = agbindrec(g, CL_EDGE_TAG, sizeof(cl_edge_t), false);
cl_info->n_cluster_edges = num_cl_edges;
}
dtclose(cmap);
if ((nn = agfindnode(g, name)))
return nn;
nn = agnode(g, name, 1);
- agbindrec(nn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec(nn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true);
SET_CLUST_NODE(nn);
/* Set all attributes to default */
if (!ecnt) return;
clg = agsubg(g, "__clusternodes",1);
- agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
elist = N_NEW(ecnt, edge_t*);
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
#include <dotgen/dot.h>
#include <pack/pack.h>
#include <dotgen/aspect.h>
+#include <stdbool.h>
static void
dot_init_subg(graph_t * g, graph_t* droot)
graph_t* subg;
if ((g != agroot(g)))
- agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
if (g == droot)
GD_dotroot(agroot(g)) = droot;
static void
dot_init_node(node_t * n)
{
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //graph custom data
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //graph custom data
common_init_node(n);
gv_nodesize(n, GD_flip(agraphof(n)));
alloc_elist(4, ND_in(n));
dot_init_edge(edge_t * e)
{
char *tailgroup, *headgroup;
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //graph custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //graph custom data
common_init_edge(e);
ED_weight(e) = late_int(e, E_weight, 1, 0);
for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
dot_cleanup_graph(subg);
}
- if (! agbindrec(g, "Agraphinfo_t", 0, TRUE)) return;
+ if (! agbindrec(g, "Agraphinfo_t", 0, true)) return;
free (GD_clust(g));
free (GD_rankleader(g));
static void
initSubg (Agraph_t* sg, Agraph_t* g)
{
- agbindrec(sg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(sg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_drawing(sg) = NEW(layout_t);
GD_drawing(sg)->quantum = GD_drawing(g)->quantum;
GD_drawing(sg)->dpi = GD_drawing(g)->dpi;
int nclust, j;
Agraph_t* cg;
- agbindrec(cl, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(cl, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_bb(cl) = GD_bb(scl);
GD_label_pos(cl) = GD_label_pos(scl);
memcpy(GD_border(cl), GD_border(scl), 4*sizeof(pointf));
auxg = agopen ("auxg",Agdirected, NULL);
else
auxg = agopen ("auxg",Agundirected, NULL);
- agbindrec(auxg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(auxg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
agattr(auxg, AGRAPH, "rank", "");
GD_drawing(auxg) = NEW(layout_t);
GD_drawing(auxg)->quantum = GD_drawing(g)->quantum;
cloneNode (graph_t* g, node_t* orign, int flipped)
{
node_t* n = agnode(g, agnameof(orign),1);
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true);
agcopyattr (orign, n);
if (shapeOf(orign) == SH_RECORD) {
int lbllen = strlen(ND_label(orign)->text);
cloneEdge (graph_t* g, node_t* tn, node_t* hn, edge_t* orig)
{
edge_t* e = agedge(g, tn, hn,NULL,1);
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
agcopyattr (orig, e);
return e;
attrs = NEW(attr_state_t);
auxg = cloneGraph (g, attrs);
subg = agsubg (auxg, "xxx",1);
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
agset (subg, "rank", "source");
rightx = ND_coord(hn).x;
leftx = ND_coord(tn).x;
if (!lg) lg = agopen ("lg", Agstrictdirected, 0);
snprintf(buf, sizeof(buf), "%d", j);
n = agnode(lg, buf, 1);
- agbindrec(n, "info", sizeof(info_t), 1);
+ agbindrec(n, "info", sizeof(info_t), true);
lo = ND_order(aghead(ND_out(u).list[0]));
hi = ND_order(aghead(ND_out(u).list[1]));
if (lo > hi) {
sg = agsubg (dot_root(g), "_new_rank", 1);
}
n = agnode (sg, NULL, 1);
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true);
ND_rank(n) = i;
ND_lw(n) = ND_rw(n) = 0.5;
ND_ht(n) = 1;
}
static void my_init_graph(Agraph_t *g, Agobj_t *graph, void *arg)
-{ int *sz = arg; (void)g; agbindrec(graph,"level graph rec",sz[0],TRUE); }
+{ int *sz = arg; (void)g; agbindrec(graph,"level graph rec",sz[0],true); }
static void my_init_node(Agraph_t *g, Agobj_t *node, void *arg)
-{ int *sz = arg; (void)g; agbindrec(node,"level node rec",sz[1],TRUE); }
+{ int *sz = arg; (void)g; agbindrec(node,"level node rec",sz[1],true); }
static void my_init_edge(Agraph_t *g, Agobj_t *edge, void *arg)
-{ int *sz = arg; (void)g; agbindrec(edge,"level edge rec",sz[2],TRUE); }
+{ int *sz = arg; (void)g; agbindrec(edge,"level edge rec",sz[2],true); }
static Agcbdisc_t mydisc = { {my_init_graph,0,0}, {my_init_node,0,0}, {my_init_edge,0,0} };
int infosizes[] = {
Last_node = NULL;
Xg = agopen("level assignment constraints", Agstrictdirected, 0);
- agbindrec(Xg,"level graph rec",sizeof(Agraphinfo_t),TRUE);
+ agbindrec(Xg,"level graph rec",sizeof(Agraphinfo_t),true);
agpushdisc(Xg,&mydisc,infosizes);
edgelabel_ranks(g);
#include <fdpgen/comp.h>
#include <pack/pack.h>
#include <assert.h>
+#include <stdbool.h>
#define MARK(n) (marks[ND_id(n)])
if ((pp = PORTS(g))) {
snprintf(name, sizeof(name), "cc%s_%d", agnameof(g), c_cnt++ + C_cnt);
subg = agsubg(g, name,1);
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_alg(subg) = NEW(gdata);
PORTS(subg) = pp;
NPORTS(subg) = NPORTS(g);
if (!subg) {
snprintf(name, sizeof(name), "cc%s_%d", agnameof(g), c_cnt++ + C_cnt);
subg = agsubg(g, name,1);
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_alg(subg) = NEW(gdata);
}
pinflag = 1;
continue;
snprintf(name, sizeof(name), "cc%s+%d", agnameof(g), c_cnt++ + C_cnt);
subg = agsubg(g, name,1);
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data
GD_alg(subg) = NEW(gdata);
dfs(g, n, subg, marks);
nodeInduce(subg);
#include <fdpgen/tlayout.h>
#include <neatogen/neatoprocs.h>
#include <cgraph/agxbuf.h>
+#include <stdbool.h>
static void initialPositions(graph_t * g)
{
*/
static void init_edge(edge_t * e, attrsym_t * E_len)
{
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
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);
#include <fdpgen/clusteredges.h>
#include <fdpgen/dbg.h>
#include <stddef.h>
+#include <stdbool.h>
typedef struct {
graph_t* rootg; /* logical root; graph passed in to fdp_layout */
node_t *dn;
dn = agnode(dg, name,1);
- agbindrec(dn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
+ agbindrec(dn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
ND_alg(dn) = NEW(dndata); /* free in freeDeriveNode */
ND_pos(dn) = N_GNEW(GD_ndim(dg), double);
/* fprintf (stderr, "Creating %s\n", dn->name); */
infop->gid++;
dg = agopen("derived", Agstrictdirected,NULL);
- agbindrec(dg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(dg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_alg(dg) = NEW(gdata); /* freed in freeDeriveGraph */
#ifdef DEBUG
GORIG(dg) = g;
de = agedge(dg, tl, hd, NULL,1);
else
de = agedge(dg, hd, tl, NULL,1);
- agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
ED_dist(de) = ED_dist(e);
ED_factor(de) = ED_factor(e);
/* fprintf (stderr, "edge %s -- %s\n", tl->name, hd->name); */
de = agedge(dg, m, dn, NULL,1);
else
de = agedge(dg, dn, m, NULL,1);
- agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec(de, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
ED_dist(de) = ED_dist(pp->e);
ED_factor(de) = ED_factor(pp->e);
addEdge(de, pp->e);
for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg))
{
if (!strncmp(agnameof(subg), "cluster", 7)) {
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_alg(subg) = NEW(gdata); /* freed in cleanup_subgs */
GD_ndim(subg) = GD_ndim(parent);
LEVEL(subg) = LEVEL(parent) + 1;
char *p;
int rc;
- agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(g, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_gvc(g) = gvc;
if (g != agroot(g))
GD_gvc(agroot(g)) = gvc;
(void)gvc;
/* skip if no Agraphinfo_t yet */
- if (! agbindrec(g, "Agraphinfo_t", 0, TRUE))
+ if (! agbindrec(g, "Agraphinfo_t", 0, true))
return 0;
if (GD_cleanup(g)) {
#endif
g = agopen(name, desc, &gprDisc);
if (g)
- agbindrec(g, UDATA, sizeof(gdata), 0);
+ agbindrec(g, UDATA, sizeof(gdata), false);
return g;
}
sg = agsubg(g, name, 1);
if (sg && !aggetrec(sg, UDATA, 0))
- agbindrec(sg, UDATA, sizeof(gdata), 0);
+ agbindrec(sg, UDATA, sizeof(gdata), false);
return sg;
}
np = agnode(g, name, 1);
if (np && !aggetrec(np, UDATA, 0))
- agbindrec(np, UDATA, sizeof(ndata), 0);
+ agbindrec(np, UDATA, sizeof(ndata), false);
return np;
}
ep = agedge(g, t, h, key, 1);
if (ep && !aggetrec(ep, UDATA, 0))
- agbindrec(ep, UDATA, sizeof(edata), 0);
+ agbindrec(ep, UDATA, sizeof(edata), false);
return ep;
}
#include <neatogen/neato.h>
#include <neatogen/adjust.h>
#include <stddef.h>
+#include <stdbool.h>
/* For precision, scale up before algorithms, then scale down */
#define SCALE 10
delta = dist(&tp->bb, &hp->bb);
h = hp->cnode;
ce = agedge(cg, t, h, NULL, 1);
- agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
+ agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true);
ED_weight(ce) = 1;
if (ED_minlen(ce) < delta) {
if (ED_minlen(ce) == 0.0) {
edge_t *e;
node_t *lastn = NULL;
graph_t *cg = agopen("cg", Agstrictdirected, NULL);
- agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data
+ agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data
for (p = (nitem *) dtflatten(list); p;
p = (nitem *) dtlink(list, (Dtlink_t *) p)) {
n = agnode(cg, agnameof(p->np), 1); /* FIX */
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
ND_alg(n) = p;
p->cnode = n;
alloc_elist(0, ND_in(n));
if (intersect(p, nxp)) {
double delta = dist(&p->bb, &nxp->bb);
e = agedge(cg, p->cnode, nxp->cnode, NULL, 1);
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data
assert (delta <= 0xFFFF);
ED_minlen(e) = delta;
ED_weight(e) = 1;
int oldval = -INT_MAX;
node_t *lastn = NULL;
graph_t *cg = agopen("cg", Agstrictdirected, NULL);
- agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data
+ agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data
/* count distinct nodes */
cnt = 0;
oldval = p->val;
/* n = newNode (cg); */
n = agnode(cg, agnameof(p->np), 1); /* FIX */
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
ND_alg(n) = p;
if (root) {
ND_next(lastn) = n;
else
alloc_elist(cnt - lcnt - 1, ND_out(prev));
e = agedge(cg, prev, n, NULL, 1);
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); // edge custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); // edge custom data
ED_minlen(e) = SCALE;
ED_weight(e) = 1;
elist_append(e, ND_out(prev));
for (p = (nitem *) dtflatten(list); p;
p = (nitem *) dtlink(list, (Dtlink_t *) p)) {
n = agnode(vg, agnameof(p->np), 1); /* FIX */
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
p->vnode = n;
ND_alg(n) = p;
}
void neato_init_node(node_t * n)
{
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data
common_init_node(n);
ND_pos(n) = N_NEW(GD_ndim(agraphof(n)), double);
gv_nodesize(n, GD_flip(agraphof(n)));
static void neato_init_edge(edge_t * e)
{
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
common_init_edge(e);
ED_factor(e) = late_double(e, E_weight, 1.0, 1.0);
}
boxf bb;
if (!strncmp(agnameof(subg), "cluster", 7) && chkBB(subg, G_bb, &bb)) {
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
GD_bb(subg) = bb;
add_cluster(parentg, subg);
nop_init_graphs(subg, G_lp, G_bb);
graph_t *subg;
for (subg = agfstsubg(agroot(g)); subg; subg = agnxtsubg(subg)) {
if (!strncmp(agnameof(subg), "cluster", 7)) {
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
add_cluster(g, subg);
compute_bb(subg);
}
}
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //edge custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //edge custom data
common_init_edge(e);
}
}
for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
if (!strncmp(agnameof(subg), "cluster", 7)) {
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
do_graph_label (subg);
addCluster(clist, subg);
mkClusters(subg, NULL, subg);
if (!out) {
sprintf(name + len, "%" PRISIZE_T, c_cnt);
out = agsubg(g, name,1);
- agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
+ agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data
ccs[c_cnt] = out;
c_cnt++;
pin = true;
continue;
sprintf(name + len, "%" PRISIZE_T, c_cnt);
out = agsubg(g, name,1);
- agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
+ agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data
if (dfs(g, n, out, &stk) == SIZE_MAX) {
error = 1;
goto packerror;
continue;
sprintf(name + len, "%" PRISIZE_T, c_cnt);
out = agsubg(g, name,1);
- agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); //node custom data
+ agbindrec(out, "Agraphinfo_t", sizeof(Agraphinfo_t), true); //node custom data
if (dfs(g, n, out, &stk) == SIZE_MAX) {
freeStk (&stk);
free (ccs);
for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
if (isCluster(subg)) {
dn = agnode(dg, agnameof(subg), 1);
- agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), TRUE);
+ agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), true);
clustOf(dn) = subg;
for (n = agfstnode(subg); n; n = agnxtnode(subg, n)) {
if (dnodeOf(n)) {
if (dnodeOf(n))
continue;
dn = agnode(dg, agnameof(n), 1);
- agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), TRUE);
+ agbindrec (dn, NRECNAME, sizeof(ccgnodeinfo_t), true);
nodeOf(dn) = n;
dnodeSet(n,dn);
}
node_induce(proj, subg);
agcopyattr(subg, proj);
if (isCluster(proj)) {
- op = agbindrec(proj,ORIG_REC, sizeof(orig_t), 0);
+ op = agbindrec(proj,ORIG_REC, sizeof(orig_t), false);
op->orig = subg;
}
}
sprintf(name + len, "%" PRISIZE_T, c_cnt);
dout = agsubg(dg, name, 1);
out = agsubg(g, name, 1);
- agbindrec(out, GRECNAME, sizeof(ccgraphinfo_t), FALSE);
+ agbindrec(out, GRECNAME, sizeof(ccgraphinfo_t), false);
GD_cc_subg(out) = 1;
n_cnt = dfs(dg, dn, dout, &stk);
if (n_cnt == SIZE_MAX) {
#include <neatogen/adjust.h>
#include <pack/pack.h>
#include <neatogen/neatoprocs.h>
+#include <stdbool.h>
/* the following code shamelessly copied from lib/fdpgen/layout.c
and should be extracted and made into a common function */
for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
if (!strncmp(agnameof(subg), "cluster", 7)) {
- agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE);
+ agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true);
#ifdef FDP_GEN
GD_alg(subg) = (void *) NEW(gdata); /* freed in cleanup_subgs */
GD_ndim(subg) = GD_ndim(parent);
static void patchwork_init_edge(edge_t * e)
{
- agbindrec(e, "Agedgeinfo_t", sizeof(Agnodeinfo_t), TRUE); // edge custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agnodeinfo_t), true); // edge custom data
/* common_init_edge(e); */
}
GD_neato_nlist(g) = N_NEW(agnnodes(g) + 1, node_t *);
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
- agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); // node custom data
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); // node custom data
ND_alg(n) = alg + i;
GD_neato_nlist(g)[i++] = n;
patchwork_init_node(n);
static void sfdp_init_edge(edge_t * e)
{
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //node custom data
common_init_edge(e);
}
#include <neatogen/adjust.h>
#include <pack/pack.h>
#include <neatogen/neatoprocs.h>
+#include <stdbool.h>
static void twopi_init_edge(edge_t * e)
{
- agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //edge custom data
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), true); //edge custom data
common_init_edge(e);
ED_factor(e) = late_double(e, E_weight, 1.0, 0.0);
}