-
Notifications
You must be signed in to change notification settings - Fork 0
/
hfc.h
37 lines (27 loc) · 1 KB
/
hfc.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
#ifndef XENA_HFC_H
#define XENA_HFC_H
#include <stdint.h>
#include "hfc_struct.h"
#include "bytes.h"
struct hfc;
void hfc_init(struct hfc *, uint8_t *, size_t);
int hfc_count(struct hfc *);
struct hfc *hfc_new(uint8_t *, size_t);
void hfc_search_method(struct hfc *, int (*cmp)(const char *a, const char *b), int, char *, struct search_result *);
void hfc_free(struct hfc *);
struct hfc_iter *hfc_iter_init(struct hfc *hfc);
char *hfc_iter_next(struct hfc_iter *iter);
void hfc_iter_free(struct hfc_iter *iter);
struct bytes *hfc_compress(uint32_t count, char **strings);
struct hfc *hfc_merge_two(struct hfc *ha, struct hfc *hb);
// js API
void hfc_set(uint8_t *buff, uint32_t len);
void hfc_set_empty();
void hfc_merge(uint8_t *buff, uint32_t len);
char *hfc_lookup(uint32_t i);
struct search_result *hfc_search(char *substring, enum search_type type);
void hfc_filter(uint32_t *list, uint32_t count);
struct hfc *hfc_get_cache();
void hfc_clear_cache(); // inner cache only
int hfc_length();
#endif //XENA_HTC_H