home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Java / Java.zip / jaseh131.zip / ras.h < prev   
C/C++ Source or Header  |  2002-08-31  |  6KB  |  179 lines

  1. /*
  2.  * @(#)src/contract/ras/sov/ras.h, xs131, xs131, 20020822 1.13.2.1
  3.  * ===========================================================================
  4.  * Licensed Materials - Property of IBM
  5.  * "Restricted Materials of IBM"
  6.  *
  7.  * IBM Java(tm)2 SDK, Standard Edition, v 1.3.1
  8.  * (C) Copyright IBM Corp. 1998, 2001. All Rights Reserved
  9.  * US Government Users Restricted Rights - Use, duplication or disclosure
  10.  * restricted by GSA ADP Schedule Contract with IBM Corp.
  11.  * ===========================================================================
  12.  */
  13.  
  14. /*
  15.  *
  16.  * ===========================================================================
  17.  *
  18.  *
  19.  *
  20.  * ===========================================================================
  21.  * Module Information:
  22.  *
  23.  * DESCRIPTION:
  24.  * RAS header file for use in all core libraries that use any of the facilities
  25.  * provided by the Diagnostics subcomponent of the JVM.
  26.  * ===========================================================================
  27.  */
  28. #ifndef _IBM_RAS_H_
  29. #define _IBM_RAS_H_
  30.  
  31. /*
  32.  * ======================================================================
  33.  * Allow for inclusion in C++
  34.  * ======================================================================
  35.  */
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. /*
  41.  * ======================================================================
  42.  * Forward declarations
  43.  * ======================================================================
  44.  */
  45.  
  46. struct DgTrcExecStruct;
  47. typedef struct DgTrcExecStruct DgTrcExec;
  48. struct rasHpiInterface;
  49. typedef struct rasHpiInterface RasHpiInterface;
  50. struct rasJniInterface;
  51. typedef struct rasJniInterface RasJniInterface;
  52.  
  53. /*
  54.  * ======================================================================
  55.  * RasInfo structures
  56.  * ======================================================================
  57.  */
  58. typedef struct RasInfo {
  59.     int  type;
  60.     union {
  61.  
  62.         struct {
  63.             int    number;
  64.             char **names;
  65.         } query;
  66.  
  67.         struct {
  68.             int    number;
  69.             char **names;
  70.         } trace_components;
  71.  
  72.         struct {
  73.             char          *name;
  74.             int            first;
  75.             int            last;
  76.             unsigned char *bitMap;
  77.         } trace_component;
  78.     } info;
  79. } RasInfo;
  80.  
  81. #define RASINFO_TYPES               0
  82. #define RASINFO_TRACE_COMPONENTS    1
  83. #define RASINFO_TRACE_COMPONENT     2
  84. #define RASINFO_MAX_TYPES           2
  85.  
  86. /*
  87.  * ======================================================================
  88.  * External access facade
  89.  * ======================================================================
  90.  */
  91. #define JVMRAS_VERSION_1_1      0x7F000001
  92.  
  93. typedef struct DgRasInterface {
  94.     char    eyecatcher[4];
  95.     int     length;
  96.     int     version;
  97.     int     modification;
  98.     int     (JNICALL *TraceRegister)(JNIEnv *env,
  99.                                      void (JNICALL *func)(JNIEnv *env2,
  100.                              void **threadLocal, int traceId,
  101.                              const char * format, va_list var));
  102.     int     (JNICALL *TraceDeregister)(JNIEnv *env,
  103.                                        void (JNICALL *func)(JNIEnv *env2,
  104.                                void **threadLocal, int traceId,
  105.                                const char * format, va_list var));
  106.     int     (JNICALL *TraceSet)(JNIEnv *env, const char *);
  107.     void    (JNICALL *TraceSnap)(JNIEnv *env, char *);
  108.     void    (JNICALL *TraceSuspend)(JNIEnv *env);
  109.     void    (JNICALL *TraceResume)(JNIEnv *env);
  110.     int     (JNICALL *GetRasInfo)(JNIEnv * env, RasInfo * info_ptr);
  111.     int     (JNICALL *ReleaseRasInfo)(JNIEnv * env, RasInfo * info_ptr);
  112.     int     (JNICALL *DumpRegister)(JNIEnv *env,
  113.                                     int (JNICALL *func)(JNIEnv *env2,
  114.                                                         void **threadLocal,
  115.                                                         int reason));
  116.     int     (JNICALL *DumpDeregister)(JNIEnv *env,
  117.                                       int (JNICALL *func)(JNIEnv *env2,
  118.                                                           void **threadLocal,
  119.                                                           int reason));
  120.     void    (JNICALL *NotifySignal)(JNIEnv *env, int signal);
  121. } DgRasInterface;
  122.  
  123. /*
  124.  * ======================================================================
  125.  *    Dump exit return codes
  126.  * ======================================================================
  127.  */
  128.  
  129. #define RAS_DUMP_CONTINUE   0         /* Continue with diagnostic collection */
  130. #define RAS_DUMP_ABORT      1         /* No more diagnostics should be taken */
  131.  
  132. /*
  133.  * ======================================================================
  134.  *    RAS structure header
  135.  * ======================================================================
  136.  */
  137.  
  138. typedef struct RasDataHeader {
  139.     char eyecatcher[4];
  140.     int length;
  141.     int version;
  142.     int modification;
  143. } RasDataHeader;
  144.  
  145.  
  146. /*
  147.  * ======================================================================
  148.  * Function prototypes
  149.  * ======================================================================
  150.  */
  151.  
  152. int  JNICALL rasTraceRegister(JNIEnv *env , void (JNICALL *func)(JNIEnv *env2,
  153.                         void **threadLocal, int traceId,
  154.                         const char * format, va_list varargs));
  155. int  JNICALL rasTraceDeregister(JNIEnv *env ,
  156.                                    void (JNICALL *func)(JNIEnv *env2,
  157.                           void **threadLocal, int traceId,
  158.                           const char * format, va_list varargs));
  159. int  JNICALL rasGetRasInfo(JNIEnv * env, RasInfo * info_ptr);
  160. int  JNICALL rasReleaseRasInfo(JNIEnv * env, RasInfo * info_ptr);
  161.  
  162.  
  163. /*
  164.  * ======================================================================
  165.  * Facade access macros
  166.  * ======================================================================
  167.  */
  168.  
  169. #define RAS_FACADE(env) dgTrcExec.rasTrcIntf->
  170.  
  171. #ifdef __cplusplus
  172. } /* extern "C" */
  173. #endif
  174. #endif /* !_IBM_RAS_H_ */
  175.  
  176. /*
  177.  * End of file
  178.  */
  179.