Split random number functions off io.c, so that they can be documented

separately.
This commit is contained in:
Martin Mares 2000-06-05 11:46:40 +00:00
parent 5cc1e1f805
commit 10304bed43
4 changed files with 23 additions and 15 deletions

View file

@ -1,4 +1,4 @@
H UNIX system dependent parts
S io.c
S log.c
S krt.c
# io.c is documented under Resources

View file

@ -5,6 +5,7 @@ io.c
unix.h
endian.h
config.Y
random.c
krt.c
krt.h

View file

@ -28,20 +28,6 @@
#include "lib/unix.h"
#include "lib/sysio.h"
/*
* Random Numbers
*/
u32
random_u32(void)
{
long int rand_low, rand_high;
rand_low = random();
rand_high = random();
return (rand_low & 0xffff) | ((rand_high & 0xffff) << 16);
}
/*
* Tracked Files
*/

21
sysdep/unix/random.c Normal file
View file

@ -0,0 +1,21 @@
/*
* BIRD Internet Routing Daemon -- Random Numbers
*
* (c) 2000 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#include <stdlib.h>
#include "nest/bird.h"
u32
random_u32(void)
{
long int rand_low, rand_high;
rand_low = random();
rand_high = random();
return (rand_low & 0xffff) | ((rand_high & 0xffff) << 16);
}