]> granicus.if.org Git - neomutt/commitdiff
replace 'REPLACE_LIST' with 'struct ReplaceList'
authorRichard Russon <rich@flatcap.org>
Mon, 15 May 2017 13:50:41 +0000 (14:50 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 15 May 2017 23:05:11 +0000 (00:05 +0100)
globals.h
hcache/hcache.c
init.c
mutt.h
muttlib.c
protos.h

index 70fc300fe7b7dcded36d4ed0fc2045f48407b254..3794e2a3b660ca66d2524cb168fa4e3a14ddd8ab 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -207,9 +207,9 @@ WHERE RX_LIST *MailLists INITVAL(0);
 WHERE RX_LIST *UnMailLists INITVAL(0);
 WHERE RX_LIST *SubscribedLists INITVAL(0);
 WHERE RX_LIST *UnSubscribedLists INITVAL(0);
-WHERE REPLACE_LIST *SpamList INITVAL(0);
+WHERE struct ReplaceList *SpamList INITVAL(0);
 WHERE RX_LIST *NoSpamList INITVAL(0);
-WHERE REPLACE_LIST *SubjectRxList INITVAL(0);
+WHERE struct ReplaceList *SubjectRxList INITVAL(0);
 
 
 /* bit vector for boolean variables */
index 504e5005df9750c60097e050e429d6d488ca4ffa..0c71304bd2e006c5b95eba28fda3abdb2b43beea 100644 (file)
@@ -728,7 +728,7 @@ header_cache_t *mutt_hcache_open(const char *path, const char *folder, hcache_na
       unsigned int intval;
     } digest;
     struct md5_ctx ctx;
-    REPLACE_LIST *spam = NULL;
+    struct ReplaceList *spam = NULL;
     RX_LIST *nospam = NULL;
 
     hcachever = HCACHEVER;
diff --git a/init.c b/init.c
index fa92a20d56fcf7d2f1dafc1afc35c8a3d239a131..4aebb4394fd7ea9187d4cb45622a231cc245fdfb 100644 (file)
--- a/init.c
+++ b/init.c
@@ -604,9 +604,9 @@ int mutt_add_to_rx_list(RX_LIST **list, const char *s, int flags, struct Buffer
   return 0;
 }
 
-static int remove_from_replace_list(REPLACE_LIST **list, const char *pat)
+static int remove_from_replace_list(struct ReplaceList **list, const char *pat)
 {
-  REPLACE_LIST *cur = NULL, *prev = NULL;
+  struct ReplaceList *cur = NULL, *prev = NULL;
   int nremoved = 0;
 
   /* Being first is a special case. */
@@ -641,15 +641,15 @@ static int remove_from_replace_list(REPLACE_LIST **list, const char *pat)
   return nremoved;
 }
 
-static REPLACE_LIST *new_replace_list(void)
+static struct ReplaceList *new_replace_list(void)
 {
-  return safe_calloc(1, sizeof(REPLACE_LIST));
+  return safe_calloc(1, sizeof(struct ReplaceList));
 }
 
-static int add_to_replace_list(REPLACE_LIST **list, const char *pat,
+static int add_to_replace_list(struct ReplaceList **list, const char *pat,
                                const char *templ, struct Buffer *err)
 {
-  REPLACE_LIST *t = NULL, *last = NULL;
+  struct ReplaceList *t = NULL, *last = NULL;
   struct Regex *rx = NULL;
   int n;
   const char *p = NULL;
@@ -682,7 +682,7 @@ static int add_to_replace_list(REPLACE_LIST **list, const char *pat,
       break;
   }
 
-  /* If t is set, it's pointing into an extant REPLACE_LIST* that we want to
+  /* If t is set, it's pointing into an extant ReplaceList* that we want to
    * update. Otherwise we want to make a new one to link at the list's end.
    */
   if (!t)
@@ -698,7 +698,7 @@ static int add_to_replace_list(REPLACE_LIST **list, const char *pat,
   else
     mutt_free_regexp(&rx);
 
-  /* Now t is the REPLACE_LIST* that we want to modify. It is prepared. */
+  /* Now t is the ReplaceList* that we want to modify. It is prepared. */
   t->template = safe_strdup(templ);
 
   /* Find highest match number in template string */
@@ -979,7 +979,7 @@ static int parse_unalternates(struct Buffer *buf, struct Buffer *s, unsigned lon
 
 static int parse_replace_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err)
 {
-  REPLACE_LIST **list = (REPLACE_LIST **) data;
+  struct ReplaceList **list = (struct ReplaceList **) data;
   struct Buffer templ;
 
   memset(&templ, 0, sizeof(templ));
@@ -1012,7 +1012,7 @@ static int parse_replace_list(struct Buffer *buf, struct Buffer *s, unsigned lon
 
 static int parse_unreplace_list(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err)
 {
-  REPLACE_LIST **list = (REPLACE_LIST **) data;
+  struct ReplaceList **list = (struct ReplaceList **) data;
 
   /* First token is a regexp. */
   if (!MoreArgs(s))
diff --git a/mutt.h b/mutt.h
index 201eabbf5a38a0d6fb339e0d57c6af1bdc241e01..e3475bc4512a835fe0d6235374a70d0eff4f20ce 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -607,13 +607,13 @@ typedef struct rx_list_t
   struct rx_list_t *next;
 } RX_LIST;
 
-typedef struct replace_list_t
+struct ReplaceList
 {
   struct Regex *rx;
   int nmatch;
   char *template;
-  struct replace_list_t *next;
-} REPLACE_LIST;
+  struct ReplaceList *next;
+};
 
 static inline struct List *mutt_new_list(void)
 {
@@ -622,7 +622,7 @@ static inline struct List *mutt_new_list(void)
 
 void mutt_free_list(struct List **list);
 void mutt_free_rx_list(RX_LIST **list);
-void mutt_free_replace_list(REPLACE_LIST **list);
+void mutt_free_replace_list(struct ReplaceList **list);
 struct List *mutt_copy_list(struct List *p);
 int mutt_matches_ignore(const char *s);
 bool mutt_matches_list(const char *s, struct List *t);
index 4e9f6c12ba80087dbb239f277753e3862f010991..68b98ce4f94e1f6dc63d6cbb9119208e59605d08 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1178,9 +1178,9 @@ void mutt_safe_path(char *s, size_t l, struct Address *a)
 
 /* Note this function uses a fixed size buffer of LONG_STRING and so
  * should only be used for visual modifications, such as disp_subj. */
-char *mutt_apply_replace(char *dbuf, size_t dlen, char *sbuf, REPLACE_LIST *rlist)
+char *mutt_apply_replace(char *dbuf, size_t dlen, char *sbuf, struct ReplaceList *rlist)
 {
-  REPLACE_LIST *l = NULL;
+  struct ReplaceList *l = NULL;
   static regmatch_t *pmatch = NULL;
   static int nmatch = 0;
   static char twinbuf[2][LONG_STRING];
@@ -2041,9 +2041,9 @@ void mutt_free_rx_list(RX_LIST **list)
   }
 }
 
-void mutt_free_replace_list(REPLACE_LIST **list)
+void mutt_free_replace_list(struct ReplaceList **list)
 {
-  REPLACE_LIST *p = NULL;
+  struct ReplaceList *p = NULL;
 
   if (!list)
     return;
@@ -2081,7 +2081,7 @@ bool mutt_match_rx_list(const char *s, RX_LIST *l)
  *
  * Returns true if the argument `s` matches a pattern in the spam list, otherwise
  * false. */
-bool mutt_match_spam_list(const char *s, REPLACE_LIST *l, char *text, int textsize)
+bool mutt_match_spam_list(const char *s, struct ReplaceList *l, char *text, int textsize)
 {
   static regmatch_t *pmatch = NULL;
   static int nmatch = 0;
index 7f0cfcef6a79cfd8a9f628451b93ac7f17795257..733c5a671d20283ef8e8dab1db7f491571b49183 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -272,7 +272,7 @@ void mutt_alias_add_reverse(struct Alias *t);
 void mutt_alias_delete_reverse(struct Alias *t);
 int mutt_alloc_color(int fg, int bg);
 int mutt_any_key_to_continue(const char *s);
-char *mutt_apply_replace(char *dbuf, size_t dlen, char *sbuf, REPLACE_LIST *rlist);
+char *mutt_apply_replace(char *dbuf, size_t dlen, char *sbuf, struct ReplaceList *rlist);
 int mutt_buffy_check(int force);
 int mutt_buffy_notify(void);
 int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur);
@@ -335,7 +335,7 @@ bool mutt_is_text_part(struct Body *b);
 int mutt_link_threads(struct Header *cur, struct Header *last, struct Context *ctx);
 int mutt_lookup_mime_type(struct Body *att, const char *path);
 bool mutt_match_rx_list(const char *s, RX_LIST *l);
-bool mutt_match_spam_list(const char *s, REPLACE_LIST *l, char *text, int textsize);
+bool mutt_match_spam_list(const char *s, struct ReplaceList *l, char *text, int textsize);
 int mutt_messages_in_thread(struct Context *ctx, struct Header *hdr, int flag);
 int mutt_multi_choice(char *prompt, char *letters);
 bool mutt_needs_mailcap(struct Body *m);