Graphviz 13.0.0~dev.20241220.2304
|
DOT-GML converter. More...
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <getopt.h>
#include <cgraph/cgraph.h>
#include <cgraph/ingraphs.h>
#include <cgraph/tokenize.h>
#include <common/types.h>
#include <common/utils.h>
#include <util/exit.h>
#include <util/gv_ctype.h>
#include <util/streq.h>
#include <util/strview.h>
#include <util/unreachable.h>
#include "openFile.h"
Go to the source code of this file.
Data Structures | |
struct | node_attrs |
struct | edge_attrs |
struct | Local_Agnodeinfo_t |
Macros | |
#define | POS_SET (1<<0) |
#define | W_SET (1<<1) |
#define | H_SET (1<<2) |
#define | INVIS (1<<3) |
#define | FILL (1<<4) |
#define | LINE (1<<5) |
#define | DASH (1<<6) |
#define | DOT (1<<7) |
#define | BOLD (1<<8) |
#define | ID(n) (((Local_Agnodeinfo_t*)(n->base.data))->id) |
Functions | |
static void | indent (int ix) |
static bool | isNumber (char *s) |
Return true if input string is number. | |
static int | parseStyle (char *s) |
Simple implementation for parsing style attribute. | |
static void | emitInt (char *name, int value, int ix) |
static void | emitReal (char *name, double value, int ix) |
static void | emitPoint (double x, double y, int ix) |
static char * | skipWS (char *s) |
static char * | readPoint (char *s, double *xp, double *yp) |
static char * | arrowEnd (char *s0, char *pfx, int *fp, double *xp, double *yp) |
static void | emitSpline (char *s, int ix) |
static int | put (void *stream, const char *s) |
static int | xml_puts (FILE *stream, const char *s) |
static void | emitAttr (char *name, char *value, int ix) |
static void | emitNodeAttrs (Agraph_t *G, Agnode_t *np, int ix) |
static void | emitNode (Agraph_t *G, Agnode_t *n) |
static void | emitEdgeAttrs (Agraph_t *G, Agedge_t *ep, int ix) |
static void | emitEdge (Agraph_t *G, Agedge_t *e) |
static void | emitGraphAttrs (Agraph_t *G) |
static void | gv_to_gml (Agraph_t *G) |
static void | usage (int v) |
static char * | cmdName (char *cmd) |
static void | initargs (int argc, char **argv) |
int | main (int argc, char **argv) |
Variables | |
static FILE * | outFile |
static char * | CmdName |
static char ** | Files |
static uint64_t | id |
static bool | yworks |
use yWorks.com variant of GML? | |
static char * | useString |
#define ID | ( | n | ) | (((Local_Agnodeinfo_t*)(n->base.data))->id) |
|
static |
Definition at line 173 of file gv2gml.c.
References graphviz_exit(), NULL, readPoint(), and skipWS().
Referenced by emitSpline().
|
static |
Definition at line 650 of file gv2gml.c.
References cmd.
Referenced by initargs().
|
static |
Definition at line 220 of file gv2gml.c.
References indent(), isNumber(), outFile, and xml_puts().
Referenced by emitEdgeAttrs(), emitGraphAttrs(), and emitNodeAttrs().
Definition at line 593 of file gv2gml.c.
References aghead, AGSEQ, agtail, emitEdgeAttrs(), G, ID, and outFile.
Referenced by gv_to_gml().
Definition at line 433 of file gv2gml.c.
References AGEDGE, agnxtattr(), agxget(), edge_attrs::arrow, edge_attrs::arrowhead, edge_attrs::arrowtail, BOLD, DASH, DOT, emitAttr(), emitInt(), emitSpline(), edge_attrs::fill, edge_attrs::flags, edge_attrs::fontColor, edge_attrs::fontName, edge_attrs::fontSize, G, INVIS, label(), LINE, s::name, NULL, outFile, parseStyle(), edge_attrs::pos, streq(), edge_attrs::width, and yworks.
Referenced by emitEdge().
|
static |
Definition at line 601 of file gv2gml.c.
References agnxtattr(), AGRAPH, agxget(), emitAttr(), G, s::name, and NULL.
Referenced by gv_to_gml().
|
static |
Definition at line 133 of file gv2gml.c.
References indent(), and outFile.
Referenced by emitEdgeAttrs(), and emitNodeAttrs().
Definition at line 418 of file gv2gml.c.
References agbindrec(), agnameof(), emitNodeAttrs(), G, ID, and outFile.
Referenced by gv_to_gml().
Definition at line 236 of file gv2gml.c.
References agnameof(), AGNODE, agnxtattr(), agxget(), DASH, DOT, emitAttr(), emitInt(), emitReal(), FILL, node_attrs::fill, node_attrs::flags, node_attrs::fontColor, node_attrs::fontName, node_attrs::fontSize, G, node_attrs::h, H_SET, node_attrs::image, INVIS, label(), LINE, s::name, NULL, outFile, node_attrs::outline, node_attrs::outlineStyle, parseStyle(), POS_SET, streq(), node_attrs::type, node_attrs::w, W_SET, node_attrs::width, node_attrs::x, node_attrs::y, and yworks.
Referenced by emitNode().
|
static |
Definition at line 143 of file gv2gml.c.
References indent(), and outFile.
Referenced by emitSpline().
|
static |
Definition at line 138 of file gv2gml.c.
References indent(), and outFile.
Referenced by emitNodeAttrs().
|
static |
Definition at line 188 of file gv2gml.c.
References arrowEnd(), emitPoint(), indent(), outFile, and readPoint().
Referenced by emitEdgeAttrs().
|
static |
Definition at line 612 of file gv2gml.c.
References agfstnode(), agfstout(), agisdirected(), agnxtnode(), agnxtout(), emitEdge(), emitGraphAttrs(), emitNode(), G, and outFile.
Referenced by main().
|
static |
Definition at line 96 of file gv2gml.c.
References outFile.
Referenced by emitAttr(), emitInt(), emitPoint(), emitReal(), and emitSpline().
|
static |
|
static |
Definition at line 102 of file gv2gml.c.
References gv_isspace().
Referenced by emitAttr().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 705 of file gv2gml.c.
References agclose(), Files, G, graphviz_exit(), gv_to_gml(), initargs(), newIngraph(), nextGraph(), outFile, and prev.
|
static |
Definition at line 115 of file gv2gml.c.
References BOLD, DASH, DOT, FILL, flags, INVIS, LINE, strview_str_eq(), tok(), tok_end(), tok_get(), and tok_next().
Referenced by emitEdgeAttrs(), and emitNodeAttrs().
|
inlinestatic |
Definition at line 210 of file gv2gml.c.
Referenced by xml_puts().
|
static |
Definition at line 158 of file gv2gml.c.
References NULL, and skipWS().
Referenced by arrowEnd(), and emitSpline().
|
static |
Definition at line 149 of file gv2gml.c.
References gv_isspace().
Referenced by arrowEnd(), and readPoint().
|
static |
Definition at line 644 of file gv2gml.c.
References CmdName, graphviz_exit(), and useString.
|
inlinestatic |
Definition at line 215 of file gv2gml.c.
References xml_flags_t::dash, flags, put(), and xml_escape().
Referenced by emitAttr().
|
static |
Definition at line 40 of file gv2gml.c.
Referenced by initargs(), and usage().
|
static |
Definition at line 41 of file gv2gml.c.
Referenced by initargs(), and main().
|
static |
Definition at line 42 of file gv2gml.c.
Referenced by activate(), agfindedge_by_id(), agfindnode_by_name(), agfindsubg_by_id(), agfreeid(), aginternalmapinsert(), agnewsym(), agnode(), agsubg(), agsubnodeideq(), attr_list_add(), attr_list_new(), clearGrid(), compOf(), dot_sameports(), find_isym(), getObjId(), initAnchor(), initObjMapData(), loadAttrs(), LoadPlugins(), localsubg(), newedge(), newnode(), node_data_new(), node_set_hash(), populate_data(), remove_poly(), reset_attr_list_widgets(), setErrorId(), SparseMatrix_multiply3(), SparseStressMajorizationSmoother_new(), SpringSmoother_new(), StressMajorizationSmoother2_new(), StressMajorizationSmoother_smooth(), svg_gradstyle(), svg_rgradstyle(), and weak().
|
static |
Definition at line 39 of file gv2gml.c.
Referenced by emitAttr(), emitEdge(), emitEdgeAttrs(), emitInt(), emitNode(), emitNodeAttrs(), emitPoint(), emitReal(), emitSpline(), gv_to_gml(), indent(), initargs(), and main().
|
static |
|
static |
Definition at line 43 of file gv2gml.c.
Referenced by emitEdgeAttrs(), emitNodeAttrs(), and initargs().