{
GVG_t *gvg, *gvg_next;
gvplugin_package_t *package, *package_next;
- gvplugin_available_t *api, *api_next;
-
-#define ELEM(x) +1
- /* See gvcext.h for APIS and gvcint.h for an example usage of "+1"
- to get the number of APIs. */
- unsigned int num_apis = APIS, i;
-#undef ELEM
emit_once_reset();
gvg_next = gvc->gvgs;
if (gvc->input_filenames)
free(gvc->input_filenames);
textfont_dict_close(gvc);
+ free(gvc);
+ return (graphviz_errors + agerrors());
+}
- for (i = 0; i != num_apis; ++i) {
- for (api = gvc->apis[i]; api != NULL; api = api_next) {
- api_next = api->next;
- free(api);
- }
- }
+GVC_t* gvCloneGVC (GVC_t * gvc0)
+{
+ GVC_t *gvc = zmalloc(sizeof(GVC_t));
+ gvc->common = gvc0->common;
+ memcpy (&gvc->apis, &gvc0->apis, sizeof(gvc->apis));
+ memcpy (&gvc->api, &gvc0->api, sizeof(gvc->api));
+ gvc->packages = gvc->packages;
+
+ return gvc;
+}
+
+void gvFreeCloneGVC (GVC_t * gvc)
+{
+ gvjobs_delete(gvc);
free(gvc);
- return (graphviz_errors + agerrors());
}