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

/* valaglibvalue.vala
 *
 * Copyright (C) 2010  Jürg Billeter
 * Copyright (C) 2011  Luca Bruno
 *
 * 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 with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Jürg Billeter <j@bitron.ch>
 * 	Luca Bruno <lucabru@src.gnome.org>
 */

#include "valacodegen.h"
#include <glib-object.h>
#include <vala.h>
#include <valaccode.h>
#include <glib.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.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

#define _vala_ccode_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_node_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_target_value_unref0(var) ((var == NULL) ? NULL : (var = (vala_target_value_unref (var), NULL)))

static gpointer vala_glib_value_parent_class = NULL;

static void vala_glib_value_finalize (ValaTargetValue * obj);
static GType vala_glib_value_get_type_once (void);

static gpointer
_vala_ccode_node_ref0 (gpointer self)
{
	return self ? vala_ccode_node_ref (self) : NULL;
}

ValaGLibValue*
vala_glib_value_construct (GType object_type,
                           ValaDataType* value_type,
                           ValaCCodeExpression* cvalue,
                           gboolean lvalue)
{
	ValaGLibValue* self = NULL;
	ValaCCodeExpression* _tmp0_;
	self = (ValaGLibValue*) vala_target_value_construct (object_type, value_type);
	_tmp0_ = _vala_ccode_node_ref0 (cvalue);
	_vala_ccode_node_unref0 (self->cvalue);
	self->cvalue = _tmp0_;
	self->lvalue = lvalue;
	return self;
}

ValaGLibValue*
vala_glib_value_new (ValaDataType* value_type,
                     ValaCCodeExpression* cvalue,
                     gboolean lvalue)
{
	return vala_glib_value_construct (VALA_TYPE_GLIB_VALUE, value_type, cvalue, lvalue);
}

void
vala_glib_value_append_array_length_cvalue (ValaGLibValue* self,
                                            ValaCCodeExpression* length_cvalue)
{
	ValaList* _tmp0_;
	ValaList* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (length_cvalue != NULL);
	_tmp0_ = self->array_length_cvalues;
	if (_tmp0_ == NULL) {
		GEqualFunc _tmp1_;
		ValaArrayList* _tmp2_;
		_tmp1_ = g_direct_equal;
		_tmp2_ = vala_array_list_new (VALA_TYPE_CCODE_EXPRESSION, (GBoxedCopyFunc) vala_ccode_node_ref, (GDestroyNotify) vala_ccode_node_unref, _tmp1_);
		_vala_iterable_unref0 (self->array_length_cvalues);
		self->array_length_cvalues = (ValaList*) _tmp2_;
	}
	_tmp3_ = self->array_length_cvalues;
	vala_collection_add ((ValaCollection*) _tmp3_, length_cvalue);
}

ValaGLibValue*
vala_glib_value_copy (ValaGLibValue* self)
{
	ValaGLibValue* _result_ = NULL;
	ValaDataType* _tmp0_;
	ValaDataType* _tmp1_;
	ValaDataType* _tmp2_;
	ValaDataType* _tmp3_;
	ValaCCodeExpression* _tmp4_;
	ValaGLibValue* _tmp5_;
	ValaGLibValue* _tmp6_;
	ValaGLibValue* _tmp7_;
	ValaDataType* _tmp8_;
	ValaDataType* _tmp9_;
	ValaGLibValue* _tmp10_;
	ValaGLibValue* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	ValaList* _tmp14_;
	ValaGLibValue* _tmp25_;
	ValaCCodeExpression* _tmp26_;
	ValaCCodeExpression* _tmp27_;
	ValaGLibValue* _tmp28_;
	ValaGLibValue* _tmp29_;
	ValaCCodeExpression* _tmp30_;
	ValaCCodeExpression* _tmp31_;
	ValaGLibValue* _tmp32_;
	ValaCCodeExpression* _tmp33_;
	ValaCCodeExpression* _tmp34_;
	ValaGLibValue* _tmp35_;
	ValaCCodeExpression* _tmp36_;
	ValaCCodeExpression* _tmp37_;
	ValaGLibValue* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = vala_target_value_get_value_type ((ValaTargetValue*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_data_type_copy (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->cvalue;
	_tmp5_ = vala_glib_value_new (_tmp3_, _tmp4_, self->lvalue);
	_tmp6_ = _tmp5_;
	_vala_code_node_unref0 (_tmp3_);
	_result_ = _tmp6_;
	_tmp7_ = _result_;
	_tmp8_ = vala_target_value_get_actual_value_type ((ValaTargetValue*) self);
	_tmp9_ = _tmp8_;
	vala_target_value_set_actual_value_type ((ValaTargetValue*) _tmp7_, _tmp9_);
	_tmp10_ = _result_;
	_tmp10_->non_null = self->non_null;
	_tmp11_ = _result_;
	_tmp12_ = self->ctype;
	_tmp13_ = g_strdup (_tmp12_);
	_g_free0 (_tmp11_->ctype);
	_tmp11_->ctype = _tmp13_;
	_tmp14_ = self->array_length_cvalues;
	if (_tmp14_ != NULL) {
		{
			ValaList* _cexpr_list = NULL;
			ValaList* _tmp15_;
			gint _cexpr_size = 0;
			ValaList* _tmp16_;
			gint _tmp17_;
			gint _tmp18_;
			gint _cexpr_index = 0;
			_tmp15_ = self->array_length_cvalues;
			_cexpr_list = _tmp15_;
			_tmp16_ = _cexpr_list;
			_tmp17_ = vala_collection_get_size ((ValaCollection*) _tmp16_);
			_tmp18_ = _tmp17_;
			_cexpr_size = _tmp18_;
			_cexpr_index = -1;
			while (TRUE) {
				gint _tmp19_;
				gint _tmp20_;
				ValaCCodeExpression* cexpr = NULL;
				ValaList* _tmp21_;
				gpointer _tmp22_;
				ValaGLibValue* _tmp23_;
				ValaCCodeExpression* _tmp24_;
				_cexpr_index = _cexpr_index + 1;
				_tmp19_ = _cexpr_index;
				_tmp20_ = _cexpr_size;
				if (!(_tmp19_ < _tmp20_)) {
					break;
				}
				_tmp21_ = _cexpr_list;
				_tmp22_ = vala_list_get (_tmp21_, _cexpr_index);
				cexpr = (ValaCCodeExpression*) _tmp22_;
				_tmp23_ = _result_;
				_tmp24_ = cexpr;
				vala_glib_value_append_array_length_cvalue (_tmp23_, _tmp24_);
				_vala_ccode_node_unref0 (cexpr);
			}
		}
	}
	_tmp25_ = _result_;
	_tmp26_ = self->array_size_cvalue;
	_tmp27_ = _vala_ccode_node_ref0 (_tmp26_);
	_vala_ccode_node_unref0 (_tmp25_->array_size_cvalue);
	_tmp25_->array_size_cvalue = _tmp27_;
	_tmp28_ = _result_;
	_tmp28_->array_null_terminated = self->array_null_terminated;
	_tmp29_ = _result_;
	_tmp30_ = self->array_length_cexpr;
	_tmp31_ = _vala_ccode_node_ref0 (_tmp30_);
	_vala_ccode_node_unref0 (_tmp29_->array_length_cexpr);
	_tmp29_->array_length_cexpr = _tmp31_;
	_tmp32_ = _result_;
	_tmp33_ = self->delegate_target_cvalue;
	_tmp34_ = _vala_ccode_node_ref0 (_tmp33_);
	_vala_ccode_node_unref0 (_tmp32_->delegate_target_cvalue);
	_tmp32_->delegate_target_cvalue = _tmp34_;
	_tmp35_ = _result_;
	_tmp36_ = self->delegate_target_destroy_notify_cvalue;
	_tmp37_ = _vala_ccode_node_ref0 (_tmp36_);
	_vala_ccode_node_unref0 (_tmp35_->delegate_target_destroy_notify_cvalue);
	_tmp35_->delegate_target_destroy_notify_cvalue = _tmp37_;
	result = _result_;
	return result;
}

static void
vala_glib_value_class_init (ValaGLibValueClass * klass,
                            gpointer klass_data)
{
	vala_glib_value_parent_class = g_type_class_peek_parent (klass);
	((ValaTargetValueClass *) klass)->finalize = vala_glib_value_finalize;
}

static void
vala_glib_value_instance_init (ValaGLibValue * self,
                               gpointer klass)
{
}

static void
vala_glib_value_finalize (ValaTargetValue * obj)
{
	ValaGLibValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_vala_ccode_node_unref0 (self->cvalue);
	_g_free0 (self->ctype);
	_vala_iterable_unref0 (self->array_length_cvalues);
	_vala_ccode_node_unref0 (self->array_size_cvalue);
	_vala_ccode_node_unref0 (self->array_length_cexpr);
	_vala_ccode_node_unref0 (self->delegate_target_cvalue);
	_vala_ccode_node_unref0 (self->delegate_target_destroy_notify_cvalue);
	VALA_TARGET_VALUE_CLASS (vala_glib_value_parent_class)->finalize (obj);
}

static GType
vala_glib_value_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValaGLibValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_glib_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaGLibValue), 0, (GInstanceInitFunc) vala_glib_value_instance_init, NULL };
	GType vala_glib_value_type_id;
	vala_glib_value_type_id = g_type_register_static (VALA_TYPE_TARGET_VALUE, "ValaGLibValue", &g_define_type_info, 0);
	return vala_glib_value_type_id;
}

GType
vala_glib_value_get_type (void)
{
	static volatile gsize vala_glib_value_type_id__once = 0;
	if (g_once_init_enter (&vala_glib_value_type_id__once)) {
		GType vala_glib_value_type_id;
		vala_glib_value_type_id = vala_glib_value_get_type_once ();
		g_once_init_leave (&vala_glib_value_type_id__once, vala_glib_value_type_id);
	}
	return vala_glib_value_type_id__once;
}

ValaCCodeExpression*
vala_get_cvalue (ValaExpression* expr)
{
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaTargetValue* _tmp2_;
	ValaTargetValue* _tmp3_;
	ValaCCodeExpression* _tmp4_;
	ValaCCodeExpression* result;
	g_return_val_if_fail (expr != NULL, NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp2_ = vala_expression_get_target_value (expr);
	_tmp3_ = _tmp2_;
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->cvalue;
	result = _tmp4_;
	return result;
}

ValaCCodeExpression*
vala_get_cvalue_ (ValaTargetValue* value)
{
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* result;
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->cvalue;
	result = _tmp0_;
	return result;
}

void
vala_set_cvalue (ValaExpression* expr,
                 ValaCCodeExpression* cvalue)
{
	ValaGLibValue* glib_value = NULL;
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaGLibValue* _tmp2_;
	ValaGLibValue* _tmp9_;
	ValaCCodeExpression* _tmp10_;
	g_return_if_fail (expr != NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_tmp2_ = glib_value;
	if (_tmp2_ == NULL) {
		ValaDataType* _tmp3_;
		ValaDataType* _tmp4_;
		ValaGLibValue* _tmp5_;
		ValaGLibValue* _tmp6_;
		ValaTargetValue* _tmp7_;
		ValaTargetValue* _tmp8_;
		_tmp3_ = vala_expression_get_value_type (expr);
		_tmp4_ = _tmp3_;
		_tmp5_ = vala_glib_value_new (_tmp4_, NULL, FALSE);
		_tmp6_ = _tmp5_;
		vala_expression_set_target_value (expr, (ValaTargetValue*) _tmp6_);
		_vala_target_value_unref0 (_tmp6_);
		_tmp7_ = vala_expression_get_target_value (expr);
		_tmp8_ = _tmp7_;
		glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	}
	_tmp9_ = glib_value;
	_tmp10_ = _vala_ccode_node_ref0 (cvalue);
	_vala_ccode_node_unref0 (_tmp9_->cvalue);
	_tmp9_->cvalue = _tmp10_;
}

ValaCCodeExpression*
vala_get_array_size_cvalue (ValaTargetValue* value)
{
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* result;
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->array_size_cvalue;
	result = _tmp0_;
	return result;
}

void
vala_set_array_size_cvalue (ValaTargetValue* value,
                            ValaCCodeExpression* cvalue)
{
	ValaCCodeExpression* _tmp0_;
	g_return_if_fail (value != NULL);
	_tmp0_ = _vala_ccode_node_ref0 (cvalue);
	_vala_ccode_node_unref0 (G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->array_size_cvalue);
	G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->array_size_cvalue = _tmp0_;
}

ValaCCodeExpression*
vala_get_delegate_target (ValaExpression* expr)
{
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaTargetValue* _tmp2_;
	ValaTargetValue* _tmp3_;
	ValaCCodeExpression* _tmp4_;
	ValaCCodeExpression* result;
	g_return_val_if_fail (expr != NULL, NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp2_ = vala_expression_get_target_value (expr);
	_tmp3_ = _tmp2_;
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->delegate_target_cvalue;
	result = _tmp4_;
	return result;
}

void
vala_set_delegate_target (ValaExpression* expr,
                          ValaCCodeExpression* delegate_target)
{
	ValaGLibValue* glib_value = NULL;
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaGLibValue* _tmp2_;
	ValaGLibValue* _tmp9_;
	ValaCCodeExpression* _tmp10_;
	g_return_if_fail (expr != NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_tmp2_ = glib_value;
	if (_tmp2_ == NULL) {
		ValaDataType* _tmp3_;
		ValaDataType* _tmp4_;
		ValaGLibValue* _tmp5_;
		ValaGLibValue* _tmp6_;
		ValaTargetValue* _tmp7_;
		ValaTargetValue* _tmp8_;
		_tmp3_ = vala_expression_get_value_type (expr);
		_tmp4_ = _tmp3_;
		_tmp5_ = vala_glib_value_new (_tmp4_, NULL, FALSE);
		_tmp6_ = _tmp5_;
		vala_expression_set_target_value (expr, (ValaTargetValue*) _tmp6_);
		_vala_target_value_unref0 (_tmp6_);
		_tmp7_ = vala_expression_get_target_value (expr);
		_tmp8_ = _tmp7_;
		glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	}
	_tmp9_ = glib_value;
	_tmp10_ = _vala_ccode_node_ref0 (delegate_target);
	_vala_ccode_node_unref0 (_tmp9_->delegate_target_cvalue);
	_tmp9_->delegate_target_cvalue = _tmp10_;
}

ValaCCodeExpression*
vala_get_delegate_target_destroy_notify (ValaExpression* expr)
{
	ValaGLibValue* glib_value = NULL;
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaGLibValue* _tmp2_;
	ValaGLibValue* _tmp3_;
	ValaCCodeExpression* _tmp4_;
	ValaCCodeExpression* result;
	g_return_val_if_fail (expr != NULL, NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_tmp2_ = glib_value;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp3_ = glib_value;
	_tmp4_ = _tmp3_->delegate_target_destroy_notify_cvalue;
	result = _tmp4_;
	return result;
}

void
vala_set_delegate_target_destroy_notify (ValaExpression* expr,
                                         ValaCCodeExpression* destroy_notify)
{
	ValaGLibValue* glib_value = NULL;
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaGLibValue* _tmp2_;
	ValaGLibValue* _tmp9_;
	ValaCCodeExpression* _tmp10_;
	g_return_if_fail (expr != NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_tmp2_ = glib_value;
	if (_tmp2_ == NULL) {
		ValaDataType* _tmp3_;
		ValaDataType* _tmp4_;
		ValaGLibValue* _tmp5_;
		ValaGLibValue* _tmp6_;
		ValaTargetValue* _tmp7_;
		ValaTargetValue* _tmp8_;
		_tmp3_ = vala_expression_get_value_type (expr);
		_tmp4_ = _tmp3_;
		_tmp5_ = vala_glib_value_new (_tmp4_, NULL, FALSE);
		_tmp6_ = _tmp5_;
		vala_expression_set_target_value (expr, (ValaTargetValue*) _tmp6_);
		_vala_target_value_unref0 (_tmp6_);
		_tmp7_ = vala_expression_get_target_value (expr);
		_tmp8_ = _tmp7_;
		glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	}
	_tmp9_ = glib_value;
	_tmp10_ = _vala_ccode_node_ref0 (destroy_notify);
	_vala_ccode_node_unref0 (_tmp9_->delegate_target_destroy_notify_cvalue);
	_tmp9_->delegate_target_destroy_notify_cvalue = _tmp10_;
}

void
vala_append_array_length (ValaExpression* expr,
                          ValaCCodeExpression* size)
{
	ValaGLibValue* glib_value = NULL;
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaGLibValue* _tmp2_;
	ValaGLibValue* _tmp9_;
	g_return_if_fail (expr != NULL);
	g_return_if_fail (size != NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_tmp2_ = glib_value;
	if (_tmp2_ == NULL) {
		ValaDataType* _tmp3_;
		ValaDataType* _tmp4_;
		ValaGLibValue* _tmp5_;
		ValaGLibValue* _tmp6_;
		ValaTargetValue* _tmp7_;
		ValaTargetValue* _tmp8_;
		_tmp3_ = vala_expression_get_value_type (expr);
		_tmp4_ = _tmp3_;
		_tmp5_ = vala_glib_value_new (_tmp4_, NULL, FALSE);
		_tmp6_ = _tmp5_;
		vala_expression_set_target_value (expr, (ValaTargetValue*) _tmp6_);
		_vala_target_value_unref0 (_tmp6_);
		_tmp7_ = vala_expression_get_target_value (expr);
		_tmp8_ = _tmp7_;
		glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	}
	_tmp9_ = glib_value;
	vala_glib_value_append_array_length_cvalue (_tmp9_, size);
}

void
vala_set_array_length (ValaExpression* expr,
                       ValaCCodeExpression* size)
{
	ValaGLibValue* glib_value = NULL;
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaGLibValue* _tmp2_;
	ValaGLibValue* _tmp10_;
	g_return_if_fail (expr != NULL);
	g_return_if_fail (size != NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_tmp2_ = glib_value;
	if (_tmp2_ == NULL) {
		ValaDataType* _tmp3_;
		ValaDataType* _tmp4_;
		ValaGLibValue* _tmp5_;
		ValaGLibValue* _tmp6_;
		ValaTargetValue* _tmp7_;
		ValaTargetValue* _tmp8_;
		_tmp3_ = vala_expression_get_value_type (expr);
		_tmp4_ = _tmp3_;
		_tmp5_ = vala_glib_value_new (_tmp4_, NULL, FALSE);
		_tmp6_ = _tmp5_;
		vala_expression_set_target_value (expr, (ValaTargetValue*) _tmp6_);
		_vala_target_value_unref0 (_tmp6_);
		_tmp7_ = vala_expression_get_target_value (expr);
		_tmp8_ = _tmp7_;
		glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	} else {
		ValaGLibValue* _tmp9_;
		_tmp9_ = glib_value;
		_vala_iterable_unref0 (_tmp9_->array_length_cvalues);
		_tmp9_->array_length_cvalues = NULL;
	}
	_tmp10_ = glib_value;
	vala_glib_value_append_array_length_cvalue (_tmp10_, size);
}

ValaList*
vala_get_array_lengths (ValaExpression* expr)
{
	ValaGLibValue* glib_value = NULL;
	ValaTargetValue* _tmp0_;
	ValaTargetValue* _tmp1_;
	ValaGLibValue* _tmp2_;
	ValaGLibValue* _tmp3_;
	ValaList* _tmp4_;
	ValaList* result;
	g_return_val_if_fail (expr != NULL, NULL);
	_tmp0_ = vala_expression_get_target_value (expr);
	_tmp1_ = _tmp0_;
	glib_value = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_GLIB_VALUE, ValaGLibValue);
	_tmp2_ = glib_value;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp3_ = glib_value;
	_tmp4_ = _tmp3_->array_length_cvalues;
	result = _tmp4_;
	return result;
}

gboolean
vala_get_lvalue (ValaTargetValue* value)
{
	gboolean result;
	g_return_val_if_fail (value != NULL, FALSE);
	result = G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->lvalue;
	return result;
}

gboolean
vala_get_non_null (ValaTargetValue* value)
{
	gboolean result;
	g_return_val_if_fail (value != NULL, FALSE);
	result = G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->non_null;
	return result;
}

const gchar*
vala_get_ctype (ValaTargetValue* value)
{
	const gchar* _tmp0_;
	const gchar* result;
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->ctype;
	result = _tmp0_;
	return result;
}

gboolean
vala_get_array_null_terminated (ValaTargetValue* value)
{
	gboolean result;
	g_return_val_if_fail (value != NULL, FALSE);
	result = G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->array_null_terminated;
	return result;
}

ValaCCodeExpression*
vala_get_array_length_cexpr (ValaTargetValue* value)
{
	ValaCCodeExpression* _tmp0_;
	ValaCCodeExpression* result;
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (value, VALA_TYPE_GLIB_VALUE, ValaGLibValue)->array_length_cexpr;
	result = _tmp0_;
	return result;
}

