-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkvs_clock.c
41 lines (31 loc) · 871 Bytes
/
kvs_clock.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
#include "kvs_clock.h"
#include <stdlib.h>
struct kvs_clock {
// TODO: add necessary variables
kvs_base_t* kvs_base;
int capacity;
};
kvs_clock_t* kvs_clock_new(kvs_base_t* kvs, int capacity) {
kvs_clock_t* kvs_clock = malloc(sizeof(kvs_clock_t));
kvs_clock->kvs_base = kvs;
kvs_clock->capacity = capacity;
// TODO: initialize other variables
return kvs_clock;
}
void kvs_clock_free(kvs_clock_t** ptr) {
// TODO: free dynamically allocated memory
free(*ptr);
*ptr = NULL;
}
int kvs_clock_set(kvs_clock_t* kvs_clock, const char* key, const char* value) {
// TODO: implement this function
return FAILURE;
}
int kvs_clock_get(kvs_clock_t* kvs_clock, const char* key, char* value) {
// TODO: implement this function
return FAILURE;
}
int kvs_clock_flush(kvs_clock_t* kvs_clock) {
// TODO: implement this function
return FAILURE;
}