[PHP-CVS] cvs: CVSROOT / avail

2006-05-08 Thread Marcus Boerger
helly   Mon May  8 08:45:55 2006 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - Add myself to update buildsystem requirements
  
http://cvs.php.net/viewcvs.cgi/CVSROOT/avail?r1=1.1130r2=1.1131diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1130 CVSROOT/avail:1.1131
--- CVSROOT/avail:1.1130Sat May  6 19:23:00 2006
+++ CVSROOT/avail   Mon May  8 08:45:55 2006
@@ -45,7 +45,7 @@
 # The PHP Web Group maintains www.php.net, news.php.net, bugs.php.net,
 # and master.php.net.
 
-avail|ilia,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams,tom,jacques,sebastian,georg,mj,imajes,cortesi,sander,markonen,edink,jan,victor,mfischer,wez,sesser,pollita,alindeman,magnus,iliaa,philip,didou,sfox,sean,dufuz,nlopess,pajoye|phpweb,php-bugs-web,php-master-web,php-news-web,php-hosts-web
+avail|ilia,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams,tom,jacques,sebastian,georg,mj,imajes,cortesi,sander,markonen,edink,jan,victor,mfischer,wez,sesser,pollita,alindeman,magnus,iliaa,philip,didou,sfox,sean,dufuz,nlopess,pajoye,helly|phpweb,php-bugs-web,php-master-web,php-news-web,php-hosts-web
 
 # The PHP Presentation Group has access to the presentations on the
 # conf.php.net site.

-- 
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/gd/libgd gd_gif_in.c

2006-05-08 Thread Pierre-Alain Joye
pajoye  Mon May  8 11:12:49 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  - CS (spaces  tabs)
  
  http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.1r2=1.5.4.2.2.2diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.1 
php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.2
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.1Sun May  7 16:37:40 2006
+++ php-src/ext/gd/libgd/gd_gif_in.cMon May  8 11:12:49 2006
@@ -17,9 +17,9 @@
 
 static int set_verbose(void)
 {
- verbose = !!getenv(GIF_VERBOSE);
- verbose_set = 1;
- return(verbose);
+   verbose = !!getenv(GIF_VERBOSE);
+   verbose_set = 1;
+   return(verbose);
 }
 
 #else
@@ -51,21 +51,21 @@
 /* We may eventually want to use this information, but def it out for now */
 #if 0
 static struct {
-   unsigned intWidth;
-   unsigned intHeight;
-   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
-   unsigned intBitPixel;
-   unsigned intColorResolution;
-   unsigned intBackground;
-   unsigned intAspectRatio;
+   unsigned intWidth;
+   unsigned intHeight;
+   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
+   unsigned intBitPixel;
+   unsigned intColorResolution;
+   unsigned intBackground;
+   unsigned intAspectRatio;
 } GifScreen;
 #endif
 
 static struct {
-   int transparent;
-   int delayTime;
-   int inputFlag;
-   int disposal;
+   int transparent;
+   int delayTime;
+   int inputFlag;
+   int disposal;
 } Gif89 = { -1, -1, -1, 0 };
 
 static int ReadColorMap (gdIOCtx *fd, int number, unsigned char 
(*buffer)[256]);
@@ -80,222 +80,218 @@
 
 gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource)
 {
-gdIOCtx *in = gdNewSSCtx(inSource, NULL);
-gdImagePtr  im;
+   gdIOCtx *in = gdNewSSCtx(inSource, NULL);
+   gdImagePtr  im;
 
-im = gdImageCreateFromGifCtx(in);
+   im = gdImageCreateFromGifCtx(in);
 
-in-gd_free(in);
+   in-gd_free(in);
 
-return im;
+   return im;
 }
 
-gdImagePtr
+   gdImagePtr
 gdImageCreateFromGif(FILE *fdFile)
 {
-gdIOCtx*fd = gdNewFileCtx(fdFile);
-gdImagePtr im = 0;
+   gdIOCtx *fd = gdNewFileCtx(fdFile);
+   gdImagePtr  im = 0;
 
-im = gdImageCreateFromGifCtx(fd);
+   im = gdImageCreateFromGifCtx(fd);
 
-fd-gd_free(fd);
+   fd-gd_free(fd);
 
-return im;
+   return im;
 }
 
-gdImagePtr
+   gdImagePtr
 gdImageCreateFromGifCtx(gdIOCtxPtr fd)
 {
-/* 1.4   int imageNumber; */
-   int BitPixel;
-   int ColorResolution;
-   int Background;
-   int AspectRatio;
-   int Transparent = (-1);
-   unsigned char   buf[16];
-   unsigned char   c;
-   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
-   unsigned char   localColorMap[3][MAXCOLORMAPSIZE];
-   int imw, imh;
-   int useGlobalColormap;
-   int bitPixel;
-   inti;
-   /*1.4//int imageCount = 0; */
-   charversion[4];
+   /* 1.4   int imageNumber; */
+   int BitPixel;
+   int ColorResolution;
+   int Background;
+   int AspectRatio;
+   int Transparent = (-1);
+   unsigned char   buf[16];
+   unsigned char   c;
+   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
+   unsigned char   localColorMap[3][MAXCOLORMAPSIZE];
+   int imw, imh;
+   int useGlobalColormap;
+   int bitPixel;
+   inti;
+   /*1.4//int imageCount = 0; */
+   charversion[4];
 
-   gdImagePtr im = 0;
-   ZeroDataBlock = FALSE;
+   gdImagePtr im = 0;
+   ZeroDataBlock = FALSE;
 
-   /*1.4//imageNumber = 1; */
-   if (! ReadOK(fd,buf,6)) {
+   /*1.4//imageNumber = 1; */
+   if (! ReadOK(fd,buf,6)) {
return 0;
}
-   if (strncmp((char *)buf,GIF,3) != 0) {
+   if (strncmp((char *)buf,GIF,3) != 0) {
return 0;
}
-   strncpy(version, (char *)buf + 3, 3);
-   version[3] = '\0';
+   strncpy(version, (char *)buf + 3, 3);
+   version[3] = '\0';
 
-   if ((strcmp(version, 87a) != 0)  (strcmp(version, 89a) != 0)) {
+   if ((strcmp(version, 87a) != 0)  (strcmp(version, 89a) != 0)) {
return 0;
}
-   if (! ReadOK(fd,buf,7)) {
+   if (! ReadOK(fd,buf,7)) {
return 0;
}
-   BitPixel= 2(buf[4]0x07);
-   ColorResolution = (int) (((buf[4]0x70)3)+1);
-   Background  = buf[5];
-   AspectRatio = buf[6];
+   BitPixel= 2(buf[4]0x07);
+   ColorResolution = (int) 

[PHP-CVS] cvs: php-src /ext/gd/libgd gd_gif_in.c

2006-05-08 Thread Pierre-Alain Joye
pajoye  Mon May  8 11:46:13 2006 UTC

  Modified files:  
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  - CS (spaces  tabs)
  
  http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.8 
php-src/ext/gd/libgd/gd_gif_in.c:1.9
--- php-src/ext/gd/libgd/gd_gif_in.c:1.8Sun May  7 17:21:11 2006
+++ php-src/ext/gd/libgd/gd_gif_in.cMon May  8 11:46:13 2006
@@ -17,9 +17,9 @@
 
 static int set_verbose(void)
 {
- verbose = !!getenv(GIF_VERBOSE);
- verbose_set = 1;
- return(verbose);
+   verbose = !!getenv(GIF_VERBOSE);
+   verbose_set = 1;
+   return(verbose);
 }
 
 #else
@@ -51,21 +51,21 @@
 /* We may eventually want to use this information, but def it out for now */
 #if 0
 static struct {
-   unsigned intWidth;
-   unsigned intHeight;
-   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
-   unsigned intBitPixel;
-   unsigned intColorResolution;
-   unsigned intBackground;
-   unsigned intAspectRatio;
+   unsigned intWidth;
+   unsigned intHeight;
+   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
+   unsigned intBitPixel;
+   unsigned intColorResolution;
+   unsigned intBackground;
+   unsigned intAspectRatio;
 } GifScreen;
 #endif
 
 static struct {
-   int transparent;
-   int delayTime;
-   int inputFlag;
-   int disposal;
+   int transparent;
+   int delayTime;
+   int inputFlag;
+   int disposal;
 } Gif89 = { -1, -1, -1, 0 };
 
 static int ReadColorMap (gdIOCtx *fd, int number, unsigned char 
(*buffer)[256]);
@@ -80,222 +80,218 @@
 
 gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource)
 {
-gdIOCtx *in = gdNewSSCtx(inSource, NULL);
-gdImagePtr  im;
+   gdIOCtx *in = gdNewSSCtx(inSource, NULL);
+   gdImagePtr  im;
 
-im = gdImageCreateFromGifCtx(in);
+   im = gdImageCreateFromGifCtx(in);
 
-in-gd_free(in);
+   in-gd_free(in);
 
-return im;
+   return im;
 }
 
-gdImagePtr
+   gdImagePtr
 gdImageCreateFromGif(FILE *fdFile)
 {
-gdIOCtx*fd = gdNewFileCtx(fdFile);
-gdImagePtr im = 0;
+   gdIOCtx *fd = gdNewFileCtx(fdFile);
+   gdImagePtr  im = 0;
 
-im = gdImageCreateFromGifCtx(fd);
+   im = gdImageCreateFromGifCtx(fd);
 
-fd-gd_free(fd);
+   fd-gd_free(fd);
 
-return im;
+   return im;
 }
 
-gdImagePtr
-gdImageCreateFromGifCtx(gdIOCtxPtr fd)
-{
-/* 1.4   int imageNumber; */
-   int BitPixel;
-   int ColorResolution;
-   int Background;
-   int AspectRatio;
-   int Transparent = (-1);
-   unsigned char   buf[16];
-   unsigned char   c;
-   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
-   unsigned char   localColorMap[3][MAXCOLORMAPSIZE];
-   int imw, imh;
-   int useGlobalColormap;
-   int bitPixel;
-   inti;
-   /*1.4//int imageCount = 0; */
-   charversion[4];
+gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd)
+{
+   /* 1.4   int imageNumber; */
+   int BitPixel;
+   int ColorResolution;
+   int Background;
+   int AspectRatio;
+   int Transparent = (-1);
+   unsigned char   buf[16];
+   unsigned char   c;
+   unsigned char   ColorMap[3][MAXCOLORMAPSIZE];
+   unsigned char   localColorMap[3][MAXCOLORMAPSIZE];
+   int imw, imh;
+   int useGlobalColormap;
+   int bitPixel;
+   inti;
+   /*1.4//int imageCount = 0; */
+   charversion[4];
 
-   gdImagePtr im = 0;
-   ZeroDataBlock = FALSE;
+   gdImagePtr im = 0;
+   ZeroDataBlock = FALSE;
 
-   /*1.4//imageNumber = 1; */
-   if (! ReadOK(fd,buf,6)) {
+   /*1.4//imageNumber = 1; */
+   if (! ReadOK(fd,buf,6)) {
return 0;
}
-   if (strncmp((char *)buf,GIF,3) != 0) {
+   if (strncmp((char *)buf,GIF,3) != 0) {
return 0;
}
-   strncpy(version, (char *)buf + 3, 3);
-   version[3] = '\0';
+   strncpy(version, (char *)buf + 3, 3);
+   version[3] = '\0';
 
-   if ((strcmp(version, 87a) != 0)  (strcmp(version, 89a) != 0)) {
+   if ((strcmp(version, 87a) != 0)  (strcmp(version, 89a) != 0)) {
return 0;
}
-   if (! ReadOK(fd,buf,7)) {
+   if (! ReadOK(fd,buf,7)) {
return 0;
}
-   BitPixel= 2(buf[4]0x07);
-   ColorResolution = (int) (((buf[4]0x70)3)+1);
-   Background  = buf[5];
-   AspectRatio = buf[6];
+   BitPixel= 2(buf[4]0x07);
+   ColorResolution = (int) (((buf[4]0x70)3)+1);
+   

[PHP-CVS] cvs: php-src /ext/gd/libgd gd_gif_in.c /ext/gd/tests bug37360.gif bug37360.phpt

2006-05-08 Thread Pierre-Alain Joye
pajoye  Mon May  8 11:49:33 2006 UTC

  Added files: 
/php-src/ext/gd/tests   bug37360.gif bug37360.phpt 

  Modified files:  
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  - #37360, bad gif size
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.9r2=1.10diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.9 
php-src/ext/gd/libgd/gd_gif_in.c:1.10
--- php-src/ext/gd/libgd/gd_gif_in.c:1.9Mon May  8 11:46:13 2006
+++ php-src/ext/gd/libgd/gd_gif_in.cMon May  8 11:49:33 2006
@@ -146,6 +146,9 @@
Background  = buf[5];
AspectRatio = buf[6];
 
+   imw = LM_to_uint(buf[0],buf[1]);
+   imh = LM_to_uint(buf[2],buf[3]);
+
if (BitSet(buf[4], LOCALCOLORMAP)) {/* Global Colormap */
if (ReadColorMap(fd, BitPixel, ColorMap)) {
return 0;
@@ -181,9 +184,6 @@
 
bitPixel = 1((buf[8]0x07)+1);
 
-   imw = LM_to_uint(buf[4],buf[5]);
-   imh = LM_to_uint(buf[6],buf[7]);
-
if (!useGlobalColormap) {
if (ReadColorMap(fd, bitPixel, localColorMap)) {
return 0;

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug37360.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/bug37360.phpt
+++ php-src/ext/gd/tests/bug37360.phpt
--TEST--
Bug #37360 (gdimagecreatefromgif, bad image sizes)
--SKIPIF--
?php 
if (!extension_loaded('gd')) die(skip gd extension not available\n); 
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?
--FILE--
?php
$im = imagecreatefromgif(dirname(__FILE__) . '/bug37360.gif');
var_dump($im);
?
--EXPECTF--
resource(%d) of type (gd)

-- 
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/gd/libgd gd_gif_in.c /ext/gd/tests bug37360.gif bug37360.phpt

2006-05-08 Thread Pierre-Alain Joye
pajoye  Mon May  8 11:50:47 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/gd/tests   bug37360.gif bug37360.phpt 

  Modified files:  
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  - MFH: #37360, bad gif size
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.2r2=1.5.4.2.2.3diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.2 
php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.3
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.2Mon May  8 11:12:49 2006
+++ php-src/ext/gd/libgd/gd_gif_in.cMon May  8 11:50:47 2006
@@ -147,6 +147,9 @@
Background  = buf[5];
AspectRatio = buf[6];
 
+   imw = LM_to_uint(buf[0],buf[1]);
+   imh = LM_to_uint(buf[2],buf[3]);
+
if (BitSet(buf[4], LOCALCOLORMAP)) {/* Global Colormap */
if (ReadColorMap(fd, BitPixel, ColorMap)) {
return 0;
@@ -182,9 +185,6 @@
 
bitPixel = 1((buf[8]0x07)+1);
 
-   imw = LM_to_uint(buf[4],buf[5]);
-   imh = LM_to_uint(buf[6],buf[7]);
-
if (!useGlobalColormap) {
if (ReadColorMap(fd, bitPixel, localColorMap)) {
return 0;

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug37360.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/bug37360.phpt
+++ php-src/ext/gd/tests/bug37360.phpt
--TEST--
Bug #37360 (gdimagecreatefromgif, bad image sizes)
--SKIPIF--
?php 
if (!extension_loaded('gd')) die(skip gd extension not available\n); 
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?
--FILE--
?php
$im = imagecreatefromgif(dirname(__FILE__) . '/bug37360.gif');
var_dump($im);
?
--EXPECTF--
resource(%d) of type (gd)

-- 
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/gd/libgd gd_gif_in.c /ext/gd/tests bug37360.gif bug37360.phpt

2006-05-08 Thread Pierre-Alain Joye
pajoye  Mon May  8 11:56:15 2006 UTC

  Added files: (Branch: PHP_5_1)
/php-src/ext/gd/tests   bug37360.phpt bug37360.gif 

  Modified files:  
/php-src/ext/gd/libgd   gd_gif_in.c 
/php-srcNEWS 
  Log:
  - MFH: #37360, bad gif size
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.3r2=1.5.4.4diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.3 
php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.4
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.3Sun May  7 17:14:36 2006
+++ php-src/ext/gd/libgd/gd_gif_in.cMon May  8 11:56:14 2006
@@ -147,6 +147,9 @@
Background  = buf[5];
AspectRatio = buf[6];
 
+   imw = LM_to_uint(buf[0],buf[1]);
+   imh = LM_to_uint(buf[2],buf[3]);
+
if (BitSet(buf[4], LOCALCOLORMAP)) {/* Global Colormap */
if (ReadColorMap(fd, BitPixel, ColorMap)) {
return 0;
@@ -182,8 +185,6 @@
 
bitPixel = 1((buf[8]0x07)+1);
 
-   imw = LM_to_uint(buf[4],buf[5]);
-   imh = LM_to_uint(buf[6],buf[7]);
 
if (! useGlobalColormap) {
if (ReadColorMap(fd, bitPixel, localColorMap)) {
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.549r2=1.2027.2.550diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.549 php-src/NEWS:1.2027.2.550
--- php-src/NEWS:1.2027.2.549   Sun May  7 18:00:28 2006
+++ php-src/NEWSMon May  8 11:56:15 2006
@@ -3,7 +3,8 @@
 ?? ??? 2006, PHP 5.?.?
 - Fixed bug #37313 (sigemptyset() used without including signal.h).
   (jdolecek)
-- Fixed bug #37346 (invalid colormap format)
+- Fixed bug #37346 (invalid colormap format) (Pierre)
+- Fixed bug #37360 (invalid gif size) (Pierre)
 
 04 May 2006, PHP 5.1.4
 - Added capture_peer_cert and capture_peer_cert_chain context options

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug37360.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/bug37360.phpt
+++ php-src/ext/gd/tests/bug37360.phpt
--TEST--
Bug #37360 (gdimagecreatefromgif, bad image sizes)
--SKIPIF--
?php 
if (!extension_loaded('gd')) die(skip gd extension not available\n); 
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?
--FILE--
?php
$im = imagecreatefromgif(dirname(__FILE__) . '/bug37360.gif');
var_dump($im);
?
--EXPECTF--
resource(%d) of type (gd)

-- 
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/gd/libgd gd_gif_in.c

2006-05-08 Thread Pierre-Alain Joye
pajoye  Mon May  8 12:06:59 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  - more CS
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.3r2=1.5.4.2.2.4diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.3 
php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.4
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.3Mon May  8 11:50:47 2006
+++ php-src/ext/gd/libgd/gd_gif_in.cMon May  8 12:06:59 2006
@@ -78,7 +78,7 @@
 
 int ZeroDataBlock;
 
-gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource)
+gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource) /* {{{ */
 {
gdIOCtx *in = gdNewSSCtx(inSource, NULL);
gdImagePtr  im;
@@ -89,9 +89,9 @@
 
return im;
 }
+/* }}} */
 
-   gdImagePtr
-gdImageCreateFromGif(FILE *fdFile)
+gdImagePtr gdImageCreateFromGif(FILE *fdFile) /* {{{ */
 {
gdIOCtx *fd = gdNewFileCtx(fdFile);
gdImagePtr  im = 0;
@@ -102,9 +102,9 @@
 
return im;
 }
+/* }}} */
 
-   gdImagePtr
-gdImageCreateFromGifCtx(gdIOCtxPtr fd)
+gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
 {
/* 1.4   int imageNumber; */
int BitPixel;
@@ -229,8 +229,9 @@
}
return im;
 }
+/* }}} */
 
-static int ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256])
+static int ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256]) 
/* {{{ */
 {
int i;
unsigned char   rgb[3];
@@ -248,8 +249,9 @@
 
return FALSE;
 }
+/* }}} */
 
-static int DoExtension(gdIOCtx *fd, int label, int *Transparent)
+static int DoExtension(gdIOCtx *fd, int label, int *Transparent) /* {{{ */
 {
static unsigned char buf[256];
 
@@ -273,8 +275,9 @@
 
return FALSE;
 }
+/* }}} */
 
-static int GetDataBlock_(gdIOCtx *fd, unsigned char *buf)
+static int GetDataBlock_(gdIOCtx *fd, unsigned char *buf) /* {{{ */
 {
unsigned char   count;
 
@@ -290,8 +293,9 @@
 
return count;
 }
+/* }}} */
 
-static int GetDataBlock(gdIOCtx *fd, unsigned char *buf)
+static int GetDataBlock(gdIOCtx *fd, unsigned char *buf) /* {{{ */
 {
int rv;
int i;
@@ -312,8 +316,9 @@
}
return(rv);
 }
+/* }}} */
 
-static int GetCode_(gdIOCtx *fd, int code_size, int flag)
+static int GetCode_(gdIOCtx *fd, int code_size, int flag) /* {{{ */
 {
static unsigned charbuf[280];
static int  curbit, lastbit, done, last_byte;
@@ -353,7 +358,7 @@
return ret;
 }
 
-static int GetCode(gdIOCtx *fd, int code_size, int flag)
+static int GetCode(gdIOCtx *fd, int code_size, int flag) /* {{{ */
 {
int rv;
 
@@ -361,9 +366,10 @@
if (VERBOSE) php_gd_error_ex(E_NOTICE, [GetCode(,%d,%d) returning 
%d],code_size,flag,rv);
return(rv);
 }
+/* }}} */
 
 #define STACK_SIZE ((1(MAX_LWZ_BITS))*2)
-static int LWZReadByte_(gdIOCtx *fd, int flag, int input_code_size)
+static int LWZReadByte_(gdIOCtx *fd, int flag, int input_code_size) /* {{{ */
 {
static int  fresh = FALSE;
int code, incode;
@@ -482,8 +488,9 @@
}
return code;
 }
+/* }}} */
 
-static int LWZReadByte(gdIOCtx *fd, int flag, int input_code_size)
+static int LWZReadByte(gdIOCtx *fd, int flag, int input_code_size) /* {{{ */
 {
int rv;
 
@@ -491,8 +498,9 @@
if (VERBOSE) php_gd_error_ex(E_NOTICE, [LWZReadByte(,%d,%d) returning 
%d],flag,input_code_size,rv);
return(rv);
 }
+/* }}} */
 
-static void ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, 
unsigned char (*cmap)[256], int interlace) /*1.4//, int ignore) */
+static void ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, 
unsigned char (*cmap)[256], int interlace) /* {{{ */ /*1.4//, int ignore) */
 {
unsigned char   c;
int v;
@@ -573,4 +581,4 @@
/* Ignore extra */
}
 }
-
+/* }}} */

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



[PHP-CVS] cvs: php-src(PHP_4_4) / NEWS /ext/gd/libgd gd_gif_in.c /ext/gd/tests bug37346.gif bug37346.phpt bug37360.gif bug37360.phpt

2006-05-08 Thread Pierre-Alain Joye
pajoye  Mon May  8 14:04:40 2006 UTC

  Added files: (Branch: PHP_4_4)
/php-src/ext/gd/tests   bug37346.phpt bug37346.gif bug37360.gif 
bug37360.phpt 

  Modified files:  
/php-src/ext/gd/libgd   gd_gif_in.c 
/php-srcNEWS 
  Log:
  - MFH: #37346, invalid colormap format
  - MFH: #37360, bad gif size
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.2.2.2.6.1r2=1.2.2.2.6.2diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.2.2.2.6.1 
php-src/ext/gd/libgd/gd_gif_in.c:1.2.2.2.6.2
--- php-src/ext/gd/libgd/gd_gif_in.c:1.2.2.2.6.1Sun Sep 25 12:13:49 2005
+++ php-src/ext/gd/libgd/gd_gif_in.cMon May  8 14:04:39 2006
@@ -147,7 +147,10 @@
Background  = buf[5];
AspectRatio = buf[6];
 
-   if (BitSet(buf[4], LOCALCOLORMAP)) {/* Global Colormap */
+   imw = LM_to_uint(buf[0],buf[1]);
+   imh = LM_to_uint(buf[2],buf[3]);
+
+   if (BitSet(buf[4], LOCALCOLORMAP)) {/* Global Colormap */
if (ReadColorMap(fd, BitPixel, ColorMap)) {
return 0;
}
@@ -182,16 +185,17 @@
 
bitPixel = 1((buf[8]0x07)+1);
 
-   imw = LM_to_uint(buf[4],buf[5]);
-   imh = LM_to_uint(buf[6],buf[7]);
+  if (!useGlobalColormap) {
+  if (ReadColorMap(fd, bitPixel, 
localColorMap)) {
+  return 0;
+  }
+  }
+  
   if (!(im = gdImageCreate(imw, imh))) {
 return 0;
   }
im-interlace = BitSet(buf[8], INTERLACE);
if (! useGlobalColormap) {
-   if (ReadColorMap(fd, bitPixel, localColorMap)) { 
- return 0;
-   }
ReadImage(im, fd, imw, imh, localColorMap, 
  BitSet(buf[8], INTERLACE)); 
  /*1.4//imageCount != imageNumber); */
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.1247.2.920.2.127r2=1.1247.2.920.2.128diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.127 php-src/NEWS:1.1247.2.920.2.128
--- php-src/NEWS:1.1247.2.920.2.127 Sun May  7 16:33:41 2006
+++ php-src/NEWSMon May  8 14:04:39 2006
@@ -4,7 +4,9 @@
 - Updated PCRE to version 6.6. (Andrei)
 - Added overflow checks to wordwrap() function. (Ilia)
 - Added a check for special characters in the session name. (Ilia)
+- Fixed bug #34360 (bad gif size) (Pierre)
 - Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia)
+- Fixed bug #37346 (invalid colormap format) (Pierre)
 - Fixed bug #37162 (wddx does not build as a shared extension).  
   (jdolecek at NetBSD dot org, Ilia)
 - Fixed bug #37046 (foreach breaks static scope). (Dmitry)

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug37346.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/bug37346.phpt
+++ php-src/ext/gd/tests/bug37346.phpt

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/bug37360.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/bug37360.phpt
+++ php-src/ext/gd/tests/bug37360.phpt
--TEST--
Bug #37360 (gdimagecreatefromgif, bad image sizes)
--SKIPIF--
?php 
if (!extension_loaded('gd')) die(skip gd extension not available\n); 
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?
--FILE--
?php
$im = imagecreatefromgif(dirname(__FILE__) . '/bug37360.gif');
var_dump($im);
?
--EXPECTF--
resource(%d) of type (gd)

-- 
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/pdo_pgsql pgsql_driver.c pgsql_statement.c

2006-05-08 Thread Ilia Alshanetsky
iliaa   Mon May  8 14:33:00 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_pgsql  pgsql_driver.c pgsql_statement.c 
  Log:
  Fixed memory leaks when working with cursors in PDO PostgreSQL driver.
  
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.53.2.14r2=1.53.2.14.2.1diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.1
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14  Sun Apr  9 08:17:50 2006
+++ php-src/ext/pdo_pgsql/pgsql_driver.cMon May  8 14:33:00 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pgsql_driver.c,v 1.53.2.14 2006/04/09 08:17:50 wez Exp $ */
+/* $Id: pgsql_driver.c,v 1.53.2.14.2.1 2006/05/08 14:33:00 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -229,6 +229,9 @@
PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL;
 
if (scrollable) {
+   if (S-cursor_name) {
+   efree(S-cursor_name);
+   }
/* TODO: check how scrollable cursors related to prepared 
statements */
spprintf(S-cursor_name, 0, pdo_pgsql_cursor_%08x, (unsigned 
int) stmt);
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.31.2.12r2=1.31.2.12.2.1diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12 
php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.1
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12   Mon Mar 27 20:51:01 2006
+++ php-src/ext/pdo_pgsql/pgsql_statement.c Mon May  8 14:33:00 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pgsql_statement.c,v 1.31.2.12 2006/03/27 20:51:01 wez Exp $ */
+/* $Id: pgsql_statement.c,v 1.31.2.12.2.1 2006/05/08 14:33:00 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -341,6 +341,7 @@

spprintf(q, 0, FETCH %s %ld FROM %s, ori_str, offset, 
S-cursor_name);
S-result = PQexec(S-H-server, q);
+   efree(q);
status = PQresultStatus(S-result);
 
if (status != PGRES_COMMAND_OK  status != PGRES_TUPLES_OK) {

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



[PHP-CVS] cvs: php-src /ext/pdo_pgsql pgsql_driver.c pgsql_statement.c

2006-05-08 Thread Ilia Alshanetsky
iliaa   Mon May  8 14:33:23 2006 UTC

  Modified files:  
/php-src/ext/pdo_pgsql  pgsql_driver.c pgsql_statement.c 
  Log:
  MFB: Fixed memory leaks when working with cursors in PDO PostgreSQL driver.
  
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.58r2=1.59diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.58 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.59
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.58   Tue Mar 14 11:14:05 2006
+++ php-src/ext/pdo_pgsql/pgsql_driver.cMon May  8 14:33:23 2006
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pgsql_driver.c,v 1.58 2006/03/14 11:14:05 edink Exp $ */
+/* $Id: pgsql_driver.c,v 1.59 2006/05/08 14:33:23 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -155,6 +155,9 @@
PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL;
 
if (scrollable) {
+   if (S-cursor_name) {
+   efree(S-cursor_name);
+   }
/* TODO: check how scrollable cursors related to prepared 
statements */
spprintf(S-cursor_name, 0, pdo_pgsql_cursor_%08x, (unsigned 
int) stmt);
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.36r2=1.37diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.36 
php-src/ext/pdo_pgsql/pgsql_statement.c:1.37
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.36Fri Mar 17 22:17:15 2006
+++ php-src/ext/pdo_pgsql/pgsql_statement.c Mon May  8 14:33:23 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: pgsql_statement.c,v 1.36 2006/03/17 22:17:15 tony2001 Exp $ */
+/* $Id: pgsql_statement.c,v 1.37 2006/05/08 14:33:23 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -241,6 +241,7 @@

spprintf(q, 0, FETCH %s %ld FROM %s, ori_str, offset, 
S-cursor_name);
S-result = PQexec(S-H-server, q);
+   efree(q);
status = PQresultStatus(S-result);
 
if (status != PGRES_COMMAND_OK  status != PGRES_TUPLES_OK) {

-- 
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/mysqli mysqli_api.c

2006-05-08 Thread Andrey Hristov
andrey  Mon May  8 15:06:52 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysqli mysqli_api.c 
  Log:
  tweaks and optimizations
  #tested on 32b and 64b
  
  http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.22r2=1.118.2.22.2.1diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.22 
php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.1
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.22  Wed Apr  5 12:17:08 2006
+++ php-src/ext/mysqli/mysqli_api.c Mon May  8 15:06:51 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.118.2.22 2006/04/05 12:17:08 georg Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.22.2.1 2006/05/08 15:06:51 andrey Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -89,11 +89,6 @@
unsigned long   rc;
 
/* calculate and check number of parameters */
-   num_vars = argc - 1;
-   if (!getThis()) {
-   /* ignore handle parameter in procedural interface*/
-   --num_vars; 
-   }
if (argc  2) {
/* there has to be at least one pair */
WRONG_PARAM_COUNT;
@@ -105,8 +100,12 @@
 
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt, 
MYSQLI_STATUS_VALID); 
 
+   num_vars = argc - 1;
if (getThis()) {
start = 1;
+   } else {
+   /* ignore handle parameter in procedural interface*/
+   --num_vars;
}
 
if (typelen != argc - start) {
@@ -154,23 +153,19 @@
 
case 'b': /* Blob (send data) */
bind[ofs].buffer_type = MYSQL_TYPE_LONG_BLOB;
-   bind[ofs].is_null = 0;
-   bind[ofs].length = 0;
+   /* don't initialize is_null and length to 0 
because we use ecalloc */
break;
 
case 's': /* string */
bind[ofs].buffer_type = MYSQL_TYPE_VAR_STRING;
-   bind[ofs].buffer = NULL; 
-   bind[ofs].buffer_length = 0;
+   /* don't initialize buffer and buffer_length 
because we use ecalloc */
bind[ofs].is_null = stmt-param.is_null[ofs];
break;
 
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Undefined fieldtype %c (parameter %d), types[ofs], i+1);
-   efree(args);
-   efree(bind);
-   RETURN_FALSE; 
-   break;
+   RETVAL_FALSE;
+   goto end;
}
ofs++;
}
@@ -178,9 +173,8 @@
MYSQLI_REPORT_STMT_ERROR(stmt-stmt);
 
if (rc) {
-   efree(args);
-   efree(bind);
-   RETURN_FALSE;
+   RETVAL_FALSE;
+   goto end;
}
 
stmt-param.var_cnt = num_vars;
@@ -193,10 +187,10 @@
stmt-param.vars[i] = NULL;
}
}
+   RETVAL_TRUE;
+end:
efree(args);
efree(bind);
-
-   RETURN_TRUE;
 }
 /* }}} */
 
@@ -279,12 +273,16 @@
break;
 
case MYSQL_TYPE_NULL:
-   stmt-result.buf[ofs].type = IS_NULL; 
-   stmt-result.buf[ofs].buflen = 0;
+   stmt-result.buf[ofs].type = IS_NULL;
+   /*
+ don't initialize to 0 :
+ 1. stmt-result.buf[ofs].buflen
+ 2. bind[ofs].buffer
+ 3. bind[ofs].buffer_length
+ because memory was allocated with ecalloc
+   */
bind[ofs].buffer_type = MYSQL_TYPE_NULL;
-   bind[ofs].buffer = 0;
bind[ofs].is_null = stmt-result.is_null[ofs];
-   bind[ofs].buffer_length = 0;
break;
 
case MYSQL_TYPE_SHORT:
@@ -294,7 +292,7 @@
case MYSQL_TYPE_YEAR:
convert_to_long_ex(args[i]);
stmt-result.buf[ofs].type = IS_LONG;
-   stmt-result.buf[ofs].buflen = 0;
+   /* don't set stmt-result.buf[ofs].buflen to 0, 
we used ecalloc */
stmt-result.buf[ofs].val = (char 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/curl multi.c

2006-05-08 Thread Brian France
bfrance Mon May  8 15:29:28 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/curl   multi.c 
  Log:
  
  MFH: Add implementation of curl_multi_info_read
  
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.3r2=1.2027.2.547.2.4diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.3 php-src/NEWS:1.2027.2.547.2.4
--- php-src/NEWS:1.2027.2.547.2.3   Sun May  7 16:32:39 2006
+++ php-src/NEWSMon May  8 15:29:27 2006
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2006, PHP 5.2.0
+- Add implementation of curl_multi_info_read (Brian)
 - Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia)
 - Fixed bug #37313 (sigemptyset() used without including signal.h).
   (jdolecek)
http://cvs.php.net/viewcvs.cgi/php-src/ext/curl/multi.c?r1=1.19.2.3r2=1.19.2.3.2.1diff_format=u
Index: php-src/ext/curl/multi.c
diff -u php-src/ext/curl/multi.c:1.19.2.3 php-src/ext/curl/multi.c:1.19.2.3.2.1
--- php-src/ext/curl/multi.c:1.19.2.3   Thu Apr 13 11:26:10 2006
+++ php-src/ext/curl/multi.cMon May  8 15:29:28 2006
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: multi.c,v 1.19.2.3 2006/04/13 11:26:10 tony2001 Exp $ */
+/* $Id: multi.c,v 1.19.2.3.2.1 2006/05/08 15:29:28 bfrance Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -84,17 +84,29 @@
ZEND_FETCH_RESOURCE(mh, php_curlm *, z_mh, -1, 
le_curl_multi_handle_name, le_curl_multi_handle);
ZEND_FETCH_RESOURCE(ch, php_curl *, z_ch, -1, le_curl_name, le_curl);
 
-   zval_add_ref(z_ch);
-
_php_curl_cleanup_handle(ch);
ch-uses++;
 
+   /* we want to create a copy of this zval that we store in the 
multihandle
+  structure element easyh - so we separate it from the original
+  input zval to this function using SEPARATE_ZVAL */
+   SEPARATE_ZVAL( z_ch );
zend_llist_add_element(mh-easyh, z_ch);
 
RETURN_LONG((long) curl_multi_add_handle(mh-multi, ch-cp));   
 }
 /* }}} */
 
+
+/* Used internally as comparison routine passed to zend_list_del_element */
+static int curl_compare_resources( zval **z1, zval **z2 )
+{
+   return (Z_TYPE_PP( z1 ) == Z_TYPE_PP( z2 )  
+Z_TYPE_PP( z1 ) == IS_RESOURCE 
+Z_LVAL_PP( z1 ) == Z_LVAL_PP( z2 ) );
+}
+
+
 /* {{{ proto int curl_multi_remove_handle(resource mh, resource ch)
Remove a multi handle from a set of cURL handles */
 PHP_FUNCTION(curl_multi_remove_handle)
@@ -112,6 +124,9 @@
ZEND_FETCH_RESOURCE(ch, php_curl *, z_ch, -1, le_curl_name, le_curl);
 
--ch-uses;
+
+   zend_llist_del_element( mh-easyh, z_ch, 
+   (int (*)(void *, void 
*)) curl_compare_resources );

RETURN_LONG((long) curl_multi_remove_handle(mh-multi, ch-cp));
 }
@@ -206,13 +221,11 @@
 {
zval  *z_mh;
php_curlm *mh;
-   CURLMsg   *tmp_msg;
+   CURLMsg   *tmp_msg;
intqueued_msgs;
+   zval  *zmsgs_in_queue = NULL;
 
-   /* XXX: Not Implemented */
-   return;
-   
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, z_mh) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|z, z_mh, 
zmsgs_in_queue) == FAILURE) {
return;
}
 
@@ -222,12 +235,46 @@
if (tmp_msg == NULL) {
RETURN_FALSE;
}
+   if (zmsgs_in_queue) {
+   zval_dtor(zmsgs_in_queue);
+   ZVAL_LONG(zmsgs_in_queue, queued_msgs);
+   }
 
array_init(return_value);
add_assoc_long(return_value, msg, tmp_msg-msg);
add_assoc_long(return_value, result, tmp_msg-data.result);
-   /* add_assoc_resource(return_value, handle, 
zend_list_id_by_pointer(tmp_msg-easy_handle, le_curl TSRMLS_CC)); */
-   add_assoc_string(return_value, whatever, (char *) 
tmp_msg-data.whatever, 1);
+
+   /* find the original easy curl handle */
+   {
+   zend_llist_position pos;
+   php_curl *ch;
+   zval**pz_ch;
+
+   /* search the list of easy handles hanging off the multi-handle 
*/
+   for(pz_ch = (zval **)zend_llist_get_first_ex(mh-easyh, pos); 
pz_ch;
+   pz_ch = (zval **)zend_llist_get_next_ex(mh-easyh, 
pos)) {
+   ZEND_FETCH_RESOURCE(ch, php_curl *, pz_ch, -1, 
le_curl_name, le_curl);
+   if (ch-cp == tmp_msg-easy_handle) {
+
+   /* we are adding a reference to the underlying 
php_curl
+  resource, so we need to add one to the 
resource's refcount 
+  in order to ensure it doesn't get destroyed 
when the 
+

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli.c php_mysqli.h

2006-05-08 Thread Georg Richter
georg   Mon May  8 16:19:43 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysqli mysqli.c php_mysqli.h 
  Log:
  moved zend_class_entry variables to mysqli.c
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.16r2=1.72.2.16.2.1diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.16 
php-src/ext/mysqli/mysqli.c:1.72.2.16.2.1
--- php-src/ext/mysqli/mysqli.c:1.72.2.16   Sun Apr  2 09:40:19 2006
+++ php-src/ext/mysqli/mysqli.c Mon May  8 16:19:43 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.72.2.16 2006/04/02 09:40:19 georg Exp $ 
+  $Id: mysqli.c,v 1.72.2.16.2.1 2006/05/08 16:19:43 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -43,6 +43,13 @@
 static HashTable mysqli_stmt_properties;
 static HashTable mysqli_warning_properties;
 
+zend_class_entry *mysqli_link_class_entry;
+zend_class_entry *mysqli_stmt_class_entry;
+zend_class_entry *mysqli_result_class_entry;
+zend_class_entry *mysqli_driver_class_entry;
+zend_class_entry *mysqli_warning_class_entry;
+zend_class_entry *mysqli_exception_class_entry;
+
 extern void php_mysqli_connect(INTERNAL_FUNCTION_PARAMETERS);
 
 typedef int (*mysqli_read_t)(mysqli_object *obj, zval **retval TSRMLS_DC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/php_mysqli.h?r1=1.54.2.7r2=1.54.2.7.2.1diff_format=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.54.2.7 
php-src/ext/mysqli/php_mysqli.h:1.54.2.7.2.1
--- php-src/ext/mysqli/php_mysqli.h:1.54.2.7Wed Apr  5 12:17:08 2006
+++ php-src/ext/mysqli/php_mysqli.h Mon May  8 16:19:43 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.54.2.7 2006/04/05 12:17:08 georg Exp $ 
+  $Id: php_mysqli.h,v 1.54.2.7.2.1 2006/05/08 16:19:43 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -161,12 +161,12 @@
 extern int php_local_infile_error(void *, char *, uint);
 extern void php_set_local_infile_handler_default(MY_MYSQL *);
 extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno 
TSRMLS_DC, char *format, ...);
-zend_class_entry *mysqli_link_class_entry;
-zend_class_entry *mysqli_stmt_class_entry;
-zend_class_entry *mysqli_result_class_entry;
-zend_class_entry *mysqli_driver_class_entry;
-zend_class_entry *mysqli_warning_class_entry;
-zend_class_entry *mysqli_exception_class_entry;
+extern zend_class_entry *mysqli_link_class_entry;
+extern zend_class_entry *mysqli_stmt_class_entry;
+extern zend_class_entry *mysqli_result_class_entry;
+extern zend_class_entry *mysqli_driver_class_entry;
+extern zend_class_entry *mysqli_warning_class_entry;
+extern zend_class_entry *mysqli_exception_class_entry;
 
 #ifdef HAVE_SPL
 extern PHPAPI zend_class_entry *spl_ce_RuntimeException;

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



Re: [PHP-CVS] cvs: php-src /ext/pgsql pgsql.c php_pgsql.h

2006-05-08 Thread Edin Kadribašić

http://livedocs.phpdoc.info/index.php?l=enq=function.pg-field-table

Christopher Kings-Lynne wrote:

Documentation?

Edin Kadribasic wrote:


edinkThu Mar 16 14:58:56 2006 UTC

  Modified files:  /php-src/ext/pgsqlpgsql.c 
php_pgsql.h   Log:

  Added pg_field_table() as per req: #36750
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/pgsql.c?r1=1.344r2=1.345diff_format=u 


Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.344 php-src/ext/pgsql/pgsql.c:1.345
--- php-src/ext/pgsql/pgsql.c:1.344Wed Mar  8 00:43:28 2006
+++ php-src/ext/pgsql/pgsql.cThu Mar 16 14:58:56 2006
@@ -20,7 +20,7 @@

+--+

  */
  -/* $Id: pgsql.c,v 1.344 2006/03/08 00:43:28 pajoye Exp $ */
+/* $Id: pgsql.c,v 1.345 2006/03/16 14:58:56 edink Exp $ */
 
 #include stdlib.h
 
@@ -151,6 +151,7 @@

 PHP_FE(pg_field_type_oid, NULL)
 PHP_FE(pg_field_prtlen,NULL)
 PHP_FE(pg_field_is_null,NULL)
+PHP_FE(pg_field_table,  NULL)
 /* async message function */
 PHP_FE(pg_get_notify,   NULL)
 PHP_FE(pg_get_pid,  NULL)
@@ -1694,6 +1695,95 @@
 }
 /* }}} */   
 
+/* {{{ proto mixed pg_field_table(resource result, int field_number[, 
bool oid_only])
+   Returns the name of the table field belongs to, or table's oid if 
oid_only is true */

+PHP_FUNCTION(pg_field_table)
+{
+zval *result;
+pgsql_result_handle *pg_result;
+long fnum = -1;
+zend_bool return_oid = 0;
+Oid oid;
+smart_str hash_key = {0};
+char *table_name;
+zend_rsrc_list_entry *field_table;
+
+if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl|b!, 
result, fnum, return_oid) == FAILURE) {

+return;
+}
+
+ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, 
-1, PostgreSQL result, le_result);

+
+if (fnum  0 || fnum = PQnfields(pg_result-result)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, Bad field offset 
specified);

+RETURN_FALSE;
+}
+
+oid = PQftable(pg_result-result, fnum);
+
+if (InvalidOid == oid) {
+RETURN_FALSE;
+}
+
+
+if (return_oid) {
+if (oid  LONG_MAX) {
+smart_str oidstr = {0};
+smart_str_append_unsigned(oidstr, oid);
+smart_str_0(oidstr);
+RETURN_STRINGL(oidstr.c, oidstr.len, 0);
+} else {
+RETURN_LONG((long)oid);
+}
+}
+
+/* try to lookup the table name in the resource list */
+smart_str_appends(hash_key, pgsql_table_oid_);
+smart_str_append_unsigned(hash_key, oid);
+smart_str_0(hash_key);
+
+if (zend_hash_find(EG(regular_list), hash_key.c, hash_key.len+1, 
(void **) field_table) == SUCCESS) {

+smart_str_free(hash_key);
+RETURN_STRING((char *)field_table-ptr, 1);
+} else { /* Not found, lookup by querying PostgreSQL system 
tables */

+PGresult *tmp_res;
+smart_str querystr = {0};
+zend_rsrc_list_entry new_field_table;
+
+smart_str_appends(querystr, select relname from pg_class 
where oid=);

+smart_str_append_unsigned(querystr, oid);
+smart_str_0(querystr);
+
+
+if ((tmp_res = PQexec(pg_result-conn, querystr.c)) == NULL 
|| PQresultStatus(tmp_res) != PGRES_TUPLES_OK) {

+if (tmp_res) {
+PQclear(tmp_res);
+}
+smart_str_free(querystr);
+smart_str_free(hash_key);
+RETURN_FALSE;
+}
+
+smart_str_free(querystr);
+
+if ((table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) {
+PQclear(tmp_res);
+smart_str_free(hash_key);
+RETURN_FALSE;
+}
+
+Z_TYPE(new_field_table) = le_string;
+new_field_table.ptr = estrdup(table_name);
+zend_hash_update(EG(regular_list), hash_key.c, 
hash_key.len+1, (void *) new_field_table, 
sizeof(zend_rsrc_list_entry), NULL);

+
+smart_str_free(hash_key);
+PQclear(tmp_res);
+RETURN_STRING(table_name, 1);
+}
+
+}
+/* }}} */   
+

 #define PHP_PG_FIELD_NAME 1
 #define PHP_PG_FIELD_SIZE 2
 #define PHP_PG_FIELD_TYPE 3
http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/php_pgsql.h?r1=1.74r2=1.75diff_format=u 


Index: php-src/ext/pgsql/php_pgsql.h
diff -u php-src/ext/pgsql/php_pgsql.h:1.74 
php-src/ext/pgsql/php_pgsql.h:1.75

--- php-src/ext/pgsql/php_pgsql.h:1.74Sun Jan  1 13:09:53 2006
+++ php-src/ext/pgsql/php_pgsql.hThu Mar 16 14:58:56 2006
@@ -17,7 +17,7 @@

+--+

  */
  -/* $Id: php_pgsql.h,v 1.74 2006/01/01 13:09:53 sniper Exp $ */
+/* $Id: php_pgsql.h,v 1.75 2006/03/16 14:58:56 edink Exp $ */
 
 #ifndef PHP_PGSQL_H

 #define PHP_PGSQL_H
@@ -125,6 +125,7 @@
 PHP_FUNCTION(pg_field_type_oid);
 PHP_FUNCTION(pg_field_prtlen);
 PHP_FUNCTION(pg_field_is_null);
+PHP_FUNCTION(pg_field_table);
 /* async message functions */
 

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

2006-05-08 Thread Edin Kadribasic
edink   Mon May  8 20:18:34 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  Update news
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.4r2=1.2027.2.547.2.5diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.4 php-src/NEWS:1.2027.2.547.2.5
--- php-src/NEWS:1.2027.2.547.2.4   Mon May  8 15:29:27 2006
+++ php-src/NEWSMon May  8 20:18:34 2006
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? ??? 2006, PHP 5.2.0
+- Added support for Apache 2.2 handler in the Windows distro. (Edin)
+- Added pg_field_table() function. (Edin)
 - Add implementation of curl_multi_info_read (Brian)
 - Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia)
 - Fixed bug #37313 (sigemptyset() used without including signal.h).

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



[PHP-CVS] cvs: php-src /ext/unicode config.w32

2006-05-08 Thread Edin Kadribasic
edink   Mon May  8 21:06:34 2006 UTC

  Modified files:  
/php-src/ext/unicodeconfig.w32 
  Log:
  Added  constants.c to the windows build
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/config.w32?r1=1.9r2=1.10diff_format=u
Index: php-src/ext/unicode/config.w32
diff -u php-src/ext/unicode/config.w32:1.9 php-src/ext/unicode/config.w32:1.10
--- php-src/ext/unicode/config.w32:1.9  Fri May  5 21:37:08 2006
+++ php-src/ext/unicode/config.w32  Mon May  8 21:06:34 2006
@@ -1,5 +1,5 @@
-// $Id: config.w32,v 1.9 2006/05/05 21:37:08 fmk Exp $
+// $Id: config.w32,v 1.10 2006/05/08 21:06:34 edink Exp $
 // vim:ft=javascript
 
-EXTENSION(unicode, unicode.c unicode_iterators.c collator.c locale.c 
property.c, false);
+EXTENSION(unicode, unicode.c unicode_iterators.c collator.c locale.c 
property.c constants.c, false);
 AC_DEFINE('HAVE_UNICODE', 1, 'ICU API extension');

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



[PHP-CVS] cvs: php-src /ext/unicode php_property.h property.c unicode.c

2006-05-08 Thread Andrei Zmievski
andrei  Mon May  8 21:54:44 2006 UTC

  Modified files:  
/php-src/ext/unicodephp_property.h property.c unicode.c 
  Log:
  A few more property functinos.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/php_property.h?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/unicode/php_property.h
diff -u php-src/ext/unicode/php_property.h:1.4 
php-src/ext/unicode/php_property.h:1.5
--- php-src/ext/unicode/php_property.h:1.4  Thu May  4 18:37:12 2006
+++ php-src/ext/unicode/php_property.h  Mon May  8 21:54:44 2006
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: php_property.h,v 1.4 2006/05/04 18:37:12 andrei Exp $ */ 
+/* $Id: php_property.h,v 1.5 2006/05/08 21:54:44 andrei Exp $ */ 
 
 #ifndef PHP_PROPERTY_H
 #define PHP_PROPERTY_H
@@ -69,11 +69,16 @@
  * Other functions
  */
 
-PHP_FUNCTION(char_to_digit);
 PHP_FUNCTION(char_from_digit);
 PHP_FUNCTION(char_from_name);
 PHP_FUNCTION(char_get_name);
 
+PHP_FUNCTION(char_has_binary_property);
+PHP_FUNCTION(char_get_property_value);
+PHP_FUNCTION(char_get_property_value);
+PHP_FUNCTION(char_get_property_min_value);
+PHP_FUNCTION(char_get_property_max_value);
+
 #endif /* PHP_PROPERTY_H */
 
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/property.c?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/unicode/property.c
diff -u php-src/ext/unicode/property.c:1.8 php-src/ext/unicode/property.c:1.9
--- php-src/ext/unicode/property.c:1.8  Thu May  4 21:22:30 2006
+++ php-src/ext/unicode/property.c  Mon May  8 21:54:44 2006
@@ -14,7 +14,7 @@
+--+
  */
 
-/* $Id: property.c,v 1.8 2006/05/04 21:22:30 andrei Exp $ */ 
+/* $Id: property.c,v 1.9 2006/05/08 21:54:44 andrei Exp $ */ 
 
 #include php_unicode.h
 
@@ -442,6 +442,84 @@
 
 /* }}} */
 
+/* {{{ Other property functions */
+
+PHP_FUNCTION(char_has_binary_property)
+{
+   UChar   *str = NULL;
+   int  str_len;
+   long prop;
+   UPropertyuprop; 
+   int  offset = 0;
+   zend_boolresult = 1;
+   UChar32  ch;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ul, str, 
str_len, prop) == FAILURE) {
+   return;
+   }
+
+   if (str_len == 0) {
+   RETURN_FALSE;
+   }
+
+   uprop = (UProperty)prop;
+
+   while (offset  str_len  result) {
+   U16_NEXT(str, offset, str_len, ch);
+   result = u_hasBinaryProperty(ch, uprop);
+   }
+
+   RETURN_BOOL(result);
+}
+
+PHP_FUNCTION(char_get_property_value)
+{
+   UChar  *str;
+   int str_len;
+   int offset = 0;
+   UChar32 ch;
+   longprop;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ul, str, 
str_len, prop) == FAILURE) {
+   return;
+   }
+
+   if (str_len == 0) {
+   RETURN_FALSE;
+   }
+
+   U16_NEXT(str, offset, str_len, ch);
+
+   if (prop = UCHAR_BINARY_START  prop  UCHAR_BINARY_LIMIT) {
+   RETURN_BOOL((zend_bool)u_getIntPropertyValue(ch, 
(UProperty)prop));
+   } else {
+   RETURN_LONG(u_getIntPropertyValue(ch, (UProperty)prop));
+   }
+}
+
+PHP_FUNCTION(char_get_property_min_value)
+{
+   long prop;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, prop) == 
FAILURE) {
+   return;
+   }
+   
+   RETURN_LONG(u_getIntPropertyMinValue((UProperty)prop));
+}
+
+PHP_FUNCTION(char_get_property_max_value)
+{
+   long prop;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, prop) == 
FAILURE) {
+   return;
+   }
+   
+   RETURN_LONG(u_getIntPropertyMaxValue((UProperty)prop));
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode.c?r1=1.29r2=1.30diff_format=u
Index: php-src/ext/unicode/unicode.c
diff -u php-src/ext/unicode/unicode.c:1.29 php-src/ext/unicode/unicode.c:1.30
--- php-src/ext/unicode/unicode.c:1.29  Fri May  5 20:56:21 2006
+++ php-src/ext/unicode/unicode.c   Mon May  8 21:54:44 2006
@@ -15,7 +15,7 @@
   +--+
 */
 
-/* $Id: unicode.c,v 1.29 2006/05/05 20:56:21 andrei Exp $ */ 
+/* $Id: unicode.c,v 1.30 2006/05/08 21:54:44 andrei Exp $ */ 
 
 #include php_unicode.h
 #include zend_unicode.h
@@ -283,9 +283,13 @@
PHP_FE(char_get_type,   NULL)
PHP_FE(char_is_valid,   NULL)
 
-   PHP_FE(char_from_digit, NULL)
-   PHP_FE(char_from_name, NULL)
-   PHP_FE(char_get_name, NULL)
+   PHP_FE(char_from_digit, NULL)
+   PHP_FE(char_from_name,  NULL)
+   PHP_FE(char_get_name,   

[PHP-CVS] cvs: php-src /ext/unicode php_property.h property.c unicode.c

2006-05-08 Thread Andrei Zmievski
andrei  Mon May  8 22:23:58 2006 UTC

  Modified files:  
/php-src/ext/unicodephp_property.h property.c unicode.c 
  Log:
  And going, and going...
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/php_property.h?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/unicode/php_property.h
diff -u php-src/ext/unicode/php_property.h:1.5 
php-src/ext/unicode/php_property.h:1.6
--- php-src/ext/unicode/php_property.h:1.5  Mon May  8 21:54:44 2006
+++ php-src/ext/unicode/php_property.h  Mon May  8 22:23:57 2006
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: php_property.h,v 1.5 2006/05/08 21:54:44 andrei Exp $ */ 
+/* $Id: php_property.h,v 1.6 2006/05/08 22:23:57 andrei Exp $ */ 
 
 #ifndef PHP_PROPERTY_H
 #define PHP_PROPERTY_H
@@ -78,6 +78,8 @@
 PHP_FUNCTION(char_get_property_value);
 PHP_FUNCTION(char_get_property_min_value);
 PHP_FUNCTION(char_get_property_max_value);
+PHP_FUNCTION(char_get_property_name);
+PHP_FUNCTION(char_get_property_from_name);
 
 #endif /* PHP_PROPERTY_H */
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/property.c?r1=1.9r2=1.10diff_format=u
Index: php-src/ext/unicode/property.c
diff -u php-src/ext/unicode/property.c:1.9 php-src/ext/unicode/property.c:1.10
--- php-src/ext/unicode/property.c:1.9  Mon May  8 21:54:44 2006
+++ php-src/ext/unicode/property.c  Mon May  8 22:23:57 2006
@@ -14,7 +14,7 @@
+--+
  */
 
-/* $Id: property.c,v 1.9 2006/05/08 21:54:44 andrei Exp $ */ 
+/* $Id: property.c,v 1.10 2006/05/08 22:23:57 andrei Exp $ */ 
 
 #include php_unicode.h
 
@@ -369,15 +369,16 @@
 
 PHP_FUNCTION(char_from_name)
 {
-   UChar  *name;
+   void   *name;
int name_len;
+   zend_uchar  name_type;
UChar32 ch;
UCharNameChoice choice = U_UNICODE_CHAR_NAME;
zend_bool   extended = FALSE;
char   *buf;
UErrorCode  status = U_ZERO_ERROR;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, u|b, name, 
name_len, extended) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t|b, name, 
name_len, name_type, extended) == FAILURE) {
return;
}
 
@@ -385,19 +386,27 @@
choice = U_EXTENDED_CHAR_NAME;
}
 
-   buf = zend_unicode_to_ascii(name, name_len TSRMLS_CC);
-   if (buf) {
-   ch = u_charFromName(choice, buf, status);
-   if (U_SUCCESS(status)) {
-   RETVAL_UCHAR32(ch);
-   } else {
-   RETVAL_FALSE;
+   if (name_type == IS_UNICODE) {
+   buf = zend_unicode_to_ascii(name, name_len TSRMLS_CC);
+   if (buf == NULL) {
+   php_error(E_WARNING, Character name has to consist 
only of ASCII characters);
+   RETURN_FALSE;
}
} else {
-   php_error(E_WARNING, Character name has to consist only of 
ASCII characters);
+   buf = (char *) name;
+   }
+
+   ch = u_charFromName(choice, buf, status);
+
+   if (name_type == IS_UNICODE) {
+   efree(buf);
+   }
+
+   if (U_SUCCESS(status)) {
+   RETURN_UCHAR32(ch);
+   } else {
RETURN_FALSE;
}
-   efree(buf);
 }
 
 PHP_FUNCTION(char_get_name)
@@ -518,6 +527,60 @@

RETURN_LONG(u_getIntPropertyMaxValue((UProperty)prop));
 }
+
+PHP_FUNCTION(char_get_property_name)
+{
+   long prop;
+   long name_choice = U_LONG_PROPERTY_NAME;
+   const char  *name;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l|l, prop, 
name_choice) == FAILURE) {
+   return;
+   }
+
+   if (name_choice  0) {
+   name_choice = U_LONG_PROPERTY_NAME;
+   }
+
+   name = u_getPropertyName((UProperty) prop, (UPropertyNameChoice) 
name_choice);
+   if (name) {
+   RETURN_ASCII_STRING((char *)name, ZSTR_DUPLICATE);
+   } else {
+   RETURN_FALSE;
+   }
+
+}
+
+PHP_FUNCTION(char_get_property_from_name)
+{
+   void   *name;
+   int name_len;
+   zend_uchar  name_type;
+   char   *buf;
+   UProperty   prop;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t, name, 
name_len, name_type) == FAILURE) {
+   return;
+   }
+
+   if (name_type == IS_UNICODE) {
+   buf = zend_unicode_to_ascii(name, name_len TSRMLS_CC);
+   if (buf == NULL) {
+   php_error(E_WARNING, Property name has to consist only 
of ASCII characters);
+   RETURN_FALSE;
+   }
+   } else {
+   buf = (char *) name;
+   }
+
+   prop = u_getPropertyEnum(buf);
+   if (name_type == 

[PHP-CVS] cvs: php-src /ext/unicode php_property.h property.c unicode.c

2006-05-08 Thread Andrei Zmievski
andrei  Mon May  8 23:01:20 2006 UTC

  Modified files:  
/php-src/ext/unicodephp_property.h property.c unicode.c 
  Log:
  Been a long day..
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/php_property.h?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/unicode/php_property.h
diff -u php-src/ext/unicode/php_property.h:1.6 
php-src/ext/unicode/php_property.h:1.7
--- php-src/ext/unicode/php_property.h:1.6  Mon May  8 22:23:57 2006
+++ php-src/ext/unicode/php_property.h  Mon May  8 23:01:20 2006
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: php_property.h,v 1.6 2006/05/08 22:23:57 andrei Exp $ */ 
+/* $Id: php_property.h,v 1.7 2006/05/08 23:01:20 andrei Exp $ */ 
 
 #ifndef PHP_PROPERTY_H
 #define PHP_PROPERTY_H
@@ -80,6 +80,8 @@
 PHP_FUNCTION(char_get_property_max_value);
 PHP_FUNCTION(char_get_property_name);
 PHP_FUNCTION(char_get_property_from_name);
+PHP_FUNCTION(char_get_property_value_name);
+PHP_FUNCTION(char_get_property_value_from_name);
 
 #endif /* PHP_PROPERTY_H */
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/property.c?r1=1.10r2=1.11diff_format=u
Index: php-src/ext/unicode/property.c
diff -u php-src/ext/unicode/property.c:1.10 php-src/ext/unicode/property.c:1.11
--- php-src/ext/unicode/property.c:1.10 Mon May  8 22:23:57 2006
+++ php-src/ext/unicode/property.c  Mon May  8 23:01:20 2006
@@ -14,7 +14,7 @@
+--+
  */
 
-/* $Id: property.c,v 1.10 2006/05/08 22:23:57 andrei Exp $ */ 
+/* $Id: property.c,v 1.11 2006/05/08 23:01:20 andrei Exp $ */ 
 
 #include php_unicode.h
 
@@ -548,7 +548,6 @@
} else {
RETURN_FALSE;
}
-
 }
 
 PHP_FUNCTION(char_get_property_from_name)
@@ -581,6 +580,60 @@
RETURN_LONG(prop);
 }
 
+PHP_FUNCTION(char_get_property_value_name)
+{
+   long prop;
+   long value;
+   long name_choice = U_LONG_PROPERTY_NAME;
+   const char  *name;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ll|l, prop, 
value, name_choice) == FAILURE) {
+   return;
+   }
+
+   if (name_choice  0) {
+   name_choice = U_LONG_PROPERTY_NAME;
+   }
+
+   name = u_getPropertyValueName((UProperty) prop, (int32_t) value, 
(UPropertyNameChoice) name_choice);
+   if (name) {
+   RETURN_ASCII_STRING((char *)name, ZSTR_DUPLICATE);
+   } else {
+   RETURN_FALSE;
+   }
+}
+
+PHP_FUNCTION(char_get_property_value_from_name)
+{
+   longprop;
+   void   *name;
+   int name_len;
+   zend_uchar  name_type;
+   char   *buf;
+   longvalue;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, lt, prop, 
name, name_len, name_type) == FAILURE) {
+   return;
+   }
+
+   if (name_type == IS_UNICODE) {
+   buf = zend_unicode_to_ascii(name, name_len TSRMLS_CC);
+   if (buf == NULL) {
+   php_error(E_WARNING, Property value name has to 
consist only of ASCII characters);
+   RETURN_FALSE;
+   }
+   } else {
+   buf = (char *) name;
+   }
+
+   value = u_getPropertyValueEnum((UProperty)prop, buf);
+   if (name_type == IS_UNICODE) {
+   efree(buf);
+   }
+
+   RETURN_LONG(value);
+}
+
 /* }}} */
 
 /*
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/unicode.c?r1=1.31r2=1.32diff_format=u
Index: php-src/ext/unicode/unicode.c
diff -u php-src/ext/unicode/unicode.c:1.31 php-src/ext/unicode/unicode.c:1.32
--- php-src/ext/unicode/unicode.c:1.31  Mon May  8 22:23:57 2006
+++ php-src/ext/unicode/unicode.c   Mon May  8 23:01:20 2006
@@ -15,7 +15,7 @@
   +--+
 */
 
-/* $Id: unicode.c,v 1.31 2006/05/08 22:23:57 andrei Exp $ */ 
+/* $Id: unicode.c,v 1.32 2006/05/08 23:01:20 andrei Exp $ */ 
 
 #include php_unicode.h
 #include zend_unicode.h
@@ -292,6 +292,8 @@
PHP_FE(char_get_property_max_value, NULL)
PHP_FE(char_get_property_name,  NULL)
PHP_FE(char_get_property_from_name, NULL)
+   PHP_FE(char_get_property_value_name, NULL)
+   PHP_FE(char_get_property_value_from_name, NULL)
 
{ NULL, NULL, NULL }
 };

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



[PHP-CVS] cvs: php-src /ext/unicode php_property.h property.c unicode.c

2006-05-08 Thread Andrei Zmievski
andrei  Tue May  9 00:06:08 2006 UTC

  Modified files:  
/php-src/ext/unicodephp_property.h property.c unicode.c 
  Log:
  Add char_enum_names().
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/php_property.h?r1=1.7r2=1.8diff_format=u
Index: php-src/ext/unicode/php_property.h
diff -u php-src/ext/unicode/php_property.h:1.7 
php-src/ext/unicode/php_property.h:1.8
--- php-src/ext/unicode/php_property.h:1.7  Mon May  8 23:01:20 2006
+++ php-src/ext/unicode/php_property.h  Tue May  9 00:06:08 2006
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: php_property.h,v 1.7 2006/05/08 23:01:20 andrei Exp $ */ 
+/* $Id: php_property.h,v 1.8 2006/05/09 00:06:08 andrei Exp $ */ 
 
 #ifndef PHP_PROPERTY_H
 #define PHP_PROPERTY_H
@@ -83,6 +83,8 @@
 PHP_FUNCTION(char_get_property_value_name);
 PHP_FUNCTION(char_get_property_value_from_name);
 
+PHP_FUNCTION(char_enum_names);
+
 #endif /* PHP_PROPERTY_H */
 
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/property.c?r1=1.11r2=1.12diff_format=u
Index: php-src/ext/unicode/property.c
diff -u php-src/ext/unicode/property.c:1.11 php-src/ext/unicode/property.c:1.12
--- php-src/ext/unicode/property.c:1.11 Mon May  8 23:01:20 2006
+++ php-src/ext/unicode/property.c  Tue May  9 00:06:08 2006
@@ -14,12 +14,19 @@
+--+
  */
 
-/* $Id: property.c,v 1.11 2006/05/08 23:01:20 andrei Exp $ */ 
+/* $Id: property.c,v 1.12 2006/05/09 00:06:08 andrei Exp $ */ 
 
 #include php_unicode.h
 
 typedef UBool (*prop_check_func_t)(UChar32 ch);
 
+typedef struct {
+   zval  **args[4];
+   void ***thread_ctx;
+   zend_fcall_info fci;
+   zend_fcall_info_cache   fci_cache;
+} char_enum_context_t;
+
 static void check_property_impl(INTERNAL_FUNCTION_PARAMETERS, 
prop_check_func_t checker)
 {
UChar  *str;
@@ -636,6 +643,115 @@
 
 /* }}} */
 
+
+/* {{{ Enumerator functions */
+
+static UBool php_enum_char_names(void *context,
+UChar32 code,
+
UCharNameChoice nameChoice,
+const char 
*name,
+int32_t length)
+{
+char_enum_context_t   *ctx = (char_enum_context_t *)context;
+zval  *retval_ptr = NULL;
+intstatus;
+UBool  result = FALSE;
+TSRMLS_FETCH_FROM_CTX(ctx-thread_ctx);
+
+   /*
+convert_to_long_ex(ctx-args[0]);
+convert_to_bool_ex(ctx-args[1]);
+convert_to_string_ex(ctx-args[2]);
+   */
+
+ZVAL_LONG(*ctx-args[0], code);
+ZVAL_BOOL(*ctx-args[1], nameChoice == U_EXTENDED_CHAR_NAME);
+   if (Z_USTRVAL_PP(ctx-args[2])) {
+   efree(Z_USTRVAL_PP(ctx-args[2]));
+   }
+ZVAL_ASCII_STRINGL(*ctx-args[2], (char *)name, length, ZSTR_DUPLICATE);
+
+ctx-fci.retval_ptr_ptr = retval_ptr;
+
+status = zend_call_function(ctx-fci, ctx-fci_cache TSRMLS_CC);
+
+if (status == SUCCESS  retval_ptr  !EG(exception)) {
+convert_to_boolean(retval_ptr);
+result = (UBool)Z_BVAL_P(retval_ptr);
+} else {
+if (!EG(exception)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, Enumeration callback 
encountered an error);
+}
+result = FALSE;
+}
+if (retval_ptr) {
+zval_ptr_dtor(retval_ptr);
+}
+return result;
+}
+
+PHP_FUNCTION(char_enum_names)
+{
+zval  *callback;
+long   start, limit;
+   zend_bool   extended = FALSE;
+zval  *zcode, *zname, *zextended;
+char_enum_context_t ectx;
+   UCharNameChoice choice = U_UNICODE_CHAR_NAME;
+UErrorCode status = U_ZERO_ERROR;
+
+if (zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC, zll|l, callback, 
start, limit, extended)) {
+return;   
+}   
+
+   if (!zend_is_callable(callback, 0, NULL)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid 
enumeration callback);
+   return;
+   }
+
+   if (extended) {
+   choice = U_EXTENDED_CHAR_NAME;
+   }  
+
+/* Do all the heavy lifing once, instead of in the callback */
+MAKE_STD_ZVAL(zcode);
+MAKE_STD_ZVAL(zextended);
+MAKE_STD_ZVAL(zname);
+
+ZVAL_LONG(zcode, 0);
+ZVAL_BOOL(zextended, 0);
+Z_TYPE_P(zname) = IS_UNICODE;
+   Z_USTRVAL_P(zname) = NULL;
+
+memset(ectx, 0, sizeof(char_enum_context_t));
+ectx.fci.size = sizeof(ectx.fci);
+ectx.fci.function_table = 

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

2006-05-08 Thread Andrei Zmievski
andrei  Tue May  9 00:15:45 2006 UTC

  Modified files:  
/php-src/ext/unicodeproperty.c 
  Log:
  Fix and adjust.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/property.c?r1=1.12r2=1.13diff_format=u
Index: php-src/ext/unicode/property.c
diff -u php-src/ext/unicode/property.c:1.12 php-src/ext/unicode/property.c:1.13
--- php-src/ext/unicode/property.c:1.12 Tue May  9 00:06:08 2006
+++ php-src/ext/unicode/property.c  Tue May  9 00:15:45 2006
@@ -14,7 +14,7 @@
+--+
  */
 
-/* $Id: property.c,v 1.12 2006/05/09 00:06:08 andrei Exp $ */ 
+/* $Id: property.c,v 1.13 2006/05/09 00:15:45 andrei Exp $ */ 
 
 #include php_unicode.h
 
@@ -643,7 +643,6 @@
 
 /* }}} */
 
-
 /* {{{ Enumerator functions */
 
 static UBool php_enum_char_names(void *context,
@@ -658,18 +657,16 @@
 UBool  result = FALSE;
 TSRMLS_FETCH_FROM_CTX(ctx-thread_ctx);
 
-   /*
 convert_to_long_ex(ctx-args[0]);
-convert_to_bool_ex(ctx-args[1]);
-convert_to_string_ex(ctx-args[2]);
-   */
+convert_to_unicode_ex(ctx-args[1]);
+convert_to_boolean_ex(ctx-args[2]);
 
 ZVAL_LONG(*ctx-args[0], code);
-ZVAL_BOOL(*ctx-args[1], nameChoice == U_EXTENDED_CHAR_NAME);
-   if (Z_USTRVAL_PP(ctx-args[2])) {
-   efree(Z_USTRVAL_PP(ctx-args[2]));
+   if (Z_USTRVAL_PP(ctx-args[1])) {
+   efree(Z_USTRVAL_PP(ctx-args[1]));
}
-ZVAL_ASCII_STRINGL(*ctx-args[2], (char *)name, length, ZSTR_DUPLICATE);
+ZVAL_ASCII_STRINGL(*ctx-args[1], (char *)name, length, ZSTR_DUPLICATE);
+ZVAL_BOOL(*ctx-args[2], nameChoice == U_EXTENDED_CHAR_NAME);
 
 ctx-fci.retval_ptr_ptr = retval_ptr;
 
@@ -730,8 +727,8 @@
 ectx.fci.no_separation = 1;
 ectx.fci_cache = empty_fcall_info_cache;
 ectx.args[0] = zcode;
-ectx.args[1] = zextended;
-ectx.args[2] = zname;
+ectx.args[1] = zname;
+ectx.args[2] = zextended;
 ectx.fci.param_count = 3;
 ectx.fci.params = ectx.args;
 TSRMLS_SET_CTX(ectx.thread_ctx);

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