summaryrefslogtreecommitdiff
path: root/ext/pdf
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>1999-10-15 15:22:25 +0000
committerThies C. Arntzen <thies@php.net>1999-10-15 15:22:25 +0000
commitb5c3c7bfc908f4e9f841db2ce2e20c6b4cee9d32 (patch)
tree079096896d215713e74b139203b0295a9df25b4b /ext/pdf
parentd69d118cbd401dfdc1766256347a52f0aaf724ca (diff)
downloadphp-git-b5c3c7bfc908f4e9f841db2ce2e20c6b4cee9d32.tar.gz
files are now resources, file.c is thread-safe, the le_ vars are no longer shared,
but they are accessible thru "php_file_le_socket(), php_file_le_uploads()..." i also updated the ftp, pdf and file-upload stuff to match the new requirements. @- Cleaned up File-Module (Thies)
Diffstat (limited to 'ext/pdf')
-rw-r--r--ext/pdf/pdf.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c
index b5e8fd1767..8691c96b9f 100644
--- a/ext/pdf/pdf.c
+++ b/ext/pdf/pdf.c
@@ -206,6 +206,7 @@ PHP_MSHUTDOWN_FUNCTION(pdf){
}
/* {{{ proto bool pdf_set_info_creator(int info, string creator)
+
Fills the creator field of the info structure */
PHP_FUNCTION(pdf_set_info_creator) {
pval *arg1, *arg2;
@@ -231,9 +232,11 @@ PHP_FUNCTION(pdf_set_info_creator) {
RETURN_TRUE;
}
+
/* }}} */
/* {{{ proto bool pdf_set_info_title(int info, string title)
+
Fills the title field of the info structure */
PHP_FUNCTION(pdf_set_info_title) {
pval *arg1, *arg2;
@@ -259,9 +262,11 @@ PHP_FUNCTION(pdf_set_info_title) {
RETURN_TRUE;
}
+
/* }}} */
/* {{{ proto bool pdf_set_info_subject(int info, string subject)
+
Fills the subject field of the info structure */
PHP_FUNCTION(pdf_set_info_subject) {
pval *arg1, *arg2;
@@ -287,9 +292,11 @@ PHP_FUNCTION(pdf_set_info_subject) {
RETURN_TRUE;
}
+
/* }}} */
/* {{{ proto bool pdf_set_info_author(int info, string author)
+
Fills the author field of the info structure */
PHP_FUNCTION(pdf_set_info_author) {
pval *arg1, *arg2;
@@ -315,9 +322,11 @@ PHP_FUNCTION(pdf_set_info_author) {
RETURN_TRUE;
}
+
/* }}} */
/* {{{ proto bool pdf_set_info_keywords(int info, string keywords)
+
Fills the keywords field of the info structure */
PHP_FUNCTION(pdf_set_info_keywords) {
pval *arg1, *arg2;
@@ -343,30 +352,25 @@ PHP_FUNCTION(pdf_set_info_keywords) {
RETURN_TRUE;
}
+
/* }}} */
/* {{{ proto int pdf_open(int filedesc)
Opens a new pdf document */
PHP_FUNCTION(pdf_open) {
- pval *file;
+ pval **file;
pval *info;
int id, type;
FILE *fp;
PDF *pdf;
PDF_TLS_VARS;
-
- if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &file) == FAILURE) {
+ if (ARG_COUNT(ht) != 1 || getParametersEx(1, &file) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long(file);
- id=file->value.lval;
- fp = php3_list_find(id,&type);
- if (!fp || type!=php3i_get_le_fp()) {
- php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);
- RETURN_FALSE;
- }
+ ZEND_FETCH_RESOURCE(fp, FILE *, file, -1, "File-Handle", php_file_le_fopen());
+ /* XXX should do anzend_list_addref for <fp> here! */
pdf = PDF_new();
if (0 > PDF_open_fp(pdf, fp)) {