Added a dynamic array.
This commit is contained in:
24
include/dawn/util/dynarray.h
Normal file
24
include/dawn/util/dynarray.h
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
|
||||
/** Custom Array Definition */
|
||||
typedef struct {
|
||||
/** The data storage */
|
||||
void *data;
|
||||
|
||||
/** Size of each element within the array */
|
||||
size_t size;
|
||||
|
||||
/** The count of elements currently in the array */
|
||||
int32_t length;
|
||||
|
||||
/** Total count of elements the array can hold */
|
||||
int32_t total;
|
||||
} dynarray_t;
|
Reference in New Issue
Block a user