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/x509/x509.h";
77 $crypto.=" crypto/x509/x509_vfy.h";
78 $crypto.=" crypto/x509v3/x509v3.h";
79 $crypto.=" crypto/rand/rand.h";
80 $crypto.=" crypto/hmac/hmac.h";
81 $crypto.=" crypto/comp/comp.h";
82 $crypto.=" crypto/tmdiff.h";
87 @ssl_func = &do_defs("SSLEAY", $ssl);
88 @crypto_func = &do_defs("LIBEAY", $crypto);
93 open(OUT, ">>$ssl_num");
94 &update_numbers(*OUT,"SSLEAY",*ssl_list,$max_ssl, @ssl_func);
99 open(OUT, ">>$crypto_num");
100 &update_numbers(*OUT,"LIBEAY",*crypto_list,$max_crypto, @crypto_func);
106 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func)
109 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func)
117 local($name,$files)=@_;
121 foreach $file (split(/\s+/,$files))
123 # print STDERR "reading $file\n";
124 open(IN,"<$file") || die "unable to open $file:$!\n";
130 while (($i=index($a,"/*")) >= 0)
133 last unless ($j >= 0);
134 $a=substr($a,0,$i).substr($a,$j+2);
137 foreach (split("\n",$a))
139 if (/^\#\s*ifndef (.*)/)
145 elsif (/^\#\s*if !defined\(([^\)]+)\)/)
151 elsif (/^\#\s*ifdef (.*)/)
157 elsif (/^\#\s*if defined(.*)/)
163 elsif (/^\#\s*endif/)
175 #printf STDERR "$_\n%2d %2d %2d %2d %2d $W32\n",
176 #$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'};
180 { $t=&do_extern($name,$_); }
181 elsif ( ($tag{'NOPROTO'} == 1) &&
182 ($tag{'FreeBSD'} != 1) &&
183 (($W32 && ($tag{'WIN16'} != 1)) ||
184 (!$W32 && ($tag{'WIN16'} != -1))) &&
185 ($tag{'PERL5'} != 1) &&
186 # ($tag{'_WINDLL'} != -1) &&
187 ((!$W32 && $tag{'_WINDLL'} != -1) ||
188 ($W32 && $tag{'_WINDLL'} != 1)) &&
189 ((($tag{'NO_FP_API'} != 1) && $W32) ||
190 (($tag{'NO_FP_API'} != -1) && !$W32)))
191 { $t=&do_line($name,$_); }
194 if (($t ne undef) && (!$done{$name,$t}))
198 #printf STDERR "one:$t\n" if $t =~ /BIO_/;
211 return(undef) if /^$/;
212 return(undef) if /^\s/;
213 #printf STDERR "two:$_\n" if $_ =~ /BIO_/;
214 if (/(CRYPTO_get_locking_callback)/)
216 elsif (/(CRYPTO_get_id_callback)/)
218 elsif (/(CRYPTO_get_add_lock_callback)/)
220 elsif (/(SSL_CTX_get_verify_callback)/)
222 elsif (/(SSL_get_info_callback)/)
224 elsif ((!$W32) && /(ERR_load_CRYPTO_strings)/)
225 { return("ERR_load_CRYPTOlib_strings"); }
226 elsif (!$W32 && /BIO_s_file/)
228 elsif (!$W32 && /BIO_new_file/)
230 elsif (!$W32 && /BIO_new_fp/)
232 elsif ($W32 && /BIO_s_file_internal/)
234 elsif ($W32 && /BIO_new_file_internal/)
236 elsif ($W32 && /BIO_new_fp_internal/)
238 elsif (/SSL_add_dir_cert_subjects_to_stack/)
240 elsif (!$NT && /BIO_s_log/)
247 #print STDERR "$1 : $_\n";
263 local(*OUT,$name,*nums,@functions)=@_;
273 ; Definition file for the DLL version of the $name library from OpenSSL
278 DESCRIPTION 'OpenSSL $name - http://www.openssl.org/'
285 CODE PRELOAD MOVEABLE
286 DATA PRELOAD MOVEABLE SINGLE
299 (@e)=grep(/^SSLeay/,@functions);
300 (@r)=grep(!/^SSLeay/,@functions);
301 @functions=((sort @e),(sort @r));
303 foreach $func (@functions)
305 if (!defined($nums{$func}))
307 printf STDERR "$func does not have a number assigned\n"
313 printf OUT " %s%-40s@%d\n",($W32)?"":"_",$func,$n;
326 open(IN,"<$name") || die "unable to open $name:$!\n";
334 $max_num = $a[1] if $a[1] > $max_num;
342 local(*OUT,$name,*nums,$start_num, @functions)=@_;
344 print STDERR "Updating $name\n";
345 foreach $func (@functions)
347 if (!defined($nums{$func}))
350 printf OUT "%s%-40s%d\n","",$func, ++$start_num;
354 print STDERR "$new_funcs New Functions added\n";
356 print STDERR "No New Functions Added\n";