home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / MFCINC.PAK / AFXISAPI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  17.2 KB  |  555 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1995 Microsoft Corporation
  3. // All rights reserved.
  4.  
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #ifndef __AFXISAPI_H_
  12. #define __AFXISAPI_H_
  13.  
  14. #ifdef _UNICODE
  15. #error ERROR: ISAPI does not yet support Unicode.
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // Turn off warnings for /W4
  20. // To resume any of these warning: #pragma warning(default: 4xxx)
  21. // which should be placed after the AFX include files
  22. #ifndef ALL_WARNINGS
  23. // warnings generated with common MFC/Windows code
  24. #pragma warning(disable: 4127)  // constant expression for TRACE/ASSERT
  25. #pragma warning(disable: 4134)  // message map member fxn casts
  26. #pragma warning(disable: 4201)  // nameless unions are part of C++
  27. #pragma warning(disable: 4511)  // private copy constructors are good to have
  28. #pragma warning(disable: 4512)  // private operator= are good to have
  29. #pragma warning(disable: 4514)  // unreferenced inlines are common
  30. #pragma warning(disable: 4710)  // private constructors are disallowed
  31. #pragma warning(disable: 4705)  // statement has no effect in optimized code
  32. // warnings caused by normal optimizations
  33. #ifndef _DEBUG
  34. #pragma warning(disable: 4701)  // local variable *may* be used without init
  35. #pragma warning(disable: 4702)  // unreachable code caused by optimizations
  36. #pragma warning(disable: 4791)  // loss of debugging info in retail version
  37. #endif
  38. // warnings specific to _AFXDLL version
  39. #ifdef _AFXDLL
  40. #pragma warning(disable: 4204)  // non-constant aggregate initializer
  41. #endif
  42. #ifdef _AFXDLL
  43. #pragma warning(disable: 4275)  // deriving exported class from non-exported
  44. #pragma warning(disable: 4251)  // using non-exported as public in exported
  45. #endif
  46. #endif //!ALL_WARNINGS
  47.  
  48. #define STRICT 1
  49.  
  50. #include <httpext.h>
  51. #include <httpfilt.h>
  52.  
  53. #ifndef _INC_STDLIB
  54.     #include <stdlib.h>
  55. #endif
  56. #ifndef _INC_TCHAR
  57.     #include <tchar.h>
  58. #endif
  59.  
  60. #ifndef UNUSED
  61. #ifdef _DEBUG
  62. #define UNUSED(x)
  63. #else
  64. #define UNUSED(x) x
  65. #endif
  66. #endif
  67.  
  68. #define AFXISAPI __stdcall
  69. #define AFXIS_DATADEF
  70.  
  71. /////////////////////////////////////////////////////////////////////////////
  72. // Internet Server API Library
  73.  
  74. #ifndef _AFX_NOFORCE_LIBS
  75. #ifndef _MAC
  76.  
  77. #ifdef _AFXDLL
  78. #ifdef _DEBUG
  79.     #ifdef _UNICODE
  80.         #pragma comment(lib, "MFCISUD.lib")
  81.     #else
  82.         #pragma comment(lib, "EAFXISD.lib")
  83.     #endif
  84. #else
  85.     #ifdef _UNICODE
  86.         #pragma comment(lib, "MFCISU.lib")
  87.     #else
  88.         #pragma comment(lib, "EAFXIS.lib")
  89.     #endif // _UNICODE
  90. #endif // _DEBUG
  91. #else
  92. #ifdef _DEBUG
  93.     #ifdef _UNICODE
  94.         #pragma comment(lib, "UAFXISD.lib")
  95.     #else
  96.         #pragma comment(lib, "NAFXISD.lib")
  97.     #endif
  98. #else
  99.     #ifdef _UNICODE
  100.         #pragma comment(lib, "UAFXIS.lib")
  101.     #else
  102.         #pragma comment(lib, "NAFXIS.lib")
  103.     #endif // _UNICODE
  104. #endif // _DEBUG
  105. #endif // _AFXDLL
  106.  
  107. #pragma comment(lib, "kernel32.lib")
  108. #pragma comment(lib, "user32.lib")
  109. #pragma comment(lib, "winspool.lib")
  110. #pragma comment(lib, "advapi32.lib")
  111.  
  112. #endif // _MAC
  113. #endif // _AFX_NOFORCE_LIBS
  114.  
  115. extern HINSTANCE AFXISAPI AfxGetResourceHandle();
  116.  
  117. /////////////////////////////////////////////////////////////////////////////
  118. // AFXIASPI - MFC Internet Server API support
  119.  
  120. // Classes declared in this file
  121.  
  122. class CHtmlStream;
  123. class CHttpServerContext;
  124. class CHttpServer;
  125. class CHttpFilterContext;
  126. class CHttpFilter;
  127.  
  128.  
  129. ///////////////////////////////////////////////////////////////////////
  130. // CHtmlStream -- manages in-memory HTML
  131.  
  132. class CHtmlStream
  133. {
  134. public:
  135. // Constructors
  136.     CHtmlStream(UINT nGrowBytes = 4096);
  137.     CHtmlStream(BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0);
  138.  
  139. // Operations
  140.     void Attach(BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0);
  141.     BYTE* Detach();
  142.     DWORD GetStreamSize() const;
  143.  
  144.     virtual void Abort();
  145.     virtual void Close();
  146.     virtual void InitStream();
  147.     virtual void Reset();
  148.  
  149.     CHtmlStream& operator<<(LPCTSTR psz);
  150.     CHtmlStream& operator<<(short int w);
  151.     CHtmlStream& operator<<(long int dw);
  152.     CHtmlStream& operator<<(CHtmlStream& stream);
  153.     CHtmlStream& operator<<(double d);
  154.     CHtmlStream& operator<<(float f);
  155.  
  156. // Advanced Overridables
  157. protected:
  158.     virtual BYTE* Alloc(DWORD nBytes);
  159.     virtual BYTE* Realloc(BYTE* lpMem, DWORD nBytes);
  160.     virtual BYTE* Memcpy(BYTE* lpMemTarget, const BYTE* lpMemSource, UINT nBytes);
  161.     virtual void GrowStream(DWORD dwNewLen);
  162.     virtual void Write(const void* lpBuf, UINT nCount);
  163.  
  164.     DWORD    m_nStreamSize;
  165.  
  166. public:
  167.     virtual void Free(BYTE* lpMem);
  168.  
  169. // Implementation
  170. protected:
  171.     UINT    m_nGrowBytes;
  172.     DWORD    m_nPosition;
  173.     DWORD    m_nBufferSize;
  174.     BYTE*    m_lpBuffer;
  175.     BOOL    m_bAutoDelete;
  176.  
  177. public:
  178.     virtual ~CHtmlStream();
  179. };
  180.  
  181.  
  182. ///////////////////////////////////////////////////////////////////////
  183. // Status codes for HTTP transactions
  184.  
  185. #define HTTP_STATUS_OK                200        // OK
  186. #define HTTP_STATUS_CREATED            201        // created
  187. #define HTTP_STATUS_ACCEPTED        202        // accepted
  188. #define HTTP_STATUS_NO_CONTENT        204        // no content
  189. #define HTTP_STATUS_REDIRECT        301        // moved permanently
  190. #define HTTP_STATUS_TEMP_REDIRECT    302        // moved temporarily
  191. #define HTTP_STATUS_NOT_MODIFIED    304        // not modified
  192. #define HTTP_STATUS_BAD_REQUEST        400        // bad request
  193. #define HTTP_STATUS_AUTH_REQUIRED    401        // unauthorized
  194. #define HTTP_STATUS_FORBIDDEN        403        // forbidden
  195. #define HTTP_STATUS_NOT_FOUND        404        // not found
  196. #define HTTP_STATUS_SERVER_ERROR    500        // internal server error
  197. #define HTTP_STATUS_NOT_IMPLEMENTED    501        // not implemented
  198. #define HTTP_STATUS_BAD_GATEWAY        502        // bad gateway
  199. #define HTTP_STATUS_SERVICE_NA        503        // service unavailaibe
  200.  
  201.  
  202. ///////////////////////////////////////////////////////////////////////
  203. // Parse Map macros
  204.  
  205. #ifndef AFX_PARSE_CALL
  206. #define AFX_PARSE_CALL
  207. #endif
  208.  
  209. typedef void (AFX_PARSE_CALL CHttpServer::*AFX_PISAPICMD)(CHttpServerContext* pCtxt);
  210.  
  211. struct AFX_PARSEMAP_ENTRY;    // declared after CHttpServer, below
  212.  
  213. struct AFX_PARSEMAP
  214. {
  215.     UINT (PASCAL* pfnGetNumMapEntries)();
  216. #ifdef _AFXDLL
  217.     const AFX_PARSEMAP* (PASCAL* pfnGetBaseMap)();
  218. #else
  219.     const AFX_PARSEMAP* pBaseMap;
  220. #endif
  221.     const AFX_PARSEMAP_ENTRY* lpEntries;
  222.     ~AFX_PARSEMAP();
  223. };
  224.  
  225. struct AFX_PARSEMAP_ENTRY_PARAMS
  226. {
  227.     int    nParams;            // number of parameters
  228.     int nRequired;            // number of parameters without defaults
  229.     // all of these are arrays!
  230.     LPTSTR*    ppszInfo;        // pointers to name[2n], pointer to default[2n+1]
  231.     BYTE*    ppszDefaults;    // pointers to coerced default values
  232.     BYTE*     ppszValues;        // pointers to coerced actual values
  233.     ~AFX_PARSEMAP_ENTRY_PARAMS();
  234. };
  235.  
  236. #ifdef _AFXDLL
  237. #define DECLARE_PARSE_MAP() \
  238. private: \
  239.     static AFX_PARSEMAP_ENTRY _parseEntries[]; \
  240. public: \
  241.     static const AFX_PARSEMAP parseMap; \
  242.     static const AFX_PARSEMAP* PASCAL _GetBaseParseMap(); \
  243.     static UINT PASCAL GetNumMapEntries(); \
  244.     virtual const AFX_PARSEMAP* GetParseMap() const; \
  245.  
  246. #else
  247. #define DECLARE_PARSE_MAP() \
  248. private: \
  249.     static AFX_PARSEMAP_ENTRY _parseEntries[]; \
  250. public: \
  251.     static const AFX_PARSEMAP parseMap; \
  252.     static UINT PASCAL GetNumMapEntries(); \
  253.     virtual const AFX_PARSEMAP* GetParseMap() const; \
  254.  
  255. #endif // _AFXDLL
  256.  
  257. #ifdef _AFXDLL
  258. #define BEGIN_PARSE_MAP(theClass, baseClass) \
  259.     const AFX_PARSEMAP* PASCAL theClass::_GetBaseParseMap() \
  260.         { return &baseClass::parseMap; } \
  261.     typedef void (AFX_PARSE_CALL theClass::*theClass##CALL)(CHttpServerContext*); \
  262.     const AFX_PARSEMAP* theClass::GetParseMap() const \
  263.         { return &theClass::parseMap; } \
  264.     AFXIS_DATADEF const AFX_PARSEMAP theClass::parseMap = \
  265.         { &theClass::GetNumMapEntries, &theClass::_GetBaseParseMap, &theClass::_parseEntries[0] }; \
  266.     AFX_PARSEMAP_ENTRY theClass::_parseEntries[] = \
  267.     { \
  268.  
  269. #else
  270. #define BEGIN_PARSE_MAP(theClass, baseClass) \
  271.     typedef void (AFX_PARSE_CALL theClass::*theClass##CALL)(CHttpServerContext*); \
  272.     const AFX_PARSEMAP* theClass::GetParseMap() const \
  273.         { return &theClass::parseMap; } \
  274.     AFXIS_DATADEF const AFX_PARSEMAP theClass::parseMap = \
  275.         { &theClass::GetNumMapEntries, &baseClass::parseMap, &theClass::_parseEntries[0] }; \
  276.     AFX_PARSEMAP_ENTRY theClass::_parseEntries[] = \
  277.     { \
  278.  
  279. #endif
  280.  
  281. #define ON_PARSE_COMMAND(FnName, mapClass, Args) \
  282.     { _T(#FnName), (AFX_PISAPICMD) (mapClass##CALL)mapClass::FnName, Args },
  283.  
  284. #define ON_PARSE_COMMAND_PARAMS(Params) \
  285.     { NULL, (AFX_PISAPICMD) NULL, Params },
  286.  
  287. #define DEFAULT_PARSE_COMMAND(FnName, mapClass) \
  288.     { _T(#FnName), (AFX_PISAPICMD) (mapClass##CALL)mapClass::FnName, NULL },
  289.  
  290. #define END_PARSE_MAP(theClass) \
  291.     }; \
  292.     UINT PASCAL theClass::GetNumMapEntries() { \
  293.         return sizeof(theClass::_parseEntries) /\
  294.         sizeof(AFX_PARSEMAP_ENTRY); } \
  295.  
  296.  
  297. ///////////////////////////////////////////////////////////////////////
  298. //  
  299.  
  300. class CHttpServerContext
  301. {
  302. public:
  303.     CHttpServerContext(EXTENSION_CONTROL_BLOCK* pECB);
  304.     virtual ~CHttpServerContext();
  305.  
  306. // Operations
  307.     BOOL GetServerVariable(LPTSTR lpszVariableName,
  308.         LPVOID lpvBuffer, LPDWORD lpdwSize);
  309.     BOOL WriteClient(LPVOID lpvBuffer, LPDWORD lpdwBytes, DWORD dwReserved = 0);
  310.     BOOL ReadClient(LPVOID lpvBuffer, LPDWORD lpdwSize);
  311.     BOOL ServerSupportFunction(DWORD dwHSERRequest,
  312.         LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType);
  313.  
  314.     CHttpServerContext& operator<<(LPCTSTR psz);
  315.     CHttpServerContext& operator<<(long int dw);
  316.     CHttpServerContext& operator<<(short int w);
  317.     CHttpServerContext& operator<<(CHtmlStream& stream);
  318.     CHttpServerContext& operator<<(double d);
  319.     CHttpServerContext& operator<<(float f);
  320.  
  321.     void Reset();
  322.  
  323. // Attributes
  324.     EXTENSION_CONTROL_BLOCK* const m_pECB;
  325.     CHtmlStream* m_pStream;
  326.     DWORD m_dwEndOfHeaders;
  327. #ifdef _DEBUG
  328.     DWORD m_dwOldEndOfHeaders;
  329. #endif
  330. };
  331.  
  332.  
  333. ///////////////////////////////////////////////////////////////////////
  334. // Internet Information Server Extension Support
  335.  
  336. class CHttpServer
  337. {
  338. public:
  339.     CHttpServer(TCHAR cDelimiter = '&');
  340.     virtual ~CHttpServer();
  341.  
  342.     enum errors {
  343.         callOK = 0,            // everything is fine
  344.         callParamRequired,    // a required parameter was missing
  345.         callBadParamCount,    // there were too many or too few parameters
  346.         callBadCommand,        // the command name was not found
  347.         callNoStackSpace,    // no stack space was available
  348.         callNoStream,        // no CHtmlStream was available
  349.         callMissingQuote,    // a parameter had a bad format
  350.         callMissingParams,    // no parameters were available
  351.         callBadParam,        // a paremeter had a bad format (ie, only one quote)
  352.     };
  353.  
  354. // overridables
  355.     virtual int CallFunction(CHttpServerContext* pCtxt,
  356.         LPTSTR pszQuery, LPTSTR pszCommand);
  357.     virtual    BOOL OnParseError(CHttpServerContext* pCtxt, int nCause);
  358.  
  359. // operations
  360.     virtual void EndContent(CHttpServerContext* pCtxt) const;
  361.     virtual void StartContent(CHttpServerContext* pCtxt) const;
  362.     virtual void WriteTitle(CHttpServerContext* pCtxt) const;
  363.     virtual LPCTSTR GetTitle() const;
  364.     void AddHeader(CHttpServerContext* pCtxt, LPCTSTR pszString) const;
  365.  
  366.     virtual DWORD HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB);
  367.     virtual BOOL GetExtensionVersion(HSE_VERSION_INFO *pVer);
  368.     virtual CHtmlStream* ConstructStream();
  369.  
  370.     virtual BOOL InitInstance(CHttpServerContext* pCtxt);
  371.  
  372. // implementation
  373.  
  374. protected:
  375.     UINT PASCAL GetStackSize(const BYTE* pbParams);
  376.     int CallMemberFunc(CHttpServerContext* pCtxt,
  377.         const AFX_PARSEMAP_ENTRY* pEntry,
  378.         AFX_PARSEMAP_ENTRY* pParams, LPTSTR szParams);
  379.     LPTSTR GetQuery(CHttpServerContext* pCtxt,
  380.         LPTSTR lpszQuery, DWORD cbQuery);
  381.     const AFX_PARSEMAP_ENTRY* LookUp(LPCTSTR szMethod,
  382.         const AFX_PARSEMAP*& pMap, AFX_PARSEMAP_ENTRY*& pParams,
  383.         AFX_PISAPICMD pCmdDefault = NULL);
  384.     int CountParams(LPCTSTR pszCommandLine, int& nCount);
  385.     int ParseDefaultParams(AFX_PARSEMAP_ENTRY* pParams,
  386.         int nParams, AFX_PARSEMAP_ENTRY_PARAMS*& pBlock,
  387.         const BYTE* pbTypes);
  388.     LPVOID PreprocessString(LPTSTR psz);
  389.     void BuildStatusCode(LPTSTR szResponse, DWORD dwCode);
  390.  
  391. #if defined(_PPC_) || defined(_MPPC_)
  392.     int PushDefaultStackArgs(BYTE* pStack,
  393.         CHttpServerContext* pCtxt, const BYTE* pbParams,
  394.         LPTSTR lpszParams, AFX_PARSEMAP_ENTRY_PARAMS* pDefParams,
  395.         int nSizeArgs);
  396.     int PushStackArgs(BYTE* pStack, CHttpServerContext* pCtxt,
  397.         const BYTE* pbParams, LPTSTR lpszParams, UINT nSizeArgs);
  398.     BYTE* StoreStackParameter(BYTE* pStack, BYTE nType,
  399.         LPTSTR pszCurParam, UINT nSizeArgs, BOOL bDoShadow);
  400.     BYTE* StoreRawStackParameter(BYTE* pStack, BYTE nType,
  401.         BYTE* pRawParam, int nSizeArgs);
  402. #else
  403.     int PushDefaultStackArgs(BYTE* pStack,
  404.         CHttpServerContext* pCtxt, const BYTE* pbParams,
  405.         LPTSTR lpszParams, AFX_PARSEMAP_ENTRY_PARAMS* pDefParams);
  406.     int PushStackArgs(BYTE* pStack, CHttpServerContext* pCtxt,
  407.         const BYTE* pbParams, LPTSTR lpszParams);
  408.     BYTE* StoreStackParameter(BYTE* pStack, BYTE nType, LPTSTR pszParam);
  409.     BYTE* StoreRawStackParameter(BYTE* pStack, BYTE nType, BYTE* pRawParam);
  410. #endif
  411.  
  412.     LPCRITICAL_SECTION m_pCritSec;
  413.     const TCHAR m_cTokenDelimiter;    // can't EVER change
  414.  
  415.     DECLARE_PARSE_MAP()
  416. };
  417.  
  418. extern "C" BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer);
  419. extern "C" DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB);
  420.  
  421. struct AFX_PARSEMAP_ENTRY
  422. {
  423.     LPTSTR            pszFnName;        // if default param entry, ptr to AFX_PARSEMAP_ENTRY_PARAMS
  424.     AFX_PISAPICMD    pfn;            // NULL if default param entry
  425.     LPSTR            pszArgs;        // NULL if default function entry
  426. };
  427.  
  428. ///////////////////////////////////////////////////////////////////////
  429. // Constants to describe parameter types
  430.  
  431. #define ITS_EMPTY            "\x06"        // no parameters
  432. #define ITS_I2              "\x01"      // a 'short'
  433. #define ITS_I4              "\x02"      // a 'long'
  434. #define ITS_R4              "\x03"      // a 'float'
  435. #define ITS_R8              "\x04"      // a 'double'
  436. #define ITS_PSTR            "\x05"        // a 'LPCTSTR'
  437.  
  438. enum INETVARENUM
  439. {    
  440.     IT_I2        = 1,
  441.     IT_I4        = 2,
  442.     IT_R4        = 3,
  443.     IT_R8        = 4,
  444.     IT_PSTR        = 5,
  445.     IT_EMPTY    = 6,
  446. };
  447.  
  448.  
  449. ///////////////////////////////////////////////////////////////////////
  450. // Internet Information Server Entry Points
  451.  
  452. extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc,    
  453.     DWORD dwNotificationType, LPVOID pvNotification);
  454.  
  455. extern "C" BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer);
  456.  
  457.  
  458. ///////////////////////////////////////////////////////////////////////
  459. // Internet Information Server Filter Support
  460.  
  461. class CHttpFilterContext
  462. {
  463. public:
  464.     CHttpFilterContext(PHTTP_FILTER_CONTEXT pfc);
  465.     ~CHttpFilterContext() { }
  466.  
  467.     BOOL GetServerVariable(LPTSTR lpszVariableName, LPVOID lpvBuffer,
  468.         LPDWORD lpdwSize);
  469.     BOOL AddResponseHeaders(LPTSTR lpszHeaders, DWORD dwReserved = 0);
  470.     BOOL WriteClient(LPVOID lpvBuffer, LPDWORD lpdwBytes, 
  471.         DWORD dwReserved = 0);
  472.     LPVOID AllocMem(DWORD cbSize, DWORD dwReserved = 0);
  473.     BOOL ServerSupportFunction(enum SF_REQ_TYPE sfReq,
  474.         LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType);
  475.  
  476.     PHTTP_FILTER_CONTEXT const m_pFC;
  477. };
  478.  
  479.  
  480. ///////////////////////////////////////////////////////////////////////
  481. //
  482.  
  483. class CHttpFilter
  484. {
  485. public:
  486.     CHttpFilter();
  487.     ~CHttpFilter();
  488.  
  489. protected:    
  490.  
  491. public:
  492.     virtual DWORD HttpFilterProc(PHTTP_FILTER_CONTEXT pfc,    
  493.         DWORD dwNotificationType, LPVOID pvNotification);
  494.     virtual BOOL GetFilterVersion(PHTTP_FILTER_VERSION pVer);
  495.  
  496.     virtual DWORD OnReadRawData(CHttpFilterContext* pfc, PHTTP_FILTER_RAW_DATA pRawData);
  497.     virtual DWORD OnPreprocHeaders(CHttpFilterContext* pfc, PHTTP_FILTER_PREPROC_HEADERS pHeaders);
  498.     virtual DWORD OnAuthentication(CHttpFilterContext* pfc, PHTTP_FILTER_AUTHENT pAuthent);
  499.     virtual DWORD OnUrlMap(CHttpFilterContext* pfc, PHTTP_FILTER_URL_MAP pUrlMap);
  500.     virtual DWORD OnSendRawData(CHttpFilterContext* pfc, PHTTP_FILTER_RAW_DATA pRawData);
  501.     virtual DWORD OnLog(CHttpFilterContext* pfc, PHTTP_FILTER_LOG pLog);
  502.     virtual DWORD OnEndOfNetSession(CHttpFilterContext* pfc);
  503. };
  504.  
  505.  
  506. /////////////////////////////////////////////////////////////////////////////
  507. // Alternate debugging suppot
  508. #ifndef __BORLANDC__
  509. #include <crtdbg.h>
  510. #endif
  511.  
  512. #ifdef _AFX
  513. #define ISAPIASSERT(expr)                    ASSERT(expr)
  514. #define ISAPITRACE(str)                        TRACE(str)
  515. #define ISAPITRACE0(str)                    TRACE0(str)
  516. #define ISAPITRACE1(str, arg1)                TRACE1(str, arg1)
  517. #define ISAPITRACE2(str, arg1, arg2)        TRACE2(str, arg1, arg2)
  518. #define ISAPITRACE3(str, arg1, arg2, arg3)    TRACE3(str, arg1, arg2, arg3)
  519. #define ISAPIVERIFY(f)                      ASSERT(f)
  520. #else
  521. #define    ISAPIASSERT(expr)                    _ASSERTE(expr)
  522. #define ISAPITRACE(str)                        _RPT0(_CRT_WARN, str)
  523. #define ISAPITRACE0(str)                    _RPT0(_CRT_WARN, str)
  524. #define ISAPITRACE1(str, arg1)                _RPT1(_CRT_WARN, str, arg1)
  525. #define ISAPITRACE2(str, arg1, arg2)        _RPT2(_CRT_WARN, str, arg1, arg2)
  526. #define ISAPITRACE3(str, arg1, arg2, arg3)    _RPT3(_CRT_WARN, arg1, arg2, arg3)
  527. #ifdef _DEBUG
  528. #define ISAPIVERIFY(expr)                      _ASSERTE(expr)
  529. #else
  530. #define ISAPIVERIFY(expr)                    ((void)(expr))
  531. #endif
  532. #endif
  533.  
  534.  
  535. /////////////////////////////////////////////////////////////////////////////
  536. // Inline function declarations
  537.  
  538. #ifdef _AFX_ENABLE_INLINES
  539. #define _AFXISAPI_INLINE inline
  540. #include <afxisapi.inl>
  541. #endif
  542.  
  543. #undef AFX_DATA
  544. #define AFX_DATA
  545.  
  546. #ifdef _AFX_MINREBUILD
  547. #pragma component(minrebuild, on)
  548. #endif
  549. #ifndef _AFX_FULLTYPEINFO
  550. #pragma component(mintypeinfo, off)
  551. #endif
  552.  
  553. #endif // the whole file
  554.  
  555.