1010#include <bfdev/config.h>
1111#include <bfdev/types.h>
1212#include <bfdev/stddef.h>
13+ #include <bfdev/string.h>
1314#include <bfdev/allocator.h>
1415
1516BFDEV_BEGIN_DECLS
@@ -131,7 +132,7 @@ bfdev_array_data(const bfdev_array_t *array, unsigned long index)
131132/**
132133 * bfdev_array_push() - push elements into the array.
133134 * @array: the array object.
134- * @num: the data length to push.
135+ * @num: the number of element to push.
135136 *
136137 * Creates a number of new elements on the array and
137138 * returns a pointer to the first of these elements.
@@ -149,10 +150,23 @@ bfdev_array_pop(bfdev_array_t *array, unsigned long num);
149150extern void *
150151bfdev_array_peek (const bfdev_array_t * array , unsigned long num );
151152
153+ /**
154+ * bfdev_array_append() - append memory into the array.
155+ * @array: the array object.
156+ * @data: the data to append.
157+ * @num: the number of element to append.
158+ *
159+ * Return 0 on success or a negative error code on failure.
160+ */
161+ extern int
162+ bfdev_array_append (bfdev_array_t * array , const void * data , unsigned long num );
163+
152164/**
153165 * bfdev_array_resize() - directly set the number of elements in array.
154166 * @array: the array object.
155167 * @num: the number required resize.
168+ *
169+ * Return 0 on success or a negative error code on failure.
156170 */
157171extern int
158172bfdev_array_resize (bfdev_array_t * array , unsigned long num );
@@ -165,6 +179,8 @@ bfdev_array_resize(bfdev_array_t *array, unsigned long num);
165179 * Ensure that the buffer has space allocated for at least
166180 * @num bytes. If the current buffer is too small, it will
167181 * be reallocated, possibly to a larger size than requested.
182+ *
183+ * Return 0 on success or a negative error code on failure.
168184 */
169185extern int
170186bfdev_array_reserve (bfdev_array_t * array , unsigned long num );
0 commit comments