@@ -1,18 +1,19 @@
|
|
1 |
#ifndef ARRAY_H
|
2 |
#define ARRAY_H
|
3 |
|
4 |
#include <stddef.h>
|
5 |
|
6 |
-
|
|
|
7 |
|
8 |
static const size_t array_not_found = (size_t)-1;
|
9 |
|
10 |
-
array_t array_create(size_t capacity);
|
11 |
-
void array_destroy(array_t array);
|
12 |
-
int array_append(array_t array, void* element);
|
13 |
-
size_t array_get_count(const array_t array);
|
14 |
-
void* array_get_element(array_t array, size_t index);
|
15 |
-
size_t array_find_first(const array_t array, const void* element, size_t start_pos);
|
16 |
-
int array_remove_first(array_t array, const void* element, size_t start_pos);
|
17 |
|
18 |
#endif // ARRAY_H
|
1 |
#ifndef ARRAY_H
|
2 |
#define ARRAY_H
|
3 |
|
4 |
#include <stddef.h>
|
5 |
|
6 |
+
struct opaque_array_t;
|
7 |
+
typedef struct opaque_array_t array_t;
|
8 |
|
9 |
static const size_t array_not_found = (size_t)-1;
|
10 |
|
11 |
+
array_t* array_create(size_t capacity);
|
12 |
+
void array_destroy(array_t* array);
|
13 |
+
int array_append(array_t* array, void* element);
|
14 |
+
size_t array_get_count(const array_t* array);
|
15 |
+
void* array_get_element(const array_t* array, size_t index);
|
16 |
+
size_t array_find_first(const array_t* array, const void* element, size_t start_pos);
|
17 |
+
int array_remove_first(array_t* array, const void* element, size_t start_pos);
|
18 |
|
19 |
#endif // ARRAY_H
|