summaryrefslogtreecommitdiff
blob: 24c264e920d3bbc1479e98925a9a850c4fbc9eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
--- a/bindings/perl-shared/RRDs.xs
+++ b/bindings/perl-shared/RRDs.xs
@@ -189,6 +189,7 @@
 	OUTPUT:
 		RETVAL
 
+#ifdef HAVE_RRD_GRAPH
 SV *
 rrd_graph(...)
 	PROTOTYPE: @	
@@ -235,6 +236,8 @@
 		PUSHs(sv_2mortal(newSViv(xsize)));
 		PUSHs(sv_2mortal(newSViv(ysize)));
 
+#endif /* HAVE_RRD_GRAPH */
+
 SV *
 rrd_fetch(...)
 	PROTOTYPE: @	
@@ -313,6 +316,7 @@
 		PUSHs(sv_2mortal(newSVuv(start_tmp)));
 		PUSHs(sv_2mortal(newSVuv(end_tmp)));
 
+#ifdef HAVE_RRD_GRAPH
 int
 rrd_xport(...)
 	PROTOTYPE: @	
@@ -371,6 +375,8 @@
 		PUSHs(sv_2mortal(newRV_noinc((SV*)names)));
 		PUSHs(sv_2mortal(newRV_noinc((SV*)retar)));
 
+#endif /* HAVE_RRD_GRAPH */
+
 SV*
 rrd_info(...)
 	PROTOTYPE: @	
@@ -397,6 +403,7 @@
     OUTPUT:
 	   RETVAL
 
+#ifdef HAVE_RRD_GRAPH
 SV*
 rrd_graphv(...)
 	PROTOTYPE: @	
@@ -410,6 +417,8 @@
     OUTPUT:
 	   RETVAL
 
+#endif /* HAVE_RRD_GRAPH */
+
 int
 rrd_dump(...)
        PROTOTYPE: @
--- a/bindings/lua/rrdlua.c
+++ b/bindings/lua/rrdlua.c
@@ -267,6 +267,7 @@
   return 1;
 }
 
+#ifdef HAVE_RRD_GRAPH
 static int
 lua_rrd_graph (lua_State * L)
 {
@@ -291,6 +292,7 @@
   rrd_freemem(calcpr);
   return 3;
 }
+#endif /* HAVE_RRD_GRAPH */
 
 static int
 lua_rrd_flushcached(lua_State *L)
@@ -305,11 +307,13 @@
   return lua_rrd_infocall(L, "info", rrd_info);
 }
 
+#ifdef HAVE_RRD_GRAPH
 static int
 lua_rrd_graphv (lua_State * L)
 {
   return lua_rrd_infocall(L, "graphv", rrd_graph_v);
 }
+#endif /* HAVE_RRD_GRAPH */
 
 static int
 lua_rrd_updatev (lua_State * L)
@@ -347,7 +351,9 @@
   {"dump", lua_rrd_dump},
   {"fetch", lua_rrd_fetch},
   {"first", lua_rrd_first},
+#ifdef HAVE_RRD_GRAPH
   {"graph", lua_rrd_graph},
+#endif /* HAVE_RRD_GRAPH */
   {"last", lua_rrd_last},
   {"resize", lua_rrd_resize},
   {"restore", lua_rrd_restore},
@@ -357,7 +363,9 @@
 #if defined(DINF)
   {"info", lua_rrd_info},
   {"updatev", lua_rrd_updatev},
+#ifdef HAVE_RRD_GRAPH
   {"graphv", lua_rrd_graphv},
+#endif /* HAVE_RRD_GRAPH */
 #endif
   {NULL, NULL}
 };
--- a/bindings/python/rrdtoolmodule.c
+++ b/bindings/python/rrdtoolmodule.c
@@ -261,6 +261,7 @@
     return r;
 }
 
+#ifdef HAVE_RRD_GRAPH
 static char PyRRD_graph__doc__[] =
     "graph(args..): Create a graph based on data from one or several RRD\n"
     "    graph filename [-s|--start seconds] "
@@ -327,6 +328,7 @@
     destroy_args(&argv);
     return r;
 }
+#endif /* HAVE_RRD_GRAPH */
 
 static char PyRRD_tune__doc__[] =
     "tune(args...): Modify some basic properties of a Round Robin Database\n"
@@ -503,6 +505,7 @@
     return r;
 }
 
+#ifdef HAVE_RRD_GRAPH
 static char PyRRD_graphv__doc__[] =
     "graphv is called in the same manner as graph";
 
@@ -530,6 +533,7 @@
     destroy_args(&argv);
     return r;
 }
+#endif /* HAVE_RRD_GRAPH */
 
 static char PyRRD_updatev__doc__[] =
     "updatev is called in the same manner as update";
@@ -587,6 +591,7 @@
     return r;
 }
 
+#ifdef HAVE_RRD_GRAPH
 static char PyRRD_xport__doc__[] =
     "xport(args..): dictionary representation of data stored in RRDs\n"
     "    [-s|--start seconds] [-e|--end seconds] [-m|--maxrows rows]"
@@ -664,6 +669,7 @@
     destroy_args(&argv);
     return r;
 }
+#endif /* HAVE_RRD_GRAPH */
 
 /* List of methods defined in the module */
 #define meth(name, func, doc) {name, (PyCFunction)func, METH_VARARGS, doc}
@@ -672,16 +678,22 @@
     meth("create", PyRRD_create, PyRRD_create__doc__),
     meth("update", PyRRD_update, PyRRD_update__doc__),
     meth("fetch", PyRRD_fetch, PyRRD_fetch__doc__),
+#ifdef HAVE_RRD_GRAPH
     meth("graph", PyRRD_graph, PyRRD_graph__doc__),
+#endif /* HAVE_RRD_GRAPH */
     meth("tune", PyRRD_tune, PyRRD_tune__doc__),
     meth("first", PyRRD_first, PyRRD_first__doc__),
     meth("last", PyRRD_last, PyRRD_last__doc__),
     meth("resize", PyRRD_resize, PyRRD_resize__doc__),
     meth("info", PyRRD_info, PyRRD_info__doc__),
+#ifdef HAVE_RRD_GRAPH
     meth("graphv", PyRRD_graphv, PyRRD_graphv__doc__),
+#endif /* HAVE_RRD_GRAPH */
     meth("updatev", PyRRD_updatev, PyRRD_updatev__doc__),
     meth("flushcached", PyRRD_flushcached, PyRRD_flushcached__doc__),
+#ifdef HAVE_RRD_GRAPH
     meth("xport", PyRRD_xport, PyRRD_xport__doc__),
+#endif /* HAVE_RRD_GRAPH */
     {NULL, NULL, 0, NULL}
 };
 
--- a/src/rrd_cgi.c
+++ b/src/rrd_cgi.c
@@ -56,6 +56,7 @@
     const char **);
 
 /* call rrd_graph and insert appropriate image tag */
+#ifdef HAVE_RRD_GRAPH
 char     *drawgraph(
     long,
     const char **);
@@ -64,6 +65,7 @@
 char     *drawprint(
     long,
     const char **);
+#endif /* HAVE_RRD_GRAPH */
 
 /* pretty-print the <last></last> value for some.rrd via strftime() */
 char     *printtimelast(
@@ -542,9 +544,13 @@
         }
         parse(&buffer, i, "<RRD::GETVAR", rrdgetvar);
         parse(&buffer, i, "<RRD::GOODFOR", rrdgoodfor);
+#ifdef HAVE_RRD_GRAPH
         parse(&buffer, i, "<RRD::GRAPH", drawgraph);
+#endif /* HAVE_RRD_GRAPH */
         parse(&buffer, i, "<RRD::INCLUDE", includefile);
+#ifdef HAVE_RRD_GRAPH
         parse(&buffer, i, "<RRD::PRINT", drawprint);
+#endif /* HAVE_RRD_GRAPH */
         parse(&buffer, i, "<RRD::SETCONSTVAR", rrdsetvarconst);
         parse(&buffer, i, "<RRD::SETENV", rrdsetenv);
         parse(&buffer, i, "<RRD::SETVAR", rrdsetvar);
@@ -929,7 +935,7 @@
 }
 
 
-
+#ifdef HAVE_RRD_GRAPH
 char     *drawgraph(
     long argc,
     const char **args)
@@ -961,6 +967,7 @@
     }
     return NULL;
 }
+#endif /* HAVE_RRD_GRAPH */
 
 char     *drawprint(
     long argc,