picrin/src/error.c

23 lines
288 B
C
Raw Normal View History

2013-10-20 04:26:18 -04:00
#include <stdlib.h>
#include <stdio.h>
#include "picrin.h"
void
pic_error(pic_state *pic, const char *msg)
{
pic->errmsg = msg;
if (! pic->jmp) {
puts(msg);
abort();
}
longjmp(*pic->jmp, 1);
}
2013-10-20 04:26:18 -04:00
void
pic_abort(pic_state *pic, const char *msg)
2013-10-20 04:26:18 -04:00
{
puts(msg);
2013-10-20 04:26:18 -04:00
abort();
}