64 if ((*quote_list)->down)
89 struct QuoteStyle *new_class,
int index,
int *q_level)
103 q_list = q_list->
down;
105 else if (q_list->
next)
107 q_list = q_list->
next;
111 while (!q_list->
next)
118 q_list = q_list->
next;
137 size_t length,
bool *force_redraw,
int *q_level)
140 struct QuoteStyle *qc = NULL, *tmp = NULL, *ptr = NULL, *save = NULL;
141 const char *tail_qptr = NULL;
142 size_t offset, tail_lng;
191 tmp->prefix_len = length;
196 tmp->next = q_list->
next;
214 if (q_list == *quote_list)
229 *force_redraw =
true;
235 q_list = q_list->
next;
251 q_list = q_list->
down;
252 tail_lng = length - offset;
253 tail_qptr = qptr + offset;
271 tmp->prefix_len = length;
276 tmp->next = q_list->
next;
287 tmp->
up = q_list->
up;
289 if (tmp->up->down == q_list)
333 *force_redraw =
true;
338 q_list = q_list->
next;
352 q_list = q_list->
down;
353 tail_lng = length - offset;
354 tail_qptr = qptr + offset;
361 q_list = q_list->
next;
372 tmp->prefix_len = length;
376 tmp->next = ptr->down;
377 ptr->down->prev = tmp;
382 tmp->quote_n = (*q_level)++;
398 q_list = q_list->
next;
415 if ((*quote_list)->next)
420 (*quote_list)->
next = qc;
421 qc->
prev = *quote_list;
449 *cur_qlevel = (*cur_qlevel + 1) % num_qlevel;
#define MUTT_MEM_CALLOC(n, type)
Convenience wrapper for the library headers.
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
struct QuoteStyle * qstyle_classify(struct QuoteStyle **quote_list, const char *qptr, size_t length, bool *force_redraw, int *q_level)
Find a style for a string.
void qstyle_recolor(struct QuoteStyle *quote_list)
Recolour quotes after colour changes.
static void qstyle_recurse(struct QuoteStyle *quote_list, int num_qlevel, int *cur_qlevel)
Update the quoting styles after colour changes.
void qstyle_free_tree(struct QuoteStyle **quote_list)
Free an entire tree of QuoteStyle.
static void qstyle_insert(struct QuoteStyle *quote_list, struct QuoteStyle *new_class, int index, int *q_level)
Insert a new quote colour class into a list.
static struct QuoteStyle * qstyle_new(void)
Create a new QuoteStyle.
static void qstyle_free(struct QuoteStyle **ptr)
Free a single QuoteStyle object.
struct AttrColor * quoted_colors_get(int q)
Return the color of a quote, cycling through the used quotes.
int quoted_colors_num_used(void)
Return the number of used quotes.
struct AttrColor * attr_color
Colour and attribute of the text.
struct QuoteStyle * next
Different quoting styles at the same level.
size_t prefix_len
Length of the prefix string.
char * prefix
Prefix string, e.g. "> ".
struct QuoteStyle * down
Parent (less quoted) and child (more quoted) levels.
int quote_n
The quoteN colour index for this level.