4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / games / trek / damaged.c
CommitLineData
b6f0a7e4 1/*
82daddb0
KB
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
e9fb6bea 4 *
b2e7427f 5 * %sccs.include.redist.c%
b6f0a7e4
DF
6 */
7
af5e8180 8#ifndef lint
82daddb0 9static char sccsid[] = "@(#)damaged.c 8.1 (Berkeley) %G%";
e9fb6bea 10#endif /* not lint */
af5e8180
KM
11
12# include "trek.h"
13
14/* DAMAGED -- check for device damaged
15**
16** This is a boolean function which returns non-zero if the
17** specified device is broken. It does this by checking the
18** event list for a "device fix" action on that device.
19*/
20
21damaged(dev)
22int dev;
23{
24 register int d;
25 register struct event *e;
26 register int i;
27
28 d = dev;
29
30 for (i = 0; i < MAXEVENTS; i++)
31 {
32 e = &Event[i];
33 if (e->evcode != E_FIXDV)
34 continue;
35 if (e->systemname == d)
36 return (1);
37 }
38
39 /* device fix not in event list -- device must not be broken */
40 return (0);
41}