#endif
#include <lib-lib/mem.h>
+#include <lib-lib/ascii.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
#include "mutt.h"
#include "buffer.h"
-#include "ascii.h"
#include "mutt_curses.h"
#include "mapping.h"
-#include "lib/mem.h"
-#include "lib/intl.h"
-#include "lib/str.h"
#include "lib/debug.h"
#include <string.h>
static COLOR_LINE *mutt_new_color_line (void)
{
- COLOR_LINE *p = mem_calloc (1, sizeof (COLOR_LINE));
+ COLOR_LINE *p = p_new(COLOR_LINE, 1);
p->fg = p->bg = -1;
void ci_start_color (void)
{
- memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX);
- ColorQuote = p_new(int, COLOR_QUOTE_INIT);
- memset (ColorQuote, A_NORMAL, sizeof (int) * COLOR_QUOTE_INIT);
- ColorQuoteSize = COLOR_QUOTE_INIT;
- ColorQuoteUsed = 0;
-
- /* set some defaults */
- ColorDefs[MT_COLOR_STATUS] = A_REVERSE;
- ColorDefs[MT_COLOR_INDICATOR] = A_REVERSE;
- ColorDefs[MT_COLOR_SEARCH] = A_REVERSE;
- ColorDefs[MT_COLOR_MARKERS] = A_REVERSE;
- /* special meaning: toggle the relevant attribute */
- ColorDefs[MT_COLOR_BOLD] = 0;
- ColorDefs[MT_COLOR_UNDERLINE] = 0;
+ memset(ColorDefs, A_NORMAL, sizeof(int) * MT_COLOR_MAX);
+ ColorQuote = p_new(int, COLOR_QUOTE_INIT);
+ memset(ColorQuote, A_NORMAL, sizeof(int) * COLOR_QUOTE_INIT);
+ ColorQuoteSize = COLOR_QUOTE_INIT;
+ ColorQuoteUsed = 0;
+
+ /* set some defaults */
+ ColorDefs[MT_COLOR_STATUS] = A_REVERSE;
+ ColorDefs[MT_COLOR_INDICATOR] = A_REVERSE;
+ ColorDefs[MT_COLOR_SEARCH] = A_REVERSE;
+ ColorDefs[MT_COLOR_MARKERS] = A_REVERSE;
+ /* special meaning: toggle the relevant attribute */
+ ColorDefs[MT_COLOR_BOLD] = 0;
+ ColorDefs[MT_COLOR_UNDERLINE] = 0;
#ifdef HAVE_COLOR
- start_color ();
+ start_color ();
#endif
}
return (-1);
}
tmp->next = *top;
- tmp->pattern = str_dup (s);
+ tmp->pattern = m_strdup(s);
#ifdef HAVE_COLOR
if (fg != -1 && bg != -1) {
tmp->fg = fg;
}
else if (object == MT_COLOR_QUOTED) {
if (q_level >= ColorQuoteSize) {
- mem_realloc (&ColorQuote, (ColorQuoteSize += 2) * sizeof (int));
+ p_realloc(&ColorQuote, ColorQuoteSize += 2);
ColorQuote[ColorQuoteSize - 2] = ColorDefs[MT_COLOR_QUOTED];
ColorQuote[ColorQuoteSize - 1] = ColorDefs[MT_COLOR_QUOTED];
}