More rationalization of include files:

a.) Don't include a zillion system headers from "extern.h" (actually, don't
    include any).
b.) Break a global jmp_buf variable into a new file, so <setjmp.h> doesn't
    have to be pulled in everywhere (it's only used in two places).

The (one line) new file is (c) TNF with a three-clause license, FW(L)IW.
This commit is contained in:
jwise 2001-01-04 03:51:23 +00:00
parent c5b9e1cef5
commit 61a39e0b38
21 changed files with 100 additions and 46 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dr_1.c,v 1.14 2001/01/04 03:21:16 jwise Exp $ */
/* $NetBSD: dr_1.c,v 1.15 2001/01/04 03:51:23 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,12 +38,14 @@
#if 0
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: dr_1.c,v 1.14 2001/01/04 03:21:16 jwise Exp $");
__RCSID("$NetBSD: dr_1.c,v 1.15 2001/01/04 03:51:23 jwise Exp $");
#endif
#endif /* not lint */
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "extern.h"
#include "driver.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: dr_2.c,v 1.15 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: dr_2.c,v 1.16 2001/01/04 03:51:23 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,11 +38,13 @@
#if 0
static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: dr_2.c,v 1.15 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: dr_2.c,v 1.16 2001/01/04 03:51:23 jwise Exp $");
#endif
#endif /* not lint */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "extern.h"
#include "driver.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: dr_3.c,v 1.11 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: dr_3.c,v 1.12 2001/01/04 03:51:23 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,11 +38,12 @@
#if 0
static char sccsid[] = "@(#)dr_3.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: dr_3.c,v 1.11 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: dr_3.c,v 1.12 2001/01/04 03:51:23 jwise Exp $");
#endif
#endif /* not lint */
#include <stdlib.h>
#include <string.h>
#include "extern.h"
#include "driver.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: dr_5.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
/* $NetBSD: dr_5.c,v 1.9 2001/01/04 03:51:23 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,11 @@
#if 0
static char sccsid[] = "@(#)dr_5.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: dr_5.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
__RCSID("$NetBSD: dr_5.c,v 1.9 2001/01/04 03:51:23 jwise Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include "extern.h"
void subtract(struct ship *, int, int *, struct ship *, int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dr_main.c,v 1.9 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: dr_main.c,v 1.10 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,11 @@
#if 0
static char sccsid[] = "@(#)dr_main.c 8.2 (Berkeley) 4/16/94";
#else
__RCSID("$NetBSD: dr_main.c,v 1.9 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: dr_main.c,v 1.10 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.21 2001/01/04 02:43:32 jwise Exp $ */
/* $NetBSD: extern.h,v 1.22 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -35,17 +35,10 @@
* @(#)externs.h 8.1 (Berkeley) 5/31/93
*/
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <setjmp.h>
#include <sys/types.h>
#include "machdep.h"
/* program mode */
extern int mode;
extern jmp_buf restart;
#define MODE_PLAYER 1
#define MODE_DRIVER 2
#define MODE_LOGGER 3

View File

@ -1,4 +1,4 @@
/* $NetBSD: game.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
/* $NetBSD: game.c,v 1.9 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,11 @@
#if 0
static char sccsid[] = "@(#)game.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: game.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
__RCSID("$NetBSD: game.c,v 1.9 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include "extern.h"
int maxturns(struct ship *, char *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: globals.c,v 1.10 2001/01/04 01:56:28 jwise Exp $ */
/* $NetBSD: globals.c,v 1.11 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,12 @@
#if 0
static char sccsid[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: globals.c,v 1.10 2001/01/04 01:56:28 jwise Exp $");
__RCSID("$NetBSD: globals.c,v 1.11 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include <setjmp.h>
#include "extern.h"
struct scenario scene[] = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.18 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: main.c,v 1.19 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -43,15 +43,18 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: main.c,v 1.18 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: main.c,v 1.19 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <fcntl.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "extern.h"
#include "restart.h"
int
main(int argc, char **argv)

View File

@ -1,4 +1,4 @@
/* $NetBSD: misc.c,v 1.9 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: misc.c,v 1.10 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,11 @@
#if 0
static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: misc.c,v 1.9 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: misc.c,v 1.10 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
#include "extern.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: parties.c,v 1.8 2001/01/04 02:43:32 jwise Exp $ */
/* $NetBSD: parties.c,v 1.9 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,11 @@
#if 0
static char sccsid[] = "@(#)parties.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: parties.c,v 1.8 2001/01/04 02:43:32 jwise Exp $");
__RCSID("$NetBSD: parties.c,v 1.9 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include "extern.h"
int meleeing(struct ship *, struct ship *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_1.c,v 1.11 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: pl_1.c,v 1.12 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,12 +38,13 @@
#if 0
static char sccsid[] = "@(#)pl_1.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_1.c,v 1.11 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: pl_1.c,v 1.12 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "player.h"

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_5.c,v 1.10 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: pl_5.c,v 1.11 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,12 @@
#if 0
static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_5.c,v 1.10 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: pl_5.c,v 1.11 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <ctype.h>
#include <signal.h>
#include <stdio.h>
#include "player.h"

View File

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

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_7.c,v 1.18 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: pl_7.c,v 1.19 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,10 +38,11 @@
#if 0
static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_7.c,v 1.18 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: pl_7.c,v 1.19 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: pl_main.c,v 1.12 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: pl_main.c,v 1.13 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,14 +38,18 @@
#if 0
static char sccsid[] = "@(#)pl_main.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: pl_main.c,v 1.12 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: pl_main.c,v 1.13 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "player.h"
#include "restart.h"
int pl_main(void);
static void initialize(void);

32
games/sail/restart.h Normal file
View File

@ -0,0 +1,32 @@
/* $NetBSD: restart.h,v 1.1 2001/01/04 03:51:24 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.
*/
extern jmp_buf restart;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sync.c,v 1.17 2001/01/04 03:21:17 jwise Exp $ */
/* $NetBSD: sync.c,v 1.18 2001/01/04 03:51:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,15 +38,17 @@
#if 0
static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: sync.c,v 1.17 2001/01/04 03:21:17 jwise Exp $");
__RCSID("$NetBSD: sync.c,v 1.18 2001/01/04 03:51:24 jwise Exp $");
#endif
#endif /* not lint */
#include <fcntl.h>
#include <errno.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "extern.h"