~ubuntu-branches/ubuntu/vivid/mutt/vivid-updates

« back to all changes in this revision

Viewing changes to mutt_curses.h

Tags: 1.5.18-6
* Grab from upstream:
  + Guard idata->mailbox read in imap_mailbox_state.
    The bug happens when a user has more than a imap mailbox, when
    he/she browses through them mutt will segfault.
    (Closes: #462266, #513230, #514309. Mutt: #3057)

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
  struct color_line *next;
142
142
} COLOR_LINE;
143
143
 
 
144
#define M_PROGRESS_SIZE         (1<<0)  /* traffic-based progress */
 
145
#define M_PROGRESS_MSG          (1<<1)  /* message-based progress */
 
146
 
144
147
typedef struct
145
148
{
 
149
  unsigned short inc;
 
150
  unsigned short flags;
146
151
  const char* msg;
147
152
  long pos;
148
153
  long size;
 
154
  unsigned int timestamp;
149
155
  char sizestr[SHORT_STRING];
150
156
} progress_t;
151
157
 
152
 
void mutt_progress_bar (progress_t* progress, long pos);
 
158
void mutt_progress_init (progress_t* progress, const char *msg,
 
159
                         unsigned short flags, unsigned short inc,
 
160
                         long size);
 
161
/* If percent is positive, it is displayed as percentage, otherwise
 
162
 * percentage is calculated from progress->size and pos if progress
 
163
 * was initialized with positive size, otherwise no percentage is shown */
 
164
void mutt_progress_update (progress_t* progress, long pos, int percent);
 
165
 
 
166
static inline int mutt_term_width(short wrap)
 
167
{
 
168
  if (wrap < 0)
 
169
    return COLS > -wrap ? COLS + wrap : COLS;
 
170
  else if (wrap)
 
171
    return wrap < COLS ? wrap : COLS;
 
172
  else
 
173
    return COLS;
 
174
}
153
175
 
154
176
extern int *ColorQuote;
155
177
extern int ColorQuoteUsed;