#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <string.h>
#include <kernel/mod_raw.h>
Go to the source code of this file.
|
void | fe_reset_fe (void) |
|
void | fe_temp_reset (void) |
|
void | fe_temp_set (void) |
|
static int | fe_out_char (int c) |
|
static void | fe_init (void) |
|
static void | fe_ctrl_k (char *s, int i) |
|
static void | fe_ctrl_u (char *s, int *i) |
|
static void | fe_add_hist (char *s) |
|
static void | fe_get_hist (char *s, int size, int *pos, int change, int incr) |
|
static int | fe_getchar () |
|
static void | fe_set_cursor (char *s, int i) |
|
char * | fe_fgets_stdin_fe (char *pr, char *s, int size) |
|
char * | command_generator (char *text, int state) |
|
char ** | singular_completion (char *text, int start, int end) |
|
int | fe_init_dyn_rl () |
|
void | fe_reset_input_mode () |
|
◆ fe_hist_max
◆ feCTRL
#define feCTRL |
( |
|
C | ) |
((C) & 0x1F) /* <ctrl> character */ |
◆ STDIN_FILENO
◆ STDOUT_FILENO
◆ CPPFunction
typedef char** CPPFunction() |
◆ command_generator()
char* command_generator |
( |
char * |
text, |
|
|
int |
state |
|
) |
| |
Definition at line 54 of file feread.cc.
56 static int list_index, len;
75 if (strncmp (
name, text, len) == 0)
84 if (strncmp (
name, text, len) == 0)
89 return ((
char *)
NULL);
char * iiArithGetCmd(int)
char name(const Variable &v)
◆ fe_add_hist()
static void fe_add_hist |
( |
char * |
s | ) |
|
|
static |
Definition at line 280 of file fereadl.c.
const CanonicalForm int s
void omMarkAsStaticAddr(void *addr)
◆ fe_ctrl_k()
static void fe_ctrl_k |
( |
char * |
s, |
|
|
int |
i |
|
) |
| |
|
static |
Definition at line 248 of file fereadl.c.
const CanonicalForm int s
◆ fe_ctrl_u()
static void fe_ctrl_u |
( |
char * |
s, |
|
|
int * |
i |
|
) |
| |
|
static |
Definition at line 264 of file fereadl.c.
const CanonicalForm int s
static void fe_ctrl_k(char *s, int i)
◆ fe_fgets_stdin_fe()
char* fe_fgets_stdin_fe |
( |
char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
Definition at line 385 of file fereadl.c.
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);
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)
static BOOLEAN fe_stdin_is_tty
static void fe_get_hist(char *s, int size, int *pos, int change, int incr)
static void fe_init(void)
static BOOLEAN fe_is_initialized
void select(const ListCFList &ppi, int length, ListCFList &ppi1, ListCFList &ppi2)
void PrintS(const char *s)
static void fe_set_cursor(char *s, int i)
◆ fe_get_hist()
static void fe_get_hist |
( |
char * |
s, |
|
|
int |
size, |
|
|
int * |
pos, |
|
|
int |
change, |
|
|
int |
incr |
|
) |
| |
|
static |
Definition at line 312 of file fereadl.c.
const CanonicalForm int s
static void fe_add_hist(char *s)
◆ fe_getchar()
static int fe_getchar |
( |
| ) |
|
|
static |
◆ fe_init()
static void fe_init |
( |
void |
| ) |
|
|
static |
Definition at line 143 of file fereadl.c.
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);
static int fe_out_char(int c)
static BOOLEAN fe_stdin_is_tty
static BOOLEAN fe_stdout_is_tty
static BOOLEAN fe_is_initialized
static char termcap_buff[2048]
struct termios fe_saved_attributes
void omMarkAsStaticAddr(void *addr)
◆ fe_init_dyn_rl()
Definition at line 766 of file fereadl.c.
814 (*fe_rl_readline_name) =
"Singular";
818 (*fe_using_history)();
822 (*fe_read_history) (
p);
char *(* fe_filename_completion_function)()
char ** singular_completion(char *text, int start, int end)
char ** fe_rl_line_buffer
void * dynl_sym(void *handle, const char *symbol)
char **(* fe_completion_matches)()
void * dynl_open(char *filename)
void(* fe_using_history)()
char ** fe_rl_readline_name
int(* fe_history_total_bytes)()
int dynl_close(void *handle)
int(* fe_write_history)()
CPPFunction ** fe_rl_attempted_completion_function
◆ fe_out_char()
static int fe_out_char |
( |
int |
c | ) |
|
|
static |
◆ fe_reset_fe()
void fe_reset_fe |
( |
void |
| ) |
|
Definition at line 86 of file fereadl.c.
static BOOLEAN fe_stdin_is_tty
#define omFreeSize(addr, size)
static BOOLEAN fe_stdout_is_tty
struct termios fe_saved_attributes
◆ fe_reset_input_mode()
void fe_reset_input_mode |
( |
| ) |
|
Definition at line 836 of file fereadl.c.
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)
int history_total_bytes()
int(* fe_history_total_bytes)()
◆ fe_set_cursor()
static void fe_set_cursor |
( |
char * |
s, |
|
|
int |
i |
|
) |
| |
|
static |
Definition at line 364 of file fereadl.c.
const CanonicalForm int s
static int fe_out_char(int c)
◆ fe_temp_reset()
void fe_temp_reset |
( |
void |
| ) |
|
Definition at line 113 of file fereadl.c.
struct termios fe_saved_attributes
◆ fe_temp_set()
void fe_temp_set |
( |
void |
| ) |
|
Definition at line 121 of file fereadl.c.
125 struct termios tattr;
129 tattr.c_lflag &= ~(ICANON|
ECHO);
130 tattr.c_cc[VMIN] = 1;
131 tattr.c_cc[VTIME] = 0;
◆ singular_completion()
char** singular_completion |
( |
char * |
text, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
Definition at line 746 of file fereadl.c.
757 m=(
char **)
malloc(2*
sizeof(
char*));
758 m[0]=(
char *)
malloc(end-start+2);
759 strncpy(
m[0],text,end-start+1);
char *(* fe_filename_completion_function)()
char ** fe_rl_line_buffer
char **(* fe_completion_matches)()
void * malloc(size_t size)
char * command_generator(char *text, int state)
◆ fe_add_history
void(* fe_add_history) () |
◆ fe_completion_matches
char**(* fe_completion_matches) () |
◆ fe_cursor_line
◆ fe_cursor_pos
◆ fe_echo
◆ fe_filename_completion_function
char*(* fe_filename_completion_function) () |
◆ fe_hist
◆ fe_hist_pos
◆ fe_history_total_bytes
int(* fe_history_total_bytes) () |
◆ fe_is_initialized
◆ fe_is_raw_tty
◆ fe_read_history
int(* fe_read_history) () |
◆ fe_readline
◆ fe_rl_attempted_completion_function
◆ fe_rl_hdl
◆ fe_rl_line_buffer
◆ fe_rl_outstream
◆ fe_rl_readline_name
char** fe_rl_readline_name |
◆ fe_saved_attributes
struct termios fe_saved_attributes |
◆ fe_stdin_is_tty
◆ fe_stdout_is_tty
◆ fe_use_fgets
◆ fe_using_history
void(* fe_using_history) () |
◆ fe_write_history
int(* fe_write_history) () |
◆ pagelength
◆ termcap_buff