-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkvs_fifo.c
43 lines (33 loc) · 891 Bytes
/
kvs_fifo.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
#include "kvs_fifo.h"
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
struct kvs_fifo {
// TODO: add necessary variables
kvs_base_t* kvs_base;
int capacity;
};
kvs_fifo_t* kvs_fifo_new(kvs_base_t* kvs, int capacity) {
kvs_fifo_t* kvs_fifo = malloc(sizeof(kvs_fifo_t));
kvs_fifo->kvs_base = kvs;
kvs_fifo->capacity = capacity;
// TODO: initialize other variables
return kvs_fifo;
}
void kvs_fifo_free(kvs_fifo_t** ptr) {
// TODO: free dynamically allocated memory
free(*ptr);
*ptr = NULL;
}
int kvs_fifo_set(kvs_fifo_t* kvs_fifo, const char* key, const char* value) {
// TODO: implement this function
return FAILURE;
}
int kvs_fifo_get(kvs_fifo_t* kvs_fifo, const char* key, char* value) {
// TODO: implement this function
return FAILURE;
}
int kvs_fifo_flush(kvs_fifo_t* kvs_fifo) {
// TODO: implement this function
return FAILURE;
}