Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Generate binding for function _addresses_ #46

Open
edsko opened this issue Aug 2, 2024 · 0 comments
Open

Generate binding for function _addresses_ #46

edsko opened this issue Aug 2, 2024 · 0 comments

Comments

@edsko
Copy link
Collaborator

edsko commented Aug 2, 2024

Suppose we have

void showInt(int);
void callFunPtr(void (*)(int));

and we want to be able to call callFunPtr, passing showInt as an argument. Then we will to generate

foreign import capi "example.h callFunPtr"
  cCallFunPtr :: FunPtr (Int -> IO ()) -> IO ()

foreign import capi "example.h &showInt"
  addrOf_cShowInt :: FunPtr (Int -> IO ())

Not sure if we simply want to generate bindings for all function addresses, subject to the regular selection rules, or whether we need a separate mechanism here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant