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

Generating export statements #15

Closed
amitmurthy opened this issue Mar 20, 2013 · 6 comments
Closed

Generating export statements #15

amitmurthy opened this issue Mar 20, 2013 · 6 comments

Comments

@amitmurthy
Copy link
Contributor

Can wrap_c.init() take in an additional callback function which can be used to determine if a function should also be exported and the corresponding export statement generated?

@amitmurthy
Copy link
Contributor Author

Actually, not just functions but enum consts too.

@ihnorton
Copy link
Collaborator

Good point. I didn't think about this very much yet, for smaller libraries it makes a lot of sense.

What do you think about having a BOOL all/none to export everything in a library? The reason I say this is that, if you are going to manually enumerate some subset in the wrap driver, then could just do that in the library's "main" Julia file (the import wrapper).

@amitmurthy
Copy link
Contributor Author

Works for me. I am trying to wrap libCURL and it has a ton on enums. A bool flag is fine or another option is to specify a separate output file only for the export statements. I can then opt to "include" this exports-only file in my main module if I want to export everything or just ignore it.

Either model works, but a bool for now is probably good enough.

@ihnorton
Copy link
Collaborator

The "wrapcontext" variable has a field called cache_wrapped which contains all of the names that have been generated. Will this suffice for generating exports in the driver code?

@amitmurthy
Copy link
Contributor Author

I think it is missing the enum definitions currently. Those consts need to be exported too.

@ihnorton
Copy link
Collaborator

@amitmurthy this definitely works for enums now, although I'm not exactly sure where I fixed it! Please re-open if needed in future.

melonedo pushed a commit to melonedo/Clang.jl that referenced this issue Jul 20, 2021
melonedo pushed a commit to melonedo/Clang.jl that referenced this issue Jul 20, 2021
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

2 participants