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_ssl=1 if $_ eq "ssl";
19 $do_crypto=1 if $_ eq "libeay";
20 $do_crypto=1 if $_ eq "crypto";
21 $do_update=1 if $_ eq "update";
24 if (!$do_ssl && !$do_crypto)
26 print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 ]\n";
30 %ssl_list=&load_numbers($ssl_num);
32 %crypto_list=&load_numbers($crypto_num);
33 $max_crypto = $max_num;
37 $crypto ="crypto/crypto.h";
38 $crypto.=" crypto/des/des.h";
39 $crypto.=" crypto/idea/idea.h";
40 $crypto.=" crypto/rc4/rc4.h";
41 $crypto.=" crypto/rc5/rc5.h";
42 $crypto.=" crypto/rc2/rc2.h";
43 $crypto.=" crypto/bf/blowfish.h";
44 $crypto.=" crypto/cast/cast.h";
45 $crypto.=" crypto/md2/md2.h";
46 $crypto.=" crypto/md5/md5.h";
47 $crypto.=" crypto/mdc2/mdc2.h";
48 $crypto.=" crypto/sha/sha.h";
49 $crypto.=" crypto/ripemd/ripemd.h";
51 $crypto.=" crypto/bn/bn.h";
52 $crypto.=" crypto/rsa/rsa.h";
53 $crypto.=" crypto/dsa/dsa.h";
54 $crypto.=" crypto/dh/dh.h";
56 $crypto.=" crypto/stack/stack.h";
57 $crypto.=" crypto/buffer/buffer.h";
58 $crypto.=" crypto/bio/bio.h";
59 $crypto.=" crypto/lhash/lhash.h";
60 $crypto.=" crypto/conf/conf.h";
61 $crypto.=" crypto/txt_db/txt_db.h";
63 $crypto.=" crypto/evp/evp.h";
64 $crypto.=" crypto/objects/objects.h";
65 $crypto.=" crypto/pem/pem.h";
66 #$crypto.=" crypto/meth/meth.h";
67 $crypto.=" crypto/asn1/asn1.h";
68 $crypto.=" crypto/asn1/asn1_mac.h";
69 $crypto.=" crypto/err/err.h";
70 $crypto.=" crypto/pkcs7/pkcs7.h";
71 $crypto.=" crypto/x509/x509.h";
72 $crypto.=" crypto/x509/x509_vfy.h";
73 $crypto.=" crypto/x509v3/x509v3.h";
74 $crypto.=" crypto/rand/rand.h";
75 $crypto.=" crypto/hmac/hmac.h";
76 $crypto.=" crypto/comp/comp.h";
77 $crypto.=" crypto/tmdiff.h";
82 @ssl_func = &do_defs("SSLEAY", $ssl);
83 @crypto_func = &do_defs("LIBEAY", $crypto);
88 open(OUT, ">>$ssl_num");
89 &update_numbers(*OUT,"SSLEAY",*ssl_list,$max_ssl, @ssl_func);
94 open(OUT, ">>$crypto_num");
95 &update_numbers(*OUT,"LIBEAY",*crypto_list,$max_crypto, @crypto_func);
101 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func)
104 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func)
112 local($name,$files)=@_;
116 foreach $file (split(/\s+/,$files))
118 # print STDERR "reading $file\n";
119 open(IN,"<$file") || die "unable to open $file:$!\n";
125 while (($i=index($a,"/*")) >= 0)
128 last unless ($j >= 0);
129 $a=substr($a,0,$i).substr($a,$j+2);
132 foreach (split("\n",$a))
134 if (/^\#\s*ifndef (.*)/)
140 elsif (/^\#\s*if !defined\(([^\)]+)\)/)
146 elsif (/^\#\s*ifdef (.*)/)
152 elsif (/^\#\s*if defined(.*)/)
158 elsif (/^\#\s*endif/)
170 #printf STDERR "$_\n%2d %2d %2d %2d %2d $NT\n",
171 #$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'};
175 { $t=&do_extern($name,$_); }
176 elsif ( ($tag{'NOPROTO'} == 1) &&
177 ($tag{'FreeBSD'} != 1) &&
178 (($NT && ($tag{'WIN16'} != 1)) ||
179 (!$NT && ($tag{'WIN16'} != -1))) &&
180 ($tag{'PERL5'} != 1) &&
181 # ($tag{'_WINDLL'} != -1) &&
182 ((!$NT && $tag{'_WINDLL'} != -1) ||
183 ($NT && $tag{'_WINDLL'} != 1)) &&
184 ((($tag{'NO_FP_API'} != 1) && $NT) ||
185 (($tag{'NO_FP_API'} != -1) && !$NT)))
186 { $t=&do_line($name,$_); }
189 if (($t ne undef) && (!$done{$name,$t}))
193 #printf STDERR "one:$t\n" if $t =~ /BIO_/;
206 return(undef) if /^$/;
207 return(undef) if /^\s/;
208 #printf STDERR "two:$_\n" if $_ =~ /BIO_/;
209 if (/(CRYPTO_get_locking_callback)/)
211 elsif (/(CRYPTO_get_id_callback)/)
213 elsif (/(CRYPTO_get_add_lock_callback)/)
215 elsif (/(SSL_CTX_get_verify_callback)/)
217 elsif (/(SSL_get_info_callback)/)
219 elsif ((!$NT) && /(ERR_load_CRYPTO_strings)/)
220 { return("ERR_load_CRYPTOlib_strings"); }
221 elsif (!$NT && /BIO_s_file/)
223 elsif (!$NT && /BIO_new_file/)
225 elsif (!$NT && /BIO_new_fp/)
227 elsif ($NT && /BIO_s_file_internal/)
229 elsif ($NT && /BIO_new_file_internal/)
231 elsif ($NT && /BIO_new_fp_internal/)
251 local(*OUT,$name,*nums,@functions)=@_;
261 ; Definition file for the DLL version of the $name library from OpenSSL
266 DESCRIPTION 'OpenSSL $name - http://www.openssl.org/'
273 CODE PRELOAD MOVEABLE
274 DATA PRELOAD MOVEABLE SINGLE
287 (@e)=grep(/^SSLeay/,@functions);
288 (@r)=grep(!/^SSLeay/,@functions);
289 @functions=((sort @e),(sort @r));
291 foreach $func (@functions)
293 if (!defined($nums{$func}))
295 printf STDERR "$func does not have a number assigned\n"
301 printf OUT " %s%-40s@%d\n",($NT)?"":"_",$func,$n;
314 open(IN,"<$name") || die "unable to open $name:$!\n";
322 $max_num = $a[1] if $a[1] > $max_num;
330 local(*OUT,$name,*nums,$start_num, @functions)=@_;
332 print STDERR "Updating $name\n";
333 foreach $func (@functions)
335 if (!defined($nums{$func}))
338 printf OUT "%s%-40s%d\n","",$func, ++$start_num;
342 print STDERR "$new_funcs New Functions added\n";
344 print STDERR "No New Functions Added\n";