char *value;
/* a copy from the lexer */
union {
- vector v;
+ vec3_t v;
int i;
double f;
int t; /* type */
} pptoken;
typedef struct {
- lex_ctx ctx;
+ lex_ctx_t ctx;
char *name;
char **params;
/*
* ctime and its fucking annoying newline char, no worries, we're
* professionals here.
- */
+ */
find = ctime(&finfo.st_mtime);
value = (char*)mem_a(strlen(find) + 1);
memcpy(&value[1], find, (size = strlen(find)) - 1);
#define ftepp_tokval(f) ((f)->lex->tok.value)
#define ftepp_ctx(f) ((f)->lex->tok.ctx)
-static void ftepp_errorat(ftepp_t *ftepp, lex_ctx ctx, const char *fmt, ...)
+static void ftepp_errorat(ftepp_t *ftepp, lex_ctx_t ctx, const char *fmt, ...)
{
va_list ap;
ftepp->errors++;
va_start(ap, fmt);
- con_cvprintmsg((void*)&ctx, LVL_ERROR, "error", fmt, ap);
+ con_cvprintmsg(ctx, LVL_ERROR, "error", fmt, ap);
va_end(ap);
}
ftepp->errors++;
va_start(ap, fmt);
- con_cvprintmsg((void*)&ftepp->lex->tok.ctx, LVL_ERROR, "error", fmt, ap);
+ con_cvprintmsg(ftepp->lex->tok.ctx, LVL_ERROR, "error", fmt, ap);
va_end(ap);
}
mem_d(self);
}
-static ppmacro *ppmacro_new(lex_ctx ctx, const char *name)
+static ppmacro *ppmacro_new(lex_ctx_t ctx, const char *name)
{
ppmacro *macro = (ppmacro*)mem_a(sizeof(ppmacro));
ptok = pptoken_make(ftepp);
vec_push(mp.tokens, ptok);
if (ftepp_next(ftepp) >= TOKEN_EOF) {
- ftepp_error(ftepp, "unexpected EOF in macro call");
+ ftepp_error(ftepp, "unexpected end of file in macro call");
goto on_error;
}
}
goto on_error;
}
if (ftepp_next(ftepp) >= TOKEN_EOF) {
- ftepp_error(ftepp, "unexpected EOF in macro call");
+ ftepp_error(ftepp, "unexpected end of file in macro call");
goto on_error;
}
}
- /* need to leave that up
- if (ftepp_next(ftepp) >= TOKEN_EOF) {
- ftepp_error(ftepp, "unexpected EOF in macro call");
- goto on_error;
- }
- */
*out_params = params;
return true;
}
vec_push(message, '\0');
if (ftepp->output_on)
- con_cprintmsg(&ftepp->lex->tok.ctx, LVL_MSG, "message", message);
+ con_cprintmsg(ftepp->lex->tok.ctx, LVL_MSG, "message", message);
vec_free(message);
return;
}
return;
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
- con_cprintmsg(&ftepp->lex->tok.ctx, LVL_MSG, "message", ftepp_tokval(ftepp));
+ con_cprintmsg(ftepp->lex->tok.ctx, LVL_MSG, "message", ftepp_tokval(ftepp));
}
/**
{
lex_file *old_lexer = ftepp->lex;
lex_file *inlex;
- lex_ctx ctx;
+ lex_ctx_t ctx;
char lineno[128];
char *filename;
char *old_includename;
ppcondition cond;
ppcondition *pc;
- lex_ctx ctx = ftepp_ctx(ftepp);
+ lex_ctx_t ctx = ftepp_ctx(ftepp);
if (!ftepp_skipspace(ftepp))
return false;
void ftepp_add_define(ftepp_t *ftepp, const char *source, const char *name)
{
ppmacro *macro;
- lex_ctx ctx = { "__builtin__", 0, 0 };
+ lex_ctx_t ctx = { "__builtin__", 0, 0 };
ctx.file = source;
macro = ppmacro_new(ctx, name);
/*vec_push(ftepp->macros, macro);*/