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";
22 $do_ssl=1 if $_ eq "ssleay";
23 $do_ssl=1 if $_ eq "ssl";
24 $do_crypto=1 if $_ eq "libeay";
25 $do_crypto=1 if $_ eq "crypto";
26 $do_update=1 if $_ eq "update";
29 if (!$do_ssl && !$do_crypto)
31 print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 ]\n";
35 %ssl_list=&load_numbers($ssl_num);
37 %crypto_list=&load_numbers($crypto_num);
38 $max_crypto = $max_num;
42 $crypto ="crypto/crypto.h";
43 $crypto.=" crypto/des/des.h";
44 $crypto.=" crypto/idea/idea.h";
45 $crypto.=" crypto/rc4/rc4.h";
46 $crypto.=" crypto/rc5/rc5.h";
47 $crypto.=" crypto/rc2/rc2.h";
48 $crypto.=" crypto/bf/blowfish.h";
49 $crypto.=" crypto/cast/cast.h";
50 $crypto.=" crypto/md2/md2.h";
51 $crypto.=" crypto/md5/md5.h";
52 $crypto.=" crypto/mdc2/mdc2.h";
53 $crypto.=" crypto/sha/sha.h";
54 $crypto.=" crypto/ripemd/ripemd.h";
56 $crypto.=" crypto/bn/bn.h";
57 $crypto.=" crypto/rsa/rsa.h";
58 $crypto.=" crypto/dsa/dsa.h";
59 $crypto.=" crypto/dh/dh.h";
61 $crypto.=" crypto/stack/stack.h";
62 $crypto.=" crypto/buffer/buffer.h";
63 $crypto.=" crypto/bio/bio.h";
64 $crypto.=" crypto/lhash/lhash.h";
65 $crypto.=" crypto/conf/conf.h";
66 $crypto.=" crypto/txt_db/txt_db.h";
68 $crypto.=" crypto/evp/evp.h";
69 $crypto.=" crypto/objects/objects.h";
70 $crypto.=" crypto/pem/pem.h";
71 #$crypto.=" crypto/meth/meth.h";
72 $crypto.=" crypto/asn1/asn1.h";
73 $crypto.=" crypto/asn1/asn1_mac.h";
74 $crypto.=" crypto/err/err.h";
75 $crypto.=" crypto/pkcs7/pkcs7.h";
76 $crypto.=" crypto/pkcs12/pkcs12.h";
77 $crypto.=" crypto/x509/x509.h";
78 $crypto.=" crypto/x509/x509_vfy.h";
79 $crypto.=" crypto/x509v3/x509v3.h";
80 $crypto.=" crypto/rand/rand.h";
81 $crypto.=" crypto/hmac/hmac.h";
82 $crypto.=" crypto/comp/comp.h";
83 $crypto.=" crypto/tmdiff.h";
88 @ssl_func = &do_defs("SSLEAY", $ssl);
89 @crypto_func = &do_defs("LIBEAY", $crypto);
94 open(OUT, ">>$ssl_num");
95 &update_numbers(*OUT,"SSLEAY",*ssl_list,$max_ssl, @ssl_func);
100 open(OUT, ">>$crypto_num");
101 &update_numbers(*OUT,"LIBEAY",*crypto_list,$max_crypto, @crypto_func);
107 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func)
110 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func)
118 local($name,$files)=@_;
122 foreach $file (split(/\s+/,$files))
124 # print STDERR "reading $file\n";
125 open(IN,"<$file") || die "unable to open $file:$!\n";
131 while (($i=index($a,"/*")) >= 0)
134 last unless ($j >= 0);
135 $a=substr($a,0,$i).substr($a,$j+2);
138 foreach (split("\n",$a))
140 if (/^\#\s*ifndef (.*)/)
146 elsif (/^\#\s*if !defined\(([^\)]+)\)/)
152 elsif (/^\#\s*ifdef (.*)/)
158 elsif (/^\#\s*if defined(.*)/)
164 elsif (/^\#\s*endif/)
176 #printf STDERR "$_\n%2d %2d %2d %2d %2d $W32\n",
177 #$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'};
181 { $t=&do_extern($name,$_); }
182 elsif ( ($tag{'NOPROTO'} == 1) &&
183 ($tag{'FreeBSD'} != 1) &&
184 (($W32 && ($tag{'WIN16'} != 1)) ||
185 (!$W32 && ($tag{'WIN16'} != -1))) &&
186 ($tag{'PERL5'} != 1) &&
187 # ($tag{'_WINDLL'} != -1) &&
188 ((!$W32 && $tag{'_WINDLL'} != -1) ||
189 ($W32 && $tag{'_WINDLL'} != 1)) &&
190 ((($tag{'NO_FP_API'} != 1) && $W32) ||
191 (($tag{'NO_FP_API'} != -1) && !$W32)))
192 { $t=&do_line($name,$_); }
195 if (($t ne undef) && (!$done{$name,$t}))
199 #printf STDERR "one:$t\n" if $t =~ /BIO_/;
212 return(undef) if /^$/;
213 return(undef) if /^\s/;
214 #printf STDERR "two:$_\n" if $_ =~ /BIO_/;
215 if (/(CRYPTO_get_locking_callback)/)
217 elsif (/(CRYPTO_get_id_callback)/)
219 elsif (/(CRYPTO_get_add_lock_callback)/)
221 elsif (/(SSL_CTX_get_verify_callback)/)
223 elsif (/(SSL_get_info_callback)/)
225 elsif ((!$W32) && /(ERR_load_CRYPTO_strings)/)
226 { return("ERR_load_CRYPTOlib_strings"); }
227 elsif (!$W32 && /BIO_s_file/)
229 elsif (!$W32 && /BIO_new_file/)
231 elsif (!$W32 && /BIO_new_fp/)
233 elsif ($W32 && /BIO_s_file_internal/)
235 elsif ($W32 && /BIO_new_file_internal/)
237 elsif ($W32 && /BIO_new_fp_internal/)
239 elsif (/SSL_add_dir_cert_subjects_to_stack/)
241 elsif (!$NT && /BIO_s_log/)
248 #print STDERR "$1 : $_\n";
264 local(*OUT,$name,*nums,@functions)=@_;
274 ; Definition file for the DLL version of the $name library from OpenSSL
279 DESCRIPTION 'OpenSSL $name - http://www.openssl.org/'
286 CODE PRELOAD MOVEABLE
287 DATA PRELOAD MOVEABLE SINGLE
300 (@e)=grep(/^SSLeay/,@functions);
301 (@r)=grep(!/^SSLeay/,@functions);
302 @functions=((sort @e),(sort @r));
304 foreach $func (@functions)
306 if (!defined($nums{$func}))
308 printf STDERR "$func does not have a number assigned\n"
314 printf OUT " %s%-40s@%d\n",($W32)?"":"_",$func,$n;
327 open(IN,"<$name") || die "unable to open $name:$!\n";
335 $max_num = $a[1] if $a[1] > $max_num;
343 local(*OUT,$name,*nums,$start_num, @functions)=@_;
345 print STDERR "Updating $name\n";
346 foreach $func (@functions)
348 if (!defined($nums{$func}))
351 printf OUT "%s%-40s%d\n","",$func, ++$start_num;
355 print STDERR "$new_funcs New Functions added\n";
357 print STDERR "No New Functions Added\n";