Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
graph.c File Reference
#include <assert.h>
#include <cgraph/alloc.h>
#include <cgraph/cghdr.h>
#include <cgraph/node_set.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
Include dependency graph for graph.c:

Go to the source code of this file.

Functions

static Agclos_tagclos (Agdisc_t *proto)
 
Agraph_tagopen (char *name, Agdesc_t desc, Agdisc_t *arg_disc)
 creates a new graph with the given name and kind
 
Agraph_tagopen1 (Agraph_t *g)
 
int agclose (Agraph_t *g)
 deletes a graph, freeing its associated storage
 
uint64_t agnextseq (Agraph_t *g, int objtype)
 
int agnnodes (Agraph_t *g)
 
int agnedges (Agraph_t *g)
 
int agnsubg (Agraph_t *g)
 
int agisdirected (Agraph_t *g)
 
int agisundirected (Agraph_t *g)
 
int agisstrict (Agraph_t *g)
 
int agissimple (Agraph_t *g)
 
static int cnt (Dict_t *d, Dtlink_t **set)
 
int agcountuniqedges (Agraph_t *g, Agnode_t *n, int want_in, int want_out)
 
int agdegree (Agraph_t *g, Agnode_t *n, int want_in, int want_out)
 
static int agraphseqcmpf (void *arg0, void *arg1)
 
static int agraphidcmpf (void *arg0, void *arg1)
 

Variables

Agraph_tAg_G_global
 
Dtdisc_t Ag_subgraph_seq_disc
 
Dtdisc_t Ag_subgraph_id_disc
 
Agdesc_t Agdirected = {.directed = true, .maingraph = true}
 directed
 
Agdesc_t Agstrictdirected = {.directed = true, .strict = true, .maingraph = true}
 strict directed. A strict graph cannot have multi-edges or self-arcs.
 
Agdesc_t Agundirected = {.maingraph = true}
 undirected
 
Agdesc_t Agstrictundirected = {.strict = true, .maingraph = true}
 strict undirected
 
Agdisc_t AgDefaultDisc = { &AgIdDisc, &AgIoDisc }
 

Function Documentation

◆ agclos()

static Agclos_t * agclos ( Agdisc_t proto)
static

Definition at line 30 of file graph.c.

References AgIdDisc, AgIoDisc, Agclos_s::disc, gv_calloc(), Agdisc_s::id, and Agdisc_s::io.

Referenced by agopen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agnextseq()

uint64_t agnextseq ( Agraph_t g,
int  objtype 
)

Definition at line 153 of file graph.c.

References Agraph_s::clos, and Agclos_s::seq.

Referenced by agidnode(), agnode(), agopen1(), and newedge().

Here is the caller graph for this function:

◆ agopen1()

Agraph_t * agopen1 ( Agraph_t g)

Definition at line 68 of file graph.c.

References Ag_mainedge_id_disc, Ag_mainedge_seq_disc, Ag_subedge_id_disc, Ag_subedge_seq_disc, Ag_subgraph_id_disc, Ag_subgraph_seq_disc, Ag_subnode_seq_disc, agdtopen(), agmethod_init(), agnextseq(), agparent(), AGRAPH, agraphattr_init(), agroot(), AGSEQ, Agraph_s::desc, dtinsert, Dttree, Agraph_s::e_id, Agraph_s::e_seq, Agraph_s::g_id, Agraph_s::g_seq, Agdesc_s::has_attrs, Agraph_s::n_id, Agraph_s::n_seq, node_set_new(), and SEQ_MASK.

Referenced by agopen(), and localsubg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agraphidcmpf()

static int agraphidcmpf ( void *  arg0,
void *  arg1 
)
static

Definition at line 251 of file graph.c.

References AGID.

◆ agraphseqcmpf()

static int agraphseqcmpf ( void *  arg0,
void *  arg1 
)
static

Definition at line 239 of file graph.c.

References AGSEQ.

◆ cnt()

static int cnt ( Dict_t d,
Dtlink_t **  set 
)
static

Definition at line 199 of file graph.c.

References dtextract(), dtrestore(), and dtsize().

Referenced by _agstrcanon(), _printXDot(), _spline_edges(), addEdge(), addEdgeGraphics(), addEdgeGraphics(), addEdgeLabelGraphics(), addEdgeLabelGraphics(), addNodeGraphics(), addNodeGraphics(), addNodeLabelGraphics(), addNodeLabelGraphics(), addXLabels(), agcountuniqedges(), agdegree(), agxbmore(), appendFLineList(), bbox(), bbox(), choose_node(), circomps(), cntOverlaps(), color(), config_extra_args(), countPoints(), dfs(), dot_splines_(), edge_in_layer(), fdp_extra_args(), fillGraph(), findCComp(), firstlayer(), fixLabelOrder(), free_textspan(), genPorts(), get_cycle_centroid(), getFile(), gml_to_gv(), gml_to_gv(), graphviz_tred(), graphviz_unflatten(), gv_fixLocale(), gvdevice_finalize(), improve_antibandwidth_by_swapping(), in_cross(), inflatePts(), initPositions(), isBox(), isConnected(), jsonPolyline(), leave_edge(), main(), make_flat_adj_edges(), make_flat_bottom_edges(), make_flat_edge(), make_regular_edge(), makeSelfArcs(), makeSelfEdge(), makeSimpleFlat(), makeSimpleFlatLabels(), makeXDotSpline(), map_output_bspline(), mkConstraintG(), mkDirlist(), mkStmts(), mkText(), nameOf(), neato_extra_args(), numFields(), out_cross(), overlaps(), parse_layerselect(), parse_reclbl(), parseArgs(), parseXdotwithattrs(), pathscross(), positionChildren(), ppDirective(), ppDirective(), processTbl(), reduce(), rmEquality(), sAdjust(), selfBottom(), selfLeft(), selfRight(), selfTop(), splitBSpline(), storeFileName(), storeFileName(), straight_len(), straight_path(), topsort(), transCopy(), use_library(), vAdjust(), write_dict(), write_nondefault_attrs(), and write_polyline().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ Ag_G_global

◆ Ag_subgraph_id_disc

Dtdisc_t Ag_subgraph_id_disc
Initial value:
= {
.link = offsetof(Agraph_t, id_link),
.comparf = agraphidcmpf,
}
static int agraphidcmpf(void *arg0, void *arg1)
Definition graph.c:251
graph or subgraph
Definition cgraph.h:425

Definition at line 268 of file graph.c.

Referenced by agfindsubg_by_id(), and agopen1().

◆ Ag_subgraph_seq_disc

Dtdisc_t Ag_subgraph_seq_disc
Initial value:
= {
.link = offsetof(Agraph_t, seq_link),
.comparf = agraphseqcmpf,
}
static int agraphseqcmpf(void *arg0, void *arg1)
Definition graph.c:239

Definition at line 263 of file graph.c.

Referenced by agopen1().