Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
gvpr.h
Go to the documentation of this file.
1
6/*************************************************************************
7 * Copyright (c) 2011 AT&T Intellectual Property
8 * All rights reserved. This program and the accompanying materials
9 * are made available under the terms of the Eclipse Public License v1.0
10 * which accompanies this distribution, and is available at
11 * https://www.eclipse.org/legal/epl-v10.html
12 *
13 * Contributors: Details at https://graphviz.org
14 *************************************************************************/
15
16#pragma once
17
18#include <stddef.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#ifdef GVDLL
25#ifdef EXPORT_GVPR
26#define GVPR_API __declspec(dllexport)
27#else
28#define GVPR_API __declspec(dllimport)
29#endif
30#endif
31
32#ifndef GVPR_API
33#define GVPR_API /* nothing */
34#endif
35
36#include "cgraph.h"
37#ifdef _MSC_VER
38#include <BaseTsd.h>
39typedef SSIZE_T ssize_t;
40#endif
41
42/* Bits for flags variable in gvprstate_t.
43 * Included here so that calling programs can use the first
44 * two in gvpropts.flags
45 */
46 /* If set, gvpr calls exit() on errors */
47#define GV_USE_EXIT 1
48 /* If set, gvpr stores output graphs in gvpropts */
49#define GV_USE_OUTGRAPH 2
50 /* Use longjmp to return to top-level call in gvpr */
51#define GV_USE_JUMP 4
52 /* $tvnext has been set but not used */
53#define GV_NEXT_SET 8
54
55
56typedef ssize_t (*gvprwr) (void*, const char *buf, size_t nbyte, void*);
57typedef int (*gvpruserfn) (char *);
58typedef struct {
59 char* name;
62
63typedef struct {
64 Agraph_t** ingraphs; /* NULL-terminated array of input graphs */
65 size_t n_outgraphs;
67 gvprwr out; /* write function for stdout */
68 gvprwr err; /* write function for stderr */
69 int flags;
70 gvprbinding* bindings; /* array of bindings, terminated with {NULL,NULL} */
71} gvpropts;
72
73GVPR_API extern int gvpr (int argc, char *argv[], gvpropts* opts);
74
75#ifdef __cplusplus
76}
77#endif
abstract graph C library, Cgraph API
static opts_t opts
Definition gvgen.c:394
ssize_t(* gvprwr)(void *, const char *buf, size_t nbyte, void *)
Definition gvpr.h:56
int(* gvpruserfn)(char *)
Definition gvpr.h:57
int gvpr(int argc, char *argv[], gvpropts *opts)
Definition gvpr.c:1041
graph or subgraph
Definition cgraph.h:425
char * name
Definition gvpr.h:59
gvpruserfn fn
Definition gvpr.h:60
size_t n_outgraphs
if GV_USE_OUTGRAPH set, output graphs
Definition gvpr.h:65
Agraph_t ** outgraphs
Definition gvpr.h:66
gvprwr out
Definition gvpr.h:67
gvprbinding * bindings
Definition gvpr.h:70
int flags
Definition gvpr.h:69
gvprwr err
Definition gvpr.h:68
Agraph_t ** ingraphs
Definition gvpr.h:64