Skip to content

Import from C Header File #541

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

Open
Tracked by #1575 ...
certik opened this issue Jun 1, 2022 · 1 comment
Open
Tracked by #1575 ...

Import from C Header File #541

certik opened this issue Jun 1, 2022 · 1 comment

Comments

@certik
Copy link
Contributor

certik commented Jun 1, 2022

We should allow calling C functions by directly importing them from C header files. We have to parse the header file, and create the corresponding declaration in ASR. In pure Python mode, we have to implement some equivalent functionality using some of the projects below.

Prior art:

@certik
Copy link
Contributor Author

certik commented Jun 1, 2022

To keep things simple, possibly a good way is to first write a script that takes a C headerfile and produces an equivalent Python file with C declarations using @ccall. That way we do not need any special handling in LPython and things are explicit and automatic. Once we gain more experience, we can include a C parser as part of libasr and/or lpython.

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