pop3-client.h revision e7d0bea63a08b08c47c4b5c187d2cb7127859657
#ifndef POP3_CLIENT_H
#define POP3_CLIENT_H
#include "seq-range-array.h"
struct client;
struct mail_storage;
struct mail_storage_service_ctx;
#define MSGS_BITMASK_SIZE(client) \
/* Stop reading input when output buffer has this many bytes. Once the buffer
size has dropped to half of it, start reading input again. */
#define POP3_OUTBUF_THROTTLE_SIZE 4096
#define POP3_CLIENT_OUTPUT_FULL(client) \
struct pop3_client_vfuncs {
};
/*
pop3_msn = 1..n in the POP3 protocol
msgnum = 0..n-1 = pop3_msn-1
seq = 1..n = mail's sequence number in lib-storage. when pop3 sort ordering
is used, msgnum_to_seq_map[] can be used for translation.
*/
struct client {
struct pop3_client_vfuncs v;
const char *session_id;
void *cmd_context;
struct mail_storage_service_user *service_user;
struct mail_namespace *inbox_ns;
struct mailbox_transaction_context *trans;
struct mail_keywords *deleted_kw;
struct timeout *to_session_dotlock_refresh;
struct dotlock *session_dotlock;
unsigned int bad_counter;
unsigned int highest_expunged_fetch_msgnum;
unsigned int uid_validity;
unsigned int messages_count;
unsigned int deleted_count, seen_change_count;
/* All sequences currently visible in the mailbox. */
/* [msgnum] contains mail seq. anything after it has seq = msgnum+1 */
unsigned int top_count;
unsigned int retr_count;
/* [msgnum] */
const char **message_uidls;
/* [msgnum/8] & msgnum%8 */
unsigned char *deleted_bitmask;
unsigned char *seen_bitmask;
/* settings: */
const struct pop3_settings *set;
const struct mail_storage_settings *mail_set;
enum uidl_keys uidl_keymask;
/* Module-specific contexts. */
bool disconnected:1;
bool deleted:1;
bool waiting_input:1;
bool anvil_sent:1;
bool message_uidls_save:1;
bool delete_success:1;
};
struct pop3_module_register {
unsigned int id;
};
union pop3_module_context {
struct pop3_client_vfuncs super;
struct pop3_module_register *reg;
};
extern struct pop3_module_register pop3_module_register;
extern struct client *pop3_clients;
extern unsigned int pop3_client_count;
if the handle is a socket. */
struct mail_storage_service_user *service_user,
/* Disconnect client connection */
/* Send a line of data to client */
#endif