HM_dynamicblockfind()

Finds an item in a dynamic block.

Syntax

void * HM_dynamicblockfind(void * key, void * blockptr, int (*compare)(void const *item1, void const *item2));

Type

HyperMesh hmlib Function

Description

Inputs

key
The item for which the function is looking.
blockptr
A pointer to a dynamic block returned by HM_dynamicblockallocate().
(*compare)(void const *item1, void const *item2)
A function that returns:
-1 If item1 < item2.
1 If item1> item2.
0 If item1 = item2.

Example

A pointer to the item, if it is found. If the item is not found, the function returns NULL.

*key, *item1, and *item2 are all pointers to the same structure. The size of this structure should be passed into HM_dynamicblockallocate(). HM_dynamicblocksort() must be called with the same compare function before HM_dynamicblockfind().

Errors

None.