diff options
author | foobar <sniper@php.net> | 2001-07-28 03:57:16 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2001-07-28 03:57:16 +0000 |
commit | 2bff935a4f4a27cb91ca130e3ab99e457f3019de (patch) | |
tree | 3a12ad08f6dcab85e81cd0be425870b45694c045 | |
parent | c5cbe8b3cb0778cae73a75d5d2c76d93b216501d (diff) | |
download | php-git-2bff935a4f4a27cb91ca130e3ab99e457f3019de.tar.gz |
Fix build. This was done by bringing this to the 'PHP 4 era' :)
-rw-r--r-- | ext/fdf/fdf.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index 76605e9186..3c88e9397c 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -688,32 +688,26 @@ PHP_FUNCTION(fdf_set_javascript_action) /* {{{ 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; } /* }}} */ |