[PHP-CVS] cvs: php-src /ext/standard streamsfuncs.c

2006-02-01 Thread Antony Dovgal
tony2001Wed Feb  1 10:31:26 2006 UTC

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  fix #36242 (Possible memory corruption in stream_select())
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.60r2=1.61diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.60 
php-src/ext/standard/streamsfuncs.c:1.61
--- php-src/ext/standard/streamsfuncs.c:1.60Sun Jan  1 13:09:55 2006
+++ php-src/ext/standard/streamsfuncs.c Wed Feb  1 10:31:26 2006
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.60 2006/01/01 13:09:55 sniper Exp $ */
+/* $Id: streamsfuncs.c,v 1.61 2006/02/01 10:31:26 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -761,7 +761,7 @@
 
/* If seconds is not set to null, build the timeval, else we wait 
indefinitely */
if (sec != NULL) {
-   convert_to_long_ex(sec);
+   convert_to_long(sec);
 
/* Solaris + BSD do not like microsecond values which are = 1 
sec */
if (usec  99) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /ext/standard streamsfuncs.c

2006-02-01 Thread Antony Dovgal
tony2001Wed Feb  1 10:31:57 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH: fix #36242 (Possible memory corruption in stream_select())
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.388r2=1.2027.2.389diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.388 php-src/NEWS:1.2027.2.389
--- php-src/NEWS:1.2027.2.388   Tue Jan 31 18:44:18 2006
+++ php-src/NEWSWed Feb  1 10:31:57 2006
@@ -18,6 +18,7 @@
 - Added imap_savebody(). (Mike)
 - Fixed imagecolorallocate() and imagecolorallocatelapha() to return FALSE
   on error. (Pierre)
+- Fixed bug #36242 (Possible memory corruption in stream_select()). (Tony)
 - Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch). 
   (Tony)
 - Fixed bug #36224 (date(DATE_ATOM) gives wrong results). (Derick, Hannes
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.1r2=1.58.2.2diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.1 
php-src/ext/standard/streamsfuncs.c:1.58.2.2
--- php-src/ext/standard/streamsfuncs.c:1.58.2.1Sun Jan  1 12:50:15 2006
+++ php-src/ext/standard/streamsfuncs.c Wed Feb  1 10:31:57 2006
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.2 2006/02/01 10:31:57 tony2001 Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -750,7 +750,7 @@
 
/* If seconds is not set to null, build the timeval, else we wait 
indefinitely */
if (sec != NULL) {
-   convert_to_long_ex(sec);
+   convert_to_long(sec);
 
/* Solaris + BSD do not like microsecond values which are = 1 
sec */
if (usec  99) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /main php_compat.h

2006-02-01 Thread Joe Orton
jorton  Wed Feb  1 13:10:04 2006 UTC

  Modified files:  
/php-src/main   php_compat.h 
  Log:
  Fixed bug #36208 (symbol namespace conflicts using bundled gd).  (Jakub Moc)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/php_compat.h?r1=1.26r2=1.27diff_format=u
Index: php-src/main/php_compat.h
diff -u php-src/main/php_compat.h:1.26 php-src/main/php_compat.h:1.27
--- php-src/main/php_compat.h:1.26  Sun Jan  1 13:09:57 2006
+++ php-src/main/php_compat.h   Wed Feb  1 13:10:04 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_compat.h,v 1.26 2006/01/01 13:09:57 sniper Exp $ */
+/* $Id: php_compat.h,v 1.27 2006/02/01 13:10:04 jorton Exp $ */
 
 #ifndef PHP_COMPAT_H
 #define PHP_COMPAT_H
@@ -319,6 +319,12 @@
 #define term_source php_gd_term_source
 #define writewbmp php_gd_writewbmp
 #define ZeroDataBlock php_gd_ZeroDataBlock
+#define gdCacheCreate php_gd_gdCacheCreate
+#define gdCacheDelete php_gd_gdCacheDelete
+#define gdCacheGet php_gd_gdCacheGet
+#define gdFontCacheSetup php_gd_gdFontCacheSetup
+#define gdFontCacheShutdown php_gd_gdFontCacheShutdown
+#define gdFreeFontCache php_gd_gdFreeFontCache
 #endif /* HAVE_GD_BUNDLED */
 
 /* Define to specify how much context to retain around the current parse

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /main php_compat.h

2006-02-01 Thread Joe Orton
jorton  Wed Feb  1 13:52:46 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/main   php_compat.h 
/php-srcNEWS 
  Log:
  MFH: - Fixed bug #36208 (symbol namespace conflicts using bundled gd). (Jakub 
Moc)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/php_compat.h?r1=1.25.2.1r2=1.25.2.2diff_format=u
Index: php-src/main/php_compat.h
diff -u php-src/main/php_compat.h:1.25.2.1 php-src/main/php_compat.h:1.25.2.2
--- php-src/main/php_compat.h:1.25.2.1  Sun Jan  1 12:50:17 2006
+++ php-src/main/php_compat.h   Wed Feb  1 13:52:46 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_compat.h,v 1.25.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_compat.h,v 1.25.2.2 2006/02/01 13:52:46 jorton Exp $ */
 
 #ifndef PHP_COMPAT_H
 #define PHP_COMPAT_H
@@ -319,6 +319,12 @@
 #define term_source php_gd_term_source
 #define writewbmp php_gd_writewbmp
 #define ZeroDataBlock php_gd_ZeroDataBlock
+#define gdCacheCreate php_gd_gdCacheCreate
+#define gdCacheDelete php_gd_gdCacheDelete
+#define gdCacheGet php_gd_gdCacheGet
+#define gdFontCacheSetup php_gd_gdFontCacheSetup
+#define gdFontCacheShutdown php_gd_gdFontCacheShutdown
+#define gdFreeFontCache php_gd_gdFreeFontCache
 #endif /* HAVE_GD_BUNDLED */
 
 /* Define to specify how much context to retain around the current parse
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.389r2=1.2027.2.390diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.389 php-src/NEWS:1.2027.2.390
--- php-src/NEWS:1.2027.2.389   Wed Feb  1 10:31:57 2006
+++ php-src/NEWSWed Feb  1 13:52:46 2006
@@ -24,6 +24,7 @@
 - Fixed bug #36224 (date(DATE_ATOM) gives wrong results). (Derick, Hannes
   Magnusson)
 - Fixed bug #36222 (errorInfo in PDOException is always NULL). (Ilia)
+- Fixed bug #36208 (symbol namespace conflicts using bundled gd). (Jakub Moc)
 - Fixed bug #36185 (str_rot13(NULL) crash). (Pierre)
 - Fixed bug #36176 (PDO_PGSQL - PDO::exec() does not return number of rows 
   affected by the operation). (Ilia)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS

2006-02-01 Thread Ilia Alshanetsky
iliaa   Wed Feb  1 17:05:39 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  Clarify new entries.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.390r2=1.2027.2.391diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.390 php-src/NEWS:1.2027.2.391
--- php-src/NEWS:1.2027.2.390   Wed Feb  1 13:52:46 2006
+++ php-src/NEWSWed Feb  1 17:05:38 2006
@@ -15,7 +15,7 @@
 - Added new mysqli constants for BIT and NEW_DECIMAL field types:
   MYSQLI_TYPE_NEWDECIMAL and MYSQLI_TYPE_BIT. FR #36007. (Georg)
 - Added ReflectionClass::newInstanceArgs($args). (Marcus)
-- Added imap_savebody(). (Mike)
+- Added imap_savebody() that allows message body to be written to a file. 
(Mike)
 - Fixed imagecolorallocate() and imagecolorallocatelapha() to return FALSE
   on error. (Pierre)
 - Fixed bug #36242 (Possible memory corruption in stream_select()). (Tony)
@@ -25,7 +25,7 @@
   Magnusson)
 - Fixed bug #36222 (errorInfo in PDOException is always NULL). (Ilia)
 - Fixed bug #36208 (symbol namespace conflicts using bundled gd). (Jakub Moc)
-- Fixed bug #36185 (str_rot13(NULL) crash). (Pierre)
+- Fixed bug #36185 (str_rot13() crash on non-string parameter). (Pierre)
 - Fixed bug #36176 (PDO_PGSQL - PDO::exec() does not return number of rows 
   affected by the operation). (Ilia)
 - Fixed bug #36152 (problems with curl+ssl and pgsql+ssl in same PHP). (Mike)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/soap php_encoding.c /ext/soap/tests classmap003.phpt classmap003.wsdl

2006-02-01 Thread Dmitry Stogov
dmitry  Wed Feb  1 17:18:24 2006 UTC

  Added files: (Branch: PHP_5_1)
/php-src/ext/soap/tests classmap003.phpt classmap003.wsdl 

  Modified files:  
/php-src/ext/soap   php_encoding.c 
  Log:
  Fixed encoding of inhereted objects
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.13r2=1.103.2.14diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.103.2.13 
php-src/ext/soap/php_encoding.c:1.103.2.14
--- php-src/ext/soap/php_encoding.c:1.103.2.13  Sun Jan  1 12:50:13 2006
+++ php-src/ext/soap/php_encoding.c Wed Feb  1 17:18:24 2006
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.103.2.13 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.14 2006/02/01 17:18:24 dmitry Exp $ */
 
 #include time.h
 
@@ -306,6 +306,34 @@
xmlSetNs(node, nsp);
}
} else {
+   if (SOAP_GLOBAL(class_map)  data 
+   Z_TYPE_P(data) == IS_OBJECT 
+   !Z_OBJPROP_P(data)-nApplyCount) {
+   zend_class_entry *ce = Z_OBJCE_P(data);
+   HashPosition pos;
+   zval **tmp;
+   char *type_name = NULL;
+   uint type_len;
+   ulong idx;
+
+   for 
(zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(class_map), pos);
+
zend_hash_get_current_data_ex(SOAP_GLOBAL(class_map), (void **) tmp, pos) == 
SUCCESS;
+zend_hash_move_forward_ex(SOAP_GLOBAL(class_map), 
pos)) {
+   if (Z_TYPE_PP(tmp) == IS_STRING 
+   ce-name_length == Z_STRLEN_PP(tmp) 
+   zend_binary_strncasecmp(ce-name, 
ce-name_length, Z_STRVAL_PP(tmp), ce-name_length, ce-name_length) == 0 
+   
zend_hash_get_current_key_ex(SOAP_GLOBAL(class_map), type_name, type_len, 
idx, 0, pos) == HASH_KEY_IS_STRING) {
+
+   /* TODO: namespace isn't stored */
+   encodePtr enc = get_encoder(SOAP_GLOBAL(sdl), 
SOAP_GLOBAL(sdl)-target_ns, type_name);
+   if (enc) {
+   encode = enc-details;
+   }   
+   break;
+   }
+   }
+   }
+
if (encode == NULL) {
encode = get_conversion(UNKNOWN_TYPE);
}
@@ -1220,9 +1248,9 @@
ret = master_to_zval_int(sdlType-encode, data);
FIND_XML_NULL(data, ret);
if (get_zval_property(ret, any TSRMLS_CC) != 
NULL) {
- unset_zval_property(ret, any TSRMLS_CC);
+   unset_zval_property(ret, any 
TSRMLS_CC);
redo_any = 1;
- }
+   }
if (Z_TYPE_P(ret) == IS_OBJECT  ce != 
ZEND_STANDARD_CLASS_DEF_PTR) {
zend_object *zobj = 
zend_objects_get_address(ret TSRMLS_CC);
zobj-ce = ce;
@@ -1526,7 +1554,7 @@
 static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, 
xmlNodePtr parent)
 {
xmlNodePtr xmlParam;
-   HashTable *prop;
+   HashTable *prop = NULL;
int i;
sdlTypePtr sdlType = type-sdl_type;
TSRMLS_FETCH();
@@ -1534,19 +1562,19 @@
if (!data || Z_TYPE_P(data) == IS_NULL) {
xmlParam = xmlNewNode(NULL,BOGUS);
xmlAddChild(parent, xmlParam);
- if (style == SOAP_ENCODED) {
+   if (style == SOAP_ENCODED) {
xmlSetProp(xmlParam, xsi:nil, true);
}
return xmlParam;
}
 
+   if (Z_TYPE_P(data) == IS_OBJECT) {
+   prop = Z_OBJPROP_P(data);
+   } else if (Z_TYPE_P(data) == IS_ARRAY) {
+   prop = Z_ARRVAL_P(data);
+   }
+
if (sdlType) {
-   prop = NULL;
-   if (Z_TYPE_P(data) == IS_OBJECT) {
-   prop = Z_OBJPROP_P(data);
-   } else if (Z_TYPE_P(data) == IS_ARRAY) {
-   prop = Z_ARRVAL_P(data);
-   }
if (sdlType-kind == XSD_TYPEKIND_RESTRICTION 
sdlType-encode  type != sdlType-encode-details) {
encodePtr enc;
@@ -1562,7 +1590,7 @@
zval *tmp 

[PHP-CVS] cvs: php-src /ext/soap php_encoding.c /ext/soap/tests classmap003.phpt classmap003.wsdl

2006-02-01 Thread Dmitry Stogov
dmitry  Wed Feb  1 17:18:38 2006 UTC

  Modified files:  
/php-src/ext/soap   php_encoding.c 
/php-src/ext/soap/tests classmap003.phpt classmap003.wsdl 
  Log:
  Fixed encoding of inhereted objects
  
  http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_encoding.c?r1=1.117r2=1.118diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.117 
php-src/ext/soap/php_encoding.c:1.118
--- php-src/ext/soap/php_encoding.c:1.117   Sun Jan  1 13:09:53 2006
+++ php-src/ext/soap/php_encoding.c Wed Feb  1 17:18:38 2006
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.117 2006/01/01 13:09:53 sniper Exp $ */
+/* $Id: php_encoding.c,v 1.118 2006/02/01 17:18:38 dmitry Exp $ */
 
 #include time.h
 
@@ -306,6 +306,34 @@
xmlSetNs(node, nsp);
}
} else {
+   if (SOAP_GLOBAL(class_map)  data 
+   Z_TYPE_P(data) == IS_OBJECT 
+   !Z_OBJPROP_P(data)-nApplyCount) {
+   zend_class_entry *ce = Z_OBJCE_P(data);
+   HashPosition pos;
+   zval **tmp;
+   char *type_name = NULL;
+   uint type_len;
+   ulong idx;
+
+   for 
(zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(class_map), pos);
+
zend_hash_get_current_data_ex(SOAP_GLOBAL(class_map), (void **) tmp, pos) == 
SUCCESS;
+zend_hash_move_forward_ex(SOAP_GLOBAL(class_map), 
pos)) {
+   if (Z_TYPE_PP(tmp) == IS_STRING 
+   ce-name_length == Z_STRLEN_PP(tmp) 
+   zend_binary_strncasecmp(ce-name, 
ce-name_length, Z_STRVAL_PP(tmp), ce-name_length, ce-name_length) == 0 
+   
zend_hash_get_current_key_ex(SOAP_GLOBAL(class_map), type_name, type_len, 
idx, 0, pos) == HASH_KEY_IS_STRING) {
+
+   /* TODO: namespace isn't stored */
+   encodePtr enc = get_encoder(SOAP_GLOBAL(sdl), 
SOAP_GLOBAL(sdl)-target_ns, type_name);
+   if (enc) {
+   encode = enc-details;
+   }   
+   break;
+   }
+   }
+   }
+
if (encode == NULL) {
encode = get_conversion(UNKNOWN_TYPE);
}
@@ -1221,9 +1249,9 @@
ret = master_to_zval_int(sdlType-encode, data);
FIND_XML_NULL(data, ret);
if (get_zval_property(ret, any TSRMLS_CC) != 
NULL) {
- unset_zval_property(ret, any TSRMLS_CC);
+   unset_zval_property(ret, any 
TSRMLS_CC);
redo_any = 1;
- }
+   }
if (Z_TYPE_P(ret) == IS_OBJECT  ce != 
ZEND_STANDARD_CLASS_DEF_PTR) {
zend_object *zobj = 
zend_objects_get_address(ret TSRMLS_CC);
zobj-ce = ce;
@@ -1527,7 +1555,7 @@
 static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, 
xmlNodePtr parent)
 {
xmlNodePtr xmlParam;
-   HashTable *prop;
+   HashTable *prop = NULL;
int i;
sdlTypePtr sdlType = type-sdl_type;
TSRMLS_FETCH();
@@ -1535,19 +1563,19 @@
if (!data || Z_TYPE_P(data) == IS_NULL) {
xmlParam = xmlNewNode(NULL,BOGUS);
xmlAddChild(parent, xmlParam);
- if (style == SOAP_ENCODED) {
+   if (style == SOAP_ENCODED) {
xmlSetProp(xmlParam, xsi:nil, true);
}
return xmlParam;
}
 
+   if (Z_TYPE_P(data) == IS_OBJECT) {
+   prop = Z_OBJPROP_P(data);
+   } else if (Z_TYPE_P(data) == IS_ARRAY) {
+   prop = Z_ARRVAL_P(data);
+   }
+
if (sdlType) {
-   prop = NULL;
-   if (Z_TYPE_P(data) == IS_OBJECT) {
-   prop = Z_OBJPROP_P(data);
-   } else if (Z_TYPE_P(data) == IS_ARRAY) {
-   prop = Z_ARRVAL_P(data);
-   }
if (sdlType-kind == XSD_TYPEKIND_RESTRICTION 
sdlType-encode  type != sdlType-encode-details) {
encodePtr enc;
@@ -1563,7 +1591,7 @@
zval *tmp = get_zval_property(data, _ 
TSRMLS_CC);
if (tmp) 

[PHP-CVS] cvs: php-src /ext/unicode config.m4 unicode.c unicode_iterators.c

2006-02-01 Thread Andrei Zmievski
andrei  Wed Feb  1 23:50:50 2006 UTC

  Added files: 
/php-src/ext/unicodeunicode_iterators.c 

  Modified files:  
/php-src/ext/unicodeconfig.m4 unicode.c 
  Log:
  Proof-of-concept for TextIterator. Much more work to be done here.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/config.m4?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/unicode/config.m4
diff -u php-src/ext/unicode/config.m4:1.3 php-src/ext/unicode/config.m4:1.4
--- php-src/ext/unicode/config.m4:1.3   Thu Nov 10 08:00:00 2005
+++ php-src/ext/unicode/config.m4   Wed Feb  1 23:50:50 2006
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.3 2005/11/10 08:00:00 sniper Exp $
+dnl $Id: config.m4,v 1.4 2006/02/01 23:50:50 andrei Exp $
 dnl
 
 PHP_ARG_ENABLE(unicode, whether to enable unicode functions,
@@ -8,6 +8,6 @@
 if test $PHP_UNICODE != no; then
   PHP_SUBST(UNICODE_SHARED_LIBADD)
   AC_DEFINE(HAVE_UNICODE, 1, [ ])
-  PHP_NEW_EXTENSION(unicode, unicode.c locale.c unicode_filter.c, $ext_shared)
+  PHP_NEW_EXTENSION(unicode, unicode.c locale.c unicode_filter.c 
unicode_iterators.c, $ext_shared)
 fi
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode.c?r1=1.7r2=1.8diff_format=u
Index: php-src/ext/unicode/unicode.c
diff -u php-src/ext/unicode/unicode.c:1.7 php-src/ext/unicode/unicode.c:1.8
--- php-src/ext/unicode/unicode.c:1.7   Sun Jan  1 13:09:56 2006
+++ php-src/ext/unicode/unicode.c   Wed Feb  1 23:50:50 2006
@@ -15,12 +15,14 @@
   +--+
 */
 
-/* $Id: unicode.c,v 1.7 2006/01/01 13:09:56 sniper Exp $ */ 
+/* $Id: unicode.c,v 1.8 2006/02/01 23:50:50 andrei Exp $ */ 
 
 #include php_unicode.h
 #if HAVE_UNICODE
 #include zend_unicode.h
 
+void php_register_unicode_iterators(TSRMLS_D);
+
 /* {{{ proto unicode unicode_decode(string input, string encoding)
Takes a string in the source encoding and converts it to a UTF-16 unicode 
string, returning the result */
 static PHP_FUNCTION(unicode_decode)
@@ -100,6 +102,8 @@
 
ucnv_close(conv);   
 }
+/* }}} */
+
 /* {{{ unicode_functions[] */
 zend_function_entry unicode_functions[] = {
PHP_FE(i18n_loc_get_default, NULL)
@@ -139,7 +143,8 @@
if (php_stream_filter_register_factory(unicode.*, 
php_unicode_filter_factory TSRMLS_CC) == FAILURE) {
return FAILURE;
}
-   /* add your stuff here */
+
+   php_register_unicode_iterators(TSRMLS_C);
 
return SUCCESS;
 }

http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode_iterators.c?view=markuprev=1.1
Index: php-src/ext/unicode/unicode_iterators.c
+++ php-src/ext/unicode/unicode_iterators.c
/*
   +--+
   | PHP Version 6|
   +--+
   | This source file is subject to version 3.01 of the PHP license,  |
   | that is bundled with this package in the file LICENSE, and is|
   | available through the world-wide-web at the following url:   |
   | http://www.php.net/license/3_01.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  |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
   +--+
   | Authors: Andre Zmievski([EMAIL PROTECTED])  |
   +--+
*/

/* $Id: unicode_iterators.c,v 1.1 2006/02/01 23:50:50 andrei Exp $ */


#include php.h
#include zend_interfaces.h
#include zend_exceptions.h
#include ext/spl/spl_exceptions.h

typedef enum {
ITER_CODE_UNIT,
ITER_CODE_POINT,
ITER_COMB_SEQUENCE,
} text_iter_type;

typedef struct {
zend_object std;
zval*   text;
int32_t offset;
int32_t index;
text_iter_type  type;
} text_iter_t;

PHPAPI zend_class_entry* text_iterator_aggregate_ce;
PHPAPI zend_class_entry* text_iterator_ce;

static void text_iterator_free_storage(void *object TSRMLS_DC)
{
text_iter_t *intern = (text_iter_t *) object;

zend_hash_destroy(intern-std.properties);
FREE_HASHTABLE(intern-std.properties);

zval_ptr_dtor(intern-text);
efree(object);
}

static zend_object_value text_iterator_new(zend_class_entry *class_type 
TSRMLS_DC)
{
zend_object_value retval;
text_iter_t *intern;
zval *tmp;

intern = emalloc(sizeof(text_iter_t));
memset(intern, 0, sizeof(text_iter_t));
intern-std.ce = class_type;

ALLOC_HASHTABLE(intern-std.properties);
zend_hash_init(intern-std.properties, 0, NULL, ZVAL_PTR_DTOR, 

[PHP-CVS] cvs: php-src /ext/unicode unicode_iterators.c

2006-02-01 Thread Andrei Zmievski
andrei  Wed Feb  1 23:53:53 2006 UTC

  Modified files:  
/php-src/ext/unicodeunicode_iterators.c 
  Log:
  Check for intern-text before destroying it.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode_iterators.c?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/unicode/unicode_iterators.c
diff -u php-src/ext/unicode/unicode_iterators.c:1.1 
php-src/ext/unicode/unicode_iterators.c:1.2
--- php-src/ext/unicode/unicode_iterators.c:1.1 Wed Feb  1 23:50:50 2006
+++ php-src/ext/unicode/unicode_iterators.c Wed Feb  1 23:53:53 2006
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: unicode_iterators.c,v 1.1 2006/02/01 23:50:50 andrei Exp $ */
+/* $Id: unicode_iterators.c,v 1.2 2006/02/01 23:53:53 andrei Exp $ */
 
 
 #include php.h
@@ -46,7 +46,7 @@
zend_hash_destroy(intern-std.properties);
FREE_HASHTABLE(intern-std.properties);
 
-   zval_ptr_dtor(intern-text);
+   if (intern-text) zval_ptr_dtor(intern-text);
efree(object);
 }
 
@@ -90,6 +90,7 @@
}
 
if (Z_TYPE_P(text) != IS_UNICODE) {
+   printf(not unicode\n);

zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), Text 
iterator expects argument to be a Unicode string, 0 TSRMLS_CC);
return;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/unicode unicode_iterators.c

2006-02-01 Thread Andrei Zmievski
andrei  Thu Feb  2 00:05:21 2006 UTC

  Modified files:  
/php-src/ext/unicodeunicode_iterators.c 
  Log:
  Remove debug message.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode_iterators.c?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/unicode/unicode_iterators.c
diff -u php-src/ext/unicode/unicode_iterators.c:1.2 
php-src/ext/unicode/unicode_iterators.c:1.3
--- php-src/ext/unicode/unicode_iterators.c:1.2 Wed Feb  1 23:53:53 2006
+++ php-src/ext/unicode/unicode_iterators.c Thu Feb  2 00:05:21 2006
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: unicode_iterators.c,v 1.2 2006/02/01 23:53:53 andrei Exp $ */
+/* $Id: unicode_iterators.c,v 1.3 2006/02/02 00:05:21 andrei Exp $ */
 
 
 #include php.h
@@ -90,7 +90,6 @@
}
 
if (Z_TYPE_P(text) != IS_UNICODE) {
-   printf(not unicode\n);

zend_throw_exception(U_CLASS_ENTRY(spl_ce_InvalidArgumentException), Text 
iterator expects argument to be a Unicode string, 0 TSRMLS_CC);
return;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/unicode unicode_iterators.c

2006-02-01 Thread Sebastian Bergmann
sebastian   Thu Feb  2 06:01:28 2006 UTC

  Modified files:  
/php-src/ext/unicodeunicode_iterators.c 
  Log:
  Fix Andrei.
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode_iterators.c?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/unicode/unicode_iterators.c
diff -u php-src/ext/unicode/unicode_iterators.c:1.3 
php-src/ext/unicode/unicode_iterators.c:1.4
--- php-src/ext/unicode/unicode_iterators.c:1.3 Thu Feb  2 00:05:21 2006
+++ php-src/ext/unicode/unicode_iterators.c Thu Feb  2 06:01:27 2006
@@ -10,11 +10,11 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Andre Zmievski([EMAIL PROTECTED])  |
+   | Authors: Andrei Zmievski [EMAIL PROTECTED]|
+--+
 */
 
-/* $Id: unicode_iterators.c,v 1.3 2006/02/02 00:05:21 andrei Exp $ */
+/* $Id: unicode_iterators.c,v 1.4 2006/02/02 06:01:27 sebastian Exp $ */
 
 
 #include php.h

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php