Signal filtering

John (J5) Palmieri johnp at redhat.com
Mon Aug 29 12:33:13 PDT 2005


On Mon, 2005-08-29 at 21:22 +0200, Philip Van Hoof wrote:
> On Mon, 2005-08-29 at 15:02 -0400, John (J5) Palmieri wrote:
> 
> > There isn't much documentation.  Like I said it is on the TODO list.
> > But lets take NameOwnerChanged for instance.  You can only match on
> > strings with arg matches which makes this signal perfect.  Say you want
> > to receive signals from only org.freedesktop.Foo you would do this:
> > 
> > dbus_bus_add_match (dbus_connection,
> >                     "type='signal',"
> >                     "interface='org.freedesktop.DBus',"
> >                     "memeber='NameOwnerChanged',"
> >                     "arg0='org.freedesktop.Foo'", &error);
> 
> Is arg0 "any string"? Could it be like this?
> 
> "arg0='/some/tests/testing1'" or
> "arg0='/some/tests/testing2'" or
> "arg0='/some/tests/testing3'" or
> "arg0='/some/tests/more/testing4'" or

Yep this works.

> And can I let the filter succeed on tests like this?
> 
> "arg0='/some/tests/*'"

Nope.  Havoc vetoed my suggestion of allowing this.  Wildcards aren't
allowed in matches.

> So an argument for testing1, testing2, testing3 and even more/testing4.
> 
> The purpose is, indeed, a specification for a system like gconf. Not yet
> a software or implemented infrastructure. A.t.m. it's just for defining
> a specification. Don't worry :p.

Actually I rather see implementations before specifications, it kinda
keeps things grounded in what is possible to implement instead of
writing something that would be hard to implement.  But that is a
different topic :-)

-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list