annotate librandom.h @ 0:9ee92e7a1cb5
default tip
*: initial commit
this is a very simple, bare-bones randomness API. if the system can't provide
it, so be it -- init will fail.
author |
Paper <paper@tflc.us> |
date |
Tue, 10 Jun 2025 16:18:50 -0400 |
parents |
|
children |
|
rev |
line source |
0
|
1 #ifndef LIBRANDOM_H_
|
|
2 #define LIBRANDOM_H_
|
|
3
|
|
4 struct random {
|
|
5 void (*close)(struct random *r);
|
|
6 size_t (*read)(struct random *r, void *ptr, size_t s);
|
|
7
|
|
8 void *userdata;
|
|
9 };
|
|
10
|
|
11 int random_init(struct random *r);
|
|
12 void random_close(struct random *r);
|
|
13 size_t random_read(struct random *r, void *ptr, size_t s);
|
|
14
|
|
15 #endif /* LIBRANDOM_H_ */ |