Clang.jl generates lower case structs

,

I am trying to make a wrapper for a C-library and everything seems to work nicely except that Clang.jl emits the struct names in lower case. I guess I am missing something in the the generate.jl script?

I guess they’re all in lower case in C? generate.jl doesn’t automatically Julian-lize those C-library APIs, but you could easily do it by yourself. For example, instead of directly dumping ctx.common_buffer, you could apply a function that can filter and replace those lower case struct names to whatever you prefer.

https://github.com/JuliaInterop/Clang.jl/blob/ed21bb292732bbc85180d5e233bf9a4ee1b083cf/gen/generator.jl#L54

If you’re not familiar with Julia’s AST, you can also directly overload wrap! and edit this line.

1 Like

Yes, they are in lower case in C, I just thought it would be cleaner if the generated files are used without hand editing… Maybe a sed script would be the simplest way to accomplish this :slight_smile:. Thanks.