00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _PROVIDER_H_
00018 #define _PROVIDER_H_
00019
00020 #ifdef __cplusplus
00021 #define EXTERN_C extern "C"
00022 #else
00023 #define EXTERN_C
00024 #endif
00025
00026 #include "npi.h"
00027
00028
00029
00030
00031 static char * initialize ( NPIHandle *, CIMOMHandle );
00032 static void cleanup ( NPIHandle * );
00033
00034
00035
00036
00037
00038
00039 #ifdef INSTANCE_PROVIDER
00040 #define _INCLUDE_INSTANCE_PROVIDER_METHODS \
00041 enumInstanceNames, enumInstances, \
00042 getInstance, createInstance, setInstance, deleteInstance, execQuery,
00043 #else
00044 #define _INCLUDE_INSTANCE_PROVIDER_METHODS \
00045 0, 0, 0, 0, 0, 0, 0,
00046 #endif
00047
00048 static Vector enumInstanceNames ( NPIHandle *, CIMObjectPath, int, CIMClass );
00049 static Vector enumInstances ( NPIHandle *, CIMObjectPath, int, CIMClass, int );
00050 static CIMInstance getInstance ( NPIHandle *, CIMObjectPath, CIMClass, int );
00051 static CIMObjectPath createInstance ( NPIHandle *, CIMObjectPath,
00052 CIMInstance );
00053 static void setInstance ( NPIHandle *, CIMObjectPath, CIMInstance );
00054 static void deleteInstance ( NPIHandle *, CIMObjectPath );
00055 static Vector execQuery ( NPIHandle *, CIMObjectPath, const char *, int,
00056 CIMClass );
00057
00058
00059
00060
00061
00062 #ifdef ASSOCIATOR_PROVIDER
00063 #define _INCLUDE_ASSOCIATOR_PROVIDER_METHODS \
00064 associators, associatorNames, references, referenceNames,
00065 static Vector associators ( NPIHandle *, CIMObjectPath, CIMObjectPath,
00066 const char *, const char *, const char *,
00067 int, int, const char * [], int);
00068 static Vector associatorNames ( NPIHandle *, CIMObjectPath, CIMObjectPath,
00069 const char *, const char *, const char * );
00070 static Vector references ( NPIHandle *, CIMObjectPath, CIMObjectPath,
00071 const char *, int, int, const char * [], int);
00072 static Vector referenceNames ( NPIHandle *, CIMObjectPath, CIMObjectPath,
00073 const char * );
00074 #else
00075 #define _INCLUDE_ASSOCIATOR_PROVIDER_METHODS \
00076 0, 0, 0, 0,
00077 #endif
00078
00079
00080
00081
00082 #ifdef METHOD_PROVIDER
00083 #define _INCLUDE_METHOD_PROVIDER_METHODS \
00084 invokeMethod,
00085 static CIMValue invokeMethod ( NPIHandle *, CIMObjectPath,
00086 const char *, Vector, Vector);
00087 #else
00088 #define _INCLUDE_METHOD_PROVIDER_METHODS \
00089 0,
00090 #endif
00091
00092
00093
00094
00095
00096 #ifdef EVENT_PROVIDER
00097
00098 static void authorizeFilter(NPIHandle*,SelectExp,const char*,
00099 CIMObjectPath, const char*);
00100 static int mustPoll(NPIHandle*,SelectExp,const char*,
00101 CIMObjectPath);
00102 static void activateFilter(NPIHandle*,SelectExp,const char*,
00103 CIMObjectPath,int);
00104 static void deActivateFilter(NPIHandle*,SelectExp,const char*,
00105 CIMObjectPath,int);
00106
00107 #define _INCLUDE_EVENT_PROVIDER_METHODS \
00108 authorizeFilter,mustPoll,activateFilter,deActivateFilter,
00109 #else
00110 #define _INCLUDE_EVENT_PROVIDER_METHODS \
00111 0,0,0,0,
00112 #endif
00113
00114
00115
00116 #define PROVIDER_NAME(n) EXTERN_C \
00117 NPIEXPORT FTABLE NPICALL n##_initFunctionTable ( void ) { \
00118 FTABLE fTable = { \
00119 initialize, cleanup, \
00120 \
00121 _INCLUDE_INSTANCE_PROVIDER_METHODS \
00122 _INCLUDE_ASSOCIATOR_PROVIDER_METHODS \
00123 _INCLUDE_METHOD_PROVIDER_METHODS \
00124 _INCLUDE_EVENT_PROVIDER_METHODS \
00125 }; \
00126 return fTable; \
00127 }
00128
00129 #endif
00130
00131
00132