Fixes https://gitlab.com/graphviz/graphviz/-/issues/2178.
}
gvFinalize(Gvc);
r = gvFreeContext(Gvc);
- return (MAX(rc,r));
+ graphviz_exit(MAX(rc,r));
}
}
}
- return rv;
+ graphviz_exit(rv);
}
#include <getopt.h>
#include <gvc/gvc.h>
#include <common/globals.h>
+#include <cgraph/exit.h>
#ifdef _WIN32
static void usage(int v)
{
printf("%s",useString);
- exit(v);
+ graphviz_exit(v);
}
static char **parseArgs(int argc, char *argv[])
CMainWindow mainWin(&files);
mainWin.show();
ret = app.exec();
- return ret;
+ graphviz_exit(ret);
}
prevg = g;
}
- return 0;
+ graphviz_exit(0);
}
prevg = g;
}
- return 0;
+ graphviz_exit(0);
}
#include <cgraph/cgraph.h>
+#include <cgraph/exit.h>
#include <gvpr/gvpr.h>
#ifdef DEBUG
rv = gvpr (argc, argv, &opts);
- return rv;
+ graphviz_exit(rv);
}
#else
opts.flags = GV_USE_EXIT;
opts.bindings = 0;
-
- return gvpr (argc, argv, &opts);
+ graphviz_exit(gvpr(argc, argv, &opts));
}
#endif
term ();
#endif
printusage ();
- return 0;
+ graphviz_exit(0);
}
#else
processstr (leftyoptions);
argv = CommandLineToArgvW(lpCmdLine, &argc);
if (argv == NULL)
- return EXIT_FAILURE;
+ graphviz_exit(EXIT_FAILURE);
processargs(argc, argv);
LocalFree(argv);
#include "config.h"
#include <cgraph/cgraph.h>
+#include <cgraph/exit.h>
#include <ingraphs/ingraphs.h>
#include <common/pointset.h>
#include <getopt.h>
fp = fopen(name, "w");
if (!fp) {
std::cerr << cmd << ": could not open file " << name << " for writing\n";
- exit(-1);
+ graphviz_exit(-1);
}
return (fp);
}
usage (int eval)
{
std::cerr << use_msg;
- exit(eval);
+ graphviz_exit(eval);
}
/* checkG:
rv |= bundle (g, &opts);
}
- return rv;
+ graphviz_exit(rv);
}
if (VirtualQuery (&main, &mbi, sizeof(mbi)) == 0) {
fprintf (stderr,"failed to get handle for executable.\n");
- return 1;
+ graphviz_exit(1);
}
r = GetModuleFileName ((HMODULE)mbi.AllocationBase, line, BSZ);
if (!r || (r == BSZ)) {
fprintf (stderr,"failed to get path for executable.\n");
- return 1;
+ graphviz_exit(1);
}
/* line contains path to smyrna: "$GVROOT\bin\smyrna.exe"
s = strrchr(line,'\\');
if (!s) {
fprintf (stderr,"no backslash in path %s.\n", line);
- return 1;
+ graphviz_exit(1);
}
while ((s != line) && (*(--s) != '\\')) ;
if (s == line) {
fprintf (stderr,"no backslash in path %s.\n", line);
- return 1;
+ graphviz_exit(1);
}
*s = '\0';
g_free(package_data_dir);
#endif
g_free(package_locale_dir);
- return 0;
+ graphviz_exit(0);
}
gcnt++;
}
- return r;
+ graphviz_exit(r);
}
agclose(g);
}
- return r;
+ graphviz_exit(r);
}
if (n_graphs > 1)
wcp(tot_nodes, tot_edges, tot_cc, tot_cl, "total", 0);
- return rv;
+ graphviz_exit(rv);
}
#include <gml2gv.h>
#include <agxbuf.h>
#include <assert.h>
+#include <cgraph/exit.h>
#define NEW(t) malloc(sizeof(t))
#define N_NEW(n,t) calloc((n),sizeof(t))
for (np = dtfirst(graph->nodelist); np; np = dtnext(graph->nodelist, np)) {
if (!np->id) {
fprintf (stderr, "node without an id attribute");
- exit (1);
+ graphviz_exit (1);
}
n = agnode (g, np->id, 1);
addAttrs ((Agobj_t*)n, np->attrlist, xb, unk);
for (ep = dtfirst(graph->edgelist); ep; ep = dtnext(graph->edgelist, ep)) {
if (!ep->source) {
fprintf (stderr, "edge without an source attribute");
- exit (1);
+ graphviz_exit (1);
}
if (!ep->target) {
fprintf (stderr, "node without an target attribute");
- exit (1);
+ graphviz_exit (1);
}
n = agnode (g, ep->source, 1);
h = agnode (g, ep->target, 1);
agwrite(g, pv.outf);
- return 0;
+ graphviz_exit(0);
}
agclose(g);
}
- return (ig.errors != 0 || agerrors() != 0) ? EXIT_FAILURE : EXIT_SUCCESS;
+ graphviz_exit(ig.errors != 0 || agerrors() != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}
agclose(g);
}
- return 0;
+ graphviz_exit(0);
}
agclose(g);
}
- return 0;
+ graphviz_exit(0);
}
transform(g);
agwrite(g, outFile);
}
- return 0;
+ graphviz_exit(0);
}
gdImageDestroy(B);
gdImageDestroy(C);
- return (rc ? EXIT_FAILURE : EXIT_SUCCESS);
+ graphviz_exit(rc ? EXIT_FAILURE : EXIT_SUCCESS);
}
default:
fprintf(stderr, "unexpected error\n");
- return EXIT_FAILURE;
+ graphviz_exit(EXIT_FAILURE);
}
}
for (int i = optind; i < argc; ++i) {
int r = xml_escape(argv[i], flags, put, stdout);
if (r < 0)
- return EXIT_FAILURE;
+ graphviz_exit(EXIT_FAILURE);
}
- return EXIT_SUCCESS;
+ graphviz_exit(EXIT_SUCCESS);
}
#endif
fprintf (stdout, "%g = %s %d\n", test[i], buf, len);
}
- return 0;
+ graphviz_exit(0);
}
#endif
init(argc, argv, &opts);
doxlabel(&opts);
- return 0;
+ graphviz_exit(0);
}