2
This software may only be used by you under license from AT&T Corp.
3
("AT&T"). A copy of AT&T's Source Code Agreement is available at
4
AT&T's Internet website having the URL:
5
<http://www.research.att.com/sw/tools/graphviz/license/source.html>
6
If you received this software without first entering into a license
7
with AT&T, you have an infringing copy of this software and cannot use
8
it without violating AT&T's intellectual property rights.
13
#ifndef ATT_GRAPHPVT_H
14
#define ATT_GRAPHPVT_H 1
29
#define streq(s,t) ((*s == *t) && !strcmp((s),(t)))
34
#define offsetof(typ,fld) ((int)(&(((typ*)0)->fld)))
35
#define NOTUSED(var) (void) var
37
#define NILgraph NIL(Agraph_t*)
38
#define NILnode NIL(Agnode_t*)
39
#define NILedge NIL(Agedge_t*)
40
#define NILsym NIL(Agsym_t*)
41
#define NILstr NIL(char*)
43
#define MAX_OUTPUTLINE 80
46
#define LOCALNAMEPREFIX '%'
48
#define AGDISC(g,d) ((g)->clos->disc.d)
49
#define AGCLOS(g,d) ((g)->clos->state.d)
50
#define AGNEW(g,t) ((t*)(agalloc(g,sizeof(t))))
52
/* functional definitions */
53
typedef Agobj_t *(*agobjsearchfn_t)(Agraph_t *g, Agobj_t *obj);
54
int agapply(Agraph_t *g, Agobj_t* obj, agobjfn_t fn, void *arg, int preorder);
56
/* global variables */
57
EXTERN Agraph_t *Ag_G_global;
59
/* set ordering disciplines */
60
extern Dtdisc_t Ag_obj_id_disc;
61
extern Dtdisc_t Ag_obj_seq_disc;
62
extern Dtdisc_t Ag_edge_disc;
63
extern Agcbdisc_t AgAttrdisc;
65
/* default resource disciplines */
66
extern Agmemdisc_t AgMemDisc;
67
extern Agiddisc_t AgIdDisc;
68
extern Agiodisc_t AgIoDisc;
72
void agnotflat(Agraph_t *g);
73
void agflatten_edges(Agraph_t *g, Agnode_t *n);
75
/* internal constructor of graphs and subgraphs */
76
Agraph_t *agopen1(Agraph_t *g);
77
void agstrclose(Agraph_t *g);
79
/* object set management */
80
Agnode_t *agfindnode_by_id(Agraph_t *g, unsigned long id);
81
Dtcompar_f agdictorder(Agraph_t*, Dict_t*, Dtcompar_f);
82
int agobjidcmpf(Dict_t *d, void*, void*, Dtdisc_t *disc);
83
int agnamecmpf(Dict_t *d, void*, void*, Dtdisc_t *disc);
84
void agset_node_disc(Agraph_t *g, Dtdisc_t *disc);
85
unsigned long agnextseq(Agraph_t *g, int objtype);
87
/* dict helper functions */
88
Dict_t *agdtopen(Agraph_t *g, Dtdisc_t *disc, Dtmethod_t *method);
89
void agdtdisc(Agraph_t *g, Dict_t *dict, Dtdisc_t *disc);
90
long agdtdelete(Agraph_t *g, Dict_t *dict, void *obj);
91
void agdtclose(Agraph_t *g, Dict_t *dict);
92
void *agdictobjmem(Dict_t *dict, Void_t *p, size_t size, Dtdisc_t *disc);
93
void agdictobjfree(Dict_t *dict, Void_t *p, Dtdisc_t *disc);
94
void *agrealbindrec(void *obj, char *name, unsigned int size, int mtf, int norecur);
96
/* name-value pair operations */
97
Agdatadict_t *agdatadict(Agraph_t *g);
98
Agattr_t *agattrrec(void *obj);
100
void agraphattr_init(Agraph_t *g, int norecur);
101
void agraphattr_delete(Agraph_t *g);
102
void agnodeattr_init(Agnode_t *n, int norecur);
103
void agnodeattr_delete(Agnode_t *n);
104
void agedgeattr_init(Agedge_t *e, int norecur);
105
void agedgeattr_delete(Agedge_t *e);
107
/* parsing and lexing graph files */
109
void agyyerror(char*);
110
void aglexinit(Agdisc_t *disc, void *ifile);
115
int agmapnametoid(Agraph_t *g, int objtype, char *str, unsigned long *result, int allocflag);
116
int agallocid(Agraph_t *g, int objtype, unsigned long request);
117
void agfreeid(Agraph_t *g, int objtype, unsigned long id);
118
char *agprintid(Agobj_t *obj);
119
int aginternalmaplookup(Agraph_t *g, int objtype, char *str, unsigned long *result);
120
void aginternalmapinsert(Agraph_t *g, int objtype, char *str, unsigned long result);
121
char *aginternalmapprint(Agraph_t *g, int objtype, unsigned long id);
122
int aginternalmapdelete(Agraph_t *g, int objtype, unsigned long id);
123
void aginternalmapclose(Agraph_t *g);
125
/* internal set operations */
126
void agedgesetop(Agraph_t *g, Agedge_t *e, int insertion);
127
void agdelnodeimage(Agnode_t *node, void *ignored);
129
long agdelsubg(Agraph_t *g, Agraph_t *sub);
130
int agdelnode(Agnode_t *arg_n);
131
int agdeledge(Agedge_t *arg_e);
132
int agrename_node(Agnode_t *arg_n, char *newname);
133
void agrecclose(Agobj_t *obj);
135
void agmethod_init(Agraph_t *g, void *obj);
136
void agmethod_upd(Agraph_t *g, void *obj, Agsym_t *sym);
137
void agmethod_delete(Agraph_t *g, void *obj);
139
#define CB_INITIALIZE 100
140
#define CB_UPDATE 101
141
#define CB_DELETION 102
142
void agsyspushdisc(Agraph_t *g, Agcbdisc_t *cb, void *state, int stack);
143
int agsyspopdisc(Agraph_t *g, Agcbdisc_t *cb, int stack);
144
void agrecord_callback(Agobj_t *obj, int kind, Agsym_t *optsym);
145
void aginitcb(void *obj, Agcbstack_t *disc);
146
void agupdcb(void *obj, Agsym_t *sym, Agcbstack_t *disc);
147
void agdelcb(void *obj, Agcbstack_t *disc);
149
#endif /* ATT_GRAPHPVT_H */