# Synopsis

(macro) void *osm_CycleStack(long option, OSM_STACK *stack)

# Purpose

Cycle an object stack.

# Description

Successive calls to this function will return each object pointer in the stack or NULL when complete. The object pointers will be returned in the order the objects were added (last in first out) but will not be removed from the stack. If the cycle is interrupted before completion, the next invocation will start from the interruption. Any modifications performed on the stack will restart the cycle. Since the cycle termination and error condition both return NULL, the mpm_LastError function should be used to check for an error.

# Input

## option

Options (not used)

## stack

Stack pointer

# Return

Object pointer in the stack or NULL if end or error