Lines Matching defs:array

50 static void *append_to_pointer_array(void **array, void *pointer);
355 * Appends a copy of the given string to the given string array,
356 * ensuring that the last element in the array is NULL. This array
359 * Note when an error occurs and NULL is returned, array is not freed.
360 * Subsequently callers should save a pointer to the original array
363 * @param array
364 * the array to append to, or NULL to create a new array
367 * the string to copy and add to the array
369 * @return a pointer to the realloc'd (and possibly moved) array
377 char **array,
386 return ((char **)append_to_pointer_array((void **)array, copy));
390 * Frees each element of the given string array, then frees the array
393 * @param array
394 * a NULL-terminated string array
398 char **array)
403 for (i = 0; array[i] != NULL; i++) {
404 free(array[i]);
407 /* Free the array itself */
408 free((void *)array);
420 * Appends the given pointer to the given pointer array, ensuring that
421 * the last element in the array is NULL.
423 * Note when an error occurs and NULL is returned, array is not freed.
424 * Subsequently callers should save a pointer to the original array
427 * @param array
428 * the array to append to, or NULL to create a new array
431 * the pointer to add to the array
433 * @return a pointer to the realloc'd (and possibly moved) array
441 void **array,
447 if (array != NULL) {
448 /* Count the elements currently in the array */
449 for (i = 0; array[i] != NULL; ++i);
453 newarray = (void **)realloc(array, (i + 2) * sizeof (*array));