#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 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_fgets()
char* fe_fgets |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
Definition at line 310 of file feread.cc.
318 char *line=fgets(
s,
size,stdin);
321 for (
int i=strlen(line)-1;
i>=0;
i--) line[
i]=line[
i]&127;
329 case EBADF:
return NULL;
330 case EINTR:
return strcpy(
s,
"\n");
334 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 * |
, |
|
|
char * |
, |
|
|
int |
|
|
) |
| |
◆ fe_fgets_stdin_drl()
char* fe_fgets_stdin_drl |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
Definition at line 270 of file feread.cc.
279 line = (*fe_readline) ((
char*)pr);
285 for (
int i=
l-1;
i>=0;
i--) line[
i]=line[
i]&127;
289 (*fe_add_history) (line);
293 strncpy(
s,line,
size);
const CanonicalForm int s
◆ fe_fgets_stdin_emu()
char* fe_fgets_stdin_emu |
( |
const char * |
pr, |
|
|
char * |
s, |
|
|
int |
size |
|
) |
| |
Definition at line 254 of file feread.cc.
const CanonicalForm int s
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 345 of file feread.cc.
347 #if (defined(HAVE_READLINE) || defined(HAVE_LIBREADLINE)) && !defined(HAVE_DYN_RL) && !defined(HAVE_FEREAD) 363 char *fn=ttyname(fileno(stdin));
368 if(isatty(fileno(stdin)))
372 char *
p =
getenv(
"SINGULARHIST");
396 Warn(
"dynamic loading failed: %d\n",
res);
411 (*fe_using_history)();
412 char *
p =
getenv(
"SINGULARHIST");
415 (*fe_read_history) (
p);
424 char *fn=ttyname(fileno(stdin));
437 #if !defined(HAVE_READLINE) && defined(HAVE_FEREAD)
const CanonicalForm int s
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
CPPFunction * rl_attempted_completion_function
char * fe_fgets(const char *pr, char *s, int size)
char * fe_fgets_stdin_rl(const char *pr, char *s, int size)
char * fe_fgets_stdin_emu(const char *pr, char *s, int size)
char ** singular_completion(char *text, int start, int end)
CPPFunction ** fe_rl_attempted_completion_function
char * fe_fgets_stdin_drl(const char *pr, char *s, int size)
char ** fe_rl_readline_name
◆ 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.
803 (*fe_rl_readline_name) =
"Singular";
807 (*fe_using_history)();
811 (*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
◆ history_total_bytes()
int history_total_bytes |
( |
| ) |
|
◆ iiArithGetCmd()
char* iiArithGetCmd |
( |
int |
| ) |
|
Definition at line 9170 of file iparith.cc.
9172 if(nPos<0)
return NULL;
unsigned nCmdUsed
number of commands used
static SArithBase sArithBase
Base entry for arithmetic.
cmdnames * sCmds
array of existing commands
◆ 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 179 of file feread.cc.
185 #define x_rl_line_buffer (*fe_rl_line_buffer) 186 #define x_rl_completion_matches (*fe_completion_matches) 187 #define x_rl_filename_completion_function (*fe_filename_completion_function) 189 #define x_rl_line_buffer rl_line_buffer 190 #define x_rl_completion_matches rl_completion_matches 191 #define x_rl_filename_completion_function rl_filename_completion_function 196 #undef x_rl_line_buffer 197 #undef x_rl_completion_matches 200 m=(
char **)
malloc(2*
sizeof(
char*));
201 m[0]=(
char *)
malloc(end-start+2);
202 strncpy(
m[0],text,end-start+1);
char * command_generator(char *text, int state)
#define x_rl_filename_completion_function
void * malloc(size_t size)
char *(* RL_PROC)(const char *, int)
#define x_rl_completion_matches
◆ using_history()
◆ write_history()
◆ fe_add_history
void(* fe_add_history) (char *) |
◆ fe_completion_matches
char**(* fe_completion_matches) (...) |
◆ fe_fgets_stdin
◆ fe_filename_completion_function
char*(* fe_filename_completion_function) () |
◆ fe_history_total_bytes
int(* fe_history_total_bytes) () |
◆ fe_read_history
int(* fe_read_history) (char *) |
◆ fe_readline
char*(* fe_readline) (char *) |
◆ fe_rl_attempted_completion_function
◆ fe_rl_line_buffer
◆ fe_rl_outstream
◆ fe_rl_readline_name
char** fe_rl_readline_name |
◆ fe_using_history
void(* fe_using_history) () |
◆ fe_write_history
int(* fe_write_history) () |
◆ rl_attempted_completion_function
◆ rl_line_buffer
◆ rl_outstream
◆ rl_readline_name