1 /* Public Domain Curses */
5 RCSID("$Id: pdcgetsc.c,v 1.42 2008/07/13 16:08:17 wmcbrine Exp $")
9 /* return width of screen/viewport */
11 int PDC_get_columns(void)
17 PDC_LOG(("PDC_get_columns() - called\n"));
19 /* use the value from COLS environment variable, if set. MH 10-Jun-92 */
20 /* and use the minimum of COLS and return from int10h MH 18-Jun-92 */
24 cols
= (int)regs
.h
.ah
;
26 env_cols
= getenv("COLS");
29 cols
= min(atoi(env_cols
), cols
);
31 PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols
));
36 /* get the cursor size/shape */
38 int PDC_get_cursor_mode(void)
40 PDC_LOG(("PDC_get_cursor_mode() - called\n"));
42 return getdosmemword(0x460);
45 /* return number of screen rows */
47 int PDC_get_rows(void)
52 PDC_LOG(("PDC_get_rows() - called\n"));
54 /* use the value from LINES environment variable, if set. MH 10-Jun-92 */
55 /* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */
57 rows
= getdosmembyte(0x484) + 1;
58 env_rows
= getenv("LINES");
61 rows
= min(atoi(env_rows
), rows
);
63 if (rows
== 1 && pdc_adapter
== _MDS_GENIUS
)
65 if (rows
== 1 && pdc_adapter
== _MDA
)
71 pdc_direct_video
= FALSE
;
97 PDC_LOG(("PDC_get_rows() - returned: rows %d\n", rows
));