2 * msvcrt.dll misc functions
4 * Copyright 2000 Jon Griffiths
10 #include "msvcrt/stdlib.h"
13 #include "wine/debug.h"
15 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
18 /*********************************************************************
21 void _beep( unsigned int freq, unsigned int duration)
23 TRACE(":Freq %d, Duration %d\n",freq,duration);
27 /*********************************************************************
32 return (rand() & 0x7fff);
35 /*********************************************************************
38 void _sleep(unsigned long timeout)
40 TRACE("_sleep for %ld milliseconds\n",timeout);
41 Sleep((timeout)?timeout:1);
44 /*********************************************************************
47 void* _lfind(const void* match, const void* start,
48 unsigned int* array_size, unsigned int elem_size,
49 MSVCRT_compar_fn_t cf)
51 unsigned int size = *array_size;
55 if (cf(match, start) == 0)
56 return (void *)start; /* found */
62 /*********************************************************************
65 void* _lsearch(const void* match, void* start,
66 unsigned int* array_size, unsigned int elem_size,
67 MSVCRT_compar_fn_t cf)
69 unsigned int size = *array_size;
73 if (cf(match, start) == 0)
74 return start; /* found */
78 /* not found, add to end */
79 memcpy(start, match, elem_size);
84 /*********************************************************************