FOREIGN_READ_AND_SETUP(3)

EXPERIMENTAL_FUNC
foreign_read_and_setup - Read a file and perform some setup.

SYNOPSIS
#include <karma_foreign.h>

flag foreign_read_and_setup

(CONST char *filename, unsigned int mmap_option, flag writable, unsigned int *ftype, flag inform, unsigned int num_dim, unsigned int preferred_type, flag force_type, iarray *array, double *min, double *max, flag discard_zero_range, KwcsAstro *ap)

DESCRIPTION
This routine will attempt to guess the filetype of a file and in the file, converting to an Intelligent Array if possible. The routine then performs some simple checks and some other convenience functions.

filename
    The name of the file to read.

mmap_option
    This has the same meaning as for the <dsxfr_get_multi> routine.

writable
    This has the same meaning as for the <dsxfr_get_multi> routine.

ftype
    The type of the file that was read in is written here. This may be NULL.

inform
    If TRUE, the routine displays some informative messages.

num_dim
    The number of dimensions required. If this is 0, any number of dimensions is allowed.

preferred_type
    The preferred data type. If this is NONE, then no type is preferred.

force_type
    If TRUE, the routine fails if the preferred data type was not available.

array
    The Intelligent Array is written here. An existing array pointed to by this is deallocated.

min The minimum data value in the array is written here. If this is NULL nothing is written here.

max The maximum data value in the array is written here. If this is NULL nothing is written here.

discard_zero_range
    If TRUE, and the range of the data is zero, the routine fails.

ap  The KwcsAstro object is written here. This may be NULL.

RETURN VALUE
TRUE on success, 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/