Deleted Added
full compact
1c1
< /* $FreeBSD: head/contrib/libreadline/terminal.c 58314 2000-03-19 22:00:57Z ache $ */
---
> /* $FreeBSD: head/contrib/libreadline/terminal.c 75409 2001-04-11 03:15:56Z ache $ */
80,82d79
< /* Non-zero means this terminal can't really do anything. */
< static int dumb_term;
<
91,92c88,93
< char *term_goto, *term_clreol, *term_cr, *term_clrpag, *term_backspace;
< char *term_pc;
---
> char *_rl_term_clreol;
> char *_rl_term_clrpag;
> char *_rl_term_cr;
> char *_rl_term_backspace;
> char *_rl_term_goto;
> char *_rl_term_pc;
95c96
< int terminal_can_insert = 0;
---
> int _rl_terminal_can_insert = 0;
98c99,103
< char *term_im, *term_ei, *term_ic, *term_ip, *term_IC;
---
> char *_rl_term_im;
> char *_rl_term_ei;
> char *_rl_term_ic;
> char *_rl_term_ip;
> char *_rl_term_IC;
101c106,107
< char *term_dc, *term_DC;
---
> char *_rl_term_dc;
> char *_rl_term_DC;
104c110
< char *term_forward_char;
---
> char *_rl_term_forward_char;
108c114
< char *term_up;
---
> char *_rl_term_up;
110,111c116,117
< /* A visible bell, if the terminal can be made to flash the screen. */
< static char *visible_bell;
---
> /* A visible bell; char if the terminal can be made to flash the screen. */
> static char *_rl_visible_bell;
120,121c126,128
< terminal has one. */
< static char *term_mm, *term_mo;
---
> terminal has one. */
> static char *_rl_term_mm;
> static char *_rl_term_mo;
124c131,134
< static char *term_ku, *term_kd, *term_kr, *term_kl;
---
> static char *_rl_term_ku;
> static char *_rl_term_kd;
> static char *_rl_term_kr;
> static char *_rl_term_kl;
127c137,138
< static char *term_ks, *term_ke;
---
> static char *_rl_term_ks;
> static char *_rl_term_ke;
130c141,142
< static char *term_kh, *term_kH;
---
> static char *_rl_term_kh;
> static char *_rl_term_kH;
133c145
< int screenwidth, screenheight, screenchars;
---
> int _rl_screenwidth, _rl_screenheight, _rl_screenchars;
173,174c185,186
< screenwidth = (int) window_size.ws_col;
< screenheight = (int) window_size.ws_row;
---
> _rl_screenwidth = (int) window_size.ws_col;
> _rl_screenheight = (int) window_size.ws_row;
179c191
< _emx_get_screensize (&screenwidth, &screenheight);
---
> _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight);
184c196
< if (screenwidth <= 0)
---
> if (_rl_screenwidth <= 0)
186,187c198,199
< if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
< screenwidth = atoi (ss);
---
> if (ignore_env == 0 && (ss = sh_get_env_value ("COLUMNS")))
> _rl_screenwidth = atoi (ss);
190,191c202,203
< if (screenwidth <= 0 && term_string_buffer)
< screenwidth = tgetnum ("co");
---
> if (_rl_screenwidth <= 0 && term_string_buffer)
> _rl_screenwidth = tgetnum ("co");
197c209
< if (screenheight <= 0)
---
> if (_rl_screenheight <= 0)
199,200c211,212
< if (ignore_env == 0 && (ss = get_env_value ("LINES")))
< screenheight = atoi (ss);
---
> if (ignore_env == 0 && (ss = sh_get_env_value ("LINES")))
> _rl_screenheight = atoi (ss);
203,204c215,216
< if (screenheight <= 0 && term_string_buffer)
< screenheight = tgetnum ("li");
---
> if (_rl_screenheight <= 0 && term_string_buffer)
> _rl_screenheight = tgetnum ("li");
209,210c221,222
< if (screenwidth <= 1)
< screenwidth = 80;
---
> if (_rl_screenwidth <= 1)
> _rl_screenwidth = 80;
212,213c224,225
< if (screenheight <= 0)
< screenheight = 24;
---
> if (_rl_screenheight <= 0)
> _rl_screenheight = 24;
218c230
< set_lines_and_columns (screenheight, screenwidth);
---
> sh_set_lines_and_columns (_rl_screenheight, _rl_screenwidth);
221c233
< screenwidth--;
---
> _rl_screenwidth--;
223c235
< screenchars = screenwidth * screenheight;
---
> _rl_screenchars = _rl_screenwidth * _rl_screenheight;
230,231c242,243
< screenheight = rows;
< screenwidth = cols;
---
> if (rows == 0 || cols == 0)
> return;
232a245,247
> _rl_screenheight = rows;
> _rl_screenwidth = cols;
>
234c249
< screenwidth--;
---
> _rl_screenwidth--;
236c251
< screenchars = screenwidth * screenheight;
---
> _rl_screenchars = _rl_screenwidth * _rl_screenheight;
239a255,271
> rl_set_screen_size (rows, cols)
> int rows, cols;
> {
> _rl_set_screen_size (rows, cols);
> }
>
> void
> rl_get_screen_size (rows, cols)
> int *rows, *cols;
> {
> if (rows)
> *rows = _rl_screenheight;
> if (cols)
> *cols = _rl_screenwidth;
> }
>
> void
250c282
< char *tc_var;
---
> const char *tc_var;
258,277c290,309
< { "DC", &term_DC },
< { "IC", &term_IC },
< { "ce", &term_clreol },
< { "cl", &term_clrpag },
< { "cr", &term_cr },
< { "dc", &term_dc },
< { "ei", &term_ei },
< { "ic", &term_ic },
< { "im", &term_im },
< { "kd", &term_kd },
< { "kh", &term_kh }, /* home */
< { "@7", &term_kH }, /* end */
< { "kl", &term_kl },
< { "kr", &term_kr },
< { "ku", &term_ku },
< { "ks", &term_ks },
< { "ke", &term_ke },
< { "le", &term_backspace },
< { "mm", &term_mm },
< { "mo", &term_mo },
---
> { "DC", &_rl_term_DC },
> { "IC", &_rl_term_IC },
> { "ce", &_rl_term_clreol },
> { "cl", &_rl_term_clrpag },
> { "cr", &_rl_term_cr },
> { "dc", &_rl_term_dc },
> { "ei", &_rl_term_ei },
> { "ic", &_rl_term_ic },
> { "im", &_rl_term_im },
> { "kd", &_rl_term_kd },
> { "kh", &_rl_term_kh }, /* home */
> { "@7", &_rl_term_kH }, /* end */
> { "kl", &_rl_term_kl },
> { "kr", &_rl_term_kr },
> { "ku", &_rl_term_ku },
> { "ks", &_rl_term_ks },
> { "ke", &_rl_term_ke },
> { "le", &_rl_term_backspace },
> { "mm", &_rl_term_mm },
> { "mo", &_rl_term_mo },
279c311
< { "nd", &term_forward_char },
---
> { "nd", &_rl_term_forward_char },
281,283c313,315
< { "pc", &term_pc },
< { "up", &term_up },
< { "vb", &visible_bell },
---
> { "pc", &_rl_term_pc },
> { "up", &_rl_term_up },
> { "vb", &_rl_visible_bell },
308c340
< char *terminal_name;
---
> const char *terminal_name;
310c342,343
< char *term, *buffer;
---
> const char *term;
> char *buffer;
314,315c347,348
< term = terminal_name ? terminal_name : get_env_value ("TERM");
< term_clrpag = term_cr = term_clreol = (char *)NULL;
---
> term = terminal_name ? terminal_name : sh_get_env_value ("TERM");
> _rl_term_clrpag = _rl_term_cr = _rl_term_clreol = (char *)NULL;
317c350
< screenwidth = screenheight = 0;
---
> _rl_screenwidth = _rl_screenheight = 0;
348d380
< dumb_term = 1;
352,353c384,385
< _emx_get_screensize (&screenwidth, &screenheight);
< screenwidth--;
---
> _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight);
> _rl_screenwidth--;
359c391
< if (screenwidth <= 0 || screenheight <= 0)
---
> if (_rl_screenwidth <= 0 || _rl_screenheight <= 0)
361,362c393,394
< screenwidth = 79;
< screenheight = 24;
---
> _rl_screenwidth = 79;
> _rl_screenheight = 24;
366,371c398,403
< screenchars = screenwidth * screenheight;
< term_cr = "\r";
< term_im = term_ei = term_ic = term_IC = (char *)NULL;
< term_up = term_dc = term_DC = visible_bell = (char *)NULL;
< term_ku = term_kd = term_kl = term_kr = (char *)NULL;
< term_mm = term_mo = (char *)NULL;
---
> _rl_screenchars = _rl_screenwidth * _rl_screenheight;
> _rl_term_cr = "\r";
> _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL;
> _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL;
> _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL;
> _rl_term_mm = _rl_term_mo = (char *)NULL;
375c407
< terminal_can_insert = term_has_meta = 0;
---
> _rl_terminal_can_insert = term_has_meta = 0;
378c410
< tgoto if term_IC or term_DC is defined, but just in case we
---
> tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we
381,382c413,414
< BC = term_backspace = "\b";
< UP = term_up;
---
> BC = _rl_term_backspace = "\b";
> UP = _rl_term_up;
391,393c423,425
< PC = term_pc ? *term_pc : 0;
< BC = term_backspace;
< UP = term_up;
---
> PC = _rl_term_pc ? *_rl_term_pc : 0;
> BC = _rl_term_backspace;
> UP = _rl_term_up;
395,396c427,428
< if (!term_cr)
< term_cr = "\r";
---
> if (!_rl_term_cr)
> _rl_term_cr = "\r";
406c438
< terminal_can_insert = (term_IC || term_im || term_ic);
---
> _rl_terminal_can_insert = (_rl_term_IC || _rl_term_im || _rl_term_ic);
412c444
< term_mm = term_mo = (char *)NULL;
---
> _rl_term_mm = _rl_term_mo = (char *)NULL;
419,422c451,454
< _rl_bind_if_unbound (term_ku, rl_get_previous_history);
< _rl_bind_if_unbound (term_kd, rl_get_next_history);
< _rl_bind_if_unbound (term_kr, rl_forward);
< _rl_bind_if_unbound (term_kl, rl_backward);
---
> _rl_bind_if_unbound (_rl_term_ku, rl_get_previous_history);
> _rl_bind_if_unbound (_rl_term_kd, rl_get_next_history);
> _rl_bind_if_unbound (_rl_term_kr, rl_forward);
> _rl_bind_if_unbound (_rl_term_kl, rl_backward);
424,425c456,457
< _rl_bind_if_unbound (term_kh, rl_beg_of_line); /* Home */
< _rl_bind_if_unbound (term_kH, rl_end_of_line); /* End */
---
> _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
> _rl_bind_if_unbound (_rl_term_kH, rl_end_of_line); /* End */
429,432c461,464
< _rl_bind_if_unbound (term_ku, rl_get_previous_history);
< _rl_bind_if_unbound (term_kd, rl_get_next_history);
< _rl_bind_if_unbound (term_kr, rl_forward);
< _rl_bind_if_unbound (term_kl, rl_backward);
---
> _rl_bind_if_unbound (_rl_term_ku, rl_get_previous_history);
> _rl_bind_if_unbound (_rl_term_kd, rl_get_next_history);
> _rl_bind_if_unbound (_rl_term_kr, rl_forward);
> _rl_bind_if_unbound (_rl_term_kl, rl_backward);
434,435c466,467
< _rl_bind_if_unbound (term_kh, rl_beg_of_line); /* Home */
< _rl_bind_if_unbound (term_kH, rl_end_of_line); /* End */
---
> _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
> _rl_bind_if_unbound (_rl_term_kH, rl_end_of_line); /* End */
445c477
< char *cap;
---
> const char *cap;
463c495
< char *terminal_name;
---
> const char *terminal_name;
489c521
< char *string;
---
> const char *string;
502c534
< if (term_backspace)
---
> if (_rl_term_backspace)
504c536
< tputs (term_backspace, 1, _rl_output_character_function);
---
> tputs (_rl_term_backspace, 1, _rl_output_character_function);
513c545
< crlf ()
---
> rl_crlf ()
516,517c548,549
< if (term_cr)
< tputs (term_cr, 1, _rl_output_character_function);
---
> if (_rl_term_cr)
> tputs (_rl_term_cr, 1, _rl_output_character_function);
525c557
< ding ()
---
> rl_ding ()
535c567
< if (visible_bell)
---
> if (_rl_visible_bell)
537c569
< tputs (visible_bell, 1, _rl_output_character_function);
---
> tputs (_rl_visible_bell, 1, _rl_output_character_function);
561,562c593,594
< if (term_has_meta && term_mm)
< tputs (term_mm, 1, _rl_output_character_function);
---
> if (term_has_meta && _rl_term_mm)
> tputs (_rl_term_mm, 1, _rl_output_character_function);
571,574c603,606
< if (on && term_ks)
< tputs (term_ks, 1, _rl_output_character_function);
< else if (!on && term_ke)
< tputs (term_ke, 1, _rl_output_character_function);
---
> if (on && _rl_term_ks)
> tputs (_rl_term_ks, 1, _rl_output_character_function);
> else if (!on && _rl_term_ke)
> tputs (_rl_term_ke, 1, _rl_output_character_function);