Lines 96-102
Link Here
|
96 |
} |
96 |
} |
97 |
|
97 |
|
98 |
# Grab the command-line arguments |
98 |
# Grab the command-line arguments |
99 |
$mpi_header=shift @ARGV; |
99 |
$mpi_header = (@ARGV > 3) ? shift @ARGV : "/usr/include/mpi.h"; |
100 |
$unsafe_input = shift @ARGV; |
100 |
$unsafe_input = shift @ARGV; |
101 |
$unsafe_output = shift @ARGV; |
101 |
$unsafe_output = shift @ARGV; |
102 |
$cbridge_output = shift @ARGV; |
102 |
$cbridge_output = shift @ARGV; |
Lines 130-136
Link Here
|
130 |
} |
130 |
} |
131 |
push(@mpi_status_fields, " $access $type $name;\n"); |
131 |
push(@mpi_status_fields, " $access $type $name;\n"); |
132 |
} |
132 |
} |
133 |
} elsif ($line =~ /\s*#\s*define\s*(MPI_[A-Za-z0-9_]*)\s*(.*)/) { |
133 |
} elsif ($line =~ /\s*#define\s+(MPI_[A-Za-z0-9_]*)\s*(.*)/) { |
134 |
# Found an MPI_* constant defined by the preprocessor |
134 |
# Found an MPI_* constant defined by the preprocessor |
135 |
my $name = $1; |
135 |
my $name = $1; |
136 |
my $value = $2; |
136 |
my $value = $2; |
Lines 145-151
Link Here
|
145 |
} elsif ($in_enum) { |
145 |
} elsif ($in_enum) { |
146 |
parse_enum($line); |
146 |
parse_enum($line); |
147 |
} elsif ($line =~ /typedef\s+struct\s+([A-Za-z_][A-Za-z0-9_]*)\s+MPI_Status/) { |
147 |
} elsif ($line =~ /typedef\s+struct\s+([A-Za-z_][A-Za-z0-9_]*)\s+MPI_Status/) { |
148 |
$mpi_status_name = $2; |
148 |
$mpi_status_name = $1; |
149 |
} elsif ($line =~ /struct $mpi_status_name[^;]*$/) { |
149 |
} elsif ($line =~ /struct $mpi_status_name[^;]*$/) { |
150 |
$in_mpi_status=1; |
150 |
$in_mpi_status=1; |
151 |
} |
151 |
} |
Lines 183-189
Link Here
|
183 |
# This is a constant we need to replace. |
183 |
# This is a constant we need to replace. |
184 |
my $value = $constants{$constant}; |
184 |
my $value = $constants{$constant}; |
185 |
|
185 |
|
186 |
if ($value =~ /&/ or $constant =~ /_FN$/) { |
186 |
if ($value =~ /LAM_MPI_C_.+\(FN|NULL|IGNORE\)/) { |
|
|
187 |
# this is for you LAM :-) |
188 |
print UNSAFE_OUTPUT ("$whitespace","public static readonly $type $constant = mpinet_$constant();\n"); |
189 |
push (@cbridge_constants, "$type:$constant"); |
190 |
} elsif ($value =~ /&/ or $constant =~ /_FN$/) { |
187 |
# If we're taking the address of something, or if this |
191 |
# If we're taking the address of something, or if this |
188 |
# is a _FN constant, it needs to be done in the C |
192 |
# is a _FN constant, it needs to be done in the C |
189 |
# bridge *unless* this is just a fancy name for the |
193 |
# bridge *unless* this is just a fancy name for the |