aboutsummaryrefslogtreecommitdiff
path: root/src/km-rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/km-rand.c')
-rw-r--r--src/km-rand.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/km-rand.c b/src/km-rand.c
new file mode 100644
index 0000000..e777069
--- /dev/null
+++ b/src/km-rand.c
@@ -0,0 +1,33 @@
+#include <stdbool.h>
+#include "util.h"
+#include "km.h"
+
+// fill buffer with N random floats
+bool
+km_rand_get_floats(
+ km_rand_t * const rs,
+ const size_t num_floats,
+ float * const floats
+) {
+ return rs->cbs->get_floats(rs, num_floats, floats);
+}
+
+// fill buffer with N random size_ts
+bool
+km_rand_get_sizes(
+ km_rand_t * const rs,
+ const size_t num_sizes,
+ size_t * const sizes
+) {
+ return rs->cbs->get_sizes(rs, num_sizes, sizes);
+}
+
+// finalize random source
+void
+km_rand_fini(
+ km_rand_t * const rs
+) {
+ if (rs->cbs->fini) {
+ rs->cbs->fini(rs);
+ }
+}