/* scrsize.c (rsxnt) -- Copyright (c) 1996-1997 Rainer Schnitker */

#include "rsxnt.h"

void __scrsize(int *dst)
{
    EMXPROCESS *p = _rsxnt_get_process_ptr();
    CONSOLE_SCREEN_BUFFER_INFO csbi;

    if (p->bConsoleApp != FALSE &&
        GetConsoleScreenBufferInfo(
                GetStdHandle(STD_OUTPUT_HANDLE), &csbi) == TRUE) {
            dst[0] = csbi.dwSize.X;
            dst[1] = csbi.dwSize.Y;
            return;
    } else {
        dst[0] = 0;
        dst[1] = 0;
    }
}
