]> granicus.if.org Git - php/commitdiff
Allow the use of both ming 0.2a and 0.3a (API\s changed)
authorFrank M. Kromann <fmk@php.net>
Fri, 11 Jul 2003 05:55:13 +0000 (05:55 +0000)
committerFrank M. Kromann <fmk@php.net>
Fri, 11 Jul 2003 05:55:13 +0000 (05:55 +0000)
ext/ming/ming.c

index 071f0fc1c318e1de4bb961000fd4f9775e083c3d..1c8c0ed84e063bf418812904e83e331345ef1f04 100644 (file)
@@ -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);
 }