hgrib-0.1.0.0: Unofficial bindings for GRIB API

Copyright(c) Mattias Jakobsson 2015
LicenseGPL-3
Maintainermjakob422@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Grib.Raw.Context

Contents

Description

The context is a long life configuration object of the grib_api. It is used to define special allocation and free routines or to set special grib_api behaviours and variables.

Most of the documentation herein was copied from the official documentation of grib_api.

Synopsis

The GRIB Context

newtype GribContext Source

The context is a long life configuration object of the grib_api. It is used to define special allocation and free routines or to set special grib_api behaviours and variables.

Constructors

GribContext (Ptr GribContext) 

defaultGribContext :: GribContext Source

A GribContext containing a null pointer which makes the functions receiving it use the default grib context.

gribContextGetDefault :: IO GribContext Source

Get the static default context.

Note that the returned object is different from defaultGribContext, since that is just a null pointer and this is a pointer to the real thing. They should, however, be able to be used interchangeably with all the functions in this package.

gribContextNew :: GribContext -> IO GribContext Source

Create and allocate a new context from a parent context.

gribContextDelete :: GribContext -> IO () Source

Frees the cached definition files of the context.

gribContextSetMemoryProc :: GribContext -> GribMallocProc -> GribFreeProc -> GribReallocProc -> IO () Source

Sets memory procedures of the context.

gribContextSetPersistentMemoryProc :: GribContext -> GribMallocProc -> GribFreeProc -> IO () Source

Sets memory procedures of the context for persistent data.

gribContextSetBufferMemoryProc :: GribContext -> GribMallocProc -> GribFreeProc -> GribReallocProc -> IO () Source

Sets memory procedures of the context for large buffers.

gribContextSetPrintProc :: GribContext -> GribPrintProc -> IO () Source

Sets the context printing procedure used for user interaction.

gribContextSetLoggingProc :: GribContext -> GribLogProc -> IO () Source

Sets the context logging procedure used for system (warning, errors, infos ...) messages.

Control GTS Mode

gribGtsHeaderOn :: GribContext -> IO () Source

Set the gts header mode on. The GTS headers will be preserved.

gribGtsHeaderOff :: GribContext -> IO () Source

Set the gts header mode off. The GTS headers will be deleted.

Control Gribex Mode

gribGribexModeOn :: GribContext -> IO () Source

Set the gribex mode on. Grib files will be compatible with gribex.

gribGribexModeOff :: GribContext -> IO () Source

Set the gribex mode off. Grib files won't be always compatible with gribex.

gribGetGribexMode :: GribContext -> IO Bool Source

Get the gribex mode.

Control Multi-field Support

gribMultiSupportOn :: GribContext -> IO () Source

Turn on support for multiple fields in single grib messages.

gribMultiSupportOff :: GribContext -> IO () Source

Turn off support for multiple fields in single grib messages.

Foreign Function Type Definitions

type GribFreeProc = FunPtr (GribContext -> Ptr () -> IO ()) Source

Grib free procedure, format of a procedure referenced in the context that is used to free memory.

type GribMallocProc = FunPtr (GribContext -> CULong -> IO (Ptr ())) Source

Grib malloc procedure, format of a procedure referenced in the context that is used to allocate memory.

type GribReallocProc = FunPtr (GribContext -> Ptr () -> CULong -> IO (Ptr ())) Source

Grib realloc procedure, format of a procedure referenced in the context that is used to reallocate memory.

type GribLogProc = FunPtr (GribContext -> CInt -> Ptr CChar -> IO ()) Source

Grib loc proc, format of a procedure referenced in the context that is used to log internal messages.

type GribPrintProc = FunPtr (GribContext -> Ptr () -> Ptr CChar -> IO ()) Source

Grib print proc, format of a procedure referenced in the context that is used to print external messages.

type GribDataReadProc = FunPtr (GribContext -> Ptr () -> CULong -> Ptr () -> IO CULong) Source

Grib data read proc, format of a procedure referenced in the context that is used to read from a stream in a resource.

type GribDataWriteProc = FunPtr (GribContext -> Ptr () -> CULong -> Ptr () -> IO CULong) Source

Grib data read write, format of a procedure referenced in the context that is used to write to a stream from a resource.

type GribDataTellProc = FunPtr (GribContext -> Ptr () -> IO CLong) Source

Grib data tell, format of a procedure referenced in the context that is used to tell the current position in a stream.

type GribDataSeekProc = FunPtr (GribContext -> CLong -> CInt -> Ptr () -> IO CLong) Source

Grib data seek, format of a procedure referenced in the context that is used to seek the current position in a stream.

type GribDataEofProc = FunPtr (GribContext -> Ptr () -> IO CInt) Source

Grib data eof, format of a procedure referenced in the context that is used to test end of file.