summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2005-08-06 05:30:20 +0000
committerFrank M. Kromann <fmk@php.net>2005-08-06 05:30:20 +0000
commit806961aeeead0d7ac261c4c2c7c0c05c2fe3c389 (patch)
treeb3b32de3cc9fa1671051236fea38ff3ff0bf3fb6 /ext
parent91860cf594b903b02c471eb1f5f2d815a4c997cb (diff)
downloadphp-git-806961aeeead0d7ac261c4c2c7c0c05c2fe3c389.tar.gz
Cleanup to match the current cvs version of ming0.3beta
Diffstat (limited to 'ext')
-rw-r--r--ext/ming/ming.c53
1 files changed, 8 insertions, 45 deletions
diff --git a/ext/ming/ming.c b/ext/ming/ming.c
index c5480e7e4f..8a4fd9ecb5 100644
--- a/ext/ming/ming.c
+++ b/ext/ming/ming.c
@@ -2218,7 +2218,7 @@ static void phpByteOutputMethod(byte b, void *data)
PHP_METHOD(swfmovie, output)
{
SWFMovie movie = getMovie(getThis() TSRMLS_CC);
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
zval **zlimit = NULL;
int limit = -1;
int argc = ZEND_NUM_ARGS();
@@ -2244,25 +2244,6 @@ PHP_METHOD(swfmovie, output)
Ming_setSWFCompression(oldval);
}
RETURN_LONG(out);
-#elif defined(HAVE_NEW_MING)
- zval **zlimit = NULL;
- int limit = -1;
- int argc = ZEND_NUM_ARGS();
-
- if(argc) {
- if (zend_get_parameters_ex(1, &zlimit) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long_ex(zlimit);
- limit = Z_LVAL_PP(zlimit);
-
- if ((limit < 0) || (limit > 9)) {
- php_error(E_WARNING,"compression level must be within 0..9");
- RETURN_FALSE;
- }
- }
- RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL, limit));
#else
RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL));
#endif
@@ -2282,11 +2263,9 @@ static void phpStreamOutputMethod(byte b, void * data)
PHP_METHOD(swfmovie, saveToFile)
{
zval **x;
-#if defined(HAVE_MING_ZLIB) || defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
zval **zlimit = NULL;
int limit = -1;
-#endif
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
int oldval = INT_MIN;
long out;
#endif
@@ -2299,7 +2278,7 @@ PHP_METHOD(swfmovie, saveToFile)
WRONG_PARAM_COUNT;
break;
case 2:
-#if defined(HAVE_MING_ZLIB) || defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
if (zend_get_parameters_ex(2, &x, &zlimit) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_long_ex(zlimit);
@@ -2308,8 +2287,6 @@ PHP_METHOD(swfmovie, saveToFile)
php_error(E_WARNING,"compression level must be within 0..9");
RETURN_FALSE;
}
-#endif
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
oldval = Ming_setSWFCompression(limit);
#endif
break;
@@ -2318,13 +2295,11 @@ PHP_METHOD(swfmovie, saveToFile)
}
ZEND_FETCH_RESOURCE(what, php_stream *, x, -1,"File-Handle",php_file_le_stream());
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
out = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, what);
if (oldval >= -1 && oldval <=9)
Ming_setSWFCompression(oldval);
RETURN_LONG(out);
-#elif defined(HAVE_NEW_MING)
- RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what, limit));
#else
RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what));
#endif
@@ -2336,11 +2311,9 @@ PHP_METHOD(swfmovie, saveToFile)
PHP_METHOD(swfmovie, save)
{
zval **x;
-#if defined(HAVE_MING_ZLIB) || defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
zval **zlimit = NULL;
int limit = -1;
-#endif
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
int oldval = INT_MIN;
#endif
long retval;
@@ -2353,7 +2326,7 @@ PHP_METHOD(swfmovie, save)
}
break;
case 2:
-#if defined(HAVE_MING_ZLIB) || defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
if (zend_get_parameters_ex(2, &x, &zlimit) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -2363,8 +2336,6 @@ PHP_METHOD(swfmovie, save)
php_error(E_WARNING,"compression level must be within 0..9");
RETURN_FALSE;
}
-#endif
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
oldval = Ming_setSWFCompression(limit);
#endif
break;
@@ -2374,16 +2345,12 @@ PHP_METHOD(swfmovie, save)
if (Z_TYPE_PP(x) == IS_RESOURCE) {
ZEND_FETCH_RESOURCE(stream, php_stream *, x, -1,"File-Handle",php_file_le_stream());
-#if defined(HAVE_NEW_MING)
- RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream, limit));
-#else
RETVAL_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream));
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
if(oldval >= -1 && oldval <=9)
Ming_setSWFCompression(oldval);
#endif
return;
-#endif
}
convert_to_string_ex(x);
@@ -2393,13 +2360,9 @@ PHP_METHOD(swfmovie, save)
RETURN_FALSE;
}
-#if defined(HAVE_NEW_MING)
- 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);
-#if defined(HAVE_MING_ZLIB) && !defined(HAVE_NEW_MING)
+#if defined(HAVE_MING_ZLIB) && defined(HAVE_NEW_MING)
if(oldval >= -1 && oldval <=9)
Ming_setSWFCompression(oldval);
#endif