[systemd-devel] sd-bus parameter names

Giacinto Cifelli gciofono at gmail.com
Sat Jan 12 06:23:46 UTC 2019


Hi Lennart, all,


On Sun, Jan 6, 2019 at 6:40 PM Lennart Poettering
<lennart at poettering.net> wrote:
>
> On Fr, 04.01.19 09:39, Giacinto Cifelli (gciofono at gmail.com) wrote:
>
> > Hi,
> >
> > I would like to give my DBus parameters names other than the default
> > arg_X for the introspection.
> >
> > Is it ok if I post some commits to do that, or is the feature excluded
> > by choice?
>
> It was excluded because the data is kinda redundant and I couldn't
> come up with a sexy, convincing way how to denote this in the sources.
>

I have submitted my change, it has been reviewed (for the form), but
not taken for merge.
I don't want to be pushy, just I don't know if I need to do something more.

And I was expecting some comments about the sexy part. None came, so I
will give myself one.
DBus uses for in/out parameters a single string each, but splits them
for the introspectable interface (where the names are used).
sd-bus takes the first path, more functional, and then splits the
parameters internally for the XML declaration.
Given that, a matching way to declare parameter names is using a
'concatenated' string and splitting it at the same time as the
parameters themselves.
I have taken this path.

>
> Adding this certainly makes, if you can come up with macro syntax that
> makes this nice to read.

I don't know if the macro names are appealing: I just added
'_WITH_NAMES' ones, following the '_WITH_OFFSET' already in place.
I would like a comment also on this.

>
> (I'd prefer if this would use \0 or so as separator though maybe,
> given it sounds weird compiling in strings that the code first has to
> parse, and if \0 is used as separator then things feel more
> "pre-parsed" to me)

submitted so, with \0 separators.

>
> Anyway, by all means, please prep a patch set and submit as PR, and we
> can continue discussions there!y
>
> Lennart
>

Regards,
Giacinto


More information about the systemd-devel mailing list