This commit was manufactured by cvs2svn to create tag

'debian_version_2_14-8'.

git-svn-id: file:///srv/svn/joey/bsdgames-tags/debian_version_2_14-8@5231 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
unknown
2003-12-09 18:41:53 +00:00
parent ec93f45476
commit 4c4a7ab9ef
98 changed files with 1511 additions and 95189 deletions

View File

@@ -1,6 +1,8 @@
# $NetBSD: Makefile,v 1.19 1998/09/13 15:22:59 hubertf Exp $
# $NetBSD: Makefile,v 1.22 1999/07/17 19:57:03 hubertf Exp $
# @(#)Makefile 8.1 (Berkeley) 5/31/93
.include <bsd.own.mk>
PROG= atc
CPPFLAGS+=-DBSD -I${.CURDIR} -I. -DYY_NO_UNPUT
SRCS= extern.c grammar.y graphics.c input.c lex.l list.c log.c \
@@ -14,9 +16,11 @@ GAMES= Game_List Killer crossover default easy game_2 \
game_4 novice two-corners
HIDEGAME=hidegame
SETGIDGAME=yes
.if ${MKSHARE} != "no"
FILES=${GAMES:S@^@${.CURDIR}/games/@g}
FILESDIR=/usr/share/games/atc
FILESMODE=440
FILESMODE=444
.endif
lex.o: grammar.h

View File

@@ -1,4 +1,30 @@
# Makefrag - makefile fragment for atc
#
# Copyright (c) 1997, 1998 Joseph Samuel Myers.
# 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. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
atc_CLEANFILES := grammar.c grammar.h y.tab.* lex.c lex.yy.c
atc_DEFS := -DBSD -DYY_NO_UNPUT

View File

@@ -1,4 +1,4 @@
/* $NetBSD: def.h,v 1.4 1998/09/11 12:53:28 hubertf Exp $ */
/* $NetBSD: def.h,v 1.5 1999/09/30 18:01:31 jsm Exp $ */
/*-
* Copyright (c) 1990, 1993

View File

@@ -1,4 +1,4 @@
/* $NetBSD: extern.c,v 1.5 1997/10/10 02:07:04 lukem Exp $ */
/* $NetBSD: extern.c,v 1.6 1998/11/10 13:43:30 hubertf Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: extern.c,v 1.5 1997/10/10 02:07:04 lukem Exp $");
__RCSID("$NetBSD: extern.c,v 1.6 1998/11/10 13:43:30 hubertf Exp $");
#endif
#endif /* not lint */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.6 1998/09/13 15:27:26 hubertf Exp $ */
/* $NetBSD: extern.h,v 1.9 2001/02/05 00:22:52 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -48,7 +48,7 @@
*/
extern char GAMES[];
extern const char *file;
extern const char *file;
extern int clck, safe_planes, start_time, test_mode;
@@ -110,7 +110,9 @@ int too_close __P((const PLANE *p1, const PLANE *p2, int));
void update __P((int));
int yyerror __P((const char *));
int yylex __P((void));
#ifndef YYEMPTY
int yyparse __P((void));
#endif
const char *Left __P((char));
const char *Right __P((char));
const char *airport __P((char));

View File

@@ -1,4 +1,30 @@
# Makefrag - makefile fragment for atc/games
#
# Copyright (c) 1998 Joseph Samuel Myers.
# 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. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
atc_games_DIRS := $(ATC_DIR)
atc_games_GAMES := atc/games/Game_List atc/games/default atc/games/easy \

View File

@@ -1,4 +1,4 @@
/* $NetBSD: grammar.y,v 1.4 1997/10/10 02:07:08 lukem Exp $ */
/* $NetBSD: grammar.y,v 1.7 1999/07/26 21:14:21 hubertf Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -68,7 +68,7 @@
#if 0
static char sccsid[] = "@(#)grammar.y 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: grammar.y,v 1.4 1997/10/10 02:07:08 lukem Exp $");
__RCSID("$NetBSD: grammar.y,v 1.7 1999/07/26 21:14:21 hubertf Exp $");
#endif
#endif /* not lint */
@@ -137,7 +137,7 @@ hdef:
wdef:
WidthOp '=' ConstOp ';'
{
if (sp->height != 0)
if (sp->width != 0)
return (yyerror("Redefinition of 'width'."));
else if ($3 < 3)
return (yyerror("'width' is too small."));
@@ -253,7 +253,6 @@ Apoint:
sp->airport[sp->num_airports].y = $3;
sp->airport[sp->num_airports].dir = dir;
check_point($2, $3);
check_adir($2, $3, dir);
sp->num_airports++;
}
;
@@ -377,12 +376,6 @@ check_edir(x, y, dir)
yyerror("Bad direction for entrance at exit.");
}
void
check_adir(x, y, dir)
int x __attribute__((unused)), y __attribute__((unused)), dir __attribute__((unused));
{
}
int
checkdefs()
{

View File

@@ -1,4 +1,4 @@
/* $NetBSD: graphics.c,v 1.4 1997/10/10 02:07:11 lukem Exp $ */
/* $NetBSD: graphics.c,v 1.9 1999/09/10 00:16:43 jsm Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: graphics.c,v 1.4 1997/10/10 02:07:11 lukem Exp $");
__RCSID("$NetBSD: graphics.c,v 1.9 1999/09/10 00:16:43 jsm Exp $");
#endif
#endif /* not lint */
@@ -72,8 +72,10 @@ getAChar()
int c;
errno = 0;
while ((c = getchar()) == EOF && errno == EINTR)
while ((c = getchar()) == EOF && errno == EINTR) {
errno = 0;
clearerr(stdin);
}
return(c);
}
@@ -294,7 +296,7 @@ ioerror(pos, len, str)
void
quit(dummy)
int dummy __attribute__((unused));
int dummy __attribute__((__unused__));
{
int c, y, x;
#ifdef BSD

View File

@@ -1,74 +0,0 @@
/* $NetBSD: include.h,v 1.6 1997/10/10 02:07:14 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
*
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)include.h 8.1 (Berkeley) 5/31/93
*/
/*
* Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved.
*
* Copy permission is hereby granted provided that this notice is
* retained on all partial or complete copies.
*
* For more info on this and all of my stuff, mail edjames@berkeley.edu.
*/
#include <sys/types.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <ctype.h>
#include <curses.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include "def.h"
#include "struct.h"
#include "extern.h"
#include "tunable.h"

View File

@@ -1,4 +1,4 @@
/* $NetBSD: input.c,v 1.10 1998/09/13 15:20:31 hubertf Exp $ */
/* $NetBSD: input.c,v 1.14 2001/01/16 02:50:28 cgd Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,9 +50,9 @@
#if 0
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: input.c,v 1.10 1998/09/13 15:20:31 hubertf Exp $");
__RCSID("$NetBSD: input.c,v 1.14 2001/01/16 02:50:28 cgd Exp $");
#endif
#endif not lint
#endif /* not lint */
#include "include.h"
#include "pathnames.h"
@@ -374,7 +374,7 @@ setplane(c)
const char *
turn(c)
char c;
char c __attribute__((__unused__));
{
if (p.altitude == 0)
return ("Planes at airports may not change direction");
@@ -383,7 +383,7 @@ turn(c)
const char *
circle(c)
char c;
char c __attribute__((__unused__));
{
if (p.altitude == 0)
return ("Planes cannot circle on the ground");
@@ -393,7 +393,7 @@ circle(c)
const char *
left(c)
char c;
char c __attribute__((__unused__));
{
dir = D_LEFT;
p.new_dir = p.dir - 1;
@@ -404,7 +404,7 @@ left(c)
const char *
right(c)
char c;
char c __attribute__((__unused__));
{
dir = D_RIGHT;
p.new_dir = p.dir + 1;
@@ -415,7 +415,7 @@ right(c)
const char *
Left(c)
char c;
char c __attribute__((__unused__));
{
p.new_dir = p.dir - 2;
if (p.new_dir < 0)
@@ -425,7 +425,7 @@ Left(c)
const char *
Right(c)
char c;
char c __attribute__((__unused__));
{
p.new_dir = p.dir + 2;
if (p.new_dir >= MAXDIR)
@@ -434,13 +434,12 @@ Right(c)
}
const char *
delayb(ch)
char ch;
delayb(c)
char c;
{
int xdiff, ydiff;
unsigned char c;
c = ch - '0';
c -= '0';
if (c >= sp->num_beacons)
return ("Unknown beacon");
@@ -482,7 +481,7 @@ delayb(ch)
const char *
beacon(c)
char c;
char c __attribute__((__unused__));
{
dest_type = T_BEACON;
return (NULL);
@@ -490,7 +489,7 @@ beacon(c)
const char *
ex_it(c)
char c;
char c __attribute__((__unused__));
{
dest_type = T_EXIT;
return (NULL);
@@ -498,7 +497,7 @@ ex_it(c)
const char *
airport(c)
char c;
char c __attribute__((__unused__));
{
dest_type = T_AIRPORT;
return (NULL);
@@ -506,7 +505,7 @@ airport(c)
const char *
climb(c)
char c;
char c __attribute__((__unused__));
{
dir = D_UP;
return (NULL);
@@ -514,7 +513,7 @@ climb(c)
const char *
descend(c)
char c;
char c __attribute__((__unused__));
{
dir = D_DOWN;
return (NULL);
@@ -556,12 +555,10 @@ setrelalt(c)
}
const char *
benum(ch)
char ch;
benum(c)
char c;
{
unsigned char c;
dest_no = c = ch - '0';
dest_no = c -= '0';
switch (dest_type) {
case T_BEACON:
@@ -624,7 +621,7 @@ rel_dir(c)
const char *
mark(c)
char c;
char c __attribute__((__unused__));
{
if (p.altitude == 0)
return ("Cannot mark planes on the ground");
@@ -636,7 +633,7 @@ mark(c)
const char *
unmark(c)
char c;
char c __attribute__((__unused__));
{
if (p.altitude == 0)
return ("Cannot unmark planes on the ground");
@@ -648,7 +645,7 @@ unmark(c)
const char *
ignore(c)
char c;
char c __attribute__((__unused__));
{
if (p.altitude == 0)
return ("Cannot ignore planes on the ground");

View File

@@ -1,4 +1,4 @@
/* $NetBSD: list.c,v 1.4 1997/10/10 02:07:23 lukem Exp $ */
/* $NetBSD: list.c,v 1.5 2001/06/19 13:42:08 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)list.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: list.c,v 1.4 1997/10/10 02:07:23 lukem Exp $");
__RCSID("$NetBSD: list.c,v 1.5 2001/06/19 13:42:08 wiz Exp $");
#endif
#endif /* not lint */
@@ -107,7 +107,7 @@ delete(l, p)
PLANE *p;
{
if (l->head == NULL)
loser(p, "deleted a non-existant plane! Get help!");
loser(p, "deleted a non-existent plane! Get help!");
if (l->head == p && l->tail == p)
l->head = l->tail = NULL;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: log.c,v 1.7 1998/07/24 23:22:26 hubertf Exp $ */
/* $NetBSD: log.c,v 1.11 2001/01/16 02:50:28 cgd Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,9 +50,9 @@
#if 0
static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: log.c,v 1.7 1998/07/24 23:22:26 hubertf Exp $");
__RCSID("$NetBSD: log.c,v 1.11 2001/01/16 02:50:28 cgd Exp $");
#endif
#endif not lint
#endif /* not lint */
#include "include.h"
#include "pathnames.h"
@@ -117,6 +117,8 @@ open_score_file()
warn("open %s", _PATH_SCORE);
return;
}
if (score_fd < 3)
exit(1);
/* Set the close-on-exec flag. If this fails for any reason, quit
* rather than leave the score file open to tampering. */
flags = fcntl(score_fd, F_GETFD);
@@ -290,7 +292,7 @@ log_score(list_em)
void
log_score_quit(dummy)
int dummy __attribute__((unused));
int dummy __attribute__((__unused__));
{
(void)log_score(0);
exit(0);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.7 1998/09/13 15:20:31 hubertf Exp $ */
/* $NetBSD: main.c,v 1.12 2001/02/05 00:22:52 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -55,24 +55,25 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: main.c,v 1.7 1998/09/13 15:20:31 hubertf Exp $");
__RCSID("$NetBSD: main.c,v 1.12 2001/02/05 00:22:52 christos Exp $");
#endif
#endif /* not lint */
#include "include.h"
#include "pathnames.h"
extern FILE *yyin;
int
main(ac, av)
int ac __attribute__((unused));
int ac;
char *av[];
{
int seed;
int f_usage = 0, f_list = 0, f_showscore = 0;
int f_printpath = 0;
const char *file = NULL;
char *name, *ptr;
int ch;
struct sigaction sa;
#ifdef BSD
struct itimerval itv;
@@ -82,56 +83,42 @@ main(ac, av)
open_score_file();
setregid(getgid(), getgid());
start_time = seed = time(0);
start_time = seed = time(NULL);
name = *av++;
while (*av) {
#ifndef SAVEDASH
if (**av == '-')
++*av;
else
while ((ch = getopt(ac, av, "ulstpg:f:r:")) != -1) {
switch (ch) {
case '?':
case 'u':
default:
f_usage++;
break;
case 'l':
f_list++;
break;
case 's':
case 't':
f_showscore++;
break;
case 'p':
f_printpath++;
break;
case 'r':
seed = atoi(optarg);
break;
case 'f':
case 'g':
file = optarg;
break;
#endif
ptr = *av++;
while (*ptr) {
switch (*ptr) {
case '?':
case 'u':
f_usage++;
break;
case 'l':
f_list++;
break;
case 's':
case 't':
f_showscore++;
break;
case 'p':
f_printpath++;
break;
case 'r':
seed = atoi(*av);
av++;
break;
case 'f':
case 'g':
file = *av;
av++;
break;
default:
warnx("unknown option '%c'\n", *ptr);
f_usage++;
break;
}
ptr++;
}
}
if (optind < ac)
f_usage++;
srandom(seed);
if (f_usage)
fprintf(stderr,
"Usage: %s -[u?lstp] [-[gf] game_name] [-r random seed]\n",
name);
av[0]);
if (f_showscore)
log_score(1);
if (f_list)
@@ -228,7 +215,6 @@ int
read_file(s)
const char *s;
{
extern FILE *yyin;
int retval;
file = s;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: struct.h,v 1.3 1995/03/21 15:04:31 cgd Exp $ */
/* $NetBSD: struct.h,v 1.4 1999/07/17 19:57:03 hubertf Exp $ */
/*-
* Copyright (c) 1990, 1993

View File

@@ -1,4 +1,4 @@
/* $NetBSD: update.c,v 1.7 1998/09/11 12:53:29 hubertf Exp $ */
/* $NetBSD: update.c,v 1.11 2001/01/16 02:50:28 cgd Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,15 +50,15 @@
#if 0
static char sccsid[] = "@(#)update.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: update.c,v 1.7 1998/09/11 12:53:29 hubertf Exp $");
__RCSID("$NetBSD: update.c,v 1.11 2001/01/16 02:50:28 cgd Exp $");
#endif
#endif not lint
#endif /* not lint */
#include "include.h"
void
update(dummy)
int dummy __attribute__((unused));
int dummy __attribute__((__unused__));
{
int i, dir_diff, unclean;
PLANE *pp, *p1, *p2;
@@ -366,7 +366,7 @@ addplane()
pp = newplane();
if (pp == NULL)
loser(pp, "Out of memory!");
loser(NULL, "Out of memory!");
memcpy(pp, &p, sizeof (p));
if (pp->orig_type == T_AIRPORT)