X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-common%2Fstrlst.h;h=47fd14bc349c20493de4703764fbf16af2f35d1e;hb=e8e2707e96c08eda0ec6df2510dae4e6c71111ed;hp=10b7aa69ca32a3a74abd07fb71bc2866d3130942;hpb=4f0a5e7572a4257894b4bfede42c26d65152609e;p=catta diff --git a/avahi-common/strlst.h b/avahi-common/strlst.h index 10b7aa6..47fd14b 100644 --- a/avahi-common/strlst.h +++ b/avahi-common/strlst.h @@ -66,6 +66,12 @@ void avahi_string_list_free(AvahiStringList *l); * start. */ AvahiStringList *avahi_string_list_add(AvahiStringList *l, const char *text); +/** Append a new NUL terminated formatted string to the specified string list */ +AvahiStringList *avahi_string_list_add_printf(AvahiStringList *l, const char *format, ...) AVAHI_GCC_PRINTF_ATTR23; + +/** Append a new NUL terminated formatted string to the specified string list */ +AvahiStringList *avahi_string_list_add_vprintf(AvahiStringList *l, const char *format, va_list va); + /** Append an arbitrary length byte string to the list. Returns the * new list start. */ AvahiStringList *avahi_string_list_add_arbitrary(AvahiStringList *l, const uint8_t *text, size_t size); @@ -110,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