#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include "cdt.h"
Include dependency graph for graph.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | Agraph_t |
struct | Agnode_t |
struct | Agedge_t |
struct | Agdata_t |
struct | Agsym_t |
struct | Agdict_t |
struct | Agproto_t |
Defines | |
#define | _GRAPH_H 1 |
#define | TAIL_ID "tailport" |
#define | HEAD_ID "headport" |
#define | AGFLAG_DIRECTED (1<<0) |
#define | AGFLAG_STRICT (1<<1) |
#define | AGFLAG_METAGRAPH (1<<2) |
#define | AGRAPH 0 |
#define | AGRAPHSTRICT (AGRAPH | AGFLAG_STRICT) |
#define | AGDIGRAPH AGFLAG_DIRECTED |
#define | AGDIGRAPHSTRICT (AGDIGRAPH | AGFLAG_STRICT) |
#define | AGMETAGRAPH (AGFLAG_DIRECTED | AGFLAG_STRICT | AGFLAG_METAGRAPH) |
#define | AG_IS_DIRECTED(g) ((g)->kind & AGFLAG_DIRECTED) |
#define | AG_IS_STRICT(g) ((g)->kind & AGFLAG_STRICT) |
#define | AG_IS_METAGRAPH(g) ((g)->kind & AGFLAG_METAGRAPH) |
#define | aginit() aginitlib(sizeof(Agraph_t),sizeof(Agnode_t),sizeof(Agedge_t)) |
#define | agobjkind(p) ((agobjkind_t)(((Agraph_t*)(p))->tag)) |
#define | agmetanode(g) ((g)->meta_node) |
Typedefs | |
typedef Agraph_t | Agraph_t |
typedef Agnode_t | Agnode_t |
typedef Agedge_t | Agedge_t |
typedef Agdict_t | Agdict_t |
typedef Agsym_t | Agsym_t |
typedef Agdata_t | Agdata_t |
typedef Agproto_t | Agproto_t |
typedef char *(*) | gets_f (char *ubuf, int n, FILE *fp) |
Enumerations | |
enum | agerrlevel_t { AGWARN, AGERR, AGMAX, AGPREV } |
enum | agobjkind_t { AGNODE = 1, AGEDGE, AGGRAPH } |
Functions | |
char * | agstrcanon (char *, char *) |
char * | agcanonical (char *) |
int | aghtmlstr (char *s) |
char * | agget (void *, char *) |
char * | agxget (void *, int) |
int | agset (void *, char *, char *) |
int | agsafeset (void *, char *, char *, char *) |
int | agxset (void *, int, char *) |
int | agindex (void *, char *) |
void | aginitlib (int, int, int) |
Agraph_t * | agopen (char *, int) |
Agraph_t * | agsubg (Agraph_t *, char *) |
Agraph_t * | agfindsubg (Agraph_t *, char *) |
void | agclose (Agraph_t *) |
Agraph_t * | agread (FILE *) |
Agraph_t * | agread_usergets (FILE *, gets_f) |
void | agreadline (int) |
void | agsetfile (char *) |
Agraph_t * | agmemread (char *) |
int | agwrite (Agraph_t *, FILE *) |
int | agerrors (void) |
Agraph_t * | agprotograph (void) |
Agraph_t * | agusergraph (Agnode_t *) |
int | agnnodes (Agraph_t *) |
int | agnedges (Agraph_t *) |
void | aginsert (Agraph_t *, void *) |
void | agdelete (Agraph_t *, void *) |
int | agcontains (Agraph_t *, void *) |
Agnode_t * | agnode (Agraph_t *, char *) |
Agsym_t * | agnodeattr (Agraph_t *, char *, char *) |
Agnode_t * | agfindnode (Agraph_t *, char *) |
Agnode_t * | agfstnode (Agraph_t *) |
Agnode_t * | agnxtnode (Agraph_t *, Agnode_t *) |
Agnode_t * | aglstnode (Agraph_t *) |
Agnode_t * | agprvnode (Agraph_t *, Agnode_t *) |
Agedge_t * | agedge (Agraph_t *, Agnode_t *, Agnode_t *) |
Agsym_t * | agedgeattr (Agraph_t *, char *, char *) |
Agedge_t * | agfindedge (Agraph_t *, Agnode_t *, Agnode_t *) |
Agedge_t * | agfstedge (Agraph_t *, Agnode_t *) |
Agedge_t * | agnxtedge (Agraph_t *, Agedge_t *, Agnode_t *) |
Agedge_t * | agfstin (Agraph_t *, Agnode_t *) |
Agedge_t * | agnxtin (Agraph_t *, Agedge_t *) |
Agedge_t * | agfstout (Agraph_t *, Agnode_t *) |
Agedge_t * | agnxtout (Agraph_t *, Agedge_t *) |
Agsym_t * | agraphattr (Agraph_t *, char *, char *) |
Agsym_t * | agfindattr (void *, char *) |
int | agcopyattr (void *, void *) |
void | agseterr (agerrlevel_t) |
char * | aglasterr (void) |
int | agerr (agerrlevel_t level, char *fmt,...) |
void | agerrorf (char *fmt,...) |
void | agwarningf (char *fmt,...) |
char * | agstrdup (char *) |
void | agstrfree (char *) |
Variables | |
agerrlevel_t | agerrno |
#define AG_IS_DIRECTED | ( | g | ) | ((g)->kind & AGFLAG_DIRECTED) |
Definition at line 58 of file graph.h.
Referenced by agedge(), agfindedge(), agwrite(), and arrow_flags().
#define AG_IS_METAGRAPH | ( | g | ) | ((g)->kind & AGFLAG_METAGRAPH) |
Definition at line 60 of file graph.h.
Referenced by agclose(), agDELedge(), agDELnode(), agFREEnode(), and agINSnode().
#define AG_IS_STRICT | ( | g | ) | ((g)->kind & AGFLAG_STRICT) |
#define AGDIGRAPH AGFLAG_DIRECTED |
#define AGDIGRAPHSTRICT (AGDIGRAPH | AGFLAG_STRICT) |
#define AGFLAG_DIRECTED (1<<0) |
#define AGFLAG_STRICT (1<<1) |
#define AGMETAGRAPH (AGFLAG_DIRECTED | AGFLAG_STRICT | AGFLAG_METAGRAPH) |
#define agobjkind | ( | p | ) | ((agobjkind_t)(((Agraph_t*)(p))->tag)) |
Definition at line 204 of file graph.h.
Referenced by circomps(), make_html_label(), and strdup_and_subst_obj().
#define AGRAPHSTRICT (AGRAPH | AGFLAG_STRICT) |
#define HEAD_ID "headport" |
#define TAIL_ID "tailport" |
enum agerrlevel_t |
enum agobjkind_t |
char* agcanonical | ( | char * | ) |
Definition at line 195 of file graphio.c.
References agstrcanon().
Referenced by agwrite(), agwrnode(), and write_plain().
void agclose | ( | Agraph_t * | ) |
Definition at line 343 of file graph.c.
References AG_IS_METAGRAPH, agclose(), agDELnode(), agfstin(), agfstnode(), agfstout(), agnxtin(), agnxtnode(), agnxtout(), agpopproto(), agstrfree(), agusergraph(), Agraph_t::attr, Agdict_t::dict, Agraph_t::didset, dtsize(), FALSE, free(), Agdata_t::globattr, Agnode_t::graph, Agedge_t::head, Agraph_t::meta_node, NULL, Agraph_t::proto, Agraph_t::root, TAG_GRAPH, TAG_OF, TRUE, and Agraph_t::univ.
Referenced by agclose(), agdelete(), agparse(), layout_block(), main(), processClusterEdges(), rm(), and undoClusterEdges().
int agcontains | ( | Agraph_t * | , | |
void * | ||||
) |
Definition at line 398 of file graph.c.
References agidnode(), dtsearch, FALSE, NULL, TAG_EDGE, TAG_GRAPH, TAG_NODE, and TAG_OF.
Referenced by interclexp(), nodeInduce(), and twopi_layout().
int agcopyattr | ( | void * | , | |
void * | ||||
) |
Definition at line 375 of file attribs.c.
References agdictof(), agfindattr(), agxget(), agxset(), Agsym_t::index, KEYX, Agdict_t::list, Agsym_t::name, TAG_EDGE, and TAG_OF.
void agdelete | ( | Agraph_t * | , | |
void * | ||||
) |
Definition at line 426 of file graph.c.
References agclose(), agDELedge(), agDELnode(), TAG_EDGE, TAG_GRAPH, TAG_NODE, and TAG_OF.
Referenced by circoLayout(), circomps(), layout(), main(), neato_layout(), processClusterEdges(), rm(), scan_graph_mode(), twopi_layout(), and undoClusterEdges().
Definition at line 226 of file edge.c.
References AG_IS_DIRECTED, AG_IS_STRICT, agINSedge(), agNEWedge(), Agedge_t::attr, Agproto_t::e, head, Agedge_t::head, KEYX, MUSTPRINT, Agproto_t::n, NOPRINT, NULL, Agedge_t::printkey, Agraph_t::proto, SMALLBUF, and Agedge_t::tail.
Referenced by agINSgraph(), circomps(), edge(), main(), and makeGraphs().
Definition at line 206 of file attribs.c.
References AG, Agproto_t::e, NULL, Agraph_t::proto, AG_s::proto_g, and Agraph_t::root.
Referenced by agsafeset(), attach_attrs_and_arrows(), dotneato_args_initialize(), main(), and setv().
int agerr | ( | agerrlevel_t | level, | |
char * | fmt, | |||
... | ||||
) |
Definition at line 541 of file lexer.c.
Referenced by agDELedge(), agerror(), aginitlib(), aglex(), agstrfree(), allow_edits(), build_ranks(), cat_libfile(), charsetToStr(), checkStart(), common_init_node(), do_graph_label(), epsf_init(), fdp_initParams(), find_intersection(), find_ints(), gvconfig(), gvLayout(), gvloadimage(), gvNextInputGraph(), gvplugin_library_load(), gvRender(), gvrender_set_style(), gvRenderData(), gvRenderFilename(), gvRenderJobs(), htmlEntityUTF8(), htmlerror(), htmllex(), init_nop(), initHTMLlexer(), initial_positions(), install_in_rank(), makePoly(), mark_clusters(), merge_oneway(), neato_layout(), parse_style(), ps_string(), push_obj_state(), routesplinesinit(), safefile(), setEdgeType(), solve_model(), spline_edges0(), stress_majorization_kD_mkernel(), twopi_layout(), and user_pos().
void agerrorf | ( | char * | fmt, | |
... | ||||
) |
int agerrors | ( | void | ) |
Definition at line 90 of file graphio.c.
References AG, and AG_s::syntax_errors.
Referenced by gvFreeContext().
Agsym_t* agfindattr | ( | void * | , | |
char * | ||||
) |
Definition at line 282 of file attribs.c.
References agdictof(), Agdict_t::dict, and dtmatch.
Referenced by agcopyattr(), agindex(), agsafeset(), do_graph_label(), dot_rank(), dot_sameports(), dotneato_args_initialize(), emit_graph(), fdp_init_graph(), fdp_init_node_edge(), fdp_initParams(), findattr(), getv(), graph_init(), init_info(), init_nop(), late_attr(), neato_init_graphn(), neato_init_node_edge(), safe_dcl(), and setv().
Definition at line 59 of file edge.c.
References AG_IS_DIRECTED, head, and NULL.
Referenced by class1(), class2(), diffeq_model(), findedge(), nexthead(), nextsubg(), nextsupg(), and nexttail().
Definition at line 25 of file node.c.
References dtmatch, dtsearch, Agdata_t::node_dict, Agraph_t::nodes, Agraph_t::root, and Agraph_t::univ.
Referenced by agfindsubg(), agnode(), agsubg(), findnode(), main(), makeGraphs(), and twopi_layout().
Definition at line 322 of file graph.c.
References agfindnode(), agusergraph(), Agnode_t::graph, Agraph_t::meta_node, and NULL.
Referenced by agparse(), and findsubg().
Definition at line 107 of file edge.c.
References agfstin(), agfstout(), and NULL.
Referenced by agDELnode(), circuit_model(), dot_sameports(), fdp_cleanup(), firstedge(), interclexp(), and s1().
Definition at line 172 of file edge.c.
References Agedge_t::attr, dtnext, Agedge_t::head, Agraph_t::inedges, NULL, and Agedge_t::tail.
Referenced by agclose(), agfstedge(), agINSnode(), agnxtedge(), agwrnode(), firstin(), firstsupg(), firsttail(), and nextin().
Definition at line 91 of file node.c.
References dtfirst, and Agraph_t::nodes.
Referenced by agclose(), allocate_ranks(), attach_attrs_and_arrows(), build_skeleton(), cAdjust(), ccomps(), circleLayout(), circo_cleanup(), circo_layout(), circomps(), circuit_model(), circularLayout(), class1(), class2(), compoundEdges(), compute_bb(), createBlocktree(), decompose(), dot_cleanup(), dot_compoundEdges(), dot_init_node_edge(), dot_sameports(), dot_scan_ranks(), dumpstat(), emit_clusters(), emit_graph(), expand_ranksets(), fdp_cleanup(), fdp_init_node_edge(), fdp_tLayout(), findCComp(), firstin(), firstnode(), firstout(), init_nop(), interclexp(), isConnected(), layout(), main(), mark_clusters(), mark_lowclusters(), neato_cleanup(), neato_init_node_edge(), neato_set_aspect(), nodeInduce(), normalize(), pccomps(), processClusterEdges(), scAdjust(), scan_graph_mode(), shortest_path(), spline_edges(), splineEdges(), twopi_cleanup(), twopi_layout(), undoClusterEdges(), and write_plain().
Definition at line 147 of file edge.c.
References Agedge_t::attr, dtnext, Agedge_t::head, NULL, Agraph_t::outedges, and Agedge_t::tail.
Referenced by agclose(), agDELedge(), agDELnode(), agfstedge(), agwrnode(), allocate_ranks(), attach_attrs_and_arrows(), build_skeleton(), circo_cleanup(), circomps(), class1(), class2(), compoundEdges(), compute_bb(), dot_cleanup(), dot_compoundEdges(), dot_init_node_edge(), dumpstat(), emit_clusters(), fdp_init_node_edge(), findCComp(), firsthead(), firstout(), firstsubg(), main(), mark_clusters(), mark_lowclusters(), neato_cleanup(), neato_init_node_edge(), neato_layout(), nextout(), nodeInduce(), normalize(), processClusterEdges(), rm(), splineEdges(), twopi_cleanup(), undoClusterEdges(), and write_plain().
char* agget | ( | void * | , | |
char * | ||||
) |
Definition at line 306 of file attribs.c.
References agindex(), and agxget().
Referenced by agwredge(), agwrnode(), attach_attrs_and_arrows(), bind_shape(), common_init_edge(), do_graph_label(), dot_layout(), dot_mincross(), emit_background(), emit_clusters(), emit_html_label(), epsf_init(), expFactor(), fdp_xLayout(), getdouble(), getPack(), getPackMode(), graph_init(), graphAdjustMode(), gvrender_begin_graph(), neatoLayout(), normalize(), rank(), removeOverlap(), scan_graph_mode(), setEdgeType(), setSeed(), splineEdges(), and twopi_layout().
int aghtmlstr | ( | char * | s | ) |
Definition at line 146 of file refstr.c.
Referenced by agstrcanon(), common_init_edge(), common_init_node(), and do_graph_label().
int agindex | ( | void * | , | |
char * | ||||
) |
Definition at line 316 of file attribs.c.
References agfindattr(), and Agsym_t::index.
Referenced by agget(), agset(), and scan_graph_mode().
void aginsert | ( | Agraph_t * | , | |
void * | ||||
) |
Definition at line 411 of file graph.c.
References agINSedge(), agINSgraph(), agINSnode(), TAG_EDGE, TAG_GRAPH, TAG_NODE, and TAG_OF.
Referenced by agparse(), circomps(), and nodeInduce().
Agraph_t* agmemread | ( | char * | ) |
Definition at line 75 of file graphio.c.
References AG, aglexinit(), agparse(), and AG_s::parsed_g.
Referenced by readstring().
int agnedges | ( | Agraph_t * | ) |
Definition at line 446 of file graph.c.
References dtsize(), and Agraph_t::outedges.
Referenced by main(), and scan_graph_mode().
int agnnodes | ( | Agraph_t * | ) |
Definition at line 441 of file graph.c.
References dtsize(), and Agraph_t::nodes.
Referenced by adjustNodes(), cAdjust(), ccomps(), circleLayout(), circo_layout(), circoLayout(), circomps(), circularLayout(), compoundEdges(), fdp_init_node_edge(), fdp_tLayout(), findCComp(), isConnected(), layout(), main(), neato_init_node_edge(), neatoLayout(), pccomps(), processClusterEdges(), removeOverlapAs(), scAdjust(), scan_graph_mode(), and twopi_layout().
Definition at line 42 of file node.c.
References agfindnode(), agINSnode(), agNEWnode(), dtinsert, Agproto_t::n, Agdata_t::node_dict, NULL, Agraph_t::proto, Agraph_t::root, and Agraph_t::univ.
Referenced by agopen(), agsubg(), main(), makeGraphs(), and node().
Definition at line 197 of file attribs.c.
References AG, Agproto_t::n, NULL, Agraph_t::proto, AG_s::proto_g, and Agraph_t::root.
Referenced by agopen(), agsafeset(), attach_attrs_and_arrows(), dotneato_args_initialize(), gvContext(), and setv().
Definition at line 120 of file edge.c.
References agfstin(), dtnext, Agedge_t::head, Agraph_t::inedges, NULL, Agraph_t::outedges, and Agedge_t::tail.
Referenced by agDELnode(), circuit_model(), dot_sameports(), fdp_cleanup(), interclexp(), nextedge(), and s1().
Definition at line 188 of file edge.c.
References dtnext, Agedge_t::head, Agraph_t::inedges, and NULL.
Referenced by agclose(), agINSnode(), nextin(), and nextsupg().
Definition at line 96 of file node.c.
References dtnext, and Agraph_t::nodes.
Referenced by agclose(), allocate_ranks(), attach_attrs_and_arrows(), build_skeleton(), cAdjust(), ccomps(), circo_cleanup(), circomps(), circuit_model(), class1(), class2(), compoundEdges(), compute_bb(), createBlocktree(), decompose(), dot_cleanup(), dot_compoundEdges(), dot_init_node_edge(), dot_sameports(), dot_scan_ranks(), dumpstat(), emit_clusters(), emit_graph(), expand_ranksets(), fdp_cleanup(), fdp_init_node_edge(), fdp_tLayout(), findCComp(), init_nop(), interclexp(), isConnected(), layout(), main(), mark_clusters(), mark_lowclusters(), neato_cleanup(), neato_init_node_edge(), neato_set_aspect(), nextin(), nextnode(), nextout(), nodeInduce(), normalize(), pccomps(), processClusterEdges(), scAdjust(), scan_graph_mode(), shortest_path(), spline_edges(), splineEdges(), twopi_cleanup(), undoClusterEdges(), and write_plain().
Definition at line 163 of file edge.c.
References dtnext, NULL, Agraph_t::outedges, and Agedge_t::tail.
Referenced by agclose(), agDELedge(), agDELnode(), allocate_ranks(), attach_attrs_and_arrows(), build_skeleton(), circo_cleanup(), circomps(), class1(), class2(), compoundEdges(), compute_bb(), dot_cleanup(), dot_compoundEdges(), dot_init_node_edge(), dumpstat(), emit_clusters(), fdp_init_node_edge(), findCComp(), main(), mark_clusters(), mark_lowclusters(), neato_cleanup(), neato_init_node_edge(), neato_layout(), nexthead(), nextout(), nextsubg(), nexttail(), nodeInduce(), processClusterEdges(), rm(), splineEdges(), twopi_cleanup(), undoClusterEdges(), and write_plain().
Agraph_t* agopen | ( | char * | , | |
int | ||||
) |
Definition at line 287 of file graph.c.
References AGMETAGRAPH, agnode(), agnodeattr(), Agnode_t::attr, Agraph_t::meta_node, and NULL.
Referenced by circomps(), digraph(), graph(), main(), sizeArray(), strictdigraph(), and strictgraph().
Agraph_t* agprotograph | ( | void | ) |
Definition at line 165 of file attribs.c.
References AG, and AG_s::proto_g.
Referenced by dotneato_args_initialize().
Definition at line 188 of file attribs.c.
References AG, NULL, AG_s::proto_g, and Agraph_t::root.
Referenced by agsafeset(), attach_attrs_and_arrows(), dotneato_args_initialize(), init_nop(), and setv().
Agraph_t* agread | ( | FILE * | ) |
Definition at line 68 of file graphio.c.
References AG, aglexinit(), agparse(), and AG_s::parsed_g.
Referenced by gvNextInputGraph(), main(), and read().
Definition at line 83 of file graphio.c.
References AG, aglexinit(), agparse(), and AG_s::parsed_g.
Referenced by gvNextInputGraph().
void agreadline | ( | int | ) |
int agsafeset | ( | void * | , | |
char * | , | |||
char * | , | |||
char * | ||||
) |
Definition at line 349 of file attribs.c.
References agedgeattr(), agfindattr(), agnodeattr(), agraphattr(), agxset(), graph(), head, Agsym_t::index, NULL, TAG_EDGE, TAG_GRAPH, TAG_NODE, and TAG_OF.
Referenced by gvLayout().
int agset | ( | void * | , | |
char * | , | |||
char * | ||||
) |
void agseterr | ( | agerrlevel_t | ) |
void agsetfile | ( | char * | ) |
char* agstrcanon | ( | char * | , | |
char * | ||||
) |
char* agstrdup | ( | char * | ) |
Definition at line 73 of file refstr.c.
References dtinsert, dtsearch, malloc(), NULL, offsetof, refstr_t::refcnt, and refstr_t::s.
Referenced by aglex(), agNEWedge(), agNEWnode(), agNEWsym(), agxset(), and emit_once().
void agstrfree | ( | char * | ) |
Definition at line 123 of file refstr.c.
References agerr(), AGERR, dtdelete, dtsearch, free(), NULL, offsetof, and refstr_t::refcnt.
Referenced by agclose(), agFREEedge(), agFREEnode(), agparse(), and agxset().
Definition at line 301 of file graph.c.
References agfindnode(), agINSgraph(), agnode(), agusergraph(), Agnode_t::attr, Agnode_t::graph, Agraph_t::kind, and Agraph_t::meta_node.
Referenced by agparse(), ccomps(), circomps(), findCComp(), graph(), pccomps(), processClusterEdges(), and undoClusterEdges().
Definition at line 282 of file graph.c.
References Agnode_t::attr, Agnode_t::graph, Agraph_t::meta_node, and NULL.
Referenced by agclose(), agDELedge(), agDELnode(), agfindsubg(), agINSnode(), agsubg(), circomps(), findCComp(), firstsubg(), firstsupg(), neato_layout(), nextsubg(), nextsupg(), and rm().
int agwrite | ( | Agraph_t * | , | |
FILE * | ||||
) |
Definition at line 495 of file graphio.c.
References AG_IS_DIRECTED, AG_IS_STRICT, agcanonical(), Agdata_t::edgeattr, Agdata_t::globattr, Agraph_t::name, Agdata_t::nodeattr, and Agraph_t::univ.
char* agxget | ( | void * | , | |
int | ||||
) |
Definition at line 327 of file attribs.c.
References NULL.
Referenced by agcopyattr(), agget(), arrow_flags(), common_init_edge(), common_init_node(), dot_sameports(), doubleattr(), emit_clusters(), late_bool(), late_double(), late_int(), late_string(), nonconstraint_edge(), user_pos(), and write_plain().
int agxset | ( | void * | , | |
int | , | |||
char * | ||||
) |
Definition at line 334 of file attribs.c.
References agstrdup(), agstrfree(), Agraph_t::attr, and Agraph_t::didset.
Referenced by agcopyattr(), agsafeset(), agset(), and attach_attrs_and_arrows().