[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 17/20] libxl: Provide libxl_string_list_length



On Fri, 2012-03-16 at 16:26 +0000, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  tools/libxl/libxl.c |    8 ++++++++
>  tools/libxl/libxl.h |    1 +
>  2 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index ee184ca..59992b6 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -195,6 +195,14 @@ void libxl_string_list_dispose(libxl_string_list *psl)
>      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 --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 985806b..50bae2f 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -195,6 +195,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-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.