blob: 2893976f2b9709331ea6d7b6e42175c2ee3acbe9 [file] [log] [blame]
Gurchetan Singh39f66c02017-11-02 16:42:49 -07001/*
2 * Copyright 2017 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7struct drv_array;
8
9struct drv_array *drv_array_init(uint32_t item_size);
10
11/* The data will be copied and appended to the array. */
12void *drv_array_append(struct drv_array *array, void *data);
13
14/* The data at the specified index will be freed -- the array will shrink. */
15void drv_array_remove(struct drv_array *array, uint32_t idx);
16
17void *drv_array_at_idx(struct drv_array *array, uint32_t idx);
18
19uint32_t drv_array_size(struct drv_array *array);
20
21/* The array and all associated data will be freed. */
22void drv_array_destroy(struct drv_array *array);