From: Frank M. Kromann Date: Fri, 11 Jul 2003 05:55:13 +0000 (+0000) Subject: Allow the use of both ming 0.2a and 0.3a (API\s changed) X-Git-Tag: BEFORE_ARG_INFO~285 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5baaa6aee1e96e62aa7d8cb283ca281c8ba7a5f0;p=php Allow the use of both ming 0.2a and 0.3a (API\s changed) --- 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); }