]> granicus.if.org Git - neomutt/commitdiff
mxapi: add mbox_check_stats()
authorAustin Ray <austin@austinray.io>
Fri, 7 Dec 2018 00:04:26 +0000 (00:04 +0000)
committerAustin Ray <austin@austinray.io>
Fri, 7 Dec 2018 00:04:26 +0000 (00:04 +0000)
mx.c
mx.h

diff --git a/mx.c b/mx.c
index efd2e425de438cb9c7040078c423012588de17a4..2f958377d9f3923c0911010c34651967a437f775 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1766,3 +1766,14 @@ void mx_cleanup_context(struct Context *ctx)
     mutt_pattern_free(&ctx->limit_pattern);
   memset(ctx, 0, sizeof(struct Context));
 }
+
+/**
+ * mx_mbox_check_stats - Check the statistics for a mailbox - Wrapper for MxOps::mbox_check_stats
+ */
+int mx_mbox_check_stats(struct Mailbox *m, int flags)
+{
+  if (!m)
+    return -1;
+
+  return m->mx_ops->mbox_check_stats(m, flags);
+}
diff --git a/mx.h b/mx.h
index 4e7ea1fa0d923edffe6cd86d8fae2030d6a792e4..b5881d44763a785f7c977ecfa81bd8a7e0f79ce8 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -143,6 +143,14 @@ struct MxOps
    * @retval -1 Error
    */
   int (*mbox_check)      (struct Context *ctx, int *index_hint);
+  /**
+   * mbox_check_stats - Check the mailbox statistics
+   * @param m     Mailbox to check
+   * @param flags Function flags
+   * @retval  0 Success
+   * @retval -1 Failure
+   */
+  int (*mbox_check_stats)(struct Mailbox *m, int flags);
   /**
    * mbox_sync - Save changes to the mailbox
    * @param ctx        Mailbox to sync
@@ -254,6 +262,7 @@ struct MxOps
 
 /* Wrappers for the Mailbox API, see MxOps */
 int             mx_mbox_check      (struct Context *ctx, int *index_hint);
+int             mx_mbox_check_stats(struct Mailbox *m, int flags);
 int             mx_mbox_close      (struct Context **pctx, int *index_hint);
 struct Context *mx_mbox_open       (struct Mailbox *m, const char *path, int flags);
 int             mx_mbox_sync       (struct Context *ctx, int *index_hint);