MfuncAllocId()函数

Synopsis

Allocate a MIL identifier for a user-created object.

Format

MIL_ID MfuncAllocId(FunctionId, ObjectType, UserPtr)

MIL_ID FunctionId; Function identifier
long ObjectType; Object type
void *UserPtr; Pointer to the user-created object

Description

This function allows you to allocate a MIL identifier and associate it with a user-created object (such as a structure, or an array). The object is then known as a pseudo-MIL object. This permits a user-created object to be recognized by MIL and treated as a standard MIL object, for such procedures as tracing or error handling.

The FunctionId parameter is the identifier of the pseudo-MIL function currently in use.

The ObjectType parameter identifies the type of MIL object being allocated. This type is a bit encoded value and must be composed of M_USER_OBJECT_1 or M_USER_OBJECT_2 with one of the 16 least significant bits set (for example, M_USER_OBJECT_1 + 0x1L). You should use different group types (M_USER_OBJECT_ 1 or M_USER_OBJECT_2) for objects that are to be used in different MIL modules.

The UserPtr parameter specifies the address of the user-created object that is to be associated with a MIL identifier. This object can be a structure, an array, or any other data type.

Returned value

The returned value is the allocated MIL identifier; M_NULL on error.

See also

MfuncFreeId, MfuncParamId, MfuncIdGetObjectType, MfuncIdSetObjectType, MfuncIdGetUserPtr, MfuncIdSetUserPtr