57 #ifndef SUPPORT_EDITLINE 98 static int possible_commandp(
char *text,
int start,
int end);
99 static int possible_variablep(
char *text,
int start,
int end);
100 static char **command_completion (
char *text,
int start,
int end);
102 static char *el_line =
NULL;
105 static char *full_history_file =
".editline_history";
107 static STATUS siod_display_doc ()
111 const char *docstring;
117 for (i=0; docstring[i] !=
'\0'; i++)
118 putc(docstring[i],stderr);
126 static STATUS siod_say_doc ()
134 fprintf(stderr,
"\nsynthesizing doc string ...");
144 static STATUS siod_manual()
150 const char *infostring;
155 fprintf(stderr,
"%s",infostring);
199 if ((el_line==
NULL) ||
204 else if (el_pos == -1)
223 fprintf(stderr,
"fix ungetc when nothing is there");
227 static int qsort_str_compare(
const void *p1,
const void *p2)
232 s1 = *(
const char **)p1;
233 s2 = *(
const char **)p2;
235 return strcmp(s1,s2);
238 static char **command_completion (
char *text,
int start,
int end)
240 char **matches =
NULL;
245 if (possible_commandp(text,
start,end))
247 else if (possible_variablep(text,
start,end))
250 if (matches && matches[0] && matches[1])
253 for (i=0; matches[i] !=
NULL; i++);
254 qsort(matches,i,
sizeof(
char *),qsort_str_compare);
260 static int possible_commandp(
char *text,
int start,
int end)
267 for (t=
start-1; t >= 0; t--)
268 if (strchr(
" \t\n\r",text[t]) !=
NULL)
270 else if (text[t] ==
'(')
278 static int possible_variablep(
char *text,
int start,
int end)
285 for (t=
start-1; t >= 0; t--)
286 if (strchr(
" \t\n",text[t]) !=
NULL)
288 else if (text[t] ==
'(')
290 else if ((text[t] ==
'"') &&
float end(const EST_Item &item)
#define walloc(TYPE, SIZE)
void read_history(const char *history_file)
void qsort(EST_TList< T > &a)
EL_USER_COMPLETION_FUNCTION_TYPE * el_user_completion_function
char ** siod_command_generator(char *text, int length)
const char * siod_manual_sym(const char *symbol)
char * editline_history_file
void write_history(const char *history_file)
int siod_el_getc(FILE *f)
void el_bind_key_in_metamap(char c, Keymap_Function func)
const char * siod_docstring(const char *symbol)
void siod_saydocstring(const char *symbol)
void add_history(char *p)
void siod_el_ungetc(int c, FILE *f)
float start(const EST_Item &item)
char * readline(CONST char *prompt)
char ** siod_variable_generator(char *text, int length)