~ubuntu-branches/ubuntu/jaunty/libglib-perl/jaunty

« back to all changes in this revision

Viewing changes to GBoxed.xs

  • Committer: Bazaar Package Importer
  • Author(s): Marc 'HE' Brockschmidt
  • Date: 2008-03-15 09:40:14 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20080315094014-af0fqrtad5fq1u0f
Tags: 1:1.181-1
New upstream release (only changes in the build system irrelevant for
Debian, but for completeness' sake...)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * along with this library; if not, write to the Free Software Foundation,
17
17
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307  USA.
18
18
 *
19
 
 * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GBoxed.xs,v 1.24 2006/09/13 14:53:27 kaffeetisch Exp $
 
19
 * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GBoxed.xs,v 1.27 2008/01/07 19:17:08 kaffeetisch Exp $
20
20
 */
21
21
 
22
22
=head2 GBoxed
462
462
        BoxedInfo * boxed_info;
463
463
        GPerlBoxedUnwrapFunc unwrap;
464
464
 
465
 
        if (!sv || !SvOK (sv))
 
465
        if (!gperl_sv_is_defined (sv))
466
466
                croak ("variable not allowed to be undef where %s is wanted",
467
467
                       g_type_name (gtype));
468
468
 
556
556
        gchar ** strv = NULL;
557
557
 
558
558
        /* pass undef */
559
 
        if (!sv || !SvOK (sv))
 
559
        if (!gperl_sv_is_defined (sv))
560
560
                return NULL;
561
561
 
562
562
        if (SvROK (sv)) {
564
564
                int n;
565
565
 
566
566
                /* only allow a reference to an array */
567
 
                if (SvTYPE (SvRV (sv)) != SVt_PVAV)
 
567
                if (!gperl_sv_is_array_ref (sv))
568
568
                        croak ("expecting a reference to an array of strings for Glib::Strv");
569
569
                av = (AV*) SvRV (sv);
570
570
                n = av_len (av) + 1;
674
674
        char * class;
675
675
        GPerlBoxedDestroyFunc destroy;
676
676
    CODE:
677
 
        if (!sv || !SvOK (sv) || !SvROK (sv) || !SvRV (sv))
 
677
        if (!gperl_sv_is_defined (sv) || !SvROK (sv) || !SvRV (sv))
678
678
                croak ("DESTROY called on a bad value");
679
679
 
680
680
        /* we need to find the wrapper class associated with whatever type