You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.3 KiB
83 lines
2.3 KiB
Index: ext/pdf/pdf.c |
|
--- ext/pdf/pdf.c.orig 2004-02-28 23:58:56 +0100 |
|
+++ ext/pdf/pdf.c 2004-07-25 11:35:57 +0200 |
|
@@ -240,6 +240,16 @@ |
|
ZEND_GET_MODULE(pdf) |
|
#endif |
|
|
|
+ZEND_BEGIN_MODULE_GLOBALS(pdf) |
|
+FILE *fp; |
|
+ZEND_END_MODULE_GLOBALS(pdf) |
|
+ZEND_DECLARE_MODULE_GLOBALS(pdf) |
|
+#ifdef ZTS |
|
+#define PDF_G(v) TSRMG(pdf_globals_id, zend_pdf_globals *, v) |
|
+#else |
|
+#define PDF_G(v) (pdf_globals.v) |
|
+#endif |
|
+ |
|
/* {{{ _free_pdf_doc |
|
*/ |
|
static void _free_pdf_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC) |
|
@@ -305,6 +315,15 @@ |
|
} |
|
/* }}} */ |
|
|
|
+/* {{{ pdf_flushwrite_fp |
|
+ */ |
|
+static size_t pdf_flushwrite_fp(PDF *p, void *data, size_t size) |
|
+{ |
|
+ FILE *fp = PDF_G(fp); |
|
+ return fwrite(data, size, 1, fp); |
|
+} |
|
+/* }}} */ |
|
+ |
|
/* {{{ pdf_flushwrite |
|
*/ |
|
static size_t pdf_flushwrite(PDF *p, void *data, size_t size) |
|
@@ -339,8 +358,13 @@ |
|
|
|
/* {{{ PHP_MINIT_FUNCTION |
|
*/ |
|
+static void php_pdf_init_globals (zend_pdf_globals *g) |
|
+{ |
|
+ g->fp = NULL; |
|
+} |
|
PHP_MINIT_FUNCTION(pdf) |
|
{ |
|
+ ZEND_INIT_MODULE_GLOBALS(pdf, php_pdf_init_globals, NULL); |
|
if ((PDF_get_majorversion() != PDFLIB_MAJORVERSION) || |
|
(PDF_get_minorversion() != PDFLIB_MINORVERSION)) { |
|
php_error(E_ERROR,"PDFlib error: Version mismatch in wrapper code"); |
|
@@ -469,9 +493,8 @@ |
|
pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL); |
|
|
|
if(fp) { |
|
- if (PDF_open_fp(pdf, fp) < 0) { |
|
- RETURN_FALSE; |
|
- } |
|
+ PDF_G(fp) = fp; |
|
+ PDF_begin_document_callback(pdf, pdf_flushwrite_fp, ""); |
|
} else { |
|
PDF_open_mem(pdf, pdf_flushwrite); |
|
} |
|
Index: Zend/zend_strtod.c |
|
--- Zend/zend_strtod.c.orig 2004-12-14 09:35:26 +0100 |
|
+++ Zend/zend_strtod.c 2005-02-06 14:15:09 +0100 |
|
@@ -95,7 +95,7 @@ |
|
static char *rcsid = "$OpenBSD: strtod.c,v 1.19 2004/02/03 16:52:11 drahn Exp $"; |
|
#endif /* LIBC_SCCS and not lint */ |
|
|
|
-#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \ |
|
+#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || defined(__ia64__) || \ |
|
defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \ |
|
defined(__powerpc__) || defined(__ppc__) || defined(__m88k__) || \ |
|
defined(__hppa__) || defined(__x86_64__) || (defined(__arm__) && \ |
|
@@ -127,7 +127,7 @@ |
|
#define IEEE_LITTLE_ENDIAN |
|
#endif |
|
|
|
-#if defined(__sparc__) || defined(__ppc__) |
|
+#if defined(__sparc__) || defined(__ppc__) || defined(__sun__) |
|
#define u_int32_t uint32_t |
|
#endif |
|
|
|
|