return data;
}
+int array_steal_data(array_t *me, array_t *victim) {
+ priv_t *priv = (priv_t *)me ->priv;
+ priv_t *vpriv = (priv_t *)victim->priv;
+
+ if (priv->elem_size != vpriv->elem_size)
+ return 0;
+
+ array_clear(me);
+
+ void *tmp = me->priv;
+ me->priv = victim->priv;
+ victim->priv = tmp;
+
+ me->count = victim->count;
+ victim->count = 0;
+
+ return 1;
+}
+
+int array_append(array_t *me, array_t *extra) {
+ priv_t *epriv = (priv_t *)extra->priv;
+ return array_setn(me, me->count, epriv->data, extra->count);
+}
+
void *array_data(array_t *me) {
priv_t *priv = (priv_t *) me->priv;
*/
void *array_convert(array_t *me);
+/**
+ * Will steal the data from this array and make it replace our own,
+ * clearing our own data first.
+ * The victim array will be empty on success.
+ *
+ * @param victim the array whose data will be taken and cleared
+ *
+ * @note useful if you want to filter an array via a new, temporary one
+ * @note do not forget that you are still responsible for the (cleared) array
+ *
+ * @return FALSE if both arrays are incompatible
+ */
+int array_steal_data(array_t *me, array_t *victim);
+
+/**
+ * Will append the content of the given array to itself.
+ *
+ * @return FALSE if the array is too short and we cannot allocate enough
+ * contiguous memory for its needs
+ */
+int array_append(array_t *me, array_t *extra);
+
/**
* Return a pointer to the internal storage used by this array.
* This is the same value as would return `array_convert()`,