#ifndef XAPIAN_WRAPPER_H #define XAPIAN_WRAPPER_H #ifdef __cplusplus extern "C" { #endif typedef struct XapianDB XapianDB; XapianDB* xapian_open(const char* path, int writable, char** err); void xapian_close(XapianDB* db); int xapian_index(XapianDB* db, const char* id, const char* from, const char* to, const char* subject, const char* body, long long timestamp, char** err); int xapian_delete(XapianDB* db, const char* id, char** err); /* Returns JSON string: {"total":N,"hits":[{"id":"...","score":0.9},...]} Returns NULL on error, sets *err. Caller must free with xapian_free_string. */ char* xapian_search(XapianDB* db, const char* query, const char* from_filter, const char* own_email, const char* to_filter, long long date_from, long long date_to, int offset, int limit, char** err); void xapian_free_string(char* s); #ifdef __cplusplus } #endif #endif