Be consistent about generation of global variable: Output_lang, Output_file, Obj
Make rec_attach_bb() static in output.c and remove from renderprocs.h
#include "gvc.h"
#include <ctype.h>
-int Obj;
static attrsym_t *G_peripheries;
static char *defaultlinestyle[3] = { "solid\0", "setlinewidth\0001\0", 0 };
}
}
-void emit_eof(GVC_t * gvc)
+void emit_jobs_eof(GVC_t * gvc)
{
- if (gvc->job->pageNum > 0) {
- emit_deinit_job(gvc);
- emit_once_reset();
+ gvrender_job_t *job;
+
+ for (job = gvrender_first_job(gvc); job; job = gvrender_next_job(gvc)) {
+ if (job->output_file) {
+ if (gvc->job->pageNum > 0) {
+ emit_deinit_job(gvc);
+ emit_once_reset();
+ }
+ fclose(job->output_file);
+ job->output_file = NULL;
+ }
}
}
external int y_invert; /* invert y in dot & plain output */
#ifndef DISABLE_CODEGENS
- external int Output_lang; /* POSTSCRIPT, DOT, etc. */
- external FILE *Output_file;
- external int Obj;
+ EXTERN int Output_lang; /* POSTSCRIPT, DOT, etc. */
+ EXTERN FILE *Output_file;
+ EXTERN int Obj;
extern codegen_t FIG_CodeGen, HPGL_CodeGen, MAP_CodeGen,
MIF_CodeGen, XDot_CodeGen, MP_CodeGen, PIC_CodeGen,
void dotneato_terminate(GVC_t * gvc)
{
- dotneato_eof(gvc);
+ emit_jobs_eof(gvc);
exit(graphviz_errors + agerrors());
}
#include "gvc.h"
#include "agxbuf.h"
-#ifndef DISABLE_CODEGENS
-FILE *Output_file;
-int Output_lang;
-#endif
-
static int e_arrows; /* graph has edges with end arrows */
static int s_arrows; /* graph has edges with start arrows */
static agxbuf outbuf;
agwrite(g, f);
}
-void dotneato_eof(GVC_t * gvc)
-{
- gvrender_job_t *job;
-
- for (job = gvrender_first_job(gvc); job; job = gvrender_next_job(gvc)) {
- if (job->output_file) {
- emit_eof(gvc);
- fclose(job->output_file);
- job->output_file = NULL;
- }
- }
-}
-
static void set_record_rects(node_t * n, field_t * f, agxbuf * xb)
{
int i;
set_record_rects(n, f->fld[i], xb);
}
+static void rec_attach_bb(graph_t * g)
+{
+ int c;
+ char buf[32];
+ point pt;
+
+ sprintf(buf, "%d,%d,%d,%d", GD_bb(g).LL.x, Y(GD_bb(g).LL.y),
+ GD_bb(g).UR.x, Y(GD_bb(g).UR.y));
+ agset(g, "bb", buf);
+ if (GD_label(g) && GD_label(g)->text[0]) {
+ pt = GD_label(g)->p;
+ sprintf(buf, "%d,%d", pt.x, Y(pt.y));
+ agset(g, "lp", buf);
+ }
+ for (c = 1; c <= GD_n_cluster(g); c++)
+ rec_attach_bb(GD_clust(g)[c]);
+}
+
void attach_attrs(graph_t * g)
{
int i, j, sides;
if (HAS_CLUST_EDGE(g))
undoClusterEdges(g);
}
-
-void rec_attach_bb(graph_t * g)
-{
- int c;
- char buf[32];
- point pt;
-
- sprintf(buf, "%d,%d,%d,%d", GD_bb(g).LL.x, Y(GD_bb(g).LL.y),
- GD_bb(g).UR.x, Y(GD_bb(g).UR.y));
- agset(g, "bb", buf);
- if (GD_label(g) && GD_label(g)->text[0]) {
- pt = GD_label(g)->p;
- sprintf(buf, "%d,%d", pt.x, Y(pt.y));
- agset(g, "lp", buf);
- }
- for (c = 1; c <= GD_n_cluster(g); c++)
- rec_attach_bb(GD_clust(g)[c]);
-}
extern void dotneato_usage(int);
extern void dotneato_postprocess(Agraph_t *, nodesizefn_t);
extern void dotneato_set_margins(GVC_t * gvc, Agraph_t *);
- extern void dotneato_eof(GVC_t * gvc);
extern void dotneato_terminate(GVC_t * gvc);
extern void dotneato_write(GVC_t * gvc, graph_t *g);
extern void dotneato_write_one(GVC_t * gvc, graph_t *g);
extern void enqueue_neighbors(queue *, Agnode_t *, int);
extern void emit_attachment(GVC_t * gvc, textlabel_t *, splines *);
extern void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags);
- extern void emit_eof(GVC_t * gvc);
extern void emit_graph(GVC_t * gvc, graph_t * g);
extern void emit_label(GVC_t * gvc, textlabel_t *, void *obj);
extern int emit_once(char *message);
extern void emit_jobs(GVC_t * gvc, graph_t *g);
+ extern void emit_jobs_eof(GVC_t * gvc);
extern void endpath(path *, Agedge_t *, int, pathend_t *, boolean);
extern void epsf_init(node_t * n);
extern void epsf_free(node_t * n);
extern int processClusterEdges(graph_t * g);
extern char *ps_string(char *s);
extern void rank(graph_t * g, int balance, int maxiter);
- extern void rec_attach_bb(Agraph_t *);
extern void routesplinesinit(void);
extern point *routesplines(path *, int *);
extern void routesplinesterm(void);