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

#line 1 "Iterator.xs"
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"

#include "srl_common.h"
#include "srl_protocol.h"
#include "srl_iterator.h"

typedef srl_iterator_t * Sereal__Path__Iterator;

#line 22 "Iterator.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
            Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
        else
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#ifdef PERL_IMPLICIT_CONTEXT
#define croak_xs_usage(a,b)    S_croak_xs_usage(aTHX_ a,b)
#else
#define croak_xs_usage        S_croak_xs_usage
#endif

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#line 164 "Iterator.c"

XS_EUPXS(XS_Sereal__Path__Iterator_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_new)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 3)
       croak_xs_usage(cv,  "CLASS, src = NULL, opt = NULL");
    {
	char *	CLASS = (char *)SvPV_nolen(ST(0))
;
	SV *	src;
	HV *	opt;
	srl_iterator_t *	RETVAL;

	if (items < 2)
	    src = NULL;
	else {
	    src = ST(1)
;
	}

	if (items < 3)
	    opt = NULL;
	else {
	    STMT_START {
		    SV* const xsub_tmp_sv = ST(2);
		    SvGETMAGIC(xsub_tmp_sv);
		    if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv)) == SVt_PVHV){
			opt = (HV*)SvRV(xsub_tmp_sv);
		    }
		    else{
			Perl_croak(aTHX_ "%s: %s is not a HASH reference",
				    "Sereal::Path::Iterator::new",
				    "opt");
		    }
	    } STMT_END
;
	}
#line 21 "Iterator.xs"
    RETVAL = srl_build_iterator_struct(aTHX_ opt);
    if (src) srl_iterator_set(aTHX_ RETVAL, src);
#line 206 "Iterator.c"
	ST(0) = sv_newmortal();
	sv_setref_pv( ST(0), CLASS, (void*)RETVAL );
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sereal__Path__Iterator_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::DESTROY() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 29 "Iterator.xs"
    srl_destroy_iterator(aTHX_ iter);
#line 232 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_set); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_set)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "iter, src");
    {
	srl_iterator_t *	iter;
	SV *	src = ST(1)
;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::set() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 36 "Iterator.xs"
    srl_iterator_set(aTHX_ iter, src);
#line 258 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_reset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_reset)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::reset() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 42 "Iterator.xs"
    srl_iterator_reset(aTHX_ iter);
#line 282 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_eof); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_eof)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;
	UV	RETVAL;
	dXSTARG;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::eof() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 48 "Iterator.xs"
    RETVAL = srl_iterator_eof(aTHX_ iter);
#line 308 "Iterator.c"
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sereal__Path__Iterator_next); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_next)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "iter, n = NULL");
    {
	srl_iterator_t *	iter;
	SV *	n;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::next() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;

	if (items < 2)
	    n = NULL;
	else {
	    n = ST(1)
;
	}
#line 56 "Iterator.xs"
    srl_iterator_next(aTHX_ iter, n ? SvUV(n) : 1);
#line 341 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_step_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_step_in)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "iter, n = NULL");
    {
	srl_iterator_t *	iter;
	SV *	n;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::step_in() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;

	if (items < 2)
	    n = NULL;
	else {
	    n = ST(1)
;
	}
#line 63 "Iterator.xs"
    srl_iterator_step_in(aTHX_ iter, n ? SvUV(n) : 1);
#line 373 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_step_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_step_out)
{
    dVAR; dXSARGS;
    if (items < 1 || items > 2)
       croak_xs_usage(cv,  "iter, n = NULL");
    {
	srl_iterator_t *	iter;
	SV *	n;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::step_out() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;

	if (items < 2)
	    n = NULL;
	else {
	    n = ST(1)
;
	}
#line 70 "Iterator.xs"
    srl_iterator_step_out(aTHX_ iter, n ? SvUV(n) : 1);
#line 405 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_srl_next_until_depth_and_idx); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_srl_next_until_depth_and_idx)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "iter, depth, idx");
    {
	srl_iterator_t *	iter;
	UV	depth = (UV)SvUV(ST(1))
;
	U32	idx = (unsigned long)SvUV(ST(2))
;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::srl_next_until_depth_and_idx() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 78 "Iterator.xs"
    srl_iterator_next_until_depth_and_idx(aTHX_ iter, depth, idx);
#line 433 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_offset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_offset)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;
	UV	RETVAL;
	dXSTARG;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::offset() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 84 "Iterator.xs"
    RETVAL = srl_iterator_offset(aTHX_ iter);
#line 459 "Iterator.c"
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sereal__Path__Iterator_info); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_info)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	srl_iterator_t *	iter;
#line 91 "Iterator.xs"
    UV type;
    UV length;
    SV *str_type;
#line 480 "Iterator.c"

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::info() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 95 "Iterator.xs"
    switch (srl_iterator_object_info(aTHX_ iter, &length)) {
        case SRL_ITERATOR_OBJ_IS_ARRAY:
            str_type = newSVpv("ARRAY", 5);
            break;

        case SRL_ITERATOR_OBJ_IS_HASH:
            str_type = newSVpv("HASH", 4);
            break;

        case SRL_ITERATOR_OBJ_IS_SCALAR:
            str_type = newSVpv("SCALAR", 6);
            break;

        default:
            croak("should not be here");
    }

    EXTEND(SP, 2);
    PUSHs(sv_2mortal(str_type));
    PUSHs(sv_2mortal(newSVuv(length)));
#line 510 "Iterator.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sereal__Path__Iterator_stack_depth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_stack_depth)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;
	IV	RETVAL;
	dXSTARG;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::stack_depth() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 120 "Iterator.xs"
    RETVAL = srl_iterator_stack_depth(aTHX_ iter);
#line 537 "Iterator.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sereal__Path__Iterator_stack_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_stack_index)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;
	UV	RETVAL;
	dXSTARG;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::stack_index() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 127 "Iterator.xs"
    RETVAL = srl_iterator_stack_index(aTHX_ iter);
#line 564 "Iterator.c"
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sereal__Path__Iterator_stack_info); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_stack_info)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	srl_iterator_t *	iter;
#line 134 "Iterator.xs"
    UV type;
    UV length;
    SV *str_type;
#line 585 "Iterator.c"

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::stack_info() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 138 "Iterator.xs"
    switch (srl_iterator_stack_info(aTHX_ iter, &length)) {
        case SRL_ITERATOR_OBJ_IS_ARRAY:
            str_type = newSVpv("ARRAY", 5);
            break;

        case SRL_ITERATOR_OBJ_IS_HASH:
            str_type = newSVpv("HASH", 4);
            break;

        default:
            croak("should not be here");
    }

    EXTEND(SP, 2);
    PUSHs(sv_2mortal(str_type));
    PUSHs(sv_2mortal(newSVuv(length)));
#line 611 "Iterator.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sereal__Path__Iterator_array_goto); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_array_goto)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "iter, idx");
    {
	srl_iterator_t *	iter;
	IV	idx = (IV)SvIV(ST(1))
;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::array_goto() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 160 "Iterator.xs"
    srl_iterator_array_goto(aTHX_ iter, idx);
#line 638 "Iterator.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sereal__Path__Iterator_hash_exists); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_hash_exists)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "iter, name");
    {
	srl_iterator_t *	iter;
	SV *	name = ST(1)
;
	IV	RETVAL;
	dXSTARG;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::hash_exists() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 167 "Iterator.xs"
    RETVAL = srl_iterator_hash_exists_sv(aTHX_ iter, name);
#line 666 "Iterator.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sereal__Path__Iterator_hash_key); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_hash_key)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;
	SV *	RETVAL;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::hash_key() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 174 "Iterator.xs"
    RETVAL = srl_iterator_hash_key_sv(aTHX_ iter);
    SvREFCNT_inc(RETVAL);
#line 693 "Iterator.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sereal__Path__Iterator_decode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sereal__Path__Iterator_decode)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "iter");
    {
	srl_iterator_t *	iter;
	SV *	RETVAL;

	if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) )
		iter = INT2PTR(srl_iterator_t *, SvIV((SV*)SvRV( ST(0) )));
	else{
		warn( "Sereal::Path::Iterator::decode() -- iter is not a blessed SV reference" );
		XSRETURN_UNDEF;
	}
;
#line 182 "Iterator.xs"
    RETVAL = srl_iterator_decode(aTHX_ iter);
    SvREFCNT_inc(RETVAL);
#line 721 "Iterator.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Sereal__Path__Iterator); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Sereal__Path__Iterator)
{
    dVAR; dXSARGS;
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#endif
    XS_VERSION_BOOTCHECK;

        newXS("Sereal::Path::Iterator::new", XS_Sereal__Path__Iterator_new, file);
        newXS("Sereal::Path::Iterator::DESTROY", XS_Sereal__Path__Iterator_DESTROY, file);
        newXS("Sereal::Path::Iterator::set", XS_Sereal__Path__Iterator_set, file);
        newXS("Sereal::Path::Iterator::reset", XS_Sereal__Path__Iterator_reset, file);
        newXS("Sereal::Path::Iterator::eof", XS_Sereal__Path__Iterator_eof, file);
        newXS("Sereal::Path::Iterator::next", XS_Sereal__Path__Iterator_next, file);
        newXS("Sereal::Path::Iterator::step_in", XS_Sereal__Path__Iterator_step_in, file);
        newXS("Sereal::Path::Iterator::step_out", XS_Sereal__Path__Iterator_step_out, file);
        newXS("Sereal::Path::Iterator::srl_next_until_depth_and_idx", XS_Sereal__Path__Iterator_srl_next_until_depth_and_idx, file);
        newXS("Sereal::Path::Iterator::offset", XS_Sereal__Path__Iterator_offset, file);
        newXS("Sereal::Path::Iterator::info", XS_Sereal__Path__Iterator_info, file);
        newXS("Sereal::Path::Iterator::stack_depth", XS_Sereal__Path__Iterator_stack_depth, file);
        newXS("Sereal::Path::Iterator::stack_index", XS_Sereal__Path__Iterator_stack_index, file);
        newXS("Sereal::Path::Iterator::stack_info", XS_Sereal__Path__Iterator_stack_info, file);
        newXS("Sereal::Path::Iterator::array_goto", XS_Sereal__Path__Iterator_array_goto, file);
        newXS("Sereal::Path::Iterator::hash_exists", XS_Sereal__Path__Iterator_hash_exists, file);
        newXS("Sereal::Path::Iterator::hash_key", XS_Sereal__Path__Iterator_hash_key, file);
        newXS("Sereal::Path::Iterator::decode", XS_Sereal__Path__Iterator_decode, file);
#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
  if (PL_unitcheckav)
       call_list(PL_scopestack_ix, PL_unitcheckav);
#endif
    XSRETURN_YES;
}

