[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: Provide libxl_string_list_length
# HG changeset patch # User Ian Jackson <ian.jackson@xxxxxxxxxxxxx> # Date 1334150055 -3600 # Node ID 6fc016d74c40c972f82c4da38e80b448713e4665 # Parent e6db36100b1db9e67c9fed0ed087d10ec2625493 libxl: Provide libxl_string_list_length Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> --- diff -r e6db36100b1d -r 6fc016d74c40 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Wed Apr 11 14:14:15 2012 +0100 +++ b/tools/libxl/libxl.c Wed Apr 11 14:14:15 2012 +0100 @@ -177,6 +177,14 @@ void libxl_string_list_dispose(libxl_str free(sl); } +int libxl_string_list_length(const libxl_string_list *psl) +{ + if (!psl) return 0; + int i = 0; + while (*psl++) i++; + return i; +} + void libxl_key_value_list_dispose(libxl_key_value_list *pkvl) { int i; diff -r e6db36100b1d -r 6fc016d74c40 tools/libxl/libxl.h --- a/tools/libxl/libxl.h Wed Apr 11 14:14:15 2012 +0100 +++ b/tools/libxl/libxl.h Wed Apr 11 14:14:15 2012 +0100 @@ -273,6 +273,7 @@ typedef uint8_t libxl_mac[6]; typedef char **libxl_string_list; void libxl_string_list_dispose(libxl_string_list *sl); +int libxl_string_list_length(const libxl_string_list *sl); typedef char **libxl_key_value_list; void libxl_key_value_list_dispose(libxl_key_value_list *kvl); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |