aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/flexarray.h
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-03-09 17:03:34 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-03-09 17:03:34 +0000
commit8f53c184ea06bb1f060ce9ad30bc24893ff9c950 (patch)
tree80c2d729120e4ba3adb9bac40322b95bdebd9f97 /tools/libxl/flexarray.h
parent54f4cfa3d8c60fa81dbb28fc83bf5f2272ed4222 (diff)
downloadxen-8f53c184ea06bb1f060ce9ad30bc24893ff9c950.tar.gz
xen-8f53c184ea06bb1f060ce9ad30bc24893ff9c950.tar.bz2
xen-8f53c184ea06bb1f060ce9ad30bc24893ff9c950.zip
libxl: introduce flexarray_append_pair
Introduce flexarray_append_pair: a simple syntactic sugar to add a pair of pointers to a flexarray, very useful when adding pairs of strings to xenstore. Replace flexarray_vappend calls (and one pair of flexarray_append) with flexarray_append_pair calls when dealing with flexarrays that are going to be used with libxl__xs_kvs_of_flexarray: NULL is a valid pointer value in these cases while flexarray_vappend uses NULL as vargs terminator, so the old code is buggy. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/flexarray.h')
-rw-r--r--tools/libxl/flexarray.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/libxl/flexarray.h b/tools/libxl/flexarray.h
index 30b8a1766b..350fbf4a9c 100644
--- a/tools/libxl/flexarray.h
+++ b/tools/libxl/flexarray.h
@@ -28,6 +28,7 @@ _hidden void flexarray_free(flexarray_t *array);
_hidden int flexarray_grow(flexarray_t *array, int extents);
_hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);
_hidden int flexarray_append(flexarray_t *array, void *ptr);
+_hidden int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2);
_hidden int flexarray_vappend(flexarray_t *array, ...);
_hidden int flexarray_get(flexarray_t *array, int index, void **ptr);