/* api.c generated by valac 0.56.17, the Vala compiler
 * generated from api.vala, do not modify */

/* enchant: miscellaneous public APIs
 * Copyright (C) 2003, 2004 Dom Lachowicz
 * Copyright (C) 2016-2024 Reuben Thomas <rrt@sc3d.org>
 *
 * 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 GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along along with this program; if not, see
 * <https://www.gnu.org/licenses/>.
 *
 * In addition, as a special exception, the copyright holders
 * give permission to link the code of this program with
 * non-LGPL Spelling Provider libraries (eg: a MSFT Office
 * spell checker backend) and distribute linked combinations including
 * the two.  You must obey the GNU Lesser General Public License in all
 * respects for all of the code used other than said providers.  If you modify
 * this file, you may extend this exception to your version of the
 * file, but you are not obligated to do so.  If you do not wish to
 * do so, delete this exception statement from your version.
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <relocatable.h>
#include <configmake.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

VALA_EXTERN void enchant_set_prefix_dir (const gchar* new_prefix);
VALA_EXTERN const gchar* enchant_get_version (void);
VALA_EXTERN gchar* enchant_get_user_language (void);
static gssize _vala_array_length (gpointer array);

void
enchant_set_prefix_dir (const gchar* new_prefix)
{
#line 33 "api.vala"
	g_return_if_fail (new_prefix != NULL);
#line 34 "api.vala"
	set_relocation_prefix (INSTALLPREFIX, new_prefix);
#line 70 "api.c"
}

const gchar*
enchant_get_version (void)
{
	const gchar* result;
#line 38 "api.vala"
	result = ENCHANT_VERSION_STRING;
#line 38 "api.vala"
	return result;
#line 81 "api.c"
}

gchar*
enchant_get_user_language (void)
{
	gchar** languages = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint languages_length1;
	gint _languages_size_;
	const gchar* _tmp2_ = NULL;
	gchar** _tmp3_;
	gint _tmp3__length1;
	const gchar* _tmp4_;
	gchar* _tmp7_;
	gchar* result;
#line 43 "api.vala"
	_tmp1_ = _tmp0_ = g_get_language_names ();
#line 43 "api.vala"
	languages = _tmp1_;
#line 43 "api.vala"
	languages_length1 = _vala_array_length (_tmp0_);
#line 43 "api.vala"
	_languages_size_ = languages_length1;
#line 44 "api.vala"
	_tmp3_ = languages;
#line 44 "api.vala"
	_tmp3__length1 = languages_length1;
#line 44 "api.vala"
	_tmp4_ = _tmp3_[0];
#line 44 "api.vala"
	if (g_strcmp0 (_tmp4_, "C") == 0) {
#line 44 "api.vala"
		_tmp2_ = "en";
#line 116 "api.c"
	} else {
		gchar** _tmp5_;
		gint _tmp5__length1;
		const gchar* _tmp6_;
#line 44 "api.vala"
		_tmp5_ = languages;
#line 44 "api.vala"
		_tmp5__length1 = languages_length1;
#line 44 "api.vala"
		_tmp6_ = _tmp5_[0];
#line 44 "api.vala"
		_tmp2_ = _tmp6_;
#line 129 "api.c"
	}
#line 44 "api.vala"
	_tmp7_ = g_strdup (_tmp2_);
#line 44 "api.vala"
	result = _tmp7_;
#line 44 "api.vala"
	return result;
#line 137 "api.c"
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

