		/*
		 * This file was generated automatically by ExtUtils::ParseXS version 2.10 from the
		 * contents of attrs.xs. Do not edit this file, edit attrs.xs instead.
		 *
		 *	ANY CHANGES MADE HERE WILL BE LOST! 
		 *
		 */
		
		#line 1 "attrs.xs"
		#define PERL_NO_GET_CONTEXT
		#include "EXTERN.h"
		#include "perl.h"
		#include "XSUB.h"
		
		static cv_flags_t
		get_flag(const char *attr)
		{
		    if (strnEQ(attr, "method", 6))
			return CVf_METHOD;
		    else if (strnEQ(attr, "locked", 6))
			return CVf_LOCKED;
		    else
			return 0;
		}
		
		#ifndef PERL_UNUSED_VAR
		#  define PERL_UNUSED_VAR(var) if (0) var = var
		#endif
		
		#line 31 "attrs.c"
		
		XS(XS_attrs_import); /* prototype to pass -Wmissing-prototypes */
		XS(XS_attrs_import)
           6    {
           6        dXSARGS;
           6        dXSI32;
           6        PERL_UNUSED_VAR(cv); /* -W */
           6        PERL_UNUSED_VAR(ax); /* -Wall */
           6        SP -= items;
		    {
		#line 24 "attrs.xs"
			int i;
		#line 44 "attrs.c"
		#line 26 "attrs.xs"
		       if (items < 1)
		           Perl_croak(aTHX_ "Usage: %s(Class, ...)", GvNAME(CvGV(cv)));
			if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv)))
			    croak("can't set attributes outside a subroutine scope");
			if (ckWARN(WARN_DEPRECATED))
			    Perl_warner(aTHX_ packWARN(WARN_DEPRECATED),
					"pragma \"attrs\" is deprecated, "
					"use \"sub NAME : ATTRS\" instead");
			for (i = 1; i < items; i++) {
			    const char * const attr = SvPV_nolen(ST(i));
			    const cv_flags_t flag = get_flag(attr);
			    if (!flag)
				croak("invalid attribute name %s", attr);
			    if (ix)
		    		CvFLAGS(cv) &= ~flag;
			    else
				CvFLAGS(cv) |= flag;
			}
		#line 64 "attrs.c"
           6    	PUTBACK;
			return;
		    }
		}
		
		
		XS(XS_attrs_get); /* prototype to pass -Wmissing-prototypes */
		XS(XS_attrs_get)
           3    {
           3        dXSARGS;
           3        if (items != 1)
      ######    	Perl_croak(aTHX_ "Usage: attrs::get(sub)");
           3        PERL_UNUSED_VAR(cv); /* -W */
           3        PERL_UNUSED_VAR(ax); /* -Wall */
           3        SP -= items;
		    {
           3    	SV *	sub = ST(0);
		#line 49 "attrs.xs"
			if (SvROK(sub)) {
			    sub = SvRV(sub);
			    if (SvTYPE(sub) != SVt_PVCV)
				sub = Nullsv;
			}
			else {
			    const char * const name = SvPV_nolen(sub);
			    sub = (SV*)perl_get_cv(name, FALSE);
			}
			if (!sub)
			    croak("invalid subroutine reference or name");
			if (CvFLAGS(sub) & CVf_METHOD)
			    XPUSHs(sv_2mortal(newSVpvn("method", 6)));
			if (CvFLAGS(sub) & CVf_LOCKED)
			    XPUSHs(sv_2mortal(newSVpvn("locked", 6)));
		#line 98 "attrs.c"
           3    	PUTBACK;
			return;
		    }
		}
		
		#ifdef __cplusplus
		extern "C"
		#endif
		XS(boot_attrs); /* prototype to pass -Wmissing-prototypes */
		XS(boot_attrs)
           1    {
           1        dXSARGS;
           1        char* file = __FILE__;
		
           1        PERL_UNUSED_VAR(cv); /* -W */
           1        PERL_UNUSED_VAR(items); /* -W */
           1        XS_VERSION_BOOTCHECK ;
		
		    {
           1            CV * cv ;
		
           1            cv = newXS("attrs::unimport", XS_attrs_import, file);
           1            XSANY.any_i32 = 1 ;
           1            cv = newXS("attrs::import", XS_attrs_import, file);
           1            XSANY.any_i32 = 0 ;
           1            newXS("attrs::get", XS_attrs_get, file);
		    }
           1        XSRETURN_YES;
		}
		
