prepend "get_" to getters in driver_t
this makes it callbacks consistently start with a verb.
This commit is contained in:
parent
36666f7e52
commit
d54809e268
|
@ -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 * );
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user