sort out some prototypes, put them where they belong.
authorPierre Habouzit <madcoder@debian.org>
Thu, 16 Nov 2006 23:50:51 +0000 (00:50 +0100)
committerPierre Habouzit <madcoder@debian.org>
Thu, 16 Nov 2006 23:50:51 +0000 (00:50 +0100)
rework lib-lib, have a public lib-lib/lib-lib.h header that will be our
main library we always want to have.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
124 files changed:
account.c
account.h
alias.c
alias.h
attach.c
browser.c
buffy.c
cflags.mk
charset.c
commands.c
compose.c
compress.c
copy.c
dotlock.c
editmsg.c
flags.c
from.c
globals.h
handler.c
hcache.c
headers.c
help.c
hook.c
imap/auth.c
imap/auth_anon.c
imap/auth_cram.c
imap/auth_gss.c
imap/auth_login.c
imap/auth_sasl.c
imap/browse.c
imap/command.c
imap/imap.c
imap/message.c
imap/mx_imap.c
imap/utf7.c
imap/util.c
init.c
keymap.c
keymap.h
lib-crypt/crypt-gpgme.c
lib-crypt/crypt-mod.c
lib-crypt/crypt.c
lib-crypt/cryptglue.c
lib-crypt/gnupgparse.c
lib-crypt/pgp.c
lib-crypt/pgpinvoke.c
lib-crypt/pgpkey.c
lib-crypt/pgplib.c
lib-crypt/pgpmicalg.c
lib-crypt/pgppacket.c
lib-crypt/smime.c
lib-lib/Makefile.am
lib-lib/buffer.c
lib-lib/buffer.h
lib-lib/lib-lib.h [new file with mode: 0644]
lib-lib/rx.c
lib-lib/url.c
lib-mime/crypt.c
lib-mime/mime-types.h
lib-mime/mime.c
lib-mime/mime.h
lib-mime/rfc1524.c
lib-mime/rfc2047.c
lib-mime/rfc2231.c
lib-mime/rfc3676.c
lib-mime/rfc822address.c
lib-mime/rfc822parse.c
lib-sys/exit.c
lib-sys/filter.c
lib-sys/mutt_signal.c
lib-sys/mutt_socket.c
lib-sys/mutt_ssl.c
lib-sys/mutt_ssl_gnutls.c
lib-sys/mutt_tunnel.c
lib-sys/unix.c
lib-sys/unix.h
lib-ui/color.c
lib-ui/complete.c
lib-ui/curs_lib.c
lib-ui/curs_main.c
lib-ui/curses.h
lib-ui/enter.c
lib-ui/hdrline.c
lib-ui/history.c
lib-ui/menu.c
lib-ui/menu.h
lib-ui/query.c
lib-ui/sidebar.c
lib-ui/status.c
lib/list.c
main.c
makedoc.c
mbox.c
mh.c
mh.h
mutt.h
mutt_idna.c
mutt_libesmtp.c
mutt_sasl.c
muttlib.c
mx.c
mx.h
nntp/mx_nntp.c
nntp/newsrc.c
nntp/nntp.c
pager.c
pattern.c
pgppubring.c
pop/mx_pop.c
pop/pop.c
pop/pop_auth.c
pop/pop_lib.c
postpone.c
protos.h
recvattach.c
recvcmd.c
remailer.c
score.c
send.c
sendlib.c
sort.c
sort.h
thread.c
xterm.h

index dc12bc6..f13831e 100644 (file)
--- a/account.c
+++ b/account.c
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/url.h>
-
+#include <lib-lib/lib-lib.h>
 #include <lib-ui/enter.h>
 
 #include "mutt.h"
 #include <lib-ui/enter.h>
 
 #include "mutt.h"
index a838b67..d9b5a55 100644 (file)
--- a/account.h
+++ b/account.h
@@ -12,7 +12,7 @@
 #ifndef _MUTT_ACCOUNT_H_
 #define _MUTT_ACCOUNT_H_ 1
 
 #ifndef _MUTT_ACCOUNT_H_
 #define _MUTT_ACCOUNT_H_ 1
 
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 /* account types */
 enum {
 
 /* account types */
 enum {
diff --git a/alias.c b/alias.c
index 4602176..907e743 100644 (file)
--- a/alias.c
+++ b/alias.c
 #include <string.h>
 #include <ctype.h>
 
 #include <string.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/mapping.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
 
 #include <lib-sys/unix.h>
 
@@ -381,7 +375,8 @@ address_t *mutt_expand_aliases(address_t *a)
 
     t = mutt_expand_aliases_r(a, &expn);
     string_list_wipe(&expn);
 
     t = mutt_expand_aliases_r(a, &expn);
     string_list_wipe(&expn);
-    return mutt_remove_duplicates(t);
+    address_list_uniq(t);
+    return t;
 }
 
 void mutt_expand_aliases_env(ENVELOPE *env)
 }
 
 void mutt_expand_aliases_env(ENVELOPE *env)
diff --git a/alias.h b/alias.h
index e5d081c..8a4fad8 100644 (file)
--- a/alias.h
+++ b/alias.h
@@ -27,7 +27,7 @@
 #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-mime/mime.h>
 
 typedef struct alias_t {
 #include <lib-mime/mime.h>
 
 typedef struct alias_t {
index 0b497ef..a66665c 100644 (file)
--- a/attach.c
+++ b/attach.c
 #include <string.h>
 #include <errno.h>
 
 #include <string.h>
 #include <errno.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
 
 #include <lib-sys/unix.h>
 
index 244df97..0db6801 100644 (file)
--- a/browser.c
+++ b/browser.c
 #include <pwd.h>
 #include <grp.h>
 
 #include <pwd.h>
 #include <grp.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
diff --git a/buffy.c b/buffy.c
index 5befe84..2ada9b4 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <stdio.h>
 
 #include <unistd.h>
 #include <stdio.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/sidebar.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/sidebar.h>
index 911a0b4..a734def 100644 (file)
--- a/cflags.mk
+++ b/cflags.mk
@@ -45,3 +45,5 @@ CFLAGS += -Wpointer-arith
 CFLAGS += -Wredundant-decls
 # warn if the format string is not a string literal
 #CFLAGS += -Wformat-nonliteral
 CFLAGS += -Wredundant-decls
 # warn if the format string is not a string literal
 #CFLAGS += -Wformat-nonliteral
+# missing prototypes
+CFLAGS += -Wmissing-prototypes
index 90a7307..8e79d13 100644 (file)
--- a/charset.c
+++ b/charset.c
 #  include <langinfo.h>
 #endif
 
 #  include <langinfo.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "charset.h"
 
 #include "mutt.h"
 #include "charset.h"
index 6a05985..280a3fd 100644 (file)
 #include <sys/types.h>
 #include <utime.h>
 
 #include <sys/types.h>
 #include <utime.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/file.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index f6039fb..d93dbfd 100644 (file)
--- a/compose.c
+++ b/compose.c
 #include <unistd.h>
 #include <stdlib.h>
 
 #include <unistd.h>
 #include <stdlib.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
 
 #include <lib-sys/unix.h>
 
index 72ad440..ed5da3e 100644 (file)
 #include <unistd.h>
 #include <sys/stat.h>
 
 #include <unistd.h>
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/mutt_signal.h>
 #include <lib-sys/unix.h>
 
 #include <lib-sys/mutt_signal.h>
 #include <lib-sys/unix.h>
diff --git a/copy.c b/copy.c
index 661b389..94d5d28 100644 (file)
--- a/copy.c
+++ b/copy.c
 #include <ctype.h>
 #include <unistd.h>
 
 #include <ctype.h>
 #include <unistd.h>
 
-#include <lib-lib/macros.h>
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index e196464..118f531 100644 (file)
--- a/dotlock.c
+++ b/dotlock.c
@@ -59,7 +59,7 @@
 extern int snprintf (char *, size_t, const char *, ...);
 # endif
 
 extern int snprintf (char *, size_t, const char *, ...);
 # endif
 
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 
 static int DotlockFlags;
 static int Retry = MAXLOCKATTEMPT;
 
 static int DotlockFlags;
 static int Retry = MAXLOCKATTEMPT;
index f511749..123ce7e 100644 (file)
--- a/editmsg.c
+++ b/editmsg.c
@@ -13,9 +13,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "copy.h"
 
 #include "mutt.h"
 #include "copy.h"
diff --git a/flags.c b/flags.c
index 1babc0d..232508a 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -11,7 +11,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
diff --git a/from.c b/from.c
index 07b9013..f71e8a0 100644 (file)
--- a/from.c
+++ b/from.c
@@ -14,9 +14,7 @@
 #include <ctype.h>
 #include <string.h>
 
 #include <ctype.h>
 #include <string.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 
 
 #include "mutt.h"
 
index f404850..aaca563 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -9,9 +9,7 @@
 #ifndef _GLOBALS_H
 #define _GLOBALS_H
 
 #ifndef _GLOBALS_H
 #define _GLOBALS_H
 
-#include <lib-lib/str.h>
-#include <lib-lib/date.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include "lib/list.h"
 
 
 #include "lib/list.h"
 
index 47cbaca..26d1a99 100644 (file)
--- a/handler.c
+++ b/handler.c
 #include <sys/wait.h>
 #include <sys/stat.h>
 
 #include <sys/wait.h>
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 #include <lib-mime/rfc3676.h>
 
 #include <lib-mime/mime.h>
 #include <lib-mime/rfc3676.h>
index a757415..3902812 100644 (file)
--- a/hcache.c
+++ b/hcache.c
@@ -40,8 +40,7 @@
 #include <sys/time.h>
 #endif
 
 #include <sys/time.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 #include <lib-hash/hash.h>
 
 #include <lib-mime/mime.h>
 #include <lib-hash/hash.h>
 
 #include <lib-mime/mime.h>
index d94019d..058ec94 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -15,9 +15,8 @@
 #include <string.h>
 #include <ctype.h>
 
 #include <string.h>
 #include <ctype.h>
 
-#include <lib-lib/macros.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "alias.h"
 
 #include "mutt.h"
 #include "alias.h"
diff --git a/help.c b/help.c
index a0d85c8..4bd1b01 100644 (file)
--- a/help.c
+++ b/help.c
 #include <ctype.h>
 #include <string.h>
 
 #include <ctype.h>
 #include <string.h>
 
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/str.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 
 
 #include <lib-ui/curses.h>
 
@@ -101,7 +98,7 @@ static int print_macro (FILE * f, int maxwidth, const char **macro)
       wc = CharsetReplacement;
     }
     /* glibc-2.1.3's wcwidth() returns 1 for unprintable chars! */
       wc = CharsetReplacement;
     }
     /* glibc-2.1.3's wcwidth() returns 1 for unprintable chars! */
-    if (IsWPrint (wc) && (w = wcwidth (wc)) >= 0) {
+    if (iswprint(wc) && (w = wcwidth (wc)) >= 0) {
       if (w > n)
         break;
       n -= w;
       if (w > n)
         break;
       n -= w;
diff --git a/hook.c b/hook.c
index aa0d478..0a1084c 100644 (file)
--- a/hook.c
+++ b/hook.c
 #include <ctype.h>
 #include <unistd.h>
 
 #include <ctype.h>
 #include <unistd.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/file.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "alias.h"
 
 #include "mutt.h"
 #include "alias.h"
index d4b4efd..8fae85b 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-
-#include <lib-lib/macros.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "imap_private.h"
 
 #include "mutt.h"
 #include "imap_private.h"
index 16ef189..7ae029f 100644 (file)
@@ -17,7 +17,7 @@
 #include "imap_private.h"
 #include "auth.h"
 
 #include "imap_private.h"
 #include "auth.h"
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 /* this is basically a stripped-down version of the cram-md5 method. */
 imap_auth_res_t imap_auth_anon (IMAP_DATA * idata, const char *method __attribute__ ((unused)))
 
 /* this is basically a stripped-down version of the cram-md5 method. */
 imap_auth_res_t imap_auth_anon (IMAP_DATA * idata, const char *method __attribute__ ((unused)))
index 7728526..9ef4bb8 100644 (file)
@@ -20,7 +20,7 @@
 #define MD5_BLOCK_LEN 64
 #define MD5_DIGEST_LEN 16
 
 #define MD5_BLOCK_LEN 64
 #define MD5_DIGEST_LEN 16
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 #include <lib-hash/hash.h>
 
 /* forward declarations */
 #include <lib-hash/hash.h>
 
 /* forward declarations */
index a014a02..a2783f9 100644 (file)
@@ -15,7 +15,7 @@
 
 #ifdef USE_GSS
 
 
 #ifdef USE_GSS
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <netinet/in.h>
 
 
 #include <netinet/in.h>
 
index f3eaae0..2770331 100644 (file)
@@ -13,7 +13,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "imap_private.h"
 
 #include "mutt.h"
 #include "imap_private.h"
index 8544352..20a39b9 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "mutt_sasl.h"
 #include "imap_private.h"
 #include "auth.h"
 
 
 #include "mutt.h"
 #include "mutt_sasl.h"
 #include "imap_private.h"
 #include "auth.h"
 
-#include <lib-lib/macros.h>
-
 #include <sasl/sasl.h>
 #include <sasl/saslutil.h>
 
 #include <sasl/sasl.h>
 #include <sasl/saslutil.h>
 
index 7cff939..96eb8b9 100644 (file)
 #include <stdlib.h>
 #include <ctype.h>
 
 #include <stdlib.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/enter.h>
 
 
 #include <lib-ui/enter.h>
 
index 53132f7..e53d378 100644 (file)
@@ -16,9 +16,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "message.h"
 
 #include "mutt.h"
 #include "message.h"
index 9f356ba..da965d9 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/buffer.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "mx.h"
 
 #include "mutt.h"
 #include "mx.h"
 #endif
 #include "buffy.h"
 
 #endif
 #include "buffy.h"
 
-#include <lib-lib/macros.h>
-
-#include <unistd.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
 /* imap forward declarations */
 static int imap_get_delim (IMAP_DATA * idata);
 static char *imap_get_flags (string_list_t ** hflags, char *s);
 /* imap forward declarations */
 static int imap_get_delim (IMAP_DATA * idata);
 static char *imap_get_flags (string_list_t ** hflags, char *s);
index 8de66df..466d2dc 100644 (file)
 #include <stdlib.h>
 #include <ctype.h>
 
 #include <stdlib.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/buffer.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 
 
 #include <lib-ui/curses.h>
 
@@ -34,9 +31,6 @@
 #include "pgp.h"
 #endif
 
 #include "pgp.h"
 #endif
 
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-
 #if HAVE_STDINT_H
 #include <stdint.h>
 #elif HAVE_INTTYPES_H
 #if HAVE_STDINT_H
 #include <stdint.h>
 #elif HAVE_INTTYPES_H
index 1c4358f..0ee9d63 100644 (file)
@@ -9,10 +9,7 @@
 
 #include <sys/stat.h>
 
 
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/file.h>
-#include <lib-lib/str.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "imap_private.h"
 
 #include "mutt.h"
 #include "imap_private.h"
@@ -20,8 +17,6 @@
 #include "mx.h"
 #include "mx_imap.h"
 
 #include "mx.h"
 #include "mx_imap.h"
 
-
-
 int imap_is_magic (const char* path, struct stat* st __attribute__ ((unused))) {
   url_scheme_t s;
   if (!path || !*path)
 int imap_is_magic (const char* path, struct stat* st __attribute__ ((unused))) {
   url_scheme_t s;
   if (!path || !*path)
index 08bc14b..d1419e3 100644 (file)
@@ -11,7 +11,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "charset.h"
 
 #include "mutt.h"
 #include "charset.h"
index caf1616..cce8594 100644 (file)
 
 #include "config.h"
 
 
 #include "config.h"
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "mx.h"                 /* for M_IMAP */
 #include "imap_private.h"
 #include <lib-sys/mutt_ssl.h>
 
 
 #include "mutt.h"
 #include "mx.h"                 /* for M_IMAP */
 #include "imap_private.h"
 #include <lib-sys/mutt_ssl.h>
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <stdlib.h>
 #include <ctype.h>
 
 #include <stdlib.h>
 #include <ctype.h>
diff --git a/init.c b/init.c
index a40194d..7e7b455 100644 (file)
--- a/init.c
+++ b/init.c
 #include <errno.h>
 #include <sys/wait.h>
 
 #include <errno.h>
 #include <sys/wait.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/mapping.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 #include <lib-sys/mutt_ssl.h>
 
 #include <lib-sys/unix.h>
 #include <lib-sys/mutt_ssl.h>
@@ -2670,12 +2663,6 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
 
   CurrentMenu = MENU_MAIN;
 
 
   CurrentMenu = MENU_MAIN;
 
-  /* Do we have a locale definition? */
-  if (((p = getenv ("LC_ALL")) != NULL && p[0]) ||
-      ((p = getenv ("LANG")) != NULL && p[0]) ||
-      ((p = getenv ("LC_CTYPE")) != NULL && p[0]))
-    set_option (OPTLOCALES);
-
 #ifdef HAVE_GETSID
   /* Unset suspend by default if we're the session leader */
   if (getsid (0) == getpid ())
 #ifdef HAVE_GETSID
   /* Unset suspend by default if we're the session leader */
   if (getsid (0) == getpid ())
@@ -2684,22 +2671,6 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
 
   mutt_init_history ();
 
 
   mutt_init_history ();
 
-
-
-
-  /*
-   *
-   *                       BIG FAT WARNING
-   *
-   * When changing the code which looks for a configuration file,
-   * please also change the corresponding code in muttbug.sh.in.
-   *
-   *
-   */
-
-
-
-
   if (!Muttrc) {
 #if 0
     snprintf (buffer, sizeof(buffer), "%s/.madmuttrc-%s", NONULL (Homedir),
   if (!Muttrc) {
 #if 0
     snprintf (buffer, sizeof(buffer), "%s/.madmuttrc-%s", NONULL (Homedir),
index 716308a..e80e5a3 100644 (file)
--- a/keymap.c
+++ b/keymap.c
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
@@ -478,7 +473,7 @@ const char *km_keyname(int c)
   }
   else if (c >= KEY_F0 && c < KEY_F (256))      /* this maximum is just a guess */
     sprintf (buf, "<F%d>", c - KEY_F0);
   }
   else if (c >= KEY_F0 && c < KEY_F (256))      /* this maximum is just a guess */
     sprintf (buf, "<F%d>", c - KEY_F0);
-  else if (IsPrint (c))
+  else if (isprint((unsigned char)c))
     snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
   else
     snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c);
     snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
   else
     snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c);
index 4ec7dd3..6ce0b5f 100644 (file)
--- a/keymap.h
+++ b/keymap.h
@@ -10,7 +10,7 @@
 #ifndef KEYMAP_H
 #define KEYMAP_H
 
 #ifndef KEYMAP_H
 #define KEYMAP_H
 
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 /* maximal length of a key binding sequence used for buffer in km_bindkey */
 #define MAX_SEQ 8
 
 /* maximal length of a key binding sequence used for buffer in km_bindkey */
 #define MAX_SEQ 8
index 8cb8341..e6ad538 100644 (file)
 
 #include <gpgme.h>
 
 
 #include <gpgme.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
@@ -3673,7 +3669,7 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
-  tmp = mutt_remove_duplicates (tmp);
+  address_list_uniq(tmp);
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
index 9a43556..eb406f4 100644 (file)
@@ -11,7 +11,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
 
 #include "crypt-mod.h"
 
 
 #include "crypt-mod.h"
 
index 66e9588..36fbcda 100644 (file)
 #  include <sys/resource.h>
 #endif
 
 #  include <sys/resource.h>
 #endif
 
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/mem.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index 151cbad..019a339 100644 (file)
@@ -23,7 +23,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "crypt.h"
 
 #include "mutt.h"
 #include "crypt.h"
index c0c944b..3db2f90 100644 (file)
 #include <time.h>
 #include <ctype.h>
 
 #include <time.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/date.h>
-
+#include <lib-lib/lib-lib.h>
 #include <lib-mime/mime.h>
 #include <lib-mime/mime.h>
+#include <lib-sys/unix.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "pgp.h"
 
 #include "mutt.h"
 #include "pgp.h"
index 408bf33..289ffc8 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
@@ -1103,7 +1099,7 @@ char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc)
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
-  tmp = mutt_remove_duplicates (tmp);
+  address_list_uniq(&tmp);
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
index 08f5d32..3235fae 100644 (file)
 #include <fcntl.h>
 #include <time.h>
 
 #include <fcntl.h>
 #include <time.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
 
 #include <lib-sys/unix.h>
 
index 762842b..76b39b8 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index d9e5ff9..2532db5 100644 (file)
@@ -19,7 +19,7 @@
 #include <unistd.h>
 #include <time.h>
 
 #include <unistd.h>
 #include <time.h>
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "lib.h"
 
 #include "mutt.h"
 #include "lib.h"
index f750e19..a2d89db 100644 (file)
@@ -26,7 +26,8 @@
 #include <string.h>
 #include <ctype.h>
 
 #include <string.h>
 #include <ctype.h>
 
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index 450f8aa..518c11e 100644 (file)
@@ -17,7 +17,7 @@
 #include <unistd.h>
 #include <time.h>
 
 #include <unistd.h>
 #include <time.h>
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
 #include <lib-hash/hash.h>
 
 #include "lib.h"
 #include <lib-hash/hash.h>
 
 #include "lib.h"
index f96b31d..7932525 100644 (file)
 #  include <sys/resource.h>
 #endif
 
 #  include <sys/resource.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
@@ -756,7 +753,7 @@ char *smime_findKeys (address_t * to, address_t * cc, address_t * bcc)
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
-  tmp = mutt_remove_duplicates (tmp);
+  address_list_uniq(&tmp);
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
index c93a18a..d605e34 100644 (file)
@@ -1,12 +1,14 @@
 noinst_LIBRARIES = liblib.a
 
 noinst_LIBRARIES = liblib.a
 
-liblib_a_SOURCES = mem.h str.h ascii.h buffer.h hash.h list.h file.h mapping.h \
-                         str.c ascii.c buffer.c hash.c list.c file.c mapping.c \
+liblib_a_SOURCES = lib-lib.h mem.h macros.h \
+                  str.h ascii.h buffer.h hash.h list.h file.h mapping.h \
+                   str.c ascii.c buffer.c hash.c list.c file.c mapping.c \
                   \
                   date.h rx.h url.h                                   \
                   date.c rx.c url.c
 
                   \
                   date.h rx.h url.h                                   \
                   date.c rx.c url.c
 
-noinst_HEADERS   = mem.h str.h ascii.h buffer.h hash.h list.h file.h mapping.h \
+noinst_HEADERS   = lib-lib.h mem.h macros.h \
+                  str.h ascii.h buffer.h hash.h list.h file.h mapping.h \
                   date.h rx.h url.h
 
 -include ../cflags.mk
                   date.h rx.h url.h
 
 -include ../cflags.mk
index 0a506bb..e1327c8 100644 (file)
@@ -36,8 +36,6 @@
 #include "buffer.h"
 #include "file.h"
 
 #include "buffer.h"
 #include "file.h"
 
-#include "mutt.h"
-
 /*
  * Creates and initializes a BUFFER*. If passed an existing BUFFER*,
  * just initializes. Frees anything already in the buffer.
 /*
  * Creates and initializes a BUFFER*. If passed an existing BUFFER*,
  * just initializes. Frees anything already in the buffer.
@@ -101,184 +99,3 @@ void mutt_buffer_add(BUFFER *buf, const char *s, ssize_t len)
     *buf->dptr = '\0';
 }
 
     *buf->dptr = '\0';
 }
 
-int mutt_extract_token(BUFFER *dest, BUFFER *tok, int flags)
-{
-    char ch;
-    char qc = 0;                  /* quote char */
-    char *pc;
-
-    /* reset the destination pointer to the beginning of the buffer */
-    dest->dptr = dest->data;
-
-    tok->dptr = vskipspaces(tok->dptr);
-    while ((ch = *tok->dptr)) {
-        if (!qc) {
-            if ((ISSPACE(ch) && !(flags & M_TOKEN_SPACE))
-            || (ch == '#' && !(flags & M_TOKEN_COMMENT))
-            || (ch == '=' && (flags & M_TOKEN_EQUAL))
-            || (ch == ';' && !(flags & M_TOKEN_SEMICOLON))
-            || ((flags & M_TOKEN_PATTERN) && strchr("~=!|", ch)))
-            {
-                break;
-            }
-        }
-
-        tok->dptr++;
-
-        if (ch == qc) {
-            qc = 0;                     /* end of quote */
-        } else
-        if (!qc && (ch == '\'' || ch == '"') && !(flags & M_TOKEN_QUOTE)) {
-            qc = ch;
-        } else
-        if (ch == '\\' && qc != '\'') {
-            if (!*tok->dptr)
-                return -1;              /* premature end of token */
-
-            switch (ch = *tok->dptr++) {
-              case 'c':
-              case 'C':
-                if (!*tok->dptr)
-                    return -1;          /* premature end of token */
-                mutt_buffer_addch(dest,
-                                  (ascii_toupper(*tok->dptr) - 'A' + 1) & 0x7f);
-                tok->dptr++;
-                break;
-              case 'r':
-                mutt_buffer_addch(dest, '\r');
-                break;
-              case 'n':
-                mutt_buffer_addch(dest, '\n');
-                break;
-              case 't':
-                mutt_buffer_addch(dest, '\t');
-                break;
-              case 'f':
-                mutt_buffer_addch(dest, '\f');
-                break;
-              case 'e':
-                mutt_buffer_addch(dest, '\033');
-                break;
-              default:
-                if (isdigit((unsigned char)ch)
-                &&  isdigit((unsigned char)*tok->dptr)
-                &&  isdigit((unsigned char)*(tok->dptr + 1)))
-                {
-                    mutt_buffer_addch(dest, (ch << 6) + (*tok->dptr << 3) +
-                                            *(tok->dptr + 1) - 3504);
-                    tok->dptr += 2;
-                } else {
-                    mutt_buffer_addch(dest, ch);
-                }
-            }
-        } else
-        if (ch == '^' && (flags & M_TOKEN_CONDENSE)) {
-            if (!*tok->dptr)
-                return -1;              /* premature end of token */
-            ch = *tok->dptr++;
-            if (ch == '^') {
-                mutt_buffer_addch(dest, ch);
-            } else
-            if (ch == '[') {
-                mutt_buffer_addch(dest, '\033');
-            } else
-            if (isalpha((unsigned char)ch)) {
-                mutt_buffer_addch(dest, ascii_toupper(ch) - 'A' + 1);
-            } else {
-                mutt_buffer_addch(dest, '^');
-                mutt_buffer_addch(dest, ch);
-            }
-        } else
-        if (ch == '`' && (!qc || qc == '"')) {
-            FILE *fp;
-            pid_t pid;
-            char *cmd, *ptr;
-            ssize_t expnlen;
-            BUFFER expn;
-            int line = 0;
-
-            pc = tok->dptr;
-            do {
-                if ((pc = strpbrk(pc, "\\`"))) {
-                    /* skip any quoted chars */
-                    if (*pc == '\\')
-                        pc += 2;
-                }
-            } while (pc && *pc != '`');
-            if (!pc) {
-                return (-1);
-            }
-
-            cmd = p_dupstr(tok->dptr, pc - tok->dptr);
-            if ((pid = mutt_create_filter(cmd, NULL, &fp, NULL)) < 0) {
-                p_delete(&cmd);
-                return -1;
-            }
-            p_delete(&cmd);
-
-            tok->dptr = pc + 1;
-
-            /* read line */
-            p_clear(&expn, 1);
-            expn.data = mutt_read_line(NULL, &expn.dsize, fp, &line);
-            fclose(fp);
-            mutt_wait_filter(pid);
-
-            /* if we got output, make a new string consiting of the shell ouptput
-               plus whatever else was left on the original line */
-            /* BUT: If this is inside a quoted string, directly add output to 
-             * the token */
-            if (expn.data && qc) {
-                mutt_buffer_addstr(dest, expn.data);
-                p_delete(&expn.data);
-            } else
-            if (expn.data) {
-                expnlen = m_strlen(expn.data);
-                tok->dsize = expnlen + m_strlen(tok->dptr) + 1;
-                ptr = xmalloc(tok->dsize);
-                memcpy(ptr, expn.data, expnlen);
-                strcpy(ptr + expnlen, tok->dptr);      /* __STRCPY_CHECKED__ */
-                if (tok->destroy)
-                    p_delete(&tok->data);
-                tok->data = ptr;
-                tok->dptr = ptr;
-                tok->destroy = 1;       /* mark that the caller should destroy this data */
-                ptr = NULL;
-                p_delete(&expn.data);
-            }
-        } else
-        if (ch == '$' && (!qc || qc == '"')
-        && (*tok->dptr == '{' || isalpha((unsigned char)*tok->dptr)))
-        {
-            char *env = NULL, *var = NULL;
-
-            if (*tok->dptr == '{') {
-                tok->dptr++;
-                if ((pc = strchr (tok->dptr, '}'))) {
-                    var = p_dupstr(tok->dptr, pc - tok->dptr);
-                    tok->dptr = pc + 1;
-                }
-            } else {
-                for (pc = tok->dptr; isalnum((unsigned char)*pc) || *pc == '_';
-                     pc++);
-                var = p_dupstr(tok->dptr, pc - tok->dptr);
-                tok->dptr = pc;
-            }
-            if (var) {
-                char tmp[STRING];
-                if ((env = getenv (var))
-                || (mutt_option_value (var, tmp, sizeof (tmp)) && (env = tmp)))
-                {
-                    mutt_buffer_addstr (dest, env);
-                }
-            }
-            p_delete(&var);
-        } else {
-            mutt_buffer_addch(dest, ch);
-        }
-    }
-    mutt_buffer_addch(dest, 0);  /* terminate the string */
-    tok->dptr = vskipspaces(tok->dptr);
-    return 0;
-}
-
index 0fc562d..f459618 100644 (file)
 #ifndef MUTT_LIB_LIB_BUFFER_H
 #define MUTT_LIB_LIB_BUFFER_H
 
 #ifndef MUTT_LIB_LIB_BUFFER_H
 #define MUTT_LIB_LIB_BUFFER_H
 
-#include <lib-lib/str.h>
-
-/* flags for mutt_extract_token() */
-#define M_TOKEN_EQUAL          1       /* treat '=' as a special */
-#define M_TOKEN_CONDENSE       (1<<1)  /* ^(char) to control chars (macros) */
-#define M_TOKEN_SPACE          (1<<2)  /* don't treat whitespace as a term */
-#define M_TOKEN_QUOTE          (1<<3)  /* don't interpret quotes */
-#define M_TOKEN_PATTERN                (1<<4)  /* !)|~ are terms (for patterns) */
-#define M_TOKEN_COMMENT                (1<<5)  /* don't reap comments */
-#define M_TOKEN_SEMICOLON      (1<<6)  /* don't treat ; as special */
-
+#include "str.h"
 
 typedef struct {
     char *data;          /* pointer to data */
 
 typedef struct {
     char *data;          /* pointer to data */
@@ -52,8 +42,6 @@ BUFFER *mutt_buffer_init(BUFFER *);
 void mutt_buffer_free(BUFFER **);
 
 BUFFER *mutt_buffer_from(BUFFER *, const char *);
 void mutt_buffer_free(BUFFER **);
 
 BUFFER *mutt_buffer_from(BUFFER *, const char *);
-int mutt_extract_token(BUFFER *, BUFFER *, int);
-
 void mutt_buffer_add(BUFFER *, const char *, ssize_t);
 static inline void mutt_buffer_addstr(BUFFER *b, const char *s) {
     mutt_buffer_add(b, s, m_strlen(s));
 void mutt_buffer_add(BUFFER *, const char *, ssize_t);
 static inline void mutt_buffer_addstr(BUFFER *b, const char *s) {
     mutt_buffer_add(b, s, m_strlen(s));
diff --git a/lib-lib/lib-lib.h b/lib-lib/lib-lib.h
new file mode 100644 (file)
index 0000000..5f8974d
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *  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
+ */
+
+#ifndef MUTT_LIB_LIB_LIB_LIB_H
+#define MUTT_LIB_LIB_LIB_LIB_H
+
+#include "macros.h"
+#include "mem.h"
+
+#include "ascii.h"
+#include "buffer.h"
+#include "date.h"
+#include "file.h"
+#include "hash.h"
+#include "list.h"
+#include "mapping.h"
+#include "rx.h"
+#include "str.h"
+#include "url.h"
+
+#endif
index 975ed52..f2b6720 100644 (file)
@@ -26,9 +26,7 @@
 #include "config.h"
 #endif
 
 #include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 rx_t *rx_compile(const char *s, int flags)
 {
 
 rx_t *rx_compile(const char *s, int flags)
 {
index afc444b..a5ee410 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
+#include <stdio.h>
 #include <ctype.h>
 
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/mapping.h>
-#include <lib-lib/url.h>
-
-#include <lib-mime/mime.h>
-
-#include "mutt.h"
+#include <lib-lib/lib-lib.h>
 
 static struct mapping_t UrlMap[] = {
     {"file",   U_FILE},
 
 static struct mapping_t UrlMap[] = {
     {"file",   U_FILE},
index d0d3235..919c3bb 100644 (file)
@@ -30,8 +30,7 @@
  * please see the file GPL in the top level source directory.
  */
 
  * please see the file GPL in the top level source directory.
  */
 
-#include <lib-lib/macros.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-crypt/crypt.h>
 
 
 #include <lib-crypt/crypt.h>
 
index 9a32717..689f81b 100644 (file)
@@ -30,9 +30,7 @@
 #ifndef MUTT_LIB_MIME_MIME_TYPES_H
 #define MUTT_LIB_MIME_MIME_TYPES_H
 
 #ifndef MUTT_LIB_MIME_MIME_TYPES_H
 #define MUTT_LIB_MIME_MIME_TYPES_H
 
-#include <lib-lib/mem.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/list.h>
+#include <lib-lib/lib-lib.h>
 
 /* Content-Type */
 enum {
 
 /* Content-Type */
 enum {
index 4353e4d..dc50d2d 100644 (file)
@@ -22,8 +22,7 @@
  * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
  */
 
  * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
  */
 
-#include <lib-lib/ascii.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mime.h"
 
 
 #include "mime.h"
 
index 45002f4..74530cf 100644 (file)
@@ -113,12 +113,15 @@ int mutt_is_multipart_signed(BODY *);
 int mutt_is_application_pgp(BODY *);
 int mutt_is_application_smime(BODY *);
 int mutt_is_text_part(BODY *);
 int mutt_is_application_pgp(BODY *);
 int mutt_is_application_smime(BODY *);
 int mutt_is_text_part(BODY *);
+time_t mutt_parse_date(const char *, HEADER *);
 
 /*** addresses ***/
 
 address_t *mutt_parse_adrlist(address_t *, const char *);
 address_t *address_dup(const address_t *addr);
 address_t *address_list_dup(const address_t *addr);
 
 /*** addresses ***/
 
 address_t *mutt_parse_adrlist(address_t *, const char *);
 address_t *address_dup(const address_t *addr);
 address_t *address_list_dup(const address_t *addr);
+
+void address_list_uniq(address_t *);
 void rfc822_qualify(address_t *, const char *);
 
 address_t *rfc822_parse_adrlist(address_t *, const char *s);
 void rfc822_qualify(address_t *, const char *);
 
 address_t *rfc822_parse_adrlist(address_t *, const char *s);
index 6c4f2e5..de7ec11 100644 (file)
 #include <errno.h>
 #include <unistd.h>
 
 #include <errno.h>
 #include <unistd.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
 
 #include <lib-sys/unix.h>
 
index 71bf5c7..5b68921 100644 (file)
@@ -27,9 +27,7 @@
  * please see the file GPL in the top level source directory.
  */
 
  * please see the file GPL in the top level source directory.
  */
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
@@ -564,7 +562,7 @@ static int rfc2047_encode(const char *d, ssize_t dlen, int col,
 }
 
 
 }
 
 
-void _rfc2047_encode_string(char **pd, int encode_specials, int col)
+static void _rfc2047_encode_string(char **pd, int encode_specials, int col)
 {
     char *e;
     ssize_t elen;
 {
     char *e;
     ssize_t elen;
index 206f505..6bbd39a 100644 (file)
@@ -40,9 +40,7 @@
 #include <string.h>
 #include <stdlib.h>
 
 #include <string.h>
 #include <stdlib.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index 1fdcf0d..1868091 100644 (file)
 #include <sys/wait.h>
 #include <sys/stat.h>
 
 #include <sys/wait.h>
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 
 #include "state.h"
 
 #include <lib-ui/curses.h>
 
 #include "state.h"
+#include "rfc3676.h"
 
 #define FLOWED_MAX 77
 
 
 #define FLOWED_MAX 77
 
index a76fd25..cf88c95 100644 (file)
 #include <ctype.h>
 #include <stdlib.h>
 
 #include <ctype.h>
 #include <stdlib.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt_idna.h"
 
 
 #include "mutt_idna.h"
 
@@ -73,6 +70,26 @@ address_t *address_list_dup(const address_t *addr)
     return res;
 }
 
     return res;
 }
 
+/* given a list of addresses, return a list of unique addresses */
+void address_list_uniq(address_t *a)
+{
+    for (; a; a = a->next) {
+        address_t **b = &a->next;
+
+        if (!a->mailbox)
+            continue;
+
+        while (*b) {
+            if ((*b)->mailbox && !ascii_strcasecmp((*b)->mailbox, a->mailbox))
+            {
+                address_t *pop = address_list_pop(b);
+                address_delete(&pop);
+            } else {
+                b = &(*b)->next;
+            }
+        }
+    }
+}
 
 /****************************************************************************/
 /* Parsing functions                                                        */
 
 /****************************************************************************/
 /* Parsing functions                                                        */
@@ -242,7 +259,7 @@ parse_address(const char *s, static_buf *comment, address_t *cur)
     return s;
 }
 
     return s;
 }
 
-address_t **rfc822_eotoken(address_t **last, static_buf *phrase, static_buf *comment)
+static address_t **rfc822_eotoken(address_t **last, static_buf *phrase, static_buf *comment)
 {
     if (phrase->len) {
         const char *s;
 {
     if (phrase->len) {
         const char *s;
index 33012fd..e399bb7 100644 (file)
 
 #include <stdio.h>
 
 
 #include <stdio.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/date.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include "recvattach.h"
 
 
 #include "recvattach.h"
 
index 0b4e499..01a23e5 100644 (file)
@@ -37,7 +37,7 @@
 #define EX_OK 0
 #endif
 
 #define EX_OK 0
 #endif
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
 
 #include "exit.h"
 
 
 #include "exit.h"
 
index 193b2ad..e324a94 100644 (file)
@@ -16,6 +16,8 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
+#include <lib-lib/lib-lib.h>
+
 #include "mutt_signal.h"
 #include "unix.h"
 
 #include "mutt_signal.h"
 #include "unix.h"
 
@@ -152,3 +154,31 @@ int mutt_wait_filter (pid_t pid)
 
   return rc;
 }
 
   return rc;
 }
+
+/* This function allows the user to specify a command to read stdout from in
+   place of a normal file.  If the last character in the string is a pipe (|),
+   then we assume it is a commmand to run instead of a normal file. */
+FILE *mutt_open_read (const char *path, pid_t * thepid)
+{
+    int len = m_strlen(path);
+    FILE *f;
+
+    if (path[len - 1] == '|') {
+        char *s = m_strdup(path);
+
+        /* read from a pipe */
+
+        s[len - 1] = 0;
+        mutt_endwin (NULL);
+        *thepid = mutt_create_filter (s, NULL, &f, NULL);
+        p_delete(&s);
+    } else {
+        f = fopen (path, "r");
+        if (!f)
+            return NULL;
+        *thepid = -1;
+    }
+
+    return (f);
+}
+
index 159612b..55b3f02 100644 (file)
@@ -16,7 +16,7 @@
 #include <sys/wait.h>
 #include <errno.h>
 
 #include <sys/wait.h>
 #include <errno.h>
 
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 
 
 #include <lib-ui/curses.h>
 
index 0218610..f6319f0 100644 (file)
@@ -23,9 +23,8 @@
 #include <string.h>
 #include <errno.h>
 
 #include <string.h>
 #include <errno.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "globals.h"
 
 #include "mutt.h"
 #include "globals.h"
index bfb09a8..1557a8f 100644 (file)
@@ -20,9 +20,7 @@
 
 #include <string.h>
 
 
 #include <string.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
index 37248b8..7fc5eda 100644 (file)
 #include <gnutls/openssl.h>
 #endif
 
 #include <gnutls/openssl.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
index f180f38..4d58591 100644 (file)
@@ -19,9 +19,8 @@
 #include <fcntl.h>
 #include <errno.h>
 
 #include <fcntl.h>
 #include <errno.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 
 
 #include "mutt.h"
 
index a83d4bc..30a75dc 100644 (file)
 #include <sys/wait.h>
 #include <unistd.h>
 
 #include <sys/wait.h>
 #include <unistd.h>
 
-#include <lib-lib/macros.h>
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include "unix.h"
 #include "mutt_signal.h"
 
 #include "unix.h"
 #include "mutt_signal.h"
index e392c4e..5e1b618 100644 (file)
@@ -23,7 +23,7 @@
 #include <sys/types.h>
 #include <pwd.h>
 
 #include <sys/types.h>
 #include <pwd.h>
 
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 ssize_t mutt_gecos_name(char *dst, ssize_t n, struct passwd *pw, regex_t *rx);
 int getdnsdomainname(char *, ssize_t);
 
 ssize_t mutt_gecos_name(char *dst, ssize_t n, struct passwd *pw, regex_t *rx);
 int getdnsdomainname(char *, ssize_t);
@@ -40,5 +40,6 @@ pid_t mutt_create_filter_fd (const char *, FILE **, FILE **, FILE **, int,
                              int, int);
 int mutt_wait_filter (pid_t);
 
                              int, int);
 int mutt_wait_filter (pid_t);
 
+FILE *mutt_open_read (const char *, pid_t *);
 
 #endif /* MUTT_LIB_SYS_UNIX_H */
 
 #endif /* MUTT_LIB_SYS_UNIX_H */
index ca0ab98..ff90ff1 100644 (file)
 #include <stdlib.h>
 #include <ctype.h>
 
 #include <stdlib.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include "curses.h"
 
 
 #include "curses.h"
 
index 2ad60ac..06e70c3 100644 (file)
@@ -17,8 +17,7 @@
 #include <sys/stat.h>
 #include <errno.h>
 
 #include <sys/stat.h>
 #include <errno.h>
 
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "mx.h"
 
 #include "mutt.h"
 #include "mx.h"
index 125e5ca..de14e59 100644 (file)
 #include <langinfo.h>
 #endif
 
 #include <langinfo.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 #include <lib-sys/mutt_signal.h>
 
 #include <lib-sys/unix.h>
 #include <lib-sys/mutt_signal.h>
@@ -599,7 +596,7 @@ void mutt_format_string (char *dest, ssize_t destlen,
     if (arboreal && wc < M_TREE_MAX)
       w = 1;                    /* hack */
     else {
     if (arboreal && wc < M_TREE_MAX)
       w = 1;                    /* hack */
     else {
-      if (!IsWPrint (wc))
+      if (!iswprint(wc))
         wc = '?';
       w = wcwidth (wc);
     }
         wc = '?';
       w = wcwidth (wc);
     }
@@ -691,7 +688,7 @@ void mutt_paddstr (int n, const char *s)
       k = (k == -1) ? 1 : len;
       wc = CharsetReplacement;
     }
       k = (k == -1) ? 1 : len;
       wc = CharsetReplacement;
     }
-    if (!IsWPrint (wc))
+    if (!iswprint(wc))
       wc = '?';
     w = wcwidth (wc);
     if (w >= 0) {
       wc = '?';
     w = wcwidth (wc);
     if (w >= 0) {
@@ -728,7 +725,7 @@ int mutt_strwidth (const char *s)
       k = (k == -1) ? 1 : n;
       wc = CharsetReplacement;
     }
       k = (k == -1) ? 1 : n;
       wc = CharsetReplacement;
     }
-    if (!IsWPrint (wc))
+    if (!iswprint(wc))
       wc = '?';
     w += wcwidth (wc);
   }
       wc = '?';
     w += wcwidth (wc);
   }
index 3fd1fb3..5edd752 100644 (file)
 #include <sys/stat.h>
 #include <errno.h>
 
 #include <sys/stat.h>
 #include <errno.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/sidebar.h>
 
 
 #include <lib-ui/sidebar.h>
 
index 6a33540..c468446 100644 (file)
@@ -145,6 +145,46 @@ typedef struct {
 } progress_t;
 
 void mutt_progress_bar (progress_t* progress, long pos);
 } progress_t;
 
 void mutt_progress_bar (progress_t* progress, long pos);
+void mutt_clear_error (void);
+void mutt_edit_file (const char *, const char *);
+void mutt_curses_error (const char *, ...);
+void mutt_curses_message (const char *, ...);
+void mutt_format_string (char *, ssize_t, int, int, int, char, const char *,
+                         ssize_t, int);
+void mutt_format_s (char *, ssize_t, const char *, const char *);
+void mutt_format_s_tree (char *, ssize_t, const char *, const char *);
+void mutt_free_color (int fg, int bg);
+void mutt_paddstr (int, const char *);
+#define mutt_perror(a) _mutt_perror (a, __FILE__, __LINE__)
+void _mutt_perror (const char*, const char*,int);
+void mutt_query_exit (void);
+void mutt_query_menu (char *, ssize_t);
+void mutt_show_error (void);
+
+int mutt_addwch (wchar_t);
+int mutt_alloc_color (int fg, int bg);
+int mutt_any_key_to_continue (const char *);
+int mutt_complete (char *, ssize_t);
+#define mutt_enter_fname(A,B,C,D,E) _mutt_enter_fname(A,B,C,D,E,0,NULL,NULL)
+int _mutt_enter_fname (const char *, char *, ssize_t, int *, int, int,
+                       char ***, int *);
+
+#define mutt_get_field(A,B,C,D) _mutt_get_field(A,B,C,D,0,NULL,NULL)
+int _mutt_get_field (const char *, char *, ssize_t, int, int, char ***, int *);
+int mutt_get_field_unbuffered (char *, char *, ssize_t, int);
+int mutt_index_menu (void);
+int mutt_is_mail_list (address_t *);
+int mutt_is_subscribed_list (address_t *);
+int mutt_multi_choice (char *prompt, char *letters);
+int mutt_parse_color (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+int mutt_parse_uncolor (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+int mutt_parse_unmono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+int mutt_query_complete (char *, ssize_t);
+int mutt_strwidth (const char *);
+int mutt_user_is_recipient (HEADER *);
+int mutt_yesorno (const char *, int);
+void mutt_set_header_color (CONTEXT *, HEADER *);
 
 extern int *ColorQuote;
 extern int ColorQuoteUsed;
 
 extern int *ColorQuote;
 extern int ColorQuoteUsed;
@@ -156,6 +196,11 @@ extern COLOR_LINE *ColorIndexList;
 void ci_init_color (void);
 void ci_start_color (void);
 
 void ci_init_color (void);
 void ci_start_color (void);
 
+#define mutt_make_string(A,B,C,D,E) _mutt_make_string(A,B,C,D,E,0)
+void _mutt_make_string (char *, ssize_t, const char *, CONTEXT *,
+                        HEADER *, format_flag);
+
+
 #define SETCOLOR(X) attrset(ColorDefs[X])
 #define ADDCOLOR(X) attron(ColorDefs[X])
 
 #define SETCOLOR(X) attrset(ColorDefs[X])
 #define ADDCOLOR(X) attron(ColorDefs[X])
 
index d6707a6..39e0100 100644 (file)
@@ -15,7 +15,7 @@
 #include <wctype.h>
 #include <wchar.h>
 
 #include <wctype.h>
 #include <wchar.h>
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
 
 #include "curses.h"
 #include "enter.h"
 
 #include "curses.h"
 #include "enter.h"
@@ -37,7 +37,7 @@ static int my_wcwidth (wchar_t wc)
 {
   int n = wcwidth (wc);
 
 {
   int n = wcwidth (wc);
 
-  if (IsWPrint (wc) && n > 0)
+  if (iswprint(wc) && n > 0)
     return n;
   if (!(wc & ~0x7f))
     return 2;
     return n;
   if (!(wc & ~0x7f))
     return 2;
@@ -47,7 +47,7 @@ static int my_wcwidth (wchar_t wc)
 }
 
 /* combining mark / non-spacing character */
 }
 
 /* combining mark / non-spacing character */
-#define COMB_CHAR(wc) (IsWPrint (wc) && !wcwidth (wc))
+#define COMB_CHAR(wc) (iswprint(wc) && !wcwidth(wc))
 
 static int my_wcswidth (const wchar_t * s, size_t n)
 {
 
 static int my_wcswidth (const wchar_t * s, size_t n)
 {
@@ -62,7 +62,7 @@ static int my_addwch (wchar_t wc)
 {
   int n = wcwidth (wc);
 
 {
   int n = wcwidth (wc);
 
-  if (IsWPrint (wc) && n > 0)
+  if (iswprint(wc) && n > 0)
     return mutt_addwch (wc);
   if (!(wc & ~0x7f))
     return printw ("^%c", ((int) wc + 0x40) & 0x7f);
     return mutt_addwch (wc);
   if (!(wc & ~0x7f))
     return printw ("^%c", ((int) wc + 0x40) & 0x7f);
@@ -625,7 +625,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
 
       if (first && (flags & M_CLEAR)) {
         first = 0;
 
       if (first && (flags & M_CLEAR)) {
         first = 0;
-        if (IsWPrint (wc))      /* why? */
+        if (iswprint(wc))      /* why? */
           state->curpos = state->lastchar = 0;
       }
 
           state->curpos = state->lastchar = 0;
       }
 
@@ -647,7 +647,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
         rv = 0;
         goto bye;
       }
         rv = 0;
         goto bye;
       }
-      else if (wc && (wc < ' ' || IsWPrint (wc))) {     /* why? */
+      else if (wc && (wc < ' ' || iswprint(wc))) {     /* why? */
         if (state->lastchar >= state->wbuflen) {
           state->wbuflen = state->lastchar + 20;
           p_realloc(&state->wbuf, state->wbuflen);
         if (state->lastchar >= state->wbuflen) {
           state->wbuflen = state->lastchar + 20;
           p_realloc(&state->wbuf, state->wbuflen);
index 2bc1bed..5797c22 100644 (file)
@@ -16,8 +16,7 @@
 #include <string.h>
 #include <locale.h>
 
 #include <string.h>
 #include <locale.h>
 
-#include <lib-lib/rx.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index 92bdb9f..a50c00c 100644 (file)
@@ -11,7 +11,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "history.h"
 
 #include "mutt.h"
 #include "history.h"
index 4e99047..b125d3c 100644 (file)
@@ -15,9 +15,7 @@
 #include <stdlib.h>
 #include <wchar.h>
 
 #include <stdlib.h>
 #include <wchar.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "curses.h"
 #include "enter.h"
 
 #include "curses.h"
 #include "enter.h"
index d90ec4f..7c27264 100644 (file)
@@ -12,7 +12,7 @@
  * This file is named mutt_menu.h so it doesn't collide with ncurses menu.h
  */
 
  * This file is named mutt_menu.h so it doesn't collide with ncurses menu.h
  */
 
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include "keymap.h"
 
 
 #include "keymap.h"
 
index 2a60afa..11fa388 100644 (file)
 #include <stdlib.h>
 #include <ctype.h>
 
 #include <stdlib.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-sys/unix.h>
 
 #include <lib-ui/menu.h>
 
 #include <lib-ui/menu.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "alias.h"
 
 #include "mutt.h"
 #include "alias.h"
@@ -350,7 +348,7 @@ static void query_menu (char *buf, ssize_t buflen, QUERY * results, int retbuf)
                 QueryTable[i].data = queryp;
             }
             else {
                 QueryTable[i].data = queryp;
             }
             else {
-              int clear = 0;
+              int doclear = 0;
 
               /* append */
               p_realloc(&QueryTable, menu->max);
 
               /* append */
               p_realloc(&QueryTable, menu->max);
@@ -361,10 +359,10 @@ static void query_menu (char *buf, ssize_t buflen, QUERY * results, int retbuf)
                    queryp = queryp->next, i++) {
                 /* once we hit new entries, clear/init the tag */
                 if (queryp == newresults)
                    queryp = queryp->next, i++) {
                 /* once we hit new entries, clear/init the tag */
                 if (queryp == newresults)
-                  clear = 1;
+                  doclear = 1;
 
                 QueryTable[i].data = queryp;
 
                 QueryTable[i].data = queryp;
-                if (clear)
+                if (doclear)
                   QueryTable[i].tagged = 0;
               }
             }
                   QueryTable[i].tagged = 0;
               }
             }
index a216d69..1a45558 100644 (file)
@@ -15,9 +15,7 @@
 #include <libgen.h>
 #include <ctype.h>
 
 #include <libgen.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
index 1f756a5..0f918fd 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
index 7ef6e6c..c3c9952 100644 (file)
@@ -10,8 +10,7 @@
 #include <stddef.h>
 #include <string.h>
 
 #include <stddef.h>
 #include <string.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 
 #include "list.h"
 
 
 #include "list.h"
 
diff --git a/main.c b/main.c
index eace540..e097503 100644 (file)
--- a/main.c
+++ b/main.c
 #include <sys/stat.h>
 #include <sys/utsname.h>
 
 #include <sys/stat.h>
 #include <sys/utsname.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/mutt_signal.h>
 
 
 #include <lib-sys/mutt_signal.h>
 
index 3844569..0363a46 100644 (file)
--- a/makedoc.c
+++ b/makedoc.c
@@ -31,7 +31,7 @@
 #include <ctype.h>
 
 #include <errno.h>
 #include <ctype.h>
 
 #include <errno.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
diff --git a/mbox.c b/mbox.c
index 8b5b577..d4125b0 100644 (file)
--- a/mbox.c
+++ b/mbox.c
 #include <unistd.h>
 #include <fcntl.h>
 
 #include <unistd.h>
 #include <fcntl.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include <lib-sys/mutt_signal.h>
 
 
 #include <lib-sys/mutt_signal.h>
 
diff --git a/mh.c b/mh.c
index 3df675b..e03762a 100644 (file)
--- a/mh.c
+++ b/mh.c
 #include <sys/time.h>
 #endif
 
 #include <sys/time.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "mx.h"
 
 #include "mutt.h"
 #include "mx.h"
@@ -263,7 +261,7 @@ static void mhs_write_one_sequence (FILE * fp, struct mh_sequences *mhs,
 
 /* XXX - we don't currently remove deleted messages from sequences we don't know.  Should we? */
 
 
 /* XXX - we don't currently remove deleted messages from sequences we don't know.  Should we? */
 
-void mh_update_sequences (CONTEXT * ctx)
+static void mh_update_sequences (CONTEXT * ctx)
 {
   FILE *ofp, *nfp;
 
 {
   FILE *ofp, *nfp;
 
@@ -757,7 +755,7 @@ static ssize_t maildir_hcache_keylen (const char *fn)
  * This function does the second parsing pass for a maildir-style
  * folder.
  */
  * This function does the second parsing pass for a maildir-style
  * folder.
  */
-void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
+static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
 {
   struct maildir *p;
   char fn[_POSIX_PATH_MAX];
 {
   struct maildir *p;
   char fn[_POSIX_PATH_MAX];
@@ -882,7 +880,7 @@ static int mh_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr __at
   return mh_mkstemp (dest, &msg->fp, &msg->path);
 }
 
   return mh_mkstemp (dest, &msg->fp, &msg->path);
 }
 
-int ch_compar (const void *a, const void *b)
+static int ch_compar (const void *a, const void *b)
 {
   return (int) (*((const char *) a) - *((const char *) b));
 }
 {
   return (int) (*((const char *) a) - *((const char *) b));
 }
@@ -1686,8 +1684,8 @@ static int mh_check_mailbox (CONTEXT * ctx, int *index_hint, int unused __attrib
  * then again, it's called rarely.
  */
 
  * then again, it's called rarely.
  */
 
-FILE *_maildir_open_find_message (const char *folder, const char *unique,
-                                  const char *subfolder)
+static FILE *_maildir_open_find_message (const char *folder, const char *unique,
+                                         const char *subfolder)
 {
   char dir[_POSIX_PATH_MAX];
   char tunique[_POSIX_PATH_MAX];
 {
   char dir[_POSIX_PATH_MAX];
   char tunique[_POSIX_PATH_MAX];
@@ -1803,7 +1801,7 @@ static int maildir_check_empty (const char *path)
  * 0 if there are messages in the mailbox
  * -1 on error
  */
  * 0 if there are messages in the mailbox
  * -1 on error
  */
-int mh_check_empty (const char *path)
+static int mh_check_empty (const char *path)
 {
   DIR *dp;
   struct dirent *de;
 {
   DIR *dp;
   struct dirent *de;
diff --git a/mh.h b/mh.h
index 65f8247..a6b12eb 100644 (file)
--- a/mh.h
+++ b/mh.h
@@ -23,6 +23,7 @@
 
 int mh_buffy (const char *);
 FILE *maildir_open_find_message (const char *, const char *);
 
 int mh_buffy (const char *);
 FILE *maildir_open_find_message (const char *, const char *);
+int mh_valid_message (const char *);
 
 /* these are the only publicly visible for usage */
 
 
 /* these are the only publicly visible for usage */
 
diff --git a/mutt.h b/mutt.h
index 0e2b285..5931f2f 100644 (file)
--- a/mutt.h
+++ b/mutt.h
 #include <posix1_lim.h>
 #endif
 
 #include <posix1_lim.h>
 #endif
 
-#include <lib-lib/buffer.h>
-#include <lib-lib/hash.h>
-#include <lib-lib/list.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
@@ -431,7 +428,6 @@ enum {
 
   OPTAUXSORT,                   /* (pseudo) using auxillary sort function */
   OPTFORCEREFRESH,              /* (pseudo) refresh even during macros */
 
   OPTAUXSORT,                   /* (pseudo) using auxillary sort function */
   OPTFORCEREFRESH,              /* (pseudo) refresh even during macros */
-  OPTLOCALES,                   /* (pseudo) set if user has valid locale definition */
   OPTNOCURSES,                  /* (pseudo) when sending in batch mode */
   OPTNEEDREDRAW,                /* (pseudo) to notify caller of a submenu */
   OPTSEARCHREVERSE,             /* (pseudo) used by ci_search_command */
   OPTNOCURSES,                  /* (pseudo) when sending in batch mode */
   OPTNEEDREDRAW,                /* (pseudo) to notify caller of a submenu */
   OPTSEARCHREVERSE,             /* (pseudo) used by ci_search_command */
index c5f791e..acfb102 100644 (file)
 #include <idna.h>
 #endif
 
 #include <idna.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "charset.h"
 
 #include "mutt.h"
 #include "charset.h"
index fe4f24e..fe256f6 100644 (file)
 
 #include <stdarg.h>
 
 
 #include <stdarg.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/enter.h>
 
 
 #include <lib-ui/enter.h>
 
index 5952752..126504c 100644 (file)
 #include <sys/socket.h>
 #include <netinet/in.h>
 
 #include <sys/socket.h>
 #include <netinet/in.h>
 
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
+#include <lib-ui/curses.h>
+#include <lib-sys/mutt_socket.h>
 
 #include "mutt.h"
 #include "account.h"
 #include "mutt_sasl.h"
 
 #include "mutt.h"
 #include "account.h"
 #include "mutt_sasl.h"
-#include <lib-sys/mutt_socket.h>
 
 static int getnameinfo_err (int ret)
 {
 
 static int getnameinfo_err (int ret)
 {
index 6ac6dba..0e396e6 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
 #include <unistd.h>
 #include <utime.h>
 
 #include <unistd.h>
 #include <utime.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/file.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
@@ -600,7 +594,7 @@ void mutt_safe_path(char *s, ssize_t l, address_t *a)
     mutt_save_path(s, l, a);
 
     while (*s) {
     mutt_save_path(s, l, a);
 
     while (*s) {
-        if (*s == '/' || ISSPACE(*s) || !IsPrint((unsigned char)*s))
+        if (*s == '/' || ISSPACE(*s) || !isprint((unsigned char)*s))
             *s = '_';
         s++;
     }
             *s = '_';
         s++;
     }
@@ -815,39 +809,12 @@ void mutt_FormatString (char *dest,     /* output buffer */
     /* Make sure that the string is printable by changing all non-printable
        chars to dots, or spaces for non-printable whitespace */
     for (cp = dest; *cp; cp++)
     /* Make sure that the string is printable by changing all non-printable
        chars to dots, or spaces for non-printable whitespace */
     for (cp = dest; *cp; cp++)
-      if (!IsPrint (*cp) && !((flags & M_FORMAT_TREE) && (*cp <= M_TREE_MAX)))
+      if (!isprint(*cp) && !((flags & M_FORMAT_TREE) && (*cp <= M_TREE_MAX)))
         *cp = isspace ((unsigned char) *cp) ? ' ' : '.';
   }
 #endif
 }
 
         *cp = isspace ((unsigned char) *cp) ? ' ' : '.';
   }
 #endif
 }
 
-/* This function allows the user to specify a command to read stdout from in
-   place of a normal file.  If the last character in the string is a pipe (|),
-   then we assume it is a commmand to run instead of a normal file. */
-FILE *mutt_open_read (const char *path, pid_t * thepid)
-{
-    int len = m_strlen(path);
-    FILE *f;
-
-    if (path[len - 1] == '|') {
-        char *s = m_strdup(path);
-
-        /* read from a pipe */
-
-        s[len - 1] = 0;
-        mutt_endwin (NULL);
-        *thepid = mutt_create_filter (s, NULL, &f, NULL);
-        p_delete(&s);
-    } else {
-        f = fopen (path, "r");
-        if (!f)
-            return NULL;
-        *thepid = -1;
-    }
-
-    return (f);
-}
-
 /* returns 0 if OK to proceed, -1 to abort, 1 to retry */
 int mutt_save_confirm (const char *s, struct stat *st)
 {
 /* returns 0 if OK to proceed, -1 to abort, 1 to retry */
 int mutt_save_confirm (const char *s, struct stat *st)
 {
@@ -1119,3 +1086,184 @@ int mutt_cmp_body (const BODY * b1, const BODY * b2)
     return (0);
   return (1);
 }
     return (0);
   return (1);
 }
+
+int mutt_extract_token(BUFFER *dest, BUFFER *tok, int flags)
+{
+    char ch;
+    char qc = 0;                  /* quote char */
+    char *pc;
+
+    /* reset the destination pointer to the beginning of the buffer */
+    dest->dptr = dest->data;
+
+    tok->dptr = vskipspaces(tok->dptr);
+    while ((ch = *tok->dptr)) {
+        if (!qc) {
+            if ((ISSPACE(ch) && !(flags & M_TOKEN_SPACE))
+            || (ch == '#' && !(flags & M_TOKEN_COMMENT))
+            || (ch == '=' && (flags & M_TOKEN_EQUAL))
+            || (ch == ';' && !(flags & M_TOKEN_SEMICOLON))
+            || ((flags & M_TOKEN_PATTERN) && strchr("~=!|", ch)))
+            {
+                break;
+            }
+        }
+
+        tok->dptr++;
+
+        if (ch == qc) {
+            qc = 0;                     /* end of quote */
+        } else
+        if (!qc && (ch == '\'' || ch == '"') && !(flags & M_TOKEN_QUOTE)) {
+            qc = ch;
+        } else
+        if (ch == '\\' && qc != '\'') {
+            if (!*tok->dptr)
+                return -1;              /* premature end of token */
+
+            switch (ch = *tok->dptr++) {
+              case 'c':
+              case 'C':
+                if (!*tok->dptr)
+                    return -1;          /* premature end of token */
+                mutt_buffer_addch(dest,
+                                  (ascii_toupper(*tok->dptr) - 'A' + 1) & 0x7f);
+                tok->dptr++;
+                break;
+              case 'r':
+                mutt_buffer_addch(dest, '\r');
+                break;
+              case 'n':
+                mutt_buffer_addch(dest, '\n');
+                break;
+              case 't':
+                mutt_buffer_addch(dest, '\t');
+                break;
+              case 'f':
+                mutt_buffer_addch(dest, '\f');
+                break;
+              case 'e':
+                mutt_buffer_addch(dest, '\033');
+                break;
+              default:
+                if (isdigit((unsigned char)ch)
+                &&  isdigit((unsigned char)*tok->dptr)
+                &&  isdigit((unsigned char)*(tok->dptr + 1)))
+                {
+                    mutt_buffer_addch(dest, (ch << 6) + (*tok->dptr << 3) +
+                                            *(tok->dptr + 1) - 3504);
+                    tok->dptr += 2;
+                } else {
+                    mutt_buffer_addch(dest, ch);
+                }
+            }
+        } else
+        if (ch == '^' && (flags & M_TOKEN_CONDENSE)) {
+            if (!*tok->dptr)
+                return -1;              /* premature end of token */
+            ch = *tok->dptr++;
+            if (ch == '^') {
+                mutt_buffer_addch(dest, ch);
+            } else
+            if (ch == '[') {
+                mutt_buffer_addch(dest, '\033');
+            } else
+            if (isalpha((unsigned char)ch)) {
+                mutt_buffer_addch(dest, ascii_toupper(ch) - 'A' + 1);
+            } else {
+                mutt_buffer_addch(dest, '^');
+                mutt_buffer_addch(dest, ch);
+            }
+        } else
+        if (ch == '`' && (!qc || qc == '"')) {
+            FILE *fp;
+            pid_t pid;
+            char *cmd, *ptr;
+            ssize_t expnlen;
+            BUFFER expn;
+            int line = 0;
+
+            pc = tok->dptr;
+            do {
+                if ((pc = strpbrk(pc, "\\`"))) {
+                    /* skip any quoted chars */
+                    if (*pc == '\\')
+                        pc += 2;
+                }
+            } while (pc && *pc != '`');
+            if (!pc) {
+                return (-1);
+            }
+
+            cmd = p_dupstr(tok->dptr, pc - tok->dptr);
+            if ((pid = mutt_create_filter(cmd, NULL, &fp, NULL)) < 0) {
+                p_delete(&cmd);
+                return -1;
+            }
+            p_delete(&cmd);
+
+            tok->dptr = pc + 1;
+
+            /* read line */
+            p_clear(&expn, 1);
+            expn.data = mutt_read_line(NULL, &expn.dsize, fp, &line);
+            fclose(fp);
+            mutt_wait_filter(pid);
+
+            /* if we got output, make a new string consiting of the shell ouptput
+               plus whatever else was left on the original line */
+            /* BUT: If this is inside a quoted string, directly add output to 
+             * the token */
+            if (expn.data && qc) {
+                mutt_buffer_addstr(dest, expn.data);
+                p_delete(&expn.data);
+            } else
+            if (expn.data) {
+                expnlen = m_strlen(expn.data);
+                tok->dsize = expnlen + m_strlen(tok->dptr) + 1;
+                ptr = xmalloc(tok->dsize);
+                memcpy(ptr, expn.data, expnlen);
+                strcpy(ptr + expnlen, tok->dptr);      /* __STRCPY_CHECKED__ */
+                if (tok->destroy)
+                    p_delete(&tok->data);
+                tok->data = ptr;
+                tok->dptr = ptr;
+                tok->destroy = 1;       /* mark that the caller should destroy this data */
+                ptr = NULL;
+                p_delete(&expn.data);
+            }
+        } else
+        if (ch == '$' && (!qc || qc == '"')
+        && (*tok->dptr == '{' || isalpha((unsigned char)*tok->dptr)))
+        {
+            char *env = NULL, *var = NULL;
+
+            if (*tok->dptr == '{') {
+                tok->dptr++;
+                if ((pc = strchr (tok->dptr, '}'))) {
+                    var = p_dupstr(tok->dptr, pc - tok->dptr);
+                    tok->dptr = pc + 1;
+                }
+            } else {
+                for (pc = tok->dptr; isalnum((unsigned char)*pc) || *pc == '_';
+                     pc++);
+                var = p_dupstr(tok->dptr, pc - tok->dptr);
+                tok->dptr = pc;
+            }
+            if (var) {
+                char tmp[STRING];
+                if ((env = getenv (var))
+                || (mutt_option_value (var, tmp, sizeof (tmp)) && (env = tmp)))
+                {
+                    mutt_buffer_addstr (dest, env);
+                }
+            }
+            p_delete(&var);
+        } else {
+            mutt_buffer_addch(dest, ch);
+        }
+    }
+    mutt_buffer_addch(dest, 0);  /* terminate the string */
+    tok->dptr = vskipspaces(tok->dptr);
+    return 0;
+}
diff --git a/mx.c b/mx.c
index 936fc25..8b9eedd 100644 (file)
--- a/mx.c
+++ b/mx.c
 #include <ctype.h>
 #include <utime.h>
 
 #include <ctype.h>
 #include <utime.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
 
 #include <lib-sys/unix.h>
 
diff --git a/mx.h b/mx.h
index ccbe239..8f0a365 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -169,5 +169,6 @@ int mx_lock_file (const char *, int, int, int, int);
 int mx_unlock_file (const char *path, int fd, int dot);
 
 int mx_rebuild_cache (void);
 int mx_unlock_file (const char *path, int fd, int dot);
 
 int mx_rebuild_cache (void);
+void mutt_parse_mime_message (CONTEXT * ctx, HEADER *);
 
 #endif /* !_MX_H */
 
 #endif /* !_MX_H */
index e607885..20d55d8 100644 (file)
@@ -9,9 +9,7 @@
 
 #include <sys/stat.h>
 
 
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "nntp.h"
 
 #include "mutt.h"
 #include "nntp.h"
index 3b8e1fa..1a868bd 100644 (file)
 #include <libgen.h>
 #include <sys/stat.h>
 
 #include <libgen.h>
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index 6311ce9..93ad37b 100644 (file)
 #include <ctype.h>
 #include <stdlib.h>
 
 #include <ctype.h>
 #include <stdlib.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
diff --git a/pager.c b/pager.c
index 805fd43..b486021 100644 (file)
--- a/pager.c
+++ b/pager.c
 #include <string.h>
 #include <errno.h>
 
 #include <string.h>
 #include <errno.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/mapping.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
@@ -1013,7 +1009,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
 
     /* Handle backspace */
     special = 0;
 
     /* Handle backspace */
     special = 0;
-    if (IsWPrint (wc)) {
+    if (iswprint(wc)) {
       wchar_t wc1;
       mbstate_t mbstate1;
       int k1, k2;
       wchar_t wc1;
       mbstate_t mbstate1;
       int k1, k2;
@@ -1024,7 +1020,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
                            &mbstate1), k1 - k > 0 && wc1 == '\b')
              && (wc1 = 0, k2 =
                  mbrtowc (&wc1, (char *) buf + ch + k1, cnt - ch - k1,
                            &mbstate1), k1 - k > 0 && wc1 == '\b')
              && (wc1 = 0, k2 =
                  mbrtowc (&wc1, (char *) buf + ch + k1, cnt - ch - k1,
-                          &mbstate1), k2 > 0 && IsWPrint (wc1))) {
+                          &mbstate1), k2 > 0 && iswprint(wc1))) {
         if (wc == wc1) {
           special |= (wc == '_' && special & A_UNDERLINE)
             ? A_UNDERLINE : A_BOLD;
         if (wc == wc1) {
           special |= (wc == '_' && special & A_UNDERLINE)
             ? A_UNDERLINE : A_BOLD;
@@ -1050,7 +1046,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
       last_special = special;
     }
 
       last_special = special;
     }
 
-    if (IsWPrint (wc)) {
+    if (iswprint(wc)) {
       if (wc == ' ')
         space = ch;
       t = wcwidth (wc);
       if (wc == ' ')
         space = ch;
       t = wcwidth (wc);
index 32a5094..26b8375 100644 (file)
--- a/pattern.c
+++ b/pattern.c
 #include <unistd.h>
 #include <stdarg.h>
 
 #include <unistd.h>
 #include <stdarg.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/buffer.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 #include <lib-ui/enter.h>
 
 #include <lib-mime/mime.h>
 
 #include <lib-ui/enter.h>
+#include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include "alias.h"
 
 #include "mutt.h"
 #include "alias.h"
@@ -119,19 +114,6 @@ static char LastSearchExpn[LONG_STRING] = { 0 };        /* expanded version of
 #define M_PDR_ERROR    0x0100
 #define M_PDR_ERRORDONE        (M_PDR_ERROR | M_PDR_DONE)
 
 #define M_PDR_ERROR    0x0100
 #define M_PDR_ERRORDONE        (M_PDR_ERROR | M_PDR_DONE)
 
-
-int mutt_getvaluebychar (char ch, struct mapping_t *table)
-{
-  int i;
-
-  for (i = 0; table[i].name; i++) {
-    if (ch == table[i].name[0])
-      return table[i].value;
-  }
-
-  return (-1);
-}
-
 /* if no uppercase letters are given, do a case-insensitive search */
 int mutt_which_case (const char *s)
 {
 /* if no uppercase letters are given, do a case-insensitive search */
 int mutt_which_case (const char *s)
 {
index 7b297ed..2f2433c 100644 (file)
@@ -26,8 +26,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 #include <lib-hash/hash.h>
 
 #include <stdio.h>
 #include <lib-hash/hash.h>
 
 #include <stdio.h>
index c1f2048..0c11d64 100644 (file)
@@ -9,9 +9,7 @@
 
 #include <sys/stat.h>
 
 
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "pop.h"
 
 #include "mutt.h"
 #include "pop.h"
index 5fe55e4..8610713 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
 #include <string.h>
 #include <unistd.h>
 
 #include <string.h>
 #include <unistd.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/file.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 
 
 #include <lib-ui/curses.h>
 
index 5cb2519..cca0e0c 100644 (file)
@@ -11,9 +11,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 #include <lib-hash/hash.h>
 
 #include "mutt.h"
 #include <lib-hash/hash.h>
 
 #include "mutt.h"
index b5aa605..e780215 100644 (file)
 #include <unistd.h>
 #include <ctype.h>
 
 #include <unistd.h>
 #include <ctype.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "mx.h"
 
 #include "mutt.h"
 #include "mx.h"
index 174d8e1..9b4e0a6 100644 (file)
 #include <string.h>
 #include <sys/stat.h>
 
 #include <string.h>
 #include <sys/stat.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index 0b5dc6e..d07d699 100644 (file)
--- a/protos.h
+++ b/protos.h
 #include <inttypes.h>
 #endif
 
 #include <inttypes.h>
 #endif
 
-#include <lib-lib/buffer.h>
-#include <lib-lib/mapping.h>
-
 #define MoreArgs(p) (*p->dptr && *p->dptr != ';' && *p->dptr != '#')
 
 #define MoreArgs(p) (*p->dptr && *p->dptr != ';' && *p->dptr != '#')
 
-#define mutt_make_string(A,B,C,D,E) _mutt_make_string(A,B,C,D,E,0)
-void _mutt_make_string (char *, ssize_t, const char *, CONTEXT *,
-                        HEADER *, format_flag);
-
-#define mutt_new_enter_state() p_new(ENTER_STATE, 1)
-
 typedef const char *format_t (char *, ssize_t, char, const char *,
                               const char *, const char *, const char *,
                               unsigned long, format_flag);
 
 void mutt_FormatString (char *, ssize_t, const char *, format_t *,
                         unsigned long, format_flag);
 typedef const char *format_t (char *, ssize_t, char, const char *,
                               const char *, const char *, const char *,
                               unsigned long, format_flag);
 
 void mutt_FormatString (char *, ssize_t, const char *, format_t *,
                         unsigned long, format_flag);
-FILE *mutt_open_read (const char *, pid_t *);
 
 void set_quadoption (int, int);
 int query_quadoption (int, const char *);
 
 void set_quadoption (int, int);
 int query_quadoption (int, const char *);
@@ -45,7 +35,6 @@ int quadoption (int);
 int mutt_option_value (const char* val, char* dst, ssize_t dstlen);
 
 address_t *mutt_default_from (void);
 int mutt_option_value (const char* val, char* dst, ssize_t dstlen);
 
 address_t *mutt_default_from (void);
-address_t *mutt_remove_duplicates (address_t *);
 
 BODY *mutt_make_file_attach (const char *);
 BODY *mutt_make_message_attach (CONTEXT *, HEADER *, int);
 
 BODY *mutt_make_file_attach (const char *);
 BODY *mutt_make_message_attach (CONTEXT *, HEADER *, int);
@@ -54,8 +43,6 @@ BODY *mutt_make_multipart (BODY *);
 
 CONTENT *mutt_get_content_info (const char *fname, BODY * b);
 
 
 CONTENT *mutt_get_content_info (const char *fname, BODY * b);
 
-string_list_t *mutt_make_references (ENVELOPE * e);
-
 int mutt_cmp_header (const HEADER*, const HEADER*);
 int mutt_cmp_addr (const address_t * a, const address_t * b);
 int mutt_cmp_list (const string_list_t * a, const string_list_t * b);
 int mutt_cmp_header (const HEADER*, const HEADER*);
 int mutt_cmp_addr (const address_t * a, const address_t * b);
 int mutt_cmp_list (const string_list_t * a, const string_list_t * b);
@@ -64,7 +51,6 @@ int mutt_cmp_body (const BODY * b1, const BODY * b2);
 
 time_t mutt_decrease_mtime (const char *, struct stat *);
 void mutt_set_mtime (const char*, const char*);
 
 time_t mutt_decrease_mtime (const char *, struct stat *);
 void mutt_set_mtime (const char*, const char*);
-time_t mutt_parse_date (const char *, HEADER *);
 int is_from (const char *, char *, ssize_t, time_t *);
 
 const char *mutt_charset_hook (const char *);
 int is_from (const char *, char *, ssize_t, time_t *);
 
 const char *mutt_charset_hook (const char *);
@@ -88,28 +74,18 @@ void mutt_add_to_reference_headers (ENVELOPE * env, ENVELOPE * curenv,
 void mutt_adv_mktemp (const char*, char*, ssize_t);
 int mutt_bounce_message (FILE * fp, HEADER *, address_t *);
 void mutt_check_rescore (CONTEXT *);
 void mutt_adv_mktemp (const char*, char*, ssize_t);
 int mutt_bounce_message (FILE * fp, HEADER *, address_t *);
 void mutt_check_rescore (CONTEXT *);
-void mutt_clear_error (void);
 void mutt_default_save (char *, ssize_t, HEADER *);
 void mutt_display_address (ENVELOPE *);
 void mutt_edit_content_type (HEADER *, BODY *, FILE *);
 void mutt_default_save (char *, ssize_t, HEADER *);
 void mutt_display_address (ENVELOPE *);
 void mutt_edit_content_type (HEADER *, BODY *, FILE *);
-void mutt_edit_file (const char *, const char *);
 void mutt_edit_headers (const char *, const char *, HEADER *, char *, ssize_t);
 void mutt_edit_headers (const char *, const char *, HEADER *, char *, ssize_t);
-void mutt_curses_error (const char *, ...);
-void mutt_curses_message (const char *, ...);
 void mutt_enter_command (void);
 void mutt_expand_file_fmt (char *, ssize_t, const char *, const char *);
 void mutt_expand_fmt (char *, ssize_t, const char *, const char *);
 void mutt_expand_link (char *, const char *, const char *);
 void mutt_fix_reply_recipients (ENVELOPE * env);
 void mutt_folder_hook (char *);
 void mutt_enter_command (void);
 void mutt_expand_file_fmt (char *, ssize_t, const char *, const char *);
 void mutt_expand_fmt (char *, ssize_t, const char *, const char *);
 void mutt_expand_link (char *, const char *, const char *);
 void mutt_fix_reply_recipients (ENVELOPE * env);
 void mutt_folder_hook (char *);
-void mutt_format_string (char *, ssize_t, int, int, int, char, const char *,
-                         ssize_t, int);
-void mutt_format_s (char *, ssize_t, const char *, const char *);
-void mutt_format_s_tree (char *, ssize_t, const char *, const char *);
 void mutt_forward_intro (FILE * fp, HEADER * cur);
 void mutt_forward_trailer (FILE * fp);
 void mutt_forward_intro (FILE * fp, HEADER * cur);
 void mutt_forward_trailer (FILE * fp);
-void mutt_free_color (int fg, int bg);
-void mutt_generate_header (char *, ssize_t, HEADER *, int);
 void mutt_help (int);
 void mutt_draw_tree (CONTEXT *);
 void mutt_make_attribution (CONTEXT * ctx, HEADER * cur, FILE * out);
 void mutt_help (int);
 void mutt_draw_tree (CONTEXT *);
 void mutt_make_attribution (CONTEXT * ctx, HEADER * cur, FILE * out);
@@ -124,18 +100,12 @@ void mutt_message_to_7bit (BODY *, FILE *);
 
 #define mutt_mktemp(a) _mutt_mktemp (a, __FILE__, __LINE__)
 void _mutt_mktemp (char *, const char *, int);
 
 #define mutt_mktemp(a) _mutt_mktemp (a, __FILE__, __LINE__)
 void _mutt_mktemp (char *, const char *, int);
-void mutt_paddstr (int, const char *);
-void mutt_parse_mime_message (CONTEXT * ctx, HEADER *);
-#define mutt_perror(a) _mutt_perror (a, __FILE__, __LINE__)
-void _mutt_perror (const char*, const char*,int);
 void mutt_prepare_envelope (ENVELOPE *, int);
 void mutt_unprepare_envelope (ENVELOPE *);
 void mutt_pretty_mailbox (char *);
 void mutt_pretty_size (char *, ssize_t, long);
 void mutt_pipe_message (HEADER *);
 void mutt_print_message (HEADER *);
 void mutt_prepare_envelope (ENVELOPE *, int);
 void mutt_unprepare_envelope (ENVELOPE *);
 void mutt_pretty_mailbox (char *);
 void mutt_pretty_size (char *, ssize_t, long);
 void mutt_pipe_message (HEADER *);
 void mutt_print_message (HEADER *);
-void mutt_query_exit (void);
-void mutt_query_menu (char *, ssize_t);
 void mutt_safe_path (char *s, ssize_t l, address_t * a);
 void mutt_save_path (char *s, ssize_t l, address_t * a);
 void mutt_score_message (CONTEXT *, HEADER *, int);
 void mutt_safe_path (char *s, ssize_t l, address_t * a);
 void mutt_save_path (char *s, ssize_t l, address_t * a);
 void mutt_score_message (CONTEXT *, HEADER *, int);
@@ -149,9 +119,7 @@ void _mutt_set_flag (CONTEXT *, HEADER *, int, int, int);
 #define mutt_set_flag(a,b,c,d) _mutt_set_flag(a,b,c,d,1)
 void mutt_set_followup_to (ENVELOPE *);
 void mutt_shell_escape (void);
 #define mutt_set_flag(a,b,c,d) _mutt_set_flag(a,b,c,d,1)
 void mutt_set_followup_to (ENVELOPE *);
 void mutt_shell_escape (void);
-void mutt_show_error (void);
 void mutt_stamp_attachment (BODY * a);
 void mutt_stamp_attachment (BODY * a);
-void mutt_tabs_to_spaces (char *);
 void mutt_tag_set_flag (int, int);
 void mutt_update_encoding (BODY * a);
 void mutt_version (void);
 void mutt_tag_set_flag (int, int);
 void mutt_update_encoding (BODY * a);
 void mutt_version (void);
@@ -159,12 +127,8 @@ void mutt_write_references (string_list_t *, FILE *);
 void mutt_write_address_list (address_t * adr, FILE * fp, int linelen,
                               int display);
 
 void mutt_write_address_list (address_t * adr, FILE * fp, int linelen,
                               int display);
 
-int mutt_addwch (wchar_t);
-int mutt_alloc_color (int fg, int bg);
-int mutt_any_key_to_continue (const char *);
 int mutt_can_decode (BODY *);
 int mutt_change_flag (HEADER *, int);
 int mutt_can_decode (BODY *);
 int mutt_change_flag (HEADER *, int);
-int mutt_check_key (const char *);
 int mutt_check_menu (const char *);
 int mutt_check_month (const char *);
 int mutt_check_overwrite (const char *, const char *, char *, ssize_t, int *,
 int mutt_check_menu (const char *);
 int mutt_check_month (const char *);
 int mutt_check_overwrite (const char *, const char *, char *, ssize_t, int *,
@@ -172,7 +136,6 @@ int mutt_check_overwrite (const char *, const char *, char *, ssize_t, int *,
 int mutt_check_traditional_pgp (HEADER *, int *);
 int mutt_command_complete (char *, ssize_t, int, int);
 int mutt_var_value_complete (char *, ssize_t, int);
 int mutt_check_traditional_pgp (HEADER *, int *);
 int mutt_command_complete (char *, ssize_t, int, int);
 int mutt_var_value_complete (char *, ssize_t, int);
-int mutt_complete (char *, ssize_t);
 int mutt_copy_body (FILE *, BODY **, BODY *);
 
 int mutt_display_message (HEADER * h);
 int mutt_copy_body (FILE *, BODY **, BODY *);
 
 int mutt_display_message (HEADER * h);
@@ -182,49 +145,31 @@ int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags);
 int mutt_prepare_template (FILE *, CONTEXT *, HEADER *, HEADER *, short);
 int mutt_resend_message (FILE *, CONTEXT *, HEADER *);
 
 int mutt_prepare_template (FILE *, CONTEXT *, HEADER *, HEADER *, short);
 int mutt_resend_message (FILE *, CONTEXT *, HEADER *);
 
-#define mutt_enter_fname(A,B,C,D,E) _mutt_enter_fname(A,B,C,D,E,0,NULL,NULL)
-int _mutt_enter_fname (const char *, char *, ssize_t, int *, int, int,
-                       char ***, int *);
-#define mutt_get_field(A,B,C,D) _mutt_get_field(A,B,C,D,0,NULL,NULL)
-int _mutt_get_field (const char *, char *, ssize_t, int, int, char ***, int *);
-int mutt_get_field_unbuffered (char *, char *, ssize_t, int);
 int mutt_get_hook_type (const char *);
 int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, ssize_t);
 int mutt_get_hook_type (const char *);
 int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, ssize_t);
-int mutt_index_menu (void);
 int mutt_invoke_mta (address_t *, address_t *, address_t *, address_t *, const char *,
                      int);
 int mutt_invoke_mta (address_t *, address_t *, address_t *, address_t *, const char *,
                      int);
-int mutt_is_mail_list (address_t *);
 int mutt_is_list_cc (int, address_t *, address_t *);
 int mutt_is_list_recipient (int, address_t *, address_t *);
 int mutt_is_list_cc (int, address_t *, address_t *);
 int mutt_is_list_recipient (int, address_t *, address_t *);
-int mutt_is_subscribed_list (address_t *);
-int mutt_is_valid_mailbox (const char *);
 int mutt_lookup_mime_type (BODY *, const char *);
 int mutt_match_spam_list (const char *, SPAM_LIST *, char *, int);
 int mutt_lookup_mime_type (BODY *, const char *);
 int mutt_match_spam_list (const char *, SPAM_LIST *, char *, int);
-int mutt_multi_choice (char *prompt, char *letters);
 int mutt_num_postponed (int);
 int mutt_parse_bind (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_exec (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_num_postponed (int);
 int mutt_parse_bind (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_exec (BUFFER *, BUFFER *, unsigned long, BUFFER *);
-int mutt_parse_color (BUFFER *, BUFFER *, unsigned long, BUFFER *);
-int mutt_parse_uncolor (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_hook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_macro (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_hook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_macro (BUFFER *, BUFFER *, unsigned long, BUFFER *);
-int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
-int mutt_parse_unmono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_push (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_rc_line ( /* const */ char *, BUFFER *, BUFFER *);
 int mutt_parse_score (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_unscore (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_unhook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_pattern_func (int, char *);
 int mutt_parse_push (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_rc_line ( /* const */ char *, BUFFER *, BUFFER *);
 int mutt_parse_score (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_unscore (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_unhook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_pattern_func (int, char *);
-int mutt_query_complete (char *, ssize_t);
 int mutt_query_variables (string_list_t * queries);
 int _mutt_save_message (HEADER *, CONTEXT *, int, int, int);
 int mutt_save_message (HEADER *, int, int, int, int *);
 int mutt_search_command (int, int);
 int mutt_query_variables (string_list_t * queries);
 int _mutt_save_message (HEADER *, CONTEXT *, int, int, int);
 int mutt_save_message (HEADER *, int, int, int, int *);
 int mutt_search_command (int, int);
-int mutt_strwidth (const char *);
 int mutt_compose_menu (HEADER *, char *, ssize_t, HEADER *);
 int mutt_thread_set_flag (HEADER *, int, int, int);
 int mutt_compose_menu (HEADER *, char *, ssize_t, HEADER *);
 int mutt_thread_set_flag (HEADER *, int, int, int);
-int mutt_user_is_recipient (HEADER *);
 void mutt_update_num_postponed (void);
 int mutt_which_case (const char *);
 int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, int,
 void mutt_update_num_postponed (void);
 int mutt_which_case (const char *);
 int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, int,
@@ -232,24 +177,15 @@ int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, int,
 int mutt_write_mime_body (BODY *, FILE *);
 int mutt_write_mime_header (BODY *, FILE *);
 int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int);
 int mutt_write_mime_body (BODY *, FILE *);
 int mutt_write_mime_header (BODY *, FILE *);
 int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int);
-int mutt_yesorno (const char *, int);
-void mutt_set_header_color (CONTEXT *, HEADER *);
 void mutt_sleep (short);
 int mutt_save_confirm (const char *, struct stat *);
 
 void mutt_sleep (short);
 int mutt_save_confirm (const char *, struct stat *);
 
-int mh_valid_message (const char *);
-
 /* base64.c */
 void mutt_to_base64 (unsigned char *, const unsigned char *, ssize_t, ssize_t);
 int mutt_from_base64 (char *, const char *);
 
 /* base64.c */
 void mutt_to_base64 (unsigned char *, const unsigned char *, ssize_t, ssize_t);
 int mutt_from_base64 (char *, const char *);
 
-#define IsPrint(c) (isprint((unsigned char)(c)) || \
-       (option (OPTLOCALES) ? 0 : \
-       ((unsigned char)(c) >= 0xa0)))
-#define IsWPrint(wc) (iswprint(wc) || \
-       (option (OPTLOCALES) ? 0 : (wc >= 0xa0)))
-
 #define new_pattern() p_new(pattern_t, 1)
 #define new_pattern() p_new(pattern_t, 1)
+#define mutt_new_enter_state() p_new(ENTER_STATE, 1)
 
 int mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags,
                        CONTEXT * ctx, HEADER * h);
 
 int mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags,
                        CONTEXT * ctx, HEADER * h);
@@ -257,6 +193,17 @@ pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err);
 void mutt_check_simple (char *s, ssize_t len, const char *simple);
 void mutt_pattern_free (pattern_t ** pat);
 
 void mutt_check_simple (char *s, ssize_t len, const char *simple);
 void mutt_pattern_free (pattern_t ** pat);
 
-/* unsorted */
 void ci_bounce_message (HEADER *, int *);
 int ci_send_message (int, HEADER *, char *, CONTEXT *, HEADER *);
 void ci_bounce_message (HEADER *, int *);
 int ci_send_message (int, HEADER *, char *, CONTEXT *, HEADER *);
+
+/* flags for mutt_extract_token() */
+#define M_TOKEN_EQUAL          1       /* treat '=' as a special */
+#define M_TOKEN_CONDENSE       (1<<1)  /* ^(char) to control chars (macros) */
+#define M_TOKEN_SPACE          (1<<2)  /* don't treat whitespace as a term */
+#define M_TOKEN_QUOTE          (1<<3)  /* don't interpret quotes */
+#define M_TOKEN_PATTERN                (1<<4)  /* !)|~ are terms (for patterns) */
+#define M_TOKEN_COMMENT                (1<<5)  /* don't reap comments */
+#define M_TOKEN_SEMICOLON      (1<<6)  /* don't treat ; as special */
+
+int mutt_extract_token(BUFFER *, BUFFER *, int);
+
index b456131..c2fec5e 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index 5b1cfaa..d7234f9 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
index b22f0b6..fa23865 100644 (file)
 #include <sys/file.h>
 #include <fcntl.h>
 
 #include <sys/file.h>
 #include <fcntl.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/mapping.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
 
 #include <lib-sys/unix.h>
 
diff --git a/score.c b/score.c
index aae4e0a..061d84c 100644 (file)
--- a/score.c
+++ b/score.c
@@ -11,9 +11,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "sort.h"
 
 #include "mutt.h"
 #include "sort.h"
diff --git a/send.c b/send.c
index fd0341b..4039463 100644 (file)
--- a/send.c
+++ b/send.c
 #include <sys/types.h>
 #include <utime.h>
 
 #include <sys/types.h>
 #include <utime.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/url.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 #include <lib-mime/rfc3676.h>
 
 #include <lib-mime/mime.h>
 #include <lib-mime/rfc3676.h>
@@ -585,25 +580,6 @@ int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags)
   return 0;
 }
 
   return 0;
 }
 
-string_list_t *mutt_make_references (ENVELOPE * e)
-{
-  string_list_t *t = NULL, *l = NULL;
-
-  if (e->references)
-    l = string_list_dup(e->references);
-  else
-    l = string_list_dup(e->in_reply_to);
-
-  if (e->message_id) {
-    t = string_item_new();
-    t->data = m_strdup(e->message_id);
-    t->next = l;
-    l = t;
-  }
-
-  return l;
-}
-
 void mutt_fix_reply_recipients (ENVELOPE * env)
 {
   mutt_expand_aliases_env (env);
 void mutt_fix_reply_recipients (ENVELOPE * env)
 {
   mutt_expand_aliases_env (env);
@@ -617,8 +593,8 @@ void mutt_fix_reply_recipients (ENVELOPE * env)
   }
 
   /* the CC field can get cluttered, especially with lists */
   }
 
   /* the CC field can get cluttered, especially with lists */
-  env->to = mutt_remove_duplicates (env->to);
-  env->cc = mutt_remove_duplicates (env->cc);
+  address_list_uniq(&env->to);
+  address_list_uniq(&env->cc);
   env->cc = mutt_remove_xrefs (env->to, env->cc);
 
   if (env->cc && !env->to) {
   env->cc = mutt_remove_xrefs (env->to, env->cc);
 
   if (env->cc && !env->to) {
@@ -656,6 +632,25 @@ void mutt_make_misc_reply_headers (ENVELOPE * env, CONTEXT * ctx,
 #endif
 }
 
 #endif
 }
 
+static string_list_t *mutt_make_references (ENVELOPE * e)
+{
+  string_list_t *t = NULL, *l = NULL;
+
+  if (e->references)
+    l = string_list_dup(e->references);
+  else
+    l = string_list_dup(e->in_reply_to);
+
+  if (e->message_id) {
+    t = string_item_new();
+    t->data = m_strdup(e->message_id);
+    t->next = l;
+    l = t;
+  }
+
+  return l;
+}
+
 void mutt_add_to_reference_headers (ENVELOPE * env, ENVELOPE * curenv,
                                     string_list_t *** pp, string_list_t *** qq)
 {
 void mutt_add_to_reference_headers (ENVELOPE * env, ENVELOPE * curenv,
                                     string_list_t *** pp, string_list_t *** qq)
 {
@@ -925,7 +920,7 @@ void mutt_set_followup_to (ENVELOPE * e)
       }
     }
 
       }
     }
 
-    e->mail_followup_to = mutt_remove_duplicates(e->mail_followup_to);
+    address_list_uniq(&e->mail_followup_to);
 
   }
 }
 
   }
 }
index 2c5611a..3759212 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
 #include <fcntl.h>
 #include <sys/utsname.h>
 
 #include <fcntl.h>
 #include <sys/utsname.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/exit.h>
 #include <lib-sys/mutt_signal.h>
 
 #include <lib-sys/exit.h>
 #include <lib-sys/mutt_signal.h>
@@ -2163,41 +2159,6 @@ int mutt_bounce_message (FILE * fp, HEADER * h, address_t * to)
   return ret;
 }
 
   return ret;
 }
 
-
-/* given a list of addresses, return a list of unique addresses */
-address_t *mutt_remove_duplicates (address_t * addr)
-{
-  address_t *top = addr;
-  address_t **last = &top;
-  address_t *tmp;
-  int dodup = 0;
-
-  while (addr) {
-    for (tmp = top; tmp && tmp != addr; tmp = tmp->next) {
-      if (tmp->mailbox && addr->mailbox &&
-          !ascii_strcasecmp (addr->mailbox, tmp->mailbox)) {
-        dodup = 1;
-        break;
-      }
-    }
-
-    if (dodup) {
-      *last = addr->next;
-
-      addr->next = NULL;
-      address_list_wipe(&addr);
-
-      addr = *last;
-    }
-    else {
-      last = &addr->next;
-      addr = addr->next;
-    }
-  }
-
-  return (top);
-}
-
 static void set_noconv_flags (BODY * b, short flag)
 {
   for (; b; b = b->next) {
 static void set_noconv_flags (BODY * b, short flag)
 {
   for (; b; b = b->next) {
diff --git a/sort.c b/sort.c
index 9798823..2b70001 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -16,8 +16,7 @@
 #include <ctype.h>
 #include <unistd.h>
 
 #include <ctype.h>
 #include <unistd.h>
 
-#include <lib-lib/macros.h>
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "alias.h"
 
 #include "mutt.h"
 #include "alias.h"
diff --git a/sort.h b/sort.h
index fd9efa0..50c017b 100644 (file)
--- a/sort.h
+++ b/sort.h
@@ -42,5 +42,4 @@ WHERE short SortAlias INITVAL (SORT_ALIAS);
 /* FIXME: This one does not belong to here */
 WHERE short PgpSortKeys INITVAL (SORT_ADDRESS);
 
 /* FIXME: This one does not belong to here */
 WHERE short PgpSortKeys INITVAL (SORT_ADDRESS);
 
-#include <lib-lib/mapping.h>
 extern const struct mapping_t SortMethods[];
 extern const struct mapping_t SortMethods[];
index ed690f2..57cfada 100644 (file)
--- a/thread.c
+++ b/thread.c
@@ -11,8 +11,7 @@
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "sort.h"
 
 #include "mutt.h"
 #include "sort.h"
diff --git a/xterm.h b/xterm.h
index 31b153e..37dac4b 100644 (file)
--- a/xterm.h
+++ b/xterm.h
@@ -6,7 +6,7 @@
 #ifndef MUTT_XTERM_H
 #define MUTT_XTERM_H
 
 #ifndef MUTT_XTERM_H
 #define MUTT_XTERM_H
 
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 #include <stdio.h>
 
 /* sets the current xterm's title */
 #include <stdio.h>
 
 /* sets the current xterm's title */