2002-03-10 00:29:33 +01:00
|
|
|
#
|
|
|
|
# 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
|
2006-05-18 14:49:52 +02:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-10 00:29:33 +01:00
|
|
|
#
|
|
|
|
|
2001-08-22 20:09:15 +02:00
|
|
|
package c_function;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub new($)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($proto) = @_;
|
2001-08-22 20:09:15 +02:00
|
|
|
my $class = ref($proto) || $proto;
|
|
|
|
my $self = {};
|
|
|
|
bless ($self, $class);
|
|
|
|
|
|
|
|
return $self;
|
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Property setter / getter functions (each does both)
|
|
|
|
#
|
|
|
|
|
|
|
|
sub file($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $filename) = @_;
|
|
|
|
$self->{file} = $filename if (defined $filename);
|
|
|
|
return $self->{file};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-07-06 08:08:10 +02:00
|
|
|
sub begin_line($$)
|
2009-04-20 15:09:09 +02:00
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $begin_line) = @_;
|
|
|
|
$self->{begin_line} = $begin_line if (defined $begin_line);
|
|
|
|
return $self->{begin_line};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub begin_column($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $begin_column) = @_;
|
|
|
|
$self->{begin_column} = $begin_column if (defined $begin_column);
|
|
|
|
return $self->{begin_column};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub end_line($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $end_line) = @_;
|
|
|
|
$self->{end_line} = $end_line if (defined $end_line);
|
|
|
|
return $self->{end_line};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub end_column($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $end_column) = @_;
|
|
|
|
$self->{end_column} = $end_column if (defined $end_column);
|
|
|
|
return $self->{end_column};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub linkage($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $linkage) = @_;
|
|
|
|
$self->{linkage} = $linkage if (defined $linkage);
|
|
|
|
return $self->{linkage};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub return_type($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $return_type) = @_;
|
|
|
|
$self->{return_type} = $return_type if (defined $return_type);
|
|
|
|
return $self->{return_type};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub calling_convention($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $calling_convention) = @_;
|
|
|
|
$self->{calling_convention} = $calling_convention if (defined $calling_convention);
|
|
|
|
return $self->{calling_convention};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub name($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $name) = @_;
|
|
|
|
$self->{name} = $name if (defined $name);
|
|
|
|
return $self->{name};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub argument_types($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $argument_types) = @_;
|
|
|
|
$self->{argument_types} = $argument_types if (defined $argument_types);
|
|
|
|
return $self->{argument_types};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub argument_names($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $argument_names) = @_;
|
|
|
|
$self->{argument_names} = $argument_names if (defined $argument_names);
|
|
|
|
return $self->{argument_names};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub statements_line($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $statements_line) = @_;
|
|
|
|
$self->{statements_line} = $statements_line if (defined $statements_line);
|
|
|
|
return $self->{statements_line};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub statements_column($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $statements_column) = @_;
|
|
|
|
$self->{statements_column} = $statements_column if (defined $statements_column);
|
|
|
|
return $self->{statements_column};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 15:09:09 +02:00
|
|
|
sub statements($;$)
|
|
|
|
{
|
2009-07-06 08:08:10 +02:00
|
|
|
my ($self, $statements) = @_;
|
|
|
|
$self->{statements} = $statements if (defined $statements);
|
|
|
|
return $self->{statements};
|
2001-08-22 20:09:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|