Graphviz  2.41.20171026.1811
utils.h
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #ifndef _UTILS_H
15 #define _UTILS_H 1
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 
22 /*visual studio*/
23 #ifdef _WIN32
24 #ifndef GVC_EXPORTS
25 #define extern __declspec(dllimport)
26 #endif
27 #endif
28 /*end visual studio*/
29 
30 #ifndef HAVE_STRCASECMP
31  extern int strcasecmp(const char *s1, const char *s2);
32 #endif
33 #ifndef HAVE_STRNCASECMP
34  extern int strncasecmp(const char *s1, const char *s2, size_t n);
35 #endif
36 
37  extern nodequeue *new_queue(int);
38  extern void free_queue(nodequeue *);
39  extern void enqueue(nodequeue *, Agnode_t *);
40  extern Agnode_t *dequeue(nodequeue *);
41  extern pointf Bezier(pointf *, int, double, pointf *, pointf *);
42  extern void attach_attrs(graph_t * g);
43  extern void attach_attrs_and_arrows(graph_t*, int*, int*);
44  extern char *xml_string(char *str);
45  extern char *xml_string0(char *str, boolean raw);
46  extern void write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend);
47  extern double yDir (double y);
48  extern char *ps_string(char *s, int);
49  extern char *strdup_and_subst_obj(char *str, void *obj);
50  extern char *xml_url_string(char *s);
51  extern void epsf_emit_body(GVJ_t *job, usershape_t *us);
52  extern void epsf_define(GVJ_t * job);
53  extern void undoClusterEdges(graph_t * g);
54  extern Dt_t* mkClustMap (Agraph_t* g);
55  extern Agraph_t* findCluster (Dt_t* map, char* name);
56  extern attrsym_t* safe_dcl(graph_t * g, int obj_kind, char *name, char *def);
57 
58  extern int late_int(void *, Agsym_t *, int, int);
59  extern double late_double(void *, Agsym_t *, double, double);
60  extern char *late_nnstring(void *, Agsym_t *, char *);
61  extern char *late_string(void *, Agsym_t *, char *);
62  extern boolean late_bool(void *, Agsym_t *, int);
63  extern double get_inputscale (graph_t* g);
64 
65  extern Agnode_t *UF_find(Agnode_t *);
66  extern Agnode_t *UF_union(Agnode_t *, Agnode_t *);
67  extern void UF_remove(Agnode_t *, Agnode_t *);
68  extern void UF_singleton(Agnode_t *);
69  extern void UF_setname(Agnode_t *, Agnode_t *);
70 
71  extern char *Fgets(FILE * fp);
72  extern const char *safefile(const char *filename);
73 
74  extern boolean mapBool(char *, boolean);
75  extern boolean mapbool(char *);
76  extern int maptoken(char *, char **, int *);
77 
78  extern boolean findStopColor (char* colorlist, char* clrs[2], float* frac);
79  extern int test_toggle(void);
80 
81  extern void common_init_node(node_t * n);
82  extern int common_init_edge(edge_t * e);
83 
84  extern void updateBB(graph_t * g, textlabel_t * lp);
85  extern void compute_bb(Agraph_t *);
86  extern boxf polyBB (polygon_t* poly);
87  extern boolean overlap_node(node_t *n, boxf b);
88  extern boolean overlap_label(textlabel_t *lp, boxf b);
89  extern boolean overlap_edge(edge_t *e, boxf b);
90 
91  extern void get_gradient_points(pointf * A, pointf * G, int n, float angle, int flags);
92 
93  extern void processClusterEdges(graph_t * g);
94 
95  extern char *latin1ToUTF8(char *);
96  extern char *htmlEntityUTF8(char *, graph_t* g);
97  extern char* utf8ToLatin1 (char* ins);
98  extern char* scanEntity (char* t, agxbuf* xb);
99 
100  extern pointf dotneato_closest(splines * spl, pointf p);
101  extern pointf neato_closest(splines * spl, pointf p);
102  extern pointf spline_at_y(splines * spl, double y);
103 
104  extern Agsym_t *setAttr(graph_t*, void*, char*name, char *value, Agsym_t*);
105  extern void setEdgeType (graph_t* g, int dflt);
106  extern int edgeType (char* s, int dflt);
107  extern int is_a_cluster (Agraph_t* g);
108 
109  /* from postproc.c */
110  extern void gv_nodesize(Agnode_t * n, boolean flip);
111 
112  /* from timing.c */
113  extern void start_timer(void);
114  extern double elapsed_sec(void);
115 
116  /* from psusershape.c */
117  extern void cat_libfile(GVJ_t * job, const char **arglib, const char **stdlib);
118 
122 
123 #ifdef _WIN32
124  extern void fix_fc(void);
125 #endif
126 
127 #undef extern
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif /* _UTILS_H */
void s1(graph_t *, node_t *)
Definition: stuff.c:686
attrsym_t * safe_dcl(graph_t *g, int obj_kind, char *name, char *def)
Definition: utils.c:1333
void start_timer(void)
Definition: timing.c:45
char * latin1ToUTF8(char *s)
Definition: utils.c:1561
Agraphinfo_t * ginf(Agraph_t *g)
Definition: utils.c:2084
Agnodeinfo_t * ninf(Agnode_t *n)
Definition: utils.c:2083
Dt_t * mkClustMap(Agraph_t *g)
Definition: utils.c:2064
Agsym_t * setAttr(graph_t *g, void *obj, char *name, char *value, Agsym_t *ap)
Definition: utils.c:924
char * htmlEntityUTF8(char *s, graph_t *g)
Definition: utils.c:1473
boolean overlap_edge(edge_t *e, boxf b)
Definition: utils.c:1690
char * late_nnstring(void *obj, attrsym_t *attr, char *def)
Definition: utils.c:129
boolean findStopColor(char *colorlist, char *clrs[2], float *frac)
Definition: emit.c:4223
char * xml_url_string(char *s)
Definition: labels.c:572
Definition: types.h:117
void undoClusterEdges(graph_t *g)
Definition: utils.c:1295
Definition: geom.h:28
void common_init_node(node_t *n)
Definition: utils.c:629
void UF_remove(node_t *u, node_t *v)
Definition: utils.c:181
Definition: gvcjob.h:271
void enqueue(nodequeue *q, node_t *n)
Definition: utils.c:51
char * ps_string(char *ins, int chset)
Definition: psusershape.c:269
char * strdup_and_subst_obj(char *str, void *obj)
Definition: labels.c:451
void UF_setname(node_t *u, node_t *v)
Definition: utils.c:195
node_t * UF_find(node_t *n)
Definition: utils.c:146
nodequeue * new_queue(int sz)
Definition: utils.c:34
void write_plain(GVJ_t *job, graph_t *g, FILE *f, boolean extend)
Definition: output.c:113
void attach_attrs_and_arrows(graph_t *g, int *sp, int *ep)
Definition: output.c:232
void epsf_define(GVJ_t *job)
Definition: psusershape.c:221
void cat_libfile(GVJ_t *job, const char **arglib, const char **stdlib)
Definition: psusershape.c:139
char * xml_string(char *s)
Definition: labels.c:485
int strncasecmp(const char *s1, const char *s2, unsigned int n)
Definition: strncasecmp.c:20
int test_toggle()
Definition: utils.c:618
char * scanEntity(char *t, agxbuf *xb)
Definition: utils.c:1352
double yDir(double y)
Definition: output.c:25
char * Fgets(FILE *fp)
Definition: utils.c:282
void compute_bb(graph_t *g)
Definition: utils.c:852
node_t * dequeue(nodequeue *q)
Definition: utils.c:58
boolean mapBool(char *p, boolean dflt)
Definition: utils.c:454
int late_int(void *obj, attrsym_t *attr, int def, int low)
Definition: utils.c:71
Definition: grammar.c:79
void free_queue(nodequeue *q)
Definition: utils.c:45
void UF_singleton(node_t *u)
Definition: utils.c:188
void epsf_emit_body(GVJ_t *job, usershape_t *us)
Definition: psusershape.c:185
double get_inputscale(graph_t *g)
Definition: utils.c:112
const char * safefile(const char *filename)
Definition: utils.c:376
pointf Bezier(pointf *V, int degree, double t, pointf *Left, pointf *Right)
Definition: utils.c:221
Agraph_t * findCluster(Dt_t *map, char *name)
Definition: utils.c:2074
char * utf8ToLatin1(char *s)
Definition: utils.c:1601
double elapsed_sec(void)
Definition: timing.c:50
double late_double(void *obj, attrsym_t *attr, double def, double low)
Definition: utils.c:87
int strcasecmp(const char *s1, const char *s2)
Definition: strcasecmp.c:21
int is_a_cluster(Agraph_t *g)
Definition: utils.c:915
boolean mapbool(char *p)
Definition: utils.c:472
void updateBB(graph_t *g, textlabel_t *lp)
Definition: utils.c:842
int common_init_edge(edge_t *e)
Definition: utils.c:714
Agedgeinfo_t * einf(Agedge_t *e)
Definition: utils.c:2085
void setEdgeType(graph_t *g, int dflt)
Definition: utils.c:1802
void gv_nodesize(node_t *n, boolean flip)
Definition: utils.c:1970
boolean overlap_node(node_t *n, boxf b)
Definition: utils.c:1626
int edgeType(char *s, int dflt)
Definition: utils.c:1712
Definition: cdt.h:99
char * late_string(void *obj, attrsym_t *attr, char *def)
Definition: utils.c:122
agxbuf * str
Definition: htmlparse.c:85
boxf polyBB(polygon_t *poly)
Definition: utils.c:821
Definition: agxbuf.h:34
boolean overlap_label(textlabel_t *lp, boxf b)
Definition: utils.c:1643
void processClusterEdges(graph_t *g)
Definition: utils.c:1192
void attach_attrs(graph_t *g)
Definition: output.c:399
int maptoken(char *p, char **name, int *val)
Definition: utils.c:443
pointf neato_closest(splines *spl, pointf p)
Definition: utils.c:602
pointf dotneato_closest(splines *spl, pointf pt)
Definition: utils.c:477
Definition: geom.h:35
pointf spline_at_y(splines *spl, double y)
Definition: utils.c:537
node_t * UF_union(node_t *u, node_t *v)
Definition: utils.c:156
boolean late_bool(void *obj, attrsym_t *attr, int def)
Definition: utils.c:137
char * xml_string0(char *s, boolean raw)
Definition: labels.c:497
void get_gradient_points(pointf *A, pointf *G, int n, float angle, int flags)
Definition: utils.c:1827