Source

codehound / index.h

Full commit
#ifndef __INDEX_H__
#define __INDEX_H__

struct index_writer;
struct index;

struct index_writer *index_writer_create(const char *name);
void index_writer_destroy(struct index_writer *writer);
int index_writer_add(struct index_writer *writer, const char *path);
int index_writer_write(struct index_writer *writer);

typedef void (*index_search_cb)(const char *filepath, void *arg);

struct index *index_open(const char *name);
void index_close(struct index *index);
int index_search(struct index *index, uint32_t *trigrams, index_search_cb cb, void *arg);

#endif /* __INDEX_H__ */