Graphviz  2.41.20171026.1811
Data Structures | Macros | Functions
utils.c File Reference
#include "render.h"
#include "agxbuf.h"
#include "htmltable.h"
#include "entities.h"
#include "logic.h"
#include "gvc.h"
#include <ctype.h>
#include <pwd.h>
#include <string.h>
Include dependency graph for utils.c:

Go to the source code of this file.

Data Structures

struct  fontinfo
 
struct  item
 
struct  cl_edge_t
 
struct  clust_t
 

Macros

#define W_DEGREE   5
 
#define PATHSEP   ":"
 
#define MAPC(n)   (strncmp(agnameof(n),"cluster",7)?NULL:findCluster(cmap,agnameof(n)))
 
#define MAXENTLEN   8
 

Functions

nodequeuenew_queue (int sz)
 
void free_queue (nodequeue *q)
 
void enqueue (nodequeue *q, node_t *n)
 
node_tdequeue (nodequeue *q)
 
int late_int (void *obj, attrsym_t *attr, int def, int low)
 
double late_double (void *obj, attrsym_t *attr, double def, double low)
 
double get_inputscale (graph_t *g)
 
char * late_string (void *obj, attrsym_t *attr, char *def)
 
char * late_nnstring (void *obj, attrsym_t *attr, char *def)
 
boolean late_bool (void *obj, attrsym_t *attr, int def)
 
node_tUF_find (node_t *n)
 
node_tUF_union (node_t *u, node_t *v)
 
void UF_remove (node_t *u, node_t *v)
 
void UF_singleton (node_t *u)
 
void UF_setname (node_t *u, node_t *v)
 
pointf coord (node_t *n)
 
pointf Bezier (pointf *V, int degree, double t, pointf *Left, pointf *Right)
 
char * Fgets (FILE *fp)
 
const char * safefile (const char *filename)
 
int maptoken (char *p, char **name, int *val)
 
boolean mapBool (char *p, boolean dflt)
 
boolean mapbool (char *p)
 
pointf dotneato_closest (splines *spl, pointf pt)
 
pointf spline_at_y (splines *spl, double y)
 
pointf neato_closest (splines *spl, pointf p)
 
void gvToggle (int s)
 
int test_toggle ()
 
void common_init_node (node_t *n)
 
int common_init_edge (edge_t *e)
 
boxf polyBB (polygon_t *poly)
 
void updateBB (graph_t *g, textlabel_t *lp)
 
void compute_bb (graph_t *g)
 
int is_a_cluster (Agraph_t *g)
 
Agsym_tsetAttr (graph_t *g, void *obj, char *name, char *value, Agsym_t *ap)
 
void processClusterEdges (graph_t *g)
 
void undoClusterEdges (graph_t *g)
 
attrsym_tsafe_dcl (graph_t *g, int obj_kind, char *name, char *def)
 
char * scanEntity (char *t, agxbuf *xb)
 
char * htmlEntityUTF8 (char *s, graph_t *g)
 
char * latin1ToUTF8 (char *s)
 
char * utf8ToLatin1 (char *s)
 
boolean overlap_node (node_t *n, boxf b)
 
boolean overlap_label (textlabel_t *lp, boxf b)
 
boolean overlap_edge (edge_t *e, boxf b)
 
int edgeType (char *s, int dflt)
 
void setEdgeType (graph_t *g, int dflt)
 
void get_gradient_points (pointf *A, pointf *G, int n, float angle, int flags)
 
int strcasecmp (const char *s1, const char *s2)
 
int strncasecmp (const char *s1, const char *s2, unsigned int n)
 
void gv_free_splines (edge_t *e)
 
void gv_cleanup_edge (edge_t *e)
 
void gv_cleanup_node (node_t *n)
 
void gv_nodesize (node_t *n, boolean flip)
 
double drand48 (void)
 
Dt_tmkClustMap (Agraph_t *g)
 
Agraph_tfindCluster (Dt_t *map, char *name)
 
Agnodeinfo_tninf (Agnode_t *n)
 
Agraphinfo_tginf (Agraph_t *g)
 
Agedgeinfo_teinf (Agedge_t *e)
 

Macro Definition Documentation

#define MAPC (   n)    (strncmp(agnameof(n),"cluster",7)?NULL:findCluster(cmap,agnameof(n)))

Definition at line 1101 of file utils.c.

#define MAXENTLEN   8

Definition at line 1345 of file utils.c.

Referenced by scanEntity().

#define PATHSEP   ":"

Definition at line 336 of file utils.c.

#define W_DEGREE   5

Definition at line 212 of file utils.c.

Referenced by Bezier().

Function Documentation

pointf Bezier ( pointf V,
int  degree,
double  t,
pointf Left,
pointf Right 
)

Definition at line 221 of file utils.c.

References NULL, W_DEGREE, pointf_s::x, and pointf_s::y.

Referenced by bezier_clip(), dotneato_closest(), place_portlabel(), spline_at_y(), and update_bb_bz().

int common_init_edge ( edge_t e)
void common_init_node ( node_t n)
void compute_bb ( graph_t g)
pointf coord ( node_t n)

Definition at line 202 of file utils.c.

References ND_pos, POINTS_PER_INCH, pointf_s::x, and pointf_s::y.

Referenced by compute_bb(), QuadTree_get_supernodes_internal(), and right_of().

node_t* dequeue ( nodequeue q)

Definition at line 58 of file utils.c.

References nodequeue::head, nodequeue::limit, NULL, nodequeue::store, and nodequeue::tail.

Referenced by build_ranks().

pointf dotneato_closest ( splines spl,
pointf  pt 
)

Definition at line 477 of file utils.c.

References Bezier(), DIST2, bezier::list, splines::list, NULL, bezier::size, splines::size, pointf_s::x, and pointf_s::y.

Referenced by addEdgeLabels(), and edgeMidpoint().

double drand48 ( void  )
int edgeType ( char *  s,
int  dflt 
)

Definition at line 1712 of file utils.c.

References agerr(), AGWARN, ET_COMPOUND, ET_CURVED, ET_LINE, ET_NONE, ET_ORTHO, ET_PLINE, ET_SPLINE, and strcasecmp().

Referenced by setEdgeType().

Agedgeinfo_t* einf ( Agedge_t e)

Definition at line 2085 of file utils.c.

References AGDATA.

void enqueue ( nodequeue q,
node_t n 
)

Definition at line 51 of file utils.c.

References nodequeue::limit, nodequeue::store, and nodequeue::tail.

Referenced by build_ranks(), and enqueue_neighbors().

char* Fgets ( FILE *  fp)

Definition at line 282 of file utils.c.

References grealloc().

Referenced by cat_libfile().

Agraph_t* findCluster ( Dt_t map,
char *  name 
)

Definition at line 2074 of file utils.c.

References clust_t::clp, dtmatch, and NULL.

void free_queue ( nodequeue q)

Definition at line 45 of file utils.c.

References nodequeue::store.

Referenced by build_ranks().

void get_gradient_points ( pointf A,
pointf G,
int  n,
float  angle,
int  flags 
)

Definition at line 1827 of file utils.c.

References MAX, max, MIN, pointf_s::x, and pointf_s::y.

double get_inputscale ( graph_t g)

Definition at line 112 of file utils.c.

References agfindgraphattr, late_double(), POINTS_PER_INCH, and PSinputscale.

Referenced by fdp_layout(), and neato_layout().

Agraphinfo_t* ginf ( Agraph_t g)

Definition at line 2084 of file utils.c.

References AGDATA.

void gv_cleanup_edge ( edge_t e)
void gv_cleanup_node ( node_t n)
void gv_free_splines ( edge_t e)

Definition at line 1935 of file utils.c.

References ED_spl, and NULL.

Referenced by gv_cleanup_edge().

void gv_nodesize ( node_t n,
boolean  flip 
)

Definition at line 1970 of file utils.c.

References INCH2PS, ND_height, ND_ht, ND_lw, ND_rw, and ND_width.

Referenced by neato_init_node().

void gvToggle ( int  s)

Definition at line 610 of file utils.c.

References gvToggle().

Referenced by gvToggle(), and main().

char* htmlEntityUTF8 ( char *  s,
graph_t g 
)

Definition at line 1473 of file utils.c.

References agerr(), agnameof(), AGWARN, agxbfree(), agxbinit(), agxbputc, and agxbuse.

Referenced by make_html_label(), and make_label().

int is_a_cluster ( Agraph_t g)

Definition at line 915 of file utils.c.

References agnameof(), Agraph_s::root, and strncasecmp().

boolean late_bool ( void *  obj,
attrsym_t attr,
int  def 
)

Definition at line 137 of file utils.c.

References agxget(), mapbool(), and NULL.

double late_double ( void *  obj,
attrsym_t attr,
double  def,
double  low 
)
int late_int ( void *  obj,
attrsym_t attr,
int  def,
int  low 
)

Definition at line 71 of file utils.c.

References ag_xget, and NULL.

Referenced by common_init_node(), emit_clusters(), fdp_initParams(), and graph_init().

char* late_nnstring ( void *  obj,
attrsym_t attr,
char *  def 
)

Definition at line 129 of file utils.c.

References late_string().

Referenced by common_init_node(), do_graph_label(), emit_clusters(), findAttrColor(), and write_plain().

char* late_string ( void *  obj,
attrsym_t attr,
char *  def 
)

Definition at line 122 of file utils.c.

References agxget().

Referenced by common_init_edge(), emit_graph(), graph_init(), and late_nnstring().

char* latin1ToUTF8 ( char *  s)

Definition at line 1561 of file utils.c.

References agxbfree(), agxbinit(), agxbputc, and agxbuse.

Referenced by make_html_label(), and make_label().

boolean mapBool ( char *  p,
boolean  dflt 
)

Definition at line 454 of file utils.c.

References FALSE, strcasecmp(), and TRUE.

Referenced by init_nop(), mapbool(), and neato_layout().

boolean mapbool ( char *  p)
int maptoken ( char *  p,
char **  name,
int val 
)

Definition at line 443 of file utils.c.

References streq.

Referenced by graph_init().

Dt_t* mkClustMap ( Agraph_t g)

Definition at line 2064 of file utils.c.

References dtopen(), and Dtoset.

Referenced by dot_compoundEdges(), and processClusterEdges().

pointf neato_closest ( splines spl,
pointf  p 
)

Definition at line 602 of file utils.c.

References spline_at_y(), and pointf_s::y.

nodequeue* new_queue ( int  sz)

Definition at line 34 of file utils.c.

References nodequeue::head, nodequeue::limit, N_NEW, NEW, nodequeue::store, and nodequeue::tail.

Referenced by build_ranks().

Agnodeinfo_t* ninf ( Agnode_t n)

Definition at line 2083 of file utils.c.

References AGDATA.

boolean overlap_edge ( edge_t e,
boxf  b 
)

Definition at line 1690 of file utils.c.

References splines::bb, ED_label, ED_spl, FALSE, splines::list, overlap_label(), splines::size, and TRUE.

boolean overlap_label ( textlabel_t lp,
boxf  b 
)

Definition at line 1643 of file utils.c.

References textlabel_t::dimen, boxf::LL, OVERLAP, textlabel_t::pos, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by overlap_edge().

boolean overlap_node ( node_t n,
boxf  b 
)

Definition at line 1626 of file utils.c.

References inside_t::bp, FALSE, boxf::LL, inside_t::n, ND_bb, ND_coord, ND_shape, NULL, OVERLAP, inside_t::s, and boxf::UR.

boxf polyBB ( polygon_t poly)
void processClusterEdges ( graph_t g)
attrsym_t* safe_dcl ( graph_t g,
int  obj_kind,
char *  name,
char *  def 
)

Definition at line 1333 of file utils.c.

References agattr(), and NULL.

Referenced by attach_attrs_and_arrows().

const char* safefile ( const char *  filename)
char* scanEntity ( char *  t,
agxbuf xb 
)

Definition at line 1352 of file utils.c.

References agxbput(), agxbputc, MAXENTLEN, and NR_OF_ENTITIES.

Agsym_t* setAttr ( graph_t g,
void *  obj,
char *  name,
char *  value,
Agsym_t ap 
)

Definition at line 924 of file utils.c.

References agattr(), AGEDGE, AGNODE, agobjkind(), AGRAPH, agxset(), and NULL.

void setEdgeType ( graph_t g,
int  dflt 
)

Definition at line 1802 of file utils.c.

References agget(), edgeType(), ET_NONE, and GD_flags.

Referenced by circo_init_graph(), neato_layout(), sfdp_layout(), and twopi_init_graph().

pointf spline_at_y ( splines spl,
double  y 
)

Definition at line 537 of file utils.c.

References ABS, assert, BETWEEN, Bezier(), bezier::list, splines::list, NULL, bezier::size, splines::size, pointf_s::x, and pointf_s::y.

Referenced by neato_closest().

int strcasecmp ( const char *  s1,
const char *  s2 
)

Definition at line 1896 of file utils.c.

References strcasecmp().

int strncasecmp ( const char *  s1,
const char *  s2,
unsigned int  n 
)

Definition at line 1916 of file utils.c.

int test_toggle ( void  )

Definition at line 618 of file utils.c.

Referenced by move_node().

node_t* UF_find ( node_t n)

Definition at line 146 of file utils.c.

References ND_UF_parent.

Referenced by class1(), class2(), decompose(), UF_setname(), and UF_union().

void UF_remove ( node_t u,
node_t v 
)

Definition at line 181 of file utils.c.

References assert, ND_UF_parent, and ND_UF_size.

void UF_setname ( node_t u,
node_t v 
)

Definition at line 195 of file utils.c.

References assert, ND_UF_parent, ND_UF_size, and UF_find().

Referenced by mark_clusters().

void UF_singleton ( node_t u)

Definition at line 188 of file utils.c.

References ND_ranktype, ND_UF_parent, ND_UF_size, NORMAL, and NULL.

Referenced by mark_clusters().

node_t* UF_union ( node_t u,
node_t v 
)

Definition at line 156 of file utils.c.

References ND_id, ND_UF_parent, ND_UF_size, NULL, and UF_find().

void undoClusterEdges ( graph_t g)
void updateBB ( graph_t g,
textlabel_t lp 
)

Definition at line 842 of file utils.c.

References GD_bb, and GD_flip.

Referenced by addEdgeLabels(), makePortLabels(), and makeSelfArcs().

char* utf8ToLatin1 ( char *  s)

Definition at line 1601 of file utils.c.

References agxbfree(), agxbinit(), agxbputc, and agxbuse.

Referenced by ps_string().