summaryrefslogtreecommitdiffstats
path: root/private/crt32/direct/slbeep.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/direct/slbeep.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/crt32/direct/slbeep.c')
-rw-r--r--private/crt32/direct/slbeep.c105
1 files changed, 105 insertions, 0 deletions
diff --git a/private/crt32/direct/slbeep.c b/private/crt32/direct/slbeep.c
new file mode 100644
index 000000000..a549e4a5e
--- /dev/null
+++ b/private/crt32/direct/slbeep.c
@@ -0,0 +1,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_ */
+
+}