]> granicus.if.org Git - neomutt/commitdiff
globals: upper case
authorRichard Russon <rich@flatcap.org>
Sun, 9 Dec 2018 14:55:20 +0000 (14:55 +0000)
committerRichard Russon <rich@flatcap.org>
Sun, 9 Dec 2018 16:00:40 +0000 (16:00 +0000)
config/bool.c
config/bool.h
config/magic.c
config/magic.h
config/quad.c
config/quad.h
test/config/magic.c

index 6b413d0098f5bad3557dca31bd74eaa8ebc310f0..e2c6b80ae74646e274f2b4f3d98eadf638b21c07 100644 (file)
 #include "types.h"
 
 /**
- * bool_values - Valid strings for creating a Bool
+ * BoolValues - Valid strings for creating a Bool
  *
  * These strings are case-insensitive.
  */
-const char *bool_values[] = {
+const char *BoolValues[] = {
   "no", "yes", "n", "y", "false", "true", "0", "1", "off", "on", NULL,
 };
 
@@ -58,9 +58,9 @@ static int bool_string_set(const struct ConfigSet *cs, void *var, struct ConfigD
     return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
 
   int num = -1;
-  for (size_t i = 0; bool_values[i]; i++)
+  for (size_t i = 0; BoolValues[i]; i++)
   {
-    if (mutt_str_strcasecmp(bool_values[i], value) == 0)
+    if (mutt_str_strcasecmp(BoolValues[i], value) == 0)
     {
       num = i % 2;
       break;
@@ -118,7 +118,7 @@ static int bool_string_get(const struct ConfigSet *cs, void *var,
     return CSR_ERR_INVALID | CSR_INV_TYPE;
   }
 
-  mutt_buffer_addstr(result, bool_values[index]);
+  mutt_buffer_addstr(result, BoolValues[index]);
   return CSR_SUCCESS;
 }
 
index 75f7c4d2ef36b893927d6d70bd901f8aa5fd9966..112adefe4db3d26293662a59a983a15cf22af1cc 100644 (file)
@@ -27,7 +27,7 @@ struct Buffer;
 struct ConfigSet;
 struct HashElem;
 
-extern const char *bool_values[];
+extern const char *BoolValues[];
 
 void bool_init(struct ConfigSet *cs);
 int  bool_he_toggle(struct ConfigSet *cs, struct HashElem *he, struct Buffer *err);
index 3a665283801fd5a2ffaf6034d8de065cb8739a8b..78678dff250e41afb1d58bbbf15b2d906e932cf5 100644 (file)
 #include "types.h"
 
 /**
- * magic_values - Valid strings for mailbox types
+ * MagicValues - Valid strings for mailbox types
+ *
+ * These strings are case-insensitive.
  */
-const char *magic_values[] = {
+const char *MagicValues[] = {
   NULL, "mbox", "MMDF", "MH", "Maildir", NULL,
 };
 
@@ -60,9 +62,9 @@ static int magic_string_set(const struct ConfigSet *cs, void *var, struct Config
   }
 
   int num = -1;
-  for (size_t i = 1; magic_values[i]; i++)
+  for (size_t i = 1; MagicValues[i]; i++)
   {
-    if (mutt_str_strcasecmp(magic_values[i], value) == 0)
+    if (mutt_str_strcasecmp(MagicValues[i], value) == 0)
     {
       num = i;
       break;
@@ -114,13 +116,13 @@ static int magic_string_get(const struct ConfigSet *cs, void *var,
   else
     value = (int) cdef->initial;
 
-  if ((value < 1) || (value >= (mutt_array_size(magic_values) - 1)))
+  if ((value < 1) || (value >= (mutt_array_size(MagicValues) - 1)))
   {
     mutt_debug(1, "Variable has an invalid value: %d\n", value);
     return CSR_ERR_INVALID | CSR_INV_TYPE;
   }
 
-  mutt_buffer_addstr(result, magic_values[value]);
+  mutt_buffer_addstr(result, MagicValues[value]);
   return CSR_SUCCESS;
 }
 
@@ -133,7 +135,7 @@ static int magic_native_set(const struct ConfigSet *cs, void *var,
   if (!cs || !var || !cdef)
     return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
 
-  if ((value < 1) || (value >= (mutt_array_size(magic_values) - 1)))
+  if ((value < 1) || (value >= (mutt_array_size(MagicValues) - 1)))
   {
     mutt_buffer_printf(err, "Invalid magic value: %ld", value);
     return CSR_ERR_INVALID | CSR_INV_TYPE;
index a3166004fbecd1703cc63023d0781c1f9bc3ee9a..c5080dd0a44ec835b6be403f0a218ca987ddea70 100644 (file)
@@ -25,7 +25,7 @@
 
 struct ConfigSet;
 
-extern const char *magic_values[];
+extern const char *MagicValues[];
 
 /**
  * enum MailboxType - Supported mailbox formats
index f841274100d92d6d09d406bceeabfbc2bd4b1b75..efcbc65bbe7df671ff4f60168addeb105f8ef1a0 100644 (file)
 #include "types.h"
 
 /**
- * quad_values - Valid strings for creating a QuadValue
+ * QuadValues - Valid strings for creating a QuadValue
  *
  * These strings are case-insensitive.
  */
-const char *quad_values[] = {
+const char *QuadValues[] = {
   "no", "yes", "ask-no", "ask-yes", NULL,
 };
 
@@ -57,9 +57,9 @@ static int quad_string_set(const struct ConfigSet *cs, void *var, struct ConfigD
     return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
 
   int num = -1;
-  for (size_t i = 0; quad_values[i]; i++)
+  for (size_t i = 0; QuadValues[i]; i++)
   {
-    if (mutt_str_strcasecmp(quad_values[i], value) == 0)
+    if (mutt_str_strcasecmp(QuadValues[i], value) == 0)
     {
       num = i;
       break;
@@ -111,13 +111,13 @@ static int quad_string_get(const struct ConfigSet *cs, void *var,
   else
     value = (int) cdef->initial;
 
-  if (value >= (mutt_array_size(quad_values) - 1))
+  if (value >= (mutt_array_size(QuadValues) - 1))
   {
     mutt_debug(1, "Variable has an invalid value: %d\n", value);
     return CSR_ERR_INVALID | CSR_INV_TYPE;
   }
 
-  mutt_buffer_addstr(result, quad_values[value]);
+  mutt_buffer_addstr(result, QuadValues[value]);
   return CSR_SUCCESS;
 }
 
@@ -130,7 +130,7 @@ static int quad_native_set(const struct ConfigSet *cs, void *var,
   if (!cs || !var || !cdef)
     return CSR_ERR_CODE; /* LCOV_EXCL_LINE */
 
-  if ((value < 0) || (value >= (mutt_array_size(quad_values) - 1)))
+  if ((value < 0) || (value >= (mutt_array_size(QuadValues) - 1)))
   {
     mutt_buffer_printf(err, "Invalid quad value: %ld", value);
     return CSR_ERR_INVALID | CSR_INV_TYPE;
@@ -238,7 +238,7 @@ int quad_he_toggle(struct ConfigSet *cs, struct HashElem *he, struct Buffer *err
   char *var = cdef->var;
 
   char value = *var;
-  if ((value < 0) || (value >= (mutt_array_size(quad_values) - 1)))
+  if ((value < 0) || (value >= (mutt_array_size(QuadValues) - 1)))
   {
     mutt_buffer_printf(err, "Invalid quad value: %ld", value);
     return CSR_ERR_INVALID | CSR_INV_TYPE;
index efe04fe9e60b0f44076dd8d3a37e6c15e587d1bc..98f623a9acd2046944dd69ad232264cb26418bd1 100644 (file)
@@ -27,7 +27,7 @@ struct Buffer;
 struct ConfigSet;
 struct HashElem;
 
-extern const char *quad_values[];
+extern const char *QuadValues[];
 
 /**
  * enum QuadOption - Possible values for a quad-option
index 1db4ea557eebd6d648dcdba328c5b2cf9ca65f3a..8d0c4b2495e273645cc05fca3c0e1304a904ea8d 100644 (file)
@@ -147,7 +147,7 @@ static bool test_initial_values(struct ConfigSet *cs, struct Buffer *err)
     return false;
   }
 
-  TEST_MSG("Cherry = %s\n", magic_values[VarCherry]);
+  TEST_MSG("Cherry = %s\n", MagicValues[VarCherry]);
   TEST_MSG("Cherry's initial value is %s\n", value.data);
 
   FREE(&value.data);