cvs: php4 /ext/sablot sablot.c

From: Date: Tue, 09 Jan 2001 20:17:12 +0000
Subject: cvs: php4 /ext/sablot sablot.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3521@lists.php.net to get a copy of this message
sterling Tue Jan 9 12:17:12 2001 EDT Modified files: /php4/ext/sablot sablot.c Log: Move the definition of the xslt_set_encoding to the "proper" place in the file and fix the prototype. Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.27 php4/ext/sablot/sablot.c:1.28 --- php4/ext/sablot/sablot.c:1.27 Sat Jan 6 00:37:00 2001 +++ php4/ext/sablot/sablot.c Tue Jan 9 12:17:11 2001 @@ -837,6 +837,35 @@ } /* }}} */ + +#ifdef HAVE_SABLOT_SET_ENCODING + +/* {{{ proto void xslt_set_encoding(resource xh, string encoding) + Sets output encoding to be used for Sablotron regardless of the encoding specified by the stylesheet. To unset, call with encoding_ NULL. */ +PHP_FUNCTION(xslt_set_encoding) +{ + zval **xh, **encoding; + php_sablot *handle; + int ret = 0, + loglevel = 0, + argc = ZEND_NUM_ARGS(); + SABLOTLS_FETCH(); + + if (argc != 2 || + zend_get_parameters_ex(argc, &xh, &encoding) == FAILURE) { + WRONG_PARAM_COUNT; + } + ZEND_FETCH_RESOURCE(handle, php_sablot *, xh, -1, "PHP-Sablotron", le_sablot); + convert_to_string_ex(encoding); + + SablotSetEncoding(handle->p, (char *) Z_STRVAL_PP(encoding)); + +} +/* }}} */ + +#endif + + /* }}} */ /* {{{ Begin Error Handling functions */ @@ -978,33 +1007,6 @@ } } /* }}} */ - -#ifdef HAVE_SABLOT_SET_ENCODING -/* {{{ proto void xslt_set_encoding(resource xh, string encoding) - Sets output encoding to be used for Sablotron regardless of the - encoding specified by the stylesheet. To unset, call with - encoding_ NULL. */ -PHP_FUNCTION(xslt_set_encoding) -{ - zval **xh, **encoding; - php_sablot *handle; - int ret = 0, - loglevel = 0, - argc = ZEND_NUM_ARGS(); - SABLOTLS_FETCH(); - - if (argc != 2 || - zend_get_parameters_ex(argc, &xh, &encoding) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(handle, php_sablot *, xh, -1, "PHP-Sablotron", le_sablot); - convert_to_string_ex(encoding); - - SablotSetEncoding(handle->p, (char *)Z_STRVAL_PP(encoding)); - -} -/* }}} */ -#endif /* {{{ _php_sablot_call_handler_function() Call a sablot call handler function, wrapper for call_user_function() */

« previous php.cvs (#3521) next »