summaryrefslogtreecommitdiffstats
path: root/polyp/dynarray.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-11-21 02:43:05 +0000
committerLennart Poettering <lennart@poettering.net>2004-11-21 02:43:05 +0000
commitfa751e537db75108f9a1597d83a4e1093173fc28 (patch)
treed07c63ecfbc618599c88a089055713f98b02f9ba /polyp/dynarray.h
parent6985eda9347730d4506de630c310a34e7844df0a (diff)
some commenting
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@298 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/dynarray.h')
-rw-r--r--polyp/dynarray.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/polyp/dynarray.h b/polyp/dynarray.h
index 2e9b72f6..6733e958 100644
--- a/polyp/dynarray.h
+++ b/polyp/dynarray.h
@@ -24,10 +24,22 @@
struct pa_dynarray;
+/* Implementation of a simple dynamically sized array. The array
+ * expands if required, but doesn't shrink if possible. Memory
+ * management of the array's entries is the user's job. */
+
struct pa_dynarray* pa_dynarray_new(void);
+
+/* Free the array calling the specified function for every entry in
+ * the array. The function may be NULL. */
void pa_dynarray_free(struct pa_dynarray* a, void (*func)(void *p, void *userdata), void *userdata);
+/* Store p at position i in the array */
void pa_dynarray_put(struct pa_dynarray*a, unsigned i, void *p);
+
+/* Store p a the first free position in the array. Returns the index
+ * of that entry. If entries are removed from the array their position
+ * are not filled any more by this function. */
unsigned pa_dynarray_append(struct pa_dynarray*a, void *p);
void *pa_dynarray_get(struct pa_dynarray*a, unsigned i);