From: foobar Date: Fri, 28 Jun 2002 12:35:30 +0000 (+0000) Subject: Moved all gd.h related stuff to gd.c X-Git-Tag: php-4.3.0dev_zend2_alpha2~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2eaa0261a534a32922e6ed7eaf3ce266bbb5f30;p=php Moved all gd.h related stuff to gd.c --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 084d0aec5d..640b488132 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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 @@ -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 } */ /* }}} */ diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index 401a848cfb..44d91cac47 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -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