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

Customizable naming templates (e.g., namespace prefixing) #93

Open
dignifiedquire opened this issue Mar 23, 2022 · 3 comments · Fixed by #108
Open

Customizable naming templates (e.g., namespace prefixing) #93

dignifiedquire opened this issue Mar 23, 2022 · 3 comments · Fixed by #108
Labels
K-bug Kind: existing code isn’t behaving as expected K-feature Kind: proposed new code to implement new behaviour

Comments

@dignifiedquire
Copy link

I was wondering if there is a way to automatically add a prefix to types/functions etc when generating the C definitions, sth like this:

#[ffi_export]
fn foo() {
  // ..things
}

#[derive_reprC]
pub struct MyStruct { /* ...  */ }
typedef struct { /* .. */ } PFX_MyStruct;
void pfx_foo() {
}

as currently I have to add the PFX prefix manually to my types and functions in rust, which makes it very unidiomatic, and easy to forget.

@danielhenrymantilla danielhenrymantilla added K-feature Kind: proposed new code to implement new behaviour 2022-Q1 labels Mar 23, 2022
@danielhenrymantilla
Copy link
Collaborator

Agreed. This more general query thus supersedes #70, and ought to be featured rather soon 🙂

@danielhenrymantilla danielhenrymantilla changed the title Custom namespace prefixing Customizable naming templates (e.g., namespace prefixing) Mar 23, 2022
@steph-lui steph-lui added 2022-Q2 and removed 2022-Q1 labels Apr 4, 2022
@ronan-ditto ronan-ditto linked a pull request May 17, 2022 that will close this issue
@steph-lui steph-lui added T-big-peer Team: big peer I-must-have Importance: this issue is a must-have M-pre-prod Marker: required for platform production launch and removed 2022-Q2 labels Jul 14, 2022
@dignifiedquire
Copy link
Author

it seems there should be support for this now, but using .with_naming_convention seems to not change any thing currently. Is that expected?

@danielhenrymantilla
Copy link
Collaborator

Yes and no: I haven't had the time to cater to the finishing touches for the header generation, which I would like to make it as extensible as possible, with a guide about this, c.f. the languages/{c,csharp}.rs files; so some certain parts are currently empty/shallow scaffolding for when they finally do something in the future.
It is, however, a genuine oversight for this scaffolding to have ended up in public API, such as with_naming_convention() 😅

@danielhenrymantilla danielhenrymantilla added K-bug Kind: existing code isn’t behaving as expected and removed T-big-peer Team: big peer M-pre-prod Marker: required for platform production launch I-must-have Importance: this issue is a must-have labels Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K-bug Kind: existing code isn’t behaving as expected K-feature Kind: proposed new code to implement new behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants