58#define CGRAPH_API __declspec(dllexport)
60#define CGRAPH_API __declspec(dllimport)
202 unsigned seq : (
sizeof(unsigned) * 8 - 4);
215#define AGTAG(obj) (((Agobj_t *)(obj))->tag)
216#define AGTYPE(obj) (AGTAG(obj).objtype)
220#define AGID(obj) (AGTAG(obj).id)
223#define AGSEQ(obj) (AGTAG(obj).seq)
224#define AGATTRWF(obj) (AGTAG(obj).attrwf)
225#define AGDATA(obj) (((Agobj_t *)(obj))->data)
315 long (*
map)(
void *state,
int objtype,
char *
str,
IDTYPE *
id,
int createflag);
318 char *(*print)(
void *state,
int objtype,
IDTYPE id);
325 int (*
afread)(
void *chan,
char *buf,
int bufsize);
326 int (*
putstr)(
void *chan,
const char *
str);
675CGRAPH_API
int agcopyattr(
void *oldobj,
void *newobj);
684CGRAPH_API
void *
agbindrec(
void *obj,
const char *name,
unsigned int recsize,
690CGRAPH_API
Agrec_t *
aggetrec(
void *obj,
const char *name,
int move_to_front);
693CGRAPH_API
int agdelrec(
void *obj,
const char *name);
696CGRAPH_API
void aginit(
Agraph_t *g,
int kind,
const char *rec_name,
697 int rec_size,
int move_to_front);
711CGRAPH_API
char *
agget(
void *obj,
char *name);
713CGRAPH_API
int agset(
void *obj,
char *name,
const char *value);
714CGRAPH_API
int agxset(
void *obj,
Agsym_t *sym,
const char *value);
715CGRAPH_API
int agsafeset(
void *obj,
char *name,
const char *value,
799#define PRINTF_LIKE(index, first) __attribute__((format(printf, index, first)))
801#define PRINTF_LIKE(index, first)
866#define AGIN2OUT(inedge) ((inedge) - 1)
867#define AGOUT2IN(outedge) \
869#define AGOPP(e) ((AGTYPE(e) == AGINEDGE) ? AGIN2OUT(e) : AGOUT2IN(e))
870#define AGMKOUT(e) (AGTYPE(e) == AGOUTEDGE ? (e) : AGIN2OUT(e))
871#define AGMKIN(e) (AGTYPE(e) == AGINEDGE ? (e) : AGOUT2IN(e))
872#define AGTAIL(e) (AGMKIN(e)->node)
873#define AGHEAD(e) (AGMKOUT(e)->node)
874#define AGEQEDGE(e, f) (AGMKOUT(e) == AGMKOUT(f))
876#define agtail(e) AGTAIL(e)
877#define aghead(e) AGHEAD(e)
880#define ageqedge(e, f) AGEQEDGE(e, f)
882#define TAILPORT_ID "tailport"
883#define HEADPORT_ID "headport"
903#define AGSNMAIN(sn) ((sn) == (&((sn)->node->mainsub)))
904#define EDGEOF(sn, rep) \
906 ? ((Agedge_t *)((unsigned char *)(rep) - offsetof(Agedge_t, seq_link))) \
907 : ((Dthold_t *)(rep))->obj)
935 bool PrintRemovedEdges;
static void out(agerrlevel_t level, const char *fmt, va_list args)
Report messages using a user-supplied or default write function.
#define PRINTF_LIKE(index, first)
int agcountuniqedges(Agraph_t *g, Agnode_t *n, int in, int out)
int agnedges(Agraph_t *g)
int agdegree(Agraph_t *g, Agnode_t *n, int in, int out)
int agnnodes(Agraph_t *g)
void aginternalmapclearlocalnames(Agraph_t *g)
bool graphviz_acyclic(Agraph_t *g, const graphviz_acyclic_options_t *opts, size_t *num_rev)
void graphviz_unflatten(Agraph_t *g, const graphviz_unflatten_options_t *opts)
size_t graphviz_node_induce(Agraph_t *g, Agraph_t *edgeset)
void graphviz_tred(Agraph_t *g, const graphviz_tred_options_t *opts)
programmatic access to tred - transitive reduction
Agsym_t * agattrsym(void *obj, char *name)
looks up a string attribute for a graph object given as an argument
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
int agset(void *obj, char *name, const char *value)
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
permits traversing the list of attributes of a given type
int agxset(void *obj, Agsym_t *sym, const char *value)
char * agget(void *obj, char *name)
int agsafeset(void *obj, char *name, const char *value, const char *def)
ensures the given attribute is declared before setting it locally on an object
char * agxget(void *obj, Agsym_t *sym)
int agcopyattr(void *oldobj, void *newobj)
copies all of the attributes from one object to another
int agpopdisc(Agraph_t *g, Agcbdisc_t *disc)
void agpushdisc(Agraph_t *g, Agcbdisc_t *disc, void *state)
Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Agedge_t * agidedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, IDTYPE id, int createflag)
Agedge_t * agsubedge(Agraph_t *g, Agedge_t *e, int createflag)
int agdeledge(Agraph_t *g, Agedge_t *arg_e)
Agedge_t * agnxtin(Agraph_t *g, Agedge_t *e)
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
Agedge_t * agfstin(Agraph_t *g, Agnode_t *n)
void agwarningf(const char *fmt,...)
void agerrorf(const char *fmt,...)
agerrlevel_t agseterr(agerrlevel_t)
agusererrf agseterrf(agusererrf)
int agerr(agerrlevel_t level, const char *fmt,...)
int(* agusererrf)(char *)
void(* agobjupdfn_t)(Agraph_t *g, Agobj_t *obj, void *arg, Agsym_t *sym)
void(* agobjfn_t)(Agraph_t *g, Agobj_t *obj, void *arg)
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 * agmemconcat(Agraph_t *g, const char *cp)
Agraph_t * agconcat(Agraph_t *g, void *chan, Agdisc_t *disc)
merges the file contents with a pre-existing graph
Agraph_t * agmemread(const char *cp)
reads a graph from the input string
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
creates a new graph with the given name and kind
int agisundirected(Agraph_t *g)
int agwrite(Agraph_t *g, void *chan)
Return 0 on success, EOF on failure.
void agsetfile(const char *)
sets the current file name for subsequent error reporting
Agraph_t * agread(void *chan, Agdisc_t *disc)
constructs a new graph
Agdesc_t Agdirected
directed
Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
int agnodebefore(Agnode_t *u, Agnode_t *v)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agprvnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
Agnode_t * agsubnode(Agraph_t *g, Agnode_t *n, int createflag)
Agnode_t * agidnode(Agraph_t *g, IDTYPE id, int createflag)
Agnode_t * aglstnode(Agraph_t *g)
int agrelabel_node(Agnode_t *n, char *newname)
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)
Agraph_t * agraphof(void *obj)
char * agnameof(void *)
returns a string descriptor for the object.
uint64_t IDTYPE
unique per main graph ID
int agdelete(Agraph_t *g, void *obj)
deletes object. Equivalent to agclose, agdelnode, and agdeledge for obj being a graph,...
int agcontains(Agraph_t *, void *obj)
returns non-zero if obj is a member of (sub)graph
Agraph_t * agroot(void *obj)
Agrec_t * aggetrec(void *obj, const char *name, int move_to_front)
find record in circular list and do optional move-to-front and lock
void aginit(Agraph_t *g, int kind, const char *rec_name, int rec_size, int move_to_front)
attach new records to objects of specified kind
void * agbindrec(void *obj, const char *name, unsigned int recsize, int move_to_front)
attaches a new record of the given size to the object
void agclean(Agraph_t *g, int kind, char *rec_name)
calls agdelrec for all objects of the same class in an entire graph
int agdelrec(void *obj, const char *name)
deletes a named record from one object
int aghtmlstr(const char *)
int agstrfree(Agraph_t *, const char *)
char * agstrcanon(char *, char *)
char * agstrdup(Agraph_t *, const char *)
returns a pointer to a reference-counted copy of the argument string, creating one if necessary
char * agcanon(char *str, int html)
char * agstrbind(Agraph_t *g, const char *)
char * agcanonStr(char *str)
char * agstrdup_html(Agraph_t *, const char *)
Agraph_t * agparent(Agraph_t *g)
Agraph_t * agidsubg(Agraph_t *g, IDTYPE id, int cflag)
Agraph_t * agfstsubg(Agraph_t *g)
Agraph_t * agnxtsubg(Agraph_t *subg)
Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
int agdelsubg(Agraph_t *g, Agraph_t *sub)
textitem scanner parser str
string attribute container
char ** str
the attribute string values indexed by Agsym_s.id
Dict_t * dict
shared dict of Agsym_s to interpret Agattr_s.str
client event callbacks, used in Agcbstack_s
struct Agcbdisc_s::@63 edge
struct Agcbdisc_s::@63 graph
struct Agcbdisc_s::@63 node
shared resources for Agraph_s
Dict_t * lookup_by_name[3]
struct Agdatadict_s::@64 dict
Agrec_t h
< set of dictionaries per graph
object ID allocator discipline
long(* map)(void *state, int objtype, char *str, IDTYPE *id, int createflag)
void(* idregister)(void *state, int objtype, void *obj)
void(* close)(void *state)
void(* free)(void *state, int objtype, IDTYPE id)
long(* alloc)(void *state, int objtype, IDTYPE id)
int(* afread)(void *chan, char *buf, int bufsize)
int(* putstr)(void *chan, const char *str)
a generic header of Agraph_s, Agnode_s and Agedge_s
Agrec_t * data
stores programmer-defined data, access with AGDATA
Agtag_t tag
access with AGTAG
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
implementation of Agrec_t
Agrec_t * next
circular linked list of records
tag in Agobj_s for graphs, nodes, and edges.
unsigned objtype
access with AGTYPE
unsigned mtflock
move-to-front lock, guards Agobj_s::data
options for passing to graphviz_acyclic
options for passing to graphviz_tred
options for passing to graphviz_unflatten