]> granicus.if.org Git - neomutt/commitdiff
delete unused functions
authorRichard Russon <rich@flatcap.org>
Sun, 12 Mar 2017 15:37:12 +0000 (15:37 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 16 Mar 2017 23:39:53 +0000 (23:39 +0000)
These functions have been commented out for over 6 months
(and many for more than 10 years).

hash.c
mutt_socket.c
muttlib.c
pgp.c
url.c

diff --git a/hash.c b/hash.c
index 0be99591bc2b9a265a3d1a0f0dddb3bcd745a297..9095206592cb5f450d80bb47d4bc81924d22d9b3 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -220,25 +220,6 @@ static struct hash_elem *union_hash_find_elem (const HASH *table, union hash_key
   return NULL;
 }
 
-#if 0
-static void hash_set_data (HASH *table, const char *key, void *data)
-{
-  if (!table)
-    return;
-
-  union hash_key k;
-  k.strkey = key;
-
-  unsigned int hash = table->gen_hash (k, table->nelem);
-
-  struct hash_elem *ptr = table->table[hash];
-  if (!ptr)
-    return;
-
-  ptr->data = data;
-}
-#endif
-
 static void *union_hash_find (const HASH *table, union hash_key key)
 {
   struct hash_elem *ptr = union_hash_find_elem (table, key);
index f0f5556a406714f6bf6e6e8bc2c7094b0f4f0a74..b0267dad2b251831d9ee5f2eb11e1d309593c065 100644 (file)
@@ -86,31 +86,6 @@ int mutt_socket_close (CONNECTION* conn)
   return rc;
 }
 
-#if 0
-static int mutt_socket_read (CONNECTION* conn, char* buf, size_t len)
-{
-  int rc;
-
-  if (conn->fd < 0)
-  {
-    mutt_debug (1, "mutt_socket_read: attempt to read from closed connection\n");
-    return -1;
-  }
-
-  rc = conn->conn_read (conn, buf, len);
-  /* EOF */
-  if (rc == 0)
-  {
-    mutt_error (_("Connection to %s closed"), conn->account.host);
-    mutt_sleep (2);
-  }
-  if (rc <= 0)
-    mutt_socket_close (conn);
-
-  return rc;
-}
-#endif
-
 int mutt_socket_write_d (CONNECTION *conn, const char *buf, int len, int dbg)
 {
   int rc;
index bafa18533f7265441fa66b8a55373c603804b432..25c64905200e7c705cfc665d088279f2962745cd 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -382,17 +382,6 @@ LIST *mutt_copy_list (LIST *p)
   return (l);
 }
 
-#if 0
-static HEADER *mutt_dup_header(HEADER *h)
-{
-  HEADER *hnew;
-
-  hnew = mutt_new_header();
-  memcpy(hnew, h, sizeof (HEADER));
-  return hnew;
-}
-#endif
-
 void mutt_free_header (HEADER **h)
 {
   if(!h || !*h) return;
@@ -429,33 +418,6 @@ int mutt_matches_ignore (const char *s)
     return mutt_matches_list (s, Ignore) && !mutt_matches_list (s, UnIgnore);
 }
 
-#if 0
-/* prepend the path part of *path to *link */
-static void mutt_expand_link (char *newpath, const char *path, const char *link)
-{
-  const char *lb = NULL;
-  size_t len;
-
-  /* link is full path */
-  if (*link == '/')
-  {
-    strfcpy (newpath, link, _POSIX_PATH_MAX);
-    return;
-  }
-
-  if ((lb = strrchr (path, '/')) == NULL)
-  {
-    /* no path in link */
-    strfcpy (newpath, link, _POSIX_PATH_MAX);
-    return;
-  }
-
-  len = lb - path + 1;
-  memcpy (newpath, path, len);
-  strfcpy (newpath + len, link, _POSIX_PATH_MAX - len);
-}
-#endif
-
 char *mutt_expand_path (char *s, size_t slen)
 {
   return _mutt_expand_path (s, slen, 0);
@@ -1967,17 +1929,6 @@ int state_putws (const wchar_t *ws, STATE *s)
   return 0;
 }
 
-#if 0
-static void mutt_display_sanitize (char *s)
-{
-  for (; *s; s++)
-  {
-    if (!IsPrint (*s))
-      *s = '?';
-  }
-}
-#endif
-
 void mutt_sleep (short s)
 {
   if (SleepTime > s)
diff --git a/pgp.c b/pgp.c
index abe8c045d02b44145486073d7aa8ff6b23685075..ba699629cde5476a16a0cab592214caad4f46a40 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -100,14 +100,6 @@ int pgp_valid_passphrase (void)
   return 0;
 }
 
-#if 0
-static void pgp_forget_passphrase (void)
-{
-  pgp_void_passphrase ();
-  mutt_message (_("PGP passphrase forgotten."));
-}
-#endif
-
 int pgp_use_gpg_agent (void)
 {
   char *tty;
@@ -767,72 +759,6 @@ int pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempfile)
 
 
 /* Extract pgp public keys from messages or attachments */
-
-#if 0
-static void pgp_extract_keys_from_messages (HEADER *h)
-{
-  int i;
-  char tempfname[_POSIX_PATH_MAX];
-  FILE *fpout;
-
-  if (h)
-  {
-    mutt_parse_mime_message (Context, h);
-    if(h->security & PGPENCRYPT && !pgp_valid_passphrase ())
-      return;
-  }
-
-  mutt_mktemp (tempfname, sizeof (tempfname));
-  if (!(fpout = safe_fopen (tempfname, "w")))
-  {
-    mutt_perror (tempfname);
-    return;
-  }
-
-  set_option (OPTDONTHANDLEPGPKEYS);
-
-  if (!h)
-  {
-    for (i = 0; i < Context->vcount; i++)
-    {
-      if (Context->hdrs[Context->v2r[i]]->tagged)
-      {
-       mutt_parse_mime_message (Context, Context->hdrs[Context->v2r[i]]);
-       if (Context->hdrs[Context->v2r[i]]->security & PGPENCRYPT
-          && !pgp_valid_passphrase())
-       {
-         safe_fclose (&fpout);
-         goto bailout;
-       }
-       mutt_copy_message (fpout, Context, Context->hdrs[Context->v2r[i]],
-                          MUTT_CM_DECODE|MUTT_CM_CHARCONV, 0);
-      }
-    }
-  }
-  else
-  {
-    mutt_parse_mime_message (Context, h);
-    if (h->security & PGPENCRYPT && !pgp_valid_passphrase())
-    {
-      safe_fclose (&fpout);
-      goto bailout;
-    }
-    mutt_copy_message (fpout, Context, h, MUTT_CM_DECODE|MUTT_CM_CHARCONV, 0);
-  }
-
-  safe_fclose (&fpout);
-  mutt_endwin (NULL);
-  pgp_invoke_import (tempfname);
-  mutt_any_key_to_continue (NULL);
-
-  bailout:
-
-  mutt_unlink (tempfname);
-  unset_option (OPTDONTHANDLEPGPKEYS);
-
-}
-#endif
-
 static void pgp_extract_keys_from_attachment (FILE *fp, BODY *top)
 {
   STATE s;
diff --git a/url.c b/url.c
index 224eea4f90562deb088f79a3698e139515fa5985..c7d600f7c10d24994eabdbdbe50142c91e217d92 100644 (file)
--- a/url.c
+++ b/url.c
@@ -100,20 +100,6 @@ url_scheme_t url_check_scheme (const char *s)
     return (url_scheme_t) i;
 }
 
-#if 0
-static int url_parse_file (char *d, const char *src, size_t dl)
-{
-  if (ascii_strncasecmp (src, "file:", 5))
-    return -1;
-  else if (!ascii_strncasecmp (src, "file://", 7))     /* we don't support remote files */
-    return -1;
-  else
-    strfcpy (d, src + 5, dl);
-
-  return url_pct_decode (d);
-}
-#endif
-
 /* ciss_parse_userhost: fill in components of ciss with info from src. Note
  *   these are pointers into src, which is altered with '\0's. Port of 0
  *   means no port given. */