Make mkdef.pl parse some ASN1 IMPLEMENT macros.
authorDr. Stephen Henson <steve@openssl.org>
Sat, 16 Dec 2000 01:19:24 +0000 (01:19 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sat, 16 Dec 2000 01:19:24 +0000 (01:19 +0000)
Initial support for variables in DEF files.

CHANGES
util/mkdef.pl

diff --git a/CHANGES b/CHANGES
index 5c31f05..fd7e2d3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,9 @@
 
  Changes between 0.9.6 and 0.9.7  [xx XXX 2000]
 
+  *) Make mkdef.pl parse some of the ASN1 macros and add apropriate
+     entries for variables.
+
   *) Add functionality to apps/openssl.c for detecting locking
      problems: As the program is single-threaded, all we have
      to do is register a locking callback using an array for
index e9e21ca..6ffbbe4 100755 (executable)
@@ -197,6 +197,7 @@ $crypto.=" crypto/objects/objects.h";
 $crypto.=" crypto/pem/pem.h";
 #$crypto.=" crypto/meth/meth.h";
 $crypto.=" crypto/asn1/asn1.h";
+$crypto.=" crypto/asn1/asn1t.h";
 $crypto.=" crypto/asn1/asn1_mac.h";
 $crypto.=" crypto/err/err.h";
 $crypto.=" crypto/pkcs7/pkcs7.h";
@@ -376,6 +377,14 @@ sub do_defs
                        }
                        if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) {
                                next;
+                       } elsif (/^\s*DECLARE_ASN1_FUNCTIONS\s*\(\s*(\w*)\s*\)/) {
+                               $syms{"d2i_$1"} = 1;
+                               $syms{"i2d_$1"} = 1;
+                               $syms{"$1_new"} = 1;
+                               $syms{"$1_free"} = 1;
+                               $syms{"$1_it"} = 1;
+                               $kind{"$1_it"} = "VARIABLE";
+                               next;
                        } elsif (/^\s*DECLARE_PKCS12_STACK_OF\s*\(\s*(\w*)\s*\)/) {
                                next;
                        } elsif (/^\s*DECLARE_ASN1_SET_OF\s*\(\s*(\w*)\s*\)/) {
@@ -675,7 +684,7 @@ sub print_test_file
 sub print_def_file
 {
        (*OUT,my $name,*nums,my @symbols)=@_;
-       my $n = 1; my @e; my @r;
+       my $n = 1; my @e; my @r; my @v;
 
        if ($W32)
                { $name.="32"; }
@@ -710,11 +719,14 @@ EOF
 
        (@e)=grep(/^SSLeay\\.*?:.*?:FUNCTION/,@symbols);
        (@r)=grep(/^\w+\\.*?:.*?:FUNCTION/ && !/^SSLeay\\.*?:.*?:FUNCTION/,@symbols);
-       @symbols=((sort @e),(sort @r));
+       (@v)=grep(/^\w+\\.*?:.*?:VARIABLE/,@symbols);
+       @symbols=((sort @e),(sort @r), (sort @v));
 
 
        foreach $sym (@symbols) {
                (my $s, my $i) = $sym =~ /^(.*?)\\(.*)$/;
+               my $v = 0;
+               $v = 1 if $sym=~ /^\w+\\.*?:.*?:VARIABLE/;
                if (!defined($nums{$s})) {
                        printf STDERR "Warning: $s does not have a number assigned\n"
                                        if(!$do_update);
@@ -765,7 +777,11 @@ EOF
                            && (!@a || (!$no_rijndael || !grep(/^RIJNDAEL$/,@a)))
                            && (!@a || (!$no_fp_api || !grep(/^FP_API$/,@a)))
                            ) {
-                               printf OUT "    %s%-40s@%d\n",($W32)?"":"_",$s,$n;
+                               if($v) {
+                                       printf OUT "    %s%-40s@%-8d DATA\n",($W32)?"":"_",$s,$n;
+                               } else {
+                                       printf OUT "    %s%-40s@%d\n",($W32)?"":"_",$s,$n;
+                               }
 #                      } else {
 #                              print STDERR "DEBUG: \"$sym\" (@p):",
 #                              " rsaref:", !!(!@p