byedpi/mpool.h
2024-04-16 20:55:41 +03:00

27 lines
476 B
C

#include <stdbool.h>
#include <time.h>
#include "kavl.h"
struct elem {
int len;
char *data;
int m;
time_t time;
KAVL_HEAD(struct elem) head;
};
struct mphdr {
bool stat;
struct elem *root;
};
struct mphdr *mem_pool(bool cst);
struct elem *mem_get(struct mphdr *hdr, char *str, int len);
struct elem *mem_add(struct mphdr *hdr, char *str, int len);
void mem_delete(struct mphdr *hdr, char *str, int len);
void mem_destroy(struct mphdr *hdr);