move mutt_get_parameter -> parameter_getval into mime.c
[apps/madmutt.git] / sendlib.c
index e8a89a6..0178db0 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -274,7 +274,6 @@ static void encode_8bit (fgetconv_t * fc, FILE * fout, int istext)
 
 int mutt_write_mime_header (BODY * a, FILE * f)
 {
-  PARAMETER *p;
   char buffer[STRING];
   char *t;
   char *fn;
@@ -285,6 +284,8 @@ int mutt_write_mime_header (BODY * a, FILE * f)
   fprintf (f, "Content-Type: %s/%s", TYPE (a), a->subtype);
 
   if (a->parameter) {
+    PARAMETER *p;
+
     len = 25 + m_strlen(a->subtype);        /* approximate len. of content-type */
 
     for (p = a->parameter; p; p = p->next) {
@@ -369,7 +370,8 @@ int mutt_write_mime_header (BODY * a, FILE * f)
 
 int mutt_write_mime_body (BODY * a, FILE * f)
 {
-  char *p, boundary[SHORT_STRING];
+  const char *p;
+  char boundary[SHORT_STRING];
   char send_charset[SHORT_STRING];
   FILE *fpin;
   BODY *t;
@@ -377,7 +379,7 @@ int mutt_write_mime_body (BODY * a, FILE * f)
 
   if (a->type == TYPEMULTIPART) {
     /* First, find the boundary to use */
-    if (!(p = mutt_get_parameter ("boundary", a->parameter))) {
+    if (!(p = parameter_getval(a->parameter, "boundary"))) {
       mutt_error _("No boundary parameter found! [report this error]");
 
       return (-1);
@@ -819,7 +821,7 @@ CONTENT *mutt_get_content_info (const char *fname, BODY * b)
   p_clear(&state, 1);
 
   if (b != NULL && b->type == TYPETEXT && (!b->noconv && !b->force_charset)) {
-    char *chs = mutt_get_parameter ("charset", b->parameter);
+    const char *chs = parameter_getval(b->parameter, "charset");
     char *fchs = b->use_disp ? ((FileCharset && *FileCharset) ?
                                 FileCharset : Charset) : Charset;
     if (Charset && (chs || SendCharset) &&
@@ -1127,16 +1129,16 @@ void mutt_stamp_attachment (BODY * a)
 
 char *mutt_get_body_charset (char *d, ssize_t dlen, BODY * b)
 {
-  char *p = NULL;
+  const char *p = NULL;
 
   if (b && b->type != TYPETEXT)
     return NULL;
 
   if (b)
-    p = mutt_get_parameter ("charset", b->parameter);
+    p = parameter_getval(b->parameter, "charset");
 
   if (p)
-    charset_canonicalize (d, dlen, NONULL (p));
+    charset_canonicalize (d, dlen, p);
   else
     m_strcpy(d, dlen, "us-ascii");