gperl-i11n-gvalue.c 479 Bytes
Newer Older
1 2
/* -*- mode: c; indent-tabs-mode: t; c-basic-offset: 8; -*- */

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/* Semi-private package for marshalling into GValues. */
#define GVALUE_WRAPPER_PACKAGE "Glib::Object::Introspection::GValueWrapper"

static GValue *
SvGValueWrapper (SV *sv)
{
	return sv_derived_from (sv, GVALUE_WRAPPER_PACKAGE)
		? INT2PTR (GValue*, SvIV (SvRV (sv)))
		: NULL;
}

static SV *
newSVGValueWrapper (GValue *v)
{
	SV *sv;
	sv = newSV (0);
	sv_setref_pv (sv, GVALUE_WRAPPER_PACKAGE, v);
	return sv;
}