/*
 * This file was generated automatically by ExtUtils::ParseXS version 2.18 from the
 * contents of Overload.xs. Do not edit this file, edit Overload.xs instead.
 *
 *	ANY CHANGES MADE HERE WILL BE LOST! 
 *
 */

#line 1 "Overload.xs"
/* Copyright (c) 1997-2006			 -*- C -*-
   Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
   http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.de

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
*/

#ident "$Project: polymake $$Id: Overload.xs 7164 2006-03-07 17:54:08Z gawrilow $"

#include "Ext.h"

static HV *keyword_stash, *UNIVERSAL_stash;

#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#line 36 "Overload.c"

XS(XS_Poly__Overload_can_signature); /* prototype to pass -Wmissing-prototypes */
XS(XS_Poly__Overload_can_signature)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 3)
       Perl_croak(aTHX_ "Usage: %s(%s)", "Poly::Overload::can_signature", "arg, signature, keywords");
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	arg = ST(0);
	SV *	signature = ST(1);
	SV *	keywords = ST(2);
#line 32 "Overload.xs"
{
   STRLEN method_name_len;
   char *method_name=SvPV(signature,method_name_len);
   HV *stash=
      SvROK(arg) && SvOBJECT(SvRV(arg))
      ? SvSTASH(SvRV(arg)) :
      SvTRUE(keywords) && SvIsUV(arg)
      ? keyword_stash
      : UNIVERSAL_stash;
   GV *glob=gv_fetchmeth(stash, method_name, method_name_len, 0);
   if (glob)
      PUSHs( sv_2mortal(newRV((SV*)GvCV(glob))) );
   else
      PUSHs( &PL_sv_undef );
}
#line 71 "Overload.c"
	PUTBACK;
	return;
    }
}

#ifdef __cplusplus
extern "C"
#endif
XS(boot_Poly__Overload); /* prototype to pass -Wmissing-prototypes */
XS(boot_Poly__Overload)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    char* file = __FILE__;

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    XS_VERSION_BOOTCHECK ;

        newXS("Poly::Overload::can_signature", XS_Poly__Overload_can_signature, file);

    /* Initialisation Section */

#line 49 "Overload.xs"
   keyword_stash=gv_stashpv("Poly::Overload::keyword", TRUE);
   UNIVERSAL_stash=gv_stashpv("UNIVERSAL", FALSE);

#line 102 "Overload.c"

    /* End of Initialisation Section */

    XSRETURN_YES;
}



syntax highlighted by Code2HTML, v. 0.9.1