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/x509v3/x509v3.h";
69 $crypto.=" crypto/rand/rand.h";
70 $crypto.=" crypto/hmac/hmac.h";
71 $crypto.=" crypto/comp/comp.h";
72 $crypto.=" crypto/tmdiff.h";
77 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,&do_defs("SSLEAY",$ssl))
80 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,&do_defs("LIBEAY",$crypto))
85 local($name,$files)=@_;
89 foreach $file (split(/\s+/,$files))
91 # print STDERR "reading $file\n";
92 open(IN,"<$file") || die "unable to open $file:$!\n";
98 while (($i=index($a,"/*")) >= 0)
101 break unless ($j >= 0);
102 $a=substr($a,0,$i).substr($a,$j+2);
105 foreach (split("\n",$a))
107 if (/^\#\s*ifndef (.*)/)
113 elsif (/^\#\s*if !defined\(([^\)]+)\)/)
119 elsif (/^\#\s*ifdef (.*)/)
125 elsif (/^\#\s*if defined(.*)/)
131 elsif (/^\#\s*endif/)
143 #printf STDERR "$_\n%2d %2d %2d %2d %2d $NT\n",
144 #$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'};
148 { $t=&do_extern($name,$_); }
149 elsif ( ($tag{'NOPROTO'} == 1) &&
150 ($tag{'FreeBSD'} != 1) &&
151 (($NT && ($tag{'WIN16'} != 1)) ||
152 (!$NT && ($tag{'WIN16'} != -1))) &&
153 ($tag{'PERL5'} != 1) &&
154 # ($tag{'_WINDLL'} != -1) &&
155 ((!$NT && $tag{'_WINDLL'} != -1) ||
156 ($NT && $tag{'_WINDLL'} != 1)) &&
157 ((($tag{'NO_FP_API'} != 1) && $NT) ||
158 (($tag{'NO_FP_API'} != -1) && !$NT)))
159 { $t=&do_line($name,$_); }
162 if (($t ne undef) && (!$done{$name,$t}))
166 #printf STDERR "one:$t\n" if $t =~ /BIO_/;
179 return(undef) if /^$/;
180 return(undef) if /^\s/;
181 #printf STDERR "two:$_\n" if $_ =~ /BIO_/;
182 if (/(CRYPTO_get_locking_callback)/)
184 elsif (/(CRYPTO_get_id_callback)/)
186 elsif (/(CRYPTO_get_add_lock_callback)/)
188 elsif (/(SSL_CTX_get_verify_callback)/)
190 elsif (/(SSL_get_info_callback)/)
192 elsif ((!$NT) && /(ERR_load_CRYPTO_strings)/)
193 { return("ERR_load_CRYPTOlib_strings"); }
194 elsif (!$NT && /BIO_s_file/)
196 elsif (!$NT && /BIO_new_file/)
198 elsif (!$NT && /BIO_new_fp/)
200 elsif ($NT && /BIO_s_file_internal/)
202 elsif ($NT && /BIO_new_file_internal/)
204 elsif ($NT && /BIO_new_fp_internal/)
224 local(*OUT,$name,*nums,@functions)=@_;
234 ; Definition file for the DLL version of the $name library from OpenSSL
239 DESCRIPTION 'OpenSSL $name - http://www.openssl.org/'
246 CODE PRELOAD MOVEABLE
247 DATA PRELOAD MOVEABLE SINGLE
260 (@e)=grep(/^SSLeay/,@functions);
261 (@r)=grep(!/^SSLeay/,@functions);
262 @functions=((sort @e),(sort @r));
264 foreach $func (@functions)
266 if (!defined($nums{$func}))
268 printf STDERR "$func does not have a number assigned\n";
273 printf OUT " %s%-40s@%d\n",($NT)?"":"_",$func,$n;
284 open(IN,"<$name") || die "unable to open $name:$!\n";