*
* Copyright (C) 2003 Merjis Ltd.
*
- * $Id: perl.mli,v 1.12 2004-03-03 12:39:20 rich Exp $
+ * $Id: perl.mli,v 1.13 2005-01-28 23:09:32 rich Exp $
*)
type sv
| SVt_NV (** Floating point scalar. *)
| SVt_PV (** String scalar. *)
| SVt_RV (** Reference. *)
- | SVt_PVAV (** Array ref. *)
- | SVt_PVHV (** Hash ref. *)
- | SVt_PVCV (** Code ref. *)
- | SVt_PVGV (** Glob. *)
+ | SVt_PVAV (** Array. *)
+ | SVt_PVHV (** Hash. *)
+ | SVt_PVCV (** Code. *)
+ | SVt_PVGV (** Glob (possibly a file handle). *)
| SVt_PVMG (** Blessed or magical scalar. *)
val sv_type : sv -> sv_t
(** Return the type of data contained in an [SV]. Somewhat equivalent to
val string_of_sv_t : sv_t -> string
(** Return a printable string for an [sv_t] ([SV] type). *)
+val address_of_sv : sv -> Nativeint.t
+(** Returns the address of the SV. Useful for debugging since
+ * Perl also prints out addresses on internal errors.
+ *)
+val address_of_av : av -> Nativeint.t
+(** Returns the address of the AV. Useful for debugging since
+ * Perl also prints out addresses on internal errors.
+ *)
+val address_of_hv : hv -> Nativeint.t
+(** Returns the address of the HV. Useful for debugging since
+ * Perl also prints out addresses on internal errors.
+ *)
+
val scalarref : sv -> sv
(** Given a scalar, this returns a reference to the scalar. Note that
* because references are [SV]s, this returns [sv].
val av_undef : av -> unit
(** Delete the [AV] (and all elements in it). Same as Perl [undef \@av]. *)
val av_extend : av -> int -> unit
-(** Extend the [AV] so it contains at least [n+1] elements. *)
+(** Extend the [AV] so it contains at least [n+1] elements. Note that
+ * this apparently just changes the amount of allocated storage. The
+ * extra elements are not visible until you store something in them.
+ *)
val av_map : (sv -> 'a) -> av -> 'a list
(** Map a function over the elements in the [AV], return a list of the
* results. *)