X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=sendlib.c;h=e8a89a613ee06f658342303da41c42157d92ab6e;hp=3551aaf3680697c7c36fd9e99ceec45116bed0a4;hb=2293e9bc5a94ef33dc596b064c607d6bed5ad1fd;hpb=fdb93a08e305b8755260144807e4d45106a9cb9f diff --git a/sendlib.c b/sendlib.c index 3551aaf..e8a89a6 100644 --- a/sendlib.c +++ b/sendlib.c @@ -76,7 +76,7 @@ static char MsgIdPfx = 'A'; static void transform_to_7bit (BODY * a, FILE * fpin); -static void encode_quoted (FGETCONV * fc, FILE * fout, int istext) +static void encode_quoted (fgetconv_t * fc, FILE * fout, int istext) { int c, linelen = 0; char line[77], savechar; @@ -247,7 +247,7 @@ static void b64_putc (char c, FILE * fout) } -static void encode_base64 (FGETCONV * fc, FILE * fout, int istext) +static void encode_base64 (fgetconv_t * fc, FILE * fout, int istext) { int ch, ch1 = EOF; @@ -263,7 +263,7 @@ static void encode_base64 (FGETCONV * fc, FILE * fout, int istext) fputc ('\n', fout); } -static void encode_8bit (FGETCONV * fc, FILE * fout, int istext) +static void encode_8bit (fgetconv_t * fc, FILE * fout, int istext) { int ch; @@ -373,7 +373,7 @@ int mutt_write_mime_body (BODY * a, FILE * f) char send_charset[SHORT_STRING]; FILE *fpin; BODY *t; - FGETCONV *fc; + fgetconv_t *fc; if (a->type == TYPEMULTIPART) { /* First, find the boundary to use */ @@ -598,7 +598,7 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, ssize_t *score; cd1 = mutt_iconv_open ("UTF-8", fromcode, 0); - if (cd1 == (iconv_t) (-1)) + if (cd1 == MUTT_ICONV_ERROR) return -1; cd = p_new(iconv_t, ncodes); @@ -611,7 +611,7 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, cd[i] = mutt_iconv_open (tocodes[i], "UTF-8", 0); else /* Special case for conversion to UTF-8 */ - cd[i] = (iconv_t) (-1), score[i] = -1; + cd[i] = MUTT_ICONV_ERROR, score[i] = -1; rewind (file); ibl = 0; @@ -637,7 +637,7 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, /* Convert from UTF-8 */ for (i = 0; i < ncodes; i++) - if (cd[i] != (iconv_t) (-1) && score[i] != -1) { + if (cd[i] != MUTT_ICONV_ERROR && score[i] != -1) { ub = bufu, ubl = ubl1; ob = bufo, obl = sizeof (bufo); n = my_iconv(cd[i], (ibl || ubl) ? &ub : 0, &ubl, &ob, &obl); @@ -651,7 +651,7 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, update_content_info (&infos[i], &states[i], bufo, ob - bufo); } } - else if (cd[i] == (iconv_t) (-1) && score[i] == -1) + else if (cd[i] == MUTT_ICONV_ERROR && score[i] == -1) /* Special case for conversion to UTF-8 */ update_content_info (&infos[i], &states[i], bufu, ubl1); @@ -668,13 +668,13 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, /* Find best score */ ret = -1; for (i = 0; i < ncodes; i++) { - if (cd[i] == (iconv_t) (-1) && score[i] == -1) { + if (cd[i] == MUTT_ICONV_ERROR && score[i] == -1) { /* Special case for conversion to UTF-8 */ *tocode = i; ret = 0; break; } - else if (cd[i] == (iconv_t) (-1) || score[i] == -1) + else if (cd[i] == MUTT_ICONV_ERROR || score[i] == -1) continue; else if (ret == -1 || score[i] < ret) { *tocode = i; @@ -690,7 +690,7 @@ static ssize_t convert_file_to (FILE * file, const char *fromcode, } for (i = 0; i < ncodes; i++) - if (cd[i] != (iconv_t) (-1)) + if (cd[i] != MUTT_ICONV_ERROR) iconv_close (cd[i]); iconv_close (cd1);