Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
gvjobs.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include "config.h"
12
13#include <common/types.h>
14#include <gvc/gvplugin.h>
15#include <gvc/gvcjob.h>
16#include <gvc/gvcint.h>
17#include <gvc/gvcproc.h>
18#include <stdbool.h>
19#include <stddef.h>
20#include <util/alloc.h>
21
24
25/*
26 * -T and -o can be specified in any order relative to the other, e.g.
27 * -T -T -o -o
28 * -T -o -o -T
29 * The first -T is paired with the first -o, the second with the second, and so on.
30 *
31 * If there are more -T than -o, then the last -o is repeated for the remaining -T
32 * and vice-versa
33 *
34 * If there are no -T or -o then a single job is instantiated.
35 *
36 * If there is no -T on the first job, then "dot" is used.
37 *
38 * As many -R as are specified before a completed -T -o pair (according to the above rules)
39 * are used as renderer-specific switches for just that one job. -R must be restated for
40 * each job.
41 */
42
43/* -o switches */
44void gvjobs_output_filename(GVC_t * gvc, const char *name)
45{
46 if (!gvc->jobs) {
48 } else {
51 } else {
54 }
56 }
57 }
60}
61
62/* -T switches */
63bool gvjobs_output_langname(GVC_t * gvc, const char *name)
64{
65 if (!gvc->jobs) {
67 } else {
70 } else {
73 }
75 }
76 }
79
80 /* load it now to check that it exists */
81 if (gvplugin_load(gvc, API_device, name, NULL))
82 return true;
83 return false;
84}
85
87{
88 return (gvc->job = gvc->jobs);
89}
90
92{
93 GVJ_t *job = gvc->job->next;
94
95 if (job) {
96 /* if langname not specified, then repeat previous value */
97 if (!job->output_langname)
99 /* if filename not specified, then leave NULL to indicate stdout */
100 }
101 return (gvc->job = job);
102}
103
105{
106 GVJ_t *job, *j;
107
108 job = gvc->jobs;
109 while ((j = job)) {
110 job = job->next;
113 free(j);
114 }
116 NULL;
117 gvc->common.viewNum = 0;
118}
Memory allocation wrappers that exit on failure.
static void * gv_alloc(size_t size)
Definition alloc.h:47
void free(void *)
node NULL
Definition grammar.y:163
static GVC_t * gvc
Definition gv.cpp:23
gvplugin_available_t * gvplugin_load(GVC_t *gvc, api_t api, const char *type, FILE *debug)
Definition gvplugin.c:250
void gvjobs_output_filename(GVC_t *gvc, const char *name)
Definition gvjobs.c:44
static GVJ_t * output_langname_job
Definition gvjobs.c:23
bool gvjobs_output_langname(GVC_t *gvc, const char *name)
Definition gvjobs.c:63
void gvjobs_delete(GVC_t *gvc)
Definition gvjobs.c:104
static GVJ_t * output_filename_job
Definition gvjobs.c:22
GVJ_t * gvjobs_first(GVC_t *gvc)
Definition gvjobs.c:86
GVJ_t * gvjobs_next(GVC_t *gvc)
Definition gvjobs.c:91
int viewNum
rendering state
Definition gvcommon.h:29
Definition gvcint.h:80
GVJ_t * active_jobs
Definition gvcint.h:123
GVCOMMON_t common
Definition gvcint.h:81
GVJ_t * jobs
Definition gvcint.h:114
GVJ_t * job
Definition gvcint.h:115
GVJ_t * next
Definition gvcjob.h:264
const char * output_filename
Definition gvcjob.h:276
char * active_tooltip
Definition gvcjob.h:350
char * selected_href
Definition gvcjob.h:351
GVC_t * gvc
Definition gvcjob.h:263
const char * output_langname
Definition gvcjob.h:282
graphs, nodes and edges info: Agraphinfo_t, Agnodeinfo_t and Agedgeinfo_t