<type> *karray_free(
<type> *array,
int type,
size_t num,
void (*routine) (<type>)
none
The array utilities, including karray_free(), support arrays of a variety of data types. The data type of the array being used is specified with the 'type' parameter; supported data types include:
KBYTE - array of characters KUBYTE - array of unsigned characters KSHORT - array of short integers KUSHORT - array of unsigned short integers KINT - array of integers KUINT - array of unsigned integers KLONG - array of long integers KULONG - array of unsigned long integers KFLOAT - array of floating point numbers KDOUBLE - array of double precision numbers KSTRING - array of strings KSTRUCT - array of pointers to structures KLOGICAL - array of TRUE/FALSE values
If desired, you may provide a routine to destroy each element of the array. Generally, this feature is used only for arrays of type KSTRUCT, where the structure in question contains pointers to strings or other structures that must be freed individually. If used, the routine specified must be declared as follows:
int free_routine(void *)
It must return TRUE on success and FALSE on failure. It must take a single parameter with which to pass the pointer to the element to free, cast as a (void *). If the routine parameter is NULL, then karray_free() simply uses kfree_and_NULL() to free the array.
none
none
$BOOTSTRAP/objects/library/kutils/src/array.c