3 * Copyright (C) 2007 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jürg Billeter <j@bitron.ch>
26 * Represents a pointer-type.
28 public class Vala
.Pointer
: DataType
{
30 * The type to which this pointer type points.
32 public DataType
! referent_type
{ get; set construct; }
36 public Pointer (construct DataType
! referent_type
, construct SourceReference source_reference
= null) {
40 name
= referent_type
.name
+ "*";
43 public override string get_cname (bool const_type
= false) {
45 if (referent_type
.is_reference_type ()) {
46 cname
= "%s**".printf (referent_type
.get_cname ());
48 cname
= "%s*".printf (referent_type
.get_cname ());
55 public override bool is_reference_type () {
59 public override string get_upper_case_cname (string infix
) {
63 public override string get_lower_case_cname (string infix
) {
67 public override string get_free_function () {
71 public override List
<string> get_cheader_filenames () {
72 return referent_type
.get_cheader_filenames ();
75 public override string get_type_id () {
76 return "G_TYPE_POINTER";
79 public override string get_marshaller_type_name () {
83 public override string get_get_value_function () {
84 return "g_value_get_pointer";
87 public override string get_set_value_function () {
88 return "g_value_set_pointer";