13016Swollman/*
23016Swollman * Copyright (c) 1993 Martin Birgmeier
33016Swollman * All rights reserved.
43016Swollman *
53016Swollman * You may redistribute unmodified or modified versions of this source
63016Swollman * code provided that the above copyright notice and this and the
73016Swollman * following conditions are retained.
83016Swollman *
93016Swollman * This software is provided ``as is'', and comes with no warranties
103016Swollman * of any kind. I shall in no event be liable for anything that happens
113016Swollman * to anyone/anything when using this software.
123016Swollman */
133016Swollman
1492986Sobrien#include <sys/cdefs.h>
1592986Sobrien__FBSDID("$FreeBSD$");
1692986Sobrien
173016Swollman#include "rand48.h"
183016Swollman
193016Swollmanextern unsigned short _rand48_seed[3];
203016Swollmanextern unsigned short _rand48_mult[3];
213016Swollmanextern unsigned short _rand48_add;
223016Swollman
233016Swollmanunsigned short *
243016Swollmanseed48(unsigned short xseed[3])
253016Swollman{
263016Swollman	static unsigned short sseed[3];
273016Swollman
283016Swollman	sseed[0] = _rand48_seed[0];
293016Swollman	sseed[1] = _rand48_seed[1];
303016Swollman	sseed[2] = _rand48_seed[2];
313016Swollman	_rand48_seed[0] = xseed[0];
323016Swollman	_rand48_seed[1] = xseed[1];
333016Swollman	_rand48_seed[2] = xseed[2];
343016Swollman	_rand48_mult[0] = RAND48_MULT_0;
353016Swollman	_rand48_mult[1] = RAND48_MULT_1;
363016Swollman	_rand48_mult[2] = RAND48_MULT_2;
373016Swollman	_rand48_add = RAND48_ADD;
383016Swollman	return sseed;
393016Swollman}
40