OSDN Git Service

minigbm: virtio_gpu: set vma->length when mmap.
[android-x86/external-minigbm.git] / helpers_array.h
1 /*
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
7 struct drv_array;
8
9 struct drv_array *drv_array_init(uint32_t item_size);
10
11 /* The data will be copied and appended to the array. */
12 void *drv_array_append(struct drv_array *array, void *data);
13
14 /* The data at the specified index will be freed -- the array will shrink. */
15 void drv_array_remove(struct drv_array *array, uint32_t idx);
16
17 void *drv_array_at_idx(struct drv_array *array, uint32_t idx);
18
19 uint32_t drv_array_size(struct drv_array *array);
20
21 /* The array and all associated data will be freed. */
22 void drv_array_destroy(struct drv_array *array);