[PATCH 28/30] dynarray: Add pa_dynarray_get_raw_array()

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

 



I'll use this in pacat to convert a dynarray containing node names
into a string array.
---
 src/pulsecore/dynarray.c | 6 ++++++
 src/pulsecore/dynarray.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/src/pulsecore/dynarray.c b/src/pulsecore/dynarray.c
index 569c5cb..8dd8fab 100644
--- a/src/pulsecore/dynarray.c
+++ b/src/pulsecore/dynarray.c
@@ -95,3 +95,9 @@ unsigned pa_dynarray_size(pa_dynarray *array) {
 
     return array->n_entries;
 }
+
+void * const *pa_dynarray_get_raw_array(pa_dynarray *array) {
+    pa_assert(array);
+
+    return array->data;
+}
diff --git a/src/pulsecore/dynarray.h b/src/pulsecore/dynarray.h
index 3aacde8..65030f2 100644
--- a/src/pulsecore/dynarray.h
+++ b/src/pulsecore/dynarray.h
@@ -56,6 +56,7 @@ void *pa_dynarray_get(pa_dynarray *array, unsigned i);
 void *pa_dynarray_steal_last(pa_dynarray *array);
 
 unsigned pa_dynarray_size(pa_dynarray *array);
+void * const *pa_dynarray_get_raw_array(pa_dynarray *array);
 
 #define PA_DYNARRAY_FOREACH(elem, array, idx) \
     for ((idx) = 0; ((elem) = pa_dynarray_get(array, idx)); (idx)++)
-- 
1.8.3.1



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux