-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.c
51 lines (48 loc) · 1.12 KB
/
init.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*____________________________________________________________________________
**
** File: init.c
**
** Description: Initialization of the input/output interface
**____________________________________________________________________________
*/
#include <stdio.h>
#ifndef MSDOS
#ifdef sco
#include <sys/console.h>
#endif
#include <unistd.h>
#endif
#include "inter.h"
#include "check.h"
void DosInit(void);
void CursesInit(void);
void ConsoleInit(void);
void OpenInterface(void)
{
_I_Screen=NULL;
_I_ColorMap=NULL;
_I_PairMap=NULL;
_I_ColorInfo=NULL;
_I_PairInfo=NULL;
I_CursorX=I_CursorY=0;
I_CurType=C_NORMAL;
AddMemoryErrorHandler(CloseInterface,200);
#ifdef MSDOS
DosInit();
#else
#ifdef sco
if(ioctl(0,CONS_GET,0)==-1)
CursesInit();
else
SCOConsoleInit();
#else /* defined(sco) */
CursesInit();
#endif
#endif /* MSDOS */
TimerInit();
_I_OldMouseX=I_MouseX;
_I_OldMouseY=I_MouseY;
_I_OldMouseOffs=_I_MouseOffs=I_MouseY*I_ScreenWidth+I_MouseX;
I_EventMask=KEYBOARD_EVENTS;
_I_HaveReadKey=0;
}