MpatAllocResult()函数

Synopsis

Allocate a pattern matching result buffer.

Format

MIL_ID MpatAllocResult(SystemId, NbEntries, PatResultIdPtr)

MIL_ID SystemId; System identifier
long NbEntries; Number of result buffer entries
MIL_ID *PatResultIdPtr; Storage location for pattern matching result buffer identifier

Description

This function allocates a result buffer with the specified number of entries and returns a identifier to it, for use with the pattern recognition functions. When the result buffer is no longer required, release its memory, using MpatFree.

The SystemId parameter specifies the system on which the result buffer will be allocated. This parameter must be set to a valid system identifier, M_DEFAULT_HOST or M_DEFAULT. To use the default Host system of the current MIL application, specify M_DEFAULT_HOST. If you specify M_DEFAULT, MIL will select the most appropriate system on which to allocate the buffer (the Host system or any already allocated system).

The NbEntries parameter specifies the number of result entries to allocate. This value should be greater than or equal to the number of occurrences being sought (specified by the model “number of occurrences” search parameter).

The PatResultIdPtr specifies the address of the variable in which the pattern matching result buffer identifier is to be written. This identifier is required so that you can later specify the result buffer in which to store pattern recognition function results. Since the MpatAllocResult function also returns the pattern matching result buffer identifier, you can set this parameter to M_NULL. If allocation fails, M_NULL is written as the identifier.

Returned value

The returned value is the pattern matching result buffer identifier. If allocation fails, M_NULL is returned.

See also

MpatFree