summaryrefslogtreecommitdiff
path: root/tests/parser/foreach.c-expected
blob: 5d013475a51da034c2da8d44f96b200405e253b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* parser_foreach.c generated by valac, the Vala compiler
 * generated from parser_foreach.vala, do not modify */

#include <stdlib.h>
#include <string.h>
#include <glib.h>

#define _g_free0(var) (var = (g_free (var), NULL))

static void _vala_main (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static void
_vala_main (void)
{
	gchar** array = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gint array_length1;
	gint _array_size_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp6_;
	gint _tmp6__length1;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar** _tmp9_;
	gint _tmp9__length1;
	_tmp0_ = g_strdup ("foo");
	_tmp1_ = g_strdup ("bar");
	_tmp2_ = g_strdup ("manam");
	_tmp3_ = g_new0 (gchar*, 3 + 1);
	_tmp3_[0] = _tmp0_;
	_tmp3_[1] = _tmp1_;
	_tmp3_[2] = _tmp2_;
	array = _tmp3_;
	array_length1 = 3;
	_array_size_ = array_length1;
	_tmp4_ = array;
	_tmp4__length1 = array_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp4_;
		s_collection_length1 = _tmp4__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp5_;
			gchar* s = NULL;
			_tmp5_ = g_strdup (s_collection[s_it]);
			s = _tmp5_;
			{
				_g_free0 (s);
			}
		}
	}
	_tmp6_ = array;
	_tmp6__length1 = array_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp6_;
		s_collection_length1 = _tmp6__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			const gchar* s = NULL;
			s = s_collection[s_it];
			{
			}
		}
	}
	_tmp7_ = array;
	_tmp7__length1 = array_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp7_;
		s_collection_length1 = _tmp7__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp8_;
			gchar* s = NULL;
			_tmp8_ = g_strdup (s_collection[s_it]);
			s = _tmp8_;
			{
				_g_free0 (s);
			}
		}
	}
	_tmp9_ = array;
	_tmp9__length1 = array_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp9_;
		s_collection_length1 = _tmp9__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			const gchar* s = NULL;
			s = s_collection[s_it];
			{
			}
		}
	}
	array = (_vala_array_free (array, array_length1, (GDestroyNotify) g_free), NULL);
}

int
main (int argc,
      char ** argv)
{
	_vala_main ();
	return 0;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}