-
Notifications
You must be signed in to change notification settings - Fork 0
/
Container.c
45 lines (33 loc) · 855 Bytes
/
Container.c
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
#include "Container.h"
Container newContainer(Container c){
Container res = c;
res.object = res.new();
return res;
}
int setFreeCallBackContainer(Container c, void (*Free)(void *)){
return c.free_callback(c.object,Free);
}
void deleteContainer(Container c){
c.delete(c.object);
}
int pushBackContainer(Container c, void * v){
return c.pushBack(c.object,v);
}
int pushFrontContainer(Container c, void * v){
return c.pushFront(c.object,v);
}
void * popBackContainer(Container c){
return c.popBack(c.object);
}
void * popFrontContainer(Container c){
return c.popFront(c.object);
}
size_t lenContainer(Container c){
return c.len(c.object);
}
void * getContainer(Container c,size_t id){
return c.get(c.object,id);
}
void * setContainer(Container c,size_t id,void * v){
return c.set(c.object,id,v);
}