00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef _NPI_H_
00018 #define _NPI_H_
00019 
00020 #ifndef _COMPILE_UNIX
00021 #define _COMPILE_UNIX
00022 #include "os_compile.h"
00023 #endif
00024 
00025 #ifdef _COMPILE_WIN32
00026 #define NPIEXPORT __declspec(dllexport)
00027 #define NPICALL __stdcall
00028 #else
00029 #define NPIEXPORT
00030 #define NPICALL
00031 #endif
00032 
00033 
00034 #ifndef NPI_MAX_DLL
00035 #define NPI_MAX_DLL 100
00036 #endif
00037 
00038 
00039 
00040 
00041   
00042 typedef struct {
00043   void *          jniEnv;
00044   int             errorOccurred;
00045   const char *    providerError;
00046   void *          thisObject;
00047   void *          context;
00048 } NPIHandle;
00049 
00050 typedef struct {
00051   char *          operationContext;
00052 } NPIenvironment;
00053 
00054 
00055 typedef enum {
00056   CIM_INTEGER,
00057   CIM_STRING,
00058   CIM_REF 
00059 } CIMType;
00060   
00061 
00062 typedef struct { void * ptr; } CIMObjectPath;
00063 typedef struct { void * ptr; } CIMOMHandle;
00064 typedef struct { void * ptr; } CIMInstance;
00065 typedef struct { void * ptr; } CIMClass;
00066 typedef struct { void * ptr; } CIMParameter;
00067 typedef struct { void * ptr; } CIMValue;
00068 typedef struct { void * ptr; } Vector;
00069 typedef struct { void * ptr; } SelectExp;
00070   
00071 
00072 typedef char * (*FP_INITIALIZE) ( NPIHandle *, CIMOMHandle );
00073 typedef void (*FP_CLEANUP) ( NPIHandle * );
00074 
00075 
00076 typedef Vector (*FP_ENUMINSTANCENAMES) ( NPIHandle *, CIMObjectPath, int, 
00077                 CIMClass );
00078 typedef Vector (*FP_ENUMINSTANCES) ( NPIHandle *, CIMObjectPath, int, CIMClass,
00079                  int );
00080 typedef CIMInstance (*FP_GETINSTANCE) ( NPIHandle *, CIMObjectPath, CIMClass, int );
00081 typedef CIMObjectPath (*FP_CREATEINSTANCE) ( NPIHandle *, CIMObjectPath, 
00082                     CIMInstance );
00083 typedef void (*FP_SETINSTANCE) ( NPIHandle *, CIMObjectPath, CIMInstance );
00084 typedef void (*FP_DELETEINSTANCE) ( NPIHandle *, CIMObjectPath );
00085 typedef Vector (*FP_EXECQUERY) ( NPIHandle *, CIMObjectPath, const char *, int,
00086              CIMClass );
00087 
00088 
00089 typedef Vector (*FP_ASSOCIATORS) ( NPIHandle *, CIMObjectPath, CIMObjectPath,
00090                const char *, const char *, const char *,
00091                int, int, const char *[], int );
00092 typedef Vector (*FP_ASSOCIATORNAMES) ( NPIHandle *, CIMObjectPath,
00093                    CIMObjectPath, const char *, 
00094                    const char *, const char * );
00095 typedef Vector (*FP_REFERENCES) ( NPIHandle *, CIMObjectPath, CIMObjectPath,
00096               const char *, int, int, const char *[], 
00097               int );
00098 typedef Vector (*FP_REFERENCENAMES) ( NPIHandle *, CIMObjectPath, 
00099                   CIMObjectPath, const char * );
00100 typedef CIMValue (*FP_INVOKEMETHOD) ( NPIHandle *, CIMObjectPath, 
00101                   const char *, Vector, Vector );
00102 
00103 
00104 typedef void (*FP_AUTHORIZEFILTER)(NPIHandle*,SelectExp,const char*,
00105        CIMObjectPath, const char*);
00106 typedef int (*FP_MUSTPOLL)(NPIHandle*,SelectExp,const char*,
00107        CIMObjectPath);
00108 typedef void (*FP_ACTIVATEFILTER)(NPIHandle*,SelectExp,const char*,
00109        CIMObjectPath,int);
00110 typedef void (*FP_DEACTIVATEFILTER)(NPIHandle*,SelectExp,const char*,
00111        CIMObjectPath,int);
00112   
00113 
00114   
00115 typedef struct {
00116   
00117   FP_INITIALIZE         fp_initialize;
00118   FP_CLEANUP            fp_cleanup;
00119   
00120   FP_ENUMINSTANCENAMES  fp_enumInstanceNames;
00121   FP_ENUMINSTANCES      fp_enumInstances;
00122   FP_GETINSTANCE        fp_getInstance;
00123   FP_CREATEINSTANCE     fp_createInstance;
00124   FP_SETINSTANCE        fp_setInstance;
00125   FP_DELETEINSTANCE     fp_deleteInstance;
00126   FP_EXECQUERY          fp_execQuery;
00127   
00128   FP_ASSOCIATORS        fp_associators;
00129   FP_ASSOCIATORNAMES    fp_associatorNames;
00130   FP_REFERENCES         fp_references;
00131   FP_REFERENCENAMES     fp_referenceNames;
00132   
00133   FP_INVOKEMETHOD       fp_invokeMethod;
00134   
00135   FP_AUTHORIZEFILTER    fp_authorizeFilter;
00136   FP_MUSTPOLL           fp_mustPoll;
00137   FP_ACTIVATEFILTER     fp_activateFilter;
00138   FP_DEACTIVATEFILTER   fp_deActivateFilter;
00139 }FTABLE;
00140 
00141 
00142 typedef FTABLE (*FP_INIT_FT) ();
00143 
00144 
00145 typedef struct {
00146   int clsIndex;
00147   const char * methodName;
00148   const char * signature;
00149 } METHOD_STRUCT;
00150 
00151 #endif