cvs: /php4/ext/fdf fdf.c php3_fdf.h
| From: | Uwe Steinmann | Date: | Fri, 06 Aug 1999 06:52:07 +0000 |
| Subject: | cvs: /php4/ext/fdf fdf.c php3_fdf.h | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-3165@lists.php.net to get a copy of this message | ||
steinm Fri Aug 6 02:52:07 1999 EDT
Modified files:
/php4/ext/fdf fdf.c php3_fdf.h
Log:
Fdf module should now be up to date
Index: php4/ext/fdf/fdf.c
diff -u php4/ext/fdf/fdf.c:1.7 php4/ext/fdf/fdf.c:1.8
--- php4/ext/fdf/fdf.c:1.7 Mon Aug 2 15:16:40 1999
+++ php4/ext/fdf/fdf.c Fri Aug 6 02:52:06 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fdf.c,v 1.7 1999/08/02 19:16:40 zeev Exp $ */
+/* $Id: fdf.c,v 1.8 1999/08/06 06:52:06 steinm Exp $ */
/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from
http://beta1.adobe.com/ada/acrosdk/forms.html.
*/
@@ -76,6 +76,7 @@
PHP_FE(fdf_get_status, NULL)
PHP_FE(fdf_set_file, NULL)
PHP_FE(fdf_get_file, NULL)
+ PHP_FE(fdf_add_template, NULL)
{NULL, NULL, NULL}
};
@@ -89,14 +90,18 @@
DLEXPORT php3_module_entry *get_module(void) { return &fdf_module_entry; }
#endif
+static void phpi_FDFClose(FDFDoc fdf) {
+ (void)FDFClose(fdf);
+}
+
PHP_MINIT_FUNCTION(fdf)
{
FDFErc err;
- FDF_GLOBAL(le_fdf) = register_list_destructors(FDFClose, NULL);
+ FDF_GLOBAL(le_fdf) = register_list_destructors(phpi_FDFClose, NULL);
err = FDFInitialize();
if(err == FDFErcOK)
- printf("FDFINitital executed\n");
- return SUCCESS;
+ return SUCCESS;
+ return FAILURE;
}
PHP_MINFO_FUNCTION(fdf)
@@ -110,8 +115,8 @@
FDFErc err;
err = FDFFinalize();
if(err == FDFErcOK)
- printf("FDFFinalize executed\n");
- return SUCCESS;
+ return SUCCESS;
+ return FAILURE;
}
/* {{{ proto int fdf_open(string filename)
@@ -160,7 +165,7 @@
RETURN_FALSE;
}
-// FDFClose(fdf);
+/* FDFClose(fdf); */
php3_list_delete(id);
RETURN_TRUE;
@@ -512,6 +517,48 @@
RETURN_TRUE;
} /* }}} */
+
+/* {{{ proto void fdf_add_template(int fdfdoc, int newpage, string filename, string template, int
rename)
+ Adds a template to the FDF*/
+PHP_FUNCTION(fdf_add_template) {
+ pval *arg1, *arg2, *arg3, *arg4, *arg5;
+ int id, type;
+ FDFDoc fdf;
+ FDFErc err;
+ pdfFileSpecRec filespec;
+ FDF_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 5 || getParameters(ht, 5, &arg1, &arg2, &arg3, &arg4,
&arg5) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(arg1);
+ convert_to_long(arg2);
+ convert_to_string(arg3);
+ convert_to_string(arg4);
+ convert_to_long(arg5);
+ id=arg1->value.lval;
+ fdf = php3_list_find(id,&type);
+ if(!fdf || type!=FDF_GLOBAL(le_fdf)) {
+ php3_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ filespec.FS = NULL;
+ filespec.F = arg3->value.str.val;
+ filespec.Mac = NULL;
+ filespec.DOS = NULL;
+ filespec.Unix = NULL;
+ filespec.ID[0] = NULL;
+ filespec.ID[1] = NULL;
+ filespec.bVolatile = false;
+ err = FDFAddTemplate(fdf, arg2->value.lval, &filespec, arg4->value.str.val,
arg5->value.lval);
+ if(err != FDFErcOK)
+ printf("Aiii, error\n");
+
+ RETURN_TRUE;
+}
+/* }}} */
#endif
Index: php4/ext/fdf/php3_fdf.h
diff -u php4/ext/fdf/php3_fdf.h:1.4 php4/ext/fdf/php3_fdf.h:1.5
--- php4/ext/fdf/php3_fdf.h:1.4 Tue Jul 27 15:44:44 1999
+++ php4/ext/fdf/php3_fdf.h Fri Aug 6 02:52:06 1999
@@ -26,7 +26,7 @@
| Authors: Uwe Steinmann |
+----------------------------------------------------------------------+
*/
-/* $Id: php3_fdf.h,v 1.4 1999/07/27 19:44:44 andrey Exp $ */
+/* $Id: php3_fdf.h,v 1.5 1999/08/06 06:52:06 steinm Exp $ */
#ifndef _PHP3_FDF_H
#define _PHP3_FDF_H
@@ -58,6 +58,7 @@
PHP_FUNCTION(fdf_set_status);
PHP_FUNCTION(fdf_set_file);
PHP_FUNCTION(fdf_get_file);
+PHP_FUNCTION(fdf_add_template);
#else
#define phpext_fdf_ptr NULL
#endif