summaryrefslogtreecommitdiff
path: root/packages/sundials/src/Bar.hsc
blob: 7db0d4a5176eca6c6878d46043f64bef17eb0156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{-# LANGUAGE RecordWildCards #-}

module Bar where

import Foreign
import Foreign.C.Types
import Foreign.C.String

#include "/Users/dom/sundials/include/sundials/sundials_nvector.h"
#include "/Users/dom/sundials/include/nvector/nvector_serial.h"
#include "/Users/dom/sundials/include/arkode/arkode.h"

#def typedef struct _generic_N_Vector BarType;
#def typedef struct _N_VectorContent_Serial BazType;


getContentPtr :: Storable a => Ptr b -> IO a
getContentPtr ptr = (#peek BarType, content) ptr

getData :: Storable a => Ptr b -> IO a
getData ptr = (#peek BazType, data) ptr

arkSMax :: Int
arkSMax = #const ARK_S_MAX