Back to index

php5  5.3.10
pi3web_sapi.h
Go to the documentation of this file.
00001 #ifndef _PI3WEB_SAPI_H_
00002 #define _PI3WEB_SAPI_H_
00003 
00004 #ifdef PHP_WIN32
00005 #      include <windows.h>
00006 #      ifdef PHP5PI3WEB_EXPORTS
00007 #             define MODULE_API __declspec(dllexport) 
00008 #      else
00009 #             define MODULE_API __declspec(dllimport) 
00010 #      endif
00011 #else
00012 #      if defined(__GNUC__) && __GNUC__ >= 4
00013 #             define MODULE_API __attribute__ ((visibility("default")))
00014 #      else
00015 #             define MODULE_API
00016 #      endif
00017 #      define far
00018 
00019        typedef int BOOL;
00020        typedef void far *LPVOID;
00021        typedef unsigned long DWORD;
00022        typedef DWORD far *LPDWORD;
00023        typedef char CHAR;
00024        typedef CHAR *LPSTR;
00025        typedef unsigned char BYTE;
00026        typedef BYTE far *LPBYTE;
00027 #endif
00028 
00029        typedef LPVOID HCONN;
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 #define PHP_MODE_STANDARD  1
00036 #define PHP_MODE_HIGHLIGHT 2
00037 #define PHP_MODE_INDENT    3
00038 #define PHP_MODE_LINT          4
00039 
00040 //
00041 // passed to the procedure on a new request
00042 //
00043 typedef struct _CONTROL_BLOCK {
00044     DWORD     cbSize;                 // size of this struct.
00045     HCONN     ConnID;                 // Context number not to be modified!
00046     DWORD     dwHttpStatusCode;       // HTTP Status code
00047     CHAR      lpszLogData[80];        // null terminated log info
00048 
00049     LPSTR     lpszMethod;             // REQUEST_METHOD
00050     LPSTR     lpszQueryString;        // QUERY_STRING
00051     LPSTR     lpszPathInfo;           // PATH_INFO
00052     LPSTR     lpszPathTranslated;     // PATH_TRANSLATED
00053        LPSTR     lpszFileName;           // FileName to PHP3 physical file
00054        LPSTR     lpszUri;                    // The request URI
00055        LPSTR     lpszReq;                    // The whole HTTP request line
00056        LPSTR     lpszUser;                   // The authenticated user
00057        LPSTR     lpszPassword;               // The authenticated password
00058 
00059     DWORD     cbTotalBytes;           // Total bytes indicated from client
00060     DWORD     cbAvailable;            // Available number of bytes
00061     LPBYTE    lpbData;                // pointer to cbAvailable bytes
00062 
00063     LPSTR     lpszContentType;        // Content type of client data
00064        DWORD     dwBehavior;                       // PHP behavior (standard, highlight, intend
00065 
00066 
00067     LPVOID (* GetVariableNames) (HCONN      hConn);
00068 
00069     BOOL (* GetServerVariable) ( HCONN       hConn,
00070                                  LPSTR       lpszVariableName,
00071                                  LPVOID      lpvBuffer,
00072                                  LPDWORD     lpdwSize );
00073 
00074     BOOL (* WriteClient)  ( HCONN      hConn,
00075                             LPVOID     lpvBuffer,
00076                             LPDWORD    lpdwBytes,
00077                             DWORD      dwReserved );
00078 
00079     BOOL (* ReadClient)  ( HCONN      hConn,
00080                            LPVOID     lpvBuffer,
00081                            LPDWORD    lpdwSize );
00082 
00083     BOOL (* SendHeaderFunction)( HCONN      hConn,
00084                                  LPDWORD    lpdwSize,
00085                                  LPDWORD    lpdwDataType );
00086 
00087 } CONTROL_BLOCK, *LPCONTROL_BLOCK;
00088 
00089 MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB);
00090 MODULE_API BOOL PHP5_startup();
00091 MODULE_API BOOL PHP5_shutdown();
00092 
00093 // the following type declaration is for the server side
00094 typedef DWORD ( * PFN_WRAPPERFUNC )( CONTROL_BLOCK *pCB );
00095 
00096 
00097 
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101 
00102 #endif  // end definition _PI3WEB_SAPI_H_