]> granicus.if.org Git - neomutt/commitdiff
rename Buffy
authorRichard Russon <rich@flatcap.org>
Fri, 3 Aug 2018 14:08:36 +0000 (15:08 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 3 Aug 2018 19:42:56 +0000 (20:42 +0100)
15 files changed:
browser.c
commands.c
imap/browse.c
imap/command.c
imap/imap.c
init.c
mailbox.c
mailbox.h
maildir/maildir.h
maildir/mh.c
main.c
mbox/mbox.c
notmuch/mutt_notmuch.c
sidebar.c
sidebar.h

index d29ad5b7ebfa79d8ab4cb7f8afe67423de47527e..9003e37f4dc9a2126e795c9862cbe301a2492918 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -727,8 +727,9 @@ static const char *group_index_format_str(char *buf, size_t buflen, size_t col,
 }
 #endif /* USE_NNTP */
 
-static void add_folder(struct Menu *m, struct BrowserState *state, const char *name,
-                       const char *desc, const struct stat *s, struct Buffy *b, void *data)
+static void add_folder(struct Menu *m, struct BrowserState *state,
+                       const char *name, const char *desc, const struct stat *s,
+                       struct Mailbox *b, void *data)
 {
   if (state->entrylen == state->entrymax)
   {
@@ -892,8 +893,8 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state,
       else if (!S_ISREG(s.st_mode))
         continue;
 
-      struct BuffyNode *np = NULL;
-      STAILQ_FOREACH(np, &BuffyList, entries)
+      struct MailboxNode *np = NULL;
+      STAILQ_FOREACH(np, &AllMailboxes, entries)
       {
         if (mutt_str_strcmp(buffer, np->b->path) != 0)
           break;
@@ -922,15 +923,15 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state,
  */
 static int examine_vfolders(struct Menu *menu, struct BrowserState *state)
 {
-  if (STAILQ_EMPTY(&BuffyList))
+  if (STAILQ_EMPTY(&AllMailboxes))
     return -1;
 
   mutt_buffy_check(0);
 
   init_state(state, menu);
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if (mx_is_notmuch(np->b->path))
     {
@@ -978,12 +979,12 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)
   {
     init_state(state, menu);
 
-    if (STAILQ_EMPTY(&BuffyList))
+    if (STAILQ_EMPTY(&AllMailboxes))
       return -1;
     mutt_buffy_check(0);
 
-    struct BuffyNode *np = NULL;
-    STAILQ_FOREACH(np, &BuffyList, entries)
+    struct MailboxNode *np = NULL;
+    STAILQ_FOREACH(np, &AllMailboxes, entries)
     {
       if (Context && (mutt_str_strcmp(np->b->realpath, Context->realpath) == 0))
       {
index 1fe27687aa233f9e4cbf52d8b836ac8dafb10656..36556404e385fe71371e0fc304f04165fb9b202f 100644 (file)
@@ -991,7 +991,7 @@ int mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt)
 #ifdef USE_COMPRESSED
     /* If we're saving to a compressed mailbox, the stats won't be updated
      * until the next open.  Until then, improvise. */
-    struct Buffy *cm = NULL;
+    struct Mailbox *cm = NULL;
     if (ctx.compress_info)
       cm = mutt_find_mailbox(ctx.realpath);
     /* We probably haven't been opened yet */
index 6aaef412d150a9a1127a48a0d88dd8cae68863e9..366bed5c90bfb12f92d6dac1457ae006ca6ec527 100644 (file)
@@ -113,8 +113,8 @@ static void add_folder(char delim, char *folder, int noselect, int noinferiors,
   (state->entry)[state->entrylen].selectable = !noselect;
   (state->entry)[state->entrylen].inferiors = !noinferiors;
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if (mutt_str_strcmp(tmp, np->b->path) == 0)
       break;
index 81f2dc25b2346099edb30d42a1ee4e348147581b..94cf1ce8283b31a11de9417598296c8813ed89bc 100644 (file)
@@ -711,8 +711,8 @@ static void cmd_parse_status(struct ImapData *idata, char *s)
   mutt_debug(3, "Running default STATUS handler\n");
 
   /* should perhaps move this code back to imap_buffy_check */
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if (np->b->magic != MUTT_IMAP)
       continue;
index 8c28ca138c2bf3d5de4cd002f43b3e039e30a523..dc666392001231f664ac2156f1d9154cca77ca6a 100644 (file)
@@ -542,8 +542,8 @@ static int complete_hosts(char *buf, size_t buflen)
   size_t matchlen;
 
   matchlen = mutt_str_strlen(buf);
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if (mutt_str_strncmp(buf, np->b->path, matchlen) != 0)
       continue;
@@ -1430,8 +1430,8 @@ int imap_buffy_check(int check_stats)
   char munged[LONG_STRING];
   int buffies = 0;
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     /* Init newly-added mailboxes */
     if (!np->b->magic)
@@ -1505,7 +1505,7 @@ int imap_buffy_check(int check_stats)
   }
 
   /* collect results */
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if ((np->b->magic == MUTT_IMAP) && np->b->new)
       buffies++;
diff --git a/init.c b/init.c
index 1460f4df2ecc3c1397757347042d926f0737f703..1e0f4dfe70269322b1c94c252f7fb0a9421f7d11 100644 (file)
--- a/init.c
+++ b/init.c
@@ -3309,12 +3309,12 @@ int mutt_init(bool skip_sys_rc, struct ListHead *commands)
   if (VirtualSpoolfile)
   {
     /* Find the first virtual folder and open it */
-    struct BuffyNode *bp = NULL;
-    STAILQ_FOREACH(bp, &BuffyList, entries)
+    struct MailboxNode *mp = NULL;
+    STAILQ_FOREACH(mp, &AllMailboxes, entries)
     {
-      if (bp->b->magic == MUTT_NOTMUCH)
+      if (mp->b->magic == MUTT_NOTMUCH)
       {
-        cs_str_string_set(Config, "spoolfile", bp->b->path, NULL);
+        cs_str_string_set(Config, "spoolfile", mp->b->path, NULL);
         mutt_sb_toggle_virtual();
         break;
       }
index fc2f0b5101d9f37839ad0070988f111d29f82fec..c7fb3bb242af07e3963e146ca01ae0b2af00ebeb 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -59,13 +59,12 @@ bool MailCheckStats;          ///< Config: Periodically check for new mail
 short MailCheckStatsInterval; ///< Config: How often to check for new mail
 bool MaildirCheckCur; ///< Config: Check both 'new' and 'cur' directories for new mail
 
-static time_t BuffyTime = 0; /**< last time we started checking for mail */
-static time_t BuffyStatsTime = 0; /**< last time we check performed mail_check_stats */
-time_t BuffyDoneTime = 0; /**< last time we knew for sure how much mail there was. */
-static short BuffyCount = 0;  /**< how many boxes with new mail */
-static short BuffyNotify = 0; /**< # of unnotified new boxes */
+static time_t MailboxTime = 0; /**< last time we started checking for mail */
+static time_t MailboxStatsTime = 0; /**< last time we check performed mail_check_stats */
+static short MailboxCount = 0;  /**< how many boxes with new mail */
+static short MailboxNotify = 0; /**< # of unnotified new boxes */
 
-struct BuffyList BuffyList = STAILQ_HEAD_INITIALIZER(BuffyList);
+struct MailboxList AllMailboxes = STAILQ_HEAD_INITIALIZER(AllMailboxes);
 
 /**
  * fseek_last_message - Find the last message in the file
@@ -171,15 +170,15 @@ static bool test_new_folder(const char *path)
 }
 
 /**
- * buffy_new - Create a new Buffy (mailbox)
+ * buffy_new - Create a new Maibox
  * @param path Path to the mailbox
- * @retval ptr New Buffy
+ * @retval ptr New Mailbox
  */
-static struct Buffy *buffy_new(const char *path)
+static struct Mailbox *buffy_new(const char *path)
 {
   char rp[PATH_MAX] = "";
 
-  struct Buffy *buffy = mutt_mem_calloc(1, sizeof(struct Buffy));
+  struct Mailbox *buffy = mutt_mem_calloc(1, sizeof(struct Mailbox));
   mutt_str_strfcpy(buffy->path, path, sizeof(buffy->path));
   char *r = realpath(path, rp);
   mutt_str_strfcpy(buffy->realpath, r ? rp : path, sizeof(buffy->realpath));
@@ -189,10 +188,10 @@ static struct Buffy *buffy_new(const char *path)
 }
 
 /**
- * buffy_free - Free a Buffy (mailbox)
- * @param mailbox Buffy to free
+ * buffy_free - Free a Mailbox
+ * @param mailbox Mailbox to free
  */
-static void buffy_free(struct Buffy **mailbox)
+static void buffy_free(struct Mailbox **mailbox)
 {
   if (mailbox && *mailbox)
     FREE(&(*mailbox)->desc);
@@ -209,7 +208,7 @@ static void buffy_free(struct Buffy **mailbox)
  *
  * Checks the specified maildir subdir (cur or new) for new mail or mail counts.
  */
-static int buffy_maildir_check_dir(struct Buffy *mailbox, const char *dir_name,
+static int buffy_maildir_check_dir(struct Mailbox *mailbox, const char *dir_name,
                                    bool check_new, bool check_stats)
 {
   char path[PATH_MAX];
@@ -292,7 +291,7 @@ static int buffy_maildir_check_dir(struct Buffy *mailbox, const char *dir_name,
  * @param check_stats if true, also count total, new, and flagged messages
  * @retval 1 if the mailbox has new mail
  */
-static int buffy_maildir_check(struct Buffy *mailbox, bool check_stats)
+static int buffy_maildir_check(struct Mailbox *mailbox, bool check_stats)
 {
   int rc = 1;
   bool check_new = true;
@@ -321,7 +320,7 @@ static int buffy_maildir_check(struct Buffy *mailbox, bool check_stats)
  * @param check_stats if true, also count total, new, and flagged messages
  * @retval 1 if the mailbox has new mail
  */
-static int buffy_mbox_check(struct Buffy *mailbox, struct stat *sb, bool check_stats)
+static int buffy_mbox_check(struct Mailbox *mailbox, struct stat *sb, bool check_stats)
 {
   int rc = 0;
   int new_or_changed;
@@ -375,7 +374,7 @@ static int buffy_mbox_check(struct Buffy *mailbox, struct stat *sb, bool check_s
  * @param contex_sb   stat() info for the current mailbox (Context)
  * @param check_stats If true, also count the total, new and flagged messages
  */
-static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_stats)
+static void buffy_check(struct Mailbox *tmp, struct stat *contex_sb, bool check_stats)
 {
   struct stat sb;
 #ifdef USE_SIDEBAR
@@ -439,17 +438,17 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st
       case MUTT_MBOX:
       case MUTT_MMDF:
         if (buffy_mbox_check(tmp, &sb, check_stats) > 0)
-          BuffyCount++;
+          MailboxCount++;
         break;
 
       case MUTT_MAILDIR:
         if (buffy_maildir_check(tmp, check_stats) > 0)
-          BuffyCount++;
+          MailboxCount++;
         break;
 
       case MUTT_MH:
         if (mh_buffy(tmp, check_stats))
-          BuffyCount++;
+          MailboxCount++;
         break;
 #ifdef USE_NOTMUCH
       case MUTT_NOTMUCH:
@@ -459,7 +458,7 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st
         nm_nonctx_get_count(tmp->path, &tmp->msg_count, &tmp->msg_unread);
         if (tmp->msg_unread > 0)
         {
-          BuffyCount++;
+          MailboxCount++;
           tmp->new = true;
         }
         break;
@@ -480,15 +479,15 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st
   if (!tmp->new)
     tmp->notified = false;
   else if (!tmp->notified)
-    BuffyNotify++;
+    MailboxNotify++;
 }
 
 /**
  * buffy_get - Fetch buffy object for given path, if present
  * @param path Path to the mailbox
- * @retval ptr Buffy for the mailbox
+ * @retval ptr Mailbox for the path
  */
-static struct Buffy *buffy_get(const char *path)
+static struct Mailbox *buffy_get(const char *path)
 {
   if (!path)
     return NULL;
@@ -496,8 +495,8 @@ static struct Buffy *buffy_get(const char *path)
   char *epath = mutt_str_strdup(path);
   mutt_expand_path(epath, mutt_str_strlen(epath));
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     /* must be done late because e.g. IMAP delimiter may change */
     mutt_expand_path(np->b->path, sizeof(np->b->path));
@@ -526,7 +525,7 @@ void mutt_buffy_cleanup(const char *path, struct stat *st)
 
   if (CheckMboxSize)
   {
-    struct Buffy *b = mutt_find_mailbox(path);
+    struct Mailbox *b = mutt_find_mailbox(path);
     if (b && !b->new)
       mutt_update_mailbox(b);
   }
@@ -547,9 +546,9 @@ void mutt_buffy_cleanup(const char *path, struct stat *st)
 /**
  * mutt_find_mailbox - Find the mailbox with a given path
  * @param path Path to match
- * @retval ptr Matching Buffy
+ * @retval ptr Matching Mailbox
  */
-struct Buffy *mutt_find_mailbox(const char *path)
+struct Mailbox *mutt_find_mailbox(const char *path)
 {
   if (!path)
     return NULL;
@@ -560,8 +559,8 @@ struct Buffy *mutt_find_mailbox(const char *path)
   if (stat(path, &sb) != 0)
     return NULL;
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if ((stat(np->b->path, &tmp_sb) == 0) && (sb.st_dev == tmp_sb.st_dev) &&
         (sb.st_ino == tmp_sb.st_ino))
@@ -577,7 +576,7 @@ struct Buffy *mutt_find_mailbox(const char *path)
  * mutt_update_mailbox - Get the mailbox's current size
  * @param b Mailbox to check
  */
-void mutt_update_mailbox(struct Buffy *b)
+void mutt_update_mailbox(struct Mailbox *b)
 {
   struct stat sb;
 
@@ -641,8 +640,8 @@ int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s,
 
     /* avoid duplicates */
     p = realpath(buf, f1);
-    struct BuffyNode *np = NULL;
-    STAILQ_FOREACH(np, &BuffyList, entries)
+    struct MailboxNode *np = NULL;
+    STAILQ_FOREACH(np, &AllMailboxes, entries)
     {
       if (mutt_str_strcmp(p ? p : buf, np->b->realpath) == 0)
       {
@@ -657,7 +656,7 @@ int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s,
       continue;
     }
 
-    struct Buffy *b = buffy_new(buf);
+    struct Mailbox *b = buffy_new(buf);
 
     b->new = false;
     b->notified = true;
@@ -685,9 +684,9 @@ int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s,
         b->size = 0;
     }
 
-    struct BuffyNode *bn = mutt_mem_calloc(1, sizeof(*bn));
-    bn->b = b;
-    STAILQ_INSERT_TAIL(&BuffyList, bn, entries);
+    struct MailboxNode *mn = mutt_mem_calloc(1, sizeof(*mn));
+    mn->b = b;
+    STAILQ_INSERT_TAIL(&AllMailboxes, mn, entries);
 
 #ifdef USE_SIDEBAR
     mutt_sb_notify_mailbox(b, 1);
@@ -736,9 +735,9 @@ int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s,
       }
     }
 
-    struct BuffyNode *np = NULL;
-    struct BuffyNode *tmp = NULL;
-    STAILQ_FOREACH_SAFE(np, &BuffyList, entries, tmp)
+    struct MailboxNode *np = NULL;
+    struct MailboxNode *tmp = NULL;
+    STAILQ_FOREACH_SAFE(np, &AllMailboxes, entries, tmp)
     {
       /* Decide whether to delete all normal mailboxes or all virtual */
       bool virt = ((np->b->magic == MUTT_NOTMUCH) && (data & MUTT_VIRTUAL));
@@ -751,7 +750,7 @@ int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s,
 #ifdef USE_SIDEBAR
         mutt_sb_notify_mailbox(np->b, 0);
 #endif
-        STAILQ_REMOVE(&BuffyList, np, BuffyNode, entries);
+        STAILQ_REMOVE(&AllMailboxes, np, MailboxNode, entries);
         buffy_free(&np->b);
         FREE(&np);
         continue;
@@ -762,15 +761,15 @@ int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s,
 }
 
 /**
- * mutt_buffy_check - Check all BuffyList for new mail
+ * mutt_buffy_check - Check all AllMailboxes for new mail
  * @param force Force flags, see below
  * @retval num Number of mailboxes with new mail
  *
  * The force argument may be any combination of the following values:
- * - MUTT_BUFFY_CHECK_FORCE        ignore BuffyTimeout and check for new mail
- * - MUTT_BUFFY_CHECK_FORCE_STATS  ignore BuffyTimeout and calculate statistics
+ * - MUTT_BUFFY_CHECK_FORCE        ignore MailboxTime and check for new mail
+ * - MUTT_BUFFY_CHECK_FORCE_STATS  ignore MailboxTime and calculate statistics
  *
- * Check all BuffyList for new mail and total/new/flagged messages
+ * Check all AllMailboxes for new mail and total/new/flagged messages
  */
 int mutt_buffy_check(int force)
 {
@@ -787,26 +786,26 @@ int mutt_buffy_check(int force)
 #endif
 
   /* fastest return if there are no mailboxes */
-  if (STAILQ_EMPTY(&BuffyList))
+  if (STAILQ_EMPTY(&AllMailboxes))
     return 0;
 
   t = time(NULL);
-  if (!force && (t - BuffyTime < MailCheck))
-    return BuffyCount;
+  if (!force && (t - MailboxTime < MailCheck))
+    return MailboxCount;
 
   if ((force & MUTT_BUFFY_CHECK_FORCE_STATS) ||
-      (MailCheckStats && ((t - BuffyStatsTime) >= MailCheckStatsInterval)))
+      (MailCheckStats && ((t - MailboxStatsTime) >= MailCheckStatsInterval)))
   {
     check_stats = true;
-    BuffyStatsTime = t;
+    MailboxStatsTime = t;
   }
 
-  BuffyTime = t;
-  BuffyCount = 0;
-  BuffyNotify = 0;
+  MailboxTime = t;
+  MailboxCount = 0;
+  MailboxNotify = 0;
 
 #ifdef USE_IMAP
-  BuffyCount += imap_buffy_check(check_stats);
+  MailboxCount += imap_buffy_check(check_stats);
 #endif
 
   /* check device ID and serial number instead of comparing paths */
@@ -820,14 +819,13 @@ int mutt_buffy_check(int force)
     contex_sb.st_ino = 0;
   }
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     buffy_check(np->b, &contex_sb, check_stats);
   }
 
-  BuffyDoneTime = BuffyTime;
-  return BuffyCount;
+  return MailboxCount;
 }
 
 /**
@@ -841,12 +839,12 @@ bool mutt_buffy_list(void)
   size_t pos = 0;
   int first = 1;
 
-  int have_unnotified = BuffyNotify;
+  int have_unnotified = MailboxNotify;
 
   buffylist[0] = '\0';
   pos += strlen(strncat(buffylist, _("New mail in "), sizeof(buffylist) - 1 - pos));
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     /* Is there new mail in this mailbox? */
     if (!np->b->new || (have_unnotified && np->b->notified))
@@ -869,7 +867,7 @@ bool mutt_buffy_list(void)
     {
       /* pos += strlen (strncat(buffylist + pos, "*", sizeof(buffylist)-1-pos)); */
       np->b->notified = true;
-      BuffyNotify--;
+      MailboxNotify--;
     }
     pos += strlen(strncat(buffylist + pos, path, sizeof(buffylist) - 1 - pos));
     first = 0;
@@ -885,9 +883,9 @@ bool mutt_buffy_list(void)
     return true;
   }
   /* there were no mailboxes needing to be notified, so clean up since
-   * BuffyNotify has somehow gotten out of sync
+   * MailboxNotify has somehow gotten out of sync
    */
-  BuffyNotify = 0;
+  MailboxNotify = 0;
   return false;
 }
 
@@ -897,7 +895,7 @@ bool mutt_buffy_list(void)
  */
 void mutt_buffy_setnotified(const char *path)
 {
-  struct Buffy *buffy = buffy_get(path);
+  struct Mailbox *buffy = buffy_get(path);
   if (!buffy)
     return;
 
@@ -911,7 +909,7 @@ void mutt_buffy_setnotified(const char *path)
  */
 bool mutt_buffy_notify(void)
 {
-  if (mutt_buffy_check(0) && BuffyNotify)
+  if (mutt_buffy_check(0) && MailboxNotify)
   {
     return mutt_buffy_list();
   }
@@ -934,8 +932,8 @@ void mutt_buffy(char *s, size_t slen)
     int found = 0;
     for (int pass = 0; pass < 2; pass++)
     {
-      struct BuffyNode *np = NULL;
-      STAILQ_FOREACH(np, &BuffyList, entries)
+      struct MailboxNode *np = NULL;
+      STAILQ_FOREACH(np, &AllMailboxes, entries)
       {
         if (np->b->magic == MUTT_NOTMUCH) /* only match real mailboxes */
           continue;
@@ -971,8 +969,8 @@ void mutt_buffy_vfolder(char *buf, size_t buflen)
     bool found = false;
     for (int pass = 0; pass < 2; pass++)
     {
-      struct BuffyNode *np = NULL;
-      STAILQ_FOREACH(np, &BuffyList, entries)
+      struct MailboxNode *np = NULL;
+      STAILQ_FOREACH(np, &AllMailboxes, entries)
       {
         if (np->b->magic != MUTT_NOTMUCH)
           continue;
@@ -986,7 +984,7 @@ void mutt_buffy_vfolder(char *buf, size_t buflen)
       }
     }
 
-    mutt_buffy_check(MUTT_BUFFY_CHECK_FORCE); /* buffy was wrong - resync things */
+    mutt_buffy_check(MUTT_BUFFY_CHECK_FORCE); /* Mailbox was wrong - resync things */
   }
 
   /* no folders with new mail */
index 84f40748374c9b1f21c975088d2e8c043fa0fd8c..b218fe52195224294147903f4e9b721f4ac49cb5 100644 (file)
--- a/mailbox.h
+++ b/mailbox.h
@@ -20,8 +20,8 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _MUTT_BUFFY_H
-#define _MUTT_BUFFY_H
+#ifndef _MUTT_MAILBOX_H
+#define _MUTT_MAILBOX_H
 
 #include <limits.h>
 #include <stdbool.h>
@@ -44,9 +44,9 @@ extern bool  MaildirCheckCur;
 #define MUTT_VIRTUAL 2
 
 /**
- * struct Buffy - A mailbox
+ * struct Mailbox - A mailbox
  */
-struct Buffy
+struct Mailbox
 {
   char path[PATH_MAX];
   char realpath[PATH_MAX]; /**< used for duplicate detection, context
@@ -67,24 +67,22 @@ struct Buffy
   time_t stats_last_checked; /**< mtime of mailbox the last time stats where checked. */
 };
 
-struct BuffyNode
+struct MailboxNode
 {
-  struct Buffy *b;
-  STAILQ_ENTRY(BuffyNode) entries;
+  struct Mailbox *b;
+  STAILQ_ENTRY(MailboxNode) entries;
 };
 
-STAILQ_HEAD(BuffyList, BuffyNode);
+STAILQ_HEAD(MailboxList, MailboxNode);
 
-extern struct BuffyList BuffyList;
+extern struct MailboxList AllMailboxes;
 
 #ifdef USE_NOTMUCH
 void mutt_buffy_vfolder(char *buf, size_t buflen);
 #endif
 
-extern time_t BuffyDoneTime; /**< last time we knew for sure how much mail there was */
-
-struct Buffy *mutt_find_mailbox(const char *path);
-void mutt_update_mailbox(struct Buffy *b);
+struct Mailbox *mutt_find_mailbox(const char *path);
+void mutt_update_mailbox(struct Mailbox *b);
 
 void mutt_buffy_cleanup(const char *path, struct stat *st);
 
@@ -102,4 +100,4 @@ bool mutt_buffy_notify(void);
 int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
 
-#endif /* _MUTT_BUFFY_H */
+#endif /* _MUTT_MAILBOX_H */
index 25bd5adac63f2cba2041775c8ff9820f14c76e08..d19988ba8d0228e231a5da8ff85097803d97d96f 100644 (file)
@@ -40,7 +40,7 @@
 #include "hcache/hcache.h"
 #endif
 
-struct Buffy;
+struct Mailbox;
 struct Context;
 struct Header;
 
@@ -63,7 +63,7 @@ struct Header *maildir_parse_message(int magic, const char *fname, bool is_old,
 struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *h);
 bool           maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n);
 
-bool           mh_buffy(struct Buffy *mailbox, bool check_stats);
+bool           mh_buffy(struct Mailbox *mailbox, bool check_stats);
 int            mh_check_empty(const char *path);
 
 bool           mx_is_maildir(const char *path);
index 9352b9817666e2fceb02ad82cf71475097c0c720..39acb30a392514e415b8f927b95e24f647f7bd03 100644 (file)
@@ -292,7 +292,7 @@ static inline mode_t mh_umask(struct Context *ctx)
  * @retval 0 modification time is older
  * @retval -1 Error
  */
-static int mh_sequences_changed(struct Buffy *b)
+static int mh_sequences_changed(struct Mailbox *b)
 {
   char path[PATH_MAX];
   struct stat sb;
@@ -313,7 +313,7 @@ static int mh_sequences_changed(struct Buffy *b)
  * @retval 0 Modification time on the message file is newer
  * @retval -1 Error
  */
-static int mh_already_notified(struct Buffy *b, int msgno)
+static int mh_already_notified(struct Mailbox *b, int msgno)
 {
   char path[PATH_MAX];
   struct stat sb;
@@ -352,7 +352,7 @@ static bool mh_valid_message(const char *s)
  * @param check_stats Also count total, new, and flagged messages
  * @retval true if the mailbox has new mail
  */
-bool mh_buffy(struct Buffy *mailbox, bool check_stats)
+bool mh_buffy(struct Mailbox *mailbox, bool check_stats)
 {
   struct MhSequences mhs = { 0 };
   bool check_new = true;
diff --git a/main.c b/main.c
index 3a6b5e903d681e7b1e8f55221775252d968604cd..9b6c8a254d6a5344bbaffb71d4007df7e236300b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1139,7 +1139,7 @@ int main(int argc, char *argv[], char *envp[])
       }
       else
 #endif
-          if (STAILQ_EMPTY(&BuffyList))
+          if (STAILQ_EMPTY(&AllMailboxes))
       {
         mutt_error(_("No incoming mailboxes defined."));
         goto main_curses; // TEST39: neomutt -n -F /dev/null -y
index 66b7b49b28252d1cbbbe13d7f39c5592132644ae..719aa048a8465fba1cd6863fd180146e21a308d6 100644 (file)
@@ -967,7 +967,7 @@ static int mbox_mbox_sync(struct Context *ctx, int *index_hint)
   FILE *fp = NULL;
   struct Progress progress;
   char msgbuf[PATH_MAX + 64];
-  struct Buffy *tmp = NULL;
+  struct Mailbox *tmp = NULL;
 
   /* sort message by their position in the mailbox on disk */
   if (Sort != SORT_ORDER)
index 200a40ef240447a4d2d05a1b47a6b59e69ca4597..711ca12f0c1688d22c2242b6c9e0a864f46f8e37 100644 (file)
@@ -2276,8 +2276,8 @@ done:
  */
 char *nm_get_description(struct Context *ctx)
 {
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if (np->b->desc && (strcmp(np->b->path, ctx->path) == 0))
       return np->b->desc;
@@ -2299,8 +2299,8 @@ int nm_description_to_path(const char *desc, char *buf, size_t buflen)
   if (!desc || !buf || (buflen == 0))
     return -EINVAL;
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if ((np->b->magic == MUTT_NOTMUCH) && np->b->desc && (strcmp(desc, np->b->desc) == 0))
     {
index 8d7c6e0a278fa17c3883550e671df2785d15a534..592d8bce13af1916ab2dbf94138419506b85fb34 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -73,9 +73,9 @@ static short PreviousSort = SORT_ORDER; /* sidebar_sort_method */
  */
 struct SbEntry
 {
-  char box[STRING];    /**< formatted mailbox name */
-  struct Buffy *buffy; /**< Mailbox this represents */
-  bool is_hidden;      /**< Don't show, e.g. $sidebar_new_mail_only */
+  char box[STRING];      /**< formatted mailbox name */
+  struct Mailbox *buffy; /**< Mailbox this represents */
+  bool is_hidden;        /**< Don't show, e.g. $sidebar_new_mail_only */
 };
 
 static int EntryCount = 0;
@@ -149,7 +149,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int
 
   buf[0] = 0; /* Just in case there's nothing to do */
 
-  struct Buffy *b = sbe->buffy;
+  struct Mailbox *b = sbe->buffy;
   if (!b)
     return src;
 
@@ -316,8 +316,8 @@ static int cb_qsort_sbe(const void *a, const void *b)
 {
   const struct SbEntry *sbe1 = *(const struct SbEntry **) a;
   const struct SbEntry *sbe2 = *(const struct SbEntry **) b;
-  struct Buffy *b1 = sbe1->buffy;
-  struct Buffy *b2 = sbe2->buffy;
+  struct Mailbox *b1 = sbe1->buffy;
+  struct Mailbox *b2 = sbe2->buffy;
 
   int result = 0;
 
@@ -422,8 +422,8 @@ static void unsort_entries(void)
 {
   int i = 0;
 
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if (i >= EntryCount)
       break;
@@ -817,7 +817,7 @@ static void fill_empty_space(int first_row, int num_rows, int div_width, int num
  * Display a list of mailboxes in a panel on the left.  What's displayed will
  * depend on our index markers: TopBuffy, OpnBuffy, HilBuffy, BotBuffy.
  * On the first run they'll be NULL, so we display the top of NeoMutt's list
- * (BuffyList).
+ * (AllMailboxes).
  *
  * * TopBuffy - first visible mailbox
  * * BotBuffy - last  visible mailbox
@@ -832,7 +832,7 @@ static void fill_empty_space(int first_row, int num_rows, int div_width, int num
 static void draw_sidebar(int num_rows, int num_cols, int div_width)
 {
   struct SbEntry *entry = NULL;
-  struct Buffy *b = NULL;
+  struct Mailbox *b = NULL;
   if (TopIndex < 0)
     return;
 
@@ -1003,8 +1003,8 @@ void mutt_sb_draw(void)
 
   if (!Entries)
   {
-    struct BuffyNode *np = NULL;
-    STAILQ_FOREACH(np, &BuffyList, entries)
+    struct MailboxNode *np = NULL;
+    STAILQ_FOREACH(np, &AllMailboxes, entries)
     {
       mutt_sb_notify_mailbox(np->b, 1);
     }
@@ -1087,8 +1087,8 @@ void mutt_sb_set_buffystats(const struct Context *ctx)
     return;
 
   /* Even if the sidebar's hidden, we should take note of the new data. */
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     if (mutt_str_strcmp(np->b->realpath, ctx->realpath) == 0)
     {
@@ -1152,7 +1152,7 @@ void mutt_sb_set_open_buffy(void)
  *
  * Before a deletion, check that our pointers won't be invalidated.
  */
-void mutt_sb_notify_mailbox(struct Buffy *b, int created)
+void mutt_sb_notify_mailbox(struct Mailbox *b, int created)
 {
   if (!b)
     return;
@@ -1229,8 +1229,8 @@ void mutt_sb_toggle_virtual(void)
   EntryCount = 0;
   FREE(&Entries);
   EntryLen = 0;
-  struct BuffyNode *np = NULL;
-  STAILQ_FOREACH(np, &BuffyList, entries)
+  struct MailboxNode *np = NULL;
+  STAILQ_FOREACH(np, &AllMailboxes, entries)
   {
     /* and reintroduce the ones that are visible */
     if (((np->b->magic == MUTT_NOTMUCH) && (sidebar_source == SB_SRC_VIRT)) ||
index a681dd2481f4e519c0711c214ceaf80ca69f215c..ec7b926bc39065636e70f3cfa0abb0c031333187 100644 (file)
--- a/sidebar.h
+++ b/sidebar.h
@@ -27,7 +27,7 @@
 
 #include <stdbool.h>
 
-struct Buffy;
+struct Mailbox;
 struct Context;
 
 /* These Config Variables are only used in sidebar.c */
@@ -45,7 +45,7 @@ extern short SidebarSortMethod;
 void mutt_sb_change_mailbox(int op);
 void mutt_sb_draw(void);
 const char *mutt_sb_get_highlight(void);
-void mutt_sb_notify_mailbox(struct Buffy *b, int created);
+void mutt_sb_notify_mailbox(struct Mailbox *b, int created);
 void mutt_sb_set_buffystats(const struct Context *ctx);
 void mutt_sb_set_open_buffy(void);
 void mutt_sb_toggle_virtual(void);