]> granicus.if.org Git - neomutt/commitdiff
mxapi: add Account
authorRichard Russon <rich@flatcap.org>
Thu, 18 Oct 2018 20:45:09 +0000 (21:45 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 25 Oct 2018 20:33:13 +0000 (21:33 +0100)
mailbox.h
mx.h

index 2017de0e8a0e0a0b1fd6defd2e287875638f260a..d6ca0607722b2a08a117ec33e74091719f228d77 100644 (file)
--- a/mailbox.h
+++ b/mailbox.h
@@ -4,6 +4,7 @@
  *
  * @authors
  * Copyright (C) 1996-2000,2010,2013 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
  *
  * @copyright
  * This program is free software: you can redistribute it and/or modify it under
@@ -32,6 +33,7 @@
 
 struct Buffer;
 struct Context;
+struct Account;
 struct stat;
 
 /* These Config Variables are only used in mailbox.c */
@@ -115,6 +117,8 @@ struct Mailbox
   struct Hash *subj_hash;   /**< hash table by subject */
   struct Hash *label_hash;  /**< hash table for x-labels */
 
+  struct Account *account;
+
   int flags; /**< e.g. #MB_NORMAL */
 
   void *mdata;                 /**< driver specific data */
diff --git a/mx.h b/mx.h
index 84213781c729c330bc51e5f60d6d2067c270e560..92f90e31e58bea5945aa2d340e3f3ba0d566da4e 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -5,6 +5,7 @@
  * @authors
  * Copyright (C) 1996-2002,2013 Michael R. Elkins <me@mutt.org>
  * Copyright (C) 1999-2002 Thomas Roessler <roessler@does-not-exist.org>
+ * Copyright (C) 2017-2018 Richard Russon <rich@flatcap.org>
  *
  * @copyright
  * This program is free software: you can redistribute it and/or modify it under
@@ -100,6 +101,23 @@ struct MxOps
 {
   const int magic;  ///< Mailbox type, e.g. #MUTT_IMAP
   const char *name; ///< Mailbox name, e.g. "imap"
+
+  /**
+   * ac_find - Find an Account for a Mailbox path
+   * @param a    Account to search
+   * @param path Path to search for
+   * @retval  0 Success
+   * @retval -1 Error
+   */
+  struct Account *(*ac_find)  (struct Account *a, const char *path);
+  /**
+   * ac_add - Add a Mailbox to an Account
+   * @param a Account to add to
+   * @param m Mailbox to add
+   * @retval  0 Success
+   * @retval -1 Error
+   */
+  int             (*ac_add)   (struct Account *a, struct Mailbox *m);
   /**
    * mbox_open - Open a mailbox
    * @param ctx Mailbox to open