47 #define RESET_COUNT 2000 57 #if RAND_MAX < 0x1000000 61 num = (
long) rand () << 16;
62 num |= rand () & 0xffff;
64 long result = num % limit;
70 return (
long)((double)limit * rand()/(RAND_MAX + 1.0));
83 FILE *thisfile = NULL;
84 if ((thisfile = fopen (filename, mode)) == NULL) {
85 tprintf (
"Could not open file, %s\n", filename);
95 if ((f = fopen(filename,
"rb")) != NULL) {
bool exists_file(const char *filename)
Check whether the file exists.
FILE * open_file(const char *filename, const char *mode)
long long_rand(long limit)
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque