]> granicus.if.org Git - neomutt/commitdiff
drop lib.c
authorRichard Russon <rich@flatcap.org>
Wed, 2 Aug 2017 15:20:34 +0000 (16:20 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 2 Aug 2017 16:26:05 +0000 (17:26 +0100)
126 files changed:
Makefile.am
account.c
addrbook.c
alias.c
attach.c
bcache.c
browser.c
buffy.c
charset.c
color.c
commands.c
complete.c
compose.c
compress.c
copy.c
curs_lib.c
curs_main.c
edit.c
editmsg.c
enter.c
enter_state.h
envelope.h
flags.c
from.c
getdomain.c
globals.h
group.c
handler.c
hcache/bdb.c
hcache/gdbm.c
hcache/hcache.c
hcache/kc.c
hcache/lmdb.c
hcache/qdbm.c
hcache/tc.c
hdrline.c
header.h
headers.c
help.c
history.c
hook.c
imap/auth.c
imap/auth_anon.c
imap/auth_cram.c
imap/auth_gss.c
imap/auth_login.c
imap/auth_plain.c
imap/auth_sasl.c
imap/browse.c
imap/command.c
imap/imap.c
imap/message.c
imap/utf7.c
imap/util.c
init.c
keymap.c
lib.c [deleted file]
lib.h [deleted file]
list.h
main.c
mbox.c
mbyte.c
menu.c
mh.c
mutt.h
mutt_curses.h
mutt_idna.c
mutt_lua.c
mutt_notmuch.c
mutt_sasl.c
mutt_sasl_plain.c
mutt_socket.h
mutt_ssl.c
mutt_ssl_gnutls.c
mutt_tunnel.c
muttlib.c
mx.c
ncrypt/crypt.c
ncrypt/crypt_gpgme.c
ncrypt/crypt_mod.c
ncrypt/cryptglue.c
ncrypt/gnupgparse.c
ncrypt/pgp.c
ncrypt/pgpinvoke.c
ncrypt/pgpkey.c
ncrypt/pgplib.c
ncrypt/pgplib.h
ncrypt/pgpmicalg.c
ncrypt/pgppacket.c
ncrypt/smime.c
newsrc.c
nntp.c
pager.c
parameter.h
parse.c
pattern.c
pattern.h
pgppubring.c
po/POTFILES.in
pop.c
pop_auth.c
pop_lib.c
postpone.c
query.c
recvattach.c
recvcmd.c
remailer.c
resize.c
rfc1524.c
rfc2047.c
rfc2231.c
rfc3676.c
rfc822.h
safe_asprintf.c
score.c
send.c
sendlib.c
sidebar.c
signal.c
smtp.c
sort.c
state.c
status.c
thread.c
url.c
version.c

index ac3ed39b21f4982a093912958778ac8b9d0c7493..168d374849b6f371f9490cc8921502dbbd351f21 100644 (file)
@@ -50,7 +50,7 @@ mutt_SOURCES = account.c addrbook.c address.h alias.c alias.h attach.c \
        curs_lib.c curs_main.c edit.c editmsg.c enter.c enter_state.h \
        envelope.h filter.c flags.c format_flags.h from.c getdomain.c group.c \
        handler.c hdrline.c header.h headers.c help.c history.c hook.c \
-       init.c keymap.c lib.c list.h main.c mbox.c mbyte.c mbyte_table.h \
+       init.c keymap.c list.h main.c mbox.c mbyte.c mbyte_table.h \
        menu.c mh.c muttlib.c mutt_idna.c mutt_sasl_plain.c mutt_socket.c \
        mutt_tunnel.c mx.c newsrc.c nntp.c options.h pager.c parameter.c parameter.h \
        parse.c pattern.c pattern.h pop.c pop_auth.c pop_lib.c postpone.c \
@@ -85,7 +85,7 @@ EXTRA_mutt_SOURCES = browser.h mbyte.h mutt_idna.c mutt_idna.h \
 EXTRA_DIST = account.h attach.h bcache.h browser.h buffy.h \
        ChangeLog.md charset.h CODE_OF_CONDUCT.md compress.h copy.h \
        COPYRIGHT filter.h functions.h gen_defs globals.h \
-       group.h history.h init.h keymap.h lib.h LICENSE.md mailbox.h \
+       group.h history.h init.h keymap.h LICENSE.md mailbox.h \
        mapping.h mbyte.h mime.h mime.types mutt.h mutt_commands.h \
        mutt_curses.h mutt_idna.h mutt_lua.h mutt_menu.h mutt_notmuch.h \
        mutt_options.h mutt_regex.h mutt_sasl.h mutt_sasl_plain.h \
@@ -98,7 +98,7 @@ EXTRA_DIST = account.h attach.h bcache.h browser.h buffy.h \
 
 EXTRA_SCRIPTS =
 
-pgpring_SOURCES = lib.c pgppubring.c
+pgpring_SOURCES = pgppubring.c
 pgpring_LDADD = $(LIBOBJS) $(NCRYPT_LIBS) $(INTLLIBS) $(LIBLIB)
 pgpring_DEPENDENCIES = $(LIBOBJS) $(NCRYPT_DEPS) $(INTLDEPS) $(LIBLIBDEPS)
 
index 3eedcfedc23bb36c9d3a62e0f03a162fc44f93f7..fe7693f0ac860ed877798dee5c4c2797d555c18f 100644 (file)
--- a/account.c
+++ b/account.c
@@ -28,7 +28,6 @@
 #include "mutt.h"
 #include "account.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 #include "protos.h"
index 4d99a8e5cd3e62f36444648ba549ec535cc943be..4a0ebce7116d71fd4a09e58076389e323f456739 100644 (file)
@@ -30,7 +30,6 @@
 #include "globals.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mapping.h"
 #include "mutt_curses.h"
diff --git a/alias.c b/alias.c
index 32ee6de5b4f7f603ab6ffc8a804521b8bc215f53..f5c7b0a90d76e70d0e00ebd86556d82e0c17804e 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -36,7 +36,6 @@
 #include "charset.h"
 #include "envelope.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mutt_curses.h"
index 42a9cd63faa4ac13f5747686457061a8386def69..c491c571cb45865ffd28ffcc8e6a467921976c7c 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -36,7 +36,6 @@
 #include "filter.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index 095a23668e224a6ada6f220d55c5c4b0dc5c47f9..4b2005412b1e913ef66b6cb94f127015aa7e897d 100644 (file)
--- a/bcache.c
+++ b/bcache.c
@@ -32,7 +32,6 @@
 #include "bcache.h"
 #include "account.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "protos.h"
 #include "url.h"
index 0996b6029c63a68f975e83ec9ee992a45b75d411..5b8ee074deffc9f82d464a9f97e29e00253cd3ed 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -48,7 +48,6 @@
 #include "globals.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mapping.h"
diff --git a/buffy.c b/buffy.c
index ec92b53abc72535210013e2b71cfd44864780539..d96d43618c41636e937ebba2edfe6360e026e441 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -33,7 +33,6 @@
 #include "context.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mutt.h"
index cabc2fd6b498d7e8a1ea5a8e17d0038ac483d6cf..445666bda41cd20d4d12958c632ccbd06fdafccf 100644 (file)
--- a/charset.c
+++ b/charset.c
@@ -30,7 +30,6 @@
 #include "mutt.h"
 #include "charset.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "protos.h"
 
diff --git a/color.c b/color.c
index ec35c57ebfc5cc634d9bb18849f1d390f6f1b6ba..5d372d8f0045ea1da5e56c8cc52cd4b05b94ff90 100644 (file)
--- a/color.c
+++ b/color.c
@@ -31,7 +31,6 @@
 #include "globals.h"
 #include "header.h"
 #include "keymap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mapping.h"
 #include "mutt_curses.h"
index f8993be2d3eb2059c7fac80ec5f70b77b1d20c9e..213525bd547a5f7b030e489d1146bcb3e3755afd 100644 (file)
@@ -44,7 +44,6 @@
 #include "globals.h"
 #include "header.h"
 #include "keymap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mime.h"
index 31c6d72e468ddc7379669f430a75831e7ddc29bb..f8a50680f57cd06e2ca267c7b15d97b3215d64d9 100644 (file)
@@ -27,7 +27,6 @@
 #include <string.h>
 #include <sys/stat.h>
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 #include "protos.h"
index 940be255e2ce6b93dd58152804655b649a50655f..0dbd737898ed172ceaff1a131a384958dfce2a12 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -42,7 +42,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index 87f7aa1516e4e6f8ebead70dee55ff9db1f3389c..f95eac7cd019570abab6443c5af49223a8765740 100644 (file)
@@ -32,7 +32,6 @@
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mutt_curses.h"
diff --git a/copy.c b/copy.c
index 82aa477cdd7adc340847b6104b6c9c5bff6acb8a..c28818bc28bdeb2e2f3cb61867379b4593319b3f 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -33,7 +33,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index 6515d4708ac083801de409355c9acf34ceb13082..141ab47922dd728ebedd8a0e29074aafa89fba4d 100644 (file)
@@ -43,7 +43,6 @@
 #include "enter_state.h"
 #include "globals.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mbyte.h"
 #include "mutt_curses.h"
index 7c0193c4ff1b02100ea6b5d6a129b5c79f698327..d9aa77f6ac15d915098db0d94e4dc3ffa638a6c0 100644 (file)
@@ -40,7 +40,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
diff --git a/edit.c b/edit.c
index 3aa5a0868fd8ac8a9e40262e8795db7cd375efd0..19b5e8093db1bcb1e640c7198869ff691badcea1 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -38,7 +38,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "mutt_idna.h"
index 843d9927de57fa644ca71f593a90e3ba0123dde8..a10cdf7d80fc863876b238c0ab2d25937d149b38 100644 (file)
--- a/editmsg.c
+++ b/editmsg.c
@@ -36,7 +36,6 @@
 #include "copy.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mx.h"
diff --git a/enter.c b/enter.c
index 86ba3fe81d42fdf034431ba3c078a8464e81efe1..ec2b132d42fd20d349035ce7be76b9b25cd35eaa 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -33,7 +33,6 @@
 #include "history.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mbyte.h"
 #include "mutt_curses.h"
index c31153710bba1824e7a438c869e8ab2ea2a05dcf..87c1822600ebf4cf7d9e3cd6afd7a9250e5e2aaf 100644 (file)
@@ -24,7 +24,6 @@
 #define _MUTT_ENTER_STATE_H
 
 #include <stddef.h>
-#include "lib.h"
 #include "lib/lib.h"
 
 /**
index d73e4993f43b680e3a5e9dc945289e82f2c6aaa4..3925a79057054c622338b83d0a200881d5f06c34 100644 (file)
@@ -24,7 +24,6 @@
 #define _MUTT_ENVELOPE_H
 
 #include <stdbool.h>
-#include "lib.h"
 #include "lib/lib.h"
 
 /**
diff --git a/flags.c b/flags.c
index b619648ed206c520d86dea831bcea3bcec0f4cab..e7d1afcfe0877eb59234d7eb4a4bd4b6b6895dbd 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -27,7 +27,6 @@
 #include "context.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "mutt_menu.h"
diff --git a/from.c b/from.c
index 14b78e651d32478356080869309bf2b833efa7d3..ef49ac94f15611c437f6d9a28a2301cace1738e7 100644 (file)
--- a/from.c
+++ b/from.c
@@ -27,7 +27,6 @@
 #include <string.h>
 #include <time.h>
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "protos.h"
 
index 7203d13e2d718ec4f3b53a924ff3ecb72d694739..ff4baeacec52f554f16d2ac8039a4c4fcae34c01 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/socket.h>
 #include <time.h>
 #include <unistd.h>
-#include "lib.h"
 #include "lib/lib.h"
 
 int getdnsdomainname(char *d, size_t len)
index 4cb791ee7c84107595ad565dca571dc4631da4f6..1a0659e02edc0eeac75f1930f84722caa26e78b8 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -24,7 +24,6 @@
 #define _MUTT_GLOBALS_H
 
 #include <signal.h>
-#include "lib.h"
 #include "lib/lib.h"
 #include "where.h"
 #include "mutt_regex.h"
diff --git a/group.c b/group.c
index 1dfaeebdefd5e9a91dd659b83484ba31e74949a3..05acb7641902d7bd10a21680ee5b70835b51e407 100644 (file)
--- a/group.c
+++ b/group.c
@@ -27,7 +27,6 @@
 #include "group.h"
 #include "address.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "protos.h"
index 83f662e728514f6d67a95590b4e0a55642f2e8d9..979659fc77ceb4a0947d6f444d8550e481cbca7e 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -43,7 +43,6 @@
 #include "globals.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mime.h"
index c83c0592894784a0feaa779ec9fd51d8a9213db7..7b716b9d0a51404eae5c2d4fdf99ed7ff9905894 100644 (file)
@@ -34,7 +34,6 @@
 #include <unistd.h>
 #include "backend.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mx.h"
 
index d1c9aa28ae5eba9e2617b3ef201d90ff8684fadc..46ff12e89f1c01f907be4ada90663fd4c4f34d4a 100644 (file)
@@ -28,7 +28,6 @@
 #include <gdbm.h>
 #include "backend.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 
 static void *hcache_gdbm_open(const char *path)
index c4c1c3fa24a11af7d010ce24ab445df756ef3d22..9efd496740c89791a41a08d22cb290c088c54eed 100644 (file)
@@ -48,7 +48,6 @@
 #include "hcache.h"
 #include "hcversion.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mbyte.h"
index bb35baa12d9ec8bd6d82f9eee4bfc289207881cd..2fa05fbaf11ad200b480ba2c1fa8c21e404d2d50 100644 (file)
@@ -28,7 +28,6 @@
 #include <limits.h>
 #include <stdio.h>
 #include "backend.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 
index 4fb0f24017f297e4aa6d2b5efa0069d2a9e3ef0e..a399f2936125f163f8277e0595136705dbb30407 100644 (file)
@@ -27,7 +27,6 @@
 #include <stddef.h>
 #include <lmdb.h>
 #include "backend.h"
-#include "lib.h"
 #include "lib/lib.h"
 
 /** The maximum size of the database file (2GiB).
index 0f50c6de47db533c2a402a296be01c13783efb56..f4815eaec5856cc36370db34db6b00547e59edc6 100644 (file)
@@ -28,7 +28,6 @@
 #include <depot.h>
 #include <villa.h>
 #include "backend.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 
index e175478799e38ce92d68d5810e89129da6799b44..32e698c0482fcc380cbdaa5c4a6c6b8b8fe07e45 100644 (file)
@@ -28,7 +28,6 @@
 #include <tcbdb.h>
 #include <tcutil.h>
 #include "backend.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 
index b732afa2955471edee5b112c80a8f3e2f342034a..f13c878b9ea5781f584803a099c3b5ebe85c2f97 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -38,7 +38,6 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mbyte_table.h"
 #include "mutt_curses.h"
index 61340a8d87a5d859865d85b34ffa30817e912df5..9a458c88ddfd6ec798bf52fba8d0a14901f98538 100644 (file)
--- a/header.h
+++ b/header.h
@@ -26,7 +26,6 @@
 #include <stddef.h>
 #include <stdbool.h>
 #include <time.h>
-#include "lib.h"
 
 /**
  * struct Header - The header/envelope of an email
index 181074e1d2e32608f9468fba1a397e75ac5ca57d..3b5b4a4b8c36016cda87ee506865d1d887a5c462 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -35,7 +35,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mutt_idna.h"
diff --git a/help.c b/help.c
index 517d317412a50fc71ec534d44100b36ea581c260..2a0e46fe2a1cc21b0faf635a5be7b262c5566851 100644 (file)
--- a/help.c
+++ b/help.c
@@ -33,7 +33,6 @@
 #include "globals.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mapping.h"
 #include "mbyte.h"
index f9576b4b85b51674f12efe38c1497a8bcde4a334..4a05ee549d36f32d35490c3e2d0060e3660a8ead 100644 (file)
--- a/history.c
+++ b/history.c
@@ -29,7 +29,6 @@
 #include "history.h"
 #include "charset.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "protos.h"
 
diff --git a/hook.c b/hook.c
index c6c1e4b7de365ba59d86371028e7726a881e7aff..0db8af77731e535cf0503bff1c7e0e5edf5896f7 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -34,7 +34,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index c7e832f5b0933c7f4e0b946b9c49bcfae6ed4cbf..347e9ef38c2b5e5ecdfaaad1a64901fad138f1cc 100644 (file)
@@ -28,7 +28,6 @@
 #include <string.h>
 #include "auth.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "protos.h"
 
index ceeea060a196874025a57fd85b6420595428a332..527964b107b46367cf13c9ab910006f51aec8d88 100644 (file)
@@ -27,7 +27,6 @@
 #include "account.h"
 #include "auth.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_socket.h"
 #include "options.h"
index d389a3640c1fa606eb0df4c372193cf3926c6185..61142e9da3577e303e2defa03d0f2fe8466fd6b4 100644 (file)
@@ -29,7 +29,6 @@
 #include "account.h"
 #include "auth.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_socket.h"
 #include "options.h"
index c0fb1df4496003e872f134cc1f6f6586ff6de178..42600ab2330f102e9d218a534e632ac60f5a2d78 100644 (file)
 #include "account.h"
 #include "auth.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_socket.h"
 #include "options.h"
 #include "protos.h"
+#include "mutt.h"
 #ifdef HAVE_HEIMDAL
 #include <gssapi/gssapi.h>
 #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
index 4d19123497dcad1cb63ab0c071fa3357124feec4..8ae9014cb081e06fc43053f58fb3eeb30006bc72 100644 (file)
 #include "account.h"
 #include "auth.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_socket.h"
 #include "options.h"
 #include "protos.h"
+#include "mutt.h"
 
 /**
  * imap_auth_login - Plain LOGIN support
index 2db64f5ae410fe5ed2f17e5ee72ad1f564cc337c..4bd13eff57e6788a64e3663aa1e7723f2c294f5e 100644 (file)
@@ -28,7 +28,6 @@
 #include "account.h"
 #include "auth.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_sasl_plain.h"
 #include "mutt_socket.h"
index 360ed6ce645296ccd8d195c932423ff124ead69f..d33239b41992da9daace81262e31a4dc28b6b9cf 100644 (file)
@@ -32,7 +32,6 @@
 #include "account.h"
 #include "auth.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_sasl.h"
 #include "mutt_socket.h"
index b68d9eee177eb381d7cad84ab1e2761caa631549..85364dc35f29792a76ca24d17f951078b2ffeb78 100644 (file)
@@ -37,7 +37,6 @@
 #include "context.h"
 #include "globals.h"
 #include "imap/imap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_regex.h"
 #include "options.h"
index 5d2d78d51e21c5080aec7fcba83013ce4c38f96f..7d5764f94f3c9fc99ddeed9cc822f28e0688780a 100644 (file)
@@ -39,7 +39,6 @@
 #include "globals.h"
 #include "header.h"
 #include "imap/imap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "message.h"
index a83b2e0adf0db0444245797a9361b65421ff9840..9627d63565ccc23674e4e91dc820cee686a05a92 100644 (file)
@@ -45,7 +45,6 @@
 #include "globals.h"
 #include "header.h"
 #include "imap/imap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index b055a0c7f956758af8e81093409a67b90f027476..b1816d6c271356990390a00669e9cc7c9626f32f 100644 (file)
@@ -41,7 +41,6 @@
 #include "globals.h"
 #include "header.h"
 #include "imap/imap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index 4be19ce24b46730b7450d0a3f9e3646813ff176b..220271ed4c332738e79dbb8c03cc297b3cfa2a69 100644 (file)
@@ -25,7 +25,6 @@
 #include "imap_private.h"
 #include "charset.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 
 // clang-format off
index a424465b5de9ca3c8f06d6803d97d0a73cc4304d..b4552282e05dff0ac204e9980c764914d66c438d 100644 (file)
@@ -44,7 +44,6 @@
 #include "globals.h"
 #include "header.h"
 #include "imap/imap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
diff --git a/init.c b/init.c
index a37b90255ec30fb783efafa4e4232f5fb55e579f..6427341cdc3e9705be5adb069e9b5533d62f3996 100644 (file)
--- a/init.c
+++ b/init.c
@@ -50,7 +50,6 @@
 #include "header.h"
 #include "history.h"
 #include "keymap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index e5da8fa587f24d597d28290c793a0c64f547e1cd..38f9b24d494a2c12753dee8bf80cf981667962e4 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -31,7 +31,6 @@
 #include "functions.h"
 #include "globals.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mapping.h"
 #include "mutt.h"
diff --git a/lib.c b/lib.c
deleted file mode 100644 (file)
index ed7882c..0000000
--- a/lib.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * @file
- * Some very miscellaneous functions
- *
- * @authors
- * Copyright (C) 1996-2000,2007,2010 Michael R. Elkins <me@mutt.org>
- * Copyright (C) 1999-2004,2006-2007 Thomas Roessler <roessler@does-not-exist.org>
- *
- * @copyright
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * This file used to contain some more functions, namely those
- * which are now in muttlib.c.  They have been removed, so we have
- * some of our "standard" functions in external programs, too.
- */
-
-#include "config.h"
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <time.h>
-#include <unistd.h>
-#include "lib.h"
-#include "lib/lib.h"
-
-#ifdef HAVE_SYSEXITS_H
-#include <sysexits.h>
-#else /* Make sure EX_OK is defined <philiph@pobox.com> */
-#define EX_OK 0
-#endif
-
-/**
- * struct SysExits - Lookup table of error messages
- */
-static const struct SysExits
-{
-  int v;
-  const char *str;
-} sysexits_h[] = {
-#ifdef EX_USAGE
-  { 0xff & EX_USAGE, "Bad usage." },
-#endif
-#ifdef EX_DATAERR
-  { 0xff & EX_DATAERR, "Data format error." },
-#endif
-#ifdef EX_NOINPUT
-  { 0xff & EX_NOINPUT, "Cannot open input." },
-#endif
-#ifdef EX_NOUSER
-  { 0xff & EX_NOUSER, "User unknown." },
-#endif
-#ifdef EX_NOHOST
-  { 0xff & EX_NOHOST, "Host unknown." },
-#endif
-#ifdef EX_UNAVAILABLE
-  { 0xff & EX_UNAVAILABLE, "Service unavailable." },
-#endif
-#ifdef EX_SOFTWARE
-  { 0xff & EX_SOFTWARE, "Internal error." },
-#endif
-#ifdef EX_OSERR
-  { 0xff & EX_OSERR, "Operating system error." },
-#endif
-#ifdef EX_OSFILE
-  { 0xff & EX_OSFILE, "System file missing." },
-#endif
-#ifdef EX_CANTCREAT
-  { 0xff & EX_CANTCREAT, "Can't create output." },
-#endif
-#ifdef EX_IOERR
-  { 0xff & EX_IOERR, "I/O error." },
-#endif
-#ifdef EX_TEMPFAIL
-  { 0xff & EX_TEMPFAIL, "Deferred." },
-#endif
-#ifdef EX_PROTOCOL
-  { 0xff & EX_PROTOCOL, "Remote protocol error." },
-#endif
-#ifdef EX_NOPERM
-  { 0xff & EX_NOPERM, "Insufficient permission." },
-#endif
-#ifdef EX_CONFIG
-  { 0xff & EX_NOPERM, "Local configuration error." },
-#endif
-  { S_ERR, "Exec error." },
-  { -1, NULL },
-};
-
-void mutt_nocurses_error(const char *fmt, ...)
-{
-  va_list ap;
-
-  va_start(ap, fmt);
-  vfprintf(stderr, fmt, ap);
-  va_end(ap);
-  fputc('\n', stderr);
-}
-
-const char *mutt_strsysexit(int e)
-{
-  int i;
-
-  for (i = 0; sysexits_h[i].str; i++)
-  {
-    if (e == sysexits_h[i].v)
-      break;
-  }
-
-  return sysexits_h[i].str;
-}
-
-#ifdef DEBUG
-char debugfilename[_POSIX_PATH_MAX];
-FILE *debugfile = NULL;
-int debuglevel;
-char *debugfile_cmdline = NULL;
-int debuglevel_cmdline;
-
-void mutt_debug(int level, const char *fmt, ...)
-{
-  va_list ap;
-  time_t now = time(NULL);
-  static char buf[23] = "";
-  static time_t last = 0;
-
-  if (debuglevel < level || !debugfile)
-    return;
-
-  if (now > last)
-  {
-    strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", localtime(&now));
-    last = now;
-  }
-  fprintf(debugfile, "[%s] ", buf);
-  va_start(ap, fmt);
-  vfprintf(debugfile, fmt, ap);
-  va_end(ap);
-}
-#endif
-
-/**
- * mutt_inbox_cmp - do two folders share the same path and one is an inbox
- * @param a First path
- * @param b Second path
- * @retval -1 if a is INBOX of b
- * @retval 0 if none is INBOX
- * @retval 1 if b is INBOX for a
- *
- * This function compares two folder paths. It first looks for the position of
- * the last common '/' character. If a valid position is found and it's not the
- * last character in any of the two paths, the remaining parts of the paths are
- * compared (case insensitively) with the string "INBOX". If one of the two
- * paths matches, it's reported as being less than the other and the function
- * returns -1 (a < b) or 1 (a > b). If no paths match the requirements, the two
- * paths are considered equivalent and this function returns 0.
- *
- * Examples:
- * * mutt_inbox_cmp("/foo/bar",      "/foo/baz") --> 0
- * * mutt_inbox_cmp("/foo/bar/",     "/foo/bar/inbox") --> 0
- * * mutt_inbox_cmp("/foo/bar/sent", "/foo/bar/inbox") --> 1
- * * mutt_inbox_cmp("=INBOX",        "=Drafts") --> -1
- */
-int mutt_inbox_cmp(const char *a, const char *b)
-{
-  /* fast-track in case the paths have been mutt_pretty_mailbox'ified */
-  if (a[0] == '=' && b[0] == '=')
-    return (mutt_strcasecmp(a + 1, "inbox") == 0) ?
-               -1 :
-               (mutt_strcasecmp(b + 1, "inbox") == 0) ? 1 : 0;
-
-  const char *a_end = strrchr(a, '/');
-  const char *b_end = strrchr(b, '/');
-
-  /* If one path contains a '/', but not the other */
-  if (!a_end ^ !b_end)
-    return 0;
-
-  /* If neither path contains a '/' */
-  if (!a_end)
-    return 0;
-
-  /* Compare the subpaths */
-  size_t a_len = a_end - a;
-  size_t b_len = b_end - b;
-  size_t min = MIN(a_len, b_len);
-  int same = (a[min] == '/') && (b[min] == '/') && (a[min + 1] != '\0') &&
-             (b[min + 1] != '\0') && (mutt_strncasecmp(a, b, min) == 0);
-
-  if (!same)
-    return 0;
-
-  if (mutt_strcasecmp(&a[min + 1], "inbox") == 0)
-    return -1;
-
-  if (mutt_strcasecmp(&b[min + 1], "inbox") == 0)
-    return 1;
-
-  return 0;
-}
-
diff --git a/lib.h b/lib.h
deleted file mode 100644 (file)
index 0935b84..0000000
--- a/lib.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file
- * Some very miscellaneous functions
- *
- * @authors
- * Copyright (C) 1996-2000,2007,2010,2012 Michael R. Elkins <me@mutt.org>
- * Copyright (C) 1999-2005,2007 Thomas Roessler <roessler@does-not-exist.org>
- *
- * @copyright
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-/* mutt functions which are generally useful. */
-
-#ifndef _MUTT_LIB_H
-#define _MUTT_LIB_H
-
-#include <ctype.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-
-/* Use this with care.  If the compiler can't see the array
- * definition, it obviously won't produce a correct result. */
-#define mutt_array_size(x) (sizeof(x) / sizeof((x)[0]))
-
-/* For mutt_simple_format() justifications */
-/* Making left 0 and center -1 is of course completely nonsensical, but
- * it retains compatibility for any patches that call mutt_simple_format.
- * Once patches are updated to use FMT_*, these can be made sane. */
-#define FMT_LEFT   0
-#define FMT_RIGHT  1
-#define FMT_CENTER -1
-
-#ifdef DEBUG
-extern char debugfilename[_POSIX_PATH_MAX];
-extern FILE *debugfile;
-extern int debuglevel;
-extern char *debugfile_cmdline;
-extern int debuglevel_cmdline;
-#endif
-
-/* Exit values used in send_msg() */
-#define S_ERR 127
-#define S_BKG 126
-
-int safe_asprintf(char **, const char *, ...);
-
-void mutt_nocurses_error(const char *, ...);
-int mutt_inbox_cmp(const char *a, const char *b);
-
-const char *mutt_strsysexit(int e);
-
-#endif /* _MUTT_LIB_H */
diff --git a/list.h b/list.h
index ed48213f1ab3cfbe716d67ae0571655e99c6879e..7723e0fdc035266edb412513e9e71e56e2607468 100644 (file)
--- a/list.h
+++ b/list.h
@@ -23,7 +23,6 @@
 #ifndef _MUTT_LIST_H
 #define _MUTT_LIST_H
 
-#include "lib.h"
 
 /**
  * struct List - Singly-linked List type
diff --git a/main.c b/main.c
index d20cb882870dee8394e567c5b3cd1848dc379610..e7a72bcec2abd6a37a382c4ad2f6f1510af7b6ca 100644 (file)
--- a/main.c
+++ b/main.c
@@ -44,7 +44,6 @@
 #include "globals.h"
 #include "header.h"
 #include "keymap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
diff --git a/mbox.c b/mbox.c
index 8355feeed8120fabe19eabdffa8ef9bff80e9090..9c186f5d95eb708606feb1281b2390797ff0d480 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -41,7 +41,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
diff --git a/mbyte.c b/mbyte.c
index bfc98139fa15da8869a9f3f6da799c46ab5be909..a1bd0b45562ae9aa7d47b376ed82c317c77f5a71 100644 (file)
--- a/mbyte.c
+++ b/mbyte.c
@@ -32,7 +32,6 @@
 #include <wchar.h>
 #include "mbyte.h"
 #include "charset.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 #include "protos.h"
diff --git a/menu.c b/menu.c
index 3110cc1337e79259008b866826bbda8692e5f784..617ec349a71dd1dd526f28dd2ae69b34b7ed238c 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -33,7 +33,6 @@
 #include "globals.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mbyte.h"
 #include "mutt_curses.h"
diff --git a/mh.c b/mh.c
index a1c83c1f6af9e88093793b33255c6155138c4f91..9bcb863dac6b5344c5f71a8e6ce626f19a2b73aa 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -51,7 +51,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mutt_curses.h"
diff --git a/mutt.h b/mutt.h
index d63f5b23bd201011c79ae994c8d9c98a22ad715f..4c7ac3e1cf429ed80e1f65d8a3797cc057edd28d 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -359,4 +359,34 @@ struct AttachMatch
 
 #define EXECSHELL "/bin/sh"
 
+/* Use this with care.  If the compiler can't see the array
+ * definition, it obviously won't produce a correct result. */
+#define mutt_array_size(x) (sizeof(x) / sizeof((x)[0]))
+
+/* For mutt_simple_format() justifications */
+/* Making left 0 and center -1 is of course completely nonsensical, but
+ * it retains compatibility for any patches that call mutt_simple_format.
+ * Once patches are updated to use FMT_*, these can be made sane. */
+#define FMT_LEFT   0
+#define FMT_RIGHT  1
+#define FMT_CENTER -1
+
+/* Exit values used in send_msg() */
+#define S_ERR 127
+#define S_BKG 126
+
+int safe_asprintf(char **, const char *, ...);
+
+int mutt_inbox_cmp(const char *a, const char *b);
+
+const char *mutt_strsysexit(int e);
+
+#ifdef DEBUG
+extern char debugfilename[_POSIX_PATH_MAX];
+extern FILE *debugfile;
+extern int debuglevel;
+extern char *debugfile_cmdline;
+extern int debuglevel_cmdline;
+#endif
+
 #endif /* _MUTT_H */
index b49943e25194bde33e4f3f7d259f0f9082bb1903..4915f9af4769c1b6b6a250a7db940cdc3a321b6e 100644 (file)
@@ -25,7 +25,6 @@
 #define _MUTT_CURSES_H
 
 #include <regex.h>
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 
index de5fb27733339e362d8dc85f6cd0bf64a552718d..ddd401ca11489d73a59d3a5d722144d81734d1ca 100644 (file)
@@ -29,7 +29,6 @@
 #include "charset.h"
 #include "envelope.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 
index f945e59bf82f47360093adbf55a2913fcfb63852..4121cfe1dd62c9ff27fe7a08a5121c587d1aa102 100644 (file)
@@ -32,7 +32,6 @@
 #include "mutt.h"
 #include "mutt_lua.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mbyte_table.h"
index e7778996c5e79a0ba03197642d0fd0aa2a08e624..1439af533c2095c0c53ef847eec937dc6ea1f6f4 100644 (file)
@@ -54,7 +54,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mutt_curses.h"
index 9694f364a422b92f0757bdd710185532c1e7b83b..81ef916fa8b996006994c7b271458da4c0bbe3e5 100644 (file)
@@ -31,7 +31,6 @@
 #include <sys/socket.h>
 #include "mutt_sasl.h"
 #include "account.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_socket.h"
 #include "options.h"
index 19c6b19c3bf8c074c0fc9a33eb75cbf7892bfde7..011a15bb6b059e25c1f8f6afd337e9d6f013837b 100644 (file)
@@ -23,7 +23,6 @@
 #include "config.h"
 #include <stdio.h>
 #include "mutt_sasl_plain.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "protos.h"
 
index 682b6aea68556e381eea901c246e52bcaa0d9506..afe55d7fbd732ded33f3cd22327358df0e2dd698 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <stddef.h>
 #include "account.h"
-#include "lib.h"
 #include "lib/lib.h"
 
 /* logging levels */
index 7963d620b27f0e598f45a7e7bc09bc2e357efca0..bbef1ad7d2d6a146aa812848ac12350f48aa32d1 100644 (file)
@@ -47,7 +47,6 @@
 #include "globals.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_idna.h"
 #include "mutt_menu.h"
index 3311001c83a4b3da96077b938d39d04edff22dac..446fd8af76ae618b9f6e977f719be982fe353540 100644 (file)
@@ -35,7 +35,6 @@
 #include "globals.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_menu.h"
 #include "mutt_regex.h"
index c457390e7997b45c2b5602e9a2596148465ee6d5..3016b8b8dff53b293a56819b680693a4edd64bb0 100644 (file)
@@ -34,7 +34,6 @@
 #include "mutt_tunnel.h"
 #include "account.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_socket.h"
 #include "protos.h"
index 7bd4375e2893dbcbd1c17e7a366e4d3b2c062b98..dcb8fea61ec11c5d0a70e176c71230478404f744 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -52,7 +52,6 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
@@ -2234,3 +2233,169 @@ void mutt_get_parent_path(char *output, char *path, size_t olen)
     }
   }
 }
+
+#ifdef HAVE_SYSEXITS_H
+#include <sysexits.h>
+#else /* Make sure EX_OK is defined <philiph@pobox.com> */
+#define EX_OK 0
+#endif
+
+/**
+ * struct SysExits - Lookup table of error messages
+ */
+static const struct SysExits
+{
+  int v;
+  const char *str;
+} sysexits_h[] = {
+#ifdef EX_USAGE
+  { 0xff & EX_USAGE, "Bad usage." },
+#endif
+#ifdef EX_DATAERR
+  { 0xff & EX_DATAERR, "Data format error." },
+#endif
+#ifdef EX_NOINPUT
+  { 0xff & EX_NOINPUT, "Cannot open input." },
+#endif
+#ifdef EX_NOUSER
+  { 0xff & EX_NOUSER, "User unknown." },
+#endif
+#ifdef EX_NOHOST
+  { 0xff & EX_NOHOST, "Host unknown." },
+#endif
+#ifdef EX_UNAVAILABLE
+  { 0xff & EX_UNAVAILABLE, "Service unavailable." },
+#endif
+#ifdef EX_SOFTWARE
+  { 0xff & EX_SOFTWARE, "Internal error." },
+#endif
+#ifdef EX_OSERR
+  { 0xff & EX_OSERR, "Operating system error." },
+#endif
+#ifdef EX_OSFILE
+  { 0xff & EX_OSFILE, "System file missing." },
+#endif
+#ifdef EX_CANTCREAT
+  { 0xff & EX_CANTCREAT, "Can't create output." },
+#endif
+#ifdef EX_IOERR
+  { 0xff & EX_IOERR, "I/O error." },
+#endif
+#ifdef EX_TEMPFAIL
+  { 0xff & EX_TEMPFAIL, "Deferred." },
+#endif
+#ifdef EX_PROTOCOL
+  { 0xff & EX_PROTOCOL, "Remote protocol error." },
+#endif
+#ifdef EX_NOPERM
+  { 0xff & EX_NOPERM, "Insufficient permission." },
+#endif
+#ifdef EX_CONFIG
+  { 0xff & EX_NOPERM, "Local configuration error." },
+#endif
+  { S_ERR, "Exec error." },
+  { -1, NULL },
+};
+
+const char *mutt_strsysexit(int e)
+{
+  int i;
+
+  for (i = 0; sysexits_h[i].str; i++)
+  {
+    if (e == sysexits_h[i].v)
+      break;
+  }
+
+  return sysexits_h[i].str;
+}
+
+#ifdef DEBUG
+char debugfilename[_POSIX_PATH_MAX];
+FILE *debugfile = NULL;
+int debuglevel;
+char *debugfile_cmdline = NULL;
+int debuglevel_cmdline;
+
+void mutt_debug(int level, const char *fmt, ...)
+{
+  va_list ap;
+  time_t now = time(NULL);
+  static char buf[23] = "";
+  static time_t last = 0;
+
+  if (debuglevel < level || !debugfile)
+    return;
+
+  if (now > last)
+  {
+    strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", localtime(&now));
+    last = now;
+  }
+  fprintf(debugfile, "[%s] ", buf);
+  va_start(ap, fmt);
+  vfprintf(debugfile, fmt, ap);
+  va_end(ap);
+}
+#endif
+
+/**
+ * mutt_inbox_cmp - do two folders share the same path and one is an inbox
+ * @param a First path
+ * @param b Second path
+ * @retval -1 if a is INBOX of b
+ * @retval 0 if none is INBOX
+ * @retval 1 if b is INBOX for a
+ *
+ * This function compares two folder paths. It first looks for the position of
+ * the last common '/' character. If a valid position is found and it's not the
+ * last character in any of the two paths, the remaining parts of the paths are
+ * compared (case insensitively) with the string "INBOX". If one of the two
+ * paths matches, it's reported as being less than the other and the function
+ * returns -1 (a < b) or 1 (a > b). If no paths match the requirements, the two
+ * paths are considered equivalent and this function returns 0.
+ *
+ * Examples:
+ * * mutt_inbox_cmp("/foo/bar",      "/foo/baz") --> 0
+ * * mutt_inbox_cmp("/foo/bar/",     "/foo/bar/inbox") --> 0
+ * * mutt_inbox_cmp("/foo/bar/sent", "/foo/bar/inbox") --> 1
+ * * mutt_inbox_cmp("=INBOX",        "=Drafts") --> -1
+ */
+int mutt_inbox_cmp(const char *a, const char *b)
+{
+  /* fast-track in case the paths have been mutt_pretty_mailbox'ified */
+  if (a[0] == '=' && b[0] == '=')
+    return (mutt_strcasecmp(a + 1, "inbox") == 0) ?
+               -1 :
+               (mutt_strcasecmp(b + 1, "inbox") == 0) ? 1 : 0;
+
+  const char *a_end = strrchr(a, '/');
+  const char *b_end = strrchr(b, '/');
+
+  /* If one path contains a '/', but not the other */
+  if (!a_end ^ !b_end)
+    return 0;
+
+  /* If neither path contains a '/' */
+  if (!a_end)
+    return 0;
+
+  /* Compare the subpaths */
+  size_t a_len = a_end - a;
+  size_t b_len = b_end - b;
+  size_t min = MIN(a_len, b_len);
+  int same = (a[min] == '/') && (b[min] == '/') && (a[min + 1] != '\0') &&
+             (b[min + 1] != '\0') && (mutt_strncasecmp(a, b, min) == 0);
+
+  if (!same)
+    return 0;
+
+  if (mutt_strcasecmp(&a[min + 1], "inbox") == 0)
+    return -1;
+
+  if (mutt_strcasecmp(&b[min + 1], "inbox") == 0)
+    return 1;
+
+  return 0;
+}
+
diff --git a/mx.c b/mx.c
index 71ae67053b0add1b106badd2de5d6b2ae92cd89b..cacdbda6ec3b4f462008380ee596856e9ee05916 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -44,7 +44,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "ncrypt/ncrypt.h"
index f7a7fa24e90cdb6308176f9a9826793947c25a57..cc0b1c9f3c4c51cb8a3d4f1879a467870a697636 100644 (file)
@@ -43,7 +43,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mime.h"
 #include "mutt_curses.h"
index 8e2edc0b7c5a62ec3eeea7e51382052e039cd1b2..9c4f73dbf8fa2765ff02a131621957859b8c243b 100644 (file)
@@ -55,7 +55,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mime.h"
index e04089719a6e2e3c156b2d02dc49d5ad53f1a89f..45e74f2bfed68cd2a40917751acf455fa89c653c 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "config.h"
 #include "crypt_mod.h"
-#include "lib.h"
 #include "lib/lib.h"
 
 /**
index 06ad5b720abf67da6f288e30ba2323a043359832..c489ddc02f5f67c2cea83e83ea042cf379f36b52 100644 (file)
@@ -36,7 +36,6 @@
 #include <stdio.h>
 #include "crypt_mod.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "ncrypt.h"
 #include "options.h"
index cf857a3663348c39c941f9c9f325865af3f77c15..5310ed8385f872f639c3ab70e1c40afb775bed14 100644 (file)
@@ -42,7 +42,6 @@
 #include "charset.h"
 #include "filter.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mime.h"
 #include "ncrypt.h"
index 07a6b42c47e0e449beca13721da832384a835307..2395c26a7cee0c0872dbc481572e38f50c411e92 100644 (file)
@@ -51,7 +51,6 @@
 #include "filter.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mime.h"
index ffbf8461ff7ba24f164a2e60dc4b9f6d8d05f7e6..4afa8700ce9aadf6f085fcabb62d7a5a8edb3814 100644 (file)
@@ -34,7 +34,6 @@
 #include "filter.h"
 #include "format_flags.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mutt_curses.h"
index 07fa5e75d2bdacf8c294d0ebdd66a5b5af593bee..0d99fa9f362572b3092bfa9f6043f2882601bab0 100644 (file)
@@ -43,7 +43,6 @@
 #include "gnupgparse.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mime.h"
 #include "mutt_curses.h"
index 968847f7ecf17363d1aeb8e89a8a5ab7e5f03beb..d6e23c53f52ee7ee816e69303e76bd973ddde727 100644 (file)
@@ -25,7 +25,6 @@
 #include "config.h"
 #include <stdbool.h>
 #include "pgplib.h"
-#include "lib.h"
 #include "lib/lib.h"
 
 const char *pgp_pkalgbytype(unsigned char type)
index 440d9b94b24106b9ad9bdd08ee576ad085ac4961..b58e26e6a38cd1d9a96cfbde62779435ce393192 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <stdbool.h>
 #include <time.h>
-#include "lib.h"
 #include "lib/lib.h"
 
 /**
index 01b42710a37773b44971577e0674cc7ceed3aa8a..33ed5bc1af9c7adfc7daf6766431a9fd2e03b548 100644 (file)
@@ -32,7 +32,6 @@
 #include <string.h>
 #include <unistd.h>
 #include "mutt.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "pgppacket.h"
 #include "protos.h"
index 543d9e159fb66dab1e4f3fb0ccbb95f2ecec738d..14a11187f7bd713e89597ba1820820ae8811d70a 100644 (file)
@@ -24,7 +24,6 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include "lib.h"
 #include "lib/lib.h"
 
 #define CHUNKSIZE 1024
index c2ab4ed26f0a7a14717f0c88db1648ebd00146ce..534a0beeefec0cc59f2135b77228b07f48b41a4a 100644 (file)
@@ -45,7 +45,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mime.h"
 #include "mutt_curses.h"
index 9cc0a3148b3558dd364e3421270d028428188a06..d53b9f789ee575adadd15e0e1b06baa019b9ba08 100644 (file)
--- a/newsrc.c
+++ b/newsrc.c
@@ -39,7 +39,6 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "mutt_socket.h"
diff --git a/nntp.c b/nntp.c
index e3c481a77553735152228baa69c27edf995bc03f..7afeb65fbe855d1f8e18b4ea0aa2218b619a0356 100644 (file)
--- a/nntp.c
+++ b/nntp.c
@@ -36,7 +36,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mutt_curses.h"
diff --git a/pager.c b/pager.c
index 259c0c4c3cf0c47bab0ae3a82c2774f1e5c7199d..9730c99d1849508ee3f164a8234048064c6516fa 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -45,7 +45,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mapping.h"
index b3e09d47f1a97090e75350b5123a4239e94a4ebb..ceff12f5f2b8debd382cd2adb98838b676bdc26b 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef _MUTT_PARAMETER_H
 #define _MUTT_PARAMETER_H
 
-#include "lib.h"
 #include "lib/lib.h"
 
 /**
diff --git a/parse.c b/parse.c
index d04633bc1da26797f77f66afc47e067cec3b2cba..1ab7e85de68fb8b486e20eb4ac042357898cfc65 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -34,7 +34,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index c6a929457d109270443f426acbcaef5dc5f5380a..636fa8bd619d20100833b7627f0feaf06ee7baaf 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -47,7 +47,6 @@
 #include "group.h"
 #include "header.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index ebd71c54a311214ff3100655f5767181e03d596c..ea17b7ab2fedf500261c707060a767fe98c3fb4a 100644 (file)
--- a/pattern.h
+++ b/pattern.h
@@ -26,7 +26,6 @@
 #include <regex.h>
 #include <stdbool.h>
 #include <stddef.h>
-#include "lib.h"
 #include "lib/lib.h"
 
 struct Address;
index 3d2081ae417f995b86b7f2352e4db520d1d9c846..bdd4545c7cf34cbe78087132454d3783a86a05f2 100644 (file)
@@ -42,7 +42,6 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
-#include "lib.h"
 #include "lib/lib.h"
 #include "ncrypt/ncrypt.h"
 #include "ncrypt/pgplib.h"
index e3e1333a878977654c1a1d7d9557f7decc435d0e..2b1399a3c998804486f150121c09711164a27e16 100644 (file)
@@ -55,7 +55,6 @@ imap/util.c
 init.c
 keymap.c
 keymap_alldefs.h
-lib.c
 lib/lib_ascii.c
 lib/lib_base64.c
 lib/lib_buffer.c
diff --git a/pop.c b/pop.c
index a5eab4961fb810709dd4b63d85ae2a346d45f629..8f4faa82e5114a3026a5499420a90844e7d349c4 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -37,7 +37,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mutt_curses.h"
index bc87975c2185decab67437904dfb5a07d95eb6dd..5800e08e4d6ce77a96921315e2b7a026fc325282 100644 (file)
@@ -26,7 +26,6 @@
 #include <string.h>
 #include "account.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_socket.h"
 #include "options.h"
index eba22e94e732d3aadf8efb3da045d1742b78cf20..7e7247bafa5ebb6ad58cf8a38c4b727388f22fef 100644 (file)
--- a/pop_lib.c
+++ b/pop_lib.c
@@ -33,7 +33,6 @@
 #include "context.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "mutt_socket.h"
index 39f522456a40cb2a49eecd18ea3ce632e3ffb0a9..b85dff305501e404ff37c5a0ecb971d98e394b3b 100644 (file)
@@ -38,7 +38,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
diff --git a/query.c b/query.c
index d939faa21eb649dddecc7ebee1cac6d96ddc1a97..37a92eca434dd6d3ab4f932b5748868a9877d107 100644 (file)
--- a/query.c
+++ b/query.c
@@ -38,7 +38,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mapping.h"
 #include "mutt_curses.h"
index 6d590ad23d61015bc3616ab462ad90b0b196178a..e3ef6c23f43eeb484dae69d6310d02d3c0575fb0 100644 (file)
@@ -40,7 +40,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mailbox.h"
 #include "mapping.h"
index daa5d055d1601e4101b605eed3112f87b6ff4624..40f6530e2bf62f13550122f42639122574a836f9 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -33,7 +33,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "mutt_idna.h"
index 40cf349d356caf2ccc05f78dba764f72e312902e..44a2a4676ebedc76941f5e0220edf8af8134cb8d 100644 (file)
@@ -40,7 +40,6 @@
 #include "header.h"
 #include "keymap.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mapping.h"
index a2e99fe6b4d4782fc9c64aef9f20bf94d169c578..0aba12ea23ee00c03e052542572d52424e446adb 100644 (file)
--- a/resize.c
+++ b/resize.c
@@ -26,7 +26,6 @@
 #include <stdlib.h>
 #include <termios.h>
 #include <unistd.h>
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #ifdef HAVE_SYS_IOCTL_H
index 134f54a4bbef43728612504279392a6601345ace..3163dd2d60b720ec811bb608af53bf21e9f77979 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -39,7 +39,6 @@
 #include "rfc1524.h"
 #include "body.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "options.h"
 #include "parameter.h"
index 45af27f552c3f27ad8cda80db601136730457de0..7d4f04b2c019a916f0e084030be676e4a266519b 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -30,7 +30,6 @@
 #include "address.h"
 #include "charset.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mbyte.h"
 #include "mime.h"
index 333c577944245a1aa406d171d21ea0ad7503b670..0e8213ffef0ffbfa90142f13ceb22fcebb98a705 100644 (file)
--- a/rfc2231.c
+++ b/rfc2231.c
@@ -37,7 +37,6 @@
 #include "rfc2231.h"
 #include "charset.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mbyte.h"
 #include "mime.h"
index 25c55895f5da7f4f7499db1cbeada064f6a554a7..f931d7012a4b59c68438f725628026cda9dcc2cf 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -35,7 +35,6 @@
 #include "body.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "options.h"
index b43d904d1e6414ce86742a27aecd61eeee8a0ee3..2eb0fef2f871a92766782dcdfbefabacecfa7ca3 100644 (file)
--- a/rfc822.h
+++ b/rfc822.h
@@ -27,7 +27,6 @@
 #include <stddef.h>
 #include <stdbool.h>
 #include "address.h"
-#include "lib.h"
 #include "lib/lib.h"
 
 /**
index 7111f6bba992ded3980d236c45f7f6eb0dae4e1f..1847068cfbde7ca1c49ed9591ebb5849e9163c25 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-#include "lib.h"
 #include "lib/lib.h"
 
 /* NOTE: Currently there is no check in configure.ac for vasprintf(3).  the
diff --git a/score.c b/score.c
index 617ce0711ba82237d4a9b030cb5159212730b478..93b1b0195216dfbeaf88635da137f2315cc439b7 100644 (file)
--- a/score.c
+++ b/score.c
@@ -28,7 +28,6 @@
 #include "globals.h"
 #include "header.h"
 #include "keymap.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_menu.h"
 #include "options.h"
diff --git a/send.c b/send.c
index 3f2e86aff4c8ace187a07ad722f527d5fc79c5c3..9e178346b38f65bad789c119d1afe855502d0637 100644 (file)
--- a/send.c
+++ b/send.c
@@ -42,7 +42,6 @@
 #include "filter.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index b96427a44dbaf63a48e56662e4df66738588e9d3..70a2e26dcb3fa1f963d397d1d636626b2a2625cf 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -50,7 +50,6 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "mailbox.h"
index 2cd9f781e652677106b1e6e07dd9ce8bbf297a04..c13a983d337e79ffc43b633b43cc73c44149f958 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -35,7 +35,6 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "keymap_defs.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "mutt_menu.h"
index db2a98028ad4bf5198c0bc4d6d814172a7f649b4..1586cd310a9e43073dae0ad666d590e532c648fe 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -27,7 +27,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "options.h"
diff --git a/smtp.c b/smtp.c
index 7b9231bea046e15fd4d36e6d198e413b5a253dde..aadf9211c5c8bf09e927679bb43704c7657a66f8 100644 (file)
--- a/smtp.c
+++ b/smtp.c
@@ -35,7 +35,6 @@
 #include "account.h"
 #include "address.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_curses.h"
 #include "mutt_socket.h"
diff --git a/sort.c b/sort.c
index 13e9f9909f0f4fd3ab6685c6a1d91dd0df0dfb8d..05e89f83237d38b3ecfbe88c98a0ccc182dc9514 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -31,7 +31,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mutt_idna.h"
 #include "options.h"
diff --git a/state.c b/state.c
index 2a5bb914835d7cab6930a171330f9c1e876b4a42..2e27be631e279b1521c4973d3cfb1f66f668f442 100644 (file)
--- a/state.c
+++ b/state.c
@@ -23,7 +23,6 @@
 #include "config.h"
 #include <stdarg.h>
 #include "state.h"
-#include "lib.h"
 #include "globals.h"
 #include "mbyte.h"
 
index 21e93546d0c7bb541e836641f1536af458dcb870..4a37aa43852d71d02d8e03c46b6fa666d4d954d3 100644 (file)
--- a/status.c
+++ b/status.c
@@ -25,7 +25,6 @@
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mapping.h"
 #include "mbyte_table.h"
index 792dff4416b8fcfa394e4e10b7547b4331aee550..be13d0f6217b843a5b9301369ac3a13993677330 100644 (file)
--- a/thread.c
+++ b/thread.c
@@ -32,7 +32,6 @@
 #include "envelope.h"
 #include "globals.h"
 #include "header.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "list.h"
 #include "options.h"
diff --git a/url.c b/url.c
index 97faee0e4b9eb744e15c78e2eb4138b0f49878ca..c47598514cf46bfd18773267494c075c74dec1d4 100644 (file)
--- a/url.c
+++ b/url.c
@@ -32,7 +32,6 @@
 #include "url.h"
 #include "envelope.h"
 #include "globals.h"
-#include "lib.h"
 #include "lib/lib.h"
 #include "mapping.h"
 #include "mime.h"
index 3f4c860d5ce8de20c7861faeee5069f828325f49..9da21b6cb64e9c903e7ff9d5b9a767841a450707 100644 (file)
--- a/version.c
+++ b/version.c
@@ -28,7 +28,6 @@
 #include <string.h>
 #include <sys/utsname.h>
 #include <unistd.h>
-#include "lib.h"
 #include "lib/lib.h"
 #ifdef HAVE_STRINGPREP_H
 #include <stringprep.h>