sprintf doesn't necessarily return its first arg
[unix-history] / usr / src / games / sail / player.h
CommitLineData
69b10fe7 1/*
1e008c14
DF
2 * Copyright (c) 1983 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 * @(#)player.h 5.1 (Berkeley) %G%
b5f0675e
EW
7 */
8
69b10fe7
CL
9#include <curses.h>
10#include "externs.h"
11
b3a57661 12/* sizes and coordinates for the screen */
69b10fe7 13
b3a57661
EW
14#define LINE_T 0
15#define LINE_L 0
16#define LINE_X COLS
17#define LINE_Y 1
18#define LINE_B (LINE_T+LINE_Y-1)
19#define LINE_R (LINE_L+LINE_X-1)
69b10fe7 20
b3a57661
EW
21#define BOX_T 1
22#define BOX_L 0
23#define BOX_X 65
24#define BOX_Y 16
25#define BOX_B (BOX_T+BOX_Y-1)
26#define BOX_R (BOX_L+BOX_X-1)
27
28#define TURN_T BOX_B
b3a57661 29#define TURN_Y 1
67485396
EW
30#define TURN_L ((BOX_L+BOX_R-TURN_X)/2)
31#define TURN_X 9
b3a57661
EW
32#define TURN_B (TURN_T+TURN_Y+1)
33#define TURN_R (TURN_L+TURN_X+1)
34
35#define STAT_T 0
b3a57661 36#define STAT_B BOX_B
67485396
EW
37#define STAT_L (BOX_R+2)
38#define STAT_X 14
b3a57661 39#define STAT_Y (STAT_B-STAT_T+1)
67485396 40#define STAT_R (STAT_L+STAT_X-1)
b3a57661
EW
41#define STAT_1 0
42#define STAT_2 (STAT_1+4)
43#define STAT_3 (STAT_2+7)
44
45#define SCROLL_T (BOX_B+1)
46#define SCROLL_L 0
47#define SCROLL_B (LINES-1)
48#define SCROLL_R (COLS-1)
67485396
EW
49#define SCROLL_X (SCROLL_R-SCROLL_L+1)
50#define SCROLL_Y (SCROLL_B-SCROLL_T+1)
b3a57661
EW
51
52#define VIEW_T (BOX_T+1)
53#define VIEW_L (BOX_L+1)
54#define VIEW_X (BOX_X-5)
55#define VIEW_Y (BOX_Y-2)
56#define VIEW_B (VIEW_T+VIEW_Y-1)
57#define VIEW_R (VIEW_L+VIEW_X-1)
58
59#define SLOT_T VIEW_T
60#define SLOT_L (VIEW_R+1)
61#define SLOT_X 3
62#define SLOT_Y VIEW_Y
63#define SLOT_B VIEW_B
64#define SLOT_R (SLOT_L+SLOT_X-1)
65
67485396
EW
66#ifdef SIGTSTP
67#define SCREENTEST() (initscr() != ERR && signal(SIGTSTP, SIG_DFL) != BADSIG && STAT_R < COLS && SCROLL_Y > 0)
68#else
69#define SCREENTEST() (initscr() != ERR && STAT_R < COLS && SCROLL_Y > 0)
70#endif
71
b3a57661
EW
72WINDOW *view_w;
73WINDOW *slot_w;
74WINDOW *scroll_w;
75WINDOW *stat_w;
76WINDOW *turn_w;
77
78char done_curses;
79char loaded, fired, changed, repaired;
80char dont_adjust;
81int viewrow, viewcol;
6ca45914 82char movebuf[sizeof SHIP(0)->file->movebuf];
b3a57661
EW
83char version[];
84int player;
85struct ship *ms; /* memorial structure, &cc->ship[player] */
86struct File *mf; /* ms->file */
87struct shipspecs *mc; /* ms->specs */
88
89/* condition codes for leave() */
90#define LEAVE_QUIT 0
91#define LEAVE_CAPTURED 1
92#define LEAVE_HURRICAN 2
93#define LEAVE_DRIVER 3
2b5c5996 94#define LEAVE_FORK 4
67485396 95#define LEAVE_SYNC 5