mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
copy in from cvs; cvs2svn fucked up big time
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@9775 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
@@ -1,4 +1,30 @@
|
||||
# Makefrag - makefile fragment for number
|
||||
#
|
||||
# Copyright (c) 1997, 1998, 1999 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.
|
||||
|
||||
number_DEFS := -D_GNU_SOURCE
|
||||
number_DIRS := $(GAMESDIR) $(MAN6DIR)
|
||||
@@ -9,6 +35,3 @@ number_install: number_all
|
||||
$(INSTALL_BINARY) number/number $(INSTALL_PREFIX)$(GAMESDIR)/number
|
||||
$(HIDE_GAME) number
|
||||
$(INSTALL_MANUAL) number/number.6
|
||||
|
||||
number_check: number_all
|
||||
echo "1234567890" | number/number
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: number.6,v 1.5 1997/10/10 16:41:37 lukem Exp $
|
||||
.\" $NetBSD: number.6,v 1.6 2001/12/20 20:10:35 soren Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1989, 1993, 1994
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@@ -41,7 +41,8 @@
|
||||
.Nd convert Arabic numerals to English
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op #
|
||||
.Op Fl l
|
||||
.Op Ar number ...
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: number.c,v 1.6 1998/09/13 15:24:57 hubertf Exp $ */
|
||||
/* $NetBSD: number.c,v 1.7 1999/09/08 21:17:53 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993, 1994
|
||||
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: number.c,v 1.6 1998/09/13 15:24:57 hubertf Exp $");
|
||||
__RCSID("$NetBSD: number.c,v 1.7 1999/09/08 21:17:53 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -58,19 +58,19 @@ __RCSID("$NetBSD: number.c,v 1.6 1998/09/13 15:24:57 hubertf Exp $");
|
||||
|
||||
#define MAXNUM 65 /* Biggest number we handle. */
|
||||
|
||||
static char *name1[] = {
|
||||
static const char *const name1[] = {
|
||||
"", "one", "two", "three",
|
||||
"four", "five", "six", "seven",
|
||||
"eight", "nine", "ten", "eleven",
|
||||
"twelve", "thirteen", "fourteen", "fifteen",
|
||||
"sixteen", "seventeen", "eighteen", "nineteen",
|
||||
},
|
||||
*name2[] = {
|
||||
*const name2[] = {
|
||||
"", "ten", "twenty", "thirty",
|
||||
"forty", "fifty", "sixty", "seventy",
|
||||
"eighty", "ninety",
|
||||
},
|
||||
*name3[] = {
|
||||
*const name3[] = {
|
||||
"hundred", "thousand", "million", "billion",
|
||||
"trillion", "quadrillion", "quintillion", "sextillion",
|
||||
"septillion", "octillion", "nonillion", "decillion",
|
||||
@@ -82,9 +82,9 @@ static char *name1[] = {
|
||||
|
||||
void convert __P((char *));
|
||||
int main __P((int, char *[]));
|
||||
int number __P((char *, int));
|
||||
int number __P((const char *, int));
|
||||
void pfract __P((int));
|
||||
int unit __P((int, char *));
|
||||
int unit __P((int, const char *));
|
||||
void usage __P((void)) __attribute__((__noreturn__));
|
||||
|
||||
int lflag;
|
||||
@@ -203,7 +203,7 @@ badnum: errx(1, "illegal number: %s", line);
|
||||
int
|
||||
unit(len, p)
|
||||
int len;
|
||||
char *p;
|
||||
const char *p;
|
||||
{
|
||||
int off, rval;
|
||||
|
||||
@@ -238,7 +238,7 @@ unit(len, p)
|
||||
|
||||
int
|
||||
number(p, len)
|
||||
char *p;
|
||||
const char *p;
|
||||
int len;
|
||||
{
|
||||
int val, rval;
|
||||
@@ -280,7 +280,7 @@ void
|
||||
pfract(len)
|
||||
int len;
|
||||
{
|
||||
static char *pref[] = { "", "ten-", "hundred-" };
|
||||
static const char *const pref[] = { "", "ten-", "hundred-" };
|
||||
|
||||
switch(len) {
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user