home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------
- *
- * 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;
- }
-