23 #include <sys/types.h> 31 #define _XOPEN_SOURCE_EXTENDED 32 #include "/usr/xpg4/include/term.h" 43 #if defined(HAVE_TERMIOS_H) && ! defined(TCSANOW) 46 #if defined(HAVE_TERM_H) && ! defined(TCSANOW) 54 #define STDIN_FILENO 0 57 #define STDOUT_FILENO 1 60 #define feCTRL(C) ((C) & 0x1F) 72 #define fe_hist_max 32 80 int on_exit(
void (*
f)(
int,
void *),
void *arg);
125 struct termios tattr;
129 tattr.c_lflag &= ~(ICANON|
ECHO);
130 tattr.c_cc[VMIN] = 1;
131 tattr.c_cc[VTIME] = 0;
160 char *tty_name=ttyname(fileno(stdin));
162 fe_echo = fopen( tty_name,
"w" );
168 printf(
"stdin is a tty, but ttyname fails\n");
174 struct termios tattr;
186 tattr.c_lflag &= ~(ICANON|
ECHO);
187 tattr.c_cc[VMIN] = 1;
188 tattr.c_cc[VTIME] = 0;
194 printf(
"need TERM\n");
198 printf(
"could not access termcap data base\n");
208 char *t_buf=(
char *)
omAlloc(128);
211 char** t_buf_ptr= &t_buf;
213 temp = tgetstr (
"pc", t_buf_ptr);
214 PC = (temp!=
NULL) ? *temp :
'\0';
215 BC=tgetstr(
"le",t_buf_ptr);
216 UP=tgetstr(
"up",t_buf_ptr);
224 temp = tgetstr (
"ti", t_buf_ptr);
432 (
int *)fdset.fds_bits,
437 }
while( (sel == -1) && (errno == EINTR) );
463 if ((
i==0) &&(
s[0]==
'\0'))
return NULL;
639 if ((c>=
' ')&&(c<=126))
654 while ((
s[
j]!=
'\0')&&(
j<
size-2))
j++;
656 while (
j>
i) {
s[
j]=
s[
j-1];
j--; }
690 return fgets(
s,
size,stdin);
711 #if defined(HAVE_DYN_RL) 720 #include <kernel/mod_raw.h> 724 char *(*fe_filename_completion_function)();
725 char *(* fe_readline) ();
729 char **(*fe_completion_matches)();
757 m=(
char **)
malloc(2*
sizeof(
char*));
758 m[0]=(
char *)
malloc(end-start+2);
759 strncpy(
m[0],text,end-start+1);
814 (*fe_rl_readline_name) =
"Singular";
818 (*fe_using_history)();
822 (*fe_read_history) (
p);
832 #if defined(HAVE_READLINE) && !defined(HAVE_FEREAD) && !defined(HAVE_DYN_RL) 838 #if defined(HAVE_DYN_RL) 839 char *
p =
getenv(
"SINGULARHIST");
843 (*fe_write_history) (
p);
846 #if defined(HAVE_READLINE) && !defined(HAVE_FEREAD) && !defined(HAVE_DYN_RL) 847 char *
p =
getenv(
"SINGULARHIST");
854 #if defined(HAVE_FEREAD)
const CanonicalForm int s
static void fe_ctrl_k(char *s, int i)
static void fe_add_hist(char *s)
static void fe_ctrl_u(char *s, int *i)
static int fe_out_char(int c)
char *(* fe_filename_completion_function)()
char ** singular_completion(char *text, int start, int end)
static BOOLEAN fe_stdin_is_tty
#define omFreeSize(addr, size)
static void fe_get_hist(char *s, int size, int *pos, int change, int incr)
static BOOLEAN fe_stdout_is_tty
char ** fe_rl_line_buffer
void * dynl_sym(void *handle, const char *symbol)
char **(* fe_completion_matches)()
void * dynl_open(char *filename)
static void fe_init(void)
static BOOLEAN fe_is_initialized
int history_total_bytes()
void(* fe_using_history)()
void * malloc(size_t size)
void select(const ListCFList &ppi, int length, ListCFList &ppi1, ListCFList &ppi2)
char ** fe_rl_readline_name
static char termcap_buff[2048]
void PrintS(const char *s)
int(* fe_history_total_bytes)()
static void fe_set_cursor(char *s, int i)
const Variable & v
< [in] a sqrfree bivariate poly
int dynl_close(void *handle)
int(* fe_write_history)()
char * fe_fgets_stdin_fe(char *pr, char *s, int size)
struct termios fe_saved_attributes
void omMarkAsStaticAddr(void *addr)
CPPFunction ** fe_rl_attempted_completion_function
void fe_reset_input_mode()
char * command_generator(char *text, int state)