-char *mutt_get_parameter (const char *s, PARAMETER * p)
-{
- for (; p; p = p->next)
- if (ascii_strcasecmp (s, p->attribute) == 0)
- return (p->value);
-
- return NULL;
-}
-
-void mutt_set_parameter (const char *attribute, const char *value,
- PARAMETER ** p)
-{
- PARAMETER *q;
-
- if (!value) {
- mutt_delete_parameter (attribute, p);
- return;
- }
-
- for (q = *p; q; q = q->next) {
- if (ascii_strcasecmp (attribute, q->attribute) == 0) {
- m_strreplace(&q->value, value);
- return;
- }
- }
-
- q = parameter_new();
- q->attribute = m_strdup(attribute);
- q->value = m_strdup(value);
- q->next = *p;
- *p = q;
-}
-
-void mutt_delete_parameter (const char *attribute, PARAMETER ** p)
-{
- PARAMETER *q;
-
- for (q = *p; q; p = &q->next, q = q->next) {
- if (ascii_strcasecmp (attribute, q->attribute) == 0) {
- *p = q->next;
- q->next = NULL;
- parameter_list_wipe(&q);
- return;
- }
- }
-}
-
-/* returns 1 if Mutt can't display this type of data, 0 otherwise */
-int mutt_needs_mailcap (BODY * m)
-{
- switch (m->type) {
- case TYPETEXT:
-
- if (!ascii_strcasecmp ("plain", m->subtype) ||
- !ascii_strcasecmp ("rfc822-headers", m->subtype) ||
- !ascii_strcasecmp ("enriched", m->subtype))
- return 0;
- break;
-
- case TYPEAPPLICATION:
- if (mutt_is_application_pgp (m))
- return 0;
- if (mutt_is_application_smime (m))
- return 0;
- break;
-
- case TYPEMULTIPART:
- case TYPEMESSAGE:
- return 0;
- }
-
- return 1;
-}
-
-int mutt_is_text_part (BODY * b)
-{
- int t = b->type;
- char *s = b->subtype;
-
- if (mutt_is_application_pgp (b))
- return 0;
-
- if (t == TYPETEXT)
- return 1;
-
- if (t == TYPEMESSAGE) {
- if (!ascii_strcasecmp ("delivery-status", s))
- return 1;
- }
-
- if (t == TYPEAPPLICATION) {
- if (!ascii_strcasecmp ("pgp-keys", s))
- return 1;
- }
-
- return 0;
-}
-