2014-09-30 08:21:59 -04:00
|
|
|
#include "picrin.h"
|
2016-02-20 10:58:58 -05:00
|
|
|
#include "picrin/extra.h"
|
2014-09-30 08:21:59 -04:00
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
static pic_value
|
|
|
|
pic_repl_tty_p(pic_state *pic)
|
|
|
|
{
|
|
|
|
pic_get_args(pic, "");
|
|
|
|
|
2016-02-18 06:15:42 -05:00
|
|
|
return pic_bool_value(pic, (isatty(STDIN_FILENO)));
|
2014-09-30 08:21:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
pic_init_repl(pic_state *pic)
|
|
|
|
{
|
2016-02-18 03:39:32 -05:00
|
|
|
pic_deflibrary(pic, "picrin.repl");
|
2016-02-14 23:20:26 -05:00
|
|
|
|
|
|
|
pic_defun(pic, "tty?", pic_repl_tty_p);
|
2014-09-30 08:21:59 -04:00
|
|
|
}
|