CAMLprim value wrapper_bdd_setvarorder(value neworder) { CAMLparam1(neworder); int h, i; int n[bdd_varnum()]; int len = length(neworder); if (len != bdd_varnum()) { caml_raise_constant(*caml_named_value("buddy_exn_InvalidOrder")); } else { for (i = bdd_varnum() - 1; i >= 0; i--) { n[i] = 0; } i = 0; while (neworder != Val_emptylist) { h = Int_val(Field(neworder, 0)); neworder = Field(neworder, 1); n[i++]=h; // i=i+1; } bdd_setvarorder(n); } CAMLreturn(Val_unit); }
CAMLprim value wrapper_bdd_varnum() { CAMLparam0(); CAMLreturn(Val_int(bdd_varnum())); }
/* ML type: unit -> int */ EXTERNML value mlbdd_getvarnum(value dummy) /* ML */ { return Val_long(bdd_varnum()); }