diff options
author | Zeev Suraski <zeev@php.net> | 2001-08-05 01:43:02 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-08-05 01:43:02 +0000 |
commit | 1159c84ab7849099d4a717cd05c2d920102040ed (patch) | |
tree | ed4e48bb27e2ce5de5972fc3a29c1d24c818467a /sapi | |
parent | fcc035108f7b8d2e169c5a592227b3df84d0573e (diff) | |
download | php-git-1159c84ab7849099d4a717cd05c2d920102040ed.tar.gz |
- TSRMLS_FETCH work
- whitespace fixes
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/aolserver/aolserver.c | 2 | ||||
-rw-r--r-- | sapi/apache/mod_php4.c | 12 | ||||
-rw-r--r-- | sapi/apache/php_apache.c | 78 | ||||
-rw-r--r-- | sapi/apache/sapi_apache.c | 2 | ||||
-rw-r--r-- | sapi/caudium/caudium.c | 2 | ||||
-rw-r--r-- | sapi/cgi/cgi_main.c | 6 | ||||
-rw-r--r-- | sapi/fastcgi/fastcgi.c | 4 | ||||
-rw-r--r-- | sapi/isapi/php4isapi.c | 6 | ||||
-rw-r--r-- | sapi/isapi/stresstest/stresstest.cpp | 55 | ||||
-rw-r--r-- | sapi/phttpd/phttpd.c | 8 | ||||
-rw-r--r-- | sapi/roxen/roxen.c | 2 | ||||
-rw-r--r-- | sapi/servlet/servlet.c | 4 |
12 files changed, 91 insertions, 90 deletions
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c index 6f620a3a9e..e7830c36e6 100644 --- a/sapi/aolserver/aolserver.c +++ b/sapi/aolserver/aolserver.c @@ -299,7 +299,7 @@ php_ns_startup(sapi_module_struct *sapi_module) * the HTTP header data, so that a script can access these. */ -#define ADD_STRINGX(name,buf) \ +#define ADD_STRINGX(name, buf) \ php_register_variable(name, buf, track_vars_array TSRMLS_CC) #define ADD_STRING(name) \ diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index c13ce53de8..4265f4aa6a 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -440,7 +440,7 @@ static void init_request_info(TSRMLS_D) tmp = uudecode(r->pool, authorization); SG(request_info).auth_user = getword_nulls_nc(r->pool, &tmp, ':'); if (SG(request_info).auth_user) { - r->connection->user = pstrdup(r->connection->pool,SG(request_info).auth_user); + r->connection->user = pstrdup(r->connection->pool, SG(request_info).auth_user); r->connection->ap_auth_type = "Basic"; SG(request_info).auth_user = estrdup(SG(request_info).auth_user); } @@ -596,7 +596,7 @@ static int send_parsed_php(request_rec * r) TSRMLS_FETCH(); sprintf(mem_usage,"%u", (int) AG(allocated_memory_peak)); - ap_table_setn(r->notes, "mod_php_memory_usage", ap_pstrdup(r->pool,mem_usage)); + ap_table_setn(r->notes, "mod_php_memory_usage", ap_pstrdup(r->pool, mem_usage)); } #endif @@ -889,16 +889,16 @@ module MODULE_VAR_EXPORT php4_module = NULL, /* fixups */ NULL /* logger */ #if MODULE_MAGIC_NUMBER >= 19970103 - ,NULL /* header parser */ + , NULL /* header parser */ #endif #if MODULE_MAGIC_NUMBER >= 19970719 - ,NULL /* child_init */ + , NULL /* child_init */ #endif #if MODULE_MAGIC_NUMBER >= 19970728 - ,php_child_exit_handler /* child_exit */ + , php_child_exit_handler /* child_exit */ #endif #if MODULE_MAGIC_NUMBER >= 19970902 - ,NULL /* post read-request */ + , NULL /* post read-request */ #endif }; /* }}} */ diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c index 681493e86f..6b141c52b4 100644 --- a/sapi/apache/php_apache.c +++ b/sapi/apache/php_apache.c @@ -139,26 +139,26 @@ PHP_FUNCTION(apache_child_terminate) Get and set Apache request notes */ PHP_FUNCTION(apache_note) { - pval **arg_name,**arg_val; + pval **arg_name, **arg_val; char *note_val; int arg_count = ARG_COUNT(ht); TSRMLS_FETCH(); if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count,&arg_name,&arg_val) ==FAILURE ) { + zend_get_parameters_ex(arg_count, &arg_name, &arg_val) ==FAILURE ) { WRONG_PARAM_COUNT; } convert_to_string_ex(arg_name); - note_val = (char *) table_get(((request_rec *)SG(server_context))->notes,(*arg_name)->value.str.val); + note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val); if (arg_count == 2) { convert_to_string_ex(arg_val); - table_set(((request_rec *)SG(server_context))->notes,(*arg_name)->value.str.val,(*arg_val)->value.str.val); + table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val); } if (note_val) { - RETURN_STRING(note_val,1); + RETURN_STRING(note_val, 1); } else { RETURN_FALSE; } @@ -205,15 +205,15 @@ PHP_MINFO_FUNCTION(apache) #endif sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER); php_info_print_table_row(2, "Apache API Version", output_buf); - sprintf(output_buf, "%s:%u", serv->server_hostname,serv->port); + sprintf(output_buf, "%s:%u", serv->server_hostname, serv->port); php_info_print_table_row(2, "Hostname:Port", output_buf); #if !defined(WIN32) && !defined(WINNT) - sprintf(output_buf, "%s(%d)/%d", user_name,(int)user_id,(int)group_id); + sprintf(output_buf, "%s(%d)/%d", user_name, (int)user_id, (int)group_id); php_info_print_table_row(2, "User/Group", output_buf); - sprintf(output_buf, "Per Child: %d<br>Keep Alive: %s<br>Max Per Connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max); + sprintf(output_buf, "Per Child: %d<br>Keep Alive: %s<br>Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max); php_info_print_table_row(2, "Max Requests", output_buf); #endif - sprintf(output_buf, "Connection: %d<br>Keep-Alive: %d",serv->timeout,serv->keep_alive_timeout); + sprintf(output_buf, "Connection: %d<br>Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout); php_info_print_table_row(2, "Timeouts", output_buf); #if !defined(WIN32) && !defined(WINNT) php_info_print_table_row(2, "Server Root", server_root); @@ -304,12 +304,12 @@ PHP_FUNCTION(virtual) request_rec *rr = NULL; TSRMLS_FETCH(); - if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1,&filename) == FAILURE) { + if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(filename); - if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val,((request_rec *) SG(server_context))))) { + if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val); if (rr) destroy_sub_req (rr); RETURN_FALSE; @@ -355,7 +355,7 @@ PHP_FUNCTION(getallheaders) !strncasecmp(tenv[i].key, "authorization", 13))) { continue; } - if (add_assoc_string(return_value, tenv[i].key,(tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { + if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { RETURN_FALSE; } } @@ -370,65 +370,65 @@ PHP_FUNCTION(apache_lookup_uri) request_rec *rr=NULL; TSRMLS_FETCH(); - if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1,&filename) == FAILURE) { + if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(filename); - if(!(rr = sub_req_lookup_uri((*filename)->value.str.val,((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "URI lookup failed",(*filename)->value.str.val); + if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { + php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val); RETURN_FALSE; } object_init(return_value); - add_property_long(return_value,"status",rr->status); + add_property_long(return_value,"status", rr->status); if (rr->the_request) { - add_property_string(return_value,"the_request",rr->the_request,1); + add_property_string(return_value,"the_request", rr->the_request, 1); } if (rr->status_line) { - add_property_string(return_value,"status_line",(char *)rr->status_line,1); + add_property_string(return_value,"status_line", (char *)rr->status_line, 1); } if (rr->method) { - add_property_string(return_value,"method",(char *)rr->method,1); + add_property_string(return_value,"method", (char *)rr->method, 1); } if (rr->content_type) { - add_property_string(return_value,"content_type",(char *)rr->content_type,1); + add_property_string(return_value,"content_type", (char *)rr->content_type, 1); } if (rr->handler) { - add_property_string(return_value,"handler",(char *)rr->handler,1); + add_property_string(return_value,"handler", (char *)rr->handler, 1); } if (rr->uri) { - add_property_string(return_value,"uri",rr->uri,1); + add_property_string(return_value,"uri", rr->uri, 1); } if (rr->filename) { - add_property_string(return_value,"filename",rr->filename,1); + add_property_string(return_value,"filename", rr->filename, 1); } if (rr->path_info) { - add_property_string(return_value,"path_info",rr->path_info,1); + add_property_string(return_value,"path_info", rr->path_info, 1); } if (rr->args) { - add_property_string(return_value,"args",rr->args,1); + add_property_string(return_value,"args", rr->args, 1); } if (rr->boundary) { - add_property_string(return_value,"boundary",rr->boundary,1); + add_property_string(return_value,"boundary", rr->boundary, 1); } - add_property_long(return_value,"no_cache",rr->no_cache); - add_property_long(return_value,"no_local_copy",rr->no_local_copy); - add_property_long(return_value,"allowed",rr->allowed); - add_property_long(return_value,"sent_bodyct",rr->sent_bodyct); - add_property_long(return_value,"bytes_sent",rr->bytes_sent); - add_property_long(return_value,"byterange",rr->byterange); - add_property_long(return_value,"clength",rr->clength); + add_property_long(return_value,"no_cache", rr->no_cache); + add_property_long(return_value,"no_local_copy", rr->no_local_copy); + add_property_long(return_value,"allowed", rr->allowed); + add_property_long(return_value,"sent_bodyct", rr->sent_bodyct); + add_property_long(return_value,"bytes_sent", rr->bytes_sent); + add_property_long(return_value,"byterange", rr->byterange); + add_property_long(return_value,"clength", rr->clength); #if MODULE_MAGIC_NUMBER >= 19980324 if (rr->unparsed_uri) { - add_property_string(return_value,"unparsed_uri",rr->unparsed_uri,1); + add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1); } if(rr->mtime) { - add_property_long(return_value,"mtime",rr->mtime); + add_property_long(return_value,"mtime", rr->mtime); } #endif if(rr->request_time) { - add_property_long(return_value,"request_time",rr->request_time); + add_property_long(return_value,"request_time", rr->request_time); } destroy_sub_req(rr); @@ -445,13 +445,13 @@ PHP_FUNCTION(apache_exec_uri) request_rec *rr=NULL; TSRMLS_FETCH(); - if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1,&filename) == FAILURE) { + if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(filename); - if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val,((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "URI lookup failed",(*filename)->value.str.val); + if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { + php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val); RETURN_FALSE; } RETVAL_LONG(ap_run_sub_req(rr)); diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c index f67e4b35fb..572d46ebff 100644 --- a/sapi/apache/sapi_apache.c +++ b/sapi/apache/sapi_apache.c @@ -75,7 +75,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(SG(request_info).path_translated,&syntax_highlighter_ini TSRMLS_CC)){ + if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC)){ return OK; } else { return NOT_FOUND; diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c index 356a6ee978..135c242896 100644 --- a/sapi/caudium/caudium.c +++ b/sapi/caudium/caudium.c @@ -823,7 +823,7 @@ void pike_module_init( void ) } start_new_program(); /* Text */ pike_add_function("run", f_php_caudium_request_handler, - "function(string,mapping,object,function:void)", 0); + "function(string, mapping, object, function:void)", 0); end_class("Interpreter", 0); } diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index c8c366b844..b0d6134c7d 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -390,7 +390,7 @@ int main(int argc, char *argv[]) #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE,SIG_IGN); /* ignore SIGPIPE in standalone mode so + signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so that sockets created via fsockopen() don't kill PHP if the remote site closes it. in apache|apxs mode apache @@ -401,7 +401,7 @@ int main(int argc, char *argv[]) #ifdef ZTS - tsrm_startup(1,1,0, NULL); + tsrm_startup(1, 1, 0, NULL); #endif sapi_startup(&cgi_sapi_module); @@ -718,7 +718,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine return FAILURE; } file_handle.filename = argv0; - file_handle.opened_path = expand_filepath(argv0, NULL); + file_handle.opened_path = expand_filepath(argv0, NULL TSRMLS_CC); } else if (retval == SUCCESS) { /* #!php support */ c = fgetc(file_handle.handle.fp); diff --git a/sapi/fastcgi/fastcgi.c b/sapi/fastcgi/fastcgi.c index 3050bcd6ac..382d148807 100644 --- a/sapi/fastcgi/fastcgi.c +++ b/sapi/fastcgi/fastcgi.c @@ -237,7 +237,7 @@ static void init_request_info( TSRMLS_D ) char *ptr; while( ptr = strrchr(pt,'/') ) { *ptr = 0; - if ( stat(pt,&st) == 0 && S_ISREG(st.st_mode) ) { + if ( stat(pt, &st) == 0 && S_ISREG(st.st_mode) ) { /* * okay, we found the base script! * work out how many chars we had to strip off; @@ -350,7 +350,7 @@ int main(int argc, char *argv[]) #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE,SIG_IGN); /* ignore SIGPIPE in standalone mode so + signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so that sockets created via fsockopen() don't kill PHP if the remote site closes it. in apache|apxs mode apache diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c index 145e45cd26..da0c303ebc 100644 --- a/sapi/isapi/php4isapi.c +++ b/sapi/isapi/php4isapi.c @@ -788,14 +788,14 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) } CG(unclean_shutdown)=1; - _snprintf(buf,sizeof(buf)-1,"PHP has encountered a Stack overflow"); + _snprintf(buf, sizeof(buf)-1,"PHP has encountered a Stack overflow"); php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); } else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) { - _snprintf(buf,sizeof(buf)-1,"PHP has encountered an Access Violation at %p",e->ExceptionRecord->ExceptionAddress); + _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", e->ExceptionRecord->ExceptionAddress); php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); my_endthread(); } else { - _snprintf(buf,sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p",e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress); + _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress); php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); my_endthread(); } diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp index 846305ac6c..34084eee89 100644 --- a/sapi/isapi/stresstest/stresstest.cpp +++ b/sapi/isapi/stresstest/stresstest.cpp @@ -23,8 +23,8 @@ // // Simple wrappers for the heap APIS // -#define xmalloc(s) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(s)) -#define xfree(s) HeapFree(GetProcessHeap(),0,(s)) +#define xmalloc(s) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (s)) +#define xfree(s) HeapFree(GetProcessHeap(), 0, (s)) // // The mandatory exports from the ISAPI DLL @@ -64,9 +64,9 @@ typedef BOOL (WINAPI *VersionProc)(HSE_VERSION_INFO *) ; typedef DWORD (WINAPI *HttpExtProc)(EXTENSION_CONTROL_BLOCK *); BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *, TIsapiContext *) ; BOOL WINAPI GetServerVariable(HCONN, LPSTR, LPVOID, LPDWORD ); -BOOL WINAPI ReadClient(HCONN,LPVOID,LPDWORD); -BOOL WINAPI WriteClient(HCONN,LPVOID,LPDWORD,DWORD); -BOOL WINAPI ServerSupportFunction(HCONN,DWORD,LPVOID,LPDWORD,LPDWORD); +BOOL WINAPI ReadClient(HCONN, LPVOID, LPDWORD); +BOOL WINAPI WriteClient(HCONN, LPVOID, LPDWORD, DWORD); +BOOL WINAPI ServerSupportFunction(HCONN, DWORD, LPVOID, LPDWORD, LPDWORD); VersionProc IsapiGetExtensionVersion; HttpExtProc IsapiHttpExtensionProc; HSE_VERSION_INFO version_info; @@ -186,7 +186,7 @@ BOOL ReadGlobalEnvironment(const char *environment) DWORD i=0; if (fp) { char line[2048]; - while (fgets(line,sizeof(line)-1,fp)) { + while (fgets(line, sizeof(line)-1, fp)) { // file.php arg1 arg2 etc. char *p = strchr(line, '='); if (p) { @@ -209,7 +209,7 @@ BOOL ReadFileList(const char *filelist) } char line[2048]; int i=0; - while (fgets(line,sizeof(line)-1,fp)) { + while (fgets(line, sizeof(line)-1, fp)) { // file.php arg1 arg2 etc. stripcrlf(line); if (strlen(line)>3) { @@ -298,7 +298,7 @@ BOOL ParseTestFile(const char *path, const char *fn) FILE *ft = fopen(tn, "w+"); FILE *fe = fopen(en, "w+"); if (fp && ft && fe) { - while (fgets(line,sizeof(line)-1,fp)) { + while (fgets(line, sizeof(line)-1, fp)) { if (line[0]=='-') { if (_strnicmp(line, "--TEST--", 8)==0) { parsestate = test; @@ -371,7 +371,7 @@ BOOL GetTestFiles(const char *path) WIN32_FIND_DATA fd; memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - _snprintf(FindPath, sizeof(FindPath)-1, "%s\\*.*",path); + _snprintf(FindPath, sizeof(FindPath)-1, "%s\\*.*", path); HANDLE fh = FindFirstFile(FindPath, &fd); if (fh != INVALID_HANDLE_VALUE) { do { @@ -379,7 +379,7 @@ BOOL GetTestFiles(const char *path) !strchr(fd.cFileName, '.')) { // subdirectory, recurse into it char NewFindPath[MAX_PATH]; - _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s",path, fd.cFileName); + _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", path, fd.cFileName); GetTestFiles(NewFindPath); } else if (strstr(fd.cFileName, ".phpt")) { // got test file, parse it now @@ -400,12 +400,12 @@ void DeleteTempFiles(const char *mask) WIN32_FIND_DATA fd; memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - _snprintf(FindPath, sizeof(FindPath)-1, "%s\\%s",temppath, mask); + _snprintf(FindPath, sizeof(FindPath)-1, "%s\\%s", temppath, mask); HANDLE fh = FindFirstFile(FindPath, &fd); if (fh != INVALID_HANDLE_VALUE) { do { char NewFindPath[MAX_PATH]; - _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s",temppath, fd.cFileName); + _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", temppath, fd.cFileName); DeleteFile(NewFindPath); memset(&fd, 0, sizeof(WIN32_FIND_DATA)); } while (FindNextFile(fh, &fd) != 0); @@ -469,7 +469,7 @@ int main(int argc, char* argv[]) 0, NULL ); - fprintf(stderr,"Error: Dll 'php4isapi.dll' not found -%d\n%s\n", GetLastError(),lpMsgBuf); + fprintf(stderr,"Error: Dll 'php4isapi.dll' not found -%d\n%s\n", GetLastError(), lpMsgBuf); LocalFree( lpMsgBuf ); return -1; } @@ -479,12 +479,12 @@ int main(int argc, char* argv[]) IsapiGetExtensionVersion = (VersionProc)GetProcAddress(hDll,"GetExtensionVersion"); if (!IsapiGetExtensionVersion) { - fprintf(stderr,"Can't Get Extension Version %d\n",GetLastError()); + fprintf(stderr,"Can't Get Extension Version %d\n", GetLastError()); return -1; } IsapiHttpExtensionProc = (HttpExtProc)GetProcAddress(hDll,"HttpExtensionProc"); if (!IsapiHttpExtensionProc) { - fprintf(stderr,"Can't Get Extension proc %d\n",GetLastError()); + fprintf(stderr,"Can't Get Extension proc %d\n", GetLastError()); return -1; } @@ -658,7 +658,7 @@ BOOL WINAPI GetServerVariable(HCONN hConn, LPSTR lpszVariableName, rc = value.GetLength(); strncpy((char *)lpBuffer, value, *lpdwSize-1); } else - rc = GetEnvironmentVariable(lpszVariableName,(char *)lpBuffer,*lpdwSize) ; + rc = GetEnvironmentVariable(lpszVariableName, (char *)lpBuffer, *lpdwSize) ; if (!rc) { // return of 0 indicates the variable was not found SetLastError(ERROR_NO_DATA); @@ -684,7 +684,7 @@ BOOL WINAPI ReadClient(HCONN hConn, LPVOID lpBuffer, LPDWORD lpdwSize) { if (!c) return FALSE; if (c->in != INVALID_HANDLE_VALUE) - return ReadFile(c->in,lpBuffer,(*lpdwSize), lpdwSize,NULL); + return ReadFile(c->in, lpBuffer, (*lpdwSize), lpdwSize, NULL); return FALSE; } @@ -697,7 +697,7 @@ BOOL WINAPI WriteClient(HCONN hConn, LPVOID lpBuffer, LPDWORD lpdwSize, if (!c) return FALSE; if (c->out != INVALID_HANDLE_VALUE) - return WriteFile(c->out,lpBuffer,*lpdwSize, lpdwSize,NULL); + return WriteFile(c->out, lpBuffer, *lpdwSize, lpdwSize, NULL); return FALSE; } @@ -737,7 +737,7 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, if (temp) xfree(temp); dwBytes = strlen(lpszRespBuf); - bRet = WriteClient(0,lpszRespBuf,&dwBytes,0); + bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0); xfree(lpszRespBuf); break; @@ -761,7 +761,7 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, (lpdwSize > 0)?lpvBuffer:0); xfree(temp); dwBytes = strlen(lpszRespBuf); - bRet = WriteClient(0,lpszRespBuf,&dwBytes,0); + bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0); xfree(lpszRespBuf); break; default: @@ -785,11 +785,11 @@ char * MakeDateStr(void){ GetSystemTime(&systime); - wsprintf(szDate,"%s, %d %s %d %d:%d.%d",DaysofWeek[systime.wDayOfWeek], + wsprintf(szDate,"%s, %d %s %d %d:%d.%d", DaysofWeek[systime.wDayOfWeek], systime.wDay, Months[systime.wMonth], systime.wYear, - systime.wHour,systime.wMinute, + systime.wHour, systime.wMinute, systime.wSecond ); return szDate; @@ -801,7 +801,7 @@ BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *ECB, TIsapiContex char * temp; ECB->cbSize = sizeof(EXTENSION_CONTROL_BLOCK); - ECB->dwVersion = MAKELONG(HSE_VERSION_MINOR,HSE_VERSION_MAJOR); + ECB->dwVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR); ECB->ConnID = (void *)context; // // Pointers to the functions the DLL will call. @@ -831,15 +831,16 @@ BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *ECB, TIsapiContex // // Works like _getenv(), but uses win32 functions instead. // -char * GetEnv(LPSTR lpszEnvVar) { +char *GetEnv(LPSTR lpszEnvVar) +{ - char *var,dummy; + char *var, dummy; DWORD dwLen; if (!lpszEnvVar) return ""; - dwLen =GetEnvironmentVariable(lpszEnvVar,&dummy,1); + dwLen =GetEnvironmentVariable(lpszEnvVar, &dummy, 1); if (dwLen == 0) return ""; @@ -847,7 +848,7 @@ char * GetEnv(LPSTR lpszEnvVar) { var = (char *)xmalloc(dwLen); if (!var) return ""; - (void)GetEnvironmentVariable(lpszEnvVar,var,dwLen); + (void)GetEnvironmentVariable(lpszEnvVar, var, dwLen); return var; } diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c index a7fbebcde1..cb3b524723 100644 --- a/sapi/phttpd/phttpd.c +++ b/sapi/phttpd/phttpd.c @@ -62,7 +62,7 @@ php_phttpd_sapi_ub_write(const char *str, uint str_length) int sent_bytes; TSRMLS_FETCH(); - sent_bytes = fd_write(PHG(cip)->fd,str,str_length); + sent_bytes = fd_write(PHG(cip)->fd, str, str_length); if (sent_bytes == -1) { php_handle_aborted_connection(); @@ -78,7 +78,7 @@ php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str char *p; TSRMLS_FETCH(); - http_sendheaders(PHG(cip)->fd,PHG(cip), SG(sapi_headers).http_response_code, NULL); + http_sendheaders(PHG(cip)->fd, PHG(cip), SG(sapi_headers).http_response_code, NULL); header_name = sapi_header->header; header_content = p = strchr(header_name, ':'); @@ -89,7 +89,7 @@ php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str header_content++; } while (*header_content == ' '); - fd_printf(PHG(cip)->fd,"%s: %s\n",header_name,header_content); + fd_printf(PHG(cip)->fd,"%s: %s\n", header_name, header_content); *p = ':'; } @@ -194,7 +194,7 @@ static sapi_module_struct phttpd_sapi_module = { static void php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC) { - memset(&SG(request_info),0,sizeof(sapi_globals_struct)); /* pfusch! */ + memset(&SG(request_info), 0, sizeof(sapi_globals_struct)); /* pfusch! */ SG(request_info).query_string = PHG(cip)->hip->request; SG(request_info).request_method = PHG(cip)->hip->method; diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c index bad3621e7d..09ea71c4d3 100644 --- a/sapi/roxen/roxen.c +++ b/sapi/roxen/roxen.c @@ -716,7 +716,7 @@ void pike_module_init( void ) ADD_STORAGE(php_roxen_request); set_init_callback(clear_struct); pike_add_function("run", f_php_roxen_request_handler, - "function(string,mapping,object,function:int)", 0); + "function(string, mapping, object, function:int)", 0); add_program_constant("Interpreter", (php_program = end_program()), 0); } diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c index dda106fe4a..edfce72b81 100644 --- a/sapi/servlet/servlet.c +++ b/sapi/servlet/servlet.c @@ -355,7 +355,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send * changed, so save it and change it back as quickly as possible * in the hopes that Java doesn't notice. */ - getcwd(cwd,MAXPATHLEN); + getcwd(cwd, MAXPATHLEN); retval = php_fopen_primary_script(&file_handle TSRMLS_CC); chdir(cwd); #endif @@ -363,7 +363,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send if (retval == FAILURE) { php_request_shutdown((void *) 0); php_module_shutdown(); - ThrowIOException(jenv,file_handle.filename); + ThrowIOException(jenv, file_handle.filename); return; } |