1 /* tagletsee.c generated by valac, the Vala compiler
2  * generated from tagletsee.vala, do not modify */
3 
4 /* tagletsee.vala
5  *
6  * Copyright (C) 2008-2009 Didier Villevalois
7  * Copyright (C) 2008-2012 Florian Brosch
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
22  *
23  * Author:
24  * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
25  */
26 
27 #include "valadoc.h"
28 #include <stdlib.h>
29 #include <string.h>
30 #include <glib.h>
31 #include <glib-object.h>
32 
33 enum  {
34 	VALADOC_TAGLETS_SEE_0_PROPERTY,
35 	VALADOC_TAGLETS_SEE_SYMBOL_NAME_PROPERTY,
36 	VALADOC_TAGLETS_SEE_SYMBOL_PROPERTY,
37 	VALADOC_TAGLETS_SEE_NUM_PROPERTIES
38 };
39 static GParamSpec* valadoc_taglets_see_properties[VALADOC_TAGLETS_SEE_NUM_PROPERTIES];
40 #define _g_free0(var) (var = (g_free (var), NULL))
41 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
42 
43 struct _ValadocTagletsSeePrivate {
44 	gchar* _symbol_name;
45 	ValadocApiNode* _symbol;
46 };
47 
48 static gint ValadocTagletsSee_private_offset;
49 static gpointer valadoc_taglets_see_parent_class = NULL;
50 static ValadocContentTagletIface * valadoc_taglets_see_valadoc_content_taglet_parent_iface = NULL;
51 static ValadocContentBlockIface * valadoc_taglets_see_valadoc_content_block_parent_iface = NULL;
52 
53 static void valadoc_taglets_see_set_symbol_name (ValadocTagletsSee* self,
54                                           const gchar* value);
55 static void valadoc_taglets_see_set_symbol (ValadocTagletsSee* self,
56                                      ValadocApiNode* value);
57 static ValadocRule* valadoc_taglets_see_real_get_parser_rule (ValadocContentTaglet* base,
58                                                        ValadocRule* run_rule);
59 static void __lambda128_ (ValadocTagletsSee* self,
60                    ValadocToken* token,
61                    GError** error);
62 static void ___lambda128__valadoc_token_type_action (ValadocToken* token,
63                                               gpointer self,
64                                               GError** error);
65 static void valadoc_taglets_see_real_check (ValadocContentContentElement* base,
66                                      ValadocApiTree* api_root,
67                                      ValadocApiNode* container,
68                                      const gchar* file_path,
69                                      ValadocErrorReporter* reporter,
70                                      ValadocSettings* settings);
71 static void valadoc_taglets_see_real_accept (ValadocContentContentElement* base,
72                                       ValadocContentContentVisitor* visitor);
73 static gboolean valadoc_taglets_see_real_is_empty (ValadocContentContentElement* base);
74 static ValadocContentContentElement* valadoc_taglets_see_real_copy (ValadocContentContentElement* base,
75                                                              ValadocContentContentElement* new_parent);
76 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
77                                                  ValadocContentContentElement* value);
78 static void valadoc_taglets_see_finalize (GObject * obj);
79 static GType valadoc_taglets_see_get_type_once (void);
80 static void _vala_valadoc_taglets_see_get_property (GObject * object,
81                                              guint property_id,
82                                              GValue * value,
83                                              GParamSpec * pspec);
84 static void _vala_valadoc_taglets_see_set_property (GObject * object,
85                                              guint property_id,
86                                              const GValue * value,
87                                              GParamSpec * pspec);
88 static void _vala_array_destroy (gpointer array,
89                           gint array_length,
90                           GDestroyNotify destroy_func);
91 static void _vala_array_free (gpointer array,
92                        gint array_length,
93                        GDestroyNotify destroy_func);
94 
95 static inline gpointer
valadoc_taglets_see_get_instance_private(ValadocTagletsSee * self)96 valadoc_taglets_see_get_instance_private (ValadocTagletsSee* self)
97 {
98 	return G_STRUCT_MEMBER_P (self, ValadocTagletsSee_private_offset);
99 }
100 
101 const gchar*
valadoc_taglets_see_get_symbol_name(ValadocTagletsSee * self)102 valadoc_taglets_see_get_symbol_name (ValadocTagletsSee* self)
103 {
104 	const gchar* result;
105 	const gchar* _tmp0_;
106 	g_return_val_if_fail (self != NULL, NULL);
107 	_tmp0_ = self->priv->_symbol_name;
108 	result = _tmp0_;
109 	return result;
110 }
111 
112 static void
valadoc_taglets_see_set_symbol_name(ValadocTagletsSee * self,const gchar * value)113 valadoc_taglets_see_set_symbol_name (ValadocTagletsSee* self,
114                                      const gchar* value)
115 {
116 	gchar* old_value;
117 	g_return_if_fail (self != NULL);
118 	old_value = valadoc_taglets_see_get_symbol_name (self);
119 	if (g_strcmp0 (value, old_value) != 0) {
120 		gchar* _tmp0_;
121 		_tmp0_ = g_strdup (value);
122 		_g_free0 (self->priv->_symbol_name);
123 		self->priv->_symbol_name = _tmp0_;
124 		g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_see_properties[VALADOC_TAGLETS_SEE_SYMBOL_NAME_PROPERTY]);
125 	}
126 }
127 
128 ValadocApiNode*
valadoc_taglets_see_get_symbol(ValadocTagletsSee * self)129 valadoc_taglets_see_get_symbol (ValadocTagletsSee* self)
130 {
131 	ValadocApiNode* result;
132 	ValadocApiNode* _tmp0_;
133 	g_return_val_if_fail (self != NULL, NULL);
134 	_tmp0_ = self->priv->_symbol;
135 	result = _tmp0_;
136 	return result;
137 }
138 
139 static gpointer
_g_object_ref0(gpointer self)140 _g_object_ref0 (gpointer self)
141 {
142 	return self ? g_object_ref (self) : NULL;
143 }
144 
145 static void
valadoc_taglets_see_set_symbol(ValadocTagletsSee * self,ValadocApiNode * value)146 valadoc_taglets_see_set_symbol (ValadocTagletsSee* self,
147                                 ValadocApiNode* value)
148 {
149 	ValadocApiNode* old_value;
150 	g_return_if_fail (self != NULL);
151 	old_value = valadoc_taglets_see_get_symbol (self);
152 	if (old_value != value) {
153 		ValadocApiNode* _tmp0_;
154 		_tmp0_ = _g_object_ref0 (value);
155 		_g_object_unref0 (self->priv->_symbol);
156 		self->priv->_symbol = _tmp0_;
157 		g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_see_properties[VALADOC_TAGLETS_SEE_SYMBOL_PROPERTY]);
158 	}
159 }
160 
161 static void
__lambda128_(ValadocTagletsSee * self,ValadocToken * token,GError ** error)162 __lambda128_ (ValadocTagletsSee* self,
163               ValadocToken* token,
164               GError** error)
165 {
166 	const gchar* _tmp0_;
167 	g_return_if_fail (token != NULL);
168 	_tmp0_ = valadoc_token_to_string (token);
169 	valadoc_taglets_see_set_symbol_name (self, _tmp0_);
170 }
171 
172 static void
___lambda128__valadoc_token_type_action(ValadocToken * token,gpointer self,GError ** error)173 ___lambda128__valadoc_token_type_action (ValadocToken* token,
174                                          gpointer self,
175                                          GError** error)
176 {
177 	__lambda128_ ((ValadocTagletsSee*) self, token, error);
178 }
179 
180 static ValadocRule*
valadoc_taglets_see_real_get_parser_rule(ValadocContentTaglet * base,ValadocRule * run_rule)181 valadoc_taglets_see_real_get_parser_rule (ValadocContentTaglet* base,
182                                           ValadocRule* run_rule)
183 {
184 	ValadocTagletsSee * self;
185 	ValadocRule* optional_spaces = NULL;
186 	ValadocTokenType* _tmp0_;
187 	GObject* _tmp1_;
188 	GObject** _tmp2_;
189 	GObject** _tmp3_;
190 	gint _tmp3__length1;
191 	ValadocRule* _tmp4_;
192 	GObject** _tmp5_;
193 	GObject** _tmp6_;
194 	gint _tmp6__length1;
195 	ValadocRule* _tmp7_;
196 	ValadocRule* _tmp8_;
197 	GObject* _tmp9_;
198 	ValadocTokenType* _tmp10_;
199 	ValadocTokenType* _tmp11_;
200 	ValadocTokenType* _tmp12_;
201 	GObject* _tmp13_;
202 	GObject** _tmp14_;
203 	GObject** _tmp15_;
204 	gint _tmp15__length1;
205 	ValadocRule* _tmp16_;
206 	ValadocRule* _tmp17_;
207 	ValadocRule* result = NULL;
208 	self = (ValadocTagletsSee*) base;
209 	g_return_val_if_fail (run_rule != NULL, NULL);
210 	_tmp0_ = valadoc_token_type_SPACE;
211 	_tmp1_ = _g_object_ref0 ((GObject*) _tmp0_);
212 	_tmp2_ = g_new0 (GObject*, 1 + 1);
213 	_tmp2_[0] = _tmp1_;
214 	_tmp3_ = _tmp2_;
215 	_tmp3__length1 = 1;
216 	_tmp4_ = valadoc_rule_many (_tmp3_, (gint) 1);
217 	_tmp5_ = g_new0 (GObject*, 1 + 1);
218 	_tmp5_[0] = (GObject*) _tmp4_;
219 	_tmp6_ = _tmp5_;
220 	_tmp6__length1 = 1;
221 	_tmp7_ = valadoc_rule_option (_tmp6_, (gint) 1);
222 	_tmp8_ = _tmp7_;
223 	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_object_unref), NULL);
224 	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
225 	optional_spaces = _tmp8_;
226 	_tmp9_ = _g_object_ref0 ((GObject*) optional_spaces);
227 	_tmp10_ = valadoc_token_type_any_word ();
228 	_tmp11_ = _tmp10_;
229 	_tmp12_ = valadoc_token_type_action (_tmp11_, ___lambda128__valadoc_token_type_action, self);
230 	_tmp13_ = _g_object_ref0 ((GObject*) optional_spaces);
231 	_tmp14_ = g_new0 (GObject*, 3 + 1);
232 	_tmp14_[0] = _tmp9_;
233 	_tmp14_[1] = (GObject*) _tmp12_;
234 	_tmp14_[2] = _tmp13_;
235 	_tmp15_ = _tmp14_;
236 	_tmp15__length1 = 3;
237 	_tmp16_ = valadoc_rule_seq (_tmp15_, (gint) 3);
238 	_tmp17_ = _tmp16_;
239 	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_object_unref), NULL);
240 	_g_object_unref0 (_tmp11_);
241 	result = _tmp17_;
242 	_g_object_unref0 (optional_spaces);
243 	return result;
244 }
245 
246 static glong
string_strnlen(gchar * str,glong maxlen)247 string_strnlen (gchar* str,
248                 glong maxlen)
249 {
250 	gchar* end = NULL;
251 	gchar* _tmp0_;
252 	gchar* _tmp1_;
253 	glong result = 0L;
254 	_tmp0_ = memchr (str, 0, (gsize) maxlen);
255 	end = _tmp0_;
256 	_tmp1_ = end;
257 	if (_tmp1_ == NULL) {
258 		result = maxlen;
259 		return result;
260 	} else {
261 		gchar* _tmp2_;
262 		_tmp2_ = end;
263 		result = (glong) (_tmp2_ - str);
264 		return result;
265 	}
266 }
267 
268 static gchar*
string_substring(const gchar * self,glong offset,glong len)269 string_substring (const gchar* self,
270                   glong offset,
271                   glong len)
272 {
273 	glong string_length = 0L;
274 	gboolean _tmp0_ = FALSE;
275 	gchar* _tmp3_;
276 	gchar* result = NULL;
277 	g_return_val_if_fail (self != NULL, NULL);
278 	if (offset >= ((glong) 0)) {
279 		_tmp0_ = len >= ((glong) 0);
280 	} else {
281 		_tmp0_ = FALSE;
282 	}
283 	if (_tmp0_) {
284 		string_length = string_strnlen ((gchar*) self, offset + len);
285 	} else {
286 		gint _tmp1_;
287 		gint _tmp2_;
288 		_tmp1_ = strlen (self);
289 		_tmp2_ = _tmp1_;
290 		string_length = (glong) _tmp2_;
291 	}
292 	if (offset < ((glong) 0)) {
293 		offset = string_length + offset;
294 		g_return_val_if_fail (offset >= ((glong) 0), NULL);
295 	} else {
296 		g_return_val_if_fail (offset <= string_length, NULL);
297 	}
298 	if (len < ((glong) 0)) {
299 		len = string_length - offset;
300 	}
301 	g_return_val_if_fail ((offset + len) <= string_length, NULL);
302 	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
303 	result = _tmp3_;
304 	return result;
305 }
306 
307 static void
valadoc_taglets_see_real_check(ValadocContentContentElement * base,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)308 valadoc_taglets_see_real_check (ValadocContentContentElement* base,
309                                 ValadocApiTree* api_root,
310                                 ValadocApiNode* container,
311                                 const gchar* file_path,
312                                 ValadocErrorReporter* reporter,
313                                 ValadocSettings* settings)
314 {
315 	ValadocTagletsSee * self;
316 	const gchar* _tmp0_;
317 	ValadocApiNode* _tmp14_;
318 	self = (ValadocTagletsSee*) base;
319 	g_return_if_fail (api_root != NULL);
320 	g_return_if_fail (container != NULL);
321 	g_return_if_fail (file_path != NULL);
322 	g_return_if_fail (reporter != NULL);
323 	g_return_if_fail (settings != NULL);
324 	_tmp0_ = self->priv->_symbol_name;
325 	if (g_str_has_prefix (_tmp0_, "c::")) {
326 		const gchar* _tmp1_;
327 		gchar* _tmp2_;
328 		gchar* _tmp3_;
329 		const gchar* _tmp4_;
330 		ValadocApiNode* _tmp5_;
331 		ValadocApiNode* _tmp6_;
332 		ValadocApiNode* _tmp7_;
333 		_tmp1_ = self->priv->_symbol_name;
334 		_tmp2_ = string_substring (_tmp1_, (glong) 3, (glong) -1);
335 		_tmp3_ = _tmp2_;
336 		valadoc_taglets_see_set_symbol_name (self, _tmp3_);
337 		_g_free0 (_tmp3_);
338 		_tmp4_ = self->priv->_symbol_name;
339 		_tmp5_ = valadoc_api_tree_search_symbol_cstr (api_root, container, _tmp4_);
340 		_tmp6_ = _tmp5_;
341 		valadoc_taglets_see_set_symbol (self, _tmp6_);
342 		_g_object_unref0 (_tmp6_);
343 		_tmp7_ = self->priv->_symbol;
344 		if (_tmp7_ != NULL) {
345 			ValadocApiNode* _tmp8_;
346 			const gchar* _tmp9_;
347 			const gchar* _tmp10_;
348 			_tmp8_ = self->priv->_symbol;
349 			_tmp9_ = valadoc_api_node_get_name (_tmp8_);
350 			_tmp10_ = _tmp9_;
351 			valadoc_taglets_see_set_symbol_name (self, _tmp10_);
352 		}
353 	} else {
354 		const gchar* _tmp11_;
355 		ValadocApiNode* _tmp12_;
356 		ValadocApiNode* _tmp13_;
357 		_tmp11_ = self->priv->_symbol_name;
358 		_tmp12_ = valadoc_api_tree_search_symbol_str (api_root, container, _tmp11_);
359 		_tmp13_ = _tmp12_;
360 		valadoc_taglets_see_set_symbol (self, _tmp13_);
361 		_g_object_unref0 (_tmp13_);
362 	}
363 	_tmp14_ = self->priv->_symbol;
364 	if (_tmp14_ == NULL) {
365 		gchar* _tmp15_;
366 		gchar* _tmp16_;
367 		gchar* _tmp17_;
368 		gchar* _tmp18_;
369 		const gchar* _tmp19_;
370 		_tmp15_ = valadoc_api_node_get_full_name (container);
371 		_tmp16_ = _tmp15_;
372 		_tmp17_ = g_strdup_printf ("%s: %s: @see", file_path, _tmp16_);
373 		_tmp18_ = _tmp17_;
374 		_tmp19_ = self->priv->_symbol_name;
375 		valadoc_error_reporter_simple_warning (reporter, _tmp18_, "`%s' does not exist", _tmp19_);
376 		_g_free0 (_tmp18_);
377 		_g_free0 (_tmp16_);
378 	}
379 }
380 
381 static void
valadoc_taglets_see_real_accept(ValadocContentContentElement * base,ValadocContentContentVisitor * visitor)382 valadoc_taglets_see_real_accept (ValadocContentContentElement* base,
383                                  ValadocContentContentVisitor* visitor)
384 {
385 	ValadocTagletsSee * self;
386 	self = (ValadocTagletsSee*) base;
387 	g_return_if_fail (visitor != NULL);
388 	valadoc_content_content_visitor_visit_taglet (visitor, (ValadocContentTaglet*) self);
389 }
390 
391 static gboolean
valadoc_taglets_see_real_is_empty(ValadocContentContentElement * base)392 valadoc_taglets_see_real_is_empty (ValadocContentContentElement* base)
393 {
394 	ValadocTagletsSee * self;
395 	gboolean result = FALSE;
396 	self = (ValadocTagletsSee*) base;
397 	result = FALSE;
398 	return result;
399 }
400 
401 static ValadocContentContentElement*
valadoc_taglets_see_real_copy(ValadocContentContentElement * base,ValadocContentContentElement * new_parent)402 valadoc_taglets_see_real_copy (ValadocContentContentElement* base,
403                                ValadocContentContentElement* new_parent)
404 {
405 	ValadocTagletsSee * self;
406 	ValadocTagletsSee* see = NULL;
407 	ValadocTagletsSee* _tmp0_;
408 	const gchar* _tmp1_;
409 	ValadocApiNode* _tmp2_;
410 	ValadocContentContentElement* result = NULL;
411 	self = (ValadocTagletsSee*) base;
412 	_tmp0_ = valadoc_taglets_see_new ();
413 	see = _tmp0_;
414 	valadoc_content_content_element_set_parent ((ValadocContentContentElement*) see, new_parent);
415 	_tmp1_ = self->priv->_symbol_name;
416 	valadoc_taglets_see_set_symbol_name (see, _tmp1_);
417 	_tmp2_ = self->priv->_symbol;
418 	valadoc_taglets_see_set_symbol (see, _tmp2_);
419 	result = (ValadocContentContentElement*) see;
420 	return result;
421 }
422 
423 ValadocTagletsSee*
valadoc_taglets_see_construct(GType object_type)424 valadoc_taglets_see_construct (GType object_type)
425 {
426 	ValadocTagletsSee * self = NULL;
427 	self = (ValadocTagletsSee*) valadoc_content_content_element_construct (object_type);
428 	return self;
429 }
430 
431 ValadocTagletsSee*
valadoc_taglets_see_new(void)432 valadoc_taglets_see_new (void)
433 {
434 	return valadoc_taglets_see_construct (VALADOC_TAGLETS_TYPE_SEE);
435 }
436 
437 static void
valadoc_taglets_see_class_init(ValadocTagletsSeeClass * klass,gpointer klass_data)438 valadoc_taglets_see_class_init (ValadocTagletsSeeClass * klass,
439                                 gpointer klass_data)
440 {
441 	valadoc_taglets_see_parent_class = g_type_class_peek_parent (klass);
442 	g_type_class_adjust_private_offset (klass, &ValadocTagletsSee_private_offset);
443 	((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_taglets_see_real_check;
444 	((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_taglets_see_real_accept;
445 	((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement*)) valadoc_taglets_see_real_is_empty;
446 	((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_taglets_see_real_copy;
447 	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_taglets_see_get_property;
448 	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_taglets_see_set_property;
449 	G_OBJECT_CLASS (klass)->finalize = valadoc_taglets_see_finalize;
450 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_SEE_SYMBOL_NAME_PROPERTY, valadoc_taglets_see_properties[VALADOC_TAGLETS_SEE_SYMBOL_NAME_PROPERTY] = g_param_spec_string ("symbol-name", "symbol-name", "symbol-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
451 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_SEE_SYMBOL_PROPERTY, valadoc_taglets_see_properties[VALADOC_TAGLETS_SEE_SYMBOL_PROPERTY] = g_param_spec_object ("symbol", "symbol", "symbol", VALADOC_API_TYPE_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
452 }
453 
454 static void
valadoc_taglets_see_valadoc_content_taglet_interface_init(ValadocContentTagletIface * iface,gpointer iface_data)455 valadoc_taglets_see_valadoc_content_taglet_interface_init (ValadocContentTagletIface * iface,
456                                                            gpointer iface_data)
457 {
458 	valadoc_taglets_see_valadoc_content_taglet_parent_iface = g_type_interface_peek_parent (iface);
459 	iface->get_parser_rule = (ValadocRule* (*) (ValadocContentTaglet*, ValadocRule*)) valadoc_taglets_see_real_get_parser_rule;
460 }
461 
462 static void
valadoc_taglets_see_valadoc_content_block_interface_init(ValadocContentBlockIface * iface,gpointer iface_data)463 valadoc_taglets_see_valadoc_content_block_interface_init (ValadocContentBlockIface * iface,
464                                                           gpointer iface_data)
465 {
466 	valadoc_taglets_see_valadoc_content_block_parent_iface = g_type_interface_peek_parent (iface);
467 }
468 
469 static void
valadoc_taglets_see_instance_init(ValadocTagletsSee * self,gpointer klass)470 valadoc_taglets_see_instance_init (ValadocTagletsSee * self,
471                                    gpointer klass)
472 {
473 	self->priv = valadoc_taglets_see_get_instance_private (self);
474 }
475 
476 static void
valadoc_taglets_see_finalize(GObject * obj)477 valadoc_taglets_see_finalize (GObject * obj)
478 {
479 	ValadocTagletsSee * self;
480 	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_TAGLETS_TYPE_SEE, ValadocTagletsSee);
481 	_g_free0 (self->priv->_symbol_name);
482 	_g_object_unref0 (self->priv->_symbol);
483 	G_OBJECT_CLASS (valadoc_taglets_see_parent_class)->finalize (obj);
484 }
485 
486 static GType
valadoc_taglets_see_get_type_once(void)487 valadoc_taglets_see_get_type_once (void)
488 {
489 	static const GTypeInfo g_define_type_info = { sizeof (ValadocTagletsSeeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_taglets_see_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocTagletsSee), 0, (GInstanceInitFunc) valadoc_taglets_see_instance_init, NULL };
490 	static const GInterfaceInfo valadoc_content_taglet_info = { (GInterfaceInitFunc) valadoc_taglets_see_valadoc_content_taglet_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
491 	static const GInterfaceInfo valadoc_content_block_info = { (GInterfaceInitFunc) valadoc_taglets_see_valadoc_content_block_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
492 	GType valadoc_taglets_see_type_id;
493 	valadoc_taglets_see_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_CONTENT_ELEMENT, "ValadocTagletsSee", &g_define_type_info, 0);
494 	g_type_add_interface_static (valadoc_taglets_see_type_id, VALADOC_CONTENT_TYPE_TAGLET, &valadoc_content_taglet_info);
495 	g_type_add_interface_static (valadoc_taglets_see_type_id, VALADOC_CONTENT_TYPE_BLOCK, &valadoc_content_block_info);
496 	ValadocTagletsSee_private_offset = g_type_add_instance_private (valadoc_taglets_see_type_id, sizeof (ValadocTagletsSeePrivate));
497 	return valadoc_taglets_see_type_id;
498 }
499 
500 GType
valadoc_taglets_see_get_type(void)501 valadoc_taglets_see_get_type (void)
502 {
503 	static volatile gsize valadoc_taglets_see_type_id__volatile = 0;
504 	if (g_once_init_enter (&valadoc_taglets_see_type_id__volatile)) {
505 		GType valadoc_taglets_see_type_id;
506 		valadoc_taglets_see_type_id = valadoc_taglets_see_get_type_once ();
507 		g_once_init_leave (&valadoc_taglets_see_type_id__volatile, valadoc_taglets_see_type_id);
508 	}
509 	return valadoc_taglets_see_type_id__volatile;
510 }
511 
512 static void
_vala_valadoc_taglets_see_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)513 _vala_valadoc_taglets_see_get_property (GObject * object,
514                                         guint property_id,
515                                         GValue * value,
516                                         GParamSpec * pspec)
517 {
518 	ValadocTagletsSee * self;
519 	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_SEE, ValadocTagletsSee);
520 	switch (property_id) {
521 		case VALADOC_TAGLETS_SEE_SYMBOL_NAME_PROPERTY:
522 		g_value_set_string (value, valadoc_taglets_see_get_symbol_name (self));
523 		break;
524 		case VALADOC_TAGLETS_SEE_SYMBOL_PROPERTY:
525 		g_value_set_object (value, valadoc_taglets_see_get_symbol (self));
526 		break;
527 		default:
528 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
529 		break;
530 	}
531 }
532 
533 static void
_vala_valadoc_taglets_see_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)534 _vala_valadoc_taglets_see_set_property (GObject * object,
535                                         guint property_id,
536                                         const GValue * value,
537                                         GParamSpec * pspec)
538 {
539 	ValadocTagletsSee * self;
540 	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_SEE, ValadocTagletsSee);
541 	switch (property_id) {
542 		case VALADOC_TAGLETS_SEE_SYMBOL_NAME_PROPERTY:
543 		valadoc_taglets_see_set_symbol_name (self, g_value_get_string (value));
544 		break;
545 		case VALADOC_TAGLETS_SEE_SYMBOL_PROPERTY:
546 		valadoc_taglets_see_set_symbol (self, g_value_get_object (value));
547 		break;
548 		default:
549 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
550 		break;
551 	}
552 }
553 
554 static void
_vala_array_destroy(gpointer array,gint array_length,GDestroyNotify destroy_func)555 _vala_array_destroy (gpointer array,
556                      gint array_length,
557                      GDestroyNotify destroy_func)
558 {
559 	if ((array != NULL) && (destroy_func != NULL)) {
560 		gint i;
561 		for (i = 0; i < array_length; i = i + 1) {
562 			if (((gpointer*) array)[i] != NULL) {
563 				destroy_func (((gpointer*) array)[i]);
564 			}
565 		}
566 	}
567 }
568 
569 static void
_vala_array_free(gpointer array,gint array_length,GDestroyNotify destroy_func)570 _vala_array_free (gpointer array,
571                   gint array_length,
572                   GDestroyNotify destroy_func)
573 {
574 	_vala_array_destroy (array, array_length, destroy_func);
575 	g_free (array);
576 }
577 
578