Whitespace

This commit is contained in:
Zeev Suraski 2001-08-11 17:03:37 +00:00
parent f6f6c4d7e6
commit c0404f4631
46 changed files with 708 additions and 707 deletions

View file

@ -82,7 +82,7 @@ static void _free_reg_cache(reg_cache *rc)
#undef regfree
#define regfree(a);
#undef regcomp
#define regcomp(a,b,c) _php_regcomp(a,b,c)
#define regcomp(a, b, c) _php_regcomp(a, b, c)
static void php_reg_init_globals(php_reg_globals *reg_globals TSRMLS_DC)
{
@ -440,7 +440,7 @@ static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
if ((*arg_pattern)->type == IS_STRING) {
if ((*arg_pattern)->value.str.val && (*arg_pattern)->value.str.len)
pattern = estrndup((*arg_pattern)->value.str.val,(*arg_pattern)->value.str.len);
pattern = estrndup((*arg_pattern)->value.str.val, (*arg_pattern)->value.str.len);
else
pattern = empty_string;
} else {
@ -473,7 +473,7 @@ static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
if (ret == (char *) -1) {
RETVAL_FALSE;
} else {
RETVAL_STRING(ret,1);
RETVAL_STRING(ret, 1);
STR_FREE(ret);
}
STR_FREE(string);

View file

@ -171,7 +171,7 @@ static int array_key_compare(const void *a, const void *b)
static int array_reverse_key_compare(const void *a, const void *b)
{
return array_key_compare(a,b)*-1;
return array_key_compare(a, b)*-1;
}
/* {{{ proto int krsort(array array_arg [, int sort_flags])
@ -225,7 +225,7 @@ PHP_FUNCTION(ksort)
sort_type_val = Z_LVAL_PP(sort_type);
}
set_compare_func(sort_type_val TSRMLS_CC);
if (zend_hash_sort(target_hash, qsort, array_key_compare,0) == FAILURE) {
if (zend_hash_sort(target_hash, qsort, array_key_compare, 0) == FAILURE) {
return;
}
RETURN_TRUE;
@ -303,7 +303,7 @@ static int array_data_compare(const void *a, const void *b)
static int array_reverse_data_compare(const void *a, const void *b)
{
return array_data_compare(a,b)*-1;
return array_data_compare(a, b)*-1;
}
static int array_natural_general_compare(const void *a, const void *b, int fold_case)
@ -420,7 +420,7 @@ PHP_FUNCTION(asort)
sort_type_val = Z_LVAL_PP(sort_type);
}
set_compare_func(sort_type_val TSRMLS_CC);
if (zend_hash_sort(target_hash, qsort, array_data_compare,0) == FAILURE) {
if (zend_hash_sort(target_hash, qsort, array_data_compare, 0) == FAILURE) {
return;
}
RETURN_TRUE;
@ -449,7 +449,7 @@ PHP_FUNCTION(arsort)
sort_type_val = Z_LVAL_PP(sort_type);
}
set_compare_func(sort_type_val TSRMLS_CC);
if (zend_hash_sort(target_hash, qsort, array_reverse_data_compare,0) == FAILURE) {
if (zend_hash_sort(target_hash, qsort, array_reverse_data_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@ -478,7 +478,7 @@ PHP_FUNCTION(sort)
sort_type_val = Z_LVAL_PP(sort_type);
}
set_compare_func(sort_type_val TSRMLS_CC);
if (zend_hash_sort(target_hash, qsort, array_data_compare,1) == FAILURE) {
if (zend_hash_sort(target_hash, qsort, array_data_compare, 1) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@ -507,7 +507,7 @@ PHP_FUNCTION(rsort)
sort_type_val = Z_LVAL_PP(sort_type);
}
set_compare_func(sort_type_val TSRMLS_CC);
if (zend_hash_sort(target_hash, qsort, array_reverse_data_compare,1) == FAILURE) {
if (zend_hash_sort(target_hash, qsort, array_reverse_data_compare, 1) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@ -979,7 +979,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata TSRMLS_DC)
zval_ptr_dtor(&retval_ptr);
} else
php_error(E_WARNING,"Unable to call %s() - function does not exist",
php_error(E_WARNING, "Unable to call %s() - function does not exist",
(*BG(array_walk_func_name))->value.str.val);
zend_hash_move_forward_ex(target_hash, &pos);
@ -1331,7 +1331,7 @@ PHP_FUNCTION(range)
{
zval **zlow, **zhigh;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2,&zlow,&zhigh) == FAILURE) {
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zlow, &zhigh) == FAILURE) {
WRONG_PARAM_COUNT;
}
@ -2039,7 +2039,7 @@ PHP_FUNCTION(array_count_values)
MAKE_STD_ZVAL(data);
Z_TYPE_P(data) = IS_LONG;
Z_LVAL_P(data) = 1;
zend_hash_index_update(Z_ARRVAL_P(return_value),Z_LVAL_PP(entry), &data, sizeof(data), NULL);
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), &data, sizeof(data), NULL);
} else {
Z_LVAL_PP(tmp)++;
}
@ -2052,7 +2052,7 @@ PHP_FUNCTION(array_count_values)
MAKE_STD_ZVAL(data);
Z_TYPE_P(data) = IS_LONG;
Z_LVAL_P(data) = 1;
zend_hash_update(Z_ARRVAL_P(return_value),Z_STRVAL_PP(entry),Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
} else {
Z_LVAL_PP(tmp)++;
}
@ -2227,9 +2227,9 @@ PHP_FUNCTION(array_flip)
}
if (Z_TYPE_PP(entry) == IS_LONG) {
zend_hash_index_update(Z_ARRVAL_P(return_value),Z_LVAL_PP(entry), &data, sizeof(data), NULL);
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), &data, sizeof(data), NULL);
} else if (Z_TYPE_PP(entry) == IS_STRING) {
zend_hash_update(Z_ARRVAL_P(return_value),Z_STRVAL_PP(entry),Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
} else {
zval_ptr_dtor(&data); /* will free also zval structure */
php_error(E_WARNING, "Can only flip STRING and INTEGER values!");

View file

@ -59,7 +59,7 @@ static PHP_INI_MH(OnChangeCallback)
MAKE_STD_ZVAL(ASSERTG(callback));
if (new_value) {
ZVAL_STRINGL(ASSERTG(callback),new_value,new_value_length,1);
ZVAL_STRINGL(ASSERTG(callback), new_value, new_value_length, 1);
} else {
ZVAL_EMPTY_STRING(ASSERTG(callback));
}
@ -188,9 +188,9 @@ PHP_FUNCTION(assert)
MAKE_STD_ZVAL(args[1]);
MAKE_STD_ZVAL(args[2]);
ZVAL_STRING(args[0],SAFE_STRING(filename),1);
ZVAL_LONG (args[1],lineno);
ZVAL_STRING(args[2],SAFE_STRING(myeval),1);
ZVAL_STRING(args[0], SAFE_STRING(filename), 1);
ZVAL_LONG (args[1], lineno);
ZVAL_STRING(args[2], SAFE_STRING(myeval), 1);
MAKE_STD_ZVAL(retval);
ZVAL_FALSE(retval);
@ -206,9 +206,9 @@ PHP_FUNCTION(assert)
if (ASSERTG(warning)) {
if (myeval) {
php_error(E_WARNING,"Assertion \"%s\" failed",myeval);
php_error(E_WARNING, "Assertion \"%s\" failed", myeval);
} else {
php_error(E_WARNING,"Assertion failed");
php_error(E_WARNING, "Assertion failed");
}
}
@ -223,7 +223,7 @@ PHP_FUNCTION(assert)
PHP_FUNCTION(assert_options)
{
pval **what,**value;
pval **what, **value;
int oldint;
int ac = ZEND_NUM_ARGS();
@ -282,7 +282,7 @@ PHP_FUNCTION(assert_options)
break;
default:
php_error(E_WARNING,"Unknown value %d.",Z_LVAL_PP(what));
php_error(E_WARNING, "Unknown value %d.", Z_LVAL_PP(what));
break;
}

View file

@ -157,7 +157,7 @@ PHP_FUNCTION(base64_encode)
unsigned char *result;
int ret_length;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1,&str) == FAILURE) {
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(str);
@ -179,7 +179,7 @@ PHP_FUNCTION(base64_decode)
unsigned char *result;
int ret_length;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1,&str) == FAILURE) {
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(str);

View file

@ -695,7 +695,7 @@ static void php_putenv_destructor(putenv_entry *pe)
char **env;
for (env = environ; env != NULL && *env != NULL; env++) {
if (!strncmp(*env,pe->key,pe->key_len) && (*env)[pe->key_len]=='=') { /* found it */
if (!strncmp(*env, pe->key, pe->key_len) && (*env)[pe->key_len]=='=') { /* found it */
*env = "";
break;
}
@ -1053,10 +1053,10 @@ PHP_FUNCTION(putenv)
if (Z_STRVAL_PP(str) && *(Z_STRVAL_PP(str))) {
int ret;
char *p,**env;
char *p, **env;
putenv_entry pe;
pe.putenv_string = estrndup(Z_STRVAL_PP(str),Z_STRLEN_PP(str));
pe.putenv_string = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str));
pe.key = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str));
if ((p=strchr(pe.key,'='))) { /* nullify the '=' if there is one */
*p='\0';
@ -1095,21 +1095,21 @@ PHP_FUNCTION(putenv)
}
}
zend_hash_del(&BG(putenv_ht),pe.key,pe.key_len+1);
zend_hash_del(&BG(putenv_ht), pe.key, pe.key_len+1);
/* find previous value */
pe.previous_value = NULL;
for (env = environ; env != NULL && *env != NULL; env++) {
if (!strncmp(*env,pe.key,pe.key_len) && (*env)[pe.key_len]=='=') { /* found it */
if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len]=='=') { /* found it */
pe.previous_value = *env;
break;
}
}
if ((ret=putenv(pe.putenv_string))==0) { /* success */
zend_hash_add(&BG(putenv_ht),pe.key,pe.key_len+1,(void **) &pe,sizeof(putenv_entry),NULL);
zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len+1, (void **) &pe, sizeof(putenv_entry), NULL);
#ifdef HAVE_TZSET
if(!strncmp(pe.key,"TZ",2)) tzset();
if(!strncmp(pe.key, "TZ", 2)) tzset();
#endif
RETURN_TRUE;
} else {
@ -1152,7 +1152,7 @@ PHP_FUNCTION(intval)
}
*return_value=**num;
zval_copy_ctor(return_value);
convert_to_long_base(return_value,base);
convert_to_long_base(return_value, base);
}
/* }}} */
@ -1235,28 +1235,28 @@ PHP_FUNCTION(gettype)
}
switch (Z_TYPE_PP(arg)) {
case IS_NULL:
RETVAL_STRING("NULL",1);
RETVAL_STRING("NULL", 1);
break;
case IS_BOOL:
RETVAL_STRING("boolean",1);
RETVAL_STRING("boolean", 1);
break;
case IS_LONG:
RETVAL_STRING("integer",1);
RETVAL_STRING("integer", 1);
break;
case IS_RESOURCE:
RETVAL_STRING("resource",1);
RETVAL_STRING("resource", 1);
break;
case IS_DOUBLE:
RETVAL_STRING("double",1);
RETVAL_STRING("double", 1);
break;
case IS_STRING:
RETVAL_STRING("string",1);
RETVAL_STRING("string", 1);
break;
case IS_ARRAY:
RETVAL_STRING("array",1);
RETVAL_STRING("array", 1);
break;
case IS_OBJECT:
RETVAL_STRING("object",1);
RETVAL_STRING("object", 1);
break;
/*
{
@ -1271,7 +1271,7 @@ PHP_FUNCTION(gettype)
*/
break;
default:
RETVAL_STRING("unknown type",1);
RETVAL_STRING("unknown type", 1);
}
}
/* }}} */
@ -1316,7 +1316,7 @@ PHP_FUNCTION(settype)
Get the name of the owner of the current PHP script */
PHP_FUNCTION(get_current_user)
{
RETURN_STRING(php_get_current_user(),1);
RETURN_STRING(php_get_current_user(), 1);
}
/* }}} */
@ -1333,10 +1333,10 @@ PHP_FUNCTION(get_cfg_var)
convert_to_string_ex(varname);
if (cfg_get_string(Z_STRVAL_PP(varname),&value)==FAILURE) {
if (cfg_get_string(Z_STRVAL_PP(varname), &value)==FAILURE) {
RETURN_FALSE;
}
RETURN_STRING(value,1);
RETURN_STRING(value, 1);
}
/* }}} */
@ -1374,7 +1374,7 @@ PHP_FUNCTION(get_magic_quotes_gpc)
/* }}} */
void php_is_type(INTERNAL_FUNCTION_PARAMETERS,int type)
void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
{
pval **arg;
@ -1533,22 +1533,22 @@ PHP_FUNCTION(error_log)
switch(ZEND_NUM_ARGS()) {
case 1:
if (zend_get_parameters_ex(1,&string) == FAILURE) {
php_error(E_WARNING,"Invalid argument 1 in error_log");
if (zend_get_parameters_ex(1, &string) == FAILURE) {
php_error(E_WARNING, "Invalid argument 1 in error_log");
RETURN_FALSE;
}
break;
case 2:
if (zend_get_parameters_ex(2,&string,&erropt) == FAILURE) {
php_error(E_WARNING,"Invalid arguments in error_log");
if (zend_get_parameters_ex(2, &string, &erropt) == FAILURE) {
php_error(E_WARNING, "Invalid arguments in error_log");
RETURN_FALSE;
}
convert_to_long_ex(erropt);
opt_err=Z_LVAL_PP(erropt);
break;
case 3:
if (zend_get_parameters_ex(3,&string,&erropt,&option) == FAILURE){
php_error(E_WARNING,"Invalid arguments in error_log");
if (zend_get_parameters_ex(3, &string, &erropt, &option) == FAILURE){
php_error(E_WARNING, "Invalid arguments in error_log");
RETURN_FALSE;
}
convert_to_long_ex(erropt);
@ -1557,8 +1557,8 @@ PHP_FUNCTION(error_log)
opt=Z_STRVAL_PP(option);
break;
case 4:
if (zend_get_parameters_ex(4,&string,&erropt,&option,&emailhead) == FAILURE){
php_error(E_WARNING,"Invalid arguments in error_log");
if (zend_get_parameters_ex(4, &string, &erropt, &option, &emailhead) == FAILURE){
php_error(E_WARNING, "Invalid arguments in error_log");
RETURN_FALSE;
}
break;
@ -1601,22 +1601,22 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T
return FAILURE;
}
#else
php_error(E_WARNING,"Mail option not available!");
php_error(E_WARNING, "Mail option not available!");
return FAILURE;
#endif
}
break;
case 2: /*send to an address */
php_error(E_WARNING,"TCP/IP option not available!");
php_error(E_WARNING, "TCP/IP option not available!");
return FAILURE;
break;
case 3: /*save to a file*/
logfile=php_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL TSRMLS_CC);
logfile=php_fopen_wrapper(opt, "a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL TSRMLS_CC);
if(!logfile) {
php_error(E_WARNING,"error_log: Unable to write to %s",opt);
php_error(E_WARNING, "error_log: Unable to write to %s", opt);
return FAILURE;
}
fwrite(message,strlen(message),1,logfile);
fwrite(message, strlen(message), 1, logfile);
fclose(logfile);
break;
default:
@ -1746,7 +1746,7 @@ PHP_FUNCTION(call_user_method)
RETURN_FALSE;
}
if (Z_TYPE_PP(params[1]) != IS_OBJECT && Z_TYPE_PP(params[1]) != IS_STRING) {
php_error(E_WARNING,"2nd argument is not an object or class name\n");
php_error(E_WARNING, "2nd argument is not an object or class name\n");
efree(params);
RETURN_FALSE;
}
@ -1755,7 +1755,7 @@ PHP_FUNCTION(call_user_method)
if (call_user_function_ex(EG(function_table), params[1], *params[0], &retval_ptr, arg_count-2, params+2, 0, NULL TSRMLS_CC)==SUCCESS && retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
} else {
php_error(E_WARNING,"Unable to call %s()", Z_STRVAL_PP(params[0]));
php_error(E_WARNING, "Unable to call %s()", Z_STRVAL_PP(params[0]));
}
efree(params);
}
@ -1782,7 +1782,7 @@ PHP_FUNCTION(call_user_method_array)
}
if (Z_TYPE_PP(obj) != IS_OBJECT && Z_TYPE_PP(obj) != IS_STRING) {
php_error(E_WARNING,"2nd argument is not an object or class name\n");
php_error(E_WARNING, "2nd argument is not an object or class name\n");
RETURN_FALSE;
}
@ -1837,7 +1837,7 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun
if (call_user_function(EG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1 TSRMLS_CC)==SUCCESS) {
zval_dtor(&retval);
} else {
php_error(E_WARNING,"Unable to call %s() - function does not exist",
php_error(E_WARNING, "Unable to call %s() - function does not exist",
Z_STRVAL_P(shutdown_function_entry->arguments[0]));
}
return 0;
@ -2136,7 +2136,7 @@ PHP_FUNCTION(ini_get)
RETURN_FALSE;
}
RETURN_STRING(str,1);
RETURN_STRING(str, 1);
}
/* }}} */
@ -2251,16 +2251,16 @@ PHP_FUNCTION(ignore_user_abort)
#if HAVE_GETSERVBYNAME
PHP_FUNCTION(getservbyname)
{
pval **name,**proto;
pval **name, **proto;
struct servent *serv;
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2,&name,&proto) == FAILURE) {
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &name, &proto) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(name);
convert_to_string_ex(proto);
serv = getservbyname(Z_STRVAL_PP(name),Z_STRVAL_PP(proto));
serv = getservbyname(Z_STRVAL_PP(name), Z_STRVAL_PP(proto));
if(serv == NULL)
RETURN_FALSE;
@ -2276,21 +2276,21 @@ PHP_FUNCTION(getservbyname)
#if HAVE_GETSERVBYPORT
PHP_FUNCTION(getservbyport)
{
pval **port,**proto;
pval **port, **proto;
struct servent *serv;
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2,&port,&proto) == FAILURE) {
if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &port, &proto) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(port);
convert_to_string_ex(proto);
serv = getservbyport(htons((unsigned short) Z_LVAL_PP(port)),Z_STRVAL_PP(proto));
serv = getservbyport(htons((unsigned short) Z_LVAL_PP(port)), Z_STRVAL_PP(proto));
if(serv == NULL)
RETURN_FALSE;
RETURN_STRING(serv->s_name,1);
RETURN_STRING(serv->s_name, 1);
}
#endif
/* }}} */
@ -2343,7 +2343,7 @@ PHP_FUNCTION(getprotobynumber)
if(ent == NULL)
RETURN_FALSE;
RETURN_STRING(ent->p_name,1);
RETURN_STRING(ent->p_name, 1);
}
#endif
/* }}} */
@ -2405,7 +2405,7 @@ PHP_FUNCTION(unregister_tick_function)
tick_fe.arguments[0] = *function;
tick_fe.arg_count = 1;
zend_llist_del_element(BG(user_tick_functions), &tick_fe,
(int(*)(void*,void*))user_tick_function_compare);
(int(*)(void*, void*))user_tick_function_compare);
efree(tick_fe.arguments);
}
/* }}} */
@ -2572,7 +2572,7 @@ PHP_FUNCTION(parse_ini_file)
convert_to_string_ex(filename);
fh.handle.fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r");
if (!fh.handle.fp) {
php_error(E_WARNING,"Cannot open '%s' for reading", Z_STRVAL_PP(filename));
php_error(E_WARNING, "Cannot open '%s' for reading", Z_STRVAL_PP(filename));
return;
}
Z_TYPE(fh) = ZEND_HANDLE_FP;

View file

@ -44,7 +44,7 @@ static void browscap_entry_dtor(zval *pvalue)
*/
static void convert_browscap_pattern(zval *pattern)
{
register int i,j;
register int i, j;
char *t;
for (i=0; i<pattern->value.str.len; i++) {
@ -60,7 +60,7 @@ static void convert_browscap_pattern(zval *pattern)
t = (char *) malloc(pattern->value.str.len*2);
for (i=0,j=0; i<pattern->value.str.len; i++,j++) {
for (i=0, j=0; i<pattern->value.str.len; i++, j++) {
switch (pattern->value.str.val[i]) {
case '?':
t[j] = '.';
@ -148,7 +148,7 @@ PHP_MINIT_FUNCTION(browscap)
fh.handle.fp = VCWD_FOPEN(browscap, "r");
if (!fh.handle.fp) {
php_error(E_CORE_WARNING,"Cannot open '%s' for reading", browscap);
php_error(E_CORE_WARNING, "Cannot open '%s' for reading", browscap);
return FAILURE;
}
fh.filename = browscap;
@ -173,27 +173,27 @@ PHP_MSHUTDOWN_FUNCTION(browscap)
/* {{{ browser_reg_compare
*/
static int browser_reg_compare(zval **browser,int num_args, va_list args, zend_hash_key *key)
static int browser_reg_compare(zval **browser, int num_args, va_list args, zend_hash_key *key)
{
zval **browser_name;
regex_t r;
char *lookup_browser_name = va_arg(args,char *);
zval **found_browser_entry = va_arg(args,zval **);
char *lookup_browser_name = va_arg(args, char *);
zval **found_browser_entry = va_arg(args, zval **);
if (*found_browser_entry) { /* already found */
return 0;
}
if(zend_hash_find(Z_OBJPROP_PP(browser), "browser_name_pattern",sizeof("browser_name_pattern"),(void **) &browser_name) == FAILURE) {
if(zend_hash_find(Z_OBJPROP_PP(browser), "browser_name_pattern", sizeof("browser_name_pattern"), (void **) &browser_name) == FAILURE) {
return 0;
}
if (!strchr((*browser_name)->value.str.val,'*')) {
return 0;
}
if (regcomp(&r,(*browser_name)->value.str.val,REG_NOSUB)!=0) {
if (regcomp(&r, (*browser_name)->value.str.val, REG_NOSUB)!=0) {
return 0;
}
if (regexec(&r,lookup_browser_name,0,NULL,0)==0) {
if (regexec(&r, lookup_browser_name, 0, NULL, 0)==0) {
*found_browser_entry = *browser;
}
regfree(&r);
@ -205,8 +205,8 @@ static int browser_reg_compare(zval **browser,int num_args, va_list args, zend_h
Get information about the capabilities of a browser */
PHP_FUNCTION(get_browser)
{
zval **agent_name,**agent;
zval *found_browser_entry,*tmp_copy;
zval **agent_name, **agent;
zval *found_browser_entry, *tmp_copy;
char *lookup_browser_name;
if (!INI_STR("browscap")) {
@ -217,12 +217,12 @@ PHP_FUNCTION(get_browser)
case 0:
if (!PG(http_globals)[TRACK_VARS_SERVER]
|| zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) {
zend_error(E_WARNING,"HTTP_USER_AGENT variable is not set, cannot determine user agent name");
zend_error(E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name");
RETURN_FALSE;
}
break;
case 1:
if (zend_get_parameters_ex(1,&agent_name)==FAILURE) {
if (zend_get_parameters_ex(1, &agent_name)==FAILURE) {
RETURN_FALSE;
}
break;
@ -233,7 +233,7 @@ PHP_FUNCTION(get_browser)
convert_to_string_ex(agent_name);
if (zend_hash_find(&browser_hash, (*agent_name)->value.str.val,(*agent_name)->value.str.len+1, (void **) &agent)==FAILURE) {
if (zend_hash_find(&browser_hash, (*agent_name)->value.str.val, (*agent_name)->value.str.len+1, (void **) &agent)==FAILURE) {
lookup_browser_name = (*agent_name)->value.str.val;
found_browser_entry = NULL;
zend_hash_apply_with_arguments(&browser_hash, (apply_func_args_t) browser_reg_compare, 2, lookup_browser_name, &found_browser_entry);
@ -248,9 +248,9 @@ PHP_FUNCTION(get_browser)
object_init(return_value);
zend_hash_copy(Z_OBJPROP_P(return_value), Z_OBJPROP_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
while (zend_hash_find(Z_OBJPROP_PP(agent), "parent",sizeof("parent"), (void **) &agent_name)==SUCCESS) {
while (zend_hash_find(Z_OBJPROP_PP(agent), "parent", sizeof("parent"), (void **) &agent_name)==SUCCESS) {
if (zend_hash_find(&browser_hash,(*agent_name)->value.str.val, (*agent_name)->value.str.len+1, (void **)&agent)==FAILURE) {
if (zend_hash_find(&browser_hash, (*agent_name)->value.str.val, (*agent_name)->value.str.len+1, (void **)&agent)==FAILURE) {
break;
}

View file

@ -10,80 +10,80 @@
*/
CREDIT_LINE("aspell","Rasmus Lerdorf");
CREDIT_LINE("Assert","Thies C. Arntzen");
CREDIT_LINE("BC Math","Andi Gutmans");
CREDIT_LINE("bz2","Sterling Hughes");
CREDIT_LINE("ccvs","Brendan W. McAdams, Doug DeJulio");
CREDIT_LINE("cpdf","Uwe Steinmann");
CREDIT_LINE("crack","Alexander Feldman");
CREDIT_LINE("ctype","Hartmut Holzgraefe");
CREDIT_LINE("CURL","Sterling Hughes");
CREDIT_LINE("CyberCash","Evan Klinger");
CREDIT_LINE("DBA","Sascha Schumann");
CREDIT_LINE("dBase","Jim Winstead");
CREDIT_LINE("DBM","Rasmus Lerdorf, Jim Winstead");
CREDIT_LINE("domxml","Uwe Steinmann");
CREDIT_LINE("dotnet","Sam Ruby");
CREDIT_LINE("EXIF","Rasmus Lerdorf");
CREDIT_LINE("FBSQL","Frank M. Kromann");
CREDIT_LINE("FDF","Uwe Steinmann");
CREDIT_LINE("FilePro","Chad Robinson");
CREDIT_LINE("FTP","Andrew Skalski");
CREDIT_LINE("GD imaging","Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto");
CREDIT_LINE("GetText","Alex Plotnick");
CREDIT_LINE("HyperWave","Uwe Steinmann");
CREDIT_LINE("icap","Mark Musone");
CREDIT_LINE("iisfunc","Frank M. Kromann");
CREDIT_LINE("IMAP","Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
CREDIT_LINE("Informix","Danny Heijl, Christian Cartus");
CREDIT_LINE("Ingres II","David Hénot");
CREDIT_LINE("InterBase","Jouni Ahto, Andrew Avdeev");
CREDIT_LINE("IRCG","Sascha Schumann");
CREDIT_LINE("Java","Sam Ruby");
CREDIT_LINE("LDAP","Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson");
CREDIT_LINE("Mailparse MIME parsing and manipulation functions","Wez Furlong");
CREDIT_LINE("MCAL","Mark Musone, Chuck Hagenbuch");
CREDIT_LINE("mcrypt","Sascha Schumann, Derick Rethans");
CREDIT_LINE("mhash","Sascha Schumann");
CREDIT_LINE("MING","Dave Hayden");
CREDIT_LINE("mnoGoSearch","Alex Barkov, Ramil Kalimullin, Sergey Kartashoff");
CREDIT_LINE("MS SQL","Frank M. Kromann");
CREDIT_LINE("mSQL","Zeev Suraski");
CREDIT_LINE("Multibyte (Japanese) String Functions","Tsukada Takuya");
CREDIT_LINE("MySQL","Zeev Suraski");
CREDIT_LINE("OCI8","Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson");
CREDIT_LINE("ODBC","Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky");
CREDIT_LINE("OpenSSL","Stig Venaas, Wez Furlong, Sascha Kettler");
CREDIT_LINE("Oracle","Stig Bakken, Mitch Golden, Rasmus Lerdorf, Andreas Karajannis, Thies C. Arntzen");
CREDIT_LINE("Ovrimos","Nikos Mavroyanopoulos");
CREDIT_LINE("pcntl","Jason Greene");
CREDIT_LINE("PDF","Uwe Steinmann");
CREDIT_LINE("Perl Compatible Regexps","Andrei Zmievski");
CREDIT_LINE("Posix","Kristian Köhntopp");
CREDIT_LINE("PostgreSQL","Jouni Ahto, Zeev Suraski");
CREDIT_LINE("PRINTER","Daniel Beulshausen, Frank M. Kromann");
CREDIT_LINE("Pspell","Vlad Krupin");
CREDIT_LINE("qtdom","Jan Borsodi");
CREDIT_LINE("Readline","Thies C. Arntzen");
CREDIT_LINE("Recode","Kristian Köhntopp");
CREDIT_LINE("Sablotron XSLT","Sterling Hughes");
CREDIT_LINE("Satellite (CORBA)","David Eriksson");
CREDIT_LINE("Sessions","Sascha Schumann, Andrei Zmievski");
CREDIT_LINE("Shared Memory Operations","Slava Poliakov, Ilia Alshanetsky");
CREDIT_LINE("SNMP","Rasmus Lerdorf");
CREDIT_LINE("Sockets","Chris Vandomelen, Sterling Hughes, Daniel Beulshausen");
CREDIT_LINE("SWF","Sterling Hughes");
CREDIT_LINE("Sybase-CT","Zeev Suraski, Tom May");
CREDIT_LINE("Sybase-DB","Zeev Suraski");
CREDIT_LINE("System V Semaphores","Tom May");
CREDIT_LINE("System V Shared Memory","Christian Cartus");
CREDIT_LINE("Verisign Payflow Pro","John Donagher, David Croft");
CREDIT_LINE("Vpopmail","David Croft, Boian Bonev");
CREDIT_LINE("WDDX","Andrei Zmievski");
CREDIT_LINE("Win32 COM","Zeev Suraski, Harald Radi");
CREDIT_LINE("XML","Stig Bakken, Thies C. Arntzen");
CREDIT_LINE("YAZ","Adam Dickmeiss");
CREDIT_LINE("Yellow Pages","Stephanie Wehner, Fredrik Ohrn");
CREDIT_LINE("Zip","Sterling Hughes");
CREDIT_LINE("Zlib","Rasmus Lerdorf, Stefan Roehrich");
CREDIT_LINE("aspell", "Rasmus Lerdorf");
CREDIT_LINE("Assert", "Thies C. Arntzen");
CREDIT_LINE("BC Math", "Andi Gutmans");
CREDIT_LINE("bz2", "Sterling Hughes");
CREDIT_LINE("ccvs", "Brendan W. McAdams, Doug DeJulio");
CREDIT_LINE("cpdf", "Uwe Steinmann");
CREDIT_LINE("crack", "Alexander Feldman");
CREDIT_LINE("ctype", "Hartmut Holzgraefe");
CREDIT_LINE("CURL", "Sterling Hughes");
CREDIT_LINE("CyberCash", "Evan Klinger");
CREDIT_LINE("DBA", "Sascha Schumann");
CREDIT_LINE("dBase", "Jim Winstead");
CREDIT_LINE("DBM", "Rasmus Lerdorf, Jim Winstead");
CREDIT_LINE("domxml", "Uwe Steinmann");
CREDIT_LINE("dotnet", "Sam Ruby");
CREDIT_LINE("EXIF", "Rasmus Lerdorf");
CREDIT_LINE("FBSQL", "Frank M. Kromann");
CREDIT_LINE("FDF", "Uwe Steinmann");
CREDIT_LINE("FilePro", "Chad Robinson");
CREDIT_LINE("FTP", "Andrew Skalski");
CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto");
CREDIT_LINE("GetText", "Alex Plotnick");
CREDIT_LINE("HyperWave", "Uwe Steinmann");
CREDIT_LINE("icap", "Mark Musone");
CREDIT_LINE("iisfunc", "Frank M. Kromann");
CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
CREDIT_LINE("Informix", "Danny Heijl, Christian Cartus");
CREDIT_LINE("Ingres II", "David Hénot");
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev");
CREDIT_LINE("IRCG", "Sascha Schumann");
CREDIT_LINE("Java", "Sam Ruby");
CREDIT_LINE("LDAP", "Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson");
CREDIT_LINE("Mailparse MIME parsing and manipulation functions", "Wez Furlong");
CREDIT_LINE("MCAL", "Mark Musone, Chuck Hagenbuch");
CREDIT_LINE("mcrypt", "Sascha Schumann, Derick Rethans");
CREDIT_LINE("mhash", "Sascha Schumann");
CREDIT_LINE("MING", "Dave Hayden");
CREDIT_LINE("mnoGoSearch", "Alex Barkov, Ramil Kalimullin, Sergey Kartashoff");
CREDIT_LINE("MS SQL", "Frank M. Kromann");
CREDIT_LINE("mSQL", "Zeev Suraski");
CREDIT_LINE("Multibyte (Japanese) String Functions", "Tsukada Takuya");
CREDIT_LINE("MySQL", "Zeev Suraski");
CREDIT_LINE("OCI8", "Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson");
CREDIT_LINE("ODBC", "Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky");
CREDIT_LINE("OpenSSL", "Stig Venaas, Wez Furlong, Sascha Kettler");
CREDIT_LINE("Oracle", "Stig Bakken, Mitch Golden, Rasmus Lerdorf, Andreas Karajannis, Thies C. Arntzen");
CREDIT_LINE("Ovrimos", "Nikos Mavroyanopoulos");
CREDIT_LINE("pcntl", "Jason Greene");
CREDIT_LINE("PDF", "Uwe Steinmann");
CREDIT_LINE("Perl Compatible Regexps", "Andrei Zmievski");
CREDIT_LINE("Posix", "Kristian Köhntopp");
CREDIT_LINE("PostgreSQL", "Jouni Ahto, Zeev Suraski");
CREDIT_LINE("PRINTER", "Daniel Beulshausen, Frank M. Kromann");
CREDIT_LINE("Pspell", "Vlad Krupin");
CREDIT_LINE("qtdom", "Jan Borsodi");
CREDIT_LINE("Readline", "Thies C. Arntzen");
CREDIT_LINE("Recode", "Kristian Köhntopp");
CREDIT_LINE("Sablotron XSLT", "Sterling Hughes");
CREDIT_LINE("Satellite (CORBA)", "David Eriksson");
CREDIT_LINE("Sessions", "Sascha Schumann, Andrei Zmievski");
CREDIT_LINE("Shared Memory Operations", "Slava Poliakov, Ilia Alshanetsky");
CREDIT_LINE("SNMP", "Rasmus Lerdorf");
CREDIT_LINE("Sockets", "Chris Vandomelen, Sterling Hughes, Daniel Beulshausen");
CREDIT_LINE("SWF", "Sterling Hughes");
CREDIT_LINE("Sybase-CT", "Zeev Suraski, Tom May");
CREDIT_LINE("Sybase-DB", "Zeev Suraski");
CREDIT_LINE("System V Semaphores", "Tom May");
CREDIT_LINE("System V Shared Memory", "Christian Cartus");
CREDIT_LINE("Verisign Payflow Pro", "John Donagher, David Croft");
CREDIT_LINE("Vpopmail", "David Croft, Boian Bonev");
CREDIT_LINE("WDDX", "Andrei Zmievski");
CREDIT_LINE("Win32 COM", "Zeev Suraski, Harald Radi");
CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen");
CREDIT_LINE("YAZ", "Adam Dickmeiss");
CREDIT_LINE("Yellow Pages", "Stephanie Wehner, Fredrik Ohrn");
CREDIT_LINE("Zip", "Sterling Hughes");
CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Roehrich");

View file

@ -10,15 +10,15 @@
*/
CREDIT_LINE("AOLserver","Sascha Schumann");
CREDIT_LINE("Apache 1.3","Rasmus Lerdorf, Zeev Suraski, Stig Bakken, David Sklar");
CREDIT_LINE("Apache 2.0","Sascha Schumann");
CREDIT_LINE("Caudium / Roxen","David Hedbor");
CREDIT_LINE("CGI","Rasmus Lerdorf, Stig Bakken");
CREDIT_LINE("fhttpd","Alex Belits");
CREDIT_LINE("ISAPI","Andi Gutmans, Zeev Suraski");
CREDIT_LINE("Java Servlet","Sam Ruby");
CREDIT_LINE("NSAPI","Jayakumar Muthukumarasamy");
CREDIT_LINE("phttpd","Thies C. Arntzen");
CREDIT_LINE("pi3web","Holger Zimmermann");
CREDIT_LINE("thttpd","Sascha Schumann");
CREDIT_LINE("AOLserver", "Sascha Schumann");
CREDIT_LINE("Apache 1.3", "Rasmus Lerdorf, Zeev Suraski, Stig Bakken, David Sklar");
CREDIT_LINE("Apache 2.0", "Sascha Schumann");
CREDIT_LINE("Caudium / Roxen", "David Hedbor");
CREDIT_LINE("CGI", "Rasmus Lerdorf, Stig Bakken");
CREDIT_LINE("fhttpd", "Alex Belits");
CREDIT_LINE("ISAPI", "Andi Gutmans, Zeev Suraski");
CREDIT_LINE("Java Servlet", "Sam Ruby");
CREDIT_LINE("NSAPI", "Jayakumar Muthukumarasamy");
CREDIT_LINE("phttpd", "Thies C. Arntzen");
CREDIT_LINE("pi3web", "Holger Zimmermann");
CREDIT_LINE("thttpd", "Sascha Schumann");

View file

@ -43,7 +43,7 @@
#ifdef PHP_WIN32
#include <process.h>
extern char *crypt(char *__key,char *__salt);
extern char *crypt(char *__key, char *__salt);
#endif
#include "php_lcg.h"

View file

@ -85,7 +85,7 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
int i, gmadjust, seconds, arg_count = ZEND_NUM_ARGS();
int is_dst = -1;
if (arg_count > 7 || zend_get_parameters_array_ex(arg_count,arguments) == FAILURE) {
if (arg_count > 7 || zend_get_parameters_array_ex(arg_count, arguments) == FAILURE) {
WRONG_PARAM_COUNT;
}
/* convert supplied arguments to longs */
@ -99,7 +99,7 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
/*
** Set default time parameters with local time values,
** EVEN when some GMT time parameters are specified!
** This may give strange result, with PHP gmmktime(0,0,0),
** This may give strange result, with PHP gmmktime(0, 0, 0),
** which is assumed to return GMT midnight time
** for today (in localtime), so that the result time may be
** AFTER or BEFORE the current time.
@ -439,7 +439,7 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
#if HAVE_TM_GMTOFF
sprintf(tmp_buff, "%c%02d%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( ta->tm_gmtoff % 3600));
#else
sprintf(tmp_buff, "%c%02d%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+',abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs((ta->tm_isdst ? timezone - 3600 : timezone) % 3600));
sprintf(tmp_buff, "%c%02d%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs((ta->tm_isdst ? timezone - 3600 : timezone) % 3600));
#endif
strcat(return_value->value.str.val, tmp_buff);
break;
@ -616,7 +616,7 @@ PHP_FUNCTION(getdate)
if (ZEND_NUM_ARGS() == 0) {
timestamp = time(NULL);
} else if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1,&timestamp_arg) == FAILURE) {
} else if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &timestamp_arg) == FAILURE) {
WRONG_PARAM_COUNT;
} else {
convert_to_long_ex(timestamp_arg);
@ -711,7 +711,7 @@ PHP_FUNCTION(checkdate)
if (d < 1 || d > phpday_tab[isleap(y)][m - 1]) {
RETURN_FALSE;
}
RETURN_TRUE; /* True : This month,day,year arguments are valid */
RETURN_TRUE; /* True : This month, day, year arguments are valid */
}
/* }}} */
@ -721,7 +721,7 @@ PHP_FUNCTION(checkdate)
void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm)
{
pval **format_arg, **timestamp_arg;
char *format,*buf;
char *format, *buf;
time_t timestamp;
struct tm *ta, tmbuf;
int max_reallocs = 5;
@ -729,13 +729,13 @@ void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm)
switch (ZEND_NUM_ARGS()) {
case 1:
if (zend_get_parameters_ex(1,&format_arg)==FAILURE) {
if (zend_get_parameters_ex(1, &format_arg)==FAILURE) {
RETURN_FALSE;
}
time(&timestamp);
break;
case 2:
if (zend_get_parameters_ex(2, &format_arg,&timestamp_arg)==FAILURE) {
if (zend_get_parameters_ex(2, &format_arg, &timestamp_arg)==FAILURE) {
RETURN_FALSE;
}
convert_to_long_ex(timestamp_arg);
@ -761,14 +761,14 @@ void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm)
}
buf = (char *) emalloc(buf_len);
while ((real_len=strftime(buf,buf_len,format,ta))==buf_len || real_len==0) {
while ((real_len=strftime(buf, buf_len, format, ta))==buf_len || real_len==0) {
buf_len *= 2;
buf = (char *) erealloc(buf, buf_len);
if(!--max_reallocs) break;
}
if(real_len && real_len != buf_len) {
buf = (char *) erealloc(buf,real_len+1);
buf = (char *) erealloc(buf, real_len+1);
RETURN_STRINGL(buf, real_len, 0);
}
efree(buf);

View file

@ -76,7 +76,7 @@ static zend_class_entry *dir_class_entry_ptr;
} else if ((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &id) == FAILURE) { \
WRONG_PARAM_COUNT; \
} else { \
ZEND_FETCH_RESOURCE(dirp,php_dir *,id,-1, "Directory", le_dirp); \
ZEND_FETCH_RESOURCE(dirp, php_dir *, id,-1, "Directory", le_dirp); \
}
static zend_function_entry php_dir_class_functions[] = {
@ -169,7 +169,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
RETURN_FALSE;
}
dirp->id = zend_list_insert(dirp,le_dirp);
dirp->id = zend_list_insert(dirp, le_dirp);
php_set_default_dir(dirp->id TSRMLS_CC);
@ -189,7 +189,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
PHP_FUNCTION(opendir)
{
_php_do_opendir(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
_php_do_opendir(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
@ -198,7 +198,7 @@ PHP_FUNCTION(opendir)
PHP_FUNCTION(getdir)
{
_php_do_opendir(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
_php_do_opendir(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
@ -306,7 +306,7 @@ PHP_FUNCTION(getcwd)
#endif
if (ret) {
RETURN_STRING(path,1);
RETURN_STRING(path, 1);
} else {
RETURN_FALSE;
}

View file

@ -96,7 +96,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
{
void *handle;
char *libpath;
zend_module_entry *module_entry,*tmp;
zend_module_entry *module_entry, *tmp;
zend_module_entry *(*get_module)(void);
int error_type;
char *extension_dir;
@ -122,9 +122,9 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
libpath = emalloc(extension_dir_len+file->value.str.len+2);
if (IS_SLASH(extension_dir[extension_dir_len-1])) {
sprintf(libpath,"%s%s", extension_dir, file->value.str.val); /* SAFE */
sprintf(libpath, "%s%s", extension_dir, file->value.str.val); /* SAFE */
} else {
sprintf(libpath,"%s/%s", extension_dir, file->value.str.val); /* SAFE */
sprintf(libpath, "%s/%s", extension_dir, file->value.str.val); /* SAFE */
}
} else {
libpath = estrndup(file->value.str.val, file->value.str.len);
@ -190,8 +190,8 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
}
/* update the .request_started property... */
if (zend_hash_find(&module_registry, module_entry->name, strlen(module_entry->name)+1,(void **) &tmp)==FAILURE) {
php_error(error_type,"%s: Loaded module got lost", module_entry->name);
if (zend_hash_find(&module_registry, module_entry->name, strlen(module_entry->name)+1, (void **) &tmp)==FAILURE) {
php_error(error_type, "%s: Loaded module got lost", module_entry->name);
RETURN_FALSE;
}
tmp->handle = handle;
@ -209,7 +209,7 @@ PHP_MINFO_FUNCTION(dl)
void php_dl(pval *file, int type, pval *return_value)
{
php_error(E_WARNING,"Cannot dynamically load %s - dynamic modules are not supported", file->value.str.val);
php_error(E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", file->value.str.val);
RETURN_FALSE;
}

View file

@ -184,8 +184,8 @@ static char *php_gethostbyname(char *name)
Check DNS records corresponding to a given Internet host name or IP address */
PHP_FUNCTION(checkdnsrr)
{
zval **arg1,**arg2;
int type,i;
zval **arg1, **arg2;
int type, i;
#ifndef MAXPACKET
#define MAXPACKET 8192 /* max packet size used internally by BIND */
#endif
@ -205,22 +205,22 @@ PHP_FUNCTION(checkdnsrr)
}
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
if ( !strcasecmp("A",Z_STRVAL_PP(arg2)) ) type = T_A;
else if ( !strcasecmp("NS",Z_STRVAL_PP(arg2)) ) type = T_NS;
else if ( !strcasecmp("MX",Z_STRVAL_PP(arg2)) ) type = T_MX;
else if ( !strcasecmp("PTR",Z_STRVAL_PP(arg2)) ) type = T_PTR;
else if ( !strcasecmp("ANY",Z_STRVAL_PP(arg2)) ) type = T_ANY;
else if ( !strcasecmp("SOA",Z_STRVAL_PP(arg2)) ) type = T_SOA;
else if ( !strcasecmp("CNAME",Z_STRVAL_PP(arg2)) ) type = T_CNAME;
if ( !strcasecmp("A", Z_STRVAL_PP(arg2)) ) type = T_A;
else if ( !strcasecmp("NS", Z_STRVAL_PP(arg2)) ) type = T_NS;
else if ( !strcasecmp("MX", Z_STRVAL_PP(arg2)) ) type = T_MX;
else if ( !strcasecmp("PTR", Z_STRVAL_PP(arg2)) ) type = T_PTR;
else if ( !strcasecmp("ANY", Z_STRVAL_PP(arg2)) ) type = T_ANY;
else if ( !strcasecmp("SOA", Z_STRVAL_PP(arg2)) ) type = T_SOA;
else if ( !strcasecmp("CNAME", Z_STRVAL_PP(arg2)) ) type = T_CNAME;
else {
php_error(E_WARNING,"Type '%s' not supported",Z_STRVAL_PP(arg2));
php_error(E_WARNING, "Type '%s' not supported", Z_STRVAL_PP(arg2));
RETURN_FALSE;
}
break;
default:
WRONG_PARAM_COUNT;
}
i = res_search(Z_STRVAL_PP(arg1),C_IN,type,ans,sizeof(ans));
i = res_search(Z_STRVAL_PP(arg1), C_IN, type, ans, sizeof(ans));
if ( i < 0 ) {
RETURN_FALSE;
}
@ -246,12 +246,12 @@ PHP_FUNCTION(getmxrr)
{
pval *host, *mx_list, *weight_list;
int need_weight = 0;
int count,qdc;
u_short type,weight;
int count, qdc;
u_short type, weight;
u_char ans[MAXPACKET];
char buf[MAXHOSTNAMELEN];
HEADER *hp;
u_char *cp,*end;
u_char *cp, *end;
int i;
switch(ZEND_NUM_ARGS()) {
@ -281,7 +281,7 @@ PHP_FUNCTION(getmxrr)
}
/* Go! */
i = res_search(Z_STRVAL_P(host),C_IN,T_MX,(u_char *)&ans,sizeof(ans));
i = res_search(Z_STRVAL_P(host), C_IN, T_MX, (u_char *)&ans, sizeof(ans));
if ( i < 0 ) {
RETURN_FALSE;
}
@ -290,25 +290,25 @@ PHP_FUNCTION(getmxrr)
cp = (u_char *)&ans + HFIXEDSZ;
end = (u_char *)&ans +i;
for ( qdc = ntohs((unsigned short)hp->qdcount); qdc--; cp += i + QFIXEDSZ) {
if ( (i = dn_skipname(cp,end)) < 0 ) {
if ( (i = dn_skipname(cp, end)) < 0 ) {
RETURN_FALSE;
}
}
count = ntohs((unsigned short)hp->ancount);
while ( --count >= 0 && cp < end ) {
if ( (i = dn_skipname(cp,end)) < 0 ) {
if ( (i = dn_skipname(cp, end)) < 0 ) {
RETURN_FALSE;
}
cp += i;
GETSHORT(type,cp);
GETSHORT(type, cp);
cp += INT16SZ + INT32SZ;
GETSHORT(i,cp);
GETSHORT(i, cp);
if ( type != T_MX ) {
cp += i;
continue;
}
GETSHORT(weight,cp);
if ( (i = dn_expand(ans,end,cp,buf,sizeof(buf)-1)) < 0 ) {
GETSHORT(weight, cp);
if ( (i = dn_expand(ans, end, cp, buf, sizeof(buf)-1)) < 0 ) {
RETURN_FALSE;
}
cp += i;

View file

@ -202,9 +202,9 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
int len;
tmp = php_addslashes(buf, 0, &len, 0 TSRMLS_CC);
RETVAL_STRINGL(tmp,len,0);
RETVAL_STRINGL(tmp, len, 0);
} else {
RETVAL_STRINGL(buf,l,1);
RETVAL_STRINGL(buf, l, 1);
}
} else {
int b, i;
@ -242,18 +242,18 @@ PHP_FUNCTION(exec)
int arg_count = ZEND_NUM_ARGS();
int ret;
if (arg_count > 3 || zend_get_parameters_ex(arg_count, &arg1,&arg2, &arg3) == FAILURE) {
if (arg_count > 3 || zend_get_parameters_ex(arg_count, &arg1, &arg2, &arg3) == FAILURE) {
WRONG_PARAM_COUNT;
}
switch (arg_count) {
case 1:
ret = php_Exec(0, Z_STRVAL_PP(arg1), NULL,return_value TSRMLS_CC);
ret = php_Exec(0, Z_STRVAL_PP(arg1), NULL, return_value TSRMLS_CC);
break;
case 2:
ret = php_Exec(2, Z_STRVAL_PP(arg1),*arg2,return_value TSRMLS_CC);
ret = php_Exec(2, Z_STRVAL_PP(arg1), *arg2, return_value TSRMLS_CC);
break;
case 3:
ret = php_Exec(2,Z_STRVAL_PP(arg1),*arg2,return_value TSRMLS_CC);
ret = php_Exec(2, Z_STRVAL_PP(arg1), *arg2, return_value TSRMLS_CC);
Z_TYPE_PP(arg3) = IS_LONG;
Z_LVAL_PP(arg3)=ret;
break;
@ -270,15 +270,15 @@ PHP_FUNCTION(system)
int arg_count = ZEND_NUM_ARGS();
int ret;
if (arg_count > 2 || zend_get_parameters_ex(arg_count, &arg1,&arg2) == FAILURE) {
if (arg_count > 2 || zend_get_parameters_ex(arg_count, &arg1, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
}
switch (arg_count) {
case 1:
ret = php_Exec(1, Z_STRVAL_PP(arg1), NULL,return_value TSRMLS_CC);
ret = php_Exec(1, Z_STRVAL_PP(arg1), NULL, return_value TSRMLS_CC);
break;
case 2:
ret = php_Exec(1, Z_STRVAL_PP(arg1), NULL,return_value TSRMLS_CC);
ret = php_Exec(1, Z_STRVAL_PP(arg1), NULL, return_value TSRMLS_CC);
Z_TYPE_PP(arg2) = IS_LONG;
Z_LVAL_PP(arg2)=ret;
break;
@ -294,7 +294,7 @@ PHP_FUNCTION(passthru)
int arg_count = ZEND_NUM_ARGS();
int ret;
if (arg_count > 2 || zend_get_parameters_ex(arg_count, &arg1,&arg2) == FAILURE) {
if (arg_count > 2 || zend_get_parameters_ex(arg_count, &arg1, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
}
switch (arg_count) {
@ -438,37 +438,37 @@ PHP_FUNCTION(escapeshellarg)
PHP_FUNCTION(shell_exec)
{
FILE *in;
int readbytes,total_readbytes=0,allocated_space;
int readbytes, total_readbytes=0, allocated_space;
pval **cmd;
char *ret;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1,&cmd)==FAILURE) {
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &cmd)==FAILURE) {
WRONG_PARAM_COUNT;
}
if (PG(safe_mode)) {
php_error(E_WARNING,"Cannot execute using backquotes in safe mode");
php_error(E_WARNING, "Cannot execute using backquotes in safe mode");
RETURN_FALSE;
}
convert_to_string_ex(cmd);
#ifdef PHP_WIN32
if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd),"rt"))==NULL) {
if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd), "rt"))==NULL) {
#else
if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd),"r"))==NULL) {
if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd), "r"))==NULL) {
#endif
php_error(E_WARNING,"Unable to execute '%s'",Z_STRVAL_PP(cmd));
php_error(E_WARNING, "Unable to execute '%s'", Z_STRVAL_PP(cmd));
}
allocated_space = EXEC_INPUT_BUF;
ret = (char *) emalloc(allocated_space);
while (1) {
readbytes = fread(ret+total_readbytes,1,EXEC_INPUT_BUF,in);
readbytes = fread(ret+total_readbytes, 1, EXEC_INPUT_BUF, in);
if (readbytes<=0) {
break;
}
total_readbytes += readbytes;
allocated_space = total_readbytes+EXEC_INPUT_BUF;
ret = (char *) erealloc(ret,allocated_space);
ret = (char *) erealloc(ret, allocated_space);
}
pclose(in);

View file

@ -301,12 +301,12 @@ PHP_FUNCTION(get_meta_tags)
/* check args */
switch (ARG_COUNT(ht)) {
case 1:
if (zend_get_parameters_ex(1,&filename) == FAILURE) {
if (zend_get_parameters_ex(1, &filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 2:
if (zend_get_parameters_ex(2,&filename,&arg2) == FAILURE) {
if (zend_get_parameters_ex(2, &filename, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg2);
@ -322,7 +322,7 @@ PHP_FUNCTION(get_meta_tags)
if (md.issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"get_meta_tags(\"%s\") - %s", tmp, strerror(errno));
php_error(E_WARNING, "get_meta_tags(\"%s\") - %s", tmp, strerror(errno));
efree(tmp);
}
RETURN_FALSE;
@ -347,7 +347,7 @@ PHP_FUNCTION(get_meta_tags)
if (tok == TOK_ID) {
if (tok_last == TOK_OPENTAG) {
in_meta_tag = !strcasecmp("meta",md.token_data);
in_meta_tag = !strcasecmp("meta", md.token_data);
md.in_meta = in_meta_tag;
} else if (tok_last == TOK_SLASH && in_tag) {
if (strcasecmp("head", md.token_data) == 0) {
@ -357,7 +357,7 @@ PHP_FUNCTION(get_meta_tags)
} else if (tok_last == TOK_EQUAL && looking_for_val) {
if (saw_name) {
/* Get the NAME attr (Single word attr, non-quoted) */
temp = name = estrndup(md.token_data,md.token_len);
temp = name = estrndup(md.token_data, md.token_len);
while (temp && *temp) {
if (strchr(PHP_META_UNSAFE, *temp)) {
@ -370,9 +370,9 @@ PHP_FUNCTION(get_meta_tags)
} else if (saw_content) {
/* Get the CONTENT attr (Single word attr, non-quoted) */
if (PG(magic_quotes_runtime)) {
value = php_addslashes(md.token_data,0,&md.token_len,0 TSRMLS_CC);
value = php_addslashes(md.token_data, 0, &md.token_len, 0 TSRMLS_CC);
} else {
value = estrndup(md.token_data,md.token_len);
value = estrndup(md.token_data, md.token_len);
}
have_content = 1;
@ -395,7 +395,7 @@ PHP_FUNCTION(get_meta_tags)
} else if (tok == TOK_STRING && tok_last == TOK_EQUAL && looking_for_val) {
if (saw_name) {
/* Get the NAME attr (Quoted single/double) */
temp = name = estrndup(md.token_data,md.token_len);
temp = name = estrndup(md.token_data, md.token_len);
while (temp && *temp) {
if (strchr(PHP_META_UNSAFE, *temp)) {
@ -408,9 +408,9 @@ PHP_FUNCTION(get_meta_tags)
} else if (saw_content) {
/* Get the CONTENT attr (Single word attr, non-quoted) */
if (PG(magic_quotes_runtime)) {
value = php_addslashes(md.token_data,0,&md.token_len,0 TSRMLS_CC);
value = php_addslashes(md.token_data, 0, &md.token_len, 0 TSRMLS_CC);
} else {
value = estrndup(md.token_data,md.token_len);
value = estrndup(md.token_data, md.token_len);
}
have_content = 1;
@ -483,12 +483,12 @@ PHP_FUNCTION(file)
/* check args */
switch (ARG_COUNT(ht)) {
case 1:
if (zend_get_parameters_ex(1,&filename) == FAILURE) {
if (zend_get_parameters_ex(1, &filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 2:
if (zend_get_parameters_ex(2,&filename,&arg2) == FAILURE) {
if (zend_get_parameters_ex(2, &filename, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg2);
@ -499,12 +499,12 @@ PHP_FUNCTION(file)
}
convert_to_string_ex(filename);
fp = php_fopen_wrapper((*filename)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
fp = php_fopen_wrapper((*filename)->value.str.val, "rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd) {
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"file(\"%s\") - %s", tmp, strerror(errno));
php_error(E_WARNING, "file(\"%s\") - %s", tmp, strerror(errno));
efree(tmp);
}
RETURN_FALSE;
@ -647,12 +647,12 @@ PHP_NAMED_FUNCTION(php_if_fopen)
switch(ARG_COUNT(ht)) {
case 2:
if (zend_get_parameters_ex(2,&arg1,&arg2) == FAILURE) {
if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 3:
if (zend_get_parameters_ex(3,&arg1,&arg2,&arg3) == FAILURE) {
if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg3);
@ -663,7 +663,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
}
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
p = estrndup((*arg2)->value.str.val,(*arg2)->value.str.len);
p = estrndup((*arg2)->value.str.val, (*arg2)->value.str.len);
/*
* We need a better way of returning error messages from
@ -674,7 +674,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"fopen(\"%s\",\"%s\") - %s", tmp, p, strerror(errno));
php_error(E_WARNING, "fopen(\"%s\", \"%s\") - %s", tmp, p, strerror(errno));
efree(tmp);
}
efree(p);
@ -687,9 +687,9 @@ PHP_NAMED_FUNCTION(php_if_fopen)
if (issock) {
sock=emalloc(sizeof(int));
*sock=socketd;
ZEND_REGISTER_RESOURCE(return_value,sock,le_socket);
ZEND_REGISTER_RESOURCE(return_value, sock, le_socket);
} else {
ZEND_REGISTER_RESOURCE(return_value,fp,le_fopen);
ZEND_REGISTER_RESOURCE(return_value, fp, le_fopen);
}
}
@ -722,7 +722,7 @@ PHP_FUNCTION(popen)
{
pval **arg1, **arg2;
FILE *fp;
char *p,*tmp = NULL;
char *p, *tmp = NULL;
char *b, buf[1024];
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
@ -730,7 +730,7 @@ PHP_FUNCTION(popen)
}
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
p = estrndup((*arg2)->value.str.val,(*arg2)->value.str.len);
p = estrndup((*arg2)->value.str.val, (*arg2)->value.str.len);
if (PG(safe_mode)){
b = strchr((*arg1)->value.str.val,' ');
if (!b) {
@ -746,30 +746,30 @@ PHP_FUNCTION(popen)
}
}
if (b) {
snprintf(buf,sizeof(buf),"%s%s",PG(safe_mode_exec_dir),b);
snprintf(buf, sizeof(buf), "%s%s", PG(safe_mode_exec_dir), b);
} else {
snprintf(buf,sizeof(buf),"%s/%s",PG(safe_mode_exec_dir),(*arg1)->value.str.val);
snprintf(buf, sizeof(buf), "%s/%s", PG(safe_mode_exec_dir), (*arg1)->value.str.val);
}
tmp = php_escape_shell_cmd(buf);
fp = VCWD_POPEN(tmp,p);
fp = VCWD_POPEN(tmp, p);
efree(tmp);
if (!fp) {
php_error(E_WARNING,"popen(\"%s\",\"%s\") - %s",buf,p,strerror(errno));
php_error(E_WARNING, "popen(\"%s\", \"%s\") - %s", buf, p, strerror(errno));
RETURN_FALSE;
}
} else {
fp = VCWD_POPEN((*arg1)->value.str.val, p);
if (!fp) {
php_error(E_WARNING,"popen(\"%s\",\"%s\") - %s",(*arg1)->value.str.val,p,strerror(errno));
php_error(E_WARNING, "popen(\"%s\", \"%s\") - %s", (*arg1)->value.str.val, p, strerror(errno));
efree(p);
RETURN_FALSE;
}
}
efree(p);
ZEND_REGISTER_RESOURCE(return_value,fp,le_popen);
ZEND_REGISTER_RESOURCE(return_value, fp, le_popen);
}
/* }}} */
@ -785,7 +785,7 @@ PHP_FUNCTION(pclose)
WRONG_PARAM_COUNT;
}
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",NULL,1,le_popen);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", NULL, 1, le_popen);
ZEND_VERIFY_RESOURCE(what);
zend_list_delete((*arg1)->value.lval);
@ -847,8 +847,8 @@ PHPAPI int php_set_sock_blocking(int socketd, int block)
#ifdef PHP_WIN32
/* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
flags = !block;
if (ioctlsocket(socketd,FIONBIO,&flags)==SOCKET_ERROR){
php_error(E_WARNING,"%s",WSAGetLastError());
if (ioctlsocket(socketd, FIONBIO, &flags)==SOCKET_ERROR){
php_error(E_WARNING, "%s", WSAGetLastError());
ret = FALSE;
}
#else
@ -1014,7 +1014,7 @@ PHP_FUNCTION(fgets)
buf = emalloc(sizeof(char) * (len + 1));
/* needed because recv doesnt put a null at the end*/
memset(buf,0,len+1);
memset(buf, 0, len+1);
#if HAVE_PHP_STREAM
if (type == le_stream) {
@ -1038,13 +1038,13 @@ PHP_FUNCTION(fgets)
}
if (PG(magic_quotes_runtime)) {
return_value->value.str.val = php_addslashes(buf,0,&return_value->value.str.len,1 TSRMLS_CC);
return_value->value.str.val = php_addslashes(buf, 0, &return_value->value.str.len, 1 TSRMLS_CC);
} else {
return_value->value.str.val = buf;
return_value->value.str.len = strlen(return_value->value.str.val);
/* resize buffer if it's much larger than the result */
if(return_value->value.str.len < len/2) {
return_value->value.str.val = erealloc(buf,return_value->value.str.len+1);
return_value->value.str.val = erealloc(buf, return_value->value.str.len+1);
}
}
return_value->type = IS_STRING;
@ -1205,7 +1205,7 @@ PHP_FUNCTION(fscanf)
WRONG_PARAM_COUNT;
}
args = (zval ***)emalloc(argCount * sizeof(zval **));
if (!args || (zend_get_parameters_array_ex(argCount,args) == FAILURE)) {
if (!args || (zend_get_parameters_array_ex(argCount, args) == FAILURE)) {
efree( args );
WRONG_PARAM_COUNT;
}
@ -1233,7 +1233,7 @@ PHP_FUNCTION(fscanf)
}
buf = emalloc(sizeof(char) * (len + 1));
/* needed because recv doesnt put a null at the end*/
memset(buf,0,len+1);
memset(buf, 0, len+1);
#if HAVE_PHP_STREAM
if (type == le_stream) {
@ -1251,7 +1251,7 @@ PHP_FUNCTION(fscanf)
}
convert_to_string_ex( format_string );
result = php_sscanf_internal( buf,(*format_string)->value.str.val,
result = php_sscanf_internal( buf, (*format_string)->value.str.val,
argCount, args, 2, &return_value TSRMLS_CC);
efree(args);
efree(buf);
@ -1269,7 +1269,7 @@ PHP_FUNCTION(fscanf)
PHP_FUNCTION(fwrite)
{
pval **arg1, **arg2, **arg3=NULL;
int ret,type;
int ret, type;
int num_bytes;
int issock=0;
int socketd=0;
@ -1319,14 +1319,14 @@ PHP_FUNCTION(fwrite)
#endif
if (issock){
ret = SOCK_WRITEL((*arg2)->value.str.val,num_bytes,socketd);
ret = SOCK_WRITEL((*arg2)->value.str.val, num_bytes, socketd);
} else {
#ifdef HAVE_FLUSHIO
if (type == le_fopen) {
fseek((FILE*)what, 0, SEEK_CUR);
}
#endif
ret = fwrite((*arg2)->value.str.val,1,num_bytes,(FILE*)what);
ret = fwrite((*arg2)->value.str.val, 1, num_bytes, (FILE*)what);
}
RETURN_LONG(ret);
}
@ -1338,7 +1338,7 @@ PHP_FUNCTION(fwrite)
PHP_FUNCTION(fflush)
{
pval **arg1;
int ret,type;
int ret, type;
int issock=0;
int socketd=0;
void *what;
@ -1347,7 +1347,7 @@ PHP_FUNCTION(fflush)
WRONG_PARAM_COUNT;
}
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",&type,4,le_fopen,le_popen,le_socket, le_stream);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", &type, 4, le_fopen, le_popen, le_socket, le_stream);
ZEND_VERIFY_RESOURCE(what);
#if HAVE_PHP_STREAM
@ -1385,7 +1385,7 @@ PHP_FUNCTION(fflush)
PHP_FUNCTION(set_file_buffer)
{
pval **arg1, **arg2;
int ret,type,buff;
int ret, type, buff;
void *what;
switch (ARG_COUNT(ht)) {
@ -1402,7 +1402,7 @@ PHP_FUNCTION(set_file_buffer)
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",&type,2,le_fopen,le_popen);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", &type, 2, le_fopen, le_popen);
ZEND_VERIFY_RESOURCE(what);
convert_to_long_ex(arg2);
@ -1432,7 +1432,7 @@ PHP_FUNCTION(rewind)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",NULL,2,le_fopen,le_popen);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", NULL, 2, le_fopen, le_popen);
ZEND_VERIFY_RESOURCE(what);
rewind((FILE*) what);
@ -1454,7 +1454,7 @@ PHP_FUNCTION(ftell)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",NULL,2,le_fopen,le_popen);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", NULL, 2, le_fopen, le_popen);
ZEND_VERIFY_RESOURCE(what);
ret = ftell((FILE*) what);
@ -1481,7 +1481,7 @@ PHP_FUNCTION(fseek)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",NULL,2,le_fopen,le_popen);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", NULL, 2, le_fopen, le_popen);
ZEND_VERIFY_RESOURCE(what);
convert_to_long_ex(arg2);
@ -1514,7 +1514,7 @@ PHP_FUNCTION(mkdir)
}
ret = VCWD_MKDIR((*arg1)->value.str.val, mode);
if (ret < 0) {
php_error(E_WARNING,"MkDir failed (%s)", strerror(errno));
php_error(E_WARNING, "MkDir failed (%s)", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@ -1538,7 +1538,7 @@ PHP_FUNCTION(rmdir)
}
ret = VCWD_RMDIR((*arg1)->value.str.val);
if (ret < 0) {
php_error(E_WARNING,"RmDir failed (%s)", strerror(errno));
php_error(E_WARNING, "RmDir failed (%s)", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@ -1610,12 +1610,12 @@ PHP_FUNCTION(readfile)
/* check args */
switch (ARG_COUNT(ht)) {
case 1:
if (zend_get_parameters_ex(1,&arg1) == FAILURE) {
if (zend_get_parameters_ex(1, &arg1) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 2:
if (zend_get_parameters_ex(2,&arg1,&arg2) == FAILURE) {
if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg2);
@ -1630,12 +1630,12 @@ PHP_FUNCTION(readfile)
* We need a better way of returning error messages from
* php_fopen_wrapper().
*/
fp = php_fopen_wrapper((*arg1)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
fp = php_fopen_wrapper((*arg1)->value.str.val, "rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd){
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"readfile(\"%s\") - %s", tmp, strerror(errno));
php_error(E_WARNING, "readfile(\"%s\") - %s", tmp, strerror(errno));
efree(tmp);
}
RETURN_FALSE;
@ -1644,9 +1644,9 @@ PHP_FUNCTION(readfile)
if (issock) {
int *sock=emalloc(sizeof(int));
*sock = socketd;
rsrc_id = ZEND_REGISTER_RESOURCE(NULL,sock,php_file_le_socket());
rsrc_id = ZEND_REGISTER_RESOURCE(NULL, sock, php_file_le_socket());
} else {
rsrc_id = ZEND_REGISTER_RESOURCE(NULL,fp,php_file_le_fopen());
rsrc_id = ZEND_REGISTER_RESOURCE(NULL, fp, php_file_le_fopen());
}
size = php_passthru_fd(socketd, fp, issock TSRMLS_CC);
@ -1700,7 +1700,7 @@ PHP_FUNCTION(fpassthru)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",&type,3,le_fopen,le_popen,le_socket);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", &type, 3, le_fopen, le_popen, le_socket);
ZEND_VERIFY_RESOURCE(what);
if (type == le_socket) {
@ -1740,7 +1740,7 @@ PHP_FUNCTION(rename)
ret = VCWD_RENAME(old_name, new_name);
if (ret == -1) {
php_error(E_WARNING,"Rename failed (%s)", strerror(errno));
php_error(E_WARNING, "Rename failed (%s)", strerror(errno));
RETURN_FALSE;
}
@ -1789,7 +1789,7 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(fp TSRMLS_CC,-1,"File-Handle",&type,3,le_fopen,le_popen,le_socket);
what = zend_fetch_resource(fp TSRMLS_CC,-1, "File-Handle", &type, 3, le_fopen, le_popen, le_socket);
ZEND_VERIFY_RESOURCE(what);
if (type == le_socket)
@ -1810,21 +1810,21 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
PHP_NAMED_FUNCTION(php_if_fstat)
{
zval **fp;
zval *stat_dev,*stat_ino,*stat_mode,*stat_nlink,*stat_uid,*stat_gid,*stat_rdev,
zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid, *stat_gid, *stat_rdev,
*stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks;
int type;
void *what;
struct stat stat_sb;
char *stat_sb_names[13]={"dev","ino","mode","nlink","uid","gid","rdev",
"size","atime","mtime","ctime","blksize","blocks"};
char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev",
"size", "atime", "mtime", "ctime", "blksize", "blocks"};
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &fp) == FAILURE) {
WRONG_PARAM_COUNT;
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(fp TSRMLS_CC,-1,"File-Handle",&type,3,le_fopen,le_popen,le_socket);
what = zend_fetch_resource(fp TSRMLS_CC,-1, "File-Handle", &type, 3, le_fopen, le_popen, le_socket);
ZEND_VERIFY_RESOURCE(what);
if (fstat(fileno((FILE *) what ), &stat_sb)) {
@ -1859,34 +1859,34 @@ PHP_NAMED_FUNCTION(php_if_fstat)
MAKE_LONG_ZVAL_INCREF(stat_blocks,-1);
#endif
/* Store numeric indexes in propper order */
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_dev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_ino, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_mode, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_nlink, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_uid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_gid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_rdev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_size, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_atime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_mtime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_ctime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_blksize, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_blocks, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_dev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_ino, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_mode, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_nlink, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_uid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_gid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_rdev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_size, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_atime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_mtime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_ctime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blksize, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blocks, sizeof(zval *), NULL);
/* Store string indexes referencing the same zval*/
zend_hash_update(HASH_OF(return_value),stat_sb_names[0],strlen(stat_sb_names[0])+1,(void *)&stat_dev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[1],strlen(stat_sb_names[1])+1,(void *)&stat_ino, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[2],strlen(stat_sb_names[2])+1,(void *)&stat_mode, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[3],strlen(stat_sb_names[3])+1,(void *)&stat_nlink, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[4],strlen(stat_sb_names[4])+1,(void *)&stat_uid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[5],strlen(stat_sb_names[5])+1,(void *)&stat_gid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[6],strlen(stat_sb_names[6])+1,(void *)&stat_rdev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[7],strlen(stat_sb_names[7])+1,(void *)&stat_size, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[8],strlen(stat_sb_names[8])+1,(void *)&stat_atime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[9],strlen(stat_sb_names[9])+1,(void *)&stat_mtime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[10],strlen(stat_sb_names[10])+1,(void *)&stat_ctime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[11],strlen(stat_sb_names[11])+1,(void *)&stat_blksize, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[12],strlen(stat_sb_names[12])+1,(void *)&stat_blocks, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *)&stat_dev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *)&stat_ino, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *)&stat_mode, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *)&stat_nlink, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *)&stat_uid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *)&stat_gid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *)&stat_rdev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *)&stat_size, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *)&stat_atime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *)&stat_mtime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *)&stat_ctime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *)&stat_blksize, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *)&stat_blocks, sizeof(zval *), NULL);
}
/* }}} */
@ -1934,7 +1934,7 @@ PHP_FUNCTION(copy)
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
{
char buffer[8192];
int fd_s,fd_t,read_bytes;
int fd_s, fd_t, read_bytes;
int ret = FAILURE;
#ifdef PHP_WIN32
@ -1942,7 +1942,7 @@ PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
#else
if ((fd_s=VCWD_OPEN(src, O_RDONLY))==-1) {
#endif
php_error(E_WARNING,"Unable to open '%s' for reading: %s", src, strerror(errno));
php_error(E_WARNING, "Unable to open '%s' for reading: %s", src, strerror(errno));
return FAILURE;
}
#ifdef PHP_WIN32
@ -1950,7 +1950,7 @@ PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
#else
if ((fd_t=VCWD_CREAT(dest, 0777))==-1) {
#endif
php_error(E_WARNING,"Unable to create '%s': %s", dest, strerror(errno));
php_error(E_WARNING, "Unable to create '%s': %s", dest, strerror(errno));
close(fd_s);
return FAILURE;
}
@ -1973,9 +1973,9 @@ PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
}
#endif
while ((read_bytes=read(fd_s,buffer,8192))!=-1 && read_bytes!=0) {
if (write(fd_t,buffer,read_bytes)==-1) {
php_error(E_WARNING,"Unable to write to '%s': %s", dest, strerror(errno));
while ((read_bytes=read(fd_s, buffer, 8192))!=-1 && read_bytes!=0) {
if (write(fd_t, buffer, read_bytes)==-1) {
php_error(E_WARNING, "Unable to write to '%s': %s", dest, strerror(errno));
goto cleanup;
}
}
@ -2004,7 +2004,7 @@ PHP_FUNCTION(fread)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(arg1 TSRMLS_CC,-1,"File-Handle",&type,3,le_fopen,le_popen,le_socket);
what = zend_fetch_resource(arg1 TSRMLS_CC,-1, "File-Handle", &type, 3, le_fopen, le_popen, le_socket);
ZEND_VERIFY_RESOURCE(what);
if (type == le_socket) {
@ -2034,7 +2034,7 @@ PHP_FUNCTION(fread)
}
return_value->value.str.val[return_value->value.str.len] = 0;
if (PG(magic_quotes_runtime)) {
return_value->value.str.val = php_addslashes(return_value->value.str.val,return_value->value.str.len,&return_value->value.str.len,1 TSRMLS_CC);
return_value->value.str.val = php_addslashes(return_value->value.str.val, return_value->value.str.len, &return_value->value.str.len, 1 TSRMLS_CC);
}
return_value->type = IS_STRING;
}
@ -2085,7 +2085,7 @@ PHP_FUNCTION(fgetcsv)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(fd TSRMLS_CC,-1,"File-Handle",&type,3,le_fopen,le_popen,le_socket);
what = zend_fetch_resource(fd TSRMLS_CC,-1, "File-Handle", &type, 3, le_fopen, le_popen, le_socket);
ZEND_VERIFY_RESOURCE(what);
if (type == le_socket) {
@ -2165,10 +2165,10 @@ PHP_FUNCTION(fgetcsv)
if (*bptr == 0) { /* embedded line end? */
*(tptr-1)=0; /* remove space character added on reading line */
strcat(temp,lineEnd); /* add the embedded line end to the field */
strcat(temp, lineEnd); /* add the embedded line end to the field */
/* read a new line from input, as at start of routine */
memset(buf,0,len+1);
memset(buf, 0, len+1);
if (FP_FGETS(buf, len, socketd, (FILE*)what, issock) == NULL) {
efree(lineEnd); efree(temp); efree(buf);
zval_dtor(return_value);
@ -2254,7 +2254,7 @@ PHP_FUNCTION(fd_set)
WRONG_PARAM_COUNT;
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(arg TSRMLS_CC,-1,"select",&type,3,le_fopen,le_socket,le_popen);
what = zend_fetch_resource(arg TSRMLS_CC,-1, "select", &type, 3, le_fopen, le_socket, le_popen);
ZEND_VERIFY_RESOURCE(what);
if(type == le_socket) {
fd = *(int *)what;
@ -2275,7 +2275,7 @@ PHP_FUNCTION(fd_set)
FD_ZERO(&readfd);
for(i = 0; i < ARG_COUNT(ht); i++) {
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(*args TSRMLS_CC,-1,"select",&type,3,le_fopen,le_socket,le_popen);
what = zend_fetch_resource(*args TSRMLS_CC,-1, "select", &type, 3, le_fopen, le_socket, le_popen);
ZEND_VERIFY_RESOURCE(what);
if(type == le_socket) {
fd = *(int *)what;
@ -2308,7 +2308,7 @@ PHP_FUNCTION(select)
tv.tv_usec = (*timeout)->value.lval % 1000000;
/* XXX: add stream support --Wez. */
RETURN_LONG(select(max_fd + 1,&readfd,NULL,NULL,((*timeout)->value.lval <= 0) ? NULL : &tv));
RETURN_LONG(select(max_fd + 1, &readfd, NULL, NULL, ((*timeout)->value.lval <= 0) ? NULL : &tv));
}
/* }}} */
@ -2325,7 +2325,7 @@ PHP_FUNCTION(fd_isset)
}
/* XXX: add stream support --Wez. */
what = zend_fetch_resource(fdarg TSRMLS_CC,-1,"select",&type,3,le_fopen,le_socket,le_popen);
what = zend_fetch_resource(fdarg TSRMLS_CC,-1, "select", &type, 3, le_fopen, le_socket, le_popen);
ZEND_VERIFY_RESOURCE(what);
if(type == le_socket) {
@ -2334,7 +2334,7 @@ PHP_FUNCTION(fd_isset)
fd = fileno((FILE *)what);
}
if(FD_ISSET(fd,&readfd)) {
if(FD_ISSET(fd, &readfd)) {
RETURN_TRUE;
}
RETURN_FALSE;
@ -2386,11 +2386,11 @@ php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
int ch = 0, compliment;
char buff[META_DEF_BUFSIZE + 1];
memset((void *)buff,0,META_DEF_BUFSIZE + 1);
memset((void *)buff, 0, META_DEF_BUFSIZE + 1);
while (md->ulc || (!FP_FEOF(md->socketd,md->fp,md->issock) && (ch = FP_FGETC(md->socketd,md->fp,md->issock)))) {
while (md->ulc || (!FP_FEOF(md->socketd, md->fp, md->issock) && (ch = FP_FGETC(md->socketd, md->fp, md->issock)))) {
if(FP_FEOF(md->socketd,md->fp,md->issock))
if(FP_FEOF(md->socketd, md->fp, md->issock))
break;
if (md->ulc) {
@ -2415,8 +2415,8 @@ php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
case '"':
compliment = ch;
md->token_len = 0;
while (!FP_FEOF(md->socketd,md->fp,md->issock) &&
(ch = FP_FGETC(md->socketd,md->fp,md->issock)) &&
while (!FP_FEOF(md->socketd, md->fp, md->issock) &&
(ch = FP_FGETC(md->socketd, md->fp, md->issock)) &&
ch != compliment && ch != '<' && ch != '>') {
buff[(md->token_len)++] = ch;
@ -2434,7 +2434,7 @@ php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
/* We don't need to alloc unless we are in a meta tag */
if (md->in_meta) {
md->token_data = (char *) emalloc(md->token_len + 1);
memcpy(md->token_data,buff,md->token_len+1);
memcpy(md->token_data, buff, md->token_len+1);
}
return TOK_STRING;
@ -2450,9 +2450,9 @@ php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
if (isalnum(ch)) {
md->token_len = 0;
buff[(md->token_len)++] = ch;
while (!FP_FEOF(md->socketd,md->fp,md->issock) &&
(ch = FP_FGETC(md->socketd,md->fp,md->issock)) &&
(isalnum(ch) || strchr(PHP_META_HTML401_CHARS,ch))) {
while (!FP_FEOF(md->socketd, md->fp, md->issock) &&
(ch = FP_FGETC(md->socketd, md->fp, md->issock)) &&
(isalnum(ch) || strchr(PHP_META_HTML401_CHARS, ch))) {
buff[(md->token_len)++] = ch;
@ -2467,7 +2467,7 @@ php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
}
md->token_data = (char *) emalloc(md->token_len + 1);
memcpy(md->token_data,buff,md->token_len+1);
memcpy(md->token_data, buff, md->token_len+1);
return TOK_ID;
} else {

View file

@ -154,7 +154,7 @@ PHP_FUNCTION(disk_total_space)
double bytestotal = 0;
#endif /* WINDOWS */
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1,&path)==FAILURE) {
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &path)==FAILURE) {
WRONG_PARAM_COUNT;
}
@ -207,7 +207,7 @@ PHP_FUNCTION(disk_total_space)
}
#else /* WINDOWS, OS/2 */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
if (statvfs((*path)->value.str.val,&buf)) RETURN_FALSE;
if (statvfs((*path)->value.str.val, &buf)) RETURN_FALSE;
if (buf.f_frsize) {
bytestotal = (((double)buf.f_blocks) * ((double)buf.f_frsize));
} else {
@ -215,7 +215,7 @@ PHP_FUNCTION(disk_total_space)
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs((*path)->value.str.val,&buf)) RETURN_FALSE;
if (statfs((*path)->value.str.val, &buf)) RETURN_FALSE;
bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks));
#endif
#endif /* WINDOWS */
@ -257,7 +257,7 @@ PHP_FUNCTION(disk_free_space)
double bytesfree = 0;
#endif /* WINDOWS */
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1,&path)==FAILURE) {
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &path)==FAILURE) {
WRONG_PARAM_COUNT;
}
@ -310,14 +310,14 @@ PHP_FUNCTION(disk_free_space)
}
#else /* WINDOWS, OS/2 */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
if (statvfs((*path)->value.str.val,&buf)) RETURN_FALSE;
if (statvfs((*path)->value.str.val, &buf)) RETURN_FALSE;
if (buf.f_frsize) {
bytesfree = (((double)buf.f_bavail) * ((double)buf.f_frsize));
} else {
bytesfree = (((double)buf.f_bavail) * ((double)buf.f_bsize));
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs((*path)->value.str.val,&buf)) RETURN_FALSE;
if (statfs((*path)->value.str.val, &buf)) RETURN_FALSE;
bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bavail));
#endif
#endif /* WINDOWS */
@ -336,7 +336,7 @@ PHP_FUNCTION(chgrp)
struct group *gr=NULL;
int ret;
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2,&filename,&group)==FAILURE) {
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &filename, &group)==FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(filename);
@ -384,7 +384,7 @@ PHP_FUNCTION(chown)
uid_t uid;
struct passwd *pw = NULL;
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2,&filename,&user)==FAILURE) {
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &filename, &user)==FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(filename);
@ -428,7 +428,7 @@ PHP_FUNCTION(chmod)
int ret;
mode_t imode;
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2,&filename,&mode)==FAILURE) {
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &filename, &mode)==FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(filename);
@ -472,7 +472,7 @@ PHP_FUNCTION(touch)
struct utimbuf *newtime = NULL;
int ac = ZEND_NUM_ARGS();
if (ac == 1 && zend_get_parameters_ex(1,&filename) != FAILURE) {
if (ac == 1 && zend_get_parameters_ex(1, &filename) != FAILURE) {
#ifndef HAVE_UTIME_NULL
newtime = (struct utimbuf *)emalloc(sizeof(struct utimbuf));
if (!newtime) {
@ -482,7 +482,7 @@ PHP_FUNCTION(touch)
newtime->actime = time(NULL);
newtime->modtime = newtime->actime;
#endif
} else if (ac == 2 && zend_get_parameters_ex(2,&filename,&filetime) != FAILURE) {
} else if (ac == 2 && zend_get_parameters_ex(2, &filename, &filetime) != FAILURE) {
newtime = (struct utimbuf *)emalloc(sizeof(struct utimbuf));
if (!newtime) {
php_error(E_WARNING, "unable to emalloc memory for changing time");
@ -550,12 +550,12 @@ PHP_FUNCTION(clearstatcache)
*/
static void php_stat(const char *filename, php_stat_len filename_length, int type, pval *return_value)
{
zval *stat_dev,*stat_ino,*stat_mode,*stat_nlink,*stat_uid,*stat_gid,*stat_rdev,
zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid, *stat_gid, *stat_rdev,
*stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks;
struct stat *stat_sb;
int rmask=S_IROTH,wmask=S_IWOTH,xmask=S_IXOTH; /* access rights defaults to other */
char *stat_sb_names[13]={"dev","ino","mode","nlink","uid","gid","rdev",
"size","atime","mtime","ctime","blksize","blocks"};
int rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access rights defaults to other */
char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev",
"size", "atime", "mtime", "ctime", "blksize", "blocks"};
TSRMLS_FETCH();
stat_sb = &BG(sb);
@ -606,13 +606,13 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
wmask=S_IWGRP;
xmask=S_IXGRP;
} else {
int groups,n,i;
int groups, n, i;
gid_t *gids;
groups = getgroups(0,NULL);
groups = getgroups(0, NULL);
if(groups) {
gids=(gid_t *)emalloc(groups*sizeof(gid_t));
n=getgroups(groups,gids);
n=getgroups(groups, gids);
for(i=0;i<n;i++){
if(BG(sb).st_gid==gids[i]) {
rmask=S_IRGRP;
@ -646,20 +646,20 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
case FS_TYPE:
#if HAVE_SYMLINK
if (S_ISLNK(BG(lsb).st_mode)) {
RETURN_STRING("link",1);
RETURN_STRING("link", 1);
}
#endif
switch(BG(sb).st_mode&S_IFMT) {
case S_IFIFO: RETURN_STRING("fifo",1);
case S_IFCHR: RETURN_STRING("char",1);
case S_IFDIR: RETURN_STRING("dir",1);
case S_IFBLK: RETURN_STRING("block",1);
case S_IFREG: RETURN_STRING("file",1);
case S_IFIFO: RETURN_STRING("fifo", 1);
case S_IFCHR: RETURN_STRING("char", 1);
case S_IFDIR: RETURN_STRING("dir", 1);
case S_IFBLK: RETURN_STRING("block", 1);
case S_IFREG: RETURN_STRING("file", 1);
#if defined(S_IFSOCK) && !defined(ZEND_WIN32)&&!defined(__BEOS__)
case S_IFSOCK: RETURN_STRING("socket",1);
case S_IFSOCK: RETURN_STRING("socket", 1);
#endif
}
php_error(E_WARNING,"Unknown file type (%d)",BG(sb).st_mode&S_IFMT);
php_error(E_WARNING, "Unknown file type (%d)", BG(sb).st_mode&S_IFMT);
RETURN_STRING("unknown", 1);
case FS_IS_W:
if (getuid()==0) {
@ -724,34 +724,34 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
MAKE_LONG_ZVAL_INCREF(stat_blocks,-1);
#endif
/* Store numeric indexes in propper order */
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_dev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_ino, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_mode, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_nlink, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_uid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_gid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_rdev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_size, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_atime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_mtime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_ctime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_blksize, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value),(void *)&stat_blocks, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_dev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_ino, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_mode, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_nlink, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_uid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_gid, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_rdev, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_size, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_atime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_mtime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_ctime, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blksize, sizeof(zval *), NULL);
zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_blocks, sizeof(zval *), NULL);
/* Store string indexes referencing the same zval*/
zend_hash_update(HASH_OF(return_value),stat_sb_names[0],strlen(stat_sb_names[0])+1,(void *)&stat_dev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[1],strlen(stat_sb_names[1])+1,(void *)&stat_ino, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[2],strlen(stat_sb_names[2])+1,(void *)&stat_mode, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[3],strlen(stat_sb_names[3])+1,(void *)&stat_nlink, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[4],strlen(stat_sb_names[4])+1,(void *)&stat_uid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[5],strlen(stat_sb_names[5])+1,(void *)&stat_gid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[6],strlen(stat_sb_names[6])+1,(void *)&stat_rdev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[7],strlen(stat_sb_names[7])+1,(void *)&stat_size, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[8],strlen(stat_sb_names[8])+1,(void *)&stat_atime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[9],strlen(stat_sb_names[9])+1,(void *)&stat_mtime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[10],strlen(stat_sb_names[10])+1,(void *)&stat_ctime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[11],strlen(stat_sb_names[11])+1,(void *)&stat_blksize, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value),stat_sb_names[12],strlen(stat_sb_names[12])+1,(void *)&stat_blocks, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[0], strlen(stat_sb_names[0])+1, (void *) &stat_dev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[1], strlen(stat_sb_names[1])+1, (void *) &stat_ino, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[2], strlen(stat_sb_names[2])+1, (void *) &stat_mode, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[3], strlen(stat_sb_names[3])+1, (void *) &stat_nlink, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[4], strlen(stat_sb_names[4])+1, (void *) &stat_uid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[5], strlen(stat_sb_names[5])+1, (void *) &stat_gid, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[6], strlen(stat_sb_names[6])+1, (void *) &stat_rdev, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[7], strlen(stat_sb_names[7])+1, (void *) &stat_size, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[8], strlen(stat_sb_names[8])+1, (void *) &stat_atime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[9], strlen(stat_sb_names[9])+1, (void *) &stat_mtime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[10], strlen(stat_sb_names[10])+1, (void *) &stat_ctime, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[11], strlen(stat_sb_names[11])+1, (void *) &stat_blksize, sizeof(zval *), NULL);
zend_hash_update(HASH_OF(return_value), stat_sb_names[12], strlen(stat_sb_names[12])+1, (void *) &stat_blocks, sizeof(zval *), NULL);
return;
}
@ -773,12 +773,12 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
/* {{{ proto int fileperms(string filename)
Get file permissions */
FileFunction(PHP_FN(fileperms),FS_PERMS)
FileFunction(PHP_FN(fileperms), FS_PERMS)
/* }}} */
/* {{{ proto int fileinode(string filename)
Get file inode */
FileFunction(PHP_FN(fileinode),FS_INODE)
FileFunction(PHP_FN(fileinode), FS_INODE)
/* }}} */
/* {{{ proto int filesize(string filename)
@ -788,27 +788,27 @@ FileFunction(PHP_FN(filesize), FS_SIZE)
/* {{{ proto int fileowner(string filename)
Get file owner */
FileFunction(PHP_FN(fileowner),FS_OWNER)
FileFunction(PHP_FN(fileowner), FS_OWNER)
/* }}} */
/* {{{ proto int filegroup(string filename)
Get file group */
FileFunction(PHP_FN(filegroup),FS_GROUP)
FileFunction(PHP_FN(filegroup), FS_GROUP)
/* }}} */
/* {{{ proto int fileatime(string filename)
Get last access time of file */
FileFunction(PHP_FN(fileatime),FS_ATIME)
FileFunction(PHP_FN(fileatime), FS_ATIME)
/* }}} */
/* {{{ proto int filemtime(string filename)
Get last modification time of file */
FileFunction(PHP_FN(filemtime),FS_MTIME)
FileFunction(PHP_FN(filemtime), FS_MTIME)
/* }}} */
/* {{{ proto int filectime(string filename)
Get inode modification time of file */
FileFunction(PHP_FN(filectime),FS_CTIME)
FileFunction(PHP_FN(filectime), FS_CTIME)
/* }}} */
/* {{{ proto string filetype(string filename)
@ -823,32 +823,32 @@ FileFunction(PHP_FN(is_writable), FS_IS_W)
/* {{{ proto int is_readable(string filename)
Returns true if file can be read */
FileFunction(PHP_FN(is_readable),FS_IS_R)
FileFunction(PHP_FN(is_readable), FS_IS_R)
/* }}} */
/* {{{ proto int is_executable(string filename)
Returns true if file is executable */
FileFunction(PHP_FN(is_executable),FS_IS_X)
FileFunction(PHP_FN(is_executable), FS_IS_X)
/* }}} */
/* {{{ proto int is_file(string filename)
Returns true if file is a regular file */
FileFunction(PHP_FN(is_file),FS_IS_FILE)
FileFunction(PHP_FN(is_file), FS_IS_FILE)
/* }}} */
/* {{{ proto int is_dir(string filename)
Returns true if file is directory */
FileFunction(PHP_FN(is_dir),FS_IS_DIR)
FileFunction(PHP_FN(is_dir), FS_IS_DIR)
/* }}} */
/* {{{ proto int is_link(string filename)
Returns true if file is symbolic link */
FileFunction(PHP_FN(is_link),FS_IS_LINK)
FileFunction(PHP_FN(is_link), FS_IS_LINK)
/* }}} */
/* {{{ proto bool file_exists(string filename)
Returns true if filename exists */
FileFunction(PHP_FN(file_exists),FS_EXISTS)
FileFunction(PHP_FN(file_exists), FS_EXISTS)
/* }}} */
/* {{{ proto array lstat(string filename)
@ -858,7 +858,7 @@ FileFunction(php_if_lstat, FS_LSTAT)
/* {{{ proto array stat(string filename)
Give information about a file */
FileFunction(php_if_stat,FS_SIZE)
FileFunction(php_if_stat, FS_SIZE)
/* }}} */
/*

View file

@ -32,7 +32,7 @@ int flock(int fd, int operation);
#ifdef PHP_WIN32
#define EWOULDBLOCK WSAEWOULDBLOCK
# define fsync _commit
# define ftruncate(a,b) chsize(a,b)
# define ftruncate(a, b) chsize(a, b)
#endif /* defined(PHP_WIN32) */
#if !HAVE_INET_ATON

View file

@ -463,7 +463,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
if (currarg >= argc && format[inpos + 1] != '%') {
efree(result);
efree(args);
php_error(E_WARNING, "%s(): too few arguments",get_active_function_name(TSRMLS_C));
php_error(E_WARNING, "%s(): too few arguments", get_active_function_name(TSRMLS_C));
return NULL;
}
/* starting a new format specifier, reset variables */
@ -652,7 +652,7 @@ PHP_FUNCTION(user_sprintf)
if ((result=php_formatted_print(ht, &len, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
}
RETVAL_STRINGL(result,len,1);
RETVAL_STRINGL(result, len, 1);
efree(result);
}
/* }}} */
@ -667,7 +667,7 @@ PHP_FUNCTION(vsprintf)
if ((result=php_formatted_print(ht, &len, 1 TSRMLS_CC))==NULL) {
RETURN_FALSE;
}
RETVAL_STRINGL(result,len,1);
RETVAL_STRINGL(result, len, 1);
efree(result);
}
/* }}} */
@ -682,7 +682,7 @@ PHP_FUNCTION(user_printf)
if ((result=php_formatted_print(ht, &len, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
}
PHPWRITE(result,len);
PHPWRITE(result, len);
efree(result);
}
/* }}} */
@ -697,7 +697,7 @@ PHP_FUNCTION(vprintf)
if ((result=php_formatted_print(ht, &len, 1 TSRMLS_CC))==NULL) {
RETURN_FALSE;
}
PHPWRITE(result,len);
PHPWRITE(result, len);
efree(result);
}
/* }}} */

View file

@ -161,7 +161,7 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
unsigned long conv;
char *key = NULL;
if (arg_count > 5 || arg_count < 2 || zend_get_parameters_array_ex(arg_count,args)==FAILURE) {
if (arg_count > 5 || arg_count < 2 || zend_get_parameters_array_ex(arg_count, args)==FAILURE) {
CLOSE_SOCK(1);
WRONG_PARAM_COUNT;
}
@ -174,11 +174,11 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
/* fall-through */
case 4:
zval_dtor(*args[3]);
ZVAL_STRING(*args[3],"",1);
ZVAL_STRING(*args[3], "", 1);
/* fall-through */
case 3:
zval_dtor(*args[2]);
ZVAL_LONG(*args[2],0);
ZVAL_LONG(*args[2], 0);
break;
}
convert_to_string_ex(args[0]);
@ -192,7 +192,7 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
(void *) &sockp) == SUCCESS) {
CLOSE_SOCK(0);
*sock = *sockp;
ZEND_REGISTER_RESOURCE(return_value,sock,php_file_le_socket());
ZEND_REGISTER_RESOURCE(return_value, sock, php_file_le_socket());
return;
}
@ -204,7 +204,7 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
udp = 1;
}
socketd = socket(AF_INET,udp ? SOCK_DGRAM : SOCK_STREAM,0);
socketd = socket(AF_INET, udp ? SOCK_DGRAM : SOCK_STREAM, 0);
if (socketd == SOCK_ERR) {
CLOSE_SOCK(1);
@ -213,7 +213,7 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
server.sin_family = AF_INET;
if(php_lookup_hostname(udp ? &(*args[0])->value.str.val[6] : (*args[0])->value.str.val,&server.sin_addr)) {
if(php_lookup_hostname(udp ? &(*args[0])->value.str.val[6] : (*args[0])->value.str.val, &server.sin_addr)) {
CLOSE_SOCK(1);
RETURN_FALSE;
}
@ -225,11 +225,11 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
if (arg_count>2) {
zval_dtor(*args[2]);
ZVAL_LONG(*args[2],errno);
ZVAL_LONG(*args[2], errno);
}
if (arg_count>3) {
zval_dtor(*args[3]);
ZVAL_STRING(*args[3],strerror(errno),1);
ZVAL_STRING(*args[3], strerror(errno), 1);
}
RETURN_FALSE;
}
@ -237,7 +237,7 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
} else {
/* Unix domain socket. s->strval is socket name. */
struct sockaddr_un unix_addr;
socketd = socket(AF_UNIX,SOCK_STREAM,0);
socketd = socket(AF_UNIX, SOCK_STREAM, 0);
if (socketd == SOCK_ERR) {
CLOSE_SOCK(1);
RETURN_FALSE;
@ -251,11 +251,11 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
CLOSE_SOCK(1);
if (arg_count>2) {
zval_dtor(*args[2]);
ZVAL_LONG(*args[2],errno);
ZVAL_LONG(*args[2], errno);
}
if (arg_count>3) {
zval_dtor(*args[3]);
ZVAL_STRING(*args[3],strerror(errno),1);
ZVAL_STRING(*args[3], strerror(errno), 1);
}
RETURN_FALSE;
}
@ -283,7 +283,7 @@ static void php_fsockopen(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
}
if(key) efree(key);
ZEND_REGISTER_RESOURCE(return_value,sock,php_file_le_socket());
ZEND_REGISTER_RESOURCE(return_value, sock, php_file_le_socket());
}
/* }}} */
@ -325,7 +325,7 @@ PHPAPI void php_cleanup_sockbuf(int persistent TSRMLS_DC)
#define TOREAD(sock) ((sock)->writepos - (sock)->readpos)
#define READPTR(sock) ((sock)->readbuf + (sock)->readpos)
#define WRITEPTR(sock) ((sock)->readbuf + (sock)->writepos)
#define SOCK_FIND(sock,socket) \
#define SOCK_FIND(sock, socket) \
php_sockbuf *sock; \
TSRMLS_FETCH(); \
sock = php_sockfind(socket TSRMLS_CC); \

View file

@ -216,7 +216,7 @@ FILE *php_fopen_url_wrap_ftp(const char *path, char *mode, int options, int *iss
/* make sure we got a 227 response */
if (strncmp(tmp_line, "227", 3))
goto errexit;
/* parse pasv command (129,80,95,25,13,221) */
/* parse pasv command (129, 80, 95, 25, 13, 221) */
tpath = tmp_line;
/* skip over the "227 Some message " part */
for (tpath += 4; *tpath && !isdigit((int) *tpath); tpath++);

View file

@ -70,7 +70,7 @@ PHPAPI int php_header()
/* php_set_cookie(name,value,expires,path,domain,secure) */
/* php_set_cookie(name, value, expires, path, domain, secure) */
/* {{{ proto void setcookie(string name [, string value [, int expires [, string path [, string domain [, string secure]]]]])
Send a cookie */
PHP_FUNCTION(setcookie)

View file

@ -48,21 +48,21 @@ static entity_table_t ent_cp_1252[] = {
};
static entity_table_t ent_iso_8859_1[] = {
"nbsp","iexcl","cent","pound","curren","yen","brvbar",
"sect","uml","copy","ordf","laquo","not","shy","reg",
"macr","deg","plusmn","sup2","sup3","acute","micro",
"para","middot","cedil","sup1","ordm","raquo","frac14",
"frac12","frac34","iquest","Agrave","Aacute","Acirc",
"Atilde","Auml","Aring","AElig","Ccedil","Egrave",
"Eacute","Ecirc","Euml","Igrave","Iacute","Icirc",
"Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde",
"Ouml","times","Oslash","Ugrave","Uacute","Ucirc","Uuml",
"Yacute","THORN","szlig","agrave","aacute","acirc",
"atilde","auml","aring","aelig","ccedil","egrave",
"eacute","ecirc","euml","igrave","iacute","icirc",
"iuml","eth","ntilde","ograve","oacute","ocirc","otilde",
"ouml","divide","oslash","ugrave","uacute","ucirc",
"uuml","yacute","thorn","yuml"
"nbsp", "iexcl", "cent", "pound", "curren", "yen", "brvbar",
"sect", "uml", "copy", "ordf", "laquo", "not", "shy", "reg",
"macr", "deg", "plusmn", "sup2", "sup3", "acute", "micro",
"para", "middot", "cedil", "sup1", "ordm", "raquo", "frac14",
"frac12", "frac34", "iquest", "Agrave", "Aacute", "Acirc",
"Atilde", "Auml", "Aring", "AElig", "Ccedil", "Egrave",
"Eacute", "Ecirc", "Euml", "Igrave", "Iacute", "Icirc",
"Iuml", "ETH", "Ntilde", "Ograve", "Oacute", "Ocirc", "Otilde",
"Ouml", "times", "Oslash", "Ugrave", "Uacute", "Ucirc", "Uuml",
"Yacute", "THORN", "szlig", "agrave", "aacute", "acirc",
"atilde", "auml", "aring", "aelig", "ccedil", "egrave",
"eacute", "ecirc", "euml", "igrave", "iacute", "icirc",
"iuml", "eth", "ntilde", "ograve", "oacute", "ocirc", "otilde",
"ouml", "divide", "oslash", "ugrave", "uacute", "ucirc",
"uuml", "yacute", "thorn", "yuml"
};
static entity_table_t ent_iso_8859_15[] = {
@ -72,15 +72,15 @@ static entity_table_t ent_iso_8859_15[] = {
"micro", "para", "middot", NULL, /* zcaron */ "sup1", "ordm",
"raquo", "OElig", "oelig", "Yuml", "iquest", "Agrave", "Aacute",
"Acirc", "Atilde", "Auml", "Aring", "AElig", "Ccedil", "Egrave",
"Eacute","Ecirc","Euml","Igrave","Iacute","Icirc",
"Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde",
"Ouml","times","Oslash","Ugrave","Uacute","Ucirc","Uuml",
"Yacute","THORN","szlig","agrave","aacute","acirc",
"atilde","auml","aring","aelig","ccedil","egrave",
"eacute","ecirc","euml","igrave","iacute","icirc",
"iuml","eth","ntilde","ograve","oacute","ocirc","otilde",
"ouml","divide","oslash","ugrave","uacute","ucirc",
"uuml","yacute","thorn","yuml"
"Eacute", "Ecirc", "Euml", "Igrave", "Iacute", "Icirc",
"Iuml", "ETH", "Ntilde", "Ograve", "Oacute", "Ocirc", "Otilde",
"Ouml", "times", "Oslash", "Ugrave", "Uacute", "Ucirc", "Uuml",
"Yacute", "THORN", "szlig", "agrave", "aacute", "acirc",
"atilde", "auml", "aring", "aelig", "ccedil", "egrave",
"eacute", "ecirc", "euml", "igrave", "iacute", "icirc",
"iuml", "eth", "ntilde", "ograve", "oacute", "ocirc", "otilde",
"ouml", "divide", "oslash", "ugrave", "uacute", "ucirc",
"uuml", "yacute", "thorn", "yuml"
};
struct html_entity_map {
@ -394,7 +394,7 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
new = php_escape_html_entities((*arg)->value.str.val, (*arg)->value.str.len, &len, all, quote_style, hint_charset);
RETVAL_STRINGL(new,len,0);
RETVAL_STRINGL(new, len, 0);
}
/* }}} */
@ -417,7 +417,7 @@ void register_html_constants(INIT_FUNC_ARGS)
Convert special characters to HTML entities */
PHP_FUNCTION(htmlspecialchars)
{
php_html_entities(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
php_html_entities(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
@ -425,7 +425,7 @@ PHP_FUNCTION(htmlspecialchars)
Convert all applicable characters to HTML entities */
PHP_FUNCTION(htmlentities)
{
php_html_entities(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
php_html_entities(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
@ -478,15 +478,15 @@ PHP_FUNCTION(get_html_translation_table)
/* break thru */
case HTML_SPECIALCHARS:
ind[0]=38; add_assoc_string(return_value,ind,"&amp;",1);
ind[0]=38; add_assoc_string(return_value, ind, "&amp;", 1);
if(quote_style&ENT_QUOTES) {
ind[0]=39; add_assoc_string(return_value,ind,"&#039;",1);
ind[0]=39; add_assoc_string(return_value, ind, "&#039;", 1);
}
if(!(quote_style&ENT_NOQUOTES)) {
ind[0]=34; add_assoc_string(return_value,ind,"&quot;",1);
ind[0]=34; add_assoc_string(return_value, ind, "&quot;", 1);
}
ind[0]=60; add_assoc_string(return_value,ind,"&lt;",1);
ind[0]=62; add_assoc_string(return_value,ind,"&gt;",1);
ind[0]=60; add_assoc_string(return_value, ind, "&lt;", 1);
ind[0]=62; add_assoc_string(return_value, ind, "&gt;", 1);
break;
}
}

View file

@ -74,14 +74,14 @@ static struct gfxinfo *php_handle_gif (int socketd, FILE *fp, int issock)
unsigned char a[2];
char temp[3];
result = (struct gfxinfo *) ecalloc(1,sizeof(struct gfxinfo));
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
FP_FREAD(temp, 3, socketd, fp, issock); /* fseek(fp, 6L, SEEK_SET); */
FP_FREAD(a, sizeof(a), socketd, fp, issock); /* fread(a,sizeof(a),1,fp); */
FP_FREAD(a, sizeof(a), socketd, fp, issock); /* fread(a, sizeof(a), 1, fp); */
result->width = (unsigned short)a[0] | (((unsigned short)a[1])<<8);
FP_FREAD(a, sizeof(a), socketd, fp, issock); /* fread(a,sizeof(a),1,fp); */
FP_FREAD(a, sizeof(a), socketd, fp, issock); /* fread(a, sizeof(a), 1, fp); */
result->height = (unsigned short)a[0] | (((unsigned short)a[1])<<8);
return result;
@ -97,7 +97,7 @@ static struct gfxinfo *php_handle_psd (int socketd, FILE *fp, int issock)
char temp[11];
unsigned long in_width, in_height;
result = (struct gfxinfo *) ecalloc(1,sizeof(struct gfxinfo));
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
FP_FREAD(temp, sizeof(temp), socketd, fp, issock);
if((FP_FREAD(a, sizeof(a), socketd, fp, issock)) <= 0) {
@ -165,7 +165,7 @@ static struct gfxinfo *php_handle_swf (int socketd, FILE *fp, int issock)
result = (struct gfxinfo *) ecalloc (1, sizeof (struct gfxinfo));
FP_FREAD(temp, 5, socketd, fp, issock); /* fseek(fp, 8L, SEEK_SET); */
FP_FREAD(a, sizeof(a), socketd, fp, issock); /* fread(a,sizeof(a),1,fp); */
FP_FREAD(a, sizeof(a), socketd, fp, issock); /* fread(a, sizeof(a), 1, fp); */
bits = php_swf_get_bits (a, 0, 5);
result->width = (php_swf_get_bits (a, 5 + bits, bits) -
php_swf_get_bits (a, 5, bits)) / 20;
@ -184,7 +184,7 @@ static struct gfxinfo *php_handle_png (int socketd, FILE *fp, int issock)
char temp[8];
unsigned char a[8];
result = (struct gfxinfo *) ecalloc(1,sizeof(struct gfxinfo));
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
FP_FREAD(temp, sizeof(temp), socketd, fp, issock); /* fseek(fp, 16L, SEEK_SET); */
@ -260,7 +260,7 @@ static unsigned int php_next_marker(int socketd, FILE *fp, int issock)
/* get marker byte, swallowing possible padding */
do {
if ((c = FP_FGETC(socketd,fp,issock)) == EOF)
if ((c = FP_FGETC(socketd, fp, issock)) == EOF)
return M_EOI; /* we hit EOF */
} while (c == 0xff);
@ -276,7 +276,7 @@ static void php_skip_variable(int socketd, FILE *fp, int issock)
unsigned short length;
char *tmp;
length = php_read2(socketd,fp,issock);
length = php_read2(socketd, fp, issock);
length -= 2; /* length includes itself */
tmp = emalloc(length);
@ -287,14 +287,14 @@ static void php_skip_variable(int socketd, FILE *fp, int issock)
/* {{{ php_read_APP
*/
static void php_read_APP(int socketd, FILE *fp, int issock,unsigned int marker,pval *info)
static void php_read_APP(int socketd, FILE *fp, int issock, unsigned int marker, pval *info)
{
unsigned short length;
unsigned char *buffer;
unsigned char markername[ 16 ];
zval *tmp;
length = php_read2(socketd,fp,issock);
length = php_read2(socketd, fp, issock);
length -= 2; /* length includes itself */
buffer = emalloc(length);
@ -304,11 +304,11 @@ static void php_read_APP(int socketd, FILE *fp, int issock,unsigned int marker,p
return;
}
sprintf(markername,"APP%d",marker - M_APP0);
sprintf(markername, "APP%d", marker - M_APP0);
if (zend_hash_find(info->value.ht, markername, strlen(markername)+1, (void **) &tmp) == FAILURE) {
/* XXX we onyl catch the 1st tag of it's kind! */
add_assoc_stringl(info,markername,buffer,length,1);
add_assoc_stringl(info, markername, buffer, length, 1);
}
efree(buffer);
@ -325,7 +325,7 @@ static struct gfxinfo *php_handle_jpeg (int socketd, FILE *fp, int issock, pval
unsigned char a[4];
for (;;) {
marker = php_next_marker(socketd,fp,issock);
marker = php_next_marker(socketd, fp, issock);
switch (marker) {
case M_SOF0:
case M_SOF1:
@ -342,18 +342,18 @@ static struct gfxinfo *php_handle_jpeg (int socketd, FILE *fp, int issock, pval
case M_SOF15:
if (result == NULL) {
/* handle SOFn block */
result = (struct gfxinfo *) ecalloc(1,sizeof(struct gfxinfo));
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
FP_FREAD(tmp, sizeof(tmp), socketd, fp, issock);
result->bits = FP_FGETC(socketd,fp,issock);
result->bits = FP_FGETC(socketd, fp, issock);
FP_FREAD(a, sizeof(a), socketd, fp, issock);
result->height = (((unsigned short) a[ 0 ]) << 8) + ((unsigned short) a[ 1 ]);
result->width = (((unsigned short) a[ 2 ]) << 8) + ((unsigned short) a[ 3 ]);
result->channels = FP_FGETC(socketd,fp,issock);
result->channels = FP_FGETC(socketd, fp, issock);
if (! info) /* if we don't want an extanded info -> return */
return result;
} else {
php_skip_variable(socketd,fp,issock);
php_skip_variable(socketd, fp, issock);
}
break;
@ -374,9 +374,9 @@ static struct gfxinfo *php_handle_jpeg (int socketd, FILE *fp, int issock, pval
case M_APP14:
case M_APP15:
if (info) {
php_read_APP(socketd,fp,issock,marker,info); /* read all the app markes... */
php_read_APP(socketd, fp, issock, marker, info); /* read all the app markes... */
} else {
php_skip_variable(socketd,fp,issock);
php_skip_variable(socketd, fp, issock);
}
break;
@ -386,7 +386,7 @@ static struct gfxinfo *php_handle_jpeg (int socketd, FILE *fp, int issock, pval
break;
default:
php_skip_variable(socketd,fp,issock); /* anything else isn't interesting */
php_skip_variable(socketd, fp, issock); /* anything else isn't interesting */
break;
}
}
@ -401,7 +401,7 @@ static struct gfxinfo *php_handle_jpeg (int socketd, FILE *fp, int issock, pval
Get the size of an image as 4-element array */
PHP_FUNCTION(getimagesize)
{
pval **arg1,**info = 0;
pval **arg1, **info = 0;
FILE *fp;
int issock=0, socketd=0, rsrc_id;
int itype = 0;
@ -442,7 +442,7 @@ PHP_FUNCTION(getimagesize)
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"getimagesize: Unable to open '%s' for reading.", tmp);
php_error(E_WARNING, "getimagesize: Unable to open '%s' for reading.", tmp);
efree(tmp);
}
RETURN_FALSE;
@ -451,13 +451,13 @@ PHP_FUNCTION(getimagesize)
if (issock) {
int *sock=emalloc(sizeof(int));
*sock = socketd;
rsrc_id = ZEND_REGISTER_RESOURCE(NULL,sock,php_file_le_socket());
rsrc_id = ZEND_REGISTER_RESOURCE(NULL, sock, php_file_le_socket());
} else {
rsrc_id = ZEND_REGISTER_RESOURCE(NULL,fp,php_file_le_fopen());
rsrc_id = ZEND_REGISTER_RESOURCE(NULL, fp, php_file_le_fopen());
}
if((FP_FREAD(filetype, 3, socketd, fp, issock)) <= 0) {
php_error(E_WARNING,"getimagesize: Read error!");
php_error(E_WARNING, "getimagesize: Read error!");
RETURN_FALSE;
}
@ -505,10 +505,10 @@ PHP_FUNCTION(getimagesize)
add_index_string(return_value, 3, temp, 1);
if (result->bits != 0) {
add_assoc_long(return_value,"bits",result->bits);
add_assoc_long(return_value, "bits", result->bits);
}
if (result->channels != 0) {
add_assoc_long(return_value,"channels",result->channels);
add_assoc_long(return_value, "channels", result->channels);
}
efree(result);
}

View file

@ -77,7 +77,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
zend_html_puts(string_key, strlen(string_key));
break;
case HASH_KEY_IS_LONG:
php_printf("%ld",num_key);
php_printf("%ld", num_key);
break;
}
PUTS("\"]</b></td><td>");
@ -108,10 +108,10 @@ void php_info_print_style(void)
php_printf("<style type=\"text/css\"><!--\n");
php_printf("a { text-decoration: none; }\n");
php_printf("a:hover { text-decoration: underline; }\n");
php_printf("h1 { font-family: arial,helvetica,sans-serif; font-size: 18pt; font-weight: bold;}\n");
php_printf("h2 { font-family: arial,helvetica,sans-serif; font-size: 14pt; font-weight: bold;}\n");
php_printf("body,td { font-family: arial,helvetica,sans-serif; font-size: 10pt; }\n");
php_printf("th { font-family: arial,helvetica,sans-serif; font-size: 11pt; font-weight: bold; }\n");
php_printf("h1 { font-family: arial, helvetica, sans-serif; font-size: 18pt; font-weight: bold;}\n");
php_printf("h2 { font-family: arial, helvetica, sans-serif; font-size: 14pt; font-weight: bold;}\n");
php_printf("body, td { font-family: arial, helvetica, sans-serif; font-size: 10pt; }\n");
php_printf("th { font-family: arial, helvetica, sans-serif; font-size: 11pt; font-weight: bold; }\n");
php_printf("//--></style>\n");
}
/* }}} */
@ -131,9 +131,9 @@ PHPAPI char *php_get_uname()
/* Get build numbers for Windows NT or Win95 */
if (dwVersion < 0x80000000){
dwBuild = (DWORD)(HIWORD(dwVersion));
snprintf(php_windows_uname,255,"%s %d.%d build %d","Windows NT",dwWindowsMajorVersion,dwWindowsMinorVersion,dwBuild);
snprintf(php_windows_uname, 255, "%s %d.%d build %d", "Windows NT", dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild);
} else {
snprintf(php_windows_uname,255,"%s %d.%d","Windows 95/98",dwWindowsMajorVersion,dwWindowsMinorVersion);
snprintf(php_windows_uname, 255, "%s %d.%d", "Windows 95/98", dwWindowsMajorVersion, dwWindowsMinorVersion);
}
php_uname = php_windows_uname;
#else
@ -147,7 +147,7 @@ PHPAPI char *php_get_uname()
*/
PHPAPI void php_print_info(int flag TSRMLS_DC)
{
char **env,*tmp1,*tmp2;
char **env, *tmp1, *tmp2;
char *php_uname;
int expose_php = INI_INT("expose_php");
time_t the_time;
@ -484,7 +484,7 @@ PHP_FUNCTION(phpinfo)
Return the current PHP version */
PHP_FUNCTION(phpversion)
{
RETURN_STRING(PHP_VERSION,1);
RETURN_STRING(PHP_VERSION, 1);
}
/* }}} */
@ -546,7 +546,7 @@ PHP_FUNCTION(zend_logo_guid)
PHP_FUNCTION(php_sapi_name)
{
if (sapi_module.name) {
RETURN_STRING(sapi_module.name,1);
RETURN_STRING(sapi_module.name, 1);
} else {
RETURN_FALSE;
}

View file

@ -75,7 +75,7 @@
/* {{{ php_iptc_put1
*/
static int php_iptc_put1(FILE *fp,int spool,unsigned char c,unsigned char **spoolbuf TSRMLS_DC)
static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf TSRMLS_DC)
{
if (spool > 0)
PUTC(c);
@ -88,7 +88,7 @@ static int php_iptc_put1(FILE *fp,int spool,unsigned char c,unsigned char **spoo
/* {{{ php_iptc_get1
*/
static int php_iptc_get1(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC)
static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
{
int c;
char cc;
@ -110,11 +110,11 @@ static int php_iptc_get1(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC)
/* {{{ php_iptc_read_remaining
*/
static int php_iptc_read_remaining(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC)
static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
{
int c;
while ((c = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) != EOF) continue;
while ((c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) != EOF) continue;
return M_EOI;
}
@ -122,21 +122,21 @@ static int php_iptc_read_remaining(FILE *fp,int spool,unsigned char **spoolbuf T
/* {{{ php_iptc_skip_variable
*/
static int php_iptc_skip_variable(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC)
static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
{
unsigned int length;
int c1,c2;
int c1, c2;
if ((c1 = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
if ((c1 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
if ((c2 = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
if ((c2 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
length = (((unsigned char) c1) << 8) + ((unsigned char) c2);
length -= 2;
while (length--)
if (php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC) == EOF) return M_EOI;
if (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) == EOF) return M_EOI;
return 0;
}
@ -144,29 +144,29 @@ static int php_iptc_skip_variable(FILE *fp,int spool,unsigned char **spoolbuf TS
/* {{{ php_iptc_next_marker
*/
static int php_iptc_next_marker(FILE *fp,int spool,unsigned char **spoolbuf TSRMLS_DC)
static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
{
int c;
/* skip unimportant stuff */
c = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC);
c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC);
if (c == EOF) return M_EOI;
while (c != 0xff) {
if ((c = php_iptc_get1(fp,spool,spoolbuf TSRMLS_CC)) == EOF)
if ((c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF)
return M_EOI; /* we hit EOF */
}
/* get marker byte, swallowing possible padding */
do {
c = php_iptc_get1(fp,0,0 TSRMLS_CC);
c = php_iptc_get1(fp, 0, 0 TSRMLS_CC);
if (c == EOF)
return M_EOI; /* we hit EOF */
else
if (c == 0xff)
php_iptc_put1(fp,spool,(unsigned char)c,spoolbuf TSRMLS_CC);
php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf TSRMLS_CC);
} while (c == 0xff);
return (unsigned int) c;
@ -183,7 +183,7 @@ PHP_FUNCTION(iptcembed)
FILE *fp;
unsigned int marker;
unsigned int spool = 0, done = 0, inx, len;
unsigned char *spoolbuf=0,*poi=0;
unsigned char *spoolbuf=0, *poi=0;
struct stat sb;
switch(ZEND_NUM_ARGS()){
@ -214,7 +214,7 @@ PHP_FUNCTION(iptcembed)
RETURN_FALSE;
}
if ((fp = VCWD_FOPEN((*jpeg_file)->value.str.val,"rb")) == 0) {
if ((fp = VCWD_FOPEN((*jpeg_file)->value.str.val, "rb")) == 0) {
php_error(E_WARNING, "Unable to open %s", (*jpeg_file)->value.str.val);
RETURN_FALSE;
}
@ -222,7 +222,7 @@ PHP_FUNCTION(iptcembed)
len = (*iptcdata)->value.str.len;
if (spool < 2) {
fstat(fileno(fp),&sb);
fstat(fileno(fp), &sb);
poi = spoolbuf = emalloc(len + sizeof(psheader) + sb.st_size + 1024);
@ -232,36 +232,36 @@ PHP_FUNCTION(iptcembed)
}
}
if (php_iptc_get1(fp,spool,poi?&poi:0 TSRMLS_CC) != 0xFF) {
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
fclose(fp);
RETURN_FALSE;
}
if (php_iptc_get1(fp,spool,poi?&poi:0 TSRMLS_CC) != 0xD8) {
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) {
fclose(fp);
RETURN_FALSE;
}
while (!done) {
marker = php_iptc_next_marker(fp,spool,poi?&poi:0 TSRMLS_CC);
marker = php_iptc_next_marker(fp, spool, poi?&poi:0 TSRMLS_CC);
if (marker == M_EOI) { /* EOF */
break;
} else if (marker != M_APP13) {
php_iptc_put1(fp,spool,(unsigned char)marker,poi?&poi:0 TSRMLS_CC);
php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0 TSRMLS_CC);
}
switch (marker) {
case M_APP13:
/* we are going to write a new APP13 marker, so don't output the old one */
php_iptc_skip_variable(fp,0,0 TSRMLS_CC);
php_iptc_read_remaining(fp,spool,poi?&poi:0 TSRMLS_CC);
php_iptc_skip_variable(fp, 0, 0 TSRMLS_CC);
php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC);
done = 1;
break;
case M_APP0:
/* APP0 is in each and every JPEG, so when we hit APP0 we insert our new APP13! */
php_iptc_skip_variable(fp,spool,poi?&poi:0 TSRMLS_CC);
php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC);
if (len & 1) len++; /* make the length even */
@ -269,23 +269,23 @@ PHP_FUNCTION(iptcembed)
psheader[ 3 ] = (len+28)&0xff;
for (inx = 0; inx < 28; inx++)
php_iptc_put1(fp,spool,psheader[inx],poi?&poi:0 TSRMLS_CC);
php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0 TSRMLS_CC);
php_iptc_put1(fp,spool,(unsigned char)(len>>8),poi?&poi:0 TSRMLS_CC);
php_iptc_put1(fp,spool,(unsigned char)(len&0xff),poi?&poi:0 TSRMLS_CC);
php_iptc_put1(fp, spool, (unsigned char)(len>>8), poi?&poi:0 TSRMLS_CC);
php_iptc_put1(fp, spool, (unsigned char)(len&0xff), poi?&poi:0 TSRMLS_CC);
for (inx = 0; inx < len; inx++)
php_iptc_put1(fp,spool,(*iptcdata)->value.str.val[inx],poi?&poi:0 TSRMLS_CC);
php_iptc_put1(fp, spool, (*iptcdata)->value.str.val[inx], poi?&poi:0 TSRMLS_CC);
break;
case M_SOS:
/* we hit data, no more marker-inserting can be done! */
php_iptc_read_remaining(fp,spool,poi?&poi:0 TSRMLS_CC);
php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC);
done = 1;
break;
default:
php_iptc_skip_variable(fp,spool,poi?&poi:0 TSRMLS_CC);
php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC);
break;
}
}
@ -293,7 +293,7 @@ PHP_FUNCTION(iptcembed)
fclose(fp);
if (spool < 2) {
RETVAL_STRINGL(spoolbuf,poi - spoolbuf,0);
RETVAL_STRINGL(spoolbuf, poi - spoolbuf, 0);
} else {
RETURN_TRUE;
}
@ -350,7 +350,7 @@ PHP_FUNCTION(iptcparse)
inx += 2;
}
sprintf(key,"%d#%03d",(unsigned int) dataset,(unsigned int) recnum);
sprintf(key, "%d#%03d", (unsigned int) dataset, (unsigned int) recnum);
if ((len > length) || (inx + len) > length)
break;
@ -362,7 +362,7 @@ PHP_FUNCTION(iptcparse)
}
}
if (zend_hash_find(return_value->value.ht,key,strlen(key) + 1,(void **) &element) == FAILURE) {
if (zend_hash_find(return_value->value.ht, key, strlen(key) + 1, (void **) &element) == FAILURE) {
ALLOC_ZVAL(values);
INIT_PZVAL(values);
if (array_init(values) == FAILURE) {
@ -373,7 +373,7 @@ PHP_FUNCTION(iptcparse)
zend_hash_update(return_value->value.ht, key, strlen(key)+1, (void *) &values, sizeof(pval*), (void **) &element);
}
add_next_index_stringl(*element,buffer+inx,len,1);
add_next_index_stringl(*element, buffer+inx, len, 1);
inx += len;

View file

@ -38,21 +38,21 @@ static int php_lcg_initialized = 0;
#endif
/*
* combinedLCG() returns a pseudo random number in the range of (0,1).
* combinedLCG() returns a pseudo random number in the range of (0, 1).
* The function combines two CGs with periods of
* 2^31 - 85 and 2^31 - 249. The period of this function
* is equal to the product of both primes.
*/
#define MODMULT(a,b,c,m,s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m
#define MODMULT(a, b, c, m, s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m
double php_combined_lcg(TSRMLS_D)
{
php_int32 q;
php_int32 z;
MODMULT(53668,40014,12211,2147483563L, LCG(s1));
MODMULT(52774,40692,3791, 2147483399L, LCG(s2));
MODMULT(53668, 40014, 12211, 2147483563L, LCG(s1));
MODMULT(52774, 40692, 3791, 2147483399L, LCG(s2));
z = LCG(s1) - LCG(s2);
if(z < 1) {

View file

@ -31,8 +31,8 @@ static int reference_levdist(const char *s1, int l1,
const char *s2, int l2,
int cost_ins, int cost_rep, int cost_del )
{
int *p1,*p2,*tmp;
int i1,i2,c0,c1,c2;
int *p1, *p2, *tmp;
int i1, i2, c0, c1, c2;
if(l1==0) return l2*cost_ins;
if(l2==0) return l1*cost_del;
@ -77,9 +77,9 @@ static int reference_levdist(const char *s1, int l1,
/* {{{ custom_levdist
*/
static int custom_levdist(char *str1,char *str2,char *callback_name)
static int custom_levdist(char *str1, char *str2, char *callback_name)
{
php_error(E_WARNING,"the general Levenshtein support is not there yet");
php_error(E_WARNING, "the general Levenshtein support is not there yet");
/* not there yet */
return -1;
@ -90,7 +90,7 @@ static int custom_levdist(char *str1,char *str2,char *callback_name)
Calculate Levenshtein distance between two strings */
PHP_FUNCTION(levenshtein)
{
zval **str1, **str2, **cost_ins, **cost_rep, **cost_del,**callback_name;
zval **str1, **str2, **cost_ins, **cost_rep, **cost_del, **callback_name;
int distance=-1;
switch(ZEND_NUM_ARGS()) {
@ -101,9 +101,9 @@ PHP_FUNCTION(levenshtein)
convert_to_string_ex(str1);
convert_to_string_ex(str2);
distance = reference_levdist((*str1)->value.str.val,(*str1)->value.str.len,
(*str2)->value.str.val,(*str2)->value.str.len,
1,1,1);
distance = reference_levdist((*str1)->value.str.val, (*str1)->value.str.len,
(*str2)->value.str.val, (*str2)->value.str.len,
1, 1, 1);
break;
@ -117,8 +117,8 @@ PHP_FUNCTION(levenshtein)
convert_to_long_ex(cost_rep);
convert_to_long_ex(cost_del);
distance = reference_levdist((*str1)->value.str.val,(*str1)->value.str.len,
(*str2)->value.str.val,(*str2)->value.str.len,
distance = reference_levdist((*str1)->value.str.val, (*str1)->value.str.len,
(*str2)->value.str.val, (*str2)->value.str.len,
(*cost_ins)->value.lval,
(*cost_rep)->value.lval,
(*cost_del)->value.lval
@ -145,7 +145,7 @@ PHP_FUNCTION(levenshtein)
}
if(distance<0) {
php_error(E_WARNING,"levenshtein(): argument string(s) too long");
php_error(E_WARNING, "levenshtein(): argument string(s) too long");
}
RETURN_LONG(distance);

View file

@ -70,7 +70,7 @@ PHP_FUNCTION(readlink)
}
/* Append NULL to the end of the string */
buff[ret] = '\0';
RETURN_STRING(buff,1);
RETURN_STRING(buff, 1);
}
/* }}} */
@ -112,7 +112,7 @@ PHP_FUNCTION(symlink)
if (PG(safe_mode) && !php_checkuid((*topath)->value.str.val, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
RETURN_FALSE;
}
if (!strncasecmp((*topath)->value.str.val,"http://",7) || !strncasecmp((*topath)->value.str.val,"ftp://",6)) {
if (!strncasecmp((*topath)->value.str.val, "http://", 7) || !strncasecmp((*topath)->value.str.val, "ftp://", 6)) {
php_error(E_WARNING, "Unable to symlink to a URL");
RETURN_FALSE;
}
@ -142,7 +142,7 @@ PHP_FUNCTION(link)
if (PG(safe_mode) && !php_checkuid((*topath)->value.str.val, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
RETURN_FALSE;
}
if (!strncasecmp((*topath)->value.str.val,"http://",7) || !strncasecmp((*topath)->value.str.val,"ftp://",6)) {
if (!strncasecmp((*topath)->value.str.val, "http://", 7) || !strncasecmp((*topath)->value.str.val, "ftp://", 6)) {
php_error(E_WARNING, "Unable to link to a URL");
RETURN_FALSE;
}

View file

@ -32,7 +32,7 @@
#endif
char *_php_math_number_format(double, int, char ,char);
char *_php_math_number_format(double, int, char , char);
/* {{{ proto int abs(int number)
Return the absolute value of the number */
@ -40,7 +40,7 @@ PHP_FUNCTION(abs)
{
zval **value;
if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1,&value)==FAILURE) {
if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1, &value)==FAILURE) {
WRONG_PARAM_COUNT;
}
@ -66,7 +66,7 @@ PHP_FUNCTION(ceil)
{
zval **value;
if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1,&value)==FAILURE) {
if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1, &value)==FAILURE) {
WRONG_PARAM_COUNT;
}
@ -89,7 +89,7 @@ PHP_FUNCTION(floor)
{
zval **value;
if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1,&value)==FAILURE) {
if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1, &value)==FAILURE) {
WRONG_PARAM_COUNT;
}
@ -263,7 +263,7 @@ PHP_FUNCTION(atan2)
}
convert_to_double_ex(num1);
convert_to_double_ex(num2);
Z_DVAL_P(return_value) = atan2(Z_DVAL_PP(num1),Z_DVAL_PP(num2));
Z_DVAL_P(return_value) = atan2(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
@ -394,41 +394,41 @@ PHP_FUNCTION(pow)
*/
zval **zbase, **zexp;
long lbase,lexp;
long lbase, lexp;
double dval;
if (ZEND_NUM_ARGS() != 2) {
WRONG_PARAM_COUNT;
}
zend_get_parameters_ex(ZEND_NUM_ARGS(),&zbase,&zexp);
zend_get_parameters_ex(ZEND_NUM_ARGS(), &zbase, &zexp);
convert_scalar_to_number_ex(zbase);
convert_scalar_to_number_ex(zexp);
if ((Z_TYPE_PP(zbase) != IS_LONG && Z_TYPE_PP(zbase) != IS_DOUBLE) ||
(Z_TYPE_PP(zexp ) != IS_LONG && Z_TYPE_PP(zexp ) != IS_DOUBLE)) {
php_error(E_WARNING,"Invalid argument(s) passed to pow()");
php_error(E_WARNING, "Invalid argument(s) passed to pow()");
RETURN_FALSE;
}
if (Z_TYPE_PP(zexp) == IS_DOUBLE) {
/* pow(?,float), this is the ^^ case */
/* pow(?, float), this is the ^^ case */
convert_to_double_ex(zbase);
if ( Z_DVAL_PP(zbase) <= 0.0 ) {
/* Note that with the old behaviour, php pow() returned bogus
results. Try pow(-1,2.5) in PHP <= 4.0.6 ... */
php_error(E_WARNING,"Trying to raise a nonpositive value to a broken power");
results. Try pow(-1, 2.5) in PHP <= 4.0.6 ... */
php_error(E_WARNING, "Trying to raise a nonpositive value to a broken power");
RETURN_FALSE;
}
RETURN_DOUBLE(exp(log(Z_DVAL_PP(zbase)) * Z_DVAL_PP(zexp)));
}
/* pow(?,int), this is the ** case */
/* pow(?, int), this is the ** case */
lexp = Z_LVAL_PP(zexp);
if (Z_TYPE_PP(zbase) == IS_DOUBLE) {
/* pow(float,int) */
/* pow(float, int) */
if (lexp == 0) {
RETURN_DOUBLE(1.0);
}
@ -437,7 +437,7 @@ PHP_FUNCTION(pow)
} else if (Z_DVAL_PP(zbase) == 0.0) {
if (lexp < 0) {
php_error(E_WARNING,
"Division by zero: pow(0.0,[negative integer])");
"Division by zero: pow(0.0, [negative integer])");
RETURN_FALSE;
} else {
RETURN_DOUBLE(0.0);
@ -449,7 +449,7 @@ PHP_FUNCTION(pow)
}
/* pow(int,int) */
/* pow(int, int) */
if (lexp == 0) {
RETURN_LONG(1);
}
@ -463,7 +463,7 @@ PHP_FUNCTION(pow)
case 0:
if (lexp < 0) {
php_error(E_WARNING,
"Division by zero: pow(0,[negative integer])");
"Division by zero: pow(0, [negative integer])");
RETURN_FALSE;
} else {
RETURN_LONG(0);
@ -523,7 +523,7 @@ PHP_FUNCTION(exp2)
convert_to_double_ex(num);
// libc function is broken in RH Linux 6.1, glibc 2.1.3
//Z_DVAL_P(return_value) = exp2(Z_DVAL_PP(num));
Z_DVAL_P(return_value) = pow(2.0,Z_DVAL_PP(num));
Z_DVAL_P(return_value) = pow(2.0, Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
@ -541,7 +541,7 @@ PHP_FUNCTION(exp10)
convert_to_double_ex(num);
// libc function is broken in RH Linux 6.1, glibc 2.1.3
//Z_DVAL_P(return_value) = exp10(Z_DVAL_PP(num));
Z_DVAL_P(return_value) = pow(10.0,Z_DVAL_PP(num));
Z_DVAL_P(return_value) = pow(10.0, Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
@ -935,11 +935,11 @@ PHP_FUNCTION(base_convert)
convert_to_long_ex(frombase);
convert_to_long_ex(tobase);
if (Z_LVAL_PP(frombase) < 2 || Z_LVAL_PP(frombase) > 36) {
php_error(E_WARNING, "base_convert: invalid `from base' (%d)",Z_LVAL_PP(frombase));
php_error(E_WARNING, "base_convert: invalid `from base' (%d)", Z_LVAL_PP(frombase));
RETURN_FALSE;
}
if (Z_LVAL_PP(tobase) < 2 || Z_LVAL_PP(tobase) > 36) {
php_error(E_WARNING, "base_convert: invalid `to base' (%d)",Z_LVAL_PP(tobase));
php_error(E_WARNING, "base_convert: invalid `to base' (%d)", Z_LVAL_PP(tobase));
RETURN_FALSE;
}
Z_TYPE(temp) = IS_LONG;
@ -951,11 +951,11 @@ PHP_FUNCTION(base_convert)
/* }}} */
/* {{{ _php_math_number_format */
char *_php_math_number_format(double d,int dec,char dec_point,char thousand_sep)
char *_php_math_number_format(double d, int dec, char dec_point, char thousand_sep)
{
char *tmpbuf,*resbuf;
char *s,*t; /* source, target */
int tmplen,reslen=0;
char *tmpbuf, *resbuf;
char *s, *t; /* source, target */
int tmplen, reslen=0;
int count=0;
int is_negative=0;
@ -963,10 +963,10 @@ char *_php_math_number_format(double d,int dec,char dec_point,char thousand_sep)
is_negative=1;
d = -d;
}
dec = MAX(0,dec);
dec = MAX(0, dec);
tmpbuf = (char *) emalloc(1+DBL_MAX_10_EXP+1+dec+1);
tmplen=sprintf(tmpbuf,"%.*f",dec,d);
tmplen=sprintf(tmpbuf, "%.*f", dec, d);
if (!isdigit((int)tmpbuf[0])) {
return tmpbuf;
@ -1013,7 +1013,7 @@ char *_php_math_number_format(double d,int dec,char dec_point,char thousand_sep)
PHP_FUNCTION(number_format)
{
zval **num,**dec,**t_s,**d_p;
zval **num, **dec, **t_s, **d_p;
char thousand_sep=',', dec_point='.';
switch(ZEND_NUM_ARGS()) {
@ -1022,7 +1022,7 @@ PHP_FUNCTION(number_format)
RETURN_FALSE;
}
convert_to_double_ex(num);
RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num),0,dec_point,thousand_sep),0);
RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num), 0, dec_point, thousand_sep), 0);
break;
case 2:
if (zend_get_parameters_ex(2, &num, &dec)==FAILURE) {
@ -1030,7 +1030,7 @@ PHP_FUNCTION(number_format)
}
convert_to_double_ex(num);
convert_to_long_ex(dec);
RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num),Z_LVAL_PP(dec),dec_point,thousand_sep),0);
RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num), Z_LVAL_PP(dec), dec_point, thousand_sep), 0);
break;
case 4:
if (zend_get_parameters_ex(4, &num, &dec, &d_p, &t_s)==FAILURE) {
@ -1048,7 +1048,7 @@ PHP_FUNCTION(number_format)
} else if(Z_STRLEN_PP(t_s)==0) {
thousand_sep=0;
}
RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num),Z_LVAL_PP(dec),dec_point,thousand_sep),0);
RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num), Z_LVAL_PP(dec), dec_point, thousand_sep), 0);
break;
default:
WRONG_PARAM_COUNT;

View file

@ -51,7 +51,7 @@ PHP_NAMED_FUNCTION(php_if_md5)
sprintf(r, "%02x", digest[i]);
}
*r = '\0';
RETVAL_STRING(md5str,1);
RETVAL_STRING(md5str, 1);
}
/* }}} */

View file

@ -85,7 +85,7 @@ static void php_pack(pval **val, int size, int *map, char *output)
/* }}} */
/* pack() idea stolen from Perl (implemented formats behave the same as there)
* Implemented formats are A,a,h,H,c,C,s,S,i,I,l,L,n,N,f,d,x,X,@.
* Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
*/
/* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]])
Takes one or more arguments and packs them into a binary string according to the format argument */
@ -288,7 +288,7 @@ PHP_FUNCTION(pack)
memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg);
val = argv[currentarg++];
convert_to_string_ex(val);
memcpy(&output[outputpos],(*val)->value.str.val,
memcpy(&output[outputpos], (*val)->value.str.val,
((*val)->value.str.len < arg) ? (*val)->value.str.len : arg);
outputpos += arg;
break;
@ -304,7 +304,7 @@ PHP_FUNCTION(pack)
v = (*val)->value.str.val;
outputpos--;
if(arg > (*val)->value.str.len) {
php_error(E_WARNING,"pack type %c: not enough characters in string",code);
php_error(E_WARNING, "pack type %c: not enough characters in string", code);
arg = (*val)->value.str.len;
}
@ -472,7 +472,7 @@ static long php_unpack(char *data, int size, int issigned, int *map)
* chars1, chars2, and ints.
* Numeric pack types will return numbers, a and A will return strings,
* f and d will return doubles.
* Implemented formats are A,a,h,H,c,C,s,S,i,I,l,L,n,N,f,d,x,X,@.
* Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
*/
/* {{{ proto array unpack(string format, string input)
Unpack binary string into named array elements according to format argument */
@ -486,7 +486,7 @@ PHP_FUNCTION(unpack)
int inputpos, inputlen;
int i;
if ((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&formatarg,&inputarg) == FAILURE) {
if ((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2, &formatarg, &inputarg) == FAILURE) {
WRONG_PARAM_COUNT;
}

View file

@ -53,7 +53,7 @@ PHP_FUNCTION(clearstatcache);
#define MAKE_LONG_ZVAL_INCREF(name, val)\
MAKE_STD_ZVAL(name); \
ZVAL_LONG(name,val); \
ZVAL_LONG(name, val); \
name->refcount++;
#ifdef PHP_WIN32
@ -68,7 +68,7 @@ PHP_FUNCTION(clearstatcache);
#define S_IXOTH S_IEXEC
#undef getgid
#define getgroups(a,b) 0
#define getgroups(a, b) 0
#define getgid() 1
#define getuid() 1
#endif

View file

@ -30,7 +30,7 @@
#define SMART_STR_PREALLOC 128
#endif
#define smart_str_alloc(d,n,what) {\
#define smart_str_alloc(d, n, what) {\
if (!d->c) d->len = d->a = 0; \
newlen = d->len + n; \
if (newlen >= d->a) {\
@ -44,9 +44,9 @@
#define smart_str_appendc(dest, c) smart_str_appendc_ex(dest, c, 0)
#define smart_str_free(s) smart_str_free_ex(s, 0)
#define smart_str_appendl(dest,src,len) smart_str_appendl_ex(dest,src,len,0)
#define smart_str_append(dest, src) smart_str_append_ex(dest,src,0)
#define smart_str_append_long(dest, val) smart_str_append_long_ex(dest,val,0)
#define smart_str_appendl(dest, src, len) smart_str_appendl_ex(dest, src, len, 0)
#define smart_str_append(dest, src) smart_str_append_ex(dest, src, 0)
#define smart_str_append_long(dest, val) smart_str_append_long_ex(dest, val, 0)
static inline void smart_str_appendc_ex(smart_str *dest, char c, int what)
{

View file

@ -108,7 +108,7 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit T
PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC);
PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC);
PHPAPI void php_stripcslashes(char *str, int *len);
PHPAPI char *php_basename(char *str, size_t len ,char *suffix, size_t sufflen);
PHPAPI char *php_basename(char *str, size_t len , char *suffix, size_t sufflen);
PHPAPI void php_dirname(char *str, int len);
PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len);
PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,

View file

@ -36,20 +36,20 @@ PHPAPI void php_var_serialize(smart_str *buf, zval **struc, php_serialize_data_t
PHPAPI int php_var_unserialize(zval **rval, const char **p, const char *max, php_serialize_data_t *var_hash TSRMLS_DC);
#define PHP_VAR_SERIALIZE_INIT(var_hash) \
zend_hash_init(&(var_hash),10,NULL,NULL,0)
zend_hash_init(&(var_hash), 10, NULL, NULL, 0)
#define PHP_VAR_SERIALIZE_DESTROY(var_hash) \
zend_hash_destroy(&(var_hash))
#define PHP_VAR_UNSERIALIZE_INIT(var_hash) \
zend_hash_init(&(var_hash),10,NULL,NULL,0)
zend_hash_init(&(var_hash), 10, NULL, NULL, 0)
#define PHP_VAR_UNSERIALIZE_DESTROY(var_hash) \
zend_hash_destroy(&(var_hash))
#define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash,ozval,nzval) \
#define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash, ozval, nzval) \
if (var_hash) { \
HashPosition pos; \
zval **zval_ref; \
zend_hash_internal_pointer_reset_ex(var_hash,&pos); \
zend_hash_internal_pointer_reset_ex(var_hash, &pos); \
while (zend_hash_get_current_data_ex(var_hash, (void **) &zval_ref, &pos) == SUCCESS) { \
if (*zval_ref == ozval) { \
char *string_key; \
@ -60,10 +60,10 @@ if (var_hash) { \
zend_hash_index_update(var_hash, num_key, &nzval, sizeof(zval *), NULL); \
break; \
} \
zend_hash_move_forward_ex(var_hash,&pos); \
zend_hash_move_forward_ex(var_hash, &pos); \
} \
}
PHPAPI zend_class_entry *php_create_empty_class(char *class_name,int len);
PHPAPI zend_class_entry *php_create_empty_class(char *class_name, int len);
#endif /* PHP_VAR_H */

View file

@ -63,7 +63,7 @@ PHP_FUNCTION(quoted_printable_decode)
char *str_in, *str_out;
int i = 0, j = 0, k;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1,&arg1)==FAILURE)
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1)==FAILURE)
{
WRONG_PARAM_COUNT;
}

View file

@ -235,9 +235,9 @@ PHP_FUNCTION(rand)
convert_to_long_ex(p_min);
convert_to_long_ex(p_max);
if ((*p_max)->value.lval-(*p_min)->value.lval < 0) {
php_error(E_WARNING,"rand(): Invalid range: %ld..%ld", (*p_min)->value.lval, (*p_max)->value.lval);
}else if ((*p_max)->value.lval-(*p_min)->value.lval > PHP_RAND_MAX){
php3_error(E_WARNING,"rand(): Invalid range: %ld..%ld", (*p_min)->value.lval, (*p_max)->value.lval);
php_error(E_WARNING, "rand(): Invalid range: %ld..%ld", (*p_min)->value.lval, (*p_max)->value.lval);
} else if ((*p_max)->value.lval-(*p_min)->value.lval > PHP_RAND_MAX){
php3_error(E_WARNING, "rand(): Invalid range: %ld..%ld", (*p_min)->value.lval, (*p_max)->value.lval);
}
break;
default:
@ -297,9 +297,9 @@ PHP_FUNCTION(mt_rand)
convert_to_long_ex(p_min);
convert_to_long_ex(p_max);
if ((*p_max)->value.lval-(*p_min)->value.lval <= 0) {
php_error(E_WARNING,"mt_rand(): Invalid range: %ld..%ld", (*p_min)->value.lval, (*p_max)->value.lval);
php_error(E_WARNING, "mt_rand(): Invalid range: %ld..%ld", (*p_min)->value.lval, (*p_max)->value.lval);
}else if ((*p_max)->value.lval-(*p_min)->value.lval > MT_RAND_MAX){
php3_error(E_WARNING,"mt_rand(): Invalid range: %ld..%ld",(*p_min)->value.lval, (*p_max)->value.lval);
php3_error(E_WARNING, "mt_rand(): Invalid range: %ld..%ld", (*p_min)->value.lval, (*p_max)->value.lval);
}
break;
default:

View file

@ -82,7 +82,7 @@ static void _free_reg_cache(reg_cache *rc)
#undef regfree
#define regfree(a);
#undef regcomp
#define regcomp(a,b,c) _php_regcomp(a,b,c)
#define regcomp(a, b, c) _php_regcomp(a, b, c)
static void php_reg_init_globals(php_reg_globals *reg_globals TSRMLS_DC)
{
@ -440,7 +440,7 @@ static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
if ((*arg_pattern)->type == IS_STRING) {
if ((*arg_pattern)->value.str.val && (*arg_pattern)->value.str.len)
pattern = estrndup((*arg_pattern)->value.str.val,(*arg_pattern)->value.str.len);
pattern = estrndup((*arg_pattern)->value.str.val, (*arg_pattern)->value.str.len);
else
pattern = empty_string;
} else {
@ -473,7 +473,7 @@ static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
if (ret == (char *) -1) {
RETVAL_FALSE;
} else {
RETVAL_STRING(ret,1);
RETVAL_STRING(ret, 1);
STR_FREE(ret);
}
STR_FREE(string);

View file

@ -320,7 +320,7 @@ static void ReleaseCharSet(CharSet *cset)
*
*----------------------------------------------------------------------
*/
PHPAPI int ValidateFormat(char *format,int numVars,int *totalSubs)
PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
{
#define STATIC_LIST_SIZE 16
int gotXpg, gotSequential, value, i, flags;
@ -457,7 +457,7 @@ PHPAPI int ValidateFormat(char *format,int numVars,int *totalSubs)
break;
case 'c':
/* we differ here with the TCL implementation in allowing for */
/* a character width specification,to be more consistent with */
/* a character width specification, to be more consistent with */
/* ANSI. since Zend auto allocates space for vars, this is no */
/* problem - cc */
/*
@ -496,7 +496,7 @@ PHPAPI int ValidateFormat(char *format,int numVars,int *totalSubs)
goto error;
default:
{
php_error(E_WARNING,"bad scan conversion character \"%c\"", ch);
php_error(E_WARNING, "bad scan conversion character \"%c\"", ch);
goto error;
}
}
@ -567,7 +567,7 @@ PHPAPI int ValidateFormat(char *format,int numVars,int *totalSubs)
if (gotXpg) {
php_error(E_WARNING, "\"%n$\" argument index out of range");
} else {
php_error(E_WARNING,"different numbers of variable names and field specifiers");
php_error(E_WARNING, "different numbers of variable names and field specifiers");
}
error:
@ -592,9 +592,9 @@ PHPAPI int ValidateFormat(char *format,int numVars,int *totalSubs)
* return_value set with the results of the scan
*/
PHPAPI int php_sscanf_internal( char *string,char *format,
int argCount,zval ***args,
int varStart,pval **return_value TSRMLS_DC)
PHPAPI int php_sscanf_internal( char *string, char *format,
int argCount, zval ***args,
int varStart, pval **return_value TSRMLS_DC)
{
int numVars, nconversions, totalVars = -1;
int i, value, result;
@ -623,8 +623,8 @@ PHPAPI int php_sscanf_internal( char *string,char *format,
}
#if 0
zend_printf("<br>in sscanf_internal : <br> string is \"%s\",format = \"%s\"<br> NumVars = %d. VarStart = %d<br>-------------------------<br>",
string,format,numVars,varStart);
zend_printf("<br>in sscanf_internal : <br> string is \"%s\", format = \"%s\"<br> NumVars = %d. VarStart = %d<br>-------------------------<br>",
string, format, numVars, varStart);
#endif
/*
* Check for errors in the format string.
@ -642,7 +642,7 @@ PHPAPI int php_sscanf_internal( char *string,char *format,
if (numVars) {
for (i = varStart;i < argCount;i++){
if ( ! PZVAL_IS_REF( *args[ i ] ) ) {
php_error(E_WARNING,"Parameter %d to %s() must be passed by reference",
php_error(E_WARNING, "Parameter %d to %s() must be passed by reference",
i, get_active_function_name(TSRMLS_C));
scan_set_error_return(numVars, return_value);
return SCAN_ERROR_VAR_PASSED_BYVAL;
@ -1230,7 +1230,7 @@ PHPAPI int php_sscanf_internal( char *string,char *format,
/* }}} */
/* the compiler choked when i tried to make this a macro */
static inline void scan_set_error_return(int numVars,pval **return_value)
static inline void scan_set_error_return(int numVars, pval **return_value)
{
if (numVars) {
(*return_value)->type = IS_LONG;

View file

@ -44,7 +44,7 @@
*/
PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars);
PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval ***args,
int varStart,pval **return_value TSRMLS_DC);
int varStart, pval **return_value TSRMLS_DC);
#endif /* SCANF_H */

View file

@ -195,7 +195,7 @@ PHP_FUNCTION(bin2hex)
Find length of initial segment consisting entirely of characters found in mask */
PHP_FUNCTION(strspn)
{
zval **s1,**s2;
zval **s1, **s2;
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
WRONG_PARAM_COUNT;
@ -212,7 +212,7 @@ PHP_FUNCTION(strspn)
Find length of initial segment consisting entirely of characters not found in mask */
PHP_FUNCTION(strcspn)
{
zval **s1,**s2;
zval **s1, **s2;
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
WRONG_PARAM_COUNT;
@ -455,22 +455,22 @@ int php_charmask(unsigned char *input, int len, char *mask TSRMLS_DC)
/* Error, try to be as helpful as possible:
(a range ending/starting with '.' won't be captured here) */
if (end-len>=input) { /* there was no 'left' char */
php_error(E_WARNING,"Invalid '..'-range passed to %s(), no character to the left of '..'",get_active_function_name(TSRMLS_C));
php_error(E_WARNING, "Invalid '..'-range passed to %s(), no character to the left of '..'", get_active_function_name(TSRMLS_C));
result = FAILURE;
continue;
}
if (input+2>=end) { /* there is no 'right' char */
php_error(E_WARNING,"Invalid '..'-range passed to %s(), no character to the right of '..'",get_active_function_name(TSRMLS_C));
php_error(E_WARNING, "Invalid '..'-range passed to %s(), no character to the right of '..'", get_active_function_name(TSRMLS_C));
result = FAILURE;
continue;
}
if (input[-1] > input[2]) { /* wrong order */
php_error(E_WARNING,"Invalid '..'-range passed to %s(), '..'-range needs to be incrementing",get_active_function_name(TSRMLS_C));
php_error(E_WARNING, "Invalid '..'-range passed to %s(), '..'-range needs to be incrementing", get_active_function_name(TSRMLS_C));
result = FAILURE;
continue;
}
/* FIXME: better error (a..b..c is the only left possibility?) */
php_error(E_WARNING,"Invalid '..'-range passed to %s()",get_active_function_name(TSRMLS_C));
php_error(E_WARNING, "Invalid '..'-range passed to %s()", get_active_function_name(TSRMLS_C));
result = FAILURE;
continue;
} else {
@ -804,7 +804,7 @@ PHP_FUNCTION(explode)
convert_to_string_ex(delim);
if (! (*delim)->value.str.len) {
php_error(E_WARNING,"Empty delimiter");
php_error(E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
@ -897,7 +897,7 @@ PHP_FUNCTION(implode)
#define STRTOK_TABLE(p) BG(strtok_table)[(unsigned char) *p]
/* {{{ proto string strtok([string str,] string token)
/* {{{ proto string strtok([string str, ] string token)
Tokenize a string */
PHP_FUNCTION(strtok)
{
@ -1056,7 +1056,7 @@ PHPAPI char *php_basename(char *s, size_t len, char *suffix, size_t sufflen)
/* do suffix removal as the unix command does */
if(suffix && (len > sufflen)) {
if(!strncmp(suffix,c-sufflen+1,sufflen)) {
if(!strncmp(suffix, c-sufflen+1, sufflen)) {
c -= sufflen;
*(c + 1) = '\0';
}
@ -1322,7 +1322,7 @@ PHP_FUNCTION(stristr)
if ((*needle)->type == IS_STRING) {
if ((*needle)->value.str.len==0) {
php_error(E_WARNING,"Empty delimiter");
php_error(E_WARNING, "Empty delimiter");
efree(haystack_orig);
RETURN_FALSE;
}
@ -1367,7 +1367,7 @@ PHP_FUNCTION(strstr)
if ((*needle)->type == IS_STRING) {
if ((*needle)->value.str.len==0) {
php_error(E_WARNING,"Empty delimiter");
php_error(E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
found = php_memnstr((*haystack)->value.str.val, (*needle)->value.str.val,
@ -1415,7 +1415,7 @@ PHP_FUNCTION(strpos)
convert_to_long_ex(OFFSET);
offset = (*OFFSET)->value.lval;
if (offset < 0) {
php_error(E_WARNING,"offset not contained in string");
php_error(E_WARNING, "offset not contained in string");
RETURN_FALSE;
}
break;
@ -1426,7 +1426,7 @@ PHP_FUNCTION(strpos)
convert_to_string_ex(haystack);
if (offset > (*haystack)->value.str.len) {
php_error(E_WARNING,"offset not contained in string");
php_error(E_WARNING, "offset not contained in string");
RETURN_FALSE;
}
@ -1438,7 +1438,7 @@ PHP_FUNCTION(strpos)
if ((*needle)->type == IS_STRING) {
if ((*needle)->value.str.len==0) {
php_error(E_WARNING,"Empty delimiter");
php_error(E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
found = php_memnstr(startp, (*needle)->value.str.val, (*needle)->value.str.len, endp);
@ -1509,7 +1509,7 @@ PHP_FUNCTION(strrchr)
if (found) {
RETVAL_STRING(found,1);
RETVAL_STRING(found, 1);
} else {
RETVAL_FALSE;
}
@ -1812,7 +1812,7 @@ PHP_FUNCTION(chr)
convert_to_long_ex(num);
temp[0] = (char) (*num)->value.lval;
temp[1] = '\0';
RETVAL_STRINGL(temp, 1,1);
RETVAL_STRINGL(temp, 1, 1);
}
/* }}} */
@ -1893,7 +1893,7 @@ PHPAPI char *php_strtr(char *str, int len, char *str_from,
/* {{{ php_strtr_array
*/
static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *hash)
static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *hash)
{
zval *entry;
char *string_key;
@ -1939,12 +1939,12 @@ static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *has
}
found = 0;
memcpy(key,str+pos,maxlen);
memcpy(key, str+pos, maxlen);
for (len = maxlen; len >= minlen; len--) {
key[ len ]=0;
if (zend_hash_find(hash,key,len+1,(void**)&trans) == SUCCESS) {
if (zend_hash_find(hash, key, len+1, (void**)&trans) == SUCCESS) {
char *tval;
int tlen;
zval tmp;
@ -1978,14 +1978,14 @@ static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *has
efree(key);
smart_str_0(&result);
RETVAL_STRINGL(result.c,result.len,0);
RETVAL_STRINGL(result.c, result.len, 0);
}
/* }}} */
/* {{{ proto string strtr(string str, string from, string to)
Translate characters in str using given translation tables */
PHP_FUNCTION(strtr)
{ /* strtr(STRING,FROM,TO) */
{ /* strtr(STRING, FROM, TO) */
zval **str, **from, **to;
int ac = ZEND_NUM_ARGS();
@ -1994,7 +1994,7 @@ PHP_FUNCTION(strtr)
}
if (ac == 2 && (*from)->type != IS_ARRAY) {
php_error(E_WARNING,"arg2 must be passed an array");
php_error(E_WARNING, "arg2 must be passed an array");
RETURN_FALSE;
}
@ -2006,7 +2006,7 @@ PHP_FUNCTION(strtr)
}
if (ac == 2) {
php_strtr_array(return_value,(*str)->value.str.val,(*str)->value.str.len,HASH_OF(*from));
php_strtr_array(return_value, (*str)->value.str.val, (*str)->value.str.len, HASH_OF(*from));
} else {
convert_to_string_ex(from);
convert_to_string_ex(to);
@ -2018,7 +2018,7 @@ PHP_FUNCTION(strtr)
return_value->value.str.len,
(*from)->value.str.val,
(*to)->value.str.val,
MIN((*from)->value.str.len,(*to)->value.str.len));
MIN((*from)->value.str.len, (*to)->value.str.len));
}
}
/* }}} */
@ -2028,7 +2028,7 @@ PHP_FUNCTION(strtr)
PHP_FUNCTION(strrev)
{
zval **str;
int i,len;
int i, len;
char c;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str)==FAILURE) {
@ -2244,7 +2244,7 @@ PHP_FUNCTION(stripcslashes)
*return_value = **str;
zval_copy_ctor(return_value);
php_stripcslashes(return_value->value.str.val,&return_value->value.str.len);
php_stripcslashes(return_value->value.str.val, &return_value->value.str.len);
}
/* }}} */
@ -2285,11 +2285,11 @@ char *php_strerror(int errnum)
*/
PHPAPI void php_stripcslashes(char *str, int *len)
{
char *source,*target,*end;
char *source, *target, *end;
int nlen = *len, i;
char numtmp[4];
for (source=str,end=str+nlen,target=str; source<end; source++) {
for (source=str, end=str+nlen, target=str; source<end; source++) {
if (*source == '\\' && source+1<end) {
source++;
switch (*source) {
@ -2348,7 +2348,7 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_
{
char flags[256];
char *new_str = emalloc((length?length:(length=strlen(str)))*4+1);
char *source,*target;
char *source, *target;
char *end;
char c;
int newlen;
@ -2363,7 +2363,7 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_
php_charmask(what, wlength, flags TSRMLS_CC);
for (source=str,end=source+length,target=new_str; (c=*source) || source<end; source++) {
for (source=str, end=source+length, target=new_str; (c=*source) || source<end; source++) {
if (flags[(unsigned char)c]) {
if ((unsigned char)c<32 || (unsigned char)c>126) {
*target++ = '\\';
@ -2404,7 +2404,7 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_f
{
/* maximum string length, worst case situation */
char *new_str;
char *source,*target;
char *source, *target;
char *end;
char c;
@ -2413,7 +2413,7 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_f
return str;
}
new_str = (char *) emalloc((length?length:(length=strlen(str)))*2+1);
for (source=str,end=source+length,target=new_str; source<end; source++) {
for (source=str, end=source+length, target=new_str; source<end; source++) {
c = *source;
switch(c) {
case '\0':
@ -2457,10 +2457,10 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_f
/* {{{ php_char_to_str
*/
PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zval *result)
PHPAPI void php_char_to_str(char *str, uint len, char from, char *to, int to_len, zval *result)
{
int char_count=0;
char *source,*target,*tmp,*source_end=str+len, *tmp_end=NULL;
char *source, *target, *tmp, *source_end=str+len, *tmp_end=NULL;
for (source=str; source<source_end; source++) {
if (*source==from) {
@ -2471,7 +2471,7 @@ PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zva
result->type = IS_STRING;
if (char_count==0) {
result->value.str.val = estrndup(str,len);
result->value.str.val = estrndup(str, len);
result->value.str.len = len;
return;
}
@ -2481,7 +2481,7 @@ PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zva
for (source=str; source<source_end; source++) {
if (*source==from) {
for (tmp=to,tmp_end=tmp+to_len; tmp<tmp_end; tmp++) {
for (tmp=to, tmp_end=tmp+to_len; tmp<tmp_end; tmp++) {
*target = *tmp;
target++;
}
@ -2777,14 +2777,14 @@ PHP_FUNCTION(str_replace)
* Converts Logical Hebrew text (Hebrew Windows style) to Visual text
* Cheers/complaints/flames - Zeev Suraski <zeev@php.net>
*/
static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines)
static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
{
zval **str,**max_chars_per_line;
char *heb_str,*tmp,*target,*opposite_target,*broken_str;
zval **str, **max_chars_per_line;
char *heb_str, *tmp, *target, *opposite_target, *broken_str;
int block_start, block_end, block_type, block_length, i;
int block_ended;
long max_chars=0;
int begin,end,char_count,orig_begin;
int begin, end, char_count, orig_begin;
switch(ZEND_NUM_ARGS()) {
@ -2931,7 +2931,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines)
efree(heb_str);
if (convert_newlines) {
php_char_to_str(broken_str,(*str)->value.str.len,'\n',"<br>\n",5,return_value);
php_char_to_str(broken_str, (*str)->value.str.len,'\n', "<br>\n", 5, return_value);
efree(broken_str);
} else {
return_value->value.str.val = broken_str;
@ -2945,7 +2945,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines)
Convert logical Hebrew text to visual text */
PHP_FUNCTION(hebrev)
{
php_hebrev(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
php_hebrev(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
@ -2953,7 +2953,7 @@ PHP_FUNCTION(hebrev)
Convert logical Hebrew text to visual text with newline conversion */
PHP_FUNCTION(hebrevc)
{
php_hebrev(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
php_hebrev(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
@ -2969,7 +2969,7 @@ PHP_FUNCTION(nl2br)
convert_to_string_ex(str);
php_char_to_str((*str)->value.str.val,(*str)->value.str.len,'\n',"<br />\n",7,return_value);
php_char_to_str((*str)->value.str.val, (*str)->value.str.len,'\n', "<br />\n", 7, return_value);
}
/* }}} */
@ -3001,7 +3001,7 @@ PHP_FUNCTION(strip_tags)
break;
}
convert_to_string_ex(str);
buf = estrndup((*str)->value.str.val,(*str)->value.str.len);
buf = estrndup((*str)->value.str.val, (*str)->value.str.len);
php_strip_tags(buf, (*str)->value.str.len, 0, allowed_tags, allowed_tags_len);
RETURN_STRING(buf, 0);
}
@ -3026,7 +3026,7 @@ PHP_FUNCTION(setlocale)
convert_to_long_ex(pcategory);
cat = Z_LVAL_PP(pcategory);
} else { /* FIXME: The following behaviour should be removed. */
php_error(E_NOTICE,"Passing locale category name as string is deprecated. Use the LC_* -constants instead.");
php_error(E_NOTICE, "Passing locale category name as string is deprecated. Use the LC_* -constants instead.");
convert_to_string_ex(pcategory);
category = *pcategory;
@ -3047,7 +3047,7 @@ PHP_FUNCTION(setlocale)
else if (!strcasecmp ("LC_TIME", category->value.str.val))
cat = LC_TIME;
else {
php_error(E_WARNING,"Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC or LC_TIME", category->value.str.val);
php_error(E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC or LC_TIME", category->value.str.val);
RETURN_FALSE;
}
}
@ -3065,7 +3065,7 @@ PHP_FUNCTION(setlocale)
BG(locale_string) = estrdup(retval);
}
RETVAL_STRING(retval,1);
RETVAL_STRING(retval, 1);
return;
}
#endif
@ -3163,7 +3163,7 @@ int php_tag_find(char *tag, int len, char *set) {
}
*(n++) = '>';
*n = '\0';
if(strstr(set,norm)) {
if(strstr(set, norm)) {
done=1;
} else {
done=0;
@ -3195,7 +3195,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo
char *tbuf, *buf, *p, *tp, *rp, c, lc;
int br, i=0;
buf = estrndup(rbuf,len);
buf = estrndup(rbuf, len);
c = *buf;
lc = '\0';
p = buf;
@ -3255,7 +3255,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo
*(tp++) = '>';
*tp='\0';
if(php_tag_find(tbuf, tp-tbuf, allow)) {
memcpy(rp,tbuf,tp-tbuf);
memcpy(rp, tbuf, tp-tbuf);
rp += tp-tbuf;
}
tp = tbuf;
@ -3391,7 +3391,7 @@ PHP_FUNCTION(count_chars)
len = (*input)->value.str.len;
buf = (unsigned char *) (*input)->value.str.val;
memset((void*) chars,0,sizeof(chars));
memset((void*) chars, 0, sizeof(chars));
while (len > 0) {
chars[*buf]++;
@ -3406,16 +3406,16 @@ PHP_FUNCTION(count_chars)
for (inx=0; inx < 256; inx++) {
switch (mymode) {
case 0:
add_index_long(return_value,inx,chars[inx]);
add_index_long(return_value, inx, chars[inx]);
break;
case 1:
if (chars[inx] != 0) {
add_index_long(return_value,inx,chars[inx]);
add_index_long(return_value, inx, chars[inx]);
}
break;
case 2:
if (chars[inx] == 0) {
add_index_long(return_value,inx,chars[inx]);
add_index_long(return_value, inx, chars[inx]);
}
break;
case 3:
@ -3432,7 +3432,7 @@ PHP_FUNCTION(count_chars)
}
if (mymode >= 3 && mymode <= 4) {
RETURN_STRINGL(retstr,retlen,1);
RETURN_STRINGL(retstr, retlen, 1);
}
}
/* }}} */
@ -3719,7 +3719,7 @@ PHP_FUNCTION(sscanf)
WRONG_PARAM_COUNT;
}
args = (zval ***)emalloc(argCount * sizeof(zval **));
if (!args || (zend_get_parameters_array_ex(argCount,args) == FAILURE)) {
if (!args || (zend_get_parameters_array_ex(argCount, args) == FAILURE)) {
efree( args );
WRONG_PARAM_COUNT;
}

View file

@ -217,7 +217,7 @@ PHP_FUNCTION(openlog)
if (BG(syslog_device)) {
efree(BG(syslog_device));
}
BG(syslog_device) = estrndup((*ident)->value.str.val,(*ident)->value.str.len);
BG(syslog_device) = estrndup((*ident)->value.str.val, (*ident)->value.str.len);
openlog(BG(syslog_device), (*option)->value.lval, (*facility)->value.lval);
RETURN_TRUE;
}
@ -253,7 +253,7 @@ PHP_FUNCTION(syslog)
* this will cause problems.
*/
php_syslog((*priority)->value.lval, "%.500s",(*message)->value.str.val);
php_syslog((*priority)->value.lval, "%.500s", (*message)->value.str.val);
RETURN_TRUE;
}
/* }}} */

View file

@ -82,7 +82,7 @@ PHP_FUNCTION(uniqid)
sprintf(uniqid, "%s%08x%05x", (*prefix)->value.str.val, sec, usec);
}
RETURN_STRING(uniqid,1);
RETURN_STRING(uniqid, 1);
#endif
}
/* }}} */

View file

@ -70,7 +70,7 @@ PHPAPI php_url *php_url_parse(char *str)
php_url *ret = (php_url *) emalloc(sizeof(php_url));
if (!ret) {
/*php_error(E_WARNING,"Unable to allocate memory\n");*/
/*php_error(E_WARNING, "Unable to allocate memory\n");*/
return NULL;
}
memset(ret, 0, sizeof(php_url));
@ -79,13 +79,13 @@ PHPAPI php_url *php_url_parse(char *str)
http://www.ics.uci.edu/~fielding/url/url.txt */
err = regcomp(&re, "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?", REG_EXTENDED);
if (err) {
/*php_error(E_WARNING,"Unable to compile regex: %d\n", err);*/
/*php_error(E_WARNING, "Unable to compile regex: %d\n", err);*/
efree(ret);
return NULL;
}
err = regexec(&re, str, 10, subs, 0);
if (err) {
/*php_error(E_WARNING,"Error with regex\n");*/
/*php_error(E_WARNING, "Error with regex\n");*/
efree(ret);
regfree(&re);
return NULL;
@ -128,7 +128,7 @@ PHPAPI php_url *php_url_parse(char *str)
STR_FREE(ret->fragment);
efree(ret);
efree(result);
/*php_error(E_WARNING,"Unable to compile regex: %d\n", err);*/
/*php_error(E_WARNING, "Unable to compile regex: %d\n", err);*/
if (!cerr) regfree(&re);
return NULL;
}

View file

@ -47,7 +47,7 @@ typedef struct url_adapt_struct {
char *val;
char delim;
char *p;
int l,ml;
int l, ml;
int attr_done;
} url_adapt_state_t;

View file

@ -18,7 +18,8 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
/* $Id: var.c
1.111 2001/08/06 13:36:08 thies Exp $ */
/* {{{ includes
@ -105,7 +106,7 @@ head_done:
break;
}
default:
php_printf("%sUNKNOWN:0\n",COMMON);
php_printf("%sUNKNOWN:0\n", COMMON);
break;
}
}
@ -275,7 +276,7 @@ static void php_var_serialize_intern(smart_str *buf, zval **struc, HashTable *va
char s[256];
ulong slen;
slen = sprintf(s, "d:%.*G;",(int) EG(precision), Z_DVAL_PP(struc));
slen = sprintf(s, "d:%.*G;", (int) EG(precision), Z_DVAL_PP(struc));
smart_str_appendl(buf, s, slen);
return;
}
@ -430,9 +431,9 @@ PHPAPI int php_var_unserialize(zval **rval, const char **p, const char *max, Has
(*p)++;
INIT_PZVAL(*rval);
if (cur == 'b') {
ZVAL_BOOL(*rval,atol(q + 2));
ZVAL_BOOL(*rval, atol(q + 2));
} else {
ZVAL_LONG(*rval,atol(q + 2));
ZVAL_LONG(*rval, atol(q + 2));
}
return 1;
@ -449,7 +450,7 @@ PHPAPI int php_var_unserialize(zval **rval, const char **p, const char *max, Has
}
(*p)++;
INIT_PZVAL(*rval);
ZVAL_DOUBLE(*rval,atof(q + 2));
ZVAL_DOUBLE(*rval, atof(q + 2));
return 1;
case 's':
@ -474,11 +475,11 @@ PHPAPI int php_var_unserialize(zval **rval, const char **p, const char *max, Has
if (i == 0) {
str = empty_string;
} else {
str = estrndup(*p,i);
str = estrndup(*p, i);
}
(*p) += i + 2;
INIT_PZVAL(*rval);
ZVAL_STRINGL(*rval,str,i,0);
ZVAL_STRINGL(*rval, str, i, 0);
return 1;
case 'a':
@ -654,7 +655,7 @@ PHP_FUNCTION(unserialize)
if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_PP(buf), &var_hash TSRMLS_CC)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
zval_dtor(return_value);
php_error(E_NOTICE, "unserialize() failed at offset %d of %d bytes",p - Z_STRVAL_PP(buf),Z_STRLEN_PP(buf));
php_error(E_NOTICE, "unserialize() failed at offset %d of %d bytes", p - Z_STRVAL_PP(buf), Z_STRLEN_PP(buf));
RETURN_FALSE;
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);