1 /*** 2 *slbeep.c - Sleep and beep 3 * 4 * Copyright (c) Microsoft Corporation. All rights reserved. 5 * 6 *Purpose: 7 * defines _sleep() and _beep() 8 * 9 *******************************************************************************/ 10 11 #include <corecrt_internal.h> 12 #include <stdlib.h> 13 14 /*** 15 *void _sleep(duration) - Length of sleep 16 * 17 *Purpose: 18 * 19 *Entry: 20 * unsigned long duration - length of sleep in milliseconds or 21 * one of the following special values: 22 * 23 * _SLEEP_MINIMUM - Sends a yield message without any delay 24 * _SLEEP_FOREVER - Never return 25 * 26 *Exit: 27 * None 28 * 29 *Exceptions: 30 * 31 *******************************************************************************/ 32 33 extern "C" void __cdecl _sleep(unsigned long duration) 34 { 35 if (duration == 0) 36 ++duration; 37 38 Sleep(duration); 39 } 40 41 /*** 42 *void _beep(frequency, duration) - Length of sleep 43 * 44 *Purpose: 45 * 46 *Entry: 47 * unsigned frequency - frequency in hertz 48 * unsigned duration - length of beep in milliseconds 49 * 50 *Exit: 51 * None 52 * 53 *Exceptions: 54 * 55 *******************************************************************************/ 56 57 extern "C" void __cdecl _beep(unsigned const frequency, unsigned const duration) 58 { 59 Beep(frequency, duration); 60 } 61