move mutt_get_parameter -> parameter_getval into mime.c
[apps/madmutt.git] / sendlib.c
index e92b825..0178db0 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -370,7 +370,8 @@ int mutt_write_mime_header (BODY * a, FILE * f)
 
 int mutt_write_mime_body (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;
   char send_charset[SHORT_STRING];
   FILE *fpin;
   BODY *t;
@@ -378,7 +379,7 @@ int mutt_write_mime_body (BODY * a, FILE * f)
 
   if (a->type == TYPEMULTIPART) {
     /* First, find the boundary to use */
 
   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);
       mutt_error _("No boundary parameter found! [report this error]");
 
       return (-1);
@@ -820,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)) {
   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) &&
     char *fchs = b->use_disp ? ((FileCharset && *FileCharset) ?
                                 FileCharset : Charset) : Charset;
     if (Charset && (chs || SendCharset) &&
@@ -1128,16 +1129,16 @@ void mutt_stamp_attachment (BODY * a)
 
 char *mutt_get_body_charset (char *d, ssize_t dlen, BODY * b)
 {
 
 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)
 
   if (b && b->type != TYPETEXT)
     return NULL;
 
   if (b)
-    p = mutt_get_parameter ("charset", b->parameter);
+    p = parameter_getval(b->parameter, "charset");
 
   if (p)
 
   if (p)
-    charset_canonicalize (d, dlen, NONULL (p));
+    charset_canonicalize (d, dlen, p);
   else
     m_strcpy(d, dlen, "us-ascii");
 
   else
     m_strcpy(d, dlen, "us-ascii");