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

index df385caf6a1c91a8ebcd823792711f0360edf701..70fc300fe7b7dcded36d4ed0fc2045f48407b254 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -41,7 +41,7 @@ WHERE char *Attribution;
 WHERE char *AttributionLocale;
 WHERE char *AttachCharset;
 WHERE char *AttachFormat;
-WHERE REGEXP AttachKeyword;
+WHERE struct Regex AttachKeyword;
 WHERE char *Charset;
 WHERE char *ComposeFormat;
 WHERE char *ConfigCharset;
@@ -280,8 +280,8 @@ WHERE struct Alias *Aliases INITVAL(0);
 WHERE struct List *UserHeader INITVAL(0);
 
 /* -- formerly in pgp.h -- */
-WHERE REGEXP PgpGoodSign;
-WHERE REGEXP PgpDecryptionOkay;
+WHERE struct Regex PgpGoodSign;
+WHERE struct Regex PgpDecryptionOkay;
 WHERE char *PgpSignAs;
 WHERE short PgpTimeout;
 WHERE char *PgpEntryFormat;
diff --git a/hook.c b/hook.c
index bfa4aa537b25fdc950f63c34b8a2d79b2ef5a900..f99c595b636bded4bb234d98d898a5175bed7aab 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -31,7 +31,7 @@
 typedef struct hook
 {
   int type;           /* hook type */
-  REGEXP rx;          /* regular expression */
+  struct Regex rx;          /* regular expression */
   char *command;      /* filename, command or pattern to execute */
   struct Pattern *pattern; /* used for fcc,save,send-hook */
   struct hook *next;
diff --git a/init.c b/init.c
index 5a269d9331bc20dd18de3c9c3a400ec1caa11f78..fa92a20d56fcf7d2f1dafc1afc35c8a3d239a131 100644 (file)
--- a/init.c
+++ b/init.c
@@ -124,7 +124,7 @@ static int parse_regex(int idx, struct Buffer *tmp, struct Buffer *err)
   int e, flags = 0;
   const char *p = NULL;
   regex_t *rx = NULL;
-  REGEXP *ptr = (REGEXP *) MuttVars[idx].data;
+  struct Regex *ptr = (struct Regex *) MuttVars[idx].data;
 
   if (!ptr->pattern || (mutt_strcmp(ptr->pattern, tmp->data) != 0))
   {
@@ -479,7 +479,7 @@ int mutt_option_set(const struct option_t *val, struct Buffer *err)
 
 static void free_opt(struct option_t *p)
 {
-  REGEXP *pp = NULL;
+  struct Regex *pp = NULL;
 
   switch (p->type & DT_MASK)
   {
@@ -487,7 +487,7 @@ static void free_opt(struct option_t *p)
       rfc822_free_address((struct Address **) p->data);
       break;
     case DT_RX:
-      pp = (REGEXP *) p->data;
+      pp = (struct Regex *) p->data;
       FREE(&pp->pattern);
       if (pp->rx)
       {
@@ -562,7 +562,7 @@ static RX_LIST *new_rx_list(void)
 int mutt_add_to_rx_list(RX_LIST **list, const char *s, int flags, struct Buffer *err)
 {
   RX_LIST *t = NULL, *last = NULL;
-  REGEXP *rx = NULL;
+  struct Regex *rx = NULL;
 
   if (!s || !*s)
     return 0;
@@ -650,7 +650,7 @@ static int add_to_replace_list(REPLACE_LIST **list, const char *pat,
                                const char *templ, struct Buffer *err)
 {
   REPLACE_LIST *t = NULL, *last = NULL;
-  REGEXP *rx = NULL;
+  struct Regex *rx = NULL;
   int n;
   const char *p = NULL;
 
@@ -1892,7 +1892,7 @@ static void set_default(struct option_t *p)
       break;
     case DT_RX:
     {
-      REGEXP *pp = (REGEXP *) p->data;
+      struct Regex *pp = (struct Regex *) p->data;
       if (!p->init && pp->pattern)
         p->init = (unsigned long) safe_strdup(pp->pattern);
       break;
@@ -1954,7 +1954,7 @@ static void restore_default(struct option_t *p)
       break;
     case DT_RX:
     {
-      REGEXP *pp = (REGEXP *) p->data;
+      struct Regex *pp = (struct Regex *) p->data;
       int flags = 0;
 
       FREE(&pp->pattern);
@@ -2601,7 +2601,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, s
       if (query || *s->dptr != '=')
       {
         /* user requested the value of this variable */
-        REGEXP *ptr = (REGEXP *) MuttVars[idx].data;
+        struct Regex *ptr = (struct Regex *) MuttVars[idx].data;
         pretty_var(err->data, err->dsize, MuttVars[idx].option, NONULL(ptr->pattern));
         break;
       }
diff --git a/mutt.h b/mutt.h
index aeaff3a9caf2d24fd43151bd05a703d04f40599f..201eabbf5a38a0d6fb339e0d57c6af1bdc241e01 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -603,13 +603,13 @@ struct List
 
 typedef struct rx_list_t
 {
-  REGEXP *rx;
+  struct Regex *rx;
   struct rx_list_t *next;
 } RX_LIST;
 
 typedef struct replace_list_t
 {
-  REGEXP *rx;
+  struct Regex *rx;
   int nmatch;
   char *template;
   struct replace_list_t *next;
index 5b675d414e67c7827406df76a8689c4f45043a41..08b779bd3c4e7617bc2cf26267fd311b263e7972 100644 (file)
 #define REGCOMP(X, Y, Z) regcomp(X, Y, REG_WORDS | REG_EXTENDED | (Z))
 #define REGEXEC(X, Y) regexec(&X, Y, (size_t) 0, (regmatch_t *) 0, (int) 0)
 
-typedef struct
+struct Regex
 {
   char *pattern; /* printable version */
   regex_t *rx;   /* compiled expression */
   int not;       /* do not match */
-} REGEXP;
+};
 
-WHERE REGEXP Mask;
-WHERE REGEXP QuoteRegexp;
-WHERE REGEXP ReplyRegexp;
-WHERE REGEXP Smileys;
-WHERE REGEXP GecosMask;
+WHERE struct Regex Mask;
+WHERE struct Regex QuoteRegexp;
+WHERE struct Regex ReplyRegexp;
+WHERE struct Regex Smileys;
+WHERE struct Regex GecosMask;
 
 #endif /* _MUTT_REGEX_H */
index db82584b8560fe45c1541fdf695eaa7cb9e26eb3..4e9f6c12ba80087dbb239f277753e3862f010991 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -2007,9 +2007,9 @@ const char *mutt_make_version(void)
   return vstring;
 }
 
-REGEXP *mutt_compile_regexp(const char *s, int flags)
+struct Regex *mutt_compile_regexp(const char *s, int flags)
 {
-  REGEXP *pp = safe_calloc(sizeof(REGEXP), 1);
+  struct Regex *pp = safe_calloc(sizeof(struct Regex), 1);
   pp->pattern = safe_strdup(s);
   pp->rx = safe_calloc(sizeof(regex_t), 1);
   if (REGCOMP(pp->rx, NONULL(s), flags) != 0)
@@ -2018,7 +2018,7 @@ REGEXP *mutt_compile_regexp(const char *s, int flags)
   return pp;
 }
 
-void mutt_free_regexp(REGEXP **pp)
+void mutt_free_regexp(struct Regex **pp)
 {
   FREE(&(*pp)->pattern);
   regfree((*pp)->rx);
index 8fc87a1065fb8c36aaa72830a464ff2a1e09baf1..7f0cfcef6a79cfd8a9f628451b93ac7f17795257 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -151,7 +151,7 @@ const char *mutt_fqdn(short may_hide_host);
 
 struct Group *mutt_pattern_group(const char *k);
 
-REGEXP *mutt_compile_regexp(const char *s, int flags);
+struct Regex *mutt_compile_regexp(const char *s, int flags);
 
 void mutt_account_hook(const char *url);
 void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv, struct List ***pp,
@@ -213,7 +213,7 @@ void mutt_free_enter_state(struct EnterState **esp);
 void mutt_free_envelope(struct Envelope **p);
 void mutt_free_header(struct Header **h);
 void mutt_free_parameter(struct Parameter **p);
-void mutt_free_regexp(REGEXP **pp);
+void mutt_free_regexp(struct Regex **pp);
 void mutt_help(int menu);
 void mutt_draw_tree(struct Context *ctx);
 void mutt_check_lookup_list(struct Body *b, char *type, int len);