DS_EASY_ALLOC_ARRAY_DESC(3)

FUNCTION
ds_easy_alloc_array_desc - Allocate a simple array descriptor.

SYNOPSIS
#include <karma_ds.h>

array_desc * ds_easy_alloc_array_desc

(unsigned int num_dim, CONST uaddr *lengths, CONST double *first_arr, CONST double *last_arr, CONST double **coordinates, CONST char **names, unsigned int num_elements, CONST unsigned int *data_types, CONST char **data_names)

DESCRIPTION
This routine will allocate an array descriptor and its associated packet descriptor.

num_dim
    The number of dimensions in the array.

lengths
    An array of lengths for each dimension (axis).

first_arr
    An array of first co-ordinate values for each dimension.

last_arr
    An array of last co-ordinate values for each dimension. If either of these pointers is NULL, the range of the co-ordinates will be the lengths of the dimensions minus 1. If one of the pointers is NULL, the other array is used to tie one end of the range for each dimension. If both pointers are NULL,the minima are 0.0 and the maxima are the lengths minus 1

coordinates
    The array of co-ordinate array pointers. If this is NULL, all dimensions are assumed to be regularly spaced. If any co-ordinate array pointer is NULL, the corresponding dimension is assumed to be regularly spaced.

names
    An array of string pointers to the names of each dimension. If this is NULL, the names "Axis 0", "Axis 1", ...etc will be used. Note: the character arrays are copied, so the arrays of characters and the array of pointers may be subsequently deallocated.

num_elements
    The number of atomic elements in the array packet. If this is 0, no packet descriptor is allocated.

data_types
    The types of the elements in the array. See <-ds_KARMA_DATA_TYPES-> for a list of legal values. This may be NULL if <<num_elements>> is 0.

data_names
    The array of element names. The name strings are copied, thus the memory used for the input strings may be subsequently deallocated. This may be NULL if <<num_elements>> is 0.

RETURN VALUE
An array descriptor pointer 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/