spurious "sleep"s
[apps/madmutt.git] / lib-mx / mh.c
index f0a1484..dacef77 100644 (file)
@@ -16,7 +16,7 @@
 #include <lib-lib/lib-lib.h>
 #include <utime.h>
 
 #include <lib-lib/lib-lib.h>
 #include <utime.h>
 
-#include <lib-ui/curses.h>
+#include <lib-ui/lib-ui.h>
 
 #include "mutt.h"
 #include "mx.h"
 
 #include "mutt.h"
 #include "mx.h"
@@ -163,7 +163,7 @@ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt)
 
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d",
 
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d",
-              dest->path, NONULL(MCore.shorthost), (int) getpid (), Counter++);
+              dest->path, NONULL(mod_core.shorthost), (int) getpid (), Counter++);
     umask (Umask);
     if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
       if (errno != EEXIST) {
     umask (Umask);
     if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
       if (errno != EEXIST) {
@@ -730,7 +730,7 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
   struct stat lastchanged;
   int ret;
 
   struct stat lastchanged;
   int ret;
 
-  hc = mutt_hcache_open (HeaderCache, ctx->path);
+  hc = mutt_hcache_open(ctx->path);
 #endif
 
   for (p = md, count = 0; p; p = p->next, count++) {
 #endif
 
   for (p = md, count = 0; p; p = p->next, count++) {
@@ -898,7 +898,7 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
               dest->path, subdir, (long) time (NULL),
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
               dest->path, subdir, (long) time (NULL),
-              (unsigned int) getpid (), Counter++, NONULL (MCore.shorthost), suffix);
+              (unsigned int) getpid (), Counter++, NONULL (mod_core.shorthost), suffix);
 
     umask (Umask);
     if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
 
     umask (Umask);
     if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
@@ -971,7 +971,7 @@ static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr)
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir,
               (long) time (NULL), (unsigned int) getpid (), Counter++,
   for (;;) {
     snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir,
               (long) time (NULL), (unsigned int) getpid (), Counter++,
-              NONULL (MCore.shorthost), suffix);
+              NONULL (mod_core.shorthost), suffix);
     snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path);
 
     if (safe_rename (msg->path, full) == 0) {
     snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path);
 
     if (safe_rename (msg->path, full) == 0) {
@@ -1229,7 +1229,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)),
   int i, j;
 
 #ifdef USE_HCACHE
   int i, j;
 
 #ifdef USE_HCACHE
-  void *hc = NULL;
+  hcache_t *hc = NULL;
 #endif /* USE_HCACHE */
 
   if (ctx->magic == M_MH)
 #endif /* USE_HCACHE */
 
   if (ctx->magic == M_MH)
@@ -1242,7 +1242,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)),
 
 #ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
 
 #ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
-    hc = mutt_hcache_open (HeaderCache, ctx->path);
+    hc = mutt_hcache_open(ctx->path);
 #endif /* USE_HCACHE */
 
   for (i = 0; i < ctx->msgcount; i++) {
 #endif /* USE_HCACHE */
 
   for (i = 0; i < ctx->msgcount; i++) {
@@ -1286,7 +1286,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)),
 
 #ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
 
 #ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
-    mutt_hcache_close (hc);
+    mutt_hcache_close (&hc);
 #endif /* USE_HCACHE */
 
   if (ctx->magic == M_MH)
 #endif /* USE_HCACHE */
 
   if (ctx->magic == M_MH)
@@ -1311,7 +1311,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)),
 err:
 #ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
 err:
 #ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
-    mutt_hcache_close (hc);
+    mutt_hcache_close (&hc);
 #endif /* USE_HCACHE */
   return -1;
 }
 #endif /* USE_HCACHE */
   return -1;
 }