Graphviz 13.0.0~dev.20241212.1010
|
Modules | |
callbacks | |
virtual methods of initialization, modification, and finalization of graph objects | |
subgraphs | |
Files | |
file | graph.c |
file | write.c |
implements agwrite, agcanon, agstrcanon, and agcanonStr | |
Data Structures | |
struct | Agdesc_s |
graph descriptor More... | |
struct | Agdstate_s |
client state (closures) More... | |
struct | Agclos_s |
shared resources for Agraph_s More... | |
struct | Agraph_s |
graph or subgraph More... | |
struct | Agraphinfo_t |
Macros | |
#define | GD_parent(g) (((Agraphinfo_t*)AGDATA(g))->parent) |
#define | GD_level(g) (((Agraphinfo_t*)AGDATA(g))->level) |
#define | GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing) |
#define | GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb) |
#define | GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc) |
#define | GD_cleanup(g) (((Agraphinfo_t*)AGDATA(g))->cleanup) |
#define | GD_dist(g) (((Agraphinfo_t*)AGDATA(g))->dist) |
#define | GD_alg(g) (((Agraphinfo_t*)AGDATA(g))->alg) |
#define | GD_border(g) (((Agraphinfo_t*)AGDATA(g))->border) |
#define | GD_clust(g) (((Agraphinfo_t*)AGDATA(g))->clust) |
#define | GD_dotroot(g) (((Agraphinfo_t*)AGDATA(g))->dotroot) |
#define | GD_comp(g) (((Agraphinfo_t*)AGDATA(g))->comp) |
#define | GD_exact_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->exact_ranksep) |
#define | GD_expanded(g) (((Agraphinfo_t*)AGDATA(g))->expanded) |
#define | GD_flags(g) (((Agraphinfo_t*)AGDATA(g))->flags) |
#define | GD_gui_state(g) (((Agraphinfo_t*)AGDATA(g))->gui_state) |
#define | GD_charset(g) (((Agraphinfo_t*)AGDATA(g))->charset) |
#define | GD_has_labels(g) (((Agraphinfo_t*)AGDATA(g))->has_labels) |
#define | GD_has_images(g) (((Agraphinfo_t*)AGDATA(g))->has_images) |
#define | GD_has_flat_edges(g) (((Agraphinfo_t*)AGDATA(g))->has_flat_edges) |
#define | GD_ht1(g) (((Agraphinfo_t*)AGDATA(g))->ht1) |
#define | GD_ht2(g) (((Agraphinfo_t*)AGDATA(g))->ht2) |
#define | GD_installed(g) (((Agraphinfo_t*)AGDATA(g))->installed) |
#define | GD_label(g) (((Agraphinfo_t*)AGDATA(g))->label) |
#define | GD_leader(g) (((Agraphinfo_t*)AGDATA(g))->leader) |
#define | GD_rankdir2(g) (((Agraphinfo_t*)AGDATA(g))->rankdir) |
#define | GD_rankdir(g) (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3) |
#define | GD_flip(g) (GD_rankdir(g) & 1) |
#define | GD_realrankdir(g) ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2) |
#define | GD_realflip(g) (GD_realrankdir(g) & 1) |
#define | GD_ln(g) (((Agraphinfo_t*)AGDATA(g))->ln) |
#define | GD_maxrank(g) (((Agraphinfo_t*)AGDATA(g))->maxrank) |
#define | GD_maxset(g) (((Agraphinfo_t*)AGDATA(g))->maxset) |
#define | GD_minrank(g) (((Agraphinfo_t*)AGDATA(g))->minrank) |
#define | GD_minset(g) (((Agraphinfo_t*)AGDATA(g))->minset) |
#define | GD_minrep(g) (((Agraphinfo_t*)AGDATA(g))->minrep) |
#define | GD_maxrep(g) (((Agraphinfo_t*)AGDATA(g))->maxrep) |
#define | GD_move(g) (((Agraphinfo_t*)AGDATA(g))->move) |
#define | GD_n_cluster(g) (((Agraphinfo_t*)AGDATA(g))->n_cluster) |
#define | GD_ndim(g) (((Agraphinfo_t*)AGDATA(g))->ndim) |
#define | GD_odim(g) (((Agraphinfo_t*)AGDATA(g))->odim) |
#define | GD_neato_nlist(g) (((Agraphinfo_t*)AGDATA(g))->neato_nlist) |
#define | GD_nlist(g) (((Agraphinfo_t*)AGDATA(g))->nlist) |
#define | GD_nodesep(g) (((Agraphinfo_t*)AGDATA(g))->nodesep) |
#define | GD_rank(g) (((Agraphinfo_t*)AGDATA(g))->rank) |
#define | GD_rankleader(g) (((Agraphinfo_t*)AGDATA(g))->rankleader) |
#define | GD_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->ranksep) |
#define | GD_rn(g) (((Agraphinfo_t*)AGDATA(g))->rn) |
#define | GD_set_type(g) (((Agraphinfo_t*)AGDATA(g))->set_type) |
#define | GD_label_pos(g) (((Agraphinfo_t*)AGDATA(g))->label_pos) |
#define | GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes) |
#define | GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames) |
#define | GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring) |
#define | GD_sum_t(g) (((Agraphinfo_t*)AGDATA(g))->sum_t) |
#define | GD_t(g) (((Agraphinfo_t*)AGDATA(g))->t) |
#define | agfindgraphattr(g, a) (agattr(g,AGRAPH,a,NULL)) |
Typedefs | |
typedef struct Agraph_s | Agraph_t |
graph, subgraph (or hyperedge) | |
typedef struct Agdesc_s | Agdesc_t |
graph descriptor | |
typedef struct Agdstate_s | Agdstate_t |
client state (closures) | |
typedef struct Agclos_s | Agclos_t |
common fields for graph/subgs | |
typedef void(* | agobjfn_t) (Agraph_t *g, Agobj_t *obj, void *arg) |
typedef void(* | agobjupdfn_t) (Agraph_t *g, Agobj_t *obj, void *arg, Agsym_t *sym) |
typedef struct Agraphinfo_t | Agraphinfo_t |
Functions | |
Agraph_t * | agopen (char *name, Agdesc_t desc, Agdisc_t *disc) |
creates a new graph with the given name and kind | |
int | agclose (Agraph_t *g) |
deletes a graph, freeing its associated storage | |
Agraph_t * | agread (void *chan, Agdisc_t *disc) |
constructs a new graph | |
Agraph_t * | agmemread (const char *cp) |
reads a graph from the input string | |
Agraph_t * | agmemconcat (Agraph_t *g, const char *cp) |
void | agsetfile (const char *) |
sets the current file name for subsequent error reporting | |
Agraph_t * | agconcat (Agraph_t *g, void *chan, Agdisc_t *disc) |
merges the file contents with a pre-existing graph | |
int | agwrite (Agraph_t *g, void *chan) |
Return 0 on success, EOF on failure. | |
int | agisdirected (Agraph_t *g) |
int | agisundirected (Agraph_t *g) |
int | agisstrict (Agraph_t *g) |
int | agissimple (Agraph_t *g) |
Variables | |
Agdesc_t | Agdirected |
directed | |
Agdesc_t | Agstrictdirected |
strict directed. A strict graph cannot have multi-edges or self-arcs. | |
Agdesc_t | Agundirected |
undirected | |
Agdesc_t | Agstrictundirected |
strict undirected | |
The functions agisdirected, agisundirected, agisstrict, and agissimple can be used to query if a graph is directed, undirected, strict (at most one edge with a given tail and head), or simple (strict with no loops), respectively.
#define GD_alg | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->alg) |
#define GD_bb | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->bb) |
#define GD_border | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->border) |
#define GD_charset | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->charset) |
#define GD_cleanup | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->cleanup) |
#define GD_clust | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->clust) |
#define GD_comp | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->comp) |
#define GD_dist | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->dist) |
#define GD_dotroot | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->dotroot) |
#define GD_drawing | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->drawing) |
#define GD_exact_ranksep | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->exact_ranksep) |
#define GD_expanded | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->expanded) |
#define GD_flags | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->flags) |
#define GD_flip | ( | g | ) | (GD_rankdir(g) & 1) |
#define GD_fontnames | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->fontnames) |
#define GD_gui_state | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->gui_state) |
#define GD_gvc | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->gvc) |
#define GD_has_flat_edges | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->has_flat_edges) |
#define GD_has_images | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->has_images) |
#define GD_has_labels | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->has_labels) |
#define GD_ht1 | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->ht1) |
#define GD_ht2 | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->ht2) |
#define GD_installed | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->installed) |
#define GD_label | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->label) |
#define GD_label_pos | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->label_pos) |
#define GD_leader | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->leader) |
#define GD_level | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->level) |
#define GD_ln | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->ln) |
#define GD_maxrank | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->maxrank) |
#define GD_maxrep | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->maxrep) |
#define GD_maxset | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->maxset) |
#define GD_minrank | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->minrank) |
#define GD_minrep | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->minrep) |
#define GD_minset | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->minset) |
#define GD_move | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->move) |
#define GD_n_cluster | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->n_cluster) |
#define GD_ndim | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->ndim) |
#define GD_neato_nlist | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->neato_nlist) |
#define GD_nlist | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->nlist) |
#define GD_nodesep | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->nodesep) |
#define GD_odim | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->odim) |
#define GD_parent | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->parent) |
#define GD_rank | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->rank) |
#define GD_rankdir | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3) |
#define GD_rankdir2 | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->rankdir) |
#define GD_rankleader | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->rankleader) |
#define GD_ranksep | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->ranksep) |
#define GD_realflip | ( | g | ) | (GD_realrankdir(g) & 1) |
#define GD_realrankdir | ( | g | ) | ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2) |
#define GD_rn | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->rn) |
#define GD_set_type | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->set_type) |
#define GD_showboxes | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->showboxes) |
#define GD_spring | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->spring) |
#define GD_sum_t | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->sum_t) |
#define GD_t | ( | g | ) | (((Agraphinfo_t*)AGDATA(g))->t) |
typedef struct Agdstate_s Agdstate_t |
typedef struct Agraphinfo_t Agraphinfo_t |
int agclose | ( | Agraph_t * | g | ) |
Definition at line 102 of file graph.c.
References AGCLOS, agclose(), agdelnode(), agdelsubg(), AGDISC, agdtclose(), agfree(), agfreeid(), agfstnode(), agfstsubg(), AGID, aginternalmapclose(), agmethod_delete(), agnxtnode(), agnxtsubg(), agparent(), agpopdisc(), AGRAPH, agraphattr_delete(), agrecclose(), agstrclose(), Agclos_s::cb, Agraph_s::clos, Agraph_s::desc, dtsize(), Agraph_s::e_id, Agraph_s::e_seq, Agcbstack_s::f, FAILURE, free(), Agraph_s::g_id, Agraph_s::g_seq, g_seq2(), Agdesc_s::has_attrs, Agraph_s::n_id, Agraph_s::n_seq, node_set_free(), node_set_is_empty(), and SUCCESS.
Referenced by agclose(), agdelete(), cccomps(), checkLabelOrder(), chkClose(), cleanupCloneGraph(), clear_viewport(), closeDerivedGraph(), closeGraph(), deleteGraph(), deleteObj(), dot2_rank(), freeDerivedGraph(), gvevent_read(), layout_block(), loadGraph(), lockGraph(), main(), main(), main(), mkConstraintG(), process(), process(), processClusterEdges(), processClusters(), remove_pair_edges(), rm(), run_gvpr(), and undoClusterEdges().
Though I/O methods may be overridden, the default is that the channel argument is a stdio FILE pointer. In that case, if any of the streams are wide-oriented, the behavior is undefined.
Definition at line 2281 of file grammar.c.
References aagin, aagparse(), Ag_G_global, AgDefaultDisc, aglexbad(), aglexinit(), Disc, disc, G, G, and NULL.
Referenced by agmemread0(), agread(), and agread().
int agisdirected | ( | Agraph_t * | g | ) |
Definition at line 190 of file graph.c.
References Agraph_s::desc, and Agdesc_s::directed.
Referenced by agisundirected(), arrow_flags(), cloneGraph(), edgecmd_internal(), emit_edge(), getval(), graph_init(), gv_to_gml(), gvToolTred(), initState(), lookup(), main(), main(), make_flat_adj_edges(), make_label(), multicolor(), nameOf(), nameOf(), strdup_and_subst_obj0(), taperfun(), tcldot_layout(), write_edge(), and write_hdr().
int agissimple | ( | Agraph_t * | g | ) |
Definition at line 205 of file graph.c.
References Agraph_s::desc, Agdesc_s::no_loop, and Agdesc_s::strict.
int agisstrict | ( | Agraph_t * | g | ) |
Definition at line 200 of file graph.c.
References Agraph_s::desc, and Agdesc_s::strict.
Referenced by agedge(), dfs(), getval(), lookup(), ok_to_make_edge(), readGraphs(), write_hdr(), write_hdr(), and writeHdr().
int agisundirected | ( | Agraph_t * | g | ) |
Definition at line 195 of file graph.c.
References agisdirected().
Referenced by agedge(), and agidedge().
Definition at line 102 of file io.c.
References agmemread0().
Referenced by graph_init().
Agraph_t * agmemread | ( | const char * | cp | ) |
Definition at line 97 of file io.c.
References agmemread0().
Referenced by readstring().
desc | - graph kind, can be Agdirected, Agundirected, Agstrictdirected or Agstrictundirected. A strict graph cannot have multi-edges or self-arcs. |
disc | - discipline structure which can be used to tailor I/O, memory allocation, and ID allocation. Typically, a NULL value will be used to indicate the default discipline AgDefaultDisc. |
Definition at line 44 of file graph.c.
References agclos(), AGID, agmapnametoid(), agopen1(), AGRAPH, agregister(), AGTYPE, Agraph_s::clos, Agraph_s::desc, Agclos_s::disc, gv_calloc(), Agdisc_s::id, Agdstate_s::id, Agdesc_s::maingraph, Agiddisc_s::open, Agraph_s::root, and Agclos_s::state.
Referenced by agattr(), checkLabelOrder(), circomps(), clone_graph(), cloneGraph(), cloneGraph(), deriveGraph(), deriveGraph(), digraph(), dot2_rank(), dotnew_internal(), graph(), gvplugin_graph(), main(), main(), makeDotGraph(), mkConstraintG(), mkGraph(), mkGraph(), mkNConstraintG(), openG(), process(), process(), startgraph(), startgraph(), strictdigraph(), and strictgraph().
Definition at line 2293 of file grammar.c.
References agconcat(), disc, and NULL.
Referenced by agmemread0(), dflt_read(), dotread(), dotstring(), gvevent_read(), gvNextInputGraph(), init_viewport(), loadGraph(), main(), main(), read(), read(), and readG().
void agsetfile | ( | const char * | f | ) |
Definition at line 2415 of file scan.c.
References InputFile, InputFile, line_num, and line_num.
Referenced by agmemread0(), gvNextInputGraph(), and nextFile().
int agwrite | ( | Agraph_t * | g, |
void * | chan | ||
) |
Definition at line 730 of file write.c.
References AGDISC, agget(), CHKRV, gv_isdigit(), len(), Level, MAX_OUTPUTLINE, Max_outputline, MIN_OUTPUTLINE, NULL, set_attrwf(), write_body(), write_hdr(), and write_trl().
Referenced by clarify(), create_save_subgraph_from_filter(), dot_end_graph(), export_dot(), graphviz_acyclic(), graphviz_tred(), gwrite(), gwrite(), main(), main(), main(), plot_dot_map(), process(), save_graph_with_file_name(), sfioWrite(), visit(), write(), and write().
|
extern |
Definition at line 284 of file graph.c.
Referenced by cloneGraph(), digraph(), dotnew_internal(), gvplugin_graph(), main(), main(), makeDotGraph(), mkGraph(), mkGraph(), process(), and xargs().
|
extern |
Definition at line 285 of file graph.c.
Referenced by checkLabelOrder(), deriveGraph(), dot2_rank(), dotnew_internal(), mkConstraintG(), mkNConstraintG(), and strictdigraph().
|
extern |
Definition at line 287 of file graph.c.
Referenced by circomps(), deriveGraph(), dotnew_internal(), process(), and strictgraph().
|
extern |
Definition at line 286 of file graph.c.
Referenced by cloneGraph(), dotnew_internal(), graph(), makeDotGraph(), mkGraph(), and mkGraph().