From: Frank M. Kromann Date: Fri, 11 Jul 2003 05:54:45 +0000 (+0000) Subject: Allow the use of both ming 0.2a and 0.3a (API\s changed) X-Git-Tag: php-4.3.3RC2~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d560e58711767443f406952246116c31cf74ab3e;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 1f17eb7dc2..2186335404 100644 --- a/ext/ming/ming.c +++ b/ext/ming/ming.c @@ -1439,6 +1439,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; @@ -1449,9 +1450,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 } /* }}} */ @@ -1477,6 +1485,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; @@ -1487,12 +1496,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 } /* }}} */ @@ -1510,6 +1524,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; @@ -1520,13 +1535,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); @@ -1536,7 +1556,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); }