DS_ALLOC_ARRAY(3)

FUNCTION
ds_alloc_array - Allocate an array.

SYNOPSIS
#include <karma_ds.h>

flag ds_alloc_array

(CONST array_desc *arr_desc, char *element, flag clear, flag array_alloc)

DESCRIPTION
This routine will allocate memory for an array. The routine will recursively allocate sub arrays and linked lists. Any memory which is allocated will be deallocated if an error occurs.

arr_desc
    The array descriptor.

element
    The element to write the array pointer to.

clear
    If TRUE, then the routine will initialise (set to zero) all the data.

array_alloc
    If FALSE, and an array is an atomic array, then instances of that array will NOT be allocated, and a NULL pointer will be written into the parent element, else the array will be allocated.

RETURN VALUE
A pointer to the array on success, else NULL.

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/