blob: a549e4a5ed0fd529352d61115f86c63128aedd2c (
plain) (
blame)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
/***
*slbeep.c - Sleep and beep
*
* Copyright (c) 1991, Microsoft Corporation. All rights reserved.
*
*Purpose:
* defines _sleep() and _beep()
*
*Revision History:
* 08-22-91 BWM Wrote module.
*
*******************************************************************************/
#include <cruntime.h>
#include <oscalls.h>
#include <stdlib.h>
/***
*void _sleep(duration) - Length of sleep
*
*Purpose:
*
*Entry:
* unsigned long duration - length of sleep in milliseconds or
* one of the following special values:
*
* _SLEEP_MINIMUM - Sends a yield message without any delay
* _SLEEP_FOREVER - Never return
*
*Exit:
* None
*
*Exceptions:
*
*******************************************************************************/
void _CALLTYPE1 _sleep(unsigned long dwDuration)
{
#ifdef _CRUISER_
if (dwDuration == _SLEEP_FOREVER) {
while(1) {
DOSSLEEP(dwDuration);
}
}
else {
DOSSLEEP(dwDuration);
}
#else /* ndef _CRUISER_ */
#ifdef _WIN32_
if (dwDuration == 0) {
dwDuration++;
}
Sleep(dwDuration);
#else /* ndef _WIN32_ */
#error ERROR - ONLY CRUISER OR WIN32 TARGET SUPPORTED!
#endif /* _WIN32_ */
#endif /* _CRUISER_ */
}
/***
*void _beep(frequency, duration) - Length of sleep
*
*Purpose:
*
*Entry:
* unsigned frequency - frequency in hertz
* unsigned duration - length of beep in milliseconds
*
*Exit:
* None
*
*Exceptions:
*
*******************************************************************************/
void _CALLTYPE1 _beep(unsigned dwFrequency, unsigned dwDuration)
{
#ifdef _CRUISER_
DOSBEEP(dwFrequency, dwDuration);
#else /* ndef _CRUISER_ */
#ifdef _WIN32_
Beep(dwFrequency, dwDuration);
#else /* ndef _WIN32_ */
#error ERROR - ONLY CRUISER OR WIN32 TARGET SUPPORTED!
#endif /* _WIN32_ */
#endif /* _CRUISER_ */
}
|