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";
70 $crypto.=" crypto/comp/comp.h";
71 $crypto.=" crypto/tmdiff.h";
76 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,&do_defs("SSLEAY",$ssl))
79 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,&do_defs("LIBEAY",$crypto))
84 local($name,$files)=@_;
88 foreach $file (split(/\s+/,$files))
90 # print STDERR "reading $file\n";
91 open(IN,"<$file") || die "unable to open $file:$!\n";
97 while (($i=index($a,"/*")) >= 0)
100 break unless ($j >= 0);
101 $a=substr($a,0,$i).substr($a,$j+2);
104 foreach (split("\n",$a))
106 if (/^\#\s*ifndef (.*)/)
112 elsif (/^\#\s*if !defined\(([^\)]+)\)/)
118 elsif (/^\#\s*ifdef (.*)/)
124 elsif (/^\#\s*if defined(.*)/)
130 elsif (/^\#\s*endif/)
142 #printf STDERR "$_\n%2d %2d %2d %2d %2d $NT\n",
143 #$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'};
147 { $t=&do_extern($name,$_); }
148 elsif ( ($tag{'NOPROTO'} == 1) &&
149 ($tag{'FreeBSD'} != 1) &&
150 (($NT && ($tag{'WIN16'} != 1)) ||
151 (!$NT && ($tag{'WIN16'} != -1))) &&
152 ($tag{'PERL5'} != 1) &&
153 # ($tag{'_WINDLL'} != -1) &&
154 ((!$NT && $tag{'_WINDLL'} != -1) ||
155 ($NT && $tag{'_WINDLL'} != 1)) &&
156 ((($tag{'NO_FP_API'} != 1) && $NT) ||
157 (($tag{'NO_FP_API'} != -1) && !$NT)))
158 { $t=&do_line($name,$_); }
161 if (($t ne undef) && (!$done{$name,$t}))
165 #printf STDERR "one:$t\n" if $t =~ /BIO_/;
178 return(undef) if /^$/;
179 return(undef) if /^\s/;
180 #printf STDERR "two:$_\n" if $_ =~ /BIO_/;
181 if (/(CRYPTO_get_locking_callback)/)
183 elsif (/(CRYPTO_get_id_callback)/)
185 elsif (/(CRYPTO_get_add_lock_callback)/)
187 elsif (/(SSL_CTX_get_verify_callback)/)
189 elsif (/(SSL_get_info_callback)/)
191 elsif ((!$NT) && /(ERR_load_CRYPTO_strings)/)
192 { return("ERR_load_CRYPTOlib_strings"); }
193 elsif (!$NT && /BIO_s_file/)
195 elsif (!$NT && /BIO_new_file/)
197 elsif (!$NT && /BIO_new_fp/)
199 elsif ($NT && /BIO_s_file_internal/)
201 elsif ($NT && /BIO_new_file_internal/)
203 elsif ($NT && /BIO_new_fp_internal/)
223 local(*OUT,$name,*nums,@functions)=@_;
233 ; Definition file for the DDL version of the $name library from SSLeay
238 DESCRIPTION 'SSLeay $name - eay\@cryptsoft.com'
245 CODE PRELOAD MOVEABLE
246 DATA PRELOAD MOVEABLE SINGLE
259 (@e)=grep(/^SSLeay/,@functions);
260 (@r)=grep(!/^SSLeay/,@functions);
261 @functions=((sort @e),(sort @r));
263 foreach $func (@functions)
265 if (!defined($nums{$func}))
267 printf STDERR "$func does not have a number assigned\n";
272 printf OUT " %s%-35s@%d\n",($NT)?"":"_",$func,$n;
283 open(IN,"<$name") || die "unable to open $name:$!\n";