PSET(3X)

NAME
psi_create, psi_destroy, psi_reset, psi_start, psi_next, psi_remove - pointer set iterator functions

SYNOPSIS

#include "pset.h"

psi_h psi_create( pset )
pset_h pset ;

void psi_destroy( iter )
psi_h iter ;

void psi_reset( iter, pset )
psi_h iter ;
pset_h pset ;

void *psi_start( iter )
psi_h iter ;

void *psi_next( iter )
psi_h iter ;

void psi_remove( iter )
psi_h iter ;

DESCRIPTION
These functions provide a means to iterate over psets (pointer sets).

psi_create() creates an iterator. The only operation that should be applied to an iterator after it is created is psi_start().

psi_destroy() destroys the iterator.

psi_reset() changes the pset that is being iterated to pset.

psi_start() starts an iteration and returns the first pointer in the pointer set.

psi_next() returns the next pointer in the set.

psi_remove() removes the current pointer from the set. The current pointer is the one returned most recently from either psi_start() or psi_next().

RETURN VALUES

psi_create() returns an iterator handle on success or NULL on failure.

psi_start() returns the first pointer from the set or NULL if the set is empty.

psi_next() returns a pointer or NULL if the end of the set is reached.

WARNINGS
psi_create() is the only function in this library. The rest of the interface is macros.

This interface may be eliminated in a future release of the pset library.