diff options
| author | Piotr Pawłow <pp@siedziba.pl> | 2016-09-23 04:58:53 +0200 |
|---|---|---|
| committer | Piotr Pawłow <pp@siedziba.pl> | 2016-09-23 04:58:53 +0200 |
| commit | bbf2806b919e7a5dd51d779ea57b388a7a66c5ef (patch) | |
| tree | 27fd7a15bd40afa30b02271f0826680395f37d9c /filters | |
| parent | 9c105e6be45c167af331e940db768693e2d5520e (diff) | |
Port test filter.
Diffstat (limited to 'filters')
| -rw-r--r-- | filters/php_testfilter.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/filters/php_testfilter.c b/filters/php_testfilter.c index ca844b3..ccc2268 100644 --- a/filters/php_testfilter.c +++ b/filters/php_testfilter.c @@ -14,7 +14,9 @@ _php_testfilter_tint(Imlib_Image im, HashTable* params) { Imlib_Image imge = im; Imlib_Image anoim; - HashPosition pos; + ulong num_index; + zend_string *str_index; + zval *data; Imlib_Color_Modifier cm; DATA8 atab[256]; @@ -28,30 +30,21 @@ _php_testfilter_tint(Imlib_Image im, HashTable* params) w = imlib_image_get_width(); h = imlib_image_get_height(); - zend_hash_internal_pointer_reset_ex(params,&pos); - while (pos) + ZEND_HASH_FOREACH_KEY_VAL(params, num_index, str_index, data) { - 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) + if (str_index) { - zval **data; - zend_hash_get_current_data_ex(params,(void*)&data,&pos); convert_to_long_ex(data); - if (!strcmp(str_index,"red")) r=Z_LVAL_PP(data); - if (!strcmp(str_index,"blue")) b=Z_LVAL_PP(data); - if (!strcmp(str_index,"green")) g=Z_LVAL_PP(data); - if (!strcmp(str_index,"x")) x=Z_LVAL_PP(data); - if (!strcmp(str_index,"y")) y=Z_LVAL_PP(data); - if (!strcmp(str_index,"w")) w=Z_LVAL_PP(data); - if (!strcmp(str_index,"h")) h=Z_LVAL_PP(data); - if (!strcmp(str_index,"alpha")) a=Z_LVAL_PP(data); + if (!strcmp(str_index->val,"red")) r=Z_LVAL_P(data); + if (!strcmp(str_index->val,"blue")) b=Z_LVAL_P(data); + if (!strcmp(str_index->val,"green")) g=Z_LVAL_P(data); + if (!strcmp(str_index->val,"x")) x=Z_LVAL_P(data); + if (!strcmp(str_index->val,"y")) y=Z_LVAL_P(data); + if (!strcmp(str_index->val,"w")) w=Z_LVAL_P(data); + if (!strcmp(str_index->val,"h")) h=Z_LVAL_P(data); + if (!strcmp(str_index->val,"alpha")) a=Z_LVAL_P(data); } - zend_hash_move_forward_ex(params,&pos); - } + } ZEND_HASH_FOREACH_END(); /* zend_printf( "Using values red=%d,blue=%d,green=%d,x=%d,y=%d,height=%d,width=%d,alpha=%d\n", r,b,g,x,y,w,h,a ); */ |
