Mercurial > librandom
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/librandom.h Tue Jun 10 16:18:50 2025 -0400 @@ -0,0 +1,15 @@ +#ifndef LIBRANDOM_H_ +#define LIBRANDOM_H_ + +struct random { + void (*close)(struct random *r); + size_t (*read)(struct random *r, void *ptr, size_t s); + + void *userdata; +}; + +int random_init(struct random *r); +void random_close(struct random *r); +size_t random_read(struct random *r, void *ptr, size_t s); + +#endif /* LIBRANDOM_H_ */ \ No newline at end of file