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

#line 1 "xs/GnomeConfig.xs"
/*
 * Copyright (C) 2003, 2013 by the gtk2-perl team (see the file AUTHORS)
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library 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 LICENSE file in the top level of this distribution
 * for the complete license terms.
 *
 */

#include "gnome2perl.h"

/* ------------------------------------------------------------------------- */

static void *
SvGnomeConfigIterator (SV *object)
{
	MAGIC *mg;

	if (!object || !SvOK (object) || !SvROK (object) || !(mg = mg_find (SvRV (object), PERL_MAGIC_ext)))
		return NULL;

	return (void *) mg->mg_ptr;
}

static SV *
newSVGnomeConfigIterator (const char *app_id)
{
	SV *object = (SV *) newHV ();

	sv_magic (object, 0, PERL_MAGIC_ext, (const char *) app_id, 0);

	return sv_bless (newRV_noinc (object),
	                 gv_stashpv ("Gnome2::Config::Iterator", 1));
}

/* ------------------------------------------------------------------------- */

#line 56 "xs/GnomeConfig.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 200 "xs/GnomeConfig.c"

XS_EUPXS(XS_Gnome2__Config_get_string); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_string)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	char *	RETVAL;
	dXSTARG;
#line 56 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: RETVAL = gnome_config_get_string (path); break;
		case 1: RETVAL = gnome_config_get_translated_string (path); break;
		case 2: RETVAL = gnome_config_private_get_string (path); break;
		case 3: RETVAL = gnome_config_private_get_translated_string (path); break;
		default: RETVAL = NULL;
	}
#line 222 "xs/GnomeConfig.c"
	sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
#line 66 "xs/GnomeConfig.xs"
	g_free (RETVAL);
#line 226 "xs/GnomeConfig.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config_get_string_with_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_string_with_default)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 81 "xs/GnomeConfig.xs"
	char *retval = NULL;
	gboolean def;
#line 247 "xs/GnomeConfig.c"
#line 84 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: retval = gnome_config_get_string_with_default (path, &def); break;
		case 1: retval = gnome_config_get_translated_string_with_default (path, &def); break;
		case 2: retval = gnome_config_private_get_string_with_default (path, &def); break;
		case 3: retval = gnome_config_private_get_translated_string_with_default (path, &def); break;
	}

	EXTEND (sp, 1);
	PUSHs (sv_2mortal (newSVuv (def)));
	if (retval != NULL)
		XPUSHs (sv_2mortal (newSVpv (retval, 0)));

	g_free (retval);
#line 262 "xs/GnomeConfig.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__Config_get_int); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_int)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	int	RETVAL;
	dXSTARG;
#line 104 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: RETVAL = gnome_config_get_int (path); break;
		case 1: RETVAL = gnome_config_private_get_int (path); break;
		default: RETVAL = 0;
	}
#line 287 "xs/GnomeConfig.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config_get_int_with_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_int_with_default)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 123 "xs/GnomeConfig.xs"
	int retval = 0;
	gboolean def;
#line 309 "xs/GnomeConfig.c"
#line 126 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: retval = gnome_config_get_int_with_default (path, &def); break;
		case 1: retval = gnome_config_private_get_int_with_default (path, &def); break;
	}

	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVuv (def)));
	PUSHs (sv_2mortal (newSViv (retval)));
#line 319 "xs/GnomeConfig.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__Config_get_float); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_float)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	gdouble	RETVAL;
	dXSTARG;
#line 141 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: RETVAL = gnome_config_get_float (path); break;
		case 1: RETVAL = gnome_config_private_get_float (path); break;
		default: RETVAL = 0.0;
	}
#line 344 "xs/GnomeConfig.c"
	XSprePUSH; PUSHn((double)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config_get_float_with_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_float_with_default)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 160 "xs/GnomeConfig.xs"
	gdouble retval = 0.0;
	gboolean def;
#line 366 "xs/GnomeConfig.c"
#line 163 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: retval = gnome_config_get_float_with_default (path, &def); break;
		case 1: retval = gnome_config_private_get_float_with_default (path, &def); break;
	}

	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVuv (def)));
	PUSHs (sv_2mortal (newSVnv (retval)));
#line 376 "xs/GnomeConfig.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__Config_get_bool); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_bool)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	gboolean	RETVAL;
#line 178 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: RETVAL = gnome_config_get_bool (path); break;
		case 1: RETVAL = gnome_config_private_get_bool (path); break;
		default: RETVAL = FALSE;
	}
#line 400 "xs/GnomeConfig.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config_get_bool_with_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_bool_with_default)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 197 "xs/GnomeConfig.xs"
	gboolean retval = FALSE;
	gboolean def = FALSE;
#line 422 "xs/GnomeConfig.c"
#line 200 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: retval = gnome_config_get_bool_with_default (path, &def); break;
		case 1: retval = gnome_config_private_get_bool_with_default (path, &def); break;
	}

	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVuv (def)));
	PUSHs (sv_2mortal (newSVuv (retval)));
#line 432 "xs/GnomeConfig.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__Config_get_vector); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_vector)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 215 "xs/GnomeConfig.xs"
	char **argv = NULL;
	int argc, i;
	AV *array = newAV ();
#line 453 "xs/GnomeConfig.c"
	SV *	RETVAL;
#line 219 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: gnome_config_get_vector (path, &argc, &argv); break;
		case 1: gnome_config_private_get_vector (path, &argc, &argv); break;
	}

	if (argv != NULL) {
		for (i = 0; i < argc; i++)
			av_push (array, newSVpv (argv[i], 0));

		g_free (argv);
	}

	RETVAL = newRV_noinc ((SV *) array);
#line 469 "xs/GnomeConfig.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config_get_vector_with_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_vector_with_default)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 246 "xs/GnomeConfig.xs"
	gboolean def;
	char **argv = NULL;
	int argc, i;
	AV *array = newAV ();
#line 494 "xs/GnomeConfig.c"
#line 251 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: gnome_config_get_vector_with_default (path, &argc, &argv, &def); break;
		case 1: gnome_config_private_get_vector_with_default (path, &argc, &argv, &def); break;
	}

	if (argv != NULL) {
		for (i = 0; i < argc; i++)
			av_push (array, newSVpv (argv[i], 0));

		g_free (argv);
	}

	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVuv (def)));
	PUSHs (sv_2mortal (newRV_noinc ((SV *) array)));
#line 511 "xs/GnomeConfig.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__Config_set_string); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_set_string)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "class, path, value");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	const char *	value = (const char *)SvPV_nolen(ST(2))
;
#line 278 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: gnome_config_set_string (path, value); break;
		case 1: gnome_config_set_translated_string (path, value); break;
		case 2: gnome_config_private_set_string (path, value); break;
		case 3: gnome_config_private_set_translated_string (path, value); break;
	}
#line 537 "xs/GnomeConfig.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_set_int); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_set_int)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "class, path, value");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	int	value = (int)SvIV(ST(2))
;
#line 292 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: gnome_config_set_int (path, value); break;
		case 1: gnome_config_private_set_int (path, value); break;
	}
#line 560 "xs/GnomeConfig.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_set_float); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_set_float)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "class, path, value");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	gdouble	value = (double)SvNV(ST(2))
;
#line 304 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: gnome_config_set_float (path, value); break;
		case 1: gnome_config_private_set_float (path, value); break;
	}
#line 583 "xs/GnomeConfig.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_set_bool); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_set_bool)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "class, path, value");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	gboolean	value = (bool)SvTRUE(ST(2))
;
#line 316 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: gnome_config_set_bool (path, value); break;
		case 1: gnome_config_private_set_bool (path, value); break;
	}
#line 606 "xs/GnomeConfig.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_set_vector); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_set_vector)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "class, path, value");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	SV *	value = ST(2)
;
#line 328 "xs/GnomeConfig.xs"
	char **argv;
	int length, i;
	AV *array;
	SV **string;
#line 629 "xs/GnomeConfig.c"
#line 333 "xs/GnomeConfig.xs"
	if (! (SvOK (value) && SvROK (value) && SvTYPE (SvRV (value)) == SVt_PVAV))
		croak ("the vector parameter must be a reference to an array");

	array = (AV *) SvRV (value);
	length = av_len (array);

	argv = g_new0 (char *, length + 1);

	for (i = 0; i <= length; i++) {
		string = av_fetch (array, i, 0);
		if (string)
			argv[i] = SvPV_nolen (*string);
	}

	switch (ix) {
		case 0: gnome_config_set_vector (path, length + 1, (const char **) argv); break;
		case 1: gnome_config_private_set_vector (path, length + 1, (const char **) argv); break;
	}
#line 649 "xs/GnomeConfig.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_has_section); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_has_section)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
	gboolean	RETVAL;
#line 362 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: RETVAL = gnome_config_has_section (path); break;
		case 1: RETVAL = gnome_config_private_has_section (path); break;
		case 2: RETVAL = gnome_config_sync_file ((char *) path); break;
		case 3: RETVAL = gnome_config_private_sync_file ((char *) path); break;
		default: RETVAL = FALSE;
	}
#line 674 "xs/GnomeConfig.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config_drop_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_drop_file)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 384 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: gnome_config_drop_file (path); break;
		case 1: gnome_config_private_drop_file (path); break;
		case 2: gnome_config_clean_file (path); break;
		case 3: gnome_config_private_clean_file (path); break;
		case 4: gnome_config_clean_section (path); break;
		case 5: gnome_config_private_clean_section (path); break;
		case 6: gnome_config_clean_key (path); break;
		case 7: gnome_config_private_clean_key (path); break;
	}
#line 702 "xs/GnomeConfig.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_get_real_path); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_get_real_path)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	gchar *	path;
	gchar *	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	path = (gchar *)SvPV_nolen (ST(1))
;
#line 401 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: RETVAL = gnome_config_get_real_path (path); break;
		case 1: RETVAL = gnome_config_private_get_real_path (path); break;
		default: RETVAL = NULL;
	}
#line 729 "xs/GnomeConfig.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    /* same as newSVGChar(), but not in a function */
	    sv_setpv ((SV*)RETVALSV, RETVAL);
	    SvUTF8_on (RETVALSV);
	    ST(0) = RETVALSV;
	}
#line 409 "xs/GnomeConfig.xs"
	g_free (RETVAL);
#line 740 "xs/GnomeConfig.c"
    }
    XSRETURN(1);
}


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

	gnome_config_drop_all(/* void */);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_sync); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_sync)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "class");
    {
	gboolean	RETVAL;

	RETVAL = gnome_config_sync(/* void */);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config_push_prefix); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_push_prefix)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;

	gnome_config_push_prefix(path);
    }
    XSRETURN_EMPTY;
}


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

	gnome_config_pop_prefix(/* void */);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__Config_init_iterator); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config_init_iterator)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "class, path");
    {
	const char *	path = (const char *)SvPV_nolen(ST(1))
;
#line 446 "xs/GnomeConfig.xs"
	void *pointer = NULL;
#line 818 "xs/GnomeConfig.c"
	SV *	RETVAL;
#line 448 "xs/GnomeConfig.xs"
	switch (ix) {
		case 0: pointer = gnome_config_init_iterator (path); break;
		case 1: pointer = gnome_config_init_iterator_sections (path); break;
		case 2: pointer = gnome_config_private_init_iterator (path); break;
		case 3: pointer = gnome_config_private_init_iterator_sections (path); break;
	}

	if (pointer)
		RETVAL = newSVGnomeConfigIterator (pointer);
	else
		XSRETURN_UNDEF;
#line 832 "xs/GnomeConfig.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__Config__Iterator_next); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config__Iterator_next)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	handle = ST(0)
;
#line 473 "xs/GnomeConfig.xs"
	void *new = NULL, *old = NULL;
	char *key = NULL, *value = NULL;
#line 854 "xs/GnomeConfig.c"
#line 476 "xs/GnomeConfig.xs"
	old = SvGnomeConfigIterator (handle);
	new = gnome_config_iterator_next (old, &key, &value);

	if (new && key && value) {
		EXTEND (sp, 3);

		PUSHs (sv_2mortal (newSVGnomeConfigIterator (new)));
		PUSHs (sv_2mortal (newSVpv (key, 0)));
		PUSHs (sv_2mortal (newSVpv (value, 0)));

		g_free (key);
		g_free (value);
	}
	else
		XSRETURN_EMPTY;
#line 871 "xs/GnomeConfig.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__Config__Iterator_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__Config__Iterator_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "handle");
    {
	SV *	handle = ST(0)
;
#line 496 "xs/GnomeConfig.xs"
	sv_unmagic (SvRV (handle), PERL_MAGIC_ext);
#line 889 "xs/GnomeConfig.c"
    }
    XSRETURN_EMPTY;
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Gnome2__Config); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Gnome2__Config)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    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

        cv = newXS_deffile("Gnome2::Config::Private::get_string", XS_Gnome2__Config_get_string);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Gnome2::Config::Private::get_translated_string", XS_Gnome2__Config_get_string);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Gnome2::Config::get_string", XS_Gnome2__Config_get_string);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::get_translated_string", XS_Gnome2__Config_get_string);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::Private::get_string_with_default", XS_Gnome2__Config_get_string_with_default);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Gnome2::Config::Private::get_translated_string_with_default", XS_Gnome2__Config_get_string_with_default);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Gnome2::Config::get_string_with_default", XS_Gnome2__Config_get_string_with_default);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::get_translated_string_with_default", XS_Gnome2__Config_get_string_with_default);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::Private::get_int", XS_Gnome2__Config_get_int);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_int", XS_Gnome2__Config_get_int);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_int_with_default", XS_Gnome2__Config_get_int_with_default);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_int_with_default", XS_Gnome2__Config_get_int_with_default);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_float", XS_Gnome2__Config_get_float);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_float", XS_Gnome2__Config_get_float);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_float_with_default", XS_Gnome2__Config_get_float_with_default);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_float_with_default", XS_Gnome2__Config_get_float_with_default);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_bool", XS_Gnome2__Config_get_bool);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_bool", XS_Gnome2__Config_get_bool);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_bool_with_default", XS_Gnome2__Config_get_bool_with_default);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_bool_with_default", XS_Gnome2__Config_get_bool_with_default);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_vector", XS_Gnome2__Config_get_vector);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_vector", XS_Gnome2__Config_get_vector);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_vector_with_default", XS_Gnome2__Config_get_vector_with_default);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_vector_with_default", XS_Gnome2__Config_get_vector_with_default);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::set_string", XS_Gnome2__Config_set_string);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Gnome2::Config::Private::set_translated_string", XS_Gnome2__Config_set_string);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Gnome2::Config::set_string", XS_Gnome2__Config_set_string);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::set_translated_string", XS_Gnome2__Config_set_string);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::Private::set_int", XS_Gnome2__Config_set_int);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::set_int", XS_Gnome2__Config_set_int);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::set_float", XS_Gnome2__Config_set_float);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::set_float", XS_Gnome2__Config_set_float);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::set_bool", XS_Gnome2__Config_set_bool);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::set_bool", XS_Gnome2__Config_set_bool);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::set_vector", XS_Gnome2__Config_set_vector);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::set_vector", XS_Gnome2__Config_set_vector);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::has_section", XS_Gnome2__Config_has_section);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::Private::sync_file", XS_Gnome2__Config_has_section);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Gnome2::Config::has_section", XS_Gnome2__Config_has_section);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::sync_file", XS_Gnome2__Config_has_section);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Gnome2::Config::Private::clean_file", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Gnome2::Config::Private::clean_key", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 7;
        cv = newXS_deffile("Gnome2::Config::Private::clean_section", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 5;
        cv = newXS_deffile("Gnome2::Config::Private::drop_file", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::clean_file", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Gnome2::Config::clean_key", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 6;
        cv = newXS_deffile("Gnome2::Config::clean_section", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 4;
        cv = newXS_deffile("Gnome2::Config::drop_file", XS_Gnome2__Config_drop_file);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::Private::get_real_path", XS_Gnome2__Config_get_real_path);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("Gnome2::Config::get_real_path", XS_Gnome2__Config_get_real_path);
        XSANY.any_i32 = 0;
        newXS_deffile("Gnome2::Config::drop_all", XS_Gnome2__Config_drop_all);
        newXS_deffile("Gnome2::Config::sync", XS_Gnome2__Config_sync);
        newXS_deffile("Gnome2::Config::push_prefix", XS_Gnome2__Config_push_prefix);
        newXS_deffile("Gnome2::Config::pop_prefix", XS_Gnome2__Config_pop_prefix);
        cv = newXS_deffile("Gnome2::Config::Private::init_iterator", XS_Gnome2__Config_init_iterator);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("Gnome2::Config::Private::init_iterator_sections", XS_Gnome2__Config_init_iterator);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("Gnome2::Config::init_iterator", XS_Gnome2__Config_init_iterator);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("Gnome2::Config::init_iterator_sections", XS_Gnome2__Config_init_iterator);
        XSANY.any_i32 = 1;
        newXS_deffile("Gnome2::Config::Iterator::next", XS_Gnome2__Config__Iterator_next);
        newXS_deffile("Gnome2::Config::Iterator::DESTROY", XS_Gnome2__Config__Iterator_DESTROY);
#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
}

