* Adds a new element to the end of the supplied array, and sets its value * (by copying) from the data pointed to by the supplied pointer 'p'. * Automatically ensures that enough storage space is available for the new element. */
| 177 | * Automatically ensures that enough storage space is available for the new element. |
| 178 | */ |
| 179 | static inline void zarray_add(zarray_t *za, const void *p) |
| 180 | { |
| 181 | assert(za != NULL); |
| 182 | assert(p != NULL); |
| 183 | |
| 184 | zarray_ensure_capacity(za, za->size + 1); |
| 185 | |
| 186 | memcpy(&za->data[za->size*za->el_sz], p, za->el_sz); |
| 187 | za->size++; |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Retrieves the element from the supplied array located at the zero-based |
no test coverage detected