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

2006-07-08 Thread Nuno Lopes
nlopess Sat Jul  8 21:54:49 2006 UTC

  Modified files:  
/php-src/ext/zlib   zlib.c 
  Log:
  change char* to void* when using the 't' parameter (as noted by Andrei)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib.c?r1=1.201&r2=1.202&diff_format=u
Index: php-src/ext/zlib/zlib.c
diff -u php-src/ext/zlib/zlib.c:1.201 php-src/ext/zlib/zlib.c:1.202
--- php-src/ext/zlib/zlib.c:1.201   Fri Jul  7 23:30:30 2006
+++ php-src/ext/zlib/zlib.c Sat Jul  8 21:54:49 2006
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: zlib.c,v 1.201 2006/07/07 23:30:30 nlopess Exp $ */
+/* $Id: zlib.c,v 1.202 2006/07/08 21:54:49 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -275,7 +275,7 @@
Read and uncompress entire .gz-file into an array */
 PHP_FUNCTION(gzfile)
 {
-   char *filename;
+   void *filename;
int filename_len;
zend_uchar filename_type;
long flags = 0;
@@ -291,7 +291,7 @@
use_include_path = flags ? USE_PATH : 0;
 
if (filename_type == IS_UNICODE) {
-   if (php_stream_path_encode(NULL, &filename, &filename_len, 
(UChar*)filename, filename_len, REPORT_ERRORS, NULL) == FAILURE) {
+   if (php_stream_path_encode(NULL, (char**)&filename, 
&filename_len, (UChar*)filename, filename_len, REPORT_ERRORS, NULL) == FAILURE) 
{
RETURN_FALSE;
}
}
@@ -323,7 +323,8 @@
Open a .gz-file and return a .gz-file pointer */
 PHP_FUNCTION(gzopen)
 {
-   char *filename, *mode;
+   void *filename;
+   char *mode;
int filename_len, mode_len;
zend_uchar filename_type;
long flags = 0;
@@ -337,7 +338,7 @@
use_include_path = flags ? USE_PATH : 0;
 
if (filename_type == IS_UNICODE) {
-   if (php_stream_path_encode(NULL, &filename, &filename_len, 
(UChar*)filename, filename_len, REPORT_ERRORS, NULL) == FAILURE) {
+   if (php_stream_path_encode(NULL, (char**)&filename, 
&filename_len, (UChar*)filename, filename_len, REPORT_ERRORS, NULL) == FAILURE) 
{
RETURN_FALSE;
}
}

-- 
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-07-08 Thread Andrei Zmievski
andrei  Sat Jul  8 18:46:24 2006 UTC

  Modified files:  
/php-src/ext/unicodeunicode_iterators.c 
  Log:
  Implement following() and preceding() for codepoint iterators.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/unicode_iterators.c?r1=1.33&r2=1.34&diff_format=u
Index: php-src/ext/unicode/unicode_iterators.c
diff -u php-src/ext/unicode/unicode_iterators.c:1.33 
php-src/ext/unicode/unicode_iterators.c:1.34
--- php-src/ext/unicode/unicode_iterators.c:1.33Fri Jul  7 22:52:26 2006
+++ php-src/ext/unicode/unicode_iterators.c Sat Jul  8 18:46:24 2006
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: unicode_iterators.c,v 1.33 2006/07/07 22:52:26 andrei Exp $ */
+/* $Id: unicode_iterators.c,v 1.34 2006/07/08 18:46:24 andrei Exp $ */
 
 /*
  * TODO
@@ -178,6 +178,78 @@
 
 static void text_iter_cp_following(text_iter_obj *object, int32_t offset, long 
flags TSRMLS_DC)
 {
+   int32_t k;
+
+   if (offset < 0) {
+   offset = 0;
+   }
+
+   /*
+* On invalid iterator we always want to start looking for the code unit
+* offset from the beginning of the string.
+*/
+   if (object->u.cp.cp_offset == UBRK_DONE) {
+   object->u.cp.cp_offset  = 0;
+   object->u.cp.offset = 0;
+   }
+
+   /*
+* Try to locate the code unit position relative to the last known 
codepoint
+* offset.
+*/
+   k = object->u.cp.offset;
+   if (offset > object->u.cp.cp_offset) {
+   U16_FWD_N(object->text, k, object->text_len, offset - 
object->u.cp.cp_offset);
+   } else {
+   U16_BACK_N(object->text, 0, k, object->u.cp.cp_offset - offset);
+   }
+
+   /*
+* Locate the actual boundary.
+*/
+   if (flags & ITER_REVERSE) {
+   if (k == 0) {
+   object->u.cp.cp_offset = UBRK_DONE;
+   object->u.cp.offset = UBRK_DONE;
+   return;
+   } else {
+   U16_BACK_1(object->text, 0, k);
+   }
+   } else {
+   if (k == object->text_len) {
+   object->u.cp.cp_offset = UBRK_DONE;
+   object->u.cp.offset = UBRK_DONE;
+   return;
+   } else {
+   U16_FWD_1(object->text, k, object->text_len);
+   }
+   }
+
+   /*
+* If boundary is the same one as where we were at before, simply 
return.
+*/
+   if (k == object->u.cp.offset) {
+   return;
+   }
+
+   /*
+* Adjust the internal codepoint offset based on how far we've moved.
+*/
+   if (k > object->u.cp.offset) {
+   if (k - object->u.cp.offset > 1) {
+   object->u.cp.cp_offset += u_countChar32(object->text + 
object->u.cp.offset, k - object->u.cp.offset);
+   } else {
+   object->u.cp.cp_offset++;
+   }
+   } else {
+   if (object->u.cp.offset - k > 1) {
+   object->u.cp.cp_offset -= u_countChar32(object->text + 
k, object->u.cp.offset - k);
+   } else {
+   object->u.cp.cp_offset--;
+   }
+   }
+
+   object->u.cp.offset = k;
 }
 
 static zend_bool text_iter_cp_isBoundary(text_iter_obj *object, int32_t 
offset, long flags TSRMLS_DC)
@@ -863,7 +935,7 @@
 
 PHP_METHOD(TextIterator, following)
 {
-   long flags, offset;
+   long offset;
zval *object = getThis();
text_iter_obj *intern = (text_iter_obj*) 
zend_object_store_get_object(object TSRMLS_CC);
 
@@ -871,8 +943,8 @@
return;
}
 
-   iter_ops[intern->type]->following(intern, offset, flags TSRMLS_CC);
-   RETURN_LONG(iter_ops[intern->type]->offset(intern, flags TSRMLS_CC));
+   iter_ops[intern->type]->following(intern, offset, intern->flags 
TSRMLS_CC);
+   RETURN_LONG(iter_ops[intern->type]->offset(intern, intern->flags 
TSRMLS_CC));
 }
 
 PHP_METHOD(TextIterator, preceding)

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



[PHP-CVS] cvs: CVSROOT / avail

2006-07-08 Thread Pierre-Alain Joye
pajoye  Sat Jul  8 16:28:53 2006 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - dsp karam for pear and peardoc
  
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1155&r2=1.1156&diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1155 CVSROOT/avail:1.1156
--- CVSROOT/avail:1.1155Wed Jul  5 21:55:43 2006
+++ CVSROOT/avail   Sat Jul  8 16:28:53 2006
@@ -341,6 +341,7 @@
 avail|mb|pecl/stime
 avail|hugoki|peardoc,pear/Structures_BibTex
 avail|badams|pear/Validate
+avail|dsp|pear/HTML_Template_IT,peardoc
 
 # Curl modules
 
avail|bagder,sterling,crisb,linus_nielsen|curl,curl-cpp,curl-java,curl-perl,curl-php,curl-www

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



[PHP-CVS] Re: cvs: php-src(PHP_5_2) /ext/spl/tests fileobject_003.phpt

2006-07-08 Thread Michael Wallner

Marcus Boerger wrote:

helly   Sat Jul  8 12:25:57 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/spl/tests	fileobject_003.phpt 
  Log:

  - MFH Add test
  


http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_003.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_003.phpt
+++ php-src/ext/spl/tests/fileobject_003.phpt
--TEST--
SPL: SplFileInfo cloning
--SKIPIF--

--FILE--



?>
===DONE===

--EXPECTF--


Are you sure about this exit call?

[EMAIL PROTECTED]:~/build/php-5.2-debug$ cli -r 'leak();'
[Sat Jul  8 14:35:04 2006]  Script:  '-'
/home/mike/cvs/php-5.2/Zend/zend_builtin_functions.c(1090) :  Freeing 
0x08605278 (3 bytes), script=-
=== Total 1 memory leaks detected ===
[EMAIL PROTECTED]:~/build/php-5.2-debug$ cli -r 'leak(); exit();'
[EMAIL PROTECTED]:~/build/php-5.2-debug$


--
Michael

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl/tests fileobject_003.phpt

2006-07-08 Thread Marcus Boerger
helly   Sat Jul  8 12:25:57 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/spl/tests  fileobject_003.phpt 
  Log:
  - MFH Add test
  

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_003.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_003.phpt
+++ php-src/ext/spl/tests/fileobject_003.phpt
--TEST--
SPL: SplFileInfo cloning
--SKIPIF--

--FILE--
getPathname() == $c->getPathname());
}

test(dirname(__FILE__) . '/' . 'fileobject_001a.txt');
test(dirname(__FILE__) . '/');

?>
===DONE===

--EXPECTF--
===0===
object(SplFileInfo)#%d (0) {
}
object(SplFileInfo)#%d (0) {
}
bool(false)
bool(true)
bool(true)
===1===
object(SplFileInfo)#%d (0) {
}
object(SplFileInfo)#%d (0) {
}
bool(false)
bool(true)
bool(true)
===DONE===

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



[PHP-CVS] cvs: php-src /ext/spl/tests fileobject_003.phpt

2006-07-08 Thread Marcus Boerger
helly   Sat Jul  8 11:43:07 2006 UTC

  Added files: 
/php-src/ext/spl/tests  fileobject_003.phpt 
  Log:
  - Add new test
  

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_003.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/fileobject_003.phpt
+++ php-src/ext/spl/tests/fileobject_003.phpt
--TEST--
SPL: SplFileInfo cloning
--SKIPIF--

--FILE--
getPathname() == $c->getPathname());
}

test(dirname(__FILE__) . '/' . 'fileobject_001a.txt');
test(dirname(__FILE__) . '/');

?>
===DONE===

--EXPECTF--
===0===
object(SplFileInfo)#%d (0) {
}
object(SplFileInfo)#%d (0) {
}
bool(false)
bool(true)
bool(true)
===1===
object(SplFileInfo)#%d (0) {
}
object(SplFileInfo)#%d (0) {
}
bool(false)
bool(true)
bool(true)
===DONE===

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