cvs: php4 /ext/mime_magic mime_magic.c
| From: | Derick Rethans | Date: | Wed, 26 Jun 2002 18:49:09 +0000 |
| Subject: | cvs: php4 /ext/mime_magic mime_magic.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12553@lists.php.net to get a copy of this message | ||
derick Wed Jun 26 14:49:09 2002 EDT
Modified files:
/php4/ext/mime_magic mime_magic.c
Log:
- Nuke some TSRMLS_FETCHes
Index: php4/ext/mime_magic/mime_magic.c
diff -u php4/ext/mime_magic/mime_magic.c:1.7 php4/ext/mime_magic/mime_magic.c:1.8
--- php4/ext/mime_magic/mime_magic.c:1.7 Thu Jun 20 16:13:20 2002
+++ php4/ext/mime_magic/mime_magic.c Wed Jun 26 14:49:08 2002
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <hartmut@six.de> |
+----------------------------------------------------------------------+
- $Id: mime_magic.c,v 1.7 2002/06/20 20:13:20 sander Exp $
+ $Id: mime_magic.c,v 1.8 2002/06/26 18:49:08 derick Exp $
This module contains a lot of stuff taken from Apache mod_mime_magic,
so the lincense section is a little bit longer than usual:
@@ -182,10 +182,10 @@
static void mprint(union VALUETYPE *, struct magic *);
static int mconvert(union VALUETYPE *, struct magic *);
static int magic_rsl_get(char **, char **);
-static int magic_process(char *);
+static int magic_process(char * TSRMLS_DC);
static long from_oct(int, char *);
-static int fsmagic(char *fn);
+static int fsmagic(char *fn TSRMLS_DC);
#if HAVE_ZLIB
@@ -305,7 +305,7 @@
MIME_MAGIC_G(req_dat) = magic_set_config();
- if(MIME_MAGIC_OK != magic_process(filename)) {
+ if(MIME_MAGIC_OK != magic_process(filename TSRMLS_CC)) {
RETVAL_FALSE;
} else if(MIME_MAGIC_OK != magic_rsl_get(&content_type, &content_encoding)) {
RETVAL_FALSE;
@@ -943,18 +943,17 @@
* (formerly called "process" in file command, prefix added for clarity) Opens
* the file and reads a fixed-size buffer to begin processing the contents.
*/
-static int magic_process(char *filename)
+static int magic_process(char *filename TSRMLS_DC)
{
php_stream *stream;
unsigned char buf[HOWMANY + 1]; /* one extra for terminating '\0' */
int nbytes = 0; /* number of bytes read from a datafile */
int result;
- TSRMLS_FETCH();
/*
* first try judging the file based on its filesystem status
*/
- switch ((result = fsmagic(filename))) {
+ switch ((result = fsmagic(filename TSRMLS_CC))) {
case MIME_MAGIC_DONE:
magic_rsl_putchar('\n');
return MIME_MAGIC_OK;
@@ -1033,10 +1032,9 @@
* return MIME_MAGIC_OK to indicate it's a regular file still needing handling
* other returns indicate a failure of some sort
*/
-static int fsmagic(char *filename)
+static int fsmagic(char *filename TSRMLS_DC)
{
php_stream_statbuf stat_ssb;
- TSRMLS_FETCH();
if(!php_stream_stat_path(filename, &stat_ssb)) {
return MIME_MAGIC_OK;