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

#line 1 "xs/GConfEngine.xs"
/*
 * Copyright (c) 2005 by Emmanuele Bassi (see the file AUTHORS)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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 GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, see
 * <https://www.gnu.org/licenses/>.
 */

#include "gconfperl.h"

#ifdef GCONFPERL_TYPE_ENGINE
GType
gconfperl_gconf_engine_get_type (void)
{
	static GType t = 0;
	if (! t) {
		t = g_boxed_type_register_static ("GConfEngine",
						  (GBoxedCopyFunc) gconf_engine_ref,
						  (GBoxedFreeFunc) gconf_engine_unref);
	}
	return t;
}
#endif /* GCONFPERL_TYPE_ENGINE */

static GPerlCallback *
gconfperl_engine_notify_func_create (SV * func, SV * data)
{
	GType param_types [] = {
		GCONF_TYPE_ENGINE,
		G_TYPE_INT,
		GPERL_TYPE_SV,
	};
	return gperl_callback_new (func, data,
			           G_N_ELEMENTS (param_types),
				   param_types, 0);
}

static void
gconfperl_engine_notify_func (GConfEngine *engine,
		              guint cnxn_id,
			      GConfEntry *entry,
			      gpointer data)
{
	gperl_callback_invoke ((GPerlCallback*)data, NULL,
			       engine,
			       cnxn_id,
			       newSVGConfEntry (entry));
}


#line 71 "xs/GConfEngine.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 215 "xs/GConfEngine.c"

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

	RETVAL = gconf_engine_get_default(/* void */);
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGConfEngine (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_get_for_address); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_get_for_address)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, address");
    {
	const gchar *	address;
#line 112 "xs/GConfEngine.xs"
        GError *err = NULL;
#line 248 "xs/GConfEngine.c"
	GConfEngine_ornull *	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	address = (const gchar *)SvPV_nolen (ST(1))
;
#line 114 "xs/GConfEngine.xs"
        RETVAL = gconf_engine_get_for_address (address, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 259 "xs/GConfEngine.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGConfEngine_ornull (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#if GCONF_CHECK_VERSION (2, 7, 1)
#define XSubPPtmpAAAA 1


XS_EUPXS(XS_Gnome2__GConf__Engine_get_for_addresses); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_get_for_addresses)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "class, ...");
    {
#line 128 "xs/GConfEngine.xs"
    	GSList *addresses = NULL;
	int i;
    	GError *err = NULL;
#line 285 "xs/GConfEngine.c"
	GConfEngine_ornull *	RETVAL;
#line 132 "xs/GConfEngine.xs"
    	for (i = 1; i < items; i++)
		addresses = g_slist_append (addresses, SvPV_nolen (ST (i)));
	RETVAL = gconf_engine_get_for_addresses (addresses, &err);
	g_slist_free (addresses); /* the contents are handled by Perl */	
	if (err)
		gperl_croak_gerror (NULL, err);
#line 294 "xs/GConfEngine.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGConfEngine_ornull (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif /* GCONF_CHECK_VERSION (2, 7, 1) */

XS_EUPXS(XS_Gnome2__GConf__Engine_get); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_get)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, key");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	key;
#line 168 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 319 "xs/GConfEngine.c"
	GConfValue *	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	key = (const gchar *)SvPV_nolen (ST(1))
;
#line 170 "xs/GConfEngine.xs"
    	RETVAL = gconf_engine_get (engine, key, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 330 "xs/GConfEngine.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGConfValue (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_get_without_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_get_without_default)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, key");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	key;
#line 185 "xs/GConfEngine.xs"
        GError *err = NULL;
#line 354 "xs/GConfEngine.c"
	GConfValue *	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	key = (const gchar *)SvPV_nolen (ST(1))
;
#line 187 "xs/GConfEngine.xs"
    	RETVAL = gconf_engine_get_without_default (engine, key, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 365 "xs/GConfEngine.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_get_with_locale); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_get_with_locale)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "engine, key, locale");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	key;
	const gchar *	locale;
#line 208 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 384 "xs/GConfEngine.c"
	GConfValue *	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	key = (const gchar *)SvPV_nolen (ST(1))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(2));
	locale = (const gchar *)SvPV_nolen (ST(2))
;
#line 210 "xs/GConfEngine.xs"
    	RETVAL = gconf_engine_get_with_locale (engine, key, locale, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 400 "xs/GConfEngine.c"
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_set); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_set)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "engine, key, value");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	key;
	GConfValue *	value = SvGConfValue (ST(2))
;
#line 225 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 420 "xs/GConfEngine.c"
	gboolean	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	key = (const gchar *)SvPV_nolen (ST(1))
;
#line 227 "xs/GConfEngine.xs"
    	RETVAL = gconf_engine_set (engine, key, value, &err);
	gconf_value_free (value); /* leaks otherwise */
	if (err)
		gperl_croak_gerror (NULL, err);
#line 432 "xs/GConfEngine.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_unset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_unset)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, key");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	key;
#line 244 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 451 "xs/GConfEngine.c"
	gboolean	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	key = (const gchar *)SvPV_nolen (ST(1))
;
#line 246 "xs/GConfEngine.xs"
    	RETVAL = gconf_engine_unset (engine, key, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 462 "xs/GConfEngine.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_associate_schema); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_associate_schema)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "engine, key, schema_key");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	key;
	const gchar *	schema_key;
#line 264 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 482 "xs/GConfEngine.c"
	gboolean	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	key = (const gchar *)SvPV_nolen (ST(1))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(2));
	schema_key = (const gchar *)SvPV_nolen (ST(2))
;
#line 266 "xs/GConfEngine.xs"
    	RETVAL = gconf_engine_associate_schema (engine, key, schema_key, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 498 "xs/GConfEngine.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_all_entries); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_all_entries)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, dir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	dir;
#line 280 "xs/GConfEngine.xs"
     	GError * err = NULL;
	GSList * l, * tmp;
#line 520 "xs/GConfEngine.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	dir = (const gchar *)SvPV_nolen (ST(1))
;
#line 283 "xs/GConfEngine.xs"
     	l = gconf_engine_all_entries (engine, dir, &err);

	if (err)
		gperl_croak_gerror (NULL, err);
	for (tmp = l; tmp != NULL; tmp = tmp->next) 
		XPUSHs (sv_2mortal (newSVGChar (gconf_entry_get_key(tmp->data))));
	g_slist_free (l);
#line 534 "xs/GConfEngine.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__GConf__Engine_all_dirs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_all_dirs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, dir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	dir;
#line 299 "xs/GConfEngine.xs"
     	GError * err = NULL;
	GSList * l, * tmp;
#line 556 "xs/GConfEngine.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	dir = (const gchar *)SvPV_nolen (ST(1))
;
#line 302 "xs/GConfEngine.xs"
     	l = gconf_engine_all_dirs (engine, dir, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
	for (tmp = l; tmp != NULL; tmp = tmp->next)
		XPUSHs (sv_2mortal (newSVGChar (tmp->data)));
	g_slist_free (l);
#line 569 "xs/GConfEngine.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__GConf__Engine_suggest_sync); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_suggest_sync)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "engine");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
#line 315 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 587 "xs/GConfEngine.c"
#line 317 "xs/GConfEngine.xs"
    	gconf_engine_suggest_sync (engine, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 592 "xs/GConfEngine.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__GConf__Engine_dir_exists); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_dir_exists)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, dir");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	dir;
#line 329 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 610 "xs/GConfEngine.c"
	gboolean	RETVAL;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	dir = (const gchar *)SvPV_nolen (ST(1))
;
#line 331 "xs/GConfEngine.xs"
    	RETVAL = gconf_engine_dir_exists (engine, dir, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 621 "xs/GConfEngine.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_remove_dir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_remove_dir)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, dir");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	dir;
#line 346 "xs/GConfEngine.xs"
    	GError *err = NULL;
#line 640 "xs/GConfEngine.c"

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	dir = (const gchar *)SvPV_nolen (ST(1))
;
#line 348 "xs/GConfEngine.xs"
    	gconf_engine_remove_dir (engine, dir, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 650 "xs/GConfEngine.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__GConf__Engine_notify_add); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_notify_add)
{
    dVAR; dXSARGS;
    if (items < 3 || items > 4)
       croak_xs_usage(cv,  "engine, namespace_section, func, data=NULL");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	const gchar *	namespace_section;
	SV *	func = ST(2)
;
	SV *	data;
#line 359 "xs/GConfEngine.xs"
     	GPerlCallback * callback;
	GError * err = NULL;
	guint cnxn_id = 0;
#line 673 "xs/GConfEngine.c"
	guint	RETVAL;
	dXSTARG;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	namespace_section = (const gchar *)SvPV_nolen (ST(1))
;

	if (items < 4)
	    data = NULL;
	else {
	    data = ST(3)
;
	}
#line 363 "xs/GConfEngine.xs"
     	callback = gconfperl_engine_notify_func_create (func, data);
	cnxn_id = gconf_engine_notify_add (engine, namespace_section,
					   gconfperl_engine_notify_func,
					   callback,
					   &err);
	if (err)
		gperl_croak_gerror (NULL, err);
	RETVAL = cnxn_id;
#line 697 "xs/GConfEngine.c"
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_notify_remove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_notify_remove)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, cnxn_id");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	guint	cnxn_id = (guint)SvUV(ST(1))
;

	gconf_engine_notify_remove(engine, cnxn_id);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Gnome2__GConf__Engine_commit_change_set); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_commit_change_set)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "engine, cs, remove_committed");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	GConfChangeSet *	cs = SvGConfChangeSet (ST(1))
;
	gboolean	remove_committed = (bool)SvTRUE(ST(2))
;
#line 400 "xs/GConfEngine.xs"
	GError * err = NULL;
	gboolean res;
#line 740 "xs/GConfEngine.c"
#line 403 "xs/GConfEngine.xs"
	res = gconf_engine_commit_change_set (engine, cs, remove_committed, &err);
	if (err) {
		gperl_croak_gerror (NULL, err);
	}
	if ((GIMME_V != G_ARRAY) || (! remove_committed)) {
		/* push on the stack the returned boolean value if the user
		 * wants only that, or if the user does not want to remove
		 * the successfully committed keys. */
		XPUSHs (sv_2mortal (newSViv (res)));
		gconf_change_set_unref (cs);
	}
	else {
		/* push on the stack the returned value AND the reduced set. */
		XPUSHs (sv_2mortal (newSViv (res)));
		XPUSHs (sv_2mortal (newSVGConfChangeSet (cs)));
	}
#line 758 "xs/GConfEngine.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Gnome2__GConf__Engine_reverse_change_set); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_reverse_change_set)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "engine, cs");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
	GConfChangeSet *	cs = SvGConfChangeSet (ST(1))
;
#line 428 "xs/GConfEngine.xs"
     	GError * err = NULL;
#line 778 "xs/GConfEngine.c"
	GConfChangeSet *	RETVAL;
#line 430 "xs/GConfEngine.xs"
     	RETVAL = gconf_engine_reverse_change_set (engine, cs, &err);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 784 "xs/GConfEngine.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGConfChangeSet (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Gnome2__GConf__Engine_change_set_from_current); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Gnome2__GConf__Engine_change_set_from_current)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "engine, key, ...");
    {
	GConfEngine *	engine = SvGConfEngine (ST(0))
;
#line 449 "xs/GConfEngine.xs"
     	char ** keys;
	int i;
	GError * err = NULL;
#line 809 "xs/GConfEngine.c"
	GConfChangeSet *	RETVAL;
#line 453 "xs/GConfEngine.xs"
    	keys = g_new0 (char *, items - 1);
	for (i = 1; i < items; i++)
		keys[i-1] = SvPV_nolen (ST (i));
	RETVAL = gconf_engine_change_set_from_currentv (engine, (const gchar **) keys, &err);
	g_free(keys);
	if (err)
		gperl_croak_gerror (NULL, err);
#line 819 "xs/GConfEngine.c"
	{
	    SV * RETVALSV;
	    RETVALSV = newSVGConfChangeSet (RETVAL);
	    RETVALSV = sv_2mortal(RETVALSV);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Gnome2__GConf__Engine); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Gnome2__GConf__Engine)
{
#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

        newXS_deffile("Gnome2::GConf::Engine::get_default", XS_Gnome2__GConf__Engine_get_default);
        newXS_deffile("Gnome2::GConf::Engine::get_for_address", XS_Gnome2__GConf__Engine_get_for_address);
#if XSubPPtmpAAAA
        newXS_deffile("Gnome2::GConf::Engine::get_for_addresses", XS_Gnome2__GConf__Engine_get_for_addresses);
#endif
        newXS_deffile("Gnome2::GConf::Engine::get", XS_Gnome2__GConf__Engine_get);
        newXS_deffile("Gnome2::GConf::Engine::get_without_default", XS_Gnome2__GConf__Engine_get_without_default);
        newXS_deffile("Gnome2::GConf::Engine::get_with_locale", XS_Gnome2__GConf__Engine_get_with_locale);
        newXS_deffile("Gnome2::GConf::Engine::set", XS_Gnome2__GConf__Engine_set);
        newXS_deffile("Gnome2::GConf::Engine::unset", XS_Gnome2__GConf__Engine_unset);
        newXS_deffile("Gnome2::GConf::Engine::associate_schema", XS_Gnome2__GConf__Engine_associate_schema);
        newXS_deffile("Gnome2::GConf::Engine::all_entries", XS_Gnome2__GConf__Engine_all_entries);
        newXS_deffile("Gnome2::GConf::Engine::all_dirs", XS_Gnome2__GConf__Engine_all_dirs);
        newXS_deffile("Gnome2::GConf::Engine::suggest_sync", XS_Gnome2__GConf__Engine_suggest_sync);
        newXS_deffile("Gnome2::GConf::Engine::dir_exists", XS_Gnome2__GConf__Engine_dir_exists);
        newXS_deffile("Gnome2::GConf::Engine::remove_dir", XS_Gnome2__GConf__Engine_remove_dir);
        newXS_deffile("Gnome2::GConf::Engine::notify_add", XS_Gnome2__GConf__Engine_notify_add);
        newXS_deffile("Gnome2::GConf::Engine::notify_remove", XS_Gnome2__GConf__Engine_notify_remove);
        newXS_deffile("Gnome2::GConf::Engine::commit_change_set", XS_Gnome2__GConf__Engine_commit_change_set);
        newXS_deffile("Gnome2::GConf::Engine::reverse_change_set", XS_Gnome2__GConf__Engine_reverse_change_set);
        newXS_deffile("Gnome2::GConf::Engine::change_set_from_current", XS_Gnome2__GConf__Engine_change_set_from_current);

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#line 884 "xs/GConfEngine.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
}

