|
|
1.1 root 1: /* @(#) _pos.c: 1.1 10/15/83 (1.21 2/11/83) */
2:
3: #include "curses.ext"
4:
5: extern int _outch();
6:
7: /* Position the SP->curptr to (row, column) which start at 0. */
8: _pos(row, column)
9: int row;
10: int column;
11: {
12: #ifdef DEBUG
13: if(outf) fprintf(outf, "_pos from row %d, col %d => row %d, col %d\n",
14: SP->phys_y, SP->phys_x, row, column);
15: #endif
16: if( SP->phys_x == column && SP->phys_y == row )
17: {
18: return; /* already there */
19: }
20: /*
21: * Many terminals can't move the cursor when in standout mode.
22: * We must be careful, however, because HP's and cookie terminals
23: * will drop a cookie when we do this.
24: */
25: if( !move_standout_mode && SP->phys_gr && magic_cookie_glitch < 0 )
26: {
27: if( !ceol_standout_glitch )
28: {
29: _clearhl ();
30: }
31: }
32: /* some terminals can't move in insert mode */
33: if( SP->phys_irm == 1 && !move_insert_mode )
34: {
35: tputs(exit_insert_mode, 1, _outch);
36: SP->phys_irm = 0;
37: }
38: /* If we try to move outside the scrolling region, widen it */
39: if( row<SP->phys_top_mgn || row>SP->phys_bot_mgn )
40: {
41: _window(0, lines-1, 0, columns-1);
42: _setwind();
43: }
44: mvcur(SP->phys_y, SP->phys_x, row, column);
45: SP->phys_x = column;
46: SP->phys_y = row;
47: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.