26 # define CGRAPH_API __declspec(dllexport)
28 # define CGRAPH_API __declspec(dllimport)
31 # define CGRAPH_API extern
44 #define NIL(type) ((type)0)
46 #define NILgraph NIL(Agraph_t*)
47 #define NILnode NIL(Agnode_t*)
48 #define NILedge NIL(Agedge_t*)
49 #define NILsym NIL(Agsym_t*)
95 unsigned seq:(
sizeof(unsigned) * 8 - 4);
104 #define AGEDGE AGOUTEDGE
112 #define AGTAG(obj) (((Agobj_t*)(obj))->tag)
113 #define AGTYPE(obj) (AGTAG(obj).objtype)
114 #define AGID(obj) (AGTAG(obj).id)
115 #define AGSEQ(obj) (AGTAG(obj).seq)
116 #define AGATTRWF(obj) (AGTAG(obj).attrwf)
117 #define AGDATA(obj) (((Agobj_t*)(obj))->data)
165 void *(*alloc) (
void *state,
size_t req);
166 void *(*resize) (
void *state,
void *ptr,
size_t old,
size_t req);
167 void (*
free) (
void *state,
void *ptr);
173 long (*
map) (
void *state,
int objtype,
char *
str, IDTYPE *id,
175 long (*
alloc) (
void *state,
int objtype, IDTYPE id);
176 void (*
free) (
void *state,
int objtype, IDTYPE id);
177 char *(*print) (
void *state,
int objtype, IDTYPE id);
283 char *name,
int createflag);
285 IDTYPE
id,
int createflag);
384 #define agnew(g,t) ((t*)agalloc(g,sizeof(t)))
385 #define agnnew(g,n,t) ((t*)agalloc(g,(n)*sizeof(t)))
401 #define AGIN2OUT(e) ((e)-1)
402 #define AGOUT2IN(e) ((e)+1)
403 #define AGOPP(e) ((AGTYPE(e)==AGINEDGE)?AGIN2OUT(e):AGOUT2IN(e))
404 #define AGMKOUT(e) (AGTYPE(e) == AGOUTEDGE? (e): AGIN2OUT(e))
405 #define AGMKIN(e) (AGTYPE(e) == AGINEDGE? (e): AGOUT2IN(e))
406 #define AGTAIL(e) (AGMKIN(e)->node)
407 #define AGHEAD(e) (AGMKOUT(e)->node)
408 #define AGEQEDGE(e,f) (AGMKOUT(e) == AGMKOUT(f))
410 #define agtail(e) AGTAIL(e)
411 #define aghead(e) AGHEAD(e)
412 #define agopp(e) AGOPP(e)
413 #define ageqedge(e,f) AGEQEDGE(e,f)
415 #define TAILPORT_ID "tailport"
416 #define HEADPORT_ID "headport"
428 #define AGHEADPOINTER(g) ((Agnoderef_t*)(g->n_seq->data->hh._head))
429 #define AGRIGHTPOINTER(rep) ((Agnoderef_t*)((rep)->seq_link.right?((void*)((rep)->seq_link.right) - offsetof(Agsubnode_t,seq_link)):0))
430 #define AGLEFTPOINTER(rep) ((Agnoderef_t*)((rep)->seq_link.hl._left?((void*)((rep)->seq_link.hl._left) - offsetof(Agsubnode_t,seq_link)):0))
432 #define FIRSTNREF(g) (agflatten(g,1), AGHEADPOINTER(g))
434 #define NEXTNREF(g,rep) (AGRIGHTPOINTER(rep) == AGHEADPOINTER(g)?0:AGRIGHTPOINTER(rep))
436 #define PREVNREF(g,rep) (((rep)==AGHEADPOINTER(g))?0:(AGLEFTPOINTER(rep)))
438 #define LASTNREF(g) (agflatten(g,1), AGHEADPOINTER(g)?AGLEFTPOINTER(AGHEADPOINTER(g)):0)
439 #define NODEOF(rep) ((rep)->node)
441 #define FIRSTOUTREF(g,sn) (agflatten(g,1), (sn)->out_seq)
442 #define LASTOUTREF(g,sn) (agflatten(g,1), (Agedgeref_t*)dtlast(sn->out_seq))
443 #define FIRSTINREF(g,sn) (agflatten(g,1), (sn)->in_seq)
444 #define NEXTEREF(g,rep) ((rep)->right)
445 #define PREVEREF(g,rep) ((rep)->hl._left)
448 #define AGSNMAIN(sn) ((sn)==(&((sn)->node->mainsub)))
449 #define EDGEOF(sn,rep) (AGSNMAIN(sn)?((Agedge_t*)((unsigned char*)(rep) - offsetof(Agedge_t,seq_link))) : ((Dthold_t*)(rep))->obj)
CGRAPH_API int agdeledge(Agraph_t *g, Agedge_t *arg_e)
void(* agobjupdfn_t)(Agraph_t *g, Agobj_t *obj, void *arg, Agsym_t *sym)
CGRAPH_API void agclean(Agraph_t *g, int kind, char *rec_name)
CGRAPH_API int agobjkind(void *)
CGRAPH_API Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
CGRAPH_API Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
long(* alloc)(void *state, int objtype, IDTYPE id)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, char *value)
struct Agdatadict_s::@3 dict
CGRAPH_API int agdegree(Agraph_t *g, Agnode_t *n, int in, int out)
CGRAPH_API int aghtmlstr(char *)
CGRAPH_API Agmemdisc_t AgMemDisc
CGRAPH_API Agiodisc_t AgIoDisc
CGRAPH_API int agdelnode(Agraph_t *g, Agnode_t *arg_n)
void(* idregister)(void *state, int objtype, void *obj)
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
CGRAPH_API char * agcanonStr(char *str)
struct Agcbdisc_s::@2 edge
CGRAPH_API void agsetfile(char *)
void agflatten(Agraph_t *g, int flag)
CGRAPH_API Agdesc_t Agstrictundirected
CGRAPH_API Agedge_t * agfstin(Agraph_t *g, Agnode_t *n)
int agxset(void *obj, Agsym_t *sym, char *value)
CGRAPH_API Agraph_t * agidsubg(Agraph_t *g, IDTYPE id, int cflag)
agerrlevel_t agseterr(agerrlevel_t lvl)
CGRAPH_API Agnode_t * agprvnode(Agraph_t *g, Agnode_t *n)
CGRAPH_API int agisdirected(Agraph_t *g)
CGRAPH_API long agdelsubg(Agraph_t *g, Agraph_t *sub)
CGRAPH_API int agrelabel(void *obj, char *name)
CGRAPH_API int agisundirected(Agraph_t *g)
CGRAPH_API void agpushdisc(Agraph_t *g, Agcbdisc_t *disc, void *state)
CGRAPH_API Agraph_t * agread(void *chan, Agdisc_t *disc)
CGRAPH_API Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
CGRAPH_API int agdelete(Agraph_t *g, void *obj)
CGRAPH_API Agraph_t * agconcat(Agraph_t *g, void *chan, Agdisc_t *disc)
CGRAPH_API int agwrite(Agraph_t *g, void *chan)
int agerr(agerrlevel_t level, const char *fmt,...)
unsigned char callbacks_enabled
CGRAPH_API int agcallbacks(Agraph_t *g, int flag)
CGRAPH_API Agraph_t * agfstsubg(Agraph_t *g)
CGRAPH_API int agcontains(Agraph_t *, void *)
CGRAPH_API Agraph_t * agroot(void *obj)
CGRAPH_API Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
CGRAPH_API void agreadline(int)
CGRAPH_API Agdesc_t Agundirected
CGRAPH_API Agiddisc_t AgIdDisc
CGRAPH_API void agfree(Agraph_t *g, void *ptr)
CGRAPH_API char * agstrdup_html(Agraph_t *, char *)
CGRAPH_API char * agcanon(char *, int)
char * agget(void *obj, char *name)
CGRAPH_API Agraph_t * agraphof(void *obj)
CGRAPH_API Agraph_t * agnxtsubg(Agraph_t *subg)
CGRAPH_API Agdesc_t Agstrictdirected
CGRAPH_API Agdesc_t Agdirected
CGRAPH_API void * agrealloc(Agraph_t *g, void *ptr, size_t oldsize, size_t size)
CGRAPH_API Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
int agset(void *obj, char *name, char *value)
CGRAPH_API int agcountuniqedges(Agraph_t *g, Agnode_t *n, int in, int out)
CGRAPH_API Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
CGRAPH_API int agisstrict(Agraph_t *g)
Agsym_t * agattrsym(void *obj, char *name)
CGRAPH_API Agraph_t * agmemread(const char *cp)
Dict_t * lookup_by_name[3]
void(* free)(void *state, int objtype, IDTYPE id)
CGRAPH_API int agclose(Agraph_t *g)
CGRAPH_API char * agnameof(void *)
int(* afread)(void *chan, char *buf, int bufsize)
CGRAPH_API Agraph_t * agparent(Agraph_t *g)
void(* close)(void *state)
CGRAPH_API int agrelabel_node(Agnode_t *n, char *newname)
int(* agusererrf)(char *)
void(* free)(void *state, void *ptr)
CGRAPH_API struct _vmalloc_s * agheap(Agraph_t *g)
CGRAPH_API int agstrfree(Agraph_t *, char *)
CGRAPH_API char * agstrdup(Agraph_t *, char *)
long(* map)(void *state, int objtype, char *str, IDTYPE *id, int createflag)
CGRAPH_API Agedge_t * agsubedge(Agraph_t *g, Agedge_t *e, int createflag)
CGRAPH_API Agnode_t * aglstnode(Agraph_t *g)
CGRAPH_API char * agstrcanon(char *, char *)
CGRAPH_API Agnode_t * agfstnode(Agraph_t *g)
CGRAPH_API void aginit(Agraph_t *g, int kind, char *rec_name, int rec_size, int move_to_front)
CGRAPH_API Agrec_t * aggetrec(void *obj, char *name, int move_to_front)
int agsafeset(void *obj, char *name, char *value, char *def)
CGRAPH_API Agsubnode_t * agsubrep(Agraph_t *g, Agnode_t *n)
agusererrf agseterrf(agusererrf newf)
int agcopyattr(void *oldobj, void *newobj)
struct Agcbdisc_s::@2 graph
CGRAPH_API Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
CGRAPH_API int agdelrec(void *obj, char *name)
CGRAPH_API int agpopdisc(Agraph_t *g, Agcbdisc_t *disc)
CGRAPH_API int agnsubg(Agraph_t *g)
CGRAPH_API int agnodebefore(Agnode_t *u, Agnode_t *v)
struct Agcbdisc_s::@2 node
CGRAPH_API void aginternalmapclearlocalnames(Agraph_t *g)
CGRAPH_API int agnnodes(Agraph_t *g)
CGRAPH_API void * agalloc(Agraph_t *g, size_t size)
void agwarningf(const char *fmt,...)
CGRAPH_API Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
CGRAPH_API int agissimple(Agraph_t *g)
CGRAPH_API void * agbindrec(void *obj, char *name, unsigned int size, int move_to_front)
CGRAPH_API Agedge_t * agnxtin(Agraph_t *g, Agedge_t *e)
CGRAPH_API int agnedges(Agraph_t *g)
int(* putstr)(void *chan, const char *str)
CGRAPH_API Agdisc_t AgDefaultDisc
char * agxget(void *obj, Agsym_t *sym)
CGRAPH_API Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
CGRAPH_API char * agstrbind(Agraph_t *g, char *)
CGRAPH_API Agnode_t * agidnode(Agraph_t *g, IDTYPE id, int createflag)
CGRAPH_API Agnode_t * agsubnode(Agraph_t *g, Agnode_t *n, int createflag)
void(* close)(void *state)
void(* agobjfn_t)(Agraph_t *g, Agobj_t *obj, void *arg)
void agerrorf(const char *fmt,...)
CGRAPH_API Agedge_t * agidedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, IDTYPE id, int createflag)