From eb3966f2d8bbfab5554b9312998e1d4812b0e28b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 22 Aug 2005 19:15:22 +0000 Subject: * add four new AvahiStringList functions (this is four you, Sebastien!) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@395 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/strlst.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'avahi-common/strlst.h') diff --git a/avahi-common/strlst.h b/avahi-common/strlst.h index b4e3877..47fd14b 100644 --- a/avahi-common/strlst.h +++ b/avahi-common/strlst.h @@ -116,6 +116,23 @@ AvahiStringList* avahi_string_list_reverse(AvahiStringList *l); /** Return the number of elements in the string list */ unsigned avahi_string_list_length(const AvahiStringList *l); +/** Find the string list entry for the given DNS-SD TXT key */ +AvahiStringList *avahi_string_list_find(AvahiStringList *l, const char *key); + +/** Return the DNS-SD TXT key and value for the specified string list + * item. If size is not NULL it will be filled with the length of + * value. (for strings containing NUL bytes). If the entry doesn't + * contain a value *value will be set to NULL. You need to + * avahi_free() the strings returned in *key and *value. */ +int avahi_string_list_get_pair(AvahiStringList *l, char **key, char **value, size_t *size); + +/** Add a new DNS-SD TXT key value pair to the string list. value may + * be NULL in case you want to specify a key without a value */ +AvahiStringList *avahi_string_list_add_pair(AvahiStringList *l, const char *key, const char *value); + +/** Same as avahi_string_list_add_pair() but allow strings containing NUL bytes in *value. */ +AvahiStringList *avahi_string_list_add_pair_arbitrary(AvahiStringList *l, const char *key, const uint8_t *value, size_t size); + AVAHI_C_DECL_END #endif -- cgit