home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
PROGRAM
/
AECUR100.ZIP
/
CONTRIB
/
CURSES
/
SRC
/
MATCHKEY.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-08
|
560b
|
29 lines
/*------------------------------------------------------------
*
* matchkey.c
*
* copyright (c) 1988,89,90 J. Alan Eldridge
*
* since keys are ints, we can't use strchr() to
* see if a key is in an array of keys
*
* the array is terminated with K_ILLEGAL
*
*----------------------------------------------------------*/
#include "curses.h"
int
kb_matchkey(arr, val)
int *arr;
int val;
{
int n;
for (n = 0; *arr != K_ILLEGAL; arr++, n++)
if (*arr == val)
return n;
return -1;
}