2 * msvcrt.dll misc functions
4 * Copyright 2000 Jon Griffiths
10 #include "msvcrt/stdlib.h"
13 DEFAULT_DEBUG_CHANNEL(msvcrt);
15 typedef int (*MSVCRT_comp_func)(const void*, const void*);
17 /*********************************************************************
20 void _beep( unsigned int freq, unsigned int duration)
22 TRACE(":Freq %d, Duration %d\n",freq,duration);
26 /*********************************************************************
31 return (rand() & 0x7fff);
34 /*********************************************************************
37 void _sleep(unsigned long timeout)
39 TRACE("_sleep for %ld milliseconds\n",timeout);
40 Sleep((timeout)?timeout:1);
43 /*********************************************************************
46 void* _lfind(const void* match, const void* start,
47 unsigned int* array_size, unsigned int elem_size,
50 unsigned int size = *array_size;
54 if (cf(match, start) == 0)
55 return (void *)start; /* found */
61 /*********************************************************************
64 void* _lsearch(const void* match, void* start,
65 unsigned int* array_size, unsigned int elem_size,
68 unsigned int size = *array_size;
72 if (cf(match, start) == 0)
73 return start; /* found */
77 /* not found, add to end */
78 memcpy(start, match, elem_size);
83 /*********************************************************************