From: Adrian S. <a3s...@us...> - 2005-03-21 14:22:49
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6093 Modified Files: cimXmlGen.c cimXmlRequest.c constClass.c constClass.h httpAdapter.c native.h objectpath.c providerDrv.c support.c support.h Added Files: cmpiftx.h Log Message: Added cmpiftx.h for sfcb MI extensions Added loadClassMI support in support.c Renamed __tool_loadxx variablenames to loadxx Corrected #include statements for constClass.h at various places Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cimXmlRequest.c 12 Mar 2005 00:43:00 -0000 1.2 +++ cimXmlRequest.c 21 Mar 2005 14:22:38 -0000 1.3 @@ -27,7 +27,9 @@ #include "cimXmlRequest.h" #include "cimXmlParser.h" #include "msgqueue.h" +#include "cmpidt.h" #include "constClass.h" +#include "objectImpl.h" #include "native.h" #include "trace.h" Index: cimXmlGen.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlGen.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cimXmlGen.c 15 Mar 2005 23:23:02 -0000 1.2 +++ cimXmlGen.c 21 Mar 2005 14:22:38 -0000 1.3 @@ -26,7 +26,9 @@ #include "cimXmlRequest.h" #include "cimXmlParser.h" #include "msgqueue.h" +#include "cmpidt.h" #include "constClass.h" +#include "objectImpl.h" #include "native.h" #include "trace.h" Index: native.h =================================================================== RCS file: /cvsroot/sblim/sfcb/native.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- native.h 9 Mar 2005 12:25:12 -0000 1.1.1.1 +++ native.h 21 Mar 2005 14:22:38 -0000 1.2 @@ -33,6 +33,7 @@ #include "cmpidt.h" #include "cmpift.h" +#include "constClass.h" #include "cmpimacs.h" #include "msgqueue.h" Index: support.c =================================================================== RCS file: /cvsroot/sblim/sfcb/support.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- support.c 12 Mar 2005 00:43:00 -0000 1.2 +++ support.c 21 Mar 2005 14:22:38 -0000 1.3 @@ -34,7 +34,7 @@ int collectStat=0; unsigned long exFlags = 0; -void *tool_load_lib(const char *libname) +void *loadLibib(const char *libname) { char filename[255]; sprintf(filename, "lib%s.so", libname); @@ -42,7 +42,7 @@ } -static void *__get_generic_entry_point(void *library, const char *ptype) +static void *getGenericEntryPoint(void *library, const char *ptype) { char entry_point[255]; void *sym; @@ -52,7 +52,7 @@ } -static void *__get_fixed_entry_point(const char *provider, +static void *getFixedEntryPoint(const char *provider, void *library, const char *ptype) { char entry_point[255]; @@ -70,17 +70,17 @@ CMPIContext * ctx); -CMPIInstanceMI *tool_load_InstanceMI(const char *provider, void *library, +CMPIInstanceMI *loadInstanceMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx) { CMPIInstanceMI *mi; - _SFCB_ENTER(TRACE_PROVIDERDRV, "tool_load_InstanceMI"); + _SFCB_ENTER(TRACE_PROVIDERDRV, "loadInstanceMI"); GENERIC_InstanceMI g = (GENERIC_InstanceMI) - __get_generic_entry_point(library,"Instance"); + getGenericEntryPoint(library,"Instance"); if (g == NULL) { FIXED_InstanceMI f = (FIXED_InstanceMI) - __get_fixed_entry_point(provider, library, "Instance"); + getFixedEntryPoint(provider, library, "Instance"); if (f == NULL) _SFCB_RETURN(NULL); if (broker) { mi=(f) (broker, ctx); @@ -103,20 +103,20 @@ CMPIContext * ctx); -CMPIAssociationMI *tool_load_AssociationMI(const char *provider, +CMPIAssociationMI *loadAssociationMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx) { CMPIAssociationMI *mi; - _SFCB_ENTER(TRACE_PROVIDERDRV, "tool_load_AssociationMI"); + _SFCB_ENTER(TRACE_PROVIDERDRV, "loadAssociationMI"); GENERIC_AssociationMI g = (GENERIC_AssociationMI) - __get_generic_entry_point(library, "Association"); + getGenericEntryPoint(library, "Association"); if (g == NULL) { FIXED_AssociationMI f = (FIXED_AssociationMI) - __get_fixed_entry_point(provider, library, "Association"); + getFixedEntryPoint(provider, library, "Association"); if (f == NULL) _SFCB_RETURN(NULL); if (broker) { mi=(f) (broker, ctx); @@ -139,17 +139,17 @@ CMPIContext * ctx); -CMPIMethodMI *tool_load_MethodMI(const char *provider, void *library, +CMPIMethodMI *loadMethodMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx) { CMPIMethodMI *mi; - _SFCB_ENTER(TRACE_PROVIDERDRV, "tool_load_MethodMI"); + _SFCB_ENTER(TRACE_PROVIDERDRV, "loadMethodMI"); GENERIC_MethodMI g = - (GENERIC_MethodMI) __get_generic_entry_point(library, "Method"); + (GENERIC_MethodMI) getGenericEntryPoint(library, "Method"); if (g == NULL) { FIXED_MethodMI f = - (FIXED_MethodMI) __get_fixed_entry_point(provider, library,"Method"); + (FIXED_MethodMI) getFixedEntryPoint(provider, library,"Method"); if (f == NULL) _SFCB_RETURN(NULL); if (broker) { mi=(f)(broker, ctx); @@ -171,18 +171,18 @@ typedef CMPIPropertyMI *(*FIXED_PropertyMI) (CMPIBroker * broker, CMPIContext * ctx); -CMPIPropertyMI *tool_load_PropertyMI(const char *provider, void *library, +CMPIPropertyMI *loadPropertyMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx) { + _SFCB_ENTER(TRACE_PROVIDERDRV, "loadPropertyMI"); GENERIC_PropertyMI g = - (GENERIC_PropertyMI) __get_generic_entry_point(library, + (GENERIC_PropertyMI) getGenericEntryPoint(library, "Property"); if (g == NULL) { FIXED_PropertyMI f = - (FIXED_PropertyMI) __get_fixed_entry_point(provider, library, + (FIXED_PropertyMI) getFixedEntryPoint(provider, library, "Property"); - if (f == NULL) - return NULL; + if (f == NULL) _SFCB_RETURN(NULL); return (f) (broker, ctx); } return (g) (broker, ctx, provider); @@ -196,25 +196,39 @@ CMPIContext * ctx); -CMPIIndicationMI *tool_load_IndicationMI(const char *provider, +CMPIIndicationMI *loadIndicationMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx) { GENERIC_IndicationMI g = - (GENERIC_IndicationMI) __get_generic_entry_point(library, + (GENERIC_IndicationMI) getGenericEntryPoint(library, "Indication"); if (g == NULL) { FIXED_IndicationMI f = - (FIXED_IndicationMI) __get_fixed_entry_point(provider, library, + (FIXED_IndicationMI) getFixedEntryPoint(provider, library, "Indication"); - if (f == NULL) - return NULL; + if (f == NULL) return NULL; return (f) (broker, ctx); } return (g) (broker, ctx, provider); }; + +typedef CMPIClassMI *(*FIXED_ClassMI) (CMPIBroker * broker, + CMPIContext * ctx); + +CMPIClassMI *loadClassMI(const char *provider, + void *library, + CMPIBroker * broker, CMPIContext * ctx) +{ + FIXED_ClassMI f = + (FIXED_ClassMI) getFixedEntryPoint(provider, library, + "Class"); + if (f == NULL) return NULL; + return (f) (broker, ctx); +}; + /****************************************************************************/ Index: httpAdapter.c =================================================================== RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- httpAdapter.c 11 Mar 2005 12:22:35 -0000 1.3 +++ httpAdapter.c 21 Mar 2005 14:22:38 -0000 1.4 @@ -74,9 +74,9 @@ extern char *decode64(char *data); extern void libraryName(const char *location, char *fullName); -extern void *tool_load_lib(const char *libname); +extern void *loadLibib(const char *libname); extern int getControlChars(char *id, char **val); -extern void *tool_load_lib(const char *libname); +extern void *loadLibib(const char *libname); extern RespSegments genFirstChunkResponses(BinRequestContext*,BinResponseHdr**,int,int); extern RespSegments genLastChunkResponses(BinRequestContext*, BinResponseHdr**, int); Index: support.h =================================================================== RCS file: /cvsroot/sblim/sfcb/support.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- support.h 9 Mar 2005 12:25:14 -0000 1.1.1.1 +++ support.h 21 Mar 2005 14:22:38 -0000 1.2 @@ -28,27 +28,32 @@ #include "cmpidt.h" #include "cmpift.h" +#include "cmpiftx.h" #include "cmpimacs.h" -CMPIInstanceMI *tool_load_InstanceMI(const char *provider, +CMPIInstanceMI *loadInstanceMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx); -CMPIAssociationMI *tool_load_AssociationMI(const char *provider, +CMPIAssociationMI *loadAssociationMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx); -CMPIMethodMI *tool_load_MethodMI(const char *provider, +CMPIMethodMI *loadMethodMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx); -CMPIPropertyMI *tool_load_PropertyMI(const char *provider, +CMPIPropertyMI *loadPropertyMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx); -CMPIIndicationMI *tool_load_IndicationMI(const char *provider, +CMPIIndicationMI *loadIndicationMI(const char *provider, void *library, CMPIBroker * broker, CMPIContext * ctx); +CMPIClassMI *loadClassMI(const char *provider, + void *library, + CMPIBroker * broker, + CMPIContext * ctx); /*! Index: providerDrv.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- providerDrv.c 12 Mar 2005 00:43:00 -0000 1.2 +++ providerDrv.c 21 Mar 2005 14:22:38 -0000 1.3 @@ -249,7 +249,7 @@ _SFCB_ENTER(TRACE_PROVIDERDRV, "getInstanceMI"); if (info->instanceMI == NULL) info->instanceMI = - tool_load_InstanceMI(info->providerName, info->library, Broker, ctx); + loadInstanceMI(info->providerName, info->library, Broker, ctx); *mi = info->instanceMI; rc = info->instanceMI ? 1 : 0; _SFCB_RETURN(rc); @@ -261,7 +261,7 @@ _SFCB_ENTER(TRACE_PROVIDERDRV, "getAssociationMI"); if (info->associationMI == NULL) info->associationMI = - tool_load_AssociationMI(info->providerName, info->library, Broker, ctx); + loadAssociationMI(info->providerName, info->library, Broker, ctx); *mi = info->associationMI; rc = info->associationMI ? 1 : 0; _SFCB_RETURN(rc); @@ -273,7 +273,7 @@ _SFCB_ENTER(TRACE_PROVIDERDRV, "getIndicationMI"); if (info->indicationMI == NULL) info->indicationMI = - tool_load_IndicationMI(info->providerName, info->library, Broker, ctx); + loadIndicationMI(info->providerName, info->library, Broker, ctx); *mi = info->indicationMI; rc = info->indicationMI ? 1 : 0; _SFCB_RETURN(rc); @@ -285,7 +285,7 @@ _SFCB_ENTER(TRACE_PROVIDERDRV, "getMethodMI"); if (info->methodMI == NULL) info->methodMI = - tool_load_MethodMI(info->providerName, info->library, Broker, ctx); + loadMethodMI(info->providerName, info->library, Broker, ctx); *mi = info->methodMI; rc = info->methodMI ? 1 : 0; _SFCB_RETURN(rc); Index: constClass.h =================================================================== RCS file: /cvsroot/sblim/sfcb/constClass.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- constClass.h 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ constClass.h 21 Mar 2005 14:22:38 -0000 1.2 @@ -23,7 +23,7 @@ #ifndef CMPI_constClass_h #define CMPI_constClass_h -#include "objectImpl.h" +#include "cmpidt.h" #define MALLOCED(a) (((a) & 0xff000000)!=0xff000000) --- NEW FILE: cmpiftx.h --- /* * cmpiftx.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Adrian Schuur <sc...@de...> * * Description: * * CMPI extdended function tables. * */ #ifndef _CMPIFTX_H_ #define _CMPIFTX_H_ #include "constClass.h" #include "cmpidt.h" #ifdef __cplusplus extern "C" { #endif //--------------------------------------------------- //-- // _CMPIClassMI Class Provider object //-- //--------------------------------------------------- /** This structure represents a Class provider. */ typedef struct _CMPIClassMIFT CMPIClassMIFT; typedef struct _CMPIClassMI { /** Opaque pointer to Provider specific implementation data. */ void *hdl; /** Pointer to the Class Provider Function Table. */ CMPIClassMIFT *ft; } CMPIClassMI; //--------------------------------------------------- //-- // _CMPIClassMIFT Function Table //-- //--------------------------------------------------- /** This structure is a table of pointers providing access to Class provider functions. This table must be returend during initialization by the provider. */ struct _CMPIClassMIFT { /** Function table version */ int ftVersion; /** Provider version */ int miVersion; /** Provider name */ char *miName; /** Cleanup is called prior to unloading of the provider. @param mi Provider this pointer. @param ctx Invocation Context @return Function return status. */ CMPIStatus (*cleanup) (CMPIClassMI* mi, CMPIContext* ctx); /** Enumerate ObjectPaths of Classes serviced by this provider. @param mi Provider this pointer. @param ctx Invocation Context. @param rslt Result data container. @param op ObjectPath containing namespace and classname components. @return Function return status. */ CMPIStatus (*enumClassNames) (CMPIClassMI* mi, CMPIContext* ctx, CMPIResult* rslt, CMPIObjectPath* op); /** Enumerate the Classes serviced by this provider. @param mi Provider this pointer. @param ctx Invocation Context. @param rslt Result data container. @param op ObjectPath containing namespace and classname components. @return Function return status. */ CMPIStatus (*enumClasses) (CMPIClassMI* mi, CMPIContext* ctx, CMPIResult* rslt, CMPIObjectPath* op); /** Get the Class defined by <op>. @param mi Provider this pointer. @param ctx Invocation Context. @param rslt Result data container. @param op ObjectPath containing namespace, classname and key components. @param properties If not NULL, the members of the array define one or more Property names. Each returned Object MUST NOT include elements for any Properties missing from this list. @return Function return status. */ CMPIStatus (*getClass) (CMPIClassMI* mi, CMPIContext* ctx, CMPIResult* rslt, CMPIObjectPath* op, char** properties); /** Create Class from <cls> using <op> as reference. @param mi Provider this pointer. @param ctx Invocation Context. @param rslt Result data container. @param op ObjectPath containing namespace and classname components. @param cls The Class. @return Function return status. */ CMPIStatus (*createClass) (CMPIClassMI* mi, CMPIContext* ctx, CMPIResult* rslt, CMPIObjectPath* op, CMPIConstClass* cls); /** Replace an existing Class from <cls> using <op> as reference. @param mi Provider this pointer. @param ctx Invocation Context. @param rslt Result data container. @param op ObjectPath containing namespace and classname components. @param cls The Class. @return Function return status. */ CMPIStatus (*setClass) (CMPIClassMI* mi, CMPIContext* ctx, CMPIResult* rslt, CMPIObjectPath* op, CMPIConstClass* cls); /** Delete an existing Class defined by <op>. @param mi Provider this pointer. @param ctx Invocation Context. @param rslt Result data container. @param op ObjectPath containing namespace and classname components. @return Function return status. */ CMPIStatus (*deleteClass) (CMPIClassMI* mi, CMPIContext* ctx, CMPIResult* rslt, CMPIObjectPath* op); }; #ifdef __cplusplus }; #endif #endif // _CMPIFTX_H_ Index: constClass.c =================================================================== RCS file: /cvsroot/sblim/sfcb/constClass.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- constClass.c 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ constClass.c 21 Mar 2005 14:22:38 -0000 1.2 @@ -27,6 +27,7 @@ #include <string.h> #include "constClass.h" +#include "objectImpl.h" #include "msgqueue.h" //#define DEB(x) x Index: objectpath.c =================================================================== RCS file: /cvsroot/sblim/sfcb/objectpath.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- objectpath.c 9 Mar 2005 12:25:13 -0000 1.1.1.1 +++ objectpath.c 21 Mar 2005 14:22:38 -0000 1.2 @@ -25,7 +25,8 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> -#include <constClass.h> +#include "constClass.h" +#include "objectImpl.h" #include "native.h" #include "msgqueue.h" |