#endif
#include "mutt.h"
+#include "buffer.h"
+#include "ascii.h"
#include "mutt_curses.h"
#include "mapping.h"
static COLOR_LINE *mutt_new_color_line (void)
{
- COLOR_LINE *p = safe_calloc (1, sizeof (COLOR_LINE));
+ COLOR_LINE *p = mem_calloc (1, sizeof (COLOR_LINE));
p->fg = p->bg = -1;
regfree (&tmp->rx);
mutt_pattern_free (&tmp->color_pattern);
- FREE (&tmp->pattern);
- FREE (l);
+ mem_free (&tmp->pattern);
+ mem_free (l);
}
void ci_start_color (void)
{
memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX);
- ColorQuote = (int *) safe_malloc (COLOR_QUOTE_INIT * sizeof (int));
+ ColorQuote = (int *) mem_malloc (COLOR_QUOTE_INIT * sizeof (int));
memset (ColorQuote, A_NORMAL, sizeof (int) * COLOR_QUOTE_INIT);
ColorQuoteSize = COLOR_QUOTE_INIT;
ColorQuoteUsed = 0;
i++;
}
- p = (COLOR_LIST *) safe_malloc (sizeof (COLOR_LIST));
+ p = (COLOR_LIST *) mem_malloc (sizeof (COLOR_LIST));
p->next = ColorList;
ColorList = p;
if (p == ColorList) {
ColorList = ColorList->next;
- FREE (&p);
+ mem_free (&p);
return;
}
q = ColorList;
while (q) {
if (q->next == p) {
q->next = p->next;
- FREE (&p);
+ mem_free (&p);
return;
}
q = q->next;
{
char *eptr;
- if (safe_strncasecmp (s, "bright", 6) == 0) {
+ if (str_ncasecmp (s, "bright", 6) == 0) {
*attr |= brite;
s += 6;
}
/* allow aliases for xterm color resources */
- if (safe_strncasecmp (s, "color", 5) == 0) {
+ if (str_ncasecmp (s, "color", 5) == 0) {
s += 5;
*col = strtol (s, &eptr, 10);
if (!*s || *eptr || *col < 0 ||
return (-1);
}
- if (safe_strncmp (buf->data, "index", 5) != 0) {
+ if (str_ncmp (buf->data, "index", 5) != 0) {
snprintf (err->data, err->dsize,
_("%s: command valid only for index object"),
parse_uncolor ? "uncolor" : "unmono");
do {
mutt_extract_token (buf, s, 0);
- if (!safe_strcmp ("*", buf->data)) {
+ if (!str_cmp ("*", buf->data)) {
for (tmp = ColorIndexList; tmp;) {
if (!do_cache)
do_cache = 1;
else {
for (last = NULL, tmp = ColorIndexList; tmp;
last = tmp, tmp = tmp->next) {
- if (!safe_strcmp (buf->data, tmp->pattern)) {
+ if (!str_cmp (buf->data, tmp->pattern)) {
if (!do_cache)
do_cache = 1;
debug_print (1, ("Freeing pattern \"%s\" from ColorIndexList\n", tmp->pattern));
while (tmp) {
if (sensitive) {
- if (safe_strcmp (s, tmp->pattern) == 0)
+ if (str_cmp (s, tmp->pattern) == 0)
break;
}
else {
- if (safe_strcasecmp (s, tmp->pattern) == 0)
+ if (str_casecmp (s, tmp->pattern) == 0)
break;
}
tmp = tmp->next;
return (-1);
}
tmp->next = *top;
- tmp->pattern = safe_strdup (s);
+ tmp->pattern = str_dup (s);
#ifdef HAVE_COLOR
if (fg != -1 && bg != -1) {
tmp->fg = fg;
}
mutt_extract_token (buf, s, 0);
- if (!safe_strncmp (buf->data, "quoted", 6)) {
+ if (!str_ncmp (buf->data, "quoted", 6)) {
if (buf->data[6]) {
*ql = strtol (buf->data + 6, &eptr, 10);
if (*eptr || q_level < 0) {
}
else if (object == MT_COLOR_QUOTED) {
if (q_level >= ColorQuoteSize) {
- safe_realloc (&ColorQuote, (ColorQuoteSize += 2) * sizeof (int));
+ mem_realloc (&ColorQuote, (ColorQuoteSize += 2) * sizeof (int));
ColorQuote[ColorQuoteSize - 2] = ColorDefs[MT_COLOR_QUOTED];
ColorQuote[ColorQuoteSize - 1] = ColorDefs[MT_COLOR_QUOTED];
}