// Report an error for the current token static void lex_error(lexer_t* lexer, const char* fmt, ...) { va_list ap; va_start(ap, fmt); errorv(lexer->source, lexer->token_line, lexer->token_pos, fmt, ap); va_end(ap); }
void error(source_t* source, size_t line, size_t pos, const char* fmt, ...) { va_list ap; va_start(ap, fmt); errorv(source, line, pos, fmt, ap); va_end(ap); }
// Report an error at the specified location static void lex_error_at(lexer_t* lexer, size_t line, size_t pos, const char* fmt, ...) { va_list ap; va_start(ap, fmt); errorv(lexer->errors, lexer->source, line, pos, fmt, ap); va_end(ap); }
void ast_error(errors_t* errors, ast_t* ast, const char* fmt, ...) { va_list ap; va_start(ap, fmt); errorv(errors, token_source(ast->t), token_line_number(ast->t), token_line_position(ast->t), fmt, ap); va_end(ap); }
PUBLIC void httpError(HttpConn *conn, int flags, cchar *fmt, ...) { va_list args; va_start(args, fmt); errorv(conn, flags, fmt, args); va_end(args); }
void error(int level, ...) { va_list ap; va_start(ap, level); errorv(NiL, level, ap); va_end(ap); }
void pperror(int level, ...) { va_list ap; va_start(ap, level); errorv(pp.pass, level, ap); va_end(ap); }
void errorf(void *handle, void *discipline, int level, ...) { va_list ap; va_start(ap, level); errorv((discipline && handle) ? *((char **) handle) : (char *) handle, level, ap); va_end(ap); }
int errorf(void *handle, void *discipline, int level, ...) { va_list ap; va_start(ap, level); errorv((discipline && handle) ? *((char **)handle) : (char *)handle, (discipline || level < 0) ? level : (level | ERROR_LIBRARY), ap); va_end(ap); return 0; }
int cleanExit(char *str,...) { va_list ap; va_start(ap, str); errorv(str,ap); va_end(ap); Mix_CloseAudio(); SDL_Quit(); return(1); }
static void error(int level, ...) { va_list ap; trap(); va_start(ap, level); errorv(NiL, level, ap); va_end(ap); reset(level); }
PUBLIC void httpLimitError(HttpConn *conn, int flags, cchar *fmt, ...) { va_list args; va_start(args, fmt); if (conn->endpoint) { httpMonitorEvent(conn, HTTP_COUNTER_LIMIT_ERRORS, 1); } errorv(conn, flags, fmt, args); va_end(args); }
static int errorf(const regex_t* re, regdisc_t* disc, int level, ...) { va_list ap; trap(); va_start(ap, level); errorv(NiL, level, ap); va_end(ap); reset(level); return 0; }
void errorv_continue(errors_t* errors, source_t* source, size_t line, size_t pos, const char* fmt, va_list ap) { if(errors->tail == NULL) return errorv(errors, source, line, pos, fmt, ap); errormsg_t* p = errors->tail; while(p->frame != NULL) p = p->frame; p->frame = make_errorv(source, line, pos, fmt, ap); }
void cleanExit( char *str, ... ) { #ifdef HAVE_SDL va_list ap; va_start( ap, str ); errorv( str, ap ); va_end( ap ); Mix_CloseAudio(); SDL_Quit(); #endif exit( 1 ); }
// Report an error static void build_error(build_parser_t* builder, const char* fmt, ...) { assert(builder != NULL); assert(builder->source != NULL); if(builder->had_error) return; va_list ap; va_start(ap, fmt); errorv(builder->source, builder->line, builder->pos, fmt, ap); va_end(ap); builder->had_error = true; }
static void errmsg(int level, int code, const char* fmt, va_list ap) { if (!error_info.id) { struct _astdll* dp = _ast_getdll(); char* s; char* t; if (s = dp->_ast__argv[0]) { if (t = strrchr(s, '/')) s = t + 1; error_info.id = s; } } errorv(fmt, level|ERROR_NOID, ap); if ((level & ERROR_LEVEL) >= ERROR_ERROR) exit(code); }