/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/common/utils.c File Reference

#include "render.h"
#include "agxbuf.h"
#include "htmltable.h"
#include "entities.h"
#include "ps.h"
#include <unistd.h>
#include <pwd.h>
#include <string.h>
#include <ctype.h>

Include dependency graph for utils.c:

Go to the source code of this file.

Data Structures

struct  fontinfo
struct  item

Defines

#define W_DEGREE   5
#define MAPC(n)   (strncmp((n)->name,"cluster",7)?NULL:agfindsubg((n)->graph, (n)->name))
#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_attr (void *obj, char *name)
int late_int (void *obj, attrsym_t *attr, int def, int low)
double late_double (void *obj, attrsym_t *attr, double def, double low)
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)
point coord (node_t *n)
pointf Bezier (pointf *V, int degree, double t, pointf *Left, pointf *Right)
char * gvUsername (void)
char * safefile (char *filename)
void cat_libfile (FILE *ofp, char **arglib, char **stdlib)
void cat_preamble (GVJ_t *job, char **arglib)
int maptoken (char *p, char **name, int *val)
boolean mapbool (char *p)
point dotneato_closest (splines *spl, point p)
point spline_at_y (splines *spl, int y)
point neato_closest (splines *spl, point p)
void gvToggle (int s)
int test_toggle ()
void common_init_node (node_t *n)
int common_init_edge (edge_t *e)
void updateBB (graph_t *g, textlabel_t *lp)
void compute_bb (graph_t *g)
int processClusterEdges (graph_t *g)
void undoClusterEdges (graph_t *g)
attrsym_tsafe_dcl (graph_t *g, void *obj, char *name, char *def, attrsym_t *(*fun)(Agraph_t *, char *, char *))
char * scanEntity (char *t, agxbuf *xb)
char * htmlEntityUTF8 (char *s)
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)
void setEdgeType (graph_t *g, int dflt)
int strcasecmp (const char *s1, const char *s2)
int strncasecmp (const char *s1, const char *s2, unsigned int n)


Define Documentation

#define MAPC (  )     (strncmp((n)->name,"cluster",7)?NULL:agfindsubg((n)->graph, (n)->name))

Definition at line 1063 of file utils.c.

#define MAXENTLEN   8

Definition at line 1267 of file utils.c.

Referenced by scanEntity().

#define W_DEGREE   5

Definition at line 194 of file utils.c.

Referenced by Bezier().


Function Documentation

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

Definition at line 203 of file utils.c.

References NULL, W_DEGREE, and pointf_s::y.

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

void cat_libfile ( FILE *  ofp,
char **  arglib,
char **  stdlib 
)

Definition at line 399 of file utils.c.

References agerr(), AGWARN, FALSE, safefile(), and TRUE.

Referenced by cat_preamble().

void cat_preamble ( GVJ_t job,
char **  arglib 
)

Definition at line 433 of file utils.c.

References cat_libfile(), GVJ_s::output_file, and ps_txt.

int common_init_edge ( edge_t e  ) 

Definition at line 719 of file utils.c.

References agget(), aghtmlstr(), agxget(), E_headclip, E_headlabel, E_label, E_label_float, E_tailclip, E_taillabel, ED_head_label, ED_head_port, ED_label, ED_label_ontop, ED_tail_label, ED_tail_port, EDGE_LABEL, FALSE, fontinfo::fontcolor, fontinfo::fontname, fontinfo::fontsize, GD_has_labels, Agnode_t::graph, HEAD_ID, HEAD_LABEL, Agsym_t::index, late_string(), LT_HTML, LT_NONE, make_html_label(), make_label(), mapbool(), ND_has_port, ND_shape, NULL, strdup_and_subst_obj(), Agedge_t::tail, TAIL_ID, TAIL_LABEL, and TRUE.

Referenced by neato_init_edge().

void common_init_node ( node_t n  ) 

Definition at line 608 of file utils.c.

References agerr(), aghtmlstr(), AGPREV, agxget(), bind_shape(), DEFAULT_COLOR, DEFAULT_FONTNAME, DEFAULT_FONTSIZE, DEFAULT_NODEHEIGHT, DEFAULT_NODESHAPE, DEFAULT_NODEWIDTH, Agnode_t::graph, Agsym_t::index, late_double(), late_int(), late_nnstring(), LT_HTML, LT_NONE, LT_RECD, make_html_label(), make_label(), MIN_FONTSIZE, MIN_NODEHEIGHT, MIN_NODEWIDTH, N_fontcolor, N_fontname, N_fontsize, N_height, N_label, N_shape, N_showboxes, N_width, ND_height, ND_label, ND_shape, ND_showboxes, ND_width, NODENAME_ESC, NULL, Agraph_t::root, SH_RECORD, shapeOf(), str, and strdup_and_subst_obj().

Referenced by neato_init_node().

void compute_bb ( graph_t g  ) 

Definition at line 851 of file utils.c.

References add_points(), agfstnode(), agfstout(), agnxtnode(), agnxtout(), coord(), ED_label, ED_spl, GD_bb, GD_clust, GD_flip, GD_n_cluster, INT_MAX, box::LL, ND_xsize, ND_ysize, pointof(), sub_points(), box::UR, point::x, and point::y.

Referenced by init_nop(), layout(), neato_layout(), packSubgraphs(), putGraphs(), and spline_edges().

point coord ( node_t n  ) 

Definition at line 185 of file utils.c.

References cvt2pt(), ND_pos, pointf_s::x, and pointf_s::y.

Referenced by compute_bb(), and right_of().

node_t* dequeue ( nodequeue q  ) 

Definition at line 54 of file utils.c.

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

Referenced by build_ranks().

point dotneato_closest ( splines spl,
point  p 
)

Definition at line 460 of file utils.c.

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

void enqueue ( nodequeue q,
node_t n 
)

Definition at line 47 of file utils.c.

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

Referenced by build_ranks(), and enqueue_neighbors().

void free_queue ( nodequeue q  ) 

Definition at line 41 of file utils.c.

References free(), and nodequeue::store.

Referenced by build_ranks().

void gvToggle ( int  s  ) 

Definition at line 595 of file utils.c.

References gvToggle().

Referenced by gvToggle(), and main().

char* gvUsername ( void   ) 

Definition at line 257 of file utils.c.

References agxbinit(), agxbput(), agxbputc, agxbuse, NULL, and SMALLBUF.

Referenced by gvContext(), and main().

char* htmlEntityUTF8 ( char *  s  ) 

Definition at line 1371 of file utils.c.

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

Referenced by size_label().

int late_attr ( void *  obj,
char *  name 
)

Definition at line 68 of file utils.c.

References agfindattr(), and Agsym_t::index.

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

Definition at line 121 of file utils.c.

References agxget(), Agsym_t::index, mapbool(), and NULL.

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

Definition at line 91 of file utils.c.

References agxget(), Agsym_t::index, and NULL.

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

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

Definition at line 77 of file utils.c.

References agxget(), Agsym_t::index, and NULL.

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

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

Definition at line 113 of file utils.c.

References late_string().

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

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

Definition at line 106 of file utils.c.

References agxget(), Agsym_t::index, and NULL.

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

char* latin1ToUTF8 ( char *  s  ) 

Definition at line 1447 of file utils.c.

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

Referenced by size_label().

boolean mapbool ( char *  p  ) 

Definition at line 449 of file utils.c.

References FALSE, NULL, strcasecmp(), and TRUE.

Referenced by common_init_edge(), dot_layout(), dot_mincross(), graph_init(), late_bool(), nonconstraint_edge(), normalize(), and user_pos().

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

Definition at line 438 of file utils.c.

References streq.

Referenced by graph_init().

point neato_closest ( splines spl,
point  p 
)

Definition at line 587 of file utils.c.

References spline_at_y(), and point::y.

nodequeue* new_queue ( int  sz  ) 

Definition at line 30 of file utils.c.

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

Referenced by build_ranks().

boolean overlap_edge ( edge_t e,
boxf  b 
)

Definition at line 1595 of file utils.c.

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

boolean overlap_label ( textlabel_t lp,
boxf  b 
)

Definition at line 1536 of file utils.c.

References textlabel_t::dimen, boxf::LL, textlabel_t::p, boxf::UR, pointf_s::x, point::x, pointf_s::y, and point::y.

Referenced by overlap_edge().

boolean overlap_node ( node_t n,
boxf  b 
)

Definition at line 1514 of file utils.c.

References inside_t::bp, FALSE, boxf::LL, inside_t::n, ND_bb, ND_coord_i, ND_shape, NULL, P2PF, inside_t::s, boxf::UR, pointf_s::x, and pointf_s::y.

int processClusterEdges ( graph_t g  ) 

Definition at line 1137 of file utils.c.

References agclose(), agdelete(), agfstnode(), agfstout(), agnnodes(), agnxtnode(), agnxtout(), agsubg(), agxbfree(), agxbinit(), dtclose(), dtopen(), Dtoset, IS_CLUST_NODE, SET_CLUST_EDGE, and SMALLBUF.

Referenced by fdp_init_node_edge().

attrsym_t* safe_dcl ( graph_t g,
void *  obj,
char *  name,
char *  def,
attrsym_t *(*)(Agraph_t *, char *, char *)  fun 
)

Definition at line 1254 of file utils.c.

References agfindattr(), and NULL.

Referenced by attach_attrs_and_arrows().

char* safefile ( char *  filename  ) 

Definition at line 334 of file utils.c.

References agerr(), AGWARN, FALSE, Gvfilepath, HTTPServerEnVar, NULL, realloc(), str, and TRUE.

Referenced by bind_shape(), cat_libfile(), and epsf_init().

char* scanEntity ( char *  t,
agxbuf xb 
)

Definition at line 1274 of file utils.c.

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

void setEdgeType ( graph_t g,
int  dflt 
)

Definition at line 1627 of file utils.c.

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

Referenced by circo_init_graph(), dot_layout(), fdp_init_graph(), neato_init_graphn(), and twopi_init_graph().

point spline_at_y ( splines spl,
int  y 
)

Definition at line 519 of file utils.c.

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

Referenced by neato_closest().

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

Definition at line 1709 of file utils.c.

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

Definition at line 1728 of file utils.c.

int test_toggle ( void   ) 

Definition at line 603 of file utils.c.

Referenced by move_node().

node_t* UF_find ( node_t n  ) 

Definition at line 129 of file utils.c.

References ND_UF_parent.

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

void UF_remove ( node_t u,
node_t v 
)

Definition at line 164 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 178 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 171 of file utils.c.

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

Referenced by expand_ranksets(), and mark_clusters().

node_t* UF_union ( node_t u,
node_t v 
)

Definition at line 139 of file utils.c.

References Agnode_t::id, ND_UF_parent, ND_UF_size, NULL, and UF_find().

void undoClusterEdges ( graph_t g  ) 

Definition at line 1230 of file utils.c.

References agclose(), agdelete(), agfstnode(), agfstout(), agnxtnode(), agnxtout(), and agsubg().

Referenced by attach_attrs_and_arrows().

void updateBB ( graph_t g,
textlabel_t lp 
)

Definition at line 841 of file utils.c.

References GD_bb, and GD_flip.

Referenced by makeSelfArcs().

char* utf8ToLatin1 ( char *  s  ) 

Definition at line 1488 of file utils.c.

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

Referenced by ps_string().


Generated on Mon Mar 31 19:05:07 2008 for Graphviz by  doxygen 1.5.1