}
static Dtdisc_t nodeDisc = {
- offsetof(gmlnode,attrlist),
- sizeof(Dt_t*),
- offsetof(gmlnode,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_node,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(gmlnode, attrlist),
+ .size = sizeof(Dt_t *),
+ .link = offsetof(gmlnode, link),
+ .freef = (Dtfree_f)free_node,
};
static Dtdisc_t edgeDisc = {
- offsetof(gmledge,attrlist),
- sizeof(Dt_t*),
- offsetof(gmledge,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_edge,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(gmledge, attrlist),
+ .size = sizeof(Dt_t *),
+ .link = offsetof(gmledge, link),
+ .freef = (Dtfree_f)free_edge,
};
static Dtdisc_t attrDisc = {
- offsetof(gmlattr,name),
- sizeof(char*),
- offsetof(gmlattr,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_attr,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(gmlattr, name),
+ .size = sizeof(char *),
+ .link = offsetof(gmlattr, link),
+ .freef = (Dtfree_f)free_attr,
};
static Dtdisc_t graphDisc = {
- offsetof(gmlgraph,nodelist),
- sizeof(Dt_t*),
- offsetof(gmlgraph,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_graph,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(gmlgraph, nodelist),
+ .size = sizeof(Dt_t *),
+ .link = offsetof(gmlgraph, link),
+ .freef = (Dtfree_f)free_graph,
};
static void
}
static Dtdisc_t nameDisc = {
- offsetof(namev_t, name),
- -1,
- offsetof(namev_t, link),
- (Dtmake_f) make_nitem,
- (Dtfree_f) free_nitem,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(namev_t, name),
+ .size = -1,
+ .link = offsetof(namev_t, link),
+ .makef = (Dtmake_f)make_nitem,
+ .freef = (Dtfree_f)free_nitem,
};
static userdata_t *genUserdata(char* dfltname)
}
static Dtdisc_t nameDisc = {
- offsetof(namev_t, name),
- -1,
- offsetof(namev_t, link),
- (Dtmake_f) make_nitem,
- (Dtfree_f) free_nitem,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(namev_t, name),
+ .size = -1,
+ .link = offsetof(namev_t, link),
+ .makef = (Dtmake_f)make_nitem,
+ .freef = (Dtfree_f)free_nitem,
};
static userdata_t *genUserdata(void)
/* indexing for ordered traversal */
Dtdisc_t Ag_mainedge_seq_disc = {
- 0, /* pass object ptr */
- 0, /* size (ignored) */
- offsetof(Agedge_t,seq_link),/* use internal links */
- NIL(Dtmake_f),
- NIL(Dtfree_f),
- agedgeseqcmpf,
- NIL(Dthash_f),
- agdictobjmem,
- NIL(Dtevent_f)
+ .link = offsetof(Agedge_t, seq_link), // use internal links
+ .comparf = agedgeseqcmpf,
+ .memoryf = agdictobjmem,
};
Dtdisc_t Ag_subedge_seq_disc = {
- 0, /* pass object ptr */
- 0, /* size (ignored) */
- -1, /* use external holder objects */
- NIL(Dtmake_f),
- NIL(Dtfree_f),
- agedgeseqcmpf,
- NIL(Dthash_f),
- agdictobjmem,
- NIL(Dtevent_f)
+ .link = -1, // use external holder objects
+ .comparf = agedgeseqcmpf,
+ .memoryf = agdictobjmem,
};
/* indexing for random search */
Dtdisc_t Ag_mainedge_id_disc = {
- 0, /* pass object ptr */
- 0, /* size (ignored) */
- offsetof(Agedge_t,id_link), /* use internal links */
- NIL(Dtmake_f),
- NIL(Dtfree_f),
- agedgeidcmpf,
- NIL(Dthash_f),
- agdictobjmem,
- NIL(Dtevent_f)
+ .link = offsetof(Agedge_t, id_link), // use internal links
+ .comparf = agedgeidcmpf,
+ .memoryf = agdictobjmem,
};
Dtdisc_t Ag_subedge_id_disc = {
- 0, /* pass object ptr */
- 0, /* size (ignored) */
- -1, /* use external holder objects */
- NIL(Dtmake_f),
- NIL(Dtfree_f),
- agedgeidcmpf,
- NIL(Dthash_f),
- agdictobjmem,
- NIL(Dtevent_f)
+ .link = -1, // use external holder objects
+ .comparf = agedgeidcmpf,
+ .memoryf = agdictobjmem,
};
}
Dtdisc_t Ag_subgraph_id_disc = {
- 0, /* pass object ptr */
- 0, /* size (ignored) */
- offsetof(Agraph_t, link), /* link offset */
- NIL(Dtmake_f),
- NIL(Dtfree_f),
- agraphidcmpf,
- NIL(Dthash_f),
- agdictobjmem,
- NIL(Dtevent_f)
+ .link = offsetof(Agraph_t, link), // link offset
+ .comparf = agraphidcmpf,
+ .memoryf = agdictobjmem,
};
-
Agdesc_t Agdirected = { .directed = 1, .maingraph = 1 };
Agdesc_t Agstrictdirected = { .directed = 1, .strict = 1, .maingraph = 1 };
Agdesc_t Agundirected = { .maingraph = 1 };
}
Dtdisc_t Ag_subnode_id_disc = {
- 0, /* pass object ptr */
- 0, /* size (ignored) */
- offsetof(Agsubnode_t, id_link), /* link offset */
- NIL(Dtmake_f),
- NIL(Dtfree_f),
- agsubnodeidcmpf,
- NIL(Dthash_f),
- agdictobjmem,
- NIL(Dtevent_f)
+ .link = offsetof(Agsubnode_t, id_link), // link offset
+ .comparf = agsubnodeidcmpf,
+ .memoryf = agdictobjmem,
};
Dtdisc_t Ag_subnode_seq_disc = {
- 0, /* pass object ptr */
- 0, /* size (ignored) */
- offsetof(Agsubnode_t, seq_link), /* link offset */
- NIL(Dtmake_f),
- (Dtfree_f)free_subnode,
- agsubnodeseqcmpf,
- NIL(Dthash_f),
- agdictobjmem,
- NIL(Dtevent_f)
+ .link = offsetof(Agsubnode_t, seq_link), // link offset
+ .freef = (Dtfree_f)free_subnode,
+ .comparf = agsubnodeseqcmpf,
+ .memoryf = agdictobjmem,
};
static void agnodesetfinger(Agraph_t * g, Agnode_t * n, void *ignored)
static Dict_t *strings;
static Dtdisc_t stringdict = {
- 0, /* key - the object itself */
- 0, /* size - null-terminated string */
- -1, /* link - allocate separate holder objects */
- NIL(Dtmake_f),
- (Dtfree_f) free_string_entry,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .link = -1, // link - allocate separate holder objects
+ .freef = (Dtfree_f)free_string_entry,
};
int emit_once(char *str)
}
static Dtdisc_t rowDisc = {
- offsetof(pitem,u),
- sizeof(void*),
- offsetof(pitem,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_ritem,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(pitem, u),
+ .size = sizeof(void *),
+ .link = offsetof(pitem, link),
+ .freef = (Dtfree_f)free_ritem,
};
static Dtdisc_t cellDisc = {
- offsetof(pitem,u),
- sizeof(void*),
- offsetof(pitem,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_item,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(pitem, u),
+ .size = sizeof(void *),
+ .link = offsetof(pitem, link),
+ .freef = (Dtfree_f)free_item,
};
typedef struct {
}
static Dtdisc_t fstrDisc = {
- 0,
- 0,
- offsetof(fitem,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_item,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .link = offsetof(fitem, link),
+ .freef = (Dtfree_f)free_item,
};
-
static Dtdisc_t fspanDisc = {
- 0,
- 0,
- offsetof(fspan,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_item,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .link = offsetof(fspan, link),
+ .freef = (Dtfree_f)free_item,
};
/* appendFItemList:
}
static Dtdisc_t ImageDictDisc = {
- offsetof(usershape_t, name),/* key */
- -1, /* size */
- 0, /* link offset */
- NIL(Dtmake_f),
- (Dtfree_f) ps_image_free,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(usershape_t, name),
+ .size = -1,
+ .freef = (Dtfree_f)ps_image_free,
};
static usershape_t *user_init(const char *str)
}
static Dtdisc_t mapDisc = {
- offsetof(item, p),
- sizeof(2 * sizeof(void *)),
- offsetof(item, link),
- (Dtmake_f) newItem,
- (Dtfree_f) freeItem,
- (Dtcompar_f) cmpItem,
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(item, p),
+ .size = sizeof(2 * sizeof(void *)),
+ .link = offsetof(item, link),
+ .makef = (Dtmake_f)newItem,
+ .freef = (Dtfree_f)freeItem,
+ .comparf = (Dtcompar_f)cmpItem,
};
/* cloneEdge:
}
static Dtdisc_t strDisc = {
- offsetof(clust_t,name),
- -1,
- offsetof(clust_t,link),
- NIL(Dtmake_f),
- (Dtfree_f)free_clust,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(clust_t, name),
+ .size = -1,
+ .link = offsetof(clust_t, link),
+ .freef = (Dtfree_f)free_clust,
};
static void fillMap (Agraph_t* g, Dt_t* map)
}
static Dtdisc_t ImageDictDisc = {
- offsetof(usershape_t, name), /* key */
- -1, /* size */
- 0, /* link offset */
- NIL(Dtmake_f),
- usershape_close,
- NIL(Dtcompar_f),
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(usershape_t, name),
+ .size = -1,
+ .freef = usershape_close,
};
usershape_t *gvusershape_find(const char *name)
}
static Dtdisc_t edgepair = {
- offsetof(edgepair_t, key),
- sizeof(Agedge_t*),
- offsetof(edgepair_t, link),
- NIL(Dtmake_f),
- NIL(Dtfree_f),
- (Dtcompar_f) cmppair,
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(edgepair_t, key),
+ .size = sizeof(Agedge_t *),
+ .link = offsetof(edgepair_t, link),
+ .comparf = (Dtcompar_f)cmppair,
};
/* cloneGraph:
}
static Dtdisc_t itemdisc = {
- offsetof(item, a),
- 2 * sizeof(int),
- offsetof(item, link),
- (Dtmake_f) newItem,
- (Dtfree_f) freeItem,
- (Dtcompar_f) cmpItem,
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(item, a),
+ .size = 2 * sizeof(int),
+ .link = offsetof(item, link),
+ .makef = (Dtmake_f)newItem,
+ .freef = (Dtfree_f)freeItem,
+ .comparf = (Dtcompar_f)cmpItem,
};
static void addMap(Dt_t * map, int a, int b, int t)
}
static Dtdisc_t ipairdisc = {
- offsetof(Ipair, i),
- sizeof(int),
- offsetof(Ipair, link),
- (Dtmake_f) newIpair,
- (Dtfree_f) freeIpair,
- (Dtcompar_f) cmpIpair,
- NIL(Dthash_f),
- NIL(Dtmemory_f),
- NIL(Dtevent_f)
+ .key = offsetof(Ipair, i),
+ .size = sizeof(int),
+ .link = offsetof(Ipair, link),
+ .makef = (Dtmake_f)newIpair,
+ .freef = (Dtfree_f)freeIpair,
+ .comparf = (Dtcompar_f)cmpIpair,
};
static void vmapAdd(Dt_t * map, int i, int j)