aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/flexarray.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-11-09 19:54:28 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-11-09 19:54:28 +0000
commitc5c301ac774d8cb36ccbc775bb7f1d7005d78a71 (patch)
tree8fcd7201e14424ae0b5041f186087e06639a69f6 /tools/libxl/flexarray.h
parent85f5921bdf8216ae1fd9cb5963f897562f1b2380 (diff)
downloadxen-c5c301ac774d8cb36ccbc775bb7f1d7005d78a71.tar.gz
xen-c5c301ac774d8cb36ccbc775bb7f1d7005d78a71.tar.bz2
xen-c5c301ac774d8cb36ccbc775bb7f1d7005d78a71.zip
libxenlight: initial libxenlight implementation under tools/libxl
Signed-off-by: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'tools/libxl/flexarray.h')
-rw-r--r--tools/libxl/flexarray.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/libxl/flexarray.h b/tools/libxl/flexarray.h
new file mode 100644
index 0000000000..70e4c1aad3
--- /dev/null
+++ b/tools/libxl/flexarray.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2009 Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef FLEXARRAY_H
+#define FLEXARRAY_H
+
+typedef struct flexarray {
+ int size;
+ int autogrow;
+ void **data; /* array of pointer */
+} flexarray_t;
+
+flexarray_t *flexarray_make(int size, int autogrow);
+void flexarray_free(flexarray_t *array);
+int flexarray_grow(flexarray_t *array, int extents);
+int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);
+int flexarray_get(flexarray_t *array, int index, void **ptr);
+
+void **flexarray_contents(flexarray_t *array);
+
+#endif