1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: */
6:
7: #if defined(LIBC_SCCS) && !defined(lint)
8: static char sccsid[] = "@(#)rand.c 5.2 (Berkeley) 3/9/86";
9: #endif LIBC_SCCS and not lint
10:
11: static long randx = 1;
12:
13: srand(x)
14: unsigned x;
15: {
16: randx = x;
17: }
18:
19: rand()
20: {
21: return((randx = randx * 1103515245 + 12345) & 0x7fffffff);
22: }
Defined functions
rand
defined in line
19; used 46 times
- in /usr/src/games/adventure/wizard.c line
94-95(2)
- in /usr/src/games/battlestar/externs.h line
18
- in /usr/src/games/boggle/boggle.c line
253-256(2)
- in /usr/src/games/cribbage/cards.c line
53
- in /usr/src/games/cribbage/crib.c line
172-174(2),
343,
354
- in /usr/src/games/hangman/getword.c line
4-6(3)
- in /usr/src/games/mille/mille.h line
119
- in /usr/src/games/monop/roll.c line
19,
34
- in /usr/src/games/robots/rnd_pos.c line
38-40(2)
- in /usr/src/games/sail/externs.h line
31
- in /usr/src/games/snake/snake.c line
461-462(2),
603,
804
- in /usr/src/games/trek/ranf.c line
20,
28
- in /usr/src/new/apl/src/af.c line
26,
34,
57
- in /usr/src/new/emacs/etc/yow.c line
55
- in /usr/src/new/emacs/src/sysdep.c line
996
- in /usr/src/old/berknet/prot.c line
252
- in /usr/src/ucb/lisp/franz/lam8.c line
121
- in /usr/src/undoc/brktest.c line
11-12(2),
26
- in /usr/src/usr.bin/uucp/gename.c line
69
- in /usr/src/usr.bin/xsend/lib.c line
34,
50,
57,
74-76(2)
- in /usr/src/usr.lib/libF77/rand_.c line
38-40(3),
48,
55
srand
defined in line
13; used 24 times
Defined variables
randx
defined in line
11; used 3 times
sccsid
defined in line
8;
never used