picrin/tools/main.c

29 lines
448 B
C
Raw Normal View History

2014-01-17 06:58:31 -05:00
/**
* See Copyright Notice in picrin.h
*/
2013-10-10 03:15:41 -04:00
#include "picrin.h"
#include "picrin/error.h"
2013-10-10 03:15:41 -04:00
int
main(int argc, char *argv[], char **envp)
{
pic_state *pic;
2014-07-29 02:43:59 -04:00
int status = 0;
pic = pic_open(argc, argv, envp);
2014-07-27 22:43:52 -04:00
pic_try {
2014-07-29 02:23:40 -04:00
pic_import(pic, pic_read_cstr(pic, "(picrin repl)"));
pic_funcall(pic, "repl", pic_nil_value());
2014-01-08 01:38:47 -05:00
}
2014-07-27 22:43:52 -04:00
pic_catch {
pic_print_backtrace(pic, pic->err);
2014-07-29 02:43:59 -04:00
status = 1;
}
pic_close(pic);
2014-07-29 02:43:59 -04:00
return status;
}