]> granicus.if.org Git - neomutt/commitdiff
Replace `public` variable with `only_public_key`
authorFederico Kircheis <federico.kircheis@gmail.com>
Sun, 30 Jun 2019 03:23:18 +0000 (05:23 +0200)
committerRichard Russon <rich@flatcap.org>
Fri, 5 Jul 2019 01:34:06 +0000 (02:34 +0100)
`public` is a reserved keyword in c++

ncrypt/smime.c

index a0b7d76f471ce852bc8fbc1e3b5b02808146fa1f..fdb577820dfb934d1fc6c95b96ee386da66b7884 100644 (file)
@@ -703,11 +703,11 @@ static struct SmimeKey *smime_parse_key(char *buf)
 
 /**
  * smime_get_candidates - Find keys matching a string
- * @param search String to match
- * @param public If true, only get the public keys
+ * @param search           String to match
+ * @param only_public_key  If true, only get the public keys
  * @retval ptr Matching key
  */
-static struct SmimeKey *smime_get_candidates(char *search, bool public)
+static struct SmimeKey *smime_get_candidates(char *search, bool only_public_key)
 {
   char index_file[PATH_MAX];
   char buf[1024];
@@ -715,7 +715,7 @@ static struct SmimeKey *smime_get_candidates(char *search, bool public)
   struct SmimeKey **results_end = &results;
 
   snprintf(index_file, sizeof(index_file), "%s/.index",
-           public ? NONULL(C_SmimeCertificates) : NONULL(C_SmimeKeys));
+           only_public_key ? NONULL(C_SmimeCertificates) : NONULL(C_SmimeKeys));
 
   FILE *fp = mutt_file_fopen(index_file, "r");
   if (!fp)
@@ -744,17 +744,17 @@ static struct SmimeKey *smime_get_candidates(char *search, bool public)
 
 /**
  * smime_get_key_by_hash - Find a key by its hash
- * @param hash   Hash to find
- * @param public If true, only get the public keys
+ * @param hash             Hash to find
+ * @param only_public_key  If true, only get the public keys
  * @retval ptr Matching key
  *
  * Returns the first matching key record, without prompting or checking of
  * abilities or trust.
  */
-static struct SmimeKey *smime_get_key_by_hash(char *hash, bool public)
+static struct SmimeKey *smime_get_key_by_hash(char *hash, bool only_public_key)
 {
   struct SmimeKey *match = NULL;
-  struct SmimeKey *results = smime_get_candidates(hash, public);
+  struct SmimeKey *results = smime_get_candidates(hash, only_public_key);
   for (struct SmimeKey *result = results; result; result = result->next)
   {
     if (mutt_str_strcasecmp(hash, result->hash) == 0)
@@ -771,14 +771,14 @@ static struct SmimeKey *smime_get_key_by_hash(char *hash, bool public)
 
 /**
  * smime_get_key_by_addr - Find an SIME key by address
- * @param mailbox   Email address to match
- * @param abilities Abilities to match, see #KeyFlags
- * @param public    If true, only get the public keys
- * @param may_ask   If true, the user may be asked to select a key
+ * @param mailbox          Email address to match
+ * @param abilities        Abilities to match, see #KeyFlags
+ * @param only_public_key  If true, only get the public keys
+ * @param may_ask          If true, the user may be asked to select a key
  * @retval ptr Matching key
  */
 static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities,
-                                              bool public, bool may_ask)
+                                              bool only_public_key, bool may_ask)
 {
   if (!mailbox)
     return NULL;
@@ -792,7 +792,7 @@ static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities,
   struct SmimeKey *return_key = NULL;
   bool multi_trusted_matches = false;
 
-  results = smime_get_candidates(mailbox, public);
+  results = smime_get_candidates(mailbox, only_public_key);
   for (result = results; result; result = result->next)
   {
     if (abilities && !(result->flags & abilities))
@@ -851,12 +851,12 @@ static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities,
 
 /**
  * smime_get_key_by_str - Find an SMIME key by string
- * @param str       String to match
- * @param abilities Abilities to match, see #KeyFlags
- * @param public    If true, only get the public keys
+ * @param str              String to match
+ * @param abilities        Abilities to match, see #KeyFlags
+ * @param only_public_key  If true, only get the public keys
  * @retval ptr Matching key
  */
-static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool public)
+static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool only_public_key)
 {
   if (!str)
     return NULL;
@@ -867,7 +867,7 @@ static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool
   struct SmimeKey *match = NULL;
   struct SmimeKey *return_key = NULL;
 
-  results = smime_get_candidates(str, public);
+  results = smime_get_candidates(str, only_public_key);
   for (result = results; result; result = result->next)
   {
     if (abilities && !(result->flags & abilities))
@@ -897,12 +897,12 @@ static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool
 
 /**
  * smime_ask_for_key - Ask the user to select a key
- * @param prompt    Prompt to show the user
- * @param abilities Abilities to match, see #KeyFlags
- * @param public    If true, only get the public keys
+ * @param prompt           Prompt to show the user
+ * @param abilities        Abilities to match, see #KeyFlags
+ * @param only_public_key  If true, only get the public keys
  * @retval ptr Selected SMIME key
  */
-static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool public)
+static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool only_public_key)
 {
   struct SmimeKey *key = NULL;
   char resp[128];
@@ -918,7 +918,7 @@ static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool
     if (mutt_get_field(prompt, resp, sizeof(resp), MUTT_CLEAR) != 0)
       return NULL;
 
-    key = smime_get_key_by_str(resp, abilities, public);
+    key = smime_get_key_by_str(resp, abilities, only_public_key);
     if (key)
       return key;