-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynarray.h
More file actions
38 lines (30 loc) · 1.2 KB
/
dynarray.h
File metadata and controls
38 lines (30 loc) · 1.2 KB
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
30
31
32
33
34
35
36
37
38
/*
* 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);
void dynarray_print(struct dynarray* da, void (*p) (void* a));
void dynarray_enqueue(struct dynarray* da, void* val);
void* dynarray_get_front(struct dynarray* da);
void* dynarray_dequeue(struct dynarray* da);
void front_set(struct dynarray* da);
#endif