xref: /openbsd-src/lib/libc/stdlib/rand48.h (revision 0fa1c6e603c3ddc2d49848479477cc3cca10ecd0)
1df930be7Sderaadt /*
2df930be7Sderaadt  * Copyright (c) 1993 Martin Birgmeier
3df930be7Sderaadt  * All rights reserved.
4df930be7Sderaadt  *
5df930be7Sderaadt  * You may redistribute unmodified or modified versions of this source
6df930be7Sderaadt  * code provided that the above copyright notice and this and the
7df930be7Sderaadt  * following conditions are retained.
8df930be7Sderaadt  *
9df930be7Sderaadt  * This software is provided ``as is'', and comes with no warranties
10df930be7Sderaadt  * of any kind. I shall in no event be liable for anything that happens
11df930be7Sderaadt  * to anyone/anything when using this software.
12e9b2b68cStholo  *
13*0fa1c6e6Sguenther  *	$OpenBSD: rand48.h,v 1.6 2015/09/14 13:30:17 guenther Exp $
14df930be7Sderaadt  */
15df930be7Sderaadt 
16df930be7Sderaadt #ifndef _RAND48_H_
17df930be7Sderaadt #define _RAND48_H_
18df930be7Sderaadt 
19df930be7Sderaadt #include <stdlib.h>
20df930be7Sderaadt 
21e90fdadcSguenther __BEGIN_HIDDEN_DECLS
22e90fdadcSguenther extern unsigned short __rand48_seed[3];
23e90fdadcSguenther extern unsigned short __rand48_mult[3];
24e90fdadcSguenther extern unsigned short __rand48_add;
25e90fdadcSguenther 
26c72b5b24Smillert void		__dorand48(unsigned short[3]);
27f7510a6eSderaadt extern int	__rand48_deterministic;
28e90fdadcSguenther __END_HIDDEN_DECLS
29df930be7Sderaadt 
30df930be7Sderaadt #define	RAND48_SEED_0	(0x330e)
31df930be7Sderaadt #define	RAND48_SEED_1	(0xabcd)
32df930be7Sderaadt #define	RAND48_SEED_2	(0x1234)
33df930be7Sderaadt #define	RAND48_MULT_0	(0xe66d)
34df930be7Sderaadt #define	RAND48_MULT_1	(0xdeec)
35df930be7Sderaadt #define	RAND48_MULT_2	(0x0005)
36df930be7Sderaadt #define	RAND48_ADD	(0x000b)
37df930be7Sderaadt 
38df930be7Sderaadt #endif /* _RAND48_H_ */
39