Generate low-level `foreign imports` for all function definitions
Opened this issue · 2 comments
edsko commented
This is probably relatively straight-forward, though we might already need some customization here:
- Calling convention: #93
- Safety (
safe
versusunsafe
): #94 - Pure versus impure here (though we might want to leave this for the High-level API). We can possibly take
pure
orconst
function attributes into account: #92.
edsko commented
For example, given
void resample(
int32_T *res_m_num_valid_samples,
cint16_T res_m_iq_int[30720000],
int64_T res_m_old_rate,
int64_T res_m_new_rate,
cint16_T res_m_iq_resampled_int[30720000]
);
we should generate
foreign import capi safe "resample.h resample"
c_resample ::
Ptr Int32_T
-> Ptr (CInt16_T)
-> Int64_T
-> Int64_T
-> Ptr (CInt16_T)
-> IO ()
Note: it might be helpful to include the C variable names (if given) as part of the haddocks we generate for the bindings.