Check for failed allocations. Spotted by Martin Bealby.
[reactos.git] / rosapps / dflat32 / system.h
1 /* --------------- system.h -------------- */
2 #ifndef SYSTEM_H
3 #define SYSTEM_H
4
5 //#if MSC | WATCOM
6 #include <direct.h>
7 //#else
8 //#include <dir.h>
9 //#endif
10
11 #define swap(a,b){int x=a;a=b;b=x;}
12 /* ------- platform-dependent values ------ */
13 #define DF_KEYBOARDPORT 0x60
14 #define DF_FREQUENCY 100
15 #define DF_COUNT (1193280L / DF_FREQUENCY)
16 #define DF_ZEROFLAG 0x40
17 #define DF_MAXSAVES 50
18
19 //#define DF_SCREENWIDTH (80)
20 //#define DF_SCREENHEIGHT (25)
21
22 HANDLE DfInput;
23 HANDLE DfOutput;
24
25 SHORT DfScreenHeight;
26 SHORT DfScreenWidth;
27
28
29 /* ---------- keyboard prototypes -------- */
30 int DfAltConvert(int);
31 void DfGetKey(PINPUT_RECORD);
32 int DfGetShift(void);
33 BOOL DfKeyHit(void);
34 void DfBeep(void);
35
36 /* ---------- DfCursor prototypes -------- */
37 void DfCurrCursor(int *x, int *y);
38 void DfCursor(int x, int y);
39 void DfHideCursor(void);
40 void DfUnhideCursor(void);
41 void DfSaveCursor(void);
42 void DfRestoreCursor(void);
43 void DfNormalCursor(void);
44 void DfSetCursorSize(unsigned t);
45 void DfVideoMode(void);
46 void DfSwapCursorStack(void);
47
48 /* ------------ timer macros -------------- */
49 #define DfTimedOut(timer) (timer==0)
50 #define DfSetTimer(timer, secs) timer=(secs)*182/10+1
51 #define DfDisableTimer(timer) timer = -1
52 #define DfTimerRunning(timer) (timer > 0)
53 #define DfCountdown(timer) --timer
54 #define DfTimerDisabled(timer) (timer == -1)
55
56
57 #ifndef TURBOC
58 #ifndef BCPP
59 /* ============= Color Macros ============ */
60 #define BLACK 0
61 #define BLUE 1
62 #define GREEN 2
63 #define CYAN 3
64 #define RED 4
65 #define MAGENTA 5
66 #define BROWN 6
67 #define LIGHTGRAY 7
68 #define DARKGRAY 8
69 #define LIGHTBLUE 9
70 #define LIGHTGREEN 10
71 #define LIGHTCYAN 11
72 #define LIGHTRED 12
73 #define LIGHTMAGENTA 13
74 #define YELLOW 14
75 #define WHITE 15
76 #define DfKeyHit kbhit
77 #endif
78 #endif
79
80 typedef enum DfMessages {
81 #ifdef WATCOM
82 DF_WATCOMFIX1 = -1,
83 #endif
84 #undef DFlatMsg
85 #define DFlatMsg(m) m,
86 #include "dflatmsg.h"
87 DF_MESSAGECOUNT
88 } DFMESSAGE;
89
90 typedef enum DfWindowClass {
91 #ifdef WATCOM
92 DF_WATCOMFIX2 = -1,
93 #endif
94 #define DfClassDef(c,b,p,a) c,
95 #include "classes.h"
96 DF_CLASSCOUNT
97 } DFCLASS;
98
99 #endif