diff options
author | Zeev Suraski <zeev@php.net> | 2001-08-11 16:39:07 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-08-11 16:39:07 +0000 |
commit | f6f6c4d7e63d2eaf4ece7aee66f46a013b29bffa (patch) | |
tree | 4013e29cc962a2f0363f61d764da46d8302d828e /ext | |
parent | bafa98109cb7ac4c95a4d47e010139f4cd100bde (diff) | |
download | php-git-f6f6c4d7e63d2eaf4ece7aee66f46a013b29bffa.tar.gz |
Whitespace
Diffstat (limited to 'ext')
48 files changed, 1418 insertions, 1409 deletions
diff --git a/ext/aspell/aspell.c b/ext/aspell/aspell.c index d4acf3be82..63ae1b662b 100644 --- a/ext/aspell/aspell.c +++ b/ext/aspell/aspell.c @@ -81,23 +81,23 @@ PHP_MINIT_FUNCTION(aspell) Load a dictionary */ PHP_FUNCTION(aspell_new) { - pval **master,**personal; + pval **master, **personal; int argc; aspell *sc; int ind; argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc,&master,&personal) == FAILURE) { + if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &master, &personal) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(master); if(argc==2) { convert_to_string_ex(personal) ; - sc=aspell_new((*master)->value.str.val,(*personal)->value.str.val); + sc=aspell_new((*master)->value.str.val, (*personal)->value.str.val); } else - sc=aspell_new((*master)->value.str.val,""); + sc=aspell_new((*master)->value.str.val, ""); ind = zend_list_insert(sc, le_aspell); RETURN_LONG(ind); @@ -111,13 +111,13 @@ PHP_FUNCTION(aspell_suggest) pval **scin, **word; int argc; aspell *sc; - int ind,type; + int ind, type; aspellSuggestions *sug; size_t i; argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin,&word) == FAILURE) { + if (argc != 2 || zend_get_parameters_ex(argc, &scin, &word) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scin); @@ -125,7 +125,7 @@ PHP_FUNCTION(aspell_suggest) sc = (aspell *)zend_list_find((*scin)->value.lval, &type); if(!sc) { - php_error(E_WARNING, "%d is not an ASPELL result index",(*scin)->value.lval); + php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval); RETURN_FALSE; } @@ -135,7 +135,7 @@ PHP_FUNCTION(aspell_suggest) sug = aspell_suggest(sc, (*word)->value.str.val); for (i = 0; i != sug->size; ++i) { - add_next_index_string(return_value,(char *)sug->data[i],1); + add_next_index_string(return_value, (char *)sug->data[i], 1); } aspell_free_suggestions(sug); } @@ -146,12 +146,12 @@ PHP_FUNCTION(aspell_suggest) PHP_FUNCTION(aspell_check) { int type; - pval **scin,**word; + pval **scin, **word; aspell *sc; int argc; argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin,&word) == FAILURE) { + if (argc != 2 || zend_get_parameters_ex(argc, &scin, &word) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scin); @@ -159,7 +159,7 @@ PHP_FUNCTION(aspell_check) sc= (aspell *) zend_list_find((*scin)->value.lval, &type); if(!sc) { - php_error(E_WARNING, "%d is not an ASPELL result index",(*scin)->value.lval); + php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval); RETURN_FALSE; } if (aspell_check(sc, (*word)->value.str.val)) @@ -177,13 +177,13 @@ PHP_FUNCTION(aspell_check) Return if word is valid, ignoring case or trying to trim it in any way */ PHP_FUNCTION(aspell_check_raw) { - pval **scin,**word; + pval **scin, **word; int type; int argc; aspell *sc; argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin,&word) == FAILURE) { + if (argc != 2 || zend_get_parameters_ex(argc, &scin, &word) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scin); @@ -191,7 +191,7 @@ PHP_FUNCTION(aspell_check_raw) sc = (aspell *)zend_list_find((*scin)->value.lval, &type); if(!sc) { - php_error(E_WARNING, "%d is not an ASPELL result index",(*scin)->value.lval); + php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval); RETURN_FALSE; } if (aspell_check_raw(sc, (*word)->value.str.val)) diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 7f59fd3c47..55b3af35bf 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -89,10 +89,10 @@ PHP_MINIT_FUNCTION(bcmath) extern bc_num _one_; extern bc_num _two_; - _zero_ = bc_new_num (1,0); - _one_ = bc_new_num (1,0); + _zero_ = bc_new_num (1, 0); + _one_ = bc_new_num (1, 0); _one_->n_value[0] = 1; - _two_ = bc_new_num (1,0); + _two_ = bc_new_num (1, 0); _two_->n_value[0] = 2; persist_alloc(_zero_); persist_alloc(_one_); @@ -117,7 +117,7 @@ PHP_MSHUTDOWN_FUNCTION(bcmath) PHP_RINIT_FUNCTION(bcmath) { - if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) { + if (cfg_get_long("bcmath.scale", &bc_precision)==FAILURE) { bc_precision=0; } return SUCCESS; @@ -135,18 +135,18 @@ PHP_MINFO_FUNCTION(bcmath) Returns the sum of two arbitrary precision numbers */ PHP_FUNCTION(bcadd) { - pval **left, **right,**scale_param; + pval **left, **right, **scale_param; bc_num first, second, result; int scale=bc_precision; switch (ZEND_NUM_ARGS()) { case 2: - if (zend_get_parameters_ex(2, &left,&right) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { WRONG_PARAM_COUNT; } break; case 3: - if (zend_get_parameters_ex(3, &left,&right, &scale_param) == FAILURE) { + if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scale_param); @@ -161,9 +161,9 @@ PHP_FUNCTION(bcadd) bc_init_num(&first); bc_init_num(&second); bc_init_num(&result); - bc_str2num(&first,(*left)->value.str.val,scale); - bc_str2num(&second,(*right)->value.str.val,scale); - bc_add (first,second,&result, scale); + bc_str2num(&first, (*left)->value.str.val, scale); + bc_str2num(&second, (*right)->value.str.val, scale); + bc_add (first, second, &result, scale); return_value->value.str.val = bc_num2str(result); return_value->value.str.len = strlen(return_value->value.str.val); return_value->type = IS_STRING; @@ -178,18 +178,18 @@ PHP_FUNCTION(bcadd) Returns the difference between two arbitrary precision numbers */ PHP_FUNCTION(bcsub) { - pval **left, **right,**scale_param; + pval **left, **right, **scale_param; bc_num first, second, result; int scale=bc_precision; switch (ZEND_NUM_ARGS()) { case 2: - if (zend_get_parameters_ex(2, &left,&right) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { WRONG_PARAM_COUNT; } break; case 3: - if (zend_get_parameters_ex(3, &left,&right, &scale_param) == FAILURE) { + if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scale_param); @@ -204,9 +204,9 @@ PHP_FUNCTION(bcsub) bc_init_num(&first); bc_init_num(&second); bc_init_num(&result); - bc_str2num(&first,(*left)->value.str.val,scale); - bc_str2num(&second,(*right)->value.str.val,scale); - bc_sub (first,second,&result, scale); + bc_str2num(&first, (*left)->value.str.val, scale); + bc_str2num(&second, (*right)->value.str.val, scale); + bc_sub (first, second, &result, scale); return_value->value.str.val = bc_num2str(result); return_value->value.str.len = strlen(return_value->value.str.val); return_value->type = IS_STRING; @@ -221,18 +221,18 @@ PHP_FUNCTION(bcsub) Returns the multiplication of two arbitrary precision numbers */ PHP_FUNCTION(bcmul) { - pval **left, **right,**scale_param; + pval **left, **right, **scale_param; bc_num first, second, result; int scale=bc_precision; switch (ZEND_NUM_ARGS()) { case 2: - if (zend_get_parameters_ex(2, &left,&right) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { WRONG_PARAM_COUNT; } break; case 3: - if (zend_get_parameters_ex(3, &left,&right, &scale_param) == FAILURE) { + if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scale_param); @@ -247,9 +247,9 @@ PHP_FUNCTION(bcmul) bc_init_num(&first); bc_init_num(&second); bc_init_num(&result); - bc_str2num(&first,(*left)->value.str.val,scale); - bc_str2num(&second,(*right)->value.str.val,scale); - bc_multiply (first,second,&result, scale); + bc_str2num(&first, (*left)->value.str.val, scale); + bc_str2num(&second, (*right)->value.str.val, scale); + bc_multiply (first, second, &result, scale); return_value->value.str.val = bc_num2str(result); return_value->value.str.len = strlen(return_value->value.str.val); return_value->type = IS_STRING; @@ -264,18 +264,18 @@ PHP_FUNCTION(bcmul) Returns the quotient of two arbitrary precision numbers (division) */ PHP_FUNCTION(bcdiv) { - pval **left, **right,**scale_param; + pval **left, **right, **scale_param; bc_num first, second, result; int scale=bc_precision; switch (ZEND_NUM_ARGS()) { case 2: - if (zend_get_parameters_ex(2, &left,&right) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { WRONG_PARAM_COUNT; } break; case 3: - if (zend_get_parameters_ex(3, &left,&right, &scale_param) == FAILURE) { + if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scale_param); @@ -290,16 +290,16 @@ PHP_FUNCTION(bcdiv) bc_init_num(&first); bc_init_num(&second); bc_init_num(&result); - bc_str2num(&first,(*left)->value.str.val,scale); - bc_str2num(&second,(*right)->value.str.val,scale); - switch (bc_divide (first,second,&result, scale)) { + bc_str2num(&first, (*left)->value.str.val, scale); + bc_str2num(&second, (*right)->value.str.val, scale); + switch (bc_divide (first, second, &result, scale)) { case 0: /* OK */ return_value->value.str.val = bc_num2str(result); return_value->value.str.len = strlen(return_value->value.str.val); return_value->type = IS_STRING; break; case -1: /* division by zero */ - php_error(E_WARNING,"Division by zero"); + php_error(E_WARNING, "Division by zero"); break; } bc_free_num(&first); @@ -318,7 +318,7 @@ PHP_FUNCTION(bcmod) switch (ZEND_NUM_ARGS()) { case 2: - if (zend_get_parameters_ex(2, &left,&right) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { WRONG_PARAM_COUNT; } break; @@ -331,16 +331,16 @@ PHP_FUNCTION(bcmod) bc_init_num(&first); bc_init_num(&second); bc_init_num(&result); - bc_str2num(&first,(*left)->value.str.val,0); - bc_str2num(&second,(*right)->value.str.val,0); - switch (bc_modulo(first,second,&result, 0)) { + bc_str2num(&first, (*left)->value.str.val, 0); + bc_str2num(&second, (*right)->value.str.val, 0); + switch (bc_modulo(first, second, &result, 0)) { case 0: return_value->value.str.val = bc_num2str(result); return_value->value.str.len = strlen(return_value->value.str.val); return_value->type = IS_STRING; break; case -1: - php_error(E_WARNING,"Division by zero"); + php_error(E_WARNING, "Division by zero"); break; } bc_free_num(&first); @@ -354,18 +354,18 @@ PHP_FUNCTION(bcmod) Returns the value of an arbitrary precision number raised to the power of another */ PHP_FUNCTION(bcpow) { - pval **left, **right,**scale_param; + pval **left, **right, **scale_param; bc_num first, second, result; int scale=bc_precision; switch (ZEND_NUM_ARGS()) { case 2: - if (zend_get_parameters_ex(2, &left,&right) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { WRONG_PARAM_COUNT; } break; case 3: - if (zend_get_parameters_ex(3, &left,&right, &scale_param) == FAILURE) { + if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scale_param); @@ -380,9 +380,9 @@ PHP_FUNCTION(bcpow) bc_init_num(&first); bc_init_num(&second); bc_init_num(&result); - bc_str2num(&first,(*left)->value.str.val,scale); - bc_str2num(&second,(*right)->value.str.val,scale); - bc_raise (first,second,&result, scale); + bc_str2num(&first, (*left)->value.str.val, scale); + bc_str2num(&second, (*right)->value.str.val, scale); + bc_raise (first, second, &result, scale); return_value->value.str.val = bc_num2str(result); return_value->value.str.len = strlen(return_value->value.str.val); return_value->type = IS_STRING; @@ -397,7 +397,7 @@ PHP_FUNCTION(bcpow) Returns the square root of an arbitray precision number */ PHP_FUNCTION(bcsqrt) { - pval **left,**scale_param; + pval **left, **scale_param; bc_num result; int scale=bc_precision; @@ -408,7 +408,7 @@ PHP_FUNCTION(bcsqrt) } break; case 2: - if (zend_get_parameters_ex(2, &left,&scale_param) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &scale_param) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scale_param); @@ -420,13 +420,13 @@ PHP_FUNCTION(bcsqrt) } convert_to_string_ex(left); bc_init_num(&result); - bc_str2num(&result,(*left)->value.str.val,scale); + bc_str2num(&result, (*left)->value.str.val, scale); if (bc_sqrt (&result, scale) != 0) { return_value->value.str.val = bc_num2str(result); return_value->value.str.len = strlen(return_value->value.str.val); return_value->type = IS_STRING; } else { - php_error(E_WARNING,"Square root of negative number"); + php_error(E_WARNING, "Square root of negative number"); } bc_free_num(&result); return; @@ -443,12 +443,12 @@ PHP_FUNCTION(bccomp) switch (ZEND_NUM_ARGS()) { case 2: - if (zend_get_parameters_ex(2, &left,&right) == FAILURE) { + if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { WRONG_PARAM_COUNT; } break; case 3: - if (zend_get_parameters_ex(3, &left,&right, &scale_param) == FAILURE) { + if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(scale_param); @@ -464,9 +464,9 @@ PHP_FUNCTION(bccomp) bc_init_num(&first); bc_init_num(&second); - bc_str2num(&first,(*left)->value.str.val,scale); - bc_str2num(&second,(*right)->value.str.val,scale); - return_value->value.lval = bc_compare(first,second); + bc_str2num(&first, (*left)->value.str.val, scale); + bc_str2num(&second, (*right)->value.str.val, scale); + return_value->value.lval = bc_compare(first, second); return_value->type = IS_LONG; bc_free_num(&first); @@ -481,7 +481,7 @@ PHP_FUNCTION(bcscale) { pval **new_scale; - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1,&new_scale)==FAILURE) { + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &new_scale)==FAILURE) { WRONG_PARAM_COUNT; } diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h index b7c338c4aa..a6c7627b6b 100644 --- a/ext/bcmath/libbcmath/src/bcmath.h +++ b/ext/bcmath/libbcmath/src/bcmath.h @@ -67,8 +67,8 @@ typedef struct bc_struct #undef MIN #undef MAX #endif -#define MAX(a,b) ((a)>(b)?(a):(b)) -#define MIN(a,b) ((a)>(b)?(b):(a)) +#define MAX(a, b) ((a)>(b)?(a):(b)) +#define MIN(a, b) ((a)>(b)?(b):(a)) #define ODD(a) ((a)&1) #ifndef TRUE diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c index 80853eac3d..cb3ff68ac9 100644 --- a/ext/calendar/cal_unix.c +++ b/ext/calendar/cal_unix.c @@ -34,7 +34,7 @@ PHP_FUNCTION(unixtojd) struct tm *ta, tmbuf; int myargc=ZEND_NUM_ARGS(); - if ((myargc > 1) || (zend_get_parameters(ht,myargc, ×tamp) != SUCCESS)) { + if ((myargc > 1) || (zend_get_parameters(ht, myargc, ×tamp) != SUCCESS)) { WRONG_PARAM_COUNT; } @@ -50,7 +50,7 @@ PHP_FUNCTION(unixtojd) } ta = php_localtime_r(&t, &tmbuf); - jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1,ta->tm_mday); + jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1, ta->tm_mday); RETURN_LONG(jdate); } @@ -63,7 +63,7 @@ PHP_FUNCTION(jdtounix) pval *jday; long uday; - if ((ZEND_NUM_ARGS()!= 1) || (zend_get_parameters(ht,1, &jday) != SUCCESS)) { + if ((ZEND_NUM_ARGS()!= 1) || (zend_get_parameters(ht, 1, &jday) != SUCCESS)) { WRONG_PARAM_COUNT; } diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 83e92b0e44..5fafa8de32 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -299,7 +299,7 @@ PHP_FUNCTION(jdtogregorian) SdnToGregorian((*julday)->value.lval, &year, &month, &day); sprintf(date, "%i/%i/%i", month, day, year); - RETURN_STRING(date,1); + RETURN_STRING(date, 1); } /* }}} */ @@ -318,7 +318,7 @@ PHP_FUNCTION(jdtogregorian) convert_to_long_ex(day); convert_to_long_ex(year); - jdate = GregorianToSdn((*year)->value.lval, (*month)->value.lval,(*day)->value.lval); + jdate = GregorianToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval); RETURN_LONG(jdate); } @@ -340,7 +340,7 @@ PHP_FUNCTION(jdtogregorian) SdnToJulian((*julday)->value.lval, &year, &month, &day); sprintf(date, "%i/%i/%i", month, day, year); - RETURN_STRING(date,1); + RETURN_STRING(date, 1); } /* }}} */ @@ -359,7 +359,7 @@ PHP_FUNCTION(jdtogregorian) convert_to_long_ex(day); convert_to_long_ex(year); - jdate = JulianToSdn((*year)->value.lval,(*month)->value.lval, (*day)->value.lval); + jdate = JulianToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval); RETURN_LONG(jdate); } @@ -382,7 +382,7 @@ PHP_FUNCTION(jdtogregorian) SdnToJewish((*julday)->value.lval, &year, &month, &day); sprintf(date, "%i/%i/%i", month, day, year); - RETURN_STRING(date,1); + RETURN_STRING(date, 1); } /* }}} */ @@ -401,7 +401,7 @@ PHP_FUNCTION(jdtogregorian) convert_to_long_ex(day); convert_to_long_ex(year); - jdate = JewishToSdn((*year)->value.lval,(*month)->value.lval, (*day)->value.lval); + jdate = JewishToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval); RETURN_LONG(jdate); } @@ -424,7 +424,7 @@ PHP_FUNCTION(jdtogregorian) SdnToFrench((*julday)->value.lval, &year, &month, &day); sprintf(date, "%i/%i/%i", month, day, year); - RETURN_STRING(date,1); + RETURN_STRING(date, 1); } /* }}} */ @@ -443,7 +443,7 @@ PHP_FUNCTION(jdtogregorian) convert_to_long_ex(day); convert_to_long_ex(year); - jdate = FrenchToSdn((*year)->value.lval,(*month)->value.lval,(*day)->value.lval); + jdate = FrenchToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval); RETURN_LONG(jdate); } @@ -456,9 +456,9 @@ PHP_FUNCTION(jdtogregorian) pval *julday, *mode; int day; char *daynamel, *daynames; - int myargc=ZEND_NUM_ARGS(),mymode=0; + int myargc=ZEND_NUM_ARGS(), mymode=0; - if ((myargc < 1) || (myargc > 2) || (zend_get_parameters(ht,myargc, &julday, &mode) != SUCCESS)) { + if ((myargc < 1) || (myargc > 2) || (zend_get_parameters(ht, myargc, &julday, &mode) != SUCCESS)) { WRONG_PARAM_COUNT; } @@ -474,10 +474,10 @@ PHP_FUNCTION(jdtogregorian) switch (mymode) { case CAL_DOW_SHORT: - RETURN_STRING(daynamel,1); + RETURN_STRING(daynamel, 1); break; case CAL_DOW_LONG: - RETURN_STRING(daynames,1); + RETURN_STRING(daynames, 1); break; case CAL_DOW_DAYNO: default: @@ -504,33 +504,33 @@ PHP_FUNCTION(jdtogregorian) switch((*mode)->value.lval) { case CAL_MONTH_GREGORIAN_LONG: /* gregorian or julian month */ - SdnToGregorian((*julday)->value.lval,&year, &month, &day); + SdnToGregorian((*julday)->value.lval, &year, &month, &day); monthname = MonthNameLong[month]; break; case CAL_MONTH_JULIAN_SHORT: /* gregorian or julian month */ - SdnToJulian((*julday)->value.lval, &year,&month, &day); + SdnToJulian((*julday)->value.lval, &year, &month, &day); monthname = MonthNameShort[month]; break; case CAL_MONTH_JULIAN_LONG: /* gregorian or julian month */ - SdnToJulian((*julday)->value.lval, &year,&month, &day); + SdnToJulian((*julday)->value.lval, &year, &month, &day); monthname = MonthNameLong[month]; break; case CAL_MONTH_JEWISH: /* jewish month */ - SdnToJewish((*julday)->value.lval, &year,&month, &day); + SdnToJewish((*julday)->value.lval, &year, &month, &day); monthname = JewishMonthName[month]; break; case CAL_MONTH_FRENCH: /* french month */ - SdnToFrench((*julday)->value.lval, &year,&month, &day); + SdnToFrench((*julday)->value.lval, &year, &month, &day); monthname = FrenchMonthName[month]; break; default: /* default gregorian */ case CAL_MONTH_GREGORIAN_SHORT: /* gregorian or julian month */ - SdnToGregorian((*julday)->value.lval,&year, &month, &day); + SdnToGregorian((*julday)->value.lval, &year, &month, &day); monthname = MonthNameShort[month]; break; } - RETURN_STRING(monthname,1); + RETURN_STRING(monthname, 1); } /* }}} */ diff --git a/ext/ccvs/ccvs.c b/ext/ccvs/ccvs.c index c69bee5837..10c2686244 100644 --- a/ext/ccvs/ccvs.c +++ b/ext/ccvs/ccvs.c @@ -56,39 +56,39 @@ static char const cvsid[] = "$Id$"; */ function_entry ccvs_functions[] = { - PHP_FE(ccvs_init,NULL) - PHP_FALIAS(cv_init,ccvs_init,NULL) - PHP_FE(ccvs_done,NULL) - PHP_FALIAS(cv_done,ccvs_done,NULL) - PHP_FE(ccvs_new,NULL) - PHP_FALIAS(cv_new,ccvs_new,NULL) - PHP_FE(ccvs_add,NULL) - PHP_FALIAS(cv_add,ccvs_add,NULL) - PHP_FE(ccvs_delete,NULL) - PHP_FALIAS(cv_delete,ccvs_delete,NULL) - PHP_FE(ccvs_auth,NULL) - PHP_FALIAS(cv_auth,ccvs_auth,NULL) - PHP_FE(ccvs_return,NULL) - PHP_FALIAS(cv_return,ccvs_return,NULL) - PHP_FE(ccvs_reverse,NULL) - PHP_FALIAS(cv_reverse,ccvs_reverse,NULL) - PHP_FE(ccvs_sale,NULL) - PHP_FALIAS(cv_sale,ccvs_sale,NULL) - PHP_FE(ccvs_void,NULL) - PHP_FALIAS(cv_void,ccvs_void,NULL) - PHP_FE(ccvs_status,NULL) - PHP_FALIAS(cv_status,ccvs_status,NULL) - PHP_FE(ccvs_count,NULL) - PHP_FALIAS(cv_count,ccvs_count,NULL) - PHP_FE(ccvs_lookup,NULL) - PHP_FALIAS(cv_lookup,ccvs_lookup,NULL) - PHP_FE(ccvs_report,NULL) - PHP_FALIAS(cv_report,ccvs_report,NULL) - PHP_FE(ccvs_command,NULL) - PHP_FALIAS(cv_command,ccvs_command,NULL) - PHP_FE(ccvs_textvalue,NULL) - PHP_FALIAS(cv_textvalue,ccvs_textvalue,NULL) - {NULL,NULL,NULL} + PHP_FE(ccvs_init, NULL) + PHP_FALIAS(cv_init, ccvs_init, NULL) + PHP_FE(ccvs_done, NULL) + PHP_FALIAS(cv_done, ccvs_done, NULL) + PHP_FE(ccvs_new, NULL) + PHP_FALIAS(cv_new, ccvs_new, NULL) + PHP_FE(ccvs_add, NULL) + PHP_FALIAS(cv_add, ccvs_add, NULL) + PHP_FE(ccvs_delete, NULL) + PHP_FALIAS(cv_delete, ccvs_delete, NULL) + PHP_FE(ccvs_auth, NULL) + PHP_FALIAS(cv_auth, ccvs_auth, NULL) + PHP_FE(ccvs_return, NULL) + PHP_FALIAS(cv_return, ccvs_return, NULL) + PHP_FE(ccvs_reverse, NULL) + PHP_FALIAS(cv_reverse, ccvs_reverse, NULL) + PHP_FE(ccvs_sale, NULL) + PHP_FALIAS(cv_sale, ccvs_sale, NULL) + PHP_FE(ccvs_void, NULL) + PHP_FALIAS(cv_void, ccvs_void, NULL) + PHP_FE(ccvs_status, NULL) + PHP_FALIAS(cv_status, ccvs_status, NULL) + PHP_FE(ccvs_count, NULL) + PHP_FALIAS(cv_count, ccvs_count, NULL) + PHP_FE(ccvs_lookup, NULL) + PHP_FALIAS(cv_lookup, ccvs_lookup, NULL) + PHP_FE(ccvs_report, NULL) + PHP_FALIAS(cv_report, ccvs_report, NULL) + PHP_FE(ccvs_command, NULL) + PHP_FALIAS(cv_command, ccvs_command, NULL) + PHP_FE(ccvs_textvalue, NULL) + PHP_FALIAS(cv_textvalue, ccvs_textvalue, NULL) + {NULL, NULL, NULL} }; /* End function declarations */ @@ -99,7 +99,7 @@ static char const cvsid[] = "$Id$"; zend_module_entry ccvs_module_entry = { "CCVS", ccvs_functions, - NULL,NULL,NULL,NULL, + NULL, NULL, NULL, NULL, PHP_MINFO(ccvs), STANDARD_MODULE_PROPERTIES }; @@ -580,9 +580,9 @@ PHP_MINFO_FUNCTION(ccvs) { php_info_print_table_start(); php_info_print_table_header(2, "RedHat CCVS support", "enabled"); - php_info_print_table_row(2,"CCVS Support by","Brendan W. McAdams <bmcadams@php.net><br>& Doug DeJulio <ddj@redhat.com>"); - php_info_print_table_row(2,"Release ID",cvsid); - php_info_print_table_row(2,"This Release Certified For CCVS Versions","3.0 and greater"); + php_info_print_table_row(2, "CCVS Support by", "Brendan W. McAdams <bmcadams@php.net><br>& Doug DeJulio <ddj@redhat.com>"); + php_info_print_table_row(2, "Release ID", cvsid); + php_info_print_table_row(2, "This Release Certified For CCVS Versions", "3.0 and greater"); php_info_print_table_end(); /* DISPLAY_INI_ENTRIES(); */ diff --git a/ext/com/COM.c b/ext/com/COM.c index 9d6648044b..ee1fbc8c6c 100644 --- a/ext/com/COM.c +++ b/ext/com/COM.c @@ -544,7 +544,7 @@ PHP_FUNCTION(com_load) { efree(obj); error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Invalid ProgID or Moniker: %s\n", error_message); + php_error(E_WARNING, "Invalid ProgID or Moniker: %s\n", error_message); LocalFree(error_message); RETURN_FALSE; } @@ -583,7 +583,7 @@ PHP_FUNCTION(com_load) { error_message = php_COM_error_message(hr); clsid_str = php_string_from_clsid(&clsid); - php_error(E_WARNING,"Unable to obtain IDispatch interface for CLSID %s: %s",clsid_str,error_message); + php_error(E_WARNING, "Unable to obtain IDispatch interface for CLSID %s: %s", clsid_str, error_message); LocalFree(error_message); efree(clsid_str); efree(obj); @@ -668,7 +668,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** default: /* TODO: complain about wrong arg count */ - php_error(E_WARNING,"Wrong argument count to IEnumVariant::Next()\n"); + php_error(E_WARNING, "Wrong argument count to IEnumVariant::Next()\n"); return FAILURE; } @@ -690,7 +690,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr = C_ENUMVARIANT_VT(obj)->Next(C_ENUMVARIANT(obj), count, pSA->pvData, &count))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); SafeArrayDestroy(pSA); VariantInit(var_result); @@ -703,7 +703,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(SafeArrayRedim(pSA, rgsabound))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); SafeArrayDestroy(pSA); VariantInit(var_result); @@ -718,7 +718,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr = C_ENUMVARIANT_VT(obj)->Reset(C_ENUMVARIANT(obj)))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); return FAILURE; } @@ -740,13 +740,13 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** break; default: - php_error(E_WARNING,"Wrong argument count to IEnumVariant::Skip()\n"); + php_error(E_WARNING, "Wrong argument count to IEnumVariant::Skip()\n"); return FAILURE; } if(FAILED(hr = C_ENUMVARIANT_VT(obj)->Skip(C_ENUMVARIANT(obj), count))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); return FAILURE; } @@ -762,7 +762,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to lookup %s: %s\n", Z_STRVAL_P(function_name), error_message); + php_error(E_WARNING, "Unable to lookup %s: %s\n", Z_STRVAL_P(function_name), error_message); LocalFree(error_message); efree(funcname); return FAILURE; @@ -789,7 +789,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Invoke() failed: %s\n", error_message); + php_error(E_WARNING, "Invoke() failed: %s\n", error_message); LocalFree(error_message); return FAILURE; } @@ -827,7 +827,7 @@ PHP_FUNCTION(com_invoke) obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_STRVAL_P(function_name)); + php_error(E_WARNING, "%d is not a COM object handler", Z_STRVAL_P(function_name)); RETURN_FALSE; } @@ -868,7 +868,7 @@ PHP_FUNCTION(com_release) obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler"); + php_error(E_WARNING, "%d is not a COM object handler"); RETURN_FALSE; } @@ -900,7 +900,7 @@ PHP_FUNCTION(com_addref) obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler"); + php_error(E_WARNING, "%d is not a COM object handler"); RETURN_FALSE; } @@ -941,7 +941,7 @@ static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); + php_error(E_WARNING, "Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); LocalFree(error_message); efree(propname); if(cleanup) @@ -959,7 +959,7 @@ static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"PropGet() failed: %s\n", error_message); + php_error(E_WARNING, "PropGet() failed: %s\n", error_message); LocalFree(error_message); efree(propname); if(cleanup) @@ -1000,7 +1000,7 @@ static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); + php_error(E_WARNING, "Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); LocalFree(error_message); efree(propname); RETURN_FALSE; @@ -1017,7 +1017,7 @@ static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"PropPut() failed: %s\n", error_message); + php_error(E_WARNING, "PropPut() failed: %s\n", error_message); LocalFree(error_message); efree(propname); RETURN_FALSE; @@ -1062,7 +1062,7 @@ PHP_FUNCTION(com_propget) obj = (comval *)zend_list_find(Z_LVAL_P(arg_comval), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_LVAL_P(arg_comval)); + php_error(E_WARNING, "%d is not a COM object handler", Z_LVAL_P(arg_comval)); } convert_to_string_ex(&arg_property); @@ -1094,7 +1094,7 @@ PHP_FUNCTION(com_propput) obj = (comval *)zend_list_find(Z_LVAL_P(arg_comval), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_LVAL_P(arg_comval)); + php_error(E_WARNING, "%d is not a COM object handler", Z_LVAL_P(arg_comval)); } convert_to_string_ex(&arg_property); @@ -1483,7 +1483,7 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode) /* at each version for a string match to the */ /* supplied argument */ - if(ERROR_SUCCESS != RegOpenKey(HKEY_CLASSES_ROOT, "TypeLib",&hkey)) + if(ERROR_SUCCESS != RegOpenKey(HKEY_CLASSES_ROOT, "TypeLib", &hkey)) { /* This is pretty bad - better bail */ return NULL; @@ -1634,7 +1634,7 @@ static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC) /* Check to see if they are the same */ if (!compare_function(&results, &c.value, &exists TSRMLS_CC) && INI_INT("com.autoregister_verbose")) { - php_error(E_WARNING,"Type library value %s is already defined and has a different value", c.name); + php_error(E_WARNING, "Type library value %s is already defined and has a different value", c.name); } free(ids); j++; @@ -1678,7 +1678,7 @@ PHP_FUNCTION(com_isenum) obj = (comval *) zend_list_find(Z_LVAL_PP(comval_handle), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%s is not a COM object handler", ""); + php_error(E_WARNING, "%s is not a COM object handler", ""); RETURN_FALSE; } diff --git a/ext/com/conversion.c b/ext/com/conversion.c index 8f7e80a9c6..cd05ccdb23 100644 --- a/ext/com/conversion.c +++ b/ext/com/conversion.c @@ -141,7 +141,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c if(NULL == safeArray) { - php_error( E_WARNING,"Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)"); + php_error( E_WARNING, "Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)"); ZVAL_FALSE(pval_arg); } else @@ -171,7 +171,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c } else { - php_error( E_WARNING,"phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i); + php_error( E_WARNING, "phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i); } } zend_hash_move_forward(ht); @@ -180,7 +180,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c } else { - php_error( E_WARNING,"phpArrayToSafeArray() - Unable to lock safeArray"); + php_error( E_WARNING, "phpArrayToSafeArray() - Unable to lock safeArray"); } } } @@ -488,7 +488,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, /* For now just validate that the SafeArray has one dimension */ if (1 != (Dims = SafeArrayGetDim(array))) { - php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims); + php_error(E_WARNING, "Unsupported: multi-dimensional (%d) SafeArrays", Dims); ZVAL_NULL(pval_arg); return FAILURE; } @@ -740,7 +740,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, char *error_message; error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to obtain IDispatch interface: %s", error_message); + php_error(E_WARNING, "Unable to obtain IDispatch interface: %s", error_message); LocalFree(error_message); V_DISPATCH(var_arg) = NULL; @@ -822,7 +822,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, break; default: - php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg)); + php_error(E_WARNING, "Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg)); ZVAL_NULL(pval_arg); ret = FAILURE; break; @@ -852,10 +852,10 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage) switch(GetLastError()) { case ERROR_NO_UNICODE_TRANSLATION: - php_error(E_WARNING,"No unicode translation available for the specified string"); + php_error(E_WARNING, "No unicode translation available for the specified string"); break; default: - php_error(E_WARNING,"Error in php_char_to_OLECHAR()"); + php_error(E_WARNING, "Error in php_char_to_OLECHAR()"); } } @@ -882,7 +882,7 @@ PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int per C_str = (char *) pemalloc(sizeof(char), persistent); *C_str = 0; - php_error(E_WARNING,"Error in php_OLECHAR_to_char()"); + php_error(E_WARNING, "Error in php_OLECHAR_to_char()"); } if(out_length) diff --git a/ext/cpdf/cpdf.c b/ext/cpdf/cpdf.c index 3543f72c0f..9bb9aef50c 100644 --- a/ext/cpdf/cpdf.c +++ b/ext/cpdf/cpdf.c @@ -251,9 +251,9 @@ PHP_FUNCTION(cpdf_set_creator) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d (type=%d)",id, type); + php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); RETURN_FALSE; } @@ -278,9 +278,9 @@ PHP_FUNCTION(cpdf_set_title) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d (type=%d)",id, type); + php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); RETURN_FALSE; } @@ -306,9 +306,9 @@ PHP_FUNCTION(cpdf_set_subject) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d (type=%d)",id, type); + php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); RETURN_FALSE; } @@ -333,9 +333,9 @@ PHP_FUNCTION(cpdf_set_keywords) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d (type=%d)",id, type); + php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); RETURN_FALSE; } @@ -366,9 +366,9 @@ PHP_FUNCTION(cpdf_set_viewer_preferences) id = Z_LVAL_P (arg1); - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -462,7 +462,7 @@ PHP_FUNCTION(cpdf_open) convert_to_string(arg2); #if APACHE if(strcmp(arg2->value.str.val, "-") == 0) - php_error(E_WARNING,"Writing to stdout as described in the ClibPDF manual is not possible if php is used as an Apache module. Write to a memory stream and use cpdf_output_buffer() instead."); + php_error(E_WARNING, "Writing to stdout as described in the ClibPDF manual is not possible if php is used as an Apache module. Write to a memory stream and use cpdf_output_buffer() instead."); #endif cpdf_setOutputFilename(cpdf, arg2->value.str.val); } @@ -487,9 +487,9 @@ PHP_FUNCTION(cpdf_close) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } zend_list_delete(id); @@ -525,9 +525,9 @@ PHP_FUNCTION(cpdf_page_init) orientation=argv[2]->value.lval; height = argv[3]->value.lval; width = argv[4]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -560,9 +560,9 @@ PHP_FUNCTION(cpdf_finalize_page) convert_to_long(arg2); id=arg1->value.lval; pagenr=arg2->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -588,9 +588,9 @@ PHP_FUNCTION(cpdf_set_current_page) convert_to_long(arg2); id=arg1->value.lval; pagenr=arg2->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -614,9 +614,9 @@ PHP_FUNCTION(cpdf_begin_text) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -640,9 +640,9 @@ PHP_FUNCTION(cpdf_end_text) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -667,9 +667,9 @@ PHP_FUNCTION(cpdf_show) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -698,9 +698,9 @@ PHP_FUNCTION(cpdf_show_xy) convert_to_double(argv[2]); convert_to_double(argv[3]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -732,9 +732,9 @@ PHP_FUNCTION(cpdf_continue_text) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -759,9 +759,9 @@ PHP_FUNCTION(cpdf_text) convert_to_long(argv[0]); convert_to_string(argv[1]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -851,14 +851,14 @@ PHP_FUNCTION(cpdf_set_font) convert_to_double(arg3); convert_to_string(arg4); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } /* if(arg4->value.lval > 6) { - php_error(E_WARNING,"Font encoding set to 5"); + php_error(E_WARNING, "Font encoding set to 5"); arg4->value.lval = 5; } */ @@ -884,9 +884,9 @@ PHP_FUNCTION(cpdf_set_font_directories) convert_to_string(arg2); convert_to_string(arg3); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -911,9 +911,9 @@ PHP_FUNCTION(cpdf_set_font_map_file) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -938,9 +938,9 @@ PHP_FUNCTION(cpdf_set_leading) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -965,9 +965,9 @@ PHP_FUNCTION(cpdf_set_text_rendering) convert_to_long(arg1); convert_to_long(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -992,9 +992,9 @@ PHP_FUNCTION(cpdf_set_horiz_scaling) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1019,9 +1019,9 @@ PHP_FUNCTION(cpdf_set_text_rise) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1050,14 +1050,14 @@ PHP_FUNCTION(cpdf_set_text_matrix) convert_to_array(arg2); id=arg1->value.lval; matrix=arg2->value.ht; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } if(zend_hash_num_elements(matrix) != 6) { - php_error(E_WARNING,"Text matrix must have 6 elements"); + php_error(E_WARNING, "Text matrix must have 6 elements"); RETURN_FALSE; } @@ -1102,9 +1102,9 @@ PHP_FUNCTION(cpdf_set_text_pos) convert_to_double(argv[1]); convert_to_double(argv[2]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1136,9 +1136,9 @@ PHP_FUNCTION(cpdf_rotate_text) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1163,9 +1163,9 @@ PHP_FUNCTION(cpdf_set_char_spacing) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1190,9 +1190,9 @@ PHP_FUNCTION(cpdf_set_word_spacing) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1218,9 +1218,9 @@ PHP_FUNCTION(cpdf_stringwidth) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1244,9 +1244,9 @@ PHP_FUNCTION(cpdf_save) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1270,9 +1270,9 @@ PHP_FUNCTION(cpdf_restore) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1298,9 +1298,9 @@ PHP_FUNCTION(cpdf_translate) convert_to_double(arg2); convert_to_double(arg3); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1326,9 +1326,9 @@ PHP_FUNCTION(cpdf_scale) convert_to_double(arg2); convert_to_double(arg3); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1353,9 +1353,9 @@ PHP_FUNCTION(cpdf_rotate) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1380,14 +1380,14 @@ PHP_FUNCTION(cpdf_setflat) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } if((arg2->value.lval > 100) && (arg2->value.lval < 0)) { - php_error(E_WARNING,"Parameter of pdf_setflat() has to between 0 and 100"); + php_error(E_WARNING, "Parameter of pdf_setflat() has to between 0 and 100"); RETURN_FALSE; } @@ -1412,14 +1412,14 @@ PHP_FUNCTION(cpdf_setlinejoin) convert_to_long(arg1); convert_to_long(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } if((arg2->value.lval > 2) && (arg2->value.lval < 0)) { - php_error(E_WARNING,"Parameter of pdf_setlinejoin() has to between 0 and 2"); + php_error(E_WARNING, "Parameter of pdf_setlinejoin() has to between 0 and 2"); RETURN_FALSE; } @@ -1444,14 +1444,14 @@ PHP_FUNCTION(cpdf_setlinecap) convert_to_long(arg1); convert_to_long(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } if((arg2->value.lval > 2) && (arg2->value.lval < 0)) { - php_error(E_WARNING,"Parameter of pdf_setlinecap() has to be > 0 and =< 2"); + php_error(E_WARNING, "Parameter of pdf_setlinecap() has to be > 0 and =< 2"); RETURN_FALSE; } @@ -1476,14 +1476,14 @@ PHP_FUNCTION(cpdf_setmiterlimit) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } if(arg2->value.dval < 1) { - php_error(E_WARNING,"Parameter of pdf_setmiterlimit() has to be >= 1"); + php_error(E_WARNING, "Parameter of pdf_setmiterlimit() has to be >= 1"); RETURN_FALSE; } @@ -1508,9 +1508,9 @@ PHP_FUNCTION(cpdf_setlinewidth) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1538,9 +1538,9 @@ PHP_FUNCTION(cpdf_setdash) convert_to_long(arg2); convert_to_long(arg3); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1570,9 +1570,9 @@ PHP_FUNCTION(cpdf_moveto) convert_to_double(argv[1]); convert_to_double(argv[2]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1607,9 +1607,9 @@ PHP_FUNCTION(cpdf_rmoveto) convert_to_double(argv[1]); convert_to_double(argv[2]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1648,9 +1648,9 @@ PHP_FUNCTION(cpdf_curveto) convert_to_double(argv[5]); convert_to_double(argv[6]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1695,9 +1695,9 @@ PHP_FUNCTION(cpdf_lineto) convert_to_double(argv[1]); convert_to_double(argv[2]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1732,9 +1732,9 @@ PHP_FUNCTION(cpdf_rlineto) convert_to_double(argv[1]); convert_to_double(argv[2]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1770,9 +1770,9 @@ PHP_FUNCTION(cpdf_circle) convert_to_double(argv[2]); convert_to_double(argv[3]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1810,9 +1810,9 @@ PHP_FUNCTION(cpdf_arc) convert_to_double(argv[4]); convert_to_double(argv[5]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1849,9 +1849,9 @@ PHP_FUNCTION(cpdf_rect) convert_to_double(argv[3]); convert_to_double(argv[4]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1888,9 +1888,9 @@ PHP_FUNCTION(cpdf_newpath) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1914,9 +1914,9 @@ PHP_FUNCTION(cpdf_closepath) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1940,9 +1940,9 @@ PHP_FUNCTION(cpdf_closepath_stroke) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1967,9 +1967,9 @@ PHP_FUNCTION(cpdf_stroke) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -1993,9 +1993,9 @@ PHP_FUNCTION(cpdf_fill) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2019,9 +2019,9 @@ PHP_FUNCTION(cpdf_fill_stroke) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2046,9 +2046,9 @@ PHP_FUNCTION(cpdf_closepath_fill_stroke) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2074,9 +2074,9 @@ PHP_FUNCTION(cpdf_clip) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2101,9 +2101,9 @@ PHP_FUNCTION(cpdf_setgray_fill) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2128,9 +2128,9 @@ PHP_FUNCTION(cpdf_setgray_stroke) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2155,9 +2155,9 @@ PHP_FUNCTION(cpdf_setgray) convert_to_long(arg1); convert_to_double(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2184,9 +2184,9 @@ PHP_FUNCTION(cpdf_setrgbcolor_fill) convert_to_double(arg3); convert_to_double(arg4); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2213,9 +2213,9 @@ PHP_FUNCTION(cpdf_setrgbcolor_stroke) convert_to_double(arg3); convert_to_double(arg4); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2242,9 +2242,9 @@ PHP_FUNCTION(cpdf_setrgbcolor) convert_to_double(arg3); convert_to_double(arg4); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2273,9 +2273,9 @@ PHP_FUNCTION(cpdf_set_page_animation) convert_to_long(arg5); convert_to_long(arg6); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2300,9 +2300,9 @@ PHP_FUNCTION(cpdf_finalize) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2327,9 +2327,9 @@ PHP_FUNCTION(cpdf_output_buffer) convert_to_long(arg1); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2356,15 +2356,15 @@ PHP_FUNCTION(cpdf_save_to_file) convert_to_long(arg1); convert_to_string(arg2); id=arg1->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } #if APACHE if(strcmp(arg2->value.str.val, "-") == 0) - php_error(E_WARNING,"Writing to stdout as described in the ClibPDF manual is not possible if php is used as an Apache module. Use cpdf_output_buffer() instead."); + php_error(E_WARNING, "Writing to stdout as described in the ClibPDF manual is not possible if php is used as an Apache module. Use cpdf_output_buffer() instead."); #endif cpdf_savePDFmemoryStreamToFile(pdf, arg2->value.str.val); @@ -2403,9 +2403,9 @@ PHP_FUNCTION(cpdf_import_jpeg) yscale = (float) argv[8]->value.dval; convert_to_long(argv[9]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2467,16 +2467,16 @@ PHP_FUNCTION(cpdf_place_inline_image) convert_to_double(argv[6]); convert_to_long(argv[7]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } gid=argv[1]->value.lval; im = zend_list_find(gid, &type); - ZEND_GET_RESOURCE_TYPE_ID(CPDF_GLOBAL(le_gd),"gd"); + ZEND_GET_RESOURCE_TYPE_ID(CPDF_GLOBAL(le_gd), "gd"); if(!CPDF_GLOBAL(le_gd)) { php_error(E_ERROR, "Unable to find handle for GD image stream. Please check the GD extension is loaded."); @@ -2556,9 +2556,9 @@ PHP_FUNCTION(cpdf_add_annotation) convert_to_string(argv[5]); convert_to_string(argv[6]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2615,9 +2615,9 @@ PHP_FUNCTION(cpdf_set_action_url) convert_to_double(argv[4]); convert_to_string(argv[5]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } @@ -2672,17 +2672,17 @@ PHP_FUNCTION(cpdf_add_outline) convert_to_long(argv[4]); convert_to_string(argv[5]); id=argv[0]->value.lval; - pdf = zend_list_find(id,&type); + pdf = zend_list_find(id, &type); if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING,"Unable to find identifier %d",id); + php_error(E_WARNING, "Unable to find identifier %d", id); RETURN_FALSE; } oid=argv[1]->value.lval; - lastoutline = zend_list_find(oid,&type); + lastoutline = zend_list_find(oid, &type); if(!lastoutline || type!=CPDF_GLOBAL(le_outline)) { lastoutline = NULL; -/* php_error(E_WARNING,"Unable to find last outline entry %d",id); +/* php_error(E_WARNING, "Unable to find last outline entry %d", id); RETURN_FALSE; */ } @@ -2693,7 +2693,7 @@ PHP_FUNCTION(cpdf_add_outline) argv[5]->value.str.val, 1, 0.0, 0.0, 0.0, 0.0); - id = zend_list_insert(lastoutline,CPDF_GLOBAL(le_outline)); + id = zend_list_insert(lastoutline, CPDF_GLOBAL(le_outline)); RETURN_LONG(id); } /* }}} */ diff --git a/ext/crack/crack.c b/ext/crack/crack.c index 990ad2933c..fbadc257df 100644 --- a/ext/crack/crack.c +++ b/ext/crack/crack.c @@ -45,11 +45,11 @@ function_entry crack_functions[] = { zend_module_entry crack_module_entry = { "crack", crack_functions, - ZEND_MINIT(crack), - ZEND_MSHUTDOWN(crack), - ZEND_RINIT(crack), - ZEND_RSHUTDOWN(crack), - PHP_MINFO(crack), + ZEND_MODULE_STARTUP_N(crack), + ZEND_MODULE_SHUTDOWN_N(crack), + ZEND_MODULE_ACTIVATE_N(crack), + ZEND_MODULE_DEACTIVATE_N(crack), + ZEND_MODULE_INFO_N(crack), STANDARD_MODULE_PROPERTIES }; @@ -91,7 +91,7 @@ void _close_crack_dict(PWDICT *pwdict) PWClose(pwdict); } -ZEND_MINIT_FUNCTION(crack) +ZEND_MODULE_STARTUP_D(crack) { REGISTER_INI_ENTRIES(); @@ -100,13 +100,13 @@ ZEND_MINIT_FUNCTION(crack) return SUCCESS; } -ZEND_MSHUTDOWN_FUNCTION(crack) +ZEND_MODULE_SHUTDOWN_D(crack) { UNREGISTER_INI_ENTRIES(); return SUCCESS; } -ZEND_RINIT_FUNCTION(crack) +ZEND_MODULE_ACTIVATE_D(crack) { CRACKG(last_message) = NULL; CRACKG(current_id) = -1; @@ -114,7 +114,7 @@ ZEND_RINIT_FUNCTION(crack) return SUCCESS; } -ZEND_RSHUTDOWN_FUNCTION(crack) +ZEND_MODULE_DEACTIVATE_D(crack) { if (NULL != CRACKG(last_message)) { efree(CRACKG(last_message)); @@ -122,7 +122,7 @@ ZEND_RSHUTDOWN_FUNCTION(crack) return SUCCESS; } -PHP_MINFO_FUNCTION(crack) +ZEND_MODULE_INFO_D(crack) { php_info_print_table_start(); php_info_print_table_header(2, "crack support", "enabled"); @@ -185,7 +185,7 @@ ZEND_FUNCTION(crack_closedict) } /* }}} */ -/* {{{ proto string crack_check([int dictionary,] string password) +/* {{{ proto string crack_check([int dictionary, ] string password) Performs an obscure check with the given password */ ZEND_FUNCTION(crack_check) { diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index 6528b9411c..d556160178 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -78,7 +78,7 @@ ZEND_GET_MODULE(ctype) #endif #ifndef PHP_EXPERIMENTAL -#define PHP_EXPERIMENTAL(x,y) +#define PHP_EXPERIMENTAL(x, y) #endif /* {{{ PHP_MINFO_FUNCTION @@ -93,7 +93,7 @@ PHP_MINFO_FUNCTION(ctype) /* {{{ ctype */ -static int ctype(int (*iswhat)(int),zval **c) +static int ctype(int (*iswhat)(int), zval **c) { switch ((*c)->type) { case IS_LONG: @@ -101,7 +101,7 @@ static int ctype(int (*iswhat)(int),zval **c) case IS_STRING: { char *p; - int n,len; + int n, len; convert_to_string_ex(c); p=(*c)->value.str.val; len = (*c)->value.str.len; @@ -121,13 +121,13 @@ static int ctype(int (*iswhat)(int),zval **c) Check for alphanumeric character(s) */ PHP_FUNCTION(ctype_alnum) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isalnum,c)) { + if(ctype(isalnum, c)) { RETURN_TRUE; } @@ -139,13 +139,13 @@ PHP_FUNCTION(ctype_alnum) Check for alphabetic character(s) */ PHP_FUNCTION(ctype_alpha) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isalpha,c)) { + if(ctype(isalpha, c)) { RETURN_TRUE; } @@ -157,13 +157,13 @@ PHP_FUNCTION(ctype_alpha) Check for control character(s) */ PHP_FUNCTION(ctype_cntrl) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(iscntrl,c)) { + if(ctype(iscntrl, c)) { RETURN_TRUE; } @@ -175,13 +175,13 @@ PHP_FUNCTION(ctype_cntrl) Check for numeric character(s) */ PHP_FUNCTION(ctype_digit) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isdigit,c)) { + if(ctype(isdigit, c)) { RETURN_TRUE; } @@ -193,13 +193,13 @@ PHP_FUNCTION(ctype_digit) Check for lowercase character(s) */ PHP_FUNCTION(ctype_lower) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(islower,c)) { + if(ctype(islower, c)) { RETURN_TRUE; } @@ -211,13 +211,13 @@ PHP_FUNCTION(ctype_lower) Check for any printable character(s) except space */ PHP_FUNCTION(ctype_graph) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isgraph,c)) { + if(ctype(isgraph, c)) { RETURN_TRUE; } @@ -229,13 +229,13 @@ PHP_FUNCTION(ctype_graph) Check for printable character(s) */ PHP_FUNCTION(ctype_print) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isprint,c)) { + if(ctype(isprint, c)) { RETURN_TRUE; } @@ -247,13 +247,13 @@ PHP_FUNCTION(ctype_print) Check for any printable character which is not whitespace or an alphanumeric character */ PHP_FUNCTION(ctype_punct) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(ispunct,c)) { + if(ctype(ispunct, c)) { RETURN_TRUE; } @@ -265,13 +265,13 @@ PHP_FUNCTION(ctype_punct) Check for whitespace character(s)*/ PHP_FUNCTION(ctype_space) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isspace,c)) { + if(ctype(isspace, c)) { RETURN_TRUE; } @@ -283,13 +283,13 @@ PHP_FUNCTION(ctype_space) Check for uppercase character(s) */ PHP_FUNCTION(ctype_upper) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isupper,c)) { + if(ctype(isupper, c)) { RETURN_TRUE; } @@ -301,13 +301,13 @@ PHP_FUNCTION(ctype_upper) Check for character(s) representing a hexadecimal digit */ PHP_FUNCTION(ctype_xdigit) { - PHP_EXPERIMENTAL("4.0.4dev",NULL) + PHP_EXPERIMENTAL("4.0.4dev", NULL) zval **c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){ WRONG_PARAM_COUNT; } - if(ctype(isxdigit,c)) { + if(ctype(isxdigit, c)) { RETURN_TRUE; } diff --git a/ext/cybercash/cybercash.c b/ext/cybercash/cybercash.c index 8ec8392f93..30393c3a93 100644 --- a/ext/cybercash/cybercash.c +++ b/ext/cybercash/cybercash.c @@ -111,8 +111,8 @@ PHP_FUNCTION(cybercash_encr) if (!errcode) { add_assoc_stringl(return_value, "outbuff", outbuff, outLth, 0); - add_assoc_long(return_value,"outLth",outLth); - add_assoc_stringl(return_value,"macbuff",macbuff,20,0); + add_assoc_long(return_value,"outLth", outLth); + add_assoc_stringl(return_value,"macbuff", macbuff, 20, 0); } else { efree(outbuff); efree(macbuff); @@ -124,7 +124,7 @@ PHP_FUNCTION(cybercash_encr) Cybercash decrypt */ PHP_FUNCTION(cybercash_decr) { - zval **wmk,**sk,**inbuff; + zval **wmk, **sk, **inbuff; unsigned char *outbuff, *macbuff; unsigned int outAlloc, outLth; long errcode; diff --git a/ext/cybermut/cybermut.c b/ext/cybermut/cybermut.c index f05ef9420f..ab23da0bb8 100644 --- a/ext/cybermut/cybermut.c +++ b/ext/cybermut/cybermut.c @@ -169,7 +169,7 @@ PHP_FUNCTION(cybermut_creerreponsecm) CreerReponseCM( Z_STRVAL_PP(phrase), buf); - RETURN_STRING (buf,1); + RETURN_STRING (buf, 1); } /* }}} */ diff --git a/ext/db/db.c b/ext/db/db.c index 9d2f8c10bc..4ef741738f 100644 --- a/ext/db/db.c +++ b/ext/db/db.c @@ -210,28 +210,28 @@ static char *php_get_info_db(void) temp[0]='\0'; #ifdef DB_VERSION_STRING /* using sleepycat dbm */ - strcat(temp,DB_VERSION_STRING); + strcat(temp, DB_VERSION_STRING); #endif #if GDBM - sprintf(temp1,"%s",gdbm_version); - strcat(temp,temp1); + sprintf(temp1, "%s", gdbm_version); + strcat(temp, temp1); #endif #if NDBM && !GDBM - strcat(temp,"ndbm support enabled"); + strcat(temp, "ndbm support enabled"); #endif #if !GDBM && !NDBM - strcat(temp,"flat file support enabled"); + strcat(temp, "flat file support enabled"); #endif #if NFS_HACK - strcat(temp,"NFS hack in effect"); + strcat(temp, "NFS hack in effect"); #endif if (!*temp) - strcat(temp,"No database support"); + strcat(temp, "No database support"); return temp; } @@ -253,7 +253,7 @@ PHP_MINFO_FUNCTION(db) PHP_FUNCTION(dblist) { char *str = php_get_info_db(); - RETURN_STRING(str,1); + RETURN_STRING(str, 1); } /* }}} */ @@ -265,7 +265,7 @@ PHP_FUNCTION(dbmopen) dbm_info *info=NULL; int ret; - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters(ht,2,&filename,&mode)==FAILURE) { + if (ZEND_NUM_ARGS()!=2 || zend_get_parameters(ht, 2, &filename, &mode)==FAILURE) { WRONG_PARAM_COUNT; } @@ -336,16 +336,16 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) strcat(lockfn, ".lck"); #if NFS_HACK - while((last_try = VCWD_STAT(lockfn,&sb))==0) { + while((last_try = VCWD_STAT(lockfn, &sb))==0) { retries++; php_sleep(1); if (retries>30) break; } if (last_try!=0) { - lockfd = open(lockfn,O_RDWR|O_CREAT,0644); + lockfd = open(lockfn, O_RDWR|O_CREAT, 0644); close(lockfd); } else { - php_error(E_WARNING, "File appears to be locked [%s]\n",lockfn); + php_error(E_WARNING, "File appears to be locked [%s]\n", lockfn); return -1; } #else /* NFS_HACK */ @@ -353,10 +353,10 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) lockfd = VCWD_OPEN_MODE(lockfn, O_RDWR|O_CREAT, 0644); if (lockfd) { - flock(lockfd,LOCK_EX); + flock(lockfd, LOCK_EX); close(lockfd); } else { - php_error(E_WARNING, "Unable to establish lock: %s",filename); + php_error(E_WARNING, "Unable to establish lock: %s", filename); } #endif /* else NFS_HACK */ @@ -385,7 +385,7 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) return info; } else { #if GDBM - php_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]",filename,gdbm_errno,gdbm_strerror(gdbm_errno),errno,strerror(errno)); + php_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]", filename, gdbm_errno, gdbm_strerror(gdbm_errno), errno, strerror(errno)); if (gdbm_errno) ret = gdbm_errno; else if (errno) @@ -395,13 +395,13 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) #else #if NDBM #if PHP_DEBUG - php_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n",filename,errno,strerror(errno)); + php_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n", filename, errno, strerror(errno)); #endif if (errno) ret=errno; else ret = -1; #else #if PHP_DEBUG - php_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n",filename,errno,strerror(errno)); + php_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n", filename, errno, strerror(errno)); #endif if (errno) ret=errno; else ret = -1; @@ -426,7 +426,7 @@ PHP_FUNCTION(dbmclose) { pval *id; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters(ht,1,&id)==FAILURE) { + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters(ht, 1, &id)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(id); @@ -455,7 +455,7 @@ int php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) #else if (info->lockfn) { lockfd = VCWD_OPEN_MODE(info->lockfn, O_RDWR, 0644); - flock(lockfd,LOCK_UN); + flock(lockfd, LOCK_UN); close(lockfd); } #endif @@ -485,7 +485,7 @@ PHP_FUNCTION(dbminsert) dbm_info *info; int ret; - if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht,3,&id,&key,&value) == FAILURE) { + if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht, 3, &id, &key, &value) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); @@ -545,7 +545,7 @@ PHP_FUNCTION(dbmreplace) dbm_info *info; int ret; - if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht,3,&id,&key,&value) == FAILURE) { + if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht, 3, &id, &key, &value) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); @@ -607,7 +607,7 @@ PHP_FUNCTION(dbmfetch) dbm_info *info; char *ret; - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht,2,&id,&key)==FAILURE) { + if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); @@ -683,7 +683,7 @@ PHP_FUNCTION(dbmexists) dbm_info *info; int ret; - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht,2,&id,&key)==FAILURE) { + if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); @@ -732,7 +732,7 @@ PHP_FUNCTION(dbmdelete) dbm_info *info; int ret; - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht,2,&id,&key)==FAILURE) { + if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); @@ -780,7 +780,7 @@ PHP_FUNCTION(dbmfirstkey) dbm_info *info; char *ret; - if (ZEND_NUM_ARGS()!=1||zend_get_parameters(ht,1,&id)==FAILURE) { + if (ZEND_NUM_ARGS()!=1||zend_get_parameters(ht, 1, &id)==FAILURE) { WRONG_PARAM_COUNT; } @@ -841,7 +841,7 @@ PHP_FUNCTION(dbmnextkey) dbm_info *info; char *ret; - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht,2,&id,&key)==FAILURE) { + if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); @@ -920,20 +920,20 @@ int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) { if (flatfile_findkey(dbf, key_datum)) { return 1; } - fseek(dbf,0L,SEEK_END); - fprintf(dbf,"%d\n",key_datum.dsize); + fseek(dbf, 0L, SEEK_END); + fprintf(dbf, "%d\n", key_datum.dsize); fflush(dbf); - ret = write(fileno(dbf),key_datum.dptr,key_datum.dsize); - fprintf(dbf,"%d\n",value_datum.dsize); + ret = write(fileno(dbf), key_datum.dptr, key_datum.dsize); + fprintf(dbf, "%d\n", value_datum.dsize); fflush(dbf); - ret = write(fileno(dbf),value_datum.dptr,value_datum.dsize); + ret = write(fileno(dbf), value_datum.dptr, value_datum.dsize); } else { /* DBM_REPLACE */ - flatfile_delete(dbf,key_datum); - fprintf(dbf,"%d\n",key_datum.dsize); + flatfile_delete(dbf, key_datum); + fprintf(dbf, "%d\n", key_datum.dsize); fflush(dbf); - ret = write(fileno(dbf),key_datum.dptr,key_datum.dsize); - fprintf(dbf,"%d\n",value_datum.dsize); - ret = write(fileno(dbf),value_datum.dptr,value_datum.dsize); + ret = write(fileno(dbf), key_datum.dptr, key_datum.dsize); + fprintf(dbf, "%d\n", value_datum.dsize); + ret = write(fileno(dbf), value_datum.dptr, value_datum.dsize); } if (ret>0) @@ -949,7 +949,7 @@ datum flatfile_fetch(FILE *dbf, datum key_datum) { int num=0, buf_size=1024; char *buf; - if (flatfile_findkey(dbf,key_datum)) { + if (flatfile_findkey(dbf, key_datum)) { buf = emalloc((buf_size+1) * sizeof(char)); if (fgets(buf, 15, dbf)) { num = atoi(buf); @@ -957,7 +957,7 @@ datum flatfile_fetch(FILE *dbf, datum key_datum) { buf_size+=num; buf = emalloc((buf_size+1)*sizeof(char)); } - read(fileno(dbf),buf,num); + read(fileno(dbf), buf, num); value_datum.dptr = buf; value_datum.dsize = num; } @@ -1006,7 +1006,7 @@ int flatfile_delete(FILE *dbf, datum key_datum) { } /* read in the length of the value */ - if (!fgets(buf,15,dbf)) + if (!fgets(buf, 15, dbf)) break; num = atoi(buf); if (num > buf_size) { @@ -1037,7 +1037,7 @@ int flatfile_findkey(FILE *dbf, datum key_datum) { rewind(dbf); buf = emalloc((buf_size+1)*sizeof(char)); while (!feof(dbf)) { - if (!fgets(buf,15,dbf)) break; + if (!fgets(buf, 15, dbf)) break; num = atoi(buf); if (num > buf_size) { if (buf) efree(buf); @@ -1048,12 +1048,12 @@ int flatfile_findkey(FILE *dbf, datum key_datum) { if (num<0) break; *(buf+num) = '\0'; if (size == num) { - if (!memcmp(buf,key,size)) { + if (!memcmp(buf, key, size)) { ret = 1; break; } } - if (!fgets(buf,15,dbf)) + if (!fgets(buf, 15, dbf)) break; num = atoi(buf); if (num > buf_size) { @@ -1080,28 +1080,28 @@ datum flatfile_firstkey(FILE *dbf) { rewind(dbf); buf.dptr = emalloc((buf_size+1)*sizeof(char)); while(!feof(dbf)) { - if (!fgets(buf.dptr,15,dbf)) break; + if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } - num=read(fileno(dbf),buf.dptr,num); + num=read(fileno(dbf), buf.dptr, num); if (num<0) break; buf.dsize = num; if (*(buf.dptr)!=0) { CurrentFlatFilePos = ftell(dbf); return(buf); } - if (!fgets(buf.dptr,15,dbf)) break; + if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } - num=read(fileno(dbf),buf.dptr,num); + num=read(fileno(dbf), buf.dptr, num); if (num<0) break; } if (buf.dptr) efree(buf.dptr); @@ -1117,26 +1117,26 @@ datum flatfile_nextkey(FILE *dbf) { int num; int buf_size=1024; - fseek(dbf,CurrentFlatFilePos,SEEK_SET); + fseek(dbf, CurrentFlatFilePos, SEEK_SET); buf.dptr = emalloc((buf_size+1)*sizeof(char)); while(!feof(dbf)) { - if (!fgets(buf.dptr,15,dbf)) break; + if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } - num=read(fileno(dbf),buf.dptr,num); + num=read(fileno(dbf), buf.dptr, num); if (num<0) break; - if (!fgets(buf.dptr,15,dbf)) break; + if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } - num=read(fileno(dbf),buf.dptr,num); + num=read(fileno(dbf), buf.dptr, num); if (num<0) break; buf.dsize = num; if (*(buf.dptr)!=0) { @@ -1168,7 +1168,7 @@ PHP_MINIT_FUNCTION(db) } } PHP_MUTEX_UNLOCK(dbm_mutex); - if(!PHP3_TLS_THREAD_INIT(DbmTls,dbm_globals,dbm_global_struct)){ + if(!PHP3_TLS_THREAD_INIT(DbmTls, dbm_globals, dbm_global_struct)){ PHP_MUTEX_FREE(dbm_mutex); return FAILURE; } @@ -1223,7 +1223,7 @@ function_entry dbm_functions[] = { PHP_FE(dbmdelete, NULL) PHP_FE(dbmfirstkey, NULL) PHP_FE(dbmnextkey, NULL) - {NULL,NULL,NULL} + {NULL, NULL, NULL} }; /* }}} */ diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 542497c9be..08e533142c 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -51,7 +51,7 @@ function_entry dba_functions[] = { PHP_FE(dba_nextkey, NULL) PHP_FE(dba_optimize, NULL) PHP_FE(dba_sync, NULL) - {NULL,NULL,NULL} + {NULL, NULL, NULL} }; /* }}} */ @@ -299,7 +299,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) keylen = 0; for(i = 0; i < ac; i++) { - memcpy(key+keylen,Z_STRVAL_PP(args[i]),Z_STRLEN_PP(args[i])); + memcpy(key+keylen, Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i])); keylen += Z_STRLEN_PP(args[i]); } @@ -332,7 +332,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) modenr = DBA_TRUNC; break; default: - php_error(E_WARNING,"illegal DBA mode: %s",(*args[1])->value.str.val); + php_error(E_WARNING, "illegal DBA mode: %s", (*args[1])->value.str.val); FREENOW; RETURN_FALSE; } diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c index 8d3c49f886..02f863f9f6 100644 --- a/ext/dbase/dbase.c +++ b/ext/dbase/dbase.c @@ -75,7 +75,7 @@ PHP_MINIT_FUNCTION(dbase) #if defined(THREAD_SAFE) dbase_global_struct *dbase_globals; #ifdef COMPILE_DL_DBASE - CREATE_MUTEX(dbase_mutex,"DBase_TLS"); + CREATE_MUTEX(dbase_mutex, "DBase_TLS"); SET_MUTEX(dbase_mutex); numthreads++; if (numthreads==1){ @@ -123,7 +123,7 @@ PHP_FUNCTION(dbase_open) int handle; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 2 || getParameters(ht,2,&dbf_name,&options)==FAILURE) { + if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbf_name, &options)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(dbf_name); @@ -157,7 +157,7 @@ PHP_FUNCTION(dbase_close) int dbh_type; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 1 || getParameters(ht,1,&dbh_id)==FAILURE) { + if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -181,7 +181,7 @@ PHP_FUNCTION(dbase_numrecords) int dbh_type; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 1 || getParameters(ht,1,&dbh_id)==FAILURE) { + if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -204,7 +204,7 @@ PHP_FUNCTION(dbase_numfields) int dbh_type; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 1 || getParameters(ht,1,&dbh_id)==FAILURE) { + if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -227,7 +227,7 @@ PHP_FUNCTION(dbase_pack) int dbh_type; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 1 || getParameters(ht,1,&dbh_id)==FAILURE) { + if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -257,7 +257,7 @@ PHP_FUNCTION(dbase_add_record) int i; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 2 || getParameters(ht,2,&dbh_id,&fields)==FAILURE) { + if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &fields)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -331,7 +331,7 @@ PHP_FUNCTION(dbase_replace_record) int i; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 3 || getParameters(ht,3,&dbh_id,&fields,&recnum)==FAILURE) { + if (ZEND_NUM_ARGS() != 3 || getParameters(ht, 3, &dbh_id, &fields, &recnum)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -395,7 +395,7 @@ PHP_FUNCTION(dbase_delete_record) int dbh_type; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 2 || getParameters(ht,2,&dbh_id,&record)==FAILURE) { + if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &record)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -433,7 +433,7 @@ PHP_FUNCTION(dbase_get_record) size_t cursize = 0; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 2 || getParameters(ht,2,&dbh_id,&record)==FAILURE) { + if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &record)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -471,7 +471,7 @@ PHP_FUNCTION(dbase_get_record) switch (cur_f->db_type) { case 'C': case 'D': - add_next_index_string(return_value,str_value,1); + add_next_index_string(return_value, str_value, 1); break; case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ @@ -495,10 +495,10 @@ PHP_FUNCTION(dbase_get_record) /* mark whether this record was deleted */ if (data[0] == '*') { - add_assoc_long(return_value,"deleted",1); + add_assoc_long(return_value, "deleted", 1); } else { - add_assoc_long(return_value,"deleted",0); + add_assoc_long(return_value, "deleted", 0); } free(data); @@ -517,7 +517,7 @@ PHP_FUNCTION(dbase_get_record_with_names) char *data, *fnp, *str_value; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 2 || getParameters(ht,2,&dbh_id,&record)==FAILURE) { + if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &record)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(dbh_id); @@ -550,14 +550,14 @@ PHP_FUNCTION(dbase_get_record_with_names) switch (cur_f->db_type) { case 'C': case 'D': - add_assoc_string(return_value,cur_f->db_fname,str_value,1); + add_assoc_string(return_value, cur_f->db_fname, str_value, 1); break; case 'N': /* FALLS THROUGH */ case 'L': /* FALLS THROUGH */ if (cur_f->db_fdc == 0) { - add_assoc_long(return_value,cur_f->db_fname,strtol(str_value, NULL, 10)); + add_assoc_long(return_value, cur_f->db_fname, strtol(str_value, NULL, 10)); } else { - add_assoc_double(return_value,cur_f->db_fname,atof(str_value)); + add_assoc_double(return_value, cur_f->db_fname, atof(str_value)); } break; case 'M': @@ -573,9 +573,9 @@ PHP_FUNCTION(dbase_get_record_with_names) /* mark whether this record was deleted */ if (data[0] == '*') { - add_assoc_long(return_value,"deleted",1); + add_assoc_long(return_value, "deleted", 1); } else { - add_assoc_long(return_value,"deleted",0); + add_assoc_long(return_value, "deleted", 0); } free(data); @@ -595,7 +595,7 @@ PHP_FUNCTION(dbase_create) int i, rlen, handle; DBase_TLS_VARS; - if (ZEND_NUM_ARGS() != 2 || getParameters(ht,2,&filename,&fields)==FAILURE) { + if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &filename, &fields)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(filename); @@ -682,7 +682,7 @@ PHP_FUNCTION(dbase_create) copy_crimp(cur_f->db_fname, (*value)->value.str.val, (*value)->value.str.len); /* field type */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 1,(void **)&value) == FAILURE) { + if (zend_hash_index_find(Z_ARRVAL_PP (field), 1, (void **)&value) == FAILURE) { php_error(E_WARNING, "expected field type as sececond element of list in field %d", i); RETURN_FALSE; } @@ -707,7 +707,7 @@ PHP_FUNCTION(dbase_create) case 'N': case 'C': /* field length */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 2,(void **)&value) == FAILURE) { + if (zend_hash_index_find(Z_ARRVAL_PP (field), 2, (void **)&value) == FAILURE) { php_error(E_WARNING, "expected field length as third element of list in field %d", i); free_dbf_head(dbh); RETURN_FALSE; diff --git a/ext/dbplus/dbplus.c b/ext/dbplus/dbplus.c index fc136bb84f..8bbd352fc3 100644 --- a/ext/dbplus/dbplus.c +++ b/ext/dbplus/dbplus.c @@ -208,13 +208,13 @@ PHP_FUNCTION(dbplus_open) convert_to_long_ex(writing); convert_to_long_ex(searchpath); - conn = cdb_open((*name)->value.str.val,(*writing)->value.lval,(*searchpath)->value.lval); + conn = cdb_open((*name)->value.str.val, (*writing)->value.lval, (*searchpath)->value.lval); if(conn == NULL) { /* TODO error handling */ RETURN_FALSE; } - ZEND_REGISTER_RESOURCE(return_value,conn,le_dbplus); + ZEND_REGISTER_RESOURCE(return_value, conn, le_dbplus); } /* }}} */ diff --git a/ext/dbplus/php_dbplus.c b/ext/dbplus/php_dbplus.c index b850f11123..8dfd4885ef 100644 --- a/ext/dbplus/php_dbplus.c +++ b/ext/dbplus/php_dbplus.c @@ -26,8 +26,8 @@ #define _INT(x) ((*x)->value.lval) #define _HASH(x) ((*x)->value.ht) -#define DBPLUS_FETCH_RESOURCE(r,z) ZEND_FETCH_RESOURCE(r, relf *, z, -1, "dbplus_relation", le_dbplus_relation); \ - if(!r) RETURN_LONG(ERR_UNKNOWN); +#define DBPLUS_FETCH_RESOURCE(r, z) ZEND_FETCH_RESOURCE(r, relf *, z, -1, "dbplus_relation", le_dbplus_relation); \ + if(!r) RETURN_LONG(ERR_UNKNOWN); static int @@ -45,7 +45,7 @@ var2tuple(relf *r, zval **zv, tuple *t) ap = r->r_atts; deg = r->r_rel.rel_deg; do { - if(SUCCESS!=zend_hash_find((*zv)->value.ht,ap->att_name,strlen(ap->att_name)+1,(void **)&element)) + if(SUCCESS!=zend_hash_find((*zv)->value.ht, ap->att_name, strlen(ap->att_name)+1, (void **)&element)) continue; if (! *element) return 1; @@ -116,27 +116,27 @@ tuple2var(relf * r, tuple * t, zval **zv) switch(ap->att_type) { case FT_SHORT: - ZVAL_LONG(element,AFFIX(ap, t)->f_short); + ZVAL_LONG(element, AFFIX(ap, t)->f_short); break; case FT_UNSIGNED: - ZVAL_LONG(element,AFFIX(ap, t)->f_unsigned); + ZVAL_LONG(element, AFFIX(ap, t)->f_unsigned); break; case FT_LONG: - ZVAL_LONG(element,AFFIX(ap, t)->f_long); + ZVAL_LONG(element, AFFIX(ap, t)->f_long); break; case FT_FLOAT: - ZVAL_DOUBLE(element,AFFIX(ap, t)->f_float); + ZVAL_DOUBLE(element, AFFIX(ap, t)->f_float); break; case FT_DOUBLE: - ZVAL_DOUBLE(element,AFFIX(ap, t)->f_double); + ZVAL_DOUBLE(element, AFFIX(ap, t)->f_double); break; case FT_STRING: case FT_DEUTSCH: case FT_CHAR: - ZVAL_STRING(element,AFVAR(ap, t)->f_string,1); + ZVAL_STRING(element, AFVAR(ap, t)->f_string, 1); break; /* @@ -159,12 +159,12 @@ tuple2var(relf * r, tuple * t, zval **zv) } if(element->type!=IS_NULL) - zend_hash_update((*zv)->value.ht - ,ap->att_name - ,strlen(ap->att_name)+1 - ,(void *)&element - ,sizeof(zval*) - ,NULL); + zend_hash_update((*zv)->value.ht, + ap->att_name, + strlen(ap->att_name)+1, + (void *)&element, + sizeof(zval*), + NULL); } while (ap++, --deg); return 0; @@ -190,20 +190,20 @@ ary2constr(relf * r, zval** constr) db_coninit(r, &c); if ((*constr)->type != IS_ARRAY) { - php_error(E_WARNING,"Constraint is not an array"); + php_error(E_WARNING, "Constraint is not an array"); return NULL; } zend_hash_internal_pointer_reset(_HASH(constr)); - if(zend_hash_get_current_data(_HASH(constr),(void **)&zdata)!=SUCCESS) { - php_error(E_WARNING,"Constraint array is empty"); + if(zend_hash_get_current_data(_HASH(constr), (void **)&zdata)!=SUCCESS) { + php_error(E_WARNING, "Constraint array is empty"); return NULL; } switch((*zdata)->type) { case IS_STRING: /* constraints in plain string array */ if (_HASH(constr)->nNumOfElements%3) { - php_error(E_WARNING,"Constraint array has to have triples of strings"); + php_error(E_WARNING, "Constraint array has to have triples of strings"); return NULL; } @@ -211,11 +211,11 @@ ary2constr(relf * r, zval** constr) convert_to_string_ex(zdata); dom = _STRING(zdata); zend_hash_move_forward(_HASH(constr)); - zend_hash_get_current_data(_HASH(constr),(void **)&zdata); + zend_hash_get_current_data(_HASH(constr), (void **)&zdata); convert_to_string_ex(zdata); op = _STRING(zdata); zend_hash_move_forward(_HASH(constr)); - zend_hash_get_current_data(_HASH(constr),(void **)&zdata); + zend_hash_get_current_data(_HASH(constr), (void **)&zdata); convert_to_string_ex(zdata); val = _STRING(zdata); zend_hash_move_forward(_HASH(constr)); @@ -232,36 +232,36 @@ ary2constr(relf * r, zval** constr) f = string_to_field(val, ap, 0); (void) db_constrain(r, &c, dom, sop, f ? f : (field *) val); - } while(SUCCESS==zend_hash_get_current_data(_HASH(constr),(void **)&zdata)); + } while(SUCCESS==zend_hash_get_current_data(_HASH(constr), (void **)&zdata)); break; case IS_ARRAY: { zval **entry; for(zend_hash_internal_pointer_reset(_HASH(constr)); - SUCCESS==zend_hash_get_current_data(_HASH(constr),(void **)&zdata); + SUCCESS==zend_hash_get_current_data(_HASH(constr), (void **)&zdata); zend_hash_move_forward(_HASH(constr))) { if(!((*zdata)->type==IS_ARRAY)) { - php_error(E_WARNING,"Constraint array element not an array"); + php_error(E_WARNING, "Constraint array element not an array"); return NULL; } if(_HASH(zdata)->nNumOfElements!=3) { - php_error(E_WARNING,"Constraint array element not an array of size 3"); + php_error(E_WARNING, "Constraint array element not an array of size 3"); return NULL; } zend_hash_internal_pointer_reset(_HASH(zdata)); - zend_hash_get_current_data(_HASH(zdata),(void **)&entry); + zend_hash_get_current_data(_HASH(zdata), (void **)&entry); convert_to_string_ex(entry); dom=_STRING(entry); zend_hash_move_forward(_HASH(zdata)); - zend_hash_get_current_data(_HASH(zdata),(void **)&entry); + zend_hash_get_current_data(_HASH(zdata), (void **)&entry); convert_to_string_ex(entry); op=_STRING(entry); zend_hash_move_forward(_HASH(zdata)); - zend_hash_get_current_data(_HASH(zdata),(void **)&entry); + zend_hash_get_current_data(_HASH(zdata), (void **)&entry); convert_to_string_ex(entry); val=_STRING(entry); @@ -304,13 +304,13 @@ PHP_FUNCTION(dbplus_add) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_array_ex(data); - if(var2tuple(r,data,&t)) + if(var2tuple(r, data, &t)) RETURN_LONG(ERR_UNKNOWN); - stat=cdb_add(r,&t); + stat=cdb_add(r, &t); RETURN_LONG(stat); } @@ -332,27 +332,27 @@ PHP_FUNCTION(dbplus_aql) switch (argc) { case 3: convert_to_string_ex(dbpath); - php_error(E_WARNING,"Arg dbpath: %s",_STRING(dbpath)); + php_error(E_WARNING, "Arg dbpath: %s", _STRING(dbpath)); /* Fall-through. */ case 2: convert_to_string_ex(server); - php_error(E_WARNING,"Arg server: %s",_STRING(server)); + php_error(E_WARNING, "Arg server: %s", _STRING(server)); /* Fall-through. */ case 1: convert_to_string_ex(query); - php_error(E_WARNING,"Arg query: %s",_STRING(query)); + php_error(E_WARNING, "Arg query: %s", _STRING(query)); break; } - r = cdb_aql((argc>=2)?_STRING(server):"localhost" - ,_STRING(query) - ,(argc==3)?_STRING(dbpath):NULL); + r = cdb_aql((argc>=2)?_STRING(server):"localhost", + _STRING(query), + (argc==3)?_STRING(dbpath):NULL); if(r == NULL) { /* TODO error handling */ RETURN_FALSE; } - ZEND_REGISTER_RESOURCE(return_value,r,le_dbplus_relation); + ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); } /* }}} */ @@ -370,7 +370,7 @@ PHP_FUNCTION(dbplus_chdir) convert_to_string_ex(newdir); - RETURN_STRING(cdb_chdir((argc==1)?_STRING(newdir):NULL),1); + RETURN_STRING(cdb_chdir((argc==1)?_STRING(newdir):NULL), 1); } /* }}} */ @@ -384,7 +384,7 @@ PHP_FUNCTION(dbplus_close) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); zend_list_delete((*relation)->value.lval); @@ -405,11 +405,11 @@ PHP_FUNCTION(dbplus_curr) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); - stat = cdb_current(r,&t); + stat = cdb_current(r, &t); if(stat==ERR_NOERR) { - tuple2var(r,&t,tname); + tuple2var(r, &t, tname); } RETURN_LONG(stat); @@ -437,7 +437,7 @@ PHP_FUNCTION(dbplus_errcode) if(errno==-1) errno = Acc_error; - RETURN_STRING(dbErrorMsg(errno,NULL),1); + RETURN_STRING(dbErrorMsg(errno, NULL), 1); } /* }}} */ @@ -463,16 +463,16 @@ PHP_FUNCTION(dbplus_find) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); if ((*constr)->type != IS_ARRAY) { - php_error(E_WARNING,"Constraint is not an array"); + php_error(E_WARNING, "Constraint is not an array"); RETURN_LONG(ERR_UNKNOWN); } convert_to_array_ex(data); - c = ary2constr(r,constr); + c = ary2constr(r, constr); if (!c){ RETURN_LONG(ERR_USER); @@ -481,7 +481,7 @@ PHP_FUNCTION(dbplus_find) stat = cdb_find(r, &t, c); if(stat==ERR_NOERR) - tuple2var(r,&t,data); + tuple2var(r, &t, data); RETURN_LONG(stat); } @@ -500,11 +500,11 @@ PHP_FUNCTION(dbplus_first) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); - stat = cdb_first(r,&t); + stat = cdb_first(r, &t); if(stat==ERR_NOERR) { - tuple2var(r,&t,tname); + tuple2var(r, &t, tname); } RETURN_LONG(stat); @@ -521,7 +521,7 @@ PHP_FUNCTION(dbplus_flush) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_flush(r)); } @@ -549,14 +549,14 @@ PHP_FUNCTION(dbplus_freelock) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_array_ex(data); - if(var2tuple(r,data,&t)) + if(var2tuple(r, data, &t)) RETURN_LONG(ERR_UNKNOWN); - stat=cdb_freelock(r,&t); + stat=cdb_freelock(r, &t); RETURN_LONG(stat); } @@ -572,7 +572,7 @@ PHP_FUNCTION(dbplus_freerlocks) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_freerlocks(r)); } @@ -591,14 +591,14 @@ PHP_FUNCTION(dbplus_getlock) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_array_ex(data); - if(var2tuple(r,data,&t)) + if(var2tuple(r, data, &t)) RETURN_LONG(ERR_UNKNOWN); - stat=cdb_getlock(r,&t); + stat=cdb_getlock(r, &t); RETURN_LONG(stat); } @@ -614,11 +614,11 @@ PHP_FUNCTION(dbplus_getunique) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_long_ex(uniqueid); convert_to_long_ex(flush); - RETURN_LONG(cdb_getunique(r,&(_INT(uniqueid)),_INT(flush))); + RETURN_LONG(cdb_getunique(r, &(_INT(uniqueid)), _INT(flush))); } /* }}} */ @@ -635,7 +635,7 @@ PHP_FUNCTION(dbplus_info) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); ap = r->r_atts; deg = r->r_rel.rel_deg; @@ -646,19 +646,19 @@ PHP_FUNCTION(dbplus_info) if (array_init(*result) == FAILURE) RETURN_LONG(ERR_USER); - if(!strcmp("atts",(*key)->value.str.val)) { + if(!strcmp("atts", (*key)->value.str.val)) { do { MAKE_STD_ZVAL(element); - ZVAL_STRING(element,ap->att_name,1); + ZVAL_STRING(element, ap->att_name, 1); - zend_hash_update((*result)->value.ht - ,ap->att_name - ,strlen(ap->att_name)+1 - ,(void *)&element - ,sizeof(zval*) - ,NULL); - } while (ap++,deg--); + zend_hash_update((*result)->value.ht, + ap->att_name, + strlen(ap->att_name)+1, + (void *)&element, + sizeof(zval*), + NULL); + } while (ap++, deg--); RETURN_LONG(ERR_NOERR); } @@ -679,11 +679,11 @@ PHP_FUNCTION(dbplus_last) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); - stat = cdb_last(r,&t); + stat = cdb_last(r, &t); if(stat==ERR_NOERR) { - tuple2var(r,&t,tname); + tuple2var(r, &t, tname); } RETURN_LONG(stat); @@ -701,7 +701,7 @@ PHP_FUNCTION(dbplus_lockrel) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_lockrel(r)); } @@ -720,11 +720,11 @@ PHP_FUNCTION(dbplus_next) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); - stat = cdb_next(r,&t); + stat = cdb_next(r, &t); if(stat==ERR_NOERR) { - tuple2var(r,&t,tname); + tuple2var(r, &t, tname); } RETURN_LONG(stat); @@ -743,13 +743,13 @@ PHP_FUNCTION(dbplus_open) convert_to_string_ex(tname); - r = cdb_open((*tname)->value.str.val,1,1); + r = cdb_open((*tname)->value.str.val, 1, 1); if(r == NULL) { /* TODO error handling */ RETURN_FALSE; } - ZEND_REGISTER_RESOURCE(return_value,r,le_dbplus_relation); + ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); } /* }}} */ @@ -766,11 +766,11 @@ PHP_FUNCTION(dbplus_prev) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); - stat = cdb_previous(r,&t); + stat = cdb_previous(r, &t); if(stat==ERR_NOERR) { - tuple2var(r,&t,tname); + tuple2var(r, &t, tname); } RETURN_LONG(stat); @@ -787,13 +787,13 @@ PHP_FUNCTION(dbplus_rchperm) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_long_ex(mask); convert_to_string_ex(user); convert_to_string_ex(group); - RETURN_LONG(cdbRchperm(r,_INT(mask),_STRING(user),_STRING(group))); + RETURN_LONG(cdbRchperm(r, _INT(mask), _STRING(user), _STRING(group))); } /* }}} */ @@ -809,11 +809,11 @@ PHP_FUNCTION(dbplus_restorepos) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); - stat = cdb_next(r,&t); + stat = cdb_next(r, &t); if(stat==ERR_NOERR) { - tuple2var(r,&t,tname); + tuple2var(r, &t, tname); } RETURN_LONG(stat); @@ -824,7 +824,7 @@ PHP_FUNCTION(dbplus_restorepos) */ PHP_FUNCTION(dbplus_rkeys) { - relf *r,*rnew; + relf *r, *rnew; zval **relation, **domlist, **zdata; int nkeys=0; char *p, *name=NULL, *keys[40]; /* TODO hardcoded magic number ??? */ @@ -833,17 +833,17 @@ PHP_FUNCTION(dbplus_rkeys) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); if((*domlist)->type == IS_ARRAY) { convert_to_array_ex(domlist); for(zend_hash_internal_pointer_reset(_HASH(domlist)); - SUCCESS==zend_hash_get_current_data(_HASH(domlist),(void **)&zdata); + SUCCESS==zend_hash_get_current_data(_HASH(domlist), (void **)&zdata); zend_hash_move_forward(_HASH(domlist))) { if((*zdata)->type==IS_STRING) keys[nkeys++] = _STRING(zdata); else { - php_error(E_WARNING,"Domlist array contains non-string value(s)"); + php_error(E_WARNING, "Domlist array contains non-string value(s)"); Acc_error = ERR_USER; RETURN_FALSE; } @@ -862,7 +862,7 @@ PHP_FUNCTION(dbplus_rkeys) /* TODO realy delete old relation resource ? */ zend_list_delete((*relation)->value.lval); - ZEND_REGISTER_RESOURCE(return_value,rnew,le_dbplus_relation); + ZEND_REGISTER_RESOURCE(return_value, rnew, le_dbplus_relation); } else { /* TODO error reporting */ RETURN_FALSE; @@ -882,13 +882,13 @@ PHP_FUNCTION(dbplus_ropen) convert_to_string_ex(tname); - r = ropen((*tname)->value.str.val,0,0); + r = ropen((*tname)->value.str.val, 0, 0); if(r == NULL) { /* TODO error handling */ RETURN_FALSE; } - ZEND_REGISTER_RESOURCE(return_value,r,le_dbplus_relation); + ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); } /* }}} */ @@ -904,14 +904,14 @@ PHP_FUNCTION(dbplus_rquery) WRONG_PARAM_COUNT; } - r = aql_exec(_STRING(name),(argc==2)?_STRING(dbpath):NULL); + r = aql_exec(_STRING(name), (argc==2)?_STRING(dbpath):NULL); if(!r) { /* TODO error handling */ RETURN_FALSE; } - ZEND_REGISTER_RESOURCE(return_value,r,le_dbplus_relation); + ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); } /* }}} */ @@ -925,12 +925,12 @@ PHP_FUNCTION(dbplus_rrename) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_string_ex(name); convert_to_long_ex(flag); - RETURN_LONG(cdbRrename(r,_STRING(name),(*flag)->value.lval)); + RETURN_LONG(cdbRrename(r, _STRING(name), (*flag)->value.lval)); } /* }}} */ @@ -938,7 +938,7 @@ PHP_FUNCTION(dbplus_rrename) */ PHP_FUNCTION(dbplus_rsecindex) { - relf *r,*rnew; + relf *r, *rnew; zval **relation, **domlist, **compact, **zdata; int nkeys=0; char *p, *name=NULL, *keys[40]; /* TODO hardcoded magic number ??? */ @@ -947,17 +947,17 @@ PHP_FUNCTION(dbplus_rsecindex) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); if((*domlist)->type == IS_ARRAY) { convert_to_array_ex(domlist); for(zend_hash_internal_pointer_reset(_HASH(domlist)); - SUCCESS==zend_hash_get_current_data(_HASH(domlist),(void **)&zdata); + SUCCESS==zend_hash_get_current_data(_HASH(domlist), (void **)&zdata); zend_hash_move_forward(_HASH(domlist))) { if((*zdata)->type==IS_STRING) keys[nkeys++] = _STRING(zdata); else { - php_error(E_WARNING,"Domlist array contains non-string value(s)"); + php_error(E_WARNING, "Domlist array contains non-string value(s)"); Acc_error = ERR_USER; RETURN_FALSE; } @@ -978,7 +978,7 @@ PHP_FUNCTION(dbplus_rsecindex) /* TODO realy delete old relation resource ? */ zend_list_delete((*relation)->value.lval); - ZEND_REGISTER_RESOURCE(return_value,rnew,le_dbplus_relation); + ZEND_REGISTER_RESOURCE(return_value, rnew, le_dbplus_relation); } else { /* TODO error reporting */ RETURN_FALSE; @@ -996,7 +996,7 @@ PHP_FUNCTION(dbplus_runlink) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdbRunlink(&r)); } @@ -1016,9 +1016,9 @@ PHP_FUNCTION(dbplus_rzap) convert_to_long_ex(truncate); - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); - RETURN_LONG(cdbRzap(r,(*truncate)->value.lval)); + RETURN_LONG(cdbRzap(r, (*truncate)->value.lval)); } /* }}} */ @@ -1032,7 +1032,7 @@ PHP_FUNCTION(dbplus_savepos) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_savepos(r)); } @@ -1048,11 +1048,11 @@ PHP_FUNCTION(dbplus_setindex) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_string_ex(idx_name); - RETURN_LONG(cdb_setindex(r,_STRING(idx_name))); + RETURN_LONG(cdb_setindex(r, _STRING(idx_name))); } /* }}} */ @@ -1066,11 +1066,11 @@ PHP_FUNCTION(dbplus_setindexbynumber) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_long_ex(idx_number); - RETURN_LONG(cdb_setindexbynumber(r,(*idx_number)->value.lval)); + RETURN_LONG(cdb_setindexbynumber(r, (*idx_number)->value.lval)); } /* }}} */ @@ -1090,27 +1090,27 @@ PHP_FUNCTION(dbplus_sql) switch (argc) { case 3: convert_to_string_ex(dbpath); - php_error(E_WARNING,"Arg dbpath: %s",_STRING(dbpath)); + php_error(E_WARNING, "Arg dbpath: %s", _STRING(dbpath)); /* Fall-through. */ case 2: convert_to_string_ex(server); - php_error(E_WARNING,"Arg server: %s",_STRING(server)); + php_error(E_WARNING, "Arg server: %s", _STRING(server)); /* Fall-through. */ case 1: convert_to_string_ex(query); - php_error(E_WARNING,"Arg query: %s",_STRING(query)); + php_error(E_WARNING, "Arg query: %s", _STRING(query)); break; } - r = cdb_sql((argc>=2)?_STRING(server):"localhost" - ,_STRING(query) - ,(argc==3)?_STRING(dbpath):NULL); + r = cdb_sql((argc>=2)?_STRING(server):"localhost", + _STRING(query), + (argc==3)?_STRING(dbpath):NULL); if(r == NULL) { /* TODO error handling */ RETURN_FALSE; } - ZEND_REGISTER_RESOURCE(return_value,r,le_dbplus_relation); + ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); } /* }}} */ @@ -1121,7 +1121,7 @@ PHP_FUNCTION(dbplus_tremove) zval **relation, **old, **current; enum errorcond stat = ERR_UNKNOWN; relf *r; - tuple told,tcurr; + tuple told, tcurr; int argc; argc = ZEND_NUM_ARGS(); @@ -1129,17 +1129,17 @@ PHP_FUNCTION(dbplus_tremove) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_array_ex(old); - if(var2tuple(r,old,&told)) + if(var2tuple(r, old, &told)) RETURN_LONG(ERR_UNKNOWN); - stat=cdbTremove(r,&told,&tcurr); + stat=cdbTremove(r, &told, &tcurr); if((stat==ERR_NOERR) && (argc==3)) - tuple2var(r,&tcurr,current); + tuple2var(r, &tcurr, current); RETURN_LONG(stat); } @@ -1155,7 +1155,7 @@ PHP_FUNCTION(dbplus_undo) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_undo(r)); } @@ -1171,7 +1171,7 @@ PHP_FUNCTION(dbplus_undoprepare) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_undoprepare(r)); } @@ -1187,7 +1187,7 @@ PHP_FUNCTION(dbplus_unlockrel) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_unlockrel(r)); } @@ -1203,7 +1203,7 @@ PHP_FUNCTION(dbplus_unselect) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_unselect(r)); } @@ -1216,24 +1216,24 @@ PHP_FUNCTION(dbplus_update) zval **relation, **old, **new; enum errorcond stat = ERR_UNKNOWN; relf *r; - tuple told,tnew; + tuple told, tnew; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &relation, &old, &new) == FAILURE){ WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); convert_to_array_ex(old); convert_to_array_ex(new); - if(var2tuple(r,old,&told)) + if(var2tuple(r, old, &told)) RETURN_LONG(ERR_UNKNOWN); - if(var2tuple(r,new,&tnew)) + if(var2tuple(r, new, &tnew)) RETURN_LONG(ERR_UNKNOWN); - stat=cdb_update(r,&told,&tnew); + stat=cdb_update(r, &told, &tnew); RETURN_LONG(stat); } @@ -1249,7 +1249,7 @@ PHP_FUNCTION(dbplus_xlockrel) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_xlockrel(r)); } @@ -1265,7 +1265,7 @@ PHP_FUNCTION(dbplus_xunlockrel) WRONG_PARAM_COUNT; } - DBPLUS_FETCH_RESOURCE(r,relation); + DBPLUS_FETCH_RESOURCE(r, relation); RETURN_LONG(cdb_xunlockrel(r)); } diff --git a/ext/dbx/dbx_pgsql.c b/ext/dbx/dbx_pgsql.c index d3c354656c..f498f5960e 100644 --- a/ext/dbx/dbx_pgsql.c +++ b/ext/dbx/dbx_pgsql.c @@ -44,7 +44,7 @@ int dbx_pgsql_connect(zval ** rv, zval ** host, zval ** db, zval ** username, zv len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+35; connstring = (char *)emalloc(len+1); sprintf(connstring, "host=%s port=%s dbname=%s user=%s password=%s", - Z_STRVAL_PP(host),port, Z_STRVAL_PP(db), + Z_STRVAL_PP(host), port, Z_STRVAL_PP(db), Z_STRVAL_PP(username), Z_STRVAL_PP(password)); ZVAL_STRING(conn_zval, connstring, 1); args[0] = &conn_zval; @@ -89,7 +89,7 @@ int dbx_pgsql_pconnect(zval ** rv, zval ** host, zval ** db, zval ** username, z len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+35; connstring = (char *)emalloc(len+1); sprintf(connstring, "host=%s port=%s dbname=%s user=%s password=%s", - Z_STRVAL_PP(host),port, Z_STRVAL_PP(db), + Z_STRVAL_PP(host), port, Z_STRVAL_PP(db), Z_STRVAL_PP(username), Z_STRVAL_PP(password)); ZVAL_STRING(conn_zval, connstring, 1); args[0] = &conn_zval; diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 8f8309dc56..1c8990a591 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -312,9 +312,9 @@ static zval *dom_object_get_data(void *obj) { sprintf(tmp, "%08X", obj); fprintf(stderr, "Trying getting %s from object ...", tmp); if(((xmlNodePtr) obj)->_private) - fprintf(stderr," found\n"); + fprintf(stderr, " found\n"); else - fprintf(stderr," not found\n"); */ + fprintf(stderr, " not found\n"); */ return((zval *) (((xmlNodePtr) obj)->_private)); } @@ -423,9 +423,9 @@ static zval *xpath_object_get_data(void *obj) sprintf(tmp, "%08X", obj); fprintf(stderr, "Trying getting %s from hash ...", tmp); if(((xmlXPathObjectPtr) obj)->user) - fprintf(stderr," found\n"); + fprintf(stderr, " found\n"); else - fprintf(stderr," not found\n"); */ + fprintf(stderr, " not found\n"); */ return((zval *) (((xmlXPathObjectPtr) obj)->user)); } @@ -506,9 +506,9 @@ static zval *xpath_context_get_data(void *obj) sprintf(tmp, "%08X", obj); fprintf(stderr, "Trying getting %s from hash ...", tmp); if(((xmlXPathContextPtr) obj)->user) - fprintf(stderr," found\n"); + fprintf(stderr, " found\n"); else - fprintf(stderr," not found\n"); */ + fprintf(stderr, " not found\n"); */ return((zval *) (((xmlXPathContextPtr) obj)->user)); } @@ -2599,7 +2599,7 @@ static void php_xpathptr_eval(INTERNAL_FUNCTION_PARAMETERS, int mode, int expr) } /* }}} */ -/* {{{ proto int xpath_eval([int xpathctx_handle,] string str) +/* {{{ proto int xpath_eval([int xpathctx_handle, ] string str) Evaluate the XPath Location Path in the given string */ PHP_FUNCTION(xpath_eval) { @@ -2607,7 +2607,7 @@ PHP_FUNCTION(xpath_eval) } /* }}} */ -/* {{{ proto int xpath_eval_expression([int xpathctx_handle,] string str) +/* {{{ proto int xpath_eval_expression([int xpathctx_handle, ] string str) Evaluate the XPath Location Path in the given string */ PHP_FUNCTION(xpath_eval_expression) { @@ -2617,7 +2617,7 @@ PHP_FUNCTION(xpath_eval_expression) #endif /* defined(LIBXML_XPATH_ENABLED) */ #if defined(LIBXML_XPTR_ENABLED) -/* {{{ proto int xptr_eval([int xpathctx_handle,] string str) +/* {{{ proto int xptr_eval([int xpathctx_handle, ] string str) Evaluate the XPtr Location Path in the given string */ PHP_FUNCTION(xptr_eval) { diff --git a/ext/dotnet/dotnet.cpp b/ext/dotnet/dotnet.cpp index d0376bd87f..b9af5a6d83 100644 --- a/ext/dotnet/dotnet.cpp +++ b/ext/dotnet/dotnet.cpp @@ -143,13 +143,13 @@ PHP_FUNCTION(dotnet_load) if (FAILED(hr)) { char *error_message; error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"Error obtaining .Net class for %s in assembly %s: %s",datatype_name->value.str.val,assembly_name->value.str.val,error_message); + php_error(E_WARNING, "Error obtaining .Net class for %s in assembly %s: %s", datatype_name->value.str.val, assembly_name->value.str.val, error_message); LocalFree(error_message); efree(obj); RETURN_FALSE; } if (C_DISPATCH(obj) == NULL) { - php_error(E_WARNING,"Unable to locate %s in assembly %s",datatype_name->value.str.val,assembly_name->value.str.val); + php_error(E_WARNING, "Unable to locate %s in assembly %s", datatype_name->value.str.val, assembly_name->value.str.val); efree(obj); RETURN_FALSE; } diff --git a/ext/exif/exif.c b/ext/exif/exif.c index e3e8e7cedf..927eaf9293 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -228,7 +228,7 @@ static void process_COM (ImageInfoType *ImageInfo, uchar *Data, int length) a = ImageInfo->numComments; (ImageInfo->Comments)[a] = emalloc(nch+1); - strcpy(ImageInfo->Comments[a],Comment); + strcpy(ImageInfo->Comments[a], Comment); (ImageInfo->numComments)++; } /* }}} */ @@ -273,7 +273,7 @@ static void process_SOFn (ImageInfoType *ImageInfo, uchar *Data, int marker) /* {{{ format description defines Describes format descriptor */ -static int ExifBytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8}; +static int ExifBytesPerFormat[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8}; #define NUM_FORMATS 12 #define FMT_BYTE 1 @@ -478,15 +478,15 @@ static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder) case FMT_SBYTE: Value = *(signed char *)ValuePtr; break; case FMT_BYTE: Value = *(uchar *)ValuePtr; break; - case FMT_USHORT: Value = Get16u(ValuePtr,MotorolaOrder); break; - case FMT_ULONG: Value = Get32u(ValuePtr,MotorolaOrder); break; + case FMT_USHORT: Value = Get16u(ValuePtr, MotorolaOrder); break; + case FMT_ULONG: Value = Get32u(ValuePtr, MotorolaOrder); break; case FMT_URATIONAL: case FMT_SRATIONAL: { - int Num,Den; - Num = Get32s(ValuePtr,MotorolaOrder); - Den = Get32s(4+(char *)ValuePtr,MotorolaOrder); + int Num, Den; + Num = Get32s(ValuePtr, MotorolaOrder); + Den = Get32s(4+(char *)ValuePtr, MotorolaOrder); if (Den == 0) { Value = 0; } else { @@ -495,8 +495,8 @@ static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder) break; } - case FMT_SSHORT: Value = (signed short)Get16u(ValuePtr,MotorolaOrder); break; - case FMT_SLONG: Value = Get32s(ValuePtr,MotorolaOrder); break; + case FMT_SSHORT: Value = (signed short)Get16u(ValuePtr, MotorolaOrder); break; + case FMT_SLONG: Value = Get32s(ValuePtr, MotorolaOrder); break; /* Not sure if this is correct (never seen float used in Exif format) */ case FMT_SINGLE: Value = (double)*(float *)ValuePtr; break; @@ -511,18 +511,18 @@ static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder) static void ExtractThumbnail(ImageInfoType *ImageInfo, char *OffsetBase, unsigned ExifLength) { /* according to exif2.1, the thumbnail is not supposed to be greater than 64K */ if (ImageInfo->ThumbnailSize > 65536) { - php_error(E_WARNING,"Illegal thumbnail size"); + php_error(E_WARNING, "Illegal thumbnail size"); return; } ImageInfo->Thumbnail = emalloc(ImageInfo->ThumbnailSize); if (!ImageInfo->Thumbnail) { - php_error(E_WARNING,"Could not allocate memory for thumbnail"); + php_error(E_WARNING, "Could not allocate memory for thumbnail"); return; } else { /* Check to make sure we are not going to go past the ExifLength */ if ((unsigned)(ImageInfo->ThumbnailOffset + ImageInfo->ThumbnailSize) > ExifLength) { - php_error(E_WARNING,"Thumbnail goes beyond exif header boundary"); + php_error(E_WARNING, "Thumbnail goes beyond exif header boundary"); return; } else { memcpy(ImageInfo->Thumbnail, OffsetBase + ImageInfo->ThumbnailOffset, ImageInfo->ThumbnailSize); @@ -544,14 +544,14 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse NumDirEntries = Get16u(DirStart, ImageInfo->MotorolaOrder); if ((DirStart+2+NumDirEntries*12) > (OffsetBase+ExifLength)) { - php_error(E_WARNING,"Illegally sized directory"); + php_error(E_WARNING, "Illegally sized directory"); return; } /* if (ShowTags) { - printf("Directory with %d entries\n",NumDirEntries); + printf("Directory with %d entries\n", NumDirEntries); } */ @@ -568,7 +568,7 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse if ((Format-1) >= NUM_FORMATS) { /* (-1) catches illegal zero case as unsigned underflows to positive large. */ - php_error(E_WARNING,"Illegal format code in EXIF dir"); + php_error(E_WARNING, "Illegal format code in EXIF dir"); return; } @@ -580,9 +580,9 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse /* If its bigger than 4 bytes, the dir entry contains an offset. */ if (OffsetVal+ByteCount > ExifLength) { /* Bogus pointer offset and / or bytecount value */ -/* printf("Offset %d bytes %d ExifLen %d\n",OffsetVal, ByteCount, ExifLength); */ +/* printf("Offset %d bytes %d ExifLen %d\n", OffsetVal, ByteCount, ExifLength); */ - php_error(E_WARNING,"Illegal pointer offset value in EXIF"); + php_error(E_WARNING, "Illegal pointer offset value in EXIF"); return; } ValuePtr = OffsetBase+OffsetVal; @@ -627,11 +627,11 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse break; case TAG_ORIENTATION: - ImageInfo->Orientation = (int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->Orientation = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_ISOSPEED: - ImageInfo->ISOspeed = (int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->ISOspeed = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_DATETIME_ORIGINAL: @@ -651,7 +651,7 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse } /* Copy the comment */ - if (memcmp(ValuePtr, "ASCII",5) == 0) { + if (memcmp(ValuePtr, "ASCII", 5) == 0) { for (a=5;a<10;a++) { int c; int l; c = (ValuePtr)[a]; @@ -678,7 +678,7 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse case TAG_FNUMBER: /* Simplest way of expressing aperture, so I trust it the most. (overwrite previously computd value if there is one) */ - ImageInfo->ApertureFNumber = (float)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->ApertureFNumber = (float)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_APERTURE: @@ -694,19 +694,19 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse case TAG_FOCALLENGTH: /* Nice digital cameras actually save the focal length as a function of how farthey are zoomed in. */ - ImageInfo->FocalLength = (float)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->FocalLength = (float)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_SUBJECT_DISTANCE: /* Inidcates the distacne the autofocus camera is focused to. Tends to be less accurate as distance increases. */ - ImageInfo->Distance = (float)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->Distance = (float)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_EXPOSURETIME: /* Simplest way of expressing exposure time, so I trust it most. (overwrite previously computd value if there is one) */ - ImageInfo->ExposureTime = (float)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->ExposureTime = (float)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_SHUTTERSPEED: @@ -725,15 +725,15 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse break; case TAG_IMAGEWIDTH: - ImageInfo->ExifImageWidth = (int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->ExifImageWidth = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_FOCALPLANEXRES: - ImageInfo->FocalplaneXRes = ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder); + ImageInfo->FocalplaneXRes = ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); break; case TAG_FOCALPLANEUNITS: - switch((int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->MotorolaOrder)) { + switch((int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder)) { case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */ case 2: /* According to the information I was using, 2 measn meters. @@ -753,7 +753,7 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse break; case TAG_SPECIALMODE: - ImageInfo->SpecialMode = (int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->SpecialMode); + ImageInfo->SpecialMode = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->SpecialMode); break; case TAG_JPEGQUAL: /* I think that this is a pointer to the thumbnail - let's see */ @@ -763,7 +763,7 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse if (ImageInfo->ThumbnailSize) { ExtractThumbnail(ImageInfo, OffsetBase, ExifLength); } - /*ImageInfo->JpegQual = (int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->JpegQual);*/ + /*ImageInfo->JpegQual = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->JpegQual);*/ break; case TAG_MACRO: /* I think this is the size of the Thumbnail */ @@ -773,11 +773,11 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse if (ImageInfo->ThumbnailOffset) { ExtractThumbnail(ImageInfo, OffsetBase, ExifLength); } - /*ImageInfo->Macro = (int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->Macro);*/ + /*ImageInfo->Macro = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->Macro);*/ break; case TAG_DIGIZOOM: - ImageInfo->DigiZoom = (int)ConvertAnyFormat(ValuePtr, Format,ImageInfo->DigiZoom); + ImageInfo->DigiZoom = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->DigiZoom); break; case TAG_SOFTWARERELEASE: @@ -797,7 +797,7 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse char *SubdirStart; SubdirStart = OffsetBase + Get32u(ValuePtr, ImageInfo->MotorolaOrder); if (SubdirStart < OffsetBase || SubdirStart > OffsetBase+ExifLength) { - php_error(E_WARNING,"Illegal subdirectory link"); + php_error(E_WARNING, "Illegal subdirectory link"); return; } ProcessExifDir(ImageInfo, SubdirStart, OffsetBase, ExifLength, LastExifRefd); @@ -811,7 +811,7 @@ static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *Offse NextDirOffset = Get32u(DirStart+2+12*de, ImageInfo->MotorolaOrder); if (NextDirOffset) { if (OffsetBase + NextDirOffset < OffsetBase || OffsetBase + NextDirOffset > OffsetBase+ExifLength) { - php_error(E_WARNING,"Illegal directory offset"); + php_error(E_WARNING, "Illegal directory offset"); return; } ProcessExifDir(ImageInfo, OffsetBase + NextDirOffset, OffsetBase, ExifLength, LastExifRefd); @@ -838,29 +838,29 @@ static void process_EXIF (ImageInfoType *ImageInfo, char *CharBuf, unsigned int { /* Check the EXIF header component */ static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; - if (memcmp(CharBuf+2, ExifHeader,6)) { - php_error(E_WARNING,"Incorrect Exif header"); + if (memcmp(CharBuf+2, ExifHeader, 6)) { + php_error(E_WARNING, "Incorrect Exif header"); return; } } - if (memcmp(CharBuf+8,"II",2) == 0) { + if (memcmp(CharBuf+8, "II", 2) == 0) { /* if (ShowTags) printf("Exif section in Intel order\n"); */ ImageInfo->MotorolaOrder = 0; } else { - if (memcmp(CharBuf+8,"MM",2) == 0) { + if (memcmp(CharBuf+8, "MM", 2) == 0) { /* if (ShowTags) printf("Exif section in Motorola order\n"); */ ImageInfo->MotorolaOrder = 1; } else { - php_error(E_WARNING,"Invalid Exif alignment marker."); + php_error(E_WARNING, "Invalid Exif alignment marker."); return; } } /* Check the next two values for correctness. */ - if (Get16u(CharBuf+10,ImageInfo->MotorolaOrder) != 0x2a - || Get32u(CharBuf+12,ImageInfo->MotorolaOrder) != 0x08) { - php_error(E_WARNING,"Invalid Exif start (1)"); + if (Get16u(CharBuf+10, ImageInfo->MotorolaOrder) != 0x2a + || Get32u(CharBuf+12, ImageInfo->MotorolaOrder) != 0x08) { + php_error(E_WARNING, "Invalid Exif start (1)"); return; } @@ -892,7 +892,7 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t * for(*SectionsRead=0;*SectionsRead < 19;) { int itemlen; int marker = 0; - int ll,lh, got; + int ll, lh, got; uchar *Data; for (a=0;a<7;a++) { @@ -901,7 +901,7 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t * } if (marker == 0xff) { /* 0xff is legal padding, but if we get that many, something's wrong. */ - php_error(E_WARNING,"too many padding bytes!"); + php_error(E_WARNING, "too many padding bytes!"); return FALSE; } @@ -914,7 +914,7 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t * itemlen = (lh << 8) | ll; if (itemlen < 2) { - php_error(E_WARNING,"invalid marker"); + php_error(E_WARNING, "invalid marker"); return FALSE; } @@ -929,12 +929,12 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t * got = fread(Data+2, 1, itemlen-2, infile); /* Read the whole section. */ if (got != itemlen-2) { - php_error(E_WARNING,"reading from file"); + php_error(E_WARNING, "reading from file"); return FALSE; } *SectionsRead += 1; - /*printf("Marker '%x' size %d\n",marker, itemlen);*/ + /*printf("Marker '%x' size %d\n", marker, itemlen);*/ switch(marker) { case M_SOS: /* stop before hitting compressed data */ /* If reading entire image is requested, read the rest of the data. */ @@ -949,13 +949,13 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t * size = ep-cp; Data = (uchar *)emalloc(size); if (Data == NULL) { - php_error(E_WARNING,"could not allocate data for entire image"); + php_error(E_WARNING, "could not allocate data for entire image"); return FALSE; } got = fread(Data, 1, size, infile); if (got != size) { - php_error(E_WARNING,"could not read the rest of the image"); + php_error(E_WARNING, "could not read the rest of the image"); return FALSE; } @@ -971,7 +971,7 @@ static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t * return TRUE; case M_EOI: /* in case it's a tables-only JPEG stream */ - php_error(E_WARNING,"No image in jpeg!"); + php_error(E_WARNING, "No image in jpeg!"); return FALSE; case M_COM: /* Comment section */ @@ -1056,7 +1056,7 @@ int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections, memset(ImageInfo, 0, sizeof(*ImageInfo)); memset(Sections, 0, sizeof(*Sections)); - tmp = php_basename(FileName,strlen(FileName),NULL,0); + tmp = php_basename(FileName, strlen(FileName), NULL, 0); strlcpy(ImageInfo->FileName, tmp, sizeof(ImageInfo->FileName)); efree(tmp); ImageInfo->FocalLength = 0; @@ -1077,7 +1077,7 @@ int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections, ImageInfo->FileDateTime = st.st_mtime; ImageInfo->FileSize = st.st_size; } else { - php_error(E_WARNING,"Can't get file statitics"); + php_error(E_WARNING, "Can't get file statitics"); return FALSE; } } @@ -1085,7 +1085,7 @@ int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections, /* Scan the JPEG headers. */ ret = scan_JPEG_header(ImageInfo, infile, Sections, SectionsRead, ReadAll, LastExifRefd); if (!ret) { - php_error(E_WARNING,"Invalid Jpeg file: '%s'\n",FileName); + php_error(E_WARNING, "Invalid Jpeg file: '%s'\n", FileName); return FALSE; } @@ -1156,80 +1156,80 @@ PHP_FUNCTION(read_exif_data) if (ret==FALSE || array_init(return_value) == FAILURE) { RETURN_FALSE; } - add_assoc_string(return_value,"FileName",ImageInfo.FileName,1); - add_assoc_long(return_value,"FileDateTime",ImageInfo.FileDateTime); - add_assoc_long(return_value,"FileSize",ImageInfo.FileSize); + add_assoc_string(return_value, "FileName", ImageInfo.FileName, 1); + add_assoc_long(return_value, "FileDateTime", ImageInfo.FileDateTime); + add_assoc_long(return_value, "FileSize", ImageInfo.FileSize); if (ImageInfo.CameraMake[0]) { - add_assoc_string(return_value,"CameraMake",ImageInfo.CameraMake,1); + add_assoc_string(return_value, "CameraMake", ImageInfo.CameraMake, 1); } if (ImageInfo.CameraModel[0]) { - add_assoc_string(return_value,"CameraModel",ImageInfo.CameraModel,1); + add_assoc_string(return_value, "CameraModel", ImageInfo.CameraModel, 1); } if (ImageInfo.DateTime[0]) { - add_assoc_string(return_value,"DateTime",ImageInfo.DateTime,1); + add_assoc_string(return_value, "DateTime", ImageInfo.DateTime, 1); } - add_assoc_long(return_value,"Height",ImageInfo.Height); - add_assoc_long(return_value,"Width",ImageInfo.Width); - add_assoc_long(return_value,"IsColor",ImageInfo.IsColor); + add_assoc_long(return_value, "Height", ImageInfo.Height); + add_assoc_long(return_value, "Width", ImageInfo.Width); + add_assoc_long(return_value, "IsColor", ImageInfo.IsColor); if(ImageInfo.FlashUsed >= 0) { - add_assoc_long(return_value,"FlashUsed",ImageInfo.FlashUsed); + add_assoc_long(return_value, "FlashUsed", ImageInfo.FlashUsed); } if (ImageInfo.FocalLength) { - sprintf(tmp,"%4.1fmm",ImageInfo.FocalLength); - add_assoc_string(return_value,"FocalLength",tmp,1); + sprintf(tmp, "%4.1fmm", ImageInfo.FocalLength); + add_assoc_string(return_value, "FocalLength", tmp, 1); if(ImageInfo.CCDWidth) { - sprintf(tmp,"%dmm",(int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); - add_assoc_string(return_value,"35mmFocalLength",tmp,1); + sprintf(tmp, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); + add_assoc_string(return_value, "35mmFocalLength", tmp, 1); } - add_assoc_double(return_value,"RawFocalLength",ImageInfo.FocalLength); + add_assoc_double(return_value, "RawFocalLength", ImageInfo.FocalLength); } if(ImageInfo.ExposureTime) { if(ImageInfo.ExposureTime <= 0.5) { - sprintf(tmp,"%6.3f s (1/%d)",ImageInfo.ExposureTime,(int)(0.5 + 1/ImageInfo.ExposureTime)); + sprintf(tmp, "%6.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); } else { - sprintf(tmp,"%6.3f s",ImageInfo.ExposureTime); + sprintf(tmp, "%6.3f s", ImageInfo.ExposureTime); } - add_assoc_string(return_value,"ExposureTime",tmp,1); - add_assoc_double(return_value,"RawExposureTime",ImageInfo.ExposureTime); + add_assoc_string(return_value, "ExposureTime", tmp, 1); + add_assoc_double(return_value, "RawExposureTime", ImageInfo.ExposureTime); } if(ImageInfo.ApertureFNumber) { - sprintf(tmp,"f/%4.1f",ImageInfo.ApertureFNumber); - add_assoc_string(return_value,"ApertureFNumber",tmp,1); - add_assoc_double(return_value,"RawApertureFNumber",ImageInfo.ApertureFNumber); + sprintf(tmp, "f/%4.1f", ImageInfo.ApertureFNumber); + add_assoc_string(return_value, "ApertureFNumber", tmp, 1); + add_assoc_double(return_value, "RawApertureFNumber", ImageInfo.ApertureFNumber); } if(ImageInfo.Distance) { if(ImageInfo.Distance<0) { - add_assoc_string(return_value,"FocusDistance","Infinite",1); + add_assoc_string(return_value, "FocusDistance", "Infinite", 1); } else { - sprintf(tmp,"%5.2fm",ImageInfo.Distance); - add_assoc_string(return_value,"FocusDistance",tmp,1); + sprintf(tmp, "%5.2fm", ImageInfo.Distance); + add_assoc_string(return_value, "FocusDistance", tmp, 1); } - add_assoc_double(return_value,"RawFocusDistance",ImageInfo.Distance); + add_assoc_double(return_value, "RawFocusDistance", ImageInfo.Distance); } if(ImageInfo.CCDWidth) { - add_assoc_double(return_value,"CCDWidth",ImageInfo.CCDWidth); + add_assoc_double(return_value, "CCDWidth", ImageInfo.CCDWidth); } if(ImageInfo.Orientation) { - add_assoc_long(return_value,"Orientation",ImageInfo.Orientation); + add_assoc_long(return_value, "Orientation", ImageInfo.Orientation); } if (ImageInfo.GPSinfo[0]) { - add_assoc_string(return_value,"GPSinfo",ImageInfo.GPSinfo,1); + add_assoc_string(return_value, "GPSinfo", ImageInfo.GPSinfo, 1); } if(ImageInfo.ISOspeed) { - add_assoc_long(return_value,"ISOspeed",ImageInfo.ISOspeed); + add_assoc_long(return_value, "ISOspeed", ImageInfo.ISOspeed); } if (ImageInfo.ExifVersion[0]) { - add_assoc_string(return_value,"ExifVersion",ImageInfo.ExifVersion,1); + add_assoc_string(return_value, "ExifVersion", ImageInfo.ExifVersion, 1); } if (ImageInfo.Copyright[0]) { - add_assoc_string(return_value,"Copyright",ImageInfo.Copyright,1); + add_assoc_string(return_value, "Copyright", ImageInfo.Copyright, 1); } if (ImageInfo.Software[0]) { - add_assoc_string(return_value,"Software",ImageInfo.Software,1); + add_assoc_string(return_value, "Software", ImageInfo.Software, 1); } if(ImageInfo.numComments) { if(ImageInfo.numComments==1) { - add_assoc_string(return_value,"Comments",(ImageInfo.Comments)[0],0); + add_assoc_string(return_value, "Comments", (ImageInfo.Comments)[0], 0); } else { int i; @@ -1242,30 +1242,30 @@ PHP_FUNCTION(read_exif_data) } } if(ImageInfo.ThumbnailSize && ImageInfo.Thumbnail) { - add_assoc_stringl(return_value,"Thumbnail",ImageInfo.Thumbnail,ImageInfo.ThumbnailSize,1); - add_assoc_long(return_value,"ThumbnailSize",ImageInfo.ThumbnailSize); + add_assoc_stringl(return_value, "Thumbnail", ImageInfo.Thumbnail, ImageInfo.ThumbnailSize, 1); + add_assoc_long(return_value, "ThumbnailSize", ImageInfo.ThumbnailSize); efree(ImageInfo.Thumbnail); } if(ImageInfo.SpecialMode >= 0) { - add_assoc_long(return_value,"SpecialMode",ImageInfo.SpecialMode); + add_assoc_long(return_value, "SpecialMode", ImageInfo.SpecialMode); } if(ImageInfo.JpegQual >= 0) { - add_assoc_long(return_value,"JpegQual",ImageInfo.JpegQual); + add_assoc_long(return_value, "JpegQual", ImageInfo.JpegQual); } if(ImageInfo.Macro >= 0) { - add_assoc_long(return_value,"Macro",ImageInfo.Macro); + add_assoc_long(return_value, "Macro", ImageInfo.Macro); } if(ImageInfo.DigiZoom >= 0) { - add_assoc_long(return_value,"DigiZoom",ImageInfo.DigiZoom); + add_assoc_long(return_value, "DigiZoom", ImageInfo.DigiZoom); } if (ImageInfo.SoftwareRelease[0]) { - add_assoc_string(return_value,"SoftwareRelease",ImageInfo.SoftwareRelease,1); + add_assoc_string(return_value, "SoftwareRelease", ImageInfo.SoftwareRelease, 1); } if (ImageInfo.PictInfo[0]) { - add_assoc_string(return_value,"PictInfo",ImageInfo.PictInfo,1); + add_assoc_string(return_value, "PictInfo", ImageInfo.PictInfo, 1); } if (ImageInfo.CameraId[0]) { - add_assoc_string(return_value,"CameraId",ImageInfo.CameraId,1); + add_assoc_string(return_value, "CameraId", ImageInfo.CameraId, 1); } } /* }}} */ diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c index e54ec1469a..460c77a8ec 100644 --- a/ext/fbsql/php_fbsql.c +++ b/ext/fbsql/php_fbsql.c @@ -234,7 +234,7 @@ ZEND_DECLARE_MODULE_GLOBALS(fbsql) ZEND_GET_MODULE(fbsql) #endif -#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING,"FrontBase: A link to the server could not be established"); RETURN_FALSE; } } +#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING, "FrontBase: A link to the server could not be established"); RETURN_FALSE; } } static void phpfbReleaseResult (zend_rsrc_list_entry *rsrc TSRMLS_DC); static void phpfbReleaseLink (zend_rsrc_list_entry *rsrc TSRMLS_DC); @@ -247,7 +247,7 @@ static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC) if (result) { if (result->fetchHandle) { - FBCMetaData *md = fbcdcCancelFetch(result->link->connection,result->fetchHandle); + FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle); fbcmdRelease(md); } if (result->rowHandler) fbcrhRelease(result->rowHandler); @@ -317,7 +317,7 @@ static int php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) { if (FB_SQL_G(linkIndex)==-1) { /* no link opened yet, implicitly open one */ ht = 0; - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); + php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } return FB_SQL_G(linkIndex); } @@ -351,7 +351,7 @@ static void php_fbsql_init_globals(zend_fbsql_globals *fbsql_globals) if (fbsql_globals->hostName==NULL) { char name[256]; - gethostname(name,sizeof(name)); + gethostname(name, sizeof(name)); name[sizeof(name)-1] = 0; fbsql_globals->hostName = estrdup(name); } @@ -437,7 +437,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant) zval **argv[3]; if ((argc < 0) || (argc > 3)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc,&argv[0],&argv[1],&argv[2])==FAILURE) RETURN_FALSE; + if (zend_get_parameters_ex(argc, &argv[0], &argv[1], &argv[2])==FAILURE) RETURN_FALSE; if (argc >= 1) { convert_to_string_ex(argv[0]); @@ -458,7 +458,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant) if (userName == NULL) userName = FB_SQL_G(userName); if (userPassword == NULL) userPassword = FB_SQL_G(userPassword); - sprintf(name,"fbsql_%s_%s_%s", hostName, userName, userPassword); + sprintf(name, "fbsql_%s_%s_%s", hostName, userName, userPassword); if (!FB_SQL_G(allowPersistent)) { persistant=0; @@ -473,13 +473,13 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant) if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) { - php_error(E_WARNING,"FrontBase link limit %d exceeded ", FB_SQL_G(maxLinks)); + php_error(E_WARNING, "FrontBase link limit %d exceeded ", FB_SQL_G(maxLinks)); RETURN_FALSE; } if ((FB_SQL_G(maxPersistant) != -1 && FB_SQL_G(persistantCount) == FB_SQL_G(maxPersistant))) { - php_error(E_WARNING,"FrontBase persistant link limit %d exceeded ", FB_SQL_G(maxPersistant)); + php_error(E_WARNING, "FrontBase persistant link limit %d exceeded ", FB_SQL_G(maxPersistant)); RETURN_FALSE; } @@ -490,7 +490,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant) phpLink->userPassword = strdup(userPassword); phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); phpLink->databaseName = NULL; - phpLink->execHandler = fbcehHandlerForHost(hostName,128); + phpLink->execHandler = fbcehHandlerForHost(hostName, 128); phpLink->affectedRows = 0; phpLink->autoCommit = FB_SQL_G(autoCommit); phpLink->errorNo = 0; @@ -520,7 +520,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant) if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) { - php_error(E_WARNING,"FrontBase link limit %d exceeded ", FB_SQL_G(maxLinks)); + php_error(E_WARNING, "FrontBase link limit %d exceeded ", FB_SQL_G(maxLinks)); RETURN_FALSE; } @@ -530,7 +530,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant) void *ptr; link = (int) lep->ptr; - ptr = zend_list_find(link,&type); /* check if the link is still there */ + ptr = zend_list_find(link, &type); /* check if the link is still there */ if (ptr && (type==le_link || type==le_plink)) { zend_list_addref(link); return_value->value.lval = link; @@ -550,7 +550,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant) phpLink->userPassword = strdup(userPassword); phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); phpLink->databaseName = NULL; - phpLink->execHandler = fbcehHandlerForHost(hostName,128); + phpLink->execHandler = fbcehHandlerForHost(hostName, 128); phpLink->affectedRows = 0; phpLink->autoCommit = FB_SQL_G(autoCommit); phpLink->errorNo = 0; @@ -592,7 +592,7 @@ int phpfbFetchRow(PHPFBResult* result, int row) if (row >= result->rowCount) return 0; if (fbcrhRowCount(result->rowHandler) > (unsigned int)row) return 1; rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle); - if (!fbcrhAddBatch(result->rowHandler,rawData)) result->rowCount = fbcrhRowCount(result->rowHandler); + if (!fbcrhAddBatch(result->rowHandler, rawData)) result->rowCount = fbcrhRowCount(result->rowHandler); } return 0; } @@ -602,7 +602,7 @@ int phpfbFetchRow(PHPFBResult* result, int row) */ PHP_FUNCTION(fbsql_connect) { - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); + php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ @@ -610,7 +610,7 @@ PHP_FUNCTION(fbsql_connect) */ PHP_FUNCTION(fbsql_pconnect) { - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); + php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ @@ -673,15 +673,15 @@ static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC) php_error(E_WARNING, fbcdcClassErrorMessage()); return 0; } - md = fbcdcCreateSession(c,"PHP",link->userName, link->userPassword, link->userName); + md = fbcdcCreateSession(c, "PHP", link->userName, link->userPassword, link->userName); if (fbcmdErrorsFound(md)) { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c,md); + FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); char* emg = fbcemdAllErrorMessages(emd); if (emg) php_error(E_WARNING, emg); else - php_error(E_WARNING,"No message"); + php_error(E_WARNING, "No message"); free(emg); fbcemdRelease(emd); fbcmdRelease(md); @@ -694,13 +694,13 @@ static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC) if (c) { if (link->autoCommit) - md = fbcdcExecuteDirectSQL(c,"SET COMMIT TRUE;"); + md = fbcdcExecuteDirectSQL(c, "SET COMMIT TRUE;"); else - md = fbcdcExecuteDirectSQL(c,"SET COMMIT FALSE;"); + md = fbcdcExecuteDirectSQL(c, "SET COMMIT FALSE;"); fbcmdRelease(md); } - fbcdcSetOutputCharacterSet(c,FBC_ISO8859_1); - fbcdcSetInputCharacterSet(c,FBC_ISO8859_1); + fbcdcSetOutputCharacterSet(c, FBC_ISO8859_1); + fbcdcSetInputCharacterSet(c, FBC_ISO8859_1); if (link->connection) { @@ -724,7 +724,7 @@ void phpfbestrdup(const char * s, int* length, char** value) { char* r = emalloc(l+1); if (s) - strcpy(r,s); + strcpy(r, s); else r[0] = 0; *value = r; @@ -1060,8 +1060,8 @@ PHP_FUNCTION(fbsql_select_db) { int port = atoi(name); if (port == 0 || port > 64535) { - php_error(E_WARNING,"Cannot connect to FBExec for database '%s'",name); - php_error(E_WARNING,fbcehClassErrorMessage()); + php_error(E_WARNING, "Cannot connect to FBExec for database '%s'", name); + php_error(E_WARNING, fbcehClassErrorMessage()); RETURN_FALSE; } } @@ -1121,7 +1121,7 @@ PHP_FUNCTION(fbsql_change_user) convert_to_string_ex(password); userPassword = (*password)->value.str.val; - sprintf(buffer,"SET AUTHORIZATION %s;",userName); + sprintf(buffer, "SET AUTHORIZATION %s;", userName); phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, buffer, phpLink); if (return_value->value.lval) @@ -1174,13 +1174,13 @@ PHP_FUNCTION(fbsql_create_db) else if (status == FBRunning ) txt = "running"; else if (status == FBStopping) txt = "stopping"; else if (status == FBNoExec ) txt = "no exec"; - php_error(E_WARNING, "Could not create %s@%s, database is %s",databaseName, phpLink->hostName,txt); + php_error(E_WARNING, "Could not create %s@%s, database is %s", databaseName, phpLink->hostName, txt); RETURN_FALSE; } if (!fbcehCreateDatabaseNamedWithOptions(phpLink->execHandler, databaseName, "")) { char* error = fbechErrorMessage(phpLink->execHandler); - php_error(E_WARNING, "Could not create %s@%s. %s.",databaseName,phpLink->hostName,error); + php_error(E_WARNING, "Could not create %s@%s. %s.", databaseName, phpLink->hostName, error); RETURN_FALSE; } for (i=0; i < 20; i++) @@ -1190,12 +1190,12 @@ PHP_FUNCTION(fbsql_create_db) #else sleep(1); #endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler,databaseName); + status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); if (status == FBRunning) break; } if (status != FBRunning) { - php_error(E_WARNING, "Database %s@%s created -- status unknown",databaseName, phpLink->hostName); + php_error(E_WARNING, "Database %s@%s created -- status unknown", databaseName, phpLink->hostName); RETURN_FALSE; } RETURN_TRUE; @@ -1235,7 +1235,7 @@ PHP_FUNCTION(fbsql_drop_db) convert_to_string_ex(database_name); databaseName = (*database_name)->value.str.val; - status = fbcehStatusForDatabaseNamed(phpLink->execHandler,databaseName); + status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); if (status != FBStopped) { char* txt = "Unknown status"; @@ -1245,14 +1245,14 @@ PHP_FUNCTION(fbsql_drop_db) else if (status == FBRunning ) txt = "running"; else if (status == FBStopping ) txt = "stopping"; else if (status == FBNoExec ) txt = "no exec"; - php_error(E_WARNING, "Could not drop %s@%s, database is %s.",databaseName,phpLink->hostName,txt); + php_error(E_WARNING, "Could not drop %s@%s, database is %s.", databaseName, phpLink->hostName, txt); RETURN_FALSE; } if (! fbcehDeleteDatabaseNamed (phpLink->execHandler, databaseName)) { char* error = fbechErrorMessage(phpLink->execHandler); - php_error(E_WARNING, "Could not drop %s@%s. %s.",databaseName,phpLink->hostName,error); + php_error(E_WARNING, "Could not drop %s@%s. %s.", databaseName, phpLink->hostName, error); RETURN_FALSE; } for (i=0; i < 20; i++) @@ -1262,12 +1262,12 @@ PHP_FUNCTION(fbsql_drop_db) #else sleep(1); #endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler,databaseName); + status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); if (status == FBUnknownStatus) break; } if (status != FBUnknownStatus) { - php_error(E_WARNING, "Database %s@%s dropped -- status unknown",databaseName,phpLink->hostName); + php_error(E_WARNING, "Database %s@%s dropped -- status unknown", databaseName, phpLink->hostName); RETURN_FALSE; } } @@ -1306,7 +1306,7 @@ PHP_FUNCTION(fbsql_start_db) convert_to_string_ex(database_name); databaseName = (*database_name)->value.str.val; - status = fbcehStatusForDatabaseNamed(phpLink->execHandler,databaseName); + status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); if ((status != FBStopped) && (status != FBRunning) && (status != FBStarting)) { char* txt = "Unknown status"; @@ -1315,7 +1315,7 @@ PHP_FUNCTION(fbsql_start_db) else if (status == FBRunning ) txt = "running"; else if (status == FBStopping) txt = "stopping"; else if (status == FBNoExec ) txt = "no exec"; - php_error(E_WARNING, "Could not start %s@%s, as database is %s.",databaseName,phpLink->hostName,txt); + php_error(E_WARNING, "Could not start %s@%s, as database is %s.", databaseName, phpLink->hostName, txt); RETURN_FALSE; } @@ -1324,7 +1324,7 @@ PHP_FUNCTION(fbsql_start_db) if (!fbcehStartDatabaseNamed (phpLink->execHandler, databaseName)) { char* error = fbechErrorMessage(phpLink->execHandler); - php_error(E_WARNING, "Could not start %s@%s. %s.",databaseName,phpLink->hostName,error); + php_error(E_WARNING, "Could not start %s@%s. %s.", databaseName, phpLink->hostName, error); RETURN_FALSE; } } @@ -1336,12 +1336,12 @@ PHP_FUNCTION(fbsql_start_db) #else sleep(1); #endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler,databaseName); + status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); if (status == FBRunning) break; } if (status != FBRunning) { - php_error(E_WARNING, "Database %s@%s started -- status unknown",databaseName,phpLink->hostName); + php_error(E_WARNING, "Database %s@%s started -- status unknown", databaseName, phpLink->hostName); RETURN_FALSE; } RETURN_TRUE; @@ -1385,16 +1385,16 @@ PHP_FUNCTION(fbsql_stop_db) RETURN_FALSE; } -/* printf("Stop db %x\n",phpDatabase->connection); */ +/* printf("Stop db %x\n", phpDatabase->connection); */ if (!fbcdcStopDatabase(phpLink->connection)) { - php_error(E_WARNING, "Cannot stop database %s@%s",databaseName,phpLink->hostName); + php_error(E_WARNING, "Cannot stop database %s@%s", databaseName, phpLink->hostName); RETURN_FALSE; } for (i=0; i < 20; i++) { - status = fbcehStatusForDatabaseNamed(phpLink->execHandler,databaseName); + status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); if (status == FBStopped) break; #ifdef PHP_WIN32 Sleep(1000); @@ -1470,14 +1470,14 @@ int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql) } else if (fbcmdErrorsFound(md)) { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c,md); + FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); char* emg = fbcemdAllErrorMessages(emd); if (FB_SQL_G(generateWarnings)) { if (emg) php_error(E_WARNING, "Error in statement: '%s' %s", sql, emg); else - php_error(E_WARNING,"No message"); + php_error(E_WARNING, "No message"); } link->errorText = estrdup(emg); link->errorNo = 1; @@ -1770,7 +1770,7 @@ PHP_FUNCTION(fbsql_list_fields) RETURN_FALSE; } - sprintf(sql,"EXTRACT TABLE %s;",tableName); + sprintf(sql, "EXTRACT TABLE %s;", tableName); phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink); } @@ -1847,7 +1847,7 @@ PHP_FUNCTION(fbsql_warnings) zval **argv[1]; if ((argc < 0) || (argc > 1)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc,&argv[0])==FAILURE) RETURN_FALSE; + if (zend_get_parameters_ex(argc, &argv[0])==FAILURE) RETURN_FALSE; if (argc >= 1) { convert_to_long_ex(argv[0]); @@ -1932,7 +1932,7 @@ int phpSizeOfInt (int i) /* {{{ phpfbColumnAsString */ -void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* length, char** value) +void phpfbColumnAsString (PHPFBResult* result, int column, void* data , int* length, char** value) { FBCMetaData* md = result->metaData; const FBCDatatypeMetaData* dtmd = fbcmdDatatypeMetaDataAtIndex(md, column); @@ -1943,11 +1943,11 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng { unsigned char v = *((unsigned char*)(data)); if (v == 255) - phpfbestrdup("Unknown",length,value); + phpfbestrdup("Unknown", length, value); else if (v == 0) - phpfbestrdup("False",length,value); + phpfbestrdup("False", length, value); else - phpfbestrdup("True",length,value); + phpfbestrdup("True", length, value); } break; @@ -1956,8 +1956,8 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng { int v = *((int*)data); char b[128]; - sprintf(b,"%d",v); - phpfbestrdup(b,length,value); + sprintf(b, "%d", v); + phpfbestrdup(b, length, value); } break; @@ -1965,8 +1965,8 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng { short v = *((short*)data); char b[128]; - sprintf(b,"%d",v); - phpfbestrdup(b,length,value); + sprintf(b, "%d", v); + phpfbestrdup(b, length, value); } break; @@ -1978,8 +1978,8 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng { double v = *((double*)data); char b[128]; - sprintf(b,"%f",v); - phpfbestrdup(b,length,value); + sprintf(b, "%f", v); + phpfbestrdup(b, length, value); } break; @@ -1987,14 +1987,14 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng case FB_VCharacter: { char* v = (char*)data; - phpfbestrdup(v,length,value); + phpfbestrdup(v, length, value); } break; case FB_Bit: case FB_VBit: { - const FBCColumnMetaData* clmd = fbcmdColumnMetaDataAtIndex(md,column); + const FBCColumnMetaData* clmd = fbcmdColumnMetaDataAtIndex(md, column); struct bitValue { unsigned int nBytes; @@ -2017,7 +2017,7 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng for (i = 0; i < nBits / 8; i++) { char c[4]; - sprintf(c,"%02x",ptr->bytes[i]); + sprintf(c, "%02x", ptr->bytes[i]); r[i*2+2] = c[0]; r[i*2+3] = c[1]; } @@ -2057,7 +2057,7 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng case FB_TimestampTZ: { char* v = (char*)data; - phpfbestrdup(v,length,value); + phpfbestrdup(v, length, value); } break; @@ -2065,8 +2065,8 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng { char b[128]; int v = *((unsigned int*)data); - sprintf(b,"%d",v); - phpfbestrdup(b,length,value); + sprintf(b, "%d", v); + phpfbestrdup(b, length, value); } break; @@ -2074,8 +2074,8 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng { char b[128]; double seconds = *((double*)data); - sprintf(b,"%f",seconds); - phpfbestrdup(b,length,value); + sprintf(b, "%f", seconds); + phpfbestrdup(b, length, value); } break; @@ -2088,28 +2088,28 @@ void phpfbColumnAsString (PHPFBResult* result, int column, void* data ,int* leng unsigned int l = *((unsigned int*)(bytes+1)); unsigned char* ptr = *((unsigned char**)(bytes+5)); unsigned int i; - mf(file,"%4d:",l); + mf(file, "%4d:", l); for (i=0; i < l; i++) { if (i) { if ((i % 32) == 0) - mf(file,"\n %*d:",lw+4,i); + mf(file, "\n %*d:", lw+4, i); else if ((i % 4) == 0) - mf(file," "); + mf(file, " "); } - mf(file,"%02x",*ptr++); + mf(file, "%02x", *ptr++); } } else { - mf(file,"%s",bytes+1); + mf(file, "%s", bytes+1); } } break; */ default: - php_error(E_WARNING,"Unimplemented type"); + php_error(E_WARNING, "Unimplemented type"); break; } } @@ -2122,21 +2122,21 @@ void phpfbSqlResult (INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowI void** row; if (result->list) { - FBCPList* columns = (FBCPList*)fbcplValueForKey(result->list,"COLUMNS"); - FBCPList* column = (FBCPList*)fbcplValueAtIndex(columns,result->rowIndex); + FBCPList* columns = (FBCPList*)fbcplValueForKey(result->list, "COLUMNS"); + FBCPList* column = (FBCPList*)fbcplValueAtIndex(columns, result->rowIndex); if (columnIndex == 0) { /* Name */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column,"NAME"); + FBCPList* name = (FBCPList*)fbcplValueForKey(column, "NAME"); RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); } else if (columnIndex == 2) { /* Length */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column,"WIDTH"); + FBCPList* name = (FBCPList*)fbcplValueForKey(column, "WIDTH"); RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); } else if (columnIndex == 1) { /* Type */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column,"DATATYPE"); + FBCPList* name = (FBCPList*)fbcplValueForKey(column, "DATATYPE"); RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); } else if (columnIndex == 3) @@ -2150,28 +2150,28 @@ void phpfbSqlResult (INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowI } else if (result->array) { /* Special case for get dbs */ - RETURN_STRING(fbaObjectAtIndex(result->array,rowIndex), 1); + RETURN_STRING(fbaObjectAtIndex(result->array, rowIndex), 1); } - else if (!phpfbFetchRow(result,rowIndex)) + else if (!phpfbFetchRow(result, rowIndex)) { - php_error(E_WARNING,"No such row %d in result set %d",rowIndex,rowIndex); + php_error(E_WARNING, "No such row %d in result set %d", rowIndex, rowIndex); RETURN_FALSE; } else if (columnIndex >= result->columnCount) { - php_error(E_WARNING,"No such column %d in result set %d",columnIndex,rowIndex); + php_error(E_WARNING, "No such column %d in result set %d", columnIndex, rowIndex); RETURN_FALSE; } else { - row = fbcrhRowAtIndex(result->rowHandler,rowIndex); + row = fbcrhRowAtIndex(result->rowHandler, rowIndex); if (row == NULL) { RETURN_FALSE; } else if (row[columnIndex]) { - phpfbColumnAsString(result,columnIndex,row[columnIndex],&return_value->value.str.len,&return_value->value.str.val); + phpfbColumnAsString(result, columnIndex, row[columnIndex], &return_value->value.str.len, &return_value->value.str.val); return_value->type = IS_STRING; } else @@ -2239,13 +2239,13 @@ PHP_FUNCTION(fbsql_result) columnIndex = (*field)->value.lval; if (columnIndex < 0) { - php_error(E_WARNING,"Illegal column index - %d",columnIndex); + php_error(E_WARNING, "Illegal column index - %d", columnIndex); RETURN_FALSE; } } } - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU,result,rowIndex,columnIndex); + phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, rowIndex, columnIndex); result->columnIndex++; if (result->columnIndex == result->columnCount) @@ -2330,7 +2330,7 @@ PHP_FUNCTION(fbsql_num_rows) rowCount = fbcmdRowCount(result->metaData); if (rowCount == -1) { - phpfbFetchRow(result,0x7fffffff); + phpfbFetchRow(result, 0x7fffffff); rowCount = result->rowCount; } } @@ -2432,7 +2432,7 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) rowIndex = result->rowIndex; if (((result_type & FBSQL_NUM) != FBSQL_NUM) && ((result_type & FBSQL_ASSOC) != FBSQL_ASSOC)) { - php_error(E_WARNING,"Illegal result type use FBSQL_NUM, FBSQL_ASSOC, or FBSQL_BOTH."); + php_error(E_WARNING, "Illegal result type use FBSQL_NUM, FBSQL_ASSOC, or FBSQL_BOTH."); RETURN_FALSE; } if (array_init(return_value)==FAILURE) @@ -2451,11 +2451,11 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) } if (result_type & FBSQL_NUM) { - add_index_string(return_value,0,estrdup(fbaObjectAtIndex(result->array,result->rowIndex)),0); + add_index_string(return_value, 0, estrdup(fbaObjectAtIndex(result->array, result->rowIndex)), 0); } if (result_type & FBSQL_ASSOC) { - add_assoc_string(return_value, "Database", estrdup(fbaObjectAtIndex(result->array,result->rowIndex)), 0); + add_assoc_string(return_value, "Database", estrdup(fbaObjectAtIndex(result->array, result->rowIndex)), 0); } } else { @@ -2464,11 +2464,11 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) } if (result->rowCount == 0x7fffffff) { - if (!phpfbFetchRow(result,result->rowIndex)) { + if (!phpfbFetchRow(result, result->rowIndex)) { RETURN_FALSE; } } - row = fbcrhRowAtIndex(result->rowHandler,rowIndex); + row = fbcrhRowAtIndex(result->rowHandler, rowIndex); if (row == NULL) { RETURN_FALSE; @@ -2480,28 +2480,28 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) char* value; unsigned int length; unsigned int c = 0; - phpfbColumnAsString(result,i,row[i],&length,&value); + phpfbColumnAsString(result, i, row[i], &length, &value); if (result_type & FBSQL_NUM) { - add_index_stringl(return_value,i,value,length,c); + add_index_stringl(return_value, i, value, length, c); c = 1; } if (result_type & FBSQL_ASSOC) { char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_stringl(return_value,key, value, length, c); + add_assoc_stringl(return_value, key, value, length, c); } } else { if (result_type & FBSQL_NUM) { - add_index_unset(return_value,i); + add_index_unset(return_value, i); } if (result_type & FBSQL_ASSOC) { char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_unset(return_value,key); + add_assoc_unset(return_value, key); } } } @@ -2536,11 +2536,11 @@ PHP_FUNCTION(fbsql_data_seek) if (rowIndex < 0) { - php_error(E_WARNING,"Illegal row_index (%i)", rowIndex); + php_error(E_WARNING, "Illegal row_index (%i)", rowIndex); RETURN_FALSE; } - if (result->rowCount == 0x7fffffff) phpfbFetchRow(result,rowIndex); + if (result->rowCount == 0x7fffffff) phpfbFetchRow(result, rowIndex); if (rowIndex > result->rowCount) RETURN_FALSE; result->rowIndex = rowIndex; @@ -2573,7 +2573,7 @@ PHP_FUNCTION(fbsql_fetch_lengths) for (i=0; i < result->columnCount; i++) { unsigned length = 0; - if (result->row[i]) phpfbColumnAsString(result,i, result->row[i],&length,NULL); + if (result->row[i]) phpfbColumnAsString(result, i, result->row[i], &length, NULL); add_index_long(return_value, i, length); } } @@ -2611,7 +2611,7 @@ PHP_FUNCTION(fbsql_fetch_field) column = Z_LVAL_PP(field_index); if (column < 0 || column >= result->columnCount) { - php_error(E_WARNING,"%d no such column in result",column); + php_error(E_WARNING, "%d no such column in result", column); RETURN_FALSE; } } @@ -2619,19 +2619,19 @@ PHP_FUNCTION(fbsql_fetch_field) { RETURN_FALSE; } - add_property_string(return_value, "name", (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)),1); - add_property_string(return_value, "table", (char*)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData,column)),1); - add_property_long(return_value, "max_length", fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData,column)))); - add_property_string(return_value, "type", (char*)fbcdmdDatatypeString(fbcmdDatatypeMetaDataAtIndex(result->metaData, column)),1); + add_property_string(return_value, "name", (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); + add_property_string(return_value, "table", (char*)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); + add_property_long(return_value, "max_length", fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); + add_property_string(return_value, "type", (char*)fbcdmdDatatypeString(fbcmdDatatypeMetaDataAtIndex(result->metaData, column)), 1); add_property_long(return_value, "not_null", !fbccmdIsNullable(fbcmdColumnMetaDataAtIndex(result->metaData, column))); /* Remember to add the rest */ -/* add_property_long(return_value, "primary_key",IS_PRI_KEY(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "multiple_key",(fbsql_field->flags&MULTIPLE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "unique_key",(fbsql_field->flags&UNIQUE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "numeric",IS_NUM(fbsql_field->type)?1:0); */ -/* add_property_long(return_value, "blob",IS_BLOB(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "unsigned",(fbsql_field->flags&UNSIGNED_FLAG?1:0)); */ -/* add_property_long(return_value, "zerofill",(fbsql_field->flags&ZEROFILL_FLAG?1:0)); */ +/* add_property_long(return_value, "primary_key", IS_PRI_KEY(fbsql_field->flags)?1:0); */ +/* add_property_long(return_value, "multiple_key", (fbsql_field->flags&MULTIPLE_KEY_FLAG?1:0)); */ +/* add_property_long(return_value, "unique_key", (fbsql_field->flags&UNIQUE_KEY_FLAG?1:0)); */ +/* add_property_long(return_value, "numeric", IS_NUM(fbsql_field->type)?1:0); */ +/* add_property_long(return_value, "blob", IS_BLOB(fbsql_field->flags)?1:0); */ +/* add_property_long(return_value, "unsigned", (fbsql_field->flags&UNSIGNED_FLAG?1:0)); */ +/* add_property_long(return_value, "zerofill", (fbsql_field->flags&ZEROFILL_FLAG?1:0)); */ } /* }}} */ @@ -2667,7 +2667,7 @@ PHP_FUNCTION(fbsql_field_seek) column = Z_LVAL_PP(field_index); if (column < 0 || column >= result->columnCount) { - php_error(E_WARNING,"%d no such column in result",column); + php_error(E_WARNING, "%d no such column in result", column); RETURN_FALSE; } } @@ -2709,13 +2709,13 @@ PHP_FUNCTION(fbsql_field_name) column = Z_LVAL_PP(field_index); if (column < 0 || column >= result->columnCount) { - php_error(E_WARNING,"%d no such column in result",column); + php_error(E_WARNING, "%d no such column in result", column); RETURN_FALSE; } } if (result->list) { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU,result,result->rowIndex,0); + phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 0); } else if (result->metaData) { @@ -2757,11 +2757,11 @@ PHP_FUNCTION(fbsql_field_table) column = Z_LVAL_PP(field_index); if (column < 0 || column >= result->columnCount) { - php_error(E_WARNING,"%d no such column in result",column); + php_error(E_WARNING, "%d no such column in result", column); RETURN_FALSE; } } - RETURN_STRING((char *)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData,column)), 1); + RETURN_STRING((char *)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); } /* }}} */ @@ -2797,17 +2797,17 @@ PHP_FUNCTION(fbsql_field_len) column = Z_LVAL_PP(field_index); if (column < 0 || column >= result->columnCount) { - php_error(E_WARNING,"%d no such column in result",column); + php_error(E_WARNING, "%d no such column in result", column); RETURN_FALSE; } } if (result->list) { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU,result,result->rowIndex,2); + phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 2); } else if (result->metaData) { - RETURN_LONG(fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData,column)))); + RETURN_LONG(fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); } else { @@ -2848,13 +2848,13 @@ PHP_FUNCTION(fbsql_field_type) column = Z_LVAL_PP(field_index); if (column < 0 || column >= result->columnCount) { - php_error(E_WARNING,"%d no such column in result",column); + php_error(E_WARNING, "%d no such column in result", column); RETURN_FALSE; } } if (result->list) { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU,result,result->rowIndex,1); + phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 1); } else if (result->metaData) { @@ -2901,7 +2901,7 @@ PHP_FUNCTION(fbsql_field_flags) column = Z_LVAL_PP(field_index); if (column < 0 || column >= result->columnCount) { - php_error(E_WARNING,"%d no such column in result",column); + php_error(E_WARNING, "%d no such column in result", column); RETURN_FALSE; } } diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index 43fade2ee0..a1b880a46c 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -257,7 +257,7 @@ PHP_FUNCTION(fdf_get_value) buffer = emalloc(size); err = FDFGetValue(fdf, Z_STRVAL_PP(fieldname), buffer, size-1, &nr); if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer,nr+1); + buffer = erealloc(buffer, nr+1); err = FDFGetValue(fdf, Z_STRVAL_PP(fieldname), buffer, nr, &nr); } @@ -325,8 +325,8 @@ PHP_FUNCTION(fdf_next_field_name) err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer,nr+1); - err = FDFNextFieldName(fdf, fieldname, buffer, length-1,&nr); + buffer = erealloc(buffer, nr+1); + err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); } if(err != FDFErcOK) { @@ -435,7 +435,7 @@ PHP_FUNCTION(fdf_get_status) err = FDFGetStatus(fdf, buf, size-1, &nr); if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf,nr+1); + buf = erealloc(buf, nr+1); err = FDFGetStatus(fdf, buf, size-1, &nr); } @@ -496,7 +496,7 @@ PHP_FUNCTION(fdf_get_file) err = FDFGetFile(fdf, buf, size-1, &nr); if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf,nr+1); + buf = erealloc(buf, nr+1); err = FDFGetFile(fdf, buf, size-1, &nr); } @@ -594,7 +594,7 @@ PHP_FUNCTION(fdf_set_flags) convert_to_long_ex(flags); convert_to_long_ex(newflags); - err=FDFSetFlags(fdf,Z_STRVAL_PP(fieldname), Z_LVAL_PP(flags), Z_LVAL_PP(newflags)); + err=FDFSetFlags(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(flags), Z_LVAL_PP(newflags)); if(err != FDFErcOK) { php_error(E_WARNING,"Error setting flags for field: %s", Z_STRVAL_PP(fieldname)); RETURN_FALSE; @@ -623,7 +623,7 @@ PHP_FUNCTION(fdf_set_opt) convert_to_string_ex(value); convert_to_string_ex(name); - err = FDFSetOpt(fdf,Z_STRVAL_PP(fieldname), Z_LVAL_PP(element), Z_STRVAL_PP(value), Z_STRVAL_PP(name)); + err = FDFSetOpt(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(element), Z_STRVAL_PP(value), Z_STRVAL_PP(name)); if(err != FDFErcOK) { php_error(E_WARNING,"Error setting FDF option for field: %s", Z_STRVAL_PP(fieldname)); RETURN_FALSE; @@ -719,8 +719,8 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler) { FILE *fp; FDFDoc theFDF; - char *name=NULL,*value=NULL,*p, *data; - int name_len=0,value_len=0; + char *name=NULL, *value=NULL, *p, *data; + int name_len=0, value_len=0; char *lastfieldname =NULL; char *filename = NULL; FDFErc err; @@ -732,23 +732,23 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler) if(filename) efree(filename); return; } - fwrite(SG(request_info).post_data,SG(request_info).post_data_length,1,fp); + fwrite(SG(request_info).post_data, SG(request_info).post_data_length, 1, fp); fclose(fp); /* Set HTTP_FDF_DATA variable */ - data = estrndup(SG(request_info).post_data,SG(request_info).post_data_length); + data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); SET_VAR_STRINGL("HTTP_FDF_DATA", data, SG(request_info).post_data_length); - err = FDFOpen(filename,0,&theFDF); + err = FDFOpen(filename, 0, &theFDF); if(err==FDFErcOK){ name = emalloc(name_len=256); value= emalloc(value_len=256); while (1) { - err = FDFNextFieldName(theFDF,lastfieldname,name,name_len-1,&nBytes); + err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); if(err == FDFErcBufTooShort && nBytes >0 ) { - name = erealloc(name,name_len=(nBytes+1)); - err = FDFNextFieldName(theFDF,lastfieldname,name,name_len-1,&nBytes); + name = erealloc(name, name_len=(nBytes+1)); + err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); } if(err != FDFErcOK || nBytes == 0) break; @@ -756,13 +756,13 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler) if(lastfieldname) efree(lastfieldname); lastfieldname = estrdup(name); - err = FDFGetValue(theFDF,name,NULL,0,&nBytes); + err = FDFGetValue(theFDF, name, NULL, 0, &nBytes); if(err != FDFErcOK && err != FDFErcNoValue ) break; - if(value_len<nBytes+1) value = erealloc(value,value_len=(nBytes+1)); + if(value_len<nBytes+1) value = erealloc(value, value_len=(nBytes+1)); if(nBytes>0) { - err = FDFGetValue(theFDF,name,value,value_len-1,&nBytes); + err = FDFGetValue(theFDF, name, value, value_len-1, &nBytes); if(err == FDFErcOK && nBytes != 0) { for(p=value;*p;p++) if(*p=='\r') *p='\n'; if(lastfieldname) efree(lastfieldname); diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c index ed56136882..1b3836ed26 100644 --- a/ext/filepro/filepro.c +++ b/ext/filepro/filepro.c @@ -271,7 +271,7 @@ PHP_FUNCTION(filepro) } fclose(fp); - FP_GLOBAL(fp_database) = estrndup(dir->value.str.val,dir->value.str.len); + FP_GLOBAL(fp_database) = estrndup(dir->value.str.val, dir->value.str.len); RETVAL_TRUE; } @@ -367,7 +367,7 @@ PHP_FUNCTION(filepro_fieldname) for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { if (i == fno->value.lval) { - RETURN_STRING(lp->name,1); + RETURN_STRING(lp->name, 1); } } @@ -408,7 +408,7 @@ PHP_FUNCTION(filepro_fieldtype) for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { if (i == fno->value.lval) { - RETURN_STRING(lp->format,1); + RETURN_STRING(lp->format, 1); } } php_error(E_WARNING, @@ -559,7 +559,7 @@ PHP_FUNCTION(filepro_retrieve) } readbuf[lp->width] = '\0'; fclose(fp); - RETURN_STRING(readbuf,1); + RETURN_STRING(readbuf, 1); } /* }}} */ diff --git a/ext/fribidi/fribidi.c b/ext/fribidi/fribidi.c index 1fe9fe115c..f28ba13427 100755 --- a/ext/fribidi/fribidi.c +++ b/ext/fribidi/fribidi.c @@ -65,12 +65,12 @@ ZEND_GET_MODULE(fribidi) */ PHP_MINIT_FUNCTION(fribidi) { - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_UTF8",FRIBIDI_CHARSET_UTF8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_6",FRIBIDI_CHARSET_8859_6, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_8",FRIBIDI_CHARSET_8859_8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1255",FRIBIDI_CHARSET_CP1255, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1256",FRIBIDI_CHARSET_CP1256, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_ISIRI_3342",FRIBIDI_CHARSET_ISIRI_3342, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_UTF8", FRIBIDI_CHARSET_UTF8, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_6", FRIBIDI_CHARSET_8859_6, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_8", FRIBIDI_CHARSET_8859_8, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1255", FRIBIDI_CHARSET_CP1255, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1256", FRIBIDI_CHARSET_CP1256, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_ISIRI_3342", FRIBIDI_CHARSET_ISIRI_3342, CONST_CS | CONST_PERSISTENT); return SUCCESS; } @@ -121,13 +121,13 @@ PHP_MINFO_FUNCTION(fribidi) Convert a logical string to a visual one */ PHP_FUNCTION(fribidi_log2vis) { - zval **parameter1,**parameter2, **parameter3; + zval **parameter1, **parameter2, **parameter3; - FriBidiChar *u_logical_str,*u_visual_str; /* unicode strings .... */ + FriBidiChar *u_logical_str, *u_visual_str; /* unicode strings .... */ char *inString; guchar *outString; - int len,alloc_len,utf8_len; + int len, alloc_len, utf8_len; FriBidiCharType base_dir; @@ -172,25 +172,25 @@ PHP_FUNCTION(fribidi_log2vis) switch(Z_LVAL_PP(parameter3)) { case FRIBIDI_CHARSET_UTF8: - utf8_len=fribidi_utf8_to_unicode(inString,u_logical_str); + utf8_len=fribidi_utf8_to_unicode(inString, u_logical_str); break; case FRIBIDI_CHARSET_8859_6: - fribidi_iso8859_6_to_unicode(inString,u_logical_str); + fribidi_iso8859_6_to_unicode(inString, u_logical_str); break; case FRIBIDI_CHARSET_8859_8: - fribidi_iso8859_8_to_unicode(inString,u_logical_str); + fribidi_iso8859_8_to_unicode(inString, u_logical_str); break; case FRIBIDI_CHARSET_CP1255: - fribidi_cp1255_to_unicode(inString,u_logical_str); + fribidi_cp1255_to_unicode(inString, u_logical_str); break; case FRIBIDI_CHARSET_CP1256: - fribidi_cp1256_to_unicode(inString,u_logical_str); + fribidi_cp1256_to_unicode(inString, u_logical_str); break; case FRIBIDI_CHARSET_ISIRI_3342: - fribidi_isiri_3342_to_unicode(inString,u_logical_str); + fribidi_isiri_3342_to_unicode(inString, u_logical_str); break; default: - zend_error(E_ERROR,"unknown character set %d<BR>",Z_LVAL_PP(parameter3)); + zend_error(E_ERROR,"unknown character set %d<BR>", Z_LVAL_PP(parameter3)); } @@ -203,31 +203,31 @@ PHP_FUNCTION(fribidi_log2vis) else base_dir = FRIBIDI_TYPE_N; - fribidi_log2vis(u_logical_str,len,&base_dir,u_visual_str,position_L_to_V_list,position_V_to_L_list,embedding_level_list); + fribidi_log2vis(u_logical_str, len, &base_dir, u_visual_str, position_L_to_V_list, position_V_to_L_list, embedding_level_list); /* convert back to original char set */ switch(Z_LVAL_PP(parameter3)) { case FRIBIDI_CHARSET_UTF8: - fribidi_unicode_to_utf8(u_visual_str,utf8_len , outString); + fribidi_unicode_to_utf8(u_visual_str, utf8_len , outString); break; case FRIBIDI_CHARSET_8859_6: - fribidi_unicode_to_iso8859_6(u_visual_str,len , outString); + fribidi_unicode_to_iso8859_6(u_visual_str, len , outString); break; case FRIBIDI_CHARSET_8859_8: - fribidi_unicode_to_iso8859_8(u_visual_str,len , outString); + fribidi_unicode_to_iso8859_8(u_visual_str, len , outString); break; case FRIBIDI_CHARSET_CP1255: - fribidi_unicode_to_cp1255(u_visual_str,len , outString); + fribidi_unicode_to_cp1255(u_visual_str, len , outString); break; case FRIBIDI_CHARSET_CP1256: - fribidi_unicode_to_cp1256(u_visual_str,len , outString); + fribidi_unicode_to_cp1256(u_visual_str, len , outString); break; case FRIBIDI_CHARSET_ISIRI_3342: - fribidi_unicode_to_isiri_3342(u_visual_str,len , outString); + fribidi_unicode_to_isiri_3342(u_visual_str, len , outString); break; default: - zend_error(E_ERROR,"unknown character set %d<BR>",Z_LVAL_PP(parameter3)); + zend_error(E_ERROR,"unknown character set %d<BR>", Z_LVAL_PP(parameter3)); } @@ -238,7 +238,7 @@ PHP_FUNCTION(fribidi_log2vis) efree(position_V_to_L_list); efree(embedding_level_list); - RETURN_STRING(outString,1); + RETURN_STRING(outString, 1); } /* }}} */ diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index d7146d6059..daaf481f52 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -1045,7 +1045,7 @@ ftp_getdata(ftpbuf_t *ftp) struct sockaddr_in addr; int size; union ipbox ipbox; - char arg[sizeof("255,255,255,255,255,255")]; + char arg[sizeof("255, 255, 255, 255, 255, 255")]; /* ask for a passive connection if we need one */ diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 36ac8d23bb..dc057d1dda 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -635,7 +635,7 @@ PHP_FUNCTION(ftp_fput) FTPBUF(ftp, arg1); convert_to_string(arg2); - rsrc = zend_fetch_resource(&arg3 TSRMLS_CC,-1,"File-Handle",&type,3,php_file_le_fopen(),php_file_le_popen(),php_file_le_socket()); + rsrc = zend_fetch_resource(&arg3 TSRMLS_CC,-1,"File-Handle", &type, 3, php_file_le_fopen(), php_file_le_popen(), php_file_le_socket()); ZEND_VERIFY_RESOURCE(rsrc); XTYPE(xtype, arg4); diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 9e3b507880..f7e781ef3e 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -90,7 +90,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int); #define gdImageCreateFromPngCtx NULL #define gdImageCreateFromWBMPCtx NULL typedef FILE gdIOCtx; -#define CTX_PUTC(c,fp) fputc(c, fp) +#define CTX_PUTC(c, fp) fputc(c, fp) #endif static gdImagePtr _php_image_create_from_string (zval **Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC); @@ -666,7 +666,7 @@ PHP_FUNCTION(imagefilledarc) #if HAVE_LIBGD20 zval **IM, **cx, **cy, **w, **h, **ST, **E, **col, **style; gdImagePtr im; - int e,st; + int e, st; if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); @@ -689,7 +689,7 @@ PHP_FUNCTION(imagefilledarc) if (e < 0) e %= 360; if (st < 0) st %= 360; - gdImageFilledArc(im,Z_LVAL_PP(cx),Z_LVAL_PP(cy),Z_LVAL_PP(w),Z_LVAL_PP(h),st,e,Z_LVAL_PP(col), Z_LVAL_PP(style)); + gdImageFilledArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col), Z_LVAL_PP(style)); RETURN_TRUE; #else zend_error(E_ERROR, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); @@ -858,7 +858,7 @@ PHP_FUNCTION(imagesettile) ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); - gdImageSetTile(im,tile); + gdImageSetTile(im, tile); RETURN_TRUE; #else @@ -882,7 +882,7 @@ PHP_FUNCTION(imagesetbrush) ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); - gdImageSetBrush(im,tile); + gdImageSetBrush(im, tile); RETURN_TRUE; #else @@ -983,7 +983,7 @@ gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioc gdImagePtr im; gdIOCtx *io_ctx; - io_ctx = gdNewDynamicCtx (Z_STRLEN_PP(data),Z_STRVAL_PP(data)); + io_ctx = gdNewDynamicCtx (Z_STRLEN_PP(data), Z_STRVAL_PP(data)); if(!io_ctx) { return NULL; @@ -1126,7 +1126,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, #endif if(issock && !ioctx_func_p) { - php_error(E_WARNING, "%s: Sockets are not supported for image type '%s'",get_active_function_name(TSRMLS_C),tn); + php_error(E_WARNING, "%s: Sockets are not supported for image type '%s'", get_active_function_name(TSRMLS_C), tn); RETURN_FALSE; } @@ -1134,12 +1134,12 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, #ifdef USE_GD_IOCTX gdIOCtx* io_ctx; size_t buff_size; - char *buff,*buff_em; + char *buff, *buff_em; buff_size = php_fread_all(&buff_em, socketd, fp, issock); if(!buff_size) { - php_error(E_WARNING,"%s: Cannot read image data",get_active_function_name(TSRMLS_C)); + php_error(E_WARNING,"%s: Cannot read image data", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } @@ -1147,9 +1147,9 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, memcpy(buff, buff_em, buff_size); efree(buff_em); - io_ctx = gdNewDynamicCtx(buff_size,buff); + io_ctx = gdNewDynamicCtx(buff_size, buff); if(!io_ctx) { - php_error(E_WARNING,"%s: Cannot allocate GD IO context",get_active_function_name(TSRMLS_C)); + php_error(E_WARNING,"%s: Cannot allocate GD IO context", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } if (image_type == PHP_GDIMG_TYPE_GD2PART) { @@ -1184,7 +1184,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, PHP_FUNCTION(imagecreatefromgif) { #ifdef HAVE_GD_GIF - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageCreateFromGif,gdImageCreateFromGifCtx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageCreateFromGif, gdImageCreateFromGifCtx); #else /* HAVE_GD_GIF */ php_error(E_WARNING, "ImageCreateFromGif: No GIF support in this PHP build"); RETURN_FALSE; @@ -1197,7 +1197,7 @@ PHP_FUNCTION(imagecreatefromgif) PHP_FUNCTION(imagecreatefromjpeg) { #ifdef HAVE_GD_JPG - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageCreateFromJpeg,gdImageCreateFromJpegCtx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageCreateFromJpeg, gdImageCreateFromJpegCtx); #else /* HAVE_GD_JPG */ php_error(E_WARNING, "ImageCreateFromJpeg: No JPEG support in this PHP build"); RETURN_FALSE; @@ -1210,7 +1210,7 @@ PHP_FUNCTION(imagecreatefromjpeg) PHP_FUNCTION(imagecreatefrompng) { #ifdef HAVE_GD_PNG - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImageCreateFromPng,gdImageCreateFromPngCtx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImageCreateFromPng, gdImageCreateFromPngCtx); #else /* HAVE_GD_PNG */ php_error(E_WARNING, "ImageCreateFromPng: No PNG support in this PHP build"); RETURN_FALSE; @@ -1223,7 +1223,7 @@ PHP_FUNCTION(imagecreatefrompng) PHP_FUNCTION(imagecreatefromxbm) { #ifdef HAVE_GD_XBM - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XBM, "XBM", gdImageCreateFromXbm,NULL); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XBM, "XBM", gdImageCreateFromXbm, NULL); #else /* HAVE_GD_XBM */ php_error(E_WARNING, "ImageCreateFromXbm: No XBM support in this PHP build"); RETURN_FALSE; @@ -1237,7 +1237,7 @@ PHP_FUNCTION(imagecreatefromxpm) { /* #ifdef HAVE_GD_XPM - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM, "XPM", gdImageCreateFromXpm,NULL); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM, "XPM", gdImageCreateFromXpm, NULL); #else */ php_error(E_WARNING, "ImageCreateFromXpm: No XPM support in this PHP build"); @@ -1253,7 +1253,7 @@ PHP_FUNCTION(imagecreatefromxpm) PHP_FUNCTION(imagecreatefromwbmp) { #ifdef HAVE_GD_WBMP - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageCreateFromWBMP,gdImageCreateFromWBMPCtx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageCreateFromWBMP, gdImageCreateFromWBMPCtx); #else /* HAVE_GD_WBMP */ php_error(E_WARNING, "ImageCreateFromWBMP: No WBMP support in this PHP build"); RETURN_FALSE; @@ -1265,7 +1265,7 @@ PHP_FUNCTION(imagecreatefromwbmp) Create a new image from GD file or URL */ PHP_FUNCTION(imagecreatefromgd) { - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageCreateFromGd,gdImageCreateFromGdCtx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageCreateFromGd, gdImageCreateFromGdCtx); } /* }}} */ @@ -1274,7 +1274,7 @@ PHP_FUNCTION(imagecreatefromgd) PHP_FUNCTION(imagecreatefromgd2) { #ifdef HAVE_GD_GD2 - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageCreateFromGd2,gdImageCreateFromGd2Ctx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageCreateFromGd2, gdImageCreateFromGd2Ctx); #else /* HAVE_GD_GD2 */ php_error(E_WARNING, "ImageCreateFromGd2: No GD2 support in this PHP build"); RETURN_FALSE; @@ -1287,7 +1287,7 @@ PHP_FUNCTION(imagecreatefromgd2) PHP_FUNCTION(imagecreatefromgd2part) { #ifdef HAVE_GD_GD2 - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2PART, "GD2", gdImageCreateFromGd2Part,gdImageCreateFromGd2PartCtx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2PART, "GD2", gdImageCreateFromGd2Part, gdImageCreateFromGd2PartCtx); #else /* HAVE_GD_GD2 */ php_error(E_WARNING, "ImageCreateFromGd2Part: No GD2 support in this PHP build"); RETURN_FALSE; @@ -1339,7 +1339,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char switch(image_type) { case PHP_GDIMG_CONVERT_WBM: if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(TSRMLS_C), q); + php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255", get_active_function_name(TSRMLS_C), q); } case PHP_GDIMG_TYPE_JPG: (*func_p)(im, fp, q); @@ -1370,7 +1370,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char switch(image_type) { case PHP_GDIMG_CONVERT_WBM: if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(TSRMLS_C), q); + php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255", get_active_function_name(TSRMLS_C), q); } case PHP_GDIMG_TYPE_JPG: (*func_p)(im, tmp, q); @@ -1754,7 +1754,7 @@ PHP_FUNCTION(imagecolorsforindex) RETURN_FALSE; } add_assoc_long(return_value,"red", im->red[col]); - add_assoc_long(return_value,"green",im->green[col]); + add_assoc_long(return_value,"green", im->green[col]); add_assoc_long(return_value,"blue", im->blue[col]); } else { php_error(E_WARNING, "Color index out of range"); @@ -1830,7 +1830,7 @@ PHP_FUNCTION(imagesetpixel) convert_to_long_ex(y); convert_to_long_ex(col); - gdImageSetPixel(im,Z_LVAL_PP(x),Z_LVAL_PP(y),Z_LVAL_PP(col)); + gdImageSetPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); RETURN_TRUE; } @@ -1855,7 +1855,7 @@ PHP_FUNCTION(imageline) convert_to_long_ex(y2); convert_to_long_ex(col); - gdImageLine(im,Z_LVAL_PP(x1),Z_LVAL_PP(y1),Z_LVAL_PP(x2),Z_LVAL_PP(y2),Z_LVAL_PP(col)); + gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ @@ -1879,7 +1879,7 @@ PHP_FUNCTION(imagedashedline) convert_to_long_ex(y2); convert_to_long_ex(col); - gdImageDashedLine(im,Z_LVAL_PP(x1),Z_LVAL_PP(y1),Z_LVAL_PP(x2),Z_LVAL_PP(y2),Z_LVAL_PP(col)); + gdImageDashedLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ @@ -1903,7 +1903,7 @@ PHP_FUNCTION(imagerectangle) convert_to_long_ex(y2); convert_to_long_ex(col); - gdImageRectangle(im,Z_LVAL_PP(x1),Z_LVAL_PP(y1),Z_LVAL_PP(x2),Z_LVAL_PP(y2),Z_LVAL_PP(col)); + gdImageRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ @@ -1927,7 +1927,7 @@ PHP_FUNCTION(imagefilledrectangle) convert_to_long_ex(y2); convert_to_long_ex(col); - gdImageFilledRectangle(im,Z_LVAL_PP(x1),Z_LVAL_PP(y1),Z_LVAL_PP(x2),Z_LVAL_PP(y2),Z_LVAL_PP(col)); + gdImageFilledRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ @@ -1938,7 +1938,7 @@ PHP_FUNCTION(imagearc) { zval **IM, **cx, **cy, **w, **h, **ST, **E, **col; gdImagePtr im; - int e,st; + int e, st; if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); @@ -1960,7 +1960,7 @@ PHP_FUNCTION(imagearc) if (e < 0) e %= 360; if (st < 0) st %= 360; - gdImageArc(im,Z_LVAL_PP(cx),Z_LVAL_PP(cy),Z_LVAL_PP(w),Z_LVAL_PP(h),st,e,Z_LVAL_PP(col)); + gdImageArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ @@ -1983,7 +1983,7 @@ PHP_FUNCTION(imagefilltoborder) convert_to_long_ex(border); convert_to_long_ex(col); - gdImageFillToBorder(im,Z_LVAL_PP(x),Z_LVAL_PP(y),Z_LVAL_PP(border),Z_LVAL_PP(col)); + gdImageFillToBorder(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(border), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ @@ -2005,7 +2005,7 @@ PHP_FUNCTION(imagefill) convert_to_long_ex(y); convert_to_long_ex(col); - gdImageFill(im,Z_LVAL_PP(x),Z_LVAL_PP(y),Z_LVAL_PP(col)); + gdImageFill(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ @@ -2086,7 +2086,7 @@ PHP_FUNCTION(imageinterlace) ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); if (ZEND_NUM_ARGS() > 1) { - gdImageInterlace(im,Z_LVAL_PP(INT)); + gdImageInterlace(im, Z_LVAL_PP(INT)); } RETURN_LONG(gdImageGetInterlaced(im)); @@ -3022,7 +3022,7 @@ PHP_FUNCTION(imagepstext) int space; int *f_ind; int h_lines, v_lines, c_ind; - int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl,_fg,_bg; + int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl, _fg, _bg; int aa[16], aa_steps; int width, amount_kern, add_width; double angle, extend; @@ -3332,7 +3332,7 @@ static void _php_image_bw_convert( gdImagePtr im_org, gdIOCtx *out, int threshol int color, color_org, median; int dest_height = gdImageSY (im_org); int dest_width = gdImageSX (im_org); - int x,y; + int x, y; TSRMLS_FETCH(); im_dest = gdImageCreate (dest_width, dest_height); @@ -3382,7 +3382,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) gdImagePtr im_org, im_dest, im_tmp; char *fn_org = NULL; char *fn_dest = NULL; - FILE *org,*dest; + FILE *org, *dest; int argc; int dest_height = -1; int dest_width = -1; @@ -3412,7 +3412,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) /* Check threshold value */ if( int_threshold < 0 || int_threshold > 8 ) { - php_error (E_WARNING, "Invalid threshold value '%d' in %s",int_threshold, get_active_function_name(TSRMLS_C)); + php_error (E_WARNING, "Invalid threshold value '%d' in %s", int_threshold, get_active_function_name(TSRMLS_C)); RETURN_FALSE; } diff --git a/ext/gd/gdttf.c b/ext/gd/gdttf.c index 89907c5d28..393f0bdbf7 100644 --- a/ext/gd/gdttf.c +++ b/ext/gd/gdttf.c @@ -60,10 +60,10 @@ extern int gdImageColorResolve(gdImagePtr, int, int, int); #endif #ifndef MAX -#define MAX(a,b) ((a)>(b)?(a):(b)) +#define MAX(a, b) ((a)>(b)?(a):(b)) #endif #ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) +#define MIN(a, b) ((a)<(b)?(a):(b)) #endif typedef struct { @@ -343,7 +343,7 @@ fontFetch ( char **error, void *key ) } #else a->fontname = (char *)malloc(strlen(b->fontname) + 1); - strcpy(a->fontname,b->fontname); + strcpy(a->fontname, b->fontname); #endif a->ptsize = b->ptsize; a->angle = b->angle; @@ -508,10 +508,10 @@ glyphFetch ( char **error, void *key ) crect[5] = (int)(xmax * sin_a + ymax * cos_a); crect[6] = (int)(xmin * cos_a - ymax * sin_a); crect[7] = (int)(xmin * sin_a + ymax * cos_a); - a->xmin = MIN(MIN(crect[0],crect[2]),MIN(crect[4],crect[6])); - a->xmax = MAX(MAX(crect[0],crect[2]),MAX(crect[4],crect[6])); - a->ymin = MIN(MIN(crect[1],crect[3]),MIN(crect[5],crect[7])); - a->ymax = MAX(MAX(crect[1],crect[3]),MAX(crect[5],crect[7])); + a->xmin = MIN(MIN(crect[0], crect[2]), MIN(crect[4], crect[6])); + a->xmax = MAX(MAX(crect[0], crect[2]), MAX(crect[4], crect[6])); + a->ymin = MIN(MIN(crect[1], crect[3]), MIN(crect[5], crect[7])); + a->ymax = MAX(MAX(crect[1], crect[3]), MAX(crect[5], crect[7])); /* allocate bitmap large enough for character */ a->Bit.rows = (a->ymax - a->ymin + 32 + 64) / 64; diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index dcb3d92368..2e2b70fb43 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -176,7 +176,7 @@ ZEND_MODULE_INFO_D(gmp) if(Z_TYPE_PP(zval) == IS_RESOURCE) { \ ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp);\ } else {\ - if(convert_to_gmp(&gmpnumber,zval,0) == FAILURE) {\ + if(convert_to_gmp(&gmpnumber, zval, 0) == FAILURE) {\ RETURN_FALSE;\ }\ ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp);\ @@ -240,10 +240,10 @@ typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long); /* }}} */ -#define gmp_zval_binary_ui_op(r,a,b,o,u) gmp_zval_binary_ui_op_ex(r,a,b,o,u,0 TSRMLS_CC) -#define gmp_zval_binary_ui_op2(r,a,b,o,u) gmp_zval_binary_ui_op2_ex(r,a,b,o,u,0 TSRMLS_CC) +#define gmp_zval_binary_ui_op(r, a, b, o, u) gmp_zval_binary_ui_op_ex(r, a, b, o, u, 0 TSRMLS_CC) +#define gmp_zval_binary_ui_op2(r, a, b, o, u) gmp_zval_binary_ui_op2_ex(r, a, b, o, u, 0 TSRMLS_CC) -#define gmp_binary_ui_op(op,uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop) +#define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop) #define gmp_binary_op(op) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, NULL) #define gmp_binary_opl(op) _gmp_binary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) @@ -343,7 +343,7 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op WRONG_PARAM_COUNT; } - gmp_zval_binary_ui_op(return_value,a_arg,b_arg,gmp_op,gmp_ui_op); + gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op); } /* }}} */ @@ -388,7 +388,7 @@ static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_o WRONG_PARAM_COUNT; } - gmp_zval_unary_ui_op(return_value,a_arg,gmp_op); + gmp_zval_unary_ui_op(return_value, a_arg, gmp_op); } /* }}} */ @@ -401,7 +401,7 @@ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gm WRONG_PARAM_COUNT; } - gmp_zval_unary_op(return_value,a_arg,gmp_op TSRMLS_CC); + gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC); } /* }}} */ @@ -461,7 +461,7 @@ ZEND_FUNCTION(gmp_init) } } - if(convert_to_gmp(&gmpnumber,number_arg,base) == FAILURE) { + if(convert_to_gmp(&gmpnumber, number_arg, base) == FAILURE) { RETURN_FALSE; } @@ -619,13 +619,13 @@ ZEND_FUNCTION(gmp_div_r) switch(round) { case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t)mpz_tdiv_r_ui,1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t)mpz_tdiv_r_ui, 1 TSRMLS_CC); break; case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t)mpz_cdiv_r_ui,1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t)mpz_cdiv_r_ui, 1 TSRMLS_CC); break; case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t)mpz_fdiv_r_ui,1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t)mpz_fdiv_r_ui, 1 TSRMLS_CC); break; } } @@ -678,7 +678,7 @@ ZEND_FUNCTION(gmp_mod) WRONG_PARAM_COUNT; } - gmp_zval_binary_ui_op_ex(return_value,a_arg,b_arg,mpz_mod,(gmp_binary_ui_op_t)mpz_mod_ui,1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_mod, (gmp_binary_ui_op_t)mpz_mod_ui, 1 TSRMLS_CC); } /* }}} */ @@ -873,7 +873,7 @@ ZEND_FUNCTION(gmp_gcd) WRONG_PARAM_COUNT; } - gmp_zval_binary_ui_op_ex(return_value,a_arg,b_arg,mpz_gcd,(gmp_binary_ui_op_t)mpz_gcd_ui,1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_gcd, (gmp_binary_ui_op_t)mpz_gcd_ui, 1 TSRMLS_CC); } /* }}} */ @@ -924,7 +924,7 @@ ZEND_FUNCTION(gmp_invert) FETCH_GMP_ZVAL(gmpnum_b, a_arg); INIT_GMP_NUM(gmpnum_result); - if(mpz_invert(*gmpnum_result,*gmpnum_a, *gmpnum_b)) { + if(mpz_invert(*gmpnum_result, *gmpnum_a, *gmpnum_b)) { ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } else { FREE_GMP_NUM(gmpnum_result); diff --git a/ext/hyperwave/debug.h b/ext/hyperwave/debug.h index b596cbf522..5b72dbb194 100644 --- a/ext/hyperwave/debug.h +++ b/ext/hyperwave/debug.h @@ -17,6 +17,15 @@ * ----------------- * * $Log$ +* Revision 1.2 2000/07/02 23:46:41 sas +* Change header protection macros to conform to standard. +* +* Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" +* +* All identifiers that begin with an underscore and either an uppercase +* letter or another underscore are always reserved for any use by the +* implementation. +* * Revision 1.1 1999/04/21 23:37:47 ssb * moved db * @@ -141,35 +150,35 @@ #define NUMELE(a) (sizeof(a)/sizeof(*(a))) #define LASTELE(a) ((a) + (NUMELE(a)-1)) #ifdef LDATA -#define TOOHIGH(a,p) ((long)PHYS(p) - (long)PHYS(a) > (long)(NUMELE(a)-1)) -#define TOOLOW(a,p) ((long)PHYS(p) - (long)PHYS(a) < 0) +#define TOOHIGH(a, p) ((long)PHYS(p) - (long)PHYS(a) > (long)(NUMELE(a)-1)) +#define TOOLOW(a, p) ((long)PHYS(p) - (long)PHYS(a) < 0) #else -#define TOOHIGH(a,p) ((long)(p) - (long)(a) > (long)(NUMELE(a)-1)) -#define TOOLOW(a,p) ((long)(p) - (long)(a) < 0) +#define TOOHIGH(a, p) ((long)(p) - (long)(a) > (long)(NUMELE(a)-1)) +#define TOOLOW(a, p) ((long)(p) - (long)(a) < 0) #endif -#define INBOUNDS(a,p) ( ! (TOOHIGH(a,p) || TOOLOW(a,p)) ) +#define INBOUNDS(a, p) ( ! (TOOHIGH(a, p) || TOOLOW(a, p)) ) -#define _IS(t,x) (((t)1 << (x)) != 0) /* Evaluates true if the width of */ +#define _IS(t, x) (((t)1 << (x)) != 0) /* Evaluates true if the width of */ /* variable of type t is < x. */ /* The != 0 assures that the */ /* answer is 1 or 0 */ -#define NBITS(t) (4 * (1 + _IS(t,4) + _IS(t,8) + _IS(t,12) + _IS(t,16) \ - + _IS(t,20) + _IS(t,24) + _IS(t,28) + _IS(t,32))) +#define NBITS(t) (4 * (1 + _IS(t, 4) + _IS(t, 8) + _IS(t, 12) + _IS(t, 16) \ + + _IS(t, 20) + _IS(t, 24) + _IS(t, 28) + _IS(t, 32))) #define MAXINT (((unsigned)~0) >> 1) #ifndef MAX -# define MAX(a,b) ( ((a) > (b)) ? (a) : (b)) +# define MAX(a, b) ( ((a) > (b)) ? (a) : (b)) #endif #ifndef MIN -# define MIN(a,b) ( ((a) < (b)) ? (a) : (b)) +# define MIN(a, b) ( ((a) < (b)) ? (a) : (b)) #endif #ifndef ABS # define ABS(a) ((a) >= 0 ? (a) : -(a)) #endif -#define RANGE(a,b,c) ( (a) <= (b) && (b) <= (c) ) +#define RANGE(a, b, c) ( (a) <= (b) && (b) <= (c) ) /* General typedefs */ diff --git a/ext/hyperwave/hg_comm.c b/ext/hyperwave/hg_comm.c index d25736b7d9..accaeb6912 100644 --- a/ext/hyperwave/hg_comm.c +++ b/ext/hyperwave/hg_comm.c @@ -35,7 +35,7 @@ # define EWOULDBLOCK WSAEWOULDBLOCK # define ETIMEDOUT WSAETIMEDOUT # define bcopy memcpy -# define bzero(a,b) memset(a,0,b) +# define bzero(a, b) memset(a, 0, b) #else # include <sys/socket.h> # include <netinet/in.h> @@ -1830,7 +1830,7 @@ int send_insertobject(int sockfd, char *objrec, char *parms, hw_objectID *object tmp = build_msg_str(msg.buf, objrec); tmp = build_msg_str(tmp, parms); -/*fprintf(stderr,"objrec = %s, parms = %s\n", objrec, parms); */ +/*fprintf(stderr, "objrec = %s, parms = %s\n", objrec, parms); */ if ( send_hg_msg(sockfd, &msg, length) == -1 ) { efree(msg.buf); @@ -2622,7 +2622,7 @@ int send_mvcpdocscollscoll(int sockfd, hw_objectID *objectIDs, int count, int fr tmp = build_msg_int(tmp, dest); tmp = build_msg_int(tmp, count); for(i=0; i<count;i++) - tmp = build_msg_int(tmp,objectIDs[i]); + tmp = build_msg_int(tmp, objectIDs[i]); if ( send_hg_msg(sockfd, &msg, length) == -1 ) { efree(msg.buf); @@ -3536,12 +3536,12 @@ int send_getreldestforanchorsobj(int sockfd, char **anchorrec, char ***reldestre /* fprintf(stderr, "%d: ", thisID); for(k=0; k<countthis; k++) - fprintf(stderr,"%d, ", retthisIDs[k]); -fprintf(stderr,"\n"); -fprintf(stderr,"%d: ", destdocid); + fprintf(stderr, "%d, ", retthisIDs[k]); +fprintf(stderr, "\n"); +fprintf(stderr, "%d: ", destdocid); for(k=0; k<countdest; k++) - fprintf(stderr,"%d: %d, ", destdocid, retdestIDs[k]); -fprintf(stderr,"\n"); + fprintf(stderr, "%d: %d, ", destdocid, retdestIDs[k]); +fprintf(stderr, "\n"); */ mincount = (countthis < countdest) ? countthis : countdest; @@ -3666,12 +3666,12 @@ int getrellink(int sockfd, int rootID, int thisID, int destID, char **reldeststr fprintf(stderr, "%d: ", thisID); for(k=0; k<countthis; k++) - fprintf(stderr,"%d, ", retthisIDs[k]); -fprintf(stderr,"\n"); -fprintf(stderr,"%d: ", destID); + fprintf(stderr, "%d, ", retthisIDs[k]); +fprintf(stderr, "\n"); +fprintf(stderr, "%d: ", destID); for(k=0; k<countdest; k++) - fprintf(stderr,"%d, ", retdestIDs[k]); -fprintf(stderr,"\n"); + fprintf(stderr, "%d, ", retdestIDs[k]); +fprintf(stderr, "\n"); /* ** The message incollections returned a list of collections @@ -3680,7 +3680,7 @@ fprintf(stderr,"\n"); ** a sorted list of collection IDs. If for example you are ** looking for an ID 20 which has a path 1 -> 5 -> 4 -> 20 ** (this means: 20 is child of 4, 4 is child of 5, 5 is child - ** of 1) it will return 1,4,5 instead of 1,5,4 + ** of 1) it will return 1, 4, 5 instead of 1, 5, 4 ** Consequently, we have to create the correct path, by checking ** for the parents and identifying it in the list. ** But there is another problem. If the id for which the list of @@ -3712,7 +3712,7 @@ fprintf(stderr,"\n"); } mincount = (countthis < countdest) ? countthis : countdest; -fprintf(stderr,"mincount = %d\n", mincount); +fprintf(stderr, "mincount = %d\n", mincount); for(j=0; (j<mincount) && (retthisIDs[j]==retdestIDs[j]); j++) ; equaltill = j; diff --git a/ext/hyperwave/hg_comm.h b/ext/hyperwave/hg_comm.h index 06d9e2614f..4068d4619f 100644 --- a/ext/hyperwave/hg_comm.h +++ b/ext/hyperwave/hg_comm.h @@ -229,10 +229,10 @@ extern int send_dummy(int sockfd, hw_objectID objectID, int msgid, char **attrib extern int send_insertanchors(char **text, int *count, char **anchors, char **destrec, int ancount, char **urlprefix, char **bodytag); extern char *get_hw_info(hw_connection *conn); -#define send_mvcpdocscoll(sockfd,objectIDs,count,from,dest,mvcp) \ - send_mvcpdocscollscoll(sockfd,objectIDs,count,from,dest,mvcp,DOCUMENT) -#define send_mvcpcollscoll(sockfd,objectIDs,count,from,dest,mvcp) \ - send_mvcpdocscollscoll(sockfd,objectIDs,count,from,dest,mvcp,COLLECTION) +#define send_mvcpdocscoll(sockfd, objectIDs, count, from, dest, mvcp) \ + send_mvcpdocscollscoll(sockfd, objectIDs, count, from, dest, mvcp, DOCUMENT) +#define send_mvcpcollscoll(sockfd, objectIDs, count, from, dest, mvcp) \ + send_mvcpdocscollscoll(sockfd, objectIDs, count, from, dest, mvcp, COLLECTION) #endif #endif diff --git a/ext/hyperwave/hw.c b/ext/hyperwave/hw.c index 7857d3ee37..8f3120e858 100644 --- a/ext/hyperwave/hw.c +++ b/ext/hyperwave/hw.c @@ -761,7 +761,7 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) list_entry new_le; if (HwSG(max_links)!=-1 && HwSG(num_links)>=HwSG(max_links)) { - php_error(E_ERROR,"Hyperwave: Too many open links (%d)",HwSG(num_links)); + php_error(E_ERROR, "Hyperwave: Too many open links (%d)", HwSG(num_links)); if(host) efree(host); if(username) efree(username); if(password) efree(password); @@ -769,7 +769,7 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) RETURN_FALSE; } if (HwSG(max_persistent!=-1) && HwSG(num_persistent)>=HwSG(max_persistent)) { - php_error(E_ERROR,"Hyperwave: Too many open persistent links (%d)",HwSG(num_persistent)); + php_error(E_ERROR, "Hyperwave: Too many open persistent links (%d)", HwSG(num_persistent)); if(host) efree(host); if(username) efree(username); if(password) efree(password); @@ -820,7 +820,7 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) new_le.ptr = (void *) ptr; new_le.type = le_psocketp; - if (zend_hash_update(&EG(persistent_list),hashed_details,hashed_details_length+1,(void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { + if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { php_error(E_ERROR, "Could not hash table with connection details"); if(host) efree(host); if(username) efree(username); @@ -840,26 +840,26 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) ptr = le->ptr; } - return_value->value.lval = zend_list_insert(ptr,le_psocketp); + return_value->value.lval = zend_list_insert(ptr, le_psocketp); return_value->type = IS_RESOURCE; } else { - list_entry *index_ptr,new_index_ptr; + list_entry *index_ptr, new_index_ptr; /* first we check the hash for the hashed_details key. if it exists, * it should point us to the right offset where the actual hyperwave link sits. * if it doesn't, open a new hyperwave link, add it to the resource list, * and add a pointer to it with hashed_details as the key. */ - if (zend_hash_find(&EG(regular_list),hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { - int type,link; + if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length+1, (void **) &index_ptr)==SUCCESS) { + int type, link; void *ptr; if (index_ptr->type != le_index_ptr) { RETURN_FALSE; } link = (int) index_ptr->ptr; - ptr = (hw_connection *) zend_list_find(link,&type); /* check if the link is still there */ + ptr = (hw_connection *) zend_list_find(link, &type); /* check if the link is still there */ if(!ptr || (type!=le_socketp && type!=le_psocketp)) { return_value->value.lval = HwSG(default_link) = link; return_value->type = IS_LONG; @@ -869,7 +869,7 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) if(host) efree(host); return; } else { - zend_hash_del(&EG(regular_list),hashed_details,hashed_details_length+1); + zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length+1); } } @@ -912,12 +912,12 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) ptr->hostname = strdup(host); ptr->username = strdup("anonymous"); - return_value->value.lval = zend_list_insert(ptr,le_socketp); + return_value->value.lval = zend_list_insert(ptr, le_socketp); return_value->type = IS_RESOURCE; new_index_ptr.ptr = (void *) return_value->value.lval; new_index_ptr.type = le_index_ptr; - if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { + if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1, (void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { php_error(E_ERROR, "Could not update connection details in hash table"); if(host) efree(host); efree(hashed_details); @@ -957,7 +957,7 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) Connect to the Hyperwave server */ PHP_FUNCTION(hw_connect) { - php_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); + php_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ @@ -965,7 +965,7 @@ PHP_FUNCTION(hw_connect) Connect to the Hyperwave server persistent */ PHP_FUNCTION(hw_pconnect) { - php_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); + php_hw_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ @@ -982,9 +982,9 @@ PHP_FUNCTION(hw_close) } convert_to_long_ex(arg1); id=(*arg1)->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } zend_list_delete(id); @@ -1006,9 +1006,9 @@ PHP_FUNCTION(hw_info) } convert_to_long_ex(arg1); id=(*arg1)->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } if(NULL != (str = get_hw_info(ptr))) { @@ -1038,9 +1038,9 @@ PHP_FUNCTION(hw_error) } convert_to_long_ex(arg1); id=(*arg1)->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } RETURN_LONG(ptr->lasterror); @@ -1061,9 +1061,9 @@ PHP_FUNCTION(hw_errormsg) } convert_to_long_ex(arg1); id=(*arg1)->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -1348,9 +1348,9 @@ char *php_hw_command(INTERNAL_FUNCTION_PARAMETERS, int comm) { } convert_to_long_ex(arg1); link=(*arg1)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); return NULL; } @@ -1515,9 +1515,9 @@ PHP_FUNCTION(hw_dummy) link=(*arg1)->value.lval; id=(*arg2)->value.lval; msgid=(*arg3)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -1566,9 +1566,9 @@ PHP_FUNCTION(hw_getobject) query = NULL; link=(*argv[0])->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d", link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -1642,9 +1642,9 @@ PHP_FUNCTION(hw_insertobject) link=arg1->value.lval; objrec=arg2->value.str.val; parms=arg3->value.str.val; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -1674,9 +1674,9 @@ PHP_FUNCTION(hw_getandlock) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -1706,9 +1706,9 @@ PHP_FUNCTION(hw_unlock) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -1735,9 +1735,9 @@ PHP_FUNCTION(hw_deleteobject) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -1768,9 +1768,9 @@ PHP_FUNCTION(hw_changeobject) link=arg1->value.lval; id=arg2->value.lval; newobjarr=arg3->value.ht; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -1871,9 +1871,9 @@ PHP_FUNCTION(hw_modifyobject) id=(*argv[1])->value.lval; remobjarr=(*argv[2])->value.ht; addobjarr=(*argv[3])->value.ht; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -2028,7 +2028,7 @@ PHP_FUNCTION(hw_modifyobject) if (0 == (ptr->lasterror = send_lock(ptr->socket, id))) { if (0 == (ptr->lasterror = send_changeobject(ptr->socket, id, modification))) { if (0 != (ptr->lasterror = send_unlock(ptr->socket, id))) { - php_error(E_WARNING,"Aiii, Changeobject failed and couldn't unlock object (id = 0x%X)", id); + php_error(E_WARNING, "Aiii, Changeobject failed and couldn't unlock object (id = 0x%X)", id); free(modification); RETURN_FALSE; } @@ -2040,7 +2040,7 @@ PHP_FUNCTION(hw_modifyobject) RETURN_FALSE; } } else { - php_error(E_WARNING,"Could not lock object (id = 0x%X)", id); + php_error(E_WARNING, "Could not lock object (id = 0x%X)", id); free(modification); RETURN_FALSE; } @@ -2059,7 +2059,7 @@ PHP_FUNCTION(hw_modifyobject) } break; default: - php_error(E_WARNING,"hw_modifyobject: Mode must be 0 or 1 (recursive)"); + php_error(E_WARNING, "hw_modifyobject: Mode must be 0 or 1 (recursive)"); } free(modification); RETURN_TRUE; @@ -2102,9 +2102,9 @@ void php_hw_mvcp(INTERNAL_FUNCTION_PARAMETERS, int mvcp) { from = 0; break; } - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -2214,9 +2214,9 @@ PHP_FUNCTION(hw_gettext) } link=argv[0]->value.lval; id=argv[1]->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -2234,7 +2234,7 @@ PHP_FUNCTION(hw_gettext) doc->attributes = attributes; doc->bodytag = bodytag; doc->size = count; - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } } @@ -2255,18 +2255,18 @@ PHP_FUNCTION(hw_edittext) convert_to_long(arg1); convert_to_long(arg2); link=arg1->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find socket identifier %d",link); + php_error(E_WARNING, "Unable to find socket identifier %d", link); RETURN_FALSE; } doc=arg2->value.lval; - docptr = zend_list_find(doc,&type); + docptr = zend_list_find(doc, &type); if(!docptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find document identifier %d", doc); + php_error(E_WARNING, "Unable to find document identifier %d", doc); RETURN_FALSE; } @@ -2299,9 +2299,9 @@ PHP_FUNCTION(hw_getcgi) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -2338,7 +2338,7 @@ PHP_FUNCTION(hw_getcgi) doc->attributes = attributes; doc->bodytag = NULL; doc->size = count; - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } } @@ -2361,9 +2361,9 @@ PHP_FUNCTION(hw_getremote) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -2380,7 +2380,7 @@ PHP_FUNCTION(hw_getremote) doc->attributes = attributes; doc->bodytag = NULL; doc->size = count; - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } } @@ -2402,9 +2402,9 @@ PHP_FUNCTION(hw_getremotechildren) convert_to_string(arg2); link=arg1->value.lval; objrec=arg2->value.str.val; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d", link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } set_swap(ptr->swap_on); @@ -2455,13 +2455,13 @@ php_printf("count = %d, remainder = <HR>%s---<HR>", count, remainder); */ for(i=0, len=0; i<count; i++) len += offsets[i]-18; -/*fprintf(stderr,"len = %d\n", len); */ +/*fprintf(stderr, "len = %d\n", len); */ doc = malloc(sizeof(hw_document)); doc->data = malloc(len+1); ptr = doc->data; for(i=0, j=0; i<count; i++) { memcpy((char *)ptr, (char *)&remainder[j], offsets[i]-18); -/*fprintf(stderr,"rem = %s\n", &remainder[j]); */ +/*fprintf(stderr, "rem = %s\n", &remainder[j]); */ j += offsets[i]; ptr += offsets[i] - 18; } @@ -2469,7 +2469,7 @@ php_printf("count = %d, remainder = <HR>%s---<HR>", count, remainder); doc->attributes = strdup(objrec); doc->bodytag = NULL; doc->size = strlen(doc->data); - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } else { if (array_init(return_value) == FAILURE) { @@ -2506,9 +2506,9 @@ PHP_FUNCTION(hw_setlinkroot) convert_to_long(arg2); link = arg1->value.lval; rootid = arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -2552,9 +2552,9 @@ PHP_FUNCTION(hw_pipedocument) link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d", link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -2563,7 +2563,7 @@ PHP_FUNCTION(hw_pipedocument) convert_to_array(arg3); prefixarray =arg3->value.ht; if((prefixarray == NULL) || (zend_hash_num_elements(prefixarray) != 5)) { - php_error(E_WARNING,"You must provide 5 urlprefixes (you have provided %d)", zend_hash_num_elements(prefixarray)); + php_error(E_WARNING, "You must provide 5 urlprefixes (you have provided %d)", zend_hash_num_elements(prefixarray)); RETURN_FALSE; } @@ -2578,7 +2578,7 @@ PHP_FUNCTION(hw_pipedocument) zend_hash_get_current_data(prefixarray, (void *) &dataptr); data = *dataptr; if (data->type != IS_STRING) { - php_error(E_WARNING,"%s must be a String", key); + php_error(E_WARNING, "%s must be a String", key); RETURN_FALSE; } else if ( strcmp(key, "HW_DEFAULT_LINK") == 0 ) { urlprefix[HW_DEFAULT_LINK] = data->value.str.val; @@ -2591,7 +2591,7 @@ PHP_FUNCTION(hw_pipedocument) } else if ( strcmp(key, "HW_APPLET_LINK") == 0 ) { urlprefix[HW_APPLET_LINK] = data->value.str.val; } else { - php_error(E_WARNING,"%s is not a valid urlprefix", key); + php_error(E_WARNING, "%s is not a valid urlprefix", key); RETURN_FALSE; } zend_hash_move_forward(prefixarray); @@ -2629,7 +2629,7 @@ PHP_FUNCTION(hw_pipedocument) doc->bodytag = bodytag; doc->size = count; /* fprintf(stderr, "size = %d\n", count); */ - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } } @@ -2665,9 +2665,9 @@ PHP_FUNCTION(hw_oldpipedocument) } */ link=argv[0]->value.lval; id=argv[1]->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d", link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -2698,7 +2698,7 @@ PHP_FUNCTION(hw_oldpipedocument) doc->bodytag = bodytag; doc->size = count; /* fprintf(stderr, "size = %d\n", count); */ - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } } @@ -2726,9 +2726,9 @@ PHP_FUNCTION(hw_pipecgi) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -2764,7 +2764,7 @@ PHP_FUNCTION(hw_pipecgi) doc->attributes = attributes; doc->bodytag = NULL; doc->size = count; - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } } @@ -2792,16 +2792,16 @@ PHP_FUNCTION(hw_insertdocument) convert_to_long(arg3); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find connection identifier %d",link); + php_error(E_WARNING, "Unable to find connection identifier %d", link); RETURN_FALSE; } doc=arg3->value.lval; - docptr = zend_list_find(doc,&type); + docptr = zend_list_find(doc, &type); if(!docptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find document identifier %d",doc); + php_error(E_WARNING, "Unable to find document identifier %d", doc); RETURN_FALSE; } @@ -2851,7 +2851,7 @@ PHP_FUNCTION(hw_new_document) doc->attributes = strdup(arg1->value.str.val); doc->bodytag = NULL; doc->size = arg3->value.lval; - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } /* }}} */ @@ -2879,12 +2879,12 @@ PHP_FUNCTION(hw_new_document_from_file) convert_to_string_ex(arg1); convert_to_string_ex(arg2); - fp = php_fopen_wrapper((*arg2)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); + fp = php_fopen_wrapper((*arg2)->value.str.val, "r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); if (!fp && !socketd){ if (issock != BAD_URL) { char *tmp = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2)); php_strip_url_passwd(tmp); - php_error(E_WARNING,"hw_new_document_from_file(\"%s\") - %s", tmp, strerror(errno)); + php_error(E_WARNING, "hw_new_document_from_file(\"%s\") - %s", tmp, strerror(errno)); efree(tmp); } RETURN_FALSE; @@ -2954,7 +2954,7 @@ PHP_FUNCTION(hw_new_document_from_file) doc->attributes = strdup((*arg1)->value.str.val); doc->bodytag = NULL; doc->size = bcount; - return_value->value.lval = zend_list_insert(doc,le_document); + return_value->value.lval = zend_list_insert(doc, le_document); return_value->type = IS_LONG; } /* }}} */ @@ -2973,9 +2973,9 @@ PHP_FUNCTION(hw_free_document) } convert_to_long(arg1); id=arg1->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } zend_list_delete(id); @@ -3000,9 +3000,9 @@ PHP_FUNCTION(hw_output_document) } convert_to_long(arg1); id=arg1->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3034,9 +3034,9 @@ PHP_FUNCTION(hw_document_bodytag) convert_to_long(argv[0]); id=argv[0]->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3079,9 +3079,9 @@ PHP_FUNCTION(hw_document_content) convert_to_long(argv[0]); id=argv[0]->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3108,9 +3108,9 @@ PHP_FUNCTION(hw_document_setcontent) convert_to_long(argv[0]); convert_to_string(argv[1]); id=argv[0]->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3143,9 +3143,9 @@ PHP_FUNCTION(hw_document_size) } convert_to_long(arg1); id=arg1->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3170,9 +3170,9 @@ PHP_FUNCTION(hw_document_attributes) } convert_to_long(arg1); id=arg1->value.lval; - ptr = zend_list_find(id,&type); + ptr = zend_list_find(id, &type); if(!ptr || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3198,9 +3198,9 @@ PHP_FUNCTION(hw_getparentsobj) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3233,9 +3233,9 @@ PHP_FUNCTION(hw_getparents) convert_to_long(arg2); link=arg1->value.lval; id=arg2->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3279,9 +3279,9 @@ PHP_FUNCTION(hw_children) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3326,9 +3326,9 @@ PHP_FUNCTION(hw_childrenobj) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3361,9 +3361,9 @@ PHP_FUNCTION(hw_getchildcoll) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3408,9 +3408,9 @@ PHP_FUNCTION(hw_getchildcollobj) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3442,9 +3442,9 @@ PHP_FUNCTION(hw_docbyanchor) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3474,9 +3474,9 @@ PHP_FUNCTION(hw_docbyanchorobj) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3516,9 +3516,9 @@ PHP_FUNCTION(hw_getobjectbyquery) query=(*arg2)->value.str.val; maxhits=(*arg3)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -3560,9 +3560,9 @@ PHP_FUNCTION(hw_getobjectbyqueryobj) query=(*arg2)->value.str.val; maxhits=(*arg3)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -3601,9 +3601,9 @@ PHP_FUNCTION(hw_getobjectbyquerycoll) query=(*arg3)->value.str.val; maxhits=(*arg4)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3647,9 +3647,9 @@ PHP_FUNCTION(hw_getobjectbyquerycollobj) query=(*arg3)->value.str.val; maxhits=(*arg4)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3687,9 +3687,9 @@ PHP_FUNCTION(hw_getobjectbyftquery) query=(*arg2)->value.str.val; maxhits=(*arg3)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -3732,9 +3732,9 @@ PHP_FUNCTION(hw_getobjectbyftqueryobj) query=(*arg2)->value.str.val; maxhits=(*arg3)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -3774,9 +3774,9 @@ PHP_FUNCTION(hw_getobjectbyftquerycoll) query=(*arg3)->value.str.val; maxhits=(*arg4)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3821,9 +3821,9 @@ PHP_FUNCTION(hw_getobjectbyftquerycollobj) query=(*arg3)->value.str.val; maxhits=(*arg4)->value.lval; if (maxhits < 0) maxhits=0x7FFFFFFF; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3856,9 +3856,9 @@ PHP_FUNCTION(hw_getchilddoccoll) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3896,9 +3896,9 @@ PHP_FUNCTION(hw_getchilddoccollobj) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3932,9 +3932,9 @@ PHP_FUNCTION(hw_getanchors) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -3972,9 +3972,9 @@ PHP_FUNCTION(hw_getanchorsobj) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = (hw_connection *) zend_list_find(link,&type); + ptr = (hw_connection *) zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",id); + php_error(E_WARNING, "Unable to find file identifier %d", id); RETURN_FALSE; } @@ -4003,9 +4003,9 @@ PHP_FUNCTION(hw_getusername) } convert_to_long_ex(arg1); link = (*arg1)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4033,9 +4033,9 @@ PHP_FUNCTION(hw_identify) link = (*arg1)->value.lval; name=(*arg2)->value.str.val; passwd=(*arg3)->value.str.val; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4130,9 +4130,9 @@ PHP_FUNCTION(hw_incollections) convert_to_long_ex(arg4); link = (*arg1)->value.lval; retcoll=(*arg4)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4191,9 +4191,9 @@ PHP_FUNCTION(hw_inscoll) convert_to_array_ex(arg3); link = (*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4240,9 +4240,9 @@ PHP_FUNCTION(hw_insdoc) } link = (*argv[0])->value.lval; id = (*argv[1])->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4273,9 +4273,9 @@ PHP_FUNCTION(hw_getsrcbydestobj) convert_to_long_ex(arg2); link=(*arg1)->value.lval; id=(*arg2)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4308,9 +4308,9 @@ PHP_FUNCTION(hw_mapid) link=(*arg1)->value.lval; servid=(*arg2)->value.lval; id=(*arg3)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4344,9 +4344,9 @@ PHP_FUNCTION(hw_getrellink) rootid=(*arg2)->value.lval; sourceid=(*arg3)->value.lval; destid=(*arg4)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } @@ -4396,7 +4396,7 @@ PHP_FUNCTION(hw_insertanchors) docid=(*arg1)->value.lval; hwdoc = zend_list_find(docid, &type); if(!hwdoc || (type!=le_document)) { - php_error(E_WARNING,"Unable to find file identifier %d",docid); + php_error(E_WARNING, "Unable to find file identifier %d", docid); RETURN_FALSE; } @@ -4406,7 +4406,7 @@ PHP_FUNCTION(hw_insertanchors) convert_to_array_ex(arg4); prefixarray =(*arg4)->value.ht; if((prefixarray == NULL) || (zend_hash_num_elements(prefixarray) != 5)) { - php_error(E_WARNING,"You must provide 5 urlprefixes (you have provided %d)", zend_hash_num_elements(prefixarray)); + php_error(E_WARNING, "You must provide 5 urlprefixes (you have provided %d)", zend_hash_num_elements(prefixarray)); RETURN_FALSE; } @@ -4421,7 +4421,7 @@ PHP_FUNCTION(hw_insertanchors) zend_hash_get_current_data(prefixarray, (void *) &dataptr); data = *dataptr; if (data->type != IS_STRING) { - php_error(E_WARNING,"%s must be a String", key); + php_error(E_WARNING, "%s must be a String", key); RETURN_FALSE; } else if ( strcmp(key, "HW_DEFAULT_LINK") == 0 ) { urlprefix[HW_DEFAULT_LINK] = data->value.str.val; @@ -4434,7 +4434,7 @@ PHP_FUNCTION(hw_insertanchors) } else if ( strcmp(key, "HW_APPLET_LINK") == 0 ) { urlprefix[HW_APPLET_LINK] = data->value.str.val; } else { - php_error(E_WARNING,"%s is not a valid urlprefix", key); + php_error(E_WARNING, "%s is not a valid urlprefix", key); RETURN_FALSE; } zend_hash_move_forward(prefixarray); @@ -4444,7 +4444,7 @@ PHP_FUNCTION(hw_insertanchors) } if(zend_hash_num_elements((*arg2)->value.ht) != zend_hash_num_elements((*arg3)->value.ht)) { - php_error(E_WARNING,"Unequal number of elments in arrays"); + php_error(E_WARNING, "Unequal number of elments in arrays"); RETURN_FALSE; } @@ -4490,9 +4490,9 @@ PHP_FUNCTION(hw_connection_info) } convert_to_long_ex(arg1); link=(*arg1)->value.lval; - ptr = zend_list_find(link,&type); + ptr = zend_list_find(link, &type); if(!ptr || (type!=le_socketp && type!=le_psocketp)) { - php_error(E_WARNING,"Unable to find file identifier %d",link); + php_error(E_WARNING, "Unable to find file identifier %d", link); RETURN_FALSE; } diff --git a/ext/icap/php_icap.c b/ext/icap/php_icap.c index 9ff4ae3833..692206a496 100644 --- a/ext/icap/php_icap.c +++ b/ext/icap/php_icap.c @@ -66,7 +66,7 @@ static cal_list_t *g_cal_list=NULL; static cal_list_t *g_cal_list_end=NULL; /* * this array should be set up as: - * {"PHPScriptFunctionName",dllFunctionName,1} + * {"PHPScriptFunctionName", dllFunctionName, 1} */ function_entry icap_functions[] = { @@ -115,7 +115,7 @@ CALSTREAM *cal_close_it (zend_rsrc_list_entry *rsrc TSRMLS_DC) pils *icap_le_struct = (pils *)rsrc->ptr; CALSTREAM *ret; - ret = cal_close (icap_le_struct->icap_stream,0); + ret = cal_close (icap_le_struct->icap_stream, 0); efree(icap_le_struct); return ret; } @@ -163,22 +163,22 @@ void php_icap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) int myargc=ZEND_NUM_ARGS(); - if (myargc <3 || myargc >4 || getParameters(ht, myargc, &calendar,&user,&passwd,&options) == FAILURE) { + if (myargc <3 || myargc >4 || getParameters(ht, myargc, &calendar, &user, &passwd, &options) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(calendar); convert_to_string(user); convert_to_string(passwd); - strcpy(icap_user,user->value.str.val); - strcpy(icap_password,passwd->value.str.val); + strcpy(icap_user, user->value.str.val); + strcpy(icap_password, passwd->value.str.val); if(myargc ==4) { convert_to_long(options); flags=options->value.lval; } - icap_stream = cal_open(NULL,calendar->value.str.val,0); + icap_stream = cal_open(NULL, calendar->value.str.val, 0); if (!icap_stream) { - php_error(E_WARNING,"Couldn't open stream %s\n",calendar->value.str.val); + php_error(E_WARNING, "Couldn't open stream %s\n", calendar->value.str.val); RETURN_FALSE; } @@ -244,7 +244,7 @@ PHP_FUNCTION(icap_reopen) long cl_flags=0; int myargc=ZEND_NUM_ARGS(); - if (myargc<2 || myargc>3 || getParameters(ht,myargc,&streamind, &calendar, &options) == FAILURE) { + if (myargc<2 || myargc>3 || getParameters(ht, myargc, &streamind, &calendar, &options) == FAILURE) { WRONG_PARAM_COUNT; } @@ -267,7 +267,7 @@ PHP_FUNCTION(icap_reopen) cal_login(icap_stream, calendar->value.str.val); */ if (icap_stream == NULL) { - php_error(E_WARNING,"Couldn't re-open stream\n"); + php_error(E_WARNING, "Couldn't re-open stream\n"); RETURN_FALSE; } RETURN_TRUE; @@ -281,7 +281,7 @@ PHP_FUNCTION(icap_expunge) { pval *streamind; int ind, ind_type; - pval *start,*end; + pval *start, *end; pils *icap_le_struct; if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &streamind) == FAILURE) { @@ -309,13 +309,13 @@ PHP_FUNCTION(icap_expunge) Fetch an event */ PHP_FUNCTION(icap_fetch_event) { - pval *streamind,*eventid,*start,*end,*options=NULL; + pval *streamind, *eventid, *start, *end, *options=NULL; int ind, ind_type; pils *icap_le_struct=NULL; CALEVENT *myevent; int myargcount=ZEND_NUM_ARGS(); - if (myargcount < 1 || myargcount > 3 || getParameters(ht, myargcount, &streamind, &eventid,&options) == FAILURE) { + if (myargcount < 1 || myargcount > 3 || getParameters(ht, myargcount, &streamind, &eventid, &options) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(streamind); @@ -329,47 +329,47 @@ PHP_FUNCTION(icap_fetch_event) if(myargcount==3) { convert_to_long(options); } - cal_fetch(icap_le_struct->icap_stream,eventid->value.lval,&myevent); + cal_fetch(icap_le_struct->icap_stream, eventid->value.lval, &myevent); object_init(return_value); - add_property_long(return_value,"id",myevent->id); - add_property_long(return_value,"public",myevent->public); + add_property_long(return_value, "id", myevent->id); + add_property_long(return_value, "public", myevent->public); MAKE_STD_ZVAL(start); object_init(start); if(myevent->start.has_date) { - add_property_long(start,"year",myevent->start.year); - add_property_long(start,"month",myevent->start.mon); - add_property_long(start,"mday",myevent->start.mday); + add_property_long(start, "year", myevent->start.year); + add_property_long(start, "month", myevent->start.mon); + add_property_long(start, "mday", myevent->start.mday); } if(myevent->start.has_time) { - add_property_long(start,"hour",myevent->start.hour); - add_property_long(start,"min",myevent->start.min); - add_property_long(start,"sec",myevent->start.sec); + add_property_long(start, "hour", myevent->start.hour); + add_property_long(start, "min", myevent->start.min); + add_property_long(start, "sec", myevent->start.sec); } - add_assoc_object(return_value, "start",start); + add_assoc_object(return_value, "start", start); MAKE_STD_ZVAL(end); object_init(end); if(myevent->end.has_date) { - add_property_long(end,"year",myevent->end.year); - add_property_long(end,"month",myevent->end.mon); - add_property_long(end,"mday",myevent->end.mday); + add_property_long(end, "year", myevent->end.year); + add_property_long(end, "month", myevent->end.mon); + add_property_long(end, "mday", myevent->end.mday); } if(myevent->end.has_time) { - add_property_long(end,"hour",myevent->end.hour); - add_property_long(end,"min",myevent->end.min); - add_property_long(end,"sec",myevent->end.sec); + add_property_long(end, "hour", myevent->end.hour); + add_property_long(end, "min", myevent->end.min); + add_property_long(end, "sec", myevent->end.sec); } - add_assoc_object(return_value, "end",end); + add_assoc_object(return_value, "end", end); - add_property_string(return_value,"category",myevent->category,1); - add_property_string(return_value,"title",myevent->title,1); - add_property_string(return_value,"description",myevent->description,1); - add_property_long(return_value,"alarm",myevent->alarm); + add_property_string(return_value, "category", myevent->category, 1); + add_property_string(return_value, "title", myevent->title, 1); + add_property_string(return_value, "description", myevent->description, 1); + add_property_long(return_value, "alarm", myevent->alarm); } /* }}} */ @@ -377,7 +377,7 @@ PHP_FUNCTION(icap_fetch_event) Returns list of UIDs for that day or range of days */ PHP_FUNCTION(icap_list_events) { - pval *streamind,*begindate,*enddate; + pval *streamind, *begindate, *enddate; pval **pvalue; int ind, ind_type; unsigned long i; @@ -386,10 +386,10 @@ PHP_FUNCTION(icap_list_events) unsigned int msgno; pils *icap_le_struct; cal_list_t *my_cal_list; - datetime_t begincal,endcal; + datetime_t begincal, endcal; int myargc; myargc=ZEND_NUM_ARGS(); - if (myargc <2 || myargc > 3 || getParameters(ht,myargc,&streamind,&begindate,&enddate) == FAILURE) { + if (myargc <2 || myargc > 3 || getParameters(ht, myargc, &streamind, &begindate, &enddate) == FAILURE) { WRONG_PARAM_COUNT; } @@ -411,34 +411,34 @@ PHP_FUNCTION(icap_list_events) } begincal.has_time=0; endcal.has_time=0; - if(zend_hash_find(begindate->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(begindate->value.ht, "year", sizeof("year"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); begincal.year=(*pvalue)->value.lval; } - if(zend_hash_find(begindate->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(begindate->value.ht, "month", sizeof("month"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); begincal.mon=(*pvalue)->value.lval; } - if(zend_hash_find(begindate->value.ht,"day",sizeof("day"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(begindate->value.ht, "day", sizeof("day"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); begincal.mday=(*pvalue)->value.lval; } if(myargc == 3) { - if(zend_hash_find(enddate->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(enddate->value.ht, "year", sizeof("year"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); endcal.year=(*pvalue)->value.lval; } - if(zend_hash_find(enddate->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(enddate->value.ht, "month", sizeof("month"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); endcal.mon=(*pvalue)->value.lval; } - if(zend_hash_find(enddate->value.ht,"day",sizeof("day"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(enddate->value.ht, "day", sizeof("day"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); endcal.mday=(*pvalue)->value.lval; @@ -447,11 +447,11 @@ if(myargc == 3) g_cal_list=NULL; - cal_search_range(icap_le_struct->icap_stream,&begincal,&endcal); + cal_search_range(icap_le_struct->icap_stream, &begincal, &endcal); my_cal_list=g_cal_list; while(my_cal_list != NULL) { - add_next_index_long(return_value,my_cal_list->uid); + add_next_index_long(return_value, my_cal_list->uid); my_cal_list=my_cal_list->next; free(g_cal_list); g_cal_list=my_cal_list; @@ -469,7 +469,7 @@ PHP_FUNCTION(icap_create_calendar) int ind, ind_type; pils *icap_le_struct; int myargc=ZEND_NUM_ARGS(); - if (myargc <1 || myargc > 2 || getParameters(ht,myargc,&streamind,&calendar) == FAILURE) { + if (myargc <1 || myargc > 2 || getParameters(ht, myargc, &streamind, &calendar) == FAILURE) { WRONG_PARAM_COUNT; } @@ -483,7 +483,7 @@ PHP_FUNCTION(icap_create_calendar) RETURN_FALSE; } /* - if (icap_create(icap_le_struct->icap_stream,calendar->value.str.val)) + if (icap_create(icap_le_struct->icap_stream, calendar->value.str.val)) { RETURN_TRUE; } @@ -500,11 +500,11 @@ PHP_FUNCTION(icap_create_calendar) Rename a calendar*/ PHP_FUNCTION(icap_rename_calendar) { - pval *streamind, *src_calendar,*dest_calendar; + pval *streamind, *src_calendar, *dest_calendar; int ind, ind_type; pils *icap_le_struct; int myargc=ZEND_NUM_ARGS(); - if (myargc <2 || myargc > 3 || getParameters(ht,myargc,&streamind,&src_calendar,&dest_calendar) == FAILURE) { + if (myargc <2 || myargc > 3 || getParameters(ht, myargc, &streamind, &src_calendar, &dest_calendar) == FAILURE) { WRONG_PARAM_COUNT; } @@ -519,7 +519,7 @@ PHP_FUNCTION(icap_rename_calendar) RETURN_FALSE; } /* - if(icap_rename(icap_le_struct->icap_stream,src_calendar->value.str.val,dest_calendar->value.str.val)) {RETURN_TRUE;} + if(icap_rename(icap_le_struct->icap_stream, src_calendar->value.str.val, dest_calendar->value.str.val)) {RETURN_TRUE;} else {RETURN_FALSE; } */ } @@ -532,7 +532,7 @@ PHP_FUNCTION(icap_rename_calendar) List alarms for a given time */ PHP_FUNCTION(icap_list_alarms) { - pval *streamind, *date,*time; + pval *streamind, *date, *time; pval **pvalue; datetime_t mydate; int ind, ind_type; @@ -542,7 +542,7 @@ PHP_FUNCTION(icap_list_alarms) cal_list_t *my_cal_list; int myargc=ZEND_NUM_ARGS(); - if (myargc != 3 || getParameters(ht,myargc,&streamind,&date,&time) == FAILURE) { + if (myargc != 3 || getParameters(ht, myargc, &streamind, &date, &time) == FAILURE) { WRONG_PARAM_COUNT; } @@ -562,39 +562,39 @@ PHP_FUNCTION(icap_list_alarms) } mydate.has_date=1; mydate.has_time=1; - if(zend_hash_find(date->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(date->value.ht, "year", sizeof("year"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); mydate.year=(*pvalue)->value.lval; } - if(zend_hash_find(date->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(date->value.ht, "month", sizeof("month"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); mydate.mon=(*pvalue)->value.lval; } - if(zend_hash_find(date->value.ht,"day",sizeof("day"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(date->value.ht, "day", sizeof("day"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); mydate.mday=(*pvalue)->value.lval; } - if(zend_hash_find(time->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(time->value.ht, "hour", sizeof("hour"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); mydate.hour=(*pvalue)->value.lval; } - if(zend_hash_find(time->value.ht,"minute",sizeof("minute"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(time->value.ht, "minute", sizeof("minute"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); mydate.min=(*pvalue)->value.lval; } mydate.sec=0; g_cal_list=NULL; - cal_search_alarm(icap_le_struct->icap_stream,&mydate); + cal_search_alarm(icap_le_struct->icap_stream, &mydate); my_cal_list=g_cal_list; while(my_cal_list != NULL) { - add_next_index_long(return_value,my_cal_list->uid); + add_next_index_long(return_value, my_cal_list->uid); my_cal_list=my_cal_list->next; free(g_cal_list); g_cal_list=my_cal_list; @@ -613,7 +613,7 @@ PHP_FUNCTION(icap_delete_calendar) int ind, ind_type; pils *icap_le_struct; int myargc=ZEND_NUM_ARGS(); - if (myargc <1 || myargc > 2 || getParameters(ht,myargc,&streamind,&calendar) == FAILURE) { + if (myargc <1 || myargc > 2 || getParameters(ht, myargc, &streamind, &calendar) == FAILURE) { WRONG_PARAM_COUNT; } @@ -627,7 +627,7 @@ PHP_FUNCTION(icap_delete_calendar) RETURN_FALSE; } - if (icap_delete_calendar(icap_le_struct->icap_stream,calendar->value.str.val)) + if (icap_delete_calendar(icap_le_struct->icap_stream, calendar->value.str.val)) { RETURN_TRUE; } @@ -648,7 +648,7 @@ PHP_FUNCTION(icap_delete_event) int ind, ind_type; pils *icap_le_struct; int myargc=ZEND_NUM_ARGS(); - if (myargc <1 || myargc > 2 || getParameters(ht,myargc,&streamind,&uid) == FAILURE) { + if (myargc <1 || myargc > 2 || getParameters(ht, myargc, &streamind, &uid) == FAILURE) { WRONG_PARAM_COUNT; } @@ -661,7 +661,7 @@ PHP_FUNCTION(icap_delete_event) php_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } - if (cal_remove(icap_le_struct->icap_stream,uid->value.lval)) + if (cal_remove(icap_le_struct->icap_stream, uid->value.lval)) { RETURN_TRUE; } @@ -687,20 +687,20 @@ PHP_FUNCTION(icap_popen) Store an event */ PHP_FUNCTION(icap_store_event) { - pval *streamind,*storeobject; + pval *streamind, *storeobject; int ind, ind_type; unsigned long i; char *t; int icap_folders=0; unsigned int msgno; pils *icap_le_struct; - pval **pvalue,**temppvalue; + pval **pvalue, **temppvalue; cal_list_t *my_cal_list; int myargc; unsigned long uid; CALEVENT *myevent; myargc=ZEND_NUM_ARGS(); - if (myargc !=2 || getParameters(ht,myargc,&streamind,&storeobject) == FAILURE) { + if (myargc !=2 || getParameters(ht, myargc, &streamind, &storeobject) == FAILURE) { WRONG_PARAM_COUNT; } @@ -721,69 +721,69 @@ PHP_FUNCTION(icap_store_event) RETURN_FALSE; } myevent=calevent_new(); - if(zend_hash_find(storeobject->value.ht,"uid",sizeof("uid"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "uid", sizeof("uid"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->id=(*pvalue)->value.lval; } - if(zend_hash_find(storeobject->value.ht,"public",sizeof("public"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "public", sizeof("public"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->public=(*pvalue)->value.lval; } - if(zend_hash_find(storeobject->value.ht,"category",sizeof("category"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "category", sizeof("category"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_string(*pvalue); myevent->category=strdup((*pvalue)->value.str.val); } - if(zend_hash_find(storeobject->value.ht,"title",sizeof("title"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "title", sizeof("title"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_string(*pvalue); myevent->title=strdup((*pvalue)->value.str.val); } - if(zend_hash_find(storeobject->value.ht,"description",sizeof("description"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "description", sizeof("description"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_string(*pvalue); myevent->description=strdup((*pvalue)->value.str.val); } - if(zend_hash_find(storeobject->value.ht,"alarm",sizeof("alarm"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "alarm", sizeof("alarm"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->alarm=(*pvalue)->value.lval; } - if(zend_hash_find(storeobject->value.ht,"start",sizeof("start"),(void **) &temppvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "start", sizeof("start"), (void **) &temppvalue)== SUCCESS){ SEPARATE_ZVAL(temppvalue); convert_to_array(*temppvalue); - if(zend_hash_find((*temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "year", sizeof("year"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->start.year=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "month", sizeof("month"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->start.mon=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"mday",sizeof("mday"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "mday", sizeof("mday"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->start.mday=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "hour", sizeof("hour"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->start.hour=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"min",sizeof("min"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "min", sizeof("min"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->start.min=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"sec",sizeof("sec"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "sec", sizeof("sec"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->start.sec=(*pvalue)->value.lval; @@ -791,36 +791,36 @@ PHP_FUNCTION(icap_store_event) myevent->start.has_date=true; } - if(zend_hash_find(storeobject->value.ht,"end",sizeof("end"),(void **) &temppvalue)== SUCCESS){ + if(zend_hash_find(storeobject->value.ht, "end", sizeof("end"), (void **) &temppvalue)== SUCCESS){ SEPARATE_ZVAL(temppvalue); convert_to_array(*temppvalue); - if(zend_hash_find((*temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "year", sizeof("year"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->end.year=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "month", sizeof("month"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->end.mon=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"mday",sizeof("mday"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "mday", sizeof("mday"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->end.mday=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "hour", sizeof("hour"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->end.hour=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"min",sizeof("min"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "min", sizeof("min"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->end.min=(*pvalue)->value.lval; } - if(zend_hash_find((*temppvalue)->value.ht,"sec",sizeof("sec"),(void **) &pvalue)== SUCCESS){ + if(zend_hash_find((*temppvalue)->value.ht, "sec", sizeof("sec"), (void **) &pvalue)== SUCCESS){ SEPARATE_ZVAL(pvalue); convert_to_long(*pvalue); myevent->end.sec=(*pvalue)->value.lval; @@ -828,7 +828,7 @@ PHP_FUNCTION(icap_store_event) myevent->end.has_date=true; } - cal_append(icap_le_struct->icap_stream,"INBOX",&uid,myevent); + cal_append(icap_le_struct->icap_stream, "INBOX", &uid, myevent); calevent_free(myevent); RETURN_LONG(uid); } @@ -839,13 +839,13 @@ PHP_FUNCTION(icap_store_event) Snooze an alarm */ PHP_FUNCTION(icap_snooze) { - pval *streamind,*uid; + pval *streamind, *uid; int ind, ind_type; pils *icap_le_struct; pval **pvalue; int myargc; myargc=ZEND_NUM_ARGS(); - if (myargc !=2 || getParameters(ht,myargc,&streamind,&uid) == FAILURE) { + if (myargc !=2 || getParameters(ht, myargc, &streamind, &uid) == FAILURE) { WRONG_PARAM_COUNT; } @@ -861,7 +861,7 @@ PHP_FUNCTION(icap_snooze) RETURN_FALSE; } - if(cal_snooze(icap_le_struct->icap_stream,uid->value.lval)) + if(cal_snooze(icap_le_struct->icap_stream, uid->value.lval)) { RETURN_TRUE; } @@ -918,10 +918,10 @@ void cc_login(const char **user, const char **pwd) } -void cc_vlog(const char *fmt,va_list ap) +void cc_vlog(const char *fmt, va_list ap) { } -void cc_vdlog(const char *fmt,va_list ap) +void cc_vdlog(const char *fmt, va_list ap) { } diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index d1b4d494cb..0f44512e83 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -38,13 +38,13 @@ #if HAVE_LIBICONV -#define icv_open(a,b) libiconv_open(a,b) +#define icv_open(a, b) libiconv_open(a, b) #define icv_close(a) libiconv_close(a) -#define icv(a,b,c,d,e) libiconv(a,b,c,d,e) +#define icv(a, b, c, d, e) libiconv(a, b, c, d, e) #else -#define icv_open(a,b) iconv_open(a,b) +#define icv_open(a, b) iconv_open(a, b) #define icv_close(a) iconv_close(a) -#define icv(a,b,c,d,e) iconv(a,b,c,d,e) +#define icv(a, b, c, d, e) iconv(a, b, c, d, e) #endif @@ -225,17 +225,17 @@ PHP_FUNCTION(iconv_set_encoding) convert_to_string_ex(type); convert_to_string_ex(charset); - if(!strcasecmp("input_encoding",Z_STRVAL_PP(type))) { + if(!strcasecmp("input_encoding", Z_STRVAL_PP(type))) { if (ICONVG(input_encoding)) { free(ICONVG(input_encoding)); } ICONVG(input_encoding) = estrndup(Z_STRVAL_PP(charset), Z_STRLEN_PP(charset)); - } else if(!strcasecmp("output_encoding",Z_STRVAL_PP(type))) { + } else if(!strcasecmp("output_encoding", Z_STRVAL_PP(type))) { if (ICONVG(output_encoding)) { free(ICONVG(output_encoding)); } ICONVG(output_encoding) = estrndup(Z_STRVAL_PP(charset), Z_STRLEN_PP(charset)); - } else if(!strcasecmp("internal_encoding",Z_STRVAL_PP(type))) { + } else if(!strcasecmp("internal_encoding", Z_STRVAL_PP(type))) { if (ICONVG(internal_encoding)) { free(ICONVG(internal_encoding)); } @@ -261,7 +261,7 @@ PHP_FUNCTION(iconv_get_encoding) convert_to_string_ex(type); - if (argc == 0 || !strcasecmp("all",Z_STRVAL_PP(type))) { + if (argc == 0 || !strcasecmp("all", Z_STRVAL_PP(type))) { if (array_init(return_value) == FAILURE) { RETURN_FALSE; } @@ -271,11 +271,11 @@ PHP_FUNCTION(iconv_get_encoding) ICONVG(output_encoding), 1); add_assoc_string(return_value, "internal_encoding", ICONVG(internal_encoding), 1); - } else if (!strcasecmp("input_encoding",Z_STRVAL_PP(type))) { + } else if (!strcasecmp("input_encoding", Z_STRVAL_PP(type))) { RETVAL_STRING(ICONVG(input_encoding), 1); - } else if (!strcasecmp("output_encoding",Z_STRVAL_PP(type))) { + } else if (!strcasecmp("output_encoding", Z_STRVAL_PP(type))) { RETVAL_STRING(ICONVG(output_encoding), 1); - } else if (!strcasecmp("internal_encoding",Z_STRVAL_PP(type))) { + } else if (!strcasecmp("internal_encoding", Z_STRVAL_PP(type))) { RETVAL_STRING(ICONVG(internal_encoding), 1); } else { RETURN_FALSE; diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 3d3c30c637..2c4afdf5a0 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -336,7 +336,7 @@ void mail_free_errorlist(ERRORLIST **errlist) */ MESSAGELIST *mail_newmessagelist(void) { - return (MESSAGELIST *) memset(fs_get(sizeof(MESSAGELIST)),0, + return (MESSAGELIST *) memset(fs_get(sizeof(MESSAGELIST)), 0, sizeof(MESSAGELIST)); } /* }}} */ @@ -363,7 +363,7 @@ void mail_free_messagelist(MESSAGELIST **msglist) * Called via the mail_parameter function in c-client:src/c-client/mail.c * Author DRK */ -void mail_getquota(MAILSTREAM *stream, char *qroot,QUOTALIST *qlist) +void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist) { TSRMLS_FETCH(); @@ -508,15 +508,15 @@ PHP_MINIT_FUNCTION(imap) /* Status options */ - REGISTER_MAIN_LONG_CONSTANT("SA_MESSAGES",SA_MESSAGES , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SA_MESSAGES", SA_MESSAGES , CONST_PERSISTENT | CONST_CS); /* number of messages */ REGISTER_MAIN_LONG_CONSTANT("SA_RECENT", SA_RECENT, CONST_PERSISTENT | CONST_CS); /* number of recent messages */ - REGISTER_MAIN_LONG_CONSTANT("SA_UNSEEN",SA_UNSEEN , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SA_UNSEEN", SA_UNSEEN , CONST_PERSISTENT | CONST_CS); /* number of unseen messages */ REGISTER_MAIN_LONG_CONSTANT("SA_UIDNEXT", SA_UIDNEXT, CONST_PERSISTENT | CONST_CS); /* next UID to be assigned */ - REGISTER_MAIN_LONG_CONSTANT("SA_UIDVALIDITY",SA_UIDVALIDITY , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SA_UIDVALIDITY", SA_UIDVALIDITY , CONST_PERSISTENT | CONST_CS); /* UID validity value */ REGISTER_MAIN_LONG_CONSTANT("SA_ALL", sa_all, CONST_PERSISTENT | CONST_CS); /* get all status information */ @@ -524,37 +524,37 @@ PHP_MINIT_FUNCTION(imap) /* Bits for mm_list() and mm_lsub() */ - REGISTER_MAIN_LONG_CONSTANT("LATT_NOINFERIORS",LATT_NOINFERIORS , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("LATT_NOINFERIORS", LATT_NOINFERIORS , CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("LATT_NOSELECT", LATT_NOSELECT, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT("LATT_MARKED", LATT_MARKED, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("LATT_UNMARKED",LATT_UNMARKED , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("LATT_UNMARKED", LATT_UNMARKED , CONST_PERSISTENT | CONST_CS); /* Sort functions */ - REGISTER_MAIN_LONG_CONSTANT("SORTDATE",SORTDATE , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SORTDATE", SORTDATE , CONST_PERSISTENT | CONST_CS); /* date */ - REGISTER_MAIN_LONG_CONSTANT("SORTARRIVAL",SORTARRIVAL , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SORTARRIVAL", SORTARRIVAL , CONST_PERSISTENT | CONST_CS); /* arrival date */ - REGISTER_MAIN_LONG_CONSTANT("SORTFROM",SORTFROM , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SORTFROM", SORTFROM , CONST_PERSISTENT | CONST_CS); /* from */ - REGISTER_MAIN_LONG_CONSTANT("SORTSUBJECT",SORTSUBJECT , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SORTSUBJECT", SORTSUBJECT , CONST_PERSISTENT | CONST_CS); /* subject */ - REGISTER_MAIN_LONG_CONSTANT("SORTTO",SORTTO , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SORTTO", SORTTO , CONST_PERSISTENT | CONST_CS); /* to */ - REGISTER_MAIN_LONG_CONSTANT("SORTCC",SORTCC , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SORTCC", SORTCC , CONST_PERSISTENT | CONST_CS); /* cc */ - REGISTER_MAIN_LONG_CONSTANT("SORTSIZE",SORTSIZE , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("SORTSIZE", SORTSIZE , CONST_PERSISTENT | CONST_CS); /* size */ - REGISTER_MAIN_LONG_CONSTANT("TYPETEXT",TYPETEXT , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("TYPEMULTIPART",TYPEMULTIPART , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("TYPEMESSAGE",TYPEMESSAGE , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("TYPEAPPLICATION",TYPEAPPLICATION , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("TYPEAUDIO",TYPEAUDIO , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("TYPEIMAGE",TYPEIMAGE , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("TYPEVIDEO",TYPEVIDEO , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("TYPEOTHER",TYPEOTHER , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPETEXT", TYPETEXT , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPEMULTIPART", TYPEMULTIPART , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPEMESSAGE", TYPEMESSAGE , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPEAPPLICATION", TYPEAPPLICATION , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPEAUDIO", TYPEAUDIO , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPEIMAGE", TYPEIMAGE , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPEVIDEO", TYPEVIDEO , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("TYPEOTHER", TYPEOTHER , CONST_PERSISTENT | CONST_CS); /* TYPETEXT unformatted text TYPEMULTIPART multiple part @@ -566,12 +566,12 @@ PHP_MINIT_FUNCTION(imap) TYPEOTHER unknown */ - REGISTER_MAIN_LONG_CONSTANT("ENC7BIT",ENC7BIT , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("ENC8BIT",ENC8BIT , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("ENCBINARY",ENCBINARY , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("ENCBASE64",ENCBASE64, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("ENCQUOTEDPRINTABLE",ENCQUOTEDPRINTABLE , CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("ENCOTHER",ENCOTHER , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("ENC7BIT", ENC7BIT , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("ENC8BIT", ENC8BIT , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("ENCBINARY", ENCBINARY , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("ENCBASE64", ENCBASE64, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("ENCQUOTEDPRINTABLE", ENCQUOTEDPRINTABLE , CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT("ENCOTHER", ENCOTHER , CONST_PERSISTENT | CONST_CS); /* ENC7BIT 7 bit SMTP semantic data ENC8BIT 8 bit SMTP semantic data @@ -1158,8 +1158,8 @@ PHP_FUNCTION(imap_headers) } for (msgno = 1; msgno <= imap_le_struct->imap_stream->nmsgs; msgno++) { - MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream,msgno); - mail_fetchstructure(imap_le_struct->imap_stream,msgno,NIL); + MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream, msgno); + mail_fetchstructure(imap_le_struct->imap_stream, msgno, NIL); tmp[0] = cache->recent ? (cache->seen ? 'R': 'N') : ' '; tmp[1] = (cache->recent | cache->seen) ? ' ' : 'U'; tmp[2] = cache->flagged ? 'F' : ' '; @@ -1847,7 +1847,7 @@ PHP_FUNCTION(imap_fetchstructure) RETURN_FALSE; } - mail_fetchstructure_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &body ,myargc == 3 ? Z_LVAL_PP(flags) : NIL); + mail_fetchstructure_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &body , myargc == 3 ? Z_LVAL_PP(flags) : NIL); if (!body) { php_error(E_WARNING, "No body information available"); @@ -2016,8 +2016,8 @@ PHP_FUNCTION(imap_mailboxmsginfo) msize = 0; for (msgno = 1; msgno <= imap_le_struct->imap_stream->nmsgs; msgno++) { - MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream,msgno); - mail_fetchstructure (imap_le_struct->imap_stream,msgno,NIL); + MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream, msgno); + mail_fetchstructure (imap_le_struct->imap_stream, msgno, NIL); if (!cache->seen || cache->recent) { unreadmsg++; @@ -3166,15 +3166,15 @@ PHP_FUNCTION(imap_mail_compose) /* output cookie, mini-header, and contents */ tempstring=emalloc(strlen(mystring)+strlen(tmp)+1); - strcpy(tempstring,mystring); + strcpy(tempstring, mystring); efree(mystring); mystring=tempstring; - strcat(mystring,tmp); + strcat(mystring, tmp); bod=&part->body; tempstring=emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1); - strcpy(tempstring,mystring); + strcpy(tempstring, mystring); efree(mystring); mystring=tempstring; sprintf(mystring, "%s%s%s", mystring, bod->contents.text.data, CRLF); @@ -3184,7 +3184,7 @@ PHP_FUNCTION(imap_mail_compose) sprintf(tmp, "--%s--", cookie); tempstring=emalloc(strlen(tmp)+strlen(CRLF)+strlen(mystring)+1); - strcpy(tempstring,mystring); + strcpy(tempstring, mystring); efree(mystring); mystring=tempstring; sprintf(mystring, "%s%s%s", mystring, tmp, CRLF); @@ -3192,7 +3192,7 @@ PHP_FUNCTION(imap_mail_compose) } else if (bod) { tempstring=emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1); - strcpy(tempstring,mystring); + strcpy(tempstring, mystring); efree(mystring); mystring=tempstring; sprintf(mystring, "%s%s%s", mystring, bod->contents.text.data, CRLF); @@ -3202,7 +3202,7 @@ PHP_FUNCTION(imap_mail_compose) RETURN_FALSE; } - RETVAL_STRINGL(mystring,strlen(mystring), 1); + RETVAL_STRINGL(mystring, strlen(mystring), 1); efree(tempstring); } /* }}} */ @@ -3809,26 +3809,26 @@ static void build_thread_tree_helper(THREADNODE *cur, zval *tree, long *numNodes unsigned long thisNode = *numNodes; /* define "#.num" */ - snprintf(buf,25,"%ld.num", thisNode); + snprintf(buf, 25, "%ld.num", thisNode); - add_assoc_long(tree,buf,cur->num); + add_assoc_long(tree, buf, cur->num); - snprintf(buf,25,"%ld.next", thisNode); + snprintf(buf, 25, "%ld.next", thisNode); if(cur->next) { (*numNodes)++; - add_assoc_long(tree,buf,*numNodes); + add_assoc_long(tree, buf, *numNodes); build_thread_tree_helper(cur->next, tree, numNodes, buf); } else { /* "null pointer" */ - add_assoc_long(tree,buf,0); + add_assoc_long(tree, buf, 0); } - snprintf(buf,25,"%ld.branch", thisNode); + snprintf(buf, 25, "%ld.branch", thisNode); if(cur->branch) { (*numNodes)++; - add_assoc_long(tree,buf,*numNodes); + add_assoc_long(tree, buf, *numNodes); build_thread_tree_helper(cur->branch, tree, numNodes, buf); } else { /* "null pointer" */ - add_assoc_long(tree,buf,0); + add_assoc_long(tree, buf, 0); } } /* }}} */ @@ -3891,7 +3891,7 @@ PHP_FUNCTION (imap_thread) /* {{{ Interfaces to C-client */ -void mm_searched(MAILSTREAM *stream,unsigned long number) +void mm_searched(MAILSTREAM *stream, unsigned long number) { MESSAGELIST *cur = NIL; TSRMLS_FETCH(); @@ -3912,15 +3912,15 @@ void mm_searched(MAILSTREAM *stream,unsigned long number) } } -void mm_exists(MAILSTREAM *stream,unsigned long number) +void mm_exists(MAILSTREAM *stream, unsigned long number) { } -void mm_expunged(MAILSTREAM *stream,unsigned long number) +void mm_expunged(MAILSTREAM *stream, unsigned long number) { } -void mm_flags(MAILSTREAM *stream,unsigned long number) +void mm_flags(MAILSTREAM *stream, unsigned long number) { } @@ -3948,7 +3948,7 @@ void mm_notify(MAILSTREAM *stream, char *str, long errflg) } } -void mm_list(MAILSTREAM *stream,DTYPE delimiter, char *mailbox, long attributes) +void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) { STRINGLIST *cur=NIL; FOBJECTLIST *ocur=NIL; @@ -3997,7 +3997,7 @@ void mm_list(MAILSTREAM *stream,DTYPE delimiter, char *mailbox, long attributes) } } -void mm_lsub(MAILSTREAM *stream,DTYPE delimiter, char *mailbox, long attributes) +void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) { STRINGLIST *cur=NIL; FOBJECTLIST *ocur=NIL; @@ -4043,7 +4043,7 @@ void mm_lsub(MAILSTREAM *stream,DTYPE delimiter, char *mailbox, long attributes) } } -void mm_status(MAILSTREAM *stream, char *mailbox,MAILSTATUS *status) +void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status) { TSRMLS_FETCH(); @@ -4103,7 +4103,7 @@ void mm_login(NETMBX *mb, char *user, char *pwd, long trial) TSRMLS_FETCH(); if (*mb->user) { - strlcpy (user,mb->user, MAILTMPLEN); + strlcpy (user, mb->user, MAILTMPLEN); } else { strlcpy (user, IMAPG(imap_user), MAILTMPLEN); } diff --git a/ext/informix/php_informix.h b/ext/informix/php_informix.h index f693aef570..d9c9e0bf23 100644 --- a/ext/informix/php_informix.h +++ b/ext/informix/php_informix.h @@ -101,8 +101,8 @@ PHP_FUNCTION(ifxus_tell_slob); ZEND_BEGIN_MODULE_GLOBALS(ifx) long default_link; - long num_links,num_persistent; - long max_links,max_persistent; + long num_links, num_persistent; + long max_links, max_persistent; long allow_persistent; char *default_host, *default_user, *default_password; int connectionid; diff --git a/ext/ingres_ii/ii.c b/ext/ingres_ii/ii.c index ef69b33396..d9646fd1b8 100644 --- a/ext/ingres_ii/ii.c +++ b/ext/ingres_ii/ii.c @@ -38,7 +38,7 @@ ZEND_DECLARE_MODULE_GLOBALS(ii) /* True globals, no need for thread safety */ -static int le_ii_link,le_ii_plink; +static int le_ii_link, le_ii_plink; #define SAFE_STRING(s) ((s)?(s):"") @@ -123,7 +123,7 @@ static int _rollback_transaction(II_LINK *link) IIAPI_ROLLBACKPARM rollbackParm; if(link->stmtHandle && _close_statement(link)) { - php_error(E_WARNING,"Ingres II: Unable to close statement !!"); + php_error(E_WARNING, "Ingres II: Unable to close statement !!"); return 1; } @@ -148,7 +148,7 @@ static void _close_ii_link(II_LINK *link TSRMLS_DC) IIAPI_DISCONNPARM disconnParm; if(link->tranHandle && _rollback_transaction(link)) { - php_error(E_WARNING,"Ingres II: Unable to rollback transaction !!"); + php_error(E_WARNING, "Ingres II: Unable to rollback transaction !!"); } disconnParm.dc_genParm.gp_callback = NULL; @@ -196,7 +196,7 @@ static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) if(link->autocommit) { if(link->stmtHandle && _close_statement(link)) { - php_error(E_WARNING,"Ingres II: Unable to close statement !!"); + php_error(E_WARNING, "Ingres II: Unable to close statement !!"); } autoParm.ac_genParm.gp_callback = NULL; @@ -208,7 +208,7 @@ static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) ii_sync(&(autoParm.ac_genParm)); if(ii_success(&(autoParm.ac_genParm))==II_FAIL) { - php_error(E_WARNING,"Ingres II: Unable to disable autocommit"); + php_error(E_WARNING, "Ingres II: Unable to disable autocommit"); } link->autocommit = 0; @@ -216,7 +216,7 @@ static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) } if(link->tranHandle && _rollback_transaction(link)) { - php_error(E_WARNING,"Ingres II: Unable to rollback transaction !!"); + php_error(E_WARNING, "Ingres II: Unable to rollback transaction !!"); } } @@ -348,7 +348,7 @@ static int ii_sync(IIAPI_GENPARM *genParm) } if (waitParm.wt_status != IIAPI_ST_SUCCESS) { - php_error(E_WARNING,"Ingres II: Unexpected failure of IIapi_wait()"); + php_error(E_WARNING, "Ingres II: Unexpected failure of IIapi_wait()"); return 0; } return 1; @@ -365,14 +365,14 @@ static int ii_success(IIAPI_GENPARM *genParm) return II_NO_DATA; default: if(genParm->gp_errorHandle == NULL) { /* no error message available */ - php_error(E_WARNING,"Ingres II: Server or API error - no error message available"); + php_error(E_WARNING, "Ingres II: Server or API error - no error message available"); } else { IIAPI_GETEINFOPARM getEInfoParm; getEInfoParm.ge_errorHandle = genParm->gp_errorHandle; IIapi_getErrorInfo(&getEInfoParm); - php_error(E_WARNING,"Ingres II: Server or API error : %s", getEInfoParm.ge_message); - php_error(E_WARNING,"Ingres II: SQLSTATE : %s", getEInfoParm.ge_SQLSTATE); + php_error(E_WARNING, "Ingres II: Server or API error : %s", getEInfoParm.ge_message); + php_error(E_WARNING, "Ingres II: SQLSTATE : %s", getEInfoParm.ge_SQLSTATE); } return II_FAIL; } @@ -380,7 +380,7 @@ static int ii_success(IIAPI_GENPARM *genParm) /* Actually handles connection creation, either persistent or not */ -static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) +static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) { zval **database, **username, **password; char *db, *user, *pass; @@ -396,14 +396,14 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) if (PG(sql_safe_mode)) { if (argc>0) { - php_error(E_NOTICE,"SQL safe mode in effect - ignoring host/user/password information"); + php_error(E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information"); } db = pass = NULL; user=php_get_current_user(); hashed_details_length = strlen(user) + sizeof("ingres___")-1; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"ingres__%s_",user); + sprintf(hashed_details, "Ingres__%s_", user); } else { db = IIG(default_database); user = IIG(default_user); @@ -432,13 +432,13 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) hashed_details_length = sizeof("ingres___")-1 + strlen(SAFE_STRING(db))+strlen(SAFE_STRING(user))+strlen(SAFE_STRING(pass)); hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"ingres_%s_%s_%s",SAFE_STRING(db), SAFE_STRING(user), SAFE_STRING(pass)); + sprintf(hashed_details, "Ingres_%s_%s_%s", SAFE_STRING(db), SAFE_STRING(user), SAFE_STRING(pass)); } /* if asked for unauthorized persistency, issue a warning and go for a non-persistent link */ if (persistent && !IIG(allow_persistent)) { - php_error(E_WARNING,"Ingres II: Persistent links disabled !"); + php_error(E_WARNING, "Ingres II: Persistent links disabled !"); persistent = 0; } @@ -451,12 +451,12 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) list_entry new_le; if (IIG(max_links)!=-1 && IIG(num_links)>=IIG(max_links)) { - php_error(E_WARNING,"Ingres II: Too many open links (%d)",IIG(num_links)); + php_error(E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links)); efree(hashed_details); RETURN_FALSE; } if (IIG(max_persistent)!=-1 && IIG(num_persistent)>=IIG(max_persistent)) { - php_error(E_WARNING,"Ingres II: Too many open persistent links (%d)",IIG(num_persistent)); + php_error(E_WARNING, "Ingres II: Too many open persistent links (%d)", IIG(num_persistent)); efree(hashed_details); RETURN_FALSE; } @@ -475,7 +475,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) if(!ii_sync(&(connParm.co_genParm)) || ii_success(&(connParm.co_genParm)) == II_FAIL) { efree(hashed_details); - php_error(E_WARNING,"Ingres II: Unable to connect to database (%s)", db); + php_error(E_WARNING, "Ingres II: Unable to connect to database (%s)", db); RETURN_FALSE; } @@ -491,7 +491,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) new_le.type = le_ii_plink; new_le.ptr = link; if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { - php_error(E_WARNING,"Ingres II: Unable to hash (%s)", hashed_details); + php_error(E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details); free(link); efree(hashed_details); RETURN_FALSE; @@ -509,14 +509,14 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) } ZEND_REGISTER_RESOURCE(return_value, link, le_ii_plink); } else { /* non persistent */ - list_entry *index_ptr,new_index_ptr; + list_entry *index_ptr, new_index_ptr; /* first we check the hash for the hashed_details key. if it exists, * it should point us to the right offset where the actual link sits. * if it doesn't, open a new link, add it to the resource list, * and add a pointer to it with hashed_details as the key. */ - if (zend_hash_find(&EG(regular_list),hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { + if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length+1, (void **) &index_ptr)==SUCCESS) { int type; void *ptr; @@ -524,7 +524,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) RETURN_FALSE; } link = (II_LINK *) index_ptr->ptr; - ptr = zend_list_find((int) link,&type); /* check if the link is still there */ + ptr = zend_list_find((int) link, &type); /* check if the link is still there */ if (ptr && (type==le_ii_link || type==le_ii_plink)) { zend_list_addref((int) link); return_value->value.lval = (int) link; @@ -535,11 +535,11 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) efree(hashed_details); return; } else { - zend_hash_del(&EG(regular_list),hashed_details,hashed_details_length+1); + zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length+1); } } if (IIG(max_links)!=-1 && IIG(num_links)>=IIG(max_links)) { - php_error(E_WARNING,"Ingres II: Too many open links (%d)",IIG(num_links)); + php_error(E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links)); efree(hashed_details); RETURN_FALSE; } @@ -558,7 +558,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) if(!ii_sync(&(connParm.co_genParm)) || ii_success(&(connParm.co_genParm)) == II_FAIL) { efree(hashed_details); - php_error(E_WARNING,"Ingres II: Unable to connect to database (%s)", db); + php_error(E_WARNING, "Ingres II: Unable to connect to database (%s)", db); RETURN_FALSE; } @@ -576,8 +576,8 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) /* add it to the hash */ new_index_ptr.ptr = (void *) return_value->value.lval; new_index_ptr.type = le_index_ptr; - if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { - php_error(E_WARNING,"Ingres II: Unable to hash (%s)", hashed_details); + if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1, (void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { + php_error(E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details); free(link); efree(hashed_details); RETURN_FALSE; @@ -667,7 +667,7 @@ PHP_FUNCTION(ingres_query) /* if there's already an active statement, close it */ if(ii_link->stmtHandle && _close_statement(ii_link)) { - php_error(E_WARNING,"Ingres II: Unable to close statement !!"); + php_error(E_WARNING, "Ingres II: Unable to close statement !!"); RETURN_FALSE; } @@ -837,7 +837,7 @@ static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type) fun_name = "foobar"; break; } - php_error(E_WARNING,"Ingres II: %s() called with wrong index (%d)",fun_name,index); + php_error(E_WARNING, "Ingres II: %s() called with wrong index (%d)", fun_name, index); RETURN_FALSE; } @@ -851,23 +851,23 @@ static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type) break; case II_FIELD_INFO_TYPE: switch((ii_link->descriptor[index - 1]).ds_dataType) { - case IIAPI_BYTE_TYPE: RETURN_STRING("IIAPI_BYTE_TYPE",1); - case IIAPI_CHA_TYPE: RETURN_STRING("IIAPI_CHA_TYPE",1); - case IIAPI_CHR_TYPE: RETURN_STRING("IIAPI_CHR_TYPE",1); - case IIAPI_DEC_TYPE: RETURN_STRING("IIAPI_DEC_TYPE",1); - case IIAPI_DTE_TYPE: RETURN_STRING("IIAPI_DTE_TYPE",1); - case IIAPI_FLT_TYPE: RETURN_STRING("IIAPI_FLT_TYPE",1); - case IIAPI_INT_TYPE: RETURN_STRING("IIAPI_INT_TYPE",1); - case IIAPI_LOGKEY_TYPE: RETURN_STRING("IIAPI_LOGKEY_TYPE",1); - case IIAPI_LBYTE_TYPE: RETURN_STRING("IIAPI_LBYTE_TYPE",1); - case IIAPI_LVCH_TYPE: RETURN_STRING("IIAPI_LVCH_TYPE",1); - case IIAPI_MNY_TYPE: RETURN_STRING("IIAPI_MNY_TYPE",1); - case IIAPI_TABKEY_TYPE: RETURN_STRING("IIAPI_TABKEY_TYPE",1); - case IIAPI_TXT_TYPE: RETURN_STRING("IIAPI_TXT_TYPE",1); - case IIAPI_VBYTE_TYPE: RETURN_STRING("IIAPI_VBYTE_TYPE",1); - case IIAPI_VCH_TYPE: RETURN_STRING("IIAPI_VCH_TYPE",1); + case IIAPI_BYTE_TYPE: RETURN_STRING("IIAPI_BYTE_TYPE", 1); + case IIAPI_CHA_TYPE: RETURN_STRING("IIAPI_CHA_TYPE", 1); + case IIAPI_CHR_TYPE: RETURN_STRING("IIAPI_CHR_TYPE", 1); + case IIAPI_DEC_TYPE: RETURN_STRING("IIAPI_DEC_TYPE", 1); + case IIAPI_DTE_TYPE: RETURN_STRING("IIAPI_DTE_TYPE", 1); + case IIAPI_FLT_TYPE: RETURN_STRING("IIAPI_FLT_TYPE", 1); + case IIAPI_INT_TYPE: RETURN_STRING("IIAPI_INT_TYPE", 1); + case IIAPI_LOGKEY_TYPE: RETURN_STRING("IIAPI_LOGKEY_TYPE", 1); + case IIAPI_LBYTE_TYPE: RETURN_STRING("IIAPI_LBYTE_TYPE", 1); + case IIAPI_LVCH_TYPE: RETURN_STRING("IIAPI_LVCH_TYPE", 1); + case IIAPI_MNY_TYPE: RETURN_STRING("IIAPI_MNY_TYPE", 1); + case IIAPI_TABKEY_TYPE: RETURN_STRING("IIAPI_TABKEY_TYPE", 1); + case IIAPI_TXT_TYPE: RETURN_STRING("IIAPI_TXT_TYPE", 1); + case IIAPI_VBYTE_TYPE: RETURN_STRING("IIAPI_VBYTE_TYPE", 1); + case IIAPI_VCH_TYPE: RETURN_STRING("IIAPI_VCH_TYPE", 1); default: - php_error(E_WARNING,"Ingres II: Unknown Ingres data type"); + php_error(E_WARNING, "Ingres II: Unknown Ingres data type"); RETURN_FALSE; break; } @@ -898,7 +898,7 @@ static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type) static char *php_ii_field_name(II_LINK *ii_link, int index) { if(index < 1 || index > ii_link->fieldCount) { - php_error(E_WARNING,"Ingres II: php_ii_field_name() called with wrong index (%d)",index); + php_error(E_WARNING, "Ingres II: php_ii_field_name() called with wrong index (%d)", index); return NULL; } @@ -955,7 +955,7 @@ PHP_FUNCTION(ingres_field_scale) /* Convert complex Ingres data types to php-usable ones */ -#define IIAPI_CONVERT(destType,destSize,precision) {\ +#define IIAPI_CONVERT(destType, destSize, precision) {\ convertParm.cv_srcDesc.ds_dataType = (ii_link->descriptor[i+k-2]).ds_dataType;\ convertParm.cv_srcDesc.ds_nullable = (ii_link->descriptor[i+k-2]).ds_nullable;\ convertParm.cv_srcDesc.ds_length = (ii_link->descriptor[i+k-2]).ds_length;\ @@ -994,7 +994,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res IIAPI_GETCOLPARM getColParm; IIAPI_DATAVALUE *columnData; IIAPI_CONVERTPARM convertParm; - int i,j,k; + int i, j, k; int more; double value_double=0; long value_long=0; @@ -1049,7 +1049,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res more = getColParm.gc_moreSegments; if(more){ /* more segments of LBYTE or LVCH element to come */ /* Multi segment LBYTE and LVCH elements not supported yet */ - php_error(E_ERROR,"Ingres II: Multi segment LBYTE and LVCH elements not supported yet"); + php_error(E_ERROR, "Ingres II: Multi segment LBYTE and LVCH elements not supported yet"); } else { for(k=1; k<=j; k++) { if(columnData[k-1].dv_null) { /* NULL value ? */ @@ -1068,7 +1068,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res case IIAPI_DEC_TYPE: /* decimal (fixed point number) */ case IIAPI_MNY_TYPE: /* money */ /* convert to floating point number */ - IIAPI_CONVERT(IIAPI_FLT_TYPE,sizeof(II_FLOAT8),53); + IIAPI_CONVERT(IIAPI_FLT_TYPE, sizeof(II_FLOAT8), 53); /* NO break */ case IIAPI_FLT_TYPE: /* floating point number */ switch(columnData[k-1].dv_length) { @@ -1079,7 +1079,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res value_double = (double) *((II_FLOAT8 *) columnData[k-1].dv_value); break; default: - php_error(E_WARNING,"Ingres II: Invalid size for IIAPI_FLT_TYPE data (%d)",columnData[k-1].dv_length); + php_error(E_WARNING, "Ingres II: Invalid size for IIAPI_FLT_TYPE data (%d)", columnData[k-1].dv_length); break; } if(result_type & II_NUM) { @@ -1101,7 +1101,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res value_long = (long) *((II_INT4 *) columnData[k-1].dv_value); break; default: - php_error(E_WARNING,"Ingres II: Invalid size for IIAPI_INT_TYPE data (%d)",columnData[k-1].dv_length); + php_error(E_WARNING, "Ingres II: Invalid size for IIAPI_INT_TYPE data (%d)", columnData[k-1].dv_length); break; } if(result_type & II_NUM) { @@ -1128,11 +1128,11 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res case IIAPI_DTE_TYPE: /* date */ /* eventualy convert date to string */ if((ii_link->descriptor[i+k-2]).ds_dataType==IIAPI_DTE_TYPE) { - IIAPI_CONVERT(IIAPI_CHA_TYPE,32,0); + IIAPI_CONVERT(IIAPI_CHA_TYPE, 32, 0); } /* use php_addslashes if asked to */ if(PG(magic_quotes_runtime)) { - value_char_p = php_addslashes((char *) columnData[k-1].dv_value,columnData[k-1].dv_length,&len,0 TSRMLS_CC); + value_char_p = php_addslashes((char *) columnData[k-1].dv_value, columnData[k-1].dv_length, &len, 0 TSRMLS_CC); should_copy = 0; } else { value_char_p = (char *) columnData[k-1].dv_value; @@ -1153,7 +1153,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res } break; default: - php_error(E_WARNING,"Ingres II: Invalid SQL data type in fetched field (%d -- length : %d)",(ii_link->descriptor[i+k-2]).ds_dataType,columnData[k-1].dv_length); + php_error(E_WARNING, "Ingres II: Invalid SQL data type in fetched field (%d -- length : %d)", (ii_link->descriptor[i+k-2]).ds_dataType, columnData[k-1].dv_length); break; } } @@ -1302,7 +1302,7 @@ PHP_FUNCTION(ingres_commit) ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink); if(ii_link->stmtHandle && _close_statement(ii_link)) { - php_error(E_WARNING,"Ingres II: Unable to close statement !!"); + php_error(E_WARNING, "Ingres II: Unable to close statement !!"); RETURN_FALSE; } diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index b4df082631..273520c58f 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -215,7 +215,7 @@ typedef struct { convert_to_long(blob_arg); \ blob_ptr = (ibase_blob_handle *) zend_list_find(blob_arg->value.lval, &type); \ if (type!=le_blob) { \ - _php_ibase_module_error("%d is not blob handle",blob_arg->value.lval); \ + _php_ibase_module_error("%d is not blob handle", blob_arg->value.lval); \ RETURN_FALSE; \ } \ } @@ -237,7 +237,7 @@ typedef struct { PHP_FUNCTION(ibase_errmsg) { if (IBG(errmsg[0])) { - RETURN_STRING(IBG(errmsg),1); + RETURN_STRING(IBG(errmsg), 1); } RETURN_FALSE; } @@ -809,7 +809,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) * and add a pointer to it with hashed_details as the key. */ if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length+1, (void **) &index_ptr)==SUCCESS) { - int type,xlink; + int type, xlink; void *ptr; if (index_ptr->type != le_index_ptr) { RETURN_FALSE; @@ -984,7 +984,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, int *array_cntp, break; default: _php_ibase_module_error("unexpected array type %d in relation '%s' column '%s')", - ar_desc->array_desc_dtype,var->relname, var->sqlname); + ar_desc->array_desc_dtype, var->relname, var->sqlname); efree(IB_ARRAY); IB_ARRAY = NULL; return FAILURE; @@ -1043,7 +1043,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i /* not enough output variables ? */ if (IB_QUERY->out_sqlda->sqld > IB_QUERY->out_sqlda->sqln) { - IB_QUERY->out_sqlda = erealloc(IB_QUERY->out_sqlda,XSQLDA_LENGTH(IB_QUERY->out_sqlda->sqld)); + IB_QUERY->out_sqlda = erealloc(IB_QUERY->out_sqlda, XSQLDA_LENGTH(IB_QUERY->out_sqlda->sqld)); IB_QUERY->out_sqlda->sqln = IB_QUERY->out_sqlda->sqld; IB_QUERY->out_sqlda->version = SQLDA_VERSION1; if (isc_dsql_describe(IB_STATUS, &IB_QUERY->stmt, SQLDA_VERSION1, IB_QUERY->out_sqlda)) { @@ -1063,7 +1063,7 @@ static int _php_ibase_alloc_query(ibase_query **ib_queryp, isc_db_handle link, i /* not enough input variables ? */ if (IB_QUERY->in_sqlda->sqln < IB_QUERY->in_sqlda->sqld) { - IB_QUERY->in_sqlda = erealloc(IB_QUERY->in_sqlda,XSQLDA_LENGTH(IB_QUERY->in_sqlda->sqld)); + IB_QUERY->in_sqlda = erealloc(IB_QUERY->in_sqlda, XSQLDA_LENGTH(IB_QUERY->in_sqlda->sqld)); IB_QUERY->in_sqlda->sqln = IB_QUERY->in_sqlda->sqld; IB_QUERY->in_sqlda->version = SQLDA_VERSION1; if (isc_dsql_describe_bind(IB_STATUS, &IB_QUERY->stmt, SQLDA_VERSION1, IB_QUERY->in_sqlda)) { @@ -1201,7 +1201,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf) convert_to_string(b_var); - n = sscanf(b_var->value.str.val,"%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d", + n = sscanf(b_var->value.str.val, "%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d", &t.tm_mon, &t.tm_mday, &t.tm_year, &t.tm_hour, &t.tm_min, &t.tm_sec); if(n != 3 && n != 6){ _php_ibase_module_error("invalid date/time format"); @@ -1359,7 +1359,7 @@ static int _php_ibase_exec(ibase_result **ib_resultp, ibase_query *ib_query, int IB_RESULT->drop_stmt = 0; /* when free result close but not drop!*/ out_sqlda = IB_RESULT->out_sqlda = emalloc(XSQLDA_LENGTH(ib_query->out_sqlda->sqld)); - memcpy(out_sqlda,ib_query->out_sqlda,XSQLDA_LENGTH(ib_query->out_sqlda->sqld)); + memcpy(out_sqlda, ib_query->out_sqlda, XSQLDA_LENGTH(ib_query->out_sqlda->sqld)); _php_ibase_alloc_xsqlda(out_sqlda); if (ib_query->out_array) { @@ -1575,7 +1575,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) } /* }}} */ -/* {{{ proto int ibase_commit([int link_identifier,] int trans_number) +/* {{{ proto int ibase_commit([int link_identifier, ] int trans_number) Commit transaction */ PHP_FUNCTION(ibase_commit) { @@ -1583,7 +1583,7 @@ PHP_FUNCTION(ibase_commit) } /* }}} */ -/* {{{ proto int ibase_rollback([int link_identifier,] int trans_number) +/* {{{ proto int ibase_rollback([int link_identifier, ] int trans_number) Roolback transaction */ PHP_FUNCTION(ibase_rollback) { @@ -1591,7 +1591,7 @@ PHP_FUNCTION(ibase_rollback) } /* }}} */ -/* {{{ proto int ibase_query([int link_identifier,] string query [, int bind_args]) +/* {{{ proto int ibase_query([int link_identifier, ] string query [, int bind_args]) Execute a query */ PHP_FUNCTION(ibase_query) { @@ -1817,7 +1817,7 @@ static int _php_ibase_arr_pval(pval *ar_pval, char **datap, ibase_array *ib_arra if (dim > 16) { /* InterBase limit */ - _php_ibase_module_error("php module internal error in %s %d",__FILE__,__LINE__); + _php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__); return FAILURE; } @@ -1846,7 +1846,7 @@ static int _php_ibase_arr_pval(pval *ar_pval, char **datap, ibase_array *ib_arra /* FIXME ??? */ zend_hash_index_update(ar_pval->value.ht, l_bound + i, - (void *) &tmp, sizeof(pval),NULL); + (void *) &tmp, sizeof(pval), NULL); *datap += ib_array->el_size; } } @@ -1951,7 +1951,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) } bl_items[0] = isc_info_blob_total_length; - if (isc_blob_info(IB_STATUS,&bl_handle,sizeof(bl_items),bl_items,sizeof(bl_info),bl_info)) { + if (isc_blob_info(IB_STATUS, &bl_handle, sizeof(bl_items), bl_items, sizeof(bl_info), bl_info)) { _php_ibase_error(); RETURN_FALSE; } @@ -1976,7 +1976,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) cur_len += seg_len; if (cur_len > max_len) { /* never!*/ efree(bl_data); - _php_ibase_module_error("php module internal error in %s %d",__FILE__,__LINE__); + _php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__); RETURN_FALSE; } } @@ -2107,7 +2107,7 @@ PHP_FUNCTION(ibase_free_result) } /* }}} */ -/* {{{ proto int ibase_prepare([int link_identifier,] string query) +/* {{{ proto int ibase_prepare([int link_identifier, ] string query) Prepare a query for later execution */ PHP_FUNCTION(ibase_prepare) { @@ -2380,7 +2380,7 @@ PHP_FUNCTION(ibase_field_info) case SQL_ARRAY: s = "ARRAY"; break; case SQL_QUAD: s = "QUAD"; break; default: - sprintf(buf,"unknown (%d)", var->sqltype & ~1); + sprintf(buf, "unknown (%d)", var->sqltype & ~1); s = buf; break; } @@ -2391,8 +2391,8 @@ PHP_FUNCTION(ibase_field_info) /* blobs ----------------------------------- */ -/* {{{ _php_ibase_blob_info(isc_blob_handle bl_handle,IBASE_BLOBINFO *bl_info) */ -static int _php_ibase_blob_info(isc_blob_handle bl_handle,IBASE_BLOBINFO *bl_info) +/* {{{ _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_info) */ +static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_info) { static char bl_items[] = { @@ -2410,7 +2410,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle,IBASE_BLOBINFO *bl_inf bl_info->total_length = 0; bl_info->bl_stream = 0; - if (isc_blob_info(IB_STATUS,&bl_handle,sizeof(bl_items),bl_items,sizeof(bl_inf),bl_inf)) { + if (isc_blob_info(IB_STATUS, &bl_handle, sizeof(bl_items), bl_items, sizeof(bl_inf), bl_inf)) { _php_ibase_error(); return FAILURE; } @@ -2438,7 +2438,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle,IBASE_BLOBINFO *bl_inf break; case isc_info_truncated: case isc_info_error: /* hmm. don't think so...*/ - _php_ibase_module_error("php module internal error in %s %d",__FILE__,__LINE__); + _php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__); return FAILURE; } /*switch*/ p += item_len; @@ -2484,7 +2484,7 @@ PHP_FUNCTION(ibase_blob_create) ib_blob->link = ib_link->link; ib_blob->bl_handle = NULL; - if (isc_create_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle,&ib_blob->bl_qd)) { + if (isc_create_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) { efree(ib_blob); _php_ibase_error(); RETURN_FALSE; @@ -2509,7 +2509,7 @@ PHP_FUNCTION(ibase_blob_open) ib_blob = (ibase_blob_handle *) emalloc(sizeof(ibase_blob_handle)); - GET_BLOB_ID_ARG(blob_arg,ib_blob_id); + GET_BLOB_ID_ARG(blob_arg, ib_blob_id); if (ib_blob_id == NULL) { /* blob IS NULL or argument unset */ RETURN_FALSE; @@ -2534,7 +2534,7 @@ PHP_FUNCTION(ibase_blob_open) Add data into created blob */ PHP_FUNCTION(ibase_blob_add) { - pval *blob_arg,*string_arg; + pval *blob_arg, *string_arg; ibase_blob_handle *ib_blob; RESET_ERRMSG; @@ -2585,7 +2585,7 @@ PHP_FUNCTION(ibase_blob_get) cur_len += seg_len; if (cur_len > max_len) { /* never!*/ efree(bl_data); - _php_ibase_module_error("php module internal error in %s %d",__FILE__,__LINE__); + _php_ibase_module_error("php module internal error in %s %d", __FILE__, __LINE__); RETURN_FALSE; } } @@ -2596,9 +2596,9 @@ PHP_FUNCTION(ibase_blob_get) _php_ibase_error(); RETURN_FALSE; } - RETURN_STRINGL(bl_data,cur_len,0); + RETURN_STRINGL(bl_data, cur_len, 0); } else { /* null blob */ - RETURN_STRING("",1); /* empty string */ + RETURN_STRING("", 1); /* empty string */ } } /* }}} */ @@ -2647,7 +2647,7 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) Close blob */ PHP_FUNCTION(ibase_blob_close) { - _php_ibase_blob_end(INTERNAL_FUNCTION_PARAM_PASSTHRU,BLOB_CLOSE); + _php_ibase_blob_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, BLOB_CLOSE); } /* }}} */ @@ -2655,7 +2655,7 @@ PHP_FUNCTION(ibase_blob_close) Cancel creating blob */ PHP_FUNCTION(ibase_blob_cancel) { - _php_ibase_blob_end(INTERNAL_FUNCTION_PARAM_PASSTHRU,BLOB_CANCEL); + _php_ibase_blob_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, BLOB_CANCEL); } /* }}} */ @@ -2686,7 +2686,7 @@ PHP_FUNCTION(ibase_blob_info) RETURN_FALSE; } - if (_php_ibase_blob_info(ib_blob_id->bl_handle,&bl_info)) { + if (_php_ibase_blob_info(ib_blob_id->bl_handle, &bl_info)) { RETURN_FALSE; } if (isc_close_blob(IB_STATUS, &ib_blob_id->bl_handle)) { @@ -2752,14 +2752,14 @@ PHP_FUNCTION(ibase_blob_echo) if (ib_blob_id) { /*not null ?*/ if (isc_open_blob(IB_STATUS, &ib_blob_id->link, &ib_blob_id->trans_handle, - &ib_blob_id->bl_handle,&ib_blob_id->bl_qd)) { + &ib_blob_id->bl_handle, &ib_blob_id->bl_qd)) { _php_ibase_error(); RETURN_FALSE; } while (!isc_get_segment(IB_STATUS, &ib_blob_id->bl_handle, &seg_len, sizeof(bl_data), bl_data) || IB_STATUS[1] == isc_segment) { - PHPWRITE(bl_data,seg_len); + PHPWRITE(bl_data, seg_len); } if (IB_STATUS[0] && (IB_STATUS[1] != isc_segstr_eof)) { @@ -2784,7 +2784,7 @@ extern int wsa_fp; */ /*to handle reading and writing to windows sockets*/ -/* {{{ proto string ibase_blob_import([link_identifier,] int file_id) +/* {{{ proto string ibase_blob_import([link_identifier, ] int file_id) Create blob, copy file in it, and close it */ PHP_FUNCTION(ibase_blob_import) @@ -2838,7 +2838,7 @@ PHP_FUNCTION(ibase_blob_import) ib_blob.bl_qd.gds_quad_high = 0; ib_blob.bl_qd.gds_quad_low = 0; - if (isc_create_blob(IB_STATUS, &ib_blob.link, &ib_blob.trans_handle, &ib_blob.bl_handle,&ib_blob.bl_qd)) { + if (isc_create_blob(IB_STATUS, &ib_blob.link, &ib_blob.trans_handle, &ib_blob.bl_handle, &ib_blob.bl_qd)) { _php_ibase_error(); RETURN_FALSE; } @@ -2859,7 +2859,7 @@ PHP_FUNCTION(ibase_blob_import) else { #endif /* Can't see much use for the issock stuff here, it should be nuked --Wez */ - while (issock?(b=SOCK_FREAD(bl_data,sizeof(bl_data),socketd)):(b = fread(bl_data, 1, sizeof(bl_data), fp)) > 0) { + while (issock?(b=SOCK_FREAD(bl_data, sizeof(bl_data), socketd)):(b = fread(bl_data, 1, sizeof(bl_data), fp)) > 0) { if (isc_put_segment(IB_STATUS, &ib_blob.bl_handle, b, bl_data)) { _php_ibase_error(); RETURN_FALSE; diff --git a/ext/java/java.c b/ext/java/java.c index 896388162c..adc33578d2 100644 --- a/ext/java/java.c +++ b/ext/java/java.c @@ -157,7 +157,7 @@ static int jvm_create(TSRMLS_D) jobject local_php_reflect; jthrowable error; - jint (JNICALL *JNI_CreateVM)(const void*,const void*,void*); + jint (JNICALL *JNI_CreateVM)(const void*, const void*, void*); #ifndef JNI_12 jint (JNICALL *JNI_DefaultArgs)(void*); #endif @@ -189,7 +189,7 @@ static int jvm_create(TSRMLS_D) else #endif - JNI_CreateVM = (jint (JNICALL *)(const void*,const void*,void*)) + JNI_CreateVM = (jint (JNICALL *)(const void*, const void*, void*)) DL_FETCH_SYMBOL(dl_handle, "JNI_CreateJavaVM"); if (!JNI_CreateVM) { @@ -282,8 +282,8 @@ static jobject _java_makeObject(pval* arg TSRMLS_DC) switch (arg->type) { case IS_STRING: - result=(*jenv)->NewByteArray(jenv,arg->value.str.len); - (*jenv)->SetByteArrayRegion(jenv,(jbyteArray)result,0, + result=(*jenv)->NewByteArray(jenv, arg->value.str.len); + (*jenv)->SetByteArrayRegion(jenv, (jbyteArray)result, 0, arg->value.str.len, arg->value.str.val); break; @@ -422,7 +422,7 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe if (!JG(jenv)) return; jenv = JG(jenv); - if (!strcmp("java",function_name->element.value.str.val)) { + if (!strcmp("java", function_name->element.value.str.val)) { /* construct a Java object: First argument is the class name. Any additional arguments will @@ -531,7 +531,7 @@ static pval _java_getset_property /* get the object */ zend_hash_index_find(property_reference->object->value.obj.properties, 0, (void **) &pobject); - obj = zend_list_find((*pobject)->value.lval,&type); + obj = zend_list_find((*pobject)->value.lval, &type); result = (jlong)(long) &presult; presult.type = IS_NULL; @@ -702,7 +702,7 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromObject ALLOC_ZVAL(handle); handle->type = IS_LONG; handle->value.lval = - zend_list_insert((*jenv)->NewGlobalRef(jenv,value), le_jobject); + zend_list_insert((*jenv)->NewGlobalRef(jenv, value), le_jobject); pval_copy_constructor(handle); INIT_PZVAL(handle); zend_hash_index_update(presult->value.obj.properties, 0, diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3a4cb2bd84..fad9bdad07 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -329,7 +329,7 @@ PHP_FUNCTION(ldap_connect) case 2: { pval **yyhost, **yyport; - if (zend_get_parameters_ex(2, &yyhost,&yyport) == FAILURE) { + if (zend_get_parameters_ex(2, &yyhost, &yyport) == FAILURE) { RETURN_FALSE; } @@ -390,7 +390,7 @@ PHP_FUNCTION(ldap_connect) } else #endif { - ldap = ldap_open(host,port); + ldap = ldap_open(host, port); } if ( ldap == NULL ) { @@ -426,7 +426,7 @@ static int _get_lderrno(LDAP *ldap) return ldap->ld_errno; #endif #else - return ldap_get_lderrno(ldap,NULL,NULL); + return ldap_get_lderrno(ldap, NULL, NULL); #endif } /* }}} */ @@ -451,7 +451,7 @@ PHP_FUNCTION(ldap_bind) break; case 3 : - if (zend_get_parameters_ex(3, &link, &bind_rdn,&bind_pw) == FAILURE) { + if (zend_get_parameters_ex(3, &link, &bind_rdn, &bind_pw) == FAILURE) { WRONG_PARAM_COUNT; } @@ -471,7 +471,7 @@ PHP_FUNCTION(ldap_bind) ZEND_FETCH_RESOURCE(ldap, LDAP *, link, -1, "ldap link", le_link); if (ldap_bind_s(ldap, ldap_bind_rdn, ldap_bind_pw, LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) { - php_error(E_WARNING,"LDAP: Unable to bind to server: %s",ldap_err2string(_get_lderrno(ldap))); + php_error(E_WARNING, "LDAP: Unable to bind to server: %s", ldap_err2string(_get_lderrno(ldap))); RETURN_FALSE; } else { RETURN_TRUE; @@ -751,15 +751,15 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope) && errno != LDAP_REFERRAL #endif ) { - php_error(E_WARNING,"LDAP: Unable to perform the search: %s",ldap_err2string(_get_lderrno(ldap))); + php_error(E_WARNING, "LDAP: Unable to perform the search: %s", ldap_err2string(_get_lderrno(ldap))); RETVAL_FALSE; } else { if (errno == LDAP_SIZELIMIT_EXCEEDED) { - php_error(E_WARNING,"LDAP: Partial search results returned: Sizelimit exceeded."); + php_error(E_WARNING, "LDAP: Partial search results returned: Sizelimit exceeded."); } #ifdef LDAP_ADMINLIMIT_EXCEEDED else if (errno == LDAP_ADMINLIMIT_EXCEEDED) { - php_error(E_WARNING,"LDAP: Partial search results returned: Adminlimit exceeded."); + php_error(E_WARNING, "LDAP: Partial search results returned: Adminlimit exceeded."); } #endif @@ -990,7 +990,7 @@ PHP_FUNCTION(ldap_first_attribute) } else { ZEND_REGISTER_RESOURCE(return_value, ber, le_ber_entry); - RETVAL_STRING(attribute,1); + RETVAL_STRING(attribute, 1); #if ( LDAP_API_VERSION > 2000 ) || HAVE_NSLDAP || WINDOWS ldap_memfree(attribute); #endif @@ -1021,7 +1021,7 @@ PHP_FUNCTION(ldap_next_attribute) } else { ZEND_REGISTER_RESOURCE(return_value, ber, le_ber_entry); - RETVAL_STRING(attribute,1); + RETVAL_STRING(attribute, 1); #if ( LDAP_API_VERSION > 2000 ) || HAVE_NSLDAP || WINDOWS ldap_memfree(attribute); #endif @@ -1094,7 +1094,7 @@ PHP_FUNCTION(ldap_get_values) char **ldap_value; int i, num_values; - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link,&result_entry, &attr) == FAILURE) { + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &link, &result_entry, &attr) == FAILURE) { WRONG_PARAM_COUNT; } @@ -1171,7 +1171,7 @@ PHP_FUNCTION(ldap_get_values_len) Get the DN of a result entry */ PHP_FUNCTION(ldap_get_dn) { - pval **link,**result_entry; + pval **link, **result_entry; LDAP *ldap; LDAPMessage *ldap_result_entry; char *text; @@ -1185,7 +1185,7 @@ PHP_FUNCTION(ldap_get_dn) text = ldap_get_dn(ldap, ldap_result_entry); if ( text != NULL ) { - RETVAL_STRING(text,1); + RETVAL_STRING(text, 1); #if ( LDAP_API_VERSION > 2000 ) || HAVE_NSLDAP || WINDOWS ldap_memfree(text); #else @@ -1205,14 +1205,14 @@ PHP_FUNCTION(ldap_explode_dn) char **ldap_value; int i, count; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dn,&with_attrib) == FAILURE) { + if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dn, &with_attrib) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(dn); convert_to_long_ex(with_attrib); - ldap_value = ldap_explode_dn((*dn)->value.str.val,(*with_attrib)->value.lval); + ldap_value = ldap_explode_dn((*dn)->value.str.val, (*with_attrib)->value.lval); i=0; while(ldap_value[i] != NULL) i++; @@ -1238,7 +1238,7 @@ PHP_FUNCTION(ldap_dn2ufn) pval **dn; char *ufn; - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1,&dn)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &dn)==FAILURE) { WRONG_PARAM_COUNT; } @@ -1247,7 +1247,7 @@ PHP_FUNCTION(ldap_dn2ufn) ufn = ldap_dn2ufn((*dn)->value.str.val); if (ufn !=NULL) { - RETVAL_STRING(ufn,1); + RETVAL_STRING(ufn, 1); #if ( LDAP_API_VERSION > 2000 ) || HAVE_NSLDAP || WINDOWS ldap_memfree(ufn); #endif @@ -1337,7 +1337,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper) ldap_mods[i]->mod_bvalues[0]->bv_val = (*value)->value.str.val; } else { for(j=0; j < num_values; j++) { - zend_hash_index_find((*value)->value.ht,j, (void **) &ivalue); + zend_hash_index_find((*value)->value.ht, j, (void **) &ivalue); convert_to_string_ex(ivalue); ldap_mods[i]->mod_bvalues[j] = (struct berval *) emalloc (sizeof(struct berval)); ldap_mods[i]->mod_bvalues[j]->bv_len = (*ivalue)->value.str.len; @@ -1771,7 +1771,7 @@ PHP_FUNCTION(ldap_parse_result) NULL /* &serverctrls */, 0 ); if (rc != LDAP_SUCCESS ) { - php_error(E_WARNING,"LDAP: Unable to parse result: %s", ldap_err2string(_get_lderrno(ldap))); + php_error(E_WARNING, "LDAP: Unable to parse result: %s", ldap_err2string(_get_lderrno(ldap))); RETURN_FALSE; } @@ -1971,7 +1971,7 @@ static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way) } if (result == LDAP_SUCCESS) { - RETVAL_STRINGL(ldap_buf,ldap_len,1); + RETVAL_STRINGL(ldap_buf, ldap_len, 1); free(ldap_buf); } else { php_error(E_ERROR, "LDAP: Conversion from iso-8859-1 to t61 failed."); diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 19aa221f2e..710d7c7459 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -182,7 +182,7 @@ function_entry mysql_functions[] = { /* {{{ mysql_module_entry */ zend_module_entry mysql_module_entry = { - "mysql", mysql_functions, PHP_MINIT(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), PHP_RSHUTDOWN(mysql), + "mysql", mysql_functions, ZEND_MODULE_STARTUP_N(mysql), PHP_MSHUTDOWN(mysql), PHP_RINIT(mysql), PHP_RSHUTDOWN(mysql), PHP_MINFO(mysql), STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -308,7 +308,7 @@ static void php_mysql_init_globals(zend_mysql_globals *mysql_globals) /* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(mysql) +ZEND_MODULE_STARTUP_D(mysql) { ZEND_INIT_MODULE_GLOBALS(mysql, php_mysql_init_globals, NULL); diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c index 9d6648044b..ee1fbc8c6c 100644 --- a/ext/rpc/com/com_wrapper.c +++ b/ext/rpc/com/com_wrapper.c @@ -544,7 +544,7 @@ PHP_FUNCTION(com_load) { efree(obj); error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Invalid ProgID or Moniker: %s\n", error_message); + php_error(E_WARNING, "Invalid ProgID or Moniker: %s\n", error_message); LocalFree(error_message); RETURN_FALSE; } @@ -583,7 +583,7 @@ PHP_FUNCTION(com_load) { error_message = php_COM_error_message(hr); clsid_str = php_string_from_clsid(&clsid); - php_error(E_WARNING,"Unable to obtain IDispatch interface for CLSID %s: %s",clsid_str,error_message); + php_error(E_WARNING, "Unable to obtain IDispatch interface for CLSID %s: %s", clsid_str, error_message); LocalFree(error_message); efree(clsid_str); efree(obj); @@ -668,7 +668,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** default: /* TODO: complain about wrong arg count */ - php_error(E_WARNING,"Wrong argument count to IEnumVariant::Next()\n"); + php_error(E_WARNING, "Wrong argument count to IEnumVariant::Next()\n"); return FAILURE; } @@ -690,7 +690,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr = C_ENUMVARIANT_VT(obj)->Next(C_ENUMVARIANT(obj), count, pSA->pvData, &count))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); SafeArrayDestroy(pSA); VariantInit(var_result); @@ -703,7 +703,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(SafeArrayRedim(pSA, rgsabound))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); SafeArrayDestroy(pSA); VariantInit(var_result); @@ -718,7 +718,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr = C_ENUMVARIANT_VT(obj)->Reset(C_ENUMVARIANT(obj)))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); return FAILURE; } @@ -740,13 +740,13 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** break; default: - php_error(E_WARNING,"Wrong argument count to IEnumVariant::Skip()\n"); + php_error(E_WARNING, "Wrong argument count to IEnumVariant::Skip()\n"); return FAILURE; } if(FAILED(hr = C_ENUMVARIANT_VT(obj)->Skip(C_ENUMVARIANT(obj), count))) { char *error_message = php_COM_error_message(hr); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s\n", error_message); + php_error(E_WARNING, "IEnumVariant::Next() failed: %s\n", error_message); efree(error_message); return FAILURE; } @@ -762,7 +762,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to lookup %s: %s\n", Z_STRVAL_P(function_name), error_message); + php_error(E_WARNING, "Unable to lookup %s: %s\n", Z_STRVAL_P(function_name), error_message); LocalFree(error_message); efree(funcname); return FAILURE; @@ -789,7 +789,7 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval ** if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Invoke() failed: %s\n", error_message); + php_error(E_WARNING, "Invoke() failed: %s\n", error_message); LocalFree(error_message); return FAILURE; } @@ -827,7 +827,7 @@ PHP_FUNCTION(com_invoke) obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_STRVAL_P(function_name)); + php_error(E_WARNING, "%d is not a COM object handler", Z_STRVAL_P(function_name)); RETURN_FALSE; } @@ -868,7 +868,7 @@ PHP_FUNCTION(com_release) obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler"); + php_error(E_WARNING, "%d is not a COM object handler"); RETURN_FALSE; } @@ -900,7 +900,7 @@ PHP_FUNCTION(com_addref) obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler"); + php_error(E_WARNING, "%d is not a COM object handler"); RETURN_FALSE; } @@ -941,7 +941,7 @@ static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); + php_error(E_WARNING, "Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); LocalFree(error_message); efree(propname); if(cleanup) @@ -959,7 +959,7 @@ static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"PropGet() failed: %s\n", error_message); + php_error(E_WARNING, "PropGet() failed: %s\n", error_message); LocalFree(error_message); efree(propname); if(cleanup) @@ -1000,7 +1000,7 @@ static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); + php_error(E_WARNING, "Unable to lookup %s: %s\n", Z_STRVAL_P(arg_property), error_message); LocalFree(error_message); efree(propname); RETURN_FALSE; @@ -1017,7 +1017,7 @@ static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property, if(FAILED(hr)) { error_message = php_COM_error_message(hr); - php_error(E_WARNING,"PropPut() failed: %s\n", error_message); + php_error(E_WARNING, "PropPut() failed: %s\n", error_message); LocalFree(error_message); efree(propname); RETURN_FALSE; @@ -1062,7 +1062,7 @@ PHP_FUNCTION(com_propget) obj = (comval *)zend_list_find(Z_LVAL_P(arg_comval), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_LVAL_P(arg_comval)); + php_error(E_WARNING, "%d is not a COM object handler", Z_LVAL_P(arg_comval)); } convert_to_string_ex(&arg_property); @@ -1094,7 +1094,7 @@ PHP_FUNCTION(com_propput) obj = (comval *)zend_list_find(Z_LVAL_P(arg_comval), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_LVAL_P(arg_comval)); + php_error(E_WARNING, "%d is not a COM object handler", Z_LVAL_P(arg_comval)); } convert_to_string_ex(&arg_property); @@ -1483,7 +1483,7 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode) /* at each version for a string match to the */ /* supplied argument */ - if(ERROR_SUCCESS != RegOpenKey(HKEY_CLASSES_ROOT, "TypeLib",&hkey)) + if(ERROR_SUCCESS != RegOpenKey(HKEY_CLASSES_ROOT, "TypeLib", &hkey)) { /* This is pretty bad - better bail */ return NULL; @@ -1634,7 +1634,7 @@ static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC) /* Check to see if they are the same */ if (!compare_function(&results, &c.value, &exists TSRMLS_CC) && INI_INT("com.autoregister_verbose")) { - php_error(E_WARNING,"Type library value %s is already defined and has a different value", c.name); + php_error(E_WARNING, "Type library value %s is already defined and has a different value", c.name); } free(ids); j++; @@ -1678,7 +1678,7 @@ PHP_FUNCTION(com_isenum) obj = (comval *) zend_list_find(Z_LVAL_PP(comval_handle), &type); if(!obj || (type != IS_COM)) { - php_error(E_WARNING,"%s is not a COM object handler", ""); + php_error(E_WARNING, "%s is not a COM object handler", ""); RETURN_FALSE; } diff --git a/ext/rpc/com/conversion.c b/ext/rpc/com/conversion.c index 8f7e80a9c6..cd05ccdb23 100644 --- a/ext/rpc/com/conversion.c +++ b/ext/rpc/com/conversion.c @@ -141,7 +141,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c if(NULL == safeArray) { - php_error( E_WARNING,"Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)"); + php_error( E_WARNING, "Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)"); ZVAL_FALSE(pval_arg); } else @@ -171,7 +171,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c } else { - php_error( E_WARNING,"phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i); + php_error( E_WARNING, "phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i); } } zend_hash_move_forward(ht); @@ -180,7 +180,7 @@ static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int c } else { - php_error( E_WARNING,"phpArrayToSafeArray() - Unable to lock safeArray"); + php_error( E_WARNING, "phpArrayToSafeArray() - Unable to lock safeArray"); } } } @@ -488,7 +488,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, /* For now just validate that the SafeArray has one dimension */ if (1 != (Dims = SafeArrayGetDim(array))) { - php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims); + php_error(E_WARNING, "Unsupported: multi-dimensional (%d) SafeArrays", Dims); ZVAL_NULL(pval_arg); return FAILURE; } @@ -740,7 +740,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, char *error_message; error_message = php_COM_error_message(hr); - php_error(E_WARNING,"Unable to obtain IDispatch interface: %s", error_message); + php_error(E_WARNING, "Unable to obtain IDispatch interface: %s", error_message); LocalFree(error_message); V_DISPATCH(var_arg) = NULL; @@ -822,7 +822,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, break; default: - php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg)); + php_error(E_WARNING, "Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg)); ZVAL_NULL(pval_arg); ret = FAILURE; break; @@ -852,10 +852,10 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage) switch(GetLastError()) { case ERROR_NO_UNICODE_TRANSLATION: - php_error(E_WARNING,"No unicode translation available for the specified string"); + php_error(E_WARNING, "No unicode translation available for the specified string"); break; default: - php_error(E_WARNING,"Error in php_char_to_OLECHAR()"); + php_error(E_WARNING, "Error in php_char_to_OLECHAR()"); } } @@ -882,7 +882,7 @@ PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int per C_str = (char *) pemalloc(sizeof(char), persistent); *C_str = 0; - php_error(E_WARNING,"Error in php_OLECHAR_to_char()"); + php_error(E_WARNING, "Error in php_OLECHAR_to_char()"); } if(out_length) diff --git a/ext/rpc/dotnet/dotnet.cpp b/ext/rpc/dotnet/dotnet.cpp index d0376bd87f..b9af5a6d83 100644 --- a/ext/rpc/dotnet/dotnet.cpp +++ b/ext/rpc/dotnet/dotnet.cpp @@ -143,13 +143,13 @@ PHP_FUNCTION(dotnet_load) if (FAILED(hr)) { char *error_message; error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"Error obtaining .Net class for %s in assembly %s: %s",datatype_name->value.str.val,assembly_name->value.str.val,error_message); + php_error(E_WARNING, "Error obtaining .Net class for %s in assembly %s: %s", datatype_name->value.str.val, assembly_name->value.str.val, error_message); LocalFree(error_message); efree(obj); RETURN_FALSE; } if (C_DISPATCH(obj) == NULL) { - php_error(E_WARNING,"Unable to locate %s in assembly %s",datatype_name->value.str.val,assembly_name->value.str.val); + php_error(E_WARNING, "Unable to locate %s in assembly %s", datatype_name->value.str.val, assembly_name->value.str.val); efree(obj); RETURN_FALSE; } diff --git a/ext/rpc/java/java.c b/ext/rpc/java/java.c index 896388162c..adc33578d2 100644 --- a/ext/rpc/java/java.c +++ b/ext/rpc/java/java.c @@ -157,7 +157,7 @@ static int jvm_create(TSRMLS_D) jobject local_php_reflect; jthrowable error; - jint (JNICALL *JNI_CreateVM)(const void*,const void*,void*); + jint (JNICALL *JNI_CreateVM)(const void*, const void*, void*); #ifndef JNI_12 jint (JNICALL *JNI_DefaultArgs)(void*); #endif @@ -189,7 +189,7 @@ static int jvm_create(TSRMLS_D) else #endif - JNI_CreateVM = (jint (JNICALL *)(const void*,const void*,void*)) + JNI_CreateVM = (jint (JNICALL *)(const void*, const void*, void*)) DL_FETCH_SYMBOL(dl_handle, "JNI_CreateJavaVM"); if (!JNI_CreateVM) { @@ -282,8 +282,8 @@ static jobject _java_makeObject(pval* arg TSRMLS_DC) switch (arg->type) { case IS_STRING: - result=(*jenv)->NewByteArray(jenv,arg->value.str.len); - (*jenv)->SetByteArrayRegion(jenv,(jbyteArray)result,0, + result=(*jenv)->NewByteArray(jenv, arg->value.str.len); + (*jenv)->SetByteArrayRegion(jenv, (jbyteArray)result, 0, arg->value.str.len, arg->value.str.val); break; @@ -422,7 +422,7 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe if (!JG(jenv)) return; jenv = JG(jenv); - if (!strcmp("java",function_name->element.value.str.val)) { + if (!strcmp("java", function_name->element.value.str.val)) { /* construct a Java object: First argument is the class name. Any additional arguments will @@ -531,7 +531,7 @@ static pval _java_getset_property /* get the object */ zend_hash_index_find(property_reference->object->value.obj.properties, 0, (void **) &pobject); - obj = zend_list_find((*pobject)->value.lval,&type); + obj = zend_list_find((*pobject)->value.lval, &type); result = (jlong)(long) &presult; presult.type = IS_NULL; @@ -702,7 +702,7 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setResultFromObject ALLOC_ZVAL(handle); handle->type = IS_LONG; handle->value.lval = - zend_list_insert((*jenv)->NewGlobalRef(jenv,value), le_jobject); + zend_list_insert((*jenv)->NewGlobalRef(jenv, value), le_jobject); pval_copy_constructor(handle); INIT_PZVAL(handle); zend_hash_index_update(presult->value.obj.properties, 0, |