release 1.6.1
[m6w6/ext-http] / missing.c
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifdef HAVE_CONFIG_H
16 # include "config.h"
17 #endif
18
19 #include "php.h"
20 #include "missing.h"
21
22 #ifdef WONKY
23 int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC)
24 {
25 zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS);
26 INIT_PZVAL(property);
27 ZVAL_DOUBLE(property, value);
28 return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
29 }
30
31 void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC)
32 {
33 zval *tmp = ecalloc(1, sizeof(zval));
34 ZVAL_DOUBLE(tmp, value);
35 zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
36 }
37
38 int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
39 {
40 zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS);
41 INIT_PZVAL(property);
42 ZVAL_BOOL(property, value);
43 return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
44 }
45
46 void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
47 {
48 zval *tmp = ecalloc(1, sizeof(zval));
49 ZVAL_BOOL(tmp, value);
50 zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
51 }
52
53 void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
54 {
55 zval *tmp;
56
57 ALLOC_ZVAL(tmp);
58 tmp->is_ref = 0;
59 tmp->refcount = 0;
60 ZVAL_STRINGL(tmp, value, value_len, 1);
61 zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
62 }
63
64 #endif
65
66 /*
67 * Local variables:
68 * tab-width: 4
69 * c-basic-offset: 4
70 * End:
71 * vim600: noet sw=4 ts=4 fdm=marker
72 * vim<600: noet sw=4 ts=4
73 */
74