Break out curses display-related globals into a new header file, so that

<curses.h> doesn't have to be included all over the place.
This commit is contained in:
jwise 2001-01-04 04:41:41 +00:00
parent a976c8e346
commit 9baf035b4e
10 changed files with 73 additions and 32 deletions

43
games/sail/display.h Normal file
View File

@ -0,0 +1,43 @@
/* $NetBSD: display.h,v 1.1 2001/01/04 04:41:41 jwise Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef SIGTSTP
#define SCREENTEST() (initscr() != NULL && signal(SIGTSTP, SIG_DFL) != SIG_ERR && STAT_R < COLS && SCROLL_Y > 0)
#else
#define SCREENTEST() (initscr() != NULL && STAT_R < COLS && SCROLL_Y > 0)
#endif
extern WINDOW *view_w;
extern WINDOW *slot_w;
extern WINDOW *scroll_w;
extern WINDOW *stat_w;
extern WINDOW *turn_w;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_1.c,v 1.12 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_1.c,v 1.13 2001/01/04 04:41:41 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)pl_1.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_1.c,v 1.12 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_1.c,v 1.13 2001/01/04 04:41:41 jwise Exp $");
#endif
#endif /* not lint */
@ -47,6 +47,7 @@ __RCSID("$NetBSD: pl_1.c,v 1.12 2001/01/04 03:51:24 jwise Exp $");
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "extern.h"
#include "player.h"
void leave(int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_2.c,v 1.7 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_2.c,v 1.8 2001/01/04 04:41:41 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,11 +38,12 @@
#if 0
static char sccsid[] = "@(#)pl_2.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_2.c,v 1.7 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_2.c,v 1.8 2001/01/04 04:41:41 jwise Exp $");
#endif
#endif /* not lint */
#include <signal.h>
#include "extern.h"
#include "player.h"
void play(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_3.c,v 1.13 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_3.c,v 1.14 2001/01/04 04:41:41 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,12 +38,13 @@
#if 0
static char sccsid[] = "@(#)pl_3.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_3.c,v 1.13 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_3.c,v 1.14 2001/01/04 04:41:41 jwise Exp $");
#endif
#endif /* not lint */
#include <signal.h>
#include <stdlib.h>
#include "extern.h"
#include "player.h"
void acceptcombat(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_4.c,v 1.11 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_4.c,v 1.12 2001/01/04 04:41:41 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,11 +38,13 @@
#if 0
static char sccsid[] = "@(#)pl_4.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_4.c,v 1.11 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_4.c,v 1.12 2001/01/04 04:41:41 jwise Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include <ctype.h>
#include "extern.h"
#include "player.h"
void changesail(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_5.c,v 1.11 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_5.c,v 1.12 2001/01/04 04:41:42 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,14 +38,17 @@
#if 0
static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_5.c,v 1.11 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_5.c,v 1.12 2001/01/04 04:41:42 jwise Exp $");
#endif
#endif /* not lint */
#include <ctype.h>
#include <curses.h>
#include <signal.h>
#include <stdio.h>
#include "extern.h"
#include "player.h"
#include "display.h"
#define turnfirst(x) (*x == 'r' || *x == 'l')

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_6.c,v 1.8 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_6.c,v 1.9 2001/01/04 04:41:42 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,11 +38,12 @@
#if 0
static char sccsid[] = "@(#)pl_6.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_6.c,v 1.8 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_6.c,v 1.9 2001/01/04 04:41:42 jwise Exp $");
#endif
#endif /* not lint */
#include <signal.h>
#include "extern.h"
#include "player.h"
void repair(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_7.c,v 1.19 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_7.c,v 1.20 2001/01/04 04:41:42 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,15 +38,18 @@
#if 0
static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_7.c,v 1.19 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_7.c,v 1.20 2001/01/04 04:41:42 jwise Exp $");
#endif
#endif /* not lint */
#include <curses.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
#include "extern.h"
#include "player.h"
#include "display.h"
void initscreen(void);
void cleanupscreen(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_main.c,v 1.13 2001/01/04 03:51:24 jwise Exp $ */
/* $NetBSD: pl_main.c,v 1.14 2001/01/04 04:41:42 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)pl_main.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_main.c,v 1.13 2001/01/04 03:51:24 jwise Exp $");
__RCSID("$NetBSD: pl_main.c,v 1.14 2001/01/04 04:41:42 jwise Exp $");
#endif
#endif /* not lint */
@ -48,6 +48,7 @@ __RCSID("$NetBSD: pl_main.c,v 1.13 2001/01/04 03:51:24 jwise Exp $");
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "extern.h"
#include "player.h"
#include "restart.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: player.h,v 1.8 1999/12/28 18:05:25 jsm Exp $ */
/* $NetBSD: player.h,v 1.9 2001/01/04 04:41:42 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -35,9 +35,6 @@
* @(#)player.h 8.2 (Berkeley) 5/3/95
*/
#include <curses.h>
#include "extern.h"
/* sizes and coordinates for the screen */
#define LINE_T 0
@ -92,18 +89,6 @@
#define SLOT_B VIEW_B
#define SLOT_R (SLOT_L+SLOT_X-1)
#ifdef SIGTSTP
#define SCREENTEST() (initscr() != NULL && signal(SIGTSTP, SIG_DFL) != SIG_ERR && STAT_R < COLS && SCROLL_Y > 0)
#else
#define SCREENTEST() (initscr() != NULL && STAT_R < COLS && SCROLL_Y > 0)
#endif
extern WINDOW *view_w;
extern WINDOW *slot_w;
extern WINDOW *scroll_w;
extern WINDOW *stat_w;
extern WINDOW *turn_w;
extern char done_curses;
extern char loaded, fired, changed, repaired;
extern char dont_adjust;