[PHP-CVS-DAILY] cvs: php4 / ChangeLog
changelog Fri Jun 20 20:31:17 2003 EDT Modified files: /php4 ChangeLog Log: ChangeLog update Index: php4/ChangeLog diff -u php4/ChangeLog:1.1352 php4/ChangeLog:1.1353 --- php4/ChangeLog:1.1352 Thu Jun 19 20:31:17 2003 +++ php4/ChangeLog Fri Jun 20 20:31:17 2003 @@ -1,3 +1,50 @@ +2003-06-20 Marcus Boerger [EMAIL PROTECTED] + +* ext/exif/exif.c: + - Errors, warnings and notices start with a capital letter. + - Show sorcode info when debugging exif. + +2003-06-20 Ilia Alshanetsky [EMAIL PROTECTED] + +* (PHP_4_3) + main/main.c: + Fixed bug #24253 (missing variables when register_globals is on) + Fixed a memory leak when more then 1 E|S flag is passed to gpc_order. + Fixed a memory leak when variables_order is not set and gpc_order has S|s + flag. + Optimized out duplicate parsing of the variables order string. + +2003-06-20 Sara Golemon [EMAIL PROTECTED] + +* (PHP_4_3) + ext/standard/string.c: + MFH (r-1.391) When skipping blank searchvals we should advance the + corresponding replace hash as well + +* ext/standard/string.c: + When skipping blank searchvals we should advance the corresponding replace + hash as well + +2003-06-20 Rob Richards [EMAIL PROTECTED] + +* ext/dom/php_dom.h + ext/dom/xml_common.h: + cleanup common code + +* ext/xsl/php_xsl.c: + fix mem leak + remove unused code + +2003-06-20 Hartmut Holzgraefe [EMAIL PROTECTED] + +* scripts/ext_skel_ng/extension_parser.php + scripts/ext_skel_ng/php_global.php: + - package.xml genartion fixed, configureoptions and license added + - shutdown code for globals added + +* scripts/ext_skel_ng/php_function.php: + typo fix + 2003-06-19 Edin Kadribasic [EMAIL PROTECTED] * ext/curl/.cvsignore:
[PHP-CVS] cvs: php4 /scripts/ext_skel_ng php_function.php
hholzgraFri Jun 20 07:30:42 2003 EDT Modified files: /php4/scripts/ext_skel_ng php_function.php Log: typo fix Index: php4/scripts/ext_skel_ng/php_function.php diff -u php4/scripts/ext_skel_ng/php_function.php:1.14 php4/scripts/ext_skel_ng/php_function.php:1.15 --- php4/scripts/ext_skel_ng/php_function.php:1.14 Tue May 20 10:02:12 2003 +++ php4/scripts/ext_skel_ng/php_function.php Fri Jun 20 07:30:42 2003 @@ -309,7 +309,7 @@ function docbook_xml() { $xml = '?xml version=1.0 encoding=iso-8859-1? -!-- '.'$'.Revision: 1.0 $ -- +!-- '.'$'.'Revision: 1.0 $ -- refentry id=function.'.strtolower(str_replace(_,-,$this-name)).' refnamediv refname'.$this-name.'/refname -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /scripts/ext_skel_ng extension_parser.php php_global.php
hholzgraFri Jun 20 07:31:43 2003 EDT Modified files: /php4/scripts/ext_skel_ng extension_parser.php php_global.php Log: - package.xml genartion fixed, configureoptions and license added - shutdown code for globals added Index: php4/scripts/ext_skel_ng/extension_parser.php diff -u php4/scripts/ext_skel_ng/extension_parser.php:1.23 php4/scripts/ext_skel_ng/extension_parser.php:1.24 --- php4/scripts/ext_skel_ng/extension_parser.php:1.23 Tue May 20 09:51:29 2003 +++ php4/scripts/ext_skel_ng/extension_parser.php Fri Jun 20 07:31:43 2003 @@ -710,7 +710,7 @@ ; if (count($this-globals)) { - $code .= \tZEND_INIT_MODULE_GLOBALS({$this-name}, php_{$this-name}_init_globals, NULL)\n; + $code .= \tZEND_INIT_MODULE_GLOBALS({$this-name}, php_{$this-name}_init_globals, php_{$this-name}_shutdown_globals)\n; $need_block = true; } @@ -1269,7 +1269,7 @@ ob_start(); echo -?xml version=\1.0\ encoding=\utf-8\ +?xml version=\1.0\ encoding=\iso-8859-1\? !DOCTYPE package SYSTEM \../../package.dtd\ package name{$this-name}/name @@ -1283,6 +1283,16 @@ echo description\n.rtrim($this-description).\n /description\n; } +if (isset($this-release['license'])) { + echo license.$this-release['license']./license\n; +} + + if (isset($this-with['attr'])) { + echo configureoptions\n; + echoconfigureoption name=\{$this-name}\ default=\shared\ prompt=\{$this-name} installation directory?\ /\n; + echo /configureoptions\n; +} + if (@is_array($this-users)) { echo \n maintainers\n; foreach ($this-users as $user) { @@ -1292,9 +1302,9 @@ echo $key{$user[$key]}/$key\n; } } - echo maintainer/\n; + echo /maintainer\n; } - echo maintainers/\n; + echo /maintainers\n; } if (is_array($this-release)) { @@ -1304,7 +1314,7 @@ echo $key{$this-release[$key]}/$key\n; } } - echo release/\n; + echo /release\n; } echo \n filelist\n; Index: php4/scripts/ext_skel_ng/php_global.php diff -u php4/scripts/ext_skel_ng/php_global.php:1.1 php4/scripts/ext_skel_ng/php_global.php:1.2 --- php4/scripts/ext_skel_ng/php_global.php:1.1 Sat Apr 26 11:05:00 2003 +++ php4/scripts/ext_skel_ng/php_global.php Fri Jun 20 07:31:43 2003 @@ -47,7 +47,12 @@ } static function c_code_footer() { - return }\n\n; + return +} + +static void php_{name}_shutdown_globals(zend_{name}_globals *{name}_globals) +{ +}; } static function h_code_header($name) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/xsl php_xsl.c
rrichards Fri Jun 20 10:07:51 2003 EDT Modified files: /php4/ext/xsl php_xsl.c Log: fix mem leak remove unused code Index: php4/ext/xsl/php_xsl.c diff -u php4/ext/xsl/php_xsl.c:1.4 php4/ext/xsl/php_xsl.c:1.5 --- php4/ext/xsl/php_xsl.c:1.4 Tue Jun 10 16:03:40 2003 +++ php4/ext/xsl/php_xsl.c Fri Jun 20 10:07:51 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xsl.c,v 1.4 2003/06/10 20:03:40 imajes Exp $ */ +/* $Id: php_xsl.c,v 1.5 2003/06/20 14:07:51 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -32,13 +32,7 @@ ZEND_DECLARE_MODULE_GLOBALS(xsl) */ -/* True global resources - no need for thread safety here */ - -static HashTable classes; -/* not used right now static zend_object_handlers xsl_object_handlers; -static HashTable xsl_xsltprocessor_prop_handlers; -*/ /* {{{ xsl_functions[] * @@ -73,22 +67,13 @@ ZEND_GET_MODULE(xsl) #endif +/* {{{ xsl_objects_clone */ +void xsl_objects_clone(void *object, void **object_clone TSRMLS_DC) +{ + /* TODO */ +} +/* }}} */ -/ -* copied from php_dom should be in a common file... -**/ - - -typedef int (*dom_read_t)(xsl_object *obj, zval **retval TSRMLS_DC); -typedef int (*dom_write_t)(xsl_object *obj, zval *newval TSRMLS_DC); - -typedef struct _dom_prop_handler { - dom_read_t read_func; - dom_write_t write_func; -} dom_prop_handler; - -/* end copied from php_dom.c */ - /* {{{ xsl_objects_dtor */ void xsl_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC) { @@ -119,7 +104,6 @@ { zend_object_value retval; xsl_object *intern; - zend_class_entry *base_class; zval *tmp; intern = emalloc(sizeof(xsl_object)); @@ -130,22 +114,15 @@ intern-prop_handler = NULL; intern-parameter = NULL; intern-document = NULL; - - base_class = class_type; - while(base_class-type != ZEND_INTERNAL_CLASS base_class-parent != NULL) { - base_class = base_class-parent; - } - - zend_hash_find(classes, base_class-name , base_class-name_length + 1, intern-prop_handler); ALLOC_HASHTABLE(intern-std.properties); zend_hash_init(intern-std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); zend_hash_copy(intern-std.properties, class_type-default_properties, (copy_ctor_func_t) zval_add_ref, (void *) tmp, sizeof(zval *)); ALLOC_HASHTABLE(intern-parameter); zend_hash_init(intern-parameter, 0, NULL, ZVAL_PTR_DTOR, 0); - retval.handle = zend_objects_store_put(intern, xsl_objects_dtor, dom_objects_clone TSRMLS_CC); + retval.handle = zend_objects_store_put(intern, xsl_objects_dtor, xsl_objects_clone TSRMLS_CC); intern-handle = retval.handle; - retval.handlers = dom_object_handlers; + retval.handlers = xsl_object_handlers; return retval; } /* }}} */ @@ -156,11 +133,8 @@ { zend_class_entry ce; - zend_hash_init(classes, 0, NULL, NULL, 1); - memcpy(dom_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - dom_object_handlers.read_property = dom_read_property; - dom_object_handlers.write_property = dom_write_property; + memcpy(xsl_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); REGISTER_XSL_CLASS(ce, xsltprocessor, NULL, php_xsl_xsltprocessor_class_functions, xsl_xsltprocessor_class_entry); return SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/dom php_dom.h xml_common.h
rrichards Fri Jun 20 10:08:56 2003 EDT Modified files: /php4/ext/dom xml_common.h php_dom.h Log: cleanup common code Index: php4/ext/dom/xml_common.h diff -u php4/ext/dom/xml_common.h:1.8 php4/ext/dom/xml_common.h:1.9 --- php4/ext/dom/xml_common.h:1.8 Sun Jun 15 15:58:42 2003 +++ php4/ext/dom/xml_common.h Fri Jun 20 10:08:56 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: xml_common.h,v 1.8 2003/06/15 19:58:42 rrichards Exp $ */ +/* $Id: xml_common.h,v 1.9 2003/06/20 14:08:56 rrichards Exp $ */ #ifndef PHP_XML_COMMON_H #define PHP_XML_COMMON_H @@ -52,36 +52,18 @@ #endif /* DOM_EXPORTS */ #endif /* PHP_WIN32 */ -#ifdef ZTS -#include TSRM.h -#endif - #define PHP_DOM_EXPORT(__type) PHPAPI __type PHP_DOM_EXPORT(zval *) php_dom_create_object(xmlNodePtr obj, int *found, zval *in, zval* return_value, dom_object *domobj TSRMLS_DC); -PHP_DOM_EXPORT(void) dom_objects_clone(void *object, void **object_clone TSRMLS_DC); -void dom_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC); PHP_DOM_EXPORT(zval *) dom_read_property(zval *object, zval *member TSRMLS_DC); PHP_DOM_EXPORT(void) dom_write_property(zval *object, zval *member, zval *value TSRMLS_DC); -zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC); -void dom_unregister_node(xmlNodePtr nodep TSRMLS_DC); -zend_object_handlers dom_object_handlers; #define DOM_XMLNS_NAMESPACE \ (const xmlChar *) http://www.w3.org/2000/xmlns/; -#define DOM_NOT_IMPLEMENTED() \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, Not yet implemented); \ - return; - -#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ -INIT_CLASS_ENTRY(ce, name, funcs); \ -ce.create_object = dom_objects_new; \ -entry = zend_register_internal_class_ex(ce, parent_ce, NULL TSRMLS_CC); - -#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \ - __intern = (dom_object *)zend_object_store_get_object(__id TSRMLS_CC); \ - if (!(__ptr = (__prtype)__intern-ptr)) { \ +#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \ + __intern = (node_object *)zend_object_store_get_object(__id TSRMLS_CC); \ + if (!(__ptr = (__prtype)__intern-node)) { \ php_error(E_WARNING, Couldn't fetch %s, __intern-std.ce-name);\ RETURN_NULL();\ } \ @@ -97,14 +79,11 @@ } \ } -#define DOM_DOMOBJ_NEW(zval, obj, ret, domobject) \ +#define DOM_RET_OBJ(zval, obj, ret, domobject) \ if (NULL == (zval = php_dom_create_object(obj, ret, zval, return_value, domobject TSRMLS_CC))) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot create required DOM object); \ RETURN_FALSE; \ } - -#define DOM_RET_OBJ(zval, obj, ret, domobject) \ - DOM_DOMOBJ_NEW(zval, obj, ret, domobject); #define DOM_GET_THIS(zval) \ if (NULL == (zval = getThis())) { \ Index: php4/ext/dom/php_dom.h diff -u php4/ext/dom/php_dom.h:1.5 php4/ext/dom/php_dom.h:1.6 --- php4/ext/dom/php_dom.h:1.5 Sun Jun 15 15:58:42 2003 +++ php4/ext/dom/php_dom.h Fri Jun 20 10:08:56 2003 @@ -18,12 +18,18 @@ +--+ */ -/* $Id: php_dom.h,v 1.5 2003/06/15 19:58:42 rrichards Exp $ */ +/* $Id: php_dom.h,v 1.6 2003/06/20 14:08:56 rrichards Exp $ */ #ifndef PHP_DOM_H #define PHP_DOM_H -#if HAVE_DOM +extern zend_module_entry dom_module_entry; +#define dom_module_ptr dom_module_entry + +#ifdef ZTS +#include TSRM.h +#endif + #include libxml/parser.h #include libxml/parserInternals.h #include libxml/tree.h @@ -49,15 +55,12 @@ Can be checked with phpversion(dom); */ #define DOM_API_VERSION 20030413 - -extern zend_module_entry dom_module_entry; - -#define dom_module_ptr dom_module_entry #include dom_fe.h void php_dom_set_object(dom_object *wrapper, void *obj TSRMLS_DC); dom_object *dom_object_get_data(xmlNodePtr obj); +zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC); void php_dom_throw_error(int error_code, zval **retval TSRMLS_DC); void node_free_resource(xmlNodePtr node TSRMLS_DC); void node_list_unlink(xmlNodePtr node TSRMLS_DC); @@ -72,19 +75,31 @@ int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child); int dom_has_feature(char *feature, char *version); +#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ +INIT_CLASS_ENTRY(ce, name, funcs); \ +ce.create_object = dom_objects_new; \ +entry = zend_register_internal_class_ex(ce, parent_ce, NULL TSRMLS_CC); + +#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \ + __intern = (dom_object *)zend_object_store_get_object(__id TSRMLS_CC); \ + if (!(__ptr = (__prtype)__intern-ptr)) { \ + php_error(E_WARNING, Couldn't fetch %s, __intern-std.ce-name);\ + RETURN_NULL();\ + } \ +} + #define DOM_NO_ARGS() \ if
[PHP-CVS] cvs: php4 /ext/standard string.c
pollita Fri Jun 20 11:41:43 2003 EDT Modified files: /php4/ext/standard string.c Log: When skipping blank searchvals we should advance the corresponding replace hash as well Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.390 php4/ext/standard/string.c:1.391 --- php4/ext/standard/string.c:1.390Tue Jun 10 22:16:19 2003 +++ php4/ext/standard/string.c Fri Jun 20 11:41:43 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.390 2003/06/11 02:16:19 iliaa Exp $ */ +/* $Id: string.c,v 1.391 2003/06/20 15:41:43 pollita Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3063,6 +3063,9 @@ convert_to_string(*search_entry); if (Z_STRLEN_PP(search_entry) == 0) { zend_hash_move_forward(Z_ARRVAL_P(search)); + if (Z_TYPE_P(replace) == IS_ARRAY) { + zend_hash_move_forward(Z_ARRVAL_P(replace)); + } continue; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/standard string.c
pollita Fri Jun 20 11:44:48 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard string.c Log: MFH (r-1.391) When skipping blank searchvals we should advance the corresponding replace hash as well Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.333.2.30 php4/ext/standard/string.c:1.333.2.31 --- php4/ext/standard/string.c:1.333.2.30 Tue Jun 10 22:16:49 2003 +++ php4/ext/standard/string.c Fri Jun 20 11:44:48 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.333.2.30 2003/06/11 02:16:49 iliaa Exp $ */ +/* $Id: string.c,v 1.333.2.31 2003/06/20 15:44:48 pollita Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2629,6 +2629,9 @@ convert_to_string(*search_entry); if (Z_STRLEN_PP(search_entry) == 0) { zend_hash_move_forward(Z_ARRVAL_P(search)); + if (Z_TYPE_P(replace) == IS_ARRAY) { + zend_hash_move_forward(Z_ARRVAL_P(replace)); + } continue; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /main main.c
iliaa Fri Jun 20 13:00:16 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main main.c Log: Fixed bug #24253 (missing variables when register_globals is on) Fixed a memory leak when more then 1 E|S flag is passed to gpc_order. Fixed a memory leak when variables_order is not set and gpc_order has S|s flag. Optimized out duplicate parsing of the variables order string. Index: php4/main/main.c diff -u php4/main/main.c:1.512.2.41 php4/main/main.c:1.512.2.42 --- php4/main/main.c:1.512.2.41 Tue Jun 17 13:15:16 2003 +++ php4/main/main.cFri Jun 20 13:00:16 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.512.2.41 2003/06/17 17:15:16 iliaa Exp $ */ +/* $Id: main.c,v 1.512.2.42 2003/06/20 17:00:16 iliaa Exp $ */ /* {{{ includes */ @@ -134,7 +134,6 @@ #define NUM_TRACK_VARS (sizeof(short_track_vars_names_length)/sizeof(int)) - #define SAFE_FILENAME(f) ((f)?(f):-) /* {{{ PHP_INI_MH @@ -1362,7 +1361,7 @@ static int php_hash_environment(TSRMLS_D) { char *p; - unsigned char _gpc_flags[3] = {0, 0, 0}; + int _gpc_flags[5] = {0, 0, 0, 0, 0}; zend_bool have_variables_order; zval *dummy_track_vars_array = NULL; zend_bool initialized_dummy_track_vars_array=0; @@ -1409,42 +1408,48 @@ case 'P': if (!_gpc_flags[0] !SG(headers_sent) SG(request_info).request_method !strcmp(SG(request_info).request_method, POST)) { sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC); /* POST Data */ - _gpc_flags[0]=1; + _gpc_flags[0]=TRACK_VARS_POST + 1; } break; case 'c': case 'C': if (!_gpc_flags[1]) { sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC); /* Cookie Data */ - _gpc_flags[1]=1; + _gpc_flags[1]=TRACK_VARS_COOKIE + 1; } break; case 'g': case 'G': if (!_gpc_flags[2]) { sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);/* GET Data */ - _gpc_flags[2]=1; + _gpc_flags[2]=TRACK_VARS_GET + 1; } break; case 'e': case 'E': - if (have_variables_order) { - ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]); - array_init(PG(http_globals)[TRACK_VARS_ENV]); - INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]); - php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unsupported 'e' element (environment) used in gpc_order - use variables_order instead); + if (!_gpc_flags[3]) { + if (have_variables_order) { + ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]); + array_init(PG(http_globals)[TRACK_VARS_ENV]); + INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]); + php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unsupported 'e' element (environment) used in gpc_order - use variables_order instead); + } + _gpc_flags[3]=TRACK_VARS_ENV + 1; } break; case 's': case 'S': - php_register_server_variables(TSRMLS_C); + if (!_gpc_flags[4]) { + php_register_server_variables(TSRMLS_C); + _gpc_flags[4]=TRACK_VARS_SERVER + 1; + } break; } } - if (!have_variables_order) { + if (!have_variables_order
[PHP-CVS] cvs: php4 /ext/exif exif.c
helly Fri Jun 20 14:24:38 2003 EDT Modified files: /php4/ext/exif exif.c Log: - Errors, warnings and notices start with a capital letter. - Show sorcode info when debugging exif. Index: php4/ext/exif/exif.c diff -u php4/ext/exif/exif.c:1.151 php4/ext/exif/exif.c:1.152 --- php4/ext/exif/exif.c:1.151 Sun Jun 15 18:58:03 2003 +++ php4/ext/exif/exif.cFri Jun 20 14:24:38 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: exif.c,v 1.151 2003/06/15 22:58:03 edink Exp $ */ +/* $Id: exif.c,v 1.152 2003/06/20 18:24:38 helly Exp $ */ /* ToDos * @@ -49,6 +49,14 @@ */ #undef EXIF_DEBUG +#ifdef EXIF_DEBUG +#define EXIFERR_DC , const char *_file, size_t _line TSRMLS_DC +#define EXIFERR_CC , __FILE__, __LINE__ TSRMLS_CC +#else +#define EXIFERR_DC TSRMLS_DC +#define EXIFERR_CC TSRMLS_CC +#endif + #undef EXIF_JPEG2000 #include php_exif.h @@ -99,7 +107,7 @@ }; /* }}} */ -#define EXIF_VERSION 1.4 $Id: exif.c,v 1.151 2003/06/15 22:58:03 edink Exp $ +#define EXIF_VERSION 1.4 $Id: exif.c,v 1.152 2003/06/20 18:24:38 helly Exp $ /* {{{ PHP_MINFO_FUNCTION */ @@ -243,10 +251,10 @@ static const char * EXIF_ERROR_THUMBEOF = Thumbnail goes IFD boundary or end of file reached; static const char * EXIF_ERROR_FSREALLOC = Illegal reallocating of undefined file section; -#define EXIF_ERRLOG_FILEEOFphp_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_FILEEOF); -#define EXIF_ERRLOG_CORRUPTphp_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_CORRUPT); -#define EXIF_ERRLOG_THUMBEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_THUMBEOF); -#define EXIF_ERRLOG_FSREALLOC php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_FSREALLOC); +#define EXIF_ERRLOG_FILEEOF(ImageInfo)exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, EXIF_ERROR_FILEEOF); +#define EXIF_ERRLOG_CORRUPT(ImageInfo)exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, EXIF_ERROR_CORRUPT); +#define EXIF_ERRLOG_THUMBEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, EXIF_ERROR_THUMBEOF); +#define EXIF_ERRLOG_FSREALLOC(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, EXIF_ERROR_FSREALLOC); /* }}} */ /* {{{ format description defines @@ -1436,12 +1444,22 @@ /* }}} */ /* {{{ exif_error_docref */ -static void exif_error_docref(const char *docref TSRMLS_DC, const image_info_type *ImageInfo, int type, const char *format, ...) +static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_type *ImageInfo, int type, const char *format, ...) { va_list args; va_start(args, format); +#ifdef EXIF_DEBUG + { + char *buf; + + spprintf(buf, 0, %s(%d): %s, _file, _line, format); + php_verror(docref, ImageInfo-FileName?ImageInfo-FileName:, type, buf, args TSRMLS_CC); + efree(buf); + } +#else php_verror(docref, ImageInfo-FileName?ImageInfo-FileName:, type, format, args TSRMLS_CC); +#endif va_end(args); } /* }}} */ @@ -1494,7 +1512,7 @@ * function parameters (requirements engineering). */ if (section_index = ImageInfo-file.count) { - EXIF_ERRLOG_FSREALLOC + EXIF_ERRLOG_FSREALLOC(ImageInfo) return -1; } tmp = erealloc(ImageInfo-file.list[section_index].data, size); @@ -1751,7 +1769,7 @@ info_data-name = estrdup(name); if (PG(magic_quotes_runtime)) { #ifdef EXIF_DEBUG - exif_error_docref(NULL TSRMLS_CC, image_info, E_NOTICE, Adding %s as buffer%s, name, exif_char_dump(value, length, 0)); + exif_error_docref(NULL EXIFERR_CC, image_info, E_NOTICE, Adding %s as buffer%s, name, exif_char_dump(value, length, 0)); #endif info_data-value.s = php_addslashes(value, length, length, 0 TSRMLS_CC); info_data-length = length; @@ -2334,7 +2352,7 @@ return; /* ignore this call */ } #ifdef EXIF_DEBUG - exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, Thumbnail: filetype = %d, ImageInfo-Thumbnail.filetype); + exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, Thumbnail: filetype = %d, ImageInfo-Thumbnail.filetype); #endif switch(ImageInfo-Thumbnail.filetype) { default: @@ -2346,7 +2364,7 @@ info_list = ImageInfo-info_list[SECTION_THUMBNAIL]; new_size = 8 + 2 + info_list-count * 12 + 4; #ifdef EXIF_DEBUG - exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, Thumbnail: size of signature + directory(%d): 0x%02X, info_list-count, new_size); + exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, Thumbnail: size of signature + directory(%d): 0x%02X,