[PHP-CVS] cvs: php-src /ext/mime_magic mime_magic.c /ext/msql php_msql.c /ext/odbc birdstep.c /ext/standard basic_functions.c /sapi/apache php_apache.c /sapi/apache2filter php_functions.c /sapi/

2008-07-20 Thread Felipe Pena
felipe  Sun Jul 20 14:29:29 2008 UTC

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
/php-src/ext/msql   php_msql.c 
/php-src/ext/odbc   birdstep.c 
/php-src/ext/standard   basic_functions.c 
/php-src/sapi/apachephp_apache.c 
/php-src/sapi/apache2filter php_functions.c 
/php-src/sapi/apache_hooks  php_apache.c 
  Log:
  - MFB: Added arginfo
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mime_magic/mime_magic.c?r1=1.59r2=1.60diff_format=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.59 
php-src/ext/mime_magic/mime_magic.c:1.60
--- php-src/ext/mime_magic/mime_magic.c:1.59Mon Dec 31 07:12:11 2007
+++ php-src/ext/mime_magic/mime_magic.c Sun Jul 20 14:29:29 2008
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.59 2007/12/31 07:12:11 sebastian Exp $ 
+  $Id: mime_magic.c,v 1.60 2008/07/20 14:29:29 felipe Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -217,9 +217,16 @@
 /* True global resources - no need for thread safety here */
 static magic_server_config_rec mime_global;
 
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mime_content_type, 0, 0, 1)
+   ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+/* }}} */
+
 /* {{{ mime_magic_functions[] */
 const zend_function_entry mime_magic_functions[] = {
-   PHP_FE(mime_content_type,   NULL)  
+   PHP_FE(mime_content_type,   arginfo_mime_content_type) 
{NULL, NULL, NULL}  
 };
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/msql/php_msql.c?r1=1.71r2=1.72diff_format=u
Index: php-src/ext/msql/php_msql.c
diff -u php-src/ext/msql/php_msql.c:1.71 php-src/ext/msql/php_msql.c:1.72
--- php-src/ext/msql/php_msql.c:1.71Sat Jul  5 13:12:56 2008
+++ php-src/ext/msql/php_msql.c Sun Jul 20 14:29:29 2008
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: php_msql.c,v 1.71 2008/07/05 13:12:56 pajoye Exp $ */
+/* $Id: php_msql.c,v 1.72 2008/07/20 14:29:29 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -44,58 +44,224 @@
 #define MSQL_NUM   11
 #define MSQL_BOTH  (MSQL_ASSOC|MSQL_NUM)
 
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_connect, 0, 0, 0)
+   ZEND_ARG_INFO(0, hostname)
+   ZEND_ARG_INFO(0, username)
+   ZEND_ARG_INFO(0, password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_pconnect, 0, 0, 0)
+   ZEND_ARG_INFO(0, hostname)
+   ZEND_ARG_INFO(0, username)
+   ZEND_ARG_INFO(0, password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_close, 0, 0, 0)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_select_db, 0, 0, 1)
+   ZEND_ARG_INFO(0, database_name)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_create_db, 0, 0, 1)
+   ZEND_ARG_INFO(0, database_name)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_drop_db, 0, 0, 1)
+   ZEND_ARG_INFO(0, database_name)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_query, 0, 0, 1)
+   ZEND_ARG_INFO(0, query)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_db_query, 0, 0, 2)
+   ZEND_ARG_INFO(0, database_name)
+   ZEND_ARG_INFO(0, query)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_list_dbs, 0, 0, 0)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_list_tables, 0, 0, 1)
+   ZEND_ARG_INFO(0, database_name)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_list_fields, 0, 0, 2)
+   ZEND_ARG_INFO(0, database_name)
+   ZEND_ARG_INFO(0, table_name)
+   ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_msql_error, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_result, 0, 0, 2)
+   ZEND_ARG_INFO(0, query)
+   ZEND_ARG_INFO(0, row)
+   ZEND_ARG_INFO(0, field)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_num_rows, 0, 0, 1)
+   ZEND_ARG_INFO(0, query)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_num_fields, 0, 0, 1)
+   ZEND_ARG_INFO(0, query)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msql_fetch_row, 0, 0, 1)
+   ZEND_ARG_INFO(0, query)
+ZEND_END_ARG_INFO()
+

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

2006-12-28 Thread Antony Dovgal
tony2001Thu Dec 28 20:45:20 2006 UTC

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  use strlcpy()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mime_magic/mime_magic.c?r1=1.52r2=1.53diff_format=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.52 
php-src/ext/mime_magic/mime_magic.c:1.53
--- php-src/ext/mime_magic/mime_magic.c:1.52Thu Nov 30 15:13:33 2006
+++ php-src/ext/mime_magic/mime_magic.c Thu Dec 28 20:45:20 2006
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.52 2006/11/30 15:13:33 iliaa Exp $ 
+  $Id: mime_magic.c,v 1.53 2006/12/28 20:45:20 tony2001 Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -730,9 +730,7 @@
return -1;
}

-   strncpy(m-desc, l, sizeof(m-desc) - 1);
-   m-desc[sizeof(m-desc) - 1] = '\0';
-
+   strlcpy(m-desc, l, sizeof(m-desc));
 return 0;
 }
 

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



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

2006-11-30 Thread Ilia Alshanetsky
iliaa   Thu Nov 30 15:13:33 2006 UTC

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  MFB: Use thread-safe code
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mime_magic/mime_magic.c?r1=1.51r2=1.52diff_format=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.51 
php-src/ext/mime_magic/mime_magic.c:1.52
--- php-src/ext/mime_magic/mime_magic.c:1.51Sun Nov 26 17:03:15 2006
+++ php-src/ext/mime_magic/mime_magic.c Thu Nov 30 15:13:33 2006
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.51 2006/11/26 17:03:15 iliaa Exp $ 
+  $Id: mime_magic.c,v 1.52 2006/11/30 15:13:33 iliaa Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -1755,12 +1755,15 @@
 case DATE:
 case BEDATE:
 case LEDATE:
-   /* XXX: not multithread safe */
-   pp = ctime((time_t *)  p-l);
-   if ((rt = strchr(pp, '\n')) != NULL)
-   *rt = '\0';
-   (void) magic_rsl_printf(m-desc, pp);
-   return;
+   {
+   char ctimebuf[52];
+   pp = php_ctime_r((time_t *) p-l, ctimebuf);
+   if ((rt = strchr(pp, '\n')) != NULL) {
+   *rt = '\0';
+   }
+   (void) magic_rsl_printf(m-desc, pp);
+   return;
+   }
 default:
{
TSRMLS_FETCH();

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



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

2006-11-26 Thread Ilia Alshanetsky
iliaa   Sun Nov 26 17:03:15 2006 UTC

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  MFB: Fixed bug #39623 (thread safety fixes on *nix for mime_magic extenion).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mime_magic/mime_magic.c?r1=1.50r2=1.51diff_format=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.50 
php-src/ext/mime_magic/mime_magic.c:1.51
--- php-src/ext/mime_magic/mime_magic.c:1.50Sun Oct  8 13:34:22 2006
+++ php-src/ext/mime_magic/mime_magic.c Sun Nov 26 17:03:15 2006
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.50 2006/10/08 13:34:22 bjori Exp $ 
+  $Id: mime_magic.c,v 1.51 2006/11/26 17:03:15 iliaa Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -1388,6 +1388,7 @@
 char *token;
 register struct names *p;
 int small_nbytes;
+char *strtok_buf = NULL;
 
 /* these are easy, do them first */
 
@@ -1420,8 +1421,7 @@
 s = (unsigned char *) memcpy(nbuf, buf, small_nbytes);
 s[small_nbytes] = '\0';
 has_escapes = (memchr(s, '\033', small_nbytes) != NULL);
-/* XXX: not multithread safe */
-while ((token = strtok((char *) s,  \t\n\r\f)) != NULL) {
+while ((token = php_strtok_r((char *) s,  \t\n\r\f, strtok_buf)) != 
NULL) {
s = NULL;   /* make strtok() keep on tokin' */
for (p = names; p  names + NNAMES; p++) {
if (STREQ(p-name, token)) {

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



[PHP-CVS] cvs: php-src /ext/mime_magic mime_magic.c phpmimemagic.h

2005-10-18 Thread Antony Dovgal
tony2001Tue Oct 18 08:41:14 2005 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c phpmimemagic.h 
  Log:
  fix mime_magic problems with ZTS 
  
  
http://cvs.php.net/diff.php/php-src/ext/mime_magic/mime_magic.c?r1=1.43r2=1.44ty=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.43 
php-src/ext/mime_magic/mime_magic.c:1.44
--- php-src/ext/mime_magic/mime_magic.c:1.43Fri Oct 14 11:38:56 2005
+++ php-src/ext/mime_magic/mime_magic.c Tue Oct 18 08:41:13 2005
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.43 2005/10/14 15:38:56 iliaa Exp $ 
+  $Id: mime_magic.c,v 1.44 2005/10/18 12:41:13 tony2001 Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -260,7 +260,9 @@
  */
 static void php_mime_magic_init_globals(zend_mime_magic_globals 
*mime_magic_globals)
 {
-   mime_global.magicfile = NULL;
+   memset(mime_magic_globals, 0, sizeof(zend_mime_magic_globals));
+   mime_global.magic = NULL;
+   mime_global.last = NULL;
 }
 /* }}} */
 
@@ -348,7 +350,7 @@
 
if (conf-magic == (struct magic *)-1) {
if(MIME_MAGIC_G(debug))
-   php_error_docref(http://www.php.net/mime_magic; 
TSRMLS_CC, E_ERROR, mime_magic could not be initialized, magic file %s is not 
available, conf-magicfile);
+   php_error_docref(http://www.php.net/mime_magic; 
TSRMLS_CC, E_ERROR, mime_magic could not be initialized, magic file %s is not 
available, MIME_MAGIC_G(magicfile));
RETURN_FALSE;
} 
 
@@ -391,7 +393,11 @@
 magic_server_config_rec *conf = mime_global;
 TSRMLS_FETCH();
 
-fname = conf-magicfile; /* todo cwd? */
+if (!MIME_MAGIC_G(magicfile)) {
+return -1;
+}
+   
+fname = MIME_MAGIC_G(magicfile); /* todo cwd? */
 f = fopen(fname, rb);
 if (f == NULL) {
conf-magic = (struct magic *)-1;
http://cvs.php.net/diff.php/php-src/ext/mime_magic/phpmimemagic.h?r1=1.3r2=1.4ty=u
Index: php-src/ext/mime_magic/phpmimemagic.h
diff -u php-src/ext/mime_magic/phpmimemagic.h:1.3 
php-src/ext/mime_magic/phpmimemagic.h:1.4
--- php-src/ext/mime_magic/phpmimemagic.h:1.3   Wed Aug  3 10:07:26 2005
+++ php-src/ext/mime_magic/phpmimemagic.h   Tue Oct 18 08:41:13 2005
@@ -15,7 +15,7 @@
   | Author:  |
   +--+
 
-  $Id: phpmimemagic.h,v 1.3 2005/08/03 14:07:26 sniper Exp $ 
+  $Id: phpmimemagic.h,v 1.4 2005/10/18 12:41:13 tony2001 Exp $ 
 */
 
 #ifndef PHPMIMEMAGIC_H
@@ -343,7 +343,6 @@
 
 /* per-server info */
 typedef struct {
-char *magicfile;   /* where magic be found */
 struct magic *magic;   /* head of magic config list */
 struct magic *last;
 } magic_server_config_rec;

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



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

2005-10-18 Thread Derick Rethans
derick  Tue Oct 18 09:02:15 2005 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  - Allow mime_content_type() to work with even a slightly broken mime magic
file.
  
  
http://cvs.php.net/diff.php/php-src/ext/mime_magic/mime_magic.c?r1=1.44r2=1.45ty=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.44 
php-src/ext/mime_magic/mime_magic.c:1.45
--- php-src/ext/mime_magic/mime_magic.c:1.44Tue Oct 18 08:41:13 2005
+++ php-src/ext/mime_magic/mime_magic.c Tue Oct 18 09:02:11 2005
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.44 2005/10/18 12:41:13 tony2001 Exp $ 
+  $Id: mime_magic.c,v 1.45 2005/10/18 13:02:11 derick Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -434,9 +434,6 @@
/* parse it */
if (parse(line + ws_offset, lineno) != 0)
++errs;
-
-   if(errs  !MIME_MAGIC_G(debug)) 
-   break;
 }
 
 (void) fclose(f);

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



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

2005-10-14 Thread Ilia Alshanetsky
iliaa   Fri Oct 14 11:38:58 2005 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  MFB51: ZTS fix
  
  
http://cvs.php.net/diff.php/php-src/ext/mime_magic/mime_magic.c?r1=1.42r2=1.43ty=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.42 
php-src/ext/mime_magic/mime_magic.c:1.43
--- php-src/ext/mime_magic/mime_magic.c:1.42Wed Aug  3 10:07:26 2005
+++ php-src/ext/mime_magic/mime_magic.c Fri Oct 14 11:38:56 2005
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.42 2005/08/03 14:07:26 sniper Exp $ 
+  $Id: mime_magic.c,v 1.43 2005/10/14 15:38:56 iliaa Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -271,9 +271,7 @@
ZEND_INIT_MODULE_GLOBALS(mime_magic, php_mime_magic_init_globals, NULL);
REGISTER_INI_ENTRIES();
 
-   mime_global.magicfile = MIME_MAGIC_G(magicfile);
-
-   if(mime_global.magicfile) {
+   if (MIME_MAGIC_G(magicfile)) {
if(apprentice()) {
MIME_MAGIC_G(status) = invalid magic file, disabled;
} else {

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



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

2005-07-10 Thread Ilia Alshanetsky
iliaa   Sun Jul 10 23:24:29 2005 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  Compiler warning fix.
  
  
http://cvs.php.net/diff.php/php-src/ext/mime_magic/mime_magic.c?r1=1.40r2=1.41ty=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.40 
php-src/ext/mime_magic/mime_magic.c:1.41
--- php-src/ext/mime_magic/mime_magic.c:1.40Tue May 24 23:05:47 2005
+++ php-src/ext/mime_magic/mime_magic.c Sun Jul 10 23:24:28 2005
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.40 2005/05/25 03:05:47 iliaa Exp $ 
+  $Id: mime_magic.c,v 1.41 2005/07/11 03:24:28 iliaa Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -1073,6 +1073,8 @@
streampos = php_stream_tell(stream); /* remember stream 
position for restauration */
php_stream_seek(stream, 0, SEEK_SET);
break;
+   default:
+   return -1;  
}
 
 

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



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

2005-05-24 Thread Ilia Alshanetsky
iliaa   Tue May 24 23:05:49 2005 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  Return error on an invalid input to mime_content_type() function.
  
  
  
http://cvs.php.net/diff.php/php-src/ext/mime_magic/mime_magic.c?r1=1.39r2=1.40ty=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.39 
php-src/ext/mime_magic/mime_magic.c:1.40
--- php-src/ext/mime_magic/mime_magic.c:1.39Thu Dec 16 07:34:31 2004
+++ php-src/ext/mime_magic/mime_magic.c Tue May 24 23:05:47 2005
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.39 2004/12/16 12:34:31 sniper Exp $ 
+  $Id: mime_magic.c,v 1.40 2005/05/25 03:05:47 iliaa Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -344,6 +344,7 @@
/* fallthru if not a stream resource */
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, can only process 
string or stream arguments);
+   RETURN_FALSE;
break;
}
 

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



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

2004-08-02 Thread Frank M. Kromann
fmk Tue Aug  3 00:15:35 2004 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  sys/stat.h is includes in php_streams.h no need to do that again.
  
http://cvs.php.net/diff.php/php-src/ext/mime_magic/mime_magic.c?r1=1.37r2=1.38ty=u
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.37 
php-src/ext/mime_magic/mime_magic.c:1.38
--- php-src/ext/mime_magic/mime_magic.c:1.37Fri Jan 16 06:15:13 2004
+++ php-src/ext/mime_magic/mime_magic.c Tue Aug  3 00:15:34 2004
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.37 2004/01/16 11:15:13 sniper Exp $ 
+  $Id: mime_magic.c,v 1.38 2004/08/03 04:15:34 fmk Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -160,7 +160,6 @@
 
 #include fcntl.h
 #include sys/types.h
-#include sys/stat.h
 #ifdef HAVE_UNISTD_H
 #include unistd.h
 #endif

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



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

2004-01-16 Thread Jani Taskinen
sniper  Fri Jan 16 06:15:16 2004 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  Fix the mime_magic.debug option init
  
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.36 
php-src/ext/mime_magic/mime_magic.c:1.37
--- php-src/ext/mime_magic/mime_magic.c:1.36Thu Jan 15 01:09:16 2004
+++ php-src/ext/mime_magic/mime_magic.c Fri Jan 16 06:15:13 2004
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.36 2004/01/15 06:09:16 sniper Exp $ 
+  $Id: mime_magic.c,v 1.37 2004/01/16 11:15:13 sniper Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -253,7 +253,7 @@
  */
 PHP_INI_BEGIN()
 STD_PHP_INI_ENTRY(mime_magic.magicfile, PHP_MIME_MAGIC_FILE_PATH, PHP_INI_SYSTEM, 
OnUpdateString, magicfile, zend_mime_magic_globals, mime_magic_globals)
-STD_PHP_INI_ENTRY(mime_magic.debug, 0, PHP_INI_SYSTEM, OnUpdateBool, debug, 
zend_mime_magic_globals, mime_magic_globals)
+STD_PHP_INI_BOOLEAN(mime_magic.debug, 0, PHP_INI_SYSTEM, OnUpdateBool, debug, 
zend_mime_magic_globals, mime_magic_globals)
 PHP_INI_END()
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /ext/mime_magic mime_magic.c mime_magic.dsp php_mime_magic.h phpmimemagic.h

2003-11-03 Thread Jani Taskinen
sniper  Tue Nov  4 00:15:20 2003 EDT

  Added files: 
/php-src/ext/mime_magic phpmimemagic.h 

  Modified files:  
/php-src/ext/mime_magic mime_magic.c mime_magic.dsp 
php_mime_magic.h 
  Log:
  - Moved all the mime_magic.c specific stuff into their own header file
to prevent possible compile failures.
  
  # Should fix bug #26103
  
  
  Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.33 
php-src/ext/mime_magic/mime_magic.c:1.34
--- php-src/ext/mime_magic/mime_magic.c:1.33Mon Oct 20 10:36:51 2003
+++ php-src/ext/mime_magic/mime_magic.c Tue Nov  4 00:15:19 2003
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.33 2003/10/20 14:36:51 iliaa Exp $ 
+  $Id: mime_magic.c,v 1.34 2003/11/04 05:15:19 sniper Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -156,6 +156,7 @@
 #include php_ini.h
 #include ext/standard/info.h
 #include php_mime_magic.h
+#include phpmimemagic.h
 
 #include fcntl.h
 #include sys/types.h
Index: php-src/ext/mime_magic/mime_magic.dsp
diff -u php-src/ext/mime_magic/mime_magic.dsp:1.1 
php-src/ext/mime_magic/mime_magic.dsp:1.2
--- php-src/ext/mime_magic/mime_magic.dsp:1.1   Thu Aug 22 09:16:03 2002
+++ php-src/ext/mime_magic/mime_magic.dsp   Tue Nov  4 00:15:19 2003
@@ -103,6 +103,10 @@
 
 SOURCE=.\php_mime_magic.h
 # End Source File
+# Begin Source File
+
+SOURCE=.\phpmimemagic.h
+# End Source File
 # End Group
 # End Target
 # End Project
Index: php-src/ext/mime_magic/php_mime_magic.h
diff -u php-src/ext/mime_magic/php_mime_magic.h:1.8 
php-src/ext/mime_magic/php_mime_magic.h:1.9
--- php-src/ext/mime_magic/php_mime_magic.h:1.8 Tue Aug 19 18:13:01 2003
+++ php-src/ext/mime_magic/php_mime_magic.h Tue Nov  4 00:15:19 2003
@@ -15,349 +15,12 @@
   | Author:  |
   +--+
 
-  $Id: php_mime_magic.h,v 1.8 2003/08/19 22:13:01 iliaa Exp $ 
+  $Id: php_mime_magic.h,v 1.9 2003/11/04 05:15:19 sniper Exp $ 
 */
 
 #ifndef PHP_MIME_MAGIC_H
 #define PHP_MIME_MAGIC_H
 
-#define MIME_MAGIC_DEBUG0
-
-#define MIME_BINARY_UNKNOWNapplication/octet-stream
-#define MIME_TEXT_UNKNOWNtext/plain
-
-#define MAXMIMESTRING256
-
-#define MIME_MAGIC_OK 0
-#define MIME_MAGIC_DECLINED -1
-#define MIME_MAGIC_DONE -2
-#define MIME_MAGIC_ERROR -3
-
-#define DIR_MAGIC_TYPE httpd/unix-directory
-
-/* HOWMANY must be at least 4096 to make gzip -dcq work */
-#define HOWMANY4096
-/* SMALL_HOWMANY limits how much work we do to figure out text files */
-#define SMALL_HOWMANY 1024
-#define MAXDESC50  /* max leng of text description */
-#define MAXstring 64   /* max leng of string types */
-
-struct magic {
-struct magic *next;/* link to next entry */
-int lineno;/* line number from magic file */
-
-short flag;
-#define INDIR1 /* if '(...)' appears,  */
-#defineUNSIGNED 2  /* comparison is unsigned */
-short cont_level;  /* level of  */
-struct {
-   char type;  /* byte short long */
-   long offset;/* offset from indirection */
-} in;
-long offset;   /* offset to magic number */
-unsigned char reln;/* relation (0=eq, ''=gt, etc) */
-char type; /* int, short, long or string. */
-char vallen;   /* length of string value, if any */
-union VALUETYPE {
-   unsigned char b;
-   unsigned short h;
-   unsigned long l;
-   char s[MAXstring];
-   unsigned char hs[2];/* 2 bytes of a fixed-endian short */
-   unsigned char hl[4];/* 2 bytes of a fixed-endian long */
-} value;   /* either number or string */
-unsigned long mask;/* mask before comparison with value */
-char nospflag; /* supress space character */
-
-/* NOTE: this string is suspected of overrunning - find it! */
-char desc[MAXDESC];/* description */
-};
-
-/*
- * data structures for tar file recognition
- * --
- * Header file for public domain tar (tape archive) program.
- *
- * @(#)tar.h 1.20 86/10/29Public Domain. Created 25 August 1985 by John
- * Gilmore, ihnp4!hoptoad!gnu.
- *
- * Header block on tape.
- *
- * I'm going to use traditional DP naming conventions here. A block is a big
- * chunk of stuff that we do I/O on. A record is a piece of info that we
- * care about. 

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

2003-10-20 Thread Ilia Alshanetsky
iliaa   Mon Oct 20 10:36:52 2003 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c 
  Log:
  Fixed bug #25918 (Possible crash in mime_content_type()).
  
  
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.32 
php-src/ext/mime_magic/mime_magic.c:1.33
--- php-src/ext/mime_magic/mime_magic.c:1.32Fri Sep 26 03:47:01 2003
+++ php-src/ext/mime_magic/mime_magic.c Mon Oct 20 10:36:51 2003
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.32 2003/09/26 07:47:01 hholzgra Exp $ 
+  $Id: mime_magic.c,v 1.33 2003/10/20 14:36:51 iliaa Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -1954,9 +1954,8 @@
 }
 
 /* detect memory allocation errors */
-if (!content_type ||
-   (state == rsl_encoding  !*content_encoding)) {
-   return MIME_MAGIC_ERROR;
+if (!content_type || !(*content_type) || (state == rsl_encoding  
!*content_encoding)) {
+   return MIME_MAGIC_ERROR;
 }
 
 /* success! */

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



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

2003-09-26 Thread Jani Taskinen

MFH!

--Jani


On Fri, 26 Sep 2003, Hartmut Holzgraefe wrote:

hholzgra   Fri Sep 26 03:47:01 2003 EDT

  Modified files:  
/php-src/ext/mime_magicmime_magic.c 
  Log:
  compiler warning fixes, one of them a potential crash bug
  
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.31 
php-src/ext/mime_magic/mime_magic.c:1.32
--- php-src/ext/mime_magic/mime_magic.c:1.31   Tue Aug 19 18:13:01 2003
+++ php-src/ext/mime_magic/mime_magic.cFri Sep 26 03:47:01 2003
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.31 2003/08/19 22:13:01 iliaa Exp $ 
+  $Id: mime_magic.c,v 1.32 2003/09/26 07:47:01 hholzgra Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -182,7 +182,7 @@
 
 static int apprentice(void);
 static int ascmagic(unsigned char *, int);
-static int is_tar(unsigned char *, int);
+static int is_tar(unsigned char *, unsigned int);
 static int softmagic(unsigned char *, int);
 static void tryit(unsigned char *, int, int);
 
@@ -576,7 +576,7 @@
   t = l;
   if (*t++ != ')') {
   if(MIME_MAGIC_G(debug))
-  php_error_docref(http://www.php.net/mime_magic; 
TSRMLS_CC, E_WARNING, : (%s:%s) missing ')' in indirect offset, 
MIME_MAGIC_G(magicfile), lineno);
+  php_error_docref(http://www.php.net/mime_magic; 
TSRMLS_CC, E_WARNING, : (%s:%d) missing ')' in indirect offset, 
MIME_MAGIC_G(magicfile), lineno);
   }
   l = t;
 }
@@ -1460,7 +1460,7 @@
  * old UNIX tar file, 2 for Unix Std (POSIX) tar file.
  */
 
-static int is_tar(unsigned char *buf, int nbytes)
+static int is_tar(unsigned char *buf, unsigned int nbytes)
 {
 register union record *header = (union record *) buf;
 register int i;



-- 
https://www.paypal.com/xclick/[EMAIL PROTECTED]no_note=1tax=0currency_code=EUR
 

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



[PHP-CVS] cvs: php-src /ext/mime_magic mime_magic.c php_mime_magic.h

2003-08-19 Thread Ilia Alshanetsky
iliaa   Tue Aug 19 18:13:02 2003 EDT

  Modified files:  
/php-src/ext/mime_magic mime_magic.c php_mime_magic.h 
  Log:
  Fixed bug #25155 (Possible namespace conflict between mime-magic  mssql)
  
  
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.30 
php-src/ext/mime_magic/mime_magic.c:1.31
--- php-src/ext/mime_magic/mime_magic.c:1.30Tue Jun 10 16:03:32 2003
+++ php-src/ext/mime_magic/mime_magic.c Tue Aug 19 18:13:01 2003
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  [EMAIL PROTECTED]   |
   +--+
 
-  $Id: mime_magic.c,v 1.30 2003/06/10 20:03:32 imajes Exp $ 
+  $Id: mime_magic.c,v 1.31 2003/08/19 22:13:01 iliaa Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -167,6 +167,18 @@
 #ifdef PHP_WIN32
 #define PHP_MIME_MAGIC_FILE_PATH PHP_PREFIX \\magic.mime
 #endif
+
+#define BYTE   1
+#define SHORT  2
+#define LONG   4
+#define STRING 5
+#define DATE   6
+#define BESHORT7
+#define BELONG 8
+#define BEDATE 9
+#define LESHORT10
+#define LELONG 11
+#define LEDATE 12
 
 static int apprentice(void);
 static int ascmagic(unsigned char *, int);
Index: php-src/ext/mime_magic/php_mime_magic.h
diff -u php-src/ext/mime_magic/php_mime_magic.h:1.7 
php-src/ext/mime_magic/php_mime_magic.h:1.8
--- php-src/ext/mime_magic/php_mime_magic.h:1.7 Tue Jun 10 16:03:32 2003
+++ php-src/ext/mime_magic/php_mime_magic.h Tue Aug 19 18:13:01 2003
@@ -15,7 +15,7 @@
   | Author:  |
   +--+
 
-  $Id: php_mime_magic.h,v 1.7 2003/06/10 20:03:32 imajes Exp $ 
+  $Id: php_mime_magic.h,v 1.8 2003/08/19 22:13:01 iliaa Exp $ 
 */
 
 #ifndef PHP_MIME_MAGIC_H
@@ -58,17 +58,6 @@
 unsigned char reln;/* relation (0=eq, ''=gt, etc) */
 char type; /* int, short, long or string. */
 char vallen;   /* length of string value, if any */
-#define BYTE1
-#define SHORT2
-#define LONG4
-#define STRING5
-#define DATE6
-#define BESHORT7
-#define BELONG8
-#define BEDATE9
-#define LESHORT10
-#define LELONG11
-#define LEDATE12
 union VALUETYPE {
unsigned char b;
unsigned short h;



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