summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/cst2constr.c
blob: 7a519a7501776cf97c5dde64b46ce6836639e296 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <mlvalues.h>
#include <fail.h>
#include "cst2constr.h"

value cst_to_constr(n, tbl, size, deflt)
     int n;
     int * tbl;
     int size;
     int deflt;
{
  int i;
  for (i = 0; i < size; i++)
    if (n == tbl[i]) return Atom(i);
  return Atom(deflt);
}