I noticed that I could also implement f_memory_array_append() and f_memory_array_append_all() methods if I used memcpy() and a multiplication over the type size.
This:
const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_socket_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
destination->array[destination->used++] = source.array[i];
} // for
return F_none;
Could instead become:
const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_socket_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
This could then be logic could then be moved into something like f_memory_array_append_all(), further simplifying the code into:
return f_memory_array_append(source.array, source.used, sizeof(f_socket_t), (void **) &destination->array, &destination->used, &destination->size);
I need to think of the function structure that I want and so I only decided to comment in this commit.
Such a change is not implemented yet but may be done at some later time.