cmpimacs.h

Go to the documentation of this file.
00001 
00002 /*
00003  *
00004  * cmpimacs.h
00005  *
00006  * (C) Copyright IBM Corp. 2003
00007  *
00008  * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
00009  * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
00010  * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
00011  *
00012  * You can obtain a current copy of the Common Public License from
00013  * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html
00014  *
00015  * Author:        Adrian Schuur <schuur@de.ibm.com>
00016  * Contributors:
00017  *
00018  * Description: CMPI Encapsulated types Function Tables
00019  *
00020  */
00021 
00022 
00023 #ifndef _CMPIMACS_H_
00024 #define _CMPIMACS_H_
00025 #include "OW_config.h"
00026 
00027 #include "cmpidt.h"
00028 #include "cmpift.h"
00029 
00030 #ifdef DOC_ONLY
00031 #define CMPI_INLINE
00032 #endif
00033 
00034 
00035 #ifdef DOC_ONLY
00036 
00041  noReturn CMReturn(CMPIrc rc);
00042 #else
00043 #define CMReturn(rc) \
00044       { CMPIStatus stat={(rc),NULL}; \
00045          return stat; }
00046 #endif
00047 
00048 #ifdef DOC_ONLY
00049 
00055  noReturn CMReturnWithString(CMPIrc rc, CMPIString *str);
00056 #else
00057 #define CMReturnWithString(rc,str) \
00058       { CMPIStatus stat={(rc),(str)}; \
00059          return stat; }
00060 #endif
00061 
00062 #ifdef DOC_ONLY
00063 
00070 noReturn CMReturnWithChars(CMPIBroker *mb, CMPIrc rc, char *msg);
00071 #else
00072 #define CMReturnWithChars(b,rc,chars) \
00073       { CMPIStatus stat = {(rc),NULL}; \
00074          stat.msg = (b)->eft->newString((b),(chars),NULL); \
00075          return stat; }
00076 #endif
00077 
00078 
00079 #ifdef CMPI_INLINE
00080 
00084 inline static  void CMSetStatus(CMPIStatus* st, CMPIrc rcp)
00085 {
00086    if (st)
00087    {
00088       st->rc = rcp;
00089       st->msg = NULL;
00090    }
00091 }
00092 
00093 #else
00094 #define CMSetStatus(st,rcp) \
00095 if ((st)) { \
00096    (st)->rc=(rcp); \
00097    (st)->msg=NULL; \
00098 }
00099 #endif
00100 
00101 
00102 #ifdef CMPI_INLINE
00103 
00109 inline static void CMSetStatusWithString(CMPIBroker *mb, CMPIStatus *st,
00110    CMPIrc rcp, CMPIString *str)
00111 {
00112    if (st)
00113    {
00114       st->rc = rcp;
00115       st->msg = str;
00116    }
00117 }
00118 #else
00119 #define CMSetStatusWithString(st,rcp,string) \
00120 if ((st)) { \
00121    (st)->rc=(rcp); \
00122    (st)->msg=(string); \
00123 }
00124 #endif
00125 
00126 
00127 #ifdef CMPI_INLINE
00128 
00134 inline static void CMSetStatusWithChars(CMPIBroker *mb, CMPIStatus* st,
00135    CMPIrc rcp, char* chars)
00136 {
00137    if (st)
00138    {
00139       st->rc = rcp;
00140       st->msg= mb->eft->newString(mb,(chars),NULL);
00141    }
00142 }
00143 #else
00144 #define CMSetStatusWithChars(mb,st,rcp,chars) \
00145 if ((st)) { \
00146    (st)->rc=(rcp); \
00147     (st)->msg=(mb)->eft->newString((mb),(chars),NULL); \
00148 }
00149 #endif
00150 
00151 #ifndef DOC_ONLY
00152   #ifdef __cplusplus
00153     #define EXTERN_C extern "C"
00154   #else
00155     #define EXTERN_C
00156   #endif
00157 #endif
00158 
00159 #ifdef CMPI_INLINE
00160 
00163   inline static   CMPIBoolean CMIsNullObject(void* obj)
00164        { return ((obj)==NULL || *((void**)(obj))==NULL); }
00165 #else
00166   #define CMIsNullObject(o)           ((o)==NULL || *((void**)(o))==NULL)
00167 #endif
00168 
00169 #ifdef CMPI_INLINE
00170 
00173   inline static   CMPIBoolean CMIsNullValue(CMPIData val)
00174        { return ((val.state) & CMPI_nullValue); }
00175 #else
00176   #define CMIsNullValue(v)                   ((v.state) & CMPI_nullValue)
00177 #endif
00178 
00179 #ifdef CMPI_INLINE
00180 
00183   inline static   CMPIBoolean CMIsKeyValue(CMPIData val)
00184        { return ((val.state) & CMPI_keyValue); }
00185 #else
00186   #define CMIsKeyValue(v)                     ((v.state) & CMPI_keyValue)
00187 #endif
00188 
00189 #ifdef CMPI_INLINE
00190 
00193   inline static   CMPIBoolean CMIsArray(CMPIData val)
00194        { return ((val.type) & CMPI_ARRAY); }
00195 #else
00196   #define CMIsArray(v)                            ((v.type) & CMPI_ARRAY)
00197 #endif
00198 
00199 
00200 /* Life-cycle macros */
00201 
00202   #define CMClone(o,rc)                        ((o)->ft->clone((o),(rc)))
00203   #define CMRelease(o)                            ((o)->ft->release((o)))
00204   #define CMGetCharPtr(s)   ((s)!=NULL?((char*)(s)->hdl):(char*)"(NULL)")
00205  
00206 /* CMPIBroker factory macros */
00207 
00208 #ifdef CMPI_INLINE
00209 
00215   inline static   CMPIInstance* CMNewInstance(CMPIBroker *mb, CMPIObjectPath *op,
00216                                      CMPIStatus *rc)
00217        { return ((mb)->eft->newInstance((mb),(op),(rc))); }
00218 #else
00219   #define CMNewInstance(b,c,rc)     ((b)->eft->newInstance((b),(c),(rc)))
00220 #endif
00221 
00222 #ifdef CMPI_INLINE
00223 
00230   inline static   CMPIObjectPath* CMNewObjectPath(CMPIBroker *mb, char *ns, char *cn,
00231                                          CMPIStatus *rc)
00232        { return ((mb)->eft->newObjectPath((mb),(ns),(cn),(rc))); }
00233 #else
00234   #define CMNewObjectPath(b,n,c,rc) \
00235                               ((b)->eft->newObjectPath((b),(n),(c),(rc)))
00236 #endif
00237 
00238 #ifdef CMPI_INLINE
00239 
00245   inline static   CMPIString* CMNewString(CMPIBroker* mb, char *data, CMPIStatus *rc)
00246        { return ((mb)->eft->newString((mb),(data),(rc))); }
00247 #else
00248   #define CMNewString(b,s,rc)         ((b)->eft->newString((b),(s),(rc)))
00249 #endif
00250 
00251 #ifdef CMPI_INLINE
00252 
00257   inline static   CMPIArgs* CMNewArgs(CMPIBroker* mb, CMPIStatus* rc)
00258        { return ((mb)->eft->newArgs((mb),(rc))); }
00259 #else
00260   #define CMNewArgs(b,rc)                   ((b)->eft->newArgs((b),(rc)))
00261 #endif
00262 
00263 #ifdef CMPI_INLINE
00264 
00271   inline static   CMPIArray* CMNewArray(CMPIBroker* mb, CMPICount max, CMPIType type,
00272                                CMPIStatus* rc)
00273        { return ((mb)->eft->newArray((mb),(max),(type),(rc))); }
00274 #else
00275   #define CMNewArray(b,c,t,rc)     ((b)->eft->newArray((b),(c),(t),(rc)))
00276 #endif
00277 
00278 #ifdef CMPI_INLINE
00279 
00284    inline static   CMPIDateTime* CMNewDateTime(CMPIBroker* mb, CMPIStatus* rc)
00285         { return ((mb)->eft->newDateTime((mb),(rc))); }
00286 #else
00287   #define CMNewDateTime(b,rc)           ((b)->eft->newDateTime((b),(rc)))
00288 #endif
00289 
00290 #ifdef CMPI_INLINE
00291 
00299   inline static   CMPIDateTime* CMNewDateTimeFromBinary
00300                  (CMPIBroker* mb, CMPIUint64 binTime, CMPIBoolean interval,
00301         CMPIStatus* rc)
00302        { return ((mb)->eft->newDateTimeFromBinary((mb),(binTime),(interval),(rc))); }
00303 #else
00304   #define CMNewDateTimeFromBinary(b,d,i,rc) \
00305                       ((b)->eft->newDateTimeFromBinary((b),(d),(i),(rc)))
00306 #endif
00307 
00308 #ifdef CMPI_INLINE
00309 
00315    inline static   CMPIDateTime* CMNewDateTimeFromChars
00316                  (CMPIBroker* mb, char* utcTime, CMPIStatus* rc)
00317    { return ((mb)->eft->newDateTimeFromChars((mb),(utcTime),(rc))); }
00318 #else
00319   #define CMNewDateTimeFromChars(b,d,rc) \
00320                            ((b)->eft->newDateTimeFromChars((b),(d),(rc)))
00321 #endif
00322 
00323 #ifdef CMPI_INLINE
00324 
00332      inline static   CMPISelectExp* CMNewSelectExp
00333                  (CMPIBroker* mb, char* query, char* lang,
00334                   CMPIArray** projection, CMPIStatus* rc)
00335    { return ((mb)->eft->newSelectExp((mb),(query),(lang),(projection),(rc))); }
00336 #else
00337   #define CMNewSelectExp(b,q,l,p,rc) \
00338                               ((b)->eft->newSelectExp((b),(q),(l),(p),(rc)))
00339 #endif
00340 
00341 #ifdef CMPI_INLINE
00342 
00350    inline static   CMPIBoolean CMClassPathIsA
00351                  (CMPIBroker* mb, CMPIObjectPath* op, char* type, CMPIStatus* rc)
00352    { return ((mb)->eft->classPathIsA((mb),(op),(type),(rc))); }
00353 #else
00354   #define CMClassPathIsA(b,p,pn,rc) \
00355                               ((b)->eft->classPathIsA((b),(p),(pn),(rc)))
00356 #endif
00357 
00358 /* Debugging macros */
00359 
00360 #ifdef CMPI_INLINE
00361 
00368   inline static   CMPIString* CDToString
00369                  (CMPIBroker* mb, void* object, CMPIStatus* rc)
00370    { return ((mb)->eft->toString((mb),(void*)(object),(rc))); }
00371 #else
00372   #define CDToString(b,o,rc)    ((b)->eft->toString((b),(void*)(o),(rc)))
00373 #endif
00374 
00375 #ifdef CMPI_INLINE
00376 
00385    inline static   CMPIBoolean CDIsOfType
00386                  (CMPIBroker* mb, void* object, char* type, CMPIStatus* rc)
00387    { return ((mb)->eft->isOfType((mb),(void*)(object),(type),(rc))); }
00388 #else
00389   #define CDIsOfType(b,o,t,rc) \
00390                              (b)->eft->isOfType((b),(void*)(o),(t),(rc)))
00391 #endif
00392 
00393 #ifdef CMPI_INLINE
00394 
00401   inline static   CMPIString* CDGetType
00402                  (CMPIBroker* mb, void* object, CMPIStatus* rc)
00403     { return ((mb)->eft->getType((mb),(object),(rc))); }
00404 #else
00405   #define CDGetType(b,o,rc)      ((b)->eft->getType((b),(void*)(o),(rc)))
00406 #endif
00407 
00408 #if defined(CMPI_VER_85)
00409 #ifdef DOC_ONLY
00410 
00419   inline static   CMPIString* CMgetMessage
00420                  (CMPIBroker* mb, char *msgId, char *defMsg, CMPIStatus* rc, unsigned int, ...);
00421 #endif
00422 
00423   #define CMFmtArgs0() 0
00424   #define CMFmtArgs1(v1,t1) \
00425      1,v1,t1
00426   #define CMFmtArgs2(v1,t1,v2,t2) \
00427      2,v1,t1,v2,t2
00428   #define CMFmtArgs3(v1,t1,v2,t2,v3,t3) \
00429      3,v1,t1,v2,t2,v3,t3
00430   #define CMFmtArgs4(v1,t1,v2,t2,v3,t3,v4,t4) \
00431      4,v1,t1,v2,t2,v3,t3,v4,t4
00432   #define CMFmtArgs5(v1,t1,v2,t2,v3,t3,v4,t4,v5,t5) \
00433      5,v1,t1,v2,t2,v3,t3,v4,t4,v5,t5
00434   #define CMFmtArgs6(v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6) \
00435      6,v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,
00436   #define CMFmtArgs7(v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7) \
00437      7,v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7
00438   #define CMFmtArgs8(v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7,v8,t8) \
00439      8,v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7,v8,t8,
00440   #define CMFmtArgs9(v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7,v8,t8,v9,t9) \
00441      9,v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7,v8,t8,v9,t9
00442   #define CMFmtArgs10(v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7,v8,t8,v9,t9,v10,t10) \
00443      10,v1,t1,v2,t2,v3,t3,v4,t4,v5,t5,v6,t6,v7,t7,v8,t8,v9,t9,v10,t10
00444   
00445   #define CMGetMessage(b,id,def,rc,parms)      ((b)->eft->getMessage((b),(id),(def),(rc),parms))
00446 #endif /* CMPI_VER_85 */
00447 
00448 /* CMPIInstance macros */
00449 
00450 
00451 #ifdef CMPI_INLINE
00452 
00458    inline static   CMPIData CMGetProperty
00459               (CMPIInstance* inst, char* name, CMPIStatus* rc)
00460    { return ((inst)->ft->getProperty((inst),(name),(rc))); }
00461 #else
00462   #define CMGetProperty(i,n,rc)      ((i)->ft->getProperty((i),(n),(rc)))
00463  #endif
00464 
00465 #ifdef CMPI_INLINE
00466 
00473    inline static   CMPIData CMGetPropertyAt
00474               (CMPIInstance* inst, unsigned int index, CMPIString** name,
00475           CMPIStatus* rc)
00476    { return ((inst)->ft->getPropertyAt((inst),(index),(name),(rc))); }
00477 #else
00478  #define CMGetPropertyAt(i,num,s,rc) \
00479                   ((i)->ft->getPropertyAt((i),(num),(s),(rc)))
00480 #endif
00481 
00482 #ifdef CMPI_INLINE
00483 
00490   inline static   CMPIStatus CMSetProperty
00491               (CMPIInstance* inst, char* name,
00492                void* value, CMPIType type)
00493    { return ((inst)->ft->setProperty((inst),(name),(CMPIValue*)(value),(type))); }
00494 #else
00495   #define CMSetProperty(i,n,v,t) \
00496                       ((i)->ft->setProperty((i),(n),(CMPIValue*)(v),(t)))
00497 #endif
00498 
00499 #ifdef CMPI_INLINE
00500 
00505      inline static   unsigned int CMGetPropertyCount
00506               (CMPIInstance* inst, CMPIStatus* rc)
00507     { return ((inst)->ft->getPropertyCount((inst),(rc))); }
00508 #else
00509   #define CMGetPropertyCount(i,rc)   ((i)->ft->getPropertyCount((i),(rc)))
00510 #endif
00511 
00512 #ifdef CMPI_INLINE
00513 
00519      inline static   CMPIObjectPath* CMGetObjectPath
00520               (CMPIInstance* inst, CMPIStatus* rc)
00521    { return ((inst)->ft->getObjectPath((inst),(rc))); }
00522 #else
00523   #define CMGetObjectPath(i,rc)        ((i)->ft->getObjectPath((i),(rc)))
00524 #endif
00525 
00526 #ifdef CMPI_INLINE
00527 
00535      inline static   CMPIStatus CMSetPropertyFilter
00536               (CMPIInstance* inst, char** propertyList, char **keys)
00537    { return ((inst)->ft->setPropertyFilter((inst),(propertyList),(keys))); }
00538 #else
00539   #define CMSetPropertyFilter(i,pl,k) ((i)->ft->setPropertyFilter((i),(pl),(k)))
00540 #endif
00541 
00542 
00543 
00544 /* CMPIObjectPath macros */
00545 
00546 
00547 #ifdef CMPI_INLINE
00548 
00553      inline static   CMPIStatus CMSetHostname
00554               (CMPIObjectPath* op, char* hn)
00555    { return ((op)->ft->setHostname((op),(hn))); }
00556 #else
00557   #define CMSetHostname(p,n)              ((p)->ft->setHostname((p),(n)))
00558 #endif
00559 
00560 #ifdef CMPI_INLINE
00561 
00566    inline static   CMPIString* CMGetHostname
00567               (CMPIObjectPath* op,CMPIStatus* rc)
00568    { return ((op)->ft->getHostname((op),(rc))); }
00569 #else
00570   #define CMGetHostname(p,rc)            ((p)->ft->getHostname((p),(rc)))
00571 #endif
00572 
00573 #ifdef CMPI_INLINE
00574 
00579    inline static   CMPIStatus CMSetNameSpace
00580               (CMPIObjectPath* op,char* ns)
00581     { return ((op)->ft->setNameSpace((op),(ns))); }
00582 #else
00583   #define CMSetNameSpace(p,n)            ((p)->ft->setNameSpace((p),(n)))
00584 #endif
00585 
00586 #ifdef CMPI_INLINE
00587 
00592    inline static   CMPIString* CMGetNameSpace
00593               (CMPIObjectPath* op, CMPIStatus* rc)
00594    { return ((op)->ft->getNameSpace((op),(rc))); }
00595 #else
00596   #define CMGetNameSpace(p,rc)          ((p)->ft->getNameSpace((p),(rc)))
00597 #endif
00598 
00599 #ifdef CMPI_INLINE
00600 
00605    inline static   CMPIStatus CMSetClassName
00606                  (CMPIObjectPath* op, char* cn)
00607    { return ((op)->ft->setClassName((op),(cn))); }
00608 #else
00609   #define CMSetClassName(p,n)            ((p)->ft->setClassName((p),(n)))
00610 #endif
00611 
00612 #ifdef CMPI_INLINE
00613 
00618    inline static   CMPIString* CMGetClassName
00619               (CMPIObjectPath* op,CMPIStatus* rc)
00620    { return ((op)->ft->getClassName((op),(rc))); }
00621 #else
00622   #define CMGetClassName(p,rc)          ((p)->ft->getClassName((p),(rc)))
00623 #endif
00624 
00625 #ifdef CMPI_INLINE
00626 
00633    inline static   CMPIStatus CMAddKey
00634               (CMPIObjectPath* op, char* name,
00635                void* value, CMPIType type)
00636    { return ((op)->ft->addKey((op),(name),(CMPIValue*)(value),(type))); }
00637 #else
00638   #define CMAddKey(p,n,v,t) \
00639                            ((p)->ft->addKey((p),(n),(CMPIValue*)(v),(t)))
00640 #endif
00641 
00642 #ifdef CMPI_INLINE
00643 
00649    inline static   CMPIData CMGetKey
00650               (CMPIObjectPath* op, char* name, CMPIStatus* rc)
00651    { return ((op)->ft->getKey((op),(name),(rc))); }
00652 #else
00653   #define CMGetKey(p,n,rc)                ((p)->ft->getKey((p),(n),(rc)))
00654 #endif
00655 
00656 #ifdef CMPI_INLINE
00657 
00664    inline static   CMPIData CMGetKeyAt
00665               (CMPIObjectPath* op,unsigned int index, CMPIString** name,
00666           CMPIStatus* rc)
00667    { return ((op)->ft->getKeyAt((op),(index),(name),(rc))); }
00668 #else
00669   #define CMGetKeyAt(p,i,n,rc)          ((p)->ft->getKeyAt((p),(i),(n),(rc)))
00670 #endif
00671 
00672 
00673 #ifdef CMPI_INLINE
00674 
00679    inline static   unsigned int CMGetKeyCount
00680               (CMPIObjectPath* op, CMPIStatus* rc)
00681    { return ((op)->ft->getKeyCount((op),(rc))); }
00682 #else
00683   #define CMGetKeyCount(p,rc)            ((p)->ft->getKeyCount((p),(rc)))
00684 #endif
00685 
00686 #ifdef CMPI_INLINE
00687 
00692    inline static   CMPIStatus CMSetNameSpaceFromObjectPath
00693               (CMPIObjectPath* op, CMPIObjectPath* src)
00694    { return ((op)->ft->setNameSpaceFromObjectPath((op),(src))); }
00695 #else
00696   #define CMSetNameSpaceFromObjectPath(p,s) \
00697                            ((p)->ft->setNameSpaceFromObjectPath((p),(s)))
00698 #endif
00699 
00700 #ifdef CMPI_INLINE
00701 
00706    inline static   CMPIStatus CMSetHostAndNameSpaceFromObjectPath
00707               (CMPIObjectPath* op,
00708                CMPIObjectPath* src)
00709    { return ((op)->ft->setHostAndNameSpaceFromObjectPath((op),(src))); }
00710 #else
00711   #define CMSetHostAndNameSpaceFromObjectPath(p,s) \
00712                      ((p)->ft->setHostAndNameSpaceFromObjectPath((p),(s)))
00713 #endif
00714 
00715 
00716 
00717 /* CMPIArray macros */
00718 
00719 
00720 #ifdef CMPI_INLINE
00721 
00726    inline static   CMPICount CMGetArrayCount
00727              (CMPIArray* ar, CMPIStatus* rc)
00728    { return ((ar)->ft->getSize((ar),(rc))); }
00729 #else
00730    #define CMGetArrayCount(a,rc)             ((a)->ft->getSize((a),(rc)))
00731 #endif
00732 
00733 #ifdef CMPI_INLINE
00734 
00739    inline static   CMPIType CMGetArrayType
00740              (CMPIArray* ar, CMPIStatus* rc)
00741    { return ((ar)->ft->getSimpleType((ar),(rc))); }
00742 #else
00743    #define CMGetArrayType(a,rc)        ((a)->ft->getSimpleType((a),(rc)))
00744 #endif
00745 
00746 #ifdef CMPI_INLINE
00747 
00753    inline static   CMPIData CMGetArrayElementAt
00754              (CMPIArray* ar, CMPICount index, CMPIStatus* rc)
00755    { return ((ar)->ft->getElementAt((ar),(index),(rc))); }
00756 #else
00757    #define CMGetArrayElementAt(a,n,rc) \
00758                                     ((a)->ft->getElementAt((a),(n),(rc)))
00759 #endif
00760 
00761 #ifdef CMPI_INLINE
00762 
00769    inline static   CMPIStatus CMSetArrayElementAt
00770              (CMPIArray* ar, CMPICount index, CMPIValue* value, CMPIType type)
00771    { return ((ar)->ft->setElementAt((ar),(index),(value),(type))); }
00772 #else
00773    #define CMSetArrayElementAt(a,n,v,t) \
00774                      ((a)->ft->setElementAt((a),(n),(CMPIValue*)(v),(t)))
00775 #endif
00776 
00777 
00778 
00779 /* CMPIARgs macros */
00780 
00781 
00782 #ifdef CMPI_INLINE
00783 
00790    inline static   CMPIStatus CMAddArg
00791               (CMPIArgs* as, char* name ,void* value,
00792                CMPIType type)
00793    { return  ((as)->ft->addArg((as),(name),(CMPIValue*)(value),(type))); }
00794 #else
00795   #define CMAddArg(a,n,v,t) \
00796                            ((a)->ft->addArg((a),(n),(CMPIValue*)(v),(t)))
00797 #endif
00798 
00799 #ifdef CMPI_INLINE
00800 
00806   inline static   CMPIData CMGetArg
00807               (CMPIArgs* as, char* name, CMPIStatus* rc)
00808    { return  ((as)->ft->getArg((as),(name),(rc))); }
00809 #else
00810   #define CMGetArg(a,n,rc)                ((a)->ft->getArg((a),(n),(rc)))
00811 #endif
00812 
00813 #ifdef CMPI_INLINE
00814 
00821    inline static   CMPIData CMGetArgAt
00822               (CMPIArgs* as, unsigned int index, CMPIString** name,
00823           CMPIStatus* rc)
00824    { return  ((as)->ft->getArgAt((as),(index),(name),(rc))); }
00825 #else
00826   #define CMGetArgAt(a,p,n,rc)       ((a)->ft->getArgAt((a),(p),(n),(rc)))
00827 #endif
00828 
00829 #ifdef CMPI_INLINE
00830 
00835    inline static   unsigned int CMGetArgCount
00836               (CMPIArgs* as, CMPIStatus* rc)
00837    { return  ((as)->ft->getArgCount((as),(rc))); }
00838 #else
00839   #define CMGetArgCount(a,rc)            ((a)->ft->getArgCount((a),(rc)))
00840 #endif
00841 
00842 
00843 
00844 /* CMPIString Macros */
00845 
00846 
00847 #ifdef CMPI_INLINE
00848 
00853    inline static   char* CMGetCharsPtr
00854              (CMPIString* st, CMPIStatus* rc)
00855    { return  ((st)->ft->getCharPtr((st),(rc))); }
00856 #else
00857   #define CMGetCharsPtr(st,rc)              ((st)->ft->getCharPtr((st),(rc)))
00858 #endif
00859 
00860 
00861 
00862 /* CMPIDateTime macros */
00863 
00864 
00865 #ifdef CMPI_INLINE
00866 
00871    inline static   CMPIString* CMGetStringFormat
00872              (CMPIDateTime* dt, CMPIStatus* rc)
00873    { return ((dt)->ft->getStringFormat((dt),(rc))); }
00874 #else
00875   #define CMGetStringFormat(d,rc)    ((d)->ft->getStringFormat((d),(rc)))
00876 #endif
00877 
00878 #ifdef CMPI_INLINE
00879 
00885    inline static   CMPIUint64 CMGetBinaryFormat
00886              (CMPIDateTime* dt, CMPIStatus* rc)
00887    { return ((dt)->ft->getBinaryFormat((dt),(rc))); }
00888 #else
00889   #define CMGetBinaryFormat(d,rc)    ((d)->ft->getBinaryFormat((d),(rc)))
00890 #endif
00891 
00892 #ifdef CMPI_INLINE
00893 
00898    inline static   CMPIBoolean CMIsInterval
00899               (CMPIDateTime* dt, CMPIStatus* rc)
00900    { return ((dt)->ft->isInterval((dt),(rc))); }
00901 #else
00902   #define CMIsInterval(d,rc)              ((d)->ft->isInterval((d),(rc)))
00903 #endif
00904 
00905 
00906 /* CMPIEnumeration Macros */
00907 
00908 
00909 #ifdef CMPI_INLINE
00910 
00915    inline static   CMPIData CMGetNext
00916              (CMPIEnumeration* en, CMPIStatus* rc)
00917    { return ((en)->ft->getNext((en),(rc))); }
00918 #else
00919   #define CMGetNext(n,rc)                    ((n)->ft->getNext((n),(rc)))
00920 #endif
00921 
00922 #ifdef CMPI_INLINE
00923 
00928    inline static   CMPIBoolean CMHasNext
00929              (CMPIEnumeration* en, CMPIStatus* rc)
00930    { return ((en)->ft->hasNext((en),(rc))); }
00931 #else
00932   #define CMHasNext(n,rc)                    ((n)->ft->hasNext((n),(rc)))
00933 #endif
00934 
00935 #ifdef CMPI_INLINE
00936 
00941    inline static   CMPIArray* CMToArray
00942              (CMPIEnumeration* en, CMPIStatus* rc)
00943    { return ((en)->ft->toArray((en),(rc))); }
00944 #else
00945   #define CMToArray(n,rc)                   ((n)->ft->toArray((n),(rc)))
00946 #endif
00947 
00948 
00949 /* CMPIResult Macros */
00950 
00951 
00952 #ifdef CMPI_INLINE
00953 
00959   inline static   CMPIStatus CMReturnData
00960               (CMPIResult* rslt, void* value, CMPIType type)
00961    { return ((rslt)->ft->returnData((rslt),(CMPIValue*)(value),(type))); }
00962 #else
00963   #define CMReturnData(r,v,t) \
00964                            ((r)->ft->returnData((r),(CMPIValue*)(v),(t)))
00965 #endif
00966 
00967 #ifdef CMPI_INLINE
00968 
00973    inline static   CMPIStatus CMReturnInstance
00974               (CMPIResult* rslt,CMPIInstance* inst)
00975    { return ((rslt)->ft->returnInstance((rslt),(inst))); }
00976 #else
00977   #define CMReturnInstance(r,i)        ((r)->ft->returnInstance((r),(i)))
00978 #endif
00979 
00980 #ifdef CMPI_INLINE
00981 
00986    inline static   CMPIStatus CMReturnObjectPath
00987               (CMPIResult* rslt, CMPIObjectPath* ref)
00988    { return ((rslt)->ft->returnObjectPath((rslt),(ref))); }
00989 #else
00990   #define CMReturnObjectPath(r,o)    ((r)->ft->returnObjectPath((r),(o)))
00991 #endif
00992 
00993 #ifdef CMPI_INLINE
00994 
00998    inline static   CMPIStatus CMReturnDone
00999               (CMPIResult* rslt)
01000    { return ((rslt)->ft->returnDone((rslt))); }
01001 #else
01002   #define CMReturnDone(r)                      ((r)->ft->returnDone((r)))
01003 #endif
01004 
01005 
01006 
01007 /* CMPIContext Macros */
01008 
01009 
01010 #ifdef CMPI_INLINE
01011 
01017    inline static   CMPIData CMGetContextEntry
01018               (CMPIContext* ctx, char* name, CMPIStatus* rc)
01019    { return ((ctx)->ft->getEntry((ctx),(name),(rc))); }
01020 #else
01021   #define CMGetContextEntry(c,n,rc)  \
01022                                  ((c)->ft->getEntry((c),(n),(rc)))
01023 #endif
01024 
01025 #ifdef CMPI_INLINE
01026 
01033    inline static   CMPIData CMGetContextEntryAt
01034               (CMPIContext* ctx, unsigned int index, CMPIString** name,
01035           CMPIStatus* rc)
01036    { return ((ctx)->ft->getEntryAt((ctx),(index),(name),(rc))); }
01037 #else
01038   #define CMGetContextEntryAt(c,p,n,rc) \
01039                          ((c)->ft->getEntryAt((c),(p),(n),(rc)))
01040 #endif
01041 
01042 #ifdef CMPI_INLINE
01043 
01048    inline static   unsigned int CMGetContextEntryCount
01049               (CMPIContext* ctx, CMPIStatus* rc)
01050    { return ((ctx)->ft->getEntryCount((ctx),(rc))); }
01051 #else
01052   #define CMGetContextEntryCount(c,rc) \
01053                                 ((c)->ft->getEntryCount((c),(rc)))
01054 #endif
01055 
01056 #ifdef CMPI_INLINE
01057 
01064    inline static   CMPIStatus CMAddContextEntry
01065               (CMPIContext* ctx, char* name, void* value, CMPIType type)
01066    { return ((ctx)->ft->addEntry((ctx),(name),(CMPIValue*)(value),(type))); }
01067 #else
01068   #define CMAddContextEntry(c,n,v,t) \
01069                   ((c)->ft->addEntry((c),(n),(CMPIValue*)(v),(t)))
01070 #endif
01071 
01072 
01073 
01074 /* CMPISelectExp macros */
01075 
01076 
01077 
01078 #ifdef CMPI_INLINE
01079 
01084    inline static   CMPIString* CMGetSelExpString
01085               (CMPISelectExp* se, CMPIStatus* rc)
01086    { return ((se)->ft->getString((se),(rc))); }
01087 #else
01088   #define CMGetSelExpString(s,rc)          ((s)->ft->getString((s),(rc)))
01089 #endif
01090 
01091 #ifdef CMPI_INLINE
01092 
01098    inline static   CMPIBoolean CMEvaluateSelExp
01099               (CMPISelectExp* se, CMPIInstance* inst, CMPIStatus* rc)
01100    { return ((se)->ft->evaluate((se),(inst),(rc))); }
01101 #else
01102   #define CMEvaluateSelExp(s,i,r)        ((s)->ft->evaluate((s),(i),(r)))
01103 #endif
01104 
01105 #ifdef CMPI_INLINE
01106 
01111    inline static   CMPISelectCond* CMGetDoc
01112               (CMPISelectExp* se, CMPIStatus* rc)
01113    { return ((se)->ft->getDOC((se),(rc))); }
01114 #else
01115   #define CMGetDoc(s,rc)                      ((s)->ft->getDOC((s),(rc)))
01116 #endif
01117 
01118 #ifdef CMPI_INLINE
01119 
01124    inline static   CMPISelectCond* CMGetCod
01125               (CMPISelectExp* se, CMPIStatus* rc)
01126    { return ((se)->ft->getCOD((se),(rc))); }
01127 #else
01128   #define CMGetCod(s,rc)                      ((s)->ft->getCOD((s),(rc)))
01129 #endif
01130 
01131 
01132 
01133 /* CMPISelectCond macros */
01134 
01135     
01136 
01137 #ifdef CMPI_INLINE
01138 
01145    inline static   CMPICount CMGetSubCondCountAndType
01146               (CMPISelectCond* sc, int* type, CMPIStatus* rc)
01147    { return ((sc)->ft->getCountAndType((sc),(type),(rc))); }
01148 #else
01149   #define CMGetSubCondCount(c,rc) \
01150                                 ((c)->ft->getCountAndType((c),NULL,(rc)))
01151 #endif
01152 
01153 #ifdef CMPI_INLINE
01154 
01160    inline static   CMPISubCond* CMGetSubCondAt
01161               (CMPISelectCond* sc, unsigned int index, CMPIStatus* rc)
01162    { return ((sc)->ft->getSubCondAt((sc),(index),(rc))); }
01163 #else
01164   #define CMGetSubCondAt(c,p,rc)    ((c)->ft->getSubCondAt((c),(p),(rc)))
01165 #endif
01166 
01167 
01168 
01169 /* CMPISubCond macros */
01170 
01171 
01172 
01173 #ifdef CMPI_INLINE
01174 
01179    inline static   CMPICount CMGetPredicateCount
01180               (CMPISubCond* sc, CMPIStatus* rc)
01181    { return ((sc)->ft->getCount((sc),(rc))); }
01182 #else
01183   #define CMGetPredicateCount(s,rc)         ((s)->ft->getCount((s),(rc)))
01184 #endif
01185 
01186 #ifdef CMPI_INLINE
01187 
01193    inline static   CMPIPredicate* CMGetPredicateAt
01194               (CMPISubCond* sc, unsigned int index, CMPIStatus* rc)
01195    { return ((sc)->ft->getPredicateAt((sc),(index),(rc))); }
01196 #else
01197    #define CMGetPredicateAt(s,p,rc) \
01198                                   ((s)->ft->getPredicateAt((s),(p),(rc)))
01199 #endif
01200 
01201 #ifdef CMPI_INLINE
01202 
01208    inline static   CMPIPredicate* CMGetPredicate
01209               (CMPISubCond* sc, char* name, CMPIStatus* rc)
01210    { return ((sc)->ft->getPredicate((sc),(name),(rc))); }
01211 #else
01212   #define CMGetPredicate(s,n,rc)    ((s)->ft->getPredicate((s),(n),(rc)))
01213 #endif
01214 
01215 
01216 
01217 /* CMPIPredicate macros */
01218 
01219 
01220 #ifdef CMPI_INLINE
01221 
01229    inline static   CMPIStatus CMGetPredicateData
01230               (CMPIPredicate* pr, CMPIType* type,
01231                CMPIPredOp* op, CMPIString** lhs, CMPIString** rhs)
01232    { return ((pr)->ft->getData((pr),(type),(op),(lhs),(rhs))); }
01233 #else
01234   #define CMGetPredicateData(p,t,o,n,v) \
01235                                   ((p)->ft->getData((p),(t),(o),(n),(v)))
01236 #endif
01237 
01238 #ifdef CMPI_INLINE
01239 
01247    inline static   int CMEvaluatePredicate
01248               (CMPIPredicate* pr, void* value,
01249                CMPIType type, CMPIStatus* rc)
01250    { return ((pr)->ft->evaluate((pr),(CMPIValue*)(value),(type),(rc))); }
01251 #else
01252   #define CMEvaluatePredicate(p,v,t,rc) \
01253                                   ((p)->ft->evaluate((p),(CMPIValue*)(v),(t),(rc)))
01254 #endif
01255 
01256 
01257 
01258 /* CMPIBroker Macros */
01259 
01260 
01261 
01262 #ifdef CMPI_INLINE
01263 
01266    inline static   unsigned long CBGetClassification(CMPIBroker* mb)
01267    { return ((mb)->bft->brokerClassification); }
01268 #else
01269   #define CBGetClassification(b)         ((b)->bft->brokerClassification)
01270 #endif
01271 
01272 #ifdef CMPI_INLINE
01273 
01275    inline static   int CBBrokerVersion(CMPIBroker* mb)
01276    { return ((mb)->bft->brokerVersion); }
01277 #else
01278   #define CBBrokerVersion(b)                    ((b)->bft->brokerVersion)
01279 #endif
01280 
01281 #ifdef CMPI_INLINE
01282 
01284    inline static   char* CBbrokerName(CMPIBroker* mb)
01285    { return ((mb)->bft->brokerName); }
01286 #else
01287   #define CBBrokerName(b)                          ((b)->bft->brokerName)
01288 #endif
01289 
01290 
01291 #ifdef CMPI_INLINE
01292 
01300    inline static   CMPIContext* CBPrepareAttachThread
01301                 (CMPIBroker* mb, CMPIContext* ctx)
01302    { return ((mb)->bft->prepareAttachThread((mb),(ctx))); }
01303 #else
01304   #define CBPrepareAttachThread(b,c) \
01305                                  ((b)->bft->prepareAttachThread((b),(c)))
01306 #endif
01307 
01308 #ifdef CMPI_INLINE
01309 
01315    inline static   CMPIStatus CBAttachThread
01316                 (CMPIBroker* mb, CMPIContext* ctx)
01317    { return ((mb)->bft->attachThread((mb),(ctx))); }
01318 #else
01319   #define CBAttachThread(b,c)           ((b)->bft->attachThread((b),(c)))
01320 #endif
01321 
01322 #ifdef CMPI_INLINE
01323 
01330    inline static   CMPIStatus CBDetachThread
01331                 (CMPIBroker* mb, CMPIContext* ctx)
01332    { return ((mb)->bft->detachThread((mb),(ctx))); }
01333 #else
01334   #define CBDetachThread(b,c)           ((b)->bft->detachThread((b),(c)))
01335 #endif
01336 
01337 
01338 
01339 #ifdef CMPI_INLINE
01340 
01348    inline static   CMPIStatus CBDeliverIndication
01349                 (CMPIBroker* mb, CMPIContext* ctx,
01350                  char* ns, CMPIInstance* ind)
01351    { return ((mb)->bft->deliverIndication((mb),(ctx),(ns),(ind))); }
01352 #else
01353   #define CBDeliverIndication(b,c,n,i) \
01354                            ((b)->bft->deliverIndication((b),(c),(n),(i)))
01355 #endif
01356 
01357 #ifdef CMPI_INLINE
01358 
01365    inline static   CMPIEnumeration* CBEnumInstanceNames
01366                 (CMPIBroker* mb, CMPIContext* ctx,
01367                  CMPIObjectPath* op, CMPIStatus* rc)
01368    { return ((mb)->bft->enumInstanceNames((mb),(ctx),(op),(rc))); }
01369 #else
01370   #define CBEnumInstanceNames(b,c,p,rc) \
01371                           ((b)->bft->enumInstanceNames((b),(c),(p),(rc)))
01372 #endif
01373 
01374 #ifdef CMPI_INLINE
01375 
01387    inline static   CMPIEnumeration* CBEnumInstances
01388                 (CMPIBroker* mb, CMPIContext* ctx,
01389                  CMPIObjectPath* op, char** properties, CMPIStatus* rc)
01390    { return ((mb)->bft->enumInstances((mb),(ctx),(op),(properties),(rc))); }
01391 #else
01392   #define CBEnumInstances(b,c,p,pr,rc) \
01393                          ((b)->bft->enumInstances((b),(c),(p),(pr),(rc)))
01394 #endif
01395 
01396 #ifdef CMPI_INLINE
01397 
01408    inline static   CMPIInstance* CBGetInstance
01409                 (CMPIBroker* mb, CMPIContext* ctx,
01410                  CMPIObjectPath* op, char** properties, CMPIStatus* rc)
01411    { return ((mb)->bft->getInstance((mb),(ctx),(op),(properties),(rc))); }
01412 #else
01413   #define CBGetInstance(b,c,p,pr,rc) \
01414                            ((b)->bft->getInstance((b),(c),(p),(pr),(rc)))
01415 #endif
01416 
01417 #ifdef CMPI_INLINE
01418 
01426    inline static   CMPIObjectPath* CBCreateInstance
01427                 (CMPIBroker* mb, CMPIContext* ctx,
01428                  CMPIObjectPath* op, CMPIInstance* inst, CMPIStatus* rc)
01429    { return ((mb)->bft->createInstance((mb),(ctx),(op),(inst),(rc))); }
01430 #else
01431   #define CBCreateInstance(b,c,p,i,rc) \
01432                              ((b)->bft->createInstance((b),(c),(p),(i),(rc)))
01433 #endif
01434 
01435 #ifdef CMPI_INLINE
01436 
01443    inline static   CMPIStatus CBSetInstance
01444                 (CMPIBroker* mb, CMPIContext* ctx,
01445        CMPIObjectPath* op, CMPIInstance* inst)
01446    { return ((mb)->bft->setInstance((mb),(ctx),(op),(inst))); }
01447 #else
01448   #define CBSetInstance(b,c,p,i)      ((b)->bft->setInstance((b),(c),(p),(i)))
01449 #endif
01450 
01451 #ifdef CMPI_INLINE
01452 
01458    inline static   CMPIStatus CBDeleteInstance
01459                 (CMPIBroker* mb, CMPIContext* ctx,
01460                  CMPIObjectPath* op)
01461    { return ((mb)->bft->deleteInstance((mb),(ctx),(op))); }
01462 #else
01463   #define CBDeleteInstance(b,c,p)  ((b)->bft->deleteInstance((b),(c),(p)))
01464 #endif
01465 
01466 #ifdef CMPI_INLINE
01467 
01477    inline static   CMPIEnumeration* CBExecQuery
01478                 (CMPIBroker* mb, CMPIContext* ctx,
01479                  CMPIObjectPath* op, char* query, char* lang, CMPIStatus* rc)
01480    { return ((mb)->bft->execQuery((mb),(ctx),(op),(query),(lang),(rc))); }
01481 #else
01482   #define CBExecQuery(b,c,p,l,q,rc) \
01483                           ((b)->bft->execQuery((b),(c),(p),(l),(q),(rc)))
01484 #endif
01485 
01486 
01487 #ifdef CMPI_INLINE
01488 
01518    inline static   CMPIEnumeration* CBAssociators
01519                 (CMPIBroker* mb,CMPIContext* ctx,
01520                  CMPIObjectPath* op, char* assocClass, char* resultClass,
01521        char* role, char* resultRole, char** properties, CMPIStatus* rc)
01522    { return ((mb)->bft->associators((mb),(ctx),(op),(assocClass),(resultClass),
01523                                     (role),(resultRole),(properties),(rc))); }
01524 #else
01525   #define CBAssociators(b,c,p,acl,rcl,r,rr,pr,rc) \
01526       ((b)->bft->associators((b),(c),(p),(acl),(rcl),(r),(rr),(pr),(rc)))
01527 #endif
01528 
01529 #ifdef CMPI_INLINE
01530 
01557    inline static   CMPIEnumeration* CBAssociatorNames
01558                 (CMPIBroker* mb, CMPIContext* ctx,
01559                  CMPIObjectPath* op, char* assocClass, char* resultClass,
01560        char* role, char* resultRole, CMPIStatus* rc)
01561    { return ((mb)->bft->associatorNames((mb),(ctx),(op),
01562                 (assocClass),(resultClass),(role),(resultRole),(rc))); }
01563 #else
01564   #define CBAssociatorNames(b,c,p,acl,rcl,r,rr,rc) \
01565        ((b)->bft->associatorNames((b),(c),(p),(acl),(rcl),(r),(rr),(rc)))
01566 #endif
01567 
01568 #ifdef CMPI_INLINE
01569 
01590    inline static   CMPIEnumeration* CBReferences
01591                 (CMPIBroker* mb, CMPIContext* ctx,
01592                  CMPIObjectPath* op, char* resultClass ,char* role ,
01593        char** properties, CMPIStatus* rc)
01594    { return ((mb)->bft->references((mb),(ctx),(op),
01595                 (resultClass),(role),(properties),(rc))); }
01596 #else
01597   #define CBReferences(b,c,p,acl,r,pr,rc) \
01598        ((b)->bft->references((b),(c),(p),(acl),(r),(pr),(rc)))
01599 #endif
01600 
01601 #ifdef CMPI_INLINE
01602 
01620    inline static   CMPIEnumeration* CBReferenceNames
01621                 (CMPIBroker* mb, CMPIContext* ctx,
01622                  CMPIObjectPath* op, char* resultClass ,char* role,
01623                  CMPIStatus* rc)
01624    { return ((mb)->bft->referenceNames((mb),(ctx),(op),(resultClass),(role),(rc))); }
01625 #else
01626   #define CBReferenceNames(b,c,p,acl,r,rc) \
01627        ((b)->bft->referenceNames((b),(c),(p),(acl),(r),(rc)))
01628 #endif
01629 
01630 
01631 #ifdef CMPI_INLINE
01632 
01643    inline static   CMPIData CBInvokeMethod
01644                 (CMPIBroker* mb, CMPIContext* ctx,
01645                  CMPIObjectPath* op,char* method,
01646        CMPIArgs* in, CMPIArgs* out, CMPIStatus* rc)
01647    { return ((mb)->bft->invokeMethod((mb),(ctx),(op),(method),(in),(out),(rc))); }
01648 #else
01649   #define CBInvokeMethod(b,c,p,m,ai,ao,rc) \
01650                  ((b)->bft->invokeMethod((b),(c),(p),(m),(ai),(ao),(rc)))
01651 #endif
01652 
01653 #ifdef CMPI_INLINE
01654 
01663      inline static   CMPIStatus CBSetProperty
01664                 (CMPIBroker* mb, CMPIContext* ctx,
01665                  CMPIObjectPath* op, char* name , void* value,
01666                  CMPIType type)
01667    { return ((mb)->bft->setProperty((mb),(ctx),(op),(name),
01668                     (CMPIValue*)(value),(type))); }
01669 #else
01670   #define CBSetProperty(b,c,p,n,v,t) \
01671              ((b)->bft->setProperty((b),(c),(p),(n),(CMPIValue*)(v),(t)))
01672 #endif
01673 
01674 #ifdef CMPI_INLINE
01675 
01683    inline static   CMPIData CBGetProperty
01684                 (CMPIBroker* mb, CMPIContext* ctx,
01685                  CMPIObjectPath* op, char* name, CMPIStatus* rc)
01686    { return (mb)->bft->getProperty((mb),(ctx),(op),(name),(rc)); }
01687 #else
01688   #define CBGetProperty(b,c,p,n,rc) \
01689              (b)->bft->getProperty((b),(c),(p),(n),(rc))
01690 #endif
01691 
01692 
01693 #ifndef DOC_ONLY
01694 /* MI factory stubs */
01695 
01696   #define CMNoHook if (brkr)
01697 #endif
01698 
01699 /*
01700    -----------------  C provider factories ---------------------
01701 */
01702 
01703 #ifdef DOC_ONLY
01704 
01723    CMPIInstanceMI* CMInstanceMIStub(chars pfx, chars pn,
01724          CMPIBroker *broker, statement hook);
01725 #else
01726   #define CMInstanceMIStub(pfx,pn,broker,hook) \
01727   static CMPIInstanceMIFT instMIFT__={ \
01728    CMPICurrentVersion, \
01729    CMPICurrentVersion, \
01730    "instance" #pn, \
01731    pfx##Cleanup, \
01732    pfx##EnumInstanceNames, \
01733    pfx##EnumInstances, \
01734    pfx##GetInstance, \
01735    pfx##CreateInstance, \
01736    pfx##SetInstance, \
01737    pfx##DeleteInstance, \
01738    pfx##ExecQuery, \
01739   }; \
01740   EXTERN_C \
01741   CMPIInstanceMI* pn##_Create_InstanceMI(CMPIBroker* brkr,CMPIContext *ctx) { \
01742    static CMPIInstanceMI mi={ \
01743       NULL, \
01744       &instMIFT__, \
01745    }; \
01746    broker=brkr; \
01747    hook; \
01748    return &mi;  \
01749   }
01750 #endif
01751 
01752 #ifdef DOC_ONLY
01753 
01773    CMPIAssociationMI* CMAssociationMIStub(chars pfx, chars pn,
01774          CMPIBroker *broker, statement hook);
01775 #else
01776   #define CMAssociationMIStub(pfx,pn,broker,hook) \
01777   static CMPIAssociationMIFT assocMIFT__={ \
01778    CMPICurrentVersion, \
01779    CMPICurrentVersion, \
01780    "asscociation" #pn, \
01781    pfx##AssociationCleanup, \
01782    pfx##Associators, \
01783    pfx##AssociatorNames, \
01784    pfx##References, \
01785    pfx##ReferenceNames, \
01786   }; \
01787   EXTERN_C \
01788   CMPIAssociationMI* pn##_Create_AssociationMI(CMPIBroker* brkr,CMPIContext *ctx) { \
01789    static CMPIAssociationMI mi={ \
01790       NULL, \
01791       &assocMIFT__, \
01792    }; \
01793    broker=brkr; \
01794    hook; \
01795    return &mi;  \
01796   }
01797 #endif
01798 
01799 #ifdef DOC_ONLY
01800 
01817    CMPIMethodMI* CMMethodMIStub(chars pfx, chars pn,
01818          CMPIBroker *broker, statement hook);
01819 #else
01820   #define CMMethodMIStub(pfx,pn,broker,hook) \
01821   static CMPIMethodMIFT methMIFT__={ \
01822    CMPICurrentVersion, \
01823    CMPICurrentVersion, \
01824    "method" #pn, \
01825    pfx##MethodCleanup, \
01826    pfx##InvokeMethod, \
01827   }; \
01828   EXTERN_C \
01829   CMPIMethodMI* pn##_Create_MethodMI(CMPIBroker* brkr,CMPIContext *ctx) { \
01830    static CMPIMethodMI mi={ \
01831       NULL, \
01832       &methMIFT__, \
01833    }; \
01834    broker=brkr; \
01835    hook; \
01836    return &mi; \
01837   }
01838 #endif
01839 
01840 #ifdef DOC_ONLY
01841 
01860    CMPIPropertyMI* CMPropertyMIStub(chars pfx, chars pn,
01861          CMPIBroker *broker, statement hook);
01862 #else
01863   #define CMPropertyMIStub(pfx,pn,broker,hook) \
01864   static CMPIPropertyMIFT propMIFT__={ \
01865    CMPICurrentVersion, \
01866    CMPICurrentVersion, \
01867    "property" #pn, \
01868    pfx##PropertyCleanup, \
01869    pfx##SetProperty, \
01870    pfx##GetProperty, \
01871   }; \
01872   EXTERN_C \
01873   CMPIPropertyMI* pn##_Create_PropertyMI(CMPIBroker* brkr,CMPIContext *ctx) { \
01874    static CMPIPropertyMI mi={ \
01875       NULL, \
01876       &propMIFT__, \
01877    }; \
01878    broker=brkr; \
01879    hook; \
01880    return &mi; \
01881   }
01882 #endif
01883 
01884 #ifdef DOC_ONLY
01885 
01903    CMPIIndicationMI* CMIndicationMIStub(chars pfx, chars pn,
01904          CMPIBroker *broker, statement hook);
01905 #else
01906   #define CMIndicationMIStub(pfx,pn,broker,hook) \
01907   static CMPIIndicationMIFT indMIFT__={ \
01908    CMPICurrentVersion, \
01909    CMPICurrentVersion, \
01910    "Indication" #pn, \
01911    pfx##IndicationCleanup, \
01912    pfx##AuthorizeFilter, \
01913    pfx##MustPoll, \
01914    pfx##ActivateFilter, \
01915    pfx##DeActivateFilter, \
01916   }; \
01917   EXTERN_C \
01918   CMPIIndicationMI* pn##_Create_IndicationMI(CMPIBroker* brkr,CMPIContext *ctx) { \
01919    static CMPIIndicationMI mi={ \
01920       NULL, \
01921       &indMIFT__, \
01922    }; \
01923    broker=brkr; \
01924    hook; \
01925    return &mi; \
01926  }
01927 #endif
01928 
01929 /*
01930    -----------------  C++ provider factories ---------------------
01931 */
01932 
01933 #ifdef DOC_ONLY
01934 
01945    CMPIInstanceMI* CMInstanceMIFactory(chars cn, chars pn);
01946 #else
01947  #define CMInstanceMIFactory(cn,pn) \
01948  extern "C" \
01949  CMPIInstanceMI* pn##_Create_InstanceMI(CMPIBroker* broker, CMPIContext *ctxp) { \
01950    static CMPIInstanceMIFT instMIFT={ \
01951     CMPICurrentVersion, \
01952     CMPICurrentVersion, \
01953     "instance" #pn, \
01954     (CMPIStatus(*)(CMPIInstanceMI*,CMPIContext*))CmpiBaseMI::driveBaseCleanup, \
01955     CmpiInstanceMI::driveEnumInstanceNames, \
01956     CmpiInstanceMI::driveEnumInstances, \
01957     CmpiInstanceMI::driveGetInstance, \
01958     CmpiInstanceMI::driveCreateInstance, \
01959     CmpiInstanceMI::driveSetInstance, \
01960     CmpiInstanceMI::driveDeleteInstance, \
01961     CmpiInstanceMI::driveExecQuery, \
01962    }; \
01963    static CMPIInstanceMI mi; \
01964    fprintf(stderr,"--- _Create_InstanceMI() broker: %p\n",broker); \
01965    CmpiContext ctx(ctxp); \
01966    mi.ft=&instMIFT; \
01967    CmpiInstanceMI *provider=new cn(broker,ctx); \
01968    mi.hdl=provider; \
01969    if (CmpiProviderBase::testAndSetOneTime(2)) { \
01970        provider->initialize(ctx); \
01971        CmpiProviderBase::setBroker(broker); \
01972     } \
01973     return &mi; \
01974  }
01975 #endif
01976 
01977 #ifdef DOC_ONLY
01978 
01990    CMPIAssociationMI* CMAssociationMIFactory(chars cn, chars pn);
01991 #else
01992  #define CMAssociationMIFactory(cn,pn) \
01993  extern "C" \
01994  CMPIAssociationMI* pn##_Create_AssociationMI(CMPIBroker* broker, CMPIContext *ctxp) { \
01995    static CMPIAssociationMIFT assocMIFT={ \
01996     CMPICurrentVersion, \
01997     CMPICurrentVersion, \
01998     "association" #pn, \
01999     (CMPIStatus(*)(CMPIAssociationMI*,CMPIContext*))CmpiBaseMI::driveBaseCleanup, \
02000     CmpiAssociationMI::driveAssociators, \
02001     CmpiAssociationMI::driveAssociatorNames, \
02002     CmpiAssociationMI::driveReferences, \
02003     CmpiAssociationMI::driveReferenceNames, \
02004   }; \
02005    static CMPIAssociationMI mi; \
02006    fprintf(stderr,"--- _Create_AssociationMI() broker: %p\n",broker); \
02007    CmpiContext ctx(ctxp); \
02008    mi.ft=&assocMIFT; \
02009    CmpiAssociationMI *provider=new cn(broker,ctx); \
02010    mi.hdl=provider; \
02011    if (CmpiProviderBase::testAndSetOneTime(2)) { \
02012        provider->initialize(ctx); \
02013        CmpiProviderBase::setBroker(broker); \
02014     } \
02015     return &mi; \
02016  }
02017 #endif
02018 
02019 #ifdef DOC_ONLY
02020 
02032    CMPIMethodMI* CMMethodMIFactory(chars cn, chars pn);
02033 #else
02034  #define CMMethodMIFactory(cn,pn) \
02035  extern "C" \
02036  CMPIMethodMI* pn##_Create_MethodMI(CMPIBroker* broker, CMPIContext *ctxp) { \
02037    static CMPIMethodMIFT methMIFT={ \
02038     CMPICurrentVersion, \
02039     CMPICurrentVersion, \
02040     "method" #pn, \
02041     (CMPIStatus(*)(CMPIMethodMI*,CMPIContext*))CmpiBaseMI::driveBaseCleanup, \
02042     CmpiMethodMI::driveInvokeMethod, \
02043    }; \
02044    static CMPIMethodMI mi; \
02045    fprintf(stderr,"--- _Create_MethodMI() broker: %p\n",broker); \
02046    CmpiContext ctx(ctxp); \
02047    mi.ft=&methMIFT; \
02048    CmpiMethodMI *provider=new cn(broker,ctx); \
02049    mi.hdl=provider; \
02050    if (CmpiProviderBase::testAndSetOneTime(2)) { \
02051        provider->initialize(ctx); \
02052        CmpiProviderBase::setBroker(broker); \
02053     } \
02054     return &mi; \
02055  }
02056 #endif
02057 
02058 #ifdef DOC_ONLY
02059 
02070    CMPIPropertyMI* CMPropertyMIFactory(chars cn, chars pn):
02071 #else
02072  #define CMPropertyMIFactory(cn,pn) \
02073  extern "C" \
02074  CMPIMethodMI* pn##_Create_PropertyMI(CMPIBroker* broker, CMPIContext *ctxp) { \
02075    static CMPIPropertyMIFT propMIFT={ \
02076     CMPICurrentVersion, \
02077     CMPICurrentVersion, \
02078     "property" #pn, \
02079     (CMPIStatus(*)(CMPIPropertyMI*,CMPIContext*))CmpiBaseMI::driveBaseCleanup, \
02080     CmpiPropertyMI::driveSetProperty, \
02081     CmpiPropertyMI::driveGetProperty, \
02082    }; \
02083    static CMPIPropertyMI mi; \
02084    fprintf(stderr,"--- _Create_MethodMI() broker: %p\n",broker); \
02085    CmpiContext ctx(ctxp); \
02086    mi.ft=&propMIFT; \
02087    CmpiPropertyMI *provider=new cn(broker,ctx); \
02088    mi.hdl=provider; \
02089    if (CmpiProviderBase::testAndSetOneTime(2)) { \
02090        provider->initialize(ctx); \
02091        CmpiProviderBase::setBroker(broker); \
02092     } \
02093    return &mi; \
02094  }
02095 #endif
02096 
02097 #ifdef DOC_ONLY
02098 
02109    CMPIIndicationMI* CMIndicationMIFactor(chars cn, chars pn);
02110 #else
02111  #define CMIndicationMIFactory(cn,pn) \
02112  extern "C" \
02113  CMPIMethodMI* pn##_Create_IndicationMI(CMPIBroker* broker, CMPIContext *ctxp) { \
02114    static CMPIIndicationMIFT indMIFT={ \
02115     CMPICurrentVersion, \
02116     CMPICurrentVersion, \
02117     "indication" #pn, \
02118     (CMPIStatus(*)(CMPIPropertyMI*,CMPIContext*))CmpiBaseMI::driveBaseCleanup, \
02119     Indication::driveAuthorizeFilter, \
02120     Indication::driveMustPoll, \
02121     Indication::driveActivateFilter, \
02122     Indication::driveDeActivateFilter, \
02123    }; \
02124    static CMPIPropertyMI mi; \
02125    fprintf(stderr,"--- _Create_IndicationMI() broker: %p\n",broker); \
02126    CmpiContext ctx(ctxp); \
02127    mi.ft=&indMIFT; \
02128    CmpiIndicationMI *provider=new cn(broker,ctx); \
02129    mi.hdl=provider; \
02130    if (CmpiProviderBase::testAndSetOneTime(2)) { \
02131        provider->initialize(ctx); \
02132        CmpiProviderBase::setBroker(broker); \
02133     } \
02134   return &mi; \
02135  }
02136 #endif
02137 
02138 #define CMProviderBase(b) \
02139    CmpiProviderBase* CmpiProviderBase::base=NULL; \
02140    CmpiProviderBase b;
02141 
02142 #endif /* _CMPIMACS_H_ */

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