From 373b3e101e0394f0727e1e5855e18e15851d0919 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 5 Aug 2001 15:55:43 +0000 Subject: [PATCH] more tsrm cleanup -- output.c is not doing any fetches anymore --- ext/mssql/php_mssql.c | 1 + ext/odbc/php_odbc.c | 4 +++ ext/session/php_session.h | 2 +- ext/standard/credits.c | 2 ++ ext/standard/file.c | 6 ++--- ext/standard/iptc.c | 52 +++++++++++++++++++-------------------- ext/standard/php_var.h | 2 +- ext/standard/var.c | 9 ++++--- main/main.c | 5 +++- main/output.c | 6 ++--- main/php.h | 12 ++++----- main/php_ini.c | 1 + main/php_output.h | 4 +-- sapi/apache/php_apache.c | 3 +-- 14 files changed, 59 insertions(+), 50 deletions(-) diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 957e4d9c47..1bf673bddd 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -103,6 +103,7 @@ ZEND_GET_MODULE(mssql) static PHP_INI_DISP(display_text_size) { char *value; + TSRMLS_FETCH(); if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 4983058587..e5ee7257eb 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -234,6 +234,7 @@ static void _close_odbc_pconn(zend_rsrc_list_entry *rsrc TSRMLS_DC) static PHP_INI_DISP(display_link_nums) { char *value; + TSRMLS_FETCH(); if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; @@ -255,6 +256,7 @@ static PHP_INI_DISP(display_link_nums) static PHP_INI_DISP(display_defPW) { char *value; + TSRMLS_FETCH(); if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; @@ -278,6 +280,7 @@ static PHP_INI_DISP(display_defPW) static PHP_INI_DISP(display_binmode) { char *value; + TSRMLS_FETCH(); if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; @@ -305,6 +308,7 @@ static PHP_INI_DISP(display_binmode) static PHP_INI_DISP(display_lrl) { char *value; + TSRMLS_FETCH(); if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; diff --git a/ext/session/php_session.h b/ext/session/php_session.h index 8c3ce17208..3c36d513c1 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -146,7 +146,7 @@ typedef struct ps_serializer_struct { #ifdef TRANS_SID void session_adapt_uris(const char *, size_t, char **, size_t * TSRMLS_DC); void session_adapt_url(const char *, size_t, char **, size_t * TSRMLS_DC); -void session_adapt_flush(int (*)(const char *, uint) TSRMLS_DC); +void session_adapt_flush(int (*)(const char *, uint TSRMLS_DC) TSRMLS_DC); #else #define session_adapt_uris(a,b,c,d) do { } while(0) #define session_adapt_url(a,b,c,d) do { } while(0) diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 9b93f9f4b6..2f2417385a 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -28,6 +28,8 @@ */ PHPAPI void php_print_credits(int flag) { + TSRMLS_FETCH(); + if (flag & PHP_CREDITS_FULLPAGE) { PUTS("PHP Credits\n"); } diff --git a/ext/standard/file.c b/ext/standard/file.c index 78a683f5c3..d6b0484324 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1547,7 +1547,7 @@ PHP_FUNCTION(rmdir) /* }}} */ /* {{{ php_passthru_fd */ -static size_t php_passthru_fd(int socketd, FILE *fp, int issock) +static size_t php_passthru_fd(int socketd, FILE *fp, int issock TSRMLS_DC) { size_t bcount = 0; int ready = 0; @@ -1651,7 +1651,7 @@ PHP_FUNCTION(readfile) rsrc_id = ZEND_REGISTER_RESOURCE(NULL,fp,php_file_le_fopen()); } - size = php_passthru_fd(socketd, fp, issock); + size = php_passthru_fd(socketd, fp, issock TSRMLS_CC); zend_list_delete(rsrc_id); @@ -1710,7 +1710,7 @@ PHP_FUNCTION(fpassthru) socketd=*(int*)what; } - size = php_passthru_fd(socketd, (FILE*) what, issock); + size = php_passthru_fd(socketd, (FILE*) what, issock TSRMLS_CC); zend_list_delete((*arg1)->value.lval); diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 096d0de42c..6d9be0ad06 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -75,7 +75,7 @@ /* {{{ php_iptc_put1 */ -static int php_iptc_put1(FILE *fp,int spool,unsigned char c,unsigned char **spoolbuf) +static int php_iptc_put1(FILE *fp,int spool,unsigned char c,unsigned char **spoolbuf TSRMLS_DC) { if (spool > 0) PUTC(c); @@ -88,7 +88,7 @@ static int php_iptc_put1(FILE *fp,int spool,unsigned char c,unsigned char **spoo /* {{{ php_iptc_get1 */ -static int php_iptc_get1(FILE *fp,int spool,unsigned char **spoolbuf) +static int php_iptc_get1(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC) { int c; char cc; @@ -110,11 +110,11 @@ static int php_iptc_get1(FILE *fp,int spool,unsigned char **spoolbuf) /* {{{ php_iptc_read_remaining */ -static int php_iptc_read_remaining(FILE *fp,int spool,unsigned char **spoolbuf) +static int php_iptc_read_remaining(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC) { int c; - while ((c = php_iptc_get1(fp,spool,spoolbuf)) != EOF) continue; + while ((c = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) != EOF) continue; return M_EOI; } @@ -122,21 +122,21 @@ static int php_iptc_read_remaining(FILE *fp,int spool,unsigned char **spoolbuf) /* {{{ php_iptc_skip_variable */ -static int php_iptc_skip_variable(FILE *fp,int spool,unsigned char **spoolbuf) +static int php_iptc_skip_variable(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC) { unsigned int length; int c1,c2; - if ((c1 = php_iptc_get1(fp,spool,spoolbuf)) == EOF) return M_EOI; + if ((c1 = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) == EOF) return M_EOI; - if ((c2 = php_iptc_get1(fp,spool,spoolbuf)) == EOF) return M_EOI; + if ((c2 = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) == EOF) return M_EOI; length = (((unsigned char) c1) << 8) + ((unsigned char) c2); length -= 2; while (length--) - if (php_iptc_get1(fp,spool,spoolbuf) == EOF) return M_EOI; + if (php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC) == EOF) return M_EOI; return 0; } @@ -144,29 +144,29 @@ static int php_iptc_skip_variable(FILE *fp,int spool,unsigned char **spoolbuf) /* {{{ php_iptc_next_marker */ -static int php_iptc_next_marker(FILE *fp,int spool,unsigned char **spoolbuf) +static int php_iptc_next_marker(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC) { int c; /* skip unimportant stuff */ - c = php_iptc_get1(fp,spool,spoolbuf); + c = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC); if (c == EOF) return M_EOI; while (c != 0xff) { - if ((c = php_iptc_get1(fp,spool,spoolbuf)) == EOF) + if ((c = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) == EOF) return M_EOI; /* we hit EOF */ } /* get marker byte, swallowing possible padding */ do { - c = php_iptc_get1(fp,0,0); + c = php_iptc_get1(fp,0,0 TSRMLS_CC); if (c == EOF) return M_EOI; /* we hit EOF */ else if (c == 0xff) - php_iptc_put1(fp,spool,(unsigned char)c,spoolbuf); + php_iptc_put1(fp,spool,(unsigned char)c,spoolbuf TSRMLS_CC); } while (c == 0xff); return (unsigned int) c; @@ -232,36 +232,36 @@ PHP_FUNCTION(iptcembed) } } - if (php_iptc_get1(fp,spool,poi?&poi:0) != 0xFF) { + if (php_iptc_get1(fp,spool,poi?&poi:0 TSRMLS_CC) != 0xFF) { fclose(fp); RETURN_FALSE; } - if (php_iptc_get1(fp,spool,poi?&poi:0) != 0xD8) { + if (php_iptc_get1(fp,spool,poi?&poi:0 TSRMLS_CC) != 0xD8) { fclose(fp); RETURN_FALSE; } while (!done) { - marker = php_iptc_next_marker(fp,spool,poi?&poi:0); + marker = php_iptc_next_marker(fp,spool,poi?&poi:0 TSRMLS_CC); if (marker == M_EOI) { /* EOF */ break; } else if (marker != M_APP13) { - php_iptc_put1(fp,spool,(unsigned char)marker,poi?&poi:0); + php_iptc_put1(fp,spool,(unsigned char)marker,poi?&poi:0 TSRMLS_CC); } switch (marker) { case M_APP13: /* we are going to write a new APP13 marker, so don't output the old one */ - php_iptc_skip_variable(fp,0,0); - php_iptc_read_remaining(fp,spool,poi?&poi:0); + php_iptc_skip_variable(fp,0,0 TSRMLS_CC); + php_iptc_read_remaining(fp,spool,poi?&poi:0 TSRMLS_CC); done = 1; break; case M_APP0: /* APP0 is in each and every JPEG, so when we hit APP0 we insert our new APP13! */ - php_iptc_skip_variable(fp,spool,poi?&poi:0); + php_iptc_skip_variable(fp,spool,poi?&poi:0 TSRMLS_CC); if (len & 1) len++; /* make the length even */ @@ -269,23 +269,23 @@ PHP_FUNCTION(iptcembed) psheader[ 3 ] = (len+28)&0xff; for (inx = 0; inx < 28; inx++) - php_iptc_put1(fp,spool,psheader[inx],poi?&poi:0); + php_iptc_put1(fp,spool,psheader[inx],poi?&poi:0 TSRMLS_CC); - php_iptc_put1(fp,spool,(unsigned char)(len>>8),poi?&poi:0); - php_iptc_put1(fp,spool,(unsigned char)(len&0xff),poi?&poi:0); + php_iptc_put1(fp,spool,(unsigned char)(len>>8),poi?&poi:0 TSRMLS_CC); + php_iptc_put1(fp,spool,(unsigned char)(len&0xff),poi?&poi:0 TSRMLS_CC); for (inx = 0; inx < len; inx++) - php_iptc_put1(fp,spool,(*iptcdata)->value.str.val[inx],poi?&poi:0); + php_iptc_put1(fp,spool,(*iptcdata)->value.str.val[inx],poi?&poi:0 TSRMLS_CC); break; case M_SOS: /* we hit data, no more marker-inserting can be done! */ - php_iptc_read_remaining(fp,spool,poi?&poi:0); + php_iptc_read_remaining(fp,spool,poi?&poi:0 TSRMLS_CC); done = 1; break; default: - php_iptc_skip_variable(fp,spool,poi?&poi:0); + php_iptc_skip_variable(fp,spool,poi?&poi:0 TSRMLS_CC); break; } } diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index aceeb34e7a..95de575f43 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -27,7 +27,7 @@ PHP_FUNCTION(var_dump); PHP_FUNCTION(serialize); PHP_FUNCTION(unserialize); -void php_var_dump(zval **struc, int level); +void php_var_dump(zval **struc, int level TSRMLS_DC); /* typdef HashTable php_serialize_data_t; */ #define php_serialize_data_t HashTable diff --git a/ext/standard/var.c b/ext/standard/var.c index ae8add2b80..8627aabca5 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -42,6 +42,7 @@ static int php_array_element_dump(zval **zv, int num_args, va_list args, zend_hash_key *hash_key) { int level; + TSRMLS_FETCH(); level = va_arg(args, int); @@ -50,11 +51,11 @@ static int php_array_element_dump(zval **zv, int num_args, va_list args, zend_ha } else { /* string key */ php_printf("%*c[\"%s\"]=>\n", level + 1, ' ', hash_key->arKey); } - php_var_dump(zv, level + 2); + php_var_dump(zv, level + 2 TSRMLS_CC); return 0; } -void php_var_dump(zval **struc, int level) +void php_var_dump(zval **struc, int level TSRMLS_DC) { HashTable *myht; @@ -131,7 +132,7 @@ PHP_FUNCTION(var_dump) } for (i=0; iserver; @@ -241,7 +242,6 @@ PHP_MINFO_FUNCTION(apache) array_header *arr; table_entry *elts; request_rec *r; - TSRMLS_FETCH(); r = ((request_rec *) SG(server_context)); arr = table_elts(r->subprocess_env); @@ -261,7 +261,6 @@ PHP_MINFO_FUNCTION(apache) table_entry *env; int i; request_rec *r; - TSRMLS_FETCH(); r = ((request_rec *) SG(server_context)); SECTION("HTTP Headers Information"); -- 2.40.0