[systemd-devel] sd-bus parameter names

Giacinto Cifelli gciofono at gmail.com
Fri Jan 4 08:39:24 UTC 2019


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?

The changes I would propose are:
- sd-bus-vtable.h: struct sd_bus_vtable extended like:
struct sd_bus_vtable {
        /* Please do not initialize this structure directly, use the
         * macros below instead */

        uint8_t type:8;
        uint64_t flags:56;
        union {
                struct {
                        size_t element_size;
                } start;
                struct {
                        const char *member;
                        const char *signature;
                        const char *in_names;
                        const char *result;
                        const char *out_names;
                        sd_bus_message_handler_t handler;
                        size_t offset;
                } method;
                struct {
                        const char *member;
                        const char *signature;
                        const char *out_names;
                } signal;
                struct {
                        const char *member;
                        const char *signature;
                        sd_bus_property_get_t get;
                        sd_bus_property_set_t set;
                        size_t offset;
                } property;
        } x;
};

The names would be separated by spaces for ease of coding. If the list
is too long, additional parameters are ignores, if too short, no name
tag is given (hence backward compatibility).

- additional macros for adding the name strings.
- processing of this additional information in bus-introspect.c,
changing the introspect_write_arguments:
      static int introspect_write_arguments(struct introspect *i,
const char *signature, const char *direction, const char *names)
  and related call in introspect_write_interface.

Thank you,
Regards,
Giacinto


More information about the systemd-devel mailing list