Do not insert things in syms{} and kind{} when parsing the header

files.  Instead, insert proper information in the $def string, which
will be properly munged later on.
This commit is contained in:
Richard Levitte 2001-02-19 13:33:04 +00:00
parent b0c8638650
commit 267a1927eb

View File

@ -324,6 +324,9 @@ sub do_defs
TRUE => 1, TRUE => 1,
); );
my $symhacking = $file eq $symhacksfile; my $symhacking = $file eq $symhacksfile;
my @current_platforms = ();
my @current_algorithms = ();
while(<IN>) { while(<IN>) {
last if (/BEGIN ERROR CODES/); last if (/BEGIN ERROR CODES/);
if ($line ne '') { if ($line ne '') {
@ -402,57 +405,56 @@ sub do_defs
$rename{$s} = $a; $rename{$s} = $a;
} }
if (/^\#/) { if (/^\#/) {
my @p = grep(!/^$/, @current_platforms =
map { $tag{$_} == 1 ? $_ : grep(!/^$/,
$tag{$_} == -1 ? "!".$_ : "" } map { $tag{$_} == 1 ? $_ :
@known_platforms); $tag{$_} == -1 ? "!".$_ : "" }
my @a = grep(!/^$/, @known_platforms);
map { $tag{"NO_".$_} == -1 ? $_ : "" } @current_algorithms =
@known_algorithms); grep(!/^$/,
$def .= "#INFO:".join(',',@p).":".join(',',@a).";"; map { $tag{"NO_".$_} == -1 ? $_ : "" }
@known_algorithms);
$def .=
"#INFO:"
.join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
next; next;
} }
if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) { if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) {
next; next;
} elsif (/^\s*DECLARE_ASN1_ENCODE_FUNCTIONS\s*\(\s*(\w*)\s*,\s*(\w*)\s*,\s*(\w*)\s*\)/) { } elsif (/^\s*DECLARE_ASN1_ENCODE_FUNCTIONS\s*\(\s*(\w*)\s*,\s*(\w*)\s*,\s*(\w*)\s*\)/) {
$syms{"d2i_$3"} = 1; $def .= "int d2i_$3(void);";
$syms{"i2d_$3"} = 1; $def .= "int i2d_$3(void);";
$syms{"$2_it"} = 1; $def .= "OPENSSL_EXTERN int $2_it;";
$kind{"$2_it"} = "VARIABLE";
next; next;
} elsif (/^\s*DECLARE_ASN1_FUNCTIONS_fname\s*\(\s*(\w*)\s*,\s*(\w*)\s*,\s*(\w*)\s*\)/) { } elsif (/^\s*DECLARE_ASN1_FUNCTIONS_fname\s*\(\s*(\w*)\s*,\s*(\w*)\s*,\s*(\w*)\s*\)/) {
$syms{"d2i_$3"} = 1; $def .= "int d2i_$3(void);";
$syms{"i2d_$3"} = 1; $def .= "int i2d_$3(void);";
$syms{"$3_new"} = 1; $def .= "int $3_free(void);";
$syms{"$3_free"} = 1; $def .= "int $3_new(void);";
$syms{"$2_it"} = 1; $def .= "OPENSSL_EXTERN int $2_it;";
$kind{"$2_it"} = "VARIABLE";
} elsif (/^\s*DECLARE_ASN1_FUNCTIONS\s*\(\s*(\w*)\s*\)/ || } elsif (/^\s*DECLARE_ASN1_FUNCTIONS\s*\(\s*(\w*)\s*\)/ ||
/^\s*DECLARE_ASN1_FUNCTIONS_const\s*\(\s*(\w*)\s*\)/) { /^\s*DECLARE_ASN1_FUNCTIONS_const\s*\(\s*(\w*)\s*\)/) {
$syms{"d2i_$1"} = 1; $def .= "int d2i_$1(void);";
$syms{"i2d_$1"} = 1; $def .= "int i2d_$1(void);";
$syms{"$1_new"} = 1; $def .= "int $1_free(void);";
$syms{"$1_free"} = 1; $def .= "int $1_new(void);";
$syms{"$1_it"} = 1; $def .= "OPENSSL_EXTERN int $1_it;";
$kind{"$1_it"} = "VARIABLE";
next; next;
} elsif (/^\s*DECLARE_ASN1_ENCODE_FUNCTIONS_const\s*\(\s*(\w*)\s*,\s*(\w*)\s*\)/) { } elsif (/^\s*DECLARE_ASN1_ENCODE_FUNCTIONS_const\s*\(\s*(\w*)\s*,\s*(\w*)\s*\)/) {
$syms{"d2i_$2"} = 1; $def .= "int d2i_$2(void);";
$syms{"i2d_$2"} = 1; $def .= "int i2d_$2(void);";
$syms{"$2_it"} = 1; $def .= "OPENSSL_EXTERN int $2_it;";
$kind{"$2_it"} = "VARIABLE";
next; next;
} elsif (/^\s*DECLARE_ASN1_FUNCTIONS_name\s*\(\s*(\w*)\s*,\s*(\w*)\s*\)/) { } elsif (/^\s*DECLARE_ASN1_FUNCTIONS_name\s*\(\s*(\w*)\s*,\s*(\w*)\s*\)/) {
$syms{"d2i_$2"} = 1; $def .= "int d2i_$2(void);";
$syms{"i2d_$2"} = 1; $def .= "int i2d_$2(void);";
$syms{"$2_new"} = 1; $def .= "int $2_free(void);";
$syms{"$2_free"} = 1; $def .= "int $2_new(void);";
$syms{"$2_it"} = 1; $def .= "OPENSSL_EXTERN int $2_it;";
$kind{"$2_it"} = "VARIABLE";
next; next;
} elsif (/^\s*DECLARE_ASN1_ITEM\s*\(\s*(\w*)\s*,(\w*)\s*\)/) { } elsif (/^\s*DECLARE_ASN1_ITEM\s*\(\s*(\w*)\s*,(\w*)\s*\)/) {
$syms{"$1_it"} = 1; $def .= "OPENSSL_EXTERN int $1_it;";
$kind{"$1_it"} = "VARIABLE";
next; next;
} elsif (/^\s*DECLARE_PKCS12_STACK_OF\s*\(\s*(\w*)\s*\)/) { } elsif (/^\s*DECLARE_PKCS12_STACK_OF\s*\(\s*(\w*)\s*\)/) {
next; next;
@ -461,65 +463,47 @@ sub do_defs
} elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ || } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) { /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) {
# Things not in Win16 # Things not in Win16
$syms{"PEM_read_${1}"} = 1; $def .=
$platform{"PEM_read_${1}"} = "!WIN16"; "#INFO:"
$syms{"PEM_write_${1}"} = 1; .join(',',"!WIN16",@current_platforms).":"
$platform{"PEM_write_${1}"} = "!WIN16"; .join(',',@current_algorithms).";";
$def .= "int PEM_read_$1(void);";
$def .= "int PEM_write_$1(void);";
$def .=
"#INFO:"
.join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
# Things that are everywhere # Things that are everywhere
$syms{"PEM_read_bio_${1}"} = 1; $def .= "int PEM_read_bio_$1(void);";
$syms{"PEM_write_bio_${1}"} = 1; $def .= "int PEM_write_bio_$1(void);";
if ($1 eq "RSAPrivateKey" ||
$1 eq "RSAPublicKey" ||
$1 eq "RSA_PUBKEY") {
$algorithm{"PEM_read_${1}"} = "RSA";
$algorithm{"PEM_write_${1}"} = "RSA";
$algorithm{"PEM_read_bio_${1}"} = "RSA";
$algorithm{"PEM_write_bio_${1}"} = "RSA";
}
elsif ($1 eq "DSAPrivateKey" ||
$1 eq "DSAparams" ||
$1 eq "RSA_PUBKEY") {
$algorithm{"PEM_read_${1}"} = "DSA";
$algorithm{"PEM_write_${1}"} = "DSA";
$algorithm{"PEM_read_bio_${1}"} = "DSA";
$algorithm{"PEM_write_bio_${1}"} = "DSA";
}
elsif ($1 eq "DHparams") {
$algorithm{"PEM_read_${1}"} = "DH";
$algorithm{"PEM_write_${1}"} = "DH";
$algorithm{"PEM_read_bio_${1}"} = "DH";
$algorithm{"PEM_write_bio_${1}"} = "DH";
}
} elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ || } elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) { /^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) {
# Things not in Win16 # Things not in Win16
$syms{"PEM_write_${1}"} = 1; $def .=
$platform{"PEM_write_${1}"} .= ",!WIN16"; "#INFO:"
.join(',',"!WIN16",@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_write_$1(void);";
$def .=
"#INFO:"
.join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
# Things that are everywhere # Things that are everywhere
$syms{"PEM_write_bio_${1}"} = 1; $def .= "int PEM_write_bio_$1(void);";
if ($1 eq "RSAPrivateKey" ||
$1 eq "RSAPublicKey" ||
$1 eq "RSA_PUBKEY") {
$algorithm{"PEM_write_${1}"} = "RSA";
$algorithm{"PEM_write_bio_${1}"} = "RSA";
}
elsif ($1 eq "DSAPrivateKey" ||
$1 eq "DSAparams" ||
$1 eq "RSA_PUBKEY") {
$algorithm{"PEM_write_${1}"} = "DSA";
$algorithm{"PEM_write_bio_${1}"} = "DSA";
}
elsif ($1 eq "DHparams") {
$algorithm{"PEM_write_${1}"} = "DH";
$algorithm{"PEM_write_bio_${1}"} = "DH";
}
} elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ || } elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) { /^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) {
# Things not in Win16 # Things not in Win16
$syms{"PEM_read_${1}"} = 1; $def .=
$platform{"PEM_read_${1}"} .= ",!WIN16"; "#INFO:"
.join(',',"!WIN16",@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_read_$1(void);";
$def .=
"#INFO:"
.join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
# Things that are everywhere # Things that are everywhere
$syms{"PEM_read_bio_${1}"} = 1; $def .= "int PEM_read_bio_$1(void);";
} elsif ( } elsif (
($tag{'TRUE'} != -1) ($tag{'TRUE'} != -1)
&& ($tag{'CONST_STRICT'} != 1) && ($tag{'CONST_STRICT'} != 1)