FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
io_input.c
Go to the documentation of this file.
1
/* console input helpers */
2
3
#include "../fb.h"
4
#include "
fb_private_console.h
"
5
#include <sys/farptr.h>
6
#include <go32.h>
7
8
static
int
iCircBufferStatusInited
=
FALSE
;
9
static
unsigned
short
usCircBufferStatus
= 0;
10
11
int
fb_hConsoleInputBufferChanged
(
void
)
12
{
13
int
is_changed;
14
unsigned
short
usNewStatus;
15
16
FB_LOCK
();
17
18
/* This is required to ensure that SLEEP still works even when
19
* the input buffer is full (QB quirk) */
20
fb_ConsoleMultikeyInit
( );
21
22
if
( !
iCircBufferStatusInited
) {
23
iCircBufferStatusInited
=
TRUE
;
24
usCircBufferStatus
= _farpeekw( _dos_ds, 0x41C );
25
}
26
27
usNewStatus = _farpeekw( _dos_ds, 0x41C );
28
is_changed = usNewStatus!=
usCircBufferStatus
;
29
if
( is_changed )
30
usCircBufferStatus
= usNewStatus;
31
32
/* Ensure that no IRQ disturbs us ... */
33
fb_dos_cli
();
34
is_changed |=
__fb_con
.
forceInpBufferChanged
;
35
__fb_con
.
forceInpBufferChanged
=
FALSE
;
36
fb_dos_sti
();
37
38
FB_UNLOCK
();
39
40
return
is_changed;
41
}
rtlib
dos
io_input.c
Generated on Thu Jan 23 2014 19:40:09 for FreeBASIC by
1.8.4