mkerr.pl (59191) | mkerr.pl (68651) |
---|---|
1#!/usr/local/bin/perl -w 2 3my $config = "crypto/err/openssl.ec"; 4my $debug = 0; 5my $rebuild = 0; 6my $static = 1; 7my $recurse = 0; 8my $reindex = 0; --- 24 unchanged lines hidden (view full) --- 33 $dowrite = 1; 34 shift @ARGV; 35 } else { 36 last; 37 } 38} 39 40if($recurse) { | 1#!/usr/local/bin/perl -w 2 3my $config = "crypto/err/openssl.ec"; 4my $debug = 0; 5my $rebuild = 0; 6my $static = 1; 7my $recurse = 0; 8my $reindex = 0; --- 24 unchanged lines hidden (view full) --- 33 $dowrite = 1; 34 shift @ARGV; 35 } else { 36 last; 37 } 38} 39 40if($recurse) { |
41 @source = (<crypto/*.c>, <crypto/*/*.c>, ,<rsaref/*.c>, <ssl/*.c>); | 41 @source = ( |
42} else { 43 @source = @ARGV; 44} 45 46# Read in the config file 47 48open(IN, "<$config") || die "Can't open config file $config"; 49 --- 24 unchanged lines hidden (view full) --- 74# Scan each header file in turn and make a list of error codes 75# and function names 76 77while (($lib, $hdr) = each %hinc) 78{ 79 next if($hdr eq "NONE"); 80 print STDERR "Scanning header file $hdr\n" if $debug; 81 open(IN, "<$hdr") || die "Can't open Header file $hdr\n"; | 42} else { 43 @source = @ARGV; 44} 45 46# Read in the config file 47 48open(IN, "<$config") || die "Can't open config file $config"; 49 --- 24 unchanged lines hidden (view full) --- 74# Scan each header file in turn and make a list of error codes 75# and function names 76 77while (($lib, $hdr) = each %hinc) 78{ 79 next if($hdr eq "NONE"); 80 print STDERR "Scanning header file $hdr\n" if $debug; 81 open(IN, "<$hdr") || die "Can't open Header file $hdr\n"; |
82 my $line = "", $def= ""; | 82 my $line = "", $def= "", $linenr = 0; |
83 while(<IN>) { | 83 while(<IN>) { |
84 $linenr++; 85 print STDERR "line: $linenr\r" if $debug; 86 |
|
84 last if(/BEGIN\s+ERROR\s+CODES/); 85 if ($line ne '') { 86 $_ = $line . $_; 87 $line = ''; 88 } 89 90 if (/\\$/) { 91 $line = $_; --- 13 unchanged lines hidden (view full) --- 105 106 if (/{|\/\*/) { # Add a } so editor works... 107 $line = $_; 108 } else { 109 $def .= $_; 110 } 111 } 112 | 87 last if(/BEGIN\s+ERROR\s+CODES/); 88 if ($line ne '') { 89 $_ = $line . $_; 90 $line = ''; 91 } 92 93 if (/\\$/) { 94 $line = $_; --- 13 unchanged lines hidden (view full) --- 108 109 if (/{|\/\*/) { # Add a } so editor works... 110 $line = $_; 111 } else { 112 $def .= $_; 113 } 114 } 115 |
116 print STDERR " \r" if $debug; 117 $defnr = 0; |
|
113 foreach (split /;/, $def) { | 118 foreach (split /;/, $def) { |
119 $defnr++; 120 print STDERR "def: $defnr\r" if $debug; 121 |
|
114 s/^[\n\s]*//g; 115 s/[\n\s]*$//g; 116 next if(/typedef\W/); 117 if (/\(\*(\w*)\([^\)]+/) { 118 my $name = $1; 119 $name =~ tr/[a-z]/[A-Z]/; 120 $ftrans{$name} = $1; 121 } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s){ --- 9 unchanged lines hidden (view full) --- 131 my $name = $1; 132 $name =~ tr/[a-z]/[A-Z]/; 133 $ftrans{$name} = $1; 134 } elsif (/\(/ and not (/=/ or /DECLARE_STACK/)) { 135 print STDERR "Header $hdr: cannot parse: $_;\n"; 136 } 137 } 138 | 122 s/^[\n\s]*//g; 123 s/[\n\s]*$//g; 124 next if(/typedef\W/); 125 if (/\(\*(\w*)\([^\)]+/) { 126 my $name = $1; 127 $name =~ tr/[a-z]/[A-Z]/; 128 $ftrans{$name} = $1; 129 } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s){ --- 9 unchanged lines hidden (view full) --- 139 my $name = $1; 140 $name =~ tr/[a-z]/[A-Z]/; 141 $ftrans{$name} = $1; 142 } elsif (/\(/ and not (/=/ or /DECLARE_STACK/)) { 143 print STDERR "Header $hdr: cannot parse: $_;\n"; 144 } 145 } 146 |
147 print STDERR " \r" if $debug; 148 |
|
139 next if $reindex; 140 141 # Scan function and reason codes and store them: keep a note of the 142 # maximum code used. 143 144 while(<IN>) { 145 if(/^#define\s+(\S+)\s+(\S+)/) { 146 $name = $1; --- 373 unchanged lines hidden --- | 149 next if $reindex; 150 151 # Scan function and reason codes and store them: keep a note of the 152 # maximum code used. 153 154 while(<IN>) { 155 if(/^#define\s+(\S+)\s+(\S+)/) { 156 $name = $1; --- 373 unchanged lines hidden --- |