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

#line 1 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
#include "perl_xmmsclient.h"

#line 13 "../src/clients/lib/perl/XMMSClientPlaylist.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(const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(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_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
        else
	    Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
	Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#define croak_xs_usage        S_croak_xs_usage

#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) */

#if PERL_VERSION_LE(5, 21, 5)
#  define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
#else
#  define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
#endif

#line 157 "../src/clients/lib/perl/XMMSClientPlaylist.c"

XS_EUPXS(XS_Audio__XMMSClient__Playlist_list_entries); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_list_entries)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_list_entries(p->conn, p->name);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_create)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_create(p->conn, p->name);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_current_pos); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_current_pos)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_current_pos(p->conn, p->name);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_shuffle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_shuffle)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_shuffle(p->conn, p->name);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_sort); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_sort)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "p, properties");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsv_t *	properties = (xmmsv_t *)perl_xmmsclient_pack_stringlist (ST(1));
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_sort(p->conn, p->name, properties);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
#line 136 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		xmmsv_unref (properties);
#line 272 "../src/clients/lib/perl/XMMSClientPlaylist.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_clear); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_clear)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_clear(p->conn, p->name);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_id); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_id)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "p, pos, id");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	int	pos = (int)SvIV(ST(1))
;
	unsigned int	id = (unsigned int)SvUV(ST(2))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_insert_id(p->conn, p->name, pos, id);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_args); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_args)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "p, pos, url, ...");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	int	pos = (int)SvIV(ST(1))
;
	const char *	url = (const char *)SvPV_nolen(ST(2))
;
#line 206 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		int i, nargs;
		const char **args = NULL;
#line 344 "../src/clients/lib/perl/XMMSClientPlaylist.c"
	xmmsc_result_t *	RETVAL;
#line 209 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		nargs = items - 2;
		args = (const char **)malloc (sizeof (char *) * nargs);

		for (i = 0; i < nargs; i++) {
			args[i] = SvPV_nolen (ST (i+2));
		}
#line 353 "../src/clients/lib/perl/XMMSClientPlaylist.c"

	RETVAL = xmmsc_playlist_insert_args(p->conn, p->name, pos, url, nargs, args);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
#line 218 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		free (args);
#line 364 "../src/clients/lib/perl/XMMSClientPlaylist.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_url); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_url)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "p, pos, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	int	pos = (int)SvIV(ST(1))
;
	const char *	url = (const char *)SvPV_nolen(ST(2))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_insert_url(p->conn, p->name, pos, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_encoded); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_encoded)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "p, pos, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	int	pos = (int)SvIV(ST(1))
;
	const char *	url = (const char *)SvPV_nolen(ST(2))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_insert_encoded(p->conn, p->name, pos, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_collection); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_insert_collection)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "p, pos, collection, order");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	int	pos = (int)SvIV(ST(1))
;
	xmmsv_t *	collection = (xmmsv_t *)perl_xmmsclient_get_ptr_from_sv (ST(2), "Audio::XMMSClient::Collection")
;
	xmmsv_t *	order = (xmmsv_t *)perl_xmmsclient_pack_stringlist (ST(3));
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_insert_collection(p->conn, p->name, pos, collection, order);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
#line 294 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		free (order);
#line 449 "../src/clients/lib/perl/XMMSClientPlaylist.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_id); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_id)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "p, id");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	unsigned int	id = (unsigned int)SvUV(ST(1))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_add_id(p->conn, p->name, id);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_args); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_args)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "p, url, ...");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	const char *	url = (const char *)SvPV_nolen(ST(1))
;
#line 340 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		int i, nargs;
		const char **args = NULL;
#line 494 "../src/clients/lib/perl/XMMSClientPlaylist.c"
	xmmsc_result_t *	RETVAL;
#line 343 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		nargs = items - 1;
		args = (const char **)malloc (sizeof (char *) * nargs);

		for (i = 0; i < nargs; i++) {
			args[i] = SvPV_nolen (ST (i+1));
		}
#line 503 "../src/clients/lib/perl/XMMSClientPlaylist.c"

	RETVAL = xmmsc_playlist_add_args(p->conn, p->name, url, nargs, args);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
#line 352 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		free (args);
#line 514 "../src/clients/lib/perl/XMMSClientPlaylist.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_url); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_url)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "p, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	const char *	url = (const char *)SvPV_nolen(ST(1))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_add_url(p->conn, p->name, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_encoded); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_encoded)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "p, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	const char *	url = (const char *)SvPV_nolen(ST(1))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_add_encoded(p->conn, p->name, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_collection); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_add_collection)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "p, collection, order");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsv_t *	collection = (xmmsv_t *)perl_xmmsclient_get_ptr_from_sv (ST(1), "Audio::XMMSClient::Collection")
;
	xmmsv_t *	order = (xmmsv_t *)perl_xmmsclient_pack_stringlist (ST(2));
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_add_collection(p->conn, p->name, collection, order);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
#line 423 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		free (order);
#line 593 "../src/clients/lib/perl/XMMSClientPlaylist.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_move_entry); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_move_entry)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "p, cur_pos, new_pos");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	uint32_t	cur_pos = (uint32_t)SvUV(ST(1))
;
	uint32_t	new_pos = (uint32_t)SvUV(ST(2))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_move_entry(p->conn, p->name, cur_pos, new_pos);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_remove_entry); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_remove_entry)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "p, pos");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	unsigned int	pos = (unsigned int)SvUV(ST(1))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_remove_entry(p->conn, p->name, pos);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_remove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_remove)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_remove(p->conn, p->name);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_load); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_load)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_load(p->conn, p->name);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_radd); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_radd)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "p, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	const char *	url = (const char *)SvPV_nolen(ST(1))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_radd(p->conn, p->name, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_radd_encoded); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_radd_encoded)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "p, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	const char *	url = (const char *)SvPV_nolen(ST(1))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_radd_encoded(p->conn, p->name, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_rinsert); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_rinsert)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "p, pos, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	int	pos = (int)SvIV(ST(1))
;
	const char *	url = (const char *)SvPV_nolen(ST(2))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_rinsert(p->conn, p->name, pos, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_rinsert_encoded); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_rinsert_encoded)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "p, pos, url");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
	int	pos = (int)SvIV(ST(1))
;
	const char *	url = (const char *)SvPV_nolen(ST(2))
;
	xmmsc_result_t *	RETVAL;

	RETVAL = xmmsc_playlist_rinsert_encoded(p->conn, p->name, pos, url);
	{
	    SV * RETVALSV;
	    RETVALSV = perl_xmmsclient_new_sv_from_ptr (RETVAL, "Audio::XMMSClient::Result");
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Audio__XMMSClient__Playlist_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Audio__XMMSClient__Playlist_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "p");
    {
	perl_xmmsclient_playlist_t *	p = (perl_xmmsclient_playlist_t *)perl_xmmsclient_get_ptr_from_sv (ST(0), "Audio::XMMSClient::Playlist")
;
#line 616 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
		perl_xmmsclient_playlist_destroy (p);
#line 812 "../src/clients/lib/perl/XMMSClientPlaylist.c"
    }
    XSRETURN_EMPTY;
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Audio__XMMSClient__Playlist); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Audio__XMMSClient__Playlist)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(file);

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#if PERL_VERSION_LE(5, 21, 5)
    XS_VERSION_BOOTCHECK;
#  ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#  endif
#endif

        newXS_deffile("Audio::XMMSClient::Playlist::list_entries", XS_Audio__XMMSClient__Playlist_list_entries);
        newXS_deffile("Audio::XMMSClient::Playlist::create", XS_Audio__XMMSClient__Playlist_create);
        newXS_deffile("Audio::XMMSClient::Playlist::current_pos", XS_Audio__XMMSClient__Playlist_current_pos);
        newXS_deffile("Audio::XMMSClient::Playlist::shuffle", XS_Audio__XMMSClient__Playlist_shuffle);
        newXS_deffile("Audio::XMMSClient::Playlist::sort", XS_Audio__XMMSClient__Playlist_sort);
        newXS_deffile("Audio::XMMSClient::Playlist::clear", XS_Audio__XMMSClient__Playlist_clear);
        newXS_deffile("Audio::XMMSClient::Playlist::insert_id", XS_Audio__XMMSClient__Playlist_insert_id);
        newXS_deffile("Audio::XMMSClient::Playlist::insert_args", XS_Audio__XMMSClient__Playlist_insert_args);
        newXS_deffile("Audio::XMMSClient::Playlist::insert_url", XS_Audio__XMMSClient__Playlist_insert_url);
        newXS_deffile("Audio::XMMSClient::Playlist::insert_encoded", XS_Audio__XMMSClient__Playlist_insert_encoded);
        newXS_deffile("Audio::XMMSClient::Playlist::insert_collection", XS_Audio__XMMSClient__Playlist_insert_collection);
        newXS_deffile("Audio::XMMSClient::Playlist::add_id", XS_Audio__XMMSClient__Playlist_add_id);
        newXS_deffile("Audio::XMMSClient::Playlist::add_args", XS_Audio__XMMSClient__Playlist_add_args);
        newXS_deffile("Audio::XMMSClient::Playlist::add_url", XS_Audio__XMMSClient__Playlist_add_url);
        newXS_deffile("Audio::XMMSClient::Playlist::add_encoded", XS_Audio__XMMSClient__Playlist_add_encoded);
        newXS_deffile("Audio::XMMSClient::Playlist::add_collection", XS_Audio__XMMSClient__Playlist_add_collection);
        newXS_deffile("Audio::XMMSClient::Playlist::move_entry", XS_Audio__XMMSClient__Playlist_move_entry);
        newXS_deffile("Audio::XMMSClient::Playlist::remove_entry", XS_Audio__XMMSClient__Playlist_remove_entry);
        newXS_deffile("Audio::XMMSClient::Playlist::remove", XS_Audio__XMMSClient__Playlist_remove);
        newXS_deffile("Audio::XMMSClient::Playlist::load", XS_Audio__XMMSClient__Playlist_load);
        newXS_deffile("Audio::XMMSClient::Playlist::radd", XS_Audio__XMMSClient__Playlist_radd);
        newXS_deffile("Audio::XMMSClient::Playlist::radd_encoded", XS_Audio__XMMSClient__Playlist_radd_encoded);
        newXS_deffile("Audio::XMMSClient::Playlist::rinsert", XS_Audio__XMMSClient__Playlist_rinsert);
        newXS_deffile("Audio::XMMSClient::Playlist::rinsert_encoded", XS_Audio__XMMSClient__Playlist_rinsert_encoded);
        newXS_deffile("Audio::XMMSClient::Playlist::DESTROY", XS_Audio__XMMSClient__Playlist_DESTROY);

    /* Initialisation Section */

#line 637 "../src/clients/lib/perl/XMMSClientPlaylist.xs"
	PERL_UNUSED_VAR (items);

#line 876 "../src/clients/lib/perl/XMMSClientPlaylist.c"

    /* End of Initialisation Section */

#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

