cvs: /php4/ext/gd gd.c gdt1.c php_gd.h /php4/ext/gettext gettext.c php_gettext.h /php4/ext/hyperwave hw.c php_hyperwave.h
| From: | Zeev Suraski | Date: | Fri, 17 Dec 1999 21:50:10 +0000 |
| Subject: | cvs: /php4/ext/gd gd.c gdt1.c php_gd.h /php4/ext/gettext gettext.c php_gettext.h /php4/ext/hyperwave hw.c php_hyperwave.h | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-8099@lists.php.net to get a copy of this message | ||
zeev Fri Dec 17 16:50:10 1999 EDT
Modified files:
/php4/ext/gd gd.c gdt1.c php_gd.h
/php4/ext/gettext gettext.c php_gettext.h
/php4/ext/hyperwave hw.c php_hyperwave.h
Log:
More cleanup...
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.31 php4/ext/gd/gd.c:1.32
--- php4/ext/gd/gd.c:1.31 Fri Dec 17 15:54:58 1999
+++ php4/ext/gd/gd.c Fri Dec 17 16:50:02 1999
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.31 1999/12/17 20:54:58 zeev Exp $ */
+/* $Id: gd.c,v 1.32 1999/12/17 21:50:02 zeev Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -58,7 +58,7 @@
#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
@@ -143,6 +143,14 @@
#define PolyMaxPoints 256
+static void php_free_gd_font(gdFontPtr fp)
+{
+ if (fp->data) {
+ efree(fp->data);
+ }
+ efree(fp);
+}
+
PHP_MINIT_FUNCTION(gd)
{
@@ -165,7 +173,7 @@
}
#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;
}
@@ -220,7 +228,8 @@
}
/* 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);
}
@@ -279,14 +288,6 @@
#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) {
@@ -396,7 +397,8 @@
/* {{{ 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;
@@ -430,7 +432,8 @@
/* {{{ 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;
@@ -1381,7 +1384,7 @@
/* 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];
@@ -1469,7 +1472,7 @@
Draw a polygon */
PHP_FUNCTION(imagepolygon)
{
- _php3_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+ php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
@@ -1477,12 +1480,12 @@
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;
@@ -1524,7 +1527,7 @@
* 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;
@@ -1533,7 +1536,7 @@
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);
}
@@ -1542,7 +1545,7 @@
Get font width */
PHP_FUNCTION(imagefontwidth)
{
- _php3_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+ php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
@@ -1550,13 +1553,13 @@
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;
@@ -1584,7 +1587,7 @@
* 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;
@@ -1627,14 +1630,14 @@
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++) {
@@ -1645,7 +1648,7 @@
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;
}
@@ -1661,28 +1664,28 @@
/* {{{ 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);
}
/* }}} */
@@ -1846,7 +1849,7 @@
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);
}
/* }}} */
@@ -1854,12 +1857,12 @@
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;
Index: php4/ext/gd/gdt1.c
diff -u php4/ext/gd/gdt1.c:1.3 php4/ext/gd/gdt1.c:1.4
--- php4/ext/gd/gdt1.c:1.3 Fri Dec 17 15:54:58 1999
+++ php4/ext/gd/gdt1.c Fri Dec 17 16:50:02 1999
@@ -17,22 +17,23 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gdt1.c,v 1.3 1999/12/17 20:54:58 zeev Exp $ */
+/* $Id: gdt1.c,v 1.4 1999/12/17 21:50:02 zeev Exp $ */
-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;
@@ -77,7 +78,8 @@
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;
@@ -130,7 +132,8 @@
/* {{{ 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;
@@ -154,7 +157,8 @@
/* {{{ 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;
@@ -192,7 +196,8 @@
/* {{{ 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;
@@ -219,7 +224,8 @@
/* {{{ 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;
@@ -245,7 +251,8 @@
/* {{{ 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;
@@ -413,7 +420,8 @@
/* {{{ 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;
Index: php4/ext/gd/php_gd.h
diff -u php4/ext/gd/php_gd.h:1.2 php4/ext/gd/php_gd.h:1.3
--- php4/ext/gd/php_gd.h:1.2 Fri Dec 17 15:54:58 1999
+++ php4/ext/gd/php_gd.h Fri Dec 17 16:50:02 1999
@@ -29,7 +29,7 @@
*/
-/* $Id: php_gd.h,v 1.2 1999/12/17 20:54:58 zeev Exp $ */
+/* $Id: php_gd.h,v 1.3 1999/12/17 21:50:02 zeev Exp $ */
#ifndef _PHP_GD_H
#define _PHP_GD_H
@@ -97,8 +97,7 @@
PHP_FUNCTION(imagesy);
PHP_FUNCTION(imagecreatefrompng);
PHP_FUNCTION(imagepng);
-void php3_free_gd_font(gdFontPtr);
-void _php3_gdimagecharup(gdImagePtr, gdFontPtr, int, int, int, int);
+void php_gdimagecharup(gdImagePtr, gdFontPtr, int, int, int, int);
PHP_FUNCTION(imagedashedline);
#ifdef ENABLE_GD_TTF
PHP_FUNCTION(imagettfbbox);
Index: php4/ext/gettext/gettext.c
diff -u php4/ext/gettext/gettext.c:1.10 php4/ext/gettext/gettext.c:1.11
--- php4/ext/gettext/gettext.c:1.10 Fri Dec 17 15:55:00 1999
+++ php4/ext/gettext/gettext.c Fri Dec 17 16:50:03 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gettext.c,v 1.10 1999/12/17 20:55:00 zeev Exp $ */
+/* $Id: gettext.c,v 1.11 1999/12/17 21:50:03 zeev Exp $ */
#include <stdio.h>
#include "php.h"
@@ -26,7 +26,7 @@
#include <libintl.h>
-function_entry php3_gettext_functions[] = {
+function_entry php_gettext_functions[] = {
PHP_FE(textdomain, NULL)
PHP_FE(gettext, NULL)
PHP_FALIAS(_, gettext, NULL)
@@ -36,8 +36,8 @@
{NULL, NULL, NULL}
};
-zend_module_entry php3_gettext_module_entry = {
- "gettext", php3_gettext_functions, NULL, NULL, NULL, NULL, PHP_MINFO(gettext),
STANDARD_MODULE_PROPERTIES
+zend_module_entry php_gettext_module_entry = {
+ "gettext", php_gettext_functions, NULL, NULL, NULL, NULL, PHP_MINFO(gettext),
STANDARD_MODULE_PROPERTIES
};
PHP_MINFO_FUNCTION(gettext)
Index: php4/ext/gettext/php_gettext.h
diff -u php4/ext/gettext/php_gettext.h:1.2 php4/ext/gettext/php_gettext.h:1.3
--- php4/ext/gettext/php_gettext.h:1.2 Fri Dec 17 15:55:00 1999
+++ php4/ext/gettext/php_gettext.h Fri Dec 17 16:50:03 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_gettext.h,v 1.2 1999/12/17 20:55:00 zeev Exp $ */
+/* $Id: php_gettext.h,v 1.3 1999/12/17 21:50:03 zeev Exp $ */
#ifndef _GETTEXT_H
#define _GETTEXT_H
@@ -37,8 +37,8 @@
#include "modules.h"
#endif
-extern zend_module_entry php3_gettext_module_entry;
-#define gettext_module_ptr &php3_gettext_module_entry
+extern zend_module_entry php_gettext_module_entry;
+#define gettext_module_ptr &php_gettext_module_entry
PHP_MINFO_FUNCTION(gettext);
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.32 php4/ext/hyperwave/hw.c:1.33
--- php4/ext/hyperwave/hw.c:1.32 Fri Dec 17 15:55:01 1999
+++ php4/ext/hyperwave/hw.c Fri Dec 17 16:50:05 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.32 1999/12/17 20:55:01 zeev Exp $ */
+/* $Id: hw.c,v 1.33 1999/12/17 21:50:05 zeev Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -42,7 +42,7 @@
#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
@@ -633,7 +633,7 @@
}
#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;
@@ -897,7 +897,7 @@
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);
}
/* }}} */
@@ -905,7 +905,7 @@
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);
}
/* }}} */
@@ -1095,7 +1095,7 @@
}
/* }}} */
-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;
@@ -1126,7 +1126,7 @@
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;
@@ -1144,7 +1144,7 @@
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;
@@ -1813,7 +1813,7 @@
#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;
@@ -1907,14 +1907,14 @@
/* {{{ 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);
}
/* }}} */
Index: php4/ext/hyperwave/php_hyperwave.h
diff -u php4/ext/hyperwave/php_hyperwave.h:1.2 php4/ext/hyperwave/php_hyperwave.h:1.3
--- php4/ext/hyperwave/php_hyperwave.h:1.2 Fri Dec 17 15:55:02 1999
+++ php4/ext/hyperwave/php_hyperwave.h Fri Dec 17 16:50:07 1999
@@ -23,7 +23,7 @@
*/
-/* $Id: php_hyperwave.h,v 1.2 1999/12/17 20:55:02 zeev Exp $ */
+/* $Id: php_hyperwave.h,v 1.3 1999/12/17 21:50:07 zeev Exp $ */
#ifndef _HW_H
#define _HW_H
@@ -79,7 +79,7 @@
extern PHP_HW_API php_hw_globals hw_globals;
#endif
-//extern hw_module php3_hw_module;
+//extern hw_module php_hw_module;
typedef struct {
int size;
@@ -87,8 +87,6 @@
char *attributes;
char *bodytag;
} hw_document;
-
-extern hw_connection php3_hw_connection;
extern PHP_MINIT_FUNCTION(hw);
extern PHP_MSHUTDOWN_FUNCTION(hw);