summaryrefslogtreecommitdiffstats
path: root/rrd-upstream.patch
blob: 20d0f2bc7a918f5050acffe9717ec8c32b7f92f9 (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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
--- pecl/rrd/trunk/rrd_create.c	2015/06/16 16:14:28	336980
+++ pecl/rrd/trunk/rrd_create.c	2015/06/16 16:20:26	336981
@@ -102,9 +102,9 @@
 PHP_METHOD(RRDCreator, __construct)
 {
 	rrd_create_object *intern_obj;
-	char *path; int path_length;
+	char *path; size_t path_length;
 	/* better to set defaults for optional parameters */
-	char *start_time = NULL; int start_time_length = 0;
+	char *start_time = NULL; size_t start_time_length = 0;
 	long step = 0;
 	int argc = ZEND_NUM_ARGS();
 
@@ -146,7 +146,7 @@
 {
 	rrd_create_object *intern_obj;
 	char *desc, *rrd_source_desc;
-	int desc_length;
+	size_t desc_length;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &desc, &desc_length) == FAILURE) {
 		return;
@@ -181,7 +181,7 @@
 {
 	rrd_create_object *intern_obj;
 	char *desc, *rrd_archive_desc;
-	int desc_length;
+	size_t desc_length;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &desc, &desc_length) == FAILURE) {
 		return;
@@ -284,7 +284,7 @@
 PHP_FUNCTION(rrd_create)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	zval *zv_arr_options;
 	rrd_args *argv;
 
--- pecl/rrd/trunk/rrd_graph.c	2015/06/16 16:14:28	336980
+++ pecl/rrd/trunk/rrd_graph.c	2015/06/16 16:20:26	336981
@@ -89,7 +89,7 @@
 {
 	rrd_graph_object *intern_obj;
 	char *path;
-	int path_length;
+	size_t path_length;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &path_length) == FAILURE) {
 		return;
@@ -294,7 +294,7 @@
 PHP_FUNCTION(rrd_graph)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	zval *zv_arr_options;
 	rrd_args *argv;
 	/* returned values if rrd_graph doesn't fail */
--- pecl/rrd/trunk/rrd_info.c	2015/06/16 16:14:28	336980
+++ pecl/rrd/trunk/rrd_info.c	2015/06/16 16:20:26	336981
@@ -25,7 +25,7 @@
 PHP_FUNCTION(rrd_info)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	/* list of arguments for rrd_info call, it's more efficient then u
 	 * usage of rrd_args, because there isn't array of arguments in parameters
 	 */
--- pecl/rrd/trunk/rrd_update.c	2015/06/16 16:14:28	336980
+++ pecl/rrd/trunk/rrd_update.c	2015/06/16 16:20:26	336981
@@ -83,7 +83,7 @@
 {
 	rrd_update_object *intern_obj;
 	char *path;
-	int path_length;
+	size_t path_length;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &path_length) == FAILURE) {
 		return;
@@ -107,7 +107,7 @@
 	rrd_args *update_argv;
 
 	char *time = NULL;
-	int time_str_length = 0;
+	size_t time_str_length = 0;
 
 	int argc = ZEND_NUM_ARGS();
 	zend_string *zs_ds_name;
@@ -215,7 +215,7 @@
 PHP_FUNCTION(rrd_update)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	zval *zv_arr_options;
 	rrd_args *argv;
 
Index: rrd_create.c
===================================================================
--- pecl/rrd/trunk/rrd_create.c	(révision 336981)
+++ pecl/rrd/trunk/rrd_create.c	(copie de travail)
@@ -30,7 +30,6 @@
 of having dedicated creating/cloning/destruction functions
 */
 typedef struct _rrd_create_object {
-	zend_object std;
 	/** path to newly created rrd file */
 	char *file_path;
 	/* "--start" parameters in rrd create */
@@ -41,6 +40,7 @@
 	zval zv_arr_data_sources;
 	/* "RRA" parameters in rrd create */
 	zval zv_arr_archives;
+	zend_object std;
 } rrd_create_object;
 
 /**
@@ -79,7 +79,7 @@
 static zend_object *rrd_create_object_new(zend_class_entry *ce)
 {
 	rrd_create_object *intern_obj = ecalloc(1, sizeof(rrd_create_object) + 
-		sizeof(zval) * (ce->default_properties_count - 1));
+		zend_object_properties_size(ce));
 	intern_obj->file_path = NULL;
 	intern_obj->start_time = NULL;
 	ZVAL_UNDEF(&intern_obj->zv_step);
@@ -329,7 +329,7 @@
 	PHP_ME(RRDCreator, save, NULL, ZEND_ACC_PUBLIC)
 	PHP_ME(RRDCreator, addDataSource, arginfo_rrdcreator_description, ZEND_ACC_PUBLIC)
 	PHP_ME(RRDCreator, addArchive, arginfo_rrdcreator_description, ZEND_ACC_PUBLIC)
-	{NULL, NULL, NULL}
+	PHP_FE_END
 };
 
 /* minit hook, called from main module minit */
Index: rrd_graph.c
===================================================================
--- pecl/rrd/trunk/rrd_graph.c	(révision 336981)
+++ pecl/rrd/trunk/rrd_graph.c	(copie de travail)
@@ -32,9 +32,9 @@
  * of having dedicated creating/cloning/destruction functions
  */
 typedef struct _rrd_graph_object {
-	zend_object std;
 	char *file_path;
 	zval zv_arr_options;
+	zend_object std;
 } rrd_graph_object;
 
 /**
@@ -69,7 +69,7 @@
 static zend_object *rrd_graph_object_new(zend_class_entry *ce)
 {
 	rrd_graph_object *intern_obj = ecalloc(1, sizeof(rrd_graph_object) + 
-		sizeof(zval) * (ce->default_properties_count - 1));
+		zend_object_properties_size(ce));
 	intern_obj->file_path = NULL;
 	ZVAL_UNDEF(&intern_obj->zv_arr_options);
 
@@ -370,7 +370,7 @@
 	PHP_ME(RRDGraph, save, NULL, ZEND_ACC_PUBLIC)
 	PHP_ME(RRDGraph, saveVerbose, NULL, ZEND_ACC_PUBLIC)
 	PHP_ME(RRDGraph, setOptions, arginfo_rrd_options, ZEND_ACC_PUBLIC)
-	{NULL, NULL, NULL}
+	PHP_FE_END
 };
 
 /* minit hook, called from main module minit */
Index: rrd_update.c
===================================================================
--- pecl/rrd/trunk/rrd_update.c	(révision 336981)
+++ pecl/rrd/trunk/rrd_update.c	(copie de travail)
@@ -31,9 +31,9 @@
  * of having dedicated creating/cloning/destruction functions
  */
 typedef struct _rrd_update_object {
-	zend_object std;
 	/** path to newly created rrd file */
 	char *file_path;
+	zend_object std;
 } rrd_update_object;
 
 /**
@@ -63,8 +63,8 @@
 */
 static zend_object *rrd_update_object_new(zend_class_entry *ce)
 {
-	rrd_update_object *intern_obj = ecalloc(1, sizeof(rrd_update_object) + 
-		sizeof(zval) * (ce->default_properties_count - 1));
+	rrd_update_object *intern_obj = ecalloc(1, sizeof(rrd_update_object) +
+		zend_object_properties_size(ce));
 	intern_obj->file_path = NULL;
 
 	zend_object_std_init(&intern_obj->std, ce);
@@ -257,7 +257,7 @@
 static zend_function_entry rrd_update_methods[] = {
 	PHP_ME(RRDUpdater, __construct, arginfo_rrdupdater_construct, ZEND_ACC_PUBLIC)
 	PHP_ME(RRDUpdater, update, arginfo_rrdupdater_update, ZEND_ACC_PUBLIC)
-	{NULL, NULL, NULL}
+	PHP_FE_END
 };
 
 /* minit hook, called from main module minit */
@@ -271,5 +271,5 @@
 	memcpy(&rrd_update_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	rrd_update_handlers.clone_obj = NULL;
 	rrd_update_handlers.offset = XtOffsetOf(rrd_update_object, std);
-	rrd_update_handlers.free_obj = rrd_update_object_dtor; 
+	rrd_update_handlers.free_obj = rrd_update_object_dtor;
 }
Index: rrd.c
===================================================================
--- pecl/rrd/trunk/rrd.c	(revision 336979)
+++ pecl/rrd/trunk/rrd.c	(working copy)
@@ -17,6 +17,9 @@
 #include "ext/standard/info.h"
 
 #include <rrd.h>
+#ifdef HAVE_RRDC_DISCONNECT
+#include <rrd_client.h>
+#endif
 
 #include "php_rrd.h"
 #include "rrd_graph.h"
@@ -47,7 +50,7 @@
 PHP_FUNCTION(rrd_fetch)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	zval *zv_arr_options;
 	rrd_args *argv;
 	/* returned values if rrd_fetch doesn't fail */
@@ -147,7 +150,7 @@
 PHP_FUNCTION(rrd_first)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	long rraindex = 0;
 	/* return value from rrd_first_r call */
 	time_t rrd_first_return_val;
@@ -183,7 +186,7 @@
 PHP_FUNCTION(rrd_last)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	/* return value from rrd_first_r call */
 	time_t rrd_last_return_val;
 
@@ -212,7 +215,7 @@
 PHP_FUNCTION(rrd_lastupdate)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	/* list of arguments for rrd_lastupdate call, it's more efficient then
 	 * usage of rrd_args, because there isn't array of arguments in parameters
 	 */
@@ -297,7 +300,7 @@
 PHP_FUNCTION(rrd_restore)
 {
 	char *xml_filename, *rrd_filename;
-	int xml_filename_length, rrd_filename_length;
+	size_t xml_filename_length, rrd_filename_length;
 	zval *zv_arr_options = NULL;
 	/* this is merge of options and rrd_filename. This is needed because
 	 * rrd_args_init_by_phparray allows only one filename as argument, so
@@ -349,7 +352,7 @@
 PHP_FUNCTION(rrd_tune)
 {
 	char *filename;
-	int filename_length;
+	size_t filename_length;
 	zval *zv_arr_options;
 	rrd_args *argv;
 
@@ -569,7 +572,7 @@
 	PHP_FE(rrdc_disconnect, NULL)
 #endif
 	PHP_FE(rrd_version, NULL)
-	{NULL, NULL, NULL}
+	PHP_FE_END
 };
 /* }}} */