-#include "rfc822.h"
-
-typedef struct alias {
- struct alias *self; /* XXX - ugly hack */
- char *name;
- ADDRESS *addr;
- struct alias *next;
- short tagged;
- short del;
- short num;
-} ALIAS;
-
-void mutt_create_alias (ENVELOPE *, ADDRESS *);
-int mutt_check_alias_name (const char *, char *);
-ADDRESS *mutt_get_address (ENVELOPE *, const char **);
-ADDRESS *mutt_lookup_alias (const char *s);
-ADDRESS *mutt_expand_aliases (ADDRESS *);
-void mutt_expand_aliases_env (ENVELOPE *);
-void mutt_free_alias (ALIAS **);
-ADDRESS *alias_reverse_lookup (ADDRESS *);
-int mutt_alias_complete (char *, size_t);
-int mutt_addr_is_user (ADDRESS *);
-void mutt_alias_menu (char *, size_t, ALIAS *);
+#include <lib-lib/lib-lib.h>
+#include <lib-mime/mime.h>
+
+typedef struct alias_t {
+ struct alias_t *next;
+ char *name;
+ address_t *addr;
+ short tagged;
+ short del;
+ short num;
+} alias_t;
+
+extern char *AliasFmt;
+extern char *AliasFile;
+extern alias_t *Aliases;
+extern rx_t GecosMask;
+
+DO_INIT(alias_t, alias);
+static inline void alias_wipe(alias_t *a) {
+ address_list_wipe(&a->addr);
+}
+DO_NEW(alias_t, alias);
+DO_DELETE(alias_t, alias);
+DO_SLIST(alias_t, alias, alias_delete);
+
+const address_t *alias_lookup(const char *s);
+const address_t *alias_reverse_lookup(const address_t *);
+
+int mutt_addr_is_user(address_t *);
+address_t *mutt_get_address(ENVELOPE *, const char **);
+void mutt_create_alias(ENVELOPE *, address_t *);
+
+address_t *mutt_expand_aliases(address_t *);
+void mutt_expand_aliases_env(ENVELOPE *);
+int mutt_alias_complete(char *, size_t);
+void mutt_alias_menu(char *, size_t, alias_t *);