commit d54809e26885838bdf646d33a0f2ff4b22f6bfd2
parent 36666f7e52642af3f804e6f0b32cc1dabc92c132
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Sun, 19 Mar 2017 13:46:03 +0100
prepend "get_" to getters in driver_t
this makes it callbacks consistently start with a verb.
Diffstat:
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/driver.h b/src/driver.h
@@ -259,10 +259,10 @@ struct driver {
void (*commit_cmds)( store_t *ctx );
/* Get approximate amount of memory occupied by the driver. */
- int (*memory_usage)( store_t *ctx );
+ int (*get_memory_usage)( store_t *ctx );
/* Get the FAIL_* state of the driver. */
- int (*fail_state)( store_conf_t *conf );
+ int (*get_fail_state)( store_conf_t *conf );
};
void free_generic_messages( message_t * );
diff --git a/src/drv_imap.c b/src/drv_imap.c
@@ -2875,20 +2875,20 @@ imap_commit_cmds( store_t *gctx )
(void)gctx;
}
-/******************* imap_memory_usage *******************/
+/******************* imap_get_memory_usage *******************/
static int
-imap_memory_usage( store_t *gctx )
+imap_get_memory_usage( store_t *gctx )
{
imap_store_t *ctx = (imap_store_t *)gctx;
return ctx->buffer_mem + ctx->conn.buffer_mem;
}
-/******************* imap_fail_state *******************/
+/******************* imap_get_fail_state *******************/
static int
-imap_fail_state( store_conf_t *gconf )
+imap_get_fail_state( store_conf_t *gconf )
{
return ((imap_store_conf_t *)gconf)->server->failed;
}
@@ -3208,6 +3208,6 @@ struct driver imap_driver = {
imap_close_box,
imap_cancel_cmds,
imap_commit_cmds,
- imap_memory_usage,
- imap_fail_state,
+ imap_get_memory_usage,
+ imap_get_fail_state,
};
diff --git a/src/drv_maildir.c b/src/drv_maildir.c
@@ -1796,13 +1796,13 @@ maildir_commit_cmds( store_t *gctx )
}
static int
-maildir_memory_usage( store_t *gctx ATTR_UNUSED )
+maildir_get_memory_usage( store_t *gctx ATTR_UNUSED )
{
return 0;
}
static int
-maildir_fail_state( store_conf_t *gconf )
+maildir_get_fail_state( store_conf_t *gconf )
{
return ((maildir_store_conf_t *)gconf)->failed;
}
@@ -1890,6 +1890,6 @@ struct driver maildir_driver = {
maildir_close_box,
maildir_cancel_cmds,
maildir_commit_cmds,
- maildir_memory_usage,
- maildir_fail_state,
+ maildir_get_memory_usage,
+ maildir_get_fail_state,
};
diff --git a/src/main.c b/src/main.c
@@ -800,7 +800,7 @@ sync_chans( main_vars_t *mvars, int ent )
info( "Channel %s\n", mvars->chan->name );
mvars->skip = mvars->cben = 0;
for (t = 0; t < 2; t++) {
- int st = mvars->chan->stores[t]->driver->fail_state( mvars->chan->stores[t] );
+ int st = mvars->chan->stores[t]->driver->get_fail_state( mvars->chan->stores[t] );
if (st != FAIL_TEMP) {
info( "Skipping due to %sfailed %s store %s.\n",
(st == FAIL_WAIT) ? "temporarily " : "", str_ms[t], mvars->chan->stores[t]->name );
diff --git a/src/sync.c b/src/sync.c
@@ -1881,7 +1881,7 @@ msgs_copied( sync_vars_t *svars, int t )
if (!(svars->state[t] & ST_SENT_NEW)) {
for (tmsg = svars->new_msgs[t]; tmsg; tmsg = tmsg->next) {
if ((srec = tmsg->srec) && srec->tuid[0]) {
- if (svars->drv[t]->memory_usage( svars->ctx[t] ) >= BufferLimit) {
+ if (svars->drv[t]->get_memory_usage( svars->ctx[t] ) >= BufferLimit) {
svars->new_msgs[t] = tmsg;
goto out;
}