Graphviz 14.1.5~dev.20260409.1203
Loading...
Searching...
No Matches
cghdr.h File Reference

cgraph.h additions More...

#include "config.h"
#include <cgraph.h>
#include <ctype.h>
#include <sys/types.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
Include dependency graph for cghdr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SUCCESS   0
 
#define FAILURE   -1
 
#define LOCALNAMEPREFIX   '%'
 
#define AGDISC(g, d)   ((g)->clos->disc.d)
 
#define AGCLOS(g, d)   ((g)->clos->state.d)
 

Typedefs

typedef Agobj_t *(* agobjsearchfn_t) (Agraph_t *g, Agobj_t *obj)
 
typedef void * aagscan_t
 
typedef struct aagextra_s aagextra_t
 

Enumerations

enum  { SEQ_MASK = (1 << (sizeof(unsigned) * 8 - 4)) - 1 }
 Mask of Agtag_s.seq width. More...
 

Functions

int agapply (Agraph_t *g, Agobj_t *obj, agobjfn_t fn, void *arg, int preorder)
 
Agraph_tagopen1 (Agraph_t *g)
 
int agstrclose (Agraph_t *g)
 
Agnode_tagfindnode_by_id (Agraph_t *g, IDTYPE id)
 
uint64_t agnextseq (Agraph_t *g, int objtype)
 
Dict_tagdtopen (Dtdisc_t *disc, Dtmethod_t *method)
 
void agdtdisc (Agraph_t *g, Dict_t *dict, Dtdisc_t *disc)
 
int agdtdelete (Agraph_t *g, Dict_t *dict, void *obj)
 
int agdtclose (Agraph_t *g, Dict_t *dict)
 
Agdatadict_tagdatadict (Agraph_t *g, bool cflag)
 
Agattr_tagattrrec (void *obj)
 
void agraphattr_init (Agraph_t *g)
 
int agraphattr_delete (Agraph_t *g)
 
void agnodeattr_init (Agraph_t *g, Agnode_t *n)
 
void agnodeattr_delete (Agnode_t *n)
 
void agedgeattr_init (Agraph_t *g, Agedge_t *e)
 
void agedgeattr_delete (Agedge_t *e)
 
int aaglex_init_extra (aagextra_t *user_defined, aagscan_t *scanner)
 
int aaglex_destroy (aagscan_t)
 
aagextra_taagget_extra (aagscan_t yyscanner)
 
void aagset_in (FILE *, aagscan_t)
 
int aagparse (aagscan_t scanner)
 
void aglexeof (aagscan_t yyscanner)
 
void aglexbad (aagscan_t yyscanner)
 
int agmapnametoid (Agraph_t *g, int objtype, char *str, IDTYPE *result, bool createflag)
 
void agfreeid (Agraph_t *g, int objtype, IDTYPE id)
 
char * agprintid (Agobj_t *obj)
 
bool aginternalmaplookup (Agraph_t *g, int objtype, char *str, IDTYPE *result)
 
void aginternalmapinsert (Agraph_t *g, int objtype, char *str, IDTYPE result)
 
char * aginternalmapprint (Agraph_t *g, int objtype, IDTYPE id)
 
int aginternalmapdelete (Agraph_t *g, int objtype, IDTYPE id)
 
void aginternalmapclose (Agraph_t *g)
 
void agregister (Agraph_t *g, int objtype, void *obj)
 
void agedgesetop (Agraph_t *g, Agedge_t *e, int insertion)
 
void agdelnodeimage (Agraph_t *g, Agobj_t *node, void *ignored)
 
void agdeledgeimage (Agraph_t *g, Agobj_t *edge, void *ignored)
 
int agrename (Agobj_t *obj, char *newname)
 
void agrecclose (Agobj_t *obj)
 
void agmethod_init (Agraph_t *g, void *obj)
 
void agmethod_upd (Agraph_t *g, void *obj, Agsym_t *sym)
 
void agmethod_delete (Agraph_t *g, void *obj)
 
void aginitcb (Agraph_t *g, void *obj, Agcbstack_t *disc)
 
void agupdcb (Agraph_t *g, void *obj, Agsym_t *sym, Agcbstack_t *disc)
 
void agdelcb (Agraph_t *g, void *obj, Agcbstack_t *disc)
 
void aginternalmapclearlocalnames (Agraph_t *g)
 
size_t agnnodes_z (const Agraph_t *g)
 

Variables

const char AgDataRecName []
 
Dtdisc_t Ag_subnode_seq_disc
 
Dtdisc_t Ag_mainedge_id_disc
 
Dtdisc_t Ag_subedge_id_disc
 
Dtdisc_t Ag_mainedge_seq_disc
 
Dtdisc_t Ag_subedge_seq_disc
 
Dtdisc_t Ag_subgraph_id_disc
 
Dtdisc_t Ag_subgraph_seq_disc
 

Macro Definition Documentation

◆ AGCLOS

#define AGCLOS (   g,
 
)    ((g)->clos->state.d)

Definition at line 49 of file cghdr.h.

◆ AGDISC

#define AGDISC (   g,
 
)    ((g)->clos->disc.d)

Definition at line 48 of file cghdr.h.

◆ FAILURE

#define FAILURE   -1

Definition at line 45 of file cghdr.h.

◆ LOCALNAMEPREFIX

#define LOCALNAMEPREFIX   '%'

Definition at line 46 of file cghdr.h.

◆ SUCCESS

#define SUCCESS   0

Definition at line 44 of file cghdr.h.

Typedef Documentation

◆ aagextra_t

typedef struct aagextra_s aagextra_t

Definition at line 107 of file cghdr.h.

◆ aagscan_t

typedef void* aagscan_t

Definition at line 106 of file cghdr.h.

◆ agobjsearchfn_t

typedef Agobj_t *(* agobjsearchfn_t) (Agraph_t *g, Agobj_t *obj)

Definition at line 52 of file cghdr.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEQ_MASK 

Definition at line 73 of file cghdr.h.

Function Documentation

◆ aagget_extra()

◆ aaglex_destroy()

int aaglex_destroy ( aagscan_t  )

Referenced by agconcat().

Here is the caller graph for this function:

◆ aaglex_init_extra()

int aaglex_init_extra ( aagextra_t user_defined,
aagscan_t scanner 
)

Referenced by agconcat().

Here is the caller graph for this function:

◆ aagparse()

int aagparse ( aagscan_t  scanner)

Referenced by agconcat().

Here is the caller graph for this function:

◆ aagset_in()

void aagset_in ( FILE *  ,
aagscan_t   
)

Referenced by agconcat().

Here is the caller graph for this function:

◆ agapply()

int agapply ( Agraph_t g,
Agobj_t obj,
agobjfn_t  fn,
void *  arg,
int  preorder 
)

Definition at line 62 of file apply.c.

References agerrorf(), AGINEDGE, AGNODE, AGOUTEDGE, AGRAPH, AGTYPE, FAILURE, rec_apply(), subedge_search(), subgraph_search(), subnode_search(), and SUCCESS.

Referenced by agclean(), agdeledge(), agdelnode(), agdelrec(), agnodebefore(), agrelabel_node(), eval(), init_all_attrs(), and setattr().

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

◆ agdeledgeimage()

void agdeledgeimage ( Agraph_t g,
Agobj_t edge,
void *  ignored 
)

Definition at line 299 of file edge.c.

References agfstin(), agfstout(), AGIN2OUT, AGINEDGE, agnxtin(), agnxtout(), AGOUT2IN, agsubrep(), AGTYPE, del(), Agraph_s::e_id, Agraph_s::e_seq, edge, in(), Agsubnode_s::in_id, Agsubnode_s::in_seq, out(), Agsubnode_s::out_id, and Agsubnode_s::out_seq.

Referenced by agdeledge(), and agdelnodeimage().

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

◆ agdelnodeimage()

void agdelnodeimage ( Agraph_t g,
Agobj_t node,
void *  ignored 
)

Definition at line 175 of file node.c.

References agdeledgeimage(), agfstedge(), agnxtedge(), Agnode_s::base, Agedge_s::base, dtdelete, Agtag_s::id, Agraph_s::n_id, Agraph_s::n_seq, Agsubnode_s::node, node_set_remove(), and Agobj_s::tag.

Referenced by agdelnode().

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

◆ agdtclose()

int agdtclose ( Agraph_t g,
Dict_t dict 
)

Definition at line 33 of file utils.c.

References Ag_dictop_G, dtclose(), dtdisc(), and NULL.

Referenced by agclose(), and agraphattr_delete().

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

◆ agdtdelete()

int agdtdelete ( Agraph_t g,
Dict_t dict,
void *  obj 
)

Definition at line 27 of file utils.c.

References Ag_dictop_G, dtdelete, and NULL.

◆ agdtdisc()

void agdtdisc ( Agraph_t g,
Dict_t dict,
Dtdisc_t disc 
)

Definition at line 43 of file utils.c.

References disc, dtdisc(), and NULL.

Referenced by agfindsubg_by_id().

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

◆ agdtopen()

Dict_t * agdtopen ( Dtdisc_t disc,
Dtmethod_t method 
)

Definition at line 23 of file utils.c.

References disc, and dtopen().

Referenced by aginternalmapinsert(), agmakedatadict(), and agopen1().

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

◆ agedgesetop()

void agedgesetop ( Agraph_t g,
Agedge_t e,
int  insertion 
)

◆ agfindnode_by_id()

Agnode_t * agfindnode_by_id ( Agraph_t g,
IDTYPE  id 
)

Definition at line 25 of file node.c.

References Agraph_s::n_id, Agsubnode_s::node, node_set_find(), and NULL.

Referenced by agdelnode(), agfindnode_by_name(), agidnode(), agnode(), agrelabel_node(), and agsubnode().

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

◆ agfreeid()

void agfreeid ( Agraph_t g,
int  objtype,
IDTYPE  id 
)

Definition at line 133 of file id.c.

References AGCLOS, AGDISC, aginternalmapdelete(), and id.

Referenced by agclose(), agdeledge(), agdelnode(), agrelabel_node(), and agrename().

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

◆ aginternalmapclose()

void aginternalmapclose ( Agraph_t g)

Definition at line 197 of file imap.c.

References Agraph_s::clos, closeit(), Agclos_s::lookup_by_id, and Agclos_s::lookup_by_name.

Referenced by agclose().

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

◆ aginternalmapdelete()

int aginternalmapdelete ( Agraph_t g,
int  objtype,
IDTYPE  id 
)

Definition at line 151 of file imap.c.

References AGEDGE, AGINEDGE, agstrfree(), Agraph_s::clos, dtdelete, find_isym(), free(), Agclos_s::lookup_by_id, Agclos_s::lookup_by_name, and IMapEntry_s::str.

Referenced by agfreeid(), and aginternalmapclearlocalnames().

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

◆ aginternalmapinsert()

void aginternalmapinsert ( Agraph_t g,
int  objtype,
char *  str,
IDTYPE  result 
)

Definition at line 105 of file imap.c.

References agdtopen(), AGEDGE, AGINEDGE, agstrdup(), Agraph_s::clos, dtinsert, Dttree, gv_alloc(), id, IMapEntry_s::id, Agclos_s::lookup_by_id, Agclos_s::lookup_by_name, LookupById, LookupByName, NULL, IMapEntry_s::str, and str.

Referenced by agmapnametoid().

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

◆ aginternalmaplookup()

bool aginternalmaplookup ( Agraph_t g,
int  objtype,
char *  str,
IDTYPE result 
)

Definition at line 84 of file imap.c.

References AGEDGE, AGINEDGE, agstrbind(), Agraph_s::clos, dtsearch, IMapEntry_s::id, Agclos_s::lookup_by_name, IMapEntry_s::str, and str.

Referenced by agmapnametoid().

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

◆ aginternalmapprint()

char * aginternalmapprint ( Agraph_t g,
int  objtype,
IDTYPE  id 
)

Definition at line 141 of file imap.c.

References find_isym(), NULL, and IMapEntry_s::str.

Referenced by agnameof().

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

◆ aglexbad()

void aglexbad ( aagscan_t  yyscanner)

Definition at line 196 of file scan.l.

References YY_FLUSH_BUFFER, and yyg.

Referenced by agconcat().

Here is the caller graph for this function:

◆ aglexeof()

void aglexeof ( aagscan_t  yyscanner)

Definition at line 191 of file scan.l.

References GRAPH_EOF_TOKEN, unput, and yyg.

Referenced by endgraph(), and endgraph().

Here is the caller graph for this function:

◆ agmapnametoid()

int agmapnametoid ( Agraph_t g,
int  objtype,
char *  str,
IDTYPE result,
bool  createflag 
)

Definition at line 104 of file id.c.

References AGCLOS, AGDISC, aginternalmapinsert(), aginternalmaplookup(), LOCALNAMEPREFIX, Agiddisc_s::map, NULL, and str.

Referenced by agedge(), agfindnode_by_name(), agnode(), agopen(), agrelabel_node(), agrename(), and agsubg().

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 152 of file graph.c.

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

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

Here is the caller graph for this function:

◆ agnnodes_z()

size_t agnnodes_z ( const Agraph_t g)

get the number of nodes in a graph

Where possible, this should be used in internal code in preference to agnnodes. In future, this should be migrated to the public API and replace agnnodes.

Parameters
gGraph to inspect
Returns
Number of nodes in this graph

Definition at line 157 of file graph.c.

References Agraph_s::n_id, and node_set_size().

Referenced by agnnodes(), getSizes(), and makeInfo().

Here is the call graph for this function:
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:

◆ agprintid()

char * agprintid ( Agobj_t obj)

◆ agrecclose()

void agrecclose ( Agobj_t obj)

Definition at line 229 of file rec.c.

References agraphof(), agstrfree(), Agobj_s::data, free(), Agrec_s::name, Agrec_s::next, and NULL.

Referenced by agclose(), agdeledge(), and agdelnode().

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

◆ agregister()

void agregister ( Agraph_t g,
int  objtype,
void *  obj 
)

Definition at line 172 of file id.c.

References AGCLOS, and AGDISC.

Referenced by agedge(), agnode(), agopen(), and agsubg().

Here is the caller graph for this function:

◆ agrename()

int agrename ( Agobj_t obj,
char *  newname 
)

rename an object

Parameters
objTarget to rename
newnameName to assign
Returns
0 on success

Definition at line 43 of file obj.c.

References agfreeid(), AGID, agidsubg(), AGINEDGE, agmapnametoid(), AGNODE, AGOUTEDGE, agparent(), AGRAPH, agraphof(), agrelabel_node(), agroot(), AGTYPE, FAILURE, SUCCESS, and UNREACHABLE.

Here is the call graph for this function:

◆ agstrclose()

int agstrclose ( Agraph_t g)

Definition at line 326 of file refstr.c.

References refdict(), and strdict_free().

Referenced by agclose().

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

Variable Documentation

◆ Ag_mainedge_id_disc

Dtdisc_t Ag_mainedge_id_disc
extern

Definition at line 416 of file edge.c.

Referenced by agopen1().

◆ Ag_mainedge_seq_disc

Dtdisc_t Ag_mainedge_seq_disc
extern

Definition at line 405 of file edge.c.

Referenced by agopen1().

◆ Ag_subedge_id_disc

Dtdisc_t Ag_subedge_id_disc
extern

Definition at line 421 of file edge.c.

Referenced by agopen1().

◆ Ag_subedge_seq_disc

Dtdisc_t Ag_subedge_seq_disc
extern

Definition at line 410 of file edge.c.

Referenced by agopen1().

◆ Ag_subgraph_id_disc

Dtdisc_t Ag_subgraph_id_disc
extern

Definition at line 269 of file graph.c.

Referenced by agfindsubg_by_id(), and agopen1().

◆ Ag_subgraph_seq_disc

Dtdisc_t Ag_subgraph_seq_disc
extern

Definition at line 264 of file graph.c.

Referenced by agopen1().

◆ Ag_subnode_seq_disc

Dtdisc_t Ag_subnode_seq_disc
extern

Definition at line 306 of file node.c.

Referenced by agopen1().

◆ AgDataRecName

const char AgDataRecName[]
extern

Definition at line 156 of file attr.c.

Referenced by agattrrec(), agedgeattr_delete(), agmakeattrs(), agnodeattr_delete(), newedge(), and newnode().