Category : C++ Source Code
Archive   : CURSESP.ZIP
Filename : INITSCR.C

 
Output of file : INITSCR.C contained in archive : CURSESP.ZIP
/****************************************************************/
/* Initscr() routine of the PCcurses package */
/* */
/****************************************************************/
/* This version of curses is based on ncurses, a curses version */
/* originally written by Pavel Curtis at Cornell University. */
/* I have made substantial changes to make it run on IBM PC's, */
/* and therefore consider myself free to make it public domain. */
/* Bjorn Larsson (...mcvax!enea!infovax!bl) */
/****************************************************************/
/* 1.0: Release: 870515 */
/* 1.1: Revision string in the code: 880306 */
/* 1.2: Rcsid[] string for maintenance: 881002 */
/* 1.3: MSC -W3, Turbo'C' -w -w-pro checkes: 881005 */
/****************************************************************/

#include
#include

char _curses_initscr_rcsid[] = "@(#)initscr.c v1.3 - 881005";
char _curses_revcod[] = CURSES_RCS_ID;
char _curses_cpyrgt[] = "Author B. Larsson - Public Domain";

extern void exit(int); /* to avoid warings */

WINDOW *curscr; /* the current screen image */
WINDOW *stdscr; /* the default screen window */
cursv _cursvar; /* curses variables */
int _LINES = 0; /* terminal height */
int _COLS = 0; /* terminal width */

/****************************************************************/
/* Initscr() does necessary initializations for the PCcurses */
/* package. It MUST be called before any other curses routines. */
/****************************************************************/

int initscr()
{
_cursvar.cursrow = -1; /* Initial cursor unknown */
_cursvar.curscol = -1;
_cursvar.autocr = TRUE; /* lf -> crlf by default */
_cursvar.raw = FALSE; /* tty I/O modes */
_cursvar.cbreak = FALSE;
_cursvar.echo = TRUE;
_cursvar.refrbrk = FALSE; /* no premature end of refresh */
_cursvar.orgcbr = (bool)_cursesgcb();
/* original ^BREAK setting */
if(_LINES == 0)
_LINES = 25; /* @@@@ this must be fixed */
if(_COLS == 0)
_COLS = _cursesgcols();

if ((_cursvar.tmpwin = newwin(_LINES,_COLS,0,0)) == (WINDOW *)NULL)
exit(1);
if ((curscr = newwin(_LINES,_COLS,0,0)) == (WINDOW *)NULL)
exit(1);
if ((stdscr = newwin(_LINES,_COLS,0,0)) == (WINDOW *)NULL)
exit(1);
curscr->_clear = FALSE;
return(OK);
} /* initscr */


  3 Responses to “Category : C++ Source Code
Archive   : CURSESP.ZIP
Filename : INITSCR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/