X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=avahi-common%2Fstrlst.h;h=99a9d2aa2b0fb0769fa11ab9dfcf8d22fa89f04f;hb=f43187377e0c89ba02ca23e88efa01bbb255e037;hp=13a6b2a7bd30c58f0252fe4f0d3facc98ac3e301;hpb=ff4a54d9cda0146974fab1d4f8da52e26d252eed;p=catta diff --git a/avahi-common/strlst.h b/avahi-common/strlst.h index 13a6b2a..99a9d2a 100644 --- a/avahi-common/strlst.h +++ b/avahi-common/strlst.h @@ -23,6 +23,11 @@ ***/ #include +#include + +/** \file strlst.h Implementation of a data type to store lists of strings */ + +AVAHI_C_DECL_BEGIN /** Linked list of strings that can contain any number of binary * characters, including NUL bytes. An empty list is created by @@ -44,6 +49,11 @@ AvahiStringList *avahi_string_list_new(const gchar *txt, ...); /** Same as avahi_string_list_new() but pass a va_list structure */ AvahiStringList *avahi_string_list_new_va(va_list va); +/** Create a new string list from a string array. The strings are + * copied using g_strdup(). length should contain the length of the + * array, or -1 if the array is NULL terminated*/ +AvahiStringList *avahi_string_list_new_from_array(const gchar **array, gint length); + /** Free a string list */ void avahi_string_list_free(AvahiStringList *l); @@ -83,5 +93,13 @@ gboolean avahi_string_list_equal(const AvahiStringList *a, const AvahiStringList /** Copy a string list */ AvahiStringList *avahi_string_list_copy(const AvahiStringList *l); +/** Reverse the string list. */ +AvahiStringList* avahi_string_list_reverse(AvahiStringList *l); + +/** Return the number of elements in the string list */ +guint avahi_string_list_length(const AvahiStringList *l); + +AVAHI_C_DECL_END + #endif