From: Stephan Bosch Date: Sat, 5 Jan 2019 18:43:49 +0000 (+0100) Subject: imap: client: Rearrange and document the client vfuncs. X-Git-Tag: 2.3.9~927 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e19161336f37d04735eed0dd2384df6b723f8bcb;p=thirdparty%2Fdovecot%2Fcore.git imap: client: Rearrange and document the client vfuncs. --- diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index f200f7e4b3..0cb9cb28d2 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -1594,9 +1594,11 @@ void clients_destroy_all(void) } struct imap_client_vfuncs imap_client_vfuncs = { - imap_state_export_base, - imap_state_import_base, - client_default_destroy, - client_default_send_tagline, - client_default_sync_notify_more, + .destroy = client_default_destroy, + + .send_tagline = client_default_send_tagline, + .sync_notify_more = client_default_sync_notify_more, + + .state_export = imap_state_export_base, + .state_import = imap_state_import_base, }; diff --git a/src/imap/imap-client.h b/src/imap/imap-client.h index 11e541730c..22933e35a4 100644 --- a/src/imap/imap-client.h +++ b/src/imap/imap-client.h @@ -119,6 +119,17 @@ struct client_command_context { }; struct imap_client_vfuncs { + /* Destroy the client.*/ + void (*destroy)(struct client *client, const char *reason); + + /* Send a tagged response line. */ + void (*send_tagline)(struct client_command_context *cmd, + const char *data); + /* Run "mailbox syncing". This can send any unsolicited untagged + replies. Returns 1 = done, 0 = wait for more space in output buffer, + -1 = failed. */ + int (*sync_notify_more)(struct imap_sync_context *ctx); + /* Export client state into buffer. Returns 1 if ok, 0 if some state couldn't be preserved, -1 if temporary internal error occurred. */ int (*state_export)(struct client *client, bool internal, @@ -130,14 +141,6 @@ struct imap_client_vfuncs { ssize_t (*state_import)(struct client *client, bool internal, const unsigned char *data, size_t size, const char **error_r); - void (*destroy)(struct client *client, const char *reason); - - void (*send_tagline)(struct client_command_context *cmd, - const char *data); - /* Run "mailbox syncing". This can send any unsolicited untagged - replies. Returns 1 = done, 0 = wait for more space in output buffer, - -1 = failed. */ - int (*sync_notify_more)(struct imap_sync_context *ctx); }; struct client {