X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=missing.c;h=65851bef9dd24d6571ffed3c666dec0230de2dae;hp=7febedf19d579b9892b633da254ef4165e5a6a2c;hb=ad5f896b03adaa073134a00108a9cdf00720673a;hpb=6321af281c171d1a62e2377cef9d251ba03feafc diff --git a/missing.c b/missing.c index 7febedf..65851be 100644 --- a/missing.c +++ b/missing.c @@ -1,20 +1,21 @@ /* - +----------------------------------------------------------------------+ - | PECL :: http | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, that | - | is bundled with this package in the file LICENSE, and is available | - | through the world-wide-web at http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Copyright (c) 2004-2005 Michael Wallner | - +----------------------------------------------------------------------+ + +--------------------------------------------------------------------+ + | PECL :: http | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2004-2010, Michael Wallner | + +--------------------------------------------------------------------+ */ /* $Id$ */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "php.h" #include "missing.h" @@ -43,10 +44,23 @@ int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length } void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC) -{ zval *tmp = ecalloc(1, sizeof(zval)); +{ + zval *tmp = ecalloc(1, sizeof(zval)); ZVAL_BOOL(tmp, value); zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); } + +void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC) +{ + zval *tmp; + + ALLOC_ZVAL(tmp); + tmp->is_ref = 0; + tmp->refcount = 0; + ZVAL_STRINGL(tmp, value, value_len, 1); + zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); +} + #endif /*