summaryrefslogtreecommitdiff
path: root/packages/sundials/src/Bar.hsc
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sundials/src/Bar.hsc')
-rw-r--r--packages/sundials/src/Bar.hsc24
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/sundials/src/Bar.hsc b/packages/sundials/src/Bar.hsc
new file mode 100644
index 0000000..b1159b6
--- /dev/null
+++ b/packages/sundials/src/Bar.hsc
@@ -0,0 +1,24 @@
1{-# LANGUAGE RecordWildCards #-}
2
3module Example where
4
5import Foreign
6import Foreign.C.Types
7import Foreign.C.String
8
9#include "/Users/dom/sundials/include/sundials/sundials_nvector.h"
10#include "/Users/dom/sundials/include/nvector/nvector_serial.h"
11
12#def typedef struct _generic_N_Vector BarType;
13#def typedef struct _N_VectorContent_Serial BazType;
14
15
16getContentPtr :: Storable a => Ptr b -> IO a
17getContPtr ptr = (#peek BarType, content) ptr
18
19getData ptr = (#peek BazType, data) ptr
20
21foo ptr = do
22 qtr <- getContPtr ptr
23 getData qtr
24