cvs: php4(PHP_4_0_5) /ext/fdf fdf.c
| From: | Jani Taskinen | Date: | Tue, 20 Mar 2001 01:32:28 +0000 |
| Subject: | cvs: php4(PHP_4_0_5) /ext/fdf fdf.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-4697@lists.php.net to get a copy of this message | ||
sniper Mon Mar 19 17:32:28 2001 EDT
Modified files: (Branch: PHP_4_0_5)
/php4/ext/fdf fdf.c
Log:
MFH
Index: php4/ext/fdf/fdf.c
diff -u php4/ext/fdf/fdf.c:1.39 php4/ext/fdf/fdf.c:1.39.2.1
--- php4/ext/fdf/fdf.c:1.39 Sun Feb 25 22:06:54 2001
+++ php4/ext/fdf/fdf.c Mon Mar 19 17:32:28 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fdf.c,v 1.39 2001/02/26 06:06:54 andi Exp $ */
+/* $Id: fdf.c,v 1.39.2.1 2001/03/20 01:32:28 sniper Exp $ */
/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from
http://beta1.adobe.com/ada/acrosdk/forms.html.
*/
@@ -108,11 +108,13 @@
(void)FDFClose(fdf);
}
-static sapi_post_entry supported_post_entries[] = {
-#if HAVE_FDFLIB
- {
"application/vnd.fdf", sizeof("application/vnd.fdf")-1, php_default_post_reader,
fdf_post_handler},
-#endif
- { NULL, 0, NULL }
+#define FDF_POST_CONTENT_TYPE "application/vnd.fdf"
+
+static sapi_post_entry php_fdf_post_entry = {
+ FDF_POST_CONTENT_TYPE,
+ sizeof(FDF_POST_CONTENT_TYPE)-1,
+ sapi_read_standard_form_data,
+ fdf_post_handler
};
@@ -123,9 +125,9 @@
FDF_GLOBAL(le_fdf) = zend_register_list_destructors_ex(phpi_FDFClose, NULL, "fdf",
module_number);
/* add handler for Acrobat FDF form post requests */
- sapi_add_post_entry("application/vnd.fdf", php_default_post_reader, fdf_post_handler);
+ sapi_register_post_entry(&php_fdf_post_entry);
- /* Constants used by fdf_set_opt() */
+ /* Constants used by fdf_set_opt() */
REGISTER_LONG_CONSTANT("FDFValue", FDFValue, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FDFStatus", FDFStatus, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FDFFile", FDFFile, CONST_CS | CONST_PERSISTENT);
@@ -176,7 +178,7 @@
FDFErc err;
/* remove handler for Acrobat FDF form post requests */
- sapi_remove_post_entry("application/vnd.fdf");
+ sapi_unregister_post_entry(&php_fdf_post_entry);
#ifdef PHP_WIN32
return SUCCESS;
@@ -769,10 +771,9 @@
char *name=NULL,*value=NULL,*p;
int name_len=0,value_len=0;
char *lastfieldname =NULL;
- char *strtok_buf = NULL;
char *filename = NULL;
FDFErc err;
- ASInt32 nBytes, datalen;
+ ASInt32 nBytes;
zval *array_ptr = (zval *) arg;
ELS_FETCH();
PLS_FETCH();
@@ -811,6 +812,7 @@
err = FDFGetValue(theFDF,name,value,value_len-1,&nBytes);
if(err == FDFErcOK && nBytes != 0) {
for(p=value;*p;p++) if(*p=='\r') *p='\n';
+ if(lastfieldname) efree(lastfieldname);
lastfieldname = estrdup(name);
php_register_variable(name, value, array_ptr ELS_CC PLS_CC);
}