Skip to content

remove_prefix missing #428

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

Closed
jethrogb opened this issue Jan 24, 2017 · 13 comments
Closed

remove_prefix missing #428

jethrogb opened this issue Jan 24, 2017 · 13 comments

Comments

@jethrogb
Copy link
Contributor

jethrogb commented Jan 24, 2017

I already mentioned this in #21. I was using remove_prefix in bindgen 0.19. This means I can't upgrade to 0.20 without introducing an API change in my -sys crate.

@emilio
Copy link
Contributor

emilio commented Jan 24, 2017

This seems like a really hacky thing to do. I think there are better ways to do this, mainly re-exporting structs with a different name.

That may be some churn, though, and it's definitely something we could automate...

@jethrogb
Copy link
Contributor Author

@emilio are you still planning on working on this? It's one of the last pieces preventing me from upgrading from 0.19.

@emilio
Copy link
Contributor

emilio commented Nov 5, 2018

I... Don't really know how this would work for C++, but it shouldn't be hard to do for C.

I don't have a particular incentive to work on this though I could give it a shot when I have some more free time.

In any case, the place to apply the option would be here:

https://github.com/rust-lang-nursery/rust-bindgen/blob/5de943ca7bf6c155f7bae1d91f1e3b1d91e8d901/src/ir/item.rs#L876

That already has access to BindgenContext, and thus the options, so should be trivial to make it work if somebody gets to it sooner.

@jethrogb
Copy link
Contributor Author

jethrogb commented Nov 5, 2018

What do you think about adding another function on ParseCallbacks that allows people to completely change the name of any item as they see fit?

@emilio
Copy link
Contributor

emilio commented Nov 5, 2018

Hmm, I'd rather not expose the Item type in the public API unless totally necessary, but if you mean "get a name, give a name", that'd be fine for me I suppose.

@emilio
Copy link
Contributor

emilio commented Nov 5, 2018

It may be somewhat tricky to make it work correctly though...

@ekse
Copy link
Contributor

ekse commented Nov 10, 2018

I opened a pull request that adds an item_name callback. It is sufficient for our needs in rust-mbedtls. Providing the item kind could be useful but ItemKind is not exposed at the moment.

bors-servo pushed a commit that referenced this issue Nov 11, 2018
Add item_name parse callback.

Issue: #428
@emilio
Copy link
Contributor

emilio commented Nov 11, 2018

Fixed in #1438, thanks @ekse!

@emilio emilio closed this as completed Nov 11, 2018
@ekse
Copy link
Contributor

ekse commented Nov 22, 2018

Hi emilio, would it be possible to make a new release on crates.io?

@emilio
Copy link
Contributor

emilio commented Nov 23, 2018

Sure, done :)

@ekse
Copy link
Contributor

ekse commented Nov 23, 2018

Thanks emilio, is it expected I don't see it on crates.io?

@emilio
Copy link
Contributor

emilio commented Nov 24, 2018

Blergh, no, was not expected. I recently switched distro version, and I didn't keep the cargo api token around, so the publishing failed. Should be in crates.io now.

@ekse
Copy link
Contributor

ekse commented Nov 26, 2018

Thanks! The crate update is available as expected.

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

No branches or pull requests

3 participants