]> granicus.if.org Git - neomutt/commitdiff
rename lists for consistency
authorRichard Russon <rich@flatcap.org>
Thu, 29 Aug 2019 13:12:16 +0000 (14:12 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 30 Aug 2019 15:54:37 +0000 (16:54 +0100)
- Move `entries` to end of the struct
- Separate declaration from use
- Rename `ColorLineHead`      to `ColorLineList`
- Rename `LogList`            to `LogLineList`
- Rename `MyVarHead`          to `MyVarList`
- Rename `ObserverHead`       to `ObserverList`
- Rename `PatternHead`        to `PatternList`
- Rename `RegexListNode`      to `RegexNode`
- Rename `ReplaceListNode`    to `Replace`
- Rename `TagHead`            to `TagList`
- Rename `TagNode`            to `Tag`
- Rename `UrlQueryStringHead` to `UrlQueryList`
- Rename `UrlQueryString`     to `UrlQuery`

40 files changed:
color.c
context.h
email/email.h
email/tags.c
email/tags.h
email/url.c
email/url.h
hcache/hcache.c
hook.c
imap/imap.c
imap/imap.h
menu.c
mutt/charset.c
mutt/logging.c
mutt/logging.h
mutt/notify.c
mutt/observer.h
mutt/regex.c
mutt/regex3.h
mutt_curses.h
myvar.c
myvar.h
ncrypt/crypt_mod.c
notmuch/mutt_notmuch.c
pager.c
pattern.c
pattern.h
score.c
test/config/common.c
test/pattern/comp.c
test/regex/mutt_regex_match.c
test/regex/mutt_regexlist_new.c
test/regex/mutt_replacelist_new.c
test/tags/driver_tags_free.c
test/tags/driver_tags_get.c
test/tags/driver_tags_get_transformed.c
test/tags/driver_tags_get_transformed_for.c
test/tags/driver_tags_get_with_hidden.c
test/tags/driver_tags_replace.c
test/url/url_parse.c

diff --git a/color.c b/color.c
index 2cfda34461903fbf403e6efda8c1b16f2b61fccd..47a233c44aab259be25e06488dc13f8646e09564 100644 (file)
--- a/color.c
+++ b/color.c
 int *ColorQuote = NULL;
 int ColorQuoteUsed;
 int ColorDefs[MT_COLOR_MAX];
-struct ColorLineHead ColorAttachList = STAILQ_HEAD_INITIALIZER(ColorAttachList);
-struct ColorLineHead ColorBodyList = STAILQ_HEAD_INITIALIZER(ColorBodyList);
-struct ColorLineHead ColorHdrList = STAILQ_HEAD_INITIALIZER(ColorHdrList);
-struct ColorLineHead ColorIndexAuthorList = STAILQ_HEAD_INITIALIZER(ColorIndexAuthorList);
-struct ColorLineHead ColorIndexFlagsList = STAILQ_HEAD_INITIALIZER(ColorIndexFlagsList);
-struct ColorLineHead ColorIndexList = STAILQ_HEAD_INITIALIZER(ColorIndexList);
-struct ColorLineHead ColorIndexSubjectList = STAILQ_HEAD_INITIALIZER(ColorIndexSubjectList);
-struct ColorLineHead ColorIndexTagList = STAILQ_HEAD_INITIALIZER(ColorIndexTagList);
-struct ColorLineHead ColorStatusList = STAILQ_HEAD_INITIALIZER(ColorStatusList);
+struct ColorLineList ColorAttachList = STAILQ_HEAD_INITIALIZER(ColorAttachList);
+struct ColorLineList ColorBodyList = STAILQ_HEAD_INITIALIZER(ColorBodyList);
+struct ColorLineList ColorHdrList = STAILQ_HEAD_INITIALIZER(ColorHdrList);
+struct ColorLineList ColorIndexAuthorList = STAILQ_HEAD_INITIALIZER(ColorIndexAuthorList);
+struct ColorLineList ColorIndexFlagsList = STAILQ_HEAD_INITIALIZER(ColorIndexFlagsList);
+struct ColorLineList ColorIndexList = STAILQ_HEAD_INITIALIZER(ColorIndexList);
+struct ColorLineList ColorIndexSubjectList = STAILQ_HEAD_INITIALIZER(ColorIndexSubjectList);
+struct ColorLineList ColorIndexTagList = STAILQ_HEAD_INITIALIZER(ColorIndexTagList);
+struct ColorLineList ColorStatusList = STAILQ_HEAD_INITIALIZER(ColorStatusList);
 
 /* local to this file */
 static int ColorQuoteSize;
@@ -572,7 +572,7 @@ static int parse_color_name(const char *s, uint32_t *col, int *attr, bool is_fg,
  * @param[in]     parse_uncolor If true, 'uncolor', else 'unmono'
  */
 static void do_uncolor(struct Buffer *buf, struct Buffer *s,
-                       struct ColorLineHead *cl, bool *do_cache, bool parse_uncolor)
+                       struct ColorLineList *cl, bool *do_cache, bool parse_uncolor)
 {
   struct ColorLine *np = NULL, *tmp = NULL;
   do
@@ -756,7 +756,7 @@ enum CommandResult mutt_parse_unmono(struct Buffer *buf, struct Buffer *s,
  * @param match     Number of regex subexpression to match (0 for entire pattern)
  * @retval #CommandResult Result e.g. #MUTT_CMD_SUCCESS
  */
-static enum CommandResult add_pattern(struct ColorLineHead *top, const char *s,
+static enum CommandResult add_pattern(struct ColorLineList *top, const char *s,
                                       bool sensitive, uint32_t fg, uint32_t bg, int attr,
                                       struct Buffer *err, bool is_index, int match)
 {
@@ -1244,14 +1244,14 @@ enum CommandResult mutt_parse_mono(struct Buffer *buf, struct Buffer *s,
 
 /**
  * mutt_free_color_list - Free a list of colours
- * @param head ColorLine List
+ * @param list ColorLine List
  */
-static void mutt_free_color_list(struct ColorLineHead *head)
+static void mutt_free_color_list(struct ColorLineList *list)
 {
   struct ColorLine *np = NULL, *tmp = NULL;
-  STAILQ_FOREACH_SAFE(np, head, entries, tmp)
+  STAILQ_FOREACH_SAFE(np, list, entries, tmp)
   {
-    STAILQ_REMOVE(head, np, ColorLine, entries);
+    STAILQ_REMOVE(list, np, ColorLine, entries);
     free_color_line(np, true);
   }
 }
index c4af67b6c953bfe61dcd2baf89cea5704bee44de..ee3b56b7abcc7d30ed76dae0986c5a029d0c0e11 100644 (file)
--- a/context.h
+++ b/context.h
@@ -37,7 +37,7 @@ struct Context
 {
   off_t vsize;
   char *pattern;                     ///< Limit pattern string
-  struct PatternHead *limit_pattern; ///< Compiled limit pattern
+  struct PatternList *limit_pattern; ///< Compiled limit pattern
   struct Email *last_tag;            ///< Last tagged msg (used to link threads)
   struct MuttThread *tree;           ///< Top of thread tree
   struct Hash *thread_hash;          ///< Hash table for threading
index 49c51c0e5f6c2c8468ea10074a6f401e6c3817ed..cfbb6fe266b3600cab0f91eb65aedf894b5d6b93 100644 (file)
@@ -105,7 +105,7 @@ struct Email
   int refno;                   ///< Message number on server
 #endif
 
-  struct TagHead tags;         ///< For drivers that support server tagging
+  struct TagList tags;         ///< For drivers that support server tagging
 
   char *maildir_flags;         ///< Unknown maildir flags
 
index c6ac5d4135bbbc7c7f52407a4dc1ad92e06ee8cd..cf0567421f70c70a53ccfb7eded785a7ea940bdb 100644 (file)
@@ -47,14 +47,14 @@ struct Hash *TagTransforms; /**< Lookup table of alternative tag names */
  *
  * Return a new allocated string containing tags separated by space
  */
-static char *driver_tags_getter(struct TagHead *head, bool show_hidden,
+static char *driver_tags_getter(struct TagList *head, bool show_hidden,
                                 bool show_transformed, const char *filter)
 {
   if (!head)
     return NULL;
 
   char *tags = NULL;
-  struct TagNode *np = NULL;
+  struct Tag *np = NULL;
   STAILQ_FOREACH(np, head, entries)
   {
     if (filter && (mutt_str_strcmp(np->name, filter) != 0))
@@ -72,16 +72,16 @@ static char *driver_tags_getter(struct TagHead *head, bool show_hidden,
 
 /**
  * driver_tags_add - Add a tag to header
- * @param[in] head List of tags
+ * @param[in] list List of tags
  * @param[in] new_tag string representing the new tag
  *
  * Add a tag to the header tags
  */
-static void driver_tags_add(struct TagHead *head, char *new_tag)
+static void driver_tags_add(struct TagList *list, char *new_tag)
 {
   char *new_tag_transformed = mutt_hash_find(TagTransforms, new_tag);
 
-  struct TagNode *tn = mutt_mem_calloc(1, sizeof(struct TagNode));
+  struct Tag *tn = mutt_mem_calloc(1, sizeof(struct Tag));
   tn->name = mutt_str_strdup(new_tag);
   tn->hidden = false;
   if (new_tag_transformed)
@@ -91,22 +91,22 @@ static void driver_tags_add(struct TagHead *head, char *new_tag)
   if (mutt_list_find(&C_HiddenTags->head, new_tag))
     tn->hidden = true;
 
-  STAILQ_INSERT_TAIL(head, tn, entries);
+  STAILQ_INSERT_TAIL(list, tn, entries);
 }
 
 /**
  * driver_tags_free - Free tags from a header
- * @param[in] head List of tags
+ * @param[in] list List of tags
  *
  * Free the whole tags structure
  */
-void driver_tags_free(struct TagHead *head)
+void driver_tags_free(struct TagList *list)
 {
-  if (!head)
+  if (!list)
     return;
 
-  struct TagNode *np = STAILQ_FIRST(head);
-  struct TagNode *next = NULL;
+  struct Tag *np = STAILQ_FIRST(list);
+  struct Tag *next = NULL;
   while (np)
   {
     next = STAILQ_NEXT(np, entries);
@@ -115,45 +115,45 @@ void driver_tags_free(struct TagHead *head)
     FREE(&np);
     np = next;
   }
-  STAILQ_INIT(head);
+  STAILQ_INIT(list);
 }
 
 /**
  * driver_tags_get_transformed - Get transformed tags
- * @param[in] head List of tags
+ * @param[in] list List of tags
  * @retval ptr String list of tags
  *
  * Return a new allocated string containing all tags separated by space with
  * transformation
  */
-char *driver_tags_get_transformed(struct TagHead *head)
+char *driver_tags_get_transformed(struct TagList *list)
 {
-  return driver_tags_getter(head, false, true, NULL);
+  return driver_tags_getter(list, false, true, NULL);
 }
 
 /**
  * driver_tags_get - Get tags
- * @param[in] head List of tags
+ * @param[in] list List of tags
  * @retval ptr String list of tags
  *
  * Return a new allocated string containing all tags separated by space
  */
-char *driver_tags_get(struct TagHead *head)
+char *driver_tags_get(struct TagList *list)
 {
-  return driver_tags_getter(head, false, false, NULL);
+  return driver_tags_getter(list, false, false, NULL);
 }
 
 /**
  * driver_tags_get_with_hidden - Get tags with hiddens
- * @param[in] head List of tags
+ * @param[in] list List of tags
  * @retval ptr String list of tags
  *
  * Return a new allocated string containing all tags separated by space even
  * the hiddens.
  */
-char *driver_tags_get_with_hidden(struct TagHead *head)
+char *driver_tags_get_with_hidden(struct TagList *list)
 {
-  return driver_tags_getter(head, true, false, NULL);
+  return driver_tags_getter(list, true, false, NULL);
 }
 
 /**
@@ -165,7 +165,7 @@ char *driver_tags_get_with_hidden(struct TagHead *head)
  * Return a new allocated string containing all tags separated by space even
  * the hiddens.
  */
-char *driver_tags_get_transformed_for(struct TagHead *head, const char *name)
+char *driver_tags_get_transformed_for(struct TagList *head, const char *name)
 {
   return driver_tags_getter(head, true, true, name);
 }
@@ -179,7 +179,7 @@ char *driver_tags_get_transformed_for(struct TagHead *head, const char *name)
  *
  * Free current tags structures and replace it by new tags
  */
-bool driver_tags_replace(struct TagHead *head, char *tags)
+bool driver_tags_replace(struct TagList *head, char *tags)
 {
   if (!head)
     return false;
index 1c7973ee5443632a4a54c1f8655afd4cc7b486b1..3a5653706a4b3078834a714734418cbc0e572210 100644 (file)
@@ -32,25 +32,25 @@ extern struct Slist *C_HiddenTags;
 extern struct Hash *TagTransforms;
 
 /**
- * struct TagNode - LinkedList Tag Element
+ * struct Tag - LinkedList Tag Element
  *
  * Keep a linked list of header tags and their transformed values.
  * Textual tags can be transformed to symbols to save space.
  */
-struct TagNode
+struct Tag
 {
   char *name;                    ///< Tag name
   char *transformed;             ///< Transformed name
   bool hidden;                   ///< Tag should be hidden
-  STAILQ_ENTRY(TagNode) entries; ///< Linked list
+  STAILQ_ENTRY(Tag) entries; ///< Linked list
 };
-STAILQ_HEAD(TagHead, TagNode);
+STAILQ_HEAD(TagList, Tag);
 
-void  driver_tags_free               (struct TagHead *head);
-char *driver_tags_get                (struct TagHead *head);
-char *driver_tags_get_transformed    (struct TagHead *head);
-char *driver_tags_get_transformed_for(struct TagHead *head, const char *name);
-char *driver_tags_get_with_hidden    (struct TagHead *head);
-bool  driver_tags_replace            (struct TagHead *head, char *tags);
+void  driver_tags_free               (struct TagList *list);
+char *driver_tags_get                (struct TagList *list);
+char *driver_tags_get_transformed    (struct TagList *list);
+char *driver_tags_get_transformed_for(struct TagList *list, const char *name);
+char *driver_tags_get_with_hidden    (struct TagList *list);
+bool  driver_tags_replace            (struct TagList *list, char *tags);
 
 #endif /* MUTT_EMAIL_TAGS_H */
index 042e8c8f8d582722a2f8d91231d39db424eb6f6b..1ec90e5efd9ff779262c95905293e8a305c6b40b 100644 (file)
@@ -45,19 +45,19 @@ static const struct Mapping UrlMap[] = {
 
 /**
  * parse_query_string - Parse a URL query string
- * @param l List to store the results
- * @param src String to parse
+ * @param list List to store the results
+ * @param src  String to parse
  * @retval  0 Success
  * @retval -1 Error
  */
-static int parse_query_string(struct UrlQueryStringHead *l, char *src)
+static int parse_query_string(struct UrlQueryList *list, char *src)
 {
-  struct UrlQueryString *qs = NULL;
+  struct UrlQuery *qs = NULL;
   char *k = NULL, *v = NULL;
 
   while (src && *src)
   {
-    qs = mutt_mem_calloc(1, sizeof(struct UrlQueryString));
+    qs = mutt_mem_calloc(1, sizeof(struct UrlQuery));
     k = strchr(src, '&');
     if (k)
       *k = '\0';
@@ -79,7 +79,7 @@ static int parse_query_string(struct UrlQueryStringHead *l, char *src)
       FREE(&qs);
       return -1;
     }
-    STAILQ_INSERT_TAIL(l, qs, entries);
+    STAILQ_INSERT_TAIL(list, qs, entries);
 
     if (!k)
       break;
@@ -290,8 +290,8 @@ void url_free(struct Url **u)
   if (!u || !*u)
     return;
 
-  struct UrlQueryString *np = STAILQ_FIRST(&(*u)->query_strings);
-  struct UrlQueryString *next = NULL;
+  struct UrlQuery *np = STAILQ_FIRST(&(*u)->query_strings);
+  struct UrlQuery *next = NULL;
   while (np)
   {
     next = STAILQ_NEXT(np, entries);
index 7c8ecbb1cf75e2a12cb6216064e54b2999674132..9050402bedda4cdb41db43bc80ab8c88d5747a89 100644 (file)
@@ -48,31 +48,31 @@ enum UrlScheme
 #define U_PATH          (1 << 1)
 
 /**
- * struct UrlQueryString - Parsed Query String
+ * struct UrlQuery - Parsed Query String
  *
  * The arguments in a URL are saved in a linked list.
  */
-struct UrlQueryString
+struct UrlQuery
 {
-  char *name;                           ///< Query name
-  char *value;                          ///< Query value
-  STAILQ_ENTRY(UrlQueryString) entries; ///< Linked list
+  char *name;                     ///< Query name
+  char *value;                    ///< Query value
+  STAILQ_ENTRY(UrlQuery) entries; ///< Linked list
 };
-STAILQ_HEAD(UrlQueryStringHead, UrlQueryString);
+STAILQ_HEAD(UrlQueryList, UrlQuery);
 
 /**
  * struct Url - A parsed URL `proto://user:password@host:port/path?a=1&b=2`
  */
 struct Url
 {
-  enum UrlScheme scheme;                   ///< Scheme, e.g. #U_SMTPS
-  char *user;                              ///< Username
-  char *pass;                              ///< Password
-  char *host;                              ///< Host
-  unsigned short port;                     ///< Port
-  char *path;                              ///< Path
-  struct UrlQueryStringHead query_strings; ///< List of query strings
-  char *src;                               ///< Raw URL string
+  enum UrlScheme scheme;             ///< Scheme, e.g. #U_SMTPS
+  char *user;                        ///< Username
+  char *pass;                        ///< Password
+  char *host;                        ///< Host
+  unsigned short port;               ///< Port
+  char *path;                        ///< Path
+  struct UrlQueryList query_strings; ///< List of query strings
+  char *src;                         ///< Raw URL string
 };
 
 enum UrlScheme url_check_scheme(const char *s);
index b209d0c12892037b5ff34107b8f6ba18d3e939f2..667c9095ec85e8d7b8772439b83d72ad25400565 100644 (file)
@@ -277,7 +277,7 @@ header_cache_t *mutt_hcache_open(const char *path, const char *folder, hcache_na
     mutt_md5_process_bytes(&hcachever, sizeof(hcachever), &md5ctx);
 
     /* Mix in user's spam list */
-    struct ReplaceListNode *sp = NULL;
+    struct Replace *sp = NULL;
     STAILQ_FOREACH(sp, &SpamList, entries)
     {
       mutt_md5_process(sp->regex->pattern, &md5ctx);
@@ -285,7 +285,7 @@ header_cache_t *mutt_hcache_open(const char *path, const char *folder, hcache_na
     }
 
     /* Mix in user's nospam list */
-    struct RegexListNode *np = NULL;
+    struct RegexNode *np = NULL;
     STAILQ_FOREACH(np, &NoSpamList, entries)
     {
       mutt_md5_process(np->regex->pattern, &md5ctx);
diff --git a/hook.c b/hook.c
index 5b5134ae79db36daf1060a90e5e3d559804ae225..f182a0b84cf639d7f06eab1a7e9769a54c10788a 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -67,7 +67,7 @@ struct Hook
   HookFlags type;              ///< Hook type
   struct Regex regex;          ///< Regular expression
   char *command;               ///< Filename, command or pattern to execute
-  struct PatternHead *pattern; ///< Used for fcc,save,send-hook
+  struct PatternList *pattern; ///< Used for fcc,save,send-hook
   TAILQ_ENTRY(Hook) entries;
 };
 TAILQ_HEAD(HookList, Hook);
@@ -90,7 +90,7 @@ enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s,
   int rc;
   bool pat_not = false, warning = false;
   regex_t *rx = NULL;
-  struct PatternHead *pat = NULL;
+  struct PatternList *pat = NULL;
   char path[PATH_MAX];
 
   mutt_buffer_init(&pattern);
@@ -428,7 +428,7 @@ enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s,
    * matching.  This of course is slower, but index-format-hook is commonly
    * used for date ranges, and they need to be evaluated relative to "now", not
    * the hook compilation time.  */
-  struct PatternHead *pat = mutt_pattern_comp(
+  struct PatternList *pat = mutt_pattern_comp(
       mutt_b2s(pattern), MUTT_PC_FULL_MSG | MUTT_PC_PATTERN_DYNAMIC, err);
   if (!pat)
     goto out;
index 6d88d85d525cb8dea12aa04a399c97f529ab66df..3d177eaff6cf07dc6490b0653ddcab134d5f6002 100644 (file)
@@ -337,7 +337,7 @@ static int sync_helper(struct Mailbox *m, AclFlags right, int flag, const char *
  *
  * Count the number of patterns that can be done by the server (are full-text).
  */
-static int do_search(const struct PatternHead *search, bool allpats)
+static int do_search(const struct PatternList *search, bool allpats)
 {
   int rc = 0;
   const struct Pattern *pat = NULL;
@@ -379,7 +379,7 @@ static int do_search(const struct PatternHead *search, bool allpats)
  * that require full-text search (neomutt already has what it needs for most
  * match types, and does a better job (eg server doesn't support regexes).
  */
-static int compile_search(struct Mailbox *m, const struct PatternHead *pat, struct Buffer *buf)
+static int compile_search(struct Mailbox *m, const struct PatternList *pat, struct Buffer *buf)
 {
   struct Pattern *firstpat = SLIST_FIRST(pat);
 
@@ -1346,7 +1346,7 @@ int imap_mailbox_status(struct Mailbox *m, bool queue)
  * @retval  0 Success
  * @retval -1 Failure
  */
-int imap_search(struct Mailbox *m, const struct PatternHead *pat)
+int imap_search(struct Mailbox *m, const struct PatternList *pat)
 {
   struct Buffer buf;
   struct ImapAccountData *adata = imap_adata_get(m);
index 305d6bd2c509cdb5ee2c179ca99cc8b6d79d5c43..d3c56535c4e7f6c1e7a0c2eb50f4d92954e7c268 100644 (file)
@@ -58,7 +58,7 @@ struct BrowserState;
 struct Buffer;
 struct ConnAccount;
 struct EmailList;
-struct PatternHead;
+struct PatternList;
 struct stat;
 
 /* These Config Variables are only used in imap/auth.c */
@@ -86,7 +86,7 @@ int imap_delete_mailbox(struct Mailbox *m, char *path);
 int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close);
 int imap_path_status(const char *path, bool queue);
 int imap_mailbox_status(struct Mailbox *m, bool queue);
-int imap_search(struct Mailbox *m, const struct PatternHead *pat);
+int imap_search(struct Mailbox *m, const struct PatternList *pat);
 int imap_subscribe(char *path, bool subscribe);
 int imap_complete(char *buf, size_t buflen, char *path);
 int imap_fast_trash(struct Mailbox *m, char *dest);
diff --git a/menu.c b/menu.c
index 74a092147f419857188701cb212670ac34552b1c..4e3ff372ff6b27a795092519539517f3646ff2c7 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -84,7 +84,7 @@ static struct Menu **MenuStack = NULL;
  */
 static int get_color(int index, unsigned char *s)
 {
-  struct ColorLineHead *color = NULL;
+  struct ColorLineList *color = NULL;
   struct ColorLine *np = NULL;
   struct Email *e = Context->mailbox->emails[Context->mailbox->v2r[index]];
   int type = *s;
index edf8596072a354a8dd5ab3c0f1277fed583a844e..2f9c636cd8a4d42ca7deea2792d9f092d232749c 100644 (file)
@@ -75,7 +75,9 @@ struct Lookup
   char *replacement;    /**< Alternative charset to use */
   TAILQ_ENTRY(Lookup) entries;
 };
-static TAILQ_HEAD(, Lookup) Lookups = TAILQ_HEAD_INITIALIZER(Lookups);
+TAILQ_HEAD(LookupList, Lookup);
+
+static struct LookupList Lookups = TAILQ_HEAD_INITIALIZER(Lookups);
 
 // clang-format off
 /**
index 350aa7d4cd370805e3ae0ac4118dbe26a2bc7ac8..a885a8727d11a538fd8bf8a82f3a0e8a7f958883 100644 (file)
@@ -59,7 +59,7 @@ char *LogFileVersion = NULL; /**< Program version */
 /**
  * LogQueue - In-memory list of log lines
  */
-static struct LogList LogQueue = STAILQ_HEAD_INITIALIZER(LogQueue);
+static struct LogLineList LogQueue = STAILQ_HEAD_INITIALIZER(LogQueue);
 
 int LogQueueCount = 0; /**< Number of entries currently in the log queue */
 int LogQueueMax = 0;   /**< Maximum number of entries in the log queue */
index ce7562da18fb2b5876fee91ad6b629f0d2015451..d48afc439ce65d09f93001e74d4d036ea156b982 100644 (file)
@@ -76,7 +76,7 @@ struct LogLine
   char *message;
   STAILQ_ENTRY(LogLine) entries;
 };
-STAILQ_HEAD(LogList, LogLine);
+STAILQ_HEAD(LogLineList, LogLine);
 
 #define mutt_debug(LEVEL, ...) MuttLogger(0, __FILE__, __LINE__, __func__, LEVEL,      __VA_ARGS__)
 #define mutt_warning(...)      MuttLogger(0, __FILE__, __LINE__, __func__, LL_WARNING, __VA_ARGS__)
index cf2424e168bfe3d070533b8eeb3118abd08e9a67..e5e6611302edfe8883d721115b7ed3a7aea18abd 100644 (file)
@@ -42,7 +42,7 @@ struct Notify
   void *obj;
   enum NotifyType obj_type;
   struct Notify *parent;
-  struct ObserverHead observers;
+  struct ObserverList observers;
 };
 
 /**
index 00b6b98b8d7938770ff08526848c47dbfb1945d5..d6ddaac2b2cb80bd7780919780cc98aa699ee7c9 100644 (file)
@@ -79,6 +79,6 @@ struct ObserverNode
   struct Observer *observer;
   STAILQ_ENTRY(ObserverNode) entries;
 };
-STAILQ_HEAD(ObserverHead, ObserverNode);
+STAILQ_HEAD(ObserverList, ObserverNode);
 
 #endif /* MUTT_LIB_OBSERVER_H */
index 3eca86d8d01bbba3a28b80f6e065c19635020824..077066167118619280ceda4a65de52524ad32cff 100644 (file)
@@ -142,7 +142,7 @@ int mutt_regexlist_add(struct RegexList *rl, const char *str, int flags, struct
   }
 
   /* check to make sure the item is not already on this rl */
-  struct RegexListNode *np = NULL;
+  struct RegexNode *np = NULL;
   STAILQ_FOREACH(np, rl, entries)
   {
     if (mutt_str_strcasecmp(rx->pattern, np->regex->pattern) == 0)
@@ -172,10 +172,10 @@ void mutt_regexlist_free(struct RegexList *rl)
   if (!rl)
     return;
 
-  struct RegexListNode *np = NULL, *tmp = NULL;
+  struct RegexNode *np = NULL, *tmp = NULL;
   STAILQ_FOREACH_SAFE(np, rl, entries, tmp)
   {
-    STAILQ_REMOVE(rl, np, RegexListNode, entries);
+    STAILQ_REMOVE(rl, np, RegexNode, entries);
     mutt_regex_free(&np->regex);
     FREE(&np);
   }
@@ -192,7 +192,7 @@ bool mutt_regexlist_match(struct RegexList *rl, const char *str)
 {
   if (!rl || !str)
     return false;
-  struct RegexListNode *np = NULL;
+  struct RegexNode *np = NULL;
   STAILQ_FOREACH(np, rl, entries)
   {
     if (mutt_regex_match(np->regex, str))
@@ -209,9 +209,9 @@ bool mutt_regexlist_match(struct RegexList *rl, const char *str)
  * mutt_regexlist_new - Create a new RegexList
  * @retval ptr New RegexList object
  */
-struct RegexListNode *mutt_regexlist_new(void)
+struct RegexNode *mutt_regexlist_new(void)
 {
-  return mutt_mem_calloc(1, sizeof(struct RegexListNode));
+  return mutt_mem_calloc(1, sizeof(struct RegexNode));
 }
 
 /**
@@ -235,12 +235,12 @@ int mutt_regexlist_remove(struct RegexList *rl, const char *str)
   }
 
   int rc = -1;
-  struct RegexListNode *np = NULL, *tmp = NULL;
+  struct RegexNode *np = NULL, *tmp = NULL;
   STAILQ_FOREACH_SAFE(np, rl, entries, tmp)
   {
     if (mutt_str_strcasecmp(str, np->regex->pattern) == 0)
     {
-      STAILQ_REMOVE(rl, np, RegexListNode, entries);
+      STAILQ_REMOVE(rl, np, RegexNode, entries);
       mutt_regex_free(&np->regex);
       FREE(&np);
       rc = 0;
@@ -274,7 +274,7 @@ int mutt_replacelist_add(struct ReplaceList *rl, const char *pat,
   }
 
   /* check to make sure the item is not already on this rl */
-  struct ReplaceListNode *np = NULL;
+  struct Replace *np = NULL;
   STAILQ_FOREACH(np, rl, entries)
   {
     if (mutt_str_strcasecmp(rx->pattern, np->regex->pattern) == 0)
@@ -303,7 +303,7 @@ int mutt_replacelist_add(struct ReplaceList *rl, const char *pat,
     STAILQ_INSERT_TAIL(rl, np, entries);
   }
 
-  /* Now np is the ReplaceListNode that we want to modify. It is prepared. */
+  /* Now np is the Replace that we want to modify. It is prepared. */
   np->templ = mutt_str_strdup(templ);
 
   /* Find highest match number in template string */
@@ -372,7 +372,7 @@ char *mutt_replacelist_apply(struct ReplaceList *rl, char *buf, size_t buflen, c
 
   mutt_str_strfcpy(src, str, 1024);
 
-  struct ReplaceListNode *np = NULL;
+  struct Replace *np = NULL;
   STAILQ_FOREACH(np, rl, entries)
   {
     /* If this pattern needs more matches, expand pmatch. */
@@ -449,10 +449,10 @@ void mutt_replacelist_free(struct ReplaceList *rl)
   if (!rl)
     return;
 
-  struct ReplaceListNode *np = NULL, *tmp = NULL;
+  struct Replace *np = NULL, *tmp = NULL;
   STAILQ_FOREACH_SAFE(np, rl, entries, tmp)
   {
-    STAILQ_REMOVE(rl, np, ReplaceListNode, entries);
+    STAILQ_REMOVE(rl, np, Replace, entries);
     mutt_regex_free(&np->regex);
     FREE(&np->templ);
     FREE(&np);
@@ -482,7 +482,7 @@ bool mutt_replacelist_match(struct ReplaceList *rl, char *buf, size_t buflen, co
   int tlen = 0;
   char *p = NULL;
 
-  struct ReplaceListNode *np = NULL;
+  struct Replace *np = NULL;
   STAILQ_FOREACH(np, rl, entries)
   {
     /* If this pattern needs more matches, expand pmatch. */
@@ -550,9 +550,9 @@ bool mutt_replacelist_match(struct ReplaceList *rl, char *buf, size_t buflen, co
  * mutt_replacelist_new - Create a new ReplaceList
  * @retval ptr New ReplaceList
  */
-struct ReplaceListNode *mutt_replacelist_new(void)
+struct Replace *mutt_replacelist_new(void)
 {
-  return mutt_mem_calloc(1, sizeof(struct ReplaceListNode));
+  return mutt_mem_calloc(1, sizeof(struct Replace));
 }
 
 /**
@@ -567,12 +567,12 @@ int mutt_replacelist_remove(struct ReplaceList *rl, const char *pat)
     return 0;
 
   int nremoved = 0;
-  struct ReplaceListNode *np = NULL, *tmp = NULL;
+  struct Replace *np = NULL, *tmp = NULL;
   STAILQ_FOREACH_SAFE(np, rl, entries, tmp)
   {
     if (mutt_str_strcmp(np->regex->pattern, pat) == 0)
     {
-      STAILQ_REMOVE(rl, np, ReplaceListNode, entries);
+      STAILQ_REMOVE(rl, np, Replace, entries);
       mutt_regex_free(&np->regex);
       FREE(&np->templ);
       FREE(&np);
index b4e0f26656741cadb706048a4194046ce1151f0e..976578a4329fe5c3b9e047dcc2594946af7dd954 100644 (file)
@@ -62,43 +62,43 @@ struct Regex
 };
 
 /**
- * struct RegexListNode - List of regular expressions
+ * struct RegexNode - List of regular expressions
  */
-struct RegexListNode
+struct RegexNode
 {
   struct Regex *regex; /**< Regex containing a regular expression */
-  STAILQ_ENTRY(RegexListNode) entries; /**< Next item in list */
+  STAILQ_ENTRY(RegexNode) entries; /**< Next item in list */
 };
-STAILQ_HEAD(RegexList, RegexListNode);
+STAILQ_HEAD(RegexList, RegexNode);
 
 /**
- * struct ReplaceListNode - List of regular expressions
+ * struct Replace - List of regular expressions
  */
-struct ReplaceListNode
+struct Replace
 {
   struct Regex *regex;      /**< Regex containing a regular expression */
   size_t nmatch;            /**< Match the 'nth' occurrence (0 means the whole expression) */
   char *templ;              /**< Template to match */
-  STAILQ_ENTRY(ReplaceListNode) entries; /**< Next item in list */
+  STAILQ_ENTRY(Replace) entries; /**< Next item in list */
 };
-STAILQ_HEAD(ReplaceList, ReplaceListNode);
+STAILQ_HEAD(ReplaceList, Replace);
 
 struct Regex *mutt_regex_compile(const char *str, int flags);
 struct Regex *mutt_regex_new(const char *str, int flags, struct Buffer *err);
 void          mutt_regex_free(struct Regex **r);
 
-int                   mutt_regexlist_add(struct RegexList *rl, const char *str, int flags, struct Buffer *err);
-void                  mutt_regexlist_free(struct RegexList *rl);
-bool                  mutt_regexlist_match(struct RegexList *rl, const char *str);
-struct RegexListNode *mutt_regexlist_new(void);
-int                   mutt_regexlist_remove(struct RegexList *rl, const char *str);
+int               mutt_regexlist_add   (struct RegexList *rl, const char *str, int flags, struct Buffer *err);
+void              mutt_regexlist_free  (struct RegexList *rl);
+bool              mutt_regexlist_match (struct RegexList *rl, const char *str);
+struct RegexNode *mutt_regexlist_new   (void);
+int               mutt_regexlist_remove(struct RegexList *rl, const char *str);
 
-int                     mutt_replacelist_add(struct ReplaceList *rl, const char *pat, const char *templ, struct Buffer *err);
-char *                  mutt_replacelist_apply(struct ReplaceList *rl, char *buf, size_t buflen, const char *str);
-void                    mutt_replacelist_free(struct ReplaceList *rl);
-bool                    mutt_replacelist_match(struct ReplaceList *rl, char *buf, size_t buflen, const char *str);
-struct ReplaceListNode *mutt_replacelist_new(void);
-int                     mutt_replacelist_remove(struct ReplaceList *rl, const char *pat);
+int             mutt_replacelist_add   (struct ReplaceList *rl, const char *pat, const char *templ, struct Buffer *err);
+char *          mutt_replacelist_apply (struct ReplaceList *rl, char *buf, size_t buflen, const char *str);
+void            mutt_replacelist_free  (struct ReplaceList *rl);
+bool            mutt_replacelist_match (struct ReplaceList *rl, char *buf, size_t buflen, const char *str);
+struct Replace *mutt_replacelist_new   (void);
+int             mutt_replacelist_remove(struct ReplaceList *rl, const char *pat);
 
 bool mutt_regex_match  (const struct Regex *regex, const char *str);
 bool mutt_regex_capture(const struct Regex *regex, const char *str, size_t num, regmatch_t matches[]);
index 7ebbddcb095aa079de770378703d2dc06fae14e5..494917d5175934317d60ae3b38b8f42b3c39aaeb 100644 (file)
@@ -182,29 +182,30 @@ struct ColorLine
   regex_t regex;
   int match; /**< which substringmap 0 for old behaviour */
   char *pattern;
-  struct PatternHead *color_pattern; /**< compiled pattern to speed up index color
+  struct PatternList *color_pattern; /**< compiled pattern to speed up index color
                                           calculation */
   uint32_t fg;
   uint32_t bg;
   int pair;
-  STAILQ_ENTRY(ColorLine) entries;
 
   bool stop_matching : 1; ///< used by the pager for body patterns, to prevent the color from being retried once it fails
+
+  STAILQ_ENTRY(ColorLine) entries;
 };
-STAILQ_HEAD(ColorLineHead, ColorLine);
+STAILQ_HEAD(ColorLineList, ColorLine);
 
 extern int *ColorQuote;                            ///< Array of colours for quoted email text
 extern int ColorQuoteUsed;                         ///< Number of colours for quoted email text
 extern int ColorDefs[];                            ///< Array of all fixed colours, see enum ColorId
-extern struct ColorLineHead ColorHdrList;          ///< List of colours applied to the email headers
-extern struct ColorLineHead ColorBodyList;         ///< List of colours applied to the email body
-extern struct ColorLineHead ColorAttachList;       ///< List of colours applied to the attachment headers
-extern struct ColorLineHead ColorStatusList;       ///< List of colours applied to the status bar
-extern struct ColorLineHead ColorIndexList;        ///< List of default colours applied to the index
-extern struct ColorLineHead ColorIndexAuthorList;  ///< List of colours applied to the author in the index
-extern struct ColorLineHead ColorIndexFlagsList;   ///< List of colours applied to the flags in the index
-extern struct ColorLineHead ColorIndexSubjectList; ///< List of colours applied to the subject in the index
-extern struct ColorLineHead ColorIndexTagList;     ///< List of colours applied to tags in the index
+extern struct ColorLineList ColorHdrList;          ///< List of colours applied to the email headers
+extern struct ColorLineList ColorBodyList;         ///< List of colours applied to the email body
+extern struct ColorLineList ColorAttachList;       ///< List of colours applied to the attachment headers
+extern struct ColorLineList ColorStatusList;       ///< List of colours applied to the status bar
+extern struct ColorLineList ColorIndexList;        ///< List of default colours applied to the index
+extern struct ColorLineList ColorIndexAuthorList;  ///< List of colours applied to the author in the index
+extern struct ColorLineList ColorIndexFlagsList;   ///< List of colours applied to the flags in the index
+extern struct ColorLineList ColorIndexSubjectList; ///< List of colours applied to the subject in the index
+extern struct ColorLineList ColorIndexTagList;     ///< List of colours applied to tags in the index
 
 /* If the system has bkgdset() use it rather than attrset() so that the clr*()
  * functions will properly set the background attributes all the way to the
diff --git a/myvar.c b/myvar.c
index 0fab45cfac123bc4d85de8a3a923b45283810788..d38ba5a8df559df2c7b3218ebd0221172dadbc02 100644 (file)
--- a/myvar.c
+++ b/myvar.c
@@ -31,7 +31,7 @@
 #include "mutt/mutt.h"
 #include "myvar.h"
 
-struct MyVarHead MyVars = TAILQ_HEAD_INITIALIZER(MyVars);
+struct MyVarList MyVars = TAILQ_HEAD_INITIALIZER(MyVars);
 
 /**
  * myvar_get - Get the value of a "my_" variable
diff --git a/myvar.h b/myvar.h
index 28b50f1845cbd6d5e94e975d701b570269d411e6..4f274516e4274fa74e78f55faa8f0129594f3026 100644 (file)
--- a/myvar.h
+++ b/myvar.h
@@ -34,9 +34,9 @@ struct MyVar
   char *value;
   TAILQ_ENTRY(MyVar) entries;
 };
-TAILQ_HEAD(MyVarHead, MyVar);
+TAILQ_HEAD(MyVarList, MyVar);
 
-extern struct MyVarHead MyVars; ///< List of all the user's custom config variables
+extern struct MyVarList MyVars; ///< List of all the user's custom config variables
 
 void        myvar_del(const char *var);
 const char *myvar_get(const char *var);
index 7bd7394ec1ba7136b6f8004e74442e17f1cd0a40..b3bd1599946d973d4ec7c2baa7a040c400cb1ee9 100644 (file)
  *
  * A type of a variable to keep track of registered crypto modules.
  */
-static STAILQ_HEAD(CryptModuleHead,
-                   CryptModule) CryptModules = STAILQ_HEAD_INITIALIZER(CryptModules);
 struct CryptModule
 {
   struct CryptModuleSpecs *specs;
   STAILQ_ENTRY(CryptModule) entries;
 };
+STAILQ_HEAD(CryptModuleList, CryptModule);
+
+static struct CryptModuleList CryptModules = STAILQ_HEAD_INITIALIZER(CryptModules);
 
 /**
  * crypto_module_register - Register a new crypto module
index ccbef66a93c54d29414a3cc767269829939a61af..d9cc33cec054a665dd73f132240bc9fd19eef92c 100644 (file)
@@ -498,7 +498,7 @@ static char *get_query_string(struct NmMboxData *mdata, bool window)
 
   mdata->query_type = string_to_query_type(C_NmQueryType); /* user's default */
 
-  struct UrlQueryString *item = NULL;
+  struct UrlQuery *item = NULL;
   STAILQ_FOREACH(item, &mdata->db_url->query_strings, entries)
   {
     if (!item->value || !item->name)
@@ -1927,7 +1927,7 @@ int nm_update_filename(struct Mailbox *m, const char *old_file,
  */
 static int nm_mbox_check_stats(struct Mailbox *m, int flags)
 {
-  struct UrlQueryString *item = NULL;
+  struct UrlQuery *item = NULL;
   struct Url *url = NULL;
   char *db_filename = NULL, *db_query = NULL;
   notmuch_database_t *db = NULL;
diff --git a/pager.c b/pager.c
index 6b6f374de473c00f29f7181bb3b33bc7ab2776ca..7b10fef5c1a48efece8b05491ca340a42e6e90d0 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -990,7 +990,7 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n,
                           bool *force_redraw, bool q_classify)
 {
   struct ColorLine *color_line = NULL;
-  struct ColorLineHead *head = NULL;
+  struct ColorLineList *head = NULL;
   regmatch_t pmatch[1];
   bool found;
   bool null_rx;
index aef8e53a31f58c432e275122f993a3db794d0bed..25857b4727dfa10033ec67e2187ffb14b5cd0629 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -195,7 +195,7 @@ static struct RangeRegex range_regexes[] = {
 };
 // clang-format on
 
-static struct PatternHead *SearchPattern = NULL; /**< current search pattern */
+static struct PatternList *SearchPattern = NULL; /**< current search pattern */
 static char LastSearch[256] = { 0 };      /**< last pattern searched for */
 static char LastSearchExpn[1024] = { 0 }; /**< expanded version of LastSearch */
 
@@ -1331,7 +1331,7 @@ static /* const */ char *find_matching_paren(/* const */ char *s)
  * mutt_pattern_free - Free a Pattern
  * @param[out] pat Pattern to free
  */
-void mutt_pattern_free(struct PatternHead **pat)
+void mutt_pattern_free(struct PatternList **pat)
 {
   if (!pat || !*pat)
     return;
@@ -1367,9 +1367,9 @@ void mutt_pattern_free(struct PatternHead **pat)
  * mutt_pattern_node_new - Create a new list containing a Pattern
  * @retval ptr Newly created list containing a single node with a Pattern
  */
-static struct PatternHead *mutt_pattern_node_new(void)
+static struct PatternList *mutt_pattern_node_new(void)
 {
-  struct PatternHead *h = mutt_mem_calloc(1, sizeof(struct PatternHead));
+  struct PatternList *h = mutt_mem_calloc(1, sizeof(struct PatternList));
   SLIST_INIT(h);
   struct Pattern *p = mutt_mem_calloc(1, sizeof(struct Pattern));
   SLIST_INSERT_HEAD(h, p, entries);
@@ -1383,13 +1383,13 @@ static struct PatternHead *mutt_pattern_node_new(void)
  * @param err   Buffer for error messages
  * @retval ptr Newly allocated Pattern
  */
-struct PatternHead *mutt_pattern_comp(const char *s, PatternCompFlags flags, struct Buffer *err)
+struct PatternList *mutt_pattern_comp(const char *s, PatternCompFlags flags, struct Buffer *err)
 {
   /* curlist when assigned will always point to a list containing at least one node
    * with a Pattern value.  */
-  struct PatternHead *curlist = NULL;
-  struct PatternHead *tmp = NULL, *tmp2 = NULL;
-  struct PatternHead *last = NULL;
+  struct PatternList *curlist = NULL;
+  struct PatternList *tmp = NULL, *tmp2 = NULL;
+  struct PatternList *last = NULL;
   bool pat_not = false;
   bool alladdr = false;
   bool pat_or = false;
@@ -1640,7 +1640,7 @@ cleanup:
  * @param cache Cached Patterns
  * @retval true If ALL of the Patterns evaluates to true
  */
-static bool perform_and(struct PatternHead *pat, PatternExecFlags flags,
+static bool perform_and(struct PatternList *pat, PatternExecFlags flags,
                         struct Mailbox *m, struct Email *e, struct PatternCache *cache)
 {
   struct Pattern *p = NULL;
@@ -1662,7 +1662,7 @@ static bool perform_and(struct PatternHead *pat, PatternExecFlags flags,
  * @param cache Cached Patterns
  * @retval true If ONE (or more) of the Patterns evaluates to true
  */
-static int perform_or(struct PatternHead *pat, PatternExecFlags flags,
+static int perform_or(struct PatternList *pat, PatternExecFlags flags,
                       struct Mailbox *m, struct Email *e, struct PatternCache *cache)
 {
   struct Pattern *p = NULL;
@@ -1826,7 +1826,7 @@ static int match_user(int alladdr, struct AddressList *al1, struct AddressList *
  * @retval 1  Success, match found
  * @retval 0  No match
  */
-static int match_threadcomplete(struct PatternHead *pat, PatternExecFlags flags,
+static int match_threadcomplete(struct PatternList *pat, PatternExecFlags flags,
                                 struct Mailbox *m, struct MuttThread *t,
                                 int left, int up, int right, int down)
 {
@@ -1864,7 +1864,7 @@ static int match_threadcomplete(struct PatternHead *pat, PatternExecFlags flags,
  * @retval  0 Pattern did not match
  * @retval -1 Error
  */
-static int match_threadparent(struct PatternHead *pat, PatternExecFlags flags,
+static int match_threadparent(struct PatternList *pat, PatternExecFlags flags,
                               struct Mailbox *m, struct MuttThread *t)
 {
   if (!t || !t->parent || !t->parent->message)
@@ -1883,7 +1883,7 @@ static int match_threadparent(struct PatternHead *pat, PatternExecFlags flags,
  * @retval  0 Pattern did not match
  * @retval -1 Error
  */
-static int match_threadchildren(struct PatternHead *pat, PatternExecFlags flags,
+static int match_threadchildren(struct PatternList *pat, PatternExecFlags flags,
                                 struct Mailbox *m, struct MuttThread *t)
 {
   if (!t || !t->child)
@@ -2440,7 +2440,7 @@ int mutt_pattern_func(int op, char *prompt)
   mutt_buffer_init(&err);
   err.dsize = 256;
   err.data = mutt_mem_malloc(err.dsize);
-  struct PatternHead *pat = mutt_pattern_comp(buf->data, MUTT_PC_FULL_MSG, &err);
+  struct PatternList *pat = mutt_pattern_comp(buf->data, MUTT_PC_FULL_MSG, &err);
   if (!pat)
   {
     mutt_error("%s", err.data);
index 3f432fc62c13a89a35c2979c622f5859c1a76eeb..7babdd4c246ebab6874744f5e9cb9452aaa6b7f2 100644 (file)
--- a/pattern.h
+++ b/pattern.h
@@ -59,16 +59,16 @@ struct Pattern
   bool ismulti : 1; /**< multiple case (only for I pattern now) */
   int min;
   int max;
-  SLIST_ENTRY(Pattern) entries;
-  struct PatternHead *child; /**< arguments to logical op */
+  struct PatternList *child; /**< arguments to logical op */
   union {
     regex_t *regex;
     struct Group *group;
     char *str;
     struct ListHead multi_cases;
   } p;
+  SLIST_ENTRY(Pattern) entries;
 };
-SLIST_HEAD(PatternHead, Pattern);
+SLIST_HEAD(PatternList, Pattern);
 
 typedef uint8_t PatternExecFlags;         ///< Flags for mutt_pattern_exec(), e.g. #MUTT_MATCH_FULL_ADDRESS
 #define MUTT_PAT_EXEC_NO_FLAGS         0  ///< No flags are set
@@ -152,9 +152,9 @@ enum PatternType
 
 int mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags,
                       struct Mailbox *m, struct Email *e, struct PatternCache *cache);
-struct PatternHead *mutt_pattern_comp(const char *s, PatternCompFlags flags, struct Buffer *err);
+struct PatternList *mutt_pattern_comp(const char *s, PatternCompFlags flags, struct Buffer *err);
 void mutt_check_simple(struct Buffer *s, const char *simple);
-void mutt_pattern_free(struct PatternHead **pat);
+void mutt_pattern_free(struct PatternList **pat);
 
 int mutt_which_case(const char *s);
 int mutt_is_list_recipient(bool alladdr, struct Envelope *e);
diff --git a/score.c b/score.c
index 476209701259680163e72cf2392975fd2567fbc7..dc184f1590309fa0ad81c3522b391a03582a67de 100644 (file)
--- a/score.c
+++ b/score.c
@@ -55,7 +55,7 @@ short C_ScoreThresholdRead; ///< Config: Messages with a lower score will be aut
 struct Score
 {
   char *str;
-  struct PatternHead *pat;
+  struct PatternList *pat;
   int val;
   bool exact; /**< if this rule matches, don't evaluate any more */
   struct Score *next;
@@ -123,7 +123,7 @@ enum CommandResult mutt_parse_score(struct Buffer *buf, struct Buffer *s,
       break;
   if (!ptr)
   {
-    struct PatternHead *pat = mutt_pattern_comp(pattern, MUTT_PC_NO_FLAGS, err);
+    struct PatternList *pat = mutt_pattern_comp(pattern, MUTT_PC_NO_FLAGS, err);
     if (!pat)
     {
       FREE(&pattern);
index f2d8904b0714febb9cc7217edfeb1c50638f43e7..6b938dad9ce4493c7f0fddb7ade79e934ead2e83 100644 (file)
@@ -30,8 +30,8 @@
 #include <string.h>
 #include "mutt/mutt.h"
 #include "config/lib.h"
-#include "common.h"
 #include "core/lib.h"
+#include "common.h"
 
 const char *line = "----------------------------------------"
                    "----------------------------------------";
index ca8b4ea4cf38667ac0b6d3b1317479ca6b1ec00f..acddd2ef938a0ce92ea1d75328d018429cfe5227 100644 (file)
@@ -79,7 +79,7 @@ bool ResumeEditedDraftFiles;
  *
  *  In the representation {a} is expanded to all the pattern fields.
  */
-static int canonical_pattern(char *s, struct PatternHead *pat, int indent)
+static int canonical_pattern(char *s, struct PatternList *pat, int indent)
 {
   if (!pat || !s)
     return 0;
@@ -119,13 +119,13 @@ static int canonical_pattern(char *s, struct PatternHead *pat, int indent)
 }
 
 /* best-effort pattern tree compare, returns 0 if equal otherwise 1 */
-static int cmp_pattern(struct PatternHead *p1, struct PatternHead *p2)
+static int cmp_pattern(struct PatternList *p1, struct PatternList *p2)
 {
   if (!p1 || !p2)
     return !(!p1 && !p2);
 
-  struct PatternHead p1_tmp = *p1;
-  struct PatternHead p2_tmp = *p2;
+  struct PatternList p1_tmp = *p1;
+  struct PatternList p2_tmp = *p2;
 
   while (!SLIST_EMPTY(&p1_tmp))
   {
@@ -178,7 +178,7 @@ void test_mutt_pattern_comp(void)
     char *s = "";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(!pat))
     {
@@ -198,7 +198,7 @@ void test_mutt_pattern_comp(void)
     char *s = "x";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(!pat))
     {
@@ -218,7 +218,7 @@ void test_mutt_pattern_comp(void)
     char *s = "=s";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(!pat))
     {
@@ -238,7 +238,7 @@ void test_mutt_pattern_comp(void)
     char *s = "| =s foo";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(!pat))
     {
@@ -258,7 +258,7 @@ void test_mutt_pattern_comp(void)
     char *s = "=s foobar";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(pat != NULL))
     {
@@ -266,7 +266,7 @@ void test_mutt_pattern_comp(void)
       TEST_MSG("Actual  : pat == NULL");
     }
 
-    struct PatternHead expected;
+    struct PatternList expected;
     SLIST_INIT(&expected);
     struct Pattern e = { .op = MUTT_PAT_SUBJECT,
                          .pat_not = false,
@@ -304,7 +304,7 @@ void test_mutt_pattern_comp(void)
     char *s = "! =s foobar";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(pat != NULL))
     {
@@ -312,7 +312,7 @@ void test_mutt_pattern_comp(void)
       TEST_MSG("Actual  : pat == NULL");
     }
 
-    struct PatternHead expected;
+    struct PatternList expected;
     SLIST_INIT(&expected);
     struct Pattern e = { .op = MUTT_PAT_SUBJECT,
                          .pat_not = true,
@@ -351,7 +351,7 @@ void test_mutt_pattern_comp(void)
     char *s = "=s foo =s bar";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(pat != NULL))
     {
@@ -359,7 +359,7 @@ void test_mutt_pattern_comp(void)
       TEST_MSG("Actual  : pat == NULL");
     }
 
-    struct PatternHead expected;
+    struct PatternList expected;
 
     struct Pattern e[3] = { /* root */
                             { .op = MUTT_PAT_AND,
@@ -401,7 +401,7 @@ void test_mutt_pattern_comp(void)
 
     SLIST_INIT(&expected);
     SLIST_INSERT_HEAD(&expected, &e[0], entries);
-    struct PatternHead child;
+    struct PatternList child;
     SLIST_INIT(&child);
     e[0].child = &child;
     SLIST_INSERT_HEAD(e[0].child, &e[1], entries);
@@ -430,7 +430,7 @@ void test_mutt_pattern_comp(void)
     char *s = "(=s foo =s bar)";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(pat != NULL))
     {
@@ -438,7 +438,7 @@ void test_mutt_pattern_comp(void)
       TEST_MSG("Actual  : pat == NULL");
     }
 
-    struct PatternHead expected;
+    struct PatternList expected;
 
     struct Pattern e[3] = { /* root */
                             { .op = MUTT_PAT_AND,
@@ -480,7 +480,7 @@ void test_mutt_pattern_comp(void)
 
     SLIST_INIT(&expected);
     SLIST_INSERT_HEAD(&expected, &e[0], entries);
-    struct PatternHead child;
+    struct PatternList child;
     SLIST_INIT(&child);
     e[0].child = &child;
     SLIST_INSERT_HEAD(e[0].child, &e[1], entries);
@@ -509,7 +509,7 @@ void test_mutt_pattern_comp(void)
     char *s = "! (=s foo =s bar)";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(pat != NULL))
     {
@@ -517,7 +517,7 @@ void test_mutt_pattern_comp(void)
       TEST_MSG("Actual  : pat == NULL");
     }
 
-    struct PatternHead expected;
+    struct PatternList expected;
 
     struct Pattern e[3] = { /* root */
                             { .op = MUTT_PAT_AND,
@@ -559,7 +559,7 @@ void test_mutt_pattern_comp(void)
 
     SLIST_INIT(&expected);
     SLIST_INSERT_HEAD(&expected, &e[0], entries);
-    struct PatternHead child;
+    struct PatternList child;
     SLIST_INIT(&child);
     e[0].child = &child;
     SLIST_INSERT_HEAD(e[0].child, &e[1], entries);
@@ -588,7 +588,7 @@ void test_mutt_pattern_comp(void)
     char *s = "=s foo =s bar =s quux";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(pat != NULL))
     {
@@ -596,7 +596,7 @@ void test_mutt_pattern_comp(void)
       TEST_MSG("Actual  : pat == NULL");
     }
 
-    struct PatternHead expected;
+    struct PatternList expected;
 
     struct Pattern e[4] = { /* root */
                             { .op = MUTT_PAT_AND,
@@ -650,7 +650,7 @@ void test_mutt_pattern_comp(void)
 
     SLIST_INIT(&expected);
     SLIST_INSERT_HEAD(&expected, &e[0], entries);
-    struct PatternHead child;
+    struct PatternList child;
     e[0].child = &child;
     SLIST_INSERT_HEAD(e[0].child, &e[1], entries);
     SLIST_INSERT_AFTER(&e[1], &e[2], entries);
@@ -679,7 +679,7 @@ void test_mutt_pattern_comp(void)
     char *s = "!(=s foo|=s bar) =s quux";
 
     mutt_buffer_reset(err);
-    struct PatternHead *pat = mutt_pattern_comp(s, 0, err);
+    struct PatternList *pat = mutt_pattern_comp(s, 0, err);
 
     if (!TEST_CHECK(pat != NULL))
     {
@@ -687,7 +687,7 @@ void test_mutt_pattern_comp(void)
       TEST_MSG("Actual  : pat == NULL");
     }
 
-    struct PatternHead expected;
+    struct PatternList expected;
 
     struct Pattern e[5] = { /* root */
                             { .op = MUTT_PAT_AND,
@@ -753,7 +753,7 @@ void test_mutt_pattern_comp(void)
 
     SLIST_INIT(&expected);
     SLIST_INSERT_HEAD(&expected, &e[0], entries);
-    struct PatternHead child1, child2;
+    struct PatternList child1, child2;
     SLIST_INIT(&child1);
     e[0].child = &child1;
     SLIST_INSERT_HEAD(e[0].child, &e[1], entries);
index d85130a7f4c6270f094a3f035c771e0759696566..59d031f25a36b457dde64dfe124a35a0011ff161 100644 (file)
@@ -13,10 +13,9 @@ static bool test_simple_cases(void)
   { /* handle edge cases */
     struct Regex *rx = regex_new("hello bob", 0, buf);
 
-    const bool failed =
-        !TEST_CHECK(mutt_regex_match(NULL, NULL) == false) ||
-        !TEST_CHECK(mutt_regex_match(NULL, "bob the string") == false) ||
-        !TEST_CHECK(mutt_regex_match(rx, NULL) == false);
+    const bool failed = !TEST_CHECK(mutt_regex_match(NULL, NULL) == false) ||
+                        !TEST_CHECK(mutt_regex_match(NULL, "bob the string") == false) ||
+                        !TEST_CHECK(mutt_regex_match(rx, NULL) == false);
     regex_free(&rx);
 
     if (failed)
@@ -171,8 +170,8 @@ static bool test_old_implementation(void)
     //          !((regexec(C_Mask->regex, mdata->group, 0, NULL, 0) == 0) ^ C_Mask->pat_not))
     //   to: if (!mutt_regex_match(C_Mask, mdata->group))
     struct Regex *rx = regex_new("!bob", DT_REGEX_ALLOW_NOT, buf);
-    const bool old =
-      (rx && rx->regex) && !((regexec(rx->regex, line, 0, NULL, 0) == 0) ^ rx->pat_not);
+    const bool old = (rx && rx->regex) &&
+                     !((regexec(rx->regex, line, 0, NULL, 0) == 0) ^ rx->pat_not);
     const bool new = !mutt_regex_match(rx, line);
     regex_free(&rx);
 
index 0f675460df1c964739df97da35f0be99aa046a81..8a1dae80d5d1633f6987d3e6887d7e32428262c8 100644 (file)
@@ -27,5 +27,5 @@
 
 void test_mutt_regexlist_new(void)
 {
-  // struct RegexListNode *mutt_regexlist_new(void);
+  // struct RegexNode *mutt_regexlist_new(void);
 }
index aee9b27d6a660ef6d420402ace2dc29ad3e04064..ee9fc73d8083a51be44d480c383d521a451a75f3 100644 (file)
@@ -27,5 +27,5 @@
 
 void test_mutt_replacelist_new(void)
 {
-  // struct ReplaceListNode *mutt_replacelist_new(void);
+  // struct Replace *mutt_replacelist_new(void);
 }
index b7099414405a77556239f697ecc17a3480e7c684..e7699958cab332e64941ea4be48ebc3c82870b69 100644 (file)
@@ -29,7 +29,7 @@
 
 void test_driver_tags_free(void)
 {
-  // void driver_tags_free(struct TagHead *head);
+  // void driver_tags_free(struct TagList *list);
 
   {
     driver_tags_free(NULL);
index 8823ee9fd3ab0a591968e4e9c120dd86727e2d49..b93d2b27a1e5b972d7557456d86fed3f434e2513 100644 (file)
@@ -29,7 +29,7 @@
 
 void test_driver_tags_get(void)
 {
-  // char *driver_tags_get(struct TagHead *head);
+  // char *driver_tags_get(struct TagList *list);
 
   {
     TEST_CHECK(!driver_tags_get(NULL));
index b78a3bafa5e8f4df2e739ab547d8a0d6f7a313ee..4129c35fb91dc4135eb7824b3f7b9b5f2a1565a5 100644 (file)
@@ -29,7 +29,7 @@
 
 void test_driver_tags_get_transformed(void)
 {
-  // char *driver_tags_get_transformed(struct TagHead *head);
+  // char *driver_tags_get_transformed(struct TagList *list);
 
   {
     TEST_CHECK(!driver_tags_get_transformed(NULL));
index f8e03fd7af44bf3848452009167372ba449bd8ec..948e7a07e7c46e561384d9d16b5d4d406784077a 100644 (file)
 
 void test_driver_tags_get_transformed_for(void)
 {
-  // char *driver_tags_get_transformed_for(struct TagHead *head, const char *name);
+  // char *driver_tags_get_transformed_for(struct TagList *list, const char *name);
 
   {
-    struct TagHead taghead = { 0 };
+    struct TagList taghead = { 0 };
     TEST_CHECK(!driver_tags_get_transformed_for(&taghead, NULL));
   }
 
index 0f7be67486922dfbc4fca786d3fec2edac29f49f..376bee559ffdbfa0eace353c9d0445ce078bbc86 100644 (file)
@@ -29,7 +29,7 @@
 
 void test_driver_tags_get_with_hidden(void)
 {
-  // char *driver_tags_get_with_hidden(struct TagHead *head);
+  // char *driver_tags_get_with_hidden(struct TagList *list);
 
   {
     TEST_CHECK(!driver_tags_get_with_hidden(NULL));
index 26c98239a34ad0ec51e77e21d7ab3061715d9a0d..8468573859cb242699d150f5d77656443de3fb71 100644 (file)
 
 void test_driver_tags_replace(void)
 {
-  // bool driver_tags_replace(struct TagHead *head, char *tags);
+  // bool driver_tags_replace(struct TagList *list, char *tags);
 
   {
     TEST_CHECK(!driver_tags_replace(NULL, "apple"));
   }
 
   {
-    struct TagHead taghead = { 0 };
+    struct TagList taghead = { 0 };
     TEST_CHECK(driver_tags_replace(&taghead, NULL));
   }
 }
index 4a69e3e5b68e3c12a2b5e3fed41769f8690c838d..35e57bd7af0109715f58a4cb6977ea597c5c4cd8 100644 (file)
@@ -84,11 +84,11 @@ static struct UrlTest test[] = {
 };
 // clang-format on
 
-void check_query_string(const char *exp, const struct UrlQueryStringHead *act)
+void check_query_string(const char *exp, const struct UrlQueryList *act)
 {
   char *next = NULL;
   char tmp[64] = { 0 };
-  const struct UrlQueryString *np = STAILQ_FIRST(act);
+  const struct UrlQuery *np = STAILQ_FIRST(act);
   while (exp && *exp)
   {
     next = strchr(exp, '|');