}
if (defined($public_file)) {
- open PUBLIC, ">$public_file";
+ open PUBLIC, ">$public_file" or die("Can't open `$public_file': $!");
$public_fd = \*PUBLIC;
}
if ($private_file eq $public_file) {
$private_fd = $public_fd;
} elsif (defined($private_file)) {
- open PRIVATE, ">$private_file";
+ open PRIVATE, ">$private_file" or die("Can't open `$private_file': $!"); ;
$private_fd = \*PRIVATE;
}
next if ($line =~ /^\/|[;]/);
+ if ($line =~ s/^_PUBLIC_[\t ]//) {
+ $target = $public_file;
+ }
+
next unless ( $line =~ /
^void|^BOOL|^int|^struct|^char|^const|^\w+_[tT]\s|^uint|^unsigned|^long|
^NTSTATUS|^ADS_STATUS|^enum\s.*\(|^DATA_BLOB|^WERROR|^XFILE|^FILE|^DIR|
next;
}
- if ($line =~ s/_PUBLIC_//xo) {
- $target = $public_file;
- }
-
if ( $line =~ /\(.*\)\s*$/o ) {
chomp $line;
print $target "$line;\n";