Open a FITS file residing in core computer memory. This routine
analogous to fits_open_file. In general, the application must
preallocate an initial block of memory to hold the FITS file:
'buffptr' points to the starting address and 'buffsize' gives the
initial size of the block of memory. 'mem_realloc' is a pointer to an
optional function that CFITSIO can call to allocate additional memory,
if needed, and is modeled after the standard C 'realloc' function; a
null pointer may be given if the initial allocation of memory is all
that will be required. The 'deltasize' parameter may be used to
suggest a minimum amount of additional memory that should be allocated
during each call to the memory reallocation function. By default,
CFITSIO will reallocate enough additional space to hold the entire
currently defined FITS file (as given by the NAXISn keywords) or 1 FITS
block (= 2880 bytes), which ever is larger. Values of deltasize less
than 2880 will be ignored. Since the memory reallocation operation can
be computationally expensive, allocating a larger initial block of
memory, and/or specifying a larger delta_size value may help to reduce
the number of reallocation calls and make the application program run
faster.
int fits_open_memory / ffomem
(fitsfile **fptr, const char *name, int mode, void **buffptr,
size_t *buffsize, size_t deltasize,
void *(*mem_realloc)(void *p, size_t newsize), int *status)
2
Flush any internal buffers of data to the output FITS file. This
routine rarely needs to be called, but can be useful when writing to
the FITS files in memory, and will ensure
that if the program subsequently aborts then the FITS file will
have been closed properly.
int fits_flush_file / ffflus
(fitsfile *fptr, > int *status)