Graphviz  2.41.20170921.2350
gvc.h
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #ifndef GVC_H
15 #define GVC_H
16 
17 #include "types.h"
18 #include "gvplugin.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #ifdef GVDLL
25 #define extern __declspec(dllexport)
26 #else
27 #define extern
28 #endif
29 
30 /*visual studio*/
31 #ifdef _WIN32
32 #ifndef GVC_EXPORTS
33 #undef extern
34 #define extern __declspec(dllimport)
35 #endif
36 #endif
37 /*end visual studio*/
38 
39 #define LAYOUT_DONE(g) (agbindrec(g, "Agraphinfo_t", 0, TRUE) && GD_drawing(g))
40 
41 /* misc */
42 /* FIXME - this needs eliminating or renaming */
43 extern void gvToggle(int);
44 
45 /* set up a graphviz context */
46 extern GVC_t *gvNEWcontext(const lt_symlist_t *builtins, int demand_loading);
47 
48 /* set up a graphviz context - and init graph - retaining old API */
49 extern GVC_t *gvContext(void);
50 /* set up a graphviz context - and init graph - with builtins */
51 extern GVC_t *gvContextPlugins(const lt_symlist_t *builtins, int demand_loading);
52 
53 /* get information associated with a graphviz context */
54 extern char **gvcInfo(GVC_t*);
55 extern char *gvcVersion(GVC_t*);
56 extern char *gvcBuildDate(GVC_t*);
57 
58 /* parse command line args - minimally argv[0] sets layout engine */
59 extern int gvParseArgs(GVC_t *gvc, int argc, char **argv);
62 
63 /* Compute a layout using a specified engine */
64 extern int gvLayout(GVC_t *gvc, graph_t *g, const char *engine);
65 
66 /* Compute a layout using layout engine from command line args */
67 extern int gvLayoutJobs(GVC_t *gvc, graph_t *g);
68 
69 /* Render layout into string attributes of the graph */
70 extern void attach_attrs(graph_t *g);
71 
72 /* Render layout in a specified format to an open FILE */
73 extern int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out);
74 
75 /* Render layout in a specified format to a file with the given name */
76 extern int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename);
77 
78 /* Render layout in a specified format to an external context */
79 extern int gvRenderContext(GVC_t *gvc, graph_t *g, const char *format, void *context);
80 
81 /* Render layout in a specified format to a malloc'ed string */
82 extern int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsigned int *length);
83 
84 /* Free memory allocated and pointed to by *result in gvRenderData */
85 extern void gvFreeRenderData (char* data);
86 
87 /* Render layout according to -T and -o options found by gvParseArgs */
88 extern int gvRenderJobs(GVC_t *gvc, graph_t *g);
89 
90 /* Clean up layout data structures - layouts are not nestable (yet) */
91 extern int gvFreeLayout(GVC_t *gvc, graph_t *g);
92 
93 /* Clean up graphviz context */
94 extern void gvFinalize(GVC_t *gvc);
95 extern int gvFreeContext(GVC_t *gvc);
96 
97 /* Return list of plugins of type kind.
98  * kind would normally be "render" "layout" "textlayout" "device" "loadimage"
99  * The size of the list is stored in sz.
100  * The caller is responsible for freeing the storage. This involves
101  * freeing each item, then the list.
102  * Returns NULL on error, or if there are no plugins.
103  * In the former case, sz is unchanged; in the latter, sz = 0.
104  *
105  * At present, the str argument is unused, but may be used to modify
106  * the search as in gvplugin_list above.
107  */
108 extern char** gvPluginList (GVC_t *gvc, const char* kind, int* sz, char*);
109 
114 extern void gvAddLibrary(GVC_t *gvc, gvplugin_library_t *lib);
115 
119 extern int gvToolTred(graph_t *g);
120 
121 #undef extern
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif /* GVC_H */
char ** gvcInfo(GVC_t *gvc)
Definition: gvc.c:242
int gvParseArgs(GVC_t *gvc, int argc, char **argv)
Definition: args.c:272
int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename)
Definition: gvc.c:117
int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsigned int *length)
Definition: gvc.c:182
int gvToolTred(graph_t *g)
Definition: gvtool_tred.c:73
char * gvcBuildDate(GVC_t *gvc)
Definition: gvc.c:244
graph_t * gvPluginsGraph(GVC_t *gvc)
Definition: input.c:213
int gvRenderJobs(GVC_t *gvc, graph_t *g)
Definition: emit.c:4094
int gvFreeLayout(GVC_t *gvc, graph_t *g)
Definition: gvlayout.c:102
char * gvcVersion(GVC_t *gvc)
Definition: gvc.c:243
void gvFreeRenderData(char *data)
Definition: gvc.c:232
char ** gvPluginList(GVC_t *gvc, const char *kind, int *sz, char *)
void gvFinalize(GVC_t *gvc)
Definition: gvcontext.c:65
graph_t * gvNextInputGraph(GVC_t *gvc)
Definition: input.c:537
int gvLayoutJobs(GVC_t *gvc, graph_t *g)
Definition: gvlayout.c:55
Definition: gvcint.h:70
void gvToggle(int s)
Definition: utils.c:610
GVC_t * gvContextPlugins(const lt_symlist_t *builtins, int demand_loading)
Definition: gvc.c:36
int gvRenderContext(GVC_t *gvc, graph_t *g, const char *format, void *context)
Definition: gvc.c:148
int gvLayout(GVC_t *gvc, graph_t *g, const char *engine)
Definition: gvc.c:53
GVC_t * gvc
Definition: htmlparse.c:87
int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out)
Definition: gvc.c:85
GVC_t * gvContext(void)
Definition: gvc.c:25
int gvFreeContext(GVC_t *gvc)
Definition: gvcontext.c:72
GVC_t * gvNEWcontext(const lt_symlist_t *builtins, int demand_loading)
Definition: gvcontext.c:52
void gvAddLibrary(GVC_t *gvc, gvplugin_library_t *lib)
Definition: gvc.c:237
void attach_attrs(graph_t *g)
Definition: output.c:399
Definition: legal.c:60