From: Richard Russon Date: Thu, 18 Oct 2018 20:45:09 +0000 (+0100) Subject: mxapi: add Account X-Git-Tag: 2019-10-25~593^2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23dc0841d5f3a44fb8323e1a09aec56daa39a22d;p=neomutt mxapi: add Account --- diff --git a/mailbox.h b/mailbox.h index 2017de0e8..d6ca06077 100644 --- a/mailbox.h +++ b/mailbox.h @@ -4,6 +4,7 @@ * * @authors * Copyright (C) 1996-2000,2010,2013 Michael R. Elkins + * Copyright (C) 2018 Richard Russon * * @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 84213781c..92f90e31e 100644 --- a/mx.h +++ b/mx.h @@ -5,6 +5,7 @@ * @authors * Copyright (C) 1996-2002,2013 Michael R. Elkins * Copyright (C) 1999-2002 Thomas Roessler + * Copyright (C) 2017-2018 Richard Russon * * @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