home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / minicom.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.4 KB  |  124 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19.  
  20. /*******************************************************************************
  21.  * Mini Component Object Model
  22.  ******************************************************************************/
  23.  
  24. #ifndef MINICOM_H
  25. #define MINICOM_H
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. /******************************************************************************/
  32.  
  33. #if defined(XP_PC) && !defined(XP_OS2)
  34. #if defined(_WIN32)
  35. #include "objbase.h"
  36. #else
  37. #include <windows.h>
  38. #include "compobj.h"
  39. #endif
  40. #else /* !XP_PC or XP_OS2*/
  41.  
  42. #if defined(XP_OS2)
  43. #define TID OS2TID   /* global rename in OS2 H's!               */
  44. #include <os2.h>
  45. #undef TID           /* and restore                             */
  46. #endif
  47.  
  48. typedef struct _GUID {
  49.     long        Data1;
  50.     short        Data2;
  51.     short        Data3;
  52.     char        Data4[8];
  53. } GUID;
  54.  
  55. typedef GUID    IID;
  56. typedef GUID    CLSID;
  57.  
  58. typedef IID*    REFIID;
  59. typedef GUID*    REFGUID;
  60. typedef CLSID*    REFCLSID;
  61.  
  62. #ifdef __cplusplus
  63. #define EXTERN_C        extern "C"
  64. #else
  65. #define EXTERN_C
  66. #endif /* cplusplus */
  67.  
  68. #ifndef INITGUID
  69. #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  70.     EXTERN_C const GUID name
  71. #else
  72. #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  73.     EXTERN_C const GUID name \
  74.                 = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
  75. #endif /* INITGUID */
  76.  
  77. #endif /* !XP_PC or XP_OS2*/
  78.  
  79. #define JRI_DEFINE_GUID(name, l, w1, w2) \
  80.     DEFINE_GUID(name, l, w1, w2,         \
  81.                 0xbb, 0x58, 0x00, 0x80, 0x5f, 0x74, 0x03, 0x79)
  82.  
  83. typedef long
  84. (*MCOM_QueryInterface_t)(void* self, REFIID id, void* *result);
  85.  
  86. typedef long
  87. (*MCOM_AddRef_t)(void* self);
  88.  
  89. typedef long
  90. (*MCOM_Release_t)(void* self);
  91.  
  92. #if !defined(XP_PC) || defined(XP_OS2)
  93.  
  94. typedef struct IUnknown {
  95.     MCOM_QueryInterface_t    QueryInterface;
  96.     MCOM_AddRef_t            AddRef;
  97.     MCOM_Release_t            Release;
  98. } IUnknown;
  99.  
  100. #define IUnknown_QueryInterface(self, interfaceID, resultingInterface)        \
  101.         (((*((IUnknown**)self))->QueryInterface)(self, interfaceID, resultingInterface))
  102.  
  103. #define IUnknown_AddRef(self)                            \
  104.         (((*((IUnknown**)self))->AddRef)(self))
  105.  
  106. #define IUnknown_Release(self)                            \
  107.         (((*((IUnknown**)self))->Release)(self))
  108.  
  109. #endif /* !XP_PC or XP_OS2*/
  110.  
  111. typedef long
  112. (*MCOM_CreateInstance_t)(void* self, IUnknown* outer, REFIID interfaceID,
  113.                          void** newInstance);
  114.  
  115. typedef long
  116. (*MCOM_LockServer_t)(void* self, int doLock);
  117.  
  118. /******************************************************************************/
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122. #endif /* MINICOM_H */
  123. /******************************************************************************/
  124.