home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / sun-java / stubs / include / jmc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.8 KB  |  65 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. #ifndef JMC_H
  19. #define JMC_H
  20.  
  21. #include "jritypes.h"
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif /* __cplusplus */
  26.  
  27. #define JMC_PUBLIC_API JRI_PUBLIC_API 
  28.  
  29. typedef struct JMCInterfaceID {
  30.     jint a, b, c, d;
  31. } JMCInterfaceID;
  32.  
  33. #ifdef __cplusplus
  34. #define EXTERN_C        extern "C"
  35. #define EXTERN_C_WITHOUT_EXTERN "C"
  36. #else
  37. #undef EXTERN_C
  38. #define EXTERN_C
  39. #define EXTERN_C_WITHOUT_EXTERN
  40. #endif /* cplusplus */
  41.  
  42. typedef struct JMCException JMCException;
  43.  
  44. JRI_PUBLIC_API(void)
  45. JMCException_Destroy(struct JMCException *);
  46.  
  47. #define JMC_EXCEPTION(resultPtr, exceptionToReturn)         \
  48.     (((resultPtr) != NULL)                     \
  49.      ? ((*(resultPtr) = (exceptionToReturn), resultPtr))     \
  50.      : (JMCException_Destroy(exceptionToReturn), resultPtr))
  51.  
  52. #define JMC_EXCEPTION_RETURNED(resultPtr)             \
  53.     ((resultPtr) != NULL && *(resultPtr) != NULL)
  54.  
  55. #define JMCEXCEPTION_OUT_OF_MEMORY    ((struct JMCException*)-1)
  56.  
  57. #define JMC_DELETE_EXCEPTION(resultPtr)                 \
  58.     (JMCException_Destroy(*(resultPtr)), *(resultPtr) = NULL)
  59.  
  60. #ifdef __cplusplus
  61. } /* extern "C" */
  62. #endif /* __cplusplus */
  63.  
  64. #endif /* JMC_H */
  65.