87 assert((seq &
SEQ_MASK) == seq &&
"sequence ID overflow");
90 Agraphs_append(
g_seq2(par), g);
109 for (subg =
agfstsubg(g); subg; subg = next_subg) {
134 assert(Agraphs_is_empty(
g_seq2(g)));
166 return ++(g->
clos->
seq[objtype]);
231 if (e->
node != n) rv++;
Memory allocation wrappers that exit on failure.
static void * gv_realloc(void *ptr, size_t old_size, size_t new_size)
static void * gv_calloc(size_t nmemb, size_t size)
CDT_API Dtlink_t * dtextract(Dt_t *)
CDT_API int dtsize(Dt_t *)
CDT_API Dtmethod_t * Dttree
CDT_API int dtrestore(Dt_t *, Dtlink_t *)
void agfreeid(Agraph_t *g, int objtype, IDTYPE id)
int agstrclose(Agraph_t *g)
void aginternalmapclose(Agraph_t *g)
void agrecclose(Agobj_t *obj)
Dtdisc_t Ag_subnode_seq_disc
int agmapnametoid(Agraph_t *g, int objtype, char *str, IDTYPE *result, bool createflag)
Dict_t * agdtopen(Agraph_t *g, Dtdisc_t *disc, Dtmethod_t *method)
static Agraphs_t * g_seq2(Agraph_t *g)
Dtdisc_t Ag_subedge_seq_disc
Dtdisc_t Ag_mainedge_seq_disc
void agregister(Agraph_t *g, int objtype, void *obj)
Dtdisc_t Ag_subedge_id_disc
Dtdisc_t Ag_mainedge_id_disc
int agdtclose(Agraph_t *g, Dict_t *dict)
void node_set_free(node_set_t **self)
size_t node_set_size(const node_set_t *self)
node_set_t * node_set_new(void)
static int agraphidcmpf(void *arg0, void *arg1)
static int cnt(Dict_t *d, Dtlink_t **set)
static Agclos_t * agclos(Agdisc_t *proto)
Agraph_t * agopen1(Agraph_t *g)
uint64_t agnextseq(Agraph_t *g, int objtype)
static int agraphseqcmpf(void *arg0, void *arg1)
Dtdisc_t Ag_subgraph_seq_disc
Dtdisc_t Ag_subgraph_id_disc
int agcountuniqedges(Agraph_t *g, Agnode_t *n, int want_in, int want_out)
int agnedges(Agraph_t *g)
int agdegree(Agraph_t *g, Agnode_t *n, int want_in, int want_out)
int agnnodes(Agraph_t *g)
void agraphattr_init(Agraph_t *g)
int agraphattr_delete(Agraph_t *g)
int agpopdisc(Agraph_t *g, Agcbdisc_t *disc)
void agmethod_delete(Agraph_t *g, void *obj)
void agmethod_init(Agraph_t *g, void *obj)
Agedge_t * agnxtin(Agraph_t *g, Agedge_t *e)
Agedge_t * agfstin(Agraph_t *g, Agnode_t *n)
Agdesc_t Agundirected
undirected
int agisdirected(Agraph_t *g)
Agdesc_t Agstrictundirected
strict undirected
int agclose(Agraph_t *g)
deletes a graph, freeing its associated storage
int agisstrict(Agraph_t *g)
int agissimple(Agraph_t *g)
Agdesc_t Agstrictdirected
strict directed. A strict graph cannot have multi-edges or self-arcs.
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *arg_disc)
creates a new graph with the given name and kind
int agisundirected(Agraph_t *g)
Agdesc_t Agdirected
directed
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
int agdelnode(Agraph_t *g, Agnode_t *arg_n)
removes a node from a graph or subgraph.
Agsubnode_t * agsubrep(Agraph_t *g, Agnode_t *n)
#define AGID(obj)
returns the unique integer ID associated with the object
uint64_t IDTYPE
unique per main graph ID
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
Agraph_t * agroot(void *obj)
Agraph_t * agparent(Agraph_t *g)
Agraph_t * agfstsubg(Agraph_t *g)
Agraph_t * agnxtsubg(Agraph_t *subg)
int agdelsubg(Agraph_t *g, Agraph_t *sub)
unordered set of Agsubnode_t *
static bool node_set_is_empty(const node_set_t *self)
shared resources for Agraph_s
void *(* open)(Agraph_t *g, Agdisc_t *)
a generic header of Agraph_s, Agnode_s and Agedge_s
struct graphviz_node_set * n_id
the node set indexed by ID
Agraph_t * root
subgraphs - ancestors
Dict_t * g_id
subgraphs - descendants
Dict_t * n_seq
the node set in sequence
Agclos_t * clos
shared resources
Dict_t * e_id
holders for edge sets