summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2003-07-11 05:55:13 +0000
committerFrank M. Kromann <fmk@php.net>2003-07-11 05:55:13 +0000
commit5baaa6aee1e96e62aa7d8cb283ca281c8ba7a5f0 (patch)
tree2b97da43cc934eaad0bccf1a570da9395df71330
parentd6430ab79f964ace209f639bdb92dd89ba74d715 (diff)
downloadphp-git-5baaa6aee1e96e62aa7d8cb283ca281c8ba7a5f0.tar.gz
Allow the use of both ming 0.2a and 0.3a (API\s changed)
-rw-r--r--ext/ming/ming.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/ming/ming.c b/ext/ming/ming.c
index 071f0fc1c3..1c8c0ed84e 100644
--- a/ext/ming/ming.c
+++ b/ext/ming/ming.c
@@ -1443,6 +1443,7 @@ PHP_FUNCTION(swfmovie_output)
SWFMovie movie = getMovie(getThis() TSRMLS_CC);
switch (ZEND_NUM_ARGS()) {
+#ifdef MING_HAVE_ZLIB
case 1:
if (zend_get_parameters_ex(1, &zlimit) == FAILURE)
WRONG_PARAM_COUNT;
@@ -1453,9 +1454,16 @@ PHP_FUNCTION(swfmovie_output)
RETURN_FALSE;
}
break;
+#endif
+ default:
+ WRONG_PARAM_COUNT;
}
+#ifdef MING_HAVE_ZLIB
RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL, limit));
+#else
+ RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL));
+#endif
}
/* }}} */
@@ -1481,6 +1489,7 @@ PHP_FUNCTION(swfmovie_saveToFile)
if (zend_get_parameters_ex(1, &x) == FAILURE)
WRONG_PARAM_COUNT;
break;
+#ifdef MING_HAVE_ZLIB
case 2:
if (zend_get_parameters_ex(2, &x, &zlimit) == FAILURE)
WRONG_PARAM_COUNT;
@@ -1491,12 +1500,17 @@ PHP_FUNCTION(swfmovie_saveToFile)
RETURN_FALSE;
}
break;
+#endif
default:
WRONG_PARAM_COUNT;
}
ZEND_FETCH_RESOURCE(what, php_stream *, x, -1,"File-Handle",php_file_le_stream());
+#ifdef MING_HAVE_ZLIB
RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what, limit));
+#else
+ RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what));
+#endif
}
/* }}} */
@@ -1514,6 +1528,7 @@ PHP_FUNCTION(swfmovie_save)
if (zend_get_parameters_ex(1, &x) == FAILURE)
WRONG_PARAM_COUNT;
break;
+#ifdef MING_HAVE_ZLIB
case 2:
if (zend_get_parameters_ex(2, &x, &zlimit) == FAILURE)
WRONG_PARAM_COUNT;
@@ -1524,13 +1539,18 @@ PHP_FUNCTION(swfmovie_save)
RETURN_FALSE;
}
break;
+#endif
default:
WRONG_PARAM_COUNT;
}
if (Z_TYPE_PP(x) == IS_RESOURCE) {
ZEND_FETCH_RESOURCE(stream, php_stream *, x, -1,"File-Handle",php_file_le_stream());
+#ifdef MING_HAVE_ZLIB
RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream, limit));
+#else
+ RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream));
+#endif
}
convert_to_string_ex(x);
@@ -1540,7 +1560,11 @@ PHP_FUNCTION(swfmovie_save)
RETURN_FALSE;
}
+#ifdef MING_HAVE_ZLIB
retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, (void *)stream, limit);
+#else
+ retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, (void *)stream);
+#endif
php_stream_close(stream);
RETURN_LONG(retval);
}