Graphviz 13.0.0~dev.20241212.1010
Loading...
Searching...
No Matches
Collaboration diagram for graphs:

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_tagopen (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_tagread (void *chan, Agdisc_t *disc)
 constructs a new graph
 
Agraph_tagmemread (const char *cp)
 reads a graph from the input string
 
Agraph_tagmemconcat (Agraph_t *g, const char *cp)
 
void agsetfile (const char *)
 sets the current file name for subsequent error reporting
 
Agraph_tagconcat (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
 

Detailed Description

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.

Macro Definition Documentation

◆ agfindgraphattr

#define agfindgraphattr (   g,
 
)    (agattr(g,AGRAPH,a,NULL))

Definition at line 613 of file types.h.

◆ GD_alg

#define GD_alg (   g)    (((Agraphinfo_t*)AGDATA(g))->alg)

Definition at line 358 of file types.h.

◆ GD_bb

#define GD_bb (   g)    (((Agraphinfo_t*)AGDATA(g))->bb)

Definition at line 354 of file types.h.

◆ GD_border

#define GD_border (   g)    (((Agraphinfo_t*)AGDATA(g))->border)

Definition at line 359 of file types.h.

◆ GD_charset

#define GD_charset (   g)    (((Agraphinfo_t*)AGDATA(g))->charset)

Definition at line 367 of file types.h.

◆ GD_cleanup

#define GD_cleanup (   g)    (((Agraphinfo_t*)AGDATA(g))->cleanup)

Definition at line 356 of file types.h.

◆ GD_clust

#define GD_clust (   g)    (((Agraphinfo_t*)AGDATA(g))->clust)

Definition at line 360 of file types.h.

◆ GD_comp

#define GD_comp (   g)    (((Agraphinfo_t*)AGDATA(g))->comp)

Definition at line 362 of file types.h.

◆ GD_dist

#define GD_dist (   g)    (((Agraphinfo_t*)AGDATA(g))->dist)

Definition at line 357 of file types.h.

◆ GD_dotroot

#define GD_dotroot (   g)    (((Agraphinfo_t*)AGDATA(g))->dotroot)

Definition at line 361 of file types.h.

◆ GD_drawing

#define GD_drawing (   g)    (((Agraphinfo_t*)AGDATA(g))->drawing)

Definition at line 353 of file types.h.

◆ GD_exact_ranksep

#define GD_exact_ranksep (   g)    (((Agraphinfo_t*)AGDATA(g))->exact_ranksep)

Definition at line 363 of file types.h.

◆ GD_expanded

#define GD_expanded (   g)    (((Agraphinfo_t*)AGDATA(g))->expanded)

Definition at line 364 of file types.h.

◆ GD_flags

#define GD_flags (   g)    (((Agraphinfo_t*)AGDATA(g))->flags)

Definition at line 365 of file types.h.

◆ GD_flip

#define GD_flip (   g)    (GD_rankdir(g) & 1)

Definition at line 378 of file types.h.

◆ GD_fontnames

#define GD_fontnames (   g)    (((Agraphinfo_t*)AGDATA(g))->fontnames)

Definition at line 402 of file types.h.

◆ GD_gui_state

#define GD_gui_state (   g)    (((Agraphinfo_t*)AGDATA(g))->gui_state)

Definition at line 366 of file types.h.

◆ GD_gvc

#define GD_gvc (   g)    (((Agraphinfo_t*)AGDATA(g))->gvc)

Definition at line 355 of file types.h.

◆ GD_has_flat_edges

#define GD_has_flat_edges (   g)    (((Agraphinfo_t*)AGDATA(g))->has_flat_edges)

Definition at line 370 of file types.h.

◆ GD_has_images

#define GD_has_images (   g)    (((Agraphinfo_t*)AGDATA(g))->has_images)

Definition at line 369 of file types.h.

◆ GD_has_labels

#define GD_has_labels (   g)    (((Agraphinfo_t*)AGDATA(g))->has_labels)

Definition at line 368 of file types.h.

◆ GD_ht1

#define GD_ht1 (   g)    (((Agraphinfo_t*)AGDATA(g))->ht1)

Definition at line 371 of file types.h.

◆ GD_ht2

#define GD_ht2 (   g)    (((Agraphinfo_t*)AGDATA(g))->ht2)

Definition at line 372 of file types.h.

◆ GD_installed

#define GD_installed (   g)    (((Agraphinfo_t*)AGDATA(g))->installed)

Definition at line 373 of file types.h.

◆ GD_label

#define GD_label (   g)    (((Agraphinfo_t*)AGDATA(g))->label)

Definition at line 374 of file types.h.

◆ GD_label_pos

#define GD_label_pos (   g)    (((Agraphinfo_t*)AGDATA(g))->label_pos)

Definition at line 400 of file types.h.

◆ GD_leader

#define GD_leader (   g)    (((Agraphinfo_t*)AGDATA(g))->leader)

Definition at line 375 of file types.h.

◆ GD_level

#define GD_level (   g)    (((Agraphinfo_t*)AGDATA(g))->level)

Definition at line 352 of file types.h.

◆ GD_ln

#define GD_ln (   g)    (((Agraphinfo_t*)AGDATA(g))->ln)

Definition at line 381 of file types.h.

◆ GD_maxrank

#define GD_maxrank (   g)    (((Agraphinfo_t*)AGDATA(g))->maxrank)

Definition at line 382 of file types.h.

◆ GD_maxrep

#define GD_maxrep (   g)    (((Agraphinfo_t*)AGDATA(g))->maxrep)

Definition at line 387 of file types.h.

◆ GD_maxset

#define GD_maxset (   g)    (((Agraphinfo_t*)AGDATA(g))->maxset)

Definition at line 383 of file types.h.

◆ GD_minrank

#define GD_minrank (   g)    (((Agraphinfo_t*)AGDATA(g))->minrank)

Definition at line 384 of file types.h.

◆ GD_minrep

#define GD_minrep (   g)    (((Agraphinfo_t*)AGDATA(g))->minrep)

Definition at line 386 of file types.h.

◆ GD_minset

#define GD_minset (   g)    (((Agraphinfo_t*)AGDATA(g))->minset)

Definition at line 385 of file types.h.

◆ GD_move

#define GD_move (   g)    (((Agraphinfo_t*)AGDATA(g))->move)

Definition at line 388 of file types.h.

◆ GD_n_cluster

#define GD_n_cluster (   g)    (((Agraphinfo_t*)AGDATA(g))->n_cluster)

Definition at line 389 of file types.h.

◆ GD_ndim

#define GD_ndim (   g)    (((Agraphinfo_t*)AGDATA(g))->ndim)

Definition at line 390 of file types.h.

◆ GD_neato_nlist

#define GD_neato_nlist (   g)    (((Agraphinfo_t*)AGDATA(g))->neato_nlist)

Definition at line 392 of file types.h.

◆ GD_nlist

#define GD_nlist (   g)    (((Agraphinfo_t*)AGDATA(g))->nlist)

Definition at line 393 of file types.h.

◆ GD_nodesep

#define GD_nodesep (   g)    (((Agraphinfo_t*)AGDATA(g))->nodesep)

Definition at line 394 of file types.h.

◆ GD_odim

#define GD_odim (   g)    (((Agraphinfo_t*)AGDATA(g))->odim)

Definition at line 391 of file types.h.

◆ GD_parent

#define GD_parent (   g)    (((Agraphinfo_t*)AGDATA(g))->parent)

Definition at line 351 of file types.h.

◆ GD_rank

#define GD_rank (   g)    (((Agraphinfo_t*)AGDATA(g))->rank)

Definition at line 395 of file types.h.

◆ GD_rankdir

#define GD_rankdir (   g)    (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3)

Definition at line 377 of file types.h.

◆ GD_rankdir2

#define GD_rankdir2 (   g)    (((Agraphinfo_t*)AGDATA(g))->rankdir)

Definition at line 376 of file types.h.

◆ GD_rankleader

#define GD_rankleader (   g)    (((Agraphinfo_t*)AGDATA(g))->rankleader)

Definition at line 396 of file types.h.

◆ GD_ranksep

#define GD_ranksep (   g)    (((Agraphinfo_t*)AGDATA(g))->ranksep)

Definition at line 397 of file types.h.

◆ GD_realflip

#define GD_realflip (   g)    (GD_realrankdir(g) & 1)

Definition at line 380 of file types.h.

◆ GD_realrankdir

#define GD_realrankdir (   g)    ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2)

Definition at line 379 of file types.h.

◆ GD_rn

#define GD_rn (   g)    (((Agraphinfo_t*)AGDATA(g))->rn)

Definition at line 398 of file types.h.

◆ GD_set_type

#define GD_set_type (   g)    (((Agraphinfo_t*)AGDATA(g))->set_type)

Definition at line 399 of file types.h.

◆ GD_showboxes

#define GD_showboxes (   g)    (((Agraphinfo_t*)AGDATA(g))->showboxes)

Definition at line 401 of file types.h.

◆ GD_spring

#define GD_spring (   g)    (((Agraphinfo_t*)AGDATA(g))->spring)

Definition at line 403 of file types.h.

◆ GD_sum_t

#define GD_sum_t (   g)    (((Agraphinfo_t*)AGDATA(g))->sum_t)

Definition at line 404 of file types.h.

◆ GD_t

#define GD_t (   g)    (((Agraphinfo_t*)AGDATA(g))->t)

Definition at line 405 of file types.h.

Typedef Documentation

◆ Agclos_t

typedef struct Agclos_s Agclos_t

Definition at line 82 of file cgraph.h.

◆ Agdesc_t

typedef struct Agdesc_s Agdesc_t

Definition at line 80 of file cgraph.h.

◆ Agdstate_t

typedef struct Agdstate_s Agdstate_t

Definition at line 81 of file cgraph.h.

◆ agobjfn_t

typedef void(* agobjfn_t) (Agraph_t *g, Agobj_t *obj, void *arg)

Definition at line 369 of file cgraph.h.

◆ agobjupdfn_t

typedef void(* agobjupdfn_t) (Agraph_t *g, Agobj_t *obj, void *arg, Agsym_t *sym)

Definition at line 370 of file cgraph.h.

◆ Agraph_t

typedef struct Agraph_s Agraph_t

Definition at line 79 of file cgraph.h.

◆ Agraphinfo_t

typedef struct Agraphinfo_t Agraphinfo_t

Function Documentation

◆ agclose()

◆ agconcat()

Agraph_t * agconcat ( Agraph_t g,
void *  chan,
Agdisc_t disc 
)

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().

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

◆ agisdirected()

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().

Here is the caller graph for this function:

◆ agissimple()

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.

◆ agisstrict()

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().

Here is the caller graph for this function:

◆ agisundirected()

int agisundirected ( Agraph_t g)

Definition at line 195 of file graph.c.

References agisdirected().

Referenced by agedge(), and agidedge().

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

◆ agmemconcat()

Agraph_t * agmemconcat ( Agraph_t g,
const char *  cp 
)

Definition at line 102 of file io.c.

References agmemread0().

Referenced by graph_init().

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

◆ agmemread()

Agraph_t * agmemread ( const char *  cp)

Definition at line 97 of file io.c.

References agmemread0().

Referenced by readstring().

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

◆ agopen()

Agraph_t * agopen ( char *  name,
Agdesc_t  desc,
Agdisc_t disc 
)
Parameters
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().

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

◆ agread()

Agraph_t * agread ( void *  chan,
Agdisc_t disc 
)

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().

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

◆ agsetfile()

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().

Here is the caller graph for this function:

◆ agwrite()

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().

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

Variable Documentation

◆ Agdirected

Agdesc_t Agdirected
extern

◆ Agstrictdirected

Agdesc_t Agstrictdirected
extern

◆ Agstrictundirected

Agdesc_t Agstrictundirected
extern

Definition at line 287 of file graph.c.

Referenced by circomps(), deriveGraph(), dotnew_internal(), process(), and strictgraph().

◆ Agundirected

Agdesc_t Agundirected
extern

Definition at line 286 of file graph.c.

Referenced by cloneGraph(), dotnew_internal(), graph(), makeDotGraph(), mkGraph(), and mkGraph().