fmk             Fri Jul 11 01:55:12 2003 EDT

  Modified files:              
    /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.50 php-src/ext/ming/ming.c:1.51
--- php-src/ext/ming/ming.c:1.50        Thu Jul 10 01:07:06 2003
+++ php-src/ext/ming/ming.c     Fri Jul 11 01:55:12 2003
@@ -15,7 +15,7 @@
    | Author: [EMAIL PROTECTED]                                              |
    +----------------------------------------------------------------------+
    
-  $Id: ming.c,v 1.50 2003/07/10 05:07:06 fmk Exp $ 
+  $Id: ming.c,v 1.51 2003/07/11 05:55:12 fmk Exp $ 
 
 */
 
@@ -1443,6 +1443,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;
@@ -1453,9 +1454,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
 }
 /* }}} */
 
@@ -1481,6 +1489,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;
@@ -1491,12 +1500,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
 }
 /* }}} */
 
@@ -1514,6 +1528,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;
@@ -1524,13 +1539,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);
@@ -1540,7 +1560,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

Reply via email to