After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625301 - [gdbus-codegen] --output-prefix can contain hyphens
[gdbus-codegen] --output-prefix can contain hyphens
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gdbus
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-07-26 11:25 UTC by Milan Crha
Modified: 2018-05-24 12:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed gbt patch (2.76 KB, patch)
2010-07-26 11:27 UTC, Milan Crha
none Details | Review

Description Milan Crha 2010-07-26 11:25:15 UTC
I want to have an --output-prefix set as "e-gdbus" for my needs, which is generating file names fine, but with defines and marshales it doesn't change hyphens to underscores, thus makes code uncompilable.
Comment 1 Milan Crha 2010-07-26 11:27:19 UTC
Created attachment 166572 [details] [review]
proposed gbt patch

for gdbus-binding-tool;

Please consider using patch like this. Thanks.
Comment 2 David Zeuthen (not reading bugmail) 2010-07-26 14:13:09 UTC
The --output-prefix option is supposed to take a CamelCase name, e.g. you should use EGDBus and C symbols should then be prefixed with e_gdbus_ and structs with EGDBus... this is probably not working for you there's a lot of caps right after each other and _camel_case_to_uscore() isn't working like we want, right?

Maybe we should support the Ugly_Case style - e.g. if we detect underscores in something supposed to be CamelCase, then use the underscores as places for where to split and remove them for the CamelCase name. In your example, "--output-prefix E_GDBus" would then yield EGDBus and e_gdbus as desired and things like "--output-prefix UGLY_Case_PreFix" would yield UGLYCasePreFix and ugly_case_prefix.
Comment 3 Milan Crha 2010-07-26 15:14:39 UTC
Do you mean '--namespace' instead? as documentation says:

> --namespace    The namespace to use for generated code. In CamelCase format.
>
> --output-prefix A prefix to use for all generated files. Defaults to generated

if you are interested, then my full command line is:
gdbus-codegen
    --namespace=EGdbus
    --strip-prefix=org.gnome.evolution.dataserver.calendar
    --output-prefix=e-gdbus
    e-data-cal-factory.xml e-data-cal-view.xml e-data-cal.xml

which is generating files as I want them, i.e. e-gdbus-bindings.h.
With --output-prefix=EGdbus I get EGdbus-bindings.h, but also egdbus-egdbuscal.c, so this is also somehow inconsistent. Allowing me to not use CamelCase in --output-prefix and include the patch makes it the easiest way for me. But I'm not sure how for you :)
Comment 4 David Zeuthen (not reading bugmail) 2010-07-26 15:21:36 UTC
Yeah, I clearly mixed up --namespace and --output-prefix here, sorry.
Comment 5 GNOME Infrastructure Team 2018-05-24 12:32:01 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/323.