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