88fb81ddb3d6139caeb66dc2c5ba8a6070fadef1
[apps/madmutt.git] / alias.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9 #ifndef _MUTT_ALIAS_H
10 #define _MUTT_ALIAS_H
11
12 #include <lib-lib/list.h>
13 #include <lib-mime/mime.h>
14
15 typedef struct alias_t {
16   struct alias_t *next;
17   char *name;
18   address_t *addr;
19   short tagged;
20   short del;
21   short num;
22 } alias_t;
23
24 DO_INIT(alias_t, alias);
25 static inline void alias_wipe(alias_t *a) {
26     address_list_wipe(&a->addr);
27 }
28
29 DO_NEW(alias_t, alias);
30 DO_DELETE(alias_t, alias);
31 DO_SLIST(alias_t, alias, alias_delete);
32
33 const address_t *alias_lookup(const alias_t *list, const char *s);
34 const address_t *alias_reverse_lookup(const alias_t *list, const address_t *);
35
36 int mutt_addr_is_user(address_t *);
37 address_t *mutt_get_address(ENVELOPE *, const char **);
38 void mutt_create_alias(ENVELOPE *, address_t *);
39
40 address_t *mutt_expand_aliases(address_t *);
41 void mutt_expand_aliases_env(ENVELOPE *);
42 int mutt_alias_complete(char *, size_t);
43 void mutt_alias_menu(char *, size_t, alias_t *);
44
45 #endif /* !_MUTT_ALIAS_H */