#include "kernel/mod2.h"
#include <errno.h>
#include "omalloc/omalloc.h"
#include "misc/options.h"
#include "kernel/oswrapper/feread.h"
#include <unistd.h>
#include "Singular/ipid.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/stat.h>
Go to the source code of this file.
|
static char * | fe_fgets_stdin_init (const char *pr, char *s, int size) |
|
char * | iiArithGetCmd (int) |
|
char * | command_generator (char *text, int state) |
|
char * | rl_filename_completion_function (const char *, int) |
|
char ** | rl_completion_matches (const char *, RL_PROC) |
|
char * | readline (const char *) |
|
void | add_history (char *) |
|
int | write_history () |
|
void | using_history () |
|
int | read_history (char *) |
|
int | history_total_bytes () |
|
char * | fe_fgets_stdin_rl (const char *pr, char *s, int size) |
|
int | fe_init_dyn_rl () |
|
char ** | singular_completion (char *text, int start, int end) |
|
char * | fe_fgets_stdin_fe (const char *pr, char *s, int size) |
|
char * | fe_fgets_stdin_emu (const char *pr, char *s, int size) |
|
char * | fe_fgets_stdin_drl (const char *pr, char *s, int size) |
|
char * | fe_fgets (const char *pr, char *s, int size) |
|
char * | fe_fgets_dummy (const char *, char *, int) |
|
◆ rl_completion_matches
#define rl_completion_matches completion_matches |
◆ rl_filename_completion_function
#define rl_filename_completion_function filename_completion_function |
◆ STDOUT_FILENO
◆ x_rl_completion_matches
◆ x_rl_filename_completion_function
◆ x_rl_line_buffer
◆ CPPFunction
typedef char** CPPFunction() |
◆ PROC
◆ RL_CPPFunction
typedef char** RL_CPPFunction(const char *, int, int) |
◆ RL_PROC
typedef char*(* RL_PROC) (const char *, int) |
◆ add_history()
void add_history |
( |
char * |
| ) |
|
◆ command_generator()
char* command_generator |
( |
char * |
text, |
|
|
int |
state |
|
) |
| |
Definition at line 50 of file feread.cc.
71 if (strncmp (
name, text, len) == 0)
80 if (strncmp (
name, text, len) == 0)
85 return ((
char *)
NULL);
char * iiArithGetCmd(int)
int name
New type name for int.
◆ fe_fgets()
char* fe_fgets |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
Definition at line 306 of file feread.cc.
314 char *line=fgets(
s,
size,stdin);
317 for (
int i=strlen(line)-1;
i>=0;
i--) line[
i]=line[
i]&127;
325 case EBADF:
return NULL;
326 case EINTR:
return strcpy(
s,
"\n");
330 fprintf(stderr,
"fgets() failed with errno %d\n%s\n",errsv,strerror(errsv));
const CanonicalForm int s
◆ fe_fgets_dummy()
char* fe_fgets_dummy |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
◆ fe_fgets_stdin_drl()
char* fe_fgets_stdin_drl |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
Definition at line 266 of file feread.cc.
275 line = (*fe_readline) ((
char*)pr);
281 for (
int i=
l-1;
i>=0;
i--) line[
i]=line[
i]&127;
285 (*fe_add_history) (line);
289 strncpy(
s,line,
size);
◆ fe_fgets_stdin_emu()
char* fe_fgets_stdin_emu |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
Definition at line 250 of file feread.cc.
char * fe_fgets_stdin_fe(const char *pr, char *s, int size)
◆ fe_fgets_stdin_fe()
char* fe_fgets_stdin_fe |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
◆ fe_fgets_stdin_init()
static char * fe_fgets_stdin_init |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
|
static |
Definition at line 341 of file feread.cc.
343 #if (defined(HAVE_READLINE) || defined(HAVE_LIBREADLINE)) && !defined(HAVE_DYN_RL) && !defined(HAVE_FEREAD)
359 char *fn=ttyname(fileno(stdin));
364 if(isatty(fileno(stdin)))
368 char *
p =
getenv(
"SINGULARHIST");
392 Warn(
"dynamic loading failed: %d\n",
res);
407 (*fe_using_history)();
408 char *
p =
getenv(
"SINGULARHIST");
411 (*fe_read_history) (
p);
420 char *fn=ttyname(fileno(stdin));
433 #if !defined(HAVE_READLINE) && defined(HAVE_FEREAD)
EXTERN_VAR CPPFunction * rl_attempted_completion_function
EXTERN_VAR FILE * rl_outstream
char * fe_fgets_stdin_emu(const char *pr, char *s, int size)
VAR char ** fe_rl_readline_name
char ** singular_completion(char *text, int start, int end)
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
char * fe_fgets(const char *pr, char *s, int size)
VAR CPPFunction ** fe_rl_attempted_completion_function
char * fe_fgets_stdin_drl(const char *pr, char *s, int size)
char * fe_fgets_stdin_rl(const char *pr, char *s, int size)
EXTERN_VAR char * rl_readline_name
VAR FILE ** fe_rl_outstream
◆ fe_fgets_stdin_rl()
char* fe_fgets_stdin_rl |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
◆ fe_init_dyn_rl()
Definition at line 755 of file fereadl.c.
805 (*fe_rl_readline_name) =
"Singular";
809 (*fe_using_history)();
813 (*fe_read_history) (
p);
VAR char ** fe_rl_readline_name
char ** singular_completion(char *text, int start, int end)
VAR char ** fe_rl_line_buffer
VAR int(* fe_read_history)()
VAR void(* fe_add_history)()
VAR int(* fe_write_history)()
VAR void(* fe_using_history)()
char **(* fe_completion_matches)()
VAR CPPFunction ** fe_rl_attempted_completion_function
VAR int(* fe_history_total_bytes)()
VAR FILE ** fe_rl_outstream
char *(* fe_filename_completion_function)()
void * dynl_sym(void *handle, const char *symbol)
int dynl_close(void *handle)
void * dynl_open(char *filename)
◆ history_total_bytes()
int history_total_bytes |
( |
| ) |
|
◆ iiArithGetCmd()
char* iiArithGetCmd |
( |
int |
nPos | ) |
|
Definition at line 9779 of file iparith.cc.
9781 if(nPos<0)
return NULL;
cmdnames * sCmds
array of existing commands
STATIC_VAR SArithBase sArithBase
Base entry for arithmetic.
unsigned nCmdUsed
number of commands used
◆ read_history()
int read_history |
( |
char * |
| ) |
|
◆ readline()
char* readline |
( |
const char * |
| ) |
|
◆ rl_completion_matches()
◆ rl_filename_completion_function()
char* rl_filename_completion_function |
( |
const char * |
, |
|
|
int |
|
|
) |
| |
◆ singular_completion()
char** singular_completion |
( |
char * |
text, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
Definition at line 175 of file feread.cc.
181 #define x_rl_line_buffer (*fe_rl_line_buffer)
182 #define x_rl_completion_matches (*fe_completion_matches)
183 #define x_rl_filename_completion_function (*fe_filename_completion_function)
185 #define x_rl_line_buffer rl_line_buffer
186 #define x_rl_completion_matches rl_completion_matches
187 #define x_rl_filename_completion_function rl_filename_completion_function
192 #undef x_rl_line_buffer
193 #undef x_rl_completion_matches
196 m=(
char **)
malloc(2*
sizeof(
char*));
197 m[0]=(
char *)
malloc(end-start+2);
198 strncpy(
m[0],text,end-start+1);
#define x_rl_filename_completion_function
#define x_rl_completion_matches
char *(* RL_PROC)(const char *, int)
char * command_generator(char *text, int state)
void * malloc(size_t size)
◆ using_history()
◆ write_history()
◆ fe_add_history
VAR void(* fe_add_history) (char *) |
( |
char * |
| ) |
|
◆ fe_completion_matches
char**(* fe_completion_matches) (...) |
( |
|
... | ) |
|
◆ fe_fgets_stdin
◆ fe_filename_completion_function
char*(* fe_filename_completion_function) () |
( |
| ) |
|
◆ fe_history_total_bytes
VAR int(* fe_history_total_bytes) () |
( |
| ) |
|
◆ fe_read_history
VAR int(* fe_read_history) (char *) |
( |
char * |
| ) |
|
◆ fe_readline
char*(* fe_readline) (char *) |
( |
char * |
| ) |
|
◆ fe_rl_attempted_completion_function
◆ fe_rl_line_buffer
VAR char** fe_rl_line_buffer |
◆ fe_rl_outstream
VAR FILE** fe_rl_outstream |
◆ fe_rl_readline_name
VAR char** fe_rl_readline_name |
◆ fe_using_history
VAR void(* fe_using_history) () |
( |
| ) |
|
◆ fe_write_history
VAR int(* fe_write_history) () |
( |
| ) |
|
◆ rl_attempted_completion_function
◆ rl_line_buffer
◆ rl_outstream
◆ rl_readline_name