[avahi] about the scanf like function

Ikke eikke at eikke.com
Mon Aug 22 03:49:44 PDT 2005


On Mon, 2005-08-22 at 11:59 +0200, Sebastien Estienne wrote:
> 2005/8/22, Ikke <eikke at eikke.com>:
> > > Another possiblility is to have a set of functions especially designed
> > > to handle TXT record, like:
> > > char * avahi_text_record_get_value_from_key(AvahiStringList *l, const
> > > char *key); //return value
> > >
> > > to be coherent we may add avahi_text_text_record_set
> > >
> > > what do you think?
> > 
> > An iterator would be much better IMHO, as you don't always know the
> > provided keys beforehand. Just guessing isn't really nice :-)
> i think that both are usefull, because i think the contrary:
> most of the time you know the key that you are interested in, and you
> also know it's meaning (cf: http://www.dns-sd.org/ServiceTypes.html).
> If you didn't know the key beforehand, what could you do with it
> except displaying it's value? :)
You could have a list of *possible* values.
I thought of something like this: let's say you got a FooDevice
providing FooService of brand Bar. The specs say a FooDevice/FooService
should provide TXT fields A and B, so the device does that. Bar's
engineers decice it could be usefull to have an extra TXT record C, that
can be used by application developers, that's not in the spec. Now if
your app would poll every FooDevice providing FooService it discovers
whether it provides the C TXT record, that would not be nice (IMHO), as
another vendor might provide a D record, then your code will become
pretty ugly. If you can just iterate, the code will be (i think)
prettier.

Anyway, thats just my .02 :-)
> 
> > 
> > Ikke



More information about the avahi mailing list