Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generate low-level foreign imports for all function definitions #25

Open
3 tasks
edsko opened this issue Aug 1, 2024 · 1 comment
Open
3 tasks

Generate low-level foreign imports for all function definitions #25

edsko opened this issue Aug 1, 2024 · 1 comment
Labels
confirmed-use-case Features for which there are client-confirmed use cases

Comments

@edsko
Copy link
Collaborator

edsko commented Aug 1, 2024

This is probably relatively straight-forward, though we might already need some customization here:

@edsko
Copy link
Collaborator Author

edsko commented Aug 2, 2024

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.

@edsko edsko added the confirmed-use-case Features for which there are client-confirmed use cases label Aug 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
confirmed-use-case Features for which there are client-confirmed use cases
Projects
None yet
Development

No branches or pull requests

1 participant