npi.h

Go to the documentation of this file.
00001 /*
00002  * npi.h
00003  *
00004  * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE 
00005  * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE 
00006  * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
00007  *
00008  * You can obtain a current copy of the Common Public License from
00009  * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html
00010  *
00011  * Author: Frank Scheffler <frank.scheffler@de.ibm.com>
00012  * Contributors:
00013  *
00014  * Description: All typedefs and general definitions for the NPI
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 /* the default maximum number of libraries to be linked simultaneously */
00034 #ifndef NPI_MAX_DLL
00035 #define NPI_MAX_DLL 100
00036 #endif
00037 
00038 /* 
00039  * typedef for an NPI handle, given with any function to store errors
00040  * and to resolve them 
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 /* CIM Value Type */
00055 typedef enum {
00056   CIM_INTEGER,
00057   CIM_STRING,
00058   CIM_REF 
00059 } CIMType;
00060   
00061 /* these are the pseudo structs to handle the CIMOM objects in C */
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 /* typedefs for CIMProvider function pointers for the linked libraries */
00072 typedef char * (*FP_INITIALIZE) ( NPIHandle *, CIMOMHandle );
00073 typedef void (*FP_CLEANUP) ( NPIHandle * );
00074 
00075 /* typedefs for InstanceProvider function pointers for the linked libraries */
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 /* typedefs for AssociatorProvider function pointers for the linked libraries */
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 /* typedefs for EventProvider function pointers for the linked libraries */
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 /* the function pointer table returned by <LIBNAME>_initFunctionTable() */  
00115 typedef struct {
00116   /* CIMProvider; */
00117   FP_INITIALIZE         fp_initialize;
00118   FP_CLEANUP            fp_cleanup;
00119   /* InstanceProvider; */
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   /* AssociatorProvider */
00128   FP_ASSOCIATORS        fp_associators;
00129   FP_ASSOCIATORNAMES    fp_associatorNames;
00130   FP_REFERENCES         fp_references;
00131   FP_REFERENCENAMES     fp_referenceNames;
00132   /* MethodProvider */
00133   FP_INVOKEMETHOD       fp_invokeMethod;
00134   /* EventProvider */
00135   FP_AUTHORIZEFILTER    fp_authorizeFilter;
00136   FP_MUSTPOLL           fp_mustPoll;
00137   FP_ACTIVATEFILTER     fp_activateFilter;
00138   FP_DEACTIVATEFILTER   fp_deActivateFilter;
00139 }FTABLE;
00140 
00141 /* the <LIBNAME>_initFunctionTable() pointer */
00142 typedef FTABLE (*FP_INIT_FT) ();
00143 
00144 /* structure for the cache{Instance/Static}MethodNames arrays */
00145 typedef struct {
00146   int clsIndex;
00147   const char * methodName;
00148   const char * signature;
00149 } METHOD_STRUCT;
00150 
00151 #endif

Generated on Thu Feb 9 08:47:49 2006 for openwbem by  doxygen 1.4.6