NeoMutt  2020-04-24
Teaching an old dog new tricks
Go to the documentation of this file.
24 #ifndef MUTT_ALIAS_H
25 #define MUTT_ALIAS_H
27 #include <stddef.h>
28 #include <stdbool.h>
29 #include "mutt/lib.h"
30 #include "address/lib.h"
32 struct Envelope;
37 struct Alias
38 {
39  char *name;
40  struct AddressList addr;
41  bool tagged;
42  bool del;
43  short num;
44  TAILQ_ENTRY(Alias) entries;
45 };
46 TAILQ_HEAD(AliasList, Alias);
48 struct Alias *mutt_alias_new(void);
49 void mutt_alias_free(struct Alias **ptr);
50 void mutt_alias_create(struct Envelope *cur, struct AddressList *al);
51 void mutt_aliaslist_free(struct AliasList *a_list);
52 struct AddressList *mutt_alias_lookup(const char *s);
53 void mutt_expand_aliases_env(struct Envelope *env);
54 void mutt_expand_aliases(struct AddressList *al);
55 struct AddressList *mutt_get_address(struct Envelope *env, const char **pfxp);
57 bool mutt_addr_is_user(const struct Address *addr);
58 int mutt_alias_complete(char *buf, size_t buflen);
59 void mutt_alias_add_reverse(struct Alias *t);
60 void mutt_alias_delete_reverse(struct Alias *t);
61 struct Address *mutt_alias_reverse_lookup(const struct Address *a);
63 #endif /* MUTT_ALIAS_H */
A shortcut for an email address.
Definition: alias.h:37
char * name
Short name.
Definition: alias.h:39
TAILQ_ENTRY(Alias) entries
Linked list.
TAILQ_HEAD(AliasList, Alias)
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
Definition: alias.c:303
struct Address * mutt_alias_reverse_lookup(const struct Address *a)
Does the user have an alias for the given address.
Definition: alias.c:545
short num
Index number in list.
Definition: alias.h:43
An email address.
Definition: address.h:34
int mutt_alias_complete(char *buf, size_t buflen)
alias completion routine
Definition: alias.c:607
struct AddressList * mutt_get_address(struct Envelope *env, const char **pfxp)
Get an Address from an Envelope.
Definition: alias.c:335
void mutt_aliaslist_free(struct AliasList *a_list)
Free a List of Aliases.
Definition: alias.c:762
Email Address Handling.
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition: alias.c:686
bool del
Is it deleted?
Definition: alias.h:42
void mutt_alias_create(struct Envelope *cur, struct AddressList *al)
Create a new Alias from an Envelope or an Address.
Definition: alias.c:375
void mutt_alias_free(struct Alias **ptr)
Free an Alias.
Definition: alias.c:745
struct AddressList * mutt_alias_lookup(const char *s)
Find an Alias.
Definition: alias.c:285
void mutt_alias_delete_reverse(struct Alias *t)
Remove an email address lookup for an Alias.
Definition: alias.c:579
void mutt_expand_aliases_env(struct Envelope *env)
Expand aliases in all the fields of an Envelope.
Definition: alias.c:317
struct Alias * mutt_alias_new(void)
Create a new Alias.
Definition: alias.c:144
struct AddressList addr
List of Addresses the Alias expands to.
Definition: alias.h:40
Convenience wrapper for the library headers.
void mutt_alias_add_reverse(struct Alias *t)
Add an email address lookup for an Alias.
Definition: alias.c:557
The header of an Email.
Definition: envelope.h:54
bool tagged
Is it tagged?
Definition: alias.h:41