From 10304bed435034cf8432b1c6262f7e7f0d84d49c Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 5 Jun 2000 11:46:40 +0000 Subject: [PATCH] Split random number functions off io.c, so that they can be documented separately. --- sysdep/unix/Doc | 2 +- sysdep/unix/Modules | 1 + sysdep/unix/io.c | 14 -------------- sysdep/unix/random.c | 21 +++++++++++++++++++++ 4 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 sysdep/unix/random.c diff --git a/sysdep/unix/Doc b/sysdep/unix/Doc index d4dab05f..5ab11b4c 100644 --- a/sysdep/unix/Doc +++ b/sysdep/unix/Doc @@ -1,4 +1,4 @@ H UNIX system dependent parts -S io.c S log.c S krt.c +# io.c is documented under Resources diff --git a/sysdep/unix/Modules b/sysdep/unix/Modules index 017623e7..2666f9d6 100644 --- a/sysdep/unix/Modules +++ b/sysdep/unix/Modules @@ -5,6 +5,7 @@ io.c unix.h endian.h config.Y +random.c krt.c krt.h diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 9d80b7dd..ca233113 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -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 */ diff --git a/sysdep/unix/random.c b/sysdep/unix/random.c new file mode 100644 index 00000000..b1f5086f --- /dev/null +++ b/sysdep/unix/random.c @@ -0,0 +1,21 @@ +/* + * BIRD Internet Routing Daemon -- Random Numbers + * + * (c) 2000 Martin Mares + * + * Can be freely distributed and used under the terms of the GNU GPL. + */ + +#include + +#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); +}