DS_TRAVERSE_AND_PROCESS(3)

FUNCTION
ds_traverse_and_process - Recursively traverse a pair of data structures.

SYNOPSIS
#include <karma_ds.h>

flag ds_traverse_and_process

( packet_desc *desc1, char *data1, packet_desc *desc2, char *data2, flag as_whole, flag (*func) () )

DESCRIPTION
This routine will traverse a pair of general data structures and will process a sub structure for every occurence wherever there is a difference in the two data structures' descriptors.

desc1
    One of the structures packet descriptor.

data1
    One of the structures data.

desc2
    The other structures packet descriptor.

data2
    The other structures data.

as_whole
    If FALSE: If the type or name of any element in the two packet descriptors are different, the packets are deemed divergent and they are passed to <<func>>. If any aspect of the two array's dimension descriptors are different, then the arrays are deemed divergent and their descriptors are passed to <<func>>. If TRUE: If the type or name of any element in the two packet descriptors are different, the packets are deemed divergent and they are passed to <<func>>. If any aspect of the two array's dimension descriptors are different, or their packet descriptors are divergent, then the arrays are deemed divergent and the array descriptors are passed to <<func>>. If the packet descriptors for linked lists are divergent, then the two lists are deemed divergent and their descriptors and headers are passed to <<func>>.

func
    The function to call for each divergence. The prototype function is <-ds_PROTO_traverse_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/