int PDC_get_rows(void) /***********************************************************************/ { #ifdef EMXVIDEO int cols=0; #else VIOMODEINFO modeInfo={0}; #endif int rows=0; char *env_rows=NULL; #ifdef PDCDEBUG if (trace_on) PDC_debug("PDC_get_rows() - called\n"); #endif /* use the value from LINES environment variable, if set. MH 10-Jun-92 */ /* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */ #ifdef EMXVIDEO v_dimen (&cols, &rows); #else modeInfo.cb = sizeof(modeInfo); VioGetMode(&modeInfo, 0); rows = modeInfo.row; #endif env_rows = (char *)getenv("LINES"); if (env_rows != (char *)NULL) rows = min(atoi(env_rows),rows); #ifdef PDCDEBUG if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows); #endif return(rows); }
int PDC_get_columns(void) /***********************************************************************/ { #ifdef EMXVIDEO int rows=0; #else VIOMODEINFO modeInfo={0}; #endif int cols=0; char *env_cols=NULL; #ifdef PDCDEBUG if (trace_on) PDC_debug("PDC_get_columns() - called\n"); #endif #ifdef EMXVIDEO v_dimen (&cols, &rows); #else modeInfo.cb = sizeof(modeInfo); VioGetMode(&modeInfo, 0); cols = modeInfo.col; #endif env_cols = (char *)getenv("COLS"); if (env_cols != (char *)NULL) { cols = min(atoi(env_cols),cols); } #ifdef PDCDEBUG if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols); #endif return(cols); }
char vm_getscreenheight(void) { if (_osmode == DOS_MODE) { int width, height; vi_init(); v_dimen(&width, &height); return (char)height; } else { VIOMODEINFO vi; vi.cb = sizeof(VIOMODEINFO); VioGetMode(&vi, 0); return vi.row; } }