summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2001-07-13 16:58:09 +0000
committerRasmus Lerdorf <rasmus@php.net>2001-07-13 16:58:09 +0000
commitdf965e200c905de75c5c331b244c5f61f9c22c38 (patch)
tree5b81df06aee924772554eba1c674d3f3bbaffad0
parentf00791ce247e9aa5af4677cf4bcd625480992f1a (diff)
downloadphp-git-df965e200c905de75c5c331b244c5f61f9c22c38.tar.gz
Add fdf_set_encoding()
-rw-r--r--NEWS3
-rw-r--r--ext/fdf/fdf.c34
-rw-r--r--ext/fdf/php_fdf.h1
3 files changed, 38 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 167443332f..34544178ba 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, Version 4.0.7-dev
+- Add fdf_set_encoding() function (Masaki YATSU, Rasmus)
+- Fix return value for a failed snmpset() - now returns false (Rasmus)
+- Add hostname:port support to snmp functions (nbougues@axialys.net, Rasmus)
- Reversed the destruction-order of resources. This fixes the reported OCI8
"failed to rollback outstanding transactions!" message. (Thies Zend Engine)
- Added option for returning XMLRPC fault packets. (Matt Allen, Sascha
diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c
index 78a08c3c91..6f7910813f 100644
--- a/ext/fdf/fdf.c
+++ b/ext/fdf/fdf.c
@@ -62,6 +62,7 @@ function_entry fdf_functions[] = {
PHP_FE(fdf_set_opt, NULL)
PHP_FE(fdf_set_submit_form_action, NULL)
PHP_FE(fdf_set_javascript_action, NULL)
+ PHP_FE(fdf_set_encoding, NULL)
{NULL, NULL, NULL}
};
/* }}} */
@@ -685,6 +686,38 @@ 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;
+ FDFDoc fdf;
+ FDFErc err;
+ FDF_TLS_VARS;
+
+ if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == 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;
+ }
+
+ err = FDFSetEncoding(fdf, (*arg2)->value.str.val);
+
+ if(err != FDFErcOK) {
+ printf("error setting encoding\n");
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
/* {{{ SAPI_POST_HANDLER_FUNC
* SAPI post handler for FDF forms */
SAPI_POST_HANDLER_FUNC(fdf_post_handler)
@@ -757,6 +790,7 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
}
/* }}} */
+
#endif
/*
diff --git a/ext/fdf/php_fdf.h b/ext/fdf/php_fdf.h
index e475fbe5a4..fb8f499f7e 100644
--- a/ext/fdf/php_fdf.h
+++ b/ext/fdf/php_fdf.h
@@ -53,6 +53,7 @@ PHP_FUNCTION(fdf_set_flags);
PHP_FUNCTION(fdf_set_opt);
PHP_FUNCTION(fdf_set_submit_form_action);
PHP_FUNCTION(fdf_set_javascript_action);
+PHP_FUNCTION(fdf_set_encoding);
#else
#define fdf_module_ptr NULL