#ifndef DSYNC_IBC_H
#define DSYNC_IBC_H
/* dsync inter-brain communicator */
#include "ioloop.h"
#include "guid.h"
#include "mail-error.h"
#include "dsync-brain.h"
struct dsync_mailbox;
struct dsync_mailbox_state;
struct dsync_mailbox_node;
struct dsync_mailbox_delete;
struct dsync_mailbox_attribute;
struct dsync_mail;
struct dsync_mail_change;
struct dsync_mail_request;
enum dsync_ibc_send_ret {
/* send queue is full, stop sending more */
};
enum dsync_ibc_recv_ret {
/* try again / error (the error handling delayed until io callback) */
};
enum dsync_ibc_eol_type {
};
struct dsync_ibc_settings {
/* Server hostname. Used for determining which server does the
locking. */
const char *hostname;
/* if non-NULL, sync only these namespaces (LF-separated) */
const char *sync_ns_prefixes;
/* if non-NULL, sync only this mailbox name */
const char *sync_box;
/* if non-NULL, use this mailbox for finding messages with GUIDs and
copying them instead of saving them again. */
const char *virtual_all_box;
/* if non-empty, sync only this mailbox GUID */
/* Exclude these mailboxes from the sync. They can contain '*'
wildcards and be \special-use flags. */
const char *const *exclude_mailboxes;
/* Sync only mails with received timestamp at least this high. */
/* Sync only mails with received timestamp less or equal than this */
/* Don't sync mails larger than this. */
/* Sync only mails with specified flags. */
const char *sync_flags;
/* Hashed headers */
const char *const *hashed_headers;
bool hdr_hash_v2;
bool hdr_hash_v3;
unsigned int lock_timeout;
unsigned int import_commit_msgs_interval;
};
struct dsync_ibc *
const char *name, const char *temp_path_prefix,
unsigned int timeout_secs);
/* I/O callback is called whenever new data is available. It's also called on
errors, so check first the error status. */
const struct dsync_ibc_settings *set);
enum dsync_ibc_recv_ret
const struct dsync_ibc_settings **set_r);
const struct dsync_mailbox_state *state);
enum dsync_ibc_recv_ret
struct dsync_mailbox_state *state_r);
const char *const *name,
const struct dsync_mailbox_node *node);
enum dsync_ibc_recv_ret
const char *const **name_r,
const struct dsync_mailbox_node **node_r);
const struct dsync_mailbox_delete *deletes,
unsigned int count, char hierarchy_sep);
enum dsync_ibc_recv_ret
const struct dsync_mailbox_delete **deletes_r,
unsigned int *count_r, char *hierarchy_sep_r);
const struct dsync_mailbox *dsync_box);
enum dsync_ibc_recv_ret
const struct dsync_mailbox **dsync_box_r);
const struct dsync_mailbox_attribute *attr);
enum dsync_ibc_recv_ret
const struct dsync_mailbox_attribute **attr_r);
const struct dsync_mail_change *change);
enum dsync_ibc_recv_ret
const struct dsync_mail_change **change_r);
const struct dsync_mail_request *request);
enum dsync_ibc_recv_ret
const struct dsync_mail_request **request_r);
enum dsync_ibc_recv_ret
enum mail_error mail_error,
bool require_full_resync);
enum dsync_ibc_recv_ret
enum mail_error *mail_error_r,
bool *require_full_resync_r);
/* Close any mail input streams that are kept open. This needs to be called
before the mail is attempted to be freed (usually on error conditions). */
#endif