📄 cmpimacs.h
字号:
((b)->eft->classPathIsA((b),(p),(pn),(rc)))# endif // Debugging macros# ifdef CMPI_INLINE /** Attempts to transforms an CMPI object to a broker specific string format. Intended for debugging purposes only. @param mb Broker this pointer @param object A valid CMPI object. @param rc Output: Service return status (suppressed when NULL). @return String from representation of <object>. */inline static CMPIString *CDToString (const CMPIBroker * mb, const void *object, CMPIStatus * rc){ return ((mb)->eft->toString ((mb), (void *) (object), (rc)));}# else# define CDToString(b,o,rc) ((b)->eft->toString((b),(void*)(o),(rc)))# endif# ifdef CMPI_INLINE /** Verifies whether <object> is of CMPI type <type>. Intended for debugging purposes only. @param mb Broker this pointer @param object A valid CMPI object. @param type A string specifying a valid CMPI Object type ("CMPIInstance", "CMPIObjectPath", etc). @param rc Output: Service return status (suppressed when NULL). @return True if test successful. */inline static CMPIBoolean CDIsOfType (const CMPIBroker * mb, const void *object, const char *type, CMPIStatus * rc){ return ((mb)->eft->isOfType ((mb), (void *) (object), (type), (rc)));}# else# define CDIsOfType(b,o,t,rc) \ (b)->eft->isOfType((b),(void*)(o),(t),(rc))# endif# ifdef CMPI_INLINE /** Retrieves the CMPI type of <object>. Intended for debugging purposes only. @param mb Broker this pointer @param object A valid CMPI object. @param rc Output: Service return status (suppressed when NULL). @return CMPI object type. */inline static CMPIString *CDGetType (const CMPIBroker * mb, const void *object, CMPIStatus * rc){ return ((mb)->eft->getType ((mb), (object), (rc)));}# else# define CDGetType(b,o,rc) ((b)->eft->getType((b),(void*)(o),(rc)))# endif# ifdef CMPI_VER_85# ifdef CMPI_INLINE /** Retrieves translated message. When using as macro, use CMFmtArgsX and CMFmtX macros to generate the variable parameter list and ommit the count parameter. @example CMGetMessage(_broker,"msgid","Test $0 $1",NULL, CMFmtArgs2(CMFmtChars("message"),CMFmtSint(1)); @param mb Broker this pointer @param msgId The message identifier. @param defMsg The default message. The message can have up to 10 message insert placeholders ($0 through $9). The placeholders will be replaced by the corresponding message insert values. @param rc Output: Service return status (suppressed when NULL). @param count The number of message insert values. Ommit when using the CMFmtArgsXX macro. @param ... Up to 10 Message insert values. These are specified using the following macros: CMFmtSint(v) integer value CMFmtUint(v) unsigned integer value CMFmtSint64(v) long integer value CMFmtUint64(v) long unsigned integer vale CMFmtReal(v) float or double real value CMFmtBoolean(v) CMPIBoolean value CMFmtChars(v) char string CMFmtString(v) CMPIString @return the translated message. */inline static CMPIString *CMGetMessage (const CMPIBroker * b, const char *msgId, const char *defMsg, CMPIStatus * rc, unsigned int, ...)# else# define CMFmtSint(v) CMPI_sint32,((long int)v)# define CMFmtUint(v) CMPI_uint32,((unsigned long int)v)# define CMFmtSint64(v) CMPI_sint64,((long long int)v)# define CMFmtUint64(v) CMPI_uint64,((unsigned long long int)v)# define CMFmtReal(v) CMPI_real64,((double)v)# define CMFmtBoolean(v) CMPI_boolean,((int)v)# define CMFmtChars(v) CMPI_chars,((char*)v)# define CMFmtString(v) CMPI_String,((CMPI_String*)v)# define CMFmtArgs0() 0# define CMFmtArgs1(v1) \ 1,v1# define CMFmtArgs2(v1,v2) \ 2,v1,v2# define CMFmtArgs3(v1,v2,v3) \ 3,v1,v2,v3# define CMFmtArgs4(v1,v2,v3,v4) \ 4,v1,v2,v3,v4# define CMFmtArgs5(v1,v2,v3,v4,v5) \ 5,v1,v2,v3,v4,v5# define CMFmtArgs6(v1,v2,v3,v4,v5,v6) \ 6,v1,v2,v3,v4,v5,v6# define CMFmtArgs7(v1,v2,v3,v4,v5,v6,v7) \ 7,v1,v2,v3,v4,v5,v6,v7# define CMFmtArgs8(v1,v2,v3,v4,v5,v6,v7,v8) \ 8,v1,v2,v3,v4,v5,v6,v7,v8# define CMFmtArgs9(v1,v2,v3,v4,v5,v6,v7,v8,v9) \ 9,v1,v2,v3,v4,v5,v6,v7,v8,v9# define CMFmtArgs10(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10) \ 10,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10# define CMGetMessage(b,id,def,rc,parms) ((b)->eft->getMessage((b),(id),(def),(rc),parms))# endif /* CMPI_INLINE */# endif /* CMPI_VER_85 */# ifdef CMPI_VER_100# ifdef CMPI_INLINE /** Logs the message to the standard logging facility. @example CMLogMessage(_broker, 1, "TestProvider","Entering EnumerateInstance", NULL); @param mb Broker this pointer @param severity The severity is from 1-4. 1 is for information, 2, is for warning, 3 for severe and 4 for fatal. @param id The ID of the provider. @param text The message. If not NULL, is the message text to be logged. @param string The message. If not NULL, is the message text to be logged. string will be ignored when text is not NULL. @param rc Output: Service return status */inline static CMPIStatus CMLogMessage (const CMPIBroker * b, int severity, const char *id, const char *text, const CMPIString * string){ return ((b)->eft->logMessage ((b), (severity), (id), (text), (string)));}# else# define CMLogMessage(b,severity,id, text, string) ((b)->eft->logMessage((b),(severity),(id),(text),(string)))# endif# endif /* CMPI_VER_100 */# ifdef CMPI_VER_100# ifdef CMPI_INLINE /** Logs the message to the trace facility. @example CMTraceMessage( ); @param mb Broker this pointer @param level The severity is from 1-4. @param component The component name to use for logging. The available facilities are defined in TraceComponents.h file. @param text The message. If not NULL, is the message text to be logged. @param string The message. If not NULL, is the message text to be logged. string will be ignored when text is not NULL. @param rc Output: Service return status */inline static CMPIStatus CMTraceMessage (const CMPIBroker * b, int level, const char *component, const char *text, const CMPIString * string){ return ((b)->eft->trace ((b), (level), (component), (text), (string)));}# else# define CMTraceMessage(b,level,component, text, string) ((b)->eft->trace((b),(level),(component),(text),(string)))# endif# endif /* CMPI_VER_100 */# ifdef CMPI_VER_200# ifdef CMPI_INLINE /** Create a new CMPIError object. @example CMNewCMPIError( ); @param b Broker this pointer @param owner Identifies the entity that owns the msg format definition. @param msgID Identifies the format of the message. @param msg Formatted and translated message. @param sev Perceived severity of this error. @param pc Probable caues of this error. @param cimStatusCode Status Code. @param rc Service return status @return Pointer to a newly allocated CMPIError object. */inline static CMPIError* CMNewCMPIError (const CMPIBroker* b, const char *owner, const char* msgID, const char* msg, const CMPIErrorSeverity sev, const CMPIErrorProbableCause pc, const CMPIrc cimStatusCode, CMPIStatus* rc){ return ((b)->eft->newCMPIError ((b), (owner), (msgID), (msg), (sev), (pc), (cimStatusCode), (rc)));}# else# define CMNewCMPIError(b,owner,msgID,msg,sev,pc,cimStatusCode,rc) \ ((b)->eft->newCMPIError((b),(owner),(msgID),(msg),(sev), \ (pc),(cimStatusCode),(rc)))# endif /* CMPI_INLINE */# endif /* CMPI_VER_200 */# ifdef CMPI_VER_200# ifdef CMPI_INLINE /** Opens a message file and returns a handle to it. @example CMOpenMessageFile(_broker,"/path/msgFile",&msgFileHandle); @param b Broker this pointer @param msgFile The message file identifier. @param msgFileHandle Output: The handle representing the open msg file. @return Service return status */inline static CMPIStatus CMOpenMessageFile (const CMPIBroker* b, const char *msgFile, CMPIMsgFileHandle *msgFileHandle){ return ((b)->eft->openMessageFile ((b), (msgFile), (msgFileHandle)));}# else# define CMOpenMessageFile(b,mf,mfh) ((b)->eft->openMessageFile((b),(mf),(mfh)))# endif /* CMPI_INLINE */# endif /* CMPI_VER_200 */# ifdef CMPI_VER_200# ifdef CMPI_INLINE /** Closes a message file and returns a handle to it. @example CMCloseMessageFile(_broker,msgFileHandle); @param mb Broker this pointer @param msgFileHandle The handle representing the open message file. @return Service return status */ inline static CMPIStatus CMCloseMessageFile (const CMPIBroker* b, const CMPIMsgFileHandle msgFilehandle){ return ((b)->eft->closeMessageFile ((b), (msgFileHandle)));}# else# define CMCloseMessageFile(b,mfh) ((b)->eft->closeMessageFile((b),(mfh))) # endif /* CMPI_INLINE */# endif /* CMPI_VER_200 */# ifdef CMPI_VER_200# ifdef CMPI_INLINE /** Retrieves translated message from a message file. When using as macro, use CMFmtArgsX and CMFmtX macros (defined above) to generate the variable parameter list and ommit the count parameter. @example CMGetMessage2(_broker,"msgid",msgFileHandle,"Test $0 $1", NULL,CMFmtArgs2(CMFmtChars("message"),CMFmtSint(1)); @param mb Broker this pointer @param msgId The message identifier. @param msgFileHandle The handle representing the open message file. @param defMsg The default message. The message can have up to 10 msg insert placeholders ($0 through $9). The placeholders will be replaced by the corresponding message insert values. @param rc Output: Service return status (suppressed when NULL). @param count The number of message insert values. Omit when using the CMFmtArgsXX macro. @param ... Up to 10 Message insert values. These are specified using the following macros: CMFmtSint(v) integer value CMFmtUint(v) unsigned integer value CMFmtSint64(v) long integer value CMFmtUint64(v) long unsigned integer vale CMFmtReal(v) float or double real value CMFmtBoolean(v) CMPIBoolean value CMFmtChars(v) char string CMFmtString(v) CMPIString @return the translated message. */inline static CMPIString* CMGetMessage2 (const CMPIBroker* mb, const char *msgId, const CMPIMsgFileHandle msgFilehandle, const char *defMsg, CMPIStatus* rc, unsigned int, ...);# else # define CMGetMessage2(b,id,mfh,def,rc,parms) ((b)->eft->getMessage2((b),(id),(mfh),(def),(rc),parms))# endif /* CMPI_INLINE */# endif /* CMPI_VER_200 */ // CMPIInstance macros# ifdef CMPI_INLINE /** Gets a named property value. @param inst Instance this pointer. @param name Property name. @param rc Output: Service return status (suppressed when NULL). @return Property value. */inline static CMPIData CMGetProperty (const CMPIInstance * inst, const char *name, CMPIStatus * rc){ return ((inst)->ft->getProperty ((inst), (name), (rc)));}# else# define CMGetProperty(i,n,rc) ((i)->ft->getProperty((i),(n),(rc)))# endif# ifdef CMPI_INLINE /** Gets a Property value defined by its index. @param inst Instance this pointer. @param index Position in the internal Data array. @param name Output: Returned property name (suppressed when NULL). @param rc Output: Service return status (suppressed when NULL). @return Property value. */inline static CMPIData CMGetPropertyAt (const CMPIInstance * inst, CMPICount index, CMPIString ** name, CMPIStatus * rc){ return ((inst)->ft->getPropertyAt ((inst), (index), (name), (rc)));}# else# define CMGetPropertyAt(i,num,s,rc) \ ((i)->ft->getPropertyAt((i),(num),(s),(rc)))# endif# ifdef CMPI_INLINE /** Adds/replaces a named Property. @param inst Instance this pointer. @param name Entry name. @param value Address of value structure. @param type Value type. @return Service return status. */inline static CMPIStatus CMSetProperty (const CMPIInstance * inst, const char *name, const CMPIValue * value, CMPIType type){ return ((inst)->ft->setProperty ((inst), (name), (value), (type)));}# else# define CMSetProperty(i,n,v,t) \ ((i)->ft->setProperty((i),(n),(CMPIValue*)(v),(t)))# endif# ifdef CMPI_INLINE /** Gets the number of properties contained in this Instance. @param inst Instance this pointer. @param rc Output: Service return status (suppressed when NULL). @return Number of properties. */inline static CMPICount CMGetPropertyCount (const CMPIInstance * inst, CMPIStatus * rc){ return ((inst)->ft->getPropertyCount ((inst), (rc)));}# else# define CMGetPropertyCount(i,rc) ((i)->ft->getPropertyCount((i),(rc)))# endif# ifdef CMPI_INLINE /** Generates an ObjectPath out of the namespace, classname and key propeties of this Instance. @param inst Instance this pointer. @param rc Output: Service return status (suppressed when NULL). @return the generated ObjectPath. */inline static CMPIObjectPath *CMGetObjectPath (const CMPIInstance * inst, CMPIStatus * rc){ return ((inst)->ft->getObjectPath ((inst), (rc)));}# else# define CMGetObjectPath(i,rc) ((i)->ft->getObjectPath((i),(rc)))# endif# ifdef CMPI_VER_100# ifdef CMPI_INLINE /** Replaces the ObjectPath of the instance. @param inst Instance this pointer. @param obj Pointer to the new object path. This objectpath shall contain the namespace, classname, as well as all keys for the specified instance. @param rc Output: Service return status (suppressed when NULL). @return the generated ObjectPath. */inline static CMPIStatus CMSetObjectPath (CMPIInstance * inst, const CMPIObjectPath * obj){ return ((inst)->ft->setObjectPath ((inst), (obj)));}# else# define CMSetObjectPath(i,obj) ((i)->ft->setObjectPath((i),(obj)))# endif# endif /* CMPI_VER_100 */# ifdef CMPI_INLINE /** Directs CMPI to ignore any setProperty operations for this instance for any properties not in this list. @param inst Instance this pointer. @param propertyList If not NULL, the members of the array define one or more Property names to be accepted by setProperty operations. @param keys Deprecated, ignored by MB, maintained here for compatibility. @return Service return status.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -