Graphviz 13.0.0~dev.20250121.0651
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 <util/list.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 aagparse (void)
 
void aglexinit (Agdisc_t *disc, void *ifile)
 
int aaglex (void)
 
void aglexeof (void)
 
void aglexbad (void)
 
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, Agnode_t *node, void *ignored)
 
void agdeledgeimage (Agraph_t *g, Agedge_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)
 

Variables

Agraph_tAg_G_global
 
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 108 of file cghdr.h.

◆ aagscan_t

typedef void* aagscan_t

Definition at line 107 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 74 of file cghdr.h.

Function Documentation

◆ aaglex()

int aaglex ( void  )

◆ aagparse()

int aagparse ( void  )

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 60 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,
Agedge_t edge,
void *  ignored 
)

Definition at line 300 of file edge.c.

References agfstin(), agfstout(), AGIN2OUT, AGINEDGE, agnxtin(), agnxtout(), AGOUT2IN, agsubrep(), AGTYPE, del(), Agraph_s::e_id, Agraph_s::e_seq, Agsubnode_s::in_id, Agsubnode_s::in_seq, Agedge_s::node, 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,
Agnode_t node,
void *  ignored 
)

Definition at line 172 of file node.c.

References agdeledgeimage(), agfstedge(), agnxtedge(), Agnode_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 31 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 25 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 41 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 21 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 22 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 131 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 196 of file imap.c.

References Ag_G_global, 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 149 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 103 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 82 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 139 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 ( void  )

Definition at line 2402 of file scan.c.

References YY_FLUSH_BUFFER.

Referenced by agconcat().

Here is the caller graph for this function:

◆ aglexeof()

void aglexeof ( void  )

Definition at line 2400 of file scan.c.

References GRAPH_EOF_TOKEN, and unput.

Referenced by endgraph(), and endgraph().

Here is the caller graph for this function:

◆ aglexinit()

void aglexinit ( Agdisc_t disc,
void *  ifile 
)

Definition at line 2421 of file scan.c.

References Disc, Disc, disc, graphType, graphType, Ifile, and Ifile.

Referenced by agconcat().

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 102 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 160 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:

◆ 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, Agraph_s::g_seq2, gv_alloc(), 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 227 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 170 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 41 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 322 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_G_global

◆ Ag_mainedge_id_disc

Dtdisc_t Ag_mainedge_id_disc
extern

Definition at line 417 of file edge.c.

Referenced by agopen1().

◆ Ag_mainedge_seq_disc

Dtdisc_t Ag_mainedge_seq_disc
extern

Definition at line 406 of file edge.c.

Referenced by agopen1().

◆ Ag_subedge_id_disc

Dtdisc_t Ag_subedge_id_disc
extern

Definition at line 422 of file edge.c.

Referenced by agopen1().

◆ Ag_subedge_seq_disc

Dtdisc_t Ag_subedge_seq_disc
extern

Definition at line 411 of file edge.c.

Referenced by agopen1().

◆ Ag_subgraph_id_disc

Dtdisc_t Ag_subgraph_id_disc
extern

Definition at line 275 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 270 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

char* AgDataRecName
extern

Definition at line 173 of file attr.c.

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