Skip to content
Snippets Groups Projects
Commit 5d6bde3a authored by rswindell's avatar rswindell
Browse files

Introduced xp_randomize() - couterpart to xp_random(), to seed the random

number generator.
parent 29c17339
Branches
Tags
No related merge requests found
...@@ -283,7 +283,10 @@ DLLEXPORT int DLLCALL get_errno(void); ...@@ -283,7 +283,10 @@ DLLEXPORT int DLLCALL get_errno(void);
#define CTIME_R(x,y) ctime_r(x,y) #define CTIME_R(x,y) ctime_r(x,y)
#endif #endif
/* Mimic the Borland randomize() and random() CRTL functions */
DLLEXPORT unsigned DLLCALL xp_randomize(void);
DLLEXPORT int DLLCALL xp_random(int); DLLEXPORT int DLLCALL xp_random(int);
DLLEXPORT long double DLLCALL xp_timer(void); DLLEXPORT long double DLLCALL xp_timer(void);
DLLEXPORT char* DLLCALL os_version(char *str); DLLEXPORT char* DLLCALL os_version(char *str);
DLLEXPORT char* DLLCALL lastchar(const char* str); DLLEXPORT char* DLLCALL lastchar(const char* str);
...@@ -296,7 +299,7 @@ DLLEXPORT char* DLLCALL c_unescape_str(char* str); ...@@ -296,7 +299,7 @@ DLLEXPORT char* DLLCALL c_unescape_str(char* str);
DLLEXPORT char DLLCALL c_unescape_char_ptr(const char* str, char** endptr); DLLEXPORT char DLLCALL c_unescape_char_ptr(const char* str, char** endptr);
DLLEXPORT char DLLCALL c_unescape_char(char ch); DLLEXPORT char DLLCALL c_unescape_char(char ch);
/* Millisecond clock */ /* Microsoft (e.g. DOS/Win32) real-time system clock API (ticks since process started) */
typedef clock_t msclock_t; typedef clock_t msclock_t;
#if defined(_WIN32) #if defined(_WIN32)
#define MSCLOCKS_PER_SEC CLOCKS_PER_SEC /* e.g. 18.2 on DOS, 1000.0 on Win32 */ #define MSCLOCKS_PER_SEC CLOCKS_PER_SEC /* e.g. 18.2 on DOS, 1000.0 on Win32 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment