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
typedef unsigned char boolean;
15
typedef int (*qsort_cmpf)(const void*, const void*);
16
typedef int (*bsearch_cmpf) (const void *, const void *);
18
typedef struct Agraph_t graph_t;
19
typedef struct Agnode_t node_t;
20
typedef struct Agedge_t edge_t;
21
typedef struct Agsym_t attrsym_t;
23
typedef struct pointf {
27
typedef struct point {
35
typedef struct port_t { /* internal edge endpoint specification */
36
point p; /* aiming point */
37
float theta; /* slope in radians */
38
boolean constrained,defined;
39
unsigned char order; /* for mincross */
42
typedef struct path { /* internal specification for an edge spline */
44
point *ulpp, *urpp, *llpp, *lrpp; /* tangents of near splines */
45
int nbox; /* number of subdivisions */
46
box *boxes; /* rectangular regions of subdivision */
50
typedef struct bezier {
57
typedef struct splines {
62
typedef struct textline_t {
68
typedef struct textlabel_t {
69
char *text,*fontname,*fontcolor;
77
typedef struct polygon_t { /* mutable shape information for a node */
78
int regular; /* true for symmetric shapes */
79
int peripheries; /* number of periphery lines */
80
int sides; /* number of sides */
81
float orientation; /* orientation of shape (+ve degrees) */
82
float distortion; /* distortion factor - as in trapezium */
83
float skew; /* skew factor - as in parallelogram */
84
int option; /* ROUNDED, DIAGONAL corners, etc. */
85
pointf *vertices; /* array of vertex points */
88
typedef struct shape_desc { /* read-only shape descriptor */
89
char *name; /* as read from graph file */
90
void (*initfn)(node_t *); /* initializes shape from node u.shape_info structure */
91
void (*freefn)(node_t *); /* frees shape from node u.shape_info structure */
92
port_t (*portfn)(node_t *, char *); /* finds aiming point and slope of port */
93
int (*insidefn)(node_t *, pointf, edge_t*); /* clips incident edge spline */
94
int (*pboxfn)(node_t *, edge_t *, int, box *, int *); /* finds box path to reach port */
95
void (*codefn)(node_t *); /* emits graphics code for node */
96
polygon_t *polygon; /* base polygon info */
99
typedef struct codegen_t {
101
void (*begin_job)(FILE *ofp,graph_t *g, char **lib, char *user, char *info[], point pages);
102
void (*end_job)(void);
103
void (*begin_graph)(graph_t* g, box bb, point pb);
104
void (*end_graph)(void);
105
void (*begin_page)(point page, double scale, int rot, point offset);
106
void (*end_page)(void);
107
void (*begin_cluster)(graph_t *),(*end_cluster)(void);
108
void (*begin_nodes)(void),(*end_nodes)(void);
109
void (*begin_edges)(void),(*end_edges)(void);
110
void (*begin_node)(node_t *),(*end_node)(void);
111
void (*begin_edge)(edge_t *),(*end_edge)(void);
112
void (*begin_context)(void),(*end_context)(void);
113
void (*set_font)(char *fontname, double fontsize);
114
void (*textline)(point p, textline_t *str);
115
void (*set_pencolor)(char *name),(*set_fillcolor)(char *name),(*set_style)(char **s);
116
void (*ellipse)(point p, int rx, int ry, int filled);
117
void (*polygon)(point *A, int n, int filled);
118
void (*beziercurve)(point *A, int n, int arrow_at_start, int arrow_at_end);
119
void (*polyline)(point *A,int n);
120
/* void (*arrowhead)(point p, double theta, double scale, int flag); */
121
boolean bezier_has_arrows;
122
void (*user_shape)(char *name, point *A, int sides, int filled);
123
void (*comment)(void* obj, attrsym_t* sym);
124
point (*textsize)(char *str, char *fontname, double fontsz);
127
typedef struct queue {
128
node_t **store,**limit,**head,**tail;
131
typedef struct adjmatrix_t {
136
typedef struct rank_t {
137
int n; /* number of nodes in this rank */
138
node_t **v; /* ordered list of nodes in rank */
139
int an; /* globally allocated number of nodes */
140
node_t **av; /* allocated list of nodes in rank */
141
int ht1,ht2; /* height below/above centerline */
142
int pht1,pht2; /* as above, but only primitive nodes */
143
boolean candidate; /* for transpose () */
145
int cache_nc; /* caches number of crossings */
149
typedef enum engine_e {DOT, NEATO, TWOPI} engine_t;
151
typedef struct layout_t {
152
float quantum,scale,font_scale_adj;
153
point margin, page, size;
154
boolean landscape,centered;
158
/* for "record" shapes */
159
typedef struct field_t {
160
point size; /* its dimension */
161
box b; /* its final placement */
163
textlabel_t *lp; /* n_flds == 0 */
164
struct field_t **fld; /* n_flds > 0 */
165
int LR; /* if box list is horizontal (left to right) */
166
char *id; /* user's identifier */
169
typedef struct hsbcolor_t {
174
/* possible representations of color in color_t */
175
typedef enum color_type_e {HSV_DOUBLE, RGBA_BYTE, RGBA_WORD, CMYK_BYTE} color_type;
177
/* color_t can hold a color spec in a choice or representations */
178
typedef struct color_s {
181
unsigned char rgba[4];
182
unsigned char cmyk[4];
188
typedef struct nlist_t {
193
typedef struct elist {
198
#define elist_fastapp(item,L) do {L.list[L.size++] = item; L.list[L.size] = NULL;} while(0)
199
#define elist_append(item,L) do {L.list = ALLOC(L.size + 2,L.list,edge_t*); L.list[L.size++] = item; L.list[L.size] = NULL;} while(0)
200
#define alloc_elist(n,L) do {L.size = 0; L.list = N_NEW(n + 1,edge_t*); } while (0)
201
#define free_list(L) do {if (L.list) free(L.list);} while (0)
203
typedef struct Agraphinfo_t {
204
/* to generate code */
206
textlabel_t *label; /* if the cluster has a title */
207
box bb; /* bounding box */
208
point border[4]; /* sizes of margins for graph labels */
209
boolean left_to_right,has_edge_labels,has_Latin1char;
210
int ht1,ht2; /* below and above extremal ranks */
214
node_t **neato_nlist;
216
double **dist,**spring,**sum_t,***t;
219
/* to have subgraphs */
224
/* fast graph node list */
226
/* connected components */
227
node_t *minset,*maxset; /* set leaders */
229
/* includes virtual */
230
short minrank,maxrank;
233
boolean has_flat_edges;
237
node_t *ln,*rn; /* left, right nodes of bounding box */
241
node_t *leader,**rankleader;
245
boolean exact_ranksep;
250
typedef struct Agnodeinfo_t {
263
int id,heapindex,hops;
264
double pos[NDIM],dist;
267
boolean showboxes,has_port;
270
char node_type,mark,onstack;
271
char ranktype,weight_class;
273
elist in,out,flat_out,flat_in,other;
276
/* for union-find and collapsing nodes */
279
node_t *inleaf,*outleaf;
281
/* for placing nodes */
282
int rank,order; /* initially, order = 1 for ordered edges */
284
elist save_in,save_out;
286
/* for network-simplex */
287
elist tree_in,tree_out;
297
typedef struct Agedgeinfo_t {
299
port_t tail_port,head_port; /* might be used someday */
300
textlabel_t *label,*head_label,*tail_label;
303
edge_t *to_orig; /* for dot's shapes.c */
312
boolean conc_opp_flag;
315
int cutvalue,tree_index;