make lua packages interfaces be *.li.
[apps/madmutt.git] / alias.h
diff --git a/alias.h b/alias.h
index 0c9a307..29231bf 100644 (file)
--- a/alias.h
+++ b/alias.h
@@ -1,3 +1,21 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ *
+ *  Copyright © 2006 Pierre Habouzit
+ */
 /*
  * Copyright notice from original mutt:
  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
 /*
  * Copyright notice from original mutt:
  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
 #ifndef _MUTT_ALIAS_H
 #define _MUTT_ALIAS_H
 
 #ifndef _MUTT_ALIAS_H
 #define _MUTT_ALIAS_H
 
-#include <lib-lib/list.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-lua/lib-lua.h>
+
 #include <lib-mime/mime.h>
 
 #include <lib-mime/mime.h>
 
+int luaopen_MAlias(lua_State *L);
+
 typedef struct alias_t {
 typedef struct alias_t {
-  struct alias_t *next;
-  char *name;
-  address_t *addr;
-  short tagged;
-  short del;
-  short num;
+    struct alias_t *next;
+    char *name;
+    address_t *addr;
+    short tagged;
+    short del;
+    short num;
 } alias_t;
 
 } alias_t;
 
-DO_INIT(alias_t, alias);
-void alias_wipe(alias_t *a);
+extern alias_t *Aliases;
 
 
+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_NEW(alias_t, alias);
 DO_DELETE(alias_t, alias);
-DO_SLIST(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 *);
 
 
-const address_t *alias_lookup(const alias_t *list, const char *s);
 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_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 *);
-address_t *alias_reverse_lookup(address_t *);
 int mutt_alias_complete(char *, size_t);
 int mutt_alias_complete(char *, size_t);
-void mutt_alias_menu(char *, size_t, alias_t *);
 
 #endif /* !_MUTT_ALIAS_H */
 
 #endif /* !_MUTT_ALIAS_H */