# you better don't look inside
[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-2005, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #include "php.h"
16 #include "missing.h"
17
18 #ifdef WONKY
19 int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC)
20 {
21 zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS);
22 INIT_PZVAL(property);
23 ZVAL_DOUBLE(property, value);
24 return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
25 }
26
27 void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC)
28 {
29 zval *tmp = ecalloc(1, sizeof(zval));
30 ZVAL_DOUBLE(tmp, value);
31 zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
32 }
33
34 int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
35 {
36 zval *property = pemalloc(sizeof(zval), ce->type & ZEND_INTERNAL_CLASS);
37 INIT_PZVAL(property);
38 ZVAL_BOOL(property, value);
39 return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC);
40 }
41
42 void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
43 {
44 zval *tmp = ecalloc(1, sizeof(zval));
45 ZVAL_BOOL(tmp, value);
46 zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
47 }
48
49 void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
50 {
51 zval *tmp;
52
53 ALLOC_ZVAL(tmp);
54 tmp->is_ref = 0;
55 tmp->refcount = 0;
56 ZVAL_STRINGL(tmp, value, value_len, 1);
57 zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC);
58 }
59
60 #endif
61
62 /*
63 * Local variables:
64 * tab-width: 4
65 * c-basic-offset: 4
66 * End:
67 * vim600: noet sw=4 ts=4 fdm=marker
68 * vim<600: noet sw=4 ts=4
69 */
70