-/* $NetBSD: support.c,v 1.11 2006/03/19 12:09:39 he Exp $ */
+/* $NetBSD: support.c,v 1.14 2009/08/12 05:48:04 dholland Exp $ */
/*-
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: support.c,v 1.11 2006/03/19 12:09:39 he Exp $");
+__RCSID("$NetBSD: support.c,v 1.14 2009/08/12 05:48:04 dholland Exp $");
#endif
#endif /* not lint */
#include <curses.h>
#include <stdlib.h>
#include <string.h>
-#include <stdlib.h>
#include "deck.h"
#include "cribbage.h"
#define NTV 10 /* number scores to test */
/* score to test reachability of, and order to test them in */
-const int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
+static const int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
+
+static int anysumto(const CARD[], int, int, int);
+static void prpeg(int, int, BOOLEAN);
+static int numofval(const CARD[], int, int);
/*
* computer chooses what to play in pegging...
BOOLEAN win;
prhand(hand, CINHAND, Playwin, FALSE);
- (void) sprintf(prompt, "Your %s scores ", s);
+ (void) snprintf(prompt, sizeof(prompt), "Your %s scores ", s);
i = scorehand(hand, turnover, CINHAND, strcmp(s, "crib") == 0, explain);
if ((j = number(0, 29, prompt)) == 19)
j = 0;
* Put out the peg character on the score board and put the
* score up on the board.
*/
-void
+static void
prpeg(int curscore, int pegc, BOOLEAN myturn)
{
int y, x;
* anysumto returns the index (0 <= i < n) of the card in hand that brings
* the s up to t, or -1 if there is none
*/
-int
+static int
anysumto(const CARD hand[], int n, int s, int t)
{
int i;
/*
* return the number of cards in h having the given rank value
*/
-int
+static int
numofval(const CARD h[], int n, int v)
{
int i, j;