#include "editline.h"#include <signal.h>#include <ctype.h>Include dependency graph for editline.c:

Go to the source code of this file.
Data Structures | |
| struct | _KEYMAP |
| struct | _HISTORY |
Defines | |
| #define | SCREEN_WIDTH 80 |
| #define | SCREEN_ROWS 24 |
| #define | NO_ARG (-1) |
| #define | DEL 127 |
| #define | CTL(x) ((x) & 0x1F) |
| #define | ISCTL(x) ((x) && (x) < ' ') |
| #define | UNCTL(x) ((x) + 64) |
| #define | META(x) ((x) | 0x80) |
| #define | ISMETA(x) ((x) & 0x80) |
| #define | UNMETA(x) ((x) & 0x7F) |
| #define | HIST_SIZE 20 |
| #define | TTYback() (backspace ? TTYputs((CHAR *)backspace) : TTYput('\b')) |
Typedefs | |
| typedef enum _STATUS | STATUS |
| typedef enum _CASE | CASE |
| typedef _KEYMAP | KEYMAP |
| typedef _HISTORY | HISTORY |
Enumerations | |
| enum | _STATUS { CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal } |
| enum | _CASE { TOupper, TOlower } |
Functions | |
| STATIC CHAR * | editinput () |
| int | read () |
| int | write () |
| STATIC void | TTYflush () |
| STATIC void | TTYput (CHAR c) |
| STATIC void | TTYputs (CHAR *p) |
| STATIC void | TTYshow (CHAR c) |
| STATIC void | TTYstring (CHAR *p) |
| STATIC unsigned int | TTYget () |
| STATIC void | TTYbackn (int n) |
| STATIC void | TTYinfo () |
| STATIC void | columns (int ac, CHAR **av) |
| STATIC void | reposition () |
| STATIC void | left (STATUS Change) |
| STATIC void | right (STATUS Change) |
| STATIC STATUS | ring_bell () |
| STATIC STATUS | do_macro (unsigned int c) |
| STATIC STATUS | do_forward (STATUS move) |
| STATIC STATUS | do_case (CASE type) |
| STATIC STATUS | case_down_word () |
| STATIC STATUS | case_up_word () |
| STATIC void | ceol () |
| STATIC void | clear_line () |
| STATIC STATUS | insert_string (CHAR *p) |
| STATIC STATUS | redisplay () |
| STATIC STATUS | toggle_meta_mode () |
| STATIC CHAR * | next_hist () |
| STATIC CHAR * | prev_hist () |
| STATIC STATUS | do_insert_hist (CHAR *p) |
| STATIC STATUS | do_hist (CHAR *(*move)()) |
| STATIC STATUS | h_next () |
| STATIC STATUS | h_prev () |
| STATIC STATUS | h_first () |
| STATIC STATUS | h_last () |
| STATIC int | substrcmp (char *text, char *pat, int len) |
| STATIC CHAR * | search_hist (CHAR *search, CHAR *(*move)()) |
| STATIC STATUS | h_search () |
| STATIC STATUS | fd_char () |
| STATIC void | save_yank (int begin, int i) |
| STATIC STATUS | delete_string (int count) |
| STATIC STATUS | bk_char () |
| STATIC STATUS | bk_del_char () |
| STATIC STATUS | kill_line () |
| STATIC STATUS | insert_char (int c) |
| STATIC STATUS | meta () |
| STATIC STATUS | emacs (unsigned int c) |
| STATIC STATUS | TTYspecial (unsigned int c) |
| STATIC void | hist_add (CHAR *p) |
| void | rl_reset_terminal (char *p) |
| void | rl_initialize () |
| char * | readline (CONST char *prompt) |
| void | add_history (char *p) |
| STATIC STATUS | beg_line () |
| STATIC STATUS | del_char () |
| STATIC STATUS | end_line () |
| STATIC CHAR * | find_word () |
| STATIC STATUS | c_possible () |
| STATIC STATUS | c_complete () |
| STATIC STATUS | accept_line () |
| STATIC STATUS | transpose () |
| STATIC STATUS | quote () |
| STATIC STATUS | wipe () |
| STATIC STATUS | mk_set () |
| STATIC STATUS | exchange () |
| STATIC STATUS | yank () |
| STATIC STATUS | copy_region () |
| STATIC STATUS | move_to_char () |
| STATIC STATUS | fd_word () |
| STATIC STATUS | fd_kill_word () |
| STATIC STATUS | bk_word () |
| STATIC STATUS | bk_kill_word () |
| STATIC int | argify (CHAR *line, CHAR ***avp) |
| STATIC STATUS | last_argument () |
Variables | |
| int | rl_eof |
| int | rl_erase |
| int | rl_intr |
| int | rl_kill |
| int | rl_quit |
| STATIC CHAR | NIL [] = "" |
| STATIC CONST CHAR * | Input = NIL |
| STATIC CHAR * | Line |
| STATIC CONST char * | Prompt |
| STATIC CHAR * | Yanked |
| STATIC char * | Screen |
| STATIC char | NEWLINE [] = CRLF |
| STATIC HISTORY | H |
| STATIC int | Repeat |
| STATIC int | End |
| STATIC int | Mark |
| STATIC int | OldPoint |
| STATIC int | Point |
| STATIC int | PushBack |
| STATIC int | Pushed |
| STATIC int | Signal |
| FORWARD KEYMAP | Map [33] |
| FORWARD KEYMAP | MetaMap [17] |
| STATIC SIZE_T | Length |
| STATIC SIZE_T | ScreenCount |
| STATIC SIZE_T | ScreenSize |
| STATIC char * | backspace |
| STATIC int | TTYwidth |
| STATIC int | TTYrows |
| int | rl_meta_chars = 0 |
| STATIC char | SEPS [] = "\"#$&'()*:;<=>?[\\]^`{|}~\n\t " |
| STATIC KEYMAP | Map [33] |
| STATIC KEYMAP | MetaMap [17] |
|
|
Definition at line 16 of file editline.c. Referenced by exchange(). |
|
|
Definition at line 15 of file editline.c. |
|
|
Definition at line 23 of file editline.c. Referenced by hist_add(). |
|
|
Definition at line 17 of file editline.c. Referenced by ceol(), delete_string(), left(), and TTYshow(). |
|
|
Definition at line 20 of file editline.c. Referenced by delete_string(), emacs(), left(), TTYshow(), and TTYspecial(). |
|
|
Definition at line 19 of file editline.c. |
|
|
Definition at line 14 of file editline.c. Referenced by del_char(), editinput(), emacs(), h_search(), insert_char(), kill_line(), last_argument(), and TTYspecial(). |
|
|
Definition at line 13 of file editline.c. Referenced by TTYinfo(). |
|
|
Definition at line 12 of file editline.c. Referenced by TTYinfo(). |
|
|
Definition at line 182 of file editline.c. Referenced by left(), and TTYbackn(). |
|
|
Definition at line 18 of file editline.c. Referenced by TTYshow(). |
|
|
Definition at line 21 of file editline.c. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 36 of file editline.c. |
|
|
Definition at line 29 of file editline.c. |
|
|
Definition at line 1176 of file editline.c. |
|
|
Definition at line 1032 of file editline.c. References CHAR, H, hist_add(), NULL, and strcmp. Referenced by main(). |
|
||||||||||||
|
Definition at line 1339 of file editline.c. References c, CHAR, i, isspace, MEM_INC, NEW, NULL, and p. Referenced by last_argument(). |
|
|
Definition at line 1051 of file editline.c. |
|
|
Definition at line 734 of file editline.c. References CSmove, CSstay, i, left(), and Repeat. Referenced by meta(). |
|
|
Definition at line 749 of file editline.c. References CSmove, delete_string(), i, left(), and Repeat. Referenced by TTYspecial(). |
|
|
Definition at line 1330 of file editline.c. References bk_word(), CSstay, delete_string(), OldPoint, and Point. |
|
|
Definition at line 1309 of file editline.c. References CHAR, CSmove, CSstay, i, isalnum, left(), p, Point, and Repeat. Referenced by bk_kill_word(). |
|
|
Definition at line 1137 of file editline.c. References c_possible(), CHAR, DISPOSE, find_word(), insert_string(), NEW, NULL, p, ring_bell, rl_complete(), s, SIZE_T, STATUS, strchr, strlen(), and word. |
|
|
Definition at line 1116 of file editline.c. References CHAR, columns, CSmove, DISPOSE, find_word(), ring_bell, and rl_list_possib(). Referenced by c_complete(). |
|
|
Definition at line 403 of file editline.c. |
|
|
Definition at line 409 of file editline.c. |
|
|
Definition at line 415 of file editline.c. References CHAR, End, i, ISCTL, p, Point, and TTYput(). Referenced by clear_line(), delete_string(), do_insert_hist(), and kill_line(). |
|
|
Definition at line 439 of file editline.c. References ceol(), End, Prompt, strlen(), and TTYput(). Referenced by h_search(). |
|
||||||||||||
|
Definition at line 252 of file editline.c. References CHAR, i, j, k, NEWLINE, p, skip, strlen(), TTYput(), TTYputs(), and TTYwidth. |
|
|
Definition at line 1258 of file editline.c. References CSstay, End, Mark, ring_bell, and save_yank(). |
|
|
Definition at line 1061 of file editline.c. References delete_string(), NO_ARG, and Repeat. |
|
|
Definition at line 691 of file editline.c. References ceol(), CHAR, CSmove, CSstay, End, i, ISCTL, ISMETA, p, Point, ring_bell, rl_meta_chars, save_yank(), TTYbackn(), TTYput(), and TTYstring(). Referenced by bk_del_char(), bk_kill_word(), del_char(), fd_kill_word(), kill_line(), and wipe(). |
|
|
Definition at line 374 of file editline.c. References CHAR, count, CSmove, CSstay, do_forward(), End, i, islower, isupper, OldPoint, p, Point, right(), tolower, toupper, and TOupper. Referenced by case_down_word(), and case_up_word(). |
|
|
Definition at line 349 of file editline.c. References CHAR, CSmove, CSstay, End, i, isalnum, p, Point, Repeat, and right(). |
|
|
Definition at line 524 of file editline.c. References CHAR, do_insert_hist(), i, NULL, p, Repeat, and ring_bell. |
|
|
Definition at line 511 of file editline.c. References ceol(), End, insert_string(), NULL, reposition(), and ring_bell. Referenced by do_hist(), h_first(), h_last(), and h_search(). |
|
|
Definition at line 331 of file editline.c. References CHAR, CSstay, getenv(), Input, NIL, NULL, and ring_bell. Referenced by meta(). |
|
|
Definition at line 909 of file editline.c. References c, CHAR, CSdispatch, CSdone, CSeof, CSmove, CSsignal, CSstay, emacs(), End, EOF, Mark, NO_ARG, NULL, OldPoint, Repeat, reposition(), Signal, TTYget(), and TTYspecial(). Referenced by h_search(), and readline(). |
|
|
Definition at line 855 of file editline.c. References _KEYMAP::Function, insert_char(), ISMETA, _KEYMAP::Key, Map, meta(), NO_ARG, OldPoint, PushBack, Pushed, Repeat, rl_meta_chars, s, STATUS, and UNMETA. Referenced by editinput(). |
|
|
Definition at line 1067 of file editline.c. References CSmove, CSstay, and End. Referenced by delete(). |
|
|
Definition at line 1234 of file editline.c. References c, CSeof, CSmove, CSstay, CTL, End, EOF, Mark, ring_bell, and TTYget(). |
|
|
Definition at line 658 of file editline.c. References CSmove, CSstay, End, i, Repeat, and right(). Referenced by meta(). |
|
|
Definition at line 1295 of file editline.c. References CSstay, delete_string(), do_forward(), i, OldPoint, and Point. |
|
|
Definition at line 1289 of file editline.c. References CSmove, and do_forward(). |
|
|
Definition at line 1083 of file editline.c. References CHAR, NEW, NULL, p, Point, SIZE_T, and strchr. Referenced by c_complete(), and c_possible(). |
|
|
Definition at line 551 of file editline.c. References do_insert_hist(), and H. |
|
|
Definition at line 557 of file editline.c. References do_insert_hist(), and H. |
|
|
Definition at line 539 of file editline.c. References do_hist(), and next_hist(). Referenced by meta(). |
|
|
Definition at line 545 of file editline.c. References do_hist(), and prev_hist(). Referenced by meta(). |
|
|
Definition at line 623 of file editline.c. References CHAR, clear_line(), CONST, do_insert_hist(), editinput(), move, next_hist(), NO_ARG, NULL, p, prev_hist(), Prompt, redisplay(), Repeat, ring_bell, search_hist(), Signal, and TTYputs(). |
|
|
Definition at line 952 of file editline.c. References CHAR, DISPOSE, H, HIST_SIZE, i, NULL, and strdup(). Referenced by add_history(), and readline(). |
|
|
Definition at line 790 of file editline.c. References buff, CHAR, CSstay, DISPOSE, i, insert_string(), NEW, NO_ARG, NULL, p, Repeat, s, and STATUS. |
|
|
Definition at line 450 of file editline.c. References CHAR, COPYFROMTO, CSmove, CSstay, DISPOSE, End, i, Length, MEM_INC, NEW, NULL, Point, SIZE_T, strlen(), and TTYstring(). Referenced by c_complete(), do_insert_hist(), insert_char(), last_argument(), and yank(). |
|
|
Definition at line 764 of file editline.c. References ceol(), CSmove, CSstay, delete_string(), End, i, NO_ARG, Repeat, reposition(), right(), and save_yank(). Referenced by TTYspecial(). |
|
|
Definition at line 1385 of file editline.c. References argify(), CHAR, CSstay, DISPOSE, H, insert_string(), NO_ARG, NULL, p, Repeat, ring_bell, s, STATUS, and strdup(). |
|
|
Definition at line 297 of file editline.c. References CSmove, ISCTL, ISMETA, Point, rl_meta_chars, and TTYback. Referenced by bk_char(), bk_del_char(), bk_word(), bskip(), construct(), create_slider(), decode(), findsval(), getbits(), gnu_sort(), gnu_sval(), gzscan(), gztack(), inflate(), inflate_table(), inflate_table9(), inflateBack(), inflateBack9(), init_buffer(), lunpipe(), m_transfer(), qsort1(), r_transfer(), show_inputs(), show_outputs(), sortsyms(), transpose(), and user_interface(). |
|
|
Definition at line 817 of file editline.c. References bk_char(), c, CSeof, CSstay, do_macro(), EOF, fd_char(), _KEYMAP::Function, h_next(), h_prev(), isdigit, isupper, _KEYMAP::Key, MetaMap, PushBack, Pushed, Repeat, return(), ring_bell, and TTYget(). |
|
|
Definition at line 1227 of file editline.c. |
|
|
Definition at line 1272 of file editline.c. References c, CHAR, CSeof, CSmove, End, EOF, i, p, and TTYget(). |
|
|
Definition at line 499 of file editline.c. Referenced by h_next(), and h_search(). |
|
|
Definition at line 505 of file editline.c. Referenced by h_prev(), and h_search(). |
|
|
Definition at line 1201 of file editline.c. References c, CSeof, EOF, insert_char(), and TTYget(). Referenced by copy_action(), copy_text(), copy_union(), Expand(), get_literal(), get_string(), and setopts(). |
|
|
|
|
|
Definition at line 986 of file editline.c. References CHAR, CONST, DISPOSE, editinput(), getpid, H, hist_add(), kill, Length, MEM_INC, NEW, NEWLINE, NIL, NULL, Prompt, rl_ttyset(), s, Screen, SCREEN_INC, ScreenSize, Signal, strcmp, strdup(), TTYflush(), TTYinfo(), and TTYputs(). |
|
|
Definition at line 482 of file editline.c. References CHAR, CONST, CSmove, NEWLINE, Prompt, TTYputs(), and TTYstring(). |
|
|
Definition at line 285 of file editline.c. References CHAR, CONST, i, p, Point, Prompt, TTYput(), TTYputs(), and TTYshow(). Referenced by do_insert_hist(), editinput(), kill_line(), TTYspecial(), and wipe(). |
|
|
Definition at line 314 of file editline.c. References CSmove, Point, and TTYshow(). Referenced by create_slider(), do_case(), do_forward(), Draw_Help_Screen(), fd_char(), findsval(), gnu_sort(), gnu_sval(), kill_line(), qsort1(), show_inputs(), show_outputs(), sortsyms(), and user_interface(). |
|
|
Definition at line 323 of file editline.c. References CSstay, TTYflush(), and TTYput(). |
|
|
Definition at line 981 of file editline.c. |
|
|
Definition at line 975 of file editline.c. |
|
||||||||||||
|
Definition at line 672 of file editline.c. References CHAR, COPYFROMTO, DISPOSE, NEW, NULL, SIZE_T, and Yanked. Referenced by copy_region(), delete_string(), and kill_line(). |
|
||||||||||||
|
Definition at line 582 of file editline.c. References CHAR, DISPOSE, H, int(), NULL, pos, strdup(), strlen(), strncmp(), and substrcmp(). Referenced by h_search(). |
|
||||||||||||||||
|
Definition at line 566 of file editline.c. Referenced by search_hist(). |
|
|
Definition at line 491 of file editline.c. References redisplay(), and rl_meta_chars. |
|
|
Definition at line 1183 of file editline.c. References c, CHAR, CSmove, CSstay, End, left(), and TTYshow(). |
|
|
Definition at line 185 of file editline.c. References TTYback. Referenced by delete_string(). |
|
|
Definition at line 111 of file editline.c. References Screen, ScreenCount, and write. Referenced by readline(), ring_bell(), and TTYget(). |
|
|
Definition at line 168 of file editline.c. References c, CHAR, EOF, Input, PushBack, Pushed, read, SIZE_T, and TTYflush(). Referenced by editinput(), exchange(), meta(), move_to_char(), and quote(). |
|
|
Definition at line 193 of file editline.c. References backspace, bp, buff, getenv(), init, int(), ioctl, NULL, SCREEN_ROWS, SCREEN_WIDTH, strdup(), term, tgetent(), tgetnum(), tgetstr(), TIOCGWINSZ, TTYrows, TTYwidth, and W. Referenced by readline(). |
|
|
Definition at line 120 of file editline.c. References RENEW, Screen, SCREEN_INC, ScreenCount, and ScreenSize. Referenced by ceol(), clear_line(), columns(), delete_string(), reposition(), ring_bell(), TTYputs(), and TTYshow(). |
|
|
Definition at line 131 of file editline.c. References TTYput(). Referenced by columns(), h_search(), readline(), redisplay(), and reposition(). |
|
|
Definition at line 139 of file editline.c. References DEL, ISCTL, ISMETA, rl_meta_chars, TTYput(), UNCTL, and UNMETA. Referenced by reposition(), right(), transpose(), and TTYstring(). |
|
|
Definition at line 878 of file editline.c. References bk_del_char(), CSdispatch, CSeof, CSsignal, DEL, End, ISMETA, kill_line(), NO_ARG, Repeat, reposition(), rl_eof, rl_erase, rl_intr, rl_kill, rl_quit, SIGINT, Signal, and SIGQUIT. Referenced by editinput(). |
|
|
Definition at line 160 of file editline.c. References TTYshow(). Referenced by delete_string(), insert_string(), and redisplay(). |
|
|
Definition at line 1209 of file editline.c. References delete_string(), End, i, Mark, reposition(), and ring_bell. |
|
|
|
|
|
Definition at line 1250 of file editline.c. References CSstay, insert_string(), and Yanked. |
|
|
Definition at line 87 of file editline.c. |
|
|
Definition at line 75 of file editline.c. |
|
|
Definition at line 73 of file editline.c. |
|
|
Definition at line 67 of file editline.c. Referenced by do_macro(), getsize(), and TTYget(). |
|
|
Definition at line 84 of file editline.c. |
|
|
Definition at line 68 of file editline.c. |
|
|
Definition at line 1410 of file editline.c. |
|
|
Definition at line 82 of file editline.c. Referenced by emacs(). |
|
|
Definition at line 76 of file editline.c. Referenced by copy_region(), editinput(), exchange(), mk_set(), and wipe(). |
|
|
Initial value: {
{ CTL('H'), wipe },
{ DEL, wipe },
{ ' ', mk_set },
{ '.', last_argument },
{ '<', h_first },
{ '>', h_last },
{ '?', c_possible },
{ 'b', bk_word },
{ 'd', fd_kill_word },
{ 'f', fd_word },
{ 'l', case_down_word },
{ 'm', toggle_meta_mode },
{ 'u', case_up_word },
{ 'y', yank },
{ 'w', copy_region },
{ 0, NULL }
}
Definition at line 1444 of file editline.c. |
|
|
Definition at line 83 of file editline.c. Referenced by meta(). |
|
|
Definition at line 72 of file editline.c. |
|
|
Definition at line 66 of file editline.c. |
|
|
Definition at line 77 of file editline.c. Referenced by bk_kill_word(), do_case(), editinput(), emacs(), and fd_kill_word(). |
|
|
Definition at line 78 of file editline.c. Referenced by bk_kill_word(), bk_word(), ceol(), delete_string(), do_case(), do_forward(), fd_kill_word(), find_word(), insert_string(), left(), reposition(), and right(). |
|
|
Definition at line 69 of file editline.c. Referenced by clear_line(), h_search(), readline(), redisplay(), and reposition(). |
|
|
Definition at line 79 of file editline.c. |
|
|
Definition at line 80 of file editline.c. |
|
|
Definition at line 74 of file editline.c. Referenced by bk_char(), bk_del_char(), bk_word(), del_char(), do_forward(), do_hist(), editinput(), emacs(), fd_char(), h_search(), insert_char(), kill_line(), last_argument(), meta(), and TTYspecial(). |
|
|
Definition at line 60 of file editline.c. Referenced by rl_ttyset(), and TTYspecial(). |
|
|
Definition at line 61 of file editline.c. Referenced by rl_ttyset(), and TTYspecial(). |
|
|
Definition at line 62 of file editline.c. Referenced by rl_ttyset(), and TTYspecial(). |
|
|
Definition at line 63 of file editline.c. Referenced by rl_ttyset(), and TTYspecial(). |
|
|
Definition at line 92 of file editline.c. Referenced by delete_string(), emacs(), left(), toggle_meta_mode(), and TTYshow(). |
|
|
Definition at line 64 of file editline.c. Referenced by rl_ttyset(), and TTYspecial(). |
|
|
Definition at line 71 of file editline.c. Referenced by readline(), TTYflush(), and TTYput(). |
|
|
Definition at line 85 of file editline.c. Referenced by TTYflush(), and TTYput(). |
|
|
Definition at line 86 of file editline.c. Referenced by readline(), and TTYput(). |
|
|
Definition at line 1076 of file editline.c. |
|
|
Definition at line 81 of file editline.c. |
|
|
Definition at line 89 of file editline.c. Referenced by TTYinfo(). |
|
|
Definition at line 88 of file editline.c. |
|
|
Definition at line 70 of file editline.c. Referenced by save_yank(), and yank(). |
1.4.6