X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pager.c;h=982f7f3fb78cc3a27f70695d083e2d5ee7b33b3b;hp=e18bd1448df491c898069862876843c6d70079d0;hb=f3cbb9f51357972f6e74244494236a41dc4d84cd;hpb=cdb80705105e4a788baeaef0511363a88bda1db5 diff --git a/pager.c b/pager.c index e18bd14..982f7f3 100644 --- a/pager.c +++ b/pager.c @@ -11,45 +11,29 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "mutt.h" -#include "enter.h" -#include "mutt_curses.h" +#include "alias.h" #include "keymap.h" -#include "mutt_menu.h" #include "sort.h" #include "pager.h" #include "attach.h" #include "recvattach.h" -#include "mbyte.h" -#include "sidebar.h" +#include "charset.h" #include "buffy.h" -#include "mx.h" #include #include -#include "lib/rx.h" -#include "lib/debug.h" - -#include -#include -#include -#include -#include -#include -#include - #define ISHEADER(x) ((x) == MT_COLOR_HEADER || (x) == MT_COLOR_HDEFAULT) #define IsAttach(x) (x && (x)->bdy) @@ -678,13 +662,8 @@ resolve_types (char *buf, char *rawbuf, struct line_t *lineInfo, int n, int last } else if (m_strncmp("\033[0m", rawbuf, 4) == 0) /* a little hack... */ lineInfo[n].type = MT_COLOR_NORMAL; -#if 0 - else if (m_strncmp("[-- ", buf, 4) == 0) - lineInfo[n].type = MT_COLOR_ATTACHMENT; -#else else if (check_attachment_marker ((char *) rawbuf) == 0) lineInfo[n].type = MT_COLOR_ATTACHMENT; -#endif else if (m_strcmp("-- \n", buf) == 0 || m_strcmp("-- \r\n", buf) == 0) { i = n + 1; @@ -941,7 +920,6 @@ fill_buffer (FILE * f, off_t *last_pos, off_t offset, unsigned char *buf, } else if (*p == '\033' && *(p + 1) == ']' && check_attachment_marker ((char *) p) == 0) { - debug_print (2, ("seen attachment marker.\n")); while (*p++ != '\a') /* skip pseudo-ANSI sequence */ ; } @@ -954,11 +932,9 @@ fill_buffer (FILE * f, off_t *last_pos, off_t offset, unsigned char *buf, } #ifdef USE_NNTP -#include "mx.h" -#include "nntp.h" +#include #endif - static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, int flags, ansi_attr * pa, int cnt, int *pspace, int *pvch, int *pcol, int *pspecial) @@ -1000,7 +976,6 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, k = mbrtowc (&wc, (char *) buf + ch, cnt - ch, &mbstate); if (k == -2 || k == -1) { - debug_print (1, ("mbrtowc returned %d; errno = %d.\n", k, errno)); if (col + 4 > wrap_cols) break; col += 4; @@ -1014,7 +989,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, /* Handle backspace */ special = 0; - if (IsWPrint (wc)) { + if (iswprint(wc)) { wchar_t wc1; mbstate_t mbstate1; int k1, k2; @@ -1025,7 +1000,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, &mbstate1), k1 - k > 0 && wc1 == '\b') && (wc1 = 0, k2 = mbrtowc (&wc1, (char *) buf + ch + k1, cnt - ch - k1, - &mbstate1), k2 > 0 && IsWPrint (wc1))) { + &mbstate1), k2 > 0 && iswprint(wc1))) { if (wc == wc1) { special |= (wc == '_' && special & A_UNDERLINE) ? A_UNDERLINE : A_BOLD; @@ -1051,7 +1026,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, last_special = special; } - if (IsWPrint (wc)) { + if (iswprint(wc)) { if (wc == ' ') space = ch; t = wcwidth (wc); @@ -1093,7 +1068,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, break; ++col; if (pa) - addch (replacement_char ()); + addch (CharsetReplacement); } } *pspace = space; @@ -1446,7 +1421,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) if (stat (fname, &sb) != 0) { mutt_perror (fname); - fclose (fp); + m_fclose(&fp); return (-1); } unlink (fname); @@ -1659,13 +1634,13 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) } if (redraw & REDRAW_SIDEBAR) - sidebar_draw (MENU_PAGER); + sidebar_draw (); if ((redraw & REDRAW_INDEX) && pager_index) { /* redraw the pager_index indicator, because the * flags for this message might have changed. */ menu_redraw_current (pager_index); - sidebar_draw (MENU_PAGER); + sidebar_draw (); /* print out the pager_index status bar */ menu_status_line (buffer, sizeof (buffer), pager_index, NONULL (Status)); move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SW); @@ -1677,7 +1652,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) } /* if we're not using the index, update every time */ if (index == 0) - sidebar_draw (MENU_PAGER); + sidebar_draw (); redraw = 0; @@ -1890,7 +1865,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) M_CLEAR) != 0) break; - if (!strcmp (buffer, searchbuf)) { + if (!m_strcmp (buffer, searchbuf)) { if (SearchCompiled) { /* do an implicit search-next */ if (ch == OP_SEARCH) @@ -2571,7 +2546,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) case OP_SIDEBAR_NEXT_NEW: case OP_SIDEBAR_PREV: case OP_SIDEBAR_PREV_NEW: - sidebar_scroll (ch, MENU_PAGER); + sidebar_scroll (ch); break; default: ch = -1; @@ -2579,7 +2554,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) } } - fclose (fp); + m_fclose(&fp); if (IsHeader (extra)) { Context->msgnotreadyet = -1; if (rc == -1)