# Clang.jl generates lower case structs

**URL:** <https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881>\
**Category:** General Usage\
**Tags:** c, clang\
**Created:** [June 3, 2019, 10:19am UTC](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881 "2019-06-03T10:19:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Post date:** [June 3, 2019, 10:19am UTC](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881/1 "2019-06-03T10:19:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [June 3, 2019, 10:58am UTC](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881/2 "2019-06-03T10:58:19Z")

</div>

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](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](https://github.com/JuliaInterop/Clang.jl/blob/ed21bb292732bbc85180d5e233bf9a4ee1b083cf/src/wrap_c.jl#L143).

---

<div class="post-metadata">

**Author:** ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Post date:** [June 3, 2019, 11:14am UTC](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881/3 "2019-06-03T11:14:45Z")

</div>

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 🙂. Thanks.
