This repository was archived by the owner on Sep 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakeStreamDBD.pl
More file actions
executable file
·54 lines (52 loc) · 1.55 KB
/
makeStreamDBD.pl
File metadata and controls
executable file
·54 lines (52 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use strict;
use warnings;
my @srcs = @ARGV[2..$#ARGV];
my $dbd;
my $out;
# stream.dbd
if ($ARGV[0] == 1) {
open($out, ">", "$ARGV[1]") or die "Can't open $ARGV[1]\n";
foreach $dbd (@srcs) {
print $out "device(".$dbd.",INST_IO,dev".$dbd."Stream,\"stream\")\n";
}
print $out "driver(stream)\n";
print $out "variable(streamDebug, int)\n";
print $out "registrar(streamRegistrar)\n";
close $out;
}
# streamSynApps.dbd
elsif ($ARGV[0] == 2) {
open($out, ">", "$ARGV[1]") or die "Can't open $ARGV[1]\n";
foreach $dbd (@srcs) {
print $out "device(".$dbd.",INST_IO,dev".$dbd."Stream,\"stream\")\n";
}
close $out;
}
# streamReferences for BUSSES
elsif ($ARGV[0] == 3) {
open($out, ">", "$ARGV[1]") or die "Can't open $ARGV[1]\n";
foreach $dbd (@srcs) {
print $out "extern void* ref_".$dbd."Interface;\n";
print $out "void* p".$dbd." = ref_".$dbd."Interface;\n";
}
close $out;
}
# streamReferences for FORMAT
elsif ($ARGV[0] == 4) {
open($out, ">>", "$ARGV[1]") or die "Can't open $ARGV[1]\n";
foreach $dbd (@srcs) {
print $out "extern void* ref_".$dbd."Converter;\n";
print $out "void* p".$dbd." = ref_".$dbd."Converter;\n";
}
close $out;
}
# stream.dbd for 3-13
elsif ($ARGV[0] == 5) {
open($out, ">", "$ARGV[1]") or die "Can't open $ARGV[1]\n";
foreach $dbd (@srcs) {
print $out "device(".$dbd.",INST_IO,dev".$dbd."Stream,\"stream\")\n";
}
print $out "driver(stream)\n";
close $out;
}
else {print "\n\nCannot Generate DBD Files\n\n";}