NeoMutt  2020-09-25
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1 
39 #ifndef MUTT_ALIAS_LIB_H
40 #define MUTT_ALIAS_LIB_H
41 
42 #include <stddef.h>
43 #include <stdbool.h>
44 #include <stdint.h>
45 #include "mutt_commands.h"
46 
47 struct Address;
48 struct AddressList;
49 struct Buffer;
50 struct ConfigSet;
51 struct Envelope;
52 
53 extern char *C_AliasFile;
54 
55 /* These Config Variables are only used in dlgalias.c */
56 extern char *C_AliasFormat;
57 extern short C_SortAlias;
58 
59 /* These Config Variables are only used in dlgquery.c */
60 extern char *C_QueryCommand;
61 extern char *C_QueryFormat;
62 
63 extern struct HashTable *ReverseAliases;
64 
65 void alias_init (void);
66 void alias_shutdown(void);
67 
68 void alias_create (struct AddressList *al);
69 struct AddressList *alias_lookup (const char *name);
70 
71 bool mutt_addr_is_user (const struct Address *addr);
72 void mutt_expand_aliases_env(struct Envelope *env);
73 void mutt_expand_aliases (struct AddressList *al);
74 struct AddressList *mutt_get_address (struct Envelope *env, const char **prefix);
75 
76 enum CommandResult parse_alias (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
77 enum CommandResult parse_unalias(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
78 
79 int alias_complete(char *buf, size_t buflen);
80 
81 int query_complete(char *buf, size_t buflen);
82 void query_index (void);
83 
84 struct Address *alias_reverse_lookup(const struct Address *addr);
85 
86 bool config_init_alias(struct ConfigSet *cs);
87 
88 #endif /* MUTT_ALIAS_LIB_H */
Container for lots of config items.
Definition: set.h:228
bool config_init_alias(struct ConfigSet *cs)
Register alias config variables - Implements module_init_config_t.
Definition: config.c:75
A Hash Table.
Definition: hash.h:84
enum CommandResult parse_unalias(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the &#39;unalias&#39; command - Implements Command::parse()
Definition: commands.c:159
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:34
enum CommandResult parse_alias(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the &#39;alias&#39; command - Implements Command::parse()
Definition: commands.c:49
String manipulation buffer.
Definition: buffer.h:33
An email address.
Definition: address.h:34
void alias_shutdown(void)
Clean up the Alias globals.
Definition: alias.c:660
struct AddressList * mutt_get_address(struct Envelope *env, const char **prefix)
Get an Address from an Envelope.
Definition: alias.c:326
char * C_QueryCommand
Config: External command to query and external address book.
Definition: config.c:47
struct AddressList * alias_lookup(const char *name)
Find an Alias.
Definition: alias.c:276
short C_SortAlias
Config: Sort method for the alias menu.
Definition: config.c:49
int query_complete(char *buf, size_t buflen)
Perform auto-complete using an Address Query.
Definition: dlgquery.c:579
void alias_create(struct AddressList *al)
Create a new Alias from an Address.
Definition: alias.c:365
char * C_AliasFormat
Config: printf-like format string for the alias menu.
Definition: config.c:46
char * C_QueryFormat
Config: printf-like format string for the query menu (address book)
Definition: config.c:48
struct HashTable * ReverseAliases
Hash Table of aliases (email address -> alias)
Definition: reverse.c:37
struct Address * alias_reverse_lookup(const struct Address *addr)
Does the user have an alias for the given address.
Definition: reverse.c:87
void query_index(void)
Perform an Alias Query and display the results.
Definition: dlgquery.c:617
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition: alias.c:544
int alias_complete(char *buf, size_t buflen)
alias completion routine
Definition: dlgalias.c:346
void mutt_expand_aliases_env(struct Envelope *env)
Expand aliases in all the fields of an Envelope.
Definition: alias.c:308
Definitions of NeoMutt commands.
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
Definition: alias.c:294
void alias_init(void)
Set up the Alias globals.
Definition: alias.c:650
char * C_AliasFile
Config: Save new aliases to this file.
Definition: config.c:45
The header of an Email.
Definition: envelope.h:54