blob: 434c4d4da68cc778206c3e9778fbddf976d774f7 (
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
|
{-# LANGUAGE RecordWildCards #-}
module Example 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"
#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
|