/* db-transaction-outcome.c generated by valac 0.56.3, the Vala compiler
 * generated from db-transaction-outcome.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>

const gchar*
geary_db_transaction_outcome_sql (GearyDbTransactionOutcome self)
{
	const gchar* result;
	switch (self) {
		case GEARY_DB_TRANSACTION_OUTCOME_COMMIT:
		{
			result = "COMMIT TRANSACTION";
			return result;
		}
		default:
		case GEARY_DB_TRANSACTION_OUTCOME_ROLLBACK:
		{
			result = "ROLLBACK TRANSACTION";
			return result;
		}
	}
}

gchar*
geary_db_transaction_outcome_to_string (GearyDbTransactionOutcome self)
{
	gchar* result;
	switch (self) {
		case GEARY_DB_TRANSACTION_OUTCOME_ROLLBACK:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("rollback");
			result = _tmp0_;
			return result;
		}
		case GEARY_DB_TRANSACTION_OUTCOME_COMMIT:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("commit");
			result = _tmp1_;
			return result;
		}
		default:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup_printf ("(unknown: %d)", (gint) self);
			result = _tmp2_;
			return result;
		}
	}
}

 G_GNUC_NO_INLINE static GType
geary_db_transaction_outcome_get_type_once (void)
{
	static const GEnumValue values[] = {{GEARY_DB_TRANSACTION_OUTCOME_ROLLBACK, "GEARY_DB_TRANSACTION_OUTCOME_ROLLBACK", "rollback"}, {GEARY_DB_TRANSACTION_OUTCOME_COMMIT, "GEARY_DB_TRANSACTION_OUTCOME_COMMIT", "commit"}, {GEARY_DB_TRANSACTION_OUTCOME_SUCCESS, "GEARY_DB_TRANSACTION_OUTCOME_SUCCESS", "success"}, {GEARY_DB_TRANSACTION_OUTCOME_FAILURE, "GEARY_DB_TRANSACTION_OUTCOME_FAILURE", "failure"}, {GEARY_DB_TRANSACTION_OUTCOME_DONE, "GEARY_DB_TRANSACTION_OUTCOME_DONE", "done"}, {0, NULL, NULL}};
	GType geary_db_transaction_outcome_type_id;
	geary_db_transaction_outcome_type_id = g_enum_register_static ("GearyDbTransactionOutcome", values);
	return geary_db_transaction_outcome_type_id;
}

GType
geary_db_transaction_outcome_get_type (void)
{
	static gsize geary_db_transaction_outcome_type_id__once = 0;
	if (g_once_init_enter (&geary_db_transaction_outcome_type_id__once)) {
		GType geary_db_transaction_outcome_type_id;
		geary_db_transaction_outcome_type_id = geary_db_transaction_outcome_get_type_once ();
		g_once_init_leave (&geary_db_transaction_outcome_type_id__once, geary_db_transaction_outcome_type_id);
	}
	return geary_db_transaction_outcome_type_id__once;
}

