summaryrefslogtreecommitdiffhomepage
path: root/filters/php_bumpmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'filters/php_bumpmap.c')
-rw-r--r--filters/php_bumpmap.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/filters/php_bumpmap.c b/filters/php_bumpmap.c
index 24e548d..6910f82 100644
--- a/filters/php_bumpmap.c
+++ b/filters/php_bumpmap.c
@@ -44,9 +44,7 @@ _php_bumpmap_exec(char* filter, HashTable* params,int index)
int *paramtypes;
char *script;
Imlib_Image im=NULL;
- ulong num_index;
- zend_string *str_index;
- imlib_zval *data;
+ HashPosition pos;
paramnames=allpnames[index];
paramtypes=allptypes[index];
@@ -54,28 +52,36 @@ _php_bumpmap_exec(char* filter, HashTable* params,int index)
script=estrdup(filter);
script=_php_bumpmap_stradd(script,"(");
- ZEND_HASH_FOREACH_KEY_VAL(params, num_index, str_index, data)
- {
- if (str_index)
+ zend_hash_internal_pointer_reset_ex(params,&pos);
+ while (pos)
+ {
+ char *str_index;
+ ulong num_index;
+ int retval;
+
+ retval=zend_hash_get_current_key_ex(params,&str_index,NULL,&num_index,0,&pos);
+ if (retval==HASH_KEY_IS_STRING)
{
int match=0;
int index=0;
while (paramnames[index])
{
- if (strcmp(STR_VAL(str_index),paramnames[index])==0)
+ if (strcmp(str_index,paramnames[index])==0)
{
char val[32];
+ zval **data;
+ zend_hash_get_current_data_ex(params,(void**)&data,&pos);
switch(paramtypes[index])
{
case 'I':
- im=(Imlib_Image)_php_imlib_get_image(Z_RES_P(data)); /* Why is cast to Imlib_Image needed? */
+ im=(Imlib_Image)_php_imlib_get_image(data); /* Why is cast to Imlib_Image needed? */
script=_php_bumpmap_stradd(script,"map=[]");
break;
case 'i':
convert_to_long_ex(data);
sprintf(val,"%d",(int)Z_LVAL_PP(data));
- script=_php_bumpmap_stradd(script,STR_VAL(str_index));
+ script=_php_bumpmap_stradd(script,str_index);
script=_php_bumpmap_stradd(script,"=");
script=_php_bumpmap_stradd(script,val);
break;
@@ -91,7 +97,8 @@ _php_bumpmap_exec(char* filter, HashTable* params,int index)
php_error(E_NOTICE,"Unknown argument %s ignored",str_index);
}
}
- } ZEND_HASH_FOREACH_END();
+ zend_hash_move_forward_ex(params,&pos);
+ }
if (script[strlen(script)-1]==',') script[strlen(script)-1]='\0';
script=_php_bumpmap_stradd(script,");");
@@ -115,9 +122,6 @@ php_filter_deinit()
}
int
-_php_bumpmap_getfilterindex(char*);
-
-int
php_filter_exec(Imlib_Image im, char *filter, HashTable *params)
{
int index=_php_bumpmap_getfilterindex(filter);