Graphviz 13.0.0~dev.20241220.2304
|
DOT-GXL convert subroutines. More...
#include <common/types.h>
#include <common/utils.h>
#include "convert.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
#include <util/startswith.h>
Go to the source code of this file.
Data Structures | |
struct | Local_Agnodeinfo_t |
struct | namev_t |
struct | idv_t |
struct | gxlstate_t |
Macros | |
#define | EMPTY(s) ((s == 0) || (*s == '\0')) |
#define | SLEN(s) (sizeof(s)-1) |
#define | GXL_ATTR "_gxl_" |
#define | GXL_ROLE "_gxl_role" |
#define | GXL_HYPER "_gxl_hypergraph" |
#define | GXL_ID "_gxl_id" |
#define | GXL_FROM "_gxl_fromorder" |
#define | GXL_TO "_gxl_toorder" |
#define | GXL_TYPE "_gxl_type" |
#define | GXL_COMP "_gxl_composite_" |
#define | GXL_LOC "_gxl_locator_" |
#define | GXL_COMP_LEN (SLEN(GXL_COMP)) |
#define | EDGEOP "--" /* cannot use '>'; illegal in ID in GXL */ |
#define | writeval(n) (((Local_Agnodeinfo_t*)((n)->base.data))->written) |
Functions | |
static void * | make_nitem (void *p, Dtdisc_t *disc) |
static void | free_iditem (void *idv) |
static void | writeBody (gxlstate_t *, Agraph_t *g, FILE *gxlFile) |
static void | iterateBody (gxlstate_t *stp, Agraph_t *g) |
static void | tabover (FILE *gxlFile) |
static bool | legalGXLName (const char *id) |
static int | put (void *stream, const char *s) |
static int | xml_puts (FILE *stream, const char *s) |
static int | xml_url_puts (FILE *f, const char *s) |
static bool | isGxlGrammar (const char *name) |
static bool | isLocatorType (const char *name) |
static bool | idexists (Dt_t *ids, char *id) |
static char * | addid (Dt_t *ids, const char *id) |
static char * | createGraphId (Dt_t *ids) |
static char * | createNodeId (Dt_t *ids) |
static char * | mapLookup (Dt_t *nm, char *name) |
static char * | nodeID (gxlstate_t *stp, Agnode_t *n) |
static char * | createEdgeId (gxlstate_t *stp, Agedge_t *e) |
static void | addToMap (Dt_t *map, char *name, char *uniqueName) |
static void | graphAttrs (FILE *gxlFile, Agraph_t *g) |
static void | edgeAttrs (FILE *gxlFile, Agedge_t *e) |
static void | printHref (FILE *gxlFile, void *n) |
static void | writeDict (FILE *gxlFile, const char *name, Dict_t *dict, bool isGraph) |
static void | writeDicts (Agraph_t *g, FILE *gxlFile) |
static void | writeHdr (gxlstate_t *stp, Agraph_t *g, FILE *gxlFile, bool top) |
static void | writeTrl (Agraph_t *g, FILE *gxlFile, bool top) |
static void | writeSubgs (gxlstate_t *stp, Agraph_t *g, FILE *gxlFile) |
static void | writeEdgeName (Agedge_t *e, FILE *gxlFile) |
static void | writeNondefaultAttr (void *obj, FILE *gxlFile, Dict_t *defdict) |
static bool | attrs_written (gxlstate_t *stp, void *obj) |
static void | writeNode (gxlstate_t *stp, Agnode_t *n, FILE *gxlFile, Dict_t *d) |
static void | writePort (Agedge_t *e, FILE *gxlFile, char *name) |
static bool | writeEdgeTest (Agraph_t *g, Agedge_t *e) |
static void | writeEdge (gxlstate_t *stp, Agedge_t *e, FILE *gxlFile, Dict_t *d) |
static void | iterateHdr (gxlstate_t *stp, Agraph_t *g) |
static void | iterate_subgs (gxlstate_t *stp, Agraph_t *g) |
static gxlstate_t | initState (Agraph_t *g) |
static void | freeState (gxlstate_t stp) |
void | gv_to_gxl (Agraph_t *g, FILE *gxlFile) |
Variables | |
static int | Level |
static Agsym_t * | Tailport |
static Agsym_t * | Headport |
static Dtdisc_t | nameDisc |
static Dtdisc_t | idDisc |
#define writeval | ( | n | ) | (((Local_Agnodeinfo_t*)((n)->base.data))->written) |
|
static |
Definition at line 164 of file gv2gxl.c.
References dtinsert, gv_alloc(), gv_strdup(), and idv_t::name.
Referenced by createEdgeId(), createGraphId(), createNodeId(), iterateBody(), iterateHdr(), and writeHdr().
|
static |
Definition at line 243 of file gv2gxl.c.
References dtinsert, namev_t::name, NULL, and namev_t::unique_name.
Referenced by iterateBody(), iterateHdr(), and writeHdr().
|
static |
Definition at line 573 of file gv2gxl.c.
References AGATTRWF, and gxlstate_t::attrsNotWritten.
Referenced by writeEdge(), and writeNode().
|
static |
Definition at line 223 of file gv2gxl.c.
References addid(), AGHEAD, AGTAIL, agxbfree(), agxbprint(), agxbuse(), EDGEOP, idexists(), gxlstate_t::idList, and nodeID().
Referenced by writeEdge().
|
static |
Definition at line 172 of file gv2gxl.c.
References addid(), agxbfree(), agxbprint(), agxbuse(), and idexists().
Referenced by iterateHdr().
|
static |
Definition at line 187 of file gv2gxl.c.
References addid(), agxbfree(), agxbprint(), agxbuse(), and idexists().
Referenced by iterateBody(), and writeHdr().
|
static |
Definition at line 267 of file gv2gxl.c.
References agget(), EMPTY, GXL_FROM, GXL_ID, GXL_TO, and xml_puts().
Referenced by writeEdge().
|
static |
Definition at line 80 of file gv2gxl.c.
References free(), and idv_t::name.
|
static |
Definition at line 754 of file gv2gxl.c.
References dtclose(), gxlstate_t::graphMap, gxlstate_t::idList, gxlstate_t::nodeMap, and gxlstate_t::synNodeMap.
Referenced by gv_to_gxl().
|
static |
Definition at line 251 of file gv2gxl.c.
References agget(), EMPTY, GXL_HYPER, GXL_ROLE, and xml_puts().
Referenced by writeHdr().
void gv_to_gxl | ( | Agraph_t * | g, |
FILE * | gxlFile | ||
) |
Definition at line 761 of file gv2gxl.c.
References aginit(), AGNODE, freeState(), initState(), iterateBody(), iterateHdr(), Level, writeBody(), writeHdr(), and writeTrl().
Referenced by main().
|
static |
Definition at line 157 of file gv2gxl.c.
Referenced by createEdgeId(), createGraphId(), createNodeId(), iterateBody(), iterateHdr(), and writeHdr().
|
static |
Definition at line 742 of file gv2gxl.c.
References agisdirected(), gxlstate_t::attrsNotWritten, gxlstate_t::directed, dtopen(), Dtoset, gxlstate_t::graphMap, idDisc, gxlstate_t::idList, nameDisc, gxlstate_t::nodeMap, gxlstate_t::root, and gxlstate_t::synNodeMap.
Referenced by gv_to_gxl().
|
static |
Definition at line 149 of file gv2gxl.c.
References GXL_ATTR, and startswith().
Referenced by writeDict(), and writeNondefaultAttr().
|
static |
Definition at line 153 of file gv2gxl.c.
References GXL_LOC, and startswith().
Referenced by writeDict(), and writeNondefaultAttr().
|
static |
Definition at line 706 of file gv2gxl.c.
References agfstsubg(), agnxtsubg(), iterateBody(), and iterateHdr().
Referenced by iterateBody().
|
static |
Definition at line 715 of file gv2gxl.c.
References addid(), addToMap(), agfstnode(), agfstout(), agget(), agnameof(), agnxtnode(), agnxtout(), createNodeId(), EMPTY, GXL_ID, idexists(), gxlstate_t::idList, iterate_subgs(), legalGXLName(), mapLookup(), gxlstate_t::nodeMap, and writeEdgeTest().
Referenced by gv_to_gxl(), and iterate_subgs().
|
static |
Definition at line 692 of file gv2gxl.c.
References addid(), addToMap(), agget(), agnameof(), createGraphId(), EMPTY, gxlstate_t::graphMap, GXL_ID, idexists(), gxlstate_t::idList, and legalGXLName().
Referenced by gv_to_gxl(), and iterate_subgs().
|
static |
Definition at line 120 of file gv2gxl.c.
References gv_isalnum(), and gv_isalpha().
Referenced by iterateBody(), iterateHdr(), and writeHdr().
|
static |
Definition at line 56 of file gv2gxl.c.
References disc, gv_alloc(), namev_t::name, and namev_t::unique_name.
|
static |
Definition at line 202 of file gv2gxl.c.
References dtmatch, NULL, and namev_t::unique_name.
Referenced by iterateBody(), nodeID(), and writeHdr().
|
static |
Definition at line 213 of file gv2gxl.c.
References agnameof(), mapLookup(), and gxlstate_t::nodeMap.
Referenced by createEdgeId(), writeEdge(), and writeNode().
|
static |
Definition at line 290 of file gv2gxl.c.
References agget(), EMPTY, GXL_TYPE, tabover(), and xml_url_puts().
Referenced by writeEdge(), writeHdr(), and writeNode().
|
inlinestatic |
Definition at line 133 of file gv2gxl.c.
Referenced by xml_puts(), and xml_url_puts().
|
static |
Definition at line 108 of file gv2gxl.c.
References Level.
Referenced by printHref(), writeDict(), writeEdge(), writeEdgeName(), writeHdr(), writeNode(), writeNondefaultAttr(), writePort(), and writeTrl().
|
static |
Definition at line 674 of file gv2gxl.c.
References agdatadict(), agfstnode(), agfstout(), AGID, agidnode(), agnxtnode(), agnxtout(), Agdatadict_s::dict, Agdatadict_s::e, Agdatadict_s::n, gxlstate_t::root, writeEdge(), writeEdgeTest(), writeNode(), writeSubgs(), and writeval.
Referenced by gv_to_gxl(), and writeSubgs().
|
static |
Definition at line 305 of file gv2gxl.c.
References Agsym_s::defval, dtfirst, dtnext, dtsearch, dtview(), EMPTY, GXL_COMP, GXL_COMP_LEN, GXL_LOC, isGxlGrammar(), isLocatorType(), NULL, startswith(), tabover(), view, xml_puts(), and xml_url_puts().
Referenced by writeDicts().
|
static |
Definition at line 387 of file gv2gxl.c.
References agdatadict(), Agdatadict_s::dict, Agdatadict_s::e, Agdatadict_s::g, Agdatadict_s::n, and writeDict().
Referenced by writeHdr().
|
static |
Definition at line 633 of file gv2gxl.c.
References agget(), AGHEAD, AGTAIL, attrs_written(), createEdgeId(), gxlstate_t::directed, edgeAttrs(), EMPTY, GXL_ID, Level, nodeID(), printHref(), tabover(), writeEdgeName(), writeNondefaultAttr(), and writePort().
Referenced by writeBody().
|
static |
Definition at line 483 of file gv2gxl.c.
References agnameof(), EMPTY, tabover(), and xml_puts().
Referenced by writeEdge(), and writeNondefaultAttr().
Definition at line 623 of file gv2gxl.c.
References agfstsubg(), agnxtsubg(), and agsubedge().
Referenced by iterateBody(), and writeBody().
|
static |
Definition at line 397 of file gv2gxl.c.
References addid(), addToMap(), agattr(), AGATTRWF, AGEDGE, agisstrict(), agnameof(), agparent(), agxbfree(), agxbprint(), agxbuse(), gxlstate_t::attrsNotWritten, createNodeId(), Agraph_s::desc, Agdesc_s::directed, graphAttrs(), gxlstate_t::graphMap, Headport, idexists(), gxlstate_t::idList, legalGXLName(), Level, mapLookup(), NULL, printHref(), gxlstate_t::synNodeMap, tabover(), Tailport, top(), writeDicts(), and xml_puts().
Referenced by gv_to_gxl(), and writeSubgs().
|
static |
Definition at line 578 of file gv2gxl.c.
References agnameof(), attrs_written(), Level, nodeID(), printHref(), tabover(), writeNondefaultAttr(), and xml_puts().
Referenced by writeBody().
|
static |
Definition at line 499 of file gv2gxl.c.
References agattrrec(), AGATTRWF, aghtmlstr(), AGINEDGE, AGOUTEDGE, AGTYPE, dtfirst, dtnext, GXL_COMP, GXL_COMP_LEN, GXL_LOC, Headport, Agsym_s::id, isGxlGrammar(), isLocatorType(), startswith(), tabover(), Tailport, writeEdgeName(), xml_puts(), and xml_url_puts().
Referenced by writeEdge(), and writeNode().
|
static |
Definition at line 606 of file gv2gxl.c.
References agget(), tabover(), and xml_puts().
Referenced by writeEdge().
|
static |
Definition at line 474 of file gv2gxl.c.
References agfstsubg(), agnxtsubg(), writeBody(), writeHdr(), and writeTrl().
Referenced by writeBody().
|
static |
Definition at line 462 of file gv2gxl.c.
References agparent(), Level, tabover(), and top().
Referenced by gv_to_gxl(), and writeSubgs().
|
inlinestatic |
Definition at line 138 of file gv2gxl.c.
References xml_flags_t::dash, flags, put(), and xml_escape().
Referenced by edgeAttrs(), graphAttrs(), writeDict(), writeEdgeName(), writeHdr(), writeNode(), writeNondefaultAttr(), and writePort().
|
static |
Definition at line 144 of file gv2gxl.c.
References flags, put(), and xml_escape().
Referenced by printHref(), writeDict(), and writeNondefaultAttr().
|
static |
Definition at line 48 of file gv2gxl.c.
Referenced by writeHdr(), and writeNondefaultAttr().
|
static |
Definition at line 86 of file gv2gxl.c.
Referenced by initState().
|
static |
Definition at line 47 of file gv2gxl.c.
Referenced by gv_to_gxl(), tabover(), writeEdge(), writeHdr(), writeNode(), and writeTrl().
|
static |
Definition at line 66 of file gv2gxl.c.
Referenced by initState().
|
static |
Definition at line 48 of file gv2gxl.c.
Referenced by writeHdr(), and writeNondefaultAttr().