if you are going to append a known and large number of items, * call this first */
| 393 | * call this first |
| 394 | */ |
| 395 | void array_pre_append(ARRAY *a, int app_count) |
| 396 | { |
| 397 | const char *name = "array_pre_append"; |
| 398 | |
| 399 | if (app_count <= 0) { |
| 400 | msg_fatal("%s(%d)->%s: invalid input", __FILE__, __LINE__, name); |
| 401 | } |
| 402 | |
| 403 | if (a->count + app_count > a->capacity) { |
| 404 | array_grow(a, a->count + app_count); |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | void *array_index(const ARRAY *a, int idx) |
| 409 | { |
no test coverage detected
searching dependent graphs…