picrin/contrib/60.repl/repl.c

22 lines
297 B
C

#include "picrin.h"
#include <unistd.h>
static pic_value
pic_repl_tty_p(pic_state *pic)
{
pic_get_args(pic, "");
return pic_bool_value(pic, (isatty(STDIN_FILENO)));
}
void
pic_init_repl(pic_state *pic)
{
pic_deflibrary(pic, "picrin.repl");
pic_defun(pic, "tty?", pic_repl_tty_p);
}