-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharray.h
79 lines (54 loc) · 1.26 KB
/
array.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
typedef struct iarray {
struct iarray *previous;
struct iarray *next;
value_t value;
} iarray_t;
typedef struct array {
iarray_t *begin;
iarray_t *end;
} array_t;
array_t *
array_apply(array_t *que);
array_t *
array_create();
value_t
array_isempty(array_t *que);
iarray_t*
array_next(iarray_t *current);
iarray_t*
array_previous(iarray_t *current);
value_t
array_count(array_t *que);
value_t
array_clear(array_t *que, value_t (*f)(iarray_t*));
void
array_destroy(array_t *que, value_t (*f)(iarray_t*));
iarray_t*
array_unlink(array_t *que, iarray_t* it);
iarray_t*
array_remove(array_t *que, value_t (*f)(value_t));
iarray_t*
array_rpop(array_t *que);
iarray_t *
array_rpush(array_t *que, value_t value);
iarray_t*
array_lpop(array_t *que);
iarray_t *
array_lpush(array_t *que, value_t value);
iarray_t *
array_insert(array_t *que, value_t n, value_t value);
value_t
array_null(array_t *que);
iarray_t *
array_at(array_t *que, value_t key);
iarray_t *
array_first(array_t *que);
iarray_t *
array_last(array_t *que);
iarray_t *
array_first_or_default(array_t *que, value_t (*f)(value_t));
iarray_t *
array_last_or_default(array_t *que, value_t (*f)(value_t));
value_t
array_aggregate(array_t *que, value_t(*f)(value_t, value_t));