]> granicus.if.org Git - php/commitdiff
Moved all gd.h related stuff to gd.c
authorfoobar <sniper@php.net>
Fri, 28 Jun 2002 12:35:30 +0000 (12:35 +0000)
committerfoobar <sniper@php.net>
Fri, 28 Jun 2002 12:35:30 +0000 (12:35 +0000)
ext/gd/gd.c
ext/gd/php_gd.h

index 084d0aec5db9faf212ff257292a9901a6aa0d7fe..640b488132dc95418d1d37e81a5794de46f1a9ad 100644 (file)
@@ -52,6 +52,8 @@
 static int le_gd, le_gd_font;
 #if HAVE_LIBT1
 static int le_ps_font, le_ps_enc;
+static void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC);
+static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC);
 #endif
 
 #include <gd.h>
@@ -96,6 +98,14 @@ typedef FILE gdIOCtx;
 #define CTX_PUTC(c, fp) fputc(c, fp)
 #endif
 
+#ifndef HAVE_GDIMAGECOLORRESOLVE
+extern int gdImageColorResolve(gdImagePtr, int, int, int);
+#endif
+
+#if HAVE_COLORCLOSESTHWB
+int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);
+#endif
+
 static gdImagePtr _php_image_create_from_string (zval **Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC);
 static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
 static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)());
@@ -2745,7 +2755,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
 
 /* {{{ php_free_ps_font
  */
-void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
        int *font = (int *)rsrc->ptr;
 
@@ -2756,7 +2766,7 @@ void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 
 /* {{{ php_free_ps_enc
  */
-void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
        char **enc = (char **)rsrc->ptr;
 
@@ -2764,9 +2774,6 @@ void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 }
 /* }}} */
 
-#endif
-
-#if HAVE_LIBT1
 /* {{{ proto int imagepsloadfont(string pathname)
    Load a new font from specified file */
 PHP_FUNCTION(imagepsloadfont)
@@ -2816,7 +2823,6 @@ PHP_FUNCTION(imagepsloadfont)
 /* The function in t1lib which this function uses seem to be buggy...
 PHP_FUNCTION(imagepscopyfont)
 {
-#if HAVE_LIBT1
        zval **fnt;
        int l_ind, type;
        gd_ps_font *nf_ind, *of_ind;
@@ -2863,10 +2869,6 @@ PHP_FUNCTION(imagepscopyfont)
        nf_ind->extend = 1;
        l_ind = zend_list_insert(nf_ind, le_ps_font);
        RETURN_LONG(l_ind);
-#else 
-       php_error(E_WARNING, "ImagePsCopyFont: No T1lib support in this PHP build");
-       RETURN_FALSE;
-#endif 
 }
 */
 /* }}} */
index 401a848cfbba6b7649dc18ddd272acc4d6900a7a..44d91cac472c4a284dd11530d5e91db5f0dbe0b1 100644 (file)
@@ -59,9 +59,6 @@ PHP_MINFO_FUNCTION(gd);
 PHP_MINIT_FUNCTION(gd);
 PHP_MSHUTDOWN_FUNCTION(gd);
 
-#ifndef HAVE_GDIMAGECOLORRESOLVE
-extern int gdImageColorResolve(gdImagePtr, int, int, int);
-#endif
 PHP_FUNCTION(imagearc);
 PHP_FUNCTION(imagechar);
 PHP_FUNCTION(imagecharup);
@@ -160,11 +157,6 @@ PHP_FUNCTION(image2wbmp);
 
 PHP_GD_API int phpi_get_le_gd(void);
 
-/* This is missing from gd.h */
-#if HAVE_COLORCLOSESTHWB
-int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);
-#endif
-
 #else
 
 #define phpext_gd_ptr NULL