mdbox-map.h revision 20e18d5a18fa7c4bc58de5c9e2301107d23d4faf
#ifndef MDBOX_MAP_H
#define MDBOX_MAP_H
#include "seq-range-array.h"
struct dbox_map_append_context;
struct dbox_file_append_context;
struct mdbox_storage;
struct dbox_map_mail_index_header {
};
struct dbox_map_mail_index_record {
};
struct dbox_map_file_msg {
};
struct dbox_map *
const char *path);
/* Open the map. This is done automatically for most operations.
Returns 0 if ok, -1 if error. */
/* Refresh the map. Returns 0 if ok, -1 if error. */
/* Look up file_id and offset for given map UID. Returns 1 if ok, 0 if UID
is already expunged, -1 if error. */
/* Get all messages from file */
struct dbox_map_transaction_context *
/* Write transaction to map and leave it locked. Call _free() to update tail
offset and unlock. */
/* Return all files containing messages with zero refcount. */
struct dbox_map_append_context *
/* Request file for saving a new message with given size (if available). If an
existing file can be used, the record is locked and updated in index.
Returns 0 if ok, -1 if error. */
struct dbox_file_append_context **file_append_ctx_r,
/* Finished saving the last mail. Saves the message size. */
/* Assign map UIDs to all appended msgs to multi-files. */
/* The appends are existing messages that were simply moved to a new file.
map_uids contains the moved messages' map UIDs. */
/* Returns 0 if ok, -1 if error. */
/* Get either existing uidvalidity or create a new one if map was
just created. */
#endif