module Bindings.Gsl.NTuples where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
import Bindings.Gsl.Histograms
data C'gsl_ntuple = C'gsl_ntuple{
c'gsl_ntuple'file :: Ptr CFile,
c'gsl_ntuple'ntuple_data :: Ptr (),
c'gsl_ntuple'size :: CSize
} deriving (Eq,Show)
p'gsl_ntuple'file p = plusPtr p 0
p'gsl_ntuple'file :: Ptr (C'gsl_ntuple) -> Ptr (Ptr CFile)
p'gsl_ntuple'ntuple_data p = plusPtr p 4
p'gsl_ntuple'ntuple_data :: Ptr (C'gsl_ntuple) -> Ptr (Ptr ())
p'gsl_ntuple'size p = plusPtr p 8
p'gsl_ntuple'size :: Ptr (C'gsl_ntuple) -> Ptr (CSize)
instance Storable C'gsl_ntuple where
sizeOf _ = 12
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
return $ C'gsl_ntuple v0 v1 v2
poke p (C'gsl_ntuple v0 v1 v2) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
return ()
data C'gsl_ntuple_select_fn = C'gsl_ntuple_select_fn{
c'gsl_ntuple_select_fn'function :: FunPtr (Ptr () -> Ptr () -> IO CInt),
c'gsl_ntuple_select_fn'params :: Ptr ()
} deriving (Eq,Show)
p'gsl_ntuple_select_fn'function p = plusPtr p 0
p'gsl_ntuple_select_fn'function :: Ptr (C'gsl_ntuple_select_fn) -> Ptr (FunPtr (Ptr () -> Ptr () -> IO CInt))
p'gsl_ntuple_select_fn'params p = plusPtr p 4
p'gsl_ntuple_select_fn'params :: Ptr (C'gsl_ntuple_select_fn) -> Ptr (Ptr ())
instance Storable C'gsl_ntuple_select_fn where
sizeOf _ = 8
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
return $ C'gsl_ntuple_select_fn v0 v1
poke p (C'gsl_ntuple_select_fn v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
return ()
data C'gsl_ntuple_value_fn = C'gsl_ntuple_value_fn{
c'gsl_ntuple_value_fn'function :: FunPtr (Ptr () -> Ptr () -> IO CDouble),
c'gsl_ntuple_value_fn'params :: Ptr ()
} deriving (Eq,Show)
p'gsl_ntuple_value_fn'function p = plusPtr p 0
p'gsl_ntuple_value_fn'function :: Ptr (C'gsl_ntuple_value_fn) -> Ptr (FunPtr (Ptr () -> Ptr () -> IO CDouble))
p'gsl_ntuple_value_fn'params p = plusPtr p 4
p'gsl_ntuple_value_fn'params :: Ptr (C'gsl_ntuple_value_fn) -> Ptr (Ptr ())
instance Storable C'gsl_ntuple_value_fn where
sizeOf _ = 8
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
return $ C'gsl_ntuple_value_fn v0 v1
poke p (C'gsl_ntuple_value_fn v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
return ()
foreign import ccall "gsl_ntuple_open" c'gsl_ntuple_open
:: CString -> Ptr () -> CSize -> IO (Ptr C'gsl_ntuple)
foreign import ccall "&gsl_ntuple_open" p'gsl_ntuple_open
:: FunPtr (CString -> Ptr () -> CSize -> IO (Ptr C'gsl_ntuple))
foreign import ccall "gsl_ntuple_create" c'gsl_ntuple_create
:: CString -> Ptr () -> CSize -> IO (Ptr C'gsl_ntuple)
foreign import ccall "&gsl_ntuple_create" p'gsl_ntuple_create
:: FunPtr (CString -> Ptr () -> CSize -> IO (Ptr C'gsl_ntuple))
foreign import ccall "gsl_ntuple_write" c'gsl_ntuple_write
:: Ptr C'gsl_ntuple -> IO CInt
foreign import ccall "&gsl_ntuple_write" p'gsl_ntuple_write
:: FunPtr (Ptr C'gsl_ntuple -> IO CInt)
foreign import ccall "gsl_ntuple_read" c'gsl_ntuple_read
:: Ptr C'gsl_ntuple -> IO CInt
foreign import ccall "&gsl_ntuple_read" p'gsl_ntuple_read
:: FunPtr (Ptr C'gsl_ntuple -> IO CInt)
foreign import ccall "gsl_ntuple_bookdata" c'gsl_ntuple_bookdata
:: Ptr C'gsl_ntuple -> IO CInt
foreign import ccall "&gsl_ntuple_bookdata" p'gsl_ntuple_bookdata
:: FunPtr (Ptr C'gsl_ntuple -> IO CInt)
foreign import ccall "gsl_ntuple_project" c'gsl_ntuple_project
:: Ptr C'gsl_histogram -> Ptr C'gsl_ntuple -> Ptr C'gsl_ntuple_value_fn -> Ptr C'gsl_ntuple_select_fn -> IO CInt
foreign import ccall "&gsl_ntuple_project" p'gsl_ntuple_project
:: FunPtr (Ptr C'gsl_histogram -> Ptr C'gsl_ntuple -> Ptr C'gsl_ntuple_value_fn -> Ptr C'gsl_ntuple_select_fn -> IO CInt)
foreign import ccall "gsl_ntuple_close" c'gsl_ntuple_close
:: Ptr C'gsl_ntuple -> IO CInt
foreign import ccall "&gsl_ntuple_close" p'gsl_ntuple_close
:: FunPtr (Ptr C'gsl_ntuple -> IO CInt)