summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Zimmermann <holger@php.net>2001-04-08 10:49:07 +0000
committerHolger Zimmermann <holger@php.net>2001-04-08 10:49:07 +0000
commit8c0f71e7b337ca92071d1983fd64dbcd3a69e934 (patch)
treeed6d6546d93428bfa2010ec274541b69bc66b695
parent9b7aa43dd4873fc209e9462ee43ae2a7b7810543 (diff)
downloadphp-git-8c0f71e7b337ca92071d1983fd64dbcd3a69e934.tar.gz
Reorganized the #define's in the header.
-rw-r--r--sapi/pi3web/pi3web_sapi.c12
-rw-r--r--sapi/pi3web/pi3web_sapi.h50
2 files changed, 31 insertions, 31 deletions
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 <windows.h>
-#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 <windows.h>
-//#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 <windows.h>
+# include <httpext.h>
+# 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
}