17%define api.prefix {gml}
43static char *
sortToStr(
unsigned short sort);
94 attrs_t *
const lp =
gv_alloc(
sizeof(attrs_t));
154static gmlattr *
mkAttr(
char* name,
unsigned short sort,
unsigned short kind,
155 char*
str, attrs_t* list) {
158 assert (name || sort);
183 if (dir < 0) dir = -1;
184 else if (dir > 0) dir = 1;
189 for (g =
G->parent; g; g = g->
parent) {
239glist : glist glistitem
248 yyerror(
"mixed directed and undirected graphs");
260nlist : nlist nlistitem
352 for (
size_t i = 0; alist !=
NULL && i <
LIST_SIZE(alist); ++i) {
382 for (
size_t i = 0; i <
LIST_SIZE(alist); ++i) {
424 for (
size_t i = 0; i <
LIST_SIZE(alist); ++i) {
474 for (
size_t i = 0; alist !=
NULL && i <
LIST_SIZE(alist); ++i) {
484 snprintf(buf,
sizeof(buf),
"%.04f", d/72.0);
489 snprintf(buf,
sizeof(buf),
"%.04f", d/72.0);
533 for (
size_t i = 0; alist !=
NULL && i <
LIST_SIZE(alist); ++i) {
542 fprintf (stderr,
"non-X/Y field in point attribute");
553 for (
size_t i = 0; i <
LIST_SIZE(alist); ++i) {
559 fprintf (stderr,
"non-point field in line attribute");
570 for (
size_t i = 0; alist !=
NULL && i <
LIST_SIZE(alist); ++i) {
604 for (
size_t i = 0; i <
LIST_SIZE(alist); ++i) {
637 else if (
graph->directed >= 1)
648 fprintf (stderr,
"node without an id attribute");
658 fprintf (stderr,
"edge without an source attribute");
662 fprintf (stderr,
"node without an target attribute");
723 s =
"directed";
break;
741 s =
"graphics";
break;
743 s =
"labelGraphics";
break;
749 s =
"outline";
break;
751 s =
"outlineStyle";
break;
753 s =
"outlineWidth";
break;
765 s =
"fontSize";
break;
767 s =
"fontName";
break;
771 s =
"integer";
break;
static void agxbfree(agxbuf *xb)
free any malloced resources
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
static void agxbclear(agxbuf *xb)
resets pointer to data
static WUR char * agxbuse(agxbuf *xb)
static size_t agxblen(const agxbuf *xb)
return number of characters currently stored
static int agxbputc(agxbuf *xb, char c)
add character to buffer
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
static void * gv_alloc(size_t size)
static NORETURN void graphviz_exit(int status)
static void free_attrs(attrs_t *a)
static void cleanup(void)
static gmlnode * mkNode(void)
static int setDir(char *d)
static void free_edge(gmledge *p)
static void free_node(gmlnode *p)
static gmledge * mkEdge(void)
static void pushAlist(void)
static void free_graph(gmlgraph *p)
static gmlattr * mkAttr(char *name, unsigned short sort, unsigned short kind, char *str, attrs_t *list)
static attrs_t * popAlist(void)
static char * sortToStr(unsigned short sort)
static void addEdgeGraphics(Agedge_t *ep, attrs_t *alist, agxbuf *xb, agxbuf *unk)
static void addAttrs(Agobj_t *obj, attrs_t *alist, agxbuf *xb, agxbuf *unk)
static void deparseAttr(gmlattr *ap, agxbuf *xb)
static void addEdgeLabelGraphics(Agedge_t *ep, attrs_t *alist, agxbuf *xb, agxbuf *unk)
static void addNodeLabelGraphics(Agnode_t *np, attrs_t *alist, agxbuf *unk)
static Agraph_t * mkGraph(gmlgraph *graph, Agraph_t *parent, char *name, agxbuf *xb, agxbuf *unk)
static void addNodeGraphics(Agnode_t *np, attrs_t *alist, agxbuf *xb, agxbuf *unk)
static void addEdgePoint(Agedge_t *ep, attrs_t *alist, agxbuf *xb)
static void addEdgePos(Agedge_t *ep, attrs_t *alist, agxbuf *xb)
static void free_attr(gmlattr *p)
hdr body DIRECTED INTEGER
static void deparseList(attrs_t *alist, agxbuf *xb)
Agraph_t * gml_to_gv(char *name, FILE *fp, int cnt, int *errors)
static int cnt(Dict_t *d, Dtlink_t **set)
int agsafeset(void *obj, char *name, const char *value, const char *def)
set an attribute’s value and default, ensuring it is declared before setting it locally
Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Agdesc_t Agundirected
undirected
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
creates a new graph with the given name and kind
Agdesc_t Agdirected
directed
Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
Agraph_t * graph(char *name)
textitem scanner parser str
type-generic dynamically expanding list
#define LIST_APPEND(list, item)
#define LIST_POP_BACK(list)
#define LIST_IS_EMPTY(list)
#define LIST_PUSH_BACK(list, item)
#define LIST_GET(list, index)
a generic header of Agraph_s, Agnode_s and Agedge_s
void * lp
actually an attrs_t *