From 56934c148220f0c06916f0cadf5052a71e8e1541 Mon Sep 17 00:00:00 2001 From: rich Date: Sun, 26 Oct 2003 12:57:11 +0000 Subject: [PATCH] Fixed undef handling. --- perl.ml | 5 +++-- perl_c.c | 10 +--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/perl.ml b/perl.ml index 5812a61..6110c20 100644 --- a/perl.ml +++ b/perl.ml @@ -1,6 +1,6 @@ (* Interface to Perl from OCaml. * Copyright (C) 2003 Merjis Ltd. - * $Id: perl.ml,v 1.9 2003-10-26 11:22:38 rich Exp $ + * $Id: perl.ml,v 1.10 2003-10-26 12:57:11 rich Exp $ *) type t @@ -41,7 +41,6 @@ external sv_of_float : float -> sv = "perl4caml_sv_of_float" external string_of_sv : sv -> string = "perl4caml_string_of_sv" external sv_of_string : string -> sv = "perl4caml_sv_of_string" external sv_is_true : sv -> bool = "perl4caml_sv_is_true" -external sv_is_undef : sv -> bool = "perl4caml_sv_is_undef" external sv_undef : unit -> sv = "perl4caml_sv_undef" external sv_yes : unit -> sv = "perl4caml_sv_yes" external sv_no : unit -> sv = "perl4caml_sv_no" @@ -64,6 +63,8 @@ type sv_t = SVt_NULL | SVt_PVMG external sv_type : sv -> sv_t = "perl4caml_sv_type" +let sv_is_undef sv = + SVt_NULL = sv_type sv let string_of_sv_t = function SVt_NULL -> "SVt_NULL" diff --git a/perl_c.c b/perl_c.c index 29c9776..7f3bddd 100644 --- a/perl_c.c +++ b/perl_c.c @@ -1,6 +1,6 @@ /* Interface to Perl from OCaml. * Copyright (C) 2003 Merjis Ltd. - * $Id: perl_c.c,v 1.10 2003-10-26 12:10:23 rich Exp $ + * $Id: perl_c.c,v 1.11 2003-10-26 12:57:11 rich Exp $ */ #include @@ -191,14 +191,6 @@ perl4caml_sv_is_true (value svv) } CAMLprim value -perl4caml_sv_is_undef (value svv) -{ - CAMLparam1 (svv); - SV *sv = Sv_val (svv); - CAMLreturn (SvLEN (sv) == 0 ? Val_true : Val_false); -} - -CAMLprim value perl4caml_sv_undef (value unit) { CAMLparam1 (unit); -- 1.8.3.1