MEM_VEC_FUNCTIONS(token, char, value)
MEM_VEC_FUNCTIONS(lex_file, frame_macro, frames)
-VECTOR_MAKE(char*, lex_filenames);
+char* *lex_filenames;
void lexerror(lex_file *lex, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
- vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap);
+ con_vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap);
va_end(ap);
}
lvl = LVL_ERROR;
va_start(ap, fmt);
- vprintmsg(lvl, lex->name, lex->sline, "warning", fmt, ap);
+ con_vprintmsg(lvl, lex->name, lex->sline, "warning", fmt, ap);
va_end(ap);
return opts_werror;
lex->peekpos = 0;
lex->eof = false;
- lex_filenames_add(lex->name);
-
+ vec_push(lex_filenames, lex->name);
return lex;
}
lex->peekpos = 0;
lex->eof = false;
- lex_filenames_add(lex->name);
+ vec_push(lex_filenames, lex->name);
return lex;
}
void lex_cleanup(void)
{
size_t i;
- for (i = 0; i < lex_filenames_elements; ++i)
- mem_d(lex_filenames_data[i]);
- mem_d(lex_filenames_data);
+ for (i = 0; i < vec_size(lex_filenames); ++i)
+ mem_d(lex_filenames[i]);
+ vec_free(lex_filenames);
}
void lex_close(lex_file *lex)