]> granicus.if.org Git - graphviz/commitdiff
Expose flush function to be used in Agiodisc_t of cgraph.
authorerg <devnull@localhost>
Thu, 3 Sep 2009 21:55:20 +0000 (21:55 +0000)
committererg <devnull@localhost>
Thu, 3 Sep 2009 21:55:20 +0000 (21:55 +0000)
lib/gvc/gvdevice.c
lib/gvc/gvio.h

index 93baf93ff69c8deda8c2a0afad25de8158058981..dfeefa052cd388b79121c424ce21cfffdc375451 100644 (file)
@@ -280,13 +280,15 @@ int gvputc(GVJ_t * job, int c)
     return c;
 }
 
-static void gvdevice_flush(GVJ_t * job)
+int gvflush (GVJ_t * job)
 {
     if (job->output_file
       && ! job->external_context
       && ! job->gvc->write_fn) {
-       fflush(job->output_file);
+       return fflush(job->output_file);
     }
+    else
+       return 0;
 }
 
 static void gvdevice_close(GVJ_t * job)
@@ -308,7 +310,7 @@ void gvdevice_format(GVJ_t * job)
 
     if (gvde && gvde->format)
        gvde->format(job);
-    gvdevice_flush(job);
+    gvflush (job);
 }
 
 void gvdevice_finalize(GVJ_t * job)
@@ -367,7 +369,7 @@ void gvdevice_finalize(GVJ_t * job)
 
     if (! finalized_p) {
         /* if the device has no finalization then it uses file output */
-       gvdevice_flush(job);
+       gvflush (job);
        gvdevice_close(job);
     }
 }
index 0b14a253fe124f695decb22bfdcd1209310fc9c7..97e4694f5a424be5214ab7812af338e2834078a5 100644 (file)
@@ -42,6 +42,7 @@ extern "C" {
     extern int gvferror (FILE *stream);
     extern int gvputc(GVJ_t * job, int c);
     extern int gvputs(GVJ_t * job, const char *s);
+    extern int gvflush (GVJ_t * job);
     extern void gvprintf(GVJ_t * job, const char *format, ...);
     extern void gvprintdouble(GVJ_t * job, double num); 
     extern void gvprintpointf(GVJ_t * job, pointf p);