5 # It does this by parsing the header files and looking for the
6 # non-prototyped functions.
9 $crypto_num="util/libeay.num";
10 $ssl_num= "util/ssleay.num";
17 $do_ssl=1 if $_ eq "ssleay";
18 $do_crypto=1 if $_ eq "libeay";
21 if (!$do_ssl && !$do_crypto)
23 print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 ]\n";
27 %ssl_list=&load_numbers($ssl_num);
28 %crypto_list=&load_numbers($crypto_num);
32 $crypto ="crypto/crypto.h";
33 $crypto.=" crypto/des/des.h";
34 $crypto.=" crypto/idea/idea.h";
35 $crypto.=" crypto/rc4/rc4.h";
36 $crypto.=" crypto/rc5/rc5.h";
37 $crypto.=" crypto/rc2/rc2.h";
38 $crypto.=" crypto/bf/blowfish.h";
39 $crypto.=" crypto/cast/cast.h";
40 $crypto.=" crypto/md2/md2.h";
41 $crypto.=" crypto/md5/md5.h";
42 $crypto.=" crypto/mdc2/mdc2.h";
43 $crypto.=" crypto/sha/sha.h";
44 $crypto.=" crypto/ripemd/ripemd.h";
46 $crypto.=" crypto/bn/bn.h";
47 $crypto.=" crypto/rsa/rsa.h";
48 $crypto.=" crypto/dsa/dsa.h";
49 $crypto.=" crypto/dh/dh.h";
51 $crypto.=" crypto/stack/stack.h";
52 $crypto.=" crypto/buffer/buffer.h";
53 $crypto.=" crypto/bio/bio.h";
54 $crypto.=" crypto/lhash/lhash.h";
55 $crypto.=" crypto/conf/conf.h";
56 $crypto.=" crypto/txt_db/txt_db.h";
58 $crypto.=" crypto/evp/evp.h";
59 $crypto.=" crypto/objects/objects.h";
60 $crypto.=" crypto/pem/pem.h";
61 #$crypto.=" crypto/meth/meth.h";
62 $crypto.=" crypto/asn1/asn1.h";
63 $crypto.=" crypto/asn1/asn1_mac.h";
64 $crypto.=" crypto/err/err.h";
65 $crypto.=" crypto/pkcs7/pkcs7.h";
66 $crypto.=" crypto/x509/x509.h";
67 $crypto.=" crypto/x509/x509_vfy.h";
68 $crypto.=" crypto/rand/rand.h";
69 $crypto.=" crypto/hmac/hmac.h";
74 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,&do_defs("SSLEAY",$ssl))
77 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,&do_defs("LIBEAY",$crypto))
82 local($name,$files)=@_;
86 foreach $file (split(/\s+/,$files))
88 # print STDERR "reading $file\n";
89 open(IN,"<$file") || die "unable to open $file:$!\n";
95 while (($i=index($a,"/*")) >= 0)
98 break unless ($j >= 0);
99 $a=substr($a,0,$i).substr($a,$j+2);
102 foreach (split("\n",$a))
104 if (/^\#\s*ifndef (.*)/)
110 elsif (/^\#\s*if !defined\(([^\)]+)\)/)
116 elsif (/^\#\s*ifdef (.*)/)
122 elsif (/^\#\s*if defined(.*)/)
128 elsif (/^\#\s*endif/)
140 #printf STDERR "$_\n%2d %2d %2d %2d %2d $NT\n",
141 #$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'};
145 { $t=&do_extern($name,$_); }
146 elsif ( ($tag{'NOPROTO'} == 1) &&
147 ($tag{'FreeBSD'} != 1) &&
148 (($NT && ($tag{'WIN16'} != 1)) ||
149 (!$NT && ($tag{'WIN16'} != -1))) &&
150 ($tag{'PERL5'} != 1) &&
151 # ($tag{'_WINDLL'} != -1) &&
152 ((!$NT && $tag{'_WINDLL'} != -1) ||
153 ($NT && $tag{'_WINDLL'} != 1)) &&
154 ((($tag{'NO_FP_API'} != 1) && $NT) ||
155 (($tag{'NO_FP_API'} != -1) && !$NT)))
156 { $t=&do_line($name,$_); }
159 if (($t ne undef) && (!$done{$name,$t}))
163 #printf STDERR "one:$t\n" if $t =~ /BIO_/;
176 return(undef) if /^$/;
177 return(undef) if /^\s/;
178 #printf STDERR "two:$_\n" if $_ =~ /BIO_/;
179 if (/(CRYPTO_get_locking_callback)/)
181 elsif (/(CRYPTO_get_id_callback)/)
183 elsif (/(CRYPTO_get_add_lock_callback)/)
185 elsif (/(SSL_CTX_get_verify_callback)/)
187 elsif (/(SSL_get_info_callback)/)
189 elsif ((!$NT) && /(ERR_load_CRYPTO_strings)/)
190 { return("ERR_load_CRYPTOlib_strings"); }
191 elsif (!$NT && /BIO_s_file/)
193 elsif (!$NT && /BIO_new_file/)
195 elsif (!$NT && /BIO_new_fp/)
197 elsif ($NT && /BIO_s_file_internal/)
199 elsif ($NT && /BIO_new_file_internal/)
201 elsif ($NT && /BIO_new_fp_internal/)
221 local(*OUT,$name,*nums,@functions)=@_;
231 ; Definition file for the DDL version of the $name library from SSLeay
236 DESCRIPTION 'SSLeay $name - eay\@cryptsoft.com'
243 CODE PRELOAD MOVEABLE
244 DATA PRELOAD MOVEABLE SINGLE
257 (@e)=grep(/^SSLeay/,@functions);
258 (@r)=grep(!/^SSLeay/,@functions);
259 @functions=((sort @e),(sort @r));
261 foreach $func (@functions)
263 if (!defined($nums{$func}))
265 printf STDERR "$func does not have a number assigned\n";
270 printf OUT " %s%-35s@%d\n",($NT)?"":"_",$func,$n;
281 open(IN,"<$name") || die "unable to open $name:$!\n";