DS_FOREACH_OCCURRENCE(3)

FUNCTION
ds_foreach_occurrence - Recursively traverse a data structure, searching for an item.

SYNOPSIS
#include <karma_ds.h>

flag ds_foreach_occurrence

( packet_desc *pack_desc, char *packet, CONST char *item, flag as_whole, flag (*func) () )

DESCRIPTION
Recursively traverse a data structure, searching for an item.

pack_desc
    The packet descriptor of the structure.

packet
    The packet for the structure.

item
    The name of the item to search for.

as_whole
    If FALSE: If the item pointed to is the name of a dimension, then <<function>> will be called for each occurrence of that dimension (ie. the other dimensions will be iterated through). If the item pointed to is the name of an element, then <<function>> will be called for each occurrence of the element in the array or linked list which it is in. If TRUE: If the item pointed to is the name of a dimension or an element within a packet within an array, <<function>> is called once for each occurrence of the entire array. If the item pointed to is the name of an element in a linked list, then <<function>> will be called once for each occurrence of the linked list

func
    The function to call for each occurrence. The prototype function is <-ds_PROTO_foreach_func->. If this returns FALSE, iterations are stopped.

RETURN VALUE
TRUE if all iterations completed successfully, else FALSE.

Multi-threading Level
Unsafe.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/