1 /**
2  * @file
3  * Alternate address handling
4  *
5  * @authors
6  * Copyright (C) 2021 Richard Russon <rich@flatcap.org>
7  *
8  * @copyright
9  * This program is free software: you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License as published by the Free Software
11  * Foundation, either version 2 of the License, or (at your option) any later
12  * version.
13  *
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License along with
20  * this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef MUTT_ALTERNATES_H
24 #define MUTT_ALTERNATES_H
25 
26 #include <stdbool.h>
27 #include <stdint.h>
28 #include "core/lib.h"
29 
30 struct Buffer;
31 
32 /**
33  * enum NotifyAlternates - Alternates command notification types
34  *
35  * @note Notifications are sent **after** the event.
36  */
37 enum NotifyAlternates
38 {
39   NT_ALTERN_ADD = 1,    ///< Alternate address has been added
40   NT_ALTERN_DELETE,     ///< Alternate address has been deleted
41   NT_ALTERN_DELETE_ALL, ///< All Alternate addresses have been deleted
42 };
43 
44 void alternates_init(void);
45 void alternates_free(void);
46 
47 enum CommandResult parse_alternates  (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
48 enum CommandResult parse_unalternates(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
49 
50 bool mutt_alternates_match(const char *addr);
51 void mutt_alternates_reset(struct Mailbox *m);
52 
53 #endif /* MUTT_ALTERNATES_H */
54