[avahi] about the scanf like function

Sebastien Estienne sebastien.estienne at gmail.com
Mon Aug 22 04:42:05 PDT 2005


2005/8/22, Ikke <eikke at eikke.com>:
> 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.
What will you do with the value of C and D TXT record if you don't
know that they exist when you wrote your code? how can you guess their
meaning?

anyway having an iterator is usefull :)

> 
> Anyway, thats just my .02 :-)
> >
> > >
> > > Ikke
> 
> _______________________________________________
> avahi mailing list
> avahi at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/avahi
> 


-- 
Sebastien Estienne


More information about the avahi mailing list