fmk Fri Jul 11 01:54:44 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ming ming.c Log: Allow the use of both ming 0.2a and 0.3a (API\s changed) Index: php-src/ext/ming/ming.c diff -u php-src/ext/ming/ming.c:1.42.2.4 php-src/ext/ming/ming.c:1.42.2.5 --- php-src/ext/ming/ming.c:1.42.2.4 Thu Jul 10 01:07:45 2003 +++ php-src/ext/ming/ming.c Fri Jul 11 01:54:44 2003 @@ -1439,6 +1439,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php