#endif
#ifdef ENABLE_GD_TTF
-static void php3_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int);
+static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int);
#endif
#ifdef THREAD_SAFE
#define PolyMaxPoints 256
+static void php_free_gd_font(gdFontPtr fp)
+{
+ if (fp->data) {
+ efree(fp->data);
+ }
+ efree(fp);
+}
+
PHP_MINIT_FUNCTION(gd)
{
}
#endif
GD_GLOBAL(le_gd) = register_list_destructors(gdImageDestroy, NULL);
- GD_GLOBAL(le_gd_font) = register_list_destructors(php3_free_gd_font, NULL);
+ GD_GLOBAL(le_gd_font) = register_list_destructors(php_free_gd_font, NULL);
return SUCCESS;
}
}
/* Need this for cpdf. See also comment in file.c php3i_get_le_fp() */
-PHPAPI int phpi_get_le_gd(void){
+PHPAPI int phpi_get_le_gd(void)
+{
GD_TLS_VARS;
return GD_GLOBAL(le_gd);
}
#endif
-void php3_free_gd_font(gdFontPtr fp)
-{
- if (fp->data) {
- efree(fp->data);
- }
- efree(fp);
-}
-
/* {{{ proto int imageloadfont(string filename)
Load a new font */
PHP_FUNCTION(imageloadfont) {
/* {{{ proto int imagecreatefrompng(string filename)
Create a new image from file or URL */
-void php3_imagecreatefrompng (INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagecreatefrompng)
+{
pval *file;
int ind;
gdImagePtr im;
/* {{{ proto int imagepng(int im [, string filename])
Output image to browser or file */
-void php3_imagepng (INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepng)
+{
pval *imgind, *file;
gdImagePtr im;
char *fn=NULL;
/* arg = 0 normal polygon
arg = 1 filled polygon */
/* im, points, num_points, col */
-static void _php3_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) {
+static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) {
pval *IM, *POINTS, *NPOINTS, *COL, **var;
gdImagePtr im;
gdPoint points[PolyMaxPoints];
Draw a polygon */
PHP_FUNCTION(imagepolygon)
{
- _php3_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+ php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
Draw a filled polygon */
PHP_FUNCTION(imagefilledpolygon)
{
- _php3_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+ php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
-static gdFontPtr _php3_find_gd_font(int size)
+static gdFontPtr php_find_gd_font(int size)
{
gdFontPtr font;
int ind_type;
* arg = 0 ImageFontWidth
* arg = 1 ImageFontHeight
*/
-static void _php3_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
+static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
{
pval *SIZE;
gdFontPtr font;
WRONG_PARAM_COUNT;
}
convert_to_long(SIZE);
- font = _php3_find_gd_font(SIZE->value.lval);
+ font = php_find_gd_font(SIZE->value.lval);
RETURN_LONG(arg ? font->h : font->w);
}
Get font width */
PHP_FUNCTION(imagefontwidth)
{
- _php3_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+ php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
Get font height */
PHP_FUNCTION(imagefontheight)
{
- _php3_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+ php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* workaround for a bug in gd 1.2 */
-void _php3_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c,
+void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c,
int color)
{
int cx, cy, px, py, fline;
* arg = 2 ImageString
* arg = 3 ImageStringUp
*/
-static void _php3_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) {
+static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) {
pval *IM, *SIZE, *X, *Y, *C, *COL;
gdImagePtr im;
int ch = 0, col, x, y, size, i, l = 0;
RETURN_FALSE;
}
- font = _php3_find_gd_font(size);
+ font = php_find_gd_font(size);
switch(mode) {
case 0:
gdImageChar(im, font, x, y, ch, col);
break;
case 1:
- _php3_gdimagecharup(im, font, x, y, ch, col);
+ php_gdimagecharup(im, font, x, y, ch, col);
break;
case 2:
for (i = 0; (i < l); i++) {
break;
case 3: {
for (i = 0; (i < l); i++) {
- /* _php3_gdimagecharup(im, font, x, y, (int)string[i], col); */
+ /* php_gdimagecharup(im, font, x, y, (int)string[i], col); */
gdImageCharUp(im, font, x, y, (int)string[i], col);
y -= font->w;
}
/* {{{ proto int imagechar(int im, int font, int x, int y, string c, int col)
Draw a character */
PHP_FUNCTION(imagechar) {
- _php3_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+ php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto int imagecharup(int im, int font, int x, int y, string c, int col)
Draw a character rotated 90 degrees counter-clockwise */
PHP_FUNCTION(imagecharup) {
- _php3_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+ php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto int imagestring(int im, int font, int x, int y, string str, int col)
Draw a string horizontally */
PHP_FUNCTION(imagestring) {
- _php3_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2);
+ php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2);
}
/* }}} */
/* {{{ proto int imagestringup(int im, int font, int x, int y, string str, int col)
Draw a string vertically - rotated 90 degrees counter-clockwise */
PHP_FUNCTION(imagestringup) {
- _php3_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3);
+ php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3);
}
/* }}} */
Give the bounding box of a text using TrueType fonts */
PHP_FUNCTION(imagettfbbox)
{
- php3_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX);
+ php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX);
}
/* }}} */
Write text to the image using a TrueType font */
PHP_FUNCTION(imagettftext)
{
- php3_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW);
+ php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW);
}
/* }}} */
static
-void php3_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
+void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
pval *IM, *PTSIZE, *ANGLE, *X, *Y, *C, *FONTNAME, *COL;
gdImagePtr im;
/* $Id$ */
-void _php3_free_ps_font(gd_ps_font *f_ind)
+void php_free_ps_font(gd_ps_font *f_ind)
{
T1_DeleteFont(f_ind->font_id);
efree(f_ind);
}
-void _php3_free_ps_enc(char **enc)
+void php_free_ps_enc(char **enc)
{
T1_DeleteEncoding(enc);
}
/* {{{ proto int imagepsloadfont(string pathname)
Load a new font from specified file */
-void php3_imagepsloadfont(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepsloadfont)
+{
pval *file;
int l_ind;
gd_ps_font *f_ind;
proto int imagepscopyfont(int font_index)
Make a copy of a font for purposes like extending or reenconding */
/*
-void php3_imagepscopyfont(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepscopyfont)
+{
pval *fnt;
int l_ind, type;
gd_ps_font *nf_ind, *of_ind;
/* {{{ proto bool imagepsfreefont(int font_index)
Free memory used by a font */
-void php3_imagepsfreefont(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepsfreefont)
+{
pval *fnt;
int type;
/* {{{ proto bool imagepsencodefont(int font_index, string filename)
To change a fonts character encoding vector */
-void php3_imagepsencodefont(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepsencodefont)
+{
pval *fnt, *enc;
char **enc_vector;
int type;
/* {{{ proto bool imagepsextendfont(int font_index, double extend)
Extend or or condense (if extend < 1) a font */
-void php3_imagepsextendfont(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepsextendfont)
+{
pval *fnt, *ext;
int type;
gd_ps_font *f_ind;
/* {{{ proto bool imagepsslantfont(int font_index, double slant)
Slant a font */
-void php3_imagepsslantfont(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepsslantfont)
+{
pval *fnt, *slt;
int type;
gd_ps_font*f_ind;
/* {{{ proto array imagepstext(int image, string text, int font, int size, int xcoord, int ycoord [, int space, int tightness, double angle, int antialias])
Rasterize a string over an image */
-void php3_imagepstext(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepstext)
+{
pval *img, *str, *fnt, *sz, *fg, *bg, *sp, *px, *py, *aas, *wd, *ang;
int i, j, x, y;
int space, type;
/* {{{ proto array imagepsbbox(string text, int font, int size[, int space, int tightness, int angle])
Return the bounding box needed by a string if rasterized */
-void php3_imagepsbbox(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(imagepsbbox)
+{
pval *str, *fnt, *sz, *sp, *wd, *ang;
int i, space, add_width, char_width, amount_kern, type;
int cur_x, cur_y, dx, dy;
#include "php_ini.h"
#include "php_hyperwave.h"
-//hw_module php3_hw_module;
+//hw_module php_hw_module;
#define HW_ATTR_NONE 1
#define HW_ATTR_LANG 2
}
#define BUFFERLEN 30
-static void php3_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
+static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
pval *argv[4];
int argc;
Connect to the Hyperwave server */
PHP_FUNCTION(hw_connect)
{
- php3_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
+ php_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
}
/* }}} */
Connect to the Hyperwave server persistent */
PHP_FUNCTION(hw_pconnect)
{
- php3_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
+ php_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
}
/* }}} */
}
/* }}} */
-char *php3_hw_command(INTERNAL_FUNCTION_PARAMETERS, int comm) {
+char *php_hw_command(INTERNAL_FUNCTION_PARAMETERS, int comm) {
pval **arg1;
int link, type;
hw_connection *ptr;
PHP_FUNCTION(hw_stat) {
char *object;
- object = php3_hw_command(INTERNAL_FUNCTION_PARAM_PASSTHRU, STAT_COMMAND);
+ object = php_hw_command(INTERNAL_FUNCTION_PARAM_PASSTHRU, STAT_COMMAND);
if(object == NULL)
RETURN_FALSE;
int i;
char *strtok_buf;
- object = php3_hw_command(INTERNAL_FUNCTION_PARAM_PASSTHRU, WHO_COMMAND);
+ object = php_hw_command(INTERNAL_FUNCTION_PARAM_PASSTHRU, WHO_COMMAND);
if(object == NULL)
RETURN_FALSE;
#undef BUFFERLEN
/* }}} */
-void php3_hw_mvcp(INTERNAL_FUNCTION_PARAMETERS, int mvcp) {
+void php_hw_mvcp(INTERNAL_FUNCTION_PARAMETERS, int mvcp) {
pval *arg1, *arg2, *arg3, *arg4;
int link, type, dest=0, from=0, count;
HashTable *src_arr;
/* {{{ proto void hw_mv(int link, array objrec, int from, int dest)
Moves object */
PHP_FUNCTION(hw_mv) {
- php3_hw_mvcp(INTERNAL_FUNCTION_PARAM_PASSTHRU, MOVE);
+ php_hw_mvcp(INTERNAL_FUNCTION_PARAM_PASSTHRU, MOVE);
}
/* }}} */
/* {{{ proto void hw_cp(int link, array objrec, int dest)
Copies object */
PHP_FUNCTION(hw_cp) {
- php3_hw_mvcp(INTERNAL_FUNCTION_PARAM_PASSTHRU, COPY);
+ php_hw_mvcp(INTERNAL_FUNCTION_PARAM_PASSTHRU, COPY);
}
/* }}} */