simplify alias expansion a lot.
[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 void alias_wipe(alias_t *a);
26
27 DO_NEW(alias_t, alias);
28 DO_DELETE(alias_t, alias);
29 DO_SLIST(alias_t, alias);
30
31 const address_t *alias_lookup(const alias_t *list, const char *s);
32 int mutt_addr_is_user(address_t *);
33 address_t *mutt_get_address(ENVELOPE *, const char **);
34 void mutt_create_alias(ENVELOPE *, address_t *);
35
36 address_t *mutt_expand_aliases(address_t *);
37 void mutt_expand_aliases_env(ENVELOPE *);
38 address_t *alias_reverse_lookup(address_t *);
39 int mutt_alias_complete(char *, size_t);
40 void mutt_alias_menu(char *, size_t, alias_t *);
41
42 #endif /* !_MUTT_ALIAS_H */