21 #include <sys/types.h>
29 #define _XOPEN_SOURCE_EXTENDED
30 #include "/usr/xpg4/include/term.h"
41 #if defined(HAVE_TERMIOS_H) && ! defined(TCSANOW)
44 #if defined(HAVE_TERM_H) && ! defined(TCSANOW)
52 #define STDIN_FILENO 0
55 #define STDOUT_FILENO 1
58#define feCTRL(C) ((C) & 0x1F)
77 int on_exit(
void (*
f)(
int,
void *),
void *arg);
122 struct termios tattr;
126 tattr.c_lflag &= ~(ICANON|
ECHO);
127 tattr.c_cc[VMIN] = 1;
128 tattr.c_cc[VTIME] = 0;
157 char *tty_name=ttyname(fileno(stdin));
159 fe_echo = fopen( tty_name,
"w" );
165 printf(
"stdin is a tty, but ttyname fails\n");
171 struct termios tattr;
183 tattr.c_lflag &= ~(ICANON|
ECHO);
184 tattr.c_cc[VMIN] = 1;
185 tattr.c_cc[VTIME] = 0;
191 printf(
"need TERM\n");
195 printf(
"could not access termcap data base\n");
205 char *t_buf=(
char *)
omAlloc(128);
208 char** t_buf_ptr= &t_buf;
210 temp = tgetstr (
"pc", t_buf_ptr);
211 PC = (temp!=
NULL) ? *temp :
'\0';
212 BC=tgetstr(
"le",t_buf_ptr);
213 UP=tgetstr(
"up",t_buf_ptr);
221 temp = tgetstr (
"ti", t_buf_ptr);
429 (
int *)fdset.fds_bits,
434 }
while( (sel == -1) && (errno == EINTR) );
460 if ((
i==0) &&(
s[0]==
'\0'))
return NULL;
636 if ((c>=
' ')&&(c<=126))
651 while ((
s[
j]!=
'\0')&&(
j<
size-2))
j++;
653 while (
j>
i) {
s[
j]=
s[
j-1];
j--; }
687 return fgets(
s,
size,stdin);
708#if defined(HAVE_DYN_RL)
710#include "kernel/mod_raw.h"
714 char *(*fe_filename_completion_function)();
715 char *(* fe_readline) ();
719 char **(*fe_completion_matches)();
747 m=(
char **)
malloc(2*
sizeof(
char*));
748 m[0]=(
char *)
malloc(end-start+2);
749 strncpy(
m[0],text,end-start+1);
807 (*fe_rl_readline_name) =
"Singular";
812 (*fe_using_history)();
817 (*fe_read_history) (
p);
827#if defined(HAVE_READLINE) && !defined(HAVE_FEREAD) && !defined(HAVE_DYN_RL)
833#if defined(HAVE_DYN_RL)
834 char *
p =
getenv(
"SINGULARHIST");
839 (*fe_write_history) (
p);
841#elif defined(HAVE_READLINE) && !defined(HAVE_FEREAD) && !defined(HAVE_DYN_RL)
842 char *
p =
getenv(
"SINGULARHIST");
849#elif defined(HAVE_FEREAD)
void select(const ListCFList &ppi, int length, ListCFList &ppi1, ListCFList &ppi2)
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
VAR BOOLEAN using_history_called
int history_total_bytes()
#define SINGULARHIST_FILE
STATIC_VAR BOOLEAN fe_is_initialized
char * fe_fgets_stdin_fe(char *pr, char *s, int size)
VAR struct termios fe_saved_attributes
static void fe_get_hist(char *s, int size, int *pos, int change, int incr)
VAR char ** fe_rl_readline_name
VAR char ** fe_rl_line_buffer
static int fe_out_char(int c)
VAR int(* fe_read_history)()
VAR void(* fe_add_history)()
VAR int(* fe_write_history)()
void fe_reset_input_mode(void)
static void fe_ctrl_u(char *s, int *i)
char * command_generator(char *text, int state)
static void fe_ctrl_k(char *s, int i)
VAR void(* fe_using_history)()
VAR BOOLEAN fe_is_raw_tty
VAR CPPFunction ** fe_rl_attempted_completion_function
VAR int(* fe_history_total_bytes)()
char ** singular_completion(char *text, int start, int end)
char **(* fe_completion_matches)()
STATIC_VAR BOOLEAN fe_stdin_is_tty
STATIC_VAR BOOLEAN fe_stdout_is_tty
static void fe_init(void)
STATIC_VAR char termcap_buff[2048]
char *(* fe_filename_completion_function)()
VAR FILE ** fe_rl_outstream
static void fe_set_cursor(char *s, int i)
static void fe_add_hist(char *s)
int dynl_close(void *handle)
void * dynl_sym(void *handle, const char *symbol)
void * dynl_open(char *filename)
#define omFreeSize(addr, size)
void PrintS(const char *s)
EXTERN_VAR int pagelength
#define omMarkAsStaticAddr(A)