DS_FOREACH_IN_ARRAY(3)

FUNCTION
ds_foreach_in_array - Recursively traverse an array, searching for an item.

SYNOPSIS
#include <karma_ds.h>

flag ds_foreach_in_array

( array_desc *arr_desc, char *array, CONST char *item, flag as_whole, flag (*func) () )

DESCRIPTION
Recursively traverse an array, searching for an item.

arr_desc
    The array descriptor.

array
    The array data.

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 <<func>> 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 <<func>> 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, <<func>> 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 <<func>> 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/