forked from osu-cs261-f24/recitation-5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynarray.h
29 lines (25 loc) · 980 Bytes
/
dynarray.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* This file contains the definition of the interface for a dynamic array.
* You can find descriptions of the dynamic array functions, including their
* parameters and their return values, in dynarray.c.
*/
#ifndef __DYNARRAY_H
#define __DYNARRAY_H
/*
* Structure used to represent a dynamic array. You may not change the fact
* that only a forward declaration of the dynamic array structure is included
* here. In other words, you can't define the fields of the struct here.
*/
struct dynarray;
/*
* Dynamic array interface function prototypes. Refer to dynarray.c for
* documentation about each of these functions.
*/
struct dynarray* dynarray_create();
void dynarray_free(struct dynarray* da);
int dynarray_size(struct dynarray* da);
void dynarray_insert(struct dynarray* da, void* val);
void dynarray_remove(struct dynarray* da, int idx);
void* dynarray_get(struct dynarray* da, int idx);
void dynarray_set(struct dynarray* da, int idx, void* val);
#endif