]> granicus.if.org Git - graphviz/commitdiff
revert previous change - breaks build
authorJohn Ellson <ellson@research.att.com>
Tue, 9 Feb 2016 18:09:54 +0000 (13:09 -0500)
committerJohn Ellson <ellson@research.att.com>
Tue, 9 Feb 2016 18:09:54 +0000 (13:09 -0500)
lib/gvc/gvcontext.c

index 65c2aa3419cd9a4743104a8cf5c048fc18059f6e..7600e14ae169a80fe140c6b72a57aaf7afaca3ee 100644 (file)
@@ -75,13 +75,6 @@ int gvFreeContext(GVC_t * gvc)
 {
     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;
@@ -102,15 +95,25 @@ int gvFreeContext(GVC_t * gvc)
     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());
 }