The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

GValue

GValue is GLib's generic value container, and it is because of GValue that the run time type handling of GObject parameters and GClosure marshaling can function, and most usages of these functions will be from those two points.

Client code will run into uses for gperl_sv_from_value() and gperl_value_from_sv() when trying to convert lists of parameters into GValue arrays and the like.

gboolean gperl_value_from_sv (GValue * value, SV * sv)

set a value from a whatever is in sv. value must be initialized so the code knows what kind of value to coerce out of sv.

Return value is always TRUE; if the code knows how to perform the conversion, it croaks. (The return value is for backward compatibility.) In reality, this really ought to always succeed; a failed conversion should be considered a bug or unimplemented code!

SV * gperl_sv_from_value (const GValue * value)

Coerce whatever is in value into a perl scalar and return it.

Croaks if the code doesn't know how to perform the conversion.