cvs: php4 /ext/fdf fdf.c

From: Date: Sat, 28 Jul 2001 03:57:16 +0000
Subject: cvs: php4 /ext/fdf fdf.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6369@lists.php.net to get a copy of this message
sniper Fri Jul 27 23:57:16 2001 EDT Modified files: /php4/ext/fdf fdf.c Log: Fix build. This was done by bringing this to the 'PHP 4 era' :) Index: php4/ext/fdf/fdf.c diff -u php4/ext/fdf/fdf.c:1.51 php4/ext/fdf/fdf.c:1.52 --- php4/ext/fdf/fdf.c:1.51 Fri Jul 27 06:16:19 2001 +++ php4/ext/fdf/fdf.c Fri Jul 27 23:57:16 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fdf.c,v 1.51 2001/07/27 10:16:19 zeev Exp $ */ +/* $Id: fdf.c,v 1.52 2001/07/28 03:57:16 sniper Exp $ */ /* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from http://beta1.adobe.com/ada/acrosdk/forms.html. */ @@ -688,32 +688,26 @@ /* {{{ fdf_set_encoding(int fdf_document, string encoding) Sets FDF encoding (either "Shift-JIS" or "Unicode") */ -PHP_FUNCTION(fdf_set_encoding) { - pval **arg1, **arg2; - int id, type; +PHP_FUNCTION(fdf_set_encoding) +{ + zval **fdfp, **enc; FDFDoc fdf; FDFErc err; - FDF_TLS_VARS; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { + if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &enc) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long_ex(arg1); - convert_to_string_ex(arg2); - id=(*arg1)->value.lval; - fdf = zend_list_find(id,&type); - if(!fdf || type!=FDF_GLOBAL(le_fdf)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); - RETURN_FALSE; - } + ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - err = FDFSetEncoding(fdf, (*arg2)->value.str.val); + convert_to_string_ex(enc); + + err = FDFSetEncoding(fdf, Z_STRVAL_PP(enc)); if(err != FDFErcOK) { - printf("error setting encoding\n"); + php_error(E_WARNING,"Error setting FDF encoding: %s", Z_STRVAL_PP(enc)); + RETURN_FALSE; } - RETURN_TRUE; } /* }}} */

« previous php.cvs (#6369) next »