Ross McFarland > Glib-1.043 > GValue.xs

Download:
Gtk2-Perl/Glib-1.043.tar.gz

Annotate this POD

CPAN RT

New  3
Open  3
View/Report Bugs
Source  

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.

Returns NULL if the code doesn't know how to perform the conversion. FIXME this really ought to always succeed; a failed conversion should be considered a bug or unimplemented code!

syntax highlighting: