fts-api-private.h revision b7fdf4fe23801de680e0be5aca0596a3c9ea3f8f
c0699d9e0842a53c047fcbd695fa93ce435baa8fTimo Sirainen#define MAILBOX_GUID_HEX_LENGTH (GUID_128_SIZE*2)
677e22747b82bf15b339e31d1d0106d62bf806daTimo Sirainen int (*init)(struct fts_backend *backend, const char **error_r);
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen int (*get_last_uid)(struct fts_backend *backend, struct mailbox *box,
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen int (*update_deinit)(struct fts_backend_update_context *ctx);
9d1526ac8bcec9aff3c3a32f092ee2f3da2760b7Timo Sirainen void (*update_set_mailbox)(struct fts_backend_update_context *ctx,
23ad3970cd22adb6c875caf95fa791548849f0d1Timo Sirainen void (*update_expunge)(struct fts_backend_update_context *ctx,
a35cbba04d0a2823da98e693bd09a051addffdb2Timo Sirainen /* Start a build for specified key */
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen bool (*update_set_build_key)(struct fts_backend_update_context *ctx,
cb951d3282610a9a0960230865bc5f3e3347b203Timo Sirainen /* Finish a build for specified key - guaranteed to be called */
1795e934ebcd58175d3b5bbdd811b13c7889efa3Timo Sirainen void (*update_unset_build_key)(struct fts_backend_update_context *ctx);
b863b7e3fccf75f90f613b875f02fd1781e14e5eTimo Sirainen /* Add data for current build key */
b863b7e3fccf75f90f613b875f02fd1781e14e5eTimo Sirainen int (*update_build_more)(struct fts_backend_update_context *ctx,
c0699d9e0842a53c047fcbd695fa93ce435baa8fTimo Sirainen bool (*can_lookup)(struct fts_backend *backend,
c0699d9e0842a53c047fcbd695fa93ce435baa8fTimo Sirainen int (*lookup)(struct fts_backend *backend, struct mailbox *box,
c0699d9e0842a53c047fcbd695fa93ce435baa8fTimo Sirainen int (*lookup_multi)(struct fts_backend *backend,
26ada766cfff6ebfb91d100936118cf8aa51e3aeTimo Sirainen void (*lookup_done)(struct fts_backend *backend);
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen /* Backend supports indexing binary MIME parts */
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen /* Send built text to backend as decomposed titlecase rather than
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen preserving original case */
d0cc826dab58ed8e30e1ccd7cb6ad2f44b391a00Timo Sirainen /* Checksum of settings. If the settings change, the index should
acbd82bd456316a32f61df67fc41bbff681119c7Timo Sirainen be rebuilt. */
a5563dc790a44bb58860d74479a24349f593d68fTimo Sirainenvoid fts_backend_register(const struct fts_backend *backend);
a5563dc790a44bb58860d74479a24349f593d68fTimo Sirainenbool fts_backend_default_can_lookup(struct fts_backend *backend,
23ad3970cd22adb6c875caf95fa791548849f0d1Timo Sirainenvoid fts_filter_uids(ARRAY_TYPE(seq_range) *definite_dest,
797d20c35779d68f2542d3e287c1a869048c8f26Timo Sirainen/* Returns TRUE if ok, FALSE if no fts header */
a35cbba04d0a2823da98e693bd09a051addffdb2Timo Sirainenbool fts_index_get_header(struct mailbox *box, struct fts_index_header *hdr_r);
797d20c35779d68f2542d3e287c1a869048c8f26Timo Sirainenint fts_index_set_last_uid(struct mailbox *box, uint32_t last_uid);
88c580cdff2656df007fdfe5bd8ca8a465ee605aTimo Sirainenint fts_index_have_compatible_settings(struct mailbox_list *list,
acbd82bd456316a32f61df67fc41bbff681119c7Timo Sirainen/* Returns TRUE if FTS backend should index the header for optimizing
acbd82bd456316a32f61df67fc41bbff681119c7Timo Sirainen separate lookups */
acbd82bd456316a32f61df67fc41bbff681119c7Timo Sirainenbool fts_header_want_indexed(const char *hdr_name);
de02255bbe97d5d5c54ca1054bb7c9304ee025a1Timo Sirainenint fts_mailbox_get_guid(struct mailbox *box, const char **guid_r);
de02255bbe97d5d5c54ca1054bb7c9304ee025a1Timo Sirainen/* Returns fd, which you can either read from or close. */
de02255bbe97d5d5c54ca1054bb7c9304ee025a1Timo Sirainenint fts_indexer_cmd(struct mail_user *user, const char *cmd,
de02255bbe97d5d5c54ca1054bb7c9304ee025a1Timo Sirainen const char **path_r);