X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-common%2Fstrlst.h;h=99a9d2aa2b0fb0769fa11ab9dfcf8d22fa89f04f;hb=48cfb3c876636d79dace3ebc8e82c946bc0b7ebf;hp=4fde8eb8b7e4ebaf0fcaf3250fc7a88495bc1646;hpb=9962a048634c590db23a00db1d01daada779844c;p=catta diff --git a/avahi-common/strlst.h b/avahi-common/strlst.h index 4fde8eb..99a9d2a 100644 --- a/avahi-common/strlst.h +++ b/avahi-common/strlst.h @@ -23,9 +23,14 @@ ***/ #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, include NUL bytes. An empty list is created by + * characters, including NUL bytes. An empty list is created by * assigning a NULL to a pointer to AvahiStringList. The string list * is stored in reverse order, so that appending to the string list is * effectively a prepending to the linked list. This object is used @@ -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