Deleted Added
full compact
zend_API.c (446e5d0f) zend_API.c (6847fefa)
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 0.91 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |

--- 212 unchanged lines hidden (view full) ---

221
222
223ZEND_API inline int object_init(zval *arg)
224{
225 return object_init_ex(arg, &zend_standard_class_def);
226}
227
228
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 0.91 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |

--- 212 unchanged lines hidden (view full) ---

221
222
223ZEND_API inline int object_init(zval *arg)
224{
225 return object_init_ex(arg, &zend_standard_class_def);
226}
227
228
229ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
230{
231 zend_error(E_WARNING, "add_assoc_function() is no longer supported");
232 return FAILURE;
233}
234
235
229ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
230{
231 zval *tmp = (zval *) emalloc(sizeof(zval));
232
233 tmp->type = IS_LONG;
234 tmp->value.lval = n;
235 INIT_PZVAL(tmp);
236 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
237}
238
239
236ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
237{
238 zval *tmp = (zval *) emalloc(sizeof(zval));
239
240 tmp->type = IS_LONG;
241 tmp->value.lval = n;
242 INIT_PZVAL(tmp);
243 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
244}
245
246
247ZEND_API inline int add_assoc_bool(zval *arg, char *key, int b)
248{
249 zval *tmp = (zval *) emalloc(sizeof(zval));
250
251 tmp->type = IS_BOOL;
252 tmp->value.lval = b;
253 INIT_PZVAL(tmp);
254 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
255}
256
257
258ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
259{
260 zval *tmp = (zval *) emalloc(sizeof(zval));
261
262 tmp->type = IS_RESOURCE;
263 tmp->value.lval = r;
264 INIT_PZVAL(tmp);
265 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
266}
267
268
240ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
241{
242 zval *tmp = (zval *) emalloc(sizeof(zval));
243
244 tmp->type = IS_DOUBLE;
245 tmp->value.dval = d;
246 INIT_PZVAL(tmp);
247 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);

--- 27 unchanged lines hidden (view full) ---

275 } else {
276 tmp->value.str.val = str;
277 }
278 INIT_PZVAL(tmp);
279 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
280}
281
282
269ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
270{
271 zval *tmp = (zval *) emalloc(sizeof(zval));
272
273 tmp->type = IS_DOUBLE;
274 tmp->value.dval = d;
275 INIT_PZVAL(tmp);
276 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);

--- 27 unchanged lines hidden (view full) ---

304 } else {
305 tmp->value.str.val = str;
306 }
307 INIT_PZVAL(tmp);
308 return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
309}
310
311
283ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
312ZEND_API inline int add_index_long(zval *arg, uint index, long n)
284{
313{
285 zend_error(E_WARNING, "add_assoc_function() is no longer supported");
286 return FAILURE;
314 zval *tmp = (zval *) emalloc(sizeof(zval));
315
316 tmp->type = IS_LONG;
317 tmp->value.lval = n;
318 INIT_PZVAL(tmp);
319 return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
287}
288
289
320}
321
322
290ZEND_API inline int add_index_long(zval *arg, uint index, long n)
323ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
291{
292 zval *tmp = (zval *) emalloc(sizeof(zval));
293
324{
325 zval *tmp = (zval *) emalloc(sizeof(zval));
326
294 tmp->type = IS_LONG;
295 tmp->value.lval = n;
327 tmp->type = IS_BOOL;
328 tmp->value.lval = b;
296 INIT_PZVAL(tmp);
297 return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
298}
299
300
329 INIT_PZVAL(tmp);
330 return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
331}
332
333
334ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
335{
336 zval *tmp = (zval *) emalloc(sizeof(zval));
337
338 tmp->type = IS_RESOURCE;
339 tmp->value.lval = r;
340 INIT_PZVAL(tmp);
341 return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
342}
343
344
301ZEND_API inline int add_index_double(zval *arg, uint index, double d)
302{
303 zval *tmp = (zval *) emalloc(sizeof(zval));
304
305 tmp->type = IS_DOUBLE;
306 tmp->value.dval = d;
307 INIT_PZVAL(tmp);
308 return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);

--- 38 unchanged lines hidden (view full) ---

347
348 tmp->type = IS_LONG;
349 tmp->value.lval = n;
350 INIT_PZVAL(tmp);
351 return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
352}
353
354
345ZEND_API inline int add_index_double(zval *arg, uint index, double d)
346{
347 zval *tmp = (zval *) emalloc(sizeof(zval));
348
349 tmp->type = IS_DOUBLE;
350 tmp->value.dval = d;
351 INIT_PZVAL(tmp);
352 return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);

--- 38 unchanged lines hidden (view full) ---

391
392 tmp->type = IS_LONG;
393 tmp->value.lval = n;
394 INIT_PZVAL(tmp);
395 return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
396}
397
398
399ZEND_API inline int add_next_index_bool(zval *arg, int b)
400{
401 zval *tmp = (zval *) emalloc(sizeof(zval));
402
403 tmp->type = IS_BOOL;
404 tmp->value.lval = b;
405 INIT_PZVAL(tmp);
406 return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
407}
408
409
410ZEND_API inline int add_next_index_resource(zval *arg, int r)
411{
412 zval *tmp = (zval *) emalloc(sizeof(zval));
413
414 tmp->type = IS_RESOURCE;
415 tmp->value.lval = r;
416 INIT_PZVAL(tmp);
417 return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
418}
419
420
355ZEND_API inline int add_next_index_double(zval *arg, double d)
356{
357 zval *tmp = (zval *) emalloc(sizeof(zval));
358
359 tmp->type = IS_DOUBLE;
360 tmp->value.dval = d;
361 INIT_PZVAL(tmp);
362 return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);

--- 419 unchanged lines hidden ---
421ZEND_API inline int add_next_index_double(zval *arg, double d)
422{
423 zval *tmp = (zval *) emalloc(sizeof(zval));
424
425 tmp->type = IS_DOUBLE;
426 tmp->value.dval = d;
427 INIT_PZVAL(tmp);
428 return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);

--- 419 unchanged lines hidden ---