* @brief PlibC header
* @attention This file is usually not installed under Unix,
* so ship it with your application
- * @version $Revision: 39 $
+ * @version $Revision: 44 $
*/
#ifndef _PLIBC_H_
int _win_chmod(const char *filename, int pmode);
char *realpath(const char *file_name, char *resolved_name);
long _win_random(void);
+void _win_srandom(unsigned seed);
int _win_remove(const char *path);
int _win_rename(const char *oldname, const char *newname);
int _win_stat(const char *path, struct stat *buffer);
#define MUNMAP(s, l) munmap(s, l)
#define STRERROR(i) strerror(i)
#define RANDOM() random()
+ #define SRANDOM(s) srandom(s)
#define READLINK(p, b, s) readlink(p, b, s)
#define LSTAT(p, b) lstat(p, b)
#define LSTAT64(p, b) lstat64(p, b)
#define CHMOD(f, p) _win_chmod(f, p)
#define PIPE(h) _win_pipe(h)
#define RANDOM() _win_random()
+ #define SRANDOM(s) _win_srandom()
#define REMOVE(p) _win_remove(p)
#define RENAME(o, n) _win_rename(o, n)
#define STAT(p, b) _win_stat(p, b)
struct stat sbuf;
GNUNET_log_setup ("test-container-bloomfilter", "WARNING", NULL);
- srand (1);
+ SRANDOM (1);
if (0 == stat (TESTFILE, &sbuf))
if (0 != UNLINK (TESTFILE))
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "unlink", TESTFILE);
nextHC (&tmp);
GNUNET_CONTAINER_bloomfilter_add (bf, &tmp);
}
- srand (1);
+ SRANDOM (1);
ok1 = 0;
for (i = 0; i < 200; i++)
{
bfi = GNUNET_CONTAINER_bloomfilter_init (buf, SIZE, K);
GNUNET_assert (bfi != NULL);
- srand (1);
+ SRANDOM (1);
ok1 = 0;
ok2 = 0;
for (i = 0; i < 200; i++)
return -1;
}
- srand (1);
+ SRANDOM (1);
for (i = 0; i < 100; i++)
{
nextHC (&tmp);
GNUNET_CONTAINER_bloomfilter_remove (bfi, &tmp);
}
- srand (1);
+ SRANDOM (1);
ok1 = 0;
ok2 = 0;
return -1;
}
- srand (3);
+ SRANDOM (3);
GNUNET_CONTAINER_bloomfilter_clear (bf);
falseok = 0;
return -1;
}
- srand (2);
+ SRANDOM (2);
i = 20;
GNUNET_CONTAINER_bloomfilter_resize (bfi, &add_iterator, &i, SIZE * 2, K);
- srand (2);
+ SRANDOM (2);
i = 20;
GNUNET_CONTAINER_bloomfilter_resize (bf, &add_iterator, &i, SIZE * 2, K);
- srand (2);
+ SRANDOM (2);
ok1 = 0;
ok2 = 0;