blob: 8ce4fb7d47b3147469ab41c9855ff8297fca119b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/***********************************************************************/
/* */
/* Objective Caml */
/* */
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
/* */
/* Copyright 1996 Institut National de Recherche en Informatique et */
/* Automatique. Distributed only by permission. */
/* */
/***********************************************************************/
/* $Id$ */
#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 Val_int(i);
return Val_int(deflt);
}
|