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);
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;
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;
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);
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)
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;
/* 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;
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. */