keep npartitions independent of byte order
[unix-history] / usr / src / games / trek / systemname.c
CommitLineData
9758240b
KM
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
ecb38d15 7#ifndef lint
9758240b 8static char sccsid[] = "@(#)systemname.c 5.1 (Berkeley) %G%";
ecb38d15
KM
9#endif not lint
10
11# include "trek.h"
12
13/*
14** RETRIEVE THE STARSYSTEM NAME
15**
16** Very straightforward, this routine just gets the starsystem
17** name. It returns zero if none in the specified quadrant
18** (which, by the way, is passed it).
19**
20** This routine knows all about such things as distressed
21** starsystems, etc.
22*/
23
24char *systemname(q1)
25struct quad *q1;
26{
27 register struct quad *q;
28 register int i;
29
30 q = q1;
31
06d69904 32 i = q->qsystemname;
ecb38d15
KM
33 if (i & Q_DISTRESSED)
34 i = Event[i & Q_SYSTEM].systemname;
35
06d69904 36 i &= Q_SYSTEM;
ecb38d15
KM
37 if (i == 0)
38 return (0);
39 return (Systemname[i]);
40}