3c99391d93
In some cases the license-identification header was missing, so I added that as well. Replaced the remaining headers that specifically identified "Versions 3.13.7 and higher". Makefiles and the build system were deliberately excluded.
47 lines
1.1 KiB
Perl
47 lines
1.1 KiB
Perl
######################################################################
|
|
# SPDX-License-Identifier: EPICS
|
|
# EPICS BASE is distributed subject to a Software License Agreement
|
|
# found in file LICENSE that is included with this distribution.
|
|
######################################################################
|
|
|
|
package DBD::Variable;
|
|
use DBD::Base;
|
|
our @ISA = qw(DBD::Base);
|
|
|
|
use strict;
|
|
|
|
my %valid_types = (
|
|
# C type name => corresponding iocshArg type identifier
|
|
int => 'iocshArgInt',
|
|
double => 'iocshArgDouble'
|
|
);
|
|
|
|
sub init {
|
|
my ($this, $name, $type) = @_;
|
|
$type = "int" unless defined $type;
|
|
exists $valid_types{$type} or
|
|
dieContext("Unknown variable type '$type', valid types are:",
|
|
sort keys %valid_types);
|
|
$this->SUPER::init($name, "variable");
|
|
$this->{VAR_TYPE} = $type;
|
|
return $this;
|
|
}
|
|
|
|
sub var_type {
|
|
my $this = shift;
|
|
return $this->{VAR_TYPE};
|
|
}
|
|
|
|
sub iocshArg_type {
|
|
my $this = shift;
|
|
return $valid_types{$this->{VAR_TYPE}};
|
|
}
|
|
|
|
sub equals {
|
|
my ($a, $b) = @_;
|
|
return $a->SUPER::equals($b)
|
|
&& $a->{VAR_TYPE} eq $b->{VAR_TYPE};
|
|
}
|
|
|
|
1;
|