ListInsertItem

int ListInsertItem (ListType list, const void *pointerToItem, int positionToInsertAt);

Purpose

This function inserts a copy of an item into a list at the specified position.

The item pointed to by pointerToItem should be the same size as the item size specified when the list was created.

Parameters

Input
Name Type Description
list ListType The list to insert the item into.
pointerToItem const void * The pointer to the item to insert.
positionToInsertAt integer The position at which to insert the item. The position may be a number from 1 to the number of items in the list.

To insert at the front of the list, the constant FRONT_OF_LIST may be passed.

To insert at the end of the list, the constant END_OF_LIST may be passed.

The items at or above the specified position are moved up one position.

Return Value

Name Type Description
result integer Returns non–zero if the item was inserted.

Returns zero (0) if an error occurs.