version 1.1, 1997/10/23 22:24:12 |
version 1.2, 1997/10/23 22:51:59 |
Line 95 static EditLine *e = NULL; |
|
Line 95 static EditLine *e = NULL; |
|
/* internal functions */ |
/* internal functions */ |
static unsigned char _el_rl_complete __P((EditLine *, int)); |
static unsigned char _el_rl_complete __P((EditLine *, int)); |
static char *_get_prompt __P((EditLine *)); |
static char *_get_prompt __P((EditLine *)); |
static const HIST_ENTRY *_move_history __P((int)); |
static HIST_ENTRY *_move_history __P((int)); |
static int _history_search_gen __P((const char *, int, int)); |
static int _history_search_gen __P((const char *, int, int)); |
static int _history_expand_command __P((const char *, int, char **)); |
static int _history_expand_command __P((const char *, int, char **)); |
static char *_rl_compat_sub __P((const char *, const char *, |
static char *_rl_compat_sub __P((const char *, const char *, |
|
|
/* |
/* |
* generic function for moving around history |
* generic function for moving around history |
*/ |
*/ |
static const HIST_ENTRY * |
static HIST_ENTRY * |
_move_history(op) |
_move_history(op) |
int op; |
int op; |
{ |
{ |
Line 386 _history_expand_command(command, len, re |
|
Line 386 _history_expand_command(command, len, re |
|
} |
} |
|
|
if (!event_data && event_num >= 0) { |
if (!event_data && event_num >= 0) { |
const HIST_ENTRY *rl_he; |
HIST_ENTRY *rl_he; |
rl_he = history_get(event_num); |
rl_he = history_get(event_num); |
if (!rl_he) |
if (!rl_he) |
return 0; |
return 0; |
Line 800 write_history(filename) |
|
Line 800 write_history(filename) |
|
* |
* |
* returned pointer points to static variable |
* returned pointer points to static variable |
*/ |
*/ |
const HIST_ENTRY * |
HIST_ENTRY * |
history_get(num) |
history_get(num) |
int num; |
int num; |
{ |
{ |
|
|
/* |
/* |
* returns current history event or NULL if there is no such event |
* returns current history event or NULL if there is no such event |
*/ |
*/ |
const HIST_ENTRY * |
HIST_ENTRY * |
current_history() |
current_history() |
{ |
{ |
return _move_history(H_CURR); |
return _move_history(H_CURR); |
Line 947 history_set_pos(pos) |
|
Line 947 history_set_pos(pos) |
|
/* |
/* |
* returns previous event in history and shifts pointer accordingly |
* returns previous event in history and shifts pointer accordingly |
*/ |
*/ |
const HIST_ENTRY * |
HIST_ENTRY * |
previous_history() |
previous_history() |
{ |
{ |
return _move_history(H_PREV); |
return _move_history(H_PREV); |
Line 956 previous_history() |
|
Line 956 previous_history() |
|
/* |
/* |
* returns next event in history and shifts pointer accordingly |
* returns next event in history and shifts pointer accordingly |
*/ |
*/ |
const HIST_ENTRY * |
HIST_ENTRY * |
next_history() |
next_history() |
{ |
{ |
return _move_history(H_NEXT); |
return _move_history(H_NEXT); |
Line 1060 history_search_pos(str, direction, pos) |
|
Line 1060 history_search_pos(str, direction, pos) |
|
* |
* |
* it's callers's responsibility to free() returned string |
* it's callers's responsibility to free() returned string |
*/ |
*/ |
char * |
char * |
tilde_expand(txt) |
tilde_expand(txt) |
const char *txt; |
char *txt; |
{ |
{ |
struct passwd *pass; |
struct passwd *pass; |
char *temp; |
char *temp; |