function.pm 3.69 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#
# Copyright 1999, 2000, 2001 Patrik Stridvall
#
# 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
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 18
#

19 20 21 22
package function;

use strict;

23
sub new($) {
24 25 26 27 28 29 30 31
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self  = {};
    bless ($self, $class);

    return $self;
}

32
sub file($$) {
33 34 35 36 37 38
    my $self = shift;
    my $file = \${$self->{FILE}};

    local $_ = shift;

    if(defined($_)) { $$file = $_; }
39

40 41 42
    return $$file;
}

43
sub debug_channels($$) {
44 45 46 47 48 49
    my $self = shift;
    my $debug_channels = \${$self->{DEBUG_CHANNELS}};

    local $_ = shift;

    if(defined($_)) { $$debug_channels = $_; }
50

51 52 53
    return $$debug_channels;
}

54
sub documentation_line($$) {
55 56 57 58 59 60
    my $self = shift;
    my $documentation_line = \${$self->{DOCUMENTATION_LINE}};

    local $_ = shift;

    if(defined($_)) { $$documentation_line = $_; }
61

62 63 64
    return $$documentation_line;
}

65
sub documentation($$) {
66 67 68 69 70 71
    my $self = shift;
    my $documentation = \${$self->{DOCUMENTATION}};

    local $_ = shift;

    if(defined($_)) { $$documentation = $_; }
72

73 74 75
    return $$documentation;
}

76
sub function_line($$) {
77 78 79 80 81 82
    my $self = shift;
    my $function_line = \${$self->{FUNCTION_LINE}};

    local $_ = shift;

    if(defined($_)) { $$function_line = $_; }
83

84 85 86
    return $$function_line;
}

87
sub linkage($$) {
88 89 90 91 92 93
    my $self = shift;
    my $linkage = \${$self->{LINKAGE}};

    local $_ = shift;

    if(defined($_)) { $$linkage = $_; }
94

95 96 97
    return $$linkage;
}

98
sub return_type($$) {
99 100 101 102 103 104
    my $self = shift;
    my $return_type = \${$self->{RETURN_TYPE}};

    local $_ = shift;

    if(defined($_)) { $$return_type = $_; }
105

106 107 108
    return $$return_type;
}

109
sub calling_convention($$) {
110 111 112 113 114 115
    my $self = shift;
    my $calling_convention = \${$self->{CALLING_CONVENTION}};

    local $_ = shift;

    if(defined($_)) { $$calling_convention = $_; }
116

117 118 119
    return $$calling_convention;
}

120
sub internal_name($$) {
121 122 123 124 125 126
    my $self = shift;
    my $internal_name = \${$self->{INTERNAL_NAME}};

    local $_ = shift;

    if(defined($_)) { $$internal_name = $_; }
127

128 129 130
    return $$internal_name;
}

131
sub argument_types($$) {
132 133 134 135 136 137
    my $self = shift;
    my $argument_types = \${$self->{ARGUMENT_TYPES}};

    local $_ = shift;

    if(defined($_)) { $$argument_types = $_; }
138

139 140 141
    return $$argument_types;
}

142
sub argument_names($$) {
143 144 145 146 147 148
    my $self = shift;
    my $argument_names = \${$self->{ARGUMENT_NAMES}};

    local $_ = shift;

    if(defined($_)) { $$argument_names = $_; }
149

150 151 152
    return $$argument_names;
}

153
sub argument_documentations($$) {
154 155 156 157 158 159
    my $self = shift;
    my $argument_documentations = \${$self->{ARGUMENT_DOCUMENTATIONS}};

    local $_ = shift;

    if(defined($_)) { $$argument_documentations = $_; }
160

161 162 163
    return $$argument_documentations;
}

164
sub statements_line($$) {
165 166 167 168 169 170
    my $self = shift;
    my $statements_line = \${$self->{STATEMENTS_LINE}};

    local $_ = shift;

    if(defined($_)) { $$statements_line = $_; }
171

172 173 174
    return $$statements_line;
}

175
sub statements($$) {
176 177 178 179 180 181
    my $self = shift;
    my $statements = \${$self->{STATEMENTS}};

    local $_ = shift;

    if(defined($_)) { $$statements = $_; }
182

183 184 185 186
    return $$statements;
}

1;