module Data.NetCDF.Storable
( NcStorable (..)
) where
import Foreign.C
import Foreign.Ptr
import Foreign.Storable
import Data.NetCDF.Types
import Data.NetCDF.Raw.PutGet
class Storable a => NcStorable a where
ncType :: a -> NcType
ffi_put_var1 :: CInt -> CInt -> Ptr CULong -> Ptr a -> IO CInt
ffi_get_var1 :: CInt -> CInt -> Ptr CULong -> Ptr a -> IO CInt
ffi_put_var :: CInt -> CInt -> Ptr a -> IO CInt
ffi_get_var :: CInt -> CInt -> Ptr a -> IO CInt
ffi_put_vara :: CInt -> CInt -> Ptr CULong -> Ptr CULong -> Ptr a -> IO CInt
ffi_get_vara :: CInt -> CInt -> Ptr CULong -> Ptr CULong -> Ptr a -> IO CInt
ffi_put_vars :: CInt -> CInt -> Ptr CULong -> Ptr CULong -> Ptr CULong
-> Ptr a -> IO CInt
ffi_get_vars :: CInt -> CInt -> Ptr CULong -> Ptr CULong -> Ptr CULong
-> Ptr a -> IO CInt
instance NcStorable CSChar where
ncType _ = NcByte
ffi_put_var1 = nc_put_var1_schar'_
ffi_get_var1 = nc_get_var1_schar'_
ffi_put_var = nc_put_var_schar'_
ffi_get_var = nc_get_var_schar'_
ffi_put_vara = nc_put_vara_schar'_
ffi_get_vara = nc_get_vara_schar'_
ffi_put_vars = nc_put_vars_schar'_
ffi_get_vars = nc_get_vars_schar'_
instance NcStorable CChar where
ncType _ = NcChar
ffi_put_var1 = nc_put_var1_text'_
ffi_get_var1 = nc_get_var1_text'_
ffi_put_var = nc_put_var_text'_
ffi_get_var = nc_get_var_text'_
ffi_put_vara = nc_put_vara_text'_
ffi_get_vara = nc_get_vara_text'_
ffi_put_vars = nc_put_vars_text'_
ffi_get_vars = nc_get_vars_text'_
instance NcStorable CShort where
ncType _ = NcShort
ffi_put_var1 = nc_put_var1_short'_
ffi_get_var1 = nc_get_var1_short'_
ffi_put_var = nc_put_var_short'_
ffi_get_var = nc_get_var_short'_
ffi_put_vara = nc_put_vara_short'_
ffi_get_vara = nc_get_vara_short'_
ffi_put_vars = nc_put_vars_short'_
ffi_get_vars = nc_get_vars_short'_
instance NcStorable CInt where
ncType _ = NcInt
ffi_put_var1 = nc_put_var1_int'_
ffi_get_var1 = nc_get_var1_int'_
ffi_put_var = nc_put_var_int'_
ffi_get_var = nc_get_var_int'_
ffi_put_vara = nc_put_vara_int'_
ffi_get_vara = nc_get_vara_int'_
ffi_put_vars = nc_put_vars_int'_
ffi_get_vars = nc_get_vars_int'_
instance NcStorable CFloat where
ncType _ = NcFloat
ffi_put_var1 = nc_put_var1_float'_
ffi_get_var1 = nc_get_var1_float'_
ffi_put_var = nc_put_var_float'_
ffi_get_var = nc_get_var_float'_
ffi_put_vara = nc_put_vara_float'_
ffi_get_vara = nc_get_vara_float'_
ffi_put_vars = nc_put_vars_float'_
ffi_get_vars = nc_get_vars_float'_
instance NcStorable CDouble where
ncType _ = NcDouble
ffi_put_var1 = nc_put_var1_double'_
ffi_get_var1 = nc_get_var1_double'_
ffi_put_var = nc_put_var_double'_
ffi_get_var = nc_get_var_double'_
ffi_put_vara = nc_put_vara_double'_
ffi_get_vara = nc_get_vara_double'_
ffi_put_vars = nc_put_vars_double'_
ffi_get_vars = nc_get_vars_double'_