From: Holger Zimmermann Date: Sun, 8 Apr 2001 10:49:07 +0000 (+0000) Subject: Reorganized the #define's in the header. X-Git-Tag: php-4.0.6RC1~458 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c0f71e7b337ca92071d1983fd64dbcd3a69e934;p=php Reorganized the #define's in the header. --- diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index 6880f01e7e..9a1d9234d5 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -23,10 +23,6 @@ /* $Id$ */ -#if WIN32|WINNT -# include -#endif - #include "pi3web_sapi.h" #include "php.h" #include "php_main.h" @@ -107,7 +103,7 @@ static void php_info_pi3web(ZEND_MODULE_INFO_FUNC_ARGS) if (lpCB->GetServerVariable(lpCB->ConnID, *p, variable_buf, &variable_len) && variable_buf[0]) { php_info_print_table_row(2, *p, variable_buf); - } else if (PIPlatform_getLastError() == ERROR_INSUFFICIENT_BUFFER) { + } else if (PIPlatform_getLastError() == PIAPI_EINVAL) { char *tmp_variable_buf; tmp_variable_buf = (char *) emalloc(variable_len); @@ -267,7 +263,7 @@ static char *sapi_pi3web_read_cookies(SLS_D) if (lpCB->GetServerVariable(lpCB->ConnID, "HTTP_COOKIE", variable_buf, &variable_len)) { return estrndup(variable_buf, variable_len); - } else if (PIPlatform_getLastError()==ERROR_INSUFFICIENT_BUFFER) { + } else if (PIPlatform_getLastError()==PIAPI_EINVAL) { char *tmp_variable_buf = (char *) emalloc(variable_len+1); if (lpCB->GetServerVariable(lpCB->ConnID, "HTTP_COOKIE", tmp_variable_buf, &variable_len)) { @@ -339,7 +335,7 @@ static void hash_pi3web_variables(ELS_D SLS_DC) if (lpCB->GetServerVariable(lpCB->ConnID, "ALL_HTTP", static_variable_buf, &variable_len)) { variable_buf = static_variable_buf; } else { - if (PIPlatform_getLastError()==ERROR_INSUFFICIENT_BUFFER) { + if (PIPlatform_getLastError()==PIAPI_EINVAL) { variable_buf = (char *) emalloc(variable_len); if (!lpCB->GetServerVariable(lpCB->ConnID, "ALL_HTTP", variable_buf, &variable_len)) { efree(variable_buf); @@ -377,7 +373,7 @@ static void hash_pi3web_variables(ELS_D SLS_DC) } -DWORD fnWrapperProc(LPCONTROL_BLOCK lpCB) +DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB) { zend_file_handle file_handle; SLS_FETCH(); diff --git a/sapi/pi3web/pi3web_sapi.h b/sapi/pi3web/pi3web_sapi.h index 340d98228e..8ca4392db0 100644 --- a/sapi/pi3web/pi3web_sapi.h +++ b/sapi/pi3web/pi3web_sapi.h @@ -1,21 +1,28 @@ #ifndef _PI3WEB_SAPI_H_ #define _PI3WEB_SAPI_H_ -//#if WIN32 -//#include -//#else -#define far -#define ERROR_INSUFFICIENT_BUFFER 122L -typedef int BOOL; -typedef void far *LPVOID; -typedef LPVOID HCONN; -typedef unsigned long DWORD; -typedef DWORD far *LPDWORD; -typedef char CHAR; -typedef CHAR *LPSTR; -typedef unsigned char BYTE; -typedef BYTE far *LPBYTE; -//#endif +#ifdef PHP_WIN32 +# include +# include +# ifdef SAPI_EXPORTS +# define MODULE_API __declspec(dllexport) +# else +# define MODULE_API __declspec(dllimport) +# endif +#else +# define far +# define MODULE_API + + typedef int BOOL; + typedef void far *LPVOID; + typedef LPVOID HCONN; + typedef unsigned long DWORD; + typedef DWORD far *LPDWORD; + typedef char CHAR; + typedef CHAR *LPSTR; + typedef unsigned char BYTE; + typedef BYTE far *LPBYTE; +#endif #ifdef __cplusplus extern "C" { @@ -72,17 +79,14 @@ typedef struct _CONTROL_BLOCK { } CONTROL_BLOCK, *LPCONTROL_BLOCK; -#ifndef WIN32 -#define __stdcall -#endif +MODULE_API DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB); +MODULE_API BOOL PHP4_startup(); +MODULE_API BOOL PHP4_shutdown(); -DWORD fnWrapperProc(LPCONTROL_BLOCK lpCB); +// the following type declaration is for the server side +typedef DWORD ( * PFN_WRAPPERFUNC )( CONTROL_BLOCK *pCB ); -// the following type declarations is for the server side -typedef DWORD ( * PFN_WRAPPERPROC )( CONTROL_BLOCK *pCB ); -BOOL PHP4_startup(); -BOOL PHP4_shutdown(); #ifdef __cplusplus }