/* db-transaction-type.c generated by valac 0.56.19, the Vala compiler
 * generated from db-transaction-type.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include "geary-engine.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

const gchar*
geary_db_transaction_type_sql (GearyDbTransactionType self)
{
	const gchar* result;
	switch (self) {
		case GEARY_DB_TRANSACTION_TYPE_IMMEDIATE:
		{
			result = "BEGIN IMMEDIATE";
			return result;
		}
		case GEARY_DB_TRANSACTION_TYPE_EXCLUSIVE:
		{
			result = "BEGIN EXCLUSIVE";
			return result;
		}
		default:
		case GEARY_DB_TRANSACTION_TYPE_DEFERRED:
		{
			result = "BEGIN DEFERRED";
			return result;
		}
	}
}

gchar*
geary_db_transaction_type_to_string (GearyDbTransactionType self)
{
	gchar* result;
	switch (self) {
		case GEARY_DB_TRANSACTION_TYPE_DEFERRED:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("DEFERRED");
			result = _tmp0_;
			return result;
		}
		case GEARY_DB_TRANSACTION_TYPE_IMMEDIATE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("IMMEDIATE");
			result = _tmp1_;
			return result;
		}
		case GEARY_DB_TRANSACTION_TYPE_EXCLUSIVE:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("EXCLUSIVE");
			result = _tmp2_;
			return result;
		}
		default:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup_printf ("(unknown: %d)", (gint) self);
			result = _tmp3_;
			return result;
		}
	}
}

 G_GNUC_NO_INLINE static GType
geary_db_transaction_type_get_type_once (void)
{
	static const GEnumValue values[] = {{GEARY_DB_TRANSACTION_TYPE_DEFERRED, "GEARY_DB_TRANSACTION_TYPE_DEFERRED", "deferred"}, {GEARY_DB_TRANSACTION_TYPE_IMMEDIATE, "GEARY_DB_TRANSACTION_TYPE_IMMEDIATE", "immediate"}, {GEARY_DB_TRANSACTION_TYPE_EXCLUSIVE, "GEARY_DB_TRANSACTION_TYPE_EXCLUSIVE", "exclusive"}, {GEARY_DB_TRANSACTION_TYPE_RO, "GEARY_DB_TRANSACTION_TYPE_RO", "ro"}, {GEARY_DB_TRANSACTION_TYPE_RW, "GEARY_DB_TRANSACTION_TYPE_RW", "rw"}, {GEARY_DB_TRANSACTION_TYPE_WR, "GEARY_DB_TRANSACTION_TYPE_WR", "wr"}, {GEARY_DB_TRANSACTION_TYPE_WO, "GEARY_DB_TRANSACTION_TYPE_WO", "wo"}, {0, NULL, NULL}};
	GType geary_db_transaction_type_type_id;
	geary_db_transaction_type_type_id = g_enum_register_static ("GearyDbTransactionType", values);
	return geary_db_transaction_type_type_id;
}

GType
geary_db_transaction_type_get_type (void)
{
	static gsize geary_db_transaction_type_type_id__once = 0;
	if (g_once_init_enter (&geary_db_transaction_type_type_id__once)) {
		GType geary_db_transaction_type_type_id;
		geary_db_transaction_type_type_id = geary_db_transaction_type_get_type_once ();
		g_once_init_leave (&geary_db_transaction_type_type_id__once, geary_db_transaction_type_type_id);
	}
	return geary_db_transaction_type_type_id__once;
}

