Table of Contents

Name

MAGopen - open a MAG image

Synopsis


#include <maglo.h>
int MAGopen(MagImage *mag, const char *path);

Description

The MAGopen() function opens and checks the header of a MAG image named by path and associates mag with it.

mag is a pointer to an already-allocated memory chunk.

MAGclose() should be called after procedures against mag to release memory resource associated with mag.

Return Values

Upon successful completion MAGopen() returns MAGERR_NOERROR. Otherwise errno is set if eligible and error code is returned.

Errors

MAGERR_IO_ERROR
The file to which the path points couldn't be read.
MAGERR_MAGIC_MISMATCH
The file named by path is not a MAG file.
MAGERR_DATA_PARTIAL
Data is truncated.
MAGERR_MEM_ERROR
Out of memory.

See Also

MAGclose(3) , libmaglo(7)


Table of Contents